Class DefaultProxyTransfer
java.lang.Object
org.jivesoftware.openfire.filetransfer.proxy.DefaultProxyTransfer
- All Implemented Interfaces:
Serializable,FileTransferProgress,ProxyTransfer,Cacheable
Tracks the different connections related to a file transfer. There are two connections, the
initiator and the target and when both connections are completed the transfer can begin.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTransfers the file from the initiator to the target.longReturns the number of bytes that has been transferred.intReturns the approximate size of the Object in bytes.Returns the fully qualified JID of the initiator of the file transfer.Returns the unique session id that correlates to the file transfer.Returns the full qualified JID of the target of the file transfer.Returns the transfer digest uniquely identifies a file transfer in the system.booleanReturns true if the Bytestream is ready to be activated and the proxy transfer can begin.voidsetInitiator(String initiator) voidsetInputStream(InputStream initiatorInputStream) voidsetOutputStream(OutputStream outputStream) voidsetSessionID(String streamID) voidvoidsetTransferDigest(String transferDigest) Sets the transfer digest for a file transfer.voidsetTransferFuture(Future<?> future) When the file transfer is being carried out by another thread this will set the Future relating to the thread that is carrying out the transfer.
-
Constructor Details
-
DefaultProxyTransfer
public DefaultProxyTransfer()
-
-
Method Details
-
getInitiator
Description copied from interface:FileTransferProgressReturns the fully qualified JID of the initiator of the file transfer.- Specified by:
getInitiatorin interfaceFileTransferProgress- Returns:
- the fully qualified JID of the initiator of the file transfer.
-
setInitiator
- Specified by:
setInitiatorin interfaceFileTransferProgress
-
getInputStream
- Specified by:
getInputStreamin interfaceFileTransferProgress
-
setInputStream
- Specified by:
setInputStreamin interfaceFileTransferProgress
-
getOutputStream
- Specified by:
getOutputStreamin interfaceFileTransferProgress
-
setOutputStream
- Specified by:
setOutputStreamin interfaceFileTransferProgress
-
getTarget
Description copied from interface:FileTransferProgressReturns the full qualified JID of the target of the file transfer.- Specified by:
getTargetin interfaceFileTransferProgress- Returns:
- the fully qualified JID of the target
-
setTarget
- Specified by:
setTargetin interfaceFileTransferProgress
-
getTransferDigest
Description copied from interface:ProxyTransferReturns the transfer digest uniquely identifies a file transfer in the system.- Specified by:
getTransferDigestin interfaceProxyTransfer- Returns:
- the transfer digest uniquely identifies a file transfer in the system.
-
setTransferDigest
Description copied from interface:ProxyTransferSets the transfer digest for a file transfer. The transfer digest uniquely identifies a file transfer in the system.- Specified by:
setTransferDigestin interfaceProxyTransfer- Parameters:
transferDigest- the digest which uniquely identifies this transfer.
-
getSessionID
Description copied from interface:FileTransferProgressReturns the unique session id that correlates to the file transfer.- Specified by:
getSessionIDin interfaceFileTransferProgress- Returns:
- Returns the unique session id that correlates to the file transfer.
-
setSessionID
- Specified by:
setSessionIDin interfaceFileTransferProgress
-
isActivatable
public boolean isActivatable()Description copied from interface:ProxyTransferReturns true if the Bytestream is ready to be activated and the proxy transfer can begin.- Specified by:
isActivatablein interfaceProxyTransfer- Returns:
- true if the Bytestream is ready to be activated.
-
setTransferFuture
Description copied from interface:FileTransferProgressWhen the file transfer is being carried out by another thread this will set the Future relating to the thread that is carrying out the transfer.- Specified by:
setTransferFuturein interfaceFileTransferProgress- Parameters:
future- the future that is carrying out the transfer
-
getAmountTransferred
public long getAmountTransferred()Description copied from interface:FileTransferProgressReturns the number of bytes that has been transferred.- Specified by:
getAmountTransferredin interfaceFileTransferProgress- Returns:
- the number of bytes that has been transferred.
-
doTransfer
Description copied from interface:ProxyTransferTransfers the file from the initiator to the target.- Specified by:
doTransferin interfaceProxyTransfer- Throws:
IOException- when an error occurs either reading from the input stream or writing to the output stream.
-
getCachedSize
public int getCachedSize()Description copied from interface:CacheableReturns the approximate size of the Object in bytes. The size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.- Specified by:
getCachedSizein interfaceCacheable- Returns:
- the size of the Object in bytes.
-