|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.endpoint.router.RouteResolver
class RouteResolver
Handles dynamic route resolution.
Nested Class Summary | |
---|---|
(package private) static class |
RouteResolver.CurrentCredential
Encapsulates current Membership Service credential. |
Field Summary | |
---|---|
(package private) RouteResolver.CurrentCredential |
currentCredential
The current Membership service default credential. |
(package private) net.jxta.impl.endpoint.router.RouteResolver.CredentialListener |
membershipCredListener
|
static String |
routerSName
Router Service Name |
Fields inherited from interface net.jxta.platform.Module |
---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_DISABLED, START_OK |
Constructor Summary | |
---|---|
RouteResolver(EndpointRouter router)
|
Method Summary | |
---|---|
protected List<PeerID> |
cleanupAnyEdges(ID src,
List<PeerID> results)
cleanup any edge peers when trying to forward an SRDI query so we are guaranteed to the best of our knowledge that the peer is a rendezvous. |
(package private) void |
enableRouteResolver(boolean enable)
enable routeResolver usage |
protected void |
findRoute(EndpointAddress peer)
issue a new route discovery resolver request |
protected void |
generateNACKRoute(PeerID src,
PeerID dest,
Vector<AccessPointAdvertisement> origHops)
Return a route error in case a route was found to be invalid as the current hop cannot find a way to forward the message to the destination or any other hops in the forward part of the route. |
void |
init(PeerGroup group,
ID assignedID,
Advertisement impl)
initialize routeResolver |
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 Query, and generate response |
void |
processResponse(ResolverResponseMsg response)
Called when messages are received by the ResolverService it calls back this method to deal with received responses |
boolean |
processSrdi(ResolverSrdiMsg message)
process an SRDI message request |
void |
pushEntries(boolean all)
Pushe SRDI entries. |
protected void |
pushSrdi(ID peer,
PeerID id)
|
protected void |
pushSrdi(String peer,
boolean all)
|
protected void |
removeSrdi(String peer,
PeerID id)
remove a SRDI cache entry |
protected void |
removeSrdiIndex(PeerID pid)
remove SRDI index |
int |
startApp(String[] arg)
Complete any remaining initialization of the module. |
void |
stopApp()
Stop a module. |
(package private) boolean |
useRouteResolver()
return routeResolver usage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String routerSName
RouteResolver.CurrentCredential currentCredential
final net.jxta.impl.endpoint.router.RouteResolver.CredentialListener membershipCredListener
Constructor Detail |
---|
RouteResolver(EndpointRouter router)
router
- the routerMethod Detail |
---|
public void init(PeerGroup group, ID assignedID, Advertisement impl) throws PeerGroupException
init
in interface Module
group
- The PeerGroup from which this Module can obtain services.
If this module is a Service, this is also the PeerGroup of which this
module is a service.assignedID
- Identity of Module within group.
modules can use it as a the root of their namespace to create
names that are unique within the group but predictable by the
same module on another peer. This is normally the ModuleClassID
which is also the name under which the module is known by other
modules. For a group it is the PeerGroupID itself.
The parameters of a service, in the Peer configuration, are indexed
by the assignedID of that service, and a Service must publish its
run-time parameters in the Peer Advertisement under its assigned ID.impl
- The implementation advertisement for this
Module. It is permissible to pass null if no implementation
advertisement is available. This may happen if the
implementation was selected by explicit class name rather than
by following an implementation advertisement. Modules are not
required to support that style of loading, but if they do, then
their documentation should mention it.
PeerGroupException
- This module failed to initialize.public int startApp(String[] arg)
startApp()
is completed. That is
also the opportunity to supply arbitrary arguments (mostly to
applications).
If this module is a PeerGroup
service, it may be invoked
several times depending on its return value.
startApp
in interface Module
arg
- An array of Strings forming the parameters for this
Module.
Module.START_OK
, Module.START_AGAIN_PROGRESS
,
Module.START_AGAIN_STALLED
, which indicates partial or complete
success, or any other value (negative values are
recommended for future compatibility), which indicates failure.public void stopApp()
init()
completes and should not assume that startApp()
has been
called or completed.
The Module cannot be forced to comply, but in the future
we might be able to deny it access to anything after some timeout.
Careful that stopApp() could in theory be called before startApp().
stopApp
in interface Module
boolean useRouteResolver()
void enableRouteResolver(boolean enable)
enable
- if true, enables route resolverprotected void findRoute(EndpointAddress peer)
peer
- the destination as a logical endpoint addresspublic void processResponse(ResolverResponseMsg response)
processResponse
in interface QueryHandler
response
- ResolverQueryMsg responsepublic int processQuery(ResolverQueryMsg query)
processQuery
in interface QueryHandler
query
- the query to process
OK
success, Repropagate
to indicate a re-propagation is needed.protected void generateNACKRoute(PeerID src, PeerID dest, Vector<AccessPointAdvertisement> origHops)
src
- original source of the messagedest
- original destination of the messageorigHops
- original hopspublic boolean processSrdi(ResolverSrdiMsg message)
processSrdi
in interface SrdiHandler
message
- SRDI resolver message
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.protected void pushSrdi(String peer, boolean all)
protected void pushSrdi(ID peer, PeerID id)
protected void removeSrdi(String peer, PeerID id)
peer
- peer id we send the request, null for sending to allid
- peer id of the SRDI route that we want to remove
from the cachepublic void messageSendFailed(PeerID peerid, OutgoingMessageEvent e)
messageSendFailed
in interface SrdiHandler
peerid
- peerid failure occured onprotected List<PeerID> cleanupAnyEdges(ID src, List<PeerID> results)
src
- sourceresults
- vector of PeerIDs
protected void removeSrdiIndex(PeerID pid)
pid
- of the index to be removed
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |