public final class JingleSession extends JingleNegotiator implements MediaReceivedListener
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<JingleMediaManager> |
jingleMediaManagers |
session| Constructor and Description |
|---|
JingleSession(org.jivesoftware.smack.XMPPConnection conn,
org.jxmpp.jid.Jid initiator,
org.jxmpp.jid.Jid responder,
java.lang.String sessionid,
java.util.List<JingleMediaManager> jingleMediaManagers)
Full featured JingleSession constructor.
|
JingleSession(org.jivesoftware.smack.XMPPConnection conn,
JingleSessionRequest request,
org.jxmpp.jid.Jid initiator,
org.jxmpp.jid.Jid responder,
java.util.List<JingleMediaManager> jingleMediaManagers)
JingleSession constructor (for an outgoing Jingle session).
|
| Modifier and Type | Method and Description |
|---|---|
void |
addContentNegotiator(ContentNegotiator inContentNegotiator)
Add a new content negotiator on behalf of a <content/> section received.
|
void |
addJingleMediaSession(java.lang.String mediaManagerName,
JingleMediaSession mediaSession)
The jingle session may have one or more media managers that are trying to establish media sessions.
|
void |
addMediaListener(JingleMediaListener li)
Add a listener for jmf negotiation events.
|
void |
addTransportListener(JingleTransportListener li)
Add a listener for transport negotiation events.
|
void |
close()
Terminate negotiations.
|
org.jivesoftware.smack.packet.IQ |
createAck(org.jivesoftware.smack.packet.IQ iq)
Acknowledge a IQ packet.
|
org.jivesoftware.smack.packet.IQ |
createJingleError(org.jivesoftware.smack.packet.IQ iq,
JingleError jingleError)
Complete and send an error.
|
java.util.List<org.jivesoftware.smack.packet.IQ> |
dispatchIncomingPacket(org.jivesoftware.smack.packet.IQ iq,
java.lang.String id)
Dispatch an incoming packet.
|
protected void |
doStart()
Each of the negotiators has their individual behavior when they start.
|
boolean |
equals(java.lang.Object obj) |
protected static java.lang.String |
generateSessionId()
Generate a unique session ID.
|
org.jivesoftware.smack.XMPPConnection |
getConnection() |
org.jxmpp.jid.Jid |
getInitiator()
Get the session initiator.
|
static JingleSession |
getInstanceFor(org.jivesoftware.smack.XMPPConnection con)
Returns the JingleSession related to a particular connection.
|
java.util.List<JingleMediaManager> |
getMediaManagers()
Get the Media Manager of this Jingle Session.
|
JingleMediaSession |
getMediaSession(java.lang.String mediaManagerName)
The jingle session may have one or more media managers that are trying to establish media sessions.
|
org.jxmpp.jid.Jid |
getResponder()
Get the session responder.
|
JingleSessionState |
getSessionState() |
java.lang.String |
getSid()
Get the session ID.
|
int |
hashCode()
Send a content info message.
|
boolean |
isClosed() |
boolean |
isFullyEstablished()
Return true if all of the media managers have finished.
|
void |
mediaReceived(java.lang.String participant)
Called when new Media is received.
|
void |
receivePacketAndRespond(org.jivesoftware.smack.packet.IQ iq)
Process and respond to an incoming packet.
|
protected void |
removeAsyncPacketListener()
Remove the stanza listener used for processing packet.
|
void |
removeMediaListener(JingleMediaListener li)
Remove a listener for jmf negotiation events.
|
void |
removeTransportListener(JingleTransportListener li)
Remove a listener for transport negotiation events.
|
Jingle |
sendFormattedJingle(org.jivesoftware.smack.packet.IQ iq,
Jingle jout)
Complete and send a packet.
|
Jingle |
sendFormattedJingle(Jingle jout)
Complete and send a packet.
|
void |
sendStanza(org.jivesoftware.smack.packet.IQ iq) |
void |
setInitiator(org.jxmpp.jid.Jid initiator)
Set the session initiator.
|
void |
setMediaManagers(java.util.List<JingleMediaManager> jingleMediaManagers)
Set the Media Manager of this Jingle Session.
|
void |
setResponder(org.jxmpp.jid.Jid responder)
Set the session responder.
|
void |
setSessionState(JingleSessionState stateIs)
Validate the state changes.
|
protected void |
setSid(java.lang.String sessionId)
Set the session ID
|
void |
setupListeners()
Setup the listeners that act on events coming from the lower level negotiators.
|
void |
startIncoming()
This is the starting point for responding to a new session.
|
void |
startOutgoing()
This is the starting point for intitiating a new session.
|
void |
terminate()
Terminates the session with default reason.
|
void |
terminate(java.lang.String reason)
Terminates the session with a custom reason.
|
protected void |
triggerMediaReceived(java.lang.String participant)
Trigger a media received event.
|
protected void |
triggerSessionClosed(java.lang.String reason)
Trigger a session closed event.
|
protected void |
triggerSessionClosedOnError(org.jivesoftware.smack.XMPPException exc)
Trigger a session closed event due to an error.
|
protected void |
updatePacketListener()
Install the stanza listener.
|
addExpectedId, addListener, getListenersList, getNegotiatorState, getSession, isExpectedId, isStarted, removeExpectedId, removeListener, setNegotiatorState, setSession, startprotected java.util.List<JingleMediaManager> jingleMediaManagers
public JingleSession(org.jivesoftware.smack.XMPPConnection conn,
org.jxmpp.jid.Jid initiator,
org.jxmpp.jid.Jid responder,
java.lang.String sessionid,
java.util.List<JingleMediaManager> jingleMediaManagers)
conn - TODO javadoc me please
the XMPPConnection which is usedinitiator - TODO javadoc me please
the initiator JIDresponder - TODO javadoc me please
the responder JIDsessionid - TODO javadoc me please
the session IDjingleMediaManagers - TODO javadoc me please
the jingleMediaManagerpublic JingleSession(org.jivesoftware.smack.XMPPConnection conn,
JingleSessionRequest request,
org.jxmpp.jid.Jid initiator,
org.jxmpp.jid.Jid responder,
java.util.List<JingleMediaManager> jingleMediaManagers)
conn - Connectionrequest - the request.initiator - the initiator JIDresponder - the responder JIDjingleMediaManagers - the jingleMediaManagerpublic org.jxmpp.jid.Jid getInitiator()
public org.jivesoftware.smack.XMPPConnection getConnection()
getConnection in class JingleNegotiatorpublic void setInitiator(org.jxmpp.jid.Jid initiator)
initiator - TODO javadoc me please
the initiator to setpublic java.util.List<JingleMediaManager> getMediaManagers()
public void setMediaManagers(java.util.List<JingleMediaManager> jingleMediaManagers)
jingleMediaManagers - TODO javadoc me pleasepublic org.jxmpp.jid.Jid getResponder()
public void setResponder(org.jxmpp.jid.Jid responder)
responder - TODO javadoc me please
the receptor to setpublic java.lang.String getSid()
protected void setSid(java.lang.String sessionId)
sessionId - TODO javadoc me please
the sid to setprotected static java.lang.String generateSessionId()
public void setSessionState(JingleSessionState stateIs)
stateIs - the jingle session state.public JingleSessionState getSessionState()
public boolean isFullyEstablished()
true if fully established.public void receivePacketAndRespond(org.jivesoftware.smack.packet.IQ iq)
throws org.jivesoftware.smack.XMPPException,
org.jivesoftware.smack.SmackException,
java.lang.InterruptedException
iq - TODO javadoc me please
the stanza receivedorg.jivesoftware.smack.XMPPException - if an XMPP protocol error was received.org.jivesoftware.smack.SmackException - if Smack detected an exceptional situation.java.lang.InterruptedException - if the calling thread was interrupted.public java.util.List<org.jivesoftware.smack.packet.IQ> dispatchIncomingPacket(org.jivesoftware.smack.packet.IQ iq,
java.lang.String id)
throws org.jivesoftware.smack.XMPPException,
org.jivesoftware.smack.SmackException,
java.lang.InterruptedException
dispatchIncomingPacket in class JingleNegotiatoriq - TODO javadoc me please
the stanza receivedid - the ID of the response that will be sentorg.jivesoftware.smack.XMPPException - if an XMPP protocol error was received.org.jivesoftware.smack.SmackException - if Smack detected an exceptional situation.java.lang.InterruptedException - if the calling thread was interrupted.public void addContentNegotiator(ContentNegotiator inContentNegotiator)
inContentNegotiator - the content negotiator.public void sendStanza(org.jivesoftware.smack.packet.IQ iq)
throws org.jivesoftware.smack.SmackException.NotConnectedException,
java.lang.InterruptedException
org.jivesoftware.smack.SmackException.NotConnectedExceptionjava.lang.InterruptedExceptionpublic Jingle sendFormattedJingle(Jingle jout) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jout - the Jingle stanza we want to complete and sendorg.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.java.lang.InterruptedException - if the calling thread was interrupted.public Jingle sendFormattedJingle(org.jivesoftware.smack.packet.IQ iq, Jingle jout) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
iq - The Jingle stanza we are responding tojout - the Jingle stanza we want to complete and sendorg.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.java.lang.InterruptedException - if the calling thread was interrupted.public org.jivesoftware.smack.packet.IQ createAck(org.jivesoftware.smack.packet.IQ iq)
iq - The IQ to acknowledge.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic static JingleSession getInstanceFor(org.jivesoftware.smack.XMPPConnection con)
con - TODO javadoc me please
A XMPP connectionprotected void removeAsyncPacketListener()
protected void updatePacketListener()
public void addMediaListener(JingleMediaListener li)
li - TODO javadoc me please
The listenerpublic void removeMediaListener(JingleMediaListener li)
li - TODO javadoc me please
The listenerpublic void addTransportListener(JingleTransportListener li)
li - TODO javadoc me please
The listenerpublic void removeTransportListener(JingleTransportListener li)
li - TODO javadoc me please
The listenerpublic void setupListeners()
protected void triggerSessionClosed(java.lang.String reason)
reason - the reason.protected void triggerSessionClosedOnError(org.jivesoftware.smack.XMPPException exc)
exc - the exception.protected void triggerMediaReceived(java.lang.String participant)
participant - the participant.public void terminate()
throws org.jivesoftware.smack.XMPPException,
org.jivesoftware.smack.SmackException.NotConnectedException,
java.lang.InterruptedException
org.jivesoftware.smack.XMPPException - if an XMPP protocol error was received.org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.java.lang.InterruptedException - if the calling thread was interrupted.public void terminate(java.lang.String reason)
throws org.jivesoftware.smack.XMPPException,
org.jivesoftware.smack.SmackException.NotConnectedException,
java.lang.InterruptedException
reason - the reason.org.jivesoftware.smack.XMPPException - if an XMPP protocol error was received.org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.java.lang.InterruptedException - if the calling thread was interrupted.public void close()
close in class JingleNegotiatorpublic boolean isClosed()
public org.jivesoftware.smack.packet.IQ createJingleError(org.jivesoftware.smack.packet.IQ iq,
JingleError jingleError)
iq - The Jingle stanza we are responding tojingleError - the IQ stanza we want to complete and sendpublic void mediaReceived(java.lang.String participant)
mediaReceived in interface MediaReceivedListenerparticipant - the participant.public void startOutgoing()
throws java.lang.IllegalStateException,
org.jivesoftware.smack.SmackException,
java.lang.InterruptedException
java.lang.IllegalStateException - if an illegal state was encounteredorg.jivesoftware.smack.SmackException - if Smack detected an exceptional situation.java.lang.InterruptedException - if the calling thread was interrupted.public void startIncoming()
protected void doStart()
JingleNegotiatordoStart in class JingleNegotiatorpublic void addJingleMediaSession(java.lang.String mediaManagerName,
JingleMediaSession mediaSession)
mediaManagerName - the name of the media manager.mediaSession - the jingle media session.public JingleMediaSession getMediaSession(java.lang.String mediaManagerName)
mediaManagerName - the name of the media manager.