pawn.messages
Class AppResponseMsg

java.lang.Object
  |
  +--pawn.messages.AppResponseMsg

public class AppResponseMsg
extends java.lang.Object

An example query response, which will be wrapped by a Resolver response message to send the response to the query. The response contains the answer to the simple math question posed by the query.


Constructor Summary
AppResponseMsg(java.io.InputStream stream)
          Creates a response object by parsing the given input stream.
AppResponseMsg(java.lang.String appID, java.lang.String clientID, int qt, java.lang.String msg, java.lang.String anAnswer)
          Creates a response object using the given answer value.
 
Method Summary
 java.lang.String getAnswer()
          Returns the answer for the response.
 java.lang.String getAppId()
           
 java.lang.String getClientId()
           
 net.jxta.document.Document getDocument(net.jxta.document.MimeMediaType asMimeType)
          Returns a Document representation of the response.
 java.lang.String getQueryMsg()
           
 int getQueryType()
           
 java.lang.String toString()
          Returns an XML String representation of the response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AppResponseMsg

public AppResponseMsg(java.lang.String appID,
                      java.lang.String clientID,
                      int qt,
                      java.lang.String msg,
                      java.lang.String anAnswer)
Creates a response object using the given answer value.

Parameters:
anAnswer - the answer for the response.

AppResponseMsg

public AppResponseMsg(java.io.InputStream stream)
               throws java.lang.Exception
Creates a response object by parsing the given input stream.

Parameters:
stream - the InputStream source of the response data.
Throws:
java.lang.Exception - if the message can't be parsed from the stream.
Method Detail

getAnswer

public java.lang.String getAnswer()
Returns the answer for the response.

Returns:
the answer value for the response.

getAppId

public java.lang.String getAppId()

getClientId

public java.lang.String getClientId()

getQueryType

public int getQueryType()

getQueryMsg

public java.lang.String getQueryMsg()

getDocument

public net.jxta.document.Document getDocument(net.jxta.document.MimeMediaType asMimeType)
                                       throws java.lang.Exception
Returns a Document representation of the response.

Parameters:
asMimeType - the desired MIME type representation for the response.
Returns:
a Document form of the response in the specified MIME representation.
Throws:
java.lang.Exception - if the document can't be created.

toString

public java.lang.String toString()
Returns an XML String representation of the response.

Overrides:
toString in class java.lang.Object
Returns:
the XML String representing this response.