net.jxta.resolver
Interface Resolver
- All Superinterfaces:
- Application, GenericResolver, Service
- public interface Resolver
- extends Service, GenericResolver
ResolverService Service provides a generic mechanism for jxta Services
to send "Queries", and receive "Responses". It removes the burden for
registered handlers in deal with :
Setting message tags, to ensure uniqueness of tags and
ensures that messages are sent to the correct address, and group
Authentication, and Verification of credentials
drop rogue messages
The ResolverService Service does not proccess the queries, nor does it not compose
reponses. Handling of queries, and composition of responses are left up
to the registered handlers. Services that wish to handle queries,
and generate reponses must implement QueryHandler
Message Format :
A Query message
<?xml version="1.0" standalone='yes'?>
<ResolverQuery>
<handlername> name </handlername>
<credentialServiecUri> uri </credentialServiecUri>
<credentialToken> token </credentialToken>
<srcpeerid> srcpeerid </srcpeerid>
<queryid> id </queryid>
<query> query </query>
</ResolverQuery>
Note: queryid is unique to the originating node only, it can be utilized to
match queries to responses.
A Response Message
<?xml version="1.0" standalone='yes'?>
<ResolverResponse>
<handlername> name </handlername>
<credentialServiecUri> uri </credentialServiecUri>
<credentialToken> token </credentialToken>
<queryid> id </queryid>
<response> response </response>
</ResolverResponse>
Note: queryid is unique to the originating node only, it can be
utilized to match queries to responses
- Since:
- JXTA 1.0
- See Also:
Service
,
GenericResolver
,
QueryHandler
,
ResolverQueryMsg
,
Tag $Name: $
registerHandler
public QueryHandler registerHandler(java.lang.String name,
QueryHandler handler)
- Registers the given ResolveHandler.
- Parameters:
name
- The name under which this handler is to be registered.handler
- The handler.- Returns:
- The previous handler registered under this name
- Since:
- JXTA 1.0
getHandler
public QueryHandler getHandler(java.lang.String name)
- gets the handler registered under the given name.
- Parameters:
name
- Handler name- Returns:
- QueryHandler return resolver handler
- Since:
- JXTA 1.0