Package rocks.xmpp.extensions.si
Class StreamInitiationManager
- java.lang.Object
-
- rocks.xmpp.core.stanza.AbstractIQHandler
-
- rocks.xmpp.extensions.si.StreamInitiationManager
-
- All Implemented Interfaces:
ExtensionProtocol,IQHandler,DiscoverableInfo,FileTransferNegotiator
public final class StreamInitiationManager extends AbstractIQHandler implements FileTransferNegotiator, ExtensionProtocol, DiscoverableInfo
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsyncResult<FileTransfer>accept(IQ iq, String sessionId, FileTransferOffer fileTransferOffer, Object protocol, OutputStream outputStream)Set<String>getFeatures()Gets the features.StringgetNamespace()The protocol's main namespace.AsyncResult<ByteStreamSession>initiateStream(Jid receiver, SIFileTransferOffer profile, String mimeType, Duration timeout)Initiates a stream with another entity.AsyncResult<ByteStreamSession>initiateStream(Jid receiver, SIFileTransferOffer profile, String mimeType, Duration timeout, String sessionId)Initiates a stream with another entity.booleanisEnabled()Indicates whether this protocol is enabled.voidreject(IQ iq)-
Methods inherited from class rocks.xmpp.core.stanza.AbstractIQHandler
getPayloadClass, handleRequest
-
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
-
-
-
-
Method Detail
-
initiateStream
public AsyncResult<ByteStreamSession> initiateStream(Jid receiver, SIFileTransferOffer profile, String mimeType, Duration timeout)
Initiates a stream with another entity.- Parameters:
receiver- The receiver, i.e. the XMPP entity you want to negotiate a stream.profile- The profile. Currently there's only theSIFileTransferOfferprofile.mimeType- The mime type of the stream.timeout- The timeout, which wait until the stream has been negotiated.- Returns:
- The async result with the output stream which has been negotiated.
-
initiateStream
public AsyncResult<ByteStreamSession> initiateStream(Jid receiver, SIFileTransferOffer profile, String mimeType, Duration timeout, String sessionId)
Initiates a stream with another entity.- Parameters:
receiver- The receiver, i.e. the XMPP entity you want to negotiate a stream.profile- The profile. Currently there's only theSIFileTransferOfferprofile.mimeType- The mime type of the stream.timeout- The timeout, which wait until the stream has been negotiated.sessionId- The session id.- Returns:
- The async result with the output stream which has been negotiated.
-
accept
public AsyncResult<FileTransfer> accept(IQ iq, String sessionId, FileTransferOffer fileTransferOffer, Object protocol, OutputStream outputStream)
- Specified by:
acceptin interfaceFileTransferNegotiator
-
reject
public void reject(IQ iq)
- Specified by:
rejectin interfaceFileTransferNegotiator
-
getNamespace
public final String getNamespace()
Description copied from interface:ExtensionProtocolThe protocol's main namespace. This is used to uniquely identify the extension protocol.- Specified by:
getNamespacein interfaceExtensionProtocol- Returns:
- The main namespace.
-
isEnabled
public boolean isEnabled()
Description copied from interface:ExtensionProtocolIndicates whether this protocol is enabled.- Specified by:
isEnabledin interfaceExtensionProtocol- Returns:
- true, if enabled; false if disabled.
-
getFeatures
public final Set<String> getFeatures()
Description copied from interface:DiscoverableInfoGets the features.- Specified by:
getFeaturesin interfaceDiscoverableInfo- Returns:
- The features.
-
-