Message Format :
A Query message
name
uri
token
id
query
Note: queryid is unique to the originating node only, it can be utilized to
match queries to responses.
A Response Message
name
uri
token
id
response
Note: queryid is unique to the originating node only, it can be
utilized to match queries to responses
- Since:
- JXTA 1.0
- See Also:
- ,
Method Summary |
void |
demux(MessageImpl message)
This method will be called by the endpoint to handle messages
of this type |
net.jxta.document.Advertisement |
getAdvertisement()
Returns the advertisement for that service. |
net.jxta.peergroup.PeerGroup |
getGroup()
|
net.jxta.resolver.QueryHandler |
getHandler(java.lang.String name)
gets the handler registered under the given name. |
net.jxta.service.Service |
getInterface()
Service objects are not manipulated directly to protect usage
of the service. |
void |
init(net.jxta.peergroup.PeerGroup g,
net.jxta.document.Advertisement sadv)
init is called by the group running this instance |
net.jxta.protocol.ResolverResponseMsg |
processQuery(net.jxta.protocol.ResolverQueryMsg query)
Process the message and respond |
void |
pushResponse(net.jxta.protocol.ResolverResponseMsg resp)
push Response back to the handler |
net.jxta.resolver.QueryHandler |
registerHandler(java.lang.String name,
net.jxta.resolver.QueryHandler handler)
Registers the given ResolveHandler. |
void |
ResolverService()
Default constructor |
void |
sendQuery(java.lang.String rdvPeer,
net.jxta.protocol.ResolverQueryMsg query)
try getting a response for out query |
void |
sendResponse(java.lang.String destPeer,
net.jxta.protocol.ResolverResponseMsg response)
Send a response to a peer. |
int |
startApp(java.lang.String[] arg)
Supply arguments and starts this service if it hadn't started by itself. |
void |
stopApp()
Ask this service to stop. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
outQueName
public java.lang.String outQueName
inQueName
public java.lang.String inQueName
rendezvous
protected java.util.Vector rendezvous
ResolverService
public ResolverService()
ResolverService
public void ResolverService()
- Default constructor
startApp
public int startApp(java.lang.String[] arg)
- Supply arguments and starts this service if it hadn't started by itself.
Currently this service starts by itself and does not expect
arguments.
- Parameters:
arg
- A table of strings arguments.- Returns:
- int status indication.
stopApp
public void stopApp()
- Ask this service to stop.
This request is currently ignored.
getInterface
public net.jxta.service.Service getInterface()
- Service objects are not manipulated directly to protect usage
of the service. A Service interface is returned to access the service
methods.
- Returns:
- Service public interface of the service
- Since:
- JXTA 1.0
getAdvertisement
public net.jxta.document.Advertisement getAdvertisement()
- Returns the advertisement for that service.
- Returns:
- Advertisement the advertisement.
- Since:
- JXTA 1.0
registerHandler
public net.jxta.resolver.QueryHandler registerHandler(java.lang.String name,
net.jxta.resolver.QueryHandler handler)
- Registers the given ResolveHandler.
- Specified by:
- registerHandler in interface net.jxta.resolver.Resolver
- Parameters:
name
- The name under which this handler is known.handler
- The handler.- Returns:
- The previous handler registered under this name
getHandler
public net.jxta.resolver.QueryHandler getHandler(java.lang.String name)
- gets the handler registered under the given name.
- Specified by:
- getHandler in interface net.jxta.resolver.Resolver
- Parameters:
name
- Handler name- Returns:
- ResolveHandler
sendQuery
public void sendQuery(java.lang.String rdvPeer,
net.jxta.protocol.ResolverQueryMsg query)
- try getting a response for out query
- Parameters:
address
- query
- - Throws:
- java.lang.RuntimeException -
getGroup
public net.jxta.peergroup.PeerGroup getGroup()
demux
public void demux(MessageImpl message)
- This method will be called by the endpoint to handle messages
of this type
- Specified by:
- demux in interface EndpointHandler
- Parameters:
message
-
processQuery
public net.jxta.protocol.ResolverResponseMsg processQuery(net.jxta.protocol.ResolverQueryMsg query)
throws net.jxta.exception.NoResponseException,
net.jxta.exception.ResendQueryException,
net.jxta.exception.DiscardQueryException,
java.io.IOException
- Process the message and respond
- Parameters:
query
- - Returns:
- ResolverResponseMsg response
- Throws:
- net.jxta.exception.NoResponseException -
pushResponse
public void pushResponse(net.jxta.protocol.ResolverResponseMsg resp)
- push Response back to the handler
- Parameters:
query
- - Returns:
- ResolverResponseMsg response
- Throws:
- net.jxta.exception.NoResponseException -
sendResponse
public void sendResponse(java.lang.String destPeer,
net.jxta.protocol.ResolverResponseMsg response)
- Send a response to a peer.
This is used by resolver services that are handling query/response in
an asynchronous way, which is the case of Rendezvous peers.
- Parameters:
destPeer
- is the destination of the responseresponse
- is the response to be sent
init
public void init(net.jxta.peergroup.PeerGroup g,
net.jxta.document.Advertisement sadv)
throws net.jxta.exception.PeerGroupException
- init is called by the group running this instance
- Parameters:
g
- - Throws:
- net.jxta.exception.PeerGroupException -