Class ProcessDistributorImpl

  • All Implemented Interfaces:
    ProcessDistributor, java.lang.AutoCloseable

    public class ProcessDistributorImpl
    extends java.lang.Object
    implements ProcessDistributor
    The Process Distributor call the workers and intercept the response for manage a post actions step

     TODO P1:
     - handle listing of items through a limited arraylist (memory) and through iterative (async) listing from
     Workspace
     - handle result in FATAL mode from one distributed item to stop the distribution in FATAL mode (do not
     continue)
     - try to handle distribution on 1 or on many as the same loop (so using a default arrayList of 1)
     - handle error level using order in enum in ProcessResponse.getGlobalProcessStatusCode instead of manually comparing:
      
        for (final EngineResponse response : responses) {
           tempStatusCode = response.getStatus();
           if (statusCode.ordinal() > tempStatusCode.ordinal()) {
               statusCode = tempStatusCode;
           }
          if (statusCode.ordinal() > StatusCode.KO.ordinal()) {
               break;
           }
         }