Class ProcessManagementImpl
- java.lang.Object
-
- fr.gouv.vitam.processing.management.core.ProcessManagementImpl
-
- All Implemented Interfaces:
ProcessLifeCycle
,VitamAutoCloseable
,ProcessManagement
,java.lang.AutoCloseable
public class ProcessManagementImpl extends java.lang.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemStatus
cancel(java.lang.String operationId, java.lang.Integer tenantId)
Handle a cancel action for the corresponding process workflowvoid
close()
ItemStatus
execute(java.lang.String operationId, java.lang.Integer tenantId, WorkerParameters workerParameters, java.lang.Boolean useForcedPause, ProcessAction action)
java.util.List<ProcessWorkflow>
findAllProcessWorkflow(java.lang.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 needProcessWorkflow
findOneProcessWorkflow(java.lang.String operationId, java.lang.Integer tenantId)
find the workflow process according to the operation_id and the tenant_idvoid
forcePause(ProcessPause pause)
Add a forced pause on the tenant and/or the type of processServerConfiguration
getConfiguration()
server configurationjava.util.List<ProcessDetail>
getFilteredProcess(ProcessQuery query, java.lang.Integer tenantId)
Get filtered process workflowjava.util.Map<java.lang.String,IEventsState>
getProcessMonitorList()
sProcessMonitorListjava.util.Map<java.lang.String,WorkFlow>
getWorkflowDefinitions()
Retrieve the loaded workflow definitionsjava.util.Map<java.lang.Integer,java.util.Map<java.lang.String,ProcessWorkflow>>
getWorkFlowList()
ProcessWorkflow
init(WorkerParameters workerParameters, java.lang.String workflowId)
Init a new process workflowItemStatus
next(WorkerParameters workerParameters, java.lang.Integer tenantId)
Handle a next action for the corresponding process workflowItemStatus
pause(java.lang.String operationId, java.lang.Integer tenantId)
Handle a pause action for the corresponding process workflowvoid
reloadWorkflowDefinitions()
Reload workflow definitionsvoid
removeForcePause(ProcessPause pause)
Removed the forced pause on the tenant and/or the type of processItemStatus
replay(WorkerParameters workerParameters, java.lang.Integer tenantId)
Handle a replay action for the corresponding process workflowItemStatus
resume(WorkerParameters workerParameters, java.lang.Integer tenantId, boolean useForcedPause)
Handle a resume action for the corresponding process workflowvoid
startProcess()
This method is called when the server started Start all processvoid
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
-
-
-
Constructor Detail
-
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 Detail
-
startProcess
public void startProcess()
Description copied from interface:ProcessLifeCycle
This method is called when the server started Start all process- Specified by:
startProcess
in 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:
stopProcess
in interfaceProcessLifeCycle
-
init
public ProcessWorkflow init(WorkerParameters workerParameters, java.lang.String workflowId) throws ProcessingException
Description copied from interface:ProcessManagement
Init a new process workflow- Specified by:
init
in 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, java.lang.Integer tenantId) throws ProcessingException, StateNotAllowedException
Description copied from interface:ProcessManagement
Handle a next action for the corresponding process workflow- Specified by:
next
in 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, java.lang.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 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, java.lang.Integer tenantId) throws ProcessingException, StateNotAllowedException
Description copied from interface:ProcessManagement
Handle a replay action for the corresponding process workflow- Specified by:
replay
in 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(java.lang.String operationId, java.lang.Integer tenantId) throws ProcessingException, StateNotAllowedException
Description copied from interface:ProcessManagement
Handle a pause action for the corresponding process workflow- Specified by:
pause
in 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(java.lang.String operationId, java.lang.Integer tenantId) throws WorkflowNotFoundException, ProcessingException, StateNotAllowedException
Description copied from interface:ProcessManagement
Handle a cancel action for the corresponding process workflow- Specified by:
cancel
in interfaceProcessManagement
- Parameters:
operationId
- the operation identifiertenantId
- the tenant identifier- Returns:
- the status
- Throws:
ProcessingException
- if cancel could not be appliedStateNotAllowedException
- if the process state is incorrectWorkflowNotFoundException
-
execute
public ItemStatus execute(java.lang.String operationId, java.lang.Integer tenantId, WorkerParameters workerParameters, java.lang.Boolean useForcedPause, ProcessAction action) 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 interfaceProcessManagement
- 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 interfaceProcessManagement
- Throws:
ProcessingException
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceVitamAutoCloseable
-
findAllProcessWorkflow
public java.util.List<ProcessWorkflow> findAllProcessWorkflow(java.lang.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 interfaceProcessManagement
- Parameters:
tenantId
- the tenant identifier- Returns:
- All the workflow process details
-
findOneProcessWorkflow
public ProcessWorkflow findOneProcessWorkflow(java.lang.String operationId, java.lang.Integer tenantId)
Description copied from interface:ProcessManagement
find the workflow process according to the operation_id and the tenant_id- Specified by:
findOneProcessWorkflow
in interfaceProcessManagement
- Parameters:
operationId
- the operation identifiertenantId
- the tenant identifier- Returns:
- the workFlow process
-
getWorkflowDefinitions
public java.util.Map<java.lang.String,WorkFlow> getWorkflowDefinitions()
Description copied from interface:ProcessManagement
Retrieve the loaded workflow definitions- Specified by:
getWorkflowDefinitions
in interfaceProcessManagement
- Returns:
- the workflow definitions by ID
-
reloadWorkflowDefinitions
public void reloadWorkflowDefinitions()
Description copied from interface:ProcessManagement
Reload workflow definitions- Specified by:
reloadWorkflowDefinitions
in interfaceProcessManagement
-
getWorkFlowList
public java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,ProcessWorkflow>> getWorkFlowList()
- Specified by:
getWorkFlowList
in interfaceProcessManagement
- Returns:
- WorkFlow List
-
getProcessMonitorList
public java.util.Map<java.lang.String,IEventsState> getProcessMonitorList()
Description copied from interface:ProcessManagement
sProcessMonitorList- Specified by:
getProcessMonitorList
in interfaceProcessManagement
- Returns:
-
getFilteredProcess
public java.util.List<ProcessDetail> getFilteredProcess(ProcessQuery query, java.lang.Integer tenantId)
Description copied from interface:ProcessManagement
Get filtered process workflow- Specified by:
getFilteredProcess
in interfaceProcessManagement
- Parameters:
query
- to filtertenantId
- the tenandId- Returns:
- filtered process list
-
getConfiguration
public ServerConfiguration getConfiguration()
Description copied from interface:ProcessManagement
server configuration- Specified by:
getConfiguration
in interfaceProcessManagement
- Returns:
-
-