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 Details

    • NAMESPACE_SI

      static final String NAMESPACE_SI
      The Stream Initiation, SI, namespace.
      See Also:
    • NAMESPACE_SI_FILETRANSFER

      static final String NAMESPACE_SI_FILETRANSFER
      Namespace for the file transfer profile of Stream Initiation.
      See Also:
    • NAMESPACE_BYTESTREAMS

      static final String NAMESPACE_BYTESTREAMS
      Bytestreams namespace
      See Also:
  • Method Details

    • 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 transfer
      proxyTransfer - 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
      Invokes FileTransferEventListener.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)
      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.