Package rocks.xmpp.extensions.jingle
Class JingleSession
- java.lang.Object
-
- rocks.xmpp.extensions.jingle.JingleSession
-
public final class JingleSession extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJingleSession.StateRepresents the state of a Jingle session.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsyncResult<Void>accept(Jingle.Content... contents)Accepts the session.AsyncResult<IQ>acceptTransport(String contentName, TransportMethod transportMethod)voidaddJingleListener(Consumer<JingleEvent> jingleListener)Adds a Jingle listener, which allows to listen for Jingle events.List<Jingle.Content>getContents()StringgetSessionId()Gets the session id.AsyncResult<Void>initiate()Initiates the session.AsyncResult<IQ>rejectTransport(String contentName, TransportMethod transportMethod)voidremoveJingleListener(Consumer<JingleEvent> jingleListener)Removes a previously added Jingle listener.AsyncResult<IQ>replaceTransport(String contentName, TransportMethod transportMethod)AsyncResult<IQ>sendSessionInfo(Object object)Sends a session info.AsyncResult<IQ>terminate(Jingle.Reason reason)Terminates the Jingle session.
-
-
-
Method Detail
-
getSessionId
public String getSessionId()
Gets the session id.- Returns:
- The session id.
-
initiate
public AsyncResult<Void> initiate()
Initiates the session.- Returns:
- The async result.
- See Also:
- 6.2 Initiation, 7.2.10 session-initiate
-
accept
public AsyncResult<Void> accept(Jingle.Content... contents)
Accepts the session. You must at least provide one content element.- Parameters:
contents- The contents.- Returns:
- The async result.
- See Also:
- 6.5 Acceptance, 7.2.8 session-accept
-
terminate
public AsyncResult<IQ> terminate(Jingle.Reason reason)
Terminates the Jingle session.- Parameters:
reason- The reason for termination.- Returns:
- The async result.
- See Also:
- 6.7 Termination
-
replaceTransport
public AsyncResult<IQ> replaceTransport(String contentName, TransportMethod transportMethod)
- Parameters:
contentName- The content name.transportMethod- The replaced transport method.- Returns:
- The async result.
- See Also:
- 7.2.15 transport-replace
-
acceptTransport
public AsyncResult<IQ> acceptTransport(String contentName, TransportMethod transportMethod)
-
rejectTransport
public AsyncResult<IQ> rejectTransport(String contentName, TransportMethod transportMethod)
-
getContents
public List<Jingle.Content> getContents()
-
sendSessionInfo
public AsyncResult<IQ> sendSessionInfo(Object object)
Sends a session info.- Parameters:
object- The session info payload.- Returns:
- The async result.
- See Also:
- 7.2.9 session-info
-
addJingleListener
public final void addJingleListener(Consumer<JingleEvent> jingleListener)
Adds a Jingle listener, which allows to listen for Jingle events.- Parameters:
jingleListener- The listener.- See Also:
removeJingleListener(Consumer)
-
removeJingleListener
public final void removeJingleListener(Consumer<JingleEvent> jingleListener)
Removes a previously added Jingle listener.- Parameters:
jingleListener- The listener.- See Also:
addJingleListener(Consumer)
-
-