Class WorkspaceProcessDataManagement
java.lang.Object
fr.gouv.vitam.processing.data.core.management.WorkspaceProcessDataManagement
- All Implemented Interfaces:
ProcessDataManagement
Workspace implemenation for workflows datas management
-
Field Summary
Fields inherited from interface fr.gouv.vitam.processing.data.core.management.ProcessDataManagement
DISTRIBUTOR_INDEX, PROCESS_CONTAINER -
Constructor Summary
ConstructorsConstructorDescriptionWorkspaceProcessDataManagement(WorkspaceClientFactory workspaceClientFactory) -
Method Summary
Modifier and TypeMethodDescriptionbooleancreateFolder(String folderName) Create a folder with the name {folderName} if does not exist on the process containerbooleanCreate the process container (initialisation) if does not existgetDistributorIndex(String fileName) static ProcessDataManagementGet the current instancegetProcessWorkflow(String folderName, String asyncId) Retrieve a workflow instance on process containergetProcessWorkflowFor(Integer tenantId, String folderName) Get process workflow map for tenantId and folderName (server id from serverIdentity)booleanisFolderExist(String folderName) Check if the folder with name {folderName} exists on process containerbooleanCheck if the process container existsvoidpersistDistributorIndex(String fileName, DistributorIndex distributorIndex) voidpersistProcessWorkflow(String folderName, ProcessWorkflow processWorkflow) Put process workflow instance in workspacebooleanremoveFolder(String folderName) Delete folder with name {folderName} if exists on process containerbooleanremoveOperationContainer(ProcessWorkflow processWorkflow, WorkspaceClientFactory workspaceClientFactory) voidremoveProcessWorkflow(String folderName, String asyncId) Delete process workflow from the workspace
-
Constructor Details
-
WorkspaceProcessDataManagement
-
-
Method Details
-
getInstance
Get the current instance- Returns:
- the current instance
-
createProcessContainer
Description copied from interface:ProcessDataManagementCreate the process container (initialisation) if does not exist- Specified by:
createProcessContainerin interfaceProcessDataManagement- Returns:
- true if the container was created, false if it already exists
- Throws:
ProcessingStorageWorkspaceException- when storage error occurs
-
isProcessContainerExist
Description copied from interface:ProcessDataManagementCheck if the process container exists- Specified by:
isProcessContainerExistin interfaceProcessDataManagement- Returns:
- true if the container exists, false otherwise
- Throws:
ProcessingStorageWorkspaceException- when storage error occurs
-
createFolder
Description copied from interface:ProcessDataManagementCreate a folder with the name {folderName} if does not exist on the process container- Specified by:
createFolderin interfaceProcessDataManagement- Parameters:
folderName- the name of the folder to create- Returns:
- true if the folder was created, false if it already exists
- Throws:
ProcessingStorageWorkspaceException- when storage error occurs
-
isFolderExist
Description copied from interface:ProcessDataManagementCheck if the folder with name {folderName} exists on process container- Specified by:
isFolderExistin interfaceProcessDataManagement- Parameters:
folderName- the folder name to check- Returns:
- true if folder exists on process container, false otherwise
- Throws:
ProcessingStorageWorkspaceException- when storage error occurs
-
removeFolder
Description copied from interface:ProcessDataManagementDelete folder with name {folderName} if exists on process container- Specified by:
removeFolderin interfaceProcessDataManagement- Parameters:
folderName- the folderName to delete- Returns:
- true if the folder was removed, false if it does not exist
- Throws:
ProcessingStorageWorkspaceException- when storage error occurs
-
persistProcessWorkflow
public void persistProcessWorkflow(String folderName, ProcessWorkflow processWorkflow) throws ProcessingStorageWorkspaceException, InvalidParseOperationException Description copied from interface:ProcessDataManagementPut process workflow instance in workspace- Specified by:
persistProcessWorkflowin interfaceProcessDataManagement- Parameters:
folderName- the folder to put workflow instance on process containerprocessWorkflow- the instance to save- Throws:
ProcessingStorageWorkspaceException- when storage error occursInvalidParseOperationException- when serializing object to json fail
-
persistDistributorIndex
public void persistDistributorIndex(String fileName, DistributorIndex distributorIndex) throws ProcessingStorageWorkspaceException, InvalidParseOperationException - Specified by:
persistDistributorIndexin interfaceProcessDataManagement- Throws:
ProcessingStorageWorkspaceExceptionInvalidParseOperationException
-
getDistributorIndex
public Optional<DistributorIndex> getDistributorIndex(String fileName) throws ProcessingStorageWorkspaceException, InvalidParseOperationException - Specified by:
getDistributorIndexin interfaceProcessDataManagement- Throws:
ProcessingStorageWorkspaceExceptionInvalidParseOperationException
-
getProcessWorkflow
public ProcessWorkflow getProcessWorkflow(String folderName, String asyncId) throws ProcessingStorageWorkspaceException, InvalidParseOperationException Description copied from interface:ProcessDataManagementRetrieve a workflow instance on process container- Specified by:
getProcessWorkflowin interfaceProcessDataManagement- Parameters:
folderName- the folder on process container to get workflow instanceasyncId- the request id (asynchronous id)- Returns:
- the workflow instance
- Throws:
ProcessingStorageWorkspaceException- when storage error occursInvalidParseOperationException- when deserializing object to json fail
-
removeProcessWorkflow
public void removeProcessWorkflow(String folderName, String asyncId) throws ProcessingStorageWorkspaceException Description copied from interface:ProcessDataManagementDelete process workflow from the workspace- Specified by:
removeProcessWorkflowin interfaceProcessDataManagement- Parameters:
folderName- the folder on process container to remove workflow instanceasyncId- the request id (asynchronous id)- Throws:
ProcessingStorageWorkspaceException- when storage error occurs
-
getProcessWorkflowFor
public Map<String,ProcessWorkflow> getProcessWorkflowFor(Integer tenantId, String folderName) throws ProcessingStorageWorkspaceException Description copied from interface:ProcessDataManagementGet process workflow map for tenantId and folderName (server id from serverIdentity)- Specified by:
getProcessWorkflowForin interfaceProcessDataManagement- Parameters:
tenantId- the tenant IDfolderName- the folder name (server id from serverIdentity)- Returns:
- map of tenantID process for a server id
- Throws:
ProcessingStorageWorkspaceException- thrown if an error ocurred when loading process file
-
removeOperationContainer
public boolean removeOperationContainer(ProcessWorkflow processWorkflow, WorkspaceClientFactory workspaceClientFactory) - Specified by:
removeOperationContainerin interfaceProcessDataManagement
-