de.esprit.netsuite.client.activity.transfer

## Class FileTransferClientTask<C extends ClientContext>

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<C>
    - - de.esprit.appsuite.task.AbstractAsyncExecutable<C>
      - - de.esprit.appsuite.task.AbstractAsyncTask<C>
        - - de.esprit.appsuite.gui.task.AbstractSwingTask<C>
          - - de.esprit.netsuite.client.activity.transfer.FileTransferClientTask<C>

- All Implemented Interfaces:
    ApplicationObject<C>, AsyncExecutable<C>, AsyncTask<C>, CancellableTask, LocalCancellableTask, TaskMonitorSupport, TaskEvent.Source, TaskIdHolder, ErrorHandlerSupport, Renderable, SimpleLogSupport, Dumpable, Executable, ClientObject<C>, java.lang.Runnable

      public class FileTransferClientTask<C extends ClientContext>
      extends AbstractSwingTask<C>
      implements ClientObject<C>

  This task steps through the joblist and for each job it opens an `FileUploadConnection` or a `FileDownloadConnection` depending on the transfer direction. It communicates to its remote counterpart `TransferServiceTask` via the transfer service for transporting the stream data.
  Author:
    Rainer Buesch

- - ### Field Summary

    - ### Fields inherited from class de.esprit.appsuite.task.AbstractAsyncExecutable

      `childTaskRef, isTestMode, monitorController, resultRef, stateFlag`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileTransferClientTask(C clientCtx, AgentId agentId)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doOnFinish()` Is called in ANY CASE when the task has finished.
    `void` | `executeAsync()` Must be overridden to perform the async part.
    `AgentId` | `getAgentId()`
    `C` | `getClientContext()` Returns the the client runtime environment
    `FileTransferJob` | `getCurrentJob()` Returns the job currently in transfer
    `JobId` | `getJobId()`
    `FileTransferJobList` | `getJobList()`
    `java.awt.Color` | `getRenderColor()`
    `javax.swing.Icon` | `getRenderIcon()`
    `java.lang.String` | `getRenderText()`
    `SessionId` | `getSessionId()`
    `TransferDirection` | `getTransferDirection()`
    `void` | `setJobList(FileTransferJobList jobs)`
    `TaskId` | `submit(java.util.concurrent.ExecutorService pool)` Submits this task for execution to the given thread pool

    - ### Methods inherited from class de.esprit.appsuite.gui.task.AbstractSwingTask

      `addMonitor, addTaskListener, awaitEventsDone, doneChildFinished, doneChildStarted, doneTaskCancelled, doneTaskFailed, doneTaskFinished, doneTaskProceeded, doneTaskStarted, doneTaskStateChanged, doneTaskSucceeded, getActionCancel, getSwingTaskMonitor, isRegisterInTaskList, removeTaskListener, showError, showError, showError, showInfo, showInfo, showWarning, showWarning`

    - ### Methods inherited from class de.esprit.appsuite.task.AbstractAsyncTask

      `awaitFinished, awaitFinished, awaitStarted, cancel, createTaskId, deregisterTask, doOnStart, doOnSuccess, executeChildTask, executeChildTask, getCurrentFuture, getMaxChildTasks, getPriority, getProcessingDuration, getStartTime, getStopWatch, handleFinish, handleStart, handleSuccess, isRegisterForCancel, isRunning, notifyProceeded, registerTask, releaseStart, run, setCurrentFuture, setMaxChildTasks, setPriority, setRegisterForCancel, setReleaseTimeout, submit, submitInternal, toString, wasSucceeded`

    - ### Methods inherited from class de.esprit.appsuite.task.AbstractAsyncExecutable

      `checkCancelled, checkForErrorAndRethrow, clearMonitors, createRunStateFlag, doOnCancel, doOnFailure, execute, executeSubTask, getError, getMaxProgressSteps, getMonitorCount, getMonitors, getName, getProgressStepCount, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, hasError, hasMonitor, isCancellable, registerTaskStateChange, removeMonitor, resetProgress, setCancellable, setLogLevel, setMaxProgressSteps, setMonitor, setName, setName, setResult, setRunStateFlag, setTaskId, setType, shouldFireMonitor, sleepChecked, wasCancelled`

    - ### 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.appsuite.task.AsyncTask

      `getError, hasError, setName`

    - ### Methods inherited from interface de.esprit.appsuite.task.AsyncExecutable

      `checkCancelled, checkForErrorAndRethrow, executeSubTask, getName, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, isCancellable, setCancellable, setName, setResult, setRunStateFlag, sleepChecked`

    - ### Methods inherited from interface de.esprit.appsuite.launch.ApplicationObject

      `getApplicationContext`

    - ### Methods inherited from interface de.esprit.common.type.Executable

      `execute`

    - ### Methods inherited from interface de.esprit.appsuite.task.monitor.TaskMonitorSupport

      `clearMonitors, getMonitorCount, getMonitors, hasMonitor, removeMonitor`

    - ### Methods inherited from interface de.esprit.common.log.SimpleLogSupport

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

    - ### Methods inherited from interface de.esprit.appsuite.task.CancellableTask

      `wasCancelled`

    - ### Methods inherited from interface de.esprit.appsuite.task.TaskIdHolder

      `getTaskId`

    - ### Methods inherited from interface de.esprit.common.type.Dumpable

      `toDumpString, toDumpString, toString`

- - ### Constructor Detail

    - #### FileTransferClientTask

          public FileTransferClientTask(C clientCtx,
                                AgentId agentId)

  - ### Method Detail

    - #### getSessionId

          public SessionId getSessionId()

    - #### getClientContext

          public final C getClientContext()

      Description copied from interface: `ClientObject`
      Returns the the client runtime environment
      Specified by:
        `getClientContext` in interface `ClientObject<C extends ClientContext>`

    - #### setJobList

          public final void setJobList(FileTransferJobList jobs)

    - #### getJobId

          public final JobId getJobId()

    - #### getAgentId

          public final AgentId getAgentId()

    - #### getTransferDirection

          public final TransferDirection getTransferDirection()

    - #### getJobList

          public final FileTransferJobList getJobList()

    - #### submit

          public final TaskId submit(java.util.concurrent.ExecutorService pool)
                              throws java.lang.Exception

      Description copied from interface: `AsyncTask`
      Submits this task for execution to the given thread pool
      Specified by:
        `submit` in interface `AsyncTask<C extends ClientContext>`
      Overrides:
        `submit` in class `AbstractAsyncTask<C extends ClientContext>`
      Throws:
        `java.lang.Exception` - if the pool is busy

    - #### executeAsync

          public void executeAsync()
                            throws java.lang.Exception

      Description copied from class: `AbstractAsyncTask`
      Must be overridden to perform the async part. From within this method you may directly call `AbstractAsyncTask.notifyProceeded(Object, int, int, String)` in order to notify about task progress. Note: the running task should periodically call `AbstractAsyncExecutable.checkCancelled()` in order to detect cancellation.
      Specified by:
        `executeAsync` in interface `AsyncExecutable<C extends ClientContext>`
      Specified by:
        `executeAsync` in class `AbstractAsyncTask<C extends ClientContext>`
      Throws:
        `java.lang.Exception`
      See Also:
        `for synchronous execution`

    - #### doOnFinish

          protected void doOnFinish()

      Description copied from class: `AbstractAsyncTask`
      Is called in ANY CASE when the task has finished. Maybe overridden to perform any task finalization. Note that any Exceptions thrown are caught and just logged but do NOT affect the task.
      Overrides:
        `doOnFinish` in class `AbstractAsyncTask<C extends ClientContext>`

    - #### getCurrentJob

          public FileTransferJob getCurrentJob()

      Returns the job currently in transfer

    - #### getRenderText

          public java.lang.String getRenderText()

      Specified by:
        `getRenderText` in interface `Renderable`
      Overrides:
        `getRenderText` in class `AbstractSwingTask<C extends ClientContext>`

    - #### getRenderIcon

          public javax.swing.Icon getRenderIcon()

      Specified by:
        `getRenderIcon` in interface `Renderable`
      Overrides:
        `getRenderIcon` in class `AbstractSwingTask<C extends ClientContext>`

    - #### getRenderColor

          public java.awt.Color getRenderColor()

      Specified by:
        `getRenderColor` in interface `Renderable`
      Overrides:
        `getRenderColor` in class `AbstractSwingTask<C extends ClientContext>`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.