JXTA

net.jxta.impl.resolver
Interface InternalQueryHandler

All Superinterfaces:
QueryHandler
All Known Implementing Classes:
DiscoveryServiceImpl, PipeResolver

public interface InternalQueryHandler
extends QueryHandler

Services that wish to act as a resolver handler must implement this interface.

This interface extends the normal resolver query handler interface to add the source of the query. Typically this the query's last hop which may or may not be the same as the query's originator. Knowing the source of the query can be useful for sending NAK messages.

See Also:
ResolverService, ResolverQueryMsg

Method Summary
 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, EndpointAddress srcAddr)
          Called when messages are received by the ResolverService it calls back this method to deal with received responses
 
Methods inherited from interface net.jxta.resolver.QueryHandler
processQuery, processResponse
 

Method Detail

processQuery

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 != null) {
   resolver.sendResponse(query.getSrc(), response);
   return resolver.OK;
  } else return resolver.Repropagate;
 

Parameters:
srcAddr - source address
query - ResolverQueryMsg query
Returns:
int status, OK success, Repropagate to indicate a re-propagation is needed

processResponse

void processResponse(ResolverResponseMsg response,
                     EndpointAddress srcAddr)
Called when messages are received by the ResolverService it calls back this method to deal with received responses

Parameters:
response - ResolverQueryMsg response
srcAddr - source address

JXSE