LimeWire Consolidated API

com.limegroup.gnutella.search
Interface SearchResultHandler


public interface SearchResultHandler

Handles incoming search results from the network. This class parses the results from QueryReply instances and performs the logic necessary to pass those results up to the UI.


Field Summary
static int MAX_RESULTS
          The maximum number of results to send in a QueryStatusResponse - basically sent to say 'shut off query'.
static int REPORT_INTERVAL
          The "delay" between responses to wait to send a QueryStatusResponse.
 
Method Summary
 void addQuery(QueryRequest qr)
          Adds the Query to the list of queries kept track of.
 int getNumResultsForQuery(GUID guid)
          Use this to see how many results have been displayed to the user for the specified query.
 List<QueryRequest> getQueriesToReSend()
          Returns a List of queries that require replanting into the network, based on the number of results they've had and/or whether or not they're new enough.
 void handleQueryReply(QueryReply qr)
          Handles the given query reply.
 void removeQuery(GUID guid)
          Removes the Query from the list of queries kept track of.
 void setResponseFilter(ResponseFilter responseFilter)
          Sets the new filter to use for response filters.
 

Field Detail

REPORT_INTERVAL

static final int REPORT_INTERVAL
The "delay" between responses to wait to send a QueryStatusResponse.

See Also:
Constant Field Values

MAX_RESULTS

static final int MAX_RESULTS
The maximum number of results to send in a QueryStatusResponse - basically sent to say 'shut off query'.

See Also:
Constant Field Values
Method Detail

addQuery

void addQuery(QueryRequest qr)
Adds the Query to the list of queries kept track of. You should do this EVERY TIME you start a query so we can leaf guide it when possible. Also adds the query to the Spam Manager to adjust percentages.

Parameters:
qr - The query that has been started. We really just access the guid.

removeQuery

void removeQuery(GUID guid)
Removes the Query from the list of queries kept track of. You should do this EVERY TIME you stop a query.

Parameters:
guid - the guid of the query that has been removed.

getQueriesToReSend

List<QueryRequest> getQueriesToReSend()
Returns a List of queries that require replanting into the network, based on the number of results they've had and/or whether or not they're new enough.


getNumResultsForQuery

int getNumResultsForQuery(GUID guid)
Use this to see how many results have been displayed to the user for the specified query.

Parameters:
guid - the guid of the query.
Returns:
the number of non-filtered results for query with guid guid. -1 is returned if the guid was not found....

handleQueryReply

void handleQueryReply(QueryReply qr)
Handles the given query reply. Only one thread may call it at a time.


setResponseFilter

void setResponseFilter(ResponseFilter responseFilter)
Sets the new filter to use for response filters.


LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.