Smack

org.jivesoftware.smackx.bytestreams
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 Socks5BytestreamManager and InBandBytestreamManager.

Author:
Henning Staib

Method Summary
 void addIncomingBytestreamListener(BytestreamListener listener)
          Adds BytestreamListener that is called for every incoming bytestream request unless there is a user specific BytestreamListener registered.
 void addIncomingBytestreamListener(BytestreamListener listener, java.lang.String initiatorJID)
          Adds BytestreamListener that is called for every incoming bytestream request unless there is a user specific BytestreamListener registered.
 BytestreamSession establishSession(java.lang.String targetJID)
          Establishes a bytestream with the given user and returns the session to send/receive data to/from the user.
 BytestreamSession establishSession(java.lang.String targetJID, java.lang.String sessionID)
          Establishes a bytestream with the given user and returns the session to send/receive data to/from the user.
 void removeIncomingBytestreamListener(BytestreamListener listener)
          Removes the given listener from the list of listeners for all incoming bytestream requests.
 void removeIncomingBytestreamListener(java.lang.String initiatorJID)
          Removes the listener for the given user.
 

Method Detail

addIncomingBytestreamListener

void addIncomingBytestreamListener(BytestreamListener listener)
Adds BytestreamListener that is called for every incoming bytestream request unless there is a user specific BytestreamListener registered.

See Socks5BytestreamManager.addIncomingBytestreamListener(BytestreamListener) and InBandBytestreamManager.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,
                                   java.lang.String initiatorJID)
Adds BytestreamListener that is called for every incoming bytestream request unless there is a user specific BytestreamListener registered.

Use this method if you are awaiting an incoming bytestream request from a specific user.

See Socks5BytestreamManager.addIncomingBytestreamListener(BytestreamListener, String) and InBandBytestreamManager.addIncomingBytestreamListener(BytestreamListener, String) for further details.

Parameters:
listener - the listener to register
initiatorJID - the JID of the user that wants to establish a bytestream

removeIncomingBytestreamListener

void removeIncomingBytestreamListener(java.lang.String initiatorJID)
Removes the listener for the given user.

Parameters:
initiatorJID - the JID of the user the listener should be removed

establishSession

BytestreamSession establishSession(java.lang.String targetJID)
                                   throws XMPPException,
                                          java.io.IOException,
                                          java.lang.InterruptedException
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(String, String).

See Socks5BytestreamManager.establishSession(String) and InBandBytestreamManager.establishSession(String) 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 session
java.io.IOException - if an IO error occurred while establishing the session
java.lang.InterruptedException - if the thread was interrupted while waiting in a blocking operation

establishSession

BytestreamSession establishSession(java.lang.String targetJID,
                                   java.lang.String sessionID)
                                   throws XMPPException,
                                          java.io.IOException,
                                          java.lang.InterruptedException
Establishes a bytestream with the given user and returns the session to send/receive data to/from the user.

See Socks5BytestreamManager.establishSession(String) and InBandBytestreamManager.establishSession(String) for further details.

Parameters:
targetJID - the JID of the user a bytestream should be established
sessionID - 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 session
java.io.IOException - if an IO error occurred while establishing the session
java.lang.InterruptedException - if the thread was interrupted while waiting in a blocking operation

Smack

Copyright © 2003-2007 Jive Software.