Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

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

public class ContentPacketExtension
extends AbstractPacketExtension

The Jingle "content" element contains the entire description of the session being initiated. Among other things it contains details such as transport, or (in the case of RTP) payload type list.

Author:
Emil Ivov

Nested Class Summary
static class ContentPacketExtension.CreatorEnum
          The values we currently support for the creator field.
static class ContentPacketExtension.SendersEnum
          The values we currently support for the senders field.
 
Field Summary
static String CREATOR_ATTR_NAME
          The name of the "creator" argument.
static String DISPOSITION_ATTR_NAME
          The name of the "disposition" argument.
static String ELEMENT_NAME
          The name of the "content" element.
static String NAME_ATTR_NAME
          The name of the "name" argument.
static String SENDERS_ATTR_NAME
          The name of the "senders" argument.
 
Fields inherited from class net.java.sip.communicator.impl.protocol.jabber.extensions.AbstractPacketExtension
attributes
 
Constructor Summary
ContentPacketExtension()
          Creates a new ContentPacketExtension.
ContentPacketExtension(ContentPacketExtension.CreatorEnum creator, String name)
          Creates a new ContentPacketExtension instance with the specified parameters.
ContentPacketExtension(ContentPacketExtension.CreatorEnum creator, String disposition, String name, ContentPacketExtension.SendersEnum senders)
          Creates a new ContentPacketExtension.
 
Method Summary
 ContentPacketExtension.CreatorEnum getCreator()
          Returns the value of the creator argument.
 String getDisposition()
          Returns the value of the disposition argument if it exists or null if it doesn't.
 String getName()
          Returns the value of the name argument if it exists or null if it doesn't.
 ContentPacketExtension.SendersEnum getSenders()
          Returns the value of the senders argument which indicates the parties that will be generating content in this session; the allowable values are defined in the SendersEnum.
 void setCreator(ContentPacketExtension.CreatorEnum creator)
          Sets the value of the creator argument.
 void setDisposition(String disposition)
          Sets the value of the disposition argument if it exists or null if it doesn't.
 void setName(String name)
          Sets the value of the name argument if it exists or null if it doesn't.
 void setSenders(ContentPacketExtension.SendersEnum senders)
          Sets the value of the senders argument which indicates the parties that will be generating content in this session; the allowable values are defined in the SendersEnum.
 
Methods inherited from class net.java.sip.communicator.impl.protocol.jabber.extensions.AbstractPacketExtension
addChildExtension, getAttribute, getAttributeAsInt, getAttributeAsInt, getAttributeAsString, getAttributeAsURI, getAttributeNames, getChildExtensions, getChildExtensionsOfType, getElementName, getFirstChildOfType, getNamespace, getText, removeAttribute, setAttribute, setNamespace, setText, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT_NAME

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

See Also:
Constant Field Values

CREATOR_ATTR_NAME

public static final String CREATOR_ATTR_NAME
The name of the "creator" argument.

See Also:
Constant Field Values

DISPOSITION_ATTR_NAME

public static final String DISPOSITION_ATTR_NAME
The name of the "disposition" argument.

See Also:
Constant Field Values

NAME_ATTR_NAME

public static final String NAME_ATTR_NAME
The name of the "name" argument.

See Also:
Constant Field Values

SENDERS_ATTR_NAME

public static final String SENDERS_ATTR_NAME
The name of the "senders" argument.

See Also:
Constant Field Values
Constructor Detail

ContentPacketExtension

public ContentPacketExtension()
Creates a new ContentPacketExtension.


ContentPacketExtension

public ContentPacketExtension(ContentPacketExtension.CreatorEnum creator,
                              String disposition,
                              String name,
                              ContentPacketExtension.SendersEnum senders)
Creates a new ContentPacketExtension. instance with only required parameters.

Parameters:
creator - indicates which party originally generated the content type
disposition - indicates how the content definition is to be interpreted by the recipient
name - the content type according to the creator
senders - the parties in the session will be generating content.

ContentPacketExtension

public ContentPacketExtension(ContentPacketExtension.CreatorEnum creator,
                              String name)
Creates a new ContentPacketExtension instance with the specified parameters.

Parameters:
creator - indicates which party originally generated the content type interpreted by the recipient
name - the content type according to the creator
Method Detail

getCreator

public ContentPacketExtension.CreatorEnum getCreator()
Returns the value of the creator argument. The creator argument indicates which party originally generated the content type and is used to prevent race conditions regarding modifications; the defined values are "initiator" and "responder" (where the default is "initiator"). The value of the 'creator' attribute for a given content type MUST always match the party that originally generated the content type, even for Jingle actions that are sent by the other party in relation to that content type (e.g., subsequent content-modify or transport-info messages). The combination of the 'creator' attribute and the 'name' attribute is unique among both parties to a Jingle session.

Returns:
the value of this content's creator argument.

setCreator

public void setCreator(ContentPacketExtension.CreatorEnum creator)
Sets the value of the creator argument. The creator argument indicates which party originally generated the content type and is used to prevent race conditions regarding modifications; the defined values are "initiator" and "responder" (where the default is "initiator"). The value of the 'creator' attribute for a given content type MUST always match the party that originally generated the content type, even for Jingle actions that are sent by the other party in relation to that content type (e.g., subsequent content-modify or transport-info messages). The combination of the 'creator' attribute and the 'name' attribute is unique among both parties to a Jingle session.

Parameters:
creator - the value of this content's creator argument.

getDisposition

public String getDisposition()
Returns the value of the disposition argument if it exists or null if it doesn't. The disposition argument indicates how the content definition is to be interpreted by the recipient. The meaning of this attribute matches the "Content-Disposition" header as defined in RFC 2183 and applied to SIP by RFC 3261. The value of this attribute SHOULD be one of the values registered in the IANA Mail Content Disposition Values and Parameters Registry. The default value of this attribute is "session".

Returns:
the value of this content's disposition argument.

setDisposition

public void setDisposition(String disposition)
Sets the value of the disposition argument if it exists or null if it doesn't. The disposition argument indicates how the content definition is to be interpreted by the recipient. The meaning of this attribute matches the "Content-Disposition" header as defined in RFC 2183 and applied to SIP by RFC 3261. The value of this attribute SHOULD be one of the values registered in the IANA Mail Content Disposition Values and Parameters Registry. The default value of this attribute is "session".

Parameters:
disposition - the value of this content's disposition argument.

getName

public String getName()
Returns the value of the name argument if it exists or null if it doesn't. The name argument is a unique identifier for the content type according to the creator, which MAY have meaning to a human user in order to differentiate this content type from other content types (e.g., two content types containing video media could differentiate between "room-pan" and "slides"). If there are two content types with the same value for the 'name' attribute, they shall understood as alternative definitions for the same purpose (e.g., a legacy method and a standards-based method for establishing a voice call), typically to smooth the transition from an older technology to Jingle.

Returns:
the value of this content's name argument.

setName

public void setName(String name)
Sets the value of the name argument if it exists or null if it doesn't. The name argument is a unique identifier for the content type according to the creator, which MAY have meaning to a human user in order to differentiate this content type from other content types (e.g., two content types containing video media could differentiate between "room-pan" and "slides"). If there are two content types with the same value for the 'name' attribute, they shall understood as alternative definitions for the same purpose (e.g., a legacy method and a standards-based method for establishing a voice call), typically to smooth the transition from an older technology to Jingle.

Parameters:
name - the value of this content's name argument.

getSenders

public ContentPacketExtension.SendersEnum getSenders()
Returns the value of the senders argument which indicates the parties that will be generating content in this session; the allowable values are defined in the SendersEnum.

Returns:
a ContentPacketExtension.SendersEnum instance indicating the the parties that will be generating content in this session.

setSenders

public void setSenders(ContentPacketExtension.SendersEnum senders)
Sets the value of the senders argument which indicates the parties that will be generating content in this session; the allowable values are defined in the SendersEnum.

Parameters:
senders - a ContentPacketExtension.SendersEnum instance indicating the the parties that will be generating content in this session.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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