Package fr.gouv.vitam.processing.management.core

# Class ProcessManagementImpl

java.lang.Object
fr.gouv.vitam.processing.management.core.ProcessManagementImpl

All Implemented Interfaces:
  `ProcessLifeCycle`, `VitamAutoCloseable`, `ProcessManagement`, `AutoCloseable`

public class ProcessManagementImpl extends Object implements ProcessManagement
ProcessManagementImpl implementation of ProcessManagement API

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ProcessManagementImpl(ServerConfiguration config, ProcessDistributor processDistributor)`
  `ProcessManagementImpl(ServerConfiguration config, ProcessDistributor processDistributor, ProcessDataAccess processDataAccess, ProcessDataManagement processDataManagement, OperationContextMonitor operationContextMonitor)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ItemStatus`
  `cancel(String operationId, Integer tenantId, boolean force)`
  Handle a cancel action for the corresponding process workflow
  `void`
  `close()`
  `ItemStatus`
  `execute(String operationId, Integer tenantId, WorkerParameters workerParameters, Boolean useForcedPause, boolean forceCancellation, ProcessAction action)`
  `List<ProcessWorkflow>`
  `findAllProcessWorkflow(Integer tenantId)`
  Retrieve All the workflow process for monitoring purpose The final business scope of this feature is likely to be redefined, to match the future need
  `ProcessWorkflow`
  `findOneProcessWorkflow(String operationId, Integer tenantId)`
  find the workflow process according to the operation_id and the tenant_id
  `void`
  `forcePause(ProcessPause pause)`
  Add a forced pause on the tenant and/or the type of process
  `ServerConfiguration`
  `getConfiguration()`
  server configuration
  `List<ProcessDetail>`
  `getFilteredProcess(ProcessQuery query, Integer tenantId)`
  Get filtered process workflow
  `Map<String,IEventsState>`
  `getProcessMonitorList()`
  sProcessMonitorList
  `Map<String,WorkFlow>`
  `getWorkflowDefinitions()`
  Retrieve the loaded workflow definitions
  `Map<Integer,Map<String,ProcessWorkflow>>`
  `getWorkFlowList()`
  `ProcessWorkflow`
  `init(WorkerParameters workerParameters, String workflowId)`
  Init a new process workflow
  `ItemStatus`
  `next(WorkerParameters workerParameters, Integer tenantId)`
  Handle a next action for the corresponding process workflow
  `ItemStatus`
  `pause(String operationId, Integer tenantId)`
  Handle a pause action for the corresponding process workflow
  `void`
  `reloadWorkflowDefinitions()`
  Reload workflow definitions
  `void`
  `removeForcePause(ProcessPause pause)`
  Removed the forced pause on the tenant and/or the type of process
  `ItemStatus`
  `replay(WorkerParameters workerParameters, Integer tenantId)`
  Handle a replay action for the corresponding process workflow
  `ItemStatus`
  `resume(WorkerParameters workerParameters, Integer tenantId, boolean useForcedPause)`
  Handle a resume action for the corresponding process workflow
  `void`
  `startProcess()`
  This method is called when the server started Start all process
  `void`
  `stopProcess()`
  This method is used to properly stop all ProcessWorkflow Call stop on all running process workflow and propagate this stop to the distributor The distributor should : - Unregister all worker and complete all opened connections to the workers - Stop properly waiting tasks - Save index of element to be used in the next start

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

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

- ## Constructor Details

  - ### ProcessManagementImpl

    public ProcessManagementImpl(ServerConfiguration config, ProcessDistributor processDistributor) throws ProcessingStorageWorkspaceException
    Throws:
      `ProcessingStorageWorkspaceException`

  - ### ProcessManagementImpl

    public ProcessManagementImpl(ServerConfiguration config, ProcessDistributor processDistributor, ProcessDataAccess processDataAccess, ProcessDataManagement processDataManagement, OperationContextMonitor operationContextMonitor) throws ProcessingStorageWorkspaceException
    Throws:
      `ProcessingStorageWorkspaceException`

- ## Method Details

  - ### startProcess

    public void startProcess()
    Description copied from interface: `ProcessLifeCycle`
    This method is called when the server started Start all process
    Specified by:
      `startProcess` in interface `ProcessLifeCycle`

  - ### stopProcess

    public void stopProcess()
    This method is used to properly stop all ProcessWorkflow Call stop on all running process workflow and propagate this stop to the distributor The distributor should : - Unregister all worker and complete all opened connections to the workers - Stop properly waiting tasks - Save index of element to be used in the next start
    Specified by:
      `stopProcess` in interface `ProcessLifeCycle`

  - ### init

    public ProcessWorkflow init(WorkerParameters workerParameters, String workflowId) throws ProcessingException
    Description copied from interface: `ProcessManagement`
    Init a new process workflow
    Specified by:
      `init` in interface `ProcessManagement`
    Parameters:
      `workerParameters` - parameters to be passed to ProcessEngine
      `workflowId` - the workflow identifier
    Returns:
      ProcessWorkflow
    Throws:
      `ProcessingException` - if the process could not be initialized

  - ### next

    public ItemStatus next(WorkerParameters workerParameters, Integer tenantId) throws ProcessingException, StateNotAllowedException
    Description copied from interface: `ProcessManagement`
    Handle a next action for the corresponding process workflow
    Specified by:
      `next` in interface `ProcessManagement`
    Parameters:
      `workerParameters` - parameters to be passed to ProcessEngine
      `tenantId` - the tenant identifier
    Returns:
      the status
    Throws:
      `ProcessingException` - if next could not be applied
      `StateNotAllowedException` - if the process state is incorrect

  - ### resume

    public ItemStatus resume(WorkerParameters workerParameters, Integer tenantId, boolean useForcedPause) throws ProcessingException, StateNotAllowedException
    Description copied from interface: `ProcessManagement`
    Handle a resume action for the corresponding process workflow
    Specified by:
      `resume` in interface `ProcessManagement`
    Parameters:
      `workerParameters` - parameters to be passed to ProcessEngine
      `tenantId` - the tenant identifier
      `useForcedPause` - if the forced pause must be applied
    Returns:
      the status
    Throws:
      `ProcessingException` - if resume could not be applied
      `StateNotAllowedException` - if the process state is incorrect

  - ### replay

    public ItemStatus replay(WorkerParameters workerParameters, Integer tenantId) throws ProcessingException, StateNotAllowedException
    Description copied from interface: `ProcessManagement`
    Handle a replay action for the corresponding process workflow
    Specified by:
      `replay` in interface `ProcessManagement`
    Parameters:
      `workerParameters` - parameters to be passed to ProcessEngine
      `tenantId` - the tenant identifier
    Returns:
      the status
    Throws:
      `ProcessingException` - if replay could not be applied
      `StateNotAllowedException` - if the process state is incorrect

  - ### pause

    public ItemStatus pause(String operationId, Integer tenantId) throws ProcessingException, StateNotAllowedException
    Description copied from interface: `ProcessManagement`
    Handle a pause action for the corresponding process workflow
    Specified by:
      `pause` in interface `ProcessManagement`
    Parameters:
      `operationId` - the operation identifier
      `tenantId` - the tenant identifier
    Returns:
      the status
    Throws:
      `ProcessingException` - if pause could not be applied
      `StateNotAllowedException` - if the process state is incorrect

  - ### cancel

    public ItemStatus cancel(String operationId, Integer tenantId, boolean force) throws WorkflowNotFoundException, ProcessingException, StateNotAllowedException
    Description copied from interface: `ProcessManagement`
    Handle a cancel action for the corresponding process workflow
    Specified by:
      `cancel` in interface `ProcessManagement`
    Parameters:
      `operationId` - the operation identifier
      `tenantId` - the tenant identifier
      `force` - to force cancellation when the current step is not cancellable
    Returns:
      the status
    Throws:
      `ProcessingException` - if cancel could not be applied
      `StateNotAllowedException` - if the process state is incorrect
      `WorkflowNotFoundException`

  - ### execute

    public ItemStatus execute(String operationId, Integer tenantId, WorkerParameters workerParameters, Boolean useForcedPause, boolean forceCancellation, ProcessAction action) throws ProcessingException, StateNotAllowedException
    Throws:
      `ProcessingException`
      `StateNotAllowedException`

  - ### forcePause

    public void forcePause(ProcessPause pause) throws ProcessingException
    Description copied from interface: `ProcessManagement`
    Add a forced pause on the tenant and/or the type of process
    Specified by:
      `forcePause` in interface `ProcessManagement`
    Parameters:
      `pause` -
    Throws:
      `ProcessingException`

  - ### removeForcePause

    public void removeForcePause(ProcessPause pause) throws ProcessingException
    Description copied from interface: `ProcessManagement`
    Removed the forced pause on the tenant and/or the type of process
    Specified by:
      `removeForcePause` in interface `ProcessManagement`
    Parameters:
      `pause` -
    Throws:
      `ProcessingException`

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `VitamAutoCloseable`

  - ### findAllProcessWorkflow

    public List<ProcessWorkflow> findAllProcessWorkflow(Integer tenantId)
    Description copied from interface: `ProcessManagement`
    Retrieve All the workflow process for monitoring purpose The final business scope of this feature is likely to be redefined, to match the future need
    Specified by:
      `findAllProcessWorkflow` in interface `ProcessManagement`
    Parameters:
      `tenantId` - the tenant identifier
    Returns:
      All the workflow process details

  - ### findOneProcessWorkflow

    public ProcessWorkflow findOneProcessWorkflow(String operationId, Integer tenantId)
    Description copied from interface: `ProcessManagement`
    find the workflow process according to the operation_id and the tenant_id
    Specified by:
      `findOneProcessWorkflow` in interface `ProcessManagement`
    Parameters:
      `operationId` - the operation identifier
      `tenantId` - the tenant identifier
    Returns:
      the workFlow process

  - ### getWorkflowDefinitions

    public Map<String,WorkFlow> getWorkflowDefinitions()
    Description copied from interface: `ProcessManagement`
    Retrieve the loaded workflow definitions
    Specified by:
      `getWorkflowDefinitions` in interface `ProcessManagement`
    Returns:
      the workflow definitions by ID

  - ### reloadWorkflowDefinitions

    public void reloadWorkflowDefinitions()
    Description copied from interface: `ProcessManagement`
    Reload workflow definitions
    Specified by:
      `reloadWorkflowDefinitions` in interface `ProcessManagement`

  - ### getWorkFlowList

    public Map<Integer,Map<String,ProcessWorkflow>> getWorkFlowList()
    Specified by:
      `getWorkFlowList` in interface `ProcessManagement`
    Returns:
      WorkFlow List

  - ### getProcessMonitorList

    public Map<String,IEventsState> getProcessMonitorList()
    Description copied from interface: `ProcessManagement`
    sProcessMonitorList
    Specified by:
      `getProcessMonitorList` in interface `ProcessManagement`
    Returns:

  - ### getFilteredProcess

    public List<ProcessDetail> getFilteredProcess(ProcessQuery query, Integer tenantId)
    Description copied from interface: `ProcessManagement`
    Get filtered process workflow
    Specified by:
      `getFilteredProcess` in interface `ProcessManagement`
    Parameters:
      `query` - to filter
      `tenantId` - the tenandId
    Returns:
      filtered process list

  - ### getConfiguration

    public ServerConfiguration getConfiguration()
    Description copied from interface: `ProcessManagement`
    server configuration
    Specified by:
      `getConfiguration` in interface `ProcessManagement`
    Returns: