Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.9.3 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire.filetransfer.proxy
Class DefaultProxyTransfer

    java.lang.Object
      org.jivesoftware.openfire.filetransfer.proxy.DefaultProxyTransfer

All Implemented Interfaces:
  Serializable, FileTransferProgress, ProxyTransfer, Cacheable

    public class DefaultProxyTransfer

extends Object
implements ProxyTransfer

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:
  Serialized Form

Constructor Summary
`DefaultProxyTransfer()`

Method Summary
`void` | `doTransfer()` Transfers the file from the initiator to the target.
`long` | `getAmountTransfered()`
`int` | `getCachedSize()` Returns the approximate size of the Object in bytes.
`String` | `getInitiator()` Returns the fully qualified JID of the initiator of the file transfer.
`InputStream` | `getInputStream()`
`OutputStream` | `getOutputStream()`
`String` | `getSessionID()` Returns the unique session id that correlates to the file transfer.
`String` | `getTarget()` Returns the full qualified JID of the target of the file transfer.
`String` | `getTransferDigest()` Returns the transfer digest uniquely identifies a file transfer in the system.
`boolean` | `isActivatable()` Returns true if the Bytestream is ready to be activated and the proxy transfer can begin.
`void` | `setInitiator(String initiator)`
`void` | `setInputStream(InputStream initiatorInputStream)`
`void` | `setOutputStream(OutputStream outputStream)`
`void` | `setSessionID(String streamID)`
`void` | `setTarget(String target)`
`void` | `setTransferDigest(String transferDigest)` Sets the transfer digest for a file transfer.
`void` | `setTransferFuture(Future<?> future)` When the file transfer is being caried out by another thread this will set the Future relating to the thread that is carrying out the transfer.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultProxyTransfer

    public DefaultProxyTransfer()

Method Detail

### getInitiator

    public String getInitiator()

  Description copied from interface: `FileTransferProgress`
  Returns the fully qualified JID of the initiator of the file transfer.

  Specified by:
    `getInitiator` in interface `FileTransferProgress`
  Returns:
    the fully qualified JID of the initiator of the file transfer.

### setInitiator

    public void setInitiator(String initiator)

  Specified by:
    `setInitiator` in interface `FileTransferProgress`

### getInputStream

    public InputStream getInputStream()

  Specified by:
    `getInputStream` in interface `FileTransferProgress`

### setInputStream

    public void setInputStream(InputStream initiatorInputStream)

  Specified by:
    `setInputStream` in interface `FileTransferProgress`

### getOutputStream

    public OutputStream getOutputStream()

  Specified by:
    `getOutputStream` in interface `FileTransferProgress`

### setOutputStream

    public void setOutputStream(OutputStream outputStream)

  Specified by:
    `setOutputStream` in interface `FileTransferProgress`

### getTarget

    public String getTarget()

  Description copied from interface: `FileTransferProgress`
  Returns the full qualified JID of the target of the file transfer.

  Specified by:
    `getTarget` in interface `FileTransferProgress`
  Returns:
    the fully qualified JID of the target

### setTarget

    public void setTarget(String target)

  Specified by:
    `setTarget` in interface `FileTransferProgress`

### getTransferDigest

    public String getTransferDigest()

  Description copied from interface: `ProxyTransfer`
  Returns the transfer digest uniquely identifies a file transfer in the system.

  Specified by:
    `getTransferDigest` in interface `ProxyTransfer`
  Returns:
    the transfer digest uniquely identifies a file transfer in the system.

### setTransferDigest

    public void setTransferDigest(String transferDigest)

  Description copied from interface: `ProxyTransfer`
  Sets the transfer digest for a file transfer. The transfer digest uniquely identifies a file transfer in the system.

  Specified by:
    `setTransferDigest` in interface `ProxyTransfer`
  Parameters:
    `transferDigest` - the digest which uniquely identifies this transfer.

### getSessionID

    public String getSessionID()

  Description copied from interface: `FileTransferProgress`
  Returns the unique session id that correlates to the file transfer.

  Specified by:
    `getSessionID` in interface `FileTransferProgress`
  Returns:
    Returns the unique session id that correlates to the file transfer.

### setSessionID

    public void setSessionID(String streamID)

  Specified by:
    `setSessionID` in interface `FileTransferProgress`

### isActivatable

    public boolean isActivatable()

  Description copied from interface: `ProxyTransfer`
  Returns true if the Bytestream is ready to be activated and the proxy transfer can begin.

  Specified by:
    `isActivatable` in interface `ProxyTransfer`
  Returns:
    true if the Bytestream is ready to be activated.

### setTransferFuture

    public void setTransferFuture(Future<?> future)

  Description copied from interface: `FileTransferProgress`
  When the file transfer is being caried out by another thread this will set the Future relating to the thread that is carrying out the transfer.

  Specified by:
    `setTransferFuture` in interface `FileTransferProgress`
  Parameters:
    `future` - the furute that is carrying out the transfer

### getAmountTransfered

    public long getAmountTransfered()

  Specified by:
    `getAmountTransfered` in interface `FileTransferProgress`

### doTransfer

    public void doTransfer()
                    throws IOException

  Description copied from interface: `ProxyTransfer`
  Transfers the file from the initiator to the target.

  Specified by:
    `doTransfer` in interface `ProxyTransfer`
  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: `Cacheable`
  Returns 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:
    `getCachedSize` in interface `Cacheable`
  Returns:
    the size of the Object in bytes.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.9.3 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Jive Software.