LimeWire Consolidated API

com.limegroup.gnutella.messages
Interface QueryReplyFactory

All Known Implementing Classes:
QueryReplyFactoryImpl

public interface QueryReplyFactory


Method Summary
 QueryReply createFromNetwork(byte[] guid, byte ttl, byte hops, byte[] payload)
          Creates a new query reply with data read from the network.
 QueryReply createFromNetwork(byte[] guid, byte ttl, byte hops, byte[] payload, Message.Network network)
           
 QueryReply createQueryReply(byte[] guid, byte ttl, int port, byte[] ip, long speed, Response[] responses, byte[] clientGUID, boolean isMulticastReply)
          Creates a new query reply.
 QueryReply createQueryReply(byte[] guid, byte ttl, int port, byte[] ip, long speed, Response[] responses, byte[] clientGUID, boolean needsPush, boolean isBusy, boolean finishedUpload, boolean measuredSpeed, boolean supportsChat, boolean isMulticastReply)
          Creates a new QueryReply with a BearShare 2.2.0-style QHD.
 QueryReply createQueryReply(byte[] guid, byte ttl, int port, byte[] ip, long speed, Response[] responses, byte[] clientGUID, byte[] xmlBytes, boolean needsPush, boolean isBusy, boolean finishedUpload, boolean measuredSpeed, boolean supportsChat, boolean isMulticastReply)
          Creates a new QueryReply with a BearShare 2.2.0-style QHD.
 QueryReply createQueryReply(byte[] guid, byte ttl, int port, byte[] ip, long speed, Response[] responses, byte[] clientGUID, byte[] xmlBytes, boolean needsPush, boolean isBusy, boolean finishedUpload, boolean measuredSpeed, boolean supportsChat, boolean isMulticastReply, boolean supportsFWTransfer, Set<? extends IpPort> proxies)
          Creates a new QueryReply with a BearShare 2.2.0-style QHD.
 QueryReply createQueryReply(byte[] guid, byte ttl, int port, byte[] ip, long speed, Response[] responses, byte[] clientGUID, byte[] xmlBytes, boolean needsPush, boolean isBusy, boolean finishedUpload, boolean measuredSpeed, boolean supportsChat, boolean isMulticastReply, boolean supportsFWTransfer, Set<? extends IpPort> proxies, SecurityToken securityToken)
          Creates a new QueryReply with a BearShare 2.2.0-style QHD.
 QueryReply createQueryReply(byte[] guid, byte ttl, int port, byte[] ip, long speed, Response[] responses, byte[] clientGUID, byte[] xmlBytes, boolean needsPush, boolean isBusy, boolean finishedUpload, boolean measuredSpeed, boolean supportsChat, boolean isMulticastReply, Set<? extends IpPort> proxies)
          Creates a new QueryReply with a BearShare 2.2.0-style QHD.
 QueryReply createQueryReply(byte[] guid, byte ttl, int port, byte[] ip, long speed, Response[] responses, byte[] clientGUID, byte[] xmlBytes, boolean needsPush, boolean isBusy, boolean finishedUpload, boolean measuredSpeed, boolean supportsChat, boolean isMulticastReply, Set<? extends IpPort> proxies, SecurityToken securityToken)
          Creates a new QueryReply with a BearShare 2.2.0-style QHD.
 QueryReply createQueryReply(byte[] guid, QueryReply reply)
          Copy constructor.
 QueryReply createWithNewAddress(byte[] address, QueryReply original)
          Copy constructor.
 QueryReply createWithReturnPathInfo(QueryReply original, IpPort me, IpPort source)
          Copy constructor, appending information about the return path.
 

Method Detail

createQueryReply

QueryReply createQueryReply(byte[] guid,
                            byte ttl,
                            int port,
                            byte[] ip,
                            long speed,
                            Response[] responses,
                            byte[] clientGUID,
                            boolean isMulticastReply)
Creates a new query reply. The number of responses is responses.length The Browse Host GGEP extension is ON by default.


createQueryReply

QueryReply createQueryReply(byte[] guid,
                            byte ttl,
                            int port,
                            byte[] ip,
                            long speed,
                            Response[] responses,
                            byte[] clientGUID,
                            boolean needsPush,
                            boolean isBusy,
                            boolean finishedUpload,
                            boolean measuredSpeed,
                            boolean supportsChat,
                            boolean isMulticastReply)
Creates a new QueryReply with a BearShare 2.2.0-style QHD. The QHD with the LIME vendor code and the given busy and push flags. Note that this constructor has no support for undefined push or busy bits. The Browse Host GGEP extension is ON by default.

