Class JingleNegotiator

java.lang.Object
org.jivesoftware.smackx.jingleold.JingleNegotiator
Direct Known Subclasses:
ContentNegotiator, JingleSession, MediaNegotiator, TransportNegotiator

public abstract class JingleNegotiator extends Object
Basic Jingle negotiator.

JingleNegotiator implements some basic behavior for every Jingle negotiation. It implements a "state" pattern: each stage should process Jingle packets and act depending on the current state in the negotiation...

  • Field Details

  • Constructor Details

  • Method Details

    • getNegotiatorState

    • setNegotiatorState

    • getConnection

    • getSession

      Get the XMPP connection associated with this negotiation.
      Returns:
      the connection
    • setSession

      public void setSession(JingleSession session)
      Set the XMPP connection associated.
      Parameters:
      session - the jingle session
    • addExpectedId

      public void addExpectedId(String id)
      Add expected ID.
      Parameters:
      id - TODO javadoc me please
    • isExpectedId

      public boolean isExpectedId(String id)
      Check if the passed ID is the expected ID.
      Parameters:
      id - TODO javadoc me please
      Returns:
      true if is expected id
    • removeExpectedId

      public void removeExpectedId(String id)
      Remove and expected ID.
      Parameters:
      id - TODO javadoc me please
    • addListener

      public void addListener(JingleListener li)
      Add a Jingle session listener to listen to incoming session requests.
      Parameters:
      li - The listener
      See Also:
    • removeListener

      public void removeListener(JingleListener li)
      Removes a Jingle session listener.
      Parameters:
      li - The jingle session listener to be removed
      See Also:
    • getListenersList

      Get a copy of the listeners
      Returns:
      a copy of the listeners
    • dispatchIncomingPacket

      Dispatch an incoming packet. The negotiators form a tree relationship that roughly matches the Jingle stanza format: JingleSession Content Negotiator Media Negotiator Transport Negotiator Content Negotiator Media Negotiator Transport Negotiator <jingle> <content> <description> <transport> <content> <description> <transport> This way, each segment of a Jingle stanza has a corresponding negotiator that know how to deal with that part of the Jingle packet. It also allows us to support Jingle packets of arbitrary complexity. Each parent calls dispatchIncomingPacket for each of its children. The children then pass back a List of results that will get sent when we reach the top level negotiator (JingleSession).
      Parameters:
      iq - the stanza received
      id - the ID of the response that will be sent
      Returns:
      the new stanza to send (either a Jingle or an IQ error).
      Throws:
      XMPPException - if an XMPP protocol error was received.
      SmackException - if Smack detected an exceptional situation.
      InterruptedException - if the calling thread was interrupted.
    • start

      public void start()
    • isStarted

      public boolean isStarted()
    • doStart

      protected abstract void doStart()
      Each of the negotiators has their individual behavior when they start.
    • close

      public void close()
      Close the negotiation.