|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.pipe.PipeResolver
class PipeResolver
This class implements the Resolver interfaces for a PipeServiceImpl.
Nested Class Summary | |
---|---|
(package private) static class |
PipeResolver.CurrentCredential
Encapsulates current Membership Service credential. |
(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. |
(package private) PipeResolver.CurrentCredential |
currentCredential
The current Membership service default credential. |
(package private) net.jxta.impl.pipe.PipeResolver.CredentialListener |
membershipCredListener
|
Constructor Summary | |
---|---|
PipeResolver(PeerGroup peerGroup)
Constructor for the PipeResolver object |
Method Summary | |
---|---|
(package private) boolean |
addListener(ID pipeID,
PipeResolver.Listener listener,
int queryID)
Add a pipe resolver listener |
(package private) void |
callListener(int qid,
ID 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()
|
void |
messageSendFailed(PeerID peerid,
OutgoingMessageEvent e)
Resolver calls this method when a failure to send a message to specified peer occurs |
int |
processQuery(ResolverQueryMsg query)
Process the resolver query, and generate response it is the responsibility of the handler to send the response result = processIncomingQuery(query); if (result ! |
int |
processQuery(ResolverQueryMsg query,
EndpointAddress srcAddr)
Process the resolver query, and generate response it is the responsibility of the handler to send the response result = processIncommingQuery(query); if (result ! |
void |
processResponse(ResolverResponseMsg response)
Called when messages are received by the ResolverService it calls back this method to deal with received responses |
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)
Process the SrdiMessage message, returns true if the message was processed properly |
void |
pushEntries(boolean all)
Pushe SRDI entries. |
boolean |
register(InputPipe ip)
Register that this peer is an InputPipe for the specified Pipe ID. |
(package private) PipeResolver.Listener |
removeListener(ID pipeID,
int queryID)
Remove a pipe resolver listener |
(package private) int |
sendPipeQuery(PipeAdvertisement adv,
Set<? extends ID> 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
PipeResolver.CurrentCredential currentCredential
final net.jxta.impl.pipe.PipeResolver.CredentialListener membershipCredListener
Constructor Detail |
---|
PipeResolver(PeerGroup peerGroup)
peerGroup
- group for which this PipeResolver operates inMethod Detail |
---|
static int getNextQueryID()
public int processQuery(ResolverQueryMsg query)
result = processIncomingQuery(query); if (result != null) { resolver.sendResponse(query.getSrc(), response); return ResolverService.OK; } else return ResolverService.Repropagate;
processQuery
in interface QueryHandler
query
- ResolverQueryMsg query
OK
success, Repropagate
to indicate a re-propagation is needed.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 querysrcAddr
- source address
OK
success,
Repropagate
to
indicate a re-propagation is neededpublic void processResponse(ResolverResponseMsg response)
processResponse
in interface QueryHandler
response
- ResolverQueryMsg responsepublic void processResponse(ResolverResponseMsg response, EndpointAddress srcAddr)
processResponse
in interface InternalQueryHandler
response
- ResolverQueryMsg responsesrcAddr
- source addresspublic boolean processSrdi(ResolverSrdiMsg message)
processSrdi
in interface SrdiHandler
message
- Description of the Parameter
public void messageSendFailed(PeerID peerid, OutgoingMessageEvent e)
messageSendFailed
in interface SrdiHandler
peerid
- peerid failure occured onpublic 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 InputPipe to be registered.
true
then the pipe was registered, otherwise
false
.public 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
pipe
- The InputPipe to be forgotten.
true
if the pipe was removed otherwise false
.boolean addListener(ID pipeID, PipeResolver.Listener listener, int queryID)
listener
- listenerqueryID
- The query this callback is being made in response to.pipeID
- The pipe which is the subject of the event.
void callListener(int qid, ID 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.NAK
- indicate whether the event is a nackPipeResolver.Listener removeListener(ID pipeID, int queryID)
pipeID
- listener to removequeryID
- matching queryid.
int sendPipeQuery(PipeAdvertisement adv, Set<? extends ID> 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()
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |