|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectp2ps.imp.discovery.QueryHandler
A class that handles adverts/queries.
| Constructor Summary | |
QueryHandler(DiscoveryCache cache,
Peer peer)
|
|
| Method Summary | |
void |
cache(Advertisement advert)
Adds an advert to the discovery cache (unless it is a direct query) |
DiscoveryCache |
getDiscoveryCache()
|
void |
handleAdvert(Advertisement advert,
OutputPipe replypipe)
If the advert is a query, then searches the cache for adverts that match that specified query. |
static boolean |
isDirectReplyQuery(Query query)
|
void |
outpipeConnected(PipeConnectedEvent event)
Called when an output pipe is successfully connected |
void |
outpipeConnectFailure(PipeConnectFailureEvent event)
Called when an output pipe fails to connect. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public QueryHandler(DiscoveryCache cache,
Peer peer)
| Method Detail |
public DiscoveryCache getDiscoveryCache()
public void cache(Advertisement advert)
throws java.io.IOException
java.io.IOExceptionpublic static boolean isDirectReplyQuery(Query query)
public void handleAdvert(Advertisement advert,
OutputPipe replypipe)
throws java.io.IOException
advert - the query advertisementreplypipe - an optional reply pipe to use if no direct pipe specified
java.io.IOExceptionpublic void outpipeConnected(PipeConnectedEvent event)
outpipeConnected in interface PipeConnectionListenerpublic void outpipeConnectFailure(PipeConnectFailureEvent event)
outpipeConnectFailure in interface PipeConnectionListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||