public abstract class JingleNegotiator extends Object
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...
Modifier and Type | Field and Description |
---|---|
protected JingleSession |
session |
Constructor and Description |
---|
JingleNegotiator()
Default constructor.
|
JingleNegotiator(JingleSession session)
Default constructor with a Connection.
|
Modifier and Type | Method and Description |
---|---|
void |
addExpectedId(String id)
Add expected ID.
|
void |
addListener(JingleListener li)
Add a Jingle session listener to listen to incoming session requests.
|
void |
close()
Close the negotiation.
|
abstract List<IQ> |
dispatchIncomingPacket(IQ iq,
String id)
Dispatch an incoming packet.
|
protected abstract void |
doStart()
Each of the negotiators has their individual behavior when they start.
|
XMPPConnection |
getConnection() |
protected List<JingleListener> |
getListenersList()
Get a copy of the listeners
|
JingleNegotiatorState |
getNegotiatorState() |
JingleSession |
getSession()
Get the XMPP connection associated with this negotiation.
|
boolean |
isExpectedId(String id)
Check if the passed ID is the expected ID.
|
boolean |
isStarted() |
void |
removeExpectedId(String id)
Remove and expected ID.
|
void |
removeListener(JingleListener li)
Removes a Jingle session listener.
|
void |
setNegotiatorState(JingleNegotiatorState stateIs) |
void |
setSession(JingleSession session)
Set the XMPP connection associated.
|
void |
start() |
protected JingleSession session
public JingleNegotiator()
public JingleNegotiator(JingleSession session)
session
- the jingle sessionpublic JingleNegotiatorState getNegotiatorState()
public void setNegotiatorState(JingleNegotiatorState stateIs)
public XMPPConnection getConnection()
public JingleSession getSession()
public void setSession(JingleSession session)
session
- the jingle sessionpublic void addExpectedId(String id)
id
- public boolean isExpectedId(String id)
id
- public void removeExpectedId(String id)
id
- public void addListener(JingleListener li)
li
- The listenerJingleListener
public void removeListener(JingleListener li)
li
- The jingle session listener to be removedJingleListener
protected List<JingleListener> getListenersList()
public abstract List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException, SmackException, InterruptedException
iq
- the stanza receivedid
- the ID of the response that will be sentXMPPException
InterruptedException
SmackException
public void start()
public boolean isStarted()
protected abstract void doStart()
public void close()