Parameters:
needsPush - true iff this is firewalled and the downloader should attempt a push without trying a normal download.
isBusy - true iff this server is busy, i.e., has no more upload slots.
finishedUpload - true iff this server has successfully finished an upload
measuredSpeed - true iff speed is measured, not as reported by the user
supportsChat - true iff the host currently allows chatting.

createQueryReply

QueryReply createQueryReply(byte[] guid,
                            byte ttl,
                            int port,
                            byte[] ip,
                            long speed,
                            Response[] responses,
                            byte[] clientGUID,
                            byte[] xmlBytes,
                            boolean needsPush,
                            boolean isBusy,
                            boolean finishedUpload,
                            boolean measuredSpeed,
                            boolean supportsChat,
                            boolean isMulticastReply)
Creates a new QueryReply with a BearShare 2.2.0-style QHD. The QHD with the LIME vendor code and the given busy and push flags. Note that this constructor has no support for undefined push or busy bits. The Browse Host GGEP extension is ON by default.

Parameters:
needsPush - true iff this is firewalled and the downloader should attempt a push without trying a normal download.
isBusy - true iff this server is busy, i.e., has no more upload slots
finishedUpload - true iff this server has successfully finished an upload
measuredSpeed - true iff speed is measured, not as reported by the user
xmlBytes - The (non-null) byte[] containing aggregated and indexed information regarding file metadata. In terms of byte-size, this should not be bigger than 65535 bytes. Anything larger will result in an Exception being throw. This String is assumed to consist of compressed data.
supportsChat - true iff the host currently allows chatting.
Throws:
IllegalArgumentException - Thrown if xmlBytes.length > XML_MAX_SIZE

createQueryReply

QueryReply createQueryReply(byte[] guid,
                            byte ttl,
                            int port,
                            byte[] ip,
                            long speed,
                            Response[] responses,
                            byte[] clientGUID,
                            byte[] xmlBytes,
                            boolean needsPush,
                            boolean isBusy,
                            boolean finishedUpload,
                            boolean measuredSpeed,
                            boolean supportsChat,
                            boolean isMulticastReply,
                            Set<? extends IpPort> proxies)
Creates a new QueryReply with a BearShare 2.2.0-style QHD. The QHD with the LIME vendor code and the given busy and push flags. Note that this constructor has no support for undefined push or busy bits. The Browse Host GGEP extension is ON by default.

Parameters:
needsPush - true iff this is firewalled and the downloader should attempt a push without trying a normal download.
isBusy - true iff this server is busy, i.e., has no more upload slots
finishedUpload - true iff this server has successfully finished an upload
measuredSpeed - true iff speed is measured, not as reported by the user
xmlBytes - The (non-null) byte[] containing aggregated and indexed information regarding file metadata. In terms of byte-size, this should not be bigger than 65535 bytes. Anything larger will result in an Exception being throw. This String is assumed to consist of compressed data.
supportsChat - true iff the host currently allows chatting.
proxies - an array of PushProxy interfaces. will be included in the replies GGEP extension.
Throws:
IllegalArgumentException - Thrown if xmlBytes.length > XML_MAX_SIZE

createQueryReply

QueryReply createQueryReply(byte[] guid,
                            byte ttl,
                            int port,
                            byte[] ip,
                            long speed,
                            Response[] responses,
                            byte[] clientGUID,
                            byte[] xmlBytes,
                            boolean needsPush,
                            boolean isBusy,
                            boolean finishedUpload,
                            boolean measuredSpeed,
                            boolean supportsChat,
                            boolean isMulticastReply,
                            Set<? extends IpPort> proxies,
                            SecurityToken securityToken)
Creates a new QueryReply with a BearShare 2.2.0-style QHD. The QHD with the LIME vendor code and the given busy and push flags. Note that this constructor has no support for undefined push or busy bits. The Browse Host GGEP extension is ON by default.

Parameters:
needsPush - true iff this is firewalled and the downloader should attempt a push without trying a normal download.
isBusy - true iff this server is busy, i.e., has no more upload slots
finishedUpload - true iff this server has successfully finished an upload
measuredSpeed - true iff speed is measured, not as reported by the user
xmlBytes - The (non-null) byte[] containing aggregated and indexed information regarding file metadata. In terms of byte-size, this should not be bigger than 65535 bytes. Anything larger will result in an Exception being throw. This String is assumed to consist of compressed data.
supportsChat - true iff the host currently allows chatting.
proxies - an array of PushProxy interfaces. will be included in the replies GGEP extension.
the - security token to echo along with the query reply
Throws:
IllegalArgumentException - Thrown if xmlBytes.length > XML_MAX_SIZE

