LimeWire Consolidated API

com.limegroup.gnutella
Interface Response


public interface Response

A single result from a query reply message. (In hindsight, "Result" would have been a better name.) Besides basic file information, responses can include metadata. Response was originally intended to be immutable, but it currently includes mutator methods for metadata; these will be removed in the future.


Method Summary
 long getCreateTime()
          Returns the create time.
 LimeXMLDocument getDocument()
          Returns this' metadata or null if there is no meta data for this response.
 byte[] getExtBytes()
           
 int getIncomingLength()
           
 long getIndex()
          Returns the index for the file stored in this Response instance.
 Set<? extends IpPort> getLocations()
          Returns an immutable Set of Endpoint that contain the same file described in this Response.
 String getName()
          Returns the name of the file for this response.
 IntervalSet getRanges()
           
 long getSize()
          Returns the size of the file for this Response instance (in bytes).
 Set<URN> getUrns()
          Returns an immutable Set of URN instances for this Response.
 boolean isMetaFile()
           
 boolean isVerified()
           
 void setDocument(LimeXMLDocument doc)
          Sets this' metadata.
 RemoteFileDesc toRemoteFileDesc(QueryReply queryReply, Address address, RemoteFileDescFactory remoteFileDescFactory, PushEndpointFactory pushEndpointFactory)
          Returns this Response as a RemoteFileDesc.
 void writeToStream(OutputStream os)
          Like writeToArray(), but writes to an OutputStream.
 

Method Detail

writeToStream

void writeToStream(OutputStream os)
                   throws IOException
Like writeToArray(), but writes to an OutputStream.

Throws:
IOException

setDocument

void setDocument(LimeXMLDocument doc)
Sets this' metadata.

Parameters:
doc - the parsed XML metadata

getIncomingLength

int getIncomingLength()

getIndex

long getIndex()
Returns the index for the file stored in this Response instance.

Returns:
the index for the file stored in this Response instance

getSize

long getSize()
Returns the size of the file for this Response instance (in bytes).

Returns:
the size of the file for this Response instance (in bytes)

getName

String getName()
Returns the name of the file for this response. This is guaranteed to be non-null, but it could be the empty string.

Returns:
the name of the file for this response

getDocument

LimeXMLDocument getDocument()
Returns this' metadata or null if there is no meta data for this response.


getUrns

Set<URN> getUrns()
Returns an immutable Set of URN instances for this Response.

Returns:
an immutable Set of URN instances for this Response, guaranteed to be non-null, although the set could be empty

getLocations

Set<? extends IpPort> getLocations()
Returns an immutable Set of Endpoint that contain the same file described in this Response.

Returns:
an immutable Set of Endpoint that contain the same file described in this Response, guaranteed to be non-null, although the set could be empty

getCreateTime

long getCreateTime()
Returns the create time.


isMetaFile

boolean isMetaFile()

getExtBytes

byte[] getExtBytes()

getRanges

IntervalSet getRanges()

isVerified

boolean isVerified()

toRemoteFileDesc

RemoteFileDesc toRemoteFileDesc(QueryReply queryReply,
                                Address address,
                                RemoteFileDescFactory remoteFileDescFactory,
                                PushEndpointFactory pushEndpointFactory)
                                throws UnknownHostException
Returns this Response as a RemoteFileDesc.

Parameters:
address - can be null, if not will be used for creating RemoteFileDesc otherwise address will be constructed from queryReply
Throws:
UnknownHostException

LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.