LimeWire Consolidated API

com.limegroup.gnutella
Class SelfEndpoint

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

public class SelfEndpoint
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
 
Method Summary
 PushEndpoint createClone()
          Can return null if no valid push endpoint can be cloned.
 String getAddress()
          Our address is our external address if it is valid and external.
 String getAddressDescription()
           
 byte[] getClientGUID()
          Returns the GUID of the client that can be reached through the pushproxies.
 byte getFeatures()
          we always have the same features
 int getFWTVersion()
          we support the same FWT version if we support FWT at all
 InetAddress getInetAddress()
          Assessor for the InetAddress for this host.
 InetSocketAddress getInetSocketAddress()
          Accessor for the InetSocketAddress that can describe the IP & Port.
 int getPort()
          Our port is our external port
 Set<? extends IpPort> getProxies()
          delegate the call to connection manager
 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
 

Method Detail

getProxies

public Set<? extends IpPort> getProxies()
delegate the call to connection manager

Returns:
a view of the current set of proxies, never returns null

getFeatures

public byte getFeatures()
we always have the same features

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.

getFWTVersion

public int getFWTVersion()
we support the same FWT version if we support FWT at all

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.

getAddress

public String getAddress()
Our address is our external address if it is valid and external. Otherwise we return the BOGUS_IP

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:
our external address. First converts it to string since 1.3 jvms does not support getting it from byte[].

getPort

public int getPort()
Our port is our external port

Returns:
the port this host is listening on

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.


isLocal

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

createClone

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


getClientGUID

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


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.


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()

LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.