public abstract class StreamNegotiator
extends org.jivesoftware.smack.Manager
| 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.
|
| Modifier | Constructor and Description |
|---|---|
protected |
StreamNegotiator(org.jivesoftware.smack.XMPPConnection connection) |
| 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,
org.jxmpp.jid.Jid initiator,
org.jxmpp.jid.Jid 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(org.jxmpp.jid.Jid 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 StreamNegotiator(org.jivesoftware.smack.XMPPConnection connection)
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(org.jxmpp.jid.Jid 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
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.SmackExceptionpublic abstract java.io.OutputStream createOutgoingStream(java.lang.String streamID,
org.jxmpp.jid.Jid initiator,
org.jxmpp.jid.Jid target)
throws org.jivesoftware.smack.SmackException,
org.jivesoftware.smack.XMPPException,
java.lang.InterruptedException
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.SmackExceptionorg.jivesoftware.smack.XMPPExceptionjava.lang.InterruptedExceptionpublic abstract java.lang.String[] getNamespaces()
public static void signal(java.lang.String eventKey,
org.jivesoftware.smack.packet.IQ eventValue)