pawn.messages
Class InitiateChatRequest

java.lang.Object
  |
  +--pawn.messages.InitiateChatRequestMessage
        |
        +--pawn.messages.InitiateChatRequest

public class InitiateChatRequest
extends InitiateChatRequestMessage

An implementation of the InitiateChatRequestMessage abstract class. This class is responsible for parsing and formatting the XML document used to define a request to initiate a chat session.


Constructor Summary
InitiateChatRequest()
          Creates a new request object.
InitiateChatRequest(java.io.InputStream stream)
          Creates a new Initiate Chat Request Message by parsing the given stream.
 
Method Summary
 net.jxta.document.Document getDocument(net.jxta.document.MimeMediaType asMimeType)
          Returns a Document object containing the request's document tree.
 void readDocument(net.jxta.document.TextElement document)
          Parses the given document tree for the request.
 java.lang.String toString()
          Returns an XML String representation of the request.
 
Methods inherited from class pawn.messages.InitiateChatRequestMessage
getEmailAddress, getName, setEmailAddress, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InitiateChatRequest

public InitiateChatRequest()
Creates a new request object.


InitiateChatRequest

public InitiateChatRequest(java.io.InputStream stream)
                    throws java.io.IOException,
                           java.lang.IllegalArgumentException
Creates a new Initiate Chat Request Message by parsing the given stream.

Parameters:
stream - the InputStream source of the query data.
Throws:
java.io.IOException - if the query can't be parsed from the stream.
java.lang.IllegalArgumentException - thrown if the data does not contain a Presence Query Message.
Method Detail

getDocument

public net.jxta.document.Document getDocument(net.jxta.document.MimeMediaType asMimeType)
                                       throws java.lang.IllegalArgumentException
Returns a Document object containing the request's document tree.

Specified by:
getDocument in class InitiateChatRequestMessage
Parameters:
asMimeType - the desired MIME type for the request rendering.
Returns:
the Document containing the request's document object tree.
Throws:
java.lang.IllegalArgumentException - thrown if the email address is null.

readDocument

public void readDocument(net.jxta.document.TextElement document)
                  throws java.lang.IllegalArgumentException
Parses the given document tree for the request.

Parameters:
document - the object containing the request data.
Throws:
java.lang.IllegalArgumentException - if the document is not a chat request, as expected.

toString

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

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