Wildfire 3.2.4 Javadoc

org.jivesoftware.wildfire.filetransfer
Class DefaultFileTransferManager

java.lang.Object
  extended by org.jivesoftware.wildfire.container.BasicModule
      extended by org.jivesoftware.wildfire.filetransfer.DefaultFileTransferManager
All Implemented Interfaces:
Module, FileTransferManager

public class DefaultFileTransferManager
extends BasicModule
implements FileTransferManager

Provides several utility methods for file transfer manager implementaions to utilize.

Author:
Alexander Wenckus

Field Summary
 
Fields inherited from interface org.jivesoftware.wildfire.filetransfer.FileTransferManager
NAMESPACE_BYTESTREAMS, NAMESPACE_SI, NAMESPACE_SI_FILETRANSFER
 
Constructor Summary
DefaultFileTransferManager()
          Default constructor creates the cache.
 
Method Summary
 boolean acceptIncomingFileTransferRequest(FileTransfer transfer)
          Checks an incoming file transfer request to see if it should be accepted or rejected.
 void addFileTransferInterceptor(FileTransferInterceptor interceptor)
           
protected  void cacheFileTransfer(String key, FileTransfer transfer)
           
 void fireFileTransferIntercept(FileTransferProgress transfer, boolean isReady)
           
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 removeFileTransferInterceptor(FileTransferInterceptor interceptor)
           
protected  FileTransfer retrieveFileTransfer(String key)
           
 
Methods inherited from class org.jivesoftware.wildfire.container.BasicModule
destroy, getName, initialize, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jivesoftware.wildfire.container.Module
destroy, getName, initialize, start, stop
 

Constructor Detail

DefaultFileTransferManager

public DefaultFileTransferManager()
Default constructor creates the cache.

Method Detail

isMatchProxyTransfer

public boolean isMatchProxyTransfer()
Returns true if the proxy transfer should be matched to an existing file transfer in the system.

Returns:
Returns true if the proxy transfer should be matched to an existing file transfer in the system.

cacheFileTransfer

protected void cacheFileTransfer(String key,
                                 FileTransfer transfer)

retrieveFileTransfer

protected FileTransfer retrieveFileTransfer(String key)

getChildElement

protected static org.dom4j.Element getChildElement(org.dom4j.Element element,
                                                   String namespace)

acceptIncomingFileTransferRequest

public boolean acceptIncomingFileTransferRequest(FileTransfer transfer)
                                          throws FileTransferRejectedException
Description copied from interface: FileTransferManager
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.

Specified by:
acceptIncomingFileTransferRequest in interface FileTransferManager
Parameters:
transfer - the transfer to test for acceptance
Returns:
true if it should be accepted false if it should not.
Throws:
FileTransferRejectedException

registerProxyTransfer

public void registerProxyTransfer(String transferDigest,
                                  ProxyTransfer proxyTransfer)
                           throws UnauthorizedException
Description copied from interface: FileTransferManager
Registers that a transfer has begun through the proxy connected to the server.

Specified by:
registerProxyTransfer in interface FileTransferManager
Parameters:
transferDigest - the digest of the initiator + target + sessionID that uniquely identifies a file transfer
proxyTransfer - the related proxy transfer.
Throws:
UnauthorizedException - when in the current server configuration this transfer should not be permitted.

addFileTransferInterceptor

public void addFileTransferInterceptor(FileTransferInterceptor interceptor)
Specified by:
addFileTransferInterceptor in interface FileTransferManager

removeFileTransferInterceptor

public void removeFileTransferInterceptor(FileTransferInterceptor interceptor)
Specified by:
removeFileTransferInterceptor in interface FileTransferManager

fireFileTransferIntercept

public void fireFileTransferIntercept(FileTransferProgress transfer,
                                      boolean isReady)
                               throws FileTransferRejectedException
Specified by:
fireFileTransferIntercept in interface FileTransferManager
Throws:
FileTransferRejectedException

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.