LimeWire Consolidated API

com.limegroup.gnutella
Class PushEndpointImpl

java.lang.Object
  extended by com.limegroup.gnutella.AbstractPushEndpoint
      extended by com.limegroup.gnutella.PushEndpointImpl
All Implemented Interfaces:
HTTPHeaderValue, PushEndpoint, Address, IpPort

public class PushEndpointImpl
extends AbstractPushEndpoint


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.limewire.io.IpPort
IpPort.IpComparator, IpPort.IpPortComparator
 
Nested classes/interfaces inherited from interface org.limewire.io.Address
Address.EventType
 
Field Summary
 
Fields inherited from interface com.limegroup.gnutella.PushEndpoint
FEATURES_MASK, FWT_VERSION_MASK, HEADER_SIZE, MAX_PROXIES, PLAIN, PPTLS_BINARY, PPTLS_HTTP, PROXY_SIZE, SIZE_MASK
 
Fields inherited from interface org.limewire.io.IpPort
COMPARATOR, EMPTY_LIST, EMPTY_SET, IP_COMPARATOR
 
Constructor Summary
PushEndpointImpl(byte[] guid, Set<? extends IpPort> proxies, byte features, int fwtVersion, IpPort addr, PushEndpointCache pushEndpointCache, NetworkInstanceUtils networkInstanceUtils)
           
 
Method Summary
 PushEndpoint createClone()
          Can return null if no valid push endpoint can be cloned.
 String getAddress()
          Implements the IpPort interface, returning a bogus ip if we don't know it.
 String getAddressDescription()
           
 byte[] getClientGUID()
          Returns the GUID of the client that can be reached through the pushproxies.
 byte getFeatures()
           
 int getFWTVersion()
           
 InetAddress getInetAddress()
          Assessor for the InetAddress for this host.
 InetSocketAddress getInetSocketAddress()
          Accessor for the InetSocketAddress that can describe the IP & Port.
 int getPort()
          Implements the IpPort interface, returning a bogus port if we don't know it
 Set<? extends IpPort> getProxies()
           
 IpPort getValidExternalAddress()
          Returns an IpPort representing the valid external address of this push endpoint if it is known, otherwise null.
 boolean isLocal()
           
 void updateProxies(boolean good)
          Updates either the PushEndpoint or the GUID_PROXY_MAP to ensure that GUID_PROXY_MAP has a reference to all live PE GUIDs and all live PE's reference the same GUID object as in GUID_PROXY_MAP.
 
Methods inherited from class com.limegroup.gnutella.AbstractPushEndpoint
equals, getSizeBytes, hashCode, httpStringValue, toBytes, toBytes, toBytes, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PushEndpointImpl

public PushEndpointImpl(byte[] guid,
                        Set<? extends IpPort> proxies,
                        byte features,
                        int fwtVersion,
                        IpPort addr,
                        PushEndpointCache pushEndpointCache,
                        NetworkInstanceUtils networkInstanceUtils)
Method Detail

getValidExternalAddress

public IpPort getValidExternalAddress()
Description copied from interface: PushEndpoint
Returns an IpPort representing the valid external address of this push endpoint if it is known, otherwise null.

Returns:
an IpPort representing our valid external address, or null if we don't have such.

getClientGUID

public byte[] getClientGUID()
Description copied from interface: PushEndpoint
Returns the GUID of the client that can be reached through the pushproxies.


getProxies

public Set<? extends IpPort> getProxies()
Returns:
a view of the current set of proxies, never returns null

getFWTVersion

public int getFWTVersion()
Returns:
which version of F2F transfers this PE supports. This always returns the most current version we know the PE supports unless it has never been put in the map.

getFeatures

public byte getFeatures()
Returns:
the various features this PE reports. This always returns the most current features, or the ones it was created with if they have never been updated.

getAddress

public String getAddress()
Implements the IpPort interface, returning a bogus ip if we don't know it.

Returns:
the external address if known otherwise RemoteFileDesc.BOGUS_IP

getInetAddress

public InetAddress getInetAddress()
Description copied from interface: IpPort
Assessor for the InetAddress for this host.

Returns:
the InetAddress for this host

getPort

public int getPort()
Implements the IpPort interface, returning a bogus port if we don't know it

Returns:
the port of the external address if known otherwise 6346

getInetSocketAddress

public InetSocketAddress getInetSocketAddress()
Description copied from interface: IpPort
Accessor for the InetSocketAddress that can describe the IP & Port.

Returns:
the InetSocketAddress of this host.

getAddressDescription

public String getAddressDescription()

isLocal

public boolean isLocal()
Returns:
true if this is the push endpoint for the local node

updateProxies

public void updateProxies(boolean good)
Description copied from interface: PushEndpoint
Updates either the PushEndpoint or the GUID_PROXY_MAP to ensure that GUID_PROXY_MAP has a reference to all live PE GUIDs and all live PE's reference the same GUID object as in GUID_PROXY_MAP. If this method is not called, the PE will know only about the set of proxies the remote host had when it was created. Otherwise it will point to the most recent known set.


createClone

public PushEndpoint createClone()
Description copied from interface: PushEndpoint
Can return null if no valid push endpoint can be cloned.


LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.