Class ProcessManagementImpl
java.lang.Object
fr.gouv.vitam.processing.management.core.ProcessManagementImpl
- All Implemented Interfaces:
ProcessLifeCycle,VitamAutoCloseable,ProcessManagement,AutoCloseable
ProcessManagementImpl implementation of ProcessManagement API
-
Constructor Summary
ConstructorsConstructorDescriptionProcessManagementImpl(ServerConfiguration config, ProcessDistributor processDistributor) ProcessManagementImpl(ServerConfiguration config, ProcessDistributor processDistributor, ProcessDataAccess processDataAccess, ProcessDataManagement processDataManagement, OperationContextMonitor operationContextMonitor) -
Method Summary
Modifier and TypeMethodDescriptionHandle a cancel action for the corresponding process workflowvoidclose()execute(String operationId, Integer tenantId, WorkerParameters workerParameters, Boolean useForcedPause, boolean forceCancellation, ProcessAction action) 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 needfindOneProcessWorkflow(String operationId, Integer tenantId) find the workflow process according to the operation_id and the tenant_idvoidforcePause(ProcessPause pause) Add a forced pause on the tenant and/or the type of processserver configurationgetFilteredProcess(ProcessQuery query, Integer tenantId) Get filtered process workflowsProcessMonitorListRetrieve the loaded workflow definitionsinit(WorkerParameters workerParameters, String workflowId) Init a new process workflownext(WorkerParameters workerParameters, Integer tenantId) Handle a next action for the corresponding process workflowHandle a pause action for the corresponding process workflowvoidReload workflow definitionsvoidremoveForcePause(ProcessPause pause) Removed the forced pause on the tenant and/or the type of processreplay(WorkerParameters workerParameters, Integer tenantId) Handle a replay action for the corresponding process workflowresume(WorkerParameters workerParameters, Integer tenantId, boolean useForcedPause) Handle a resume action for the corresponding process workflowvoidThis method is called when the server started Start all processvoidThis 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
-
Constructor Details
-
ProcessManagementImpl
public ProcessManagementImpl(ServerConfiguration config, ProcessDistributor processDistributor) throws ProcessingStorageWorkspaceException -
ProcessManagementImpl
public ProcessManagementImpl(ServerConfiguration config, ProcessDistributor processDistributor, ProcessDataAccess processDataAccess, ProcessDataManagement processDataManagement, OperationContextMonitor operationContextMonitor) throws ProcessingStorageWorkspaceException
-
-
Method Details
-
startProcess
public void startProcess()Description copied from interface:ProcessLifeCycleThis method is called when the server started Start all process- Specified by:
startProcessin interfaceProcessLifeCycle
-
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:
stopProcessin interfaceProcessLifeCycle
-
init
public ProcessWorkflow init(WorkerParameters workerParameters, String workflowId) throws ProcessingException Description copied from interface:ProcessManagementInit a new process workflow- Specified by:
initin interfaceProcessManagement- Parameters:
workerParameters- parameters to be passed to ProcessEngineworkflowId- 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:ProcessManagementHandle a next action for the corresponding process workflow- Specified by:
nextin interfaceProcessManagement- Parameters:
workerParameters- parameters to be passed to ProcessEnginetenantId- the tenant identifier- Returns:
- the status
- Throws:
ProcessingException- if next could not be appliedStateNotAllowedException- if the process state is incorrect
-
resume
public ItemStatus resume(WorkerParameters workerParameters, Integer tenantId, boolean useForcedPause) throws ProcessingException, StateNotAllowedException Description copied from interface:ProcessManagementHandle a resume action for the corresponding process workflow- Specified by:
resumein interfaceProcessManagement- Parameters:
workerParameters- parameters to be passed to ProcessEnginetenantId- the tenant identifieruseForcedPause- if the forced pause must be applied- Returns:
- the status
- Throws:
ProcessingException- if resume could not be appliedStateNotAllowedException- if the process state is incorrect
-
replay
public ItemStatus replay(WorkerParameters workerParameters, Integer tenantId) throws ProcessingException, StateNotAllowedException Description copied from interface:ProcessManagementHandle a replay action for the corresponding process workflow- Specified by:
replayin interfaceProcessManagement- Parameters:
workerParameters- parameters to be passed to ProcessEnginetenantId- the tenant identifier- Returns:
- the status
- Throws:
ProcessingException- if replay could not be appliedStateNotAllowedException- if the process state is incorrect
-
pause
public ItemStatus pause(String operationId, Integer tenantId) throws ProcessingException, StateNotAllowedException Description copied from interface:ProcessManagementHandle a pause action for the corresponding process workflow- Specified by:
pausein interfaceProcessManagement- Parameters:
operationId- the operation identifiertenantId- the tenant identifier- Returns:
- the status
- Throws:
ProcessingException- if pause could not be appliedStateNotAllowedException- if the process state is incorrect
-
cancel
public ItemStatus cancel(String operationId, Integer tenantId, boolean force) throws WorkflowNotFoundException, ProcessingException, StateNotAllowedException Description copied from interface:ProcessManagementHandle a cancel action for the corresponding process workflow- Specified by:
cancelin interfaceProcessManagement- Parameters:
operationId- the operation identifiertenantId- the tenant identifierforce- to force cancellation when the current step is not cancellable- Returns:
- the status
- Throws:
ProcessingException- if cancel could not be appliedStateNotAllowedException- if the process state is incorrectWorkflowNotFoundException
-
execute
public ItemStatus execute(String operationId, Integer tenantId, WorkerParameters workerParameters, Boolean useForcedPause, boolean forceCancellation, ProcessAction action) throws ProcessingException, StateNotAllowedException -
forcePause
Description copied from interface:ProcessManagementAdd a forced pause on the tenant and/or the type of process- Specified by:
forcePausein interfaceProcessManagement- Throws:
ProcessingException
-
removeForcePause
Description copied from interface:ProcessManagementRemoved the forced pause on the tenant and/or the type of process- Specified by:
removeForcePausein interfaceProcessManagement- Throws:
ProcessingException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceVitamAutoCloseable
-
findAllProcessWorkflow
Description copied from interface:ProcessManagementRetrieve 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:
findAllProcessWorkflowin interfaceProcessManagement- Parameters:
tenantId- the tenant identifier- Returns:
- All the workflow process details
-
findOneProcessWorkflow
Description copied from interface:ProcessManagementfind the workflow process according to the operation_id and the tenant_id- Specified by:
findOneProcessWorkflowin interfaceProcessManagement- Parameters:
operationId- the operation identifiertenantId- the tenant identifier- Returns:
- the workFlow process
-
getWorkflowDefinitions
Description copied from interface:ProcessManagementRetrieve the loaded workflow definitions- Specified by:
getWorkflowDefinitionsin interfaceProcessManagement- Returns:
- the workflow definitions by ID
-
reloadWorkflowDefinitions
public void reloadWorkflowDefinitions()Description copied from interface:ProcessManagementReload workflow definitions- Specified by:
reloadWorkflowDefinitionsin interfaceProcessManagement
-
getWorkFlowList
- Specified by:
getWorkFlowListin interfaceProcessManagement- Returns:
- WorkFlow List
-
getProcessMonitorList
Description copied from interface:ProcessManagementsProcessMonitorList- Specified by:
getProcessMonitorListin interfaceProcessManagement- Returns:
-
getFilteredProcess
Description copied from interface:ProcessManagementGet filtered process workflow- Specified by:
getFilteredProcessin interfaceProcessManagement- Parameters:
query- to filtertenantId- the tenandId- Returns:
- filtered process list
-
getConfiguration
Description copied from interface:ProcessManagementserver configuration- Specified by:
getConfigurationin interfaceProcessManagement- Returns:
-