public 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,
JingleSessionRequest request,
java.lang.String initiator,
java.lang.String responder,
java.util.List<JingleMediaManager> jingleMediaManagers)
JingleSession constructor (for an outgoing Jingle session)
|
JingleSession(org.jivesoftware.smack.XMPPConnection conn,
java.lang.String initiator,
java.lang.String responder,
java.lang.String sessionid,
java.util.List<JingleMediaManager> jingleMediaManagers)
Full featured JingleSession constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addContentNegotiator(ContentNegotiator inContentNegotiator)
Add a new content negotiator on behalf of a
|
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() |
java.lang.String |
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.
|
java.lang.String |
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(/packet) 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(java.lang.String initiator)
Set the session initiator
|
void |
setMediaManagers(java.util.List<JingleMediaManager> jingleMediaManagers)
Set the Media Manager of this Jingle Session
|
void |
setResponder(java.lang.String 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(/packet) 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,
java.lang.String initiator,
java.lang.String responder,
java.lang.String sessionid,
java.util.List<JingleMediaManager> jingleMediaManagers)
conn - the XMPPConnection which is usedinitiator - the initiator JIDresponder - the responder JIDsessionid - the session IDjingleMediaManagers - the jingleMediaManagerpublic JingleSession(org.jivesoftware.smack.XMPPConnection conn,
JingleSessionRequest request,
java.lang.String initiator,
java.lang.String responder,
java.util.List<JingleMediaManager> jingleMediaManagers)
conn - Connectioninitiator - the initiator JIDresponder - the responder JIDjingleMediaManagers - the jingleMediaManagerpublic java.lang.String getInitiator()
public org.jivesoftware.smack.XMPPConnection getConnection()
getConnection in class JingleNegotiatorpublic void setInitiator(java.lang.String initiator)
initiator - the initiator to setpublic java.util.List<JingleMediaManager> getMediaManagers()
public void setMediaManagers(java.util.List<JingleMediaManager> jingleMediaManagers)
jingleMediaManagers - public java.lang.String getResponder()
public void setResponder(java.lang.String responder)
responder - the receptor to setpublic java.lang.String getSid()
protected void setSid(java.lang.String sessionId)
sessionId - the sid to setprotected static java.lang.String generateSessionId()
public void setSessionState(JingleSessionState stateIs)
public JingleSessionState getSessionState()
public boolean isFullyEstablished()
public void receivePacketAndRespond(org.jivesoftware.smack.packet.IQ iq)
throws org.jivesoftware.smack.XMPPException,
org.jivesoftware.smack.SmackException
iq - the stanza(/packet) receivedorg.jivesoftware.smack.XMPPExceptionorg.jivesoftware.smack.SmackExceptionpublic 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
dispatchIncomingPacket in class JingleNegotiatoriq - the stanza(/packet) receivedid - the ID of the response that will be sentorg.jivesoftware.smack.XMPPExceptionorg.jivesoftware.smack.SmackExceptionpublic void addContentNegotiator(ContentNegotiator inContentNegotiator)
public void sendStanza(org.jivesoftware.smack.packet.IQ iq)
throws org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.SmackException.NotConnectedExceptionpublic Jingle sendFormattedJingle(Jingle jout) throws org.jivesoftware.smack.SmackException.NotConnectedException
jout - the Jingle stanza(/packet) we want to complete and sendorg.jivesoftware.smack.SmackException.NotConnectedExceptionpublic Jingle sendFormattedJingle(org.jivesoftware.smack.packet.IQ iq, Jingle jout) throws org.jivesoftware.smack.SmackException.NotConnectedException
iq - The Jingle stanza(/packet) we are responing tojout - the Jingle stanza(/packet) we want to complete and sendorg.jivesoftware.smack.SmackException.NotConnectedExceptionpublic org.jivesoftware.smack.packet.IQ createAck(org.jivesoftware.smack.packet.IQ iq)
iq - The IQ to acknowledgepublic 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 - A XMPP connectionprotected void removeAsyncPacketListener()
protected void updatePacketListener()
public void addMediaListener(JingleMediaListener li)
li - The listenerpublic void removeMediaListener(JingleMediaListener li)
li - The listenerpublic void addTransportListener(JingleTransportListener li)
li - The listenerpublic void removeTransportListener(JingleTransportListener li)
li - The listenerpublic void setupListeners()
protected void triggerSessionClosed(java.lang.String reason)
protected void triggerSessionClosedOnError(org.jivesoftware.smack.XMPPException exc)
protected void triggerMediaReceived(java.lang.String participant)
public void terminate()
throws org.jivesoftware.smack.XMPPException,
org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.XMPPExceptionorg.jivesoftware.smack.SmackException.NotConnectedExceptionpublic void terminate(java.lang.String reason)
throws org.jivesoftware.smack.XMPPException,
org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.XMPPExceptionorg.jivesoftware.smack.SmackException.NotConnectedExceptionpublic 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(/packet) we are responing tojingleError - the IQ stanza(/packet) we want to complete and sendpublic void mediaReceived(java.lang.String participant)
mediaReceived in interface MediaReceivedListenerpublic void startOutgoing()
throws java.lang.IllegalStateException,
org.jivesoftware.smack.SmackException
java.lang.IllegalStateExceptionorg.jivesoftware.smack.SmackExceptionpublic void startIncoming()
protected void doStart()
JingleNegotiatordoStart in class JingleNegotiatorpublic void addJingleMediaSession(java.lang.String mediaManagerName,
JingleMediaSession mediaSession)
public JingleMediaSession getMediaSession(java.lang.String mediaManagerName)