public abstract class StreamNegotiator
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.jivesoftware.smack.util.EventManger<java.lang.String,org.jivesoftware.smack.packet.IQ,org.jivesoftware.smack.SmackException.NotConnectedException> |
initationSetEvents
A event manager for stream initiation requests send to us.
|
| Constructor and Description |
|---|
StreamNegotiator() |
| Modifier and Type | Method and Description |
|---|---|
abstract java.io.InputStream |
createIncomingStream(StreamInitiation initiation)
This method handles the file stream download negotiation process.
|
protected static StreamInitiation |
createInitiationAccept(StreamInitiation streamInitiationOffer,
java.lang.String[] namespaces)
Creates the initiation acceptance stanza(/packet) to forward to the stream
initiator.
|
abstract java.io.OutputStream |
createOutgoingStream(java.lang.String streamID,
java.lang.String initiator,
java.lang.String target)
This method handles the file upload stream negotiation process.
|
abstract java.lang.String[] |
getNamespaces()
Returns the XMPP namespace reserved for this particular type of file
transfer.
|
protected org.jivesoftware.smack.packet.IQ |
initiateIncomingStream(org.jivesoftware.smack.XMPPConnection connection,
StreamInitiation initiation) |
protected abstract void |
newStreamInitiation(java.lang.String from,
java.lang.String streamID)
Signal that a new stream initiation arrived.
|
static void |
signal(java.lang.String eventKey,
org.jivesoftware.smack.packet.IQ eventValue) |
protected static final org.jivesoftware.smack.util.EventManger<java.lang.String,org.jivesoftware.smack.packet.IQ,org.jivesoftware.smack.SmackException.NotConnectedException> initationSetEvents
Those are typical XEP-45 Open or XEP-65 Bytestream IQ requests. The even key is in the format "initiationFrom + '\t' + streamId"
protected static StreamInitiation createInitiationAccept(StreamInitiation streamInitiationOffer, java.lang.String[] namespaces)
streamInitiationOffer - The offer from the stream initiator to connect for a stream.namespaces - The namespace that relates to the accepted means of transfer.protected final org.jivesoftware.smack.packet.IQ initiateIncomingStream(org.jivesoftware.smack.XMPPConnection connection,
StreamInitiation initiation)
throws org.jivesoftware.smack.SmackException.NoResponseException,
org.jivesoftware.smack.XMPPException.XMPPErrorException,
org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.SmackException.NoResponseExceptionorg.jivesoftware.smack.XMPPException.XMPPErrorExceptionorg.jivesoftware.smack.SmackException.NotConnectedExceptionprotected abstract void newStreamInitiation(java.lang.String from,
java.lang.String streamID)
from - The initiator of the file transfer.streamID - The stream ID related to the transfer.public abstract java.io.InputStream createIncomingStream(StreamInitiation initiation) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, java.lang.InterruptedException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException
initiation - The initiation that triggered this download.org.jivesoftware.smack.XMPPException.XMPPErrorException - If an error occurs during this process an XMPPException is
thrown.java.lang.InterruptedException - If thread is interrupted.org.jivesoftware.smack.SmackExceptionorg.jivesoftware.smack.SmackException.NoResponseExceptionpublic abstract java.io.OutputStream createOutgoingStream(java.lang.String streamID,
java.lang.String initiator,
java.lang.String target)
throws org.jivesoftware.smack.XMPPException.XMPPErrorException,
org.jivesoftware.smack.SmackException.NoResponseException,
org.jivesoftware.smack.SmackException,
org.jivesoftware.smack.XMPPException
streamID - The streamID that uniquely identifies the file transfer.initiator - The fully-qualified JID of the initiator of the file transfer.target - The fully-qualified JID of the target or receiver of the file
transfer.org.jivesoftware.smack.XMPPException.XMPPErrorException - If an error occurs during the negotiation process an
exception will be thrown.org.jivesoftware.smack.SmackExceptionorg.jivesoftware.smack.XMPPExceptionorg.jivesoftware.smack.SmackException.NoResponseExceptionpublic abstract java.lang.String[] getNamespaces()
public static void signal(java.lang.String eventKey,
org.jivesoftware.smack.packet.IQ eventValue)