diff --git a/arc-batch/src/main/java/fr/insee/arc/batch/threadrunners/PhaseThreadFactory.java b/arc-batch/src/main/java/fr/insee/arc/batch/threadrunners/PhaseThreadFactory.java index a719aaaef..6eaf56852 100644 --- a/arc-batch/src/main/java/fr/insee/arc/batch/threadrunners/PhaseThreadFactory.java +++ b/arc-batch/src/main/java/fr/insee/arc/batch/threadrunners/PhaseThreadFactory.java @@ -28,7 +28,7 @@ public void run() { public void execute() { this.report = ApiServiceFactory.getService( // - getPhaseName().toString(), // + getPhaseName(), // mapParam.get(PhaseParameterKeys.KEY_FOR_EXECUTION_ENVIRONMENT), // mapParam.get(PhaseParameterKeys.KEY_FOR_DIRECTORY_LOCATION), // Integer.parseInt(mapParam.get(capacityParameterName())), // diff --git a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiChargementServiceFactory.java b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiChargementServiceFactory.java index 9713fbae6..75446c468 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiChargementServiceFactory.java +++ b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiChargementServiceFactory.java @@ -1,5 +1,6 @@ package fr.insee.arc.core.factory; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; import fr.insee.arc.core.service.p2chargement.ApiChargementService; @@ -14,7 +15,7 @@ public class ApiChargementServiceFactory implements IServiceFactory { * @param aDirectoryRoot * @param aNbEnr */ - public ApiService get(String phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch) { + public ApiService get(TraitementPhase phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch) { return new ApiChargementService(phaseService, executionSchema, directory, capacityParameter, paramBatch); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiControleServiceFactory.java b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiControleServiceFactory.java index d1ab6c2d6..07f34c3df 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiControleServiceFactory.java +++ b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiControleServiceFactory.java @@ -1,5 +1,6 @@ package fr.insee.arc.core.factory; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; import fr.insee.arc.core.service.p4controle.ApiControleService; @@ -14,7 +15,7 @@ public class ApiControleServiceFactory implements IServiceFactory { * @param aDirectoryRoot * @param aNbEnr */ - public ApiService get(String phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch) { + public ApiService get(TraitementPhase phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch) { return new ApiControleService(phaseService, executionSchema, directory, capacityParameter, paramBatch); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiInitialisationServiceFactory.java b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiInitialisationServiceFactory.java index 5cd03070f..05f79cb99 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiInitialisationServiceFactory.java +++ b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiInitialisationServiceFactory.java @@ -1,12 +1,13 @@ package fr.insee.arc.core.factory; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; import fr.insee.arc.core.service.p0initialisation.ApiInitialisationService; public class ApiInitialisationServiceFactory implements IServiceFactory { @Override - public ApiService get(String phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch) { + public ApiService get(TraitementPhase phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch) { return new ApiInitialisationService(phaseService, executionSchema, directory, capacityParameter, paramBatch); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiMappingServiceFactory.java b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiMappingServiceFactory.java index 512717707..104f2c990 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiMappingServiceFactory.java +++ b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiMappingServiceFactory.java @@ -1,12 +1,13 @@ package fr.insee.arc.core.factory; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; import fr.insee.arc.core.service.p5mapping.ApiMappingService; public class ApiMappingServiceFactory implements IServiceFactory { @Override - public ApiService get(String phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch) { + public ApiService get(TraitementPhase phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch) { return new ApiMappingService(phaseService, executionSchema, directory, capacityParameter, paramBatch); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiNormageServiceFactory.java b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiNormageServiceFactory.java index 3d565247c..a3107bcfc 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiNormageServiceFactory.java +++ b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiNormageServiceFactory.java @@ -1,5 +1,6 @@ package fr.insee.arc.core.factory; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; import fr.insee.arc.core.service.p3normage.ApiNormageService; @@ -14,7 +15,7 @@ public class ApiNormageServiceFactory implements IServiceFactory { * @param aDirectoryRoot * @param aNbEnr */ - public ApiService get(String phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch) { + public ApiService get(TraitementPhase phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch) { return new ApiNormageService(phaseService, executionSchema, directory, capacityParameter, paramBatch); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiReceptionServiceFactory.java b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiReceptionServiceFactory.java index d7590780c..f609b8465 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiReceptionServiceFactory.java +++ b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiReceptionServiceFactory.java @@ -1,5 +1,6 @@ package fr.insee.arc.core.factory; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; import fr.insee.arc.core.service.p1reception.ApiReceptionService; @@ -14,7 +15,7 @@ public class ApiReceptionServiceFactory implements IServiceFactory { * @param aDirectoryRoot * @param aNbEnr */ - public ApiService get(String phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch) { + public ApiService get(TraitementPhase phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch) { return new ApiReceptionService(phaseService, executionSchema, directory, capacityParameter, paramBatch); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiServiceFactory.java b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiServiceFactory.java index 79e9d58c5..463065bc8 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/factory/ApiServiceFactory.java +++ b/arc-core/src/main/java/fr/insee/arc/core/factory/ApiServiceFactory.java @@ -14,23 +14,23 @@ public class ApiServiceFactory { - private Map map; + private Map map; private static ApiServiceFactory instance = null; - private ApiServiceFactory(Map aMap) { + private ApiServiceFactory(Map aMap) { this.map = aMap; - this.map.put(TraitementPhase.INITIALISATION.toString(), + this.map.put(TraitementPhase.INITIALISATION, ApiInitialisationServiceFactory.getInstance()); - this.map.put(TraitementPhase.RECEPTION.toString(), + this.map.put(TraitementPhase.RECEPTION, ApiReceptionServiceFactory.getInstance()); - this.map.put(TraitementPhase.CHARGEMENT.toString(), + this.map.put(TraitementPhase.CHARGEMENT, ApiChargementServiceFactory.getInstance()); - this.map.put(TraitementPhase.NORMAGE.toString(), + this.map.put(TraitementPhase.NORMAGE, ApiNormageServiceFactory.getInstance()); - this.map.put(TraitementPhase.CONTROLE.toString(), + this.map.put(TraitementPhase.CONTROLE, ApiControleServiceFactory.getInstance()); - this.map.put(TraitementPhase.MAPPING.toString(), + this.map.put(TraitementPhase.MAPPING, ApiMappingServiceFactory.getInstance()); } @@ -52,7 +52,7 @@ private static final ApiServiceFactory getInstance() { * @param paramBatch * @return */ - public static final ApiService getService(String phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch) { + public static final ApiService getService(TraitementPhase phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch) { return getInstance().map.get(phaseService).get(phaseService, executionSchema, directory, capacityParameter, paramBatch); } } diff --git a/arc-core/src/main/java/fr/insee/arc/core/factory/IServiceFactory.java b/arc-core/src/main/java/fr/insee/arc/core/factory/IServiceFactory.java index df1df68e9..760fb5d91 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/factory/IServiceFactory.java +++ b/arc-core/src/main/java/fr/insee/arc/core/factory/IServiceFactory.java @@ -1,5 +1,6 @@ package fr.insee.arc.core.factory; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; public interface IServiceFactory { @@ -14,6 +15,6 @@ public interface IServiceFactory { * @param paramBatch * @return */ - public ApiService get(String phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch); + public ApiService get(TraitementPhase phaseService, String executionSchema, String directory, Integer capacityParameter, String paramBatch); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/global/ApiService.java b/arc-core/src/main/java/fr/insee/arc/core/service/global/ApiService.java index 2140379a9..62a84c4ea 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/global/ApiService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/global/ApiService.java @@ -49,8 +49,8 @@ public abstract class ApiService implements IConstanteNumerique { protected String envExecution; protected String tablePrevious; - protected String previousPhase; - protected String currentPhase; + protected TraitementPhase previousPhase; + protected TraitementPhase currentPhase; protected String tablePil; protected String tablePilTemp; @@ -72,7 +72,7 @@ public ApiService() { springInit(); } - protected ApiService(String aCurrentPhase, String aEnvExecution, String aDirectoryRoot, Integer aNbEnr, + protected ApiService(TraitementPhase aCurrentPhase, String aEnvExecution, String aDirectoryRoot, Integer aNbEnr, String paramBatch) { StaticLoggerDispatcher.info(LOGGER_APISERVICE, "** initialiserVariable **"); @@ -89,7 +89,7 @@ protected ApiService(String aCurrentPhase, String aEnvExecution, String aDirecto // current phase and compute the previous phase this.currentPhase = aCurrentPhase; - this.previousPhase = TraitementPhase.valueOf(this.getCurrentPhase()).previousPhase().toString(); + this.previousPhase = this.getCurrentPhase().previousPhase(); // number of object to be proceed this.nbEnr = aNbEnr; @@ -150,11 +150,11 @@ private void springInit() { * @param phaseAncien * @return */ - private boolean checkTodo(String tablePil, String phaseAncien) { + private boolean checkTodo(String tablePil, TraitementPhase phaseAncien) { ArcPreparedStatementBuilder requete = new ArcPreparedStatementBuilder(); boolean checkTodoResult = false; requete.append("SELECT 1 FROM " + tablePil + " a "); - requete.append("WHERE phase_traitement=" + requete.quoteText(phaseAncien) + " AND " + requete.append("WHERE phase_traitement=" + requete.quoteText(phaseAncien.toString()) + " AND " + requete.quoteText(TraitementEtat.OK.toString()) + "=ANY(etat_traitement) "); requete.append("and etape=1 "); requete.append("limit 1 "); @@ -180,7 +180,7 @@ private boolean checkTodo(String tablePil, String phaseAncien) { * @param nbEnr * @throws ArcException */ - private void register(Connection connexion, String phaseIn, String phase, String tablePil, String tablePilTemp, + private void register(Connection connexion, TraitementPhase phaseIn, TraitementPhase phase, String tablePil, String tablePilTemp, Integer nbEnr) { LoggerHelper.info(LOGGER_APISERVICE, "** register **"); try { @@ -264,11 +264,11 @@ public void finaliser() { * @param etat * @return */ - public Map> pilotageListIdsource(String tablePilotage, String aCurrentPhase, String etat) { + public Map> pilotageListIdsource(String tablePilotage, TraitementPhase aCurrentPhase, String etat) { LoggerHelper.info(LOGGER_APISERVICE, "pilotageListIdsource"); ArcPreparedStatementBuilder requete = new ArcPreparedStatementBuilder(); requete.append("SELECT container, " + ColumnEnum.ID_SOURCE.getColumnName() + " FROM " + tablePilotage + " "); - requete.append("WHERE phase_traitement=" + requete.quoteText(aCurrentPhase) + " "); + requete.append("WHERE phase_traitement=" + requete.quoteText(aCurrentPhase.toString()) + " "); requete.append("AND " + requete.quoteText(etat) + "=ANY(etat_traitement); "); try { return new GenericBean( @@ -289,7 +289,7 @@ public Map> pilotageListIdsource(String tablePilotage, Stri * @param etatNew * @return */ - public static StringBuilder pilotageMarkIdsource(String tablePilotage, String idSource, String phaseNew, + public static StringBuilder pilotageMarkIdsource(String tablePilotage, String idSource, TraitementPhase phaseNew, String etatNew, String rapport, String... jointure) { StringBuilder requete = new StringBuilder(); requete.append("UPDATE " + tablePilotage + " "); @@ -336,8 +336,8 @@ public ServiceReporting invokeApi() { LoggerHelper.info(LOGGER_APISERVICE, "****** Execution " + this.getCurrentPhase() + " *******"); try { - if (this.getCurrentPhase().equals(TraitementPhase.INITIALISATION.toString()) - || this.getCurrentPhase().equals(TraitementPhase.RECEPTION.toString())) { + if (this.getCurrentPhase().equals(TraitementPhase.INITIALISATION) + || this.getCurrentPhase().equals(TraitementPhase.RECEPTION)) { this.todo = true; } else { this.todo = checkTodo(this.getTablePil(), this.getPreviousPhase()); @@ -352,7 +352,7 @@ public ServiceReporting invokeApi() { ex.logFullException(); try { this.repriseSurErreur(this.connexion.getCoordinatorConnection(), this.getCurrentPhase(), - this.getTablePil(), ex, "aucuneTableADroper"); + this.getTablePil(), ex); } catch (ArcException ex2) { LoggerHelper.error(LOGGER_APISERVICE, "Error in ApiService.invokeApi.repriseSurErreur"); ex2.logFullException(); @@ -388,8 +388,7 @@ public void setTablePilTemp(String tablePilTemp) { * @param tableDrop * @throws ArcException */ - private void repriseSurErreur(Connection connexion, String phase, String tablePil, ArcException exception, - String... tableDrop) throws ArcException { + private void repriseSurErreur(Connection connexion, TraitementPhase phase, String tablePil, ArcException exception) throws ArcException { // nettoyage de la connexion // comme on arrive ici à cause d'une erreur, la base de donnée attend une fin de // la transaction @@ -403,11 +402,6 @@ private void repriseSurErreur(Connection connexion, String phase, String tablePi throw new ArcException(rollbackException, ArcExceptionMessage.DATABASE_ROLLBACK_FAILED); } StringBuilder requete = new StringBuilder(); - - for (int i = 0; i < tableDrop.length; i++) { - requete.append("DROP TABLE IF EXISTS " + tableDrop[i] + ";"); - } - requete.append("WITH t0 AS ( "); requete.append(PilotageOperations.queryUpdatePilotageError(phase, tablePil, exception)); requete.append("\n RETURNING " + ColumnEnum.ID_SOURCE.getColumnName() + ") "); @@ -451,11 +445,11 @@ public String getTablePil() { return tablePil; } - public String getPreviousPhase() { + public TraitementPhase getPreviousPhase() { return previousPhase; } - public String getCurrentPhase() { + public TraitementPhase getCurrentPhase() { return currentPhase; } diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/global/dao/PilotageOperations.java b/arc-core/src/main/java/fr/insee/arc/core/service/global/dao/PilotageOperations.java index d2482ebfa..f3eeffd3a 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/global/dao/PilotageOperations.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/global/dao/PilotageOperations.java @@ -67,8 +67,8 @@ public static String queryUpdateNbEnr(String tablePilTemp, String tableTravailTe * @param nbEnr * @return */ - public static String queryCopieTablePilotage(String tablePil, String tablePilTemp, String phaseAncien, - String phaseNouveau, Integer nbEnr) { + public static String queryCopieTablePilotage(String tablePil, String tablePilTemp, TraitementPhase phaseAncien, + TraitementPhase phaseNouveau, Integer nbEnr) { StringBuilder requete = new StringBuilder(); Date date = new Date(); @@ -124,7 +124,7 @@ public static String queryCopieTablePilotage(String tablePil, String tablePilTem * @param exception * @return */ - public static StringBuilder queryUpdatePilotageError(String phase, String tablePil, Exception exception) { + public static StringBuilder queryUpdatePilotageError(TraitementPhase phase, String tablePil, Exception exception) { StringBuilder requete = new StringBuilder(); requete.append("UPDATE " + tablePil + " SET etape=2, etat_traitement= '{" + TraitementEtat.KO + "}', rapport=" + FormatSQL.quoteText(exception.toString()).replace("\r", "") + " "); @@ -201,7 +201,7 @@ public static StringBuilder queryResetPreviousPhaseMark(String tablePil, String * @param tableDrop * @throws ArcException */ - public static void traitementSurErreur(Connection connexion, String phase, String tablePil, String idSource, + public static void traitementSurErreur(Connection connexion, TraitementPhase phase, String tablePil, String idSource, ArcException exception) throws ArcException { // nettoyage de la connexion // comme on arrive ici à cause d'une erreur, la base de donnée attend une fin de diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/global/dao/TableNaming.java b/arc-core/src/main/java/fr/insee/arc/core/service/global/dao/TableNaming.java index e1aeba0ba..9a3b71625 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/global/dao/TableNaming.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/global/dao/TableNaming.java @@ -4,6 +4,7 @@ import fr.insee.arc.core.dataobjects.ColumnEnum; import fr.insee.arc.core.dataobjects.ViewEnum; import fr.insee.arc.core.model.TraitementEtat; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.utils.dao.SQL; import fr.insee.arc.utils.utils.FormatSQL; @@ -24,11 +25,11 @@ private TableNaming() { * @param suffix optionnal suffix added to the temporary name * @return */ - public static String temporaryTableName(String aEnvExecution, String aCurrentPhase, ViewEnum table) { + public static String temporaryTableName(String aEnvExecution, TraitementPhase aCurrentPhase, ViewEnum table) { return ViewEnum.getFullName(aEnvExecution, FormatSQL.temporaryTableName(aCurrentPhase + "_" + table)); } - public static String phaseDataTableName(String aEnvExecution, String aPhase, TraitementEtat etat) { + public static String phaseDataTableName(String aEnvExecution, TraitementPhase aPhase, TraitementEtat etat) { return ViewEnum.getFullName(aEnvExecution, aPhase + "_" + etat.toString()); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p0initialisation/ApiInitialisationService.java b/arc-core/src/main/java/fr/insee/arc/core/service/p0initialisation/ApiInitialisationService.java index 16c378094..909189e1a 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p0initialisation/ApiInitialisationService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p0initialisation/ApiInitialisationService.java @@ -2,14 +2,13 @@ import org.springframework.stereotype.Component; -import fr.insee.arc.core.dataobjects.ArcPreparedStatementBuilder; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; import fr.insee.arc.core.service.p0initialisation.filesystem.RestoreFileSystem; import fr.insee.arc.core.service.p0initialisation.metadata.SynchronizeRulesAndMetadataOperation; import fr.insee.arc.core.service.p0initialisation.pilotage.CleanPilotageOperation; import fr.insee.arc.core.service.p0initialisation.pilotage.SynchronizeDataByPilotageOperation; import fr.insee.arc.core.service.p0initialisation.useroperation.ReplayOrDeleteFilesOperation; -import fr.insee.arc.utils.dao.UtilitaireDao; import fr.insee.arc.utils.exception.ArcException; /** @@ -32,7 +31,7 @@ public ApiInitialisationService() { super(); } - public ApiInitialisationService(String aCurrentPhase, String aEnvExecution, String aDirectoryRoot, Integer aNbEnr, + public ApiInitialisationService(TraitementPhase aCurrentPhase, String aEnvExecution, String aDirectoryRoot, Integer aNbEnr, String paramBatch) { super(aCurrentPhase, aEnvExecution, aDirectoryRoot, aNbEnr, paramBatch); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p0initialisation/ResetEnvironmentService.java b/arc-core/src/main/java/fr/insee/arc/core/service/p0initialisation/ResetEnvironmentService.java index fa039c215..c38bd61ca 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p0initialisation/ResetEnvironmentService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p0initialisation/ResetEnvironmentService.java @@ -32,7 +32,7 @@ public static void backToTargetPhase(TraitementPhase phaseAExecuter, String env, if (phaseAExecuter.getOrdre() == TraitementPhase.INITIALISATION.getOrdre()) { resetBAS(env, rootDirectory); } else { - ApiInitialisationService serv = new ApiInitialisationService(TraitementPhase.INITIALISATION.toString(), env, + ApiInitialisationService serv = new ApiInitialisationService(TraitementPhase.INITIALISATION, env, rootDirectory, TraitementPhase.INITIALISATION.getNbLigneATraiter(), null); try { new ResetEnvironmentOperation(serv.getCoordinatorSandbox()).retourPhasePrecedente(phaseAExecuter, undoFilesSelection); @@ -51,7 +51,7 @@ public static void backToTargetPhase(TraitementPhase phaseAExecuter, String env, */ public static void resetBAS(String env, String rootDirectory) { - ApiInitialisationService service = new ApiInitialisationService(TraitementPhase.INITIALISATION.toString(), env, + ApiInitialisationService service = new ApiInitialisationService(TraitementPhase.INITIALISATION, env, rootDirectory, TraitementPhase.INITIALISATION.getNbLigneATraiter(), null); try { // delete files and pilotage tables diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p1reception/ApiReceptionService.java b/arc-core/src/main/java/fr/insee/arc/core/service/p1reception/ApiReceptionService.java index 652981485..f7887b305 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p1reception/ApiReceptionService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p1reception/ApiReceptionService.java @@ -3,6 +3,7 @@ import org.springframework.stereotype.Component; import fr.insee.arc.core.dataobjects.ArcDatabase; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; import fr.insee.arc.core.service.p1reception.registerarchive.ArchiveRegistrationOperation; import fr.insee.arc.core.service.p1reception.registerarchive.bo.FilesDescriber; @@ -29,7 +30,7 @@ public ApiReceptionService() { super(); } - public ApiReceptionService(String aCurrentPhase, String aEnvExecution, + public ApiReceptionService(TraitementPhase aCurrentPhase, String aEnvExecution, String aDirectoryRoot, Integer aNbEnr, String paramBatch) { super(aCurrentPhase, aEnvExecution, aDirectoryRoot, aNbEnr, paramBatch); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/ApiChargementService.java b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/ApiChargementService.java index 5307dea0e..02945738b 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/ApiChargementService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/ApiChargementService.java @@ -10,6 +10,7 @@ import fr.insee.arc.core.dataobjects.ArcDatabase; import fr.insee.arc.core.dataobjects.ColumnEnum; import fr.insee.arc.core.model.TraitementEtat; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; import fr.insee.arc.core.service.global.thread.MultiThreading; import fr.insee.arc.core.service.p1reception.provider.DirectoriesReception; @@ -45,7 +46,7 @@ public ApiChargementService() { super(); } - public ApiChargementService(String aCurrentPhase, String aEnvExecution, String aDirectoryRoot, Integer aNbEnr, + public ApiChargementService(TraitementPhase aCurrentPhase, String aEnvExecution, String aDirectoryRoot, Integer aNbEnr, String paramBatch) { super(aCurrentPhase, aEnvExecution, aDirectoryRoot, aNbEnr, paramBatch); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/dao/ChargeurCsvDao.java b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/dao/ChargeurCsvDao.java index bb9b6b696..b42246b64 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/dao/ChargeurCsvDao.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/dao/ChargeurCsvDao.java @@ -10,13 +10,13 @@ import fr.insee.arc.core.dataobjects.DataObjectService; import fr.insee.arc.core.dataobjects.ViewEnum; import fr.insee.arc.core.model.TraitementEtat; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; import fr.insee.arc.core.service.global.bo.Sandbox; -import fr.insee.arc.core.service.p2chargement.bo.Delimiters; -import fr.insee.arc.core.service.p2chargement.bo.FileIdCard; import fr.insee.arc.core.service.p2chargement.bo.CSVFileAttributes; import fr.insee.arc.core.service.p2chargement.bo.CSVFormatRules; -import fr.insee.arc.core.service.p2chargement.bo.NormeRules; +import fr.insee.arc.core.service.p2chargement.bo.Delimiters; +import fr.insee.arc.core.service.p2chargement.bo.FileIdCard; import fr.insee.arc.core.service.p2chargement.engine.ParseFormatRulesOperation; import fr.insee.arc.utils.dao.SQL; import fr.insee.arc.utils.dao.UtilitaireDao; @@ -436,7 +436,7 @@ private List execQuerySelectColumnsFromLoadTable() throws ArcException { return UtilitaireDao.get(0).getColumns(sandbox.getConnection(), ViewEnum.TMP_CHARGEMENT_ARC.getFullName()); } - public void execQueryBilan(String tableChargementPilTemp, String currentPhase) throws ArcException { + public void execQueryBilan(String tableChargementPilTemp, TraitementPhase currentPhase) throws ArcException { StringBuilder requeteBilan = new StringBuilder(); requeteBilan.append(ApiService.pilotageMarkIdsource(tableChargementPilTemp, fileIdCard.getFileName(), diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/dao/ChargeurXMLDao.java b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/dao/ChargeurXMLDao.java index 66f3d1f09..7e336f920 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/dao/ChargeurXMLDao.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/dao/ChargeurXMLDao.java @@ -4,6 +4,7 @@ import org.apache.logging.log4j.Logger; import fr.insee.arc.core.model.TraitementEtat; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; import fr.insee.arc.core.service.global.bo.Sandbox; import fr.insee.arc.core.service.p2chargement.bo.FileIdCard; @@ -84,7 +85,7 @@ public void execQueryCreateTemporaryLoadDataTable(String tableTempA) throws ArcE * @param jointure * @throws ArcException */ - public void execQueryBilan(String tableChargementPilTemp, String currentPhase, String rapport, String jointure) + public void execQueryBilan(String tableChargementPilTemp, TraitementPhase currentPhase, String rapport, String jointure) throws ArcException { StringBuilder requeteBilan = new StringBuilder(); requeteBilan.append(ApiService.pilotageMarkIdsource(tableChargementPilTemp, fileIdCard.getFileName(), diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurCSV.java b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurCSV.java index ef69b1d51..bcc38dff7 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurCSV.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurCSV.java @@ -11,11 +11,12 @@ import com.opencsv.CSVReader; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.bo.Sandbox; -import fr.insee.arc.core.service.p2chargement.bo.Delimiters; -import fr.insee.arc.core.service.p2chargement.bo.FileIdCard; import fr.insee.arc.core.service.p2chargement.bo.CSVFileAttributes; import fr.insee.arc.core.service.p2chargement.bo.CSVFormatRules; +import fr.insee.arc.core.service.p2chargement.bo.Delimiters; +import fr.insee.arc.core.service.p2chargement.bo.FileIdCard; import fr.insee.arc.core.service.p2chargement.dao.ChargeurCsvDao; import fr.insee.arc.core.service.p2chargement.thread.ThreadChargementService; import fr.insee.arc.core.util.StaticLoggerDispatcher; @@ -37,7 +38,7 @@ public class ChargeurCSV implements IChargeur { private static final Logger LOGGER = LogManager.getLogger(ChargeurCSV.class); private String tableChargementPilTemp; - private String currentPhase; + private TraitementPhase currentPhase; private InputStream streamHeader; private InputStream streamContent; diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurXml.java b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurXml.java index 1c01a5d91..c60f6b7fe 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurXml.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurXml.java @@ -10,6 +10,7 @@ import org.apache.logging.log4j.Logger; import org.xml.sax.SAXException; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.bo.Sandbox; import fr.insee.arc.core.service.p2chargement.bo.FileIdCard; import fr.insee.arc.core.service.p2chargement.dao.ChargeurXMLDao; @@ -35,7 +36,7 @@ public class ChargeurXml implements IChargeur { private Sandbox sandbox; private FileIdCard fileIdCard; private String tableChargementPilTemp; - private String currentPhase; + private TraitementPhase currentPhase; private InputStream f; // temporary table where data will be loaded by the XML SAX engine diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurXmlComplexe.java b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurXmlComplexe.java index da6976b41..e1f196110 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurXmlComplexe.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurXmlComplexe.java @@ -13,6 +13,7 @@ import org.apache.logging.log4j.Logger; import org.xml.sax.SAXException; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.bo.Sandbox; import fr.insee.arc.core.service.p2chargement.bo.Delimiters; import fr.insee.arc.core.service.p2chargement.bo.FileIdCard; @@ -38,7 +39,7 @@ public class ChargeurXmlComplexe implements IChargeur { private Sandbox sandbox; private String tableChargementPilTemp; - private String currentPhase; + private TraitementPhase currentPhase; private FileIdCard fileIdCard; private InputStream f; diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p3normage/ApiNormageService.java b/arc-core/src/main/java/fr/insee/arc/core/service/p3normage/ApiNormageService.java index 1d49f5a88..e82c68874 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p3normage/ApiNormageService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p3normage/ApiNormageService.java @@ -4,6 +4,7 @@ import fr.insee.arc.core.dataobjects.ArcDatabase; import fr.insee.arc.core.dataobjects.ColumnEnum; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; import fr.insee.arc.core.service.global.thread.MultiThreading; import fr.insee.arc.core.service.p3normage.thread.ThreadNormageService; @@ -40,7 +41,7 @@ public ApiNormageService() { super(); } - public ApiNormageService(String aCurrentPhase, String aEnvExecution, String aDirectoryRoot, Integer aNbEnr, + public ApiNormageService(TraitementPhase aCurrentPhase, String aEnvExecution, String aDirectoryRoot, Integer aNbEnr, String paramBatch) { super(aCurrentPhase, aEnvExecution, aDirectoryRoot, aNbEnr, paramBatch); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p4controle/ApiControleService.java b/arc-core/src/main/java/fr/insee/arc/core/service/p4controle/ApiControleService.java index eefa0df64..2e03f5580 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p4controle/ApiControleService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p4controle/ApiControleService.java @@ -4,6 +4,7 @@ import fr.insee.arc.core.dataobjects.ArcDatabase; import fr.insee.arc.core.dataobjects.ColumnEnum; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; import fr.insee.arc.core.service.global.thread.MultiThreading; import fr.insee.arc.core.service.p4controle.thread.ThreadControleService; @@ -37,7 +38,7 @@ public ApiControleService() { super(); } - public ApiControleService(String aCurrentPhase, String aEnvExecution, String aDirectoryRoot, Integer aNbEnr, + public ApiControleService(TraitementPhase aCurrentPhase, String aEnvExecution, String aDirectoryRoot, Integer aNbEnr, String paramBatch) { super(aCurrentPhase, aEnvExecution, aDirectoryRoot, aNbEnr, paramBatch); } diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p5mapping/ApiMappingService.java b/arc-core/src/main/java/fr/insee/arc/core/service/p5mapping/ApiMappingService.java index 04463b72c..f31dde71c 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p5mapping/ApiMappingService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p5mapping/ApiMappingService.java @@ -4,6 +4,7 @@ import fr.insee.arc.core.dataobjects.ArcDatabase; import fr.insee.arc.core.dataobjects.ColumnEnum; +import fr.insee.arc.core.model.TraitementPhase; import fr.insee.arc.core.service.global.ApiService; import fr.insee.arc.core.service.global.thread.MultiThreading; import fr.insee.arc.core.service.p4controle.ApiControleService; @@ -53,7 +54,7 @@ public ApiMappingService() { * @param aCurrentPhase * @param aNbEnr */ - public ApiMappingService(String aCurrentPhase, String anEnvironnementExecution, String aDirectoryRoot, + public ApiMappingService(TraitementPhase aCurrentPhase, String anEnvironnementExecution, String aDirectoryRoot, Integer aNbEnr, String paramBatch) { super(aCurrentPhase, anEnvironnementExecution, null, aNbEnr, paramBatch); } diff --git a/arc-core/src/test/java/fr/insee/arc/core/businesstest/TestsFonctionnels.java b/arc-core/src/test/java/fr/insee/arc/core/businesstest/TestsFonctionnels.java index 1271c2607..9bce886b9 100644 --- a/arc-core/src/test/java/fr/insee/arc/core/businesstest/TestsFonctionnels.java +++ b/arc-core/src/test/java/fr/insee/arc/core/businesstest/TestsFonctionnels.java @@ -66,7 +66,7 @@ private void executeTestSirene(String sandbox, String repertoire) throws IOExcep BddPatcherTest.insertTestDataSirene(); - ApiServiceFactory.getService(TraitementPhase.INITIALISATION.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.INITIALISATION, sandbox, repertoire, 10000000, null ).invokeApi(); @@ -75,24 +75,24 @@ private void executeTestSirene(String sandbox, String repertoire) throws IOExcep Files.copy(this.getClass().getClassLoader().getResourceAsStream("testFiles/Cas_test_V2008.11.zip"), new File(repertoireDeDepot, "Cas_test_V2008.11.zip").toPath()); Files.copy(this.getClass().getClassLoader().getResourceAsStream("testFiles/Cas_test_V2016.02.zip"), new File(repertoireDeDepot, "Cas_test_V2016.02.zip").toPath()); - ApiServiceFactory.getService(TraitementPhase.RECEPTION.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.RECEPTION, sandbox, repertoire, 10000000, null ).invokeApi(); assertEquals(114, nbFileInPhase(sandbox, TraitementPhase.RECEPTION, TraitementEtat.OK)); - ApiServiceFactory.getService(TraitementPhase.CHARGEMENT.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.CHARGEMENT, sandbox, repertoire, 10000000, null ).invokeApi(); assertEquals(114, nbFileInPhase(sandbox, TraitementPhase.CHARGEMENT, TraitementEtat.OK)); - ApiServiceFactory.getService(TraitementPhase.NORMAGE.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.NORMAGE, sandbox, repertoire, 10000000, null ).invokeApi(); assertEquals(114, nbFileInPhase(sandbox, TraitementPhase.NORMAGE, TraitementEtat.OK)); - ApiServiceFactory.getService(TraitementPhase.CONTROLE.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.CONTROLE, sandbox, repertoire, 10000000, null ).invokeApi(); assertEquals(47, nbFileInPhase(sandbox, TraitementPhase.CONTROLE, TraitementEtat.OK)); @@ -116,7 +116,7 @@ private void executeTestSiera(String sandbox, String repertoire) throws IOExcept { BddPatcherTest.insertTestDataSiera(); - ApiServiceFactory.getService(TraitementPhase.INITIALISATION.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.INITIALISATION, sandbox, repertoire, 10000000, null ).invokeApi(); @@ -124,28 +124,28 @@ private void executeTestSiera(String sandbox, String repertoire) throws IOExcept Files.copy(this.getClass().getClassLoader().getResourceAsStream("testFiles/siera_ano.xml"), new File(repertoireDeDepot, "siera_ano.xml").toPath()); - ApiServiceFactory.getService(TraitementPhase.RECEPTION.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.RECEPTION, sandbox, repertoire, 10000000, null ).invokeApi(); assertEquals(1, nbFileInPhase(sandbox, TraitementPhase.RECEPTION, TraitementEtat.OK)); - ApiServiceFactory.getService(TraitementPhase.CHARGEMENT.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.CHARGEMENT, sandbox, repertoire, 10000000, null ).invokeApi(); assertEquals(1, nbFileInPhase(sandbox, TraitementPhase.CHARGEMENT, TraitementEtat.OK)); - ApiServiceFactory.getService(TraitementPhase.NORMAGE.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.NORMAGE, sandbox, repertoire, 10000000, null ).invokeApi(); assertEquals(1, nbFileInPhase(sandbox, TraitementPhase.NORMAGE, TraitementEtat.OK)); - ApiServiceFactory.getService(TraitementPhase.CONTROLE.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.CONTROLE, sandbox, repertoire, 10000000, null ).invokeApi(); assertEquals(1, nbFileInPhase(sandbox, TraitementPhase.CONTROLE, TraitementEtat.OK)); - ApiServiceFactory.getService(TraitementPhase.MAPPING.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.MAPPING, sandbox, repertoire, 10000000, null ).invokeApi(); assertEquals(1, nbFileInPhase(sandbox, TraitementPhase.MAPPING, TraitementEtat.OK)); @@ -168,7 +168,7 @@ private void executeTestAnimal(String sandbox, String repertoire) throws IOExcep { BddPatcherTest.insertTestDataAnimal(); - ApiServiceFactory.getService(TraitementPhase.INITIALISATION.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.INITIALISATION, sandbox, repertoire, 10000000, null ).invokeApi(); @@ -176,13 +176,13 @@ private void executeTestAnimal(String sandbox, String repertoire) throws IOExcep Files.copy(this.getClass().getClassLoader().getResourceAsStream("testFiles/animals.tar.gz"), new File(repertoireDeDepot, "animals.tar.gz").toPath()); - ApiServiceFactory.getService(TraitementPhase.RECEPTION.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.RECEPTION, sandbox, repertoire, 10000000, null ).invokeApi(); assertEquals(2, nbFileInPhase(sandbox, TraitementPhase.RECEPTION, TraitementEtat.OK)); - ApiServiceFactory.getService(TraitementPhase.CHARGEMENT.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.CHARGEMENT, sandbox, repertoire, 10000000, null ).invokeApi(); assertEquals(2, nbFileInPhase(sandbox, TraitementPhase.CHARGEMENT, TraitementEtat.OK)); @@ -191,7 +191,7 @@ private void executeTestAnimal(String sandbox, String repertoire) throws IOExcep // doublon detection test Files.copy(this.getClass().getClassLoader().getResourceAsStream("testFiles/animals-001.csv"), new File(repertoireDeDepot, "animals-001.csv").toPath()); - ApiServiceFactory.getService(TraitementPhase.RECEPTION.toString(), sandbox, repertoire, + ApiServiceFactory.getService(TraitementPhase.RECEPTION, sandbox, repertoire, 10000000, null ).invokeApi(); diff --git a/arc-core/src/test/java/fr/insee/arc/core/factory/ApiServiceFactoryTest.java b/arc-core/src/test/java/fr/insee/arc/core/factory/ApiServiceFactoryTest.java index d6e1cf0ad..40403e576 100644 --- a/arc-core/src/test/java/fr/insee/arc/core/factory/ApiServiceFactoryTest.java +++ b/arc-core/src/test/java/fr/insee/arc/core/factory/ApiServiceFactoryTest.java @@ -20,11 +20,11 @@ public void testMegaFactoryInstance() { for (TraitementPhase arcPhase:TraitementPhase.getListPhaseC()) { - p=ApiServiceFactory.getService(arcPhase.toString(), "arc_bas2", "./", capacity, null); + p=ApiServiceFactory.getService(arcPhase, "arc_bas2", "./", capacity, null); assertEquals(null, p.getParamBatch()); assertEquals(capacity, p.getNbEnr().intValue()); - assertEquals(p.getCurrentPhase(), arcPhase.toString()); + assertEquals(p.getCurrentPhase().toString(), arcPhase.toString()); } } diff --git a/arc-web/src/main/java/fr/insee/arc/web/gui/pilotage/service/ServiceViewFichierBAS.java b/arc-web/src/main/java/fr/insee/arc/web/gui/pilotage/service/ServiceViewFichierBAS.java index 0bdb6acb2..afdb9005f 100644 --- a/arc-web/src/main/java/fr/insee/arc/web/gui/pilotage/service/ServiceViewFichierBAS.java +++ b/arc-web/src/main/java/fr/insee/arc/web/gui/pilotage/service/ServiceViewFichierBAS.java @@ -79,11 +79,11 @@ private String restore(Model model, String code, String messageOk) { // Lancement de l'initialisation dans la foulée loggerDispatcher.info("Synchronisation de l'environnement ", LOGGER); ApiServiceFactory - .getService(TraitementPhase.INITIALISATION.toString(), getBacASable(), + .getService(TraitementPhase.INITIALISATION, getBacASable(), this.repertoire, TraitementPhase.INITIALISATION.getNbLigneATraiter(), null) .invokeApi(); ApiServiceFactory - .getService(TraitementPhase.RECEPTION.toString(), getBacASable(), + .getService(TraitementPhase.RECEPTION, getBacASable(), this.repertoire, TraitementPhase.RECEPTION.getNbLigneATraiter(), null) .invokeApi(); } @@ -172,7 +172,7 @@ public String toDeleteBAS(Model model) { if (!isEnvProd()) { loggerDispatcher.info("Synchronisation de l'environnement ", LOGGER); ApiServiceFactory - .getService(TraitementPhase.INITIALISATION.toString(), getBacASable(), + .getService(TraitementPhase.INITIALISATION, getBacASable(), this.repertoire, TraitementPhase.INITIALISATION.getNbLigneATraiter(), null) .invokeApi(); } diff --git a/arc-web/src/main/java/fr/insee/arc/web/gui/pilotage/service/ServiceViewPilotageBAS.java b/arc-web/src/main/java/fr/insee/arc/web/gui/pilotage/service/ServiceViewPilotageBAS.java index 242fb66ca..b544dad33 100644 --- a/arc-web/src/main/java/fr/insee/arc/web/gui/pilotage/service/ServiceViewPilotageBAS.java +++ b/arc-web/src/main/java/fr/insee/arc/web/gui/pilotage/service/ServiceViewPilotageBAS.java @@ -81,11 +81,11 @@ public String filesUploadBAS(Model model) { if (!isEnvProd()) { // Lancement de l'initialisation dans la foulée ApiServiceFactory - .getService(TraitementPhase.INITIALISATION.toString(), getBacASable(), + .getService(TraitementPhase.INITIALISATION, getBacASable(), this.repertoire, TraitementPhase.INITIALISATION.getNbLigneATraiter(), null) .invokeApi(); ApiServiceFactory - .getService(TraitementPhase.RECEPTION.toString(), getBacASable(), + .getService(TraitementPhase.RECEPTION, getBacASable(), this.repertoire, TraitementPhase.RECEPTION.getNbLigneATraiter(), null) .invokeApi(); } @@ -182,7 +182,7 @@ public String executerBatch(Model model, TraitementPhase phaseAExecuter) { // Maximum number of files processed in each phase iteration int maxFilesPerPhase = new BDParameters(ArcDatabase.COORDINATOR).getInt(null, "LanceurIHM.maxFilesPerPhase", 10000000); - ApiServiceFactory.getService(phaseAExecuter.toString(), getBacASable(), this.repertoire, + ApiServiceFactory.getService(phaseAExecuter, getBacASable(), this.repertoire, maxFilesPerPhase, null ).invokeApi(); return generateDisplay(model, RESULT_SUCCESS); diff --git a/arc-ws/src/main/java/fr/insee/arc/ws/services/restServices/execute/ExecuteServiceController.java b/arc-ws/src/main/java/fr/insee/arc/ws/services/restServices/execute/ExecuteServiceController.java index e41ac17a7..69ccfa07f 100644 --- a/arc-ws/src/main/java/fr/insee/arc/ws/services/restServices/execute/ExecuteServiceController.java +++ b/arc-ws/src/main/java/fr/insee/arc/ws/services/restServices/execute/ExecuteServiceController.java @@ -78,7 +78,7 @@ public ResponseEntity executeServiceClient( } - ApiServiceFactory.getService(TraitementPhase.getPhase(bodyPojo.targetPhase).toString(), env, + ApiServiceFactory.getService(TraitementPhase.getPhase(bodyPojo.targetPhase), env, repertoire, Integer.MAX_VALUE, null).invokeApi(); @@ -155,7 +155,7 @@ public ResponseEntity executeServiceClient( } - ApiServiceFactory.getService(TraitementPhase.getPhase(bodyPojo.targetPhase).toString(), env, + ApiServiceFactory.getService(TraitementPhase.getPhase(bodyPojo.targetPhase), env, repertoire, Integer.MAX_VALUE, null).invokeApi();