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()StringgetNamespace()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()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()
- Specified by:
getNamespacein interfaceExtensionProtocol
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin interfaceExtensionProtocol
-
getFeatures
public final Set<String> getFeatures()
- Specified by:
getFeaturesin interfaceDiscoverableInfo
-
-