org.jivesoftware.smackx.jingle
Class ContentNegotiator

java.lang.Object
  extended by org.jivesoftware.smackx.jingle.JingleNegotiator
      extended by org.jivesoftware.smackx.jingle.ContentNegotiator

public class ContentNegotiator
extends JingleNegotiator

Author:
Jeff Williams

Field Summary
static java.lang.String INITIATOR
           
static java.lang.String RESPONDER
           
 
Constructor Summary
ContentNegotiator(JingleSession session, java.lang.String inCreator, java.lang.String inName)
           
 
Method Summary
 void addTransportNegotiator(TransportNegotiator transportNegotiator)
           
 void close()
          Prepare to close the media manager.
 java.util.List<IQ> dispatchIncomingPacket(IQ iq, java.lang.String id)
          Dispatch an incoming packet.
 java.lang.String getCreator()
           
 JingleContent getJingleContent()
           
 JingleMediaSession getJingleMediaSession()
          Get the JingleMediaSession of this Jingle Session
 MediaNegotiator getMediaNegotiator()
          Obtain the description negotiator for this session
 java.lang.String getName()
           
 JingleNegotiatorState getNegotiatorState()
          The negotiator state for the ContentNegotiators is a special case.
 JingleTransportManager getTransportManager()
           
 TransportNegotiator getTransportNegotiator()
          Obtain the transport negotiator for this session.
 boolean isFullyEstablished()
          Return true if the transport and content negotiators have finished
 void setJingleTransportManager(JingleTransportManager jingleTransportManager)
           
 void stopJingleMediaSession()
          Stop a Jingle media session.
 void triggerContentEstablished()
           
 
Methods inherited from class org.jivesoftware.smackx.jingle.JingleNegotiator
addExpectedId, addListener, getConnection, getSession, isExpectedId, isStarted, removeExpectedId, removeListener, setNegotiatorState, setSession, start
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIATOR

public static final java.lang.String INITIATOR
See Also:
Constant Field Values

RESPONDER

public static final java.lang.String RESPONDER
See Also:
Constant Field Values
Constructor Detail

ContentNegotiator

public ContentNegotiator(JingleSession session,
                         java.lang.String inCreator,
                         java.lang.String inName)
Method Detail

dispatchIncomingPacket

public java.util.List<IQ> dispatchIncomingPacket(IQ iq,
                                                 java.lang.String id)
                                          throws XMPPException
Description copied from class: JingleNegotiator
Dispatch an incoming packet. The negotiators form a tree relationship that roughly matches the Jingle packet format: JingleSession Content Negotiator Media Negotiator Transport Negotiator Content Negotiator Media Negotiator Transport Negotiator This way, each segment of a Jingle packet 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 arbitraty 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).

Specified by:
dispatchIncomingPacket in class JingleNegotiator
Parameters:
iq - the packet received
id - the ID of the response that will be sent
Returns:
the new packet to send (either a Jingle or an IQ error).
Throws:
XMPPException

getCreator

public java.lang.String getCreator()

getName

public java.lang.String getName()

getJingleMediaSession

public JingleMediaSession getJingleMediaSession()
Get the JingleMediaSession of this Jingle Session

Returns:
the JingleMediaSession

addTransportNegotiator

public void addTransportNegotiator(TransportNegotiator transportNegotiator)

setJingleTransportManager

public void setJingleTransportManager(JingleTransportManager jingleTransportManager)
Parameters:
jingleTransportManager -

getTransportManager

public JingleTransportManager getTransportManager()
Returns:

close

public void close()
Prepare to close the media manager.

Overrides:
close in class JingleNegotiator

getMediaNegotiator

public MediaNegotiator getMediaNegotiator()
Obtain the description negotiator for this session

Returns:
the description negotiator

getTransportNegotiator

public TransportNegotiator getTransportNegotiator()
Obtain the transport negotiator for this session.

Returns:
the transport negotiator instance

isFullyEstablished

public boolean isFullyEstablished()
Return true if the transport and content negotiators have finished


getJingleContent

public JingleContent getJingleContent()

triggerContentEstablished

public void triggerContentEstablished()

stopJingleMediaSession

public void stopJingleMediaSession()
Stop a Jingle media session.


getNegotiatorState

public JingleNegotiatorState getNegotiatorState()
The negotiator state for the ContentNegotiators is a special case. It is a roll-up of the sub-negotiator states.

Overrides:
getNegotiatorState in class JingleNegotiator