LimeWire Consolidated API

com.limegroup.gnutella
Interface SearchServices

All Known Implementing Classes:
SearchServicesImpl

public interface SearchServices


Method Summary
 BrowseHostHandler doAsynchronousBrowseHost(FriendPresence friendPresence, GUID browseGuid, BrowseListener browseListener)
          Initiates a non-blocking browse of address with session guid browseGuid.
 long getLastQueryTime()
          Accessor for the last time a query was originated from this host.
 boolean isMandragoreWorm(byte[] guid, Response response)
          Returns true if the given response for the query with the given guid is a result of the Madragore worm (8KB files of form "x.exe").
 boolean matchesQuery(byte[] guid, Response response)
           
 boolean matchesType(byte[] guid, Response response)
          Returns true if the given response is of the same type as the the query with the given guid.
 byte[] newQueryGUID()
          Returns a new GUID for passing to query.
 void query(byte[] guid, String query)
          Searches the network for files with the given query string and minimum speed, i.e., same as query(guid, query, minSpeed, null).
 void query(byte[] guid, String query, MediaType type)
          Searches the network for files of the given type with the given GUID, query string and minimum speed.
 void query(byte[] guid, String query, String richQuery, MediaType type)
          Searches the network for files with the given metadata.
 void queryWhatIsNew(byte[] guid, MediaType type)
          Sends a 'What Is New' query on the network.
 void stopQuery(GUID guid)
          Purges the query from the QueryUnicaster (GUESS) and the ResultHandler (which maintains query stats for the purpose of leaf guidance).
 

Method Detail

isMandragoreWorm

boolean isMandragoreWorm(byte[] guid,
                         Response response)
Returns true if the given response for the query with the given guid is a result of the Madragore worm (8KB files of form "x.exe"). Returns false if guid is not recognized. Ideally this would be done by the normal filtering mechanism, but it is not powerful enough without the query string.

Parameters:
guid - the value returned by query(..). MUST be 16 byts long.
resp - a response delivered by ActivityCallback.handleQueryReply
See Also:
ResponseVerifier.isMandragoreWorm(byte[], Response)

matchesQuery

boolean matchesQuery(byte[] guid,
                     Response response)

matchesType

boolean matchesType(byte[] guid,
                    Response response)
Returns true if the given response is of the same type as the the query with the given guid. Returns 100 if guid is not recognized.

Parameters:
guid - the value returned by query(..). MUST be 16 bytes long.
resp - a response delivered by ActivityCallback.handleQueryReply
See Also:
ResponseVerifier.matchesType(byte[], Response)

stopQuery

void stopQuery(GUID guid)
Purges the query from the QueryUnicaster (GUESS) and the ResultHandler (which maintains query stats for the purpose of leaf guidance).

Parameters:
guid - The GUID of the query you want to get rid of....

getLastQueryTime

long getLastQueryTime()
Accessor for the last time a query was originated from this host.

Returns:
a long representing the number of milliseconds since January 1, 1970, that the last query originated from this host

queryWhatIsNew

void queryWhatIsNew(byte[] guid,
                    MediaType type)
Sends a 'What Is New' query on the network.


query

void query(byte[] guid,
           String query,
           String richQuery,
           MediaType type)
Searches the network for files with the given metadata.

Parameters:
richQuery - metadata query to insert between the nulls, typically in XML format
See Also:
query(byte[], String, MediaType)

query

void query(byte[] guid,
           String query)
Searches the network for files with the given query string and minimum speed, i.e., same as query(guid, query, minSpeed, null).

See Also:
query(byte[], String, MediaType)

query

void query(byte[] guid,
           String query,
           MediaType type)
Searches the network for files of the given type with the given GUID, query string and minimum speed. If type is null, any file type is acceptable.

ActivityCallback is notified asynchronously of responses. These responses can be matched with requests by looking at their GUIDs. (You may want to wrap the bytes with a GUID object for simplicity.) An earlier version of this method returned the reply GUID instead of taking it as an argument. Unfortunately this caused a race condition where replies were returned before the GUI was prepared to handle them.

Parameters:
guid - the guid to use for the query. MUST be a 16-byte value as returned by newQueryGUID.
query - the query string to use
minSpeed - the minimum desired result speed
type - the desired type of result (e.g., audio, video), or null if you don't care

newQueryGUID

byte[] newQueryGUID()
Returns a new GUID for passing to query. This method is the central point of decision making for sending out OOB queries.


doAsynchronousBrowseHost

BrowseHostHandler doAsynchronousBrowseHost(FriendPresence friendPresence,
                                           GUID browseGuid,
                                           BrowseListener browseListener)
Initiates a non-blocking browse of address with session guid browseGuid.


LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.