|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.RemoteFileDesc
A reference to a single file on a remote machine. In this respect RemoteFileDesc is similar to a URL, but it contains Gnutella- specific data as well, such as the server's 16-byte GUID.
This class is serialized to disk as part of the downloads.dat file. Hence you must be very careful before making any changes. Deleting or changing the types of fields is DISALLOWED. Adding field a F is acceptable as long as the readObject() method of this initializes F to a reasonable value when reading from older files where the fields are not present. This is exactly what we do with _urns and _browseHostEnabled. On the other hand, older version of LimeWire will simply discard any extra fields F if reading from a newer serialized file.
Constructor Summary | |
RemoteFileDesc(RemoteFileDesc rfd,
Endpoint ep)
Constructs a new RemoteFileDesc exactly like the other one, but with a different remote host. |
|
RemoteFileDesc(java.lang.String host,
int port,
long index,
java.lang.String filename,
int size,
byte[] clientGUID,
int speed,
boolean chat,
int quality,
boolean browseHost,
LimeXMLDocument xmlDoc,
java.util.Set urns,
boolean replyToMulticast,
boolean firewalled,
java.lang.String vendor,
long timestamp,
java.util.Set proxies)
Constructs a new RemoteFileDesc with metadata. |
Method Summary | |
boolean |
browseHostEnabled()
|
boolean |
chatEnabled()
|
boolean |
equals(java.lang.Object o)
Overrides Object.equals to return instance equality based on the equality of all RemoteFileDesc fields. |
java.util.List |
getAvailableRanges()
Accessor for the available ranges. |
byte[] |
getClientGUID()
Accessor for the client guid for this file, which can be null. |
int |
getFailedCount()
Returns the current failed count. |
java.lang.String |
getFileName()
Accessor for the file name for this file, which can be null. |
java.lang.String |
getHost()
Accessor for the host ip with this file. |
long |
getIndex()
Accessor for the index this file, which can be null. |
int |
getPort()
Accessor for the port of the host with this file. |
java.util.Set |
getPushProxies()
Accessor for the Set of PushProxyInterfaces for this file -- can be empty, but is guaranteed to be non-null. |
int |
getQuality()
Returns the "quality" of the remote file in terms of firewalled status, whether or not the remote host has open slots, etc. |
URN |
getSHA1Urn()
Accessor for the SHA1 URN for this RemoteFileDesc. |
int |
getSize()
Accessor for the size in bytes of this file. |
int |
getSpeed()
Accessor for the speed of the host with this file, which can be null. |
java.net.URL |
getUrl()
Returns an URL instance for this RemoteFileDesc. |
java.util.Set |
getUrns()
Accessor for the Set of URNs for this RemoteFileDesc. |
java.lang.String |
getVendor()
|
LimeXMLDocument |
getXMLDoc()
Returns the LimeXMLDocument for this RemoteFileDesc, which can be null. |
void |
incrementFailedCount()
Increments the failed count by one. |
boolean |
isAltLocCapable()
|
boolean |
isFromAlternateLocation()
Determines whether or not this RemoteFileDesc was created from an alternate location. |
boolean |
isHTTP11()
Accessor for HTTP11. |
boolean |
isPartialSource()
Returns true if this is a partial source |
boolean |
isPrivate()
Determines whether or not this host reported a private address. |
boolean |
isReplyToMulticast()
Determines whether or not this RFD was a reply to a multicast query. |
void |
resetFailedCount()
Resets the failed count back to zero. |
void |
setAvailableRanges(java.util.List availableRanges)
Mutator for the available ranges. |
void |
setHTTP11(boolean http11)
Mutator for HTTP11. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public RemoteFileDesc(RemoteFileDesc rfd, Endpoint ep)
public RemoteFileDesc(java.lang.String host, int port, long index, java.lang.String filename, int size, byte[] clientGUID, int speed, boolean chat, int quality, boolean browseHost, LimeXMLDocument xmlDoc, java.util.Set urns, boolean replyToMulticast, boolean firewalled, java.lang.String vendor, long timestamp, java.util.Set proxies)
host
- the host's ipport
- the host's portindex
- the index of the file that the client sentfilename
- the name of the fileclientGUID
- the unique identifier of the clientspeed
- the speed of the connectionchat
- true if the location is chattablequality
- the quality of the connection, where 0 is the
worst and 3 is the best. (This is the same system as in the
GUI but on a 0 to N-1 scale.)browseHost
- specifies whether or not the remote host supports
browse hostxmlDoc
- the LimeXMLDocument for the responseurns
- the Set of URNs for the filereplyToMulticast
- true if its from a reply to a multicast query
IllegalArgumentException
- if any of the arguments are
not valid
NullPointerException
- if the host argument is
null or if the file name is nullMethod Detail |
public boolean isHTTP11()
public void setHTTP11(boolean http11)
public boolean isPartialSource()
public java.util.List getAvailableRanges()
public void setAvailableRanges(java.util.List availableRanges)
public int getFailedCount()
public void incrementFailedCount()
public void resetFailedCount()
public boolean isFromAlternateLocation()
public final java.lang.String getHost()
public final int getPort()
public final long getIndex()
public final int getSize()
public final java.lang.String getFileName()
public final byte[] getClientGUID()
public final int getSpeed()
public final java.lang.String getVendor()
public final boolean chatEnabled()
public final boolean browseHostEnabled()
public final int getQuality()
public final LimeXMLDocument getXMLDoc()
public final java.util.Set getUrns()
public final URN getSHA1Urn()
public java.net.URL getUrl()
public final boolean isReplyToMulticast()
public final boolean isPrivate()
public final java.util.Set getPushProxies()
public final boolean isAltLocCapable()
public boolean equals(java.lang.Object o)
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |