Interface BytestreamManager
- All Known Implementing Classes:
InBandBytestreamManager,Socks5BytestreamManager
There are two implementations of the interface. See Socks5BytestreamManager and
InBandBytestreamManager.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAddsBytestreamListenerthat is called for every incoming bytestream request unless there is a user specificBytestreamListenerregistered.voidaddIncomingBytestreamListener(BytestreamListener listener, Jid initiatorJID) AddsBytestreamListenerthat is called for every incoming bytestream request unless there is a user specificBytestreamListenerregistered.establishSession(Jid targetJID) Establishes a bytestream with the given user and returns the session to send/receive data to/from the user.establishSession(Jid targetJID, String sessionID) Establishes a bytestream with the given user and returns the session to send/receive data to/from the user.voidRemoves the given listener from the list of listeners for all incoming bytestream requests.voidremoveIncomingBytestreamListener(Jid initiatorJID) Removes the listener for the given user.
-
Method Details
-
addIncomingBytestreamListener
AddsBytestreamListenerthat is called for every incoming bytestream request unless there is a user specificBytestreamListenerregistered.See
Socks5BytestreamManager.addIncomingBytestreamListener(BytestreamListener)andInBandBytestreamManager.addIncomingBytestreamListener(BytestreamListener)for further details.- Parameters:
listener- the listener to register
-
removeIncomingBytestreamListener
Removes the given listener from the list of listeners for all incoming bytestream requests.- Parameters:
listener- the listener to remove
-
addIncomingBytestreamListener
AddsBytestreamListenerthat is called for every incoming bytestream request unless there is a user specificBytestreamListenerregistered.Use this method if you are awaiting an incoming bytestream request from a specific user.
See
Socks5BytestreamManager.addIncomingBytestreamListener(BytestreamListener, Jid)andInBandBytestreamManager.addIncomingBytestreamListener(BytestreamListener, Jid)for further details.- Parameters:
listener- the listener to registerinitiatorJID- the JID of the user that wants to establish a bytestream
-
removeIncomingBytestreamListener
Removes the listener for the given user.- Parameters:
initiatorJID- the JID of the user the listener should be removed
-
establishSession
BytestreamSession establishSession(Jid targetJID) throws XMPPException, IOException, InterruptedException, SmackException Establishes a bytestream with the given user and returns the session to send/receive data to/from the user.Use this method to establish bytestreams to users accepting all incoming bytestream requests since this method doesn't provide a way to tell the user something about the data to be sent.
To establish a bytestream after negotiation the kind of data to be sent (e.g. file transfer) use
establishSession(Jid, String).See
Socks5BytestreamManager.establishSession(Jid)andInBandBytestreamManager.establishSession(Jid)for further details.- Parameters:
targetJID- the JID of the user a bytestream should be established- Returns:
- the session to send/receive data to/from the user
- Throws:
XMPPException- if an error occurred while establishing the sessionIOException- if an IO error occurred while establishing the sessionInterruptedException- if the thread was interrupted while waiting in a blocking operationSmackException- if an error occurs in Smack.
-
establishSession
BytestreamSession establishSession(Jid targetJID, String sessionID) throws XMPPException, IOException, InterruptedException, SmackException Establishes a bytestream with the given user and returns the session to send/receive data to/from the user.See
Socks5BytestreamManager.establishSession(Jid)andInBandBytestreamManager.establishSession(Jid)for further details.- Parameters:
targetJID- the JID of the user a bytestream should be establishedsessionID- the session ID for the bytestream request- Returns:
- the session to send/receive data to/from the user
- Throws:
XMPPException- if an error occurred while establishing the sessionIOException- if an IO error occurred while establishing the sessionInterruptedException- if the thread was interrupted while waiting in a blocking operationSmackException- if an error occurs in Smack.
-