Project JXTA

net.jxta.protocol
Class ResolverResponseMsg

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

public abstract class ResolverResponseMsg
extends Object

Generic Resolver Service message "Response".

See Also:
ResolverService, ResolverQueryMsg, JXTA Protocols Specification : Peer Resolver Protocol

Field Summary
 int queryid
          Description of the Field
 
Constructor Summary
ResolverResponseMsg()
           
 
Method Summary
static String getAdvertisementType()
          All messages have a type (in xml this is !
 StructuredDocument getCredential()
          returns the credential
abstract  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.
 String getHandlerName()
          returns the handlername
 int getQueryId()
          returns queryid value
 String getResponse()
          returns the response body for this message.
abstract  RouteAdvertisement getSrcPeerRoute()
          Get optional route information that may be attached to the response.
 void setCredential(StructuredDocument cred)
          set the credential for this response.
 void setHandlerName(String name)
          set the handlername
 void setQueryId(int id)
          set the query id to which this message is a response.
 void setResponse(String response)
          Set the response body for this message.
abstract  void setSrcPeerRoute(RouteAdvertisement route)
          Set optional route information as part of the response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queryid

public int queryid
Description of the Field

Constructor Detail

ResolverResponseMsg

public ResolverResponseMsg()
Method Detail

getCredential

public StructuredDocument getCredential()
returns the credential

Returns:
StructuredDocument credential

getDocument

public abstract 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.

Parameters:
asMimeType - mime-type representation requested for that document
Returns:
Document document representing the advertisement

setSrcPeerRoute

public abstract void setSrcPeerRoute(RouteAdvertisement route)
Set optional route information as part of the response. This information is just attached to the response and is ONLY used by the resolver service. This information will not be sent as part of the response msg and is not part of the resolver response wire format protocol.

Parameters:
route - RouteAdvertisement to send the response

getSrcPeerRoute

public abstract RouteAdvertisement getSrcPeerRoute()
Get optional route information that may be attached to the response. This information is just attached to the response and is only used internally by the resolver service. This information will not be sent as part of the response msg and is not part of the resolver response wire format.

Returns:
RouteAdvertisement to send the response

getHandlerName

public String getHandlerName()
returns the handlername

Returns:
String handlername name

getQueryId

public int getQueryId()
returns queryid value

Returns:
int queryid value

getResponse

public String getResponse()
returns the response body for this message.

Returns:
the response body represented as a string.

setCredential

public void setCredential(StructuredDocument cred)
set the credential for this response.

Parameters:
cred - string credential

setHandlerName

public void setHandlerName(String name)
set the handlername

Parameters:
name - string handlername

setQueryId

public void setQueryId(int id)
set the query id to which this message is a response.

Parameters:
id - the query id for this response.

setResponse

public void setResponse(String response)
Set the response body for this message.

Parameters:
response - response body as a string.

getAdvertisementType

public static String getAdvertisementType()
All messages have a type (in xml this is !doctype) which identifies the message

Returns:
String type of the advertisement

JXTA J2SE