Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber.extensions.jingle
Class ReasonPacketExtension

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.ReasonPacketExtension
All Implemented Interfaces:
org.jivesoftware.smack.packet.PacketExtension

public class ReasonPacketExtension
extends Object
implements org.jivesoftware.smack.packet.PacketExtension

The reason element provides human or machine-readable information explaining what prompted the action of the encapsulating jingle element.

Author:
Emil Ivov, Lyubomir Marinov

Field Summary
static String ELEMENT_NAME
          The name of the "content" element.
static String NAMESPACE
          The name space (or rather lack thereof ) that the reason element belongs to.
static String TEXT_ELEMENT_NAME
          The name of the text element.
 
Constructor Summary
ReasonPacketExtension(Reason reason, String text, org.jivesoftware.smack.packet.PacketExtension packetExtension)
          Creates a new ReasonPacketExtension instance with the specified reason String.
 
Method Summary
 String getElementName()
          Returns the root element name.
 String getNamespace()
          Returns the root element XML namespace.
 org.jivesoftware.smack.packet.PacketExtension getOtherExtension()
          Returns an extra extension containing further info about this action or null if no such extension has been specified.
 Reason getReason()
          Returns the reason string that this packet extension is transporting.
 String getText()
          Returns human-readable information about the reason for the action or null if no such information is currently available.
 void setOtherExtension(org.jivesoftware.smack.packet.PacketExtension otherExtension)
          Sets the extra extension containing further info about this action or null if no such extension has been specified.
 void setText(String text)
          Sets the human-readable information about the reason for the action or null if no such information is currently available
 String toXML()
          Returns the XML representation of the PacketExtension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final String NAMESPACE
The name space (or rather lack thereof ) that the reason element belongs to.

See Also:
Constant Field Values

ELEMENT_NAME

public static final String ELEMENT_NAME
The name of the "content" element.

See Also:
Constant Field Values

TEXT_ELEMENT_NAME

public static final String TEXT_ELEMENT_NAME
The name of the text element.

See Also:
Constant Field Values
Constructor Detail

ReasonPacketExtension

public ReasonPacketExtension(Reason reason,
                             String text,
                             org.jivesoftware.smack.packet.PacketExtension packetExtension)
Creates a new ReasonPacketExtension instance with the specified reason String.

Parameters:
reason - the reason string that we'd like to transport in this packet extension, which may or may not be one of the static strings defined here.
text - an element providing human-readable information about the reason for the action or null if no such information is currently available.
packetExtension - any other element that MAY be providing further information or null if no such element has been specified.
Method Detail

getReason

public Reason getReason()
Returns the reason string that this packet extension is transporting.

Returns:
the reason string that this packet extension is transporting.

getText

public String getText()
Returns human-readable information about the reason for the action or null if no such information is currently available.

Returns:
human-readable information about the reason for the action or null if no such information is currently available.

setText

public void setText(String text)
Sets the human-readable information about the reason for the action or null if no such information is currently available

Parameters:
text - the human-readable information about the reason for the action or null if no such information is currently available

getOtherExtension

public org.jivesoftware.smack.packet.PacketExtension getOtherExtension()
Returns an extra extension containing further info about this action or null if no such extension has been specified. This method returns the extension that XEP-0166 refers to the following way: the "reason" element MAY contain an element qualified by some other namespace that provides more detailed machine-readable information about the reason for the action.

Returns:
an extra extension containing further info about this action or null if no such extension has been specified.

setOtherExtension

public void setOtherExtension(org.jivesoftware.smack.packet.PacketExtension otherExtension)
Sets the extra extension containing further info about this action or null if no such extension has been specified.

Parameters:
otherExtension - the extra extension containing further info about this action or null if no such extension has been specified

getElementName

public String getElementName()
Returns the root element name.

Specified by:
getElementName in interface org.jivesoftware.smack.packet.PacketExtension
Returns:
the element name.

getNamespace

public String getNamespace()
Returns the root element XML namespace.

Specified by:
getNamespace in interface org.jivesoftware.smack.packet.PacketExtension
Returns:
the namespace.

toXML

public String toXML()
Returns the XML representation of the PacketExtension.

Specified by:
toXML in interface org.jivesoftware.smack.packet.PacketExtension
Returns:
the packet extension as XML.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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