|
||||||||||
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
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 for two reasons:
Field Summary |
Fields inherited from class com.limegroup.gnutella.Endpoint |
processed |
Constructor Summary | |
ExtendedEndpoint(java.lang.String host,
int port)
Creates a new ExtendedEndpoint without extended uptime information. |
|
ExtendedEndpoint(java.lang.String host,
int port,
int dailyUptime)
Creates a new ExtendedEndpoint with uptime data read from a ping reply. |
Method Summary | |
boolean |
equals(java.lang.Object other)
Endpoints are equal if their hostnames and ports are. |
java.util.Iterator |
getConnectionFailures()
Returns the last few times we successfully connected to this. |
java.util.Iterator |
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. |
long |
getTimeRecorded()
Returns the system time (in milliseconds) when this' was created. |
protected long |
now()
Returns the current system time in milliseconds. |
static java.util.Comparator |
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(java.lang.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 |
write(java.io.Writer out)
Writes this' state to a single line of out. |
Methods inherited from class com.limegroup.gnutella.Endpoint |
clone, compareTo, getConnectivity, getFiles, getHostBytes, getHostname, getKbytes, getPort, getWeight, hashCode, isPrivateAddress, isSameSubnet, normalizeFilesAndSize, setConnectivity, setFiles, setHostname, setKbytes, setWeight, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ExtendedEndpoint(java.lang.String host, int port, int dailyUptime)
public ExtendedEndpoint(java.lang.String host, int port)
Method Detail |
public long getTimeRecorded()
public int getDailyUptime()
public void recordConnectionSuccess()
public void recordConnectionFailure()
public java.util.Iterator getConnectionSuccesses()
public java.util.Iterator getConnectionFailures()
protected long now()
public void write(java.io.Writer out) throws java.io.IOException
java.io.IOException
- some problem writing to outread
public static ExtendedEndpoint read(java.lang.String line) throws java.text.ParseException
line
- a single line read from the stream
java.io.IOException
- problem reading from in, e.g., EOF reached
prematurely
java.text.ParseException
- data not in proper format. Does NOT
necessarily set the offset of the exception properly.write
public static java.util.Comparator priorityComparator()
public boolean equals(java.lang.Object other)
Endpoint
equals
in class Endpoint
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |