Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber.extensions.gtalk
Class SessionIQ

java.lang.Object
  extended by org.jivesoftware.smack.packet.Packet
      extended by org.jivesoftware.smack.packet.IQ
          extended by net.java.sip.communicator.impl.protocol.jabber.extensions.gtalk.SessionIQ

public class SessionIQ
extends org.jivesoftware.smack.packet.IQ

A straightforward extension of the IQ. A SessionIQ object is created by smack via the SessionIQProvider. It contains all the information extracted from a Session IQ.

Author:
Sebastien Vincent

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jivesoftware.smack.packet.IQ
org.jivesoftware.smack.packet.IQ.Type
 
Field Summary
static String ELEMENT_NAME
          The name of the element that contains the session data.
static String ID_ATTR_NAME
          The name of the argument that contains the session id.
static String INITIATOR_ATTR_NAME
          The name of the argument that contains the "initiator" jid.
static String NAMESPACE
          The name space that session belongs to.
static String TYPE_ATTR_NAME
          The name of the argument that contains the session type value.
 
Fields inherited from class org.jivesoftware.smack.packet.Packet
DEFAULT_LANGUAGE, ID_NOT_AVAILABLE
 
Constructor Summary
SessionIQ()
           
 
Method Summary
static String generateSID()
          Generates a random String usable as a session ID.
 String getChildElementXML()
          Returns the XML string of this GTalk session IQ's "section" sub-element.
 GTalkType getGTalkType()
          Returns the value of this element's action attribute.
 String getID()
          Returns this element's session ID value.
 String getInitiator()
          Returns the full JID of the entity that has initiated the session flow.
 ReasonPacketExtension getReason()
          Returns this IQ's reason extension.
 void setGTalkType(GTalkType gtalkType)
          Sets the value of this element's action attribute.
 void setID(String id)
          Sets this element's session ID value.
 void setInitiator(String initiator)
          Sets the full JID of the entity that has initiated the session flow.
 void setReason(ReasonPacketExtension reason)
          Specifies this IQ's reason extension.
 
Methods inherited from class org.jivesoftware.smack.packet.IQ
createErrorResponse, createResultIQ, getType, setType, toXML
 
Methods inherited from class org.jivesoftware.smack.packet.Packet
addExtension, deleteProperty, equals, getDefaultLanguage, getError, getExtension, getExtension, getExtensions, getExtensionsXML, getFrom, getPacketID, getProperty, getPropertyNames, getTo, getXmlns, hashCode, nextID, removeExtension, setDefaultXmlns, setError, setFrom, setPacketID, setProperty, setTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final String NAMESPACE
The name space that session belongs to.

See Also:
Constant Field Values

ELEMENT_NAME

public static final String ELEMENT_NAME
The name of the element that contains the session data.

See Also:
Constant Field Values

TYPE_ATTR_NAME

public static final String TYPE_ATTR_NAME
The name of the argument that contains the session type value.

See Also:
Constant Field Values

INITIATOR_ATTR_NAME

public static final String INITIATOR_ATTR_NAME
The name of the argument that contains the "initiator" jid.

See Also:
Constant Field Values

ID_ATTR_NAME

public static final String ID_ATTR_NAME
The name of the argument that contains the session id.

See Also:
Constant Field Values
Constructor Detail

SessionIQ

public SessionIQ()
Method Detail

setID

public void setID(String id)
Sets this element's session ID value.

Parameters:
id - the session ID to set

getID

public String getID()
Returns this element's session ID value.

Returns:
this element's session ID.

generateSID

public static String generateSID()
Generates a random String usable as a session ID.

Returns:
a newly generated random sid String

setInitiator

public void setInitiator(String initiator)
Sets the full JID of the entity that has initiated the session flow. Only present when the GTalkType is accept.

Parameters:
initiator - the full JID of the initiator.

getInitiator

public String getInitiator()
Returns the full JID of the entity that has initiated the session flow. Only present when the GTalkType is session-accept.

Returns:
the full JID of the initiator.

setGTalkType

public void setGTalkType(GTalkType gtalkType)
Sets the value of this element's action attribute. The value of the 'action' attribute MUST be one of the values enumerated here. If an entity receives a value not defined here, it MUST ignore the attribute and MUST return a bad-request error to the sender. There is no default value for the 'action' attribute.

Parameters:
gtalkType - the value of the action attribute.

getGTalkType

public GTalkType getGTalkType()
Returns the value of this element's action attribute. The value of the 'action' attribute MUST be one of the values enumerated here. If an entity receives a value not defined here, it MUST ignore the attribute and MUST return a bad-request error to the sender. There is no default value for the 'action' attribute.

Returns:
the value of the action attribute.

setReason

public void setReason(ReasonPacketExtension reason)
Specifies this IQ's reason extension. The reason extension in a session IQ provides machine and possibly human -readable information about the reason for the action.

Parameters:
reason - this IQ's reason extension.

getReason

public ReasonPacketExtension getReason()
Returns this IQ's reason extension. The reason extension in a session IQ provides machine and possibly human -readable information about the reason for the action.

Returns:
this IQ's reason extension.

getChildElementXML

public String getChildElementXML()
Returns the XML string of this GTalk session IQ's "section" sub-element. Extensions of this class must override this method.

Specified by:
getChildElementXML in class org.jivesoftware.smack.packet.IQ
Returns:
the child element section of the IQ XML.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.