de.esprit.netsuite.client

## Class ClientTaskManager<C extends ClientContext>

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<C>
    - - de.esprit.appsuite.task.taskmgr.TaskManager<C>
      - - de.esprit.netsuite.client.ClientTaskManager<C>

- All Implemented Interfaces:
    ApplicationObject<C>, CloseableComponent, Initializable, SimpleLogSupport, Dumpable, ClientObject<C>, JournalTaskRestarter<C>, JournalTaskRestartEvent.Source, java.lang.AutoCloseable

      public class ClientTaskManager<C extends ClientContext>
      extends TaskManager<C>
      implements ClientObject<C>, JournalTaskRestarter<C>, JournalTaskRestartEvent.Source, Initializable

  Extends the `TaskManager` such that all activity lists are maintained centrally here.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientTaskManager(C clientCtx)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addTaskRestartListener(JournalTaskRestartEvent.Listener l)`
    `int` | `cancelAll()`
    `void` | `cancelAllRemoteActivity()`
    `boolean` | `cancelTask(RemoteTaskId taskId, SessionId sessId)` Sends a `RemoteTaskCancelAgent` in order to cancel the remote task on the server.
    `void` | `checkInitialized()` Checks whether initialization has yet been done and throws an `NotInitializedException` if not.
    `void` | `doAfterJournalTaskRestart(java.lang.String serverName)` Is called after all remote journal tasks have been reattached
    `void` | `doBeforeJournalTaskRestart(java.lang.String serverName)` Is called before the attempt to reattach to any remote journal tasks
    `void` | `fillCurrentActivity(java.util.Map<java.lang.String,java.lang.Integer> activityMap)` Stores the current item-count in the given activityMap.
    `ActiveAbosListModel` | `getActiveAbosListModel()`
    `ActiveAgentsListModel` | `getActiveAgentsListModel()` Returns a ListModel instance that maintains AgentId objects of the async agents that are currently running on the server.
    `ActiveCommandsListModel` | `getActiveCommandsListModel()` Returns a ListModel instance that maintains the currently running async client commands.
    `ActiveLocksListModel` | `getActiveLocksListModel()` Returns the ResourceLockCache singleton instance.
    `ActiveStreamsListModel` | `getActiveStreamsListModel()` Returns a ListModel instance that maintains JobId objects of the stream downloads that are currently running.
    `ActiveTransfersListModel` | `getActiveTransfersListModel()` Returns a ListModel instance that maintains JobId objects of the async file transfers that are currently running.
    `C` | `getClientContext()` Returns the the client runtime environment
    `JournalTaskRestarter<C>` | `getJournalTaskRestarter()`
    `void` | `init()` Performs the initialization of this class.
    `boolean` | `isInitialized()` Tells whether initialization has yet been done.
    `AsyncTask` | `reattachToJournalTask(java.lang.String serverName, JournalTaskId taskId)` Is called for each remote journal task that has to be reattached.
    `void` | `removeTaskRestartListener(JournalTaskRestartEvent.Listener l)`
    `void` | `setJournalTaskRestarter(JournalTaskRestarter<C> journalTaskRestarter)`

    - ### Methods inherited from class de.esprit.appsuite.task.taskmgr.TaskManager

      `cancelTask, checkForActivity, close, deregisterTask, findAllCancellableTaskIds, findAllNonCancellableTaskIds, findTask, findTaskByName, getActiveOsProcessesListModel, getActiveTasksListModel, getActiveWorkflowsListModel, getAsyncExecutor, getTaskCount, registerTask, registerTaskStateChange`

    - ### 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, toString`

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

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

- - ### Constructor Detail

    - #### ClientTaskManager

          public ClientTaskManager(C clientCtx)

  - ### Method Detail

    - #### 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>`

    - #### cancelAll

          public int cancelAll()

      Overrides:
        `cancelAll` in class `TaskManager<C extends ClientContext>`

    - #### cancelAllRemoteActivity

          public void cancelAllRemoteActivity()

    - #### cancelTask

          public boolean cancelTask(RemoteTaskId taskId,
                           SessionId sessId)

      Sends a `RemoteTaskCancelAgent` in order to cancel the remote task on the server. The local counterpart task remains untouched but will react on the remote cancel.

    - #### init

          public void init()

      Description copied from interface: `Initializable`
      Performs the initialization of this class. Note that the implementation should maintain an isInitialized flag which must be set when initialization has completed.
      Specified by:
        `init` in interface `Initializable`

    - #### isInitialized

          public boolean isInitialized()

      Description copied from interface: `Initializable`
      Tells whether initialization has yet been done.
      Specified by:
        `isInitialized` in interface `Initializable`

    - #### checkInitialized

          public void checkInitialized()
                                throws NotInitializedException

      Description copied from interface: `Initializable`
      Checks whether initialization has yet been done and throws an `NotInitializedException` if not.
      Specified by:
        `checkInitialized` in interface `Initializable`
      Throws:
        `NotInitializedException`

    - #### fillCurrentActivity

          public void fillCurrentActivity(java.util.Map<java.lang.String,java.lang.Integer> activityMap)

      Description copied from class: `TaskManager`
      Stores the current item-count in the given activityMap. This is just a snapshot - you should not rely on the counts to be valid over time.
      Overrides:
        `fillCurrentActivity` in class `TaskManager<C extends ClientContext>`

    - #### getActiveAgentsListModel

          public ActiveAgentsListModel getActiveAgentsListModel()

      Returns a ListModel instance that maintains AgentId objects of the async agents that are currently running on the server. As soon as the agents are received via a NetMessage the according list item is removed.

    - #### getActiveTransfersListModel

          public ActiveTransfersListModel getActiveTransfersListModel()

      Returns a ListModel instance that maintains JobId objects of the async file transfers that are currently running.

    - #### getActiveStreamsListModel

          public ActiveStreamsListModel getActiveStreamsListModel()

      Returns a ListModel instance that maintains JobId objects of the stream downloads that are currently running.

    - #### getActiveCommandsListModel

          public ActiveCommandsListModel getActiveCommandsListModel()

      Returns a ListModel instance that maintains the currently running async client commands.

    - #### getActiveLocksListModel

          public ActiveLocksListModel getActiveLocksListModel()

      Returns the ResourceLockCache singleton instance. This instance maintains ResourceLocks which are currently hold by the client an keep retriggering.

    - #### getActiveAbosListModel

          public ActiveAbosListModel getActiveAbosListModel()

    - #### setJournalTaskRestarter

          public void setJournalTaskRestarter(JournalTaskRestarter<C> journalTaskRestarter)

    - #### getJournalTaskRestarter

          public JournalTaskRestarter<C> getJournalTaskRestarter()

    - #### doBeforeJournalTaskRestart

          public void doBeforeJournalTaskRestart(java.lang.String serverName)

      Description copied from interface: `JournalTaskRestarter`
      Is called before the attempt to reattach to any remote journal tasks
      Specified by:
        `doBeforeJournalTaskRestart` in interface `JournalTaskRestarter<C extends ClientContext>`

    - #### reattachToJournalTask

          public AsyncTask reattachToJournalTask(java.lang.String serverName,
                                        JournalTaskId taskId)
                                          throws java.lang.Exception

      Description copied from interface: `JournalTaskRestarter`
      Is called for each remote journal task that has to be reattached.
      Specified by:
        `reattachToJournalTask` in interface `JournalTaskRestarter<C extends ClientContext>`
      Throws:
        `java.lang.Exception`

    - #### doAfterJournalTaskRestart

          public void doAfterJournalTaskRestart(java.lang.String serverName)

      Description copied from interface: `JournalTaskRestarter`
      Is called after all remote journal tasks have been reattached
      Specified by:
        `doAfterJournalTaskRestart` in interface `JournalTaskRestarter<C extends ClientContext>`

    - #### addTaskRestartListener

          public final void addTaskRestartListener(JournalTaskRestartEvent.Listener l)

      Specified by:
        `addTaskRestartListener` in interface `JournalTaskRestartEvent.Source`

    - #### removeTaskRestartListener

          public final void removeTaskRestartListener(JournalTaskRestartEvent.Listener l)

      Specified by:
        `removeTaskRestartListener` in interface `JournalTaskRestartEvent.Source`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.