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

# Interface ProcessDataManagement

All Known Implementing Classes:
  `WorkspaceProcessDataManagement`

public interface ProcessDataManagement
Interface for process datas management service (persist and restore workflow)

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `DISTRIBUTOR_INDEX`
  `static final String`
  `PROCESS_CONTAINER`
  Container name

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `createFolder(String folderName)`
  Create a folder with the name {folderName} if does not exist on the process container
  `boolean`
  `createProcessContainer()`
  Create the process container (initialisation) if does not exist
  `Optional<DistributorIndex>`
  `getDistributorIndex(String fileName)`
  `ProcessWorkflow`
  `getProcessWorkflow(String folderName, String asyncId)`
  Retrieve a workflow instance on process container
  `Map<String,ProcessWorkflow>`
  `getProcessWorkflowFor(Integer tenantId, String folderName)`
  Get process workflow map for tenantId and folderName (server id from serverIdentity)
  `boolean`
  `isFolderExist(String folderName)`
  Check if the folder with name {folderName} exists on process container
  `boolean`
  `isProcessContainerExist()`
  Check if the process container exists
  `void`
  `persistDistributorIndex(String fileName, DistributorIndex distributorIndex)`
  `void`
  `persistProcessWorkflow(String folderName, ProcessWorkflow processWorkflow)`
  Put process workflow instance in workspace
  `boolean`
  `removeFolder(String folderName)`
  Delete folder with name {folderName} if exists on process container
  `boolean`
  `removeOperationContainer(ProcessWorkflow processWorkflow, WorkspaceClientFactory workspaceClientFactory)`
  `void`
  `removeProcessWorkflow(String folderName, String asyncId)`
  Delete process workflow from the workspace

- ## Field Details

  - ### PROCESS_CONTAINER

    static final String PROCESS_CONTAINER
    Container name
    See Also:
      - Constant Field Values

  - ### DISTRIBUTOR_INDEX

    static final String DISTRIBUTOR_INDEX
    See Also:
      - Constant Field Values

- ## Method Details

  - ### createProcessContainer

    boolean createProcessContainer() throws ProcessingStorageWorkspaceException
    Create the process container (initialisation) if does not exist
    Returns:
      true if the container was created, false if it already exists
    Throws:
      `ProcessingStorageWorkspaceException` - when storage error occurs

  - ### isProcessContainerExist

    boolean isProcessContainerExist() throws ProcessingStorageWorkspaceException
    Check if the process container exists
    Returns:
      true if the container exists, false otherwise
    Throws:
      `ProcessingStorageWorkspaceException` - when storage error occurs

  - ### createFolder

    boolean createFolder(String folderName) throws ProcessingStorageWorkspaceException
    Create a folder with the name {folderName} if does not exist on the process container
    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

    boolean isFolderExist(String folderName) throws ProcessingStorageWorkspaceException
    Check if the folder with name {folderName} exists on process container
    Parameters:
      `folderName` - the folder name to check
    Returns:
      true if folder exists on process container, false otherwise
    Throws:
      `ProcessingStorageWorkspaceException` - when storage error occurs

  - ### removeFolder

    boolean removeFolder(String folderName) throws ProcessingStorageWorkspaceException
    Delete folder with name {folderName} if exists on process container
    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

    void persistProcessWorkflow(String folderName, ProcessWorkflow processWorkflow) throws ProcessingStorageWorkspaceException, InvalidParseOperationException
    Put process workflow instance in workspace
    Parameters:
      `folderName` - the folder to put workflow instance on process container
      `processWorkflow` - the instance to save
    Throws:
      `ProcessingStorageWorkspaceException` - when storage error occurs
      `InvalidParseOperationException` - when serializing object to json fail

  - ### persistDistributorIndex

    void persistDistributorIndex(String fileName, DistributorIndex distributorIndex) throws ProcessingStorageWorkspaceException, InvalidParseOperationException
    Throws:
      `ProcessingStorageWorkspaceException`
      `InvalidParseOperationException`

  - ### getDistributorIndex

    Optional<DistributorIndex> getDistributorIndex(String fileName) throws ProcessingStorageWorkspaceException, InvalidParseOperationException
    Throws:
      `ProcessingStorageWorkspaceException`
      `InvalidParseOperationException`

  - ### getProcessWorkflow

    ProcessWorkflow getProcessWorkflow(String folderName, String asyncId) throws ProcessingStorageWorkspaceException, InvalidParseOperationException
    Retrieve a workflow instance on process container
    Parameters:
      `folderName` - the folder on process container to get workflow instance
      `asyncId` - the request id (asynchronous id)
    Returns:
      the workflow instance
    Throws:
      `ProcessingStorageWorkspaceException` - when storage error occurs
      `InvalidParseOperationException` - when deserializing object to json fail

  - ### removeProcessWorkflow

    void removeProcessWorkflow(String folderName, String asyncId) throws ProcessingStorageWorkspaceException
    Delete process workflow from the workspace
    Parameters:
      `folderName` - the folder on process container to remove workflow instance
      `asyncId` - the request id (asynchronous id)
    Throws:
      `ProcessingStorageWorkspaceException` - when storage error occurs

  - ### getProcessWorkflowFor

    Map<String,ProcessWorkflow> getProcessWorkflowFor(Integer tenantId, String folderName) throws ProcessingStorageWorkspaceException
    Get process workflow map for tenantId and folderName (server id from serverIdentity)
    Parameters:
      `tenantId` - the tenant ID
      `folderName` - 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

    boolean removeOperationContainer(ProcessWorkflow processWorkflow, WorkspaceClientFactory workspaceClientFactory)