createQueryReply

QueryReply createQueryReply(byte[] guid,
                            byte ttl,
                            int port,
                            byte[] ip,
                            long speed,
                            Response[] responses,
                            byte[] clientGUID,
                            byte[] xmlBytes,
                            boolean needsPush,
                            boolean isBusy,
                            boolean finishedUpload,
                            boolean measuredSpeed,
                            boolean supportsChat,
                            boolean isMulticastReply,
                            boolean supportsFWTransfer,
                            Set<? extends IpPort> proxies)
Creates a new QueryReply with a BearShare 2.2.0-style QHD. The QHD with the LIME vendor code and the given busy and push flags. Note that this constructor has no support for undefined push or busy bits. The Browse Host GGEP extension is ON by default.

Parameters:
needsPush - true iff this is firewalled and the downloader should attempt a push without trying a normal download.
isBusy - true iff this server is busy, i.e., has no more upload slots
finishedUpload - true iff this server has successfully finished an upload
measuredSpeed - true iff speed is measured, not as reported by the user
xmlBytes - The (non-null) byte[] containing aggregated and indexed information regarding file metadata. In terms of byte-size, this should not be bigger than 65535 bytes. Anything larger will result in an Exception being throw. This String is assumed to consist of compressed data.
supportsChat - true iff the host currently allows chatting.
proxies - an array of PushProxy interfaces. will be included in the replies GGEP extension.
Throws:
IllegalArgumentException - Thrown if xmlBytes.length > XML_MAX_SIZE

createQueryReply

QueryReply createQueryReply(byte[] guid,
                            byte ttl,
                            int port,
                            byte[] ip,
                            long speed,
                            Response[] responses,
                            byte[] clientGUID,
                            byte[] xmlBytes,
                            boolean needsPush,
                            boolean isBusy,
                            boolean finishedUpload,
                            boolean measuredSpeed,
                            boolean supportsChat,
                            boolean isMulticastReply,
                            boolean supportsFWTransfer,
                            Set<? extends IpPort> proxies,
                            SecurityToken securityToken)
Creates a new QueryReply with a BearShare 2.2.0-style QHD. The QHD with the LIME vendor code and the given busy and push flags. Note that this constructor has no support for undefined push or busy bits. The Browse Host GGEP extension is ON by default.

Parameters:
needsPush - true iff this is firewalled and the downloader should attempt a push without trying a normal download.
isBusy - true iff this server is busy, i.e., has no more upload slots
finishedUpload - true iff this server has successfully finished an upload
measuredSpeed - true iff speed is measured, not as reported by the user
xmlBytes - The (non-null) byte[] containing aggregated and indexed information regarding file metadata. In terms of byte-size, this should not be bigger than 65535 bytes. Anything larger will result in an Exception being throw. This String is assumed to consist of compressed data.
supportsChat - true iff the host currently allows chatting.
proxies - an array of PushProxy interfaces. will be included in the replies GGEP extension.
securityToken - might be null
Throws:
IllegalArgumentException - Thrown if xmlBytes.length > XML_MAX_SIZE

createFromNetwork

QueryReply createFromNetwork(byte[] guid,
                             byte ttl,
                             byte hops,
                             byte[] payload)
                             throws BadPacketException
Creates a new query reply with data read from the network.

Throws:
BadPacketException

createQueryReply

QueryReply createQueryReply(byte[] guid,
                            QueryReply reply)
Copy constructor. Creates a new query reply from the passed query Reply. The new one is same as the passed one, but with different specified GUID.

Note: The payload is not really copied, but the reference in the newly constructed query reply, points to the one in the passed reply. But since the payload cannot be mutated, it shouldn't make difference if different query replies maintain reference to same payload

Parameters:
guid - The new GUID for the reply
reply - The query reply from where to copy the fields into the new constructed query reply

createWithReturnPathInfo

QueryReply createWithReturnPathInfo(QueryReply original,
                                    IpPort me,
                                    IpPort source)
Copy constructor, appending information about the return path.

Parameters:
original - the original query
me - this host.
source - the source that the reply came from
Returns:
original reply with return path info.

createWithNewAddress

QueryReply createWithNewAddress(byte[] address,
                                QueryReply original)
Copy constructor.

Parameters:
address - - 4 byte ip address.
Returns:
original reply but with the new address.

createFromNetwork

QueryReply createFromNetwork(byte[] guid,
                             byte ttl,
                             byte hops,
                             byte[] payload,
                             Message.Network network)
                             throws BadPacketException
Throws:
BadPacketException

LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.