de.esprit.netsuite.client.activity.transfer

## Class ClientTransferConnection<C extends ClientContext>

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<C>
    - - de.esprit.netsuite.client.AbstractClientObject<C>
      - - de.esprit.netsuite.client.activity.transfer.ClientTransferConnection<C>

- All Implemented Interfaces:
    ApplicationObject<C>, CancellableTask, SimpleLogSupport, Dumpable, ClientObject<C>
  Direct Known Subclasses:
    ClientFileDownloadConnection, ClientFileUploadConnection

      public abstract class ClientTransferConnection<C extends ClientContext>
      extends AbstractClientObject<C>
      implements CancellableTask, ClientObject<C>

  This class performs the transfer (upload or download) of a single file
  Author:
    Rainer Buesch

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `TRANSFER_BUFF_SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientTransferConnection(C clientCtx, AbstractTransferJob trJob, StreamWrapper streamWrapper)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkCancelled()`
    `abstract void` | `closeConnection()` Closes all socket streams as well as the socket itself.
    `abstract void` | `execute()`
    `protected void` | `fireReadProgress(long bytesDelta)`
    `java.io.File` | `getClientFile()`
    `protected java.lang.String` | `getClientFileInfo()`
    `java.lang.String` | `getConnectionInfo()`
    `long` | `getFileLength()`
    `protected abstract java.io.InputStream` | `getReceiveStream()`
    `protected abstract java.io.OutputStream` | `getSendStream()`
    `java.io.File` | `getServerFile()`
    `protected java.lang.String` | `getServerFileInfo()`
    `AbstractTransferJob` | `getTransferJob()`
    `boolean` | `isTransferZipped()`
    `protected abstract void` | `openConnection(ServerHost host, StreamWrapper streamWrapper)`
    `protected abstract java.lang.Object` | `readObject()`
    `void` | `setFileLength(long fileLength)`
    `protected void` | `setProgressingTask(AsyncExecutable targetTask)`
    `protected abstract void` | `shutdownInput()`
    `protected abstract void` | `shutdownOutput()`
    `void` | `startTransfer()`
    `java.lang.String` | `toString()` Returns a single line String that shows the values of the most important state variables of this object.
    `boolean` | `wasCancelled()` Tells whether ever an attempt has been made to cancel this task.
    `boolean` | `wasFoundZippedOnServer()`
    `protected abstract void` | `writeObject(java.lang.Object obj)`

    - ### Methods inherited from class de.esprit.netsuite.client.AbstractClientObject

      `getClientConfig, getClientContext`

    - ### Methods inherited from class de.esprit.appsuite.launch.AbstractApplicationObject

      `getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface de.esprit.netsuite.client.ClientObject

      `getClientContext`

- - ### Field Detail

    - #### TRANSFER_BUFF_SIZE

          public static final int TRANSFER_BUFF_SIZE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ClientTransferConnection

          public ClientTransferConnection(C clientCtx,
                                  AbstractTransferJob trJob,
                                  StreamWrapper streamWrapper)

  - ### Method Detail

    - #### setProgressingTask

          protected void setProgressingTask(AsyncExecutable targetTask)

    - #### getFileLength

          public long getFileLength()

    - #### setFileLength

          public void setFileLength(long fileLength)

    - #### getClientFile

          public final java.io.File getClientFile()

    - #### getServerFile

          public final java.io.File getServerFile()

    - #### getClientFileInfo

          protected java.lang.String getClientFileInfo()

    - #### getServerFileInfo

          protected java.lang.String getServerFileInfo()

    - #### fireReadProgress

          protected void fireReadProgress(long bytesDelta)

    - #### wasCancelled

          public boolean wasCancelled()

      Description copied from interface: `CancellableTask`
      Tells whether ever an attempt has been made to cancel this task.
      Specified by:
        `wasCancelled` in interface `CancellableTask`

    - #### checkCancelled

          public void checkCancelled()

    - #### startTransfer

          public void startTransfer()
                             throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getConnectionInfo

          public java.lang.String getConnectionInfo()

    - #### openConnection

          protected abstract void openConnection(ServerHost host,
                            StreamWrapper streamWrapper)
                                          throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getSendStream

          protected abstract java.io.OutputStream getSendStream()

    - #### getReceiveStream

          protected abstract java.io.InputStream getReceiveStream()

    - #### shutdownInput

          protected abstract void shutdownInput()
                                         throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### shutdownOutput

          protected abstract void shutdownOutput()
                                          throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeObject

          protected abstract void writeObject(java.lang.Object obj)
                                       throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### readObject

          protected abstract java.lang.Object readObject()
                                                  throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### closeConnection

          public abstract void closeConnection()

      Closes all socket streams as well as the socket itself.

    - #### isTransferZipped

          public boolean isTransferZipped()

    - #### wasFoundZippedOnServer

          public boolean wasFoundZippedOnServer()

    - #### getTransferJob

          public AbstractTransferJob getTransferJob()

    - #### execute

          public abstract void execute()
                                throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### toString

          public java.lang.String toString()

      Description copied from interface: `Dumpable`
      Returns a single line String that shows the values of the most important state variables of this object. This is intentionally the same toString() method which is already provided by Object per se.
      Specified by:
        `toString` in interface `Dumpable`
      Overrides:
        `toString` in class `DumpableObject`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.