JXTA

net.jxta.impl.protocol
Class ResolverResponse

java.lang.Object
  extended by net.jxta.protocol.ResolverResponseMsg
      extended by net.jxta.impl.protocol.ResolverResponse

public class ResolverResponse
extends ResolverResponseMsg

ResolverResponse provides an implementation for ResolverResponseMsg using the standard JXTA Peer Resolver Protocol.

The message is implemented with the following schema:


 <xs:complexType name="ResolverResponse">
   <xs:all>
     <xs:element ref="jxta:Cred" minOccurs="0"/>
     <xs:element name="HandlerName" type="xs:string"/>
     <xs:element name="QueryID" type="xs:string"/>
     <xs:element name="Response" type="xs:anyType"/>
   </xs:all>
 </xs:complexType>

See Also:
JXTA Protocols Specification : Peer Resolver Protocol

Field Summary
 
Fields inherited from class net.jxta.protocol.ResolverResponseMsg
queryid
 
Constructor Summary
ResolverResponse()
          Standard Constructor for new instances.
ResolverResponse(Element root)
          Construct from a StructuredDocument
ResolverResponse(String HandlerName, StructuredDocument Credential, int QueryId, String Response)
          Deprecated. use the individual accessor methods instead.
 
Method Summary
 Document getDocument(MimeMediaType asMimeType)
          Write advertisement into a document. asMimeType is a mime media-type specification and provides the form of the document which is being requested.
 RouteAdvertisement getSrcPeerRoute()
          Get optional route information that may be attached to the response.
 void readIt(TextElement doc)
           
 void setSrcPeerRoute(RouteAdvertisement route)
          Set optional route information as part of the response.
 String toString()
          

Result is the response as an XML string.

 
Methods inherited from class net.jxta.protocol.ResolverResponseMsg
getAdvertisementType, getCredential, getHandlerName, getQueryId, getResponse, setCredential, setHandlerName, setQueryId, setResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResolverResponse

public ResolverResponse()
Standard Constructor for new instances.


ResolverResponse

@Deprecated
public ResolverResponse(String HandlerName,
                                   StructuredDocument Credential,
                                   int QueryId,
                                   String Response)
Deprecated. use the individual accessor methods instead.

Construct a doc from strings

Parameters:
HandlerName - the handler name
Credential - the credential doc
QueryId - query ID
Response - the response

ResolverResponse

public ResolverResponse(Element root)
Construct from a StructuredDocument

Parameters:
root - the element
Method Detail

readIt

public void readIt(TextElement doc)

getDocument

public Document getDocument(MimeMediaType asMimeType)
Write advertisement into a document. asMimeType is a mime media-type specification and provides the form of the document which is being requested. Two standard document forms are defined. "text/text" encodes the document in a form nice for printing out and "text/xml" which provides an XML format.

Specified by:
getDocument in class ResolverResponseMsg
Parameters:
asMimeType - mime-type representation requested for that document
Returns:
Document document representing the advertisement

toString

public String toString()

Result is the response as an XML string.

Overrides:
toString in class Object

setSrcPeerRoute

public void setSrcPeerRoute(RouteAdvertisement route)
Set optional route information as part of the response. This information is just attached to the response and will not be sent as part of the response

Specified by:
setSrcPeerRoute in class ResolverResponseMsg
Parameters:
route - RouteAdvertisement to send the response

getSrcPeerRoute

public RouteAdvertisement getSrcPeerRoute()
Get optional route information that may be attached to the response. This information is just attached to the response and will not be sent as part of the response

Specified by:
getSrcPeerRoute in class ResolverResponseMsg
Returns:
RouteAdvertisement to send the response

JXSE