public class Jingle extends IQ
IQ.IQChildElementXmlStringBuilder, IQ.Type
Modifier and Type | Field and Description |
---|---|
static String |
NAMESPACE |
static String |
NODENAME |
IQ_ELEMENT, QUERY_ELEMENT
DEFAULT_LANGUAGE, ITEM, language, TEXT
Constructor and Description |
---|
Jingle()
The default constructor.
|
Jingle(JingleActionEnum action)
A constructor where the action can be specified.
|
Jingle(JingleContent content)
Constructor with a contents.
|
Jingle(JingleContentInfo info)
Constructor with a content info.
|
Jingle(List<JingleContent> contents,
JingleContentInfo mi,
String sid)
A constructor where the main components can be initialized.
|
Jingle(String sid)
A constructor where the session ID can be specified.
|
Modifier and Type | Method and Description |
---|---|
void |
addContent(JingleContent content)
Add a new content.
|
void |
addContents(List<JingleContent> contentList)
Add a list of JingleContent elements.
|
JingleActionEnum |
getAction()
Get the action specified in the packet.
|
JingleContentInfo |
getContentInfo()
Jingle content info.
|
Iterator<JingleContent> |
getContents()
Get an iterator for the contents.
|
List<JingleContent> |
getContentsList()
Get an iterator for the content.
|
static String |
getElementName()
Returns the XML element name of the extension sub-packet root element.
|
Jid |
getInitiator()
Get the initiator.
|
protected IQ.IQChildElementXmlStringBuilder |
getIQChildElementBuilder(IQ.IQChildElementXmlStringBuilder buf)
Return the XML representation of the packet.
|
static String |
getNamespace()
Returns the XML namespace of the extension sub-packet root element.
|
Jid |
getResponder()
Get the responder.
|
static int |
getSessionHash(String sid,
Jid initiator)
Get a hash key for the session this stanza belongs to.
|
String |
getSid()
Returns the session ID related to the session.
|
void |
setAction(JingleActionEnum action)
Set the action in the packet.
|
void |
setContentInfo(JingleContentInfo contentInfo)
Set content info.
|
void |
setInitiator(Jid initiator)
Set the initiator.
|
void |
setResponder(Jid resp)
Set the responder.
|
void |
setSid(String sid)
Set the session ID related to this session.
|
createErrorResponse, createErrorResponse, createErrorResponse, createResultIQ, getChildElementName, getChildElementNamespace, getChildElementXML, getChildElementXML, getType, initializeAsResultFor, initialzeAsResultFor, isRequestIQ, setType, toString, toXML
addCommonAttributes, addExtension, addExtensions, appendErrorIfExists, getDefaultLanguage, getError, getExtension, getExtension, getExtensions, getExtensions, getFrom, getLanguage, getPacketID, getStanzaId, getTo, hasExtension, hasExtension, hasStanzaIdSet, logCommonAttributes, overrideExtension, removeExtension, removeExtension, setError, setError, setFrom, setFrom, setLanguage, setPacketID, setStanzaId, setStanzaId, setTo, setTo
public static final String NAMESPACE
public static final String NODENAME
public Jingle(List<JingleContent> contents, JingleContentInfo mi, String sid)
public Jingle(JingleContent content)
content
- a contentpublic Jingle(JingleContentInfo info)
info
- The content infopublic Jingle(JingleActionEnum action)
action
- The action.public Jingle(String sid)
sid
- The session ID related to the negotiation.setSid(String)
public Jingle()
public final void setSid(String sid)
sid
- the session IDpublic String getSid()
setSid(String)
public static String getElementName()
public static String getNamespace()
public JingleContentInfo getContentInfo()
public void setContentInfo(JingleContentInfo contentInfo)
contentInfo
- the audioInfo to set.public Iterator<JingleContent> getContents()
public List<JingleContent> getContentsList()
public void addContent(JingleContent content)
content
- the content to addpublic void addContents(List<JingleContent> contentList)
contentList
- the list of contents to addpublic JingleActionEnum getAction()
public void setAction(JingleActionEnum action)
action
- the action to setpublic Jid getInitiator()
public void setInitiator(Jid initiator)
initiator
- the initiator to setpublic Jid getResponder()
public void setResponder(Jid resp)
resp
- the responder to setpublic static int getSessionHash(String sid, Jid initiator)
sid
- The session idinitiator
- The initiatorprotected IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(IQ.IQChildElementXmlStringBuilder buf)
getIQChildElementBuilder
in class IQ
buf
- a pre-created builder which already has the child element and the 'xmlns' attribute set.