|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.limegroup.gnutella.Endpoint
com.limegroup.gnutella.ExtendedEndpoint
public class ExtendedEndpoint
An endpoint with additional history information used to prioritize HostCatcher's permanent list:
"18.239.0.144:6347,3043,1039939393,529333939;3343434;23433,3934223"
This "poor man's serialization" is used to help HostCatcher implement the
reading and writing of gnutella.net files.ExtendedEndpoint does not override the compareTo method because it creates confusion between compareTo and equals. For comparing by priority, users should use the return value of priorityComparator()
| 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 | |
|---|---|
static String |
EOL
We've always used "\n" for the record separator in our gnutella.net files, even on systems that normally use "\r\n" for end-of-line. |
| Fields inherited from interface org.limewire.io.Connectable |
|---|
COMPARATOR, EMPTY_LIST, EMPTY_SET |
| Fields inherited from interface org.limewire.io.IpPort |
|---|
IP_COMPARATOR |
| Constructor Summary | |
|---|---|
ExtendedEndpoint(InetAddress addr,
int port)
|
|
ExtendedEndpoint(InetSocketAddress socketAddress)
Creates an endpoint from a inet socket address. |
|
ExtendedEndpoint(String host,
int port)
Creates a new ExtendedEndpoint without extended uptime information. |
|
ExtendedEndpoint(String host,
int port,
int dailyUptime)
Creates a new ExtendedEndpoint with uptime data read from a ping reply. |
|
ExtendedEndpoint(String host,
int port,
int dailyUptime,
long timeRecorded,
boolean strict)
Creates a new ExtendedEndpoint using data read from a file. |
|
ExtendedEndpoint(String host,
int port,
String locale)
creates a new ExtendedEndpoint with the specified locale |
|
| Method Summary | |
|---|---|
void |
decrementUDPHostCacheFailure()
Decrements the failures for this UDP Host Cache. |
String |
getClientLocale()
accessor for the locale of this endpoint |
Iterator<Long> |
getConnectionFailures()
Returns the last few times we successfully connected to this. |
Iterator<Long> |
getConnectionSuccesses()
Returns the last few times we successfully connected to this. |
int |
getDailyUptime()
Returns the average daily uptime (in seconds per day) reported in this' pong. |
DHTManager.DHTMode |
getDHTMode()
|
int |
getDHTVersion()
|
long |
getTimeRecorded()
Returns the system time (in milliseconds) when this was created. |
int |
getUDPHostCacheFailures()
Determines how many failures this UDP host cache had. |
boolean |
isTLSCapable()
A getter for supporting TLS. |
boolean |
isUDPHostCache()
Determines if this is an ExtendedEndpoint for a UDP Host Cache. |
protected long |
now()
Returns the current system time in milliseconds. |
static Comparator<ExtendedEndpoint> |
priorityComparator()
Returns a Comparator that compares ExtendedEndpoint's by priority, where ExtendedEndpoint's with higher priority are more likely to be available. |
static ExtendedEndpoint |
read(String line)
Parses a new ExtendedEndpoint. |
void |
recordConnectionFailure()
Records that we just failed to connect to this. |
void |
recordConnectionSuccess()
Records that we just successfully connected to this. |
void |
recordUDPHostCacheFailure()
Records a UDP Host Cache failure. |
void |
recordUDPHostCacheSuccess()
Records a UDP Host Cache success. |
void |
setClientLocale(String l)
set the locale |
void |
setDHTMode(DHTManager.DHTMode mode)
|
void |
setDHTVersion(int dhtVersion)
|
void |
setTLSCapable(boolean capable)
A setter for supporting TLS. |
ExtendedEndpoint |
setUDPHostCache(boolean cache)
Sets if this a UDP host cache endpoint. |
boolean |
supportsDHT()
|
void |
write(Writer out)
Writes this' state to a single line of out. |
| Methods inherited from class com.limegroup.gnutella.Endpoint |
|---|
clone, equals, getAddress, getAddressDescription, getFiles, getHostBytes, getInetAddress, getInetSocketAddress, getKbytes, getPort, hashCode, isSameSubnet, normalizeFilesAndSize, setFiles, setHostname, setKbytes, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String EOL
| Constructor Detail |
|---|
public ExtendedEndpoint(String host,
int port,
int dailyUptime)
public ExtendedEndpoint(String host,
int port)
public ExtendedEndpoint(InetAddress addr,
int port)
public ExtendedEndpoint(InetSocketAddress socketAddress)
public ExtendedEndpoint(String host,
int port,
int dailyUptime,
long timeRecorded,
boolean strict)
public ExtendedEndpoint(String host,
int port,
String locale)
| Method Detail |
|---|
public long getTimeRecorded()
public int getDailyUptime()
public void setTLSCapable(boolean capable)
public boolean isTLSCapable()
isTLSCapable in interface ConnectableisTLSCapable in class Endpointpublic void recordConnectionSuccess()
public void recordConnectionFailure()
public Iterator<Long> getConnectionSuccesses()
public Iterator<Long> getConnectionFailures()
public String getClientLocale()
public void setClientLocale(String l)
public void setDHTVersion(int dhtVersion)
public boolean supportsDHT()
public void setDHTMode(DHTManager.DHTMode mode)
public DHTManager.DHTMode getDHTMode()
public int getDHTVersion()
public boolean isUDPHostCache()
isUDPHostCache in class Endpointpublic void recordUDPHostCacheFailure()
public void decrementUDPHostCacheFailure()
public void recordUDPHostCacheSuccess()
public int getUDPHostCacheFailures()
public ExtendedEndpoint setUDPHostCache(boolean cache)
protected long now()
public void write(Writer out)
throws IOException
IOException - some problem writing to outread
public static ExtendedEndpoint read(String line)
throws ParseException
line - a single line read from the stream
IOException - problem reading from in, e.g., EOF reached
prematurely
ParseException - data not in proper format. Does NOT
necessarily set the offset of the exception properly.writepublic static Comparator<ExtendedEndpoint> priorityComparator()
|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||