Class VitamPoolingClient

java.lang.Object
fr.gouv.vitam.access.external.client.VitamPoolingClient

public class VitamPoolingClient extends Object
This class expose wait methods that implements pooling logic
  • Constructor Details

    • VitamPoolingClient

      public VitamPoolingClient(OperationStatusClient operationStatusClient)
      Parameters:
      operationStatusClient - interface that expose getOperationProcessStatus
  • Method Details

    • wait

      public boolean wait(int tenantId, String processId, ProcessState state, int nbTry, long timeWait, TimeUnit timeUnit) throws VitamException
      This is a helper method for checking the status of an operation Loop until : - nbTry is reached - state is completed - state is pause and status ordinal is higher than started
      Parameters:
      tenantId -
      processId - operationId du processWorkflow
      state - The state wanted
      nbTry - Number of retry
      timeWait - time to sleep
      timeUnit - timeUnit to apply to timeWait
      Returns:
      true if completed false else
      Throws:
      VitamException
    • wait

      public boolean wait(int tenantId, String processId, int nbTry, long timeout, TimeUnit timeUnit) throws VitamException
      Parameters:
      tenantId -
      processId -
      nbTry -
      timeout -
      timeUnit -
      Returns:
      Throws:
      VitamException
    • wait

      public boolean wait(int tenantId, String processId, ProcessState state) throws VitamException
      Parameters:
      tenantId -
      processId -
      state -
      Returns:
      Throws:
      VitamException
    • wait

      public boolean wait(int tenantId, String processId) throws VitamException
      Parameters:
      tenantId -
      processId -
      Returns:
      Throws:
      VitamException