Interface FileTransferManager
-
- All Superinterfaces:
Module
- All Known Implementing Classes:
DefaultFileTransferManager
public interface FileTransferManager extends Module
Manages all file transfer currently happening originating from and/or ending at users of the server. From here, file transfers can be administered and stats can be tracked.- Author:
- Alexander Wenckus
-
-
Field Summary
Fields Modifier and Type Field Description static String
NAMESPACE_BYTESTREAMS
Bytestreams namespacestatic String
NAMESPACE_SI
The Stream Initiation, SI, namespace.static String
NAMESPACE_SI_FILETRANSFER
Namespace for the file transfer profile of Stream Initiation.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
acceptIncomingFileTransferRequest(FileTransfer transfer)
Checks an incoming file transfer request to see if it should be accepted or rejected.void
addListener(FileTransferEventListener eventListener)
Registers an event listener that will be notified of file transfer related events.void
fireFileTransferCompleted(String sid, boolean wasSuccessful)
InvokesFileTransferEventListener.fileTransferComplete(FileTransfer, boolean)
for all registered event listeners.void
fireFileTransferStart(String sid, boolean isReady)
InvokesFileTransferEventListener.fileTransferStart(FileTransfer, boolean)
for all registered event listeners.void
registerProxyTransfer(String transferDigest, ProxyTransfer proxyTransfer)
Registers that a transfer has begun through the proxy connected to the server.void
removeListener(FileTransferEventListener eventListener)
Unregisters an event listener from the list of event listeners that are notified of file transfer related events.
-
-
-
Field Detail
-
NAMESPACE_SI
static final String NAMESPACE_SI
The Stream Initiation, SI, namespace.- See Also:
- Constant Field Values
-
NAMESPACE_SI_FILETRANSFER
static final String NAMESPACE_SI_FILETRANSFER
Namespace for the file transfer profile of Stream Initiation.- See Also:
- Constant Field Values
-
NAMESPACE_BYTESTREAMS
static final String NAMESPACE_BYTESTREAMS
Bytestreams namespace- See Also:
- Constant Field Values
-
-
Method Detail
-
acceptIncomingFileTransferRequest
boolean acceptIncomingFileTransferRequest(FileTransfer transfer) throws FileTransferRejectedException
Checks an incoming file transfer request to see if it should be accepted or rejected. If it is accepted true will be returned and if it is rejected false will be returned.- Parameters:
transfer
- the transfer to test for acceptance- Returns:
- true if it should be accepted false if it should not.
- Throws:
FileTransferRejectedException
- if the request was rejected (can this ever happen?)
-
registerProxyTransfer
void registerProxyTransfer(String transferDigest, ProxyTransfer proxyTransfer) throws UnauthorizedException
Registers that a transfer has begun through the proxy connected to the server.- Parameters:
transferDigest
- the digest of the initiator + target + sessionID that uniquely identifies a file transferproxyTransfer
- the related proxy transfer.- Throws:
UnauthorizedException
- when in the current server configuration this transfer should not be permitted.
-
addListener
void addListener(FileTransferEventListener eventListener)
Registers an event listener that will be notified of file transfer related events.- Parameters:
eventListener
- an event listener (cannot be null).
-
removeListener
void removeListener(FileTransferEventListener eventListener)
Unregisters an event listener from the list of event listeners that are notified of file transfer related events.- Parameters:
eventListener
- an event listener (cannot be null).
-
fireFileTransferStart
void fireFileTransferStart(String sid, boolean isReady) throws FileTransferRejectedException
InvokesFileTransferEventListener.fileTransferStart(FileTransfer, boolean)
for all registered event listeners.- Parameters:
sid
- The session id of the file transfer that is being intercepted (cannot be null).isReady
- true if the transfer is ready to commence or false if this is related to the initial file transfer request. An exception at this point will cause the transfer to not go through.- Throws:
FileTransferRejectedException
- When at least one of the listeners aborts the file transfer.
-
fireFileTransferCompleted
void fireFileTransferCompleted(String sid, boolean wasSuccessful)
InvokesFileTransferEventListener.fileTransferComplete(FileTransfer, boolean)
for all registered event listeners.- Parameters:
sid
- The session id of the file transfer that is being intercepted (cannot be null).wasSuccessful
- false when an exception was thrown during file transfer, otherwise true.
-
-