Class InBandByteStreamManager
- java.lang.Object
-
- rocks.xmpp.core.session.Manager
-
- rocks.xmpp.extensions.bytestreams.ByteStreamManager
-
- rocks.xmpp.extensions.bytestreams.ibb.InBandByteStreamManager
-
- All Implemented Interfaces:
ExtensionProtocol,InboundMessageHandler,IQHandler,DiscoverableInfo
public final class InBandByteStreamManager extends ByteStreamManager implements IQHandler, InboundMessageHandler, ExtensionProtocol, DiscoverableInfo
A manager for XEP-0047: In-Band Bytestreams. IBB streams use the same transport as XMPP, i.e. the same TCP or BOSH connection.To initiate an IBB session with another entity, use
initiateSession(Jid, String, int).This class is thread-safe.
- See Also:
- XEP-0047: In-Band Bytestreams
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>getFeatures()StringgetNamespace()Class<?>getPayloadClass()InBandByteStream.Open.StanzaTypegetStanzaType()Gets the stanza type.voidhandleInboundMessage(MessageEvent e)IQhandleRequest(IQ iq)AsyncResult<ByteStreamSession>initiateSession(Jid receiver, String sessionId)Initiates a byte stream session with another entity.AsyncResult<ByteStreamSession>initiateSession(Jid receiver, String sessionId, int blockSize)Initiates an in-band byte stream session.voidsetStanzaType(InBandByteStream.Open.StanzaType stanzaType)Sets the stanza type, which is used to send data chunks.-
Methods inherited from class rocks.xmpp.extensions.bytestreams.ByteStreamManager
addByteStreamListener, removeByteStreamListener
-
Methods inherited from class rocks.xmpp.core.session.Manager
isEnabled, setEnabled
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface rocks.xmpp.extensions.disco.model.info.DiscoverableInfo
getExtensions, getIdentities
-
Methods inherited from interface rocks.xmpp.core.ExtensionProtocol
isEnabled
-
-
-
-
Method Detail
-
initiateSession
public final AsyncResult<ByteStreamSession> initiateSession(Jid receiver, String sessionId, int blockSize)
Initiates an in-band byte stream session.- Parameters:
receiver- The receiver.sessionId- The session id.blockSize- The block size.- Returns:
- The async result with the in-band byte stream session.
-
initiateSession
public final AsyncResult<ByteStreamSession> initiateSession(Jid receiver, String sessionId)
Description copied from class:ByteStreamManagerInitiates a byte stream session with another entity.- Specified by:
initiateSessionin classByteStreamManager- Parameters:
receiver- The peer entity.sessionId- The session id.- Returns:
- The async result containing the session.
-
getStanzaType
public final InBandByteStream.Open.StanzaType getStanzaType()
Gets the stanza type.- Returns:
- The stanza type.
-
setStanzaType
public final void setStanzaType(InBandByteStream.Open.StanzaType stanzaType)
Sets the stanza type, which is used to send data chunks. It is recommended to leave this on the default (InBandByteStream.Open.StanzaType.IQ).- Parameters:
stanzaType- The stanza type.
-
getPayloadClass
public Class<?> getPayloadClass()
- Specified by:
getPayloadClassin interfaceIQHandler
-
handleRequest
public IQ handleRequest(IQ iq)
- Specified by:
handleRequestin interfaceIQHandler
-
handleInboundMessage
public void handleInboundMessage(MessageEvent e)
- Specified by:
handleInboundMessagein interfaceInboundMessageHandler
-
getNamespace
public final String getNamespace()
- Specified by:
getNamespacein interfaceExtensionProtocol
-
getFeatures
public final Set<String> getFeatures()
- Specified by:
getFeaturesin interfaceDiscoverableInfo
-
-