Class ContentNegotiator
- java.lang.Object
-
- org.jivesoftware.smackx.jingleold.JingleNegotiator
-
- org.jivesoftware.smackx.jingleold.ContentNegotiator
-
public class ContentNegotiator extends JingleNegotiator
Content negotiator.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
INITIATOR
static java.lang.String
RESPONDER
-
Fields inherited from class org.jivesoftware.smackx.jingleold.JingleNegotiator
session
-
-
Constructor Summary
Constructors Constructor Description ContentNegotiator(JingleSession session, java.lang.String inCreator, java.lang.String inName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTransportNegotiator(TransportNegotiator transportNegotiator)
void
close()
Prepare to close the media manager.protected void
destroyMediaNegotiator()
Destroy the jmf negotiator.protected void
destroyTransportNegotiator()
Destroy the transport negotiator.java.util.List<IQ>
dispatchIncomingPacket(IQ iq, java.lang.String id)
Dispatch an incoming packet.protected void
doStart()
Called from above when starting a new session.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()
Get jingle transport manager.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)
Set jingle transport manager.protected void
setMediaNegotiator(MediaNegotiator mediaNeg)
Set the jmf negotiator.protected void
setTransportNegotiator(TransportNegotiator transNeg)
Set TransportNegotiatorvoid
stopJingleMediaSession()
Stop a Jingle media session.void
triggerContentEstablished()
-
Methods inherited from class org.jivesoftware.smackx.jingleold.JingleNegotiator
addExpectedId, addListener, getConnection, getListenersList, getSession, isExpectedId, isStarted, removeExpectedId, removeListener, setNegotiatorState, setSession, start
-
-
-
-
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, SmackException, java.lang.InterruptedException
Description copied from class:JingleNegotiator
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 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 classJingleNegotiator
- Parameters:
iq
- the stanza receivedid
- 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.java.lang.InterruptedException
- if the calling thread was interrupted.
-
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)
Set jingle transport manager.- Parameters:
jingleTransportManager
- TODO javadoc me please
-
getTransportManager
public JingleTransportManager getTransportManager()
Get jingle transport manager.- Returns:
- the JingleTransportManager
-
doStart
protected void doStart()
Called from above when starting a new session.- Specified by:
doStart
in classJingleNegotiator
-
close
public void close()
Prepare to close the media manager.- Overrides:
close
in classJingleNegotiator
-
getMediaNegotiator
public MediaNegotiator getMediaNegotiator()
Obtain the description negotiator for this session.- Returns:
- the description negotiator
-
setMediaNegotiator
protected void setMediaNegotiator(MediaNegotiator mediaNeg)
Set the jmf negotiator.- Parameters:
mediaNeg
- TODO javadoc me please the description negotiator to set
-
destroyMediaNegotiator
protected void destroyMediaNegotiator()
Destroy the jmf negotiator.
-
getTransportNegotiator
public TransportNegotiator getTransportNegotiator()
Obtain the transport negotiator for this session.- Returns:
- the transport negotiator instance
-
setTransportNegotiator
protected void setTransportNegotiator(TransportNegotiator transNeg)
Set TransportNegotiator- Parameters:
transNeg
- TODO javadoc me please the transNeg to set
-
destroyTransportNegotiator
protected void destroyTransportNegotiator()
Destroy the transport negotiator.
-
isFullyEstablished
public boolean isFullyEstablished()
Return true if the transport and content negotiators have finished.- Returns:
true
if fully established.
-
getJingleContent
public JingleContent getJingleContent()
-
triggerContentEstablished
public void triggerContentEstablished() throws SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NotConnectedException
java.lang.InterruptedException
-
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 classJingleNegotiator
-
-