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.String
getNamespace()
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.boolean
isEnabled()
Indicates whether this protocol is enabled.void
reject(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 theSIFileTransferOffer
profile.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 theSIFileTransferOffer
profile.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:
accept
in interfaceFileTransferNegotiator
-
reject
public void reject(IQ iq)
- Specified by:
reject
in interfaceFileTransferNegotiator
-
getNamespace
public final String getNamespace()
Description copied from interface:ExtensionProtocol
The protocol's main namespace. This is used to uniquely identify the extension protocol.- Specified by:
getNamespace
in interfaceExtensionProtocol
- Returns:
- The main namespace.
-
isEnabled
public boolean isEnabled()
Description copied from interface:ExtensionProtocol
Indicates whether this protocol is enabled.- Specified by:
isEnabled
in interfaceExtensionProtocol
- Returns:
- true, if enabled; false if disabled.
-
getFeatures
public final Set<String> getFeatures()
Description copied from interface:DiscoverableInfo
Gets the features.- Specified by:
getFeatures
in interfaceDiscoverableInfo
- Returns:
- The features.
-
-