|
Project JXTA | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.pipe.PipeResolver
This class implements the Resolver interfaces for a PipeServiceImpl.
Nested Class Summary | |
(package private) static class |
PipeResolver.Event
A pipe resolver event. |
(package private) static interface |
PipeResolver.Listener
Pipe Resolver Event Listener. |
Field Summary | |
(package private) static int |
ANYQUERY
Constant for pipe event listeners to signify any query id. |
Constructor Summary | |
(package private) |
PipeResolver(PeerGroup g)
Constructor for the PipeResolver object |
Method Summary | |
(package private) boolean |
addListener(PipeID pipeID,
PipeResolver.Listener listener,
int queryID)
Add a pipe resolver listener |
(package private) void |
callListener(int qid,
PipeID pipeID,
String type,
PeerID peer,
boolean NAK)
Call the listener for the specified pipe id informing it about the specified peer. |
InputPipe |
findLocal(PipeID pipeID)
Return the local InputPipe , if any, for the
specified PipeID . |
boolean |
forget(InputPipe pipe)
This peer is no longer listening on the specified pipe. |
(package private) static int |
getNextQueryID()
return the next query id. |
(package private) SrdiIndex |
getSrdiIndex()
{@inheritDoc} |
void |
messageSendFailed(PeerID peerid,
OutgoingMessageEvent e)
|
int |
processQuery(ResolverQueryMsg query)
|
int |
processQuery(ResolverQueryMsg query,
EndpointAddress srcAddr)
Process the resolver query, and generate response it is the responsibilty of the handler to send the response result = processIncommingQuery(query); if (result != null) { resolver.sendResponse(query.getSrc(), response); return resolver.OK; } else return resolver.Repropagate; |
void |
processResponse(ResolverResponseMsg response)
|
void |
processResponse(ResolverResponseMsg response,
EndpointAddress srcAddr)
Called when messages are received by the ResolverService it calls back this method to deal with received responses |
boolean |
processSrdi(ResolverSrdiMsg message)
|
void |
pushEntries(boolean all)
Pushe SRDI entries. |
(package private) void |
pushSrdi(InputPipe ip,
boolean adding)
Push SRDI entry for the specified pipe |
boolean |
register(InputPipe ip)
Register that this peer is an InputPipe for the specified Pipe ID. |
(package private) PipeResolver.Listener |
removeListener(PipeID pipeID,
int queryID)
Remove a pipe resolver listener |
(package private) int |
sendPipeQuery(PipeAdvertisement adv,
Set acceptablePeers,
int queryID)
Send a request to find an input pipe |
(package private) void |
stop()
unregisters the resolver handler |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final int ANYQUERY
Constructor Detail |
PipeResolver(PeerGroup g)
g
- group for which this PipeResolver operates inMethod Detail |
static int getNextQueryID()
public int processQuery(ResolverQueryMsg query)
processQuery
in interface QueryHandler
public int processQuery(ResolverQueryMsg query, EndpointAddress srcAddr)
result = processIncommingQuery(query); if (result != null) { resolver.sendResponse(query.getSrc(), response); return resolver.OK; } else return resolver.Repropagate;
processQuery
in interface InternalQueryHandler
query
- ResolverQueryMsg query
OK
success,
Repropagate
to
indicate a re-propagation is neededpublic void processResponse(ResolverResponseMsg response)
processResponse
in interface QueryHandler
public void processResponse(ResolverResponseMsg response, EndpointAddress srcAddr)
processResponse
in interface InternalQueryHandler
response
- ResolverQueryMsg reponsepublic boolean processSrdi(ResolverSrdiMsg message)
processSrdi
in interface SrdiHandler
public void messageSendFailed(PeerID peerid, OutgoingMessageEvent e)
messageSendFailed
in interface SrdiHandler
public void pushEntries(boolean all)
pushEntries
in interface Srdi.SrdiInterface
all
- if true then push all entries otherwise just push
those which have changed since the last push.void stop()
public boolean register(InputPipe ip)
register
in interface PipeRegistrar
ip
- the pipe objectpublic InputPipe findLocal(PipeID pipeID)
InputPipe
, if any, for the
specified PipeID
.
pipeID
- the PipeID who's InputPipe is desired.
public boolean forget(InputPipe pipe)
forget
in interface PipeRegistrar
boolean addListener(PipeID pipeID, PipeResolver.Listener listener, int queryID)
listener
- listenervoid callListener(int qid, PipeID pipeID, String type, PeerID peer, boolean NAK)
qid
- The query this callback is being made in response to.pipeID
- The pipe which is the subject of the event.type
- The type of the pipe which is the subject of the event.peer
- The peer on which the remote input pipe was found.PipeResolver.Listener removeListener(PipeID pipeID, int queryID)
int sendPipeQuery(PipeAdvertisement adv, Set acceptablePeers, int queryID)
adv
- the advertisement for the pipe we are seeking.acceptablePeers
- the set of peers at which we wish the pipe to
be resolved. We will not accept responses from peers other than those
in this set. Empty set means all peers are acceptable.queryID
- the query ID to use for the query. if zero then a query
ID will be generated
SrdiIndex getSrdiIndex()
void pushSrdi(InputPipe ip, boolean adding)
ip
- the pipe who's entry we are pushingadding
- adding an entry for the pipe or expiring the entry?
|
JXTA J2SE | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |