diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/bo/FileIdCard.java b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/bo/FileIdCard.java index 0e55afc9a..aff9e8607 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/bo/FileIdCard.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/bo/FileIdCard.java @@ -13,20 +13,19 @@ public class FileIdCard { private String periodicite; private final String integrationDate = DateConversion.queryDateConversion(new Date()); - private FileIdCardChargement regleChargement; - public FileIdCardChargement getRegleChargement() { - return regleChargement; + private IdCardChargement idCardChargement; + public IdCardChargement getIdCardChargement() { + return idCardChargement; } - public void setRegleChargement(FileIdCardChargement regleChargement) { - this.regleChargement = regleChargement; + public void setIdCardChargement(IdCardChargement regleChargement) { + this.idCardChargement = regleChargement; } - public FileIdCard(String idSource) { this.fileName = idSource; } - public void setFileAttributes(String idNorme, String validite, String periodicite) { + public void setFileIdCard(String idNorme, String validite, String periodicite) { this.idNorme = idNorme; this.validite = validite; this.periodicite = periodicite; diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/bo/FileIdCardChargement.java b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/bo/IdCardChargement.java similarity index 83% rename from arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/bo/FileIdCardChargement.java rename to arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/bo/IdCardChargement.java index e5fc49910..3d6b0d817 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/bo/FileIdCardChargement.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/bo/IdCardChargement.java @@ -7,14 +7,14 @@ * @author S4LWO8 * */ -public class FileIdCardChargement { +public class IdCardChargement { private TypeChargement typeChargement; private String format; private String delimiter; - public FileIdCardChargement(TypeChargement typeChargement, String delimiter, String format) { + public IdCardChargement(TypeChargement typeChargement, String delimiter, String format) { super(); this.typeChargement = typeChargement; this.format = format; 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 a294d4948..4eca2d6b6 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 @@ -83,7 +83,7 @@ public void execQueryCopyCsv(InputStream streamContent) throws ArcException { boolean ignoreFirstLine = (parser.getValue(FormatRulesCsv.HEADERS) == null); - String separateur = fileIdCard.getRegleChargement().getDelimiter(); + String separateur = fileIdCard.getIdCardChargement().getDelimiter(); String quote = parser.getValue(FormatRulesCsv.QUOTE); diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargementBrut.java b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargementBrut.java index bee3fb717..9238e22a8 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargementBrut.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargementBrut.java @@ -165,7 +165,7 @@ private void calculerNormeAndValidite(FileIdCard normeOk, String requeteFichier) NormeRules normFound = listeNorme.get(Integer.parseInt(result.get(0).get(0))); - normeOk.setFileAttributes(normFound.getIdNorme(), result.get(0).get(2), normFound.getPeriodicite()); + normeOk.setFileIdCard(normFound.getIdNorme(), result.get(0).get(2), normFound.getPeriodicite()); } 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 f80744f85..1659f2c35 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 @@ -86,14 +86,14 @@ private void copyCsvFileToDatabase() throws ArcException { StaticLoggerDispatcher.info(LOGGER, "** CSVtoBase begin **"); StaticLoggerDispatcher.debug(LOGGER, - String.format("contenu delimiter %s", fileIdCard.getRegleChargement().getDelimiter())); + String.format("contenu delimiter %s", fileIdCard.getIdCardChargement().getDelimiter())); StaticLoggerDispatcher.debug(LOGGER, - String.format("contenu format %s", fileIdCard.getRegleChargement().getFormat())); + String.format("contenu format %s", fileIdCard.getIdCardChargement().getFormat())); // update delimiter - fileIdCard.getRegleChargement() + fileIdCard.getIdCardChargement() .setDelimiter(ObjectUtils.firstNonNull( - dao.execQueryEvaluateCharExpression(fileIdCard.getRegleChargement().getDelimiter().trim()), + dao.execQueryEvaluateCharExpression(fileIdCard.getIdCardChargement().getDelimiter().trim()), Delimiters.DEFAULT_CSV_DELIMITER)); // update quote @@ -122,7 +122,7 @@ private void copyCsvFileToDatabase() throws ArcException { */ private void computeHeaders() throws ArcException { String userDefinedHeaders = parser.getValue(FormatRulesCsv.HEADERS); - String csvDelimiter = fileIdCard.getRegleChargement().getDelimiter(); + String csvDelimiter = fileIdCard.getIdCardChargement().getDelimiter(); // si le headers n'est pas spécifié, alors on le cherche dans le fichier en // premier ligne diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurClefValeur.java b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurClefValeur.java index 903634a2f..34822b2b7 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurClefValeur.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ChargeurClefValeur.java @@ -176,8 +176,8 @@ private List initialisationOutputStream(Map arbreFormat, ecrireXML("\n"); - String rubrique = ManipString.substringBeforeFirst(ligne, fileIdCard.getRegleChargement().getDelimiter()); - String donnee = ManipString.substringAfterFirst(ligne, fileIdCard.getRegleChargement().getDelimiter()); + String rubrique = ManipString.substringBeforeFirst(ligne, fileIdCard.getIdCardChargement().getDelimiter()); + String donnee = ManipString.substringAfterFirst(ligne, fileIdCard.getIdCardChargement().getDelimiter()); // On retire les quotes de début et fin de manière violente donnee = donnee.substring(1, donnee.length() - 1); @@ -234,8 +234,8 @@ private List lectureLigne(Map arbreFormat, String pere; String rubriqueCourante; - rubrique = ManipString.substringBeforeFirst(ligne, fileIdCard.getRegleChargement().getDelimiter()); - donnee = ManipString.substringAfterFirst(ligne, fileIdCard.getRegleChargement().getDelimiter()); + rubrique = ManipString.substringBeforeFirst(ligne, fileIdCard.getIdCardChargement().getDelimiter()); + donnee = ManipString.substringAfterFirst(ligne, fileIdCard.getIdCardChargement().getDelimiter()); // On retire les quotes de début et fin de manière violente donnee = donnee.substring(1, donnee.length() - 1); 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 6099572bf..4c171f9ba 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 @@ -90,8 +90,8 @@ public void initialisation() throws ArcException { java.util.Date beginDate = new java.util.Date(); this.format = new ArrayList<>(); - if (this.fileIdCard.getRegleChargement().getFormat() != null) { - for (String rule : this.fileIdCard.getRegleChargement().getFormat().split("\n")) { + if (this.fileIdCard.getIdCardChargement().getFormat() != null) { + for (String rule : this.fileIdCard.getIdCardChargement().getFormat().split("\n")) { this.format.add(new Pair<>(rule.split(",")[0].trim(), rule.split(",")[1].trim())); } } diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ParseFormatRulesOperation.java b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ParseFormatRulesOperation.java index 152c31bcc..9f627959e 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ParseFormatRulesOperation.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/engine/ParseFormatRulesOperation.java @@ -38,7 +38,7 @@ public void setValue(T t, String value) { public void parseFormatRules() { - String formatRules = this.fileIdCard.getRegleChargement().getFormat(); + String formatRules = this.fileIdCard.getIdCardChargement().getFormat(); if (formatRules == null || formatRules.isBlank()) { return; } diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/thread/ThreadChargementService.java b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/thread/ThreadChargementService.java index 63b0b92b8..e061fa870 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/thread/ThreadChargementService.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/thread/ThreadChargementService.java @@ -28,7 +28,7 @@ import fr.insee.arc.core.service.p2chargement.archiveloader.IArchiveFileLoader; import fr.insee.arc.core.service.p2chargement.bo.FileIdCard; import fr.insee.arc.core.service.p2chargement.bo.NormeRules; -import fr.insee.arc.core.service.p2chargement.bo.FileIdCardChargement; +import fr.insee.arc.core.service.p2chargement.bo.IdCardChargement; import fr.insee.arc.core.service.p2chargement.engine.ChargementBrut; import fr.insee.arc.core.service.p2chargement.engine.IChargeur; import fr.insee.arc.core.service.p2chargement.factory.ChargeurFactory; @@ -274,7 +274,7 @@ private IChargeur chooseLoader() throws ArcException { ChargeurFactory chargeurFactory = new ChargeurFactory(this); - return chargeurFactory.getChargeur(this.fileIdCard.getRegleChargement().getTypeChargement()); + return chargeurFactory.getChargeur(this.fileIdCard.getIdCardChargement().getTypeChargement()); } /** @@ -301,7 +301,7 @@ private void calculerTypeFichier() throws ArcException { throw new ArcException(ArcExceptionMessage.LOAD_RULES_NOT_FOUND, fileIdCard.getIdNorme()); } - fileIdCard.setRegleChargement(new FileIdCardChargement( + fileIdCard.setIdCardChargement(new IdCardChargement( TypeChargement.getEnum(regle.get(ColumnEnum.TYPE_FICHIER.getColumnName()).get(0)), regle.get(ColumnEnum.DELIMITER.getColumnName()).get(0) , regle.get(ColumnEnum.FORMAT.getColumnName()).get(0))); diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/xmlhandler/ArbreFormat.java b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/xmlhandler/ArbreFormat.java index e6fca186f..075ceaa26 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/xmlhandler/ArbreFormat.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/p2chargement/xmlhandler/ArbreFormat.java @@ -51,7 +51,7 @@ public ArbreFormat(FileIdCard fileIdCard) throws ArcException { SAXParser saxParser = SecuredSaxParser.buildSecuredSaxParser(); FormatFichierHandler formatHandler = new FormatFichierHandler(); - saxParser.parse(new InputSource(new StringReader(fileIdCard.getRegleChargement().getFormat())), formatHandler); + saxParser.parse(new InputSource(new StringReader(fileIdCard.getIdCardChargement().getFormat())), formatHandler); this.arbreHierachieDuFichier = formatHandler.getArbre(); calculerFeuilles(); diff --git a/arc-ws/src/main/java/fr/insee/arc/ws/services/restServices/execute/ExecuteEngineController.java b/arc-ws/src/main/java/fr/insee/arc/ws/services/restServices/execute/ExecuteEngineController.java index 74a167f28..11dc8a487 100644 --- a/arc-ws/src/main/java/fr/insee/arc/ws/services/restServices/execute/ExecuteEngineController.java +++ b/arc-ws/src/main/java/fr/insee/arc/ws/services/restServices/execute/ExecuteEngineController.java @@ -83,7 +83,7 @@ public ResponseEntity executeEngineClient( bodyPojo.fileContent.getBytes(StandardCharsets.UTF_8));) { FileIdCard fileIdCard = new FileIdCard(bodyPojo.fileName); - fileIdCard.setFileAttributes(bodyPojo.norme, bodyPojo.validite, bodyPojo.periodicite); + fileIdCard.setFileIdCard(bodyPojo.norme, bodyPojo.validite, bodyPojo.periodicite); ChargeurXmlComplexe chargeur = new ChargeurXmlComplexe(connection, fileIdCard, inputStream, currentTemporaryTable(i)); chargeur.executeEngine();