public class DefaultFileTransferManager extends BasicModule implements FileTransferManager
NAMESPACE_BYTESTREAMS, NAMESPACE_SI, NAMESPACE_SI_FILETRANSFER
Constructor and Description |
---|
DefaultFileTransferManager()
Default constructor creates the cache.
|
Modifier and Type | Method and 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.
|
protected void |
cacheFileTransfer(String key,
FileTransfer transfer) |
void |
fireFileTransferCompleted(String sid,
boolean wasSuccessful)
Invokes
FileTransferEventListener.fileTransferComplete(FileTransfer, boolean) for all registered event
listeners. |
void |
fireFileTransferStart(String sid,
boolean isReady)
Invokes
FileTransferEventListener.fileTransferStart(FileTransfer, boolean) for all registered event
listeners. |
protected static org.dom4j.Element |
getChildElement(org.dom4j.Element element,
String namespace) |
boolean |
isMatchProxyTransfer()
Returns true if the proxy transfer should be matched to an existing file transfer
in the system.
|
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.
|
protected FileTransfer |
retrieveFileTransfer(String key) |
destroy, getName, initialize, start, stop
public DefaultFileTransferManager()
public boolean isMatchProxyTransfer()
protected void cacheFileTransfer(String key, FileTransfer transfer)
protected FileTransfer retrieveFileTransfer(String key)
protected static org.dom4j.Element getChildElement(org.dom4j.Element element, String namespace)
public boolean acceptIncomingFileTransferRequest(FileTransfer transfer) throws FileTransferRejectedException
FileTransferManager
acceptIncomingFileTransferRequest
in interface FileTransferManager
transfer
- the transfer to test for acceptanceFileTransferRejectedException
public void registerProxyTransfer(String transferDigest, ProxyTransfer proxyTransfer) throws UnauthorizedException
FileTransferManager
registerProxyTransfer
in interface FileTransferManager
transferDigest
- the digest of the initiator + target + sessionID that uniquely
identifies a file transferproxyTransfer
- the related proxy transfer.UnauthorizedException
- when in the current server configuration this transfer
should not be permitted.public void addListener(FileTransferEventListener eventListener)
FileTransferManager
addListener
in interface FileTransferManager
eventListener
- an event listener (cannot be null).public void removeListener(FileTransferEventListener eventListener)
FileTransferManager
removeListener
in interface FileTransferManager
eventListener
- an event listener (cannot be null).public void fireFileTransferStart(String sid, boolean isReady) throws FileTransferRejectedException
FileTransferManager
FileTransferEventListener.fileTransferStart(FileTransfer, boolean)
for all registered event
listeners.fireFileTransferStart
in interface FileTransferManager
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.FileTransferRejectedException
- When at least one of the listeners aborts the file transfer.public void fireFileTransferCompleted(String sid, boolean wasSuccessful)
FileTransferManager
FileTransferEventListener.fileTransferComplete(FileTransfer, boolean)
for all registered event
listeners.fireFileTransferCompleted
in interface FileTransferManager
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.Copyright © 2003-2008 Jive Software.