java.lang.Object
org.jivesoftware.smack.packet.Stanza
org.jivesoftware.smack.packet.IQ
org.jivesoftware.smackx.jingleold.packet.Jingle
All Implemented Interfaces:
org.jivesoftware.smack.packet.Element, org.jivesoftware.smack.packet.IqView, org.jivesoftware.smack.packet.NamedElement, org.jivesoftware.smack.packet.StanzaView, org.jivesoftware.smack.packet.TopLevelStreamElement, org.jivesoftware.smack.packet.XmlElement, org.jivesoftware.smack.packet.XmlLangElement

public class Jingle extends org.jivesoftware.smack.packet.IQ
An Jingle sub-packet, which is used by XMPP clients to exchange info like descriptions and transports. The following link summarizes the requirements of Jingle IM: Valid tags. Warning: this is an non-standard protocol documented by XEP-166. Because this is a non-standard protocol, it is subject to change.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.jivesoftware.smack.packet.IQ

    org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder, org.jivesoftware.smack.packet.IQ.ResponseType, org.jivesoftware.smack.packet.IQ.Type
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     

    Fields inherited from class org.jivesoftware.smack.packet.IQ

    IQ_ELEMENT, QUERY_ELEMENT

    Fields inherited from class org.jivesoftware.smack.packet.Stanza

    DEFAULT_LANGUAGE, ITEM, language, TEXT
  • Constructor Summary

    Constructors
    Constructor
    Description
    The default constructor.
    A constructor where the session ID can be specified.
    A constructor where the main components can be initialized.
    A constructor where the action can be specified.
    Constructor with a contents.
    Constructor with a content info.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add a new content.
    void
    Add a list of JingleContent elements.
    Get the action specified in the packet.
    Jingle content info.
    Get an iterator for the contents.
    Get an iterator for the content.
    org.jxmpp.jid.Jid
    Get the initiator.
    protected org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder
    getIQChildElementBuilder(org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder buf)
    Return the XML representation of the packet.
    org.jxmpp.jid.Jid
    Get the responder.
    static int
    getSessionHash(String sid, org.jxmpp.jid.Jid initiator)
    Get a hash key for the session this stanza belongs to.
    Returns the session ID related to the session.
    void
    Set the action in the packet.
    void
    Set content info.
    void
    setInitiator(org.jxmpp.jid.Jid initiator)
    Set the initiator.
    void
    setResponder(org.jxmpp.jid.Jid resp)
    Set the responder.
    final void
    Set the session ID related to this session.

    Methods inherited from class org.jivesoftware.smack.packet.IQ

    createErrorResponse, createErrorResponse, createResultIQ, getChildElementName, getChildElementNamespace, getChildElementQName, getChildElementXML, getElementName, getType, setType, toString, toXML

    Methods inherited from class org.jivesoftware.smack.packet.Stanza

    addCommonAttributes, addExtension, addExtensions, appendErrorIfExists, getDefaultLanguage, getError, getExtension, getExtension, getExtensionElement, getExtensions, getExtensions, getExtensions, getExtensions, getExtensionsMap, getFrom, getLanguage, getNamespace, getStanzaId, getTo, hasExtension, hasExtension, hasStanzaIdSet, logCommonAttributes, overrideExtension, removeExtension, setError, setFrom, setNewStanzaId, setStanzaId, setTo, throwIfNoStanzaId

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.jivesoftware.smack.packet.Element

    toXML, toXML

    Methods inherited from interface org.jivesoftware.smack.packet.IqView

    isRequestIQ, isResponseIQ

    Methods inherited from interface org.jivesoftware.smack.packet.StanzaView

    getError, getExtension, getExtension, getExtensions, getExtensions, getExtensions, getFrom, getStanzaId, getTo, hasExtension, hasExtension, hasExtension

    Methods inherited from interface org.jivesoftware.smack.packet.XmlElement

    getQName
  • Field Details

  • Constructor Details

    • Jingle

      public Jingle(List<JingleContent> contents, JingleContentInfo mi, String sid)
      A constructor where the main components can be initialized.
      Parameters:
      contents - the contents.
      mi - the jingle content info
      sid - the sid.
    • Jingle

      public Jingle(JingleContent content)
      Constructor with a contents.
      Parameters:
      content - a content
    • Jingle

      public Jingle(JingleContentInfo info)
      Constructor with a content info.
      Parameters:
      info - The content info
    • Jingle

      public Jingle(JingleActionEnum action)
      A constructor where the action can be specified.
      Parameters:
      action - The action.
    • Jingle

      public Jingle(String sid)
      A constructor where the session ID can be specified.
      Parameters:
      sid - The session ID related to the negotiation.
      See Also:
    • Jingle

      public Jingle()
      The default constructor.
  • Method Details

    • setSid

      public final void setSid(String sid)
      Set the session ID related to this session. The session ID is a unique identifier generated by the initiator. This should match the XML Nmtoken production so that XML character escaping is not needed for characters such as &.
      Parameters:
      sid - the session ID
    • getSid

      public String getSid()
      Returns the session ID related to the session. The session ID is a unique identifier generated by the initiator. This should match the XML Nmtoken production so that XML character escaping is not needed for characters such as &.
      Returns:
      Returns the session ID related to the session.
      See Also:
    • getContentInfo

      public JingleContentInfo getContentInfo()
      Jingle content info.
      Returns:
      the audioInfo.
    • setContentInfo

      public void setContentInfo(JingleContentInfo contentInfo)
      Set content info.
      Parameters:
      contentInfo - the audioInfo to set.
    • getContents

      public Iterator<JingleContent> getContents()
      Get an iterator for the contents.
      Returns:
      the contents
    • getContentsList

      public List<JingleContent> getContentsList()
      Get an iterator for the content.
      Returns:
      the contents
    • addContent

      public void addContent(JingleContent content)
      Add a new content.
      Parameters:
      content - the content to add
    • addContents

      public void addContents(List<JingleContent> contentList)
      Add a list of JingleContent elements.
      Parameters:
      contentList - the list of contents to add
    • getAction

      public JingleActionEnum getAction()
      Get the action specified in the packet.
      Returns:
      the action
    • setAction

      public void setAction(JingleActionEnum action)
      Set the action in the packet.
      Parameters:
      action - the action to set
    • getInitiator

      public org.jxmpp.jid.Jid getInitiator()
      Get the initiator. The initiator will be the full JID of the entity that has initiated the flow (which may be different to the "from" address in the IQ)
      Returns:
      the initiator
    • setInitiator

      public void setInitiator(org.jxmpp.jid.Jid initiator)
      Set the initiator. The initiator must be the full JID of the entity that has initiated the flow (which may be different to the "from" address in the IQ)
      Parameters:
      initiator - the initiator to set
    • getResponder

      public org.jxmpp.jid.Jid getResponder()
      Get the responder. The responder is the full JID of the entity that has replied to the initiation (which may be different to the "to" address in the IQ).
      Returns:
      the responder
    • setResponder

      public void setResponder(org.jxmpp.jid.Jid resp)
      Set the responder. The responder must be the full JID of the entity that has replied to the initiation (which may be different to the "to" address in the IQ).
      Parameters:
      resp - the responder to set
    • getSessionHash

      public static int getSessionHash(String sid, org.jxmpp.jid.Jid initiator)
      Get a hash key for the session this stanza belongs to.
      Parameters:
      sid - The session id
      initiator - The initiator
      Returns:
      A hash key
    • getIQChildElementBuilder

      protected org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder buf)
      Return the XML representation of the packet.
      Specified by:
      getIQChildElementBuilder in class org.jivesoftware.smack.packet.IQ
      Returns:
      the XML string