|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.search.QueryHandler
This class is a factory for creating QueryRequest instances for dynamic queries. Dynamic queries adjust to the varying conditions of a query, such as the number of results received, the number of nodes hit or theoretically hit, etc. This class makes it convenient to rapidly generate QueryRequests with similar characteristics, such as guids, the query itself, the xml query, etc, but with customized settings, such as the TTL.
Field Summary | |
static int |
MAX_QUERY_TIME
Constant for the maximum number of milliseconds the entire query can last. |
Method Summary | |
static QueryHandler |
createHandler(QueryRequest query,
ReplyHandler handler,
ResultCounter counter)
Factory constructor for generating a new QueryHandler for the given QueryRequest. |
static QueryHandler |
createHandlerForNewLeaf(QueryRequest query,
ReplyHandler handler,
ResultCounter counter)
Factory constructor for generating a new QueryHandler for the given QueryRequest. |
static QueryHandler |
createHandlerForOldLeaf(QueryRequest query,
ReplyHandler handler,
ResultCounter counter)
Factory constructor for generating a new QueryHandler for the given QueryRequest. |
static QueryRequest |
createQuery(QueryRequest query,
byte ttl)
Factory method for creating new QueryRequest instances with the same guid, query, xml query, urn types, etc. |
byte[] |
getGUID()
|
ReplyHandler |
getReplyHandler()
Accessor for the ReplyHandler instance for the connection issuing this request. |
long |
getTimeToWaitPerHop()
Accessor for the time to wait per hop, in milliseconds, for this QueryHandler. |
boolean |
hasEnoughResults()
Returns whether or not this query has received enough results. |
void |
sendQuery()
Sends the query to the current connections. |
java.lang.String |
toString()
|
void |
updateLeafResults(int numResults)
Use this to modify the number of results as reported by the leaf you are querying for. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int MAX_QUERY_TIME
Method Detail |
public static QueryHandler createHandler(QueryRequest query, ReplyHandler handler, ResultCounter counter)
handler
- the ReplyHandler for routing the repliescounter
- the ResultCounter that keeps track of how
many results have been returned for this query
public static QueryHandler createHandlerForOldLeaf(QueryRequest query, ReplyHandler handler, ResultCounter counter)
handler
- the ReplyHandler for routing the repliescounter
- the ResultCounter that keeps track of how
many results have been returned for this query
public static QueryHandler createHandlerForNewLeaf(QueryRequest query, ReplyHandler handler, ResultCounter counter)
handler
- the ReplyHandler for routing the repliescounter
- the ResultCounter that keeps track of how
many results have been returned for this query
public static QueryRequest createQuery(QueryRequest query, byte ttl)
ttl
- the time to live of the new query
public void sendQuery()
public boolean hasEnoughResults()
public void updateLeafResults(int numResults)
public ReplyHandler getReplyHandler()
public long getTimeToWaitPerHop()
public java.lang.String toString()
public byte[] getGUID()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |