com.echomine.jabber
Class MsgSessionInit

java.lang.Object
  extended by com.echomine.jabber.JabberMessage
      extended by com.echomine.jabber.MsgSessionInit

public class MsgSessionInit
extends JabberMessage

represents the initial message that gets sent out. This message is the first message initiated by the client to establish an active session. Once session starts, the rest is parsed and handled accordingly.

Conforms to XMPP 1.0 (Stream version 1.0)


Field Summary
 
Fields inherited from class com.echomine.jabber.JabberMessage
messageID
 
Constructor Summary
MsgSessionInit(java.lang.String to)
          sets only the to.
MsgSessionInit(java.lang.String from, java.lang.String sessionID, java.lang.String version)
          sets the from and session id.
 
Method Summary
 java.lang.String encode()
          encode is only used for outgoing messages only
 java.lang.String getMessageID()
          the session init method uses the "to" and "from" as the main id, not the generated id itself.
 int getMessageType()
          the default message type for message init is arbitrary and defined only in the Muse itself.
 java.lang.String getServerName()
           
 java.lang.String getSessionID()
           
 java.lang.String getVersion()
           
 void setServerName(java.lang.String serverName)
           
 void setVersion(java.lang.String version)
          sets the version for the stream
 java.lang.String toString()
           
 
Methods inherited from class com.echomine.jabber.JabberMessage
getReplyMessage, getTimeout, getXMessage, getXMessages, interrupt, isReplyRequired, isSendXMessages, isSynchronized, replyReceived, setMessageID, setReplyRequired, setSendXMessages, setSynchronized, setTimeout, setXMessage, setXMessages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MsgSessionInit

public MsgSessionInit(java.lang.String to)
sets only the to. This automatically indicates that this message is outgoing. outgoing message also requires waiting for a reply.

Parameters:
to - the server name that the client is connecting to

MsgSessionInit

public MsgSessionInit(java.lang.String from,
                      java.lang.String sessionID,
                      java.lang.String version)
sets the from and session id. This is normally the constructor used for incoming messages.

Parameters:
from - the server name that is received from the server
sessionID - the session id associated with this connection as received from the server
version - the version number of the accepted stream, null if no version (1.0 will be assumed)
Method Detail

encode

public java.lang.String encode()
encode is only used for outgoing messages only

Specified by:
encode in class JabberMessage

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
the message based on the type of the message it is

getServerName

public java.lang.String getServerName()

setServerName

public void setServerName(java.lang.String serverName)

getSessionID

public java.lang.String getSessionID()
Returns:
the unique session id sent by the server

getMessageID

public java.lang.String getMessageID()
the session init method uses the "to" and "from" as the main id, not the generated id itself. Thus, the method is overridden to work with this behavior.

Overrides:
getMessageID in class JabberMessage

getMessageType

public int getMessageType()
the default message type for message init is arbitrary and defined only in the Muse itself.

Specified by:
getMessageType in class JabberMessage
Returns:
a message code that is unique to the message
See Also:
JabberCode

getVersion

public java.lang.String getVersion()
Returns:
the version of the stream

setVersion

public void setVersion(java.lang.String version)
sets the version for the stream



Copyright © 2001-2005 Echomine. All Rights Reserved.