Interface BytestreamManager
-
- All Known Implementing Classes:
InBandBytestreamManager,Socks5BytestreamManager
public interface BytestreamManager
BytestreamManager provides a generic interface for bytestream managers.There are two implementations of the interface. See
Socks5BytestreamManagerandInBandBytestreamManager.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddIncomingBytestreamListener(BytestreamListener listener)AddsBytestreamListenerthat 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.BytestreamSessionestablishSession(Jid targetJID)Establishes a bytestream with the given user and returns the session to send/receive data to/from the user.BytestreamSessionestablishSession(Jid targetJID, java.lang.String sessionID)Establishes a bytestream with the given user and returns the session to send/receive data to/from the user.voidremoveIncomingBytestreamListener(BytestreamListener listener)Removes the given listener from the list of listeners for all incoming bytestream requests.voidremoveIncomingBytestreamListener(Jid initiatorJID)Removes the listener for the given user.
-
-
-
Method Detail
-
addIncomingBytestreamListener
void addIncomingBytestreamListener(BytestreamListener listener)
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
void removeIncomingBytestreamListener(BytestreamListener listener)
Removes the given listener from the list of listeners for all incoming bytestream requests.- Parameters:
listener- the listener to remove
-
addIncomingBytestreamListener
void addIncomingBytestreamListener(BytestreamListener listener, Jid initiatorJID)
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
void removeIncomingBytestreamListener(Jid initiatorJID)
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, java.io.IOException, java.lang.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 sessionjava.io.IOException- if an IO error occurred while establishing the sessionjava.lang.InterruptedException- if the thread was interrupted while waiting in a blocking operationSmackException- if an error occurs in Smack.
-
establishSession
BytestreamSession establishSession(Jid targetJID, java.lang.String sessionID) throws XMPPException, java.io.IOException, java.lang.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 sessionjava.io.IOException- if an IO error occurred while establishing the sessionjava.lang.InterruptedException- if the thread was interrupted while waiting in a blocking operationSmackException- if an error occurs in Smack.
-
-