From 90586182f442599818c3f1af41d09c5565f97746 Mon Sep 17 00:00:00 2001 From: Stefano Sinatti Date: Tue, 21 May 2024 13:35:02 +0200 Subject: [PATCH] General update --- .gitignore | 6 +- .mvn/wrapper/maven-wrapper.jar | Bin 0 -> 59925 bytes .mvn/wrapper/maven-wrapper.properties | 18 + CHANGELOG.md | 189 ++ LICENSE.txt | 661 +++++++ README.md | 932 ++++++++- RELEASE-NOTES.md | 11 +- mvnw | 287 +++ mvnw.cmd | 187 ++ pom.xml | 225 +-- sacerws-ear/pom.xml | 54 +- .../META-INF/jboss-deployment-structure.xml | 15 +- sacerws-ejb/arquillian.xml | 22 + sacerws-ejb/nbactions.xml | 32 + sacerws-ejb/pom.xml | 172 +- .../parer/exception/ConnectionException.java | 26 + .../ParamApplicNotFoundException.java | 17 + .../parer/exception/ParerAbstractError.java | 22 +- .../parer/exception/ParerErrorCategory.java | 17 + .../parer/exception/ParerErrorSeverity.java | 19 +- .../exception/ParerNoResultException.java | 28 +- .../eng/parer/exception/SacerWsException.java | 17 + .../exception/SacerWsRuntimeException.java | 17 + .../helper/CryptoRestConfiguratorHelper.java | 25 +- .../helper/EidasRestConfiguratorHelper.java | 25 +- .../helper/VerificaFirmeSyncHelper.java | 39 - .../firma/crypto/verifica/CryptoInvoker.java | 170 +- .../crypto/verifica/VerFormatiEnums.java | 17 + .../verifica/VerificaFirmeSyncHandler.java | 115 -- .../it/eng/parer/firma/dto/CompDocMock.java | 17 + .../eng/parer/firma/dto/StatoComponente.java | 27 +- .../eng/parer/firma/dto/StatoDocumento.java | 19 +- .../firma/dto/input/InvokeVerificaInput.java | 17 + .../firma/dto/input/InvokeVerificaRule.java | 21 +- .../it/eng/parer/firma/ejb/EidasInvoker.java | 136 +- .../eng/parer/firma/ejb/FirmeFormatiVers.java | 47 +- .../IGenericVerificaFirmaWrapperResult.java | 17 + .../firma/ejb/IVerificaFirmaInvoker.java | 17 + .../firma/ejb/SalvataggioFirmaManager.java | 520 +++-- .../ejb/VerificaFirmaReportAwsClient.java | 211 --- .../firma/ejb/VerificaFirmaReportHelper.java | 18 + .../ejb/VerificaFirmaWrapperManager.java | 27 +- .../IVerificaFirmaInvokeException.java | 21 +- .../VerificaFirmaConnectionException.java | 23 +- .../exception/VerificaFirmaException.java | 17 + .../VerificaFirmaGenericInvokeException.java | 23 +- .../VerificaFirmaWrapperGenericException.java | 27 +- ...ificaFirmaWrapperResNotFoundException.java | 29 +- .../strategy/CryptoWrapperResultStrategy.java | 82 +- .../strategy/EidasBaseWrapperResult.java | 184 -- .../strategy/EidasWrapperResultStrategy.java | 1685 +---------------- .../IVerificaFirmaWrapperResultStrategy.java | 32 +- .../eidas/EidasBaseWrapperResult.java | 432 +++++ .../strategy/eidas/EidasFirmaBuilder.java | 873 +++++++++ .../strategy/eidas/EidasMarcaBuilder.java | 660 +++++++ .../strategy/eidas/IEidasBuilderVFObj.java | 71 + .../eidas/factory/EidasAbsBuilderFactory.java | 98 + .../factory/EidasVFFirmaCompBuilder.java | 36 + .../factory/EidasVFMarcaCompBuilder.java | 36 + .../parer/firma/util/CryptoErrorHandler.java | 17 + .../parer/firma/util/EidasErrorHandler.java | 17 + .../it/eng/parer/firma/util/EidasUtils.java | 230 +-- .../parer/firma/util/VerificaFirmaEnums.java | 59 +- .../VerificaFirmaWrapperVersamentoUtil.java | 96 +- .../java/it/eng/parer/util/Constants.java | 46 +- .../it/eng/parer/util/DateUtilsConverter.java | 34 + .../it/eng/parer/util/FlagUtilsConverter.java | 33 + .../eng/parer/util/ejb/AppServerInstance.java | 22 +- .../util/ejb/help/ConfigurationHelper.java | 162 +- .../util/ejb/help/dto/AplVGetValParamDto.java | 17 + .../java/it/eng/parer/ws/dto/CSChiave.java | 19 +- .../it/eng/parer/ws/dto/CSChiaveFasc.java | 18 + .../it/eng/parer/ws/dto/CSChiaveSottFasc.java | 17 + .../java/it/eng/parer/ws/dto/CSVersatore.java | 18 + .../it/eng/parer/ws/dto/IErroriMultipli.java | 20 +- .../java/it/eng/parer/ws/dto/IRestWSBase.java | 22 +- .../java/it/eng/parer/ws/dto/IRispostaWS.java | 17 + .../java/it/eng/parer/ws/dto/IWSDesc.java | 17 + .../eng/parer/ws/dto/RispostaControlli.java | 18 + .../java/it/eng/parer/ws/ejb/ControlliMM.java | 106 +- .../eng/parer/ws/ejb/ControlliSemantici.java | 165 +- .../it/eng/parer/ws/ejb/ControlliTpi.java | 112 +- .../java/it/eng/parer/ws/ejb/ControlliWS.java | 118 +- .../java/it/eng/parer/ws/ejb/WsIdpLogger.java | 47 +- .../it/eng/parer/ws/ejb/XmlFascCache.java | 26 +- .../it/eng/parer/ws/ejb/XmlUpdVersCache.java | 19 +- .../it/eng/parer/ws/ejb/XmlVersCache.java | 43 +- .../it/eng/parer/ws/utils/AvanzamentoWs.java | 22 +- .../it/eng/parer/ws/utils/BinEncUtility.java | 58 +- .../eng/parer/ws/utils/CollectionUtility.java | 17 + .../eng/parer/ws/utils/ControlliWSBundle.java | 31 +- .../eng/parer/ws/utils/ControlliWSCache.java | 28 +- .../eng/parer/ws/utils/ControlliWSHelper.java | 28 +- .../java/it/eng/parer/ws/utils/Costanti.java | 104 +- .../it/eng/parer/ws/utils/CostantiDB.java | 51 +- .../it/eng/parer/ws/utils/FlagConverter.java | 17 + .../it/eng/parer/ws/utils/HashCalculator.java | 18 + .../it/eng/parer/ws/utils/HashUtility.java | 39 +- .../it/eng/parer/ws/utils/Hashresult.java | 17 + .../java/it/eng/parer/ws/utils/JAXBUtils.java | 24 +- .../it/eng/parer/ws/utils/KeyOrdUtility.java | 24 +- .../it/eng/parer/ws/utils/KeySizeUtility.java | 30 +- .../eng/parer/ws/utils/LogSessioneUtils.java | 23 +- .../eng/parer/ws/utils/MessaggiWSBundle.java | 37 +- .../eng/parer/ws/utils/MessaggiWSCache.java | 55 +- .../eng/parer/ws/utils/MessaggiWSFormat.java | 116 +- .../eng/parer/ws/utils/MessaggiWSHelper.java | 30 +- .../eng/parer/ws/utils/ParametroApplDB.java | 63 +- .../java/it/eng/parer/ws/utils/PayLoad.java | 20 + .../it/eng/parer/ws/utils/RomanConverter.java | 17 + .../eng/parer/ws/utils/VerificaVersione.java | 22 +- .../parer/ws/utils/WsTransactionManager.java | 84 +- .../java/it/eng/parer/ws/utils/WsXAUtil.java | 25 +- .../ws/utils/WsXmlValidationEventHandler.java | 18 + .../it/eng/parer/ws/utils/XmlDateUtility.java | 23 +- .../java/it/eng/parer/ws/utils/XmlUtils.java | 37 +- .../ws/utils/XmlValidationEventHandler.java | 18 + .../ws/utils/ejb/JmsProducerUtilEjb.java | 84 +- .../dto/AbsVersFascicoloExt.java | 25 +- .../dto/CompRapportoVersFascicolo.java | 20 +- .../ws/versFascicoli/dto/ConfigNumFasc.java | 17 + .../dto/DXPAFascicoloCollegato.java | 17 + .../dto/DXPAVoceClassificazione.java | 17 + .../dto/DXPGAmminPartecipante.java | 17 + .../versFascicoli/dto/DXPGAmminTitolare.java | 17 + .../dto/DXPGProcAmmininistrativo.java | 17 + .../versFascicoli/dto/DXPGRespFascicolo.java | 17 + .../dto/DXPGSoggettoCoinvolto.java | 17 + .../dto/DatiXmlProfiloArchivistico.java | 17 + .../dto/DatiXmlProfiloGenerale.java | 23 +- .../ws/versFascicoli/dto/FascicoloLink.java | 17 + .../ws/versFascicoli/dto/FlControlliFasc.java | 17 + .../versFascicoli/dto/IVersFascicoliExt.java | 20 +- .../dto/RispostaWSFascicolo.java | 17 + .../dto/StrutturaVersFascicolo.java | 50 +- .../versFascicoli/dto/VersFascicoloExt.java | 20 +- .../dto/WSDescVersFascicolo.java | 17 + .../ejb/ControlliCollFascicolo.java | 19 +- .../versFascicoli/ejb/ControlliFascicoli.java | 267 +-- .../ejb/ControlliProfiliFascicolo.java | 56 +- .../ejb/ElencoVersamentoFascicoli.java | 21 +- .../ejb/ElencoVersamentoFascicoliHelper.java | 79 +- .../ejb/LogSessioneFascicoli.java | 47 +- .../ejb/LogSessioneFascicoliHelper.java | 118 +- .../ejb/RecupSessDubbieFasc.java | 38 +- .../ejb/SalvataggioFascicoli.java | 54 +- .../ejb/SalvataggioFascicoliHelper.java | 93 +- .../{utils => ejb}/VersFascicoloExtPrsr.java | 315 ++- .../versFascicoli/ejb/VersFascicoloSync.java | 36 +- .../ws/versFascicoli/utils/CostantiFasc.java | 17 + .../utils/KeyOrdFascUtility.java | 17 + .../utils/KeySizeFascUtility.java | 17 + .../ws/versamento/dto/AbsVersamentoExt.java | 25 +- .../ws/versamento/dto/BackendStorage.java | 50 + .../ws/versamento/dto/ComponenteVers.java | 47 +- .../ws/versamento/dto/ConfigRegAnno.java | 20 +- .../dto/DatabaseStorageBackend.java | 31 + .../versamento/dto/DatiRegistroFiscale.java | 19 +- .../ws/versamento/dto/DatoSpecifico.java | 17 + .../ws/versamento/dto/DocumentoVers.java | 34 +- .../parer/ws/versamento/dto/FileBinario.java | 55 +- .../ws/versamento/dto/FileStorageBackend.java | 33 + .../ws/versamento/dto/IDatiSpecEntity.java | 27 +- .../ws/versamento/dto/IProfiloEntity.java | 17 + .../ws/versamento/dto/IRispostaVersWS.java | 17 + .../ws/versamento/dto/IVersamentoExt.java | 20 +- .../versamento/dto/ObjectStorageBackend.java | 47 + .../versamento/dto/ObjectStorageResource.java | 58 + .../dto/RispostaControlliAttSpec.java | 21 +- .../parer/ws/versamento/dto/RispostaWS.java | 19 +- .../ws/versamento/dto/RispostaWSAggAll.java | 19 +- .../versamento/dto/StrutturaVersamento.java | 41 +- .../ws/versamento/dto/SyncFakeSessn.java | 27 +- .../parer/ws/versamento/dto/UnitaDocColl.java | 25 +- .../ws/versamento/dto/VersamentoExt.java | 33 +- .../versamento/dto/VersamentoExtAggAll.java | 20 +- .../parer/ws/versamento/dto/VoceDiErrore.java | 22 +- .../ws/versamento/dto/WSDescVersamento.java | 19 +- .../dto/WSDescVersamentoAggAll.java | 19 +- .../ws/versamento/ejb/AggiuntaAllSync.java | 116 +- .../parer/ws/versamento/ejb/AwsClient.java | 194 ++ .../parer/ws/versamento/ejb/AwsPresigner.java | 196 ++ .../versamento/ejb/ControlliPartizioni.java | 49 +- .../ws/versamento/ejb/ControlliPerFirme.java | 115 +- .../ws/versamento/ejb/ControlliProfiliUd.java | 33 +- .../ws/versamento/ejb/ControlliRappVers.java | 83 +- .../ws/versamento/ejb/ControlliSubStrut.java | 47 +- .../DocumentoVersVFirmeHash.java | 181 +- .../{utils => ejb}/GestioneDatiSpec.java | 333 ++-- .../ws/versamento/ejb/LogSessioneSync.java | 1209 +++++++----- .../versamento/ejb/ObjectStorageService.java | 871 +++++++++ .../versamento/ejb/RapportoVersBuilder.java | 47 +- .../ws/versamento/ejb/SalvataggioSync.java | 631 +++--- .../{utils => ejb}/VerificaFirmeHash.java | 341 ++-- .../VerificaFirmeHashAggAll.java | 327 ++-- .../ws/versamento/ejb/VersamentoSync.java | 17 + .../ws/versamento/ejb/VersamentoSyncBase.java | 202 +- .../ejb/help/SalvataggioBackendHelper.java | 1279 +++++++++++++ .../ejb/oracleBlb/ISequenceGen.java | 17 + .../ejb/oracleBlb/MonotonicSequenceGen.java | 17 + .../oracleBlb/NonMonotonicSequenceGen.java | 17 + .../ejb/oracleBlb/WriteCompBlbOracle.java | 169 +- .../{utils => ejb/prs}/DocumentoVersPrsr.java | 260 ++- .../prs}/VersamentoExtAggAllPrsr.java | 422 ++--- .../{utils => ejb/prs}/VersamentoExtPrsr.java | 476 ++--- .../exceptions/ObjectStorageException.java | 147 ++ .../parer/ws/versamento/utils/Conteggi.java | 80 +- .../utils/ObjectStorageConnection.java | 95 + .../ws/versamentoMM/dto/ComponenteMM.java | 17 + .../versamentoMM/dto/StrutturaIndiceMM.java | 17 + .../ws/versamentoMM/dto/VersamentoMMExt.java | 18 + .../versamentoMM/dto/WSDescVersamentoMM.java | 19 +- .../{utils => ejb}/AllineaFileComponenti.java | 46 +- .../{utils => ejb}/IndiceMMPrsr.java | 179 +- .../ws/versamentoMM/ejb/VersamentoSyncMM.java | 33 +- .../versamentoTpi/ejb/SalvataggioCompFS.java | 69 +- .../versamentoTpi/ejb/StatoCreaCartelle.java | 17 + .../ws/versamentoTpi/utils/FileServUtils.java | 17 + .../dto/CompRapportoUpdVers.java | 17 + .../versamentoUpd/dto/ControlloEseguito.java | 19 + .../ws/versamentoUpd/dto/ControlloWSResp.java | 18 + .../dto/DatiSpecLinkOsKeyMap.java | 89 + .../ws/versamentoUpd/dto/FlControlliUpd.java | 17 + .../versamentoUpd/dto/RispostaWSUpdVers.java | 17 + .../versamentoUpd/dto/StrutturaUpdVers.java | 85 +- .../versamentoUpd/dto/UpdComponenteVers.java | 21 +- .../versamentoUpd/dto/UpdDocumentoVers.java | 25 +- .../versamentoUpd/dto/UpdFascPrincipale.java | 17 + .../ws/versamentoUpd/dto/UpdUnitaDocColl.java | 27 +- .../ejb/AggiornamentoVersamentoSync.java | 47 +- .../ejb/ControlliUpdVersamento.java | 402 ++-- .../ejb/LogSessioneUpdVersamento.java | 144 +- .../ejb/RecupSessDubbieUpdVersamento.java | 83 +- .../ejb/SalvataggioUpdVersamento.java | 361 ++-- .../ejb/UpdGestioneDatiSpec.java | 516 +++++ .../help/LogSessioneUpdVersamentoHelper.java | 315 ++- .../SalvataggioPregVersamentoAroHelper.java | 115 +- .../SalvataggioUpdVersamentoAroHelper.java | 354 ++-- .../SalvataggioUpdVersamentoBaseHelper.java | 41 +- .../SalvataggioUpdVersamentoIniHelper.java | 183 +- .../SalvataggioUpdVersamentoUpdHelper.java | 529 +++--- .../strategy => ejb/prs}/UpdBasePrsr.java | 23 +- .../prs}/UpdCollegamentiPrsr.java | 85 +- .../prs}/UpdDocumentiIdCountPrsr.java | 182 +- .../prs}/UpdDocumentiPrsr.java | 339 ++-- .../prs}/UpdVersamentoBasePrsr.java | 281 ++- .../{prsr => ejb/prs}/UpdVersamentoPrsr.java | 238 +-- .../ext/AbsUpdVersamentoExt.java | 17 + .../ext/IAggiornamentiWsMultipli.java | 19 +- .../ext/IControlliWsMultipli.java | 19 +- .../versamentoUpd/ext/IUpdVersamentoExt.java | 17 + .../versamentoUpd/ext/UpdVersamentoExt.java | 31 +- .../ws/versamentoUpd/prsr/UpdExecutePrsr.java | 26 - .../prsr/strategy/IUpdStrategyPrsr.java | 12 - .../utils/IRispostaUpdVersWS.java | 17 + .../ws/versamentoUpd/utils/UpdCostanti.java | 18 + .../utils/UpdDocumentiUtils.java | 19 +- .../utils/UpdGestioneDatiSpec.java | 603 +++--- .../ws/versamentoUpd/utils/WSDescUpdVers.java | 17 + .../main/resources/META-INF/jboss-ejb3.xml | 16 +- .../main/resources/countselectlist.properties | 23 - .../test/java/it/eng/ArquillianTestUtils.java | 110 ++ .../src/test/java/it/eng/FakeAuth.java | 52 + .../CryptoRestConfiguratorHelperTest.java | 104 + .../EidasRestConfiguratorHelperTest.java | 105 + .../eng/parer/sacer/ejb/retry/RetryTest.java | 23 +- .../versamento/dto/TestMessaggiWSFormat.java | 23 +- .../ejb/help/ConfigurationHelperTest.java | 133 ++ .../it/eng/parer/ws/ejb/ControlliMMTest.java | 54 + .../parer/ws/ejb/ControlliSemanticiTest.java | 295 +++ .../it/eng/parer/ws/ejb/ControlliTpiTest.java | 58 + .../it/eng/parer/ws/ejb/ControlliWSTest.java | 133 ++ .../it/eng/parer/ws/ejb/WsIdpLoggerTest.java | 58 + .../parer/ws/utils/ControlliWSHelperTest.java | 70 + .../parer/ws/utils/MessaggiWSHelperTest.java | 59 + .../ejb/ControlliFascicoliTest.java | 176 ++ .../ejb/ControlliProfiliFascicoloTest.java | 114 ++ .../ejb/LogSessioneFascicoliHelperTest.java | 104 + .../ejb/SalvataggioFascicoliHelperTest.java | 78 + .../ejb/ControlliPartizioniTest.java | 111 ++ .../versamento/ejb/ControlliPerFirmeTest.java | 185 ++ .../ejb/ControlliProfiliUdTest.java | 70 + .../versamento/ejb/ControlliRappVersTest.java | 67 + .../versamento/ejb/ControlliSubStrutTest.java | 61 + .../versamento/ejb/LogSessioneSyncTest.java | 72 + .../versamento/ejb/SalvataggioSyncTest.java | 102 + .../ejb/SalvataggioCompFSTest.java | 109 ++ .../ejb/ControlliUpdVersamentoTest.java | 138 ++ .../LogSessioneUpdVersamentoHelperTest.java | 143 ++ ...alvataggioPregVersamentoAroHelperTest.java | 76 + ...SalvataggioUpdVersamentoAroHelperTest.java | 105 + ...alvataggioUpdVersamentoBaseHelperTest.java | 92 + ...SalvataggioUpdVersamentoIniHelperTest.java | 91 + ...SalvataggioUpdVersamentoUpdHelperTest.java | 105 + .../WSRequestAggiornamentoVersamento_1.4.xsd | 756 ++++++++ .../WSRequestIndiceSIPFascicolo_1.0.xsd | 223 +++ .../test/resources/WSRequestVersamento.xsd | 439 +++++ .../WSResponseAggiornamentoVersamento_1.4.xsd | 315 +++ .../test/resources/WSResponseVersamento.xsd | 626 ++++++ .../src/test/resources/ejb-jar-paginator.xml | 8 + .../src/test/resources/ejb-jar-sacerlog.xml | 9 + sacerws-ejb/src/test/resources/ejb-jar.xml | 19 + sacerws-ejb/src/test/resources/jboss-ejb3.xml | 24 + .../src/test/resources/persistence.xml | 21 + .../resources/sacerEjb.properties | 0 sacerws-jpa/pom.xml | 160 ++ .../it/eng/parer/entity/AplParamApplic.java | 211 +++ .../it/eng/parer/entity/AplSistemaMigraz.java | 86 + .../eng/parer/entity/AplSistemaVersante.java | 105 + .../it/eng/parer/entity/AroArchivSec.java | 145 ++ .../it/eng/parer/entity/AroBustaCrittog.java | 141 ++ .../java/it/eng/parer/entity/AroCompDoc.java | 627 ++++++ .../parer/entity/AroCompObjectStorage.java | 122 ++ .../it/eng/parer/entity/AroCompUrnCalc.java | 103 + .../eng/parer/entity/AroContrFirmaComp.java | 152 ++ .../eng/parer/entity/AroContrMarcaComp.java | 153 ++ .../eng/parer/entity/AroControfirmaFirma.java | 92 + .../main/java/it/eng/parer/entity/AroDoc.java | 462 +++++ .../it/eng/parer/entity/AroFirmaComp.java | 398 ++++ .../it/eng/parer/entity/AroIndiceAipUd.java | 113 ++ .../it/eng/parer/entity/AroLinkUnitaDoc.java | 146 ++ .../it/eng/parer/entity/AroMarcaComp.java | 280 +++ .../java/it/eng/parer/entity/AroStrutDoc.java | 141 ++ .../java/it/eng/parer/entity/AroUnitaDoc.java | 752 ++++++++ .../it/eng/parer/entity/AroUpdArchivSec.java | 132 ++ .../eng/parer/entity/AroUpdCompUnitaDoc.java | 161 ++ .../entity/AroUpdDatiSpecUdObjectStorage.java | 153 ++ .../parer/entity/AroUpdDatiSpecUnitaDoc.java | 195 ++ .../eng/parer/entity/AroUpdDocUnitaDoc.java | 174 ++ .../eng/parer/entity/AroUpdLinkUnitaDoc.java | 135 ++ .../it/eng/parer/entity/AroUpdUnitaDoc.java | 603 ++++++ .../parer/entity/AroUsoCertifCaContrComp.java | 128 ++ .../entity/AroUsoCertifCaContrMarca.java | 129 ++ .../eng/parer/entity/AroUsoXsdDatiSpec.java | 167 ++ .../parer/entity/AroValoreAttribDatiSpec.java | 113 ++ .../eng/parer/entity/AroVerIndiceAipUd.java | 225 +++ .../eng/parer/entity/AroVerifFirmaDtVer.java | 98 + .../eng/parer/entity/AroVersIniArchivSec.java | 133 ++ .../it/eng/parer/entity/AroVersIniComp.java | 139 ++ .../eng/parer/entity/AroVersIniDatiSpec.java | 192 ++ .../AroVersIniDatiSpecObjectStorage.java | 153 ++ .../it/eng/parer/entity/AroVersIniDoc.java | 140 ++ .../parer/entity/AroVersIniLinkUnitaDoc.java | 135 ++ .../eng/parer/entity/AroVersIniUnitaDoc.java | 211 +++ .../it/eng/parer/entity/AroWarnUnitaDoc.java | 134 ++ .../eng/parer/entity/AroWarnUpdUnitaDoc.java | 127 ++ .../parer/entity/AroXmlDocObjectStorage.java | 63 + .../entity/AroXmlUnitaDocObjectStorage.java | 63 + .../entity/AroXmlUpdUdObjectStorage.java | 116 ++ .../eng/parer/entity/AroXmlUpdUnitaDoc.java | 208 ++ .../parer/entity/DecAaRegistroUnitaDoc.java | 166 ++ .../eng/parer/entity/DecAaTipoFascicolo.java | 165 ++ .../eng/parer/entity/DecAttribDatiSpec.java | 233 +++ .../java/it/eng/parer/entity/DecBackend.java | 134 ++ .../parer/entity/DecConfigObjectStorage.java | 127 ++ .../it/eng/parer/entity/DecControlloWs.java | 114 ++ .../java/it/eng/parer/entity/DecErrSacer.java | 110 ++ .../eng/parer/entity/DecEstensioneFile.java | 92 + .../parer/entity/DecFormatoFileAmmesso.java | 97 + .../eng/parer/entity/DecFormatoFileBusta.java | 92 + .../eng/parer/entity/DecFormatoFileDoc.java | 211 +++ .../parer/entity/DecFormatoFileStandard.java | 223 +++ .../it/eng/parer/entity/DecLivelloTitol.java | 136 ++ .../parer/entity/DecModelloXsdFascicolo.java | 212 +++ .../it/eng/parer/entity/DecModelloXsdUd.java | 218 +++ .../parer/entity/DecParteNumeroFascicolo.java | 189 ++ .../parer/entity/DecParteNumeroRegistro.java | 189 ++ .../eng/parer/entity/DecRegistroUnitaDoc.java | 297 +++ .../DecReportServizioVerificaCompDoc.java | 108 ++ .../entity/DecServizioVerificaCompDoc.java | 106 ++ .../it/eng/parer/entity/DecTipoCompDoc.java | 241 +++ .../java/it/eng/parer/entity/DecTipoDoc.java | 259 +++ .../it/eng/parer/entity/DecTipoFascicolo.java | 156 ++ .../it/eng/parer/entity/DecTipoRapprComp.java | 212 +++ .../it/eng/parer/entity/DecTipoStrutDoc.java | 159 ++ .../it/eng/parer/entity/DecTipoUnitaDoc.java | 329 ++++ .../parer/entity/DecTipoUnitaDocAmmesso.java | 98 + .../java/it/eng/parer/entity/DecTitol.java | 188 ++ .../entity/DecUsoFormatoFileStandard.java | 106 ++ .../parer/entity/DecUsoModelloXsdCompDoc.java | 123 ++ .../eng/parer/entity/DecUsoModelloXsdDoc.java | 125 ++ .../parer/entity/DecUsoModelloXsdFasc.java | 119 ++ .../parer/entity/DecUsoModelloXsdUniDoc.java | 123 ++ .../it/eng/parer/entity/DecValVoceTitol.java | 149 ++ .../it/eng/parer/entity/DecVoceTitol.java | 211 +++ .../eng/parer/entity/DecWarnAaRegistroUd.java | 99 + .../parer/entity/DecWarnAaTipoFascicolo.java | 100 + .../parer/entity/DecXsdAttribDatiSpec.java | 109 ++ .../it/eng/parer/entity/DecXsdDatiSpec.java | 253 +++ .../parer/entity/ElvDocAggDaElabElenco.java | 103 + .../eng/parer/entity/ElvFascDaElabElenco.java | 141 ++ .../parer/entity/ElvUdVersDaElabElenco.java | 103 + .../parer/entity/ElvUpdUdDaElabElenco.java | 160 ++ .../it/eng/parer/entity/FasAmminPartec.java | 109 ++ .../it/eng/parer/entity/FasFascicolo.java | 780 ++++++++ .../it/eng/parer/entity/FasLinkFascicolo.java | 129 ++ .../it/eng/parer/entity/FasRespFascicolo.java | 147 ++ .../it/eng/parer/entity/FasSogFascicolo.java | 142 ++ .../entity/FasStatoConservFascicolo.java | 121 ++ .../parer/entity/FasStatoFascicoloElenco.java | 120 ++ .../parer/entity/FasUniOrgRespFascicolo.java | 87 + .../parer/entity/FasUnitaDocFascicolo.java | 90 + .../it/eng/parer/entity/FasWarnFascicolo.java | 113 ++ .../it/eng/parer/entity/FasXmlFascicolo.java | 148 ++ .../eng/parer/entity/FasXmlVersFascicolo.java | 205 ++ .../java/it/eng/parer/entity/FirCertifCa.java | 236 +++ .../eng/parer/entity/FirCertifFirmatario.java | 133 ++ .../it/eng/parer/entity/FirCertifOcsp.java | 148 ++ .../main/java/it/eng/parer/entity/FirCrl.java | 156 ++ .../it/eng/parer/entity/FirFilePerFirma.java | 164 ++ .../java/it/eng/parer/entity/FirOcsp.java | 117 ++ .../java/it/eng/parer/entity/FirReport.java | 141 ++ .../it/eng/parer/entity/FirUrlDistribCrl.java | 100 + .../eng/parer/entity/FirUrlDistribOcsp.java | 91 + .../it/eng/parer/entity/FirUrnReport.java | 95 + .../it/eng/parer/entity/IamAbilOrganiz.java | 129 ++ .../it/eng/parer/entity/IamAbilTipoDato.java | 100 + .../it/eng/parer/entity/IamAutorServ.java | 88 + .../it/eng/parer/entity/IamIndIpUser.java | 78 + .../java/it/eng/parer/entity/IamUser.java | 233 +++ .../java/it/eng/parer/entity/LogLockElab.java | 110 ++ .../parer/entity/MonAaUnitaDocRegistro.java | 88 + .../eng/parer/entity/MonContaFascicoliKo.java | 138 ++ .../it/eng/parer/entity/MonContaSesUpdUd.java | 119 ++ .../eng/parer/entity/MonContaSesUpdUdKo.java | 120 ++ .../it/eng/parer/entity/MonKeyTotalUd.java | 171 ++ .../it/eng/parer/entity/MonKeyTotalUdKo.java | 158 ++ .../java/it/eng/parer/entity/OrgAmbiente.java | 161 ++ .../eng/parer/entity/OrgCampoValSubStrut.java | 131 ++ .../java/it/eng/parer/entity/OrgEnte.java | 210 ++ .../it/eng/parer/entity/OrgPartition.java | 121 ++ .../eng/parer/entity/OrgPartitionStrut.java | 101 + .../parer/entity/OrgPartitionSubStrut.java | 101 + .../parer/entity/OrgRegolaValSubStrut.java | 137 ++ .../java/it/eng/parer/entity/OrgStrut.java | 482 +++++ .../java/it/eng/parer/entity/OrgSubStrut.java | 145 ++ .../eng/parer/entity/OrgValSubPartition.java | 88 + .../java/it/eng/parer/entity/SerVerSerie.java | 273 +++ .../eng/parer/entity/VrsDatiSessioneVers.java | 160 ++ .../parer/entity/VrsDatiSessioneVersKo.java | 166 ++ .../it/eng/parer/entity/VrsDocNonVer.java | 171 ++ .../java/it/eng/parer/entity/VrsDtVers.java | 236 +++ .../parer/entity/VrsErrSesFascicoloKo.java | 135 ++ .../parer/entity/VrsErrSesUpdUnitaDocErr.java | 153 ++ .../parer/entity/VrsErrSesUpdUnitaDocKo.java | 176 ++ .../eng/parer/entity/VrsErrSessioneVers.java | 143 ++ .../parer/entity/VrsErrSessioneVersKo.java | 131 ++ .../it/eng/parer/entity/VrsFascicoloKo.java | 211 +++ .../entity/VrsFileSesObjectStorageKo.java | 107 ++ .../eng/parer/entity/VrsFileSessioneKo.java | 119 ++ .../it/eng/parer/entity/VrsPathDtVers.java | 206 ++ .../eng/parer/entity/VrsSesFascicoloErr.java | 278 +++ .../eng/parer/entity/VrsSesFascicoloKo.java | 262 +++ .../parer/entity/VrsSesUpdUnitaDocErr.java | 334 ++++ .../eng/parer/entity/VrsSesUpdUnitaDocKo.java | 284 +++ .../it/eng/parer/entity/VrsSessioneVers.java | 403 ++++ .../eng/parer/entity/VrsSessioneVersKo.java | 384 ++++ .../eng/parer/entity/VrsUnitaDocNonVer.java | 160 ++ .../it/eng/parer/entity/VrsUpdUnitaDocKo.java | 268 +++ .../parer/entity/VrsUrnXmlSessioneVers.java | 104 + .../parer/entity/VrsUrnXmlSessioneVersKo.java | 113 ++ .../entity/VrsXmlDatiSesObjectStorageKo.java | 107 ++ .../parer/entity/VrsXmlDatiSessioneVers.java | 191 ++ .../entity/VrsXmlDatiSessioneVersKo.java | 174 ++ .../entity/VrsXmlModelloSessioneVers.java | 145 ++ .../parer/entity/VrsXmlSesFascicoloErr.java | 106 ++ .../parer/entity/VrsXmlSesFascicoloKo.java | 133 ++ .../VrsXmlSesUpdUdErrObjectStorage.java | 116 ++ .../entity/VrsXmlSesUpdUdKoObjectStorage.java | 116 ++ .../parer/entity/VrsXmlSesUpdUnitaDocErr.java | 117 ++ .../parer/entity/VrsXmlSesUpdUnitaDocKo.java | 153 ++ .../builder/VrsDatiSessioneVersBuilder.java | 142 ++ .../builder/VrsErrSessioneVersBuilder.java | 107 ++ .../VrsFileSesObjectStorageBuilder.java | 79 + .../builder/VrsFileSessioneBuilder.java | 73 + .../builder/VrsSessioneVersBuilder.java | 276 +++ .../builder/VrsUrnXmlSessioneVersBuilder.java | 86 + .../VrsXmlDatiSesObjectStorageBuilder.java | 79 + .../VrsXmlDatiSessioneVersBuilder.java | 149 ++ .../constraint/AplValoreParamApplic.java | 33 + .../entity/constraint/AroCompUrnCalc.java | 33 + .../constraint/AroUpdDatiSpecUnitaDoc.java | 47 + .../entity/constraint/AroUpdUnitaDoc.java | 47 + .../entity/constraint/AroVersIniDatiSpec.java | 47 + .../entity/constraint/AroXmlUpdUnitaDoc.java | 39 + .../constraint/DecModelloXsdFascicolo.java | 44 + .../entity/constraint/DecModelloXsdUd.java | 29 + .../DecReportServizioVerificaCompDoc.java | 33 + .../DecServizioVerificaCompDoc.java | 29 + .../constraint/ElvFascDaElabElenco.java | 36 + .../entity/constraint/ElvStatoElencoVer.java | 37 + .../constraint/ElvUpdUdDaElabElenco.java | 39 + .../parer/entity/constraint/FasFascicolo.java | 74 + .../entity/constraint/FasRespFascicolo.java | 36 + .../constraint/FasStatoConservFascicolo.java | 34 + .../constraint/FasStatoFascicoloElenco.java | 36 + .../entity/constraint/FasXmlFascicolo.java | 41 + .../parer/entity/constraint/FiUrnReport.java | 29 + .../entity/constraint/MonContaSesUpdUd.java | 43 + .../entity/constraint/MonContaSesUpdUdKo.java | 39 + .../entity/constraint/SIOrgEnteSiam.java | 51 + .../entity/constraint/SerUrnFileVerSerie.java | 33 + .../constraint/VrsErrSesUpdUnitaDocErr.java | 39 + .../constraint/VrsErrUpdUnitaDocKo.java | 39 + .../constraint/VrsSesUpdUnitaDocErr.java | 36 + .../constraint/VrsSesUpdUnitaDocKo.java | 36 + .../entity/constraint/VrsUpdUnitaDocKo.java | 39 + .../constraint/VrsUrnXmlSessioneVers.java | 33 + .../constraint/VrsXmlSesUpdUnitaDocErr.java | 39 + .../constraint/VrsXmlSesUpdUnitaDocKo.java | 39 + .../converter/NeverendingDateConverter.java | 96 + .../inheritance/oop/AroXmlObjectStorage.java | 81 + .../oop/ElvUdDocUpdDaElabElenco.java | 67 + .../it/eng/parer/granted_entity/UsrUser.java | 228 +++ .../AplVGetvalParamByAatifasc.java | 168 ++ .../view_entity/AplVGetvalParamByAmb.java | 108 ++ .../view_entity/AplVGetvalParamByApl.java | 79 + .../view_entity/AplVGetvalParamByStrut.java | 132 ++ .../view_entity/AplVGetvalParamByTiud.java | 152 ++ .../view_entity/AroVDtVersMaxByUnitaDoc.java | 71 + .../parer/view_entity/FasVLisFascByUpdUd.java | 49 + .../view_entity/FasVLisFascByUpdUdId.java | 81 + .../parer/view_entity/LogVVisLastSched.java | 86 + .../view_entity/OrgVChkPartitionFascByAa.java | 272 +++ .../view_entity/OrgVChkPartitionFascErr.java | 62 + .../view_entity/OrgVChkPartitionUpdByAa.java | 241 +++ .../view_entity/OrgVChkPartitionUpdErr.java | 60 + .../view_entity/OrgVValSubPartition.java | 90 + .../view_entity/SerVLisVerserByUpdUd.java | 48 + .../view_entity/SerVLisVerserByUpdUdId.java | 77 + .../view_entity/VrsVLisXmlDocUrnDaCalc.java | 192 ++ .../view_entity/VrsVLisXmlUdUrnDaCalc.java | 172 ++ .../view_entity/VrsVLisXmlUpdUrnDaCalc.java | 182 ++ .../parer/view_entity/VrsVModifUpdUdKo.java | 168 ++ .../parer/view_entity/VrsVUpdFascicoloKo.java | 137 ++ .../main/resources/META-INF/persistence.xml | 55 + .../it/eng/parer/entity/jaxb.properties | 3 + sacerws-web/pom.xml | 8 +- .../parer/restWS/AggAllegatiSyncSrvlt.java | 181 +- .../it/eng/parer/restWS/AppInfosSrvlt.java | 176 ++ .../eng/parer/restWS/UpdVersamentoSrvlt.java | 116 +- .../restWS/VersamentoFascicoloSrvlt.java | 149 +- .../restWS/VersamentoMultiMSyncSrvlt.java | 149 +- .../eng/parer/restWS/VersamentoSyncSrvlt.java | 194 +- .../eng/parer/restWS/util/AbsRequestPrsr.java | 48 - .../it/eng/parer/restWS/util/RequestPrsr.java | 102 +- .../it/eng/parer/restWS/util/Response405.java | 17 + .../restWS/util/SrvltHandlingException.java | 17 + .../src/main/resources/Sacer.properties | 328 ---- sacerws-web/src/main/resources/ws_handler.xml | 9 - sacerws-web/src/main/webapp/WEB-INF/web.xml | 86 +- sacerws-web/src/main/webapp/lab.jsp | 22 - src/docs/JBoss6_configurazione_generale.md | 709 ------- src/docs/JBoss6_configurazione_sacerws.md | 198 -- src/docs/JBoss7_configurazione_generale.md | 975 ++++++++++ src/docs/JBoss7_configurazione_sacerws.md | 330 ++++ 556 files changed, 60024 insertions(+), 11185 deletions(-) create mode 100644 .mvn/wrapper/maven-wrapper.jar create mode 100644 .mvn/wrapper/maven-wrapper.properties create mode 100644 LICENSE.txt create mode 100755 mvnw create mode 100644 mvnw.cmd create mode 100644 sacerws-ejb/arquillian.xml create mode 100644 sacerws-ejb/nbactions.xml create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/exception/ConnectionException.java delete mode 100644 sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/VerificaFirmeSyncHelper.java delete mode 100644 sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/VerificaFirmeSyncHandler.java delete mode 100644 sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaReportAwsClient.java delete mode 100644 sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/EidasBaseWrapperResult.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/EidasBaseWrapperResult.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/EidasFirmaBuilder.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/EidasMarcaBuilder.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/IEidasBuilderVFObj.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/factory/EidasAbsBuilderFactory.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/factory/EidasVFFirmaCompBuilder.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/factory/EidasVFMarcaCompBuilder.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/util/FlagUtilsConverter.java rename sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/{utils => ejb}/VersFascicoloExtPrsr.java (86%) create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/BackendStorage.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DatabaseStorageBackend.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/FileStorageBackend.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ObjectStorageBackend.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ObjectStorageResource.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/AwsClient.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/AwsPresigner.java rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/{utils => ejb}/DocumentoVersVFirmeHash.java (92%) rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/{utils => ejb}/GestioneDatiSpec.java (64%) create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ObjectStorageService.java rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/{utils => ejb}/VerificaFirmeHash.java (60%) rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/{utils => ejb}/VerificaFirmeHashAggAll.java (62%) create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/help/SalvataggioBackendHelper.java rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/{utils => ejb/prs}/DocumentoVersPrsr.java (91%) rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/{utils => ejb/prs}/VersamentoExtAggAllPrsr.java (78%) rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/{utils => ejb/prs}/VersamentoExtPrsr.java (84%) create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/exceptions/ObjectStorageException.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/ObjectStorageConnection.java rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/{utils => ejb}/AllineaFileComponenti.java (90%) rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/{utils => ejb}/IndiceMMPrsr.java (80%) create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/DatiSpecLinkOsKeyMap.java create mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/UpdGestioneDatiSpec.java rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/{prsr/strategy => ejb/prs}/UpdBasePrsr.java (87%) rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/{prsr/strategy => ejb/prs}/UpdCollegamentiPrsr.java (90%) rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/{prsr/strategy => ejb/prs}/UpdDocumentiIdCountPrsr.java (65%) rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/{prsr/strategy => ejb/prs}/UpdDocumentiPrsr.java (87%) rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/{prsr => ejb/prs}/UpdVersamentoBasePrsr.java (85%) rename sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/{prsr => ejb/prs}/UpdVersamentoPrsr.java (78%) delete mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/UpdExecutePrsr.java delete mode 100644 sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/IUpdStrategyPrsr.java delete mode 100644 sacerws-ejb/src/main/resources/countselectlist.properties create mode 100644 sacerws-ejb/src/test/java/it/eng/ArquillianTestUtils.java create mode 100644 sacerws-ejb/src/test/java/it/eng/FakeAuth.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelperTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelperTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/util/ejb/help/ConfigurationHelperTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliMMTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliSemanticiTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliTpiTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliWSTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/WsIdpLoggerTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/utils/ControlliWSHelperTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/utils/MessaggiWSHelperTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/ControlliFascicoliTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/ControlliProfiliFascicoloTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/LogSessioneFascicoliHelperTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/SalvataggioFascicoliHelperTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliPartizioniTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliPerFirmeTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliProfiliUdTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliRappVersTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliSubStrutTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/LogSessioneSyncTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/SalvataggioSyncTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoTpi/ejb/SalvataggioCompFSTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/ControlliUpdVersamentoTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/LogSessioneUpdVersamentoHelperTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioPregVersamentoAroHelperTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoAroHelperTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoBaseHelperTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoIniHelperTest.java create mode 100644 sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoUpdHelperTest.java create mode 100644 sacerws-ejb/src/test/resources/WSRequestAggiornamentoVersamento_1.4.xsd create mode 100644 sacerws-ejb/src/test/resources/WSRequestIndiceSIPFascicolo_1.0.xsd create mode 100644 sacerws-ejb/src/test/resources/WSRequestVersamento.xsd create mode 100644 sacerws-ejb/src/test/resources/WSResponseAggiornamentoVersamento_1.4.xsd create mode 100644 sacerws-ejb/src/test/resources/WSResponseVersamento.xsd create mode 100644 sacerws-ejb/src/test/resources/ejb-jar-paginator.xml create mode 100644 sacerws-ejb/src/test/resources/ejb-jar-sacerlog.xml create mode 100644 sacerws-ejb/src/test/resources/ejb-jar.xml create mode 100644 sacerws-ejb/src/test/resources/jboss-ejb3.xml create mode 100644 sacerws-ejb/src/test/resources/persistence.xml rename sacerws-ejb/src/{main => test}/resources/sacerEjb.properties (100%) create mode 100644 sacerws-jpa/pom.xml create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AplParamApplic.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AplSistemaMigraz.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AplSistemaVersante.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroArchivSec.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroBustaCrittog.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroCompDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroCompObjectStorage.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroCompUrnCalc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroContrFirmaComp.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroContrMarcaComp.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroControfirmaFirma.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroFirmaComp.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroIndiceAipUd.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroLinkUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroMarcaComp.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroStrutDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdArchivSec.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdCompUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdDatiSpecUdObjectStorage.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdDatiSpecUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdDocUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdLinkUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroUsoCertifCaContrComp.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroUsoCertifCaContrMarca.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroUsoXsdDatiSpec.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroValoreAttribDatiSpec.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroVerIndiceAipUd.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroVerifFirmaDtVer.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniArchivSec.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniComp.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniDatiSpec.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniDatiSpecObjectStorage.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniLinkUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroWarnUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroWarnUpdUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlDocObjectStorage.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlUnitaDocObjectStorage.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlUpdUdObjectStorage.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlUpdUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecAaRegistroUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecAaTipoFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecAttribDatiSpec.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecBackend.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecConfigObjectStorage.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecControlloWs.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecErrSacer.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecEstensioneFile.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileAmmesso.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileBusta.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileStandard.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecLivelloTitol.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecModelloXsdFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecModelloXsdUd.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecParteNumeroFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecParteNumeroRegistro.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecRegistroUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecReportServizioVerificaCompDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecServizioVerificaCompDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoCompDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoRapprComp.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoStrutDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoUnitaDocAmmesso.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecTitol.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoFormatoFileStandard.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdCompDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdFasc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdUniDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecValVoceTitol.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecVoceTitol.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecWarnAaRegistroUd.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecWarnAaTipoFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecXsdAttribDatiSpec.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/DecXsdDatiSpec.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/ElvDocAggDaElabElenco.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/ElvFascDaElabElenco.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/ElvUdVersDaElabElenco.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/ElvUpdUdDaElabElenco.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FasAmminPartec.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FasFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FasLinkFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FasRespFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FasSogFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FasStatoConservFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FasStatoFascicoloElenco.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FasUniOrgRespFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FasUnitaDocFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FasWarnFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FasXmlFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FasXmlVersFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FirCertifCa.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FirCertifFirmatario.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FirCertifOcsp.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FirCrl.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FirFilePerFirma.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FirOcsp.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FirReport.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FirUrlDistribCrl.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FirUrlDistribOcsp.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/FirUrnReport.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/IamAbilOrganiz.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/IamAbilTipoDato.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/IamAutorServ.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/IamIndIpUser.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/IamUser.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/LogLockElab.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/MonAaUnitaDocRegistro.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/MonContaFascicoliKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/MonContaSesUpdUd.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/MonContaSesUpdUdKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/MonKeyTotalUd.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/MonKeyTotalUdKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/OrgAmbiente.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/OrgCampoValSubStrut.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/OrgEnte.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/OrgPartition.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/OrgPartitionStrut.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/OrgPartitionSubStrut.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/OrgRegolaValSubStrut.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/OrgStrut.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/OrgSubStrut.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/OrgValSubPartition.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/SerVerSerie.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDatiSessioneVers.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDatiSessioneVersKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDocNonVer.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDtVers.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSesFascicoloKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSesUpdUnitaDocErr.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSesUpdUnitaDocKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSessioneVers.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSessioneVersKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsFascicoloKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsFileSesObjectStorageKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsFileSessioneKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsPathDtVers.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesFascicoloErr.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesFascicoloKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesUpdUnitaDocErr.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesUpdUnitaDocKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSessioneVers.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSessioneVersKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUnitaDocNonVer.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUpdUnitaDocKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUrnXmlSessioneVers.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUrnXmlSessioneVersKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlDatiSesObjectStorageKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlDatiSessioneVers.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlDatiSessioneVersKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlModelloSessioneVers.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesFascicoloErr.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesFascicoloKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUdErrObjectStorage.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUdKoObjectStorage.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUnitaDocErr.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUnitaDocKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsDatiSessioneVersBuilder.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsErrSessioneVersBuilder.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsFileSesObjectStorageBuilder.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsFileSessioneBuilder.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsSessioneVersBuilder.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsUrnXmlSessioneVersBuilder.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsXmlDatiSesObjectStorageBuilder.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsXmlDatiSessioneVersBuilder.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AplValoreParamApplic.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroCompUrnCalc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroUpdDatiSpecUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroUpdUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroVersIniDatiSpec.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroXmlUpdUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecModelloXsdFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecModelloXsdUd.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecReportServizioVerificaCompDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecServizioVerificaCompDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/ElvFascDaElabElenco.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/ElvStatoElencoVer.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/ElvUpdUdDaElabElenco.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasRespFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasStatoConservFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasStatoFascicoloElenco.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasXmlFascicolo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FiUrnReport.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/MonContaSesUpdUd.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/MonContaSesUpdUdKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/SIOrgEnteSiam.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/SerUrnFileVerSerie.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsErrSesUpdUnitaDocErr.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsErrUpdUnitaDocKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsSesUpdUnitaDocErr.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsSesUpdUnitaDocKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsUpdUnitaDocKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsUrnXmlSessioneVers.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsXmlSesUpdUnitaDocErr.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsXmlSesUpdUnitaDocKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/converter/NeverendingDateConverter.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/inheritance/oop/AroXmlObjectStorage.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/entity/inheritance/oop/ElvUdDocUpdDaElabElenco.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/granted_entity/UsrUser.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByAatifasc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByAmb.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByApl.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByStrut.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByTiud.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/AroVDtVersMaxByUnitaDoc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/FasVLisFascByUpdUd.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/FasVLisFascByUpdUdId.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/LogVVisLastSched.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionFascByAa.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionFascErr.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionUpdByAa.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionUpdErr.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVValSubPartition.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/SerVLisVerserByUpdUd.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/SerVLisVerserByUpdUdId.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVLisXmlDocUrnDaCalc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVLisXmlUdUrnDaCalc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVLisXmlUpdUrnDaCalc.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVModifUpdUdKo.java create mode 100644 sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVUpdFascicoloKo.java create mode 100644 sacerws-jpa/src/main/resources/META-INF/persistence.xml create mode 100644 sacerws-jpa/src/main/resources/it/eng/parer/entity/jaxb.properties create mode 100644 sacerws-web/src/main/java/it/eng/parer/restWS/AppInfosSrvlt.java delete mode 100644 sacerws-web/src/main/java/it/eng/parer/restWS/util/AbsRequestPrsr.java delete mode 100644 sacerws-web/src/main/resources/Sacer.properties delete mode 100644 sacerws-web/src/main/resources/ws_handler.xml delete mode 100644 src/docs/JBoss6_configurazione_generale.md delete mode 100644 src/docs/JBoss6_configurazione_sacerws.md create mode 100644 src/docs/JBoss7_configurazione_generale.md create mode 100644 src/docs/JBoss7_configurazione_sacerws.md diff --git a/.gitignore b/.gitignore index bce8da6..093b679 100644 --- a/.gitignore +++ b/.gitignore @@ -10,10 +10,12 @@ /sacerws-ejb/nbproject/ /nbactions.xml /sacerws-ejb/nbproject/project.properties -.idea/ +/**/.idea/ .project /**/.classpath /**/.project /**/*.iml /**/*.factorypath -.vscode/ \ No newline at end of file +.vscode/ +/**/xaDiskHome +.idea/* diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..bf82ff01c6cdae4a1bb754a6e062954d77ac5c11 GIT binary patch literal 59925 zcmb5U1CS=sk~ZA7ZQHhc+Mc%Ywrx+_*0gQgw(Xv_ZBOg(y}RG;-uU;sUu;#Jh>EHw zGfrmZsXF;&D$0O@!2kh40RbILm8t;!w*&h7T24$wm|jX=oKf)`hV~7E`UmXw?e4Pt z`>_l#5YYGC|ANU0%S(xiDXTEZiATrw!Spl1gyQYxsqjrZO`%3Yq?k$Dr=tVr?HIeHlsmnE9=ZU6I2QoCjlLn85rrn7M!RO}+ z%|6^Q>sv`K3j6Ux>as6NoB}L8q#ghm_b)r{V+Pf3xj>b^+M8ZFY`k|FHgl zM!^0D!qDCjU~cj+fXM$0v@vuwvHcft?EeYw=4fbdZ{qkb#PI)>7{J=%Ux*@pi~i^9 z{(nu6>i-Y^_7lUudx7B}(hUFa*>e0ZwEROS{eRc_U*VV`F$C=Jtqb-$9MS)~&L3im zV)8%4)^9W3c4IT94|h)3k zdAT_~?$Z0{&MK=M0K)Y#_0R;gEjTs0uy4JHvr6q{RKur)D^%t>W+U;a*TZ;VL{kcnJJT z3mD=m7($$%?Y#>-Edcet`uWDH(@wIl+|_f#5l8odHg_|+)4AAYP9)~B^10nU306iE zaS4Y#5&gTL4eHH6&zd(VGyR0Qccx;>0R~Y5#29OkJpSAyr4&h1CYY|I}o)z ze}OiPf5V~(ABejc1pN%8rJQHwPn_`O*q7Dm)p}3K(mm1({hFmfY{yYbM)&Y`2R=h? zTtYwx?$W-*1LqsUrUY&~BwJjr)rO{qI$a`=(6Uplsti7Su#&_03es*Yp0{U{(nQCr z?5M{cLyHT_XALxWu5fU>DPVo99l3FAB<3mtIS<_+71o0jR1A8rd30@j;B75Z!uH;< z{shmnFK@pl080=?j0O8KnkE;zsuxzZx z4X2?!Dk7}SxCereOJK4-FkOq3i{GD#xtAE(tzLUiN~R2WN*RMuA3uYv-3vr9N8;p- z0ovH_gnvKnB5M{_^d`mUsVPvYv`38c2_qP$*@)N(ZmZosbxiRG=Cbm`0ZOx23Zzgs zLJPF;&V~ZV;Nb8ELEf73;P5ciI7|wZBtDl}on%WwtCh8Lf$Yfq`;Hb1D!-KYz&Kd< z+WE+o-gPb6S%ah2^mF80rK=H*+8mQdyrR+)Ar5krl4S!TAAG+sv8o+Teg)`9b22%4 zI7vnPTq&h=o=Z|$;>tEj(i@KN^8N@nk}}6SBhDIGCE4TrmVvM^PlBVZsbZcmR$P7v3{Pw88(jhhI?28MZ>uB%H z&+HAqu-MDFVk5|LYqUXBMR74n1nJ|qLNe#G7UaE>J{uX(rz6McAWj)Ui2R!4y&B01 z`}LOF7k|z0$I+psk+U^Z3YiAH-{>k*@z|0?L4MPNdtsPB+(F791LsRX$Dm(Gycm1k}n z#a2T#*)k-v{}p@^L5PC^@bH+-YO4v`l7Gq)9pgSns??ISG!M6>7&GySTZkVhykqk* zijh9sE`ky?DQPo+7}Vu@?}15_zTovL$r%h~*)=6*vTz?G#h|~>p(ukh%MKOCV^Jxa zi~lMP5+^-OW%Te@b#UoL6T1%9h-W}*hUtdu!>odxuT`kTg6U3+a@6QTiwM0I zqXcEI2x-gOS74?=&<18fYRv&Ms)R>e;Qz&0N20K9%CM_Iq#3V8%pwU>rAGbaXoGVS z-r5a$;fZ>75!`u@7=vV?y@7J;S;E#lvQ?Ar>%ao zOX)rc794W?X64tUEk>y|m_aCxU#N>o!Xw7##(7dIZDuYn0+9DoafcrK_(IUSl$m`A zZF1;0D&2KMWxq{!JlB#Yo*~RCRR~RBkfBb1)-;J`)fjK%LQgUfj-6(iNb3|)(r4fB z-3-I@OH8NV#Rr1`+c=9-0s3A3&EDUg1gC3 zVVb)^B@WE;ePBj#Rg2m!twC+Fe#io0Tzv)b#xh64;e}usgfxu(SfDvcONCs$<@#J@ zQrOhaWLG+)32UCO&4%us+o5#=hq*l-RUMAc6kp~sY%|01#<|RDV=-c0(~U2iF;^~Z zEGyIGa;#2iBbNLww#a{)mO^_H26>4DzS zW3Ln9#3bY?&5y|}CNM1c33!u1X@E`O+UCM*7`0CQ9bK1=r%PTO%S(Xhn0jV&cY5!; zknWK#W@!pMK$6<7w)+&nQZwlnxpxV_loGvL47cDabBUjf{BtT=5h1f2O&`n<$C%+3 zm$_pHm|BCm`G@w&Db)?4fM_YHa%}k|QMMl^&R}^}qj!z-hSy7npCB+A1jrr|1}lLs zw#c+UwVNwxP{=c;rL2BGdx*7zEe1Bcd{@%1-n8y7D4tiWqfpUVh-lHmLXM^KZShOH z*xFp)8|Y+bM`|>mg}p~MOHeh4Ev0_oE?T1n|HMCuuhyf*JDmFP(@8+hi#f-8(!7>g zH}lOHg#Nw(x(LkB`Q;g)oVAM{fXLqlew~t2GU);6V}=6Hx<4O5T!!-c93s;NqxUDm zofsXe!Q%wAD~BBUQ3dIiCtR4WMh-t>ISH?ZMus*wja+&<^&&Gm-nBlDvNS4vFnsl^ ztNpIbyMcWMPfKMe=YnWeIVj|?e>nZbwm$=sV@Qj@A@PE#Gnjlk{CGPDsqFS_)9LEa zuKx7=Sa>|^MiSKB?)pG()OoM}_%lx|mMlX&!?+`^^4bT=yz=ZoxWH_ngA*jX*IZcHOjb62dT(qTvBPn`2AFuL0q` zG+T@693;<++Z2>R2bD`qi0y2-Zf>Ao)K0f&d2P zfP78gpA6dVzjNaH?(M_mDL)R0U=lEaBZvDI4%DXB?8uw7yMJ~gE#%4F`v`Nr+^}vY zNk!D`{o4;L#H`(&_&69MXgCe`BzoU+!tF?72v9Ywy}vJ>QpqhIh5d@V>0xHtnyvuH zkllrfsI^;%I{@6lUi{~rA_w0mAm940-d++CcVAe<%1_RMLrby@&kK~cJQDXKIiybT z-kqt-K3rNz|3HT@un%{nW0OI{_DTXa-Gt@ONBB`7yPzA#K+GBJn@t@$=}KtxV871R zdlK|BI%we#j)k%=s3KJX%`+e4L~_qWz2@P z#)_IbEn(N_Ea!@g!rjt?kw;wph2ziGM|CPAOSzd(_Cp~tpAPO_7R!r5msJ4J@6?@W zb7r0)y);{W17k3}ls4DaNKdRpv@#b#oh4zlV3U@E2TCET9y3LQs1&)-c6+olCeAYp zOdn^BGxjbJIUL0yuFK_Dqpq%@KGOvu(ZgtKw;O*bxSb1Yp#>D?c~ir9P;<3wS2!-P zMc%jlfyqGiZiTjBA(FcUQ9mq#D-cvB9?$ctRZ;8+0s}_I8~6!fM~(jD=psem4Ee>J zWw&CJ7z{P9{Q7Ubye9)gwd`}~OSe#Rf$+;U1GvliVlhuHCK9yJZ2>_y@94OzD`#Ze z9)jO->@7)Bx~CeDJqQK|0%Pfmg&-w7mHdq3hENhQ;IKK;+>|iFp;c?M^kE!kGY&!y zk0I0Fk*!r6F59pwb<6v2ioT*86d(Tee%E1tmlfVjA#rHqA%a~cH`ct#9wX$-o9erW zXJEEOOJ&dezJO$TrCEB2LVOPr4a1H9%k<&lGZo1LDHNDa_xlUqto!CGM^Y}cxJn@x ziOYwn=mHBj_FAw|vMAK^Oqb(dg4Q?7Umqwc#pL?^vpIVNpINMEiP4Ml+xGo3f$#n$ zSTA3aJ)pM~4OPF>OOXOH&EW^(@T%5hknDw^bLpH%?4DjNr1s9Q9(3+8zy87a{1<&7 zQ@0A|_nnege~*7+LF5%wzLWD`lXWotLU4Y&{0i|(kn5hdwj^9o@)((-j86#TKNN|Got?9j^EYE8XJ}!o>}=@hY~siOur_pZ`mJW+ zg}Q?7Q_~bhh6s%uqEU!cv`B=jEp1K|eld>}I`pHtYzif`aZCe88}u$J6??5!TjY7Z zi_PXV!PdeegMrv48ein(j_-BWXDa73W&U|uQY2%u#HZ5hI@4>q?YPsd?K$Vm;~XD| za8S@laz_>}&|R%BD&V-i4%Q6dPCyvF3vd@kU>rvB!x*5ubENu_D>JSGcAwBe1xXs> z#6>7f9RU7nBW^%VMe9x%V$+)28`I~HD=gM$1Sivq)mNV>xD~CileqbUCO{vWg4Rh# zor2~~5hCEN)_0u$!q<(|hY5H=>Bbu%&{4ZV_rD1<#JLjo7b^d16tZ8WIRSY-f>X{Z zrJFo^lCo+3AagC{EW4g= z#o?8?8vCfRVy)U15jF^~4Gl{&Ybt92qe)hZ^_X>`+9vgWKwyZiaxznCo|TfVh3jIi zcEf?H`U;iFaJh=3Gy2JXApN`o zE=O1Gg$YQt6|76IiMNF?q#SA1bPB@dw#H+-V@9gL>;1mg+Cb#k1ey8`dvR+(4ebj= zUV1Z)tKRo}YEh@TN=$v(;aR{{n8vk`w|nNuHuckt$h27 z8*aBefUxw1*r#xB#9egcpXEi_*UAJYXXk!L7j@ zEHre9TeA?cA^qC?JqR^Tr%MObx)3(nztwV-kCeU-pv~$-T<>1;$_fqD%D@B13@6nJvk$Tb z%oMcxY|wp&wv8pf7?>V>*_$XB&mflZG#J;cO4(H9<>)V(X0~FRrD50GSAr_n^}6UI=}MTD3{q9rAHBj;!)G9GGx;~wMc8S8e@_! z_A@g2tE?_kGw#r}Y07^+v*DjB7v08O#kihqtSjT)2uwHG1UbSIKEAO<7Nt3T;R`YCSSj z!e)qa4Y~g>{F>ed`oWGW>((#s$zQGbsS&sg}^pBd?yeAN05Roe8> zT5^XsnI??pY-edI9fQNz3&cr}&YORzr4;sw1u{|Ne1V}nxSb|%Xa_Xy5#TrcTBpS@ z368Ly!a8oDB$mv21-kqD9t&0#7+@mt50oW4*qGcwbx}EyQ=zv+>?xQUL*ja2`WGq` z)sWi!%{f{lG)P(lu6{68R~smEp!Jy9!#~65DQ1AHIc%r7doy*L!1L>x7gLJdR;hH_ zP$2dAdV+VY*^|&oN=|}3-FdyGooDOM-vAGCT@@JyuF4C(otz>?^9!lR%m-tde}ePe z)Jp)zydtP%C02mCPddGz5R9NYvrS6)Bv$~r@W&cP5lLp7-4NrEQDN3%6AmXH@Tdfj zZ+k^}6%>L=d8BK-pxgvV`ix>w6F;U0C zlZ#lnOYYDhj4r)_+s){%-OP5Z{)Xy~)T{p`w1d-Z`uhiyaHX5R=prRWzg^tr8b$NI z3YKgTUvnV)o{xug^1=F=B;=5i^p6ZQ3ES<#>@?2!i0763S{RDit@XiOrjHyVHS*O` z`z@(K2K8gwhd0$u@upveU3ryuDP~by=Xy(MYd_#3r)*XC z^9+R*>njXE-TIP1lci2Q!U>qTn(dh*x7Zxv8r{aX7H$;tD?d1a-PrZ_=K*c8e050Z zQPw-n`us6g%-5T&A%0G0Pakpyp2}L*esj#H#HB!%;_(n z?@GhGHsn-TmjhdE&(mGUnQ3irA0sJtKpZ!N{aFsHtyTb#dkl=dRF+oo-dwy<#wYi=wik;LC6p#Fm zMTEA@?rBOmn>eCuHR%C{!jx>b|+<6B-)Z%(=lG{@y_@8s2x4Hym6ckPdCB$7NZFp_|El()ANXTORs zO@b$@1`3tXjEm>;bX)%xTUC>T)r6eTFtq*Rp*_?%C+fEzT##kVNH` zV}-lw6&hY;cyl5#RR-w!&K4e)Nf4noLFyjiAbKvP7Y!=2lRiRjc$&d?P~!zM@4!?3-vyqs zhm*63jiRI7cfruv!o=zO%H2cQ#o64%*4YAJ=xp~No53pO?eEA$`fR4x=^|*#{u3bx z1YB3OT97ZU3=ol)l`K!lB?~Dj(p_i0)NN=fdgz(QBu>8xV*FGZUb7m4NEbrA+BJ1O z%CPI+T>JPq9zpg~<>QR+je>?{g)rSuWpyCDcc2@rE8T>oNWPiP*u zLZc3LaQVEsC6emsi7DCL0;U0BP!SwAkXuetI25TYuCwD8~Z|M@2_ z0FaBG|x zW)FZvkPsN^5(Q}whYFk-E8)zC(+hZMRe5VA6GZM!beBdDBqq#Rye$I~h@Kf8ae!Ay z*>8BsT)dYB${E3A^j5m_ks3*1_a^uA+^E{Gxcgw2`f7jw8=^DG391okclzQA zwB6_C;;k_7OnwT<<5RjXf#XxTO9}jrCP+Ina|?UA%gFvNJy7HFEx9r{(c&yDZ9e2aovtJL$um8u>s&1k@G6# z-s55RDvTcFYZji6x+UMyCu{&*d4N<{6;H^PEF!?X@SqMfGFR}LYImL1;U}{iT!qnA zgqLCyvSp>>nS}|sv56Dnwxdo&HrZG1WQL_EkC!D6j)JW4Tv1yyqe&aM- zHXlKm;srQVctoDYl&e}E-P8h#PCQNW{Dg*Te>(zP#h*8faKJ!x-}2Rd)+>ssE`OS? zH{q>EEfl3rrD`3e_VOu!qFXm7TC9*Ni&^{$S76?jtB;*1+&lyEq_j{|Nhg&s;W6R9 zB#r9L#a7UU(Vnq#7asUx%ZyVz{CiVL5!CBl-7p|Kl&=g>)8e?z&u?Q^r>L@P zcB6n=#5Wz+@-j`qSB=wD1p_n<(NhAp8wa!IxDP?M&_ zKNcJonwpOS>a3-OBC9jGV@*WND}F8~E_QS7+H3ZK6w&kq>B}kc123ypkAfx`&en&T z+?U=!q?N5DDkt(2$KU;t^dR}IVC|M)pn@S)m{saxD4V?TZZWh@hK|C|n(P&eXLAq1 zZ#v0gPhHJYiyjEkJT~&%u@zLE`Lm!p!&-VAfk?eF{HN%PeV5S87-u3n;g}^R(OZqI zA|##x9SAAKAb!FSr9+E^(}_HX+lb+XLQiWF2UmH*7tM?y7R{u3(Vr<5h8V>Y-c`SgYgD9RvV*ZP{xBLuk-5sAcGP5G zDdk)Ua8PaYS-R*C(V(}4>%>{X%~yk{l3&El7iOz}m0Y8MAl_Qc`-2(z2T3kJ4L1Ek zW&^0C5lA$XL5oFZ0#iRevGn2ZyiotWRIag?#IT-E$gv92YXfp3P1BJxO zShcix4$;b#UM2o=3x#3;cA8Q#>eO8bAQ6o|-tw;9#7`gGIFVll^%!T5&!M|F|99EZ z?=t(Tag~g}`Wep_VX!|sgf_=8n|trl((YTM-kWDQ1U@WIg!~YjGqsZNOrayhav_lrw< zgSle+;b;p^Ff)tDt~?&TweI#6(}<3?Uw1@|4MvG2w}sQgX*N;Q=eD+(bJ%jKJ9L2o z3%MlC9=i-DKzXOun`;&7ZI$Iw?Y|j!RhIn*O`mRl2_vUnE*Rf6$?{IC&#;ZS4_)ww zZ${m6i^cVHNiw5#0MSjEF!NaQfSr&DbTX&tHM{Ke)6Pt9^4_Jf%G&51@IH0aA7QRc zPHND$ytZTZ7-07AEv8Rn%5+<=Bx1tWJSG_?CqXuJ99Zwp=hP2?0a{F)A8HLWkv z)nWbhcgRVdtQ4DpZiw6*)QeCWDXGN6@7m@}SN?Ai*4{l!jL`wrp_lL`bJF6HVAOnj zNa*fTj+{niV5~*O zN5NwHHcEed1knV2GNSZ~H6A+13`U_yY?Dlr@mtyq*Eutin@fLqITcw+{ zgfCsGo5WmpCuv^;uTtgub$oSUezlUgy1KkqBTfdC=XJ}^QYY+iHNnhYEU)j7Oq^M^ zVSeY5OiE#eElD6|4Haq&dOHw4)&QX=k_Ut{?Uvr21pd&diJ zB2+roNX!_7mJ$9n7GNdG8v{=K#ifQnT&%`l82sR{h&TKf?oxK%8RlG}Ia$WP=oQ3C z8x#$S3Rrheyw7recyTpSGf`^->QMX@9dPE# z?9u`K#Vk!hl`$zv<^Wl(#=J4ewGvm4>kxbr*k(>JDRyr_k#52zWRbBBxSsQfy=+DkvQ40v`jh_1C>g+G@4HuqNae&XeekQeAwk+&jN88l@etjc2U0(3m{pQ8vycb^=k>?R~DSv8<0tRfmLp27RlxR~V8j?ClC z)_B-Ne*s0#m}G~_QwykU<`~vMvpTlr7=W&w=#4eEKq!$muL_QJblmEh6*MUg!$z4fC{DBd*3h=N|lf1X7dTfqL1v6~_al z%J+WD;fSJ>TKV*mid$G+8eIjdfK%pu!#kkan;Qi>LK<0bn$?ecFn-b|@+^+OT=0nl zZzN%OUn9w14s`D45>E^)F8?Z?;l!%DF^oL|Yt!@m^V@3twFD@^D5$*5^c%)sM*sbi zk(RQq-d<^O7T8RfFwEK9_us2+S$&W1-Z3OR+XF6$eJl7IgHM~N8sHzWeuzxpB% zE9h3~^*;?_y)7i>a4#z6(ZQ%RaIo)|BtphTOyY@sM+vd#MYN11?ZV(xUvXb&MFg6g z=p`JrH(5;XsW4xVbiJ?|`nutpC1h*K1p~zS%9GcwUz0UWv0GXKX{69Mbhpcsxie0^ zGqgqzpqFAefIt5 zbjNv;*RSO}%{l!Z)c-Qw`A_=i-}4-?=swGSMI^E7)y37u+#O1^yiI2ehK4F|VMVkK z!hIFgJ+Ixg^6jI3#G8UbMwE1a!y~wFx@T(|6G*f($Q=e5na9eDt?f6v;SI;w0g-j% z!J#+aN|M&6l+$5a()!Cs22!+qIEIPkl)zxaaqx#rxQ_>N-kau^^0U$_bj`Aj28>km zI4^hUZb4$c;z)GTY)9y!5eJ{HNqSO{kJDcTYt-+y5;5RiVE9 z-rfg@X78JdxPkxzqWM?WOW8U(8(Lfc7xz`AqOH6jg!Y-7TpXRJ!mtM~T)9C^L}gSL z;YSLGDG_JZayritQkYm6_9cy96BXEf5-2!+OGf|OA7sdZg?o)Z<$B#|?fq|82c!WU zA|T92NDMBJCWHwuFa{aCfTqmu)kwClHDDbMnUQhx07}$x&ef5J(Vmp?fxerb?&J3W zEcoupee$`(0-Aipdr2XA7n`Vp9X;@`bGTh>URo?1%p&sSNNw!h%G)TZ^kT8~og*H% z!X8H2flq&|Mvn=U>8LSX_1WeQi24JnteP@|j;(g*B2HR-L-*$Ubi+J1heSK4&4lJ| zV!1rQLp=f2`FKko6Wb9aaD_i=<=1h?02JU2)?Ey_SS%6EQ>I20QL=(nW-P4=5mvTJ z&kgssLD)l`rHDCI`%vQMOV-yUxHQyhojHdYC*$H1=nrJKqFo93>xvB=M`$}Roksx# zRgV+d8#sk=v+tN#P-n?dx%RC(iv;9-YS-7PrZu#xJ5%k4i*8joRv1J`M_tOQR`{eV zE~<8%VC63sx|_U&{Bpy&?!~^Ce+CNv^T)?diyKrA zu^d&el}PFVWKFz9wkriy~eruRakPmmS0ZsKRiEMGj!_V`HL0FT$ zQU#r2x}sc&kxyY}K}1C{S`{Vdq_TYD4*4zgkU_ShWmQwGl2*ks*=_2Y*s%9QE)5EL zjq8+CA~jxHywIXd=tyIho1XBio%O)2-sMmqnmR&ZQWWD*!GB&UKv6%Ta=zRBv&eyf z{;f~`|5~B_&z17;pNS$3XoIA~G@mWw1YgrTRH95$f&qLKq5wY@A`UX)0I9GbBoHcu zF+!}=i8N>_J}axHrlmb)A1>vwib%T;N(z z!qkz-mizPTt^2F1``LZ#Is;SC`!6@p@t72+xBF5s!+V#&XJ54bJ|~2p(;ngG3+4NA zG?$Orjti%b`%<{?^7HlMZ3wR29z7?;KBDbAvK`kgqx4(N-xp5MuWJ1**FC|9j~trE zo`+jX&aFP*4hP;(>mA>X7yZujK`$QP9w?a`f9cQJaAA2cdE{Tm@v?W3gT&w=XzhbY zCDpADyRHQ?5fOuf*DrAnVn6BjADR2&!sV&wX1+TC*Qk}9xt8KA7}6LBN-_;c;r`H= zwL1uGsU0;W?OEez?W5HYvu>6SR+O8l#ZM+X@T3>y9G^L76W?!YFcytB^-`NyTDB=; zw421!sr`Wwopu>VDWNN>IN&RxE08d0JJZigpK%)p|Ep&aHWO`AFP)}VkqQg1S#TY> z(W)bm7duX(Nvry|l%sGs+Eudz3=_A0i@M47VtBp1RTz_zxlmqgi53tT!_i)(bad*R zt<1n~oT!|>QLmYf?YL$n8QEJ2A6liMI!hRY#mB@?9sWAUW8! z3#M&1`ZQmRP*o`jtHjbA78}!&iq6v&rlp|5&!}O}NT>|10NoWbiq5@7lhquTSHBCO z2a!-M+(e10feoq(nVw~!ZC;y+4M=F0%n)oHB7{BRYdVpeTN zryeS3Ecv^OC_2HcYbRWnOSY2McCa2PfRXH~!iu|fA^#y<&eJkS1^d|DM3)QKAnMe1 zp%9s~@jq$zOV8LQ$SoOZGMPYE@s<@m$#S(N##mh{yFb!URLo?VmR4c2D<_vio;v$u zEJivu^J$RML#dZFhO#!?D8s-JTIP{sV5EqzlSRH3SEW;p+f8?qW%}bdYNyDgxQcQg z)s4r6KHcPGxO_ErHr?P}mfM;FZE)8_I3? zDjMJvQui}|DLHJ=GXcz4%f~W;nZtC{WKitP66ONo4K<7TO!t?TYs_icsROOjf=!bP z#iDYw8Xa2L$P!_IMS+YdG$s?Gh(pybF}++ekEr=v(g97IC8z28gdGEK?6QPNA@g_H znGEeNG!5O#5gfi{IY+V>Q!Z=}bTeH|H2IGYcgh~!jjG`b~gGo!$<2(Kis_p5;(P-s_l8JWL!*jOOFW7(UIXj)5^C~7r z>g7M$hT|sIVBpur@M~;gi~j(BNMp8UkYv?y&{`-sK=@)-@S(2kqobO@Wt_pSnMh|eW*8azy%8exS@DAQxn9~G zE=4(L_gg-jHh5LtdXPgG=|7Xcq4E&x?X2G2ma(6{%4i1k?yUE4(M*Qk6_ z1vv$_*9q$Ow(QAvO;Y5T^gBQ8XX5ULw$iW6S>Q`+1H*Qj+COZ<4PxD-Fwh71j0cBx zz1pnDR}STs5k`ekB^)M`Iu39H@BwM@^8_X7VVp@epjNMqRjF($LBH!#dnEe)By}7T z7*XbIUY>#irgB@|lb)RRvHN^cPT%6slXqX1FW;4YMtNurd;?3g>rm zCSyAc0+aO+x0NojMi`4bp59%=g=zuk4R4o~hTUxxaj-YA z@UtFr6OY{A=_+?qZnrqBO49}q~-hZ!+0QZzD)8F6c7AMQ8Edl-y|d#R;NOh4ukOeId((#ChBKo`M=8Z@5!BZsX7A3n)%+;0Dy*bI-#fNe6_VV1{v%_*=I&54mqAWAg z3XmVyRkbAG&>7rIx23lx*caz7vL$Tha&FcrqTEUNZXhFsibRbc*L@H$q*&{Bx?^60 zRY;2!ODe~pKwKFrQ{(`51;0#9$tKAkXx7c-OI>j-bmJb*`eqq_;q-_i>B=}Mn^h`z za=K-$4B2-GE(-X{u|gHZ+)8*(@CW35iUra3LHje(qEJao_&fXoo%kNF}#{ zYeCndcH;)cUYsmcLrAwQySyF2t+dUrBDL;uWF|wuX8S|lr+Kg8>%G?Kuzxf;L!gZoxAqhd;`!i$5wZfphJ-c zd|uR@Q=cF4N1HXz1y}KjQJ8{7#aqNM_|j!oz6@&wEfq)8)wG4ngiGocMk=1Ft54#R zLyJe(u>P{fm>k_wUn20W9BZ#%fN9ZePCU*5DGK$uQ{GP3{oE1Qd^}1uSrdHw<-AM% znk>YZOU^R94BahzlbdB994?8{%lZ*NSZ4J+IKP3;K9;B))u#S>TRHMqa-y}{@z#V5wvOmV6zw~pafq=5ncOsU z`b-zkO|3C@lwd3SiQZeinzVP4uu+V>2-LKKA)WQXBXPb#G9E8UQ%5@sBgZtYwKzkq zNI6FloMR!lx7fV|WjJ*b`&y_UK9mPl*` z;XO8P%7{H*K=GrNF#+K3At?5`_oXT|Vz!Rh_05t2S&yd`A2 zjcyVJB|#czi?o<&biP<}0alxnpPLzJ9d#_R9(c$2IPXg7=4mL{7WoN>JTCCZ%zV{) zm691r%m?d5yR3l=Qxn7|f0?e7@ zk^9ia@dNTbyi6%GO;kec5sHCjtyr*i1QSY;G}gTsivUQRTG(i)y`O_~K{I*S+x=>M z;}<><>$k8!-=R}>b#)kmSE&~qf+xi@lJazu^F@~pV>MQ3ISq0)qH;F^;_yT@vc-Pr z390Cb$Zq{edB^7W@Mz_+gQ$>@*@>hJIjn4*`B@N%Lt_t1J1wT!aN`jpEBE5;Z|_X| zT^67k%@CVrtYeC}n;uLV%ZSClL-hu4Q5t8ke5a8BZ`=p#4yh?Xa^Q~OrJm_6aD?yj z!Od*^0L5!;q95XIh28eUbyJRpma5tq`0ds9GcX^qcBuCk#1-M-PcC@xgaV`dTbrNS$rEmz&;`STTF>1pK8< z7ykUcQ^6tZ?Yk3DVGovmRU?@pWL#e2L7cLSeBrZc$+IyWiBmoex!W#F#PlFAMT00niUZfkGz z0o{&eGEc{wC^aE3-eC$<2|Ini!y;&5zPE>9MO-I7kOD#cLp<3a%Juu2?88km=iL=? zg)Nm=ku7YEsu57C#BvklPYQ>o_{4C>a9C*0Px#k2ZkQ)j3FI#lIW3mT#f*2!gL4$_ zZDI76!tIw5o=j7Opkr~D0loH62&g?CHDg;Lp^HZ;W7)N+=s>^NuhmsYC?}lxS;sOE z69`R?BLA*%2m_L7BSZ^X5BKaWF-Y?b-HqGLcTd9NU7vY8k|j{O`cOrwxB2WW@tmhU zt`FA4?YCJwFISu42CLh~%e8Qg093rgqDa!ASGd!qoQ1e+yhXD=@Q7u0*^ddk+;D{) zKG0?!-U>8p8=*&(bw!x;E{EjWUUQyY3zVB2V}@t$lg*Bn3FId6V_Ez&aJ%8kzKZg$ zVwL+>zsp;_`X|m4RRvc|Wtejy* z?bG~}+B%y$b6zBRba$P?mX#UbwE{i{@jbuL@tZ6Rn;SCu#2M*$dpQIn$Hqv`MgjBn zURSnq5+1ReLXsI#*A8G1&h5`YFo^I17Y=&&1eQDtwY8HI3#DdGWslPJSP1` z1D()O()qzD6U~BYRUPw6gfc4Wx!am$yM#i~5MCmF8=7(q7;n3?L@7uuvn$;8B8wk8 z3>T-EJ5X9Z3@yH;L=9QFtWmzdE_;Kw^v+te+u`pF zN4&*o>iRKeC&l_{U^a`eymoog3(GY&2h;5vMyRyld37+7bW+&7tvIfrL9TpA@{Z

dy!05UMhSKsK zV1FiJ5SlAhkpcl_H0wRzql?0Qp5wz72o2cMC@utM(|&o0ZO_JpXr+N7l~F?Ef_02md^m|Ly|(EN; z%;)3t6SWt{5hgzszZWS1v^AU?`~Rctor7%qx@EySW!tuG+qP}nwr$(CZQHi1PTA*F z*Vo_ezW4q*-hHnl_8%)^$Bx*s=9+Vi%$1qr5fK%c+Hm4kiE$B;kgV)wam25w$Y7#k5$> zyB^6k3i~L_6~PX554`c3Lxx;&_sT;I^U92G@fS6#(Xv!B%;H3+{e)1R6lyU)8AK1_ z?@>F5H=sXG=ep;kDRZO_ofS}`Jus*Qp3`_V4v~&b-RQ=t8AN5H5{@!_Il~0 zZd!-aH=h)(7CJ&tL%%{P{6d_g=5tsj%S3Z!QxjrLdjoKmNP-zSjdJ!?qL(UMq38ps zjKSz5gzwhDFA;5md5yYb>QN)U_@8Xpjl4yw5065)+#MSGp;yQ*{%mt>12;$~R{eVV>o|juO{Z^ z^o^m@DOBrE2mm1nLgBfA(Wi=X9R%(1UYZcZJ!3;*bR^smI~6lyn`O4BOwo-STsQcyodVA~leg9`{=l(qDl@DCM>s+w`%S_q*PIjYP ziuHHuj0VVW1%+TH*lx9#-$^q&l)G_ojju-w{# zVs{oOc>_fcS51xY+19tN`;V~R0wVyuxdkS|t zC}~Gtu-UyA{H5~6*ocUWM)RfQ076mL1r zFVWV%zx!_*zk`5&dFbdq4nbWxIwAu=`+$V-`m<*-Z*mE2X|>OCAJVV;wlq0E$hVe@&x7V(!xg1*;%`} zxxBu5;jmZEH*e!Rj=Mz|udBR8BR6LiGoLWb<1=<14it;Fuk$6=7YCR&;F+%r`{S6M zP92W>ECy`pZR$Q<6n8Zw1|uh*M=zK=QP0b38_aX#$gB^y>EahIiUzy^MP1ct%UhZX z>FFLVJ=H`FRSq!<_DtWyjLZ6t^Nf|?<69Aj$U0*lrAJG0{t;t8Y^SKLacoR%3EXw+ zDi5T^PkjmJp7@B|$lkEwHHaQ7BGc$})@qNRqk4JH!(bgPM!{Mb&Kz|UGk?QskODW5-NCJ3`Fbks<}%TsOB+e{Hn1i7BP z(XsKkfl`r0N)u1VqaPYGlDxR3>%y{&vYaQCnX8AAv8h8>a^4<#jAhtfa;TdoFlN=?Ac{@Cdxj{YI z!kxobbr?~GU8JKwH2Ywa(#i=Rzof$nu?4-zlN#QJflTO^QkyarxNI<~MY1}jy~Jz` zBRwV&0+G01D9biQ4PR*1NiSqTXZB~NdI6yVEU|AiWJYA>k9G=*`R^VFjr{jhqZ$&G za0#huq)Mhb&8oR!jrv%;xRe@b&PWBXh7ATurhUY7yobngzP;($8b5g z9U{5JMt%fMp(N6ZVGsYa2p(#ry;Y&;GG(DG((_GrS%r&waWuX94*RX8>&x|Lzv8WCaXaWo(3FK=U@G#S$8kCX_R6q|VO;WbeXk~x zmq?NS+S2WfO|{j{dKy5``SRA!r+%)`DCW{s?8uZJW{-4%x}KJzAtiyY6b#)!fe0kA z)=W5C>X6ZLRFH_-$)Z(B8Hr}FD#FLGum2gRluDsrJHf$do$r!ORQqrI6~=-H0vPiG zC2V88MIp?Xhc&UnIS(c)naRXTu-r!%x0J;3uWjp5K%!b_v$;;T0*{_2txs!*+BgP} z%eY2;N7AFz(g@fFy&(hWk`R9#fRZ&X598A7xjHyoDJ4!3CK{Grr4>0bTBw3ps{tN7KqVY^)~B5St2NQS9wH_Lc=s8$1H5J?52_$nh z+rnm{F~bVIsiCZ^Gy&eV*X9JTJZB^`|6F$9|Fq@ekZKP~h_BWGsow^hUpo~MCTrdk^1B;= zNXiYAZnUPm>}{vX*&Yb&{0FNvW!V)h-<{na1yT-|kAkG7xU7QA-NAc|e4Nf2`OWnV zxbr6@^wO^6xW+Xdu=Z{sdK+Qw3Dii+X&Y(VdCv>CFEIOt?MCM?9@CDUKm7+N>%!q z$WI;(L@2YJ&Qfwr7k@<77r}%_q3O8c#><<+(JFdeT2?e+nsP4h+`n(HuX8^8qLN88 zv^9`|ICnNwS^PYDf7ebCGG~QNosD6-%$5;6Yx$`PGlZVnxs6ntftJW^L?iy3KIBDW&1q;{OspV)`a4w`+K45XmW5g6HLPL(lu zM^>HAPux}=ZJ?|;f=zDh!2|)WLyu7pHcc)9vAr(R_-sI`3GRfExjVpYMgql~xox)Q z)W3=WFT93oMdC)bluYO{cphI8Hjl&)W$TKN(PAk2r&mB9-)@%@xbewYx!c z{}phewJ939{qT;q&KR_!>>XnVYPC^kRaX%+G_v;*kg4g0jdi&G2G5$4#bk+*0mK8` zie_>y1oDA_0hGE(n`I(s0k(P&;*KDaX278vofbbNMZ-&1MCmPD*6d6oN$VjMzpTd@C8e zg81s83_+Y#T;duYQ%tXE$RWVk=@P5Z1VY<1C?mU)7?G9IHYx#rHCx1Mhb!ajXBoJ-rANULXqSAu0Mn9s%@_;uy-AOG|5#jDZ3j5dR7|< zR_{f>x5E@uRa$=rDD-yel$t(bf5=#v9ZWObAu%fou?4KkV-kvjmRiGX7iDe(Q)_^=>m}`2$#Xi#5CpJTi#5EF1T1mmPB}c@A6ou~a`>sHSeM4gF(ksh|DObX#Ao1r$Jp3I3 z-#zhd+d&)DO54E0K@@kKgxRB5%x&3BZ$OrawIi6~b_kN~$5G(kH6b5BD&%g70UWu6 z-ub`EccvhA2YleM%U@;V)N{Ixrkd0bjN}m=kn%!g%wE&P@WcBs>5NJ~t}y$Ar7F1n_=iC*<|&`C=qG#+ z0|)?s_kRK(@&?Z40!~gQHirKa2ua%+8CVNj{J7LD3|*Wp?EV9bZ1_j%PH`5U;9>aTZzwPD=a zXur{4zSk&)HrOFOmSK8ZKMHdg*HQk|a($OZ(0puje1K8EZNjPavWjhh64i-B(p7Zf z2g`IQ_W)I`lGa!LCabrDUSVPmGZbVX*#xhnAH|koEn~hs`=w;zVM^IEU${9oXf4C9 zk#|zrR`2_TI+u08MszOoi%H;viD}|x@Ax-{F_aW3ZIQHw-pT;hgNi%weuhcB7xt*kubK4fep+r)eaJIl%p9|sqv{M(E4lgwXe=HL2nYvO$$HX>QpPxqUn}WG zs*l{rztHOO@k5#cP%_alezmlZW9HCcT_;auQpbtV(Kh6e(9wF`C;OM(L&uqUaFglN zk@mRfKGV716J9j|zU-6W(m9pmEF&sbiZMv*M3~8lC~<@%sH8mKCL5zS4h--)TNbi$ zGT~m~}sa$tL(& zG_GBAe(+OZUY}-iY-rcb4f^fNZt_IXS52F^MC6>C?-IuOUttpxwVQBy0~D@|I1g*pQ^8D9@mu?5(kge3_GjbOm2G+7-z zkx`X#L5jF0+(b=RSgOE*XGFk$mF562Yft^UFH0micC5KNH~tfuDq*ce5Q~fKPyieC z9su^F5Df-F2X&FrZ1?<8uQ5h`uh~m z=&m+g_sL;h^%^JcRk%COiklbyo`Co8z9C%hj$&e+^pKMm>7Jt({+@)$DJbC`QjMHZ zi%3X-hLW4Gca)8|Pf3A1t4Ud8Gcj`ZNDE=lz<+3#C9z0jMR_q934+6jFXzJ$uCq~+ za-#O3p1hSU;tiKizC8=Mh@y(Ne3L{f0B?%ewopC*gCiXqueXVpGg9HaGK>hK#}F8++%^d7M6b=5@V(e#PAgrUnD^4)b1JPZ-PGNWqckW?kadj9w8b7f zp6l)!4JIwHtcBOekEW-B`yJ(E6n$+g06FFIjgZzz&+`UpKdgY-=lxNe1BI|=Cg;T; z?FYQs{*)^&tV>xbx0m~jf7l5>`+q#>!*0u^UJNZmE(3w>j|yNHB$#6zkjE;_0pL0S ze2gb)=zGHVUt5ge;3k7XmZcc5;mh=#z-ZobkM!xX0De$bw@9s|&m~zN9 z!K5tX5=4qA2sK|$bdVMz5etUdXN!`}2PL8R7qLr)Si} z!IONdCg$e~UlJ3u{n50K+;kj7SP&tC(^xDUbl{fdvL#ilA93{7Vm|&0)1p+nx=!XmT2qv6B?FjPHZV*SamC-ro9lXMAbWtsPx?Xq1Kcc_^$@r-YuI4|#Q?})HOyhMfBUVTIsc4Su?*`>kGqVs(0tbI_r0@mbv4tR&NZCQd@%?W!R_Br)qtk^~)!$ zd{bZ$2k_tV&)c$dz%vTer6*=naysJcAnpE2vboBzhwzL3ZZg^xE_1)_2eUw2B&FcL zW(!+zg@=0oy{=sCi##j;)Rn!Ty7I5A;QytP@}FjBaRXc9p9bUK6(&VZ!%ayA`L8Y0 zHgiu1Y%~0(WC8`wPF)OYDg?-xhpK#kN37I*3t$V> zeFT`E`_n>;_dQuVYN1PBmZ_}9TfEcl#^=`Abh1!Ek&ykSp^2 zUtg|J2l-(Fu4-@Z^fZW1~i@QYwP9Q9$d-lN6U6i%K#778wN;pE7`?CIfN* z4j%4F^H^LF6Q70%gi@GEB7#Kar{F)1=Hjc!yt?q2&-sWb^&Mo@Ali3 zYsI8ugwjs$rA3@sca{d2=a5mZ6PM=U7R~l1{udpZzpk<&^i)W$IV*$FUzyJ>#@G4l zunDZP3O}4G8=e2)DEXo;q|ooRSY*pQ@?dPnSA%LBmzMuh zj6iCX{hWsksbMQPykb&WEA^2^)4$ly11z>xG12rAj}?8Ft!(tswaOoNlpt=|kqrTJ z&?vxxBG>4bNn(%_w*|gVh^|*LD_=TzvKLX^EG3#)_JHhIOGSwPo4|0o#`B(-!+g_f zebxHKe=60kQz4i3=g8Q=o!~GyJjpp(m|JFSl$~J?ocx92m&&RUW=F?w)i?X8sjbbg z0+7xvpM&&Mvk2s6TEQh%-l$+wW+-wwx(yPsAW>CS<4@5r)9$_e^l&p0?yxh8t`Ni| zvkg20%R$9KD0hWHDff&(!UL3EXA@7RAORZg2_v!tmF`q!lSi%o$>srm>6H|S)B^2X ztV|vT66Q&WzEYv3LCrtL@fFVn_1u!3AIwvi9c5g^-LY)$kEOwFcdT%;T!@=Lh3b{K zJ5DKC5TfipAQ;Xelrj5>A z=_T7N`9+b0vmdY_zM3SwtpmRY?wNX&N^VG?5}z__+A;qz)l|ZX+QaujvNXdiXZ(V? z{OmPo1P@Yd;$G3ic^NHAm|1j%cIXFahDM~236V%gF?}nu9!H?ApHB?XA?IZs*m$xN z6e^ufgCQ0+_=81#=-f_IGbvy4Xizg)_Q^<)baO)G5(DO zgxn}JpKET9(UqMupTD8jB3cp z4G`IGH%ByG7iZ-QD?Esze`e049rA`qU8-l!$qPyeHl#z_q%CNdv(L)XI;?Ng4p}qk zjkLr}p4PA1I;7{Kc1WJp_Y!Q55JqK#sB5nY)=dehb&d)~g=roafxSw>Sbm)`xVXcf zG#`10jAW<8I#Nd!Q<)M`*0YE;dZ$(eKex&V5$dNnGAi-clRskp_SX#aKy?8;Y^RA; z@xEcdlr!iVGK@89*}AMBb@T}NL#V3*a00ErFr0GKMbDa2oQ-DkTV{N0Y_X9!nY1oWN1B)$PK)1Hfas5LPvtlH8ZL@g6sQ;=~> z=vTK;Y5TAt=ya36;hG?pES_n__RRVv!qlpCcy$N%vN$cm%p@=41Lzl*;2C>KsLXaT zT7L{$DZI@k7u*!SE|y2=Df|?99>gyrLB^ur~Y)vi9TpSJl6Z57d+o)lQAdh`R5kMGB7)eE`*Q;2G zQEcRN!Q?$b+o zUoag8iRTMmKuJ)5s&zS~S*B1~zU7tUT|q&h!EInBeZf#vwR|05>zpU0zRe0VWg5C; z+*3eGa6)oAS)jk-xN&bD5&{yx=Oh{=T<=akX4F4Yue*V0VM zkH4;7TLKmx%@)s6c5z_Q&5qaRX;$2vIP-ud)H84PAd0uJX*ee_AkeYKVtI6CW@W(9 z8KHRBux28|zpfOJu7mRVm*s z%?_&|3rLG%MZsk-XuimeAl!(zkxHX`$uQhJ=7%bztEXtmw!ImA{G>b$_T&F%g zFsQ^s?i59_UX8n_!c>ZltM6ABcMHOtRyrRBB3#Yo+AYyiYjPIXgd#0RF$%&xX*?+- zsPtBuy)cPjVkYkf31o50Tp3zUe-dekc|5FYz`%%l5L^>Pje2fT{!AGEHxWG_Yi|{!_@x>cc6%5SD z$ZvA==C5j@X;L3MCV!XA?SG9M0(T#83W28(9aS(t{d&siNAR`PZa(ke>q+Bbo82ut zvU5xmnR~F1ffCpw7|Fg1Gx@$)QGYDzf$|nfH3sKP3=Huhz#4)dH-ay~7cR-ML4hxY zJC3AyNh<#3hBqDyFFY{D#*eE*cnh{slzoT{|2On)ATR!sO#t-^ABA9?$(s~V<1UDq zyo>|Hc*Nrxk#`IYFkXaDTnoHWAP3E#`a^&-`SJ1RcPRHkeTbBZ&q3G_0==kIKNsi8 zPK+SND@w;5@(Jm9!|;LDkth-G0@RZYW&YJ3k={qg)_?xtrkih&RnY!V zo$Y^|7$WW_MlSzvW>1PbggdqghA-L1jCJc$kjxUIfuHEPj zLAS_=)=>DNjluF!EIspf<>8IN^gzw?ak~<)+k{ykeXo%GE=68f$Z;ZaxUAiN%zGF_5d-JZ0I9JZ*6=&gi*5l3i_WA7VrU|K{v|a zF=S?&Yw?$7*XrNDug-5bH}qO#ji37gcoNsG74BAO>OHL zJ+$W5wVs^^UjrNk2QiwyJ(aXP&FiHZNvXoDgPCs;lE0r3q^E zb1QZFSr@``4tbojlnOSCOUjP5QW*?2!?w1>p3YwB&Mp*GO3M*qgz>{jv{ak$b7(E?tkY*+R+^&>> z2dO%o%W=L!QGyw(WuAnw#oO{!I(8KwC|wq_y)<9lMxDiZwL#OlUU_DnD8&!tX&a7f zewQGgB8{dwkjR8EC%AP&bY^iirN#jA47*}#6?~g6@a?%^7(){yv(mgF=P`2yXr$Ab zuYEY=Rw^DeYTFZ^Ywa=6!`PU?q?O*FI=gFl`bbPev2k8T+=C;_X>sLJQt7BpOATpg zrpfyxa?;Uc`KUT2B@@q5dI0rCDDr{Q8d~En$h%e_rtAvjTEMd-OH%Qc7)o~}(R!O` z(i0MG6N^6LsC174qc^gK-0ayYDy1n5!q9mg_|@<( zH^wGhrdBV;Qzf}LA3=l3S|l{2(ylqgc3&K7pj~tzGSA`-wO86b&05pv_SO)Zw_hfmjx}wah`^|Qo(J(X2h!rc zPxx05-j4zshLMr@l7%0`IwPtjmgCwA{Sxj^m0H$vopZOcn-(l18gE{v?!K>bbY!=G2sL;OsI!wlS zl`om0y?Z#6@8vtXFRh`e5wNSy>T)H41%)Nt*jt9t?c#B>nBknI{Kbhq*5+Q8Lxe_H!J*!N? zH;Gr-bx%ExZEmt^9#)xcGN#!|?Xz6|l^~v7U7wM4&5cAIxbMj53pOBXW2LxqE#=+s zUC(EG;8)Odp&Rd)Qg_wrCnDExg_o7dmilm!?}lv0f5NK>w#Db7WRQa5Z94pw011GV zyHnjESKowJ&H%GT#al{iWgq|S`7S)99~4MXM?gl`=`rD9WWj$*)*NbWq$x&Jdq^ z(Q<+*Sx9NqE8$^Fqc(bfoIHwRM8##C@jW61>q;vG-*gk8G>_$;P+4b&%lQGl^XQpt z@48~+y!wp4mqN@Q?HOZ!Yr_;kT-E1R!Dz4OldNG)t;&2^&}q?~dMa&r60E7E)}#>< zrV*SWbim~#un~*J_!+nsWF_-x*9gTk>Hl>g2f7!ZQCMExX9omA0+-Fd%?Ek`^u5Av zTse2a$3`W_+4p=xIbdWKo>d*OlH=zIocE<>kNpS;Lx`OQ&-Q1P$CASxn1-0~RGYd=l#b>XT!xg+7u%F$Q7jSakj)eTa>Ty2qji4Eb4HFzvHy#qP|SXp zeb#Lbt?Nt*I~QuZr{s3Gk%GGcNPV5a16K0EjBCtb^pLdk4E5uLHP+1tY@v3z5hntx9$Vv0Tj2xkovNOuQz_TE%+7VTio)we=x|p6Zw6woNPx zcG_Z2O%BbGxfe9ld2ol=fLGR4aFV*%y*3D#mSjOJI|7z5B4+&ACSoxT&RK_fuBkxk z1Z{D-MxPSpq+f$DN!oyle^-|TkMi;fqFJ1UGd5NFA{AM^B_NurnPV??jj4yDq`QF! zXQ%rlV=SedtGKM5GccN+LZ_zY*nRh^QhVnOGA2jgF~DjqY%>eUXu}5pt)p9N9V|0Q zXC@$-8kj_9y)dSR&f2Q-S$t*V60-4m5IfeHAp)(*?%V*RU3YRI+fVm;XbrN;Znfre zHV>~Kt<08qOPU*d|3s=CmW8uaSX^bMnclwZa0*-JYD_xdlH-9QSVqCTFRD6%n}VS4 zy>uY+r9H8?BwSa;PMf%#`x7lDq2Ra&?)MJ=q&X-Vdw3kLg=AF;bh`Ngu`{SU0AP{2FA1bXzI)&Qc+N zQe2V^EkBDVUja~}gLyF(bfSN%OWm}6u4HUH3r`v7TIiEzS4!DYc1O$+O(bDf_b(zmfoP2*iYBPA-5lKMee z{!TLNugW*re`hye;8u`de34Z~ks!!LT7(P~?WfwY)j%M(rRlsVfY75wv`_j8-f<~Zh@@_No5u3lgB08$gw3J7t6YYm|-P>#mI z?Ihgih8w9<&jhN0?+L@xpaZf^v}|(+(B!Te$gx^{k_-y^@xZ8pvz4Teo8$&XcRy}gCz)E#b#7b-MxVm-OaCXYoKRhcAIJfQDELSMoUPZ2A zGJT9WYcGs3O6S~oE52|3o?hBGjTo}Z^#p~Y8HA5Pg?)uzq1dK9(?}wqZwRa130=%H zYf~z=E0yYqfTG0fyWBEMhY>h2^w4T@H3nLOIgGoExay2GP9=7H+(sF!>QtGs1-g&W z_gbac+_K^zlCn7G0blgrvHCKoOxX2B-RbMlZrJ;wg{CYdkQ}uH=vCz{^XL9b5MT@I1LRLBCN2G_*J_s4ZGh zWx7MbR#kfA8X5^2SsOa1ssX$FKr+_smpYMtr_8IC^|BTXp$X~a|@aOR`r7XM(DK=Ni-`62A>;$AvH z9_f{d2&YCRYk$@WOzak*c~OoAFfe6f@DJQ(UOb0(1s-V6+8}t zM%Y6TDbM(n0`0~e(Z=fVgsQi^OTtAv{cQHYLACfn!I5^C`4kt?8a_m$6 zbcTozSL$v*0uQgb2#l)xk-#q3kt{M?g;oWD0s&KKtKIf|mIluc_x>!Nn=F(UZhmoC@MLVWfWf8%A{!LJ-a9ibm(5(&roPX(GX)q zd@M1x1j~Z)riLkJ6l^njEwFgGs7mySZY8C9vkvltS$4KH+PxmEb7GD8$Z)quJ$36>!5YC6H4?tWLx3jX zL_~2klDHUK>j@1}T+ZgC#@^9#==euU-lRuP-UC^5Cc+L8jCGOV7-{#UL(6{hSs1p> z-8|04uLdI$1?;BBEEg_BTk#KN4^e`X!u!4==E(^tnRt1KV|!i-9k}i*QR9@it-?e5<6jq(E{}G5amY*n+H0gn_Y9 z-8;^pTZ~?CK_9>Yi%5S(q=#!=vps#u3bpC*N25|FGH$TQ9Pd_4r2%$YW!S{i=_C!G zD_fX}hHLaDE%xg_fp|i?KbzndD++)5bCZZKr8}JL`2AxVDM>tTh|-T>%j~EB_}}&( z|K(H^a5QtVF|l}x|sSOHm@dqAK_|9T*4ARfIiVq!E1 z{?^1IHFL*xX$M4a3Mm5YU!EpeD1oBkARcKhJu}}&7N2i-A0U4zc4~oNFEZ@*1*d{J z{!TQ-;$6U&WxGgOjF^lV^S+fK(41yMfFZe${01$COSKm>OdY0Ko`nRwC?nIcv5sS48^fobUN+7gD3h<@?TK=U zsq2}1JqYJDkDjs^)6H3!Y^(ni&NTu{w6vfAOZuc(I-NvUIA5QH9(Sk7D2hx zNiT)h!1lkZYyV}v{?Q|*B<@K93LuZprFU9Oj(?x*`7jTy!&B9yOv zBC(n=8x!WoL6TsFoU<~Hlq~@JoFJC(_I;+4<3?2gkpWZU!T~EWMF7v*q|26`QcQ^K zyY7tY=WEzh-Beb}LTZdzTqsr?>f%%?W^OSKq2qcG1lkqAukEF_zkk$u>XCWe4? z#Ea%vy>ICg-GEoSljel7W)-xQqU;Q+>#pyscZDYnsvo{+1MT9<8T4`~uVdxf?M~|B zynet59NiL z!rIjSxz;b%7{vy1l_G16WSgRE^<nid77&vHB`Hc!j_1F`ZD`0gi18)_8?o51 zU@6a|ci)iO?`1pg1#z@MGaRt#+VAApkLK*L@84Osn8n1p&wayu_RhR=UwwK_{XRd- z@_u3Wn-N%#fS{lWoezfKS`U=q7T4pO{SIjeFQMNZYxLGubs&kZYA-$P^!^hNiAC_F z(&Wq`HKids+xS2b*p4AAYkL|*f4oYA(x!rpT&_C7K;2ZG?{}K&D<-FkT@)`3VJ0Xb zH#wfssnie>s1svHRy7r9dzwfw#yY({tYB*1nNx)vazVXK$6z6(v#cyYmxjT(-pz)Q zmT^!`Ze~41QiQ(6|xf}+@C5ZNKgKywZ9F6&s&=xLzP2GjAv3Y0oF|N9sQ z)#f|e$7y6jIc&Qc}%ut}8+Yq?|zk-iAB&`7zddtXt^a zODQ(DgQqHOTe)pS1jRV(Z4SSYxFFm9bj`YffOXR_nrFrf=Pmfr^F8?NXDAH)RY_IJ zia@*!T}8>IHGTVN@d71~NRP5^{UuSEQBA;iP@E>vHBrii=Mt#3LM<}6v(uCW8I>pj z)iuPfGO41XkYTVm86?P+ZI7a!bu#F#q8E#ld66=_3qe5(7rwYzkyP1Cj<^O27m+O1 zqSOMa#3!)|Oi}&%<#TTC!j#90$`EUJWnuAw(DgEXbdGZ}D3-~lWKfV3CT06jARCpc zgW3?!cGxC<4bPFx>G2K|pQw6%H=mDNJ9f0i7Z9 zM9Op2T#uZC_CRl%l}%9a`x8xq0TEG6nyJmw%8@N+>W!pE-tgq@Th2AO(m( z5h}V(JEs-EqPp`)cKevppHePn%`Qoa-TTm}v83nfYu{=X)eka!5~;S>wiZ9KJjMq6 z>Fgx8lpK|M8rEmK1%a_jTLUsb8vpPoSY+$7N+_;3vCrkzy8E~s*E6qfhheM@ zrP!Wm9FgoRV70zMFupOPdouaMx%rka;9iusBffkukbq&Oa!Av$T*C5wgjUDJqJ6aB z(?h;NzQ4!^wA4Jl_hYZYcSg~3H}db;N0wk864a3n*J6lB-nb)I+5y2n+93^b!`=_} zy?b!&O*YX7-^{Ztu`4-1**M4EM4h_wU2-D?C}Aqy5ML7Yl@D#`Ppq--or&5LPqq_} zTx|N&G1%{D- z63FD%(!Xv4BFxTlU%s)bFl{J%a)l zqbCh9*g7WHB#?5O@r&ddY*myj&i_IQQSRbI!%jx#TIh8Iq)wt}a5M>>xO${;MLFTF zQ_O(@DdX&)d|+07Gko>hSrJy|%;=1|&mC?0hPHtn%4a35agZa4ED#_egj-4`fBqo0R#9mQ#BIn&i-6N6{L`Zvuc zhVM*t=AS0*G3(^>#-9WE*H7jAAN6DZVp#r5)s#1Ibo$Ty%9LoC$U%Pi5WROaGDy=C zPt+z^E_YxBba`ZMfei{n!7?uADyKFLcYluL^~1#!m1QqvZ}0E6J}Q3>QHVrfykO_w zv$|82jDqR3+Dr8`t0^fspZL6W?}Nb;in4>0ln_bv#S{!mP!7LHENN-l=~@%6ujbu+43{~BuZ zw^SLl6$KJ<_cuxbNb7Q!O0hDnWC6M4;8A_GNy9bkmdF>;M}Dt+#2h+{u6VQ^>0eSK z?k25<;(Ths!zu0AKiM3QGv1%~7fk+3?IroYB0MoYk(mh#@FSK8vIjI`ov_bH&I$oz zrLZYtsUQX0EBOWR#C}5l3RW{%Bo}~%2(30eRFFehtEwIkdu=PDTFFsev{oQPGaF9N zLO7CGqMw|o4 zXEdacLL>~Z9Q8;+O$?#CmfUc5aG9?YnHuPISSR3nZ8JM_D8dyb$SQv2-HWX?N}@nm z^pSjPE?!b&xN4pT6Iqj~IYUn!w~x*r*YJ!DJC8qDd%4PPqge{1d$*@GPtr)Wz z>kkUX_B@U^7XN4)%$HV&YAuDsY&6oUGVU~47&0HNr6)8$M29v4AHrT6Y7amNwe@2$ zMSs9J#(B)Opvkmq-rs#zH^A-}z<5I6p~|}zU3FOP#3gE}fPLjmm(O>k5}KVb$R=n4 zvES$OqRV_LtbbnFs2e-~T>F$+Tee&KFz1vD>C`sQ)TI=mBR(H3_R%|oh4VtiF3Lw_ z7tdE0!H=H2f)&ytAwMlWbDnuG(ULf9m*DTI1h-oaT(SX8kWAje29U8iM_5m`S?wCh z|2)fTcQ|>_y8p(TEt&BeR`_UPS^SO_Aw+z!Pzmz)2I2q4*o0Z?4L!A|{tFwR-u=j9 zsk_AMkBW&!9LF;X`vOexf?OkPMS?qF1or}T8%dvO4jne0W%dkm317^C;}z8p2F%50 zC&$arDGBdTWteETu7-Ej;`Eo6}jy1~TUaAs~m zhhS2-ZEu)clw!Zg9(sfvs-2Us;-4ssADLua7E|t`zlU(bj*`I2HTml-oa)BD4e;6x z#Il6qrF;-Y&tW8D@woFayo)8iO4hl9<<`}vd|k|mufrz)`$@MDyYyXLUZ9H^p@Jxe zn3mtSIH_Iw3x1|2Uhj^WaR8u^ISw=>@4vIf@UM=kjX!9O{)a6V`2W#l{>NGNfA8Xd zH=IuY-n}iVHvby@n;Z4Nh6Epb#M;g4i74tF_sb-Rd>-;(kwu z!RK#BjQOW9?`I~}#+8PwCNmj9+V$-8Ece{>&Gqh|xAzMwe+X%;d4~ahM4=pFn5%J& z@T0^41a(ePmuQCKNZXc45sKg7Sq99%CmTnsy4$U_RC+C;tYjWEXHr!g4%MNwS8o=t zU5BBC4m*jkf0GUk%P;RA01A1p(jYj9Vw|c~O0{}Vr%@Vn#JfdxEAB5UcKs;NtiXs5`3}FZBK{*S)g3 z$55~%jX_?tZ2!@XL*pbtJ0W!BhNlhcAlYmd__dLYu$LT3VyZdB7?{G*%+mk){+zJ4 zs;d!SlV0vINdFQ8yIDmbS|~){ZQ+Xl-0nVjY{WBZH5Ok(qD#50@k&HaWJ=SGQjG>sw?0g%xYX zo)I%5ZHB10EwcdHota@yKcn98pHZ*azYhpLLnCWD!~gxero1VS zp@{gsIoVg3UI+zeB3s%p_gfSf;DeNK@ONMnGm*)fS&4SKAx4v=6GM980?4Bv)-VW8 z#%=F+UKG0m8qZe7ZTAh#?Cr)Tq8}KQ_&S>Q)0X>H>+#1=Ija73_V>pJg^y?j*~!oY z-dh3EgHGCh#cwnQaC#T22>X=76ohcssCz$4SzkX0OcV~A(0xas~l-q|+(dlYU+po{VjMHA~h+?A9sV>Gg8pemGtgwQ5AD<1!^m1fsM?$4U=Pdx_dA z1Vdd^{^<QaRq{WW`$q8N+3kYCzjK`3k>V=-aI z24Nj-l1^-9@jCMfs_jjagNd?f30jHf$A9_`|w#Lm3Kw0)GM{<}zxR z>)9>F0>Hl3fVi{#9s@Nu0wh9jAuXw^`{pc}oS@tT^KC?^x}q(lC%Kz#g8xDh&VExs zNwY#ntAS8{_V% z>+5d(Cat43U!n=EJ35}M^%!aT7r^byL#@M=>I%4i#Ns}GAERjzpA-XOl0L$U&V?$O zU5Et*b(n1e(Qj=l+Kt#miKG*{HUE^I6ZIRiZkqVvq{2)w$2r|dfN{q6-d5PiP=H>y zFfj3n#fJ%9Wti#CMh3gPv`;=Zu!_H}OdwcEN1rtFVw`_} z_Z7iZ!2v$7Z1VH$Qo_SQ#Tns=?5 z`x!jNy9?0?NhcNi)A88qo3M6Dd#sE$?1>im5Hw1V3NN-b%$fzwzRli)mN1NdKEb(pdIM^yv_VSLm-8J|0?3wwKx390yng>H+3*|GL-*W zhqW^PVcIsjKMvvlr>9Td{6EOHk^L&Om4yV2S>uv;W9x#II$Ugm-=BcL6@dv|(oORY zX7m_FEQ`+Ch_@gwICp#EKsW=&-ti&EPRU}DiodxpG8l}z?0>$@*Qfn^lwUA4vHp>T zn8Xuty_)qK^|cm#L>NdIiWn4-tCFP#ErT)SiO;BWj^5g|5=@2g>;78mCz@MVas?|7 zTw9y_YH6PE62ZarIw}?Se;E~U6>#}oDb;e5%H*HjJ*!+#%z=w@6J{Q%VSe+1aY$-A zYiu2F<=VJ^sE|Gv9({JrR4pe`8$PwHv2b13V1af%!1$s2UkY;kRS;<6g!xUC8O*#Q-fj;-J7t=$q+gn)jXnj( z1wxL)j~-PE{e9s9bfni~T8*~RgP&P!!_c?gcR8}vTUg>9en5>d&RK=wqPzDm#gp4$ zj01f?E#o{t{#5aQ|3r&h{ZwH5!#4lnpFjQM4u=2m&Px?_6-;NO@5vh4aaz$4;+Vfo zXzFr0t(35F%ut&_KV4xqqT+;eWs@}=fuc#Njz-9FE@W#<@0CnSrHbWCOXB6BNkoY5 zx5$>A@1ET6XYn+j+&CX^rNsROBZnuWN+;2(HE>lR0 zdt+vO8Q`bJK=B4C;yF_|RX7V=U2w9SiCA@8{v$N4F98y0ULq4>-vfwx=hNc^ke)jP z=JtUX3@51;5GL@pCPIo6e?R{P_1Z&Yh~!3;`{l=LI!TdT+GBjnhRsd0E4$?t(cF!z z4~#=v5NNe=^9uQHzBg*}*h}OJs4&Oz+O9l{@=ma&6>15fDnS3Lu zhNjlUH_tu4aG8~G#M(x%^W-&-9c^k#MVC8F+(@<=A-S%`Ub$W?Fc$Kt5+9$Idch*` z8DPZGrrDga&I@4J#R*`!JUMdw*O>xdJluM;2O(QyC6bm(|7=LXtOMpeK2{Oc%&@VGgIM}n=xPTsHZu*o|%=ydsHI*DGc2AD4b$rWMYr_F+cj(?lYu$Y(d0;`Gym zsVB+o4{0WaVAxWNLo&g-2maMO*qGgJH^Fz&7= z2fEolQG2QIcl}C3QYX&n7uJjBQw?>=S+N}$3TvDBB4GzLg zRLYKx^=)OTX4DgErJ$67t1~NTT)b{xDBJpm-PJp6oYIFy>k5yf4es3Dl0RBGlcl=6 zkeqZGj7n2lOVEiD7>~>izlNL*I0?~Dk3B&I=?k3@VF&JxNNflsY7~FfIS1h??ud;d z(DEysJz}!|k{hFP%wR_V1vv6eo}VD6bZprUiHm6Oc!Z({ZoD1T7?|r-)XyP$bG-Kk zs+K#Tcp+0iFn)Ojr~N=xynz_nO>QaMQGRLk!77)=oI))vu#!h&Wy>uG*Xlp#{1EDy z%3$r6jdxpHLNJIgSmO)!3NMHED&BdX_<))Ch(?8pE>b8Lyn%w;OM+3lR+y?QTQooRsb|E)Y+ibYPpR&p z6s+)b!X(VTwzS7+!HF5!N~m_e9HxfjR~m1(1NVhmD`i`y54ph*TuOHuB+7D#w|bn^rs6qM}j4>u88m-909 z8Qn378h$ehryt=81-d2(punML3ZG(*KwecJa-AGkfNPyvMS%^{9mNgCm4!IL&HC@J z^l77MMF&_St=`G-5)v585Jn?7Ln~EA!8Fe_82Ch>P0PpQ+VT)sB9MB@HR@Z3(I;CA zJo(00bBCDqE0P=Q-p@S%iEzyp(jhvEEnkvBeitFmh~)w7kJK)2IQLuSThcG;t;19m zA}y3r+ik(BUg}RFoeS0@+Aw!O=T#}{7vd=KmTSobahGQvS@-iPF`2(zEWZ|rcL;+h z*A_P95X#6hgKb=iO8R&>Lx(@?U7Hnbcz{}VWQ+Y_<#T}WigYMJ>43m!22#ZMp5gld zvjS`{o;AuM{G5Q_d%Q8HaIyEgX^dy2Nw)g^$op4#@1uRb@iKc^`0oDIN}!Mz`O)-4 zeusYO!vEkuT+-Cu{)g`VLl%DQ1^)|Es7&0Jo|i!!?smr5TtY%458>ez*n}wn6hK@k z`Jf#NB}A3*Xpcyjt>2`!1o+JMh!McM?KR%_f7^?f=04Td*%F0@2j|n!kd%~Ws5j%c1tuc1<14SI~GT{=5FRz6U0JD0S?LmuiOd&*a4Hl2GA3j*mk~0 zHG{zh;!{+DZUTEyhhE~-I~nx~s|gCSu*A?HC1m3($CYe+6H9wDyGls11or9(nytJ| zd*-n%2D@K`5fS*rJ)?+*sq?mMo6t0*6fGywY7RRNIp4Ub#|f4Kahsq^&@5tt_sEw0 z6$tBs!r=*u#H5mic33oSM;v_oggvkemK}+&k^{?7?z2fqgf*5IzCiS_fY*Gr3UPfh4gBdXY(XjrTV_9xzp6snGzFWJz6*U5Ae z>b#^$8`}Oa>Yx%)Z5Ua^{d@1j`9<3&2(qX3VKiS|pK-r78?u0jI73d-73h_vE*v9^nb#_S=Y|+zY*z1#s8FFs5YJ2SHfgyTzIL#sp<+tP{L67dQd6i78rY* zPo1dBFRd8bfj;rLUm!egc@bm@LV0>{3_0s5RelFi_9kbtHD7z!KV_t9cYA;Qp^bbc zltWd_-A&ujR6b=W(!+E`0+JwY$>sB{$|=DQjq@`FVnLG&nzyoVm#wvk&sDJ%kUz$< zsz`N9uTKBzKyxY92j4VNeFI0ST2*<$kTnW%H&05Zz(!w3IP3>SMCedaI4A zV!|4#j{auL*KY|)(UQMQZG@D-G_i}_&nIGbPs1fosoM8gw&|v0gvu#GWiJny6dkAA z-tutWs3nWft)s%3*w5>H2Uz2q{mj;TB{`%`((Z0bgJ@|&bigU0=wieD!l+jHeA2opi z+<@NBOcX&dBF*y`WU)wDjBvt|L{|-1lJPd|sI&$C8(Rp_U|c3sZXHuWY9QX6;iwQ@ zLl)3S<^&wxggq*BjIn5v)~&}bg&vOc?VbThy}Qj`JF9KRFi;(X#(;=Vy)XB6dBV3J zDevR#SQo(;_9_)=xm+BwUe=4x19DusZ;98PG=+T`ysxWBjg|D)oYj_G%rpHZl7LV) zX$v2yquc{&c9dXA4Uk6IXmP8L=$*(MyP&AihZ^D6zu3_R{e=R?eo&(G zgA&1i|9A5rl>F<&q)_1>d>FMGiksGIAa&&UH3jzB36t8@&K8KuOPGl~Sdzxq8MLok zG>?S8p?u(Vy!;k|@2}?>b17=?6)Ue>Yv6hw&-f2<^6QYo2k0O#M4vuP>vh?m3~FAs zWF|jlFeAtn3PM((0JAqP$ndl)Z#OhZ5y~7=^E}9~1p_iy!7Z70a`oMBSE#o}pjLJh zVTz*5IIgH$C%LtC9E*RfOV079G@4(p_z1lzvA&$?%4XRKRqv;AP-^Pnu?;u+((h8i zL2LgIFjx6Cw&tN3x_U7nKUtE$c!a$9$#6D#qZGn;&uoa&U&%^Lp(&%yiJeB8xx|}Y z`tgF8XP6d)@q^wa%SeIAAnL0Rk7uuKv@%S~4y(V+fD5CQP@ZZivy)%ess1v}K?`t@ zQuF)fi}JY6u72#6vftxICFm+nwzg$GCg1zMT?(U0_l)Pc5!=B4LxEJS4ns<{gO;!< zXgw`8Hc(F_hbG98bMbG9=a+QL9r8@r^6nI{s-;H15v2MGagO#T9zUH9Ae$D7YdLjA z+b+6rUT1u5x61&npD`pu?-5155E}FMJ^B~@Z|iSJ|IA;1n~6ymKz||ax)GgDo`@H! z=P1HkG53^qWlx#xF?6NhQERNoVoC3Pkt;yj{nM9isXV40D1&?jp+)C!d0N7Z~W~jmsBwN~D`fatRBJZO#*%k>!yjFS^0uKVbnUJd2Ryq$#3wPIxJfZVqJ{k&L&9 zXGCBQb4AEn#6de{voh66ZgSnUtK&f&3VPU`{pLb@%fxrO3nm!q)B}6PdXBGvSNwRb znYu@N!ldSa(*GSjg59@YnmN^50&QLU~Q;g};bg&FW1uN-D6+(tiSj13|*jaU7szS?JO%dg{la; zsYTbJ>S51)l`=Ja293O0qU*grE{>~Vl~KEju8(CD)=RK6c8wXv=Ry{0eQY>gXHbMs zf(9?Q^CXoZo16h3k5t4ol0WgU@(59J#$rXL#!T$oiR2;)m5l~P=ou9rBG zKW3L*?Z8_lpgc$u*MB}N{M3p2H4S>dtnu8Y?ig969?)uZXiMBkgy{rwyvHX{IwQ*1 zAaq*bEdCiNur{67aksM~O|G6rDQ9Zva~!a|*~U!cX7%1NuGu&KR{sIq?_r_$D%$FK zxv_K6f~%Io%g_V7`)TPMKhqWVq~k!XKec!HEiArL`92$v=|=Fy{>{a`u^4b%_X}@F zaX=)3VSRhobHA_OLU51xa|m;}5)1(E>KAu5Af;kUL_1Q|j#ePnvNgw%f9VT`kTto~ zH}bUvD8g--TZr)D%6`~)z-4bH@U}GFb+C$o1;du}!_&pT=wTNZRcmcOcPPeBVAB6U zApYkL{b%<4&!DbQ;Zh1g7M80S$3itpF5HI{9ABip!2*Jmd?dIe6pq(l?`GSuohd_}1NBcI-LaLWPNMI*u862C=;tK_$ z(n&p`Ly#LKfE1kWXOo8=oF9Zma{O61Y#!*hdweURwIrF`@}}l=L)N;UYbO*a0={5B zQUPPZEY(0o5Osk`nMW4tB5m+6q$f&l_QhIa+@Wd8uwM`_ByCMc5C*DD%?Pb~C@-qq zcUh(7rHYZwlq0;NNurHgAibV_8IBFj&GvdPGrx4aFyXuJ79qf40_xr5Z*&bu?vUHi zrL{iT&VA80Zh;VY{H%tC6_8BZ({o_1Zv)FXq{4b}9w7xB9s!AIEI+J~1?*I0z!gqC z3xG=tIMJp6tvi@N)02M3zh-%m@oA)pc$rU1H2dNhDf8U~Nl`etmlVKWe5;&7d?}X) z#txXgpFv;o;ZgP|?+G}GT#aCqPZCeLfh~{RR&(0C1`nBj>JD@+Yd*Zipb_W7Gf&dR z5V2ZWykWs2WOT2WZg=R5kzfX%oX!y=y@3yCsa3&v#Q~(KRS0=IQG@~}1gL_Hi9MPT zOb$ZvS{D{a8pi$b?0yjmst@Cz0w#;kwov4k0bZp8{{js0aEg`EA7HHgs5Ad#3jY5h z$|y+wcqmZ4jM^{z+5*F5kf?I-8xU8MX!ONG3S{RC{6wKbw}R+RQPww&oWsAMXvhap zt+d>3e}@taRsYzaJdD+4Db3PcR$O_GT)VSUS82Aly#Lhr7-D^DHL6>UFAa!(Z`tDH2S}%#z)&5j#_v zI%kw=H*yBO2=zB(wjZ=7X^wI{0z0=}w?GQ@HU*|v+fE|{v@1JogpFc!`~(7k&3Q|dsgmZW#r!!e8PcYLjUy34;4uRDf z9#U%h>|eU(4V1H2NwYq^1oLj0j2<77JiF#IyodH-sB`399Jg_m`T>J$i9NBqF_T2| zyC&(TTyrJmb{i;KT(J-dQ+S^>oT@Y3lhjgdc2vlbcOEcq*0q?A*6wQ_9vQ>{0LuDb zZRZ6M1wCSOOxa5#T1c;C9jdqIy%R@%1LB=aqoVR=;61$~LOOqq4|2q|NfP$om`cza zxN$MGnK9`qf0*4Mo_0+=CIO(it+Jy|&3OL}#D@u}0H~9Qi!g9G0v+R!Lxh||kCi%P z(<{KR{57SQLKrXLIm6Z6l& zc$4!0Kzl;r(d}r&AQ6n@8xKsH{QdVC#Q%mnNLtVTh4tKLwY8B;`=gfQktp{QX3*lp z`jUi_(Lx+oeZBQoN2=!c z*Zn<;PjN}Bi2kG?u(|4nb8Qp|G&Vaa0zF69U4C+aLaW{18t48hLP};2qUR{TriE(( z_nufef{Tz|-WBOp)YCQ zAo-a9Tr1n4nZc&V?(4X#(kb*jw}?4Yd6IXU`Uo~-tv&3WlZt7X=AE&j>pXna8_WF7 zu%l%hY6M+wzY%r-KGIFb{7Rh~U65B(_(#e9GL)8hnJqlywnCmU+XCwELaE~6}7dR^0< zmG6o(Pe~FJK>Sp-LmmQ_Y{Ny|<%<-BV3k!?K4k7SP4Ui}8v#G&m)pT5%^uHxV*AOf5Z3mFX_%v@} zNJoU0h@y`^L0CQPfmGf{+kDXi6rb#B zHBK+?u?~L}H9l@Q&SWpRuHhg?M142jRAWZ!52aHNiFbvJ8aIyf!pst`fjGf5-6-f= zwb!bz9W=``d@FkoH4BPMZw#@XZv2wK9l1@uAviWs!4QCw$(cAyCaF|bC^_yq$P%7Z zu{nCX$L?(D3Z0;9JzjM5)QOA}SWlpp#I+9B9jRNo7%=6RC*+7oc@0!e*%D|r3Xd&G zl(~xANHEg(s8pe8%^PLPo!Pq5z$A2(dTpf|bb^>)2{CN|a^v@|NwKqqt4y zZJw|xD>_7omTcgs+u=xRHk>B!XurguZl!#dFd1?Y8D;e#LZ6?H0EVS0ayB!QtN-g$ zcH%6hKcDnOkn3A`eE6n7uz(m=Q__Lq7zgQdsbNhgsPy3#m~(CooW9}SsSp8C3pFuJO|^k466PtsDJwZU4jVD^=Zf6c$sz zJx3=tMkj&d{`&C7jN}vI;f;uc?!x`X7yFG4w_mUx-5YG#Gg~Rqd!M6RXb^Pvi z%t2y}>Hezt%l@$N_n%u|v#*jgp3)OuAYCVJJ)n-Lh+21Y{5( z{EQ?{{yV5!#4u$K;;=zlSwb&nd8J2pr6J!ak^wTk~#7Pug_Ji~W zzIeweDy5|82Dy0Q5*14Ejdd$Dj$?r03lnnPl=5km%95RA6a~DGO6YZEuqdOgUaFQO zu4U~)q1@XvD5O}+Z-ug-R`dp$p%jSwk9xHvD07!%0Tc#7cqp%hs;f4&p-QVcZpkl( z`ElaX+Gb+m8b%|Bzs)6CF9b07oG6b5{^&0|4*JL1*mI&oIx`Bew_lWCMGHW+^3k^T zMzNXq(UD+64Ee8TSm5)lC^r`p9Ug|pAbz()b%^tO2IYYLF!PBtzZWsd% zvISKmColu+(}g)1pXXz_g*7c$hjGX{Ga7|Zq2>!uK?&*K9$hJ&Et&?ekLm>0lfgUI z4MCYovgLTSV>!|vG=YIL0FMldJtyfX3?Oyt8JihgBD<$+&SSv@nW0}+4f^>V=?Jex zISZFs+aFnEzB3pEbC_uWhcEv`H8VLSZ#J!#o;EbI?WSGIwwI5GE;R)DF@be11NTRj zkL(pD$XEpP#a>4CVoAC8AxU(M|H*%J8Pc*TD%d;?W4CO2VlbT3e26X=rIpJMW)||t zBtD;=S4a_foJ;IY*+jQH0n*l_#f+dqI!IR5z`tP>Si>@8Uo<S{B0)7%2v-7I!k$kBpHTmCx3?f$ z-V45|wQlS}4y_x{$ax0I*8%XXm3rf9hzemc%s^*5MWkUflo)UxE7I_{PCY`gk8D7? zq}n;5q%8X6nvMkAp|ztEy>0Vq?p3_-m<;NH90_JLIdb`iwJGs})O^2~OaVug9$s;( z1TZ#2rV}R?B2&11e18F2sxI5*ZBPkV_iN@8bnk)$Oa^XTk>TskAA@lF)Y$Wlk=8bD z^~8Br&7r7Oww1+Qove3QT|**)gcG2hqNcwNmx zdKav4mfpGzC$czs#!CmON)5DFpNkY2Zp|nDF;s7?)6KX+izo--brmr3100TkLCV3NKFgNP zzRDHL-TM{8UGWvFl$e9gDvqs1tm7e8r(%k}m`Y@=_?SSB!g#1F`AJPqV30|!=_t#h z(Fz>96BCh@xDW?bmtWDKMo`x_sQAIHQw8-0=%M6^dS$u~RhUPwsr4pG9c@snMx#!v zz4g;^nRb;#+41L~7pu1BqmOog{Kai+aTtfhd#kjHA~ZLN2kB_bi;KzHjR#|?NgMbq zDtE4{hNCD4;Yl8%E#gLcPNNlK;#P_4h`pCd8+gw2kPiuIy;x?#P+wJDc1lF@JeRB@ z$Q|W*vmy&|?Fno9LHPW%3srylO;$JUqKUMV+^Jr}>;^sS*5lp}0mQKrIH+7jfcj1_ zg+s$)`O(~+Z5M1?oCRX%$?t%xb;lIl73z~;%t!lwX8%D0z6e`q4aN9(@%@&dO|W@V z;++@g`9#rU`e;?9(L$G*XN(8Bx}*DJ_pXYD$X;RIbq8Rr%D=?B$lobn(>RSrmZ>`M z-l<&a!zIsh8VZC13ys|@+*k?NH}m`AtVbM^IEkd?ryM$Cw+$2q#>N(Yi)YDlurNR8 z>WtKfeX;c>G{i;QZ0iQAs5v{=VT)>lsdThblcv*gG3QgFQq=PcL_cL3UQ$N(Nxf4R z4mK|YaaoT7B+@rRIk94fCa+#z8pbv>GA{?k6IfD9Qd$Y`8?O7`P8u?l8Bd@O1+~5F zk3b}KkS^EVpdSt0anCSL5RrJwt8hsKk+@l)dZiqBrNB~tHz-%_@?V2tbD~Rua0hn; zWoW$_b;r;ONq=)Qf5hY79~#b-t;BQ{x$wsnqi}_51Z!v z?L4$6bsRH{)NG@|>9RUTPPU;ONhxDMcV4ew6>^FOq?dPAiRxB-ce;+K97R*jDvO87 z%8ORzfSUXc=Fjj9(@u|Z<>=g^{8`_qMa2JjSc)TIdA9;7Ovs|WIF^2?5?@bHmEE9n z?$-A4c@Mu-|KO#O;O7Z`a9q zxJ`0HDXm>7us3bPC>`CLNegu8cx_I)SX5V?5VP5TcLnIIvESG{2TtKQ!ND(1UekCl zc7Z~|Rf=E8iPbjA*?%a-$`REL@!^e6s)e9S6@+6`78Q&|uy3@IdM-hfL5b}12!>@7 zfi4+{dXzwG`c-9RA($`Q=dT2GyitLcY8XS@vZwkO3Ci+XqErPHx&*hRQ>k!PAe-D( zKu_wUU(Mob>8;nnjzNB<#*tzzfAQ<1dwkKY{0Grhe`2(zv-PHPL9cVv!zUYJW6qGB=2E|tUuu!j*P^h z6A5wz`(>$mvRL93>J%R=#xIxH;;J2358v*)8^Nzz=BoGRGwaZ{3P8dA#muN~;kYDc z>n7*>Wq6krKp{owp7p!m9-g#sJ3KjP8~sZMC@ntYOMBxNs?=;(gUT<86<6XlZGIJq zmjh$mh%uR~bHRQ7BgV^SsjIB;v!HL`s&hF=eEGq3m?O6obVrt*UTHzU@Z4X z-?+ybh4+k#yoVF~sH@?!)5R-q4Q|Rswd5kTiVN*bX#f!fWUUvZ%G_8Wh_-8~Krz1T{UZn5L6|icUfS5@Q;jk& zVuJ-%WbUU5U_BeB_uF?JDo7x^y#3+W2V|U%!@mnHH_HruYy(upytxuSII3PphBQALx?9`yvjWq z!{rDyhWNr%9n&I}DeE;wT&`j5^IrP1xa2A;y)KY>>7rzO`p2Zq`2~9mCr27&C9Y}$ zfx-Fm65aMd-EO3PxIP63dL05*oaG(80iFDGhV@zm4jY1XbsMVt3-+Lk$CYS|8+hS& z8-%Yo2Jc~sPn4sx_K6vo)bL^3@`#>GdT8enLM_X2n`ng{EjEy6QHHDJ@!K4W-u}5j z;R82L;^tjjS9s~0wa*aDf%rR1PNM34(^t5xCC6U85Qv z#9;JkXR1$G`yyCjQMyIG)@UwUJ-!4f);oc9t_(w1yln2mwLz7>DA6+c{VHy#uD;PW zN?W=wE0W_bC`8(N-?(lFJxtjI;7k!>)4VR^AiV>FUDtB2%X2l;BD&j^t*Qr5y0^;) zw?b0Lo~#FTBRnG3aNY;OfGPz$bxA(;DSs7~`8HJMf(s=V$pp@Z>o_eid+dOnJS&Ua za40~9C)`k?Zi>!KS8xnaf9n^g-+oHVESv4eYS(du>_~|A515P|J4yDM=;2 zM0UyQN$}xOR(jHhN`2J1+j$tsogdDId=a1G34kCCB(G4k&=$@;>O>I|B>>^{_48Sc zF7goM;qdlV<~?UOte=}I&Ji_tE;=J>U=Zsh&qu-Rdjs0a+UHRgr^ak6plCe6KMeF@ zJU>)>K~p3`ao6e%LWVNsOi6dIjRmGE6I-(kifp$A3{Sw{=m9-@#~)7C{Vyvh&i?kDsRp06ZX^m-c+W=jeJ^p~r` z&+tq(N2?f3FuG>)h|bl(t=@I?$kxS)Nd|=ilsIL(qm|b|;aqq@BJM+w07*Q$e{p1b zO-~@UruWqZ<2gtf-?x_M^b)WpXI+Vm9hQZ_$sO<6#&`h%{5IL4!UqK9F4uw1q`lGK z{0=2%_apif(a-9CV}ppmK!6k0&h0_%`)R_3$Lf)y<^B~YGbDr6N0;I?p&eL8ihQ+5`uJtvS zwQtSfbOCxj}B3QIBrNu;DxC)>e6{U)~!hCzoqNp zny3{~n|&&G;_;E;K01dODI8 zgce24dlcM~M_7Q@}Ut2iC8q15dzD=iGf1Qb}_RWK_mU~xGb!Gi?!VX_-6|Lq=cFf7%4eVe=NU9K=Wtel9tQbDhyk7@)G zaj0%HnuKM}X@kYq@wq8P8UR1P)|Y09o!s#I`tXB|@NbghgAV!lkM0-Gs6jjMIJD5~ zLTaM>2S^zW_=`bgY{)EZmpg5NLtngzEc@%fOLn^h?{04}l=FyNQF^+-l}ln;N$hmK zs2B#P%)WyHu$muQ{niPwIQuM9iJKo*_bCE-xZ`Z`Ay@{x264);+4~-3-OIP`T-_`# zcPeW@wg{)zN6*M}nuJ;(iPbyb|6*;C%?G9x{IRt_{!DECkKr)?_lU;ef7!wRXIhh~ z{OXLMjPxZGE}TT-R6%H#QB;~Xm}EFe9!XYu$?iDUVr#}hM9pkPMw>)@R}d$J6`8?0 zlQf6iR@+cvy2>IC8e=EIH=_Fr1?>&keJd>^B{lK96=5)r-aH_DJkfsL)$Vn@#gXs5 z^)|2l3$yQ#bdR)*R1ofOEmCKVLP9=hd%Cg0imbqfWFZuEnWf4A+bwIgp6Fm8DZ5NW z9#*z_|FNv%tp!F_|2^DKvo?fmnI~PCrHkyKxU54iYVWw-r`#WH1%;I6#AaySpFu+JAajI9B6z9S6suF{--a*iU!GEB`hCyV+7663v!t`g(2DAf^( zvqL8QNtR_6sWrH?nM7C`d^aC+_^@#|yt$va@g@GW)5eal`&80|=ud zy3H!oR{ftWnPfWzqfu6(PngIVY4=rTa-mUM)x;s0BB)^ecXT%Ht3tf}4*m0dr!KVu zHuSYNA8)lLcAv_i3|cY6Gmlf87vpW zgQK60L2h^GY9g%N=dM-xTG!K_Ac~xyX35Q)Ff>57LNZBXOgcjz2f@}X4z`BsMOa+#jN$U=Mv3JwNnzIQSVcM;*Z3^E zA{w3pwPu#}T&w5q>C*~S!>Ck;QfkE4_@~-}UTIWF({*R?NVbKF#Tt%?4oqa2m1%() zy5ShK6#7M)xe0fFu-=Hz<HZzOA9QOVm*w#3~(}3Db$((Bg$sXXoT3D=1ov zkfK!s{bCbgA!eie60>QMBl$du2R;Ll3Orz#P0szlxIga=FiAe;RxOO3j-ZZT+Q5*? z6Q|eE7B>era5Jggs7a`%P6Eqn0q!c6Z}Qx?#9q-qP&^E*n=zQ71Rd7O)>QQ;5D{>< z2$yN_=V^VeVH*_*rA`uoo|=OY-_oF8)MjR)Bm6AOLGqg_X~2FldHi{{#Wi`MrnVzD zalyDY`H#%&obRVPCEA+Q3Z{==JPNl2U5QKkReQteUVho+E$bNh{-J=04tckZ#4b={ z#YfY19!wIu2|?Mr#~!MdwAhG$=D?u3d+3Y#ql3UC%v@ma(Y->Q6+guK5nSZ@t8GPl zx0v*OK4X_58bPD7r_r&0b8Ke7bAga^g~lBc+6|!@rJbWB4|#ay?>4(A_g~*E1n;i@ zK}pYZg7p5CMF#s2%bg+NMygbkP)>)A8rmWDUoh6^L%h% zUUA?NX=0>Bf2xpSkG+4hsathn7-sQHVo1_lFx>~p=JvevkF4kt|1(jzakgQep^wom zfv;MAa8fkl6)X+?yXVr&KOyuO2y@d*%*(WiWs2?0ULdr`zIB!l;Q2S1<20 z7k5(g7f7pd_44zx-869ZHB4^e`7ds-q;y|P;N;>sldO2o=P!Jawe8~XL`#|I-*kidTo?f;>AJ5z^yPW zL_Yy?tCFf_94%n=(yi!hm6D8JwG0Jd^AsX>tTdbR>88;CQdLJ z+Iljw44H!snRV~hZ+`*L@|C{R2I#7>_C4}O(DEM*Z}R&T2-zmMU=mc?Isr*%;l2Z6E@GdQXQ zE6yFGUdVB+48dw^#eF9P@tRto9xXw7caarv>W81sy`xkBCuxLSS zJYB2+XzL$#8wSySDztc86VU-1jzEqUjNycoV#A3LHku%J`m6DjMA&sBA%70|xj?F> z$%deE3^iWo4K}dQJT1D^^_tdz*`(?FuPq%TL5j8}E2Sgk6A=q77Ds1ZK30w{YP>p& z#8Vq#UY6HzAXjm1xJI4Cl-el^%?p2>fy%Q1LhYK1u%WXGg+sMSOM7{D<9fHu zb+yr%#^ebn7uVIY#S~TK9&<jqK}aJc*IBTk3GesKj0%hEbwuH<+{l)@|rc5 z-GAQ-{>shxYk_GNTO?bgUxJQ-v*(hd_CtaB7b_}5`75XJCbf7RdWO2IB<%VdjUhYJ z7abavE%-q)IMZ(_rXmIk8F0$b2D^fJ^0L!SFQ5mNFGF1!vnRa4I-tx|iXn0K<@piu zn!I_Zc>>#8+J`5P%s$me=Di=Bw0FgqGs=|<>MNzw1bHV!z{tO=ts#3LXvR1i7b-bB z(+XTuNJdAmk#H8ahCAUo5Qv$Z{fbN`t@EL+^l`ZQC3gjy8wnWDjeoZ~-X)RmQva6+ zAGHTbjm(R?DsQ^~dbshIIZMyjaTi`&a1+4*v%>4I+w4}F5KMetKAu0j2ezypAqt?~ zIT!PzHOjTgtiStX=)^XLORSQ-T8qwJbKZV^5`a2_Gx?9e%J=f;XO4t{e|#d~(b1GJ z^$Gx@Zl~deLFp61-Us0Gwc!6HhMq<4J6Dn~itURCUOqntcF|)BJI97<8wc2{_enZy zpQYA?u{$78y*U+Vo3?EV&0iyA3X^e@^)cYW-}n9(1BqMq&0Wxs1(oS1R!Zdmh#os@ zGedoc|34|qg>mCjeSZ;yrfpDU|J?f7%CZ25%mj+lgz{;?5%t#KjMYM#a!k_dxKL=O zw%h=CknWQy=-0?1w6l62Uw>z^%}<=K-$VSu?AJn;lNsw#0&Zfci4WRjOh7A;3M6@8 z^LHs+(~mJ31E3#i4h&vKXpTNhdd9K~voy6W9!>;Z%1xc&r!$%{6E{rXI9`I4OqQNy zxJG*RRQSJ2I}>;)w>OSYhR9M~LZos{lo*6aQd!12G`6~;m}DQuPLfa|WlLRKT+1|B zveXroREliLTFIIgd*oJ1uD}18D_+jkpnH6Ltk3UzmiN5pJ?FgVd8qGL{!Dwzg4I zc39+X9C0Lx{^I$>^PQTBw{Rf3>3_1Om{>t(y9z0b^~)7bDnHXYu{`Eble#U_&d!&& zqO0muWxsKCv7awPsWYwfe3b6hW)i9BW@9*n&ud8*nVdYs9=}KKc5lSZ*Y`aF(3%ap zE0P%VUey^Lu(i4%-Ej2%ie^l4si4mG?ef)m+S?0RB6Dg+JSu{nl}^7YYktIO@2mXg zk6v{~eslFzn0gh)_}|ncga~)ueQfGhocpp+;sA$J2xw~&(AF9YwKW`wbJkP_az%>tbe^WB+J|Mg2}58P`%3hV|#z$|=ikYS{X?2i_aoWVRqrw4GpRmSYS!x-AdZqF1dN@&?yW(6tB{}(slgRUw^dojogkv5-xylMbrrR#(P?LBG6U_1d zQ-8r#_esbnGGsqz-4h|7i~gBpB{xT3sAEf?O&#b5@0H&NPIZ((W9#CKl(AZR>XME` zPb()$5P(&J=uEVS-MZpoOfkqk;1$&rj&6sb^2G1b7ka?Ij}Axx}kXn%#&Ka~=( zBEvbvGPh3#IS#_E#a-6As2n2Z8TwkqN*zO|#2W&)1eLqCc(ck-Ndj;4+eDMHIV!@E z2`}z$+Q+u8`;uvWxbY`D(P8UE-9Rw>pa4WEPe**>A*Ffc}-k zi2sj41}83Yj_aGWadB=UoS))DMxUQ;iFq7o#;?R<_pkho;(Z-2L8j8P^u^D%f+dPG;UpB}sTa&=$IoCtP3saye==&j8<*KzwMwDHF+b<+pKzqR{Y_P<(F0mwn zrcl;zL6KVauEe4gHDhPT>Z@l>wLeSVa>1q*r+G8fesLU+(e^7VMd_Za%hk|*$~GF3 zn(%p#^~OgrCASlWg73E2-_vMibv(SI?cLZI?rTqZtAZ%clOC0It!$JlW0yQ1n#S!g z*z@YiP5%vnB#(n^Cz#oLcZFs+q^eM3S-;B$08#&rD;RZ<<^bHMtZmD^iqw zuBB65e^pB8LmvG%aninJoT`EGDyKd=Wa&3AYvQlr4>f1xEy1lR(5T+zoBBF2uU+0g zDv*2a$^5ln%`9J`F_)uF_lEA&znh=2`?0e2I!uhX68b>eF0xOMaUf^1X~ue9sF|S;^NedDo+GnDO%C+Gy1zg=|O+5EmS8KfwBxOGp^YhWZl9LB+ zoWXCn6}9=cTl!D|ka`B=OG1C=u5GOp{kS!4e_KL!?fWQ3@Ge#H@5XwH z8|@}}^H&;Lh*`Eq-rHN*GBln$7*!&cCq~X4tGQ10-EhUmc2~V$442}#p4}EhN{}hO zt)h1`@j%<93zx6DSiUeHVsA)enh?3KU(twm7ct2hzoFi8Fhz4PBbR4oFYZ&Q$;dT> z!C3D0%&p~^eRAO~HLXDdSN+63B{Q}9X>L4NT6^*ZUtz>@ANBO)j_s3mRYP4t;v;y1 z1J$k76io@2(v=)lQ}ui_yf*ydMmBj?=0@)9wY8RMTQft)j}b1B_xu07p-@NTt1O1- zrP&glb2U2-`-Q`(;a+19I#@FcwNEcG3AfmuF+c=pxVoPID8#uB=m8}g~n(O(fV>{k-yrT z%?ghWQ)IKh$vXwJZ@YAD40G=ap`+1KK4p)Br_1Woavo@T^m<>PC&B#hU!|J&ey|k_ z4nD3pDDgS3(P11-Y$uQNhZVz5N6F>F!h6BZllEk!_MdK|&aPx|cXhY3a?=stT8Y=e zON`*J*XWAt)HGrxwZ*q+Vqa@ZR!L$}q20V!284MwiP%v31Gsxj)?B>8!)?>u^OApn zubibAoVP(51dG%rOn3B)1%o>rsY(~gcHxBV%zHNcGJAG5LXzusqp zf6xIB1mL$bi4w3Gd_OZ<=ql@JspAZdBy`p3fx$rYJ<-5uph=7HP0s?jFr8%~{M}+| zNTO>9R$pfs>diHr8rccBgeCIxUk5pYDmyHW0xgInO29$zSUV$u*HXpl8RB4To$Jl) z{=g^)d?NLZLQw)fbI!8X+h+vqVdLNM)J_c802p356&!dPP6 zCE7UwrwB-(Cm67|{rYWDP!Y8AfYQ_I;43A7XB{1Ynw2%tgXFFTJT;NX#G{D6V^}|d zVDJD7^jm?x;T-)4a6Qv{?DzgRb=^((gMaJ8lLIg#^ggES;cg28O4wNB&wi4wpM0>1vR)_@;4cOr@Ob#+|3e&Q7EJv(^^|?+hTO*&u!_h2Ss`y zx5A)}f$&VC1c<8AQN@#OY^LLn!S!0&Q*9~*T1_5YgpxCYw2a=t(UH`pO*9TnO)F@Z z{`~n3`;;u525tv@p!e>cBQ9@1N1Q-(w^ep?vvNE_t6@CZl1Ngs1HH`dhzAnP1TKgR z&x+=ipcT78VZ`UK6Yo4@10Zu1dFQ^1lLKX#%I7Y+9FjbP)?{2X?wBENh6hH0t!iov~!_g0%`C9z|%z*OpA9f0PuiVfdgO zf~Mpy6+QnL1HT-G5DZEdApC1jdVT`D&y5iJDway1HzLD3f(U2xlZ7~o-yeiq2;Q4Q zs9aAMpu!K)v!10Ec)Wr4NDwHhZq{nR)NJ^N3n_D#JihOkz~zHi5)l;c*?&PH>xu*& VCNKd3JGtOvEm(5t0lFyE{{i--k}m)N literal 0 HcmV?d00001 diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..dc3affc --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar diff --git a/CHANGELOG.md b/CHANGELOG.md index d722ba1..8826142 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,162 @@ +## 5.2.0 (06-05-2024) + +### Bugfix: 3 +- [#32027](https://parermine.regione.emilia-romagna.it/issues/32027) Aggiornamento metadati: errore 666 se si tenta di aggiornare i Dati Specifici dei componenti +- [#31821](https://parermine.regione.emilia-romagna.it/issues/31821) Correzione gestione data scadenza in caso di "certificato scaduto" (verifica firma eidas) +- [#31285](https://parermine.regione.emilia-romagna.it/issues/31285) Correzione messaggio di errore di aggiornamento metadati + +### Novità: 2 +- [#31672](https://parermine.regione.emilia-romagna.it/issues/31672) Introduzione TAG "temporany" su bucket staging (con lifecycle) +- [#29276](https://parermine.regione.emilia-romagna.it/issues/29276) Salvataggio diretto su OS di Aggiornamento metadati UD + +## 5.1.0 (04-04-2024) + +### Bugfix: 3 +- [#31300](https://parermine.regione.emilia-romagna.it/issues/31300) Aggiornamento metadati: errore 666 se si tenta di aggiornare i componenti +- [#31297](https://parermine.regione.emilia-romagna.it/issues/31297) Risoluzione errore 666 per AggiuntaAllegatiSync in caso di mancanza tag opzionale Configurazione +- [#29906](https://parermine.regione.emilia-romagna.it/issues/29906) Correzione della mancata gestione dell'errore per dati specifici che non coincidono con l'XSD + +## 5.0.0 (12-02-2024) + +### Novità: 1 +- [#30800](https://parermine.regione.emilia-romagna.it/issues/30800) Aggiornamento a Spring 5 + +## 4.14.0 (29-01-2024) + +### Novità: 1 +- [#31011](https://parermine.regione.emilia-romagna.it/issues/31011) Aggiornamento libreria DSS 5.13 + +## 4.13.0 (05-12-2023) + +### Bugfix: 1 +- [#30753](https://parermine.regione.emilia-romagna.it/issues/30753) Correzione su aggiornamento informazioni certification authority + +### Novità: 2 +- [#30849](https://parermine.regione.emilia-romagna.it/issues/30849) Creazione endpoint con informazioni sulla versione +- [#30718](https://parermine.regione.emilia-romagna.it/issues/30718) Eliminazione gestione persistenza di oggetti "raw" (base64) presenti su report EIDAS/CRYPTO + +## 4.12.0 (22-11-2023) + +### Bugfix: 1 +- [#30887](https://parermine.regione.emilia-romagna.it/issues/30887) Correzione bug mancato salvataggio sessioni di versamento aggiunta documenti + +### Novità: 4 +- [#30155](https://parermine.regione.emilia-romagna.it/issues/30155) Miglioramento della rappresentazione degli esiti dei controlli di revoca del certificato +- [#30037](https://parermine.regione.emilia-romagna.it/issues/30037) Gestione dell'errore: Rapporto versamento non disponibile +- [#29958](https://parermine.regione.emilia-romagna.it/issues/29958) Utilizzo degli EJB nella parte di aggiornamento metadati +- [#29613](https://parermine.regione.emilia-romagna.it/issues/29613) Rimozione della libreria esterna sacer-jpa + +## 4.11.1 (05-10-2023) + +### Bugfix: 1 +- [#30617](https://parermine.regione.emilia-romagna.it/issues/30617) Correzione configurazione per ripristino della versione 1.11.1 di Eidas + +## 4.11.0 (03-10-2023) + +### Novità: 4 +- [#30236](https://parermine.regione.emilia-romagna.it/issues/30236) Ripristino della versione 1.11.1 di Eidas +- [#30089](https://parermine.regione.emilia-romagna.it/issues/30089) Revisione partizionamenti aggiornamento metadati: aggiunta gestione campi per partizionamento +- [#29834](https://parermine.regione.emilia-romagna.it/issues/29834) Attività per la realizzazione della separazione delle sessioni: parte scrittura +- [#28309](https://parermine.regione.emilia-romagna.it/issues/28309) Servizio aggiornamento metadati: possibilità di eliminare l'elemento DatiSpecifici + +## 4.10.1 (13-09-2023) + +### Bugfix: 1 +- [#30211](https://parermine.regione.emilia-romagna.it/issues/30211) Downgrade alla versione 1.10.0 di Eidas + +## 4.10.0 (16-08-2023) + +### Bugfix: 1 +- [#30052](https://parermine.regione.emilia-romagna.it/issues/30052) Correzione su regressione parsing del report di verifica firma EIDAS-DSS 5.12 + +### Novità: 2 +- [#29881](https://parermine.regione.emilia-romagna.it/issues/29881) Aggiornamento alle versione 5.12 della libreria DSS +- [#29827](https://parermine.regione.emilia-romagna.it/issues/29827) Introduzione di tag sui versamenti non andati a buon fine per la definizione di politiche di retention + +## 4.9.0 (03-08-2023) + +### Novità: 1 +- [#29661](https://parermine.regione.emilia-romagna.it/issues/29661) Aggiornamento librerie obsolete 2023 + +## 4.8.0 (13-07-2023) + +### Bugfix: 1 +- [#29615](https://parermine.regione.emilia-romagna.it/issues/29615) Correzione errata valorizzazione del TipoRiferimentoTemporaleUsato in caso di verifica Crypto effettuata alla data di firma se il documento è privo di data di firma + +### Novità: 1 +- [#26423](https://parermine.regione.emilia-romagna.it/issues/26423) Servizio di Aggiornamento UD: aggiungere profilo normativo + +## 4.7.1 (15-06-2023) + +### Bugfix: 3 +- [#29761](https://parermine.regione.emilia-romagna.it/issues/29761) Correzione salvataggio evidenze di conservazione su versamento fascicolo 1.1 e 1.0 +- [#29645](https://parermine.regione.emilia-romagna.it/issues/29645) Correzione di un bug in fase di versamento +- [#29457](https://parermine.regione.emilia-romagna.it/issues/29457) Correzione errore nella verifica delle autorizzazioni + +### Novità: 1 +- [#29091](https://parermine.regione.emilia-romagna.it/issues/29091) Verifica di conformità sull'attributo "Signature acceptance validation" + +## 4.7.0 (19-05-2023) + +### Novità: 3 +- [#29084](https://parermine.regione.emilia-romagna.it/issues/29084) Separazione su Object Storage le evidenze di conservazione andate a buon fine dalle altre +- [#28970](https://parermine.regione.emilia-romagna.it/issues/28970) Gestione risposta Verifica Eidas se impostato a true UtilizzoDataFirmaPerRifTemp +- [#28489](https://parermine.regione.emilia-romagna.it/issues/28489) Eliminazione del salvataggio dei certificati della CA e delle CRL in fase di verifica + +## 4.6.0 (08-05-2023) + +### Novità: 1 +- [#28542](https://parermine.regione.emilia-romagna.it/issues/28542) Creazione pacchetto unico per sacerws + +## 4.5.1.1 (04-05-2023) + +### Bugfix: 1 +- [#29500](https://parermine.regione.emilia-romagna.it/issues/29500) Correzione gestione upload multipart large data object con RestTemplate (invocazione microservizio di verifica firma)  +## 4.5.1 (05-04-2023) + +### Bugfix: 6 +- [#28747](https://parermine.regione.emilia-romagna.it/issues/28747) Gestione upload multipart large data object con RestTemplate (invocazione microservizio di verifica firma)  +- [#28571](https://parermine.regione.emilia-romagna.it/issues/28571) Correzione verifica-controllo hash componente versato +- [#28565](https://parermine.regione.emilia-romagna.it/issues/28565) Correzione log errore in caso di problemi al salvataggio della sessione di versamento +- [#28449](https://parermine.regione.emilia-romagna.it/issues/28449) Correzione JPQL su viste in fase di persistenza URN unità documentaria +- [#28032](https://parermine.regione.emilia-romagna.it/issues/28032) Risoluzione errore 666 in caso di mancanza tag opzionale Configurazione +- [#27471](https://parermine.regione.emilia-romagna.it/issues/27471) Mancato funzionamento parametro FL_OBBL_DATA + +## 4.5.0 (28-02-2023) + +### Novità: 1 +- [#25924](https://parermine.regione.emilia-romagna.it/issues/25924) Salvataggio diretto su object storage + +### Bugfix: 3 +- [#28094](https://parermine.regione.emilia-romagna.it/issues/28094) Correzione di conversione nel passaggio dei parametri per il salvataggio sincrono +- [#28036](https://parermine.regione.emilia-romagna.it/issues/28036) Correzione su gestione caratteri non validi nelle risposte alle chiamate dei servizi +- [#27463](https://parermine.regione.emilia-romagna.it/issues/27463) gestione caso in cui TSA non contenga un certificato corretto + +### Novità: 1 +- [#28005](https://parermine.regione.emilia-romagna.it/issues/28005) Implementazione versamento diretto su Object storage + +## 4.4.0 (23-11-2022) + +### Novità: 1 +- [#27534](https://parermine.regione.emilia-romagna.it/issues/27534) aggiornamento libreria dss 5.10 + +## 4.2.1.2 (15-09-2022) + +### Bugfix: 2 +- [#27681](https://parermine.regione.emilia-romagna.it/issues/27681) Correzione persistenza date e timestamp con Hibernate e JPA 2.2 +- [#27629](https://parermine.regione.emilia-romagna.it/issues/27629) correzione dell'ERRORE FILESYS-003-00 su versamento DPI + +## 4.2.1.1 (09-09-2022) + +### Bugfix: 1 +- [#27617](https://parermine.regione.emilia-romagna.it/issues/27617) Correzione dell'errore Hibernate nel salvataggio di un documento + +## 3.2.1 (02-08-2022) + +### Bugfix: 1 +- [#27513](https://parermine.regione.emilia-romagna.it/issues/27513) Correzione problema di concorrenza nella creazione degli elenchi + ## 3.2.0 (31-05-2022) ### Novità: 2 @@ -25,11 +183,42 @@ ### Novità: 1 - [#26508](https://parermine.regione.emilia-romagna.it/issues/26508) Gestione nuove codifiche profili per versamento fascicolo +## 4.1.4.1 (11-04-2022) + +### Bugfix: 1 +- [#27093](https://parermine.regione.emilia-romagna.it/issues/27093) Correzione problema di chiusura connessione +## 4.1.4 (28-03-2022) + +### Bugfix: 3 +- [#26930](https://parermine.regione.emilia-romagna.it/issues/26930) Risoluzione del problema della mancata chiusura di connessioni al DB +- [#26850](https://parermine.regione.emilia-romagna.it/issues/26850) Errore mancata gestione nel versamento di un fascicolo +- [#26846](https://parermine.regione.emilia-romagna.it/issues/26846) Errore in caso di aggiornamento metadati con USERID errato + +### Novità: 1 +- [#26982](https://parermine.regione.emilia-romagna.it/issues/26982) aggiornamento versione hibernate con versione SACER WS 3.1.4 + ## 3.1.4 (24-03-2022) ### Bugfix: 1 - [#26746](https://parermine.regione.emilia-romagna.it/issues/26746) Errore nell'xsd di validazione della response +## 4.1.3.2 (23-02-2022) + +### Bugfix: 2 +- [#26819](https://parermine.regione.emilia-romagna.it/issues/26819) Errore 666 in SACER WS TEST +- [#26493](https://parermine.regione.emilia-romagna.it/issues/26493) Correzione errore 666P per disallineamento tra XSD e DB + +## 4.1.3.1 (18-02-2022) + +### Bugfix: 1 +- [#26804](https://parermine.regione.emilia-romagna.it/issues/26804) Errore 666p in SACER WS TEST + +## 4.1.3 (09-02-2022) + +### Novità: 2 +- [#26262](https://parermine.regione.emilia-romagna.it/issues/26262) Allineamento alla versione 3.1.3 (eclipselink) +- [#21190](https://parermine.regione.emilia-romagna.it/issues/21190) Migrazione Hibernate + ## 3.1.3 (31-01-2022) ### Novità: 1 diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..be3f7b2 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/README.md b/README.md index 1214737..56f1221 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,927 @@ -# SACER WS +# SACERWS -Progetto contenente tutti i web services esposti da sacer. +Fonte template redazione documento: https://www.makeareadme.com/. - Fornitore: Engineering - Struttura_RER: PARER -## Configurazioni per JBoss 6 EAP +# Descrizione -Vedere i seguenti documenti: -- [Configurazioni generali](src/docs/JBoss6_configurazione_generale.md) -- [Configurazioni specifiche di progetto](src/docs/JBoss6_configurazione_sacerws.md) +SACERWS è il modulo del Sistema di Conservazione SACER che espone i web service REST di versamento dei Pacchetti di Versamento (detti anche SIP o PdV) nel sistema di conservazione SACER. -#### TODO +I SIP devono rispettare una determinata struttura dati e sono composti da due elementi: -- Chiamata API per la gestione (quando si crea il tag git) di una relativa "documentazione" al fine di avere un report di tutte le relase (vedi menu laterale) +- INDICE SIP: un documento XML che contiene i metadati descrittivi dell’entità da versare e i Parametri di versamento. +- OGGETTO-DATI: una o più sequenze di bit (tipicamente in forma di file) da sottoporre a conservazione. + + +# Installazione + +Requisiti minimi per installazione: + +- Sistema operativo : consigliato Linux server (in alternativa compatibilità con Windows server); +- Java versione 8 (OpenJDK / Oracle); +- JBoss 7 EAP; +- Oracle DB (versione consigliata 19c). + +## Instalazione JDK + +Consigliata adozione della OpenJDK alla versione 8, guida all'installazione https://openjdk.org/install/. + +## Setup application server (Jboss 7) + +Richiesta l'esecuzione delle seguenti guide secondo l'ordine riportato di seguito: + +1. guida per la configurazione **base** di [guida 1](src/docs/JBoss7_configurazione_generale.md); +2. guida con le configurazioni **specifiche** per il contesto applicativo **SACERWS** di [guida 2](src/docs/JBoss7_configurazione_sacerws.md). + +### Deploy su JBoss 7 + +Di seguito le indicazioni per il rilascio su application server JBoss7: + +1. generazione dell'artifact attraverso tool maven, eseguire il seguente comando: + + ```bash + mvn package + ``` + +2. viene generato l'artifact .ear all'interno del modulo sacerws-ear/target (e.g. sacerws-5.2.0.ear) +3. deploy dell'ear generato allo step 1 su JBoss 7 (vedi configurazione [setup JBoss7](#setup-application-server-jboss-7)) + + +## Predisposizione database + +L'applicazione utilizza come DBMS di riferimento Oracle DB (https://www.oracle.com/it/database/) alla versione, consigliata, **19c**. Per l'installazione e la configurazione fare riferimento alle guide ufficiali. + +Per la creazione del modello E-R consultare il seguente [README.md](https://github.com/RegioneER/parer-db-init/blob/master/README.md) (progetto di riferimento https://github.com/RegioneER/parer-db-init). + + +## Configurazione bucket S3 Object Storage + +L'applicazione può essere integrata sulla base delle configurazioni impostate, vedi paragrafo [Setup application server (Jboss 7)](#setup-application-server-jboss-7), ad uno storage grid o object storage attraverso lo standard [AWS S3](https://aws.amazon.com/it/s3/). + +In questa sezione si vuole proporre un possibile scenario di configurazione dei bucket e, in particolar modo, di eventuali [lifecycle](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html) legati ad alcuni bucket, essenziali per gestire in modo corretto ed opportuno il ciclo di vita degli oggetti all'interno di determinati bucket; su quest'ultimo aspetto, si sottolinea, che alcuni flussi applicativi/servizi prevedono la creazione di oggetto "temporanei" ossia la cui esistenza è prevista per un determinato periodo temporale dopo il quale possono essere eliminati dal bucket stesso. + +### Configurazione dei bucket + +Una possibile configurazione dei bucket, proposta, è la seguente: + +- aggiornamenti-metadati : oggetti prodotti dal servizio di Aggiornamento Metadati (vedi README.md progetto "sacerws"); +- aip : oggetti prodotti dai processi di creazione dell'AIP; +- componenti : oggetti prodotti dai servizi di Versamento Unità Documentarie/Aggiunta documenti (vedi README.md progetto "sacerws"); +- indici-aip : oggetti prodotti dai processi di creazione degli indici AIP; +- reportvf : oggetti prodotti dalla creazione di report verifica firma su documenti processati dai servizi di Versamento Unità Documentarie/Aggiunta documenti (vedi README.md progetto "sacerws"); +- sessioni-agg-md-err-ko : oggetti prodotti dal servizio di Aggiornamento Metadati (vedi README.md progetto "sacerws"); +- vrs-staging : oggetti prodotti dai servizi di Versamento Unità Documentarie/Aggiunta documenti (vedi README.md progetto "sacerws"). + +I bucket possono essere creati con / senza versioning, alcuni dei bucket prevedono l'applicazione di lifecycle policy (consigliato), nello specifico: +- vrs-staging; +- sessioni-agg-md-err-ko. + +#### Lifecyle policy : casi d'uso + +Bucket : vrs-staging + +Esempio di lifecycle applicata (con filtri per tag) + +```json +{ + "Rules": [ + { + "Expiration": { + "Days": 183 + }, + "ID": "default_no_tag", + "Filter": { + "Prefix": "" + }, + "Status": "Enabled" + }, + { + "Expiration": { + "Days": 92 + }, + "ID": "file_componente_uddoc", + "Filter": { + "And": { + "Prefix": "", + "Tags": [ + { + "Key": "vrs-object-type", + "Value": "file_componente_uddoc" + } + ] + } + }, + "Status": "Enabled" + }, + { + "Expiration": { + "Days": 183 + }, + "ID": "xml_metadati_uddoc", + "Filter": { + "And": { + "Prefix": "", + "Tags": [ + { + "Key": "vrs-object-type", + "Value": "xml_metadati_uddoc" + } + ] + } + }, + "Status": "Enabled" + }, + { + "Expiration": { + "Days": 30 + }, + "ID": "orphan_objects", + "Filter": { + "And": { + "Prefix": "", + "Tags": [ + { + "Key": "orphan", + "Value": "true" + } + ] + } + }, + "Status": "Enabled" + }, + { + "Expiration": { + "Days": 2 + }, + "ID": "temporany_object", + "Filter": { + "And": { + "Prefix": "", + "Tags": [ + { + "Key": "vrs-object-type", + "Value": "temporany" + } + ] + } + }, + "Status": "Enabled" + } + ] +} ``` -curl --request POST --header 'Content-Type: application/json' --header "Private-Token: " --data '{"name": "sacerws-2.1.1", "tag_name": "sacerws-2.1.1", "description": "Test"}' "https://gitlab.ente.regione.emr.it/api/v4/projects/733/releases" -``` -Nota: 733 è l'ID del progetto / probabilmente su pipeline esiste una funzionalità apposita oppure si richiama l'API + +# Utilizzo + +A seconda del modello di SIP utilizzato e delle sue caratteristiche, il SIP potrebbe essere composto solo dall’Indice SIP. + +I SIP versati sono sottoposti a varie verifiche per essere accettati e presi in carico: +- Verifiche formali +- Verifiche semantiche +- Verifiche sul formato dei file versati +- Verifiche sulle firme digitali + +I servizi esposti sono i seguenti: + +- Versamento Unità documentarie (VersamentoSync): consente di versare in SACER un pacchetto di versamento contenente un’Unità documentaria; +- Aggiunta Documento (AggiuntaAllegatiSync): consente di versare in SACER un pacchetto di versamento contenente un Documento da aggiungere a un’Unità documentaria già presente nel sistema; +- Aggiornamento metadati Unità documentaria (AggiornamentoVersamentoSync): consente di versare in SACER un pacchetto di versamento contenente i metadati per aggiornare quelli di un’unità documentaria già presente nel sistema; +- Versamento Unità documentarie Multimedia (VersamentoMultiMedia): è una variante del servizio Versamento Unità documentarie in cui gli oggetti-dati (file) non sono trasmessi nella chiamata REST ma preventivamente collocati su un’area di lavoro e referenziati nell’Indice SIP; +- Versamento fascicolo (VersamentoFascicoloSync): consente di versare in SACER un pacchetto di versamento contenente un fascicolo. + +Tutti i dettagli sulla composizione dei SIP, le modalità di invocazione dei servizi e le verifiche effettuate al versamento sono nei documenti di specifiche tecniche pubblicate a questo indirizzo: Documentazione — ParER — Polo archivistico dell'Emilia-Romagna (regione.emilia-romagna.it) + +   +# Librerie utilizzate + +| GroupId | ArtifactId | Version | Type | Licenses | +|---|---|---|---|---| +|antlr|antlr|2.7.7.redhat-7|jar|BSD License| +|ch.qos.logback|logback-classic|1.2.1|jar|Eclipse Public License - v 1.0, GNU Lesser General Public License| +|com.codeborne|phantomjsdriver|1.4.4|jar|The BSD 2-Clause License| +|com.fasterxml|classmate|1.5.1.redhat-00001|jar|Apache License, Version 2.0| +|com.fasterxml.jackson.core|jackson-annotations|2.12.7.redhat-00003|jar|The Apache Software License, Version 2.0| +|com.fasterxml.jackson.core|jackson-core|2.12.7.redhat-00003|jar|The Apache Software License, Version 2.0| +|com.fasterxml.jackson.core|jackson-databind|2.12.7.redhat-00003|jar|The Apache Software License, Version 2.0| +|com.fasterxml.jackson.datatype|jackson-datatype-jdk8|2.12.7.redhat-00003|jar|The Apache Software License, Version 2.0| +|com.fasterxml.jackson.datatype|jackson-datatype-jsr310|2.12.7.redhat-00003|jar|The Apache Software License, Version 2.0| +|com.fasterxml.jackson.jaxrs|jackson-jaxrs-base|2.12.7.redhat-00003|jar|The Apache Software License, Version 2.0| +|com.fasterxml.jackson.jaxrs|jackson-jaxrs-json-provider|2.12.7.redhat-00003|jar|The Apache Software License, Version 2.0| +|com.fasterxml.jackson.module|jackson-module-jaxb-annotations|2.12.7.redhat-00003|jar|The Apache Software License, Version 2.0| +|com.fasterxml.woodstox|woodstox-core|6.4.0.redhat-00001|jar|The Apache License, Version 2.0| +|com.github.ben-manes.caffeine|caffeine|2.8.8.redhat-00001|jar|Apache License, Version 2.0| +|com.github.fge|json-patch|1.9.0.redhat-00002|jar|The Apache License, Version 2.0, Lesser General Public License, version 3 or greater| +|com.google.code.gson|gson|2.8.9.redhat-00001|jar|Apache-2.0| +|com.google.guava|failureaccess|1.0.1.redhat-00002|jar|Apache License, Version 2.0| +|com.google.guava|guava|30.1.0.redhat-00001|jar|Apache License, Version 2.0| +|com.google.inject|guice|4.2.1|no_aop|jar|The Apache Software License, Version 2.0| +|com.h2database|h2|1.4.197.redhat-00004|jar|MPL 2.0, EPL 1.0| +|com.sun.activation|jakarta.activation|1.2.2.redhat-00001|jar|EDL 1.0| +|com.sun.istack|istack-commons-runtime|3.0.10.redhat-00001|jar|Eclipse Distribution License - v 1.0| +|com.sun.mail|jakarta.mail|1.6.7.redhat-00001|jar|EPL 2.0, GPL2 w/ CPE, EDL 1.0| +|com.beanutils|commons-beanutils|1.9.4|jar|Apache License, Version 2.0| +|commons-cli|commons-cli|1.4|jar|Apache License, Version 2.0| +|commons-codec|commons-codec|1.15|jar|Apache License, Version 2.0| +|commons-fileupload|commons-fileupload|1.5|jar|Apache-2.0| +|commons-io|commons-io|2.12.0|jar|Apache-2.0| +|commons-jxpath|commons-jxpath|1.3|jar|The Apache Software License, Version 2.0| +|commons-logging|commons-logging|1.2|jar|The Apache Software License, Version 2.0| +|commons-net|commons-net|3.9.0|jar|Apache License, Version 2.0| +|io.netty|netty-handler|4.1.86.Final-redhat-00001|jar|Apache License, Version 2.0| +|io.netty|netty-transport-native-epoll|4.1.86.Final-redhat-00001|linux-x86_64|jar|Apache License, Version 2.0| +|io.reactivex.rxjava3|rxjava|3.0.9.redhat-00001|jar|-| +|io.undertow|undertow-core|2.2.24.SP1-redhat-00001|jar|Apache License Version 2.0| +|it.engparer|idp-jaas-rdbms|0.0.9|jar|-| +|it.engparer|parer-retry|2.1.0|jar|-| +|it.engparer|sacer-xml|2.7.0|jar|-| +|it.engparer|sacerws-ejb|4.12.0|-|ejb|-| +|it.engparer|sacerws-jpa|4.12.0|jar|-| +|it.engparer|sacerws-web|4.12.0|-|war|-| +|it.engparer|spagofat-core|4.11.0|jar|-| +|it.engparer|spagofat-middle|4.11.0|jar|-| +|it.engparer|spagofat-paginator-ejb|4.11.0|-|ejb|-| +|it.engparer|spagofat-paginator-gf|4.11.0|jar|-| +|it.engparer|spagofat-si-client|4.11.0|jar|-| +|it.engparer|spagofat-si-server|4.11.0|classes|jar|-| +|it.engparer|spagofat-si-util|4.11.0|jar|-| +|it.engparer|spagofat-sl-ejb|4.11.0|-|ejb|-| +|it.engparer|spagofat-sl-jpa|4.11.0|jar|-| +|it.engparer|spagofat-sl-slg|4.11.0|jar|-| +|it.engparer|spagofat-sl-web|4.11.0|classes|jar|-| +|it.engparer|spagofat-sl-web|4.11.0|-|war|-| +|it.engparer|spagofat-timer-wrapper-common|4.11.0|jar|-| +|it.engparer|spagofat-timer-wrapper-ejb|4.11.0|-|ejb|-| +|it.engparer|verificafirma-crypto-beans|1.3.0|jar|-| +|it.engparer|verificafirma-eidas-beans|1.7.0|jar|-| +|jakarta.enterprise|jakarta.enterprise.cdi-api|2.0.2.redhat-00002|jar|Apache License 2.0| +|jakarta.inject|jakarta.inject-api|1.0.3.redhat-00001|jar|The Apache Software License, Version 2.0| +|jakarta.json|jakarta.json-api|1.1.6.redhat-00001|jar|Eclipse Public License 2.0, GNU General Public License, version 2 with the GNU Classpath Exception| +|jakarta.json.bind|jakarta.json.bind-api|1.0.2.redhat-00001|jar|Eclipse Public License 2.0, GNU General Public License, version 2 with the GNU Classpath Exception| +|jakarta.persistence|jakarta.persistence-api|2.2.3.redhat-00001|jar|Eclipse Public License v. 2.0, Eclipse Distribution License v. 1.0| +|jakarta.security.enterprise|jakarta.security.enterprise-api|1.0.2.redhat-00001|jar|EPL 2.0, GPL2 w/ CPE| +|jakarta.validation|jakarta.validation-api|2.0.2.redhat-00001|jar|Apache License 2.0| +|javax.annotation|jsr250-api|1.0|jar|COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0| +|javax.inject|javax.inject|1|jar|The Apache Software License, Version 2.0| +|javax.jws|jsr181-api|1.0.0.MR1-redhat-8|jar|CDDL+GPLv2| +|javax.servlet|javax.servlet-api|4.0.1|jar|CDDL + GPLv2 with classpath exception| +|joda-time|joda-time|2.12.5|jar|Apache License, Version 2.0| +|net.bytebuddy|byte-buddy|1.11.12.redhat-00002|jar|Apache License, Version 2.0| +|net.java.xadisk|xadisk|1.2.2.5|jar|-| +|org.apache.commons|commons-collections4|4.4|jar|Apache License, Version 2.0| +|org.apache.commons|commons-compress|1.23.0|jar|Apache-2.0| +|org.apache.commons|commons-lang3|3.12.0|jar|Apache License, Version 2.0| +|org.apache.commons|commons-text|1.10.0|jar|Apache License, Version 2.0| +|org.apache.httpcomponents|httpclient|4.5.14|jar|Apache License, Version 2.0| +|org.apache.httpcomponents|httpcore|4.4.16|jar|Apache License, Version 2.0| +|org.apache.james|apache-mime4j-dom|0.8.9.redhat-00001|jar|Apache License, Version 2.0| +|org.apache.james|apache-mime4j-storage|0.8.9.redhat-00001|jar|Apache License, Version 2.0| +|org.apache.lucene|lucene-analyzers-common|5.5.5.redhat-2|jar|Apache 2| +|org.apache.lucene|lucene-core|5.5.5.redhat-2|jar|Apache 2| +|org.apache.lucene|lucene-facet|5.5.5.redhat-2|jar|Apache 2| +|org.apache.lucene|lucene-misc|5.5.5.redhat-2|jar|Apache 2| +|org.apache.lucene|lucene-queries|5.5.5.redhat-2|jar|Apache 2| +|org.apache.lucene|lucene-queryparser|5.5.5.redhat-2|jar|Apache 2| +|org.apache.maven|maven-artifact|3.6.3|jar|Apache License, Version 2.0| +|org.apache.maven|maven-builder-support|3.6.3|jar|Apache License, Version 2.0| +|org.apache.maven|maven-compat|3.6.3|jar|Apache License, Version 2.0| +|org.apache.maven|maven-core|3.6.3|jar|Apache License, Version 2.0| +|org.apache.maven|maven-embedder|3.6.3|jar|Apache License, Version 2.0| +|org.apache.maven|maven-model|3.6.3|jar|Apache License, Version 2.0| +|org.apache.maven|maven-model-builder|3.6.3|jar|Apache License, Version 2.0| +|org.apache.maven|maven-plugin-api|3.6.3|jar|Apache License, Version 2.0| +|org.apache.maven|maven-repository-metadata|3.6.3|jar|Apache License, Version 2.0| +|org.apache.maven|maven-resolver-provider|3.6.3|jar|Apache License, Version 2.0| +|org.apache.maven|maven-settings|3.6.3|jar|Apache License, Version 2.0| +|org.apache.maven|maven-settings-builder|3.6.3|jar|Apache License, Version 2.0| +|org.apache.maven|maven-slf4j-provider|3.6.3|jar|Apache License, Version 2.0| +|org.apache.maven.resolver|maven-resolver-api|1.4.1|jar|Apache License, Version 2.0| +|org.apache.maven.resolver|maven-resolver-connector-basic|1.4.1|jar|Apache License, Version 2.0| +|org.apache.maven.resolver|maven-resolver-impl|1.4.1|jar|Apache License, Version 2.0| +|org.apache.maven.resolver|maven-resolver-spi|1.4.1|jar|Apache License, Version 2.0| +|org.apache.maven.resolver|maven-resolver-transport-wagon|1.4.1|jar|Apache License, Version 2.0| +|org.apache.maven.resolver|maven-resolver-util|1.4.1|jar|Apache License, Version 2.0| +|org.apache.maven.shared|maven-shared-utils|3.2.1|jar|Apache License, Version 2.0| +|org.apache.maven.wagon|wagon-file|3.3.4|jar|Apache License, Version 2.0| +|org.apache.maven.wagon|wagon-http|3.3.4|shaded|jar|Apache License, Version 2.0| +|org.apache.maven.wagon|wagon-provider-api|3.3.4|jar|Apache License, Version 2.0| +|org.apache.poi|poi|4.1.2|jar|Apache License, Version 2.0| +|org.apache.santuario|xmlsec|2.2.3.redhat-00001|jar|Apache License, Version 2.0| +|org.apache.taglibs|taglibs-standard-impl|1.2.6.RC1-redhat-1|jar|Apache License, Version 2.0| +|org.apache.taglibs|taglibs-standard-spec|1.2.6.RC1-redhat-1|jar|Apache License, Version 2.0| +|org.apache.xmlbeans|xmlbeans|3.1.0|jar|The Apache Software License, Version 2.0| +|org.codehaus.jackson|jackson-core-asl|1.9.13.redhat-00007|jar|The Apache Software License, Version 2.0| +|org.codehaus.jackson|jackson-jaxrs|1.9.13.redhat-00007|jar|The Apache Software License, Version 2.0, GNU Lesser General Public License (LGPL), Version 2.1| +|org.codehaus.jackson|jackson-mapper-asl|1.9.13.redhat-00007|jar|The Apache Software License, Version 2.0| +|org.codehaus.jackson|jackson-xc|1.9.13.redhat-00007|jar|The Apache Software License, Version 2.0, GNU Lesser General Public License (LGPL), Version 2.1| +|org.codehaus.jettison|jettison|1.5.4|jar|Apache License, Version 2.0| +|org.codehaus.plexus|plexus-classworlds|2.6.0|jar|Apache License, Version 2.0| +|org.codehaus.plexus|plexus-component-annotations|2.1.0|jar|Apache License, Version 2.0| +|org.codehaus.plexus|plexus-interpolation|1.25|jar|Apache License, Version 2.0| +|org.codehaus.plexus|plexus-utils|3.2.1|jar|Apache License, Version 2.0| +|org.codehaus.woodstox|stax2-api|4.2.1.redhat-00001|jar|The BSD License| +|org.eclipse.sisu|org.eclipse.sisu.inject|0.3.4|jar|Eclipse Public License, Version 1.0| +|org.eclipse.sisu|org.eclipse.sisu.plexus|0.3.4|jar|Eclipse Public License, Version 1.0| +|org.fusesource.jansi|jansi|1.17.1|jar|The Apache Software License, Version 2.0| +|org.glassfish.jaxb|jaxb-runtime|2.3.3.b02-redhat-00002|jar|Eclipse Distribution License - v 1.0| +|org.glassfish.jaxb|txw2|2.3.3.b02-redhat-00002|jar|Eclipse Distribution License - v 1.0| +|org.hibernate|hibernate-envers|5.3.29.Final-redhat-00001|jar|GNU Library General Public License v2.1 or later| +|org.hibernate|hibernate-search-engine|5.10.13.Final-redhat-00001|jar|GNU Lesser General Public License v2.1 or later| +|org.hibernate|hibernate-search-orm|5.10.13.Final-redhat-00001|jar|GNU Lesser General Public License v2.1 or later| +|org.hibernate.common|hibernate-commons-annotations|5.0.5.Final-redhat-00002|jar|GNU Lesser General Public License v2.1 or later| +|org.hibernate.validator|hibernate-validator-annotation-processor|6.0.23.Final-redhat-00001|jar|Apache License 2.0| +|org.infinispan|infinispan-client-hotrod|11.0.17.Final-redhat-00001|jar|Apache License 2.0| +|org.infinispan|infinispan-commons|11.0.17.Final-redhat-00001|jar|Apache License 2.0| +|org.infinispan|infinispan-core|11.0.17.Final-redhat-00001|jar|Apache License 2.0| +|org.infinispan|infinispan-directory-provider|10.1.8.Final-redhat-00001|jar|Apache License 2.0| +|org.infinispan.protostream|protostream|4.3.5.Final-redhat-00001|jar|Apache License 2.0| +|org.javassist|javassist|3.27.0.GA-redhat-00001|jar|MPL 1.1, LGPL 2.1, Apache License 2.0| +|org.jboss|jandex|2.4.2.Final-redhat-00001|jar|Apache License, Version 2.0| +|org.jboss.arquillian.config|arquillian-config-api|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.config|arquillian-config-impl-base|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.config|arquillian-config-spi|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.container|arquillian-container-impl-base|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.container|arquillian-container-spi|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.container|arquillian-container-test-api|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.container|arquillian-container-test-impl-base|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.container|arquillian-container-test-spi|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.core|arquillian-core-api|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.core|arquillian-core-impl-base|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.core|arquillian-core-spi|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.extension|arquillian-drone-api|2.5.2|jar|Public Domain| +|org.jboss.arquillian.extension|arquillian-drone-appium-extension|2.5.2|jar|Public Domain| +|org.jboss.arquillian.extension|arquillian-drone-browserstack-extension|2.5.2|jar|Public Domain| +|org.jboss.arquillian.extension|arquillian-drone-configuration|2.5.2|jar|Public Domain| +|org.jboss.arquillian.extension|arquillian-drone-impl|2.5.2|jar|Public Domain| +|org.jboss.arquillian.extension|arquillian-drone-saucelabs-extension|2.5.2|jar|Public Domain| +|org.jboss.arquillian.extension|arquillian-drone-spi|2.5.2|jar|Public Domain| +|org.jboss.arquillian.extension|arquillian-drone-webdriver|2.5.2|jar|Public Domain| +|org.jboss.arquillian.extension|arquillian-drone-webdriver-depchain|2.5.2|-|pom|Public Domain| +|org.jboss.arquillian.graphene|graphene-webdriver|2.3.2|-|pom|GNU Lesser General Public License, Version 2.1| +|org.jboss.arquillian.junit|arquillian-junit-container|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.junit|arquillian-junit-core|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.junit|arquillian-junit-standalone|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.protocol|arquillian-protocol-jmx|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.protocol|arquillian-protocol-servlet|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.test|arquillian-test-api|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.test|arquillian-test-impl-base|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.test|arquillian-test-spi|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.testenricher|arquillian-testenricher-cdi|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.testenricher|arquillian-testenricher-ejb|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.testenricher|arquillian-testenricher-initialcontext|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.testenricher|arquillian-testenricher-resource|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.testng|arquillian-testng-container|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.testng|arquillian-testng-core|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.arquillian.testng|arquillian-testng-standalone|1.6.0.Final|jar|Apache License, Version 2.0| +|org.jboss.eap|wildfly-clustering-api|7.4.11.GA-redhat-00002|jar|GNU Lesser General Public License v2.1 or later| +|org.jboss.eap|wildfly-clustering-service|7.4.11.GA-redhat-00002|jar|GNU Lesser General Public License v2.1 or later| +|org.jboss.eap|wildfly-clustering-singleton-api|7.4.11.GA-redhat-00002|jar|GNU Lesser General Public License v2.1 or later| +|org.jboss.eap|wildfly-ejb-client-bom|7.4.11.GA|-|pom|Apache License 2.0| +|org.jboss.eap|wildfly-jaxws-client-bom|7.4.11.GA|-|pom|Apache License 2.0| +|org.jboss.eap|wildfly-jms-client-bom|7.4.11.GA|-|pom|Apache License 2.0| +|org.jboss.eap|wildfly-security-api|7.4.11.GA-redhat-00002|jar|GNU Lesser General Public License v2.1 or later| +|org.jboss.ejb3|jboss-ejb3-ext-api|2.3.0.Final-redhat-00001|jar|Public Domain| +|org.jboss.logging|commons-logging-jboss-logging|1.0.0.Final-redhat-1|jar|Apache License 2.0| +|org.jboss.logging|jboss-logging|3.4.1.Final-redhat-00001|jar|Apache License, version 2.0| +|org.jboss.msc|jboss-msc|1.4.12.Final-redhat-00001|jar|GNU Lesser General Public License v2.1 only| +|org.jboss.narayana.xts|jbossxts|5.11.4.Final-redhat-00001|api|jar|LGPL 2.1| +|org.jboss.resteasy|resteasy-atom-provider|3.15.7.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.resteasy|resteasy-client|3.15.7.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.resteasy|resteasy-jackson-provider|3.15.7.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.resteasy|resteasy-jackson2-provider|3.15.7.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.resteasy|resteasy-jaxb-provider|3.15.7.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.resteasy|resteasy-jaxrs|3.15.7.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.resteasy|resteasy-jettison-provider|3.15.7.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.resteasy|resteasy-jsapi|3.15.7.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.resteasy|resteasy-json-p-provider|3.15.7.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.resteasy|resteasy-multipart-provider|3.15.7.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.resteasy|resteasy-spring|3.15.7.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.resteasy|resteasy-validator-provider|3.15.7.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.security|jboss-negotiation-common|3.0.6.Final-redhat-00001|jar|GNU Lesser General Public License v2.1 or later| +|org.jboss.security|jboss-negotiation-extras|3.0.6.Final-redhat-00001|jar|GNU Lesser General Public License v2.1 or later| +|org.jboss.security|jboss-negotiation-ntlm|3.0.6.Final-redhat-00001|jar|GNU Lesser General Public License v2.1 or later| +|org.jboss.security|jboss-negotiation-spnego|3.0.6.Final-redhat-00001|jar|GNU Lesser General Public License v2.1 or later| +|org.jboss.security|jbossxacml|2.0.8.Final-redhat-8|jar|lgpl| +|org.jboss.shrinkwrap|shrinkwrap-api|1.2.6|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap|shrinkwrap-api-nio2|1.2.6|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap|shrinkwrap-depchain|1.2.6|-|pom|Apache License, Version 2.0| +|org.jboss.shrinkwrap|shrinkwrap-depchain-java7|1.2.6|-|pom|Apache License, Version 2.0| +|org.jboss.shrinkwrap|shrinkwrap-impl-base|1.2.6|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap|shrinkwrap-impl-nio2|1.2.6|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap|shrinkwrap-spi|1.2.6|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.descriptors|shrinkwrap-descriptors-api-base|2.0.0|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.descriptors|shrinkwrap-descriptors-api-javaee|2.0.0|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.descriptors|shrinkwrap-descriptors-api-jboss|2.0.0|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.descriptors|shrinkwrap-descriptors-depchain|2.0.0|-|pom|Apache License, Version 2.0| +|org.jboss.shrinkwrap.descriptors|shrinkwrap-descriptors-gen|2.0.0|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.descriptors|shrinkwrap-descriptors-impl-base|2.0.0|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.descriptors|shrinkwrap-descriptors-impl-javaee|2.0.0|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.descriptors|shrinkwrap-descriptors-impl-jboss|2.0.0|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.descriptors|shrinkwrap-descriptors-spi|2.0.0|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.resolver|shrinkwrap-resolver-api|2.2.7|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.resolver|shrinkwrap-resolver-api-gradle-embedded-archive|2.2.7|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.resolver|shrinkwrap-resolver-api-maven|2.2.7|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.resolver|shrinkwrap-resolver-api-maven-archive|2.2.7|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.resolver|shrinkwrap-resolver-api-maven-embedded|3.1.4|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.resolver|shrinkwrap-resolver-depchain|2.2.7|-|pom|Apache License, Version 2.0| +|org.jboss.shrinkwrap.resolver|shrinkwrap-resolver-gradle-depchain|2.2.7|-|pom|Apache License, Version 2.0| +|org.jboss.shrinkwrap.resolver|shrinkwrap-resolver-impl-gradle-embedded-archive|2.2.7|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.resolver|shrinkwrap-resolver-impl-maven|2.2.7|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.resolver|shrinkwrap-resolver-impl-maven-archive|2.2.7|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.resolver|shrinkwrap-resolver-impl-maven-embedded|3.1.4|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.resolver|shrinkwrap-resolver-spi|2.2.7|jar|Apache License, Version 2.0| +|org.jboss.shrinkwrap.resolver|shrinkwrap-resolver-spi-maven|2.2.7|jar|Apache License, Version 2.0| +|org.jboss.spec|jboss-jakartaee-8.0|1.0.1.Final-redhat-00007|-|pom|GNU Lesser General Public License, Version 2.1| +|org.jboss.spec.javax.annotation|jboss-annotations-api_1.3_spec|2.0.1.Final-redhat-00001|jar|EPL 2.0, GPL2 w/ CPE| +|org.jboss.spec.javax.batch|jboss-batch-api_1.0_spec|2.0.0.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.spec.javax.ejb|jboss-ejb-api_3.2_spec|2.0.0.Final-redhat-00001|jar|EPL 2.0, GPL2 w/ CPE| +|org.jboss.spec.javax.el|jboss-el-api_3.0_spec|2.0.1.Final-redhat-00001|jar|EPL 2.0, GPL2 w/ CPE, Apache 2.0, LGPL 2.1 or later| +|org.jboss.spec.javax.enterprise.concurrent|jboss-concurrency-api_1.0_spec|2.0.0.Final-redhat-00001|jar|EPL 2.0, GPL2 w/ CPE| +|org.jboss.spec.javax.faces|jboss-jsf-api_2.3_spec|3.0.0.SP07-redhat-00001|jar|EPL 2.0, GPL2 w/ CPE| +|org.jboss.spec.javax.interceptor|jboss-interceptors-api_1.2_spec|2.0.0.Final-redhat-00002|jar|EPL 2.0, GPL2 w/ CPE| +|org.jboss.spec.javax.jms|jboss-jms-api_2.0_spec|2.0.0.Final-redhat-00001|jar|Eclipse Public License 2.0, GNU General Public License, version 2 with the GNU Classpath Exception| +|org.jboss.spec.javax.management.j2ee|jboss-j2eemgmt-api_1.1_spec|2.0.0.Final-redhat-00001|jar|EPL 2.0, GPL2 w/ CPE| +|org.jboss.spec.javax.resource|jboss-connector-api_1.7_spec|2.0.0.Final-redhat-00001|jar|EPL 2.0, GPL2 w/ CPE| +|org.jboss.spec.javax.security.auth.message|jboss-jaspi-api_1.1_spec|2.0.1.Final-redhat-00001|jar|EPL 2.0, GPL2 w/ CPE| +|org.jboss.spec.javax.security.jacc|jboss-jacc-api_1.5_spec|2.0.0.Final-redhat-00001|jar|EPL 2.0, GPL2 w/ CPE| +|org.jboss.spec.javax.servlet|jboss-servlet-api_4.0_spec|2.0.0.Final-redhat-00001|jar|EPL 2.0, GPL2 w/ CPE| +|org.jboss.spec.javax.servlet.jsp|jboss-jsp-api_2.3_spec|2.0.0.Final-redhat-00001|jar|EPL 2.0, GPL2 w/ CPE| +|org.jboss.spec.javax.transaction|jboss-transaction-api_1.3_spec|2.0.0.Final-redhat-00005|jar|Eclipse Public License 2.0, GNU General Public License, Version 2 with the Classpath Exception| +|org.jboss.spec.javax.websocket|jboss-websocket-api_1.1_spec|2.0.0.Final-redhat-00001|jar|Eclipse Public License 2.0, GNU General Public License, version 2 with the GNU Classpath Exception| +|org.jboss.spec.javax.ws.rs|jboss-jaxrs-api_2.1_spec|2.0.1.Final-redhat-00001|jar|EPL 2.0, GPL2 w/ CPE| +|org.jboss.spec.javax.xml.bind|jboss-jaxb-api_2.3_spec|2.0.1.Final-redhat-00001|jar|Eclipse Distribution License - v 1.0| +|org.jboss.spec.javax.xml.soap|jboss-saaj-api_1.4_spec|1.0.2.Final-redhat-00002|jar|Eclipse Distribution License, Version 1.0| +|org.jboss.spec.javax.xml.ws|jboss-jaxws-api_2.3_spec|2.0.0.Final-redhat-00001|jar|Eclipse Distribution License - v 1.0| +|org.jboss.threads|jboss-threads|2.4.0.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.xnio|xnio-api|3.8.9.Final-redhat-00001|jar|Apache License 2.0| +|org.jboss.xnio|xnio-nio|3.8.9.Final-redhat-00001|jar|Apache License 2.0| +|org.jgroups|jgroups|4.2.15.Final-redhat-00001|jar|Apache License 2.0| +|org.jsoup|jsoup|1.12.1|jar|The MIT License| +|org.keycloak|keycloak-servlet-filter-adapter|21.1.1|jar|Apache License, Version 2.0| +|org.owasp.esapi|esapi|2.2.0.0|jar|BSD, Creative Commons 3.0 BY-SA| +|org.picketbox|picketbox|5.0.3.Final-redhat-00009|jar|GNU Lesser General Public License v2.1 only| +|org.picketbox|picketbox-commons|1.0.0.final-redhat-5|jar|lgpl| +|org.picketlink|picketlink-api|2.5.5.SP12-redhat-00012|jar|Apache License 2.0| +|org.picketlink|picketlink-common|2.5.5.SP12-redhat-00012|jar|Apache License 2.0| +|org.picketlink|picketlink-config|2.5.5.SP12-redhat-00012|jar|Apache License 2.0| +|org.picketlink|picketlink-federation|2.5.5.SP12-redhat-00012|jar|Apache License, Version 2.0| +|org.picketlink|picketlink-idm-api|2.5.5.SP12-redhat-00012|jar|Apache License 2.0| +|org.picketlink|picketlink-idm-impl|2.5.5.SP12-redhat-00012|jar|Apache License 2.0| +|org.picketlink|picketlink-impl|2.5.5.SP12-redhat-00012|jar|Apache License 2.0| +|org.powermock|powermock-reflect|1.7.4|jar|The Apache Software License, Version 2.0| +|org.reactivestreams|reactive-streams|1.0.3.redhat-00003|jar|-| +|org.seleniumhq.selenium|htmlunit-driver|2.28|jar|The Apache Software License, Version 2.0| +|org.seleniumhq.selenium|lift|3.11.0|jar|The Apache Software License, Version 2.0| +|org.seleniumhq.selenium|selenium-api|3.11.0|jar|The Apache Software License, Version 2.0| +|org.seleniumhq.selenium|selenium-chrome-driver|3.11.0|jar|The Apache Software License, Version 2.0| +|org.seleniumhq.selenium|selenium-edge-driver|3.11.0|jar|The Apache Software License, Version 2.0| +|org.seleniumhq.selenium|selenium-firefox-driver|3.11.0|jar|The Apache Software License, Version 2.0| +|org.seleniumhq.selenium|selenium-ie-driver|3.11.0|jar|The Apache Software License, Version 2.0| +|org.seleniumhq.selenium|selenium-java|3.11.0|jar|The Apache Software License, Version 2.0| +|org.seleniumhq.selenium|selenium-leg-rc|3.11.0|jar|The Apache Software License, Version 2.0| +|org.seleniumhq.selenium|selenium-opera-driver|3.11.0|jar|The Apache Software License, Version 2.0| +|org.seleniumhq.selenium|selenium-remote-driver|3.11.0|jar|The Apache Software License, Version 2.0| +|org.seleniumhq.selenium|selenium-safari-driver|3.11.0|jar|The Apache Software License, Version 2.0| +|org.seleniumhq.selenium|selenium-server|3.11.0|jar|The Apache Software License, Version 2.0| +|org.seleniumhq.selenium|selenium-support|3.11.0|jar|The Apache Software License, Version 2.0| +|org.slf4j|jcl-over-slf4j|2.0.7|jar|Apache License, Version 2.0| +|org.slf4j|log4j-over-slf4j|2.0.7|jar|Apache Software Licenses| +|org.slf4j|slf4j-api|2.0.7|jar|MIT License| +|org.slf4j|slf4j-log4j12|2.0.7|jar|MIT License| +|org.slf4j|slf4j-simple|1.7.29|jar|MIT License| +|org.sonatype.plexus|plexus-cipher|1.7|jar|Apache Public License 2.0| +|org.sonatype.plexus|plexus-sec-dispatcher|1.4|jar|Apache Public License 2.0| +|org.springframework|spring-aop|4.3.30.RELEASE|jar|Apache License, Version 2.0| +|org.springframework|spring-context|4.3.30.RELEASE|jar|Apache License, Version 2.0| +|org.springframework|spring-context-support|4.3.30.RELEASE|jar|Apache License, Version 2.0| +|org.springframework|spring-core|4.3.30.RELEASE|jar|Apache License, Version 2.0| +|org.springframework|spring-jdbc|4.3.30.RELEASE|jar|Apache License, Version 2.0| +|org.springframework|spring-orm|4.3.30.RELEASE|jar|Apache License, Version 2.0| +|org.springframework|spring-test|4.3.30.RELEASE|jar|Apache License, Version 2.0| +|org.springframework|spring-tx|4.3.30.RELEASE|jar|Apache License, Version 2.0| +|org.springframework|spring-web|4.3.30.RELEASE|jar|Apache License, Version 2.0| +|org.springframework|spring-webmvc|4.3.30.RELEASE|jar|Apache License, Version 2.0| +|org.springframework.security|spring-security-config|4.2.20.RELEASE|jar|The Apache Software License, Version 2.0| +|org.springframework.security|spring-security-core|4.2.20.RELEASE|jar|The Apache Software License, Version 2.0| +|org.springframework.security|spring-security-web|4.2.20.RELEASE|jar|The Apache Software License, Version 2.0| +|org.springframework.security.extensions|spring-security-saml2-core|1.0.10.RELEASE|jar|The Apache Software License, Version 2.0| +|org.testng|testng|6.11|jar|Apache 2.0| +|org.webjars|font-awesome|6.4.0|jar|CC BY 3.0| +|org.webjars|highlightjs|11.5.0|jar|BSD| +|org.webjars|jquery|3.6.4|jar|MIT License| +|org.webjars|jquery-ui|1.13.2|jar|MIT License| +|org.webjars|jstree|3.3.8|jar|MIT License, GPL| +|org.webjars|select2|4.0.13|jar|MIT| +|org.webjars.bower|chosen|1.8.7|jar|MIT| +|org.webjars.bowergithub.wcoder|highlightjs-line-numbers.js|2.7.0|jar|MIT| +|org.webjars.npm|highlightjs-badgejs|0.0.5|jar|MIT| +|org.wildfly.arquillian|wildfly-arquillian-common|3.0.1.Final|jar|Apache License Version 2.0| +|org.wildfly.arquillian|wildfly-arquillian-container-managed|3.0.1.Final|jar|Apache License Version 2.0| +|org.wildfly.arquillian|wildfly-arquillian-container-remote|3.0.1.Final|jar|Apache License Version 2.0| +|org.wildfly.client|wildfly-client-config|1.0.1.Final-redhat-00001|jar|Apache License 2.0| +|org.wildfly.common|wildfly-common|1.5.4.Final-redhat-00001|jar|Apache License 2.0| +|org.wildfly.discovery|wildfly-discovery-client|1.2.1.Final-redhat-00001|jar|Apache License 2.0| +|org.wildfly.security|wildfly-elytron|1.15.16.Final-redhat-00001|jar|Apache License 2.0| +|software.amazon.awssdk|accessanalyzer|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|account|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|acm|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|acmpca|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|alexaforbusiness|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|amp|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|amplify|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|amplifybackend|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|amplifyuibuilder|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|annotations|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|apache-client|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|apigateway|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|apigatewaymanagementapi|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|apigatewayv2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|appconfig|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|appconfigdata|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|appflow|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|appintegrations|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|applicationautoscaling|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|applicationcostprofiler|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|applicationdiscovery|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|applicationinsights|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|appmesh|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|apprunner|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|appstream|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|appsync|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|arczonalshift|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|arns|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|athena|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|auditmanager|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|auth|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|autoscaling|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|autoscalingplans|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|aws-cbor-protocol|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|aws-core|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|aws-crt-client|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|aws-json-protocol|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|aws-query-protocol|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|aws-xml-protocol|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|backup|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|backupgateway|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|backupstorage|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|batch|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|billingconductor|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|braket|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|budgets|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|chime|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|chimesdkidentity|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|chimesdkmediapipelines|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|chimesdkmeetings|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|chimesdkmessaging|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|chimesdkvoice|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cleanrooms|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cloud9|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cloudcontrol|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|clouddirectory|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cloudformation|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cloudfront|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cloudhsm|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cloudhsmv2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cloudsearch|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cloudsearchdomain|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cloudtrail|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cloudtraildata|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cloudwatch|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cloudwatch-metric-publisher|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cloudwatchevents|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cloudwatchlogs|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codeartifact|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codebuild|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codecatalyst|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codecommit|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codedeploy|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codegen|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codegen-lite|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codegen-lite-maven-plugin|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codegen-maven-plugin|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codeguruprofiler|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codegurureviewer|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codegurusecurity|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codepipeline|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codestar|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codestarconnections|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|codestarnotifications|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cognitoidentity|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cognitoidentityprovider|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|cognitosync|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|comprehend|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|comprehendmedical|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|computeoptimizer|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|config|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|connect|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|connectcampaigns|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|connectcases|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|connectcontactlens|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|connectparticipant|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|controltower|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|costandusagereport|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|costexplorer|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|customerprofiles|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|databasemigration|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|databrew|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|dataexchange|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|datapipeline|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|datasync|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|dax|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|detective|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|devicefarm|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|devopsguru|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|directconnect|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|directory|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|dlm|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|docdb|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|docdbelastic|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|drs|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|dynamodb|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|dynamodb-enhanced|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ebs|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ec2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ec2instanceconnect|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ecr|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ecrpublic|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ecs|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|efs|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|eks|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|elasticache|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|elasticbeanstalk|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|elasticinference|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|elasticloadbalancing|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|elasticloadbalancingv2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|elasticsearch|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|elastictranscoder|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|emr|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|emrcontainers|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|emrserverless|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|eventbridge|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|evidently|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|finspace|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|finspacedata|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|firehose|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|fis|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|fms|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|forecast|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|forecastquery|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|frauddetector|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|fsx|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|gamelift|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|gamesparks|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|glacier|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|globalaccelerator|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|glue|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|grafana|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|greengrass|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|greengrassv2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|groundstation|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|guardduty|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|health|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|healthlake|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|honeycode|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|http-client-spi|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iam|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|identitystore|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|imagebuilder|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|imds|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|inspector|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|inspector2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|internetmonitor|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iot|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iot1clickdevices|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iot1clickprojects|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iotanalytics|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iotdataplane|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iotdeviceadvisor|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iotevents|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ioteventsdata|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iotfleethub|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iotfleetwise|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iotjobsdataplane|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iotroborunner|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iotsecuretunneling|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iotsitewise|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iotthingsgraph|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iottwinmaker|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|iotwireless|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ivs|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ivschat|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ivsrealtime|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|json-utils|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|kafka|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|kafkaconnect|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|kendra|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|kendraranking|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|keyspaces|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|kinesis|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|kinesisanalytics|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|kinesisanalyticsv2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|kinesisvideo|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|kinesisvideoarchivedmedia|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|kinesisvideomedia|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|kinesisvideosignaling|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|kinesisvideowebrtcstorage|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|kms|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|lakeformation|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|lambda|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|lexmodelbuilding|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|lexmodelsv2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|lexruntime|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|lexruntimev2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|licensemanager|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|licensemanagerlinuxsubscriptions|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|licensemanagerusersubscriptions|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|lightsail|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|location|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|lookoutequipment|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|lookoutmetrics|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|lookoutvision|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|m2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|machinelearning|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|macie|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|macie2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|managedblockchain|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|marketplacecatalog|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|marketplacecommerceanalytics|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|marketplaceentitlement|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|marketplacemetering|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|mediaconnect|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|mediaconvert|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|medialive|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|mediapackage|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|mediapackagev2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|mediapackagevod|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|mediastore|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|mediastoredata|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|mediatailor|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|memorydb|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|metrics-spi|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|mgn|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|migrationhub|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|migrationhubconfig|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|migrationhuborchestrator|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|migrationhubrefactorspaces|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|migrationhubstrategy|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|mobile|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|mq|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|mturk|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|mwaa|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|neptune|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|netty-nio-client|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|networkfirewall|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|networkmanager|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|nimble|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|oam|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|omics|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|opensearch|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|opensearchserverless|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|opsworks|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|opsworkscm|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|organizations|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|osis|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|outposts|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|panorama|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|paymentcryptography|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|paymentcryptographydata|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|personalize|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|personalizeevents|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|personalizeruntime|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|pi|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|pinpoint|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|pinpointemail|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|pinpointsmsvoice|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|pinpointsmsvoicev2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|pipes|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|polly|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|pricing|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|privatenetworks|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|profiles|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|protocol-core|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|proton|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|qldb|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|qldbsession|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|quicksight|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ram|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|rbin|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|rds|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|rdsdata|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|redshift|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|redshiftdata|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|redshiftserverless|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|regions|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|rekognition|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|resiliencehub|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|resourceexplorer2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|resourcegroups|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|resourcegroupstaggingapi|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|robomaker|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|rolesanywhere|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|route53|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|route53domains|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|route53recoverycluster|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|route53recoverycontrolconfig|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|route53recoveryreadiness|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|route53resolver|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|rum|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|s3|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|s3-transfer-manager|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|s3control|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|s3outposts|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sagemaker|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sagemakera2iruntime|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sagemakeredge|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sagemakerfeaturestoreruntime|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sagemakergeospatial|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sagemakermetrics|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sagemakerruntime|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|savingsplans|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|scheduler|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|schemas|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sdk-core|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|secretsmanager|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|securityhub|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|securitylake|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|serverlessapplicationrepository|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|servicecatalog|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|servicecatalogappregistry|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|servicediscovery|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|servicequotas|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ses|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sesv2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sfn|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|shield|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|signer|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|simspaceweaver|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sms|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|snowball|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|snowdevicemanagement|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sns|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sqs|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ssm|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ssmcontacts|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ssmincidents|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ssmsap|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sso|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ssoadmin|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|ssooidc|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|storagegateway|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|sts|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|support|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|supportapp|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|swf|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|synthetics|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|textract|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|third-party-jackson-core|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|third-party-jackson-dataformat-cbor|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|timestreamquery|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|timestreamwrite|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|tnb|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|transcribe|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|transcribestreaming|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|transfer|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|translate|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|url-connection-client|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|utils|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|verifiedpermissions|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|voiceid|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|vpclattice|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|waf|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|wafv2|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|wellarchitected|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|wisdom|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|workdocs|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|worklink|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|workmail|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|workmailmessageflow|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|workspaces|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|workspacesweb|2.20.87|jar|Apache License, Version 2.0| +|software.amazon.awssdk|xray|2.20.87|jar|Apache License, Version 2.0| +|xalan|xalan|2.7.2|jar|The Apache Software License, Version 2.0| +|xerces|xercesImpl|2.12.0|jar|The Apache Software License, Version 2.0| + + +# Supporto + +Mantainer del progetto è [Engineering Ingegneria Informatica S.p.A.](https://www.eng.it/). + +# Contributi + +Se interessati a crontribuire alla crescita del progetto potete scrivere all'indirizzo email areasviluppoparer@regione.emilia-romagna.it. + +# Credits + +Progetto di proprietà di [Regione Emilia-Romagna](https://www.regione.emilia-romagna.it/) sviluppato a cura di [Engineering Ingegneria Informatica S.p.A.](https://www.eng.it/). + +# Licenza + +Questo progetto è rilasciato sotto licenza GNU Affero General Public License v3.0 or later ([LICENSE.txt](LICENSE.txt)). + +# Appendice + +## Documentazione aggiuntiva + +Alcuni riferimenti: + +- Documentazione: https://poloarchivistico.regione.emilia-romagna.it/documentazione diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 8741fbb..a3c669d 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,5 +1,10 @@ -## 3.2.0 (31-05-2022) +## 5.2.0 (06-05-2024) + +### Bugfix: 3 +- [#32027](https://parermine.regione.emilia-romagna.it/issues/32027) Aggiornamento metadati: errore 666 se si tenta di aggiornare i Dati Specifici dei componenti +- [#31821](https://parermine.regione.emilia-romagna.it/issues/31821) Correzione gestione data scadenza in caso di "certificato scaduto" (verifica firma eidas) +- [#31285](https://parermine.regione.emilia-romagna.it/issues/31285) Correzione messaggio di errore di aggiornamento metadati ### Novità: 2 -- [#27249](https://parermine.regione.emilia-romagna.it/issues/27249) Aggiornamento libreria DSS 5.9 -- [#27048](https://parermine.regione.emilia-romagna.it/issues/27048) Ottimizzazione job di Creazione elenchi di versamento - Producer coda IN_ATTESA_SCHED +- [#31672](https://parermine.regione.emilia-romagna.it/issues/31672) Introduzione TAG "temporany" su bucket staging (con lifecycle) +- [#29276](https://parermine.regione.emilia-romagna.it/issues/29276) Salvataggio diretto su OS di Aggiornamento metadati UD diff --git a/mvnw b/mvnw new file mode 100755 index 0000000..b7f0646 --- /dev/null +++ b/mvnw @@ -0,0 +1,287 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.1.1 +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + JAVA_HOME="`/usr/libexec/java_home`"; export JAVA_HOME + else + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`\\unset -f command; \\command -v java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + printf '%s' "$(cd "$basedir"; pwd)" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=$(find_maven_basedir "$(dirname $0)") +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" + else + wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) wrapperUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $wrapperUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + QUIET="--quiet" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + QUIET="" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" + else + wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" + fi + [ $? -eq 0 ] || rm -f "$wrapperJarPath" + elif command -v curl > /dev/null; then + QUIET="--silent" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + QUIET="" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L + else + curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L + fi + [ $? -eq 0 ] || rm -f "$wrapperJarPath" + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaSource="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaSource=`cygpath --path --windows "$javaSource"` + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaSource" ]; then + if [ ! -e "$javaClass" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaSource") + fi + if [ -e "$javaClass" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..cba1f04 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,187 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.1.1 +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %WRAPPER_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml index 069d479..225a91e 100644 --- a/pom.xml +++ b/pom.xml @@ -1,31 +1,32 @@ 4.0.0 - it.eng.parer sacerws - 3.3.0-SNAPSHOT + 5.2.1-SNAPSHOT pom sacerws Progetto SACERWS - it.eng.parer parer-pom - 3.0.17 + 5.2.0 UTF-8 - - 1.5.1 + - 2.2.17 + 2.8.0 - 4.1.26 - 1.2.0 - 1.0.1 - 2.0.3 + 5.12.0 + 1.9.0 + 1.3.0 + 2.1.0 + 0.0.9 + + 2.20.87 + 1.2.2.5 - + github @@ -42,18 +43,6 @@ - - ${project.groupId} - sacer-jpa-el - ${sacer.jpamodule.version} - weaved - - - ${project.groupId} - sacer-jpa-el - ${sacer.jpamodule.version} - sacer-vers - ${project.groupId} sacerws-ejb @@ -66,90 +55,36 @@ ${project.version} war + + ${project.groupId} + sacerws-jpa + ${project.version} + it.eng.parer sacer-xml ${sacer.xmlmodule.version} - it.eng.parer verificafirma-crypto-beans ${verificafirma-crypto-beans.version} - it.eng.parer verificafirma-eidas-beans ${verificafirma-eidas-beans.version} - - - junit - junit - ${junit.version} - test - - - commons-codec - commons-codec - ${commons-codec.version} - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - org.apache.commons - commons-text - ${commons-text.version} - org.apache.commons commons-compress ${commons-compress.version} - - commons-fileupload - commons-fileupload - ${commons-fileupload.version} - - - commons-io - commons-io - ${commons-io.version} - - - org.apache.httpcomponents - httpclient - ${httpclient.version} - org.apache.httpcomponents httpcore ${httpcore.version} - - org.glassfish.main.persistence - eclipselink-wrapper - ${eclipselink-wrapper.version} - pom - - - - org.jboss.bom.eap - jboss-javaee-6.0-with-tools - 6.4.0.GA - pom - import - - - org.jboss.spec - jboss-javaee-6.0 - pom - ${jboss-javaee-6.0.version} - xerces @@ -160,12 +95,7 @@ xalan xalan ${xalan.version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind.version} - + it.eng.parer parer-retry @@ -176,13 +106,13 @@ it.eng.parer idp-jaas-rdbms - 0.0.9 + ${idp-jaas-rdbms.version} - - com.amazonaws - aws-java-sdk-bom - ${aws-java-sdk-bom.version} + + software.amazon.awssdk + bom + ${software.amazon.awssdk.version} pom import @@ -195,60 +125,58 @@ import - - com.sun.xml.bind - jaxb-core - 2.3.0 - provided - - - com.sun.xml.bind - jaxb-impl - 2.3.0 - provided - - - javax.xml.bind - jaxb-api - 2.3.0 - provided - - - javax.xml.soap - javax.xml.soap-api - 1.4.0 - provided - - - com.sun.activation - javax.activation - 1.2.0 - provided - - - javax.annotation - javax.annotation-api - 1.3.2 - provided - - - javax.activation - javax.activation-api - 1.2.0 - provided - + + com.sun.xml.bind + jaxb-core + ${jaxb.version} + provided + + + com.sun.xml.bind + jaxb-impl + ${jaxb.version} + provided + + + javax.xml.bind + jaxb-api + ${jaxb.version} + provided + + + javax.xml.soap + javax.xml.soap-api + ${javax.xml.soap-api.version} + provided + + + com.sun.activation + javax.activation + ${javax.activation.version} + provided + + + javax.activation + javax.activation-api + ${javax.activation.version} + provided + + + javax.annotation + javax.annotation-api + ${javax.annotation-api.version} + provided + + + + net.java.xadisk + xadisk + ${xadisk.version} + - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - org.apache.maven.plugins maven-compiler-plugin @@ -283,11 +211,20 @@ + + org.apache.maven.plugins + maven-war-plugin + + + org.apache.maven.plugins + maven-ear-plugin + sacerws-ejb sacerws-web + sacerws-jpa sacerws-ear diff --git a/sacerws-ear/pom.xml b/sacerws-ear/pom.xml index 658b36c..f43a091 100644 --- a/sacerws-ear/pom.xml +++ b/sacerws-ear/pom.xml @@ -4,11 +4,10 @@ sacerws it.eng.parer - 3.3.0-SNAPSHOT + 5.2.1-SNAPSHOT - it.eng.parer - sacerws-ear + sacerws-ear ear sacerws-ear EAR @@ -19,7 +18,7 @@ ${project.groupId} - sacerws-ejb + sacerws-ejb ejb @@ -36,28 +35,28 @@ - + ${project.groupId} - sacerws-web - war + sacerws-web + war - + commons-fileupload - commons-fileupload - + commons-fileupload + it.eng.parer - spagofat-core + spagofat-core it.eng.parer - spagofat-middle + spagofat-middle @@ -70,44 +69,41 @@ - ${project.groupId} - sacer-jpa-el - sacer-vers + sacerws-jpa - - + sacerws-${project.version} - + org.apache.maven.plugins maven-ear-plugin - ${build.env} - + ${build.env} + ${project.groupId} - sacerws-ejb + sacerws-ejb - + ${project.groupId} - sacerws-web - /sacerws + sacerws-web + /sacerws - - + + Sacerws @application.xml_env@ ${project.version} ${maven.build.timestamp} SACERWS - + 6 - lib - true + lib + true diff --git a/sacerws-ear/src/main/application/META-INF/jboss-deployment-structure.xml b/sacerws-ear/src/main/application/META-INF/jboss-deployment-structure.xml index f555294..dafe4a1 100644 --- a/sacerws-ear/src/main/application/META-INF/jboss-deployment-structure.xml +++ b/sacerws-ear/src/main/application/META-INF/jboss-deployment-structure.xml @@ -2,16 +2,7 @@ - - - - - - - + + + 127.0.0.1 + + + + + + /home/mbertuzzi/projects/jbosseap + /usr/lib/jvm/java-1.8.0-openjdk-amd64 + + true + + + + diff --git a/sacerws-ejb/nbactions.xml b/sacerws-ejb/nbactions.xml new file mode 100644 index 0000000..f86d0d1 --- /dev/null +++ b/sacerws-ejb/nbactions.xml @@ -0,0 +1,32 @@ + + + + test.single + + * + + + test-compile + test + + + ${packageClassName} + + + + debug.test.single + + * + + + test-compile + test + + + ${packageClassName} + once + -agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} + true + + + diff --git a/sacerws-ejb/pom.xml b/sacerws-ejb/pom.xml index f1541db..2eda84d 100644 --- a/sacerws-ejb/pom.xml +++ b/sacerws-ejb/pom.xml @@ -3,10 +3,9 @@ sacerws it.eng.parer - 3.3.0-SNAPSHOT + 5.2.1-SNAPSHOT - it.eng.parer sacerws-ejb ejb sacerws-ejb @@ -14,6 +13,17 @@ UTF-8 + + + + org.jboss.arquillian + arquillian-bom + 1.4.0.Final + import + pom + + + @@ -26,29 +36,59 @@ junit test - + + org.apache.openejb + tomee-embedded + 1.7.5 + test + + + org.apache.openejb + openejb-junit + 4.7.5 + test + + + org.hamcrest + hamcrest-all + 1.3 + test + + + com.oracle + ojdbc16 + 11.2.0.3.0 + test + it.eng.parer verificafirma-crypto-beans + + ${project.groupId} + sacerws-jpa + + + it.eng.parer + spagofat-sl-jpa + + + it.eng.parer parer-retry - org.jboss.spec - jboss-javaee-6.0 + jboss-jakartaee-8.0 pom provided - it.eng.parer spagofat-core provided - it.eng.parer spagofat-middle @@ -60,19 +100,6 @@ - - - ${project.groupId} - sacer-jpa-el - sacer-vers - - - it.eng.parer - spagofat-sl-jpa - - - - ${project.groupId} sacer-xml @@ -103,16 +130,9 @@ org.apache.commons commons-text - - org.glassfish.main.persistence - eclipselink-wrapper - pom - provided - net.java.xadisk xadisk - 1.2.2.5 provided @@ -120,53 +140,6 @@ httpmime ${httpmime.version} - - org.apache.xmlgraphics - fop - ${fop.version} - - - org.apache.avalon.framework - avalon-framework-api - - - org.apache.avalon.framework - avalon-framework-impl - - - xalan - xalan - - - xml-apis - xml-apis - - - serializer - xalan - - - xml-apis-ext - xml-apis - - - - - avalon-framework - avalon-framework-api - 4.2.0 - - - avalon-framework - avalon-framework-impl - 4.2.0 - - - - - - - it.eng.parer verificafirma-eidas-beans @@ -185,7 +158,12 @@ - it.eng.parer @@ -199,18 +177,41 @@ org.apache.httpcomponents httpcore - - org.slf4j - slf4j-simple - test - ${slf4j.version} - - - com.amazonaws - aws-java-sdk-s3 + org.slf4j + slf4j-simple + test + ${slf4j.version} + + + software.amazon.awssdk + s3 + + + software.amazon.awssdk + apache-client + + + org.dom4j + dom4j - + + org.jboss.arquillian.junit + arquillian-junit-container + test + + + org.jboss.as + jboss-as-arquillian-container-managed + 7.1.1.Final + test + + + org.jboss.arquillian.protocol + arquillian-protocol-servlet + test + + @@ -221,7 +222,6 @@ 3.1 - diff --git a/sacerws-ejb/src/main/java/it/eng/parer/exception/ConnectionException.java b/sacerws-ejb/src/main/java/it/eng/parer/exception/ConnectionException.java new file mode 100644 index 0000000..5068ed5 --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/exception/ConnectionException.java @@ -0,0 +1,26 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.exception; + +public class ConnectionException extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ConnectionException(String message, Exception e) { + super(message, e); + } +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/exception/ParamApplicNotFoundException.java b/sacerws-ejb/src/main/java/it/eng/parer/exception/ParamApplicNotFoundException.java index 2be4842..12bbbb9 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/exception/ParamApplicNotFoundException.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/exception/ParamApplicNotFoundException.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. diff --git a/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerAbstractError.java b/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerAbstractError.java index 55fa652..746a275 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerAbstractError.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerAbstractError.java @@ -1,6 +1,21 @@ -package it.eng.parer.exception; +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ -import java.io.Serializable; +package it.eng.parer.exception; /** * La classe astratta EMFAbstractError dev'essere estesa da tutte quelle classi che rappresentano un errore @@ -12,7 +27,8 @@ * * Verifica EMFErrorHandler */ -public abstract class ParerAbstractError extends Exception implements Serializable { +public abstract class ParerAbstractError extends Exception { + private static final long serialVersionUID = 1L; public static final String ABSTRACT_ERROR_ELEMENT = "ABSTRACT_ERROR"; public static final String ERROR_SEVERITY = "SEVERITY"; public static final String ERROR_DESCRIPTION = "DESCRIPTION"; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerErrorCategory.java b/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerErrorCategory.java index 1cff5b3..d9de540 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerErrorCategory.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerErrorCategory.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.exception; public class ParerErrorCategory { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerErrorSeverity.java b/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerErrorSeverity.java index 907a6f3..f34ff24 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerErrorSeverity.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerErrorSeverity.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.exception; /** @@ -27,4 +44,4 @@ public static boolean isSeverityValid(String severity) { public static final String WARNING = "WARNING"; public static final String ERROR = "ERROR"; public static final String BLOCKING = "BLOCKING"; -} // public class EMFErrorSeverity \ No newline at end of file +} // public class EMFErrorSeverity diff --git a/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerNoResultException.java b/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerNoResultException.java index 742bc3f..54e2f31 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerNoResultException.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/exception/ParerNoResultException.java @@ -1,15 +1,31 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.exception; -import java.io.Serializable; import java.text.MessageFormat; import java.util.List; -import java.util.ResourceBundle; import java.util.Locale; import java.util.MissingResourceException; +import java.util.ResourceBundle; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -18,7 +34,7 @@ * * @author Agati_D */ -public class ParerNoResultException extends ParerAbstractError implements Serializable { +public class ParerNoResultException extends ParerAbstractError { private static final long serialVersionUID = 1L; public static final String USER_ERROR_ELEMENT = "USER_ERROR"; @@ -28,7 +44,7 @@ public class ParerNoResultException extends ParerAbstractError implements Serial private final transient Logger logger = LoggerFactory.getLogger(this.getClass()); private ResourceBundle _bundle = ResourceBundle.getBundle("it.eng.parer.exception.errors", Locale.ITALIAN); - public ParerNoResultException(String severity, String code, List params) { + public ParerNoResultException(String severity, String code, List params) { super(); init(severity, code, params); } @@ -47,7 +63,7 @@ public ParerNoResultException() { * Questo metodo ha il compito di inizializzare lo stato dell'oggetto, viene invocato da tutti i costruttori di * ParerUserError. */ - private void init(String severity, String code, List params) { + private void init(String severity, String code, List params) { logger.debug("ParerNoResultException::init: invocato"); setSeverity(severity); logger.debug("ParerNoResultException::init: severity [{}]", getSeverity()); @@ -72,7 +88,7 @@ public String getCategory() { return ParerErrorCategory.USER_ERROR; } - private String getText(String code, List params) { + private String getText(String code, List params) { if (code == null) return ""; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/exception/SacerWsException.java b/sacerws-ejb/src/main/java/it/eng/parer/exception/SacerWsException.java index a7ecf7d..34e1130 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/exception/SacerWsException.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/exception/SacerWsException.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. diff --git a/sacerws-ejb/src/main/java/it/eng/parer/exception/SacerWsRuntimeException.java b/sacerws-ejb/src/main/java/it/eng/parer/exception/SacerWsRuntimeException.java index 2d19d75..e568391 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/exception/SacerWsRuntimeException.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/exception/SacerWsRuntimeException.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelper.java index 1a5c34d..c93e9ea 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelper.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.firma.crypto.helper; import java.util.LinkedList; @@ -54,7 +71,7 @@ public class CryptoRestConfiguratorHelper implements RestConfiguratorHelper { private Long getLongParameter(final String name) { Long paramValue = null; try { - final String longParameterString = configurationHelper.getParamApplicValue(name); + final String longParameterString = configurationHelper.getValoreParamApplicByApplic(name); paramValue = Long.parseLong(longParameterString); } catch (ParamApplicNotFoundException | NumberFormatException ignore) { @@ -66,7 +83,7 @@ private Long getLongParameter(final String name) { private Integer getIntParameter(final String name) { Integer paramValue = null; try { - final String intParameterString = configurationHelper.getParamApplicValue(name); + final String intParameterString = configurationHelper.getValoreParamApplicByApplic(name); paramValue = Integer.parseInt(intParameterString); } catch (ParamApplicNotFoundException | NumberFormatException ignore) { @@ -79,7 +96,7 @@ private Integer getIntParameter(final String name) { private Boolean getBooleanParameter(final String name) { Boolean paramValue = true; try { - final String boolParameterString = configurationHelper.getParamApplicValue(name); + final String boolParameterString = configurationHelper.getValoreParamApplicByApplic(name); paramValue = Boolean.parseBoolean(boolParameterString); } catch (ParamApplicNotFoundException ignore) { @@ -132,7 +149,7 @@ public Boolean isCompositePolicyOptimisticParam() { @Override public List endPoints() { final List endPointCL = new LinkedList<>(); - final String endPointsString = configurationHelper.getParamApplicValue(CRYPTO_ENDPOINT); + final String endPointsString = configurationHelper.getValoreParamApplicByApplic(CRYPTO_ENDPOINT); Pattern.compile(ENDPOINT_SEPARATOR).splitAsStream(endPointsString).map(String::trim).forEach(endpoint -> { endPointCL.add(endpoint); }); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelper.java index 07ed957..0b97b63 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelper.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.firma.crypto.helper; import it.eng.parer.exception.ParamApplicNotFoundException; @@ -53,7 +70,7 @@ public class EidasRestConfiguratorHelper implements RestConfiguratorHelper { private Long getLongParameter(final String name) { Long paramValue = null; try { - final String longParameterString = configurationHelper.getParamApplicValue(name); + final String longParameterString = configurationHelper.getValoreParamApplicByApplic(name); paramValue = Long.parseLong(longParameterString); } catch (ParamApplicNotFoundException | NumberFormatException ignore) { @@ -66,7 +83,7 @@ private Long getLongParameter(final String name) { private Integer getIntParameter(final String name) { Integer paramValue = null; try { - final String intParameterString = configurationHelper.getParamApplicValue(name); + final String intParameterString = configurationHelper.getValoreParamApplicByApplic(name); paramValue = Integer.parseInt(intParameterString); } catch (ParamApplicNotFoundException | NumberFormatException ignore) { @@ -79,7 +96,7 @@ private Integer getIntParameter(final String name) { private Boolean getBooleanParameter(final String name) { Boolean paramValue = true; try { - final String boolParameterString = configurationHelper.getParamApplicValue(name); + final String boolParameterString = configurationHelper.getValoreParamApplicByApplic(name); paramValue = Boolean.parseBoolean(boolParameterString); } catch (ParamApplicNotFoundException ignore) { @@ -132,7 +149,7 @@ public Boolean isCompositePolicyOptimisticParam() { */ @Override public List endPoints() { - final String endPointsString = configurationHelper.getParamApplicValue(EIDAS_ENDPOINT); + final String endPointsString = configurationHelper.getValoreParamApplicByApplic(EIDAS_ENDPOINT); return Pattern.compile(ENDPOINT_SEPARATOR).splitAsStream(endPointsString).map(String::trim) .collect(Collectors.toCollection(LinkedList::new)); } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/VerificaFirmeSyncHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/VerificaFirmeSyncHelper.java deleted file mode 100644 index 57296f1..0000000 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/VerificaFirmeSyncHelper.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package it.eng.parer.firma.crypto.helper; - -import javax.ejb.Stateless; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Helper per il WS di verifica firme sync - * - * @author Snidero_L - */ -@Stateless -public class VerificaFirmeSyncHelper { - - Logger log = LoggerFactory.getLogger(VerificaFirmeSyncHelper.class); - - @PersistenceContext(unitName = "ParerJPA") - private EntityManager em; - - /** - * Effettua i controlli sull'utente del WS SOAP VerificaFirmeSync. TODO: da implementare appena c'è l'utente. - * - * @param userName - * nome utente - * @param password - * password - * - * @return autorizzato o meno - */ - public boolean checkAuthorization(String userName, String password) { - return true; - } -} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/CryptoInvoker.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/CryptoInvoker.java index 75b758e..08a9f81 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/CryptoInvoker.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/CryptoInvoker.java @@ -1,9 +1,30 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.firma.crypto.verifica; import java.io.File; -import java.util.Date; +import java.net.URI; +import java.time.ZonedDateTime; +import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; import javax.ejb.EJB; import javax.ejb.LocalBean; @@ -11,12 +32,21 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.core.io.FileSystemResource; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import it.eng.parer.crypto.model.verifica.CryptoAroCompDoc; +import it.eng.parer.crypto.model.verifica.input.CryptoDataToValidateBody; +import it.eng.parer.crypto.model.verifica.input.CryptoDataToValidateDataUri; import it.eng.parer.crypto.model.verifica.input.CryptoDataToValidateMetadata; import it.eng.parer.crypto.model.verifica.input.CryptoDataToValidateMetadataFile; import it.eng.parer.crypto.model.verifica.input.CryptoProfiloVerifica; @@ -33,21 +63,9 @@ import it.eng.parer.firma.xml.VerificaFirmaWrapper; import it.eng.parer.retry.ParerRetryConfiguration; import it.eng.parer.retry.RestRetryInterceptor; -import it.eng.parer.util.ejb.help.ConfigurationHelper; import it.eng.parer.ws.utils.ParametroApplDB.ParametroApplFl; import it.eng.parer.ws.versamento.dto.AbsVersamentoExt; import it.eng.parer.ws.versamento.dto.ComponenteVers; -import java.net.URI; -import java.time.ZonedDateTime; -import java.util.ArrayList; -import java.util.stream.Collectors; -import org.springframework.core.io.FileSystemResource; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestClientException; /** * @@ -59,10 +77,7 @@ public class CryptoInvoker implements IVerificaFirmaInvoker { private static final Logger LOG = LoggerFactory.getLogger(CryptoInvoker.class.getName()); - @EJB - protected ConfigurationHelper configurationHelper; - - private static final String FIRMA_API_PATH = "/v2/report-verifica"; + private static final String FIRMA_API_PATH = "/api/report-verifica"; @EJB protected CryptoRestConfiguratorHelper restInvoker; @@ -150,6 +165,33 @@ private CryptoAroCompDoc verificaCrypto(File contenuto, List marcheDetache return componente; } + private CryptoAroCompDoc verificaCrypto(CryptoDataToValidateDataUri data, CryptoDataToValidateMetadata metadata) + throws VerificaFirmaConnectionException, VerificaFirmaGenericInvokeException { + + RestTemplate restTemplate = buildRestTemplateWithRetry(); + + String preferredUrl = restInvoker.preferredEndpoint(); + String urlCrypto = preferredUrl + FIRMA_API_PATH; + + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + + CryptoDataToValidateBody body = new CryptoDataToValidateBody(); + body.setData(data); + body.setMetadata(metadata); + + HttpEntity entity = new HttpEntity<>(body, headers); + CryptoAroCompDoc componente = null; + try { + componente = restTemplate.postForObject(urlCrypto, entity, CryptoAroCompDoc.class); + } catch (RestClientException rce) { + throw new VerificaFirmaConnectionException(rce, CdServizioVerificaCompDoc.CRYPTO.name(), urlCrypto); + } catch (Exception ex) { + throw new VerificaFirmaGenericInvokeException(ex, CdServizioVerificaCompDoc.CRYPTO.name(), urlCrypto); + } + return componente; + } + /** * Verifica delle firme utilizzando la cryptolibrary. * @@ -185,14 +227,62 @@ public VerificaFirmaWrapper verificaAndWrapIt(ComponenteVers componenteVers, throws VerificaFirmaWrapperResNotFoundException, VerificaFirmaConnectionException, VerificaFirmaWrapperGenericException, VerificaFirmaGenericInvokeException { - // Verifico il componente + // Preparo i metadati + CryptoDataToValidateMetadata metadata = buildMetadata(componenteVers, sottoComponentiFirma, + sottoComponentiMarca, controlliAbilitati, dataDiRiferimento, verificaAllaDataDiFirma, uuid); + + final boolean hasFirmeDetached = sottoComponentiFirma != null && !sottoComponentiFirma.isEmpty(); + CryptoAroCompDoc output; + if (isComponenteSuObjectStorage(componenteVers)) { + + CryptoDataToValidateDataUri data = buildDataUri(componenteVers, sottoComponentiFirma, sottoComponentiMarca); + output = verificaCrypto(data, metadata); + + } else { + + // File firme detached (o null) + List sottoComponentiMarcaFile = compilaFileDetached(sottoComponentiMarca); + // File marche detached (o null) + List sottoComponentiFirmaFile = compilaFileDetached(sottoComponentiFirma); + + output = verificaCrypto(componenteVers.getRifFileBinario().getFileSuDisco(), sottoComponentiMarcaFile, + sottoComponentiFirmaFile, metadata); + + } + + CryptoWrapperResultStrategy strategy = new CryptoWrapperResultStrategy(); + return strategy.buildVFWrapper(output, hasFirmeDetached); + } + + /** + * ATTENZIONE a questo livello ho bisogno di capire se il componente di cui devo effettaure la + * verifica sia su file system oppure sull'object storage. Questo metodo ha proprio lo scopo di individuare questo + * caso ma, per ora, non ho trovato un modo migliore per capire dove sia l'oggetto. Non è scorretto ma forse non è + * molto robusto perché valuta solamente il componente principale. + * + * + * @param componenteVers + * componente versato + * + * @return true se il riferimento al file del componente è sull'object storage. + */ + private boolean isComponenteSuObjectStorage(ComponenteVers componenteVers) { + return componenteVers.getRifFileBinario().getObjectStorageResource() != null; + } + + private CryptoDataToValidateMetadata buildMetadata(ComponenteVers componenteVers, + List sottoComponentiFirma, List sottoComponentiMarca, + Map controlliAbilitati, ZonedDateTime dataDiRiferimento, boolean verificaAllaDataDiFirma, + String uuid) { // Configurazione profilo di verificaCrypto custom per la struttura. CryptoProfiloVerifica profiloVerifica = new CryptoProfiloVerifica() .setControlloCrittograficoAbilitato( controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_CRITTOG_VERS)) .setControlloCatenaTrustAbilitato(controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_TRUST_VERS)) .setControlloCertificatoAbilitato(controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_CERTIF_VERS)) - .setControlloCrlAbilitato(controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS)); + .setControlloCrlAbilitato(controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS)) + .setIncludeCertificateAndRevocationValues( + controlliAbilitati.get(ParametroApplFl.FL_CRYPTO_INCLUDI_FILEBASE64)); CryptoDataToValidateMetadata metadata = new CryptoDataToValidateMetadata(); metadata.setUuid(uuid); @@ -201,9 +291,14 @@ public VerificaFirmaWrapper verificaAndWrapIt(ComponenteVers componenteVers, if (verificaAllaDataDiFirma) { metadata.setTipologiaDataRiferimento(TipologiaDataRiferimento.verificaAllaDataDiFirma()); } else { - if (dataDiRiferimento != null) { + boolean isDataDiRiferimentoOnCompVers = !Objects + .isNull(componenteVers.withAcdEntity().getTmRifTempVers());/* data di rif. su xml */ + if (isDataDiRiferimentoOnCompVers) { metadata.setTipologiaDataRiferimento(TipologiaDataRiferimento .verificaAllaDataSpecifica(dataDiRiferimento.toInstant().toEpochMilli())); + } else { + metadata.setTipologiaDataRiferimento( + TipologiaDataRiferimento.verificaDataVersamento(dataDiRiferimento.toInstant().toEpochMilli())); } } // Metadati componente principale @@ -216,21 +311,20 @@ public VerificaFirmaWrapper verificaAndWrapIt(ComponenteVers componenteVers, List metadatiFirmeDetached = compilaMetadatiElementiDetached( sottoComponentiFirma); metadata.setSottoComponentiFirma(metadatiFirmeDetached); + return metadata; + } - // File firme detached (o null) - List sottoComponentiMarcaFile = compilaFileDetached(sottoComponentiMarca); - // File marche detached (o null) - List sottoComponentiFirmaFile = compilaFileDetached(sottoComponentiFirma); - - final boolean hasFirmeDetached = sottoComponentiFirma != null && !sottoComponentiFirma.isEmpty(); - - CryptoAroCompDoc output = verificaCrypto(componenteVers.getRifFileBinario().getFileSuDisco(), - sottoComponentiMarcaFile, sottoComponentiFirmaFile, metadata); + private CryptoDataToValidateDataUri buildDataUri(ComponenteVers componenteVers, + List sottoComponentiFirma, List sottoComponentiMarca) { + CryptoDataToValidateDataUri data = new CryptoDataToValidateDataUri(); - CryptoWrapperResultStrategy strategy = new CryptoWrapperResultStrategy(versamento); - VerificaFirmaWrapper wrapper = strategy.buildVFWrapper(output, dataDiRiferimento, hasFirmeDetached); + data.setContenuto(componenteVers.getRifFileBinario().getObjectStorageResource().getPresignedURL()); + List marche = compilaURIDetached(sottoComponentiMarca); + List firme = compilaURIDetached(sottoComponentiFirma); + data.setMarche(marche); + data.setFirme(firme); - return wrapper; + return data; } private List compilaMetadatiElementiDetached( @@ -252,6 +346,16 @@ private List compilaFileDetached(List componenteDetached) return elementiDetached; } + private List compilaURIDetached(List componenteDetached) { + List elementiDetached = null; + if (componenteDetached != null) { + elementiDetached = componenteDetached.stream() + .map(m -> m.getRifFileBinario().getObjectStorageResource().getPresignedURL()) + .collect(Collectors.toCollection(ArrayList::new)); + } + return elementiDetached; + } + /** * Crea il client per le chiamate rest relativo a questo bean * @@ -274,7 +378,7 @@ private RestTemplate buildRestTemplateWithRetry() { template.setErrorHandler(new CryptoErrorHandler()); List endpoints = restInvoker.endPoints(); - List endpointsURI = endpoints.stream().map(e -> URI.create(e)).collect(Collectors.toList()); + List endpointsURI = endpoints.stream().map(URI::create).collect(Collectors.toList()); ParerRetryConfiguration retryClient = restInvoker.retryClient(); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/VerFormatiEnums.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/VerFormatiEnums.java index 447e238..edcd897 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/VerFormatiEnums.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/VerFormatiEnums.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/VerificaFirmeSyncHandler.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/VerificaFirmeSyncHandler.java deleted file mode 100644 index d8bd14b..0000000 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/VerificaFirmeSyncHandler.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package it.eng.parer.firma.crypto.verifica; - -import it.eng.parer.firma.crypto.helper.VerificaFirmeSyncHelper; -import it.eng.spagoLite.security.auth.AuthenticationHandlerConstants; -import static it.eng.spagoLite.security.auth.AuthenticationHandlerConstants.QNAME_WSSE_HEADER; -import static it.eng.spagoLite.security.auth.AuthenticationHandlerConstants.WSSE_XSD_URI; -import java.util.HashSet; -import java.util.Set; -import javax.ejb.EJB; -import javax.ejb.Stateless; -import javax.servlet.http.HttpServletRequest; -import javax.xml.namespace.QName; -import javax.xml.soap.SOAPException; -import javax.xml.soap.SOAPFactory; -import javax.xml.soap.SOAPFault; -import javax.xml.ws.ProtocolException; -import javax.xml.ws.handler.MessageContext; -import javax.xml.ws.handler.soap.SOAPHandler; -import javax.xml.ws.handler.soap.SOAPMessageContext; -import javax.xml.ws.soap.SOAPFaultException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.DOMException; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * Handler per il WS SOAP di Verifica Firme Sync - */ -@Stateless -public class VerificaFirmeSyncHandler implements SOAPHandler { - - private static final Logger log = LoggerFactory.getLogger(VerificaFirmeSyncHandler.class); - - @EJB - private VerificaFirmeSyncHelper helper; - - @Override - public boolean handleMessage(SOAPMessageContext msgCtx) { - Boolean outbound = (Boolean) msgCtx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); - String ipAddress = "NON_CALCOLATO"; - if (!outbound) { - Object tmpRequest = msgCtx.get(MessageContext.SERVLET_REQUEST); - if (tmpRequest != null && tmpRequest instanceof HttpServletRequest) { - ipAddress = ((HttpServletRequest) tmpRequest).getHeader("X-FORWARDED-FOR"); - if (ipAddress == null || ipAddress.isEmpty()) { - ipAddress = ((HttpServletRequest) tmpRequest).getRemoteAddr(); - } - } - log.debug("VerificaFirmeSyncHandler attivato. Client IP Address: " + ipAddress); - - try { - NodeList usernameEl = (NodeList) msgCtx.getMessage().getSOAPHeader() - .getElementsByTagNameNS(WSSE_XSD_URI, "Username"); - NodeList passwordEl = (NodeList) msgCtx.getMessage().getSOAPHeader() - .getElementsByTagNameNS(WSSE_XSD_URI, "Password"); - Node userNode = null; - Node passNode = null; - if (usernameEl != null && passwordEl != null && (userNode = usernameEl.item(0)) != null - && (passNode = passwordEl.item(0)) != null) { - String username = userNode.getFirstChild().getNodeValue(); - String password = passNode.getFirstChild().getNodeValue(); - - boolean authorized = helper.checkAuthorization(username, password); - - if (!authorized) { - try { - SOAPFactory fac = SOAPFactory.newInstance(); - SOAPFault sfault = fac.createFault(); - sfault.setFaultCode("ERR_USER"); - sfault.setFaultString("Utente mancante o non autorizzato per invocare il servizio"); - throw new SOAPFaultException(sfault); - } catch (SOAPException e1) { - log.error("Errore durante la creazione dell'eccezione SOAP", e1); - throw new ProtocolException(e1); - } - } - msgCtx.put(AuthenticationHandlerConstants.AUTHN_STAUTS, java.lang.Boolean.TRUE); - msgCtx.put(AuthenticationHandlerConstants.USER, username); - msgCtx.put(AuthenticationHandlerConstants.PWD, password); - } else { - throw new ProtocolException("Username e password sono obbligatorie"); - } - - } catch (DOMException | SOAPException e) { - throw new ProtocolException(e); - } - msgCtx.setScope(AuthenticationHandlerConstants.AUTHN_STAUTS, MessageContext.Scope.APPLICATION); - msgCtx.setScope(AuthenticationHandlerConstants.USER, MessageContext.Scope.APPLICATION); - msgCtx.setScope(AuthenticationHandlerConstants.PWD, MessageContext.Scope.APPLICATION); - } - return true; - } - - @Override - public boolean handleFault(SOAPMessageContext context) { - return true; - } - - @Override - public void close(MessageContext context) { - } - - @Override - public Set getHeaders() { - HashSet headers = new HashSet(); - headers.add(QNAME_WSSE_HEADER); - return headers; - } - -} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/CompDocMock.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/CompDocMock.java index 52a7204..858ff28 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/CompDocMock.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/CompDocMock.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.firma.dto; import java.math.BigDecimal; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/StatoComponente.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/StatoComponente.java index 7b4aa1e..94057df 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/StatoComponente.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/StatoComponente.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -32,7 +49,7 @@ public class StatoComponente { public boolean ctrlFirmeCatenaNegativo = false; public boolean ctrlFirmeCertificatoWarning = false; public boolean ctrlFirmeCertificatoErrore = false; - public boolean ctrlFirmeCertificatoScad = false; + public boolean ctrlFirmeCertificatoScadRev = false; public boolean ctrlFirmeCertificatoNoValid = false; public boolean ctrlFirmeCertificatoErrato = false; public boolean ctrlFirmeCRLWarning = false; @@ -81,7 +98,7 @@ public void reset() { ctrlFirmeCertificatoWarning = false; ctrlFirmeCertificatoErrore = false; - ctrlFirmeCertificatoScad = false; + ctrlFirmeCertificatoScadRev = false; ctrlFirmeCertificatoNoValid = false; ctrlFirmeCertificatoErrato = false; @@ -126,7 +143,7 @@ public int hashCode() { result = prime * result + (ctrlFirmeCertificatoErrato ? 1231 : 1237); result = prime * result + (ctrlFirmeCertificatoErrore ? 1231 : 1237); result = prime * result + (ctrlFirmeCertificatoNoValid ? 1231 : 1237); - result = prime * result + (ctrlFirmeCertificatoScad ? 1231 : 1237); + result = prime * result + (ctrlFirmeCertificatoScadRev ? 1231 : 1237); result = prime * result + (ctrlFirmeCertificatoWarning ? 1231 : 1237); result = prime * result + (ctrlFirmeCrittErrore ? 1231 : 1237); result = prime * result + (ctrlFirmeCrittNegativo ? 1231 : 1237); @@ -192,7 +209,7 @@ public boolean equals(Object obj) { return false; if (ctrlFirmeCertificatoNoValid != other.ctrlFirmeCertificatoNoValid) return false; - if (ctrlFirmeCertificatoScad != other.ctrlFirmeCertificatoScad) + if (ctrlFirmeCertificatoScadRev != other.ctrlFirmeCertificatoScadRev) return false; if (ctrlFirmeCertificatoWarning != other.ctrlFirmeCertificatoWarning) return false; @@ -223,4 +240,4 @@ public boolean equals(Object obj) { return true; } -} \ No newline at end of file +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/StatoDocumento.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/StatoDocumento.java index a08e4dd..b801cab 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/StatoDocumento.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/StatoDocumento.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -63,4 +80,4 @@ public boolean equals(Object obj) { return false; return true; } -} \ No newline at end of file +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/input/InvokeVerificaInput.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/input/InvokeVerificaInput.java index 9012b65..cceefd1 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/input/InvokeVerificaInput.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/input/InvokeVerificaInput.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.firma.dto.input; import java.io.Serializable; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/input/InvokeVerificaRule.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/input/InvokeVerificaRule.java index 164fecd..d74357f 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/input/InvokeVerificaRule.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/dto/input/InvokeVerificaRule.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -52,7 +69,9 @@ private static Map defaultAbilitazioni() { .of(new Object[][] { { ParametroApplFl.FL_ABILITA_CONTR_CRITTOG_VERS, true }, { ParametroApplFl.FL_ABILITA_CONTR_TRUST_VERS, true }, { ParametroApplFl.FL_ABILITA_CONTR_CERTIF_VERS, true }, - { ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS, true } }) + { ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS, true }, + { ParametroApplFl.FL_EIDAS_INCLUDI_FILEBASE64, true }, + { ParametroApplFl.FL_CRYPTO_INCLUDI_FILEBASE64, true } }) .collect(Collectors.toMap(data -> (String) data[0], data -> (Boolean) data[1])); } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/EidasInvoker.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/EidasInvoker.java index 50ca6fb..1c56f24 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/EidasInvoker.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/EidasInvoker.java @@ -1,9 +1,28 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.firma.ejb; import java.io.File; import java.net.URI; +import java.time.ZonedDateTime; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; import javax.ejb.EJB; @@ -25,9 +44,9 @@ import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; -import it.eng.parer.eidas.model.EidasMetadataToValidate; +import it.eng.parer.eidas.model.EidasDataToValidateMetadata; import it.eng.parer.eidas.model.EidasWSReportsDTOTree; -import it.eng.parer.eidas.model.EsitoValidazioneEidas; +import it.eng.parer.eidas.model.EidasValidationResponse; import it.eng.parer.entity.constraint.DecServizioVerificaCompDoc.CdServizioVerificaCompDoc; import it.eng.parer.firma.crypto.helper.EidasRestConfiguratorHelper; import it.eng.parer.firma.exception.VerificaFirmaConnectionException; @@ -40,11 +59,9 @@ import it.eng.parer.firma.xml.VerificaFirmaWrapper; import it.eng.parer.retry.ParerRetryConfiguration; import it.eng.parer.retry.RestRetryInterceptor; -import it.eng.parer.util.ejb.help.ConfigurationHelper; import it.eng.parer.ws.ejb.XmlVersCache; import it.eng.parer.ws.versamento.dto.AbsVersamentoExt; import it.eng.parer.ws.versamento.dto.ComponenteVers; -import java.time.ZonedDateTime; /** * Oggetto di business per verificare la firma secondo il Regolamento (UE) N. 910/2014 del Parlamento europero e del @@ -58,16 +75,13 @@ public class EidasInvoker implements IVerificaFirmaInvoker { private static final Logger LOG = LoggerFactory.getLogger(EidasInvoker.class.getName()); - @EJB - protected ConfigurationHelper configurationHelper; - @EJB protected XmlVersCache xmlVersCache; @EJB protected EidasRestConfiguratorHelper restInvoker; - private static final String FIRMA_API_PATH = "/v2/report-verifica"; + private static final String FIRMA_API_PATH = "/api/report-verifica"; /** * Si collega all'endpoint contenente l'health check per il servizio. @@ -105,8 +119,8 @@ public boolean isUp(String url) { * @throws VerificaFirmaGenericInvokeException * eccezione in caso di risposta errata */ - private EsitoValidazioneEidas verificaEidasMultipart(EidasMetadataToValidate metadata, File signed, File original) - throws VerificaFirmaConnectionException, VerificaFirmaGenericInvokeException { + private EidasValidationResponse verificaEidasMultipart(EidasDataToValidateMetadata metadata, File signed, + File original) throws VerificaFirmaConnectionException, VerificaFirmaGenericInvokeException { RestTemplate restTemplate = buildRestTemplateWithRetry(); @@ -140,7 +154,46 @@ private EsitoValidazioneEidas verificaEidasMultipart(EidasMetadataToValidate met } catch (Exception ex) { throw new VerificaFirmaGenericInvokeException(ex, CdServizioVerificaCompDoc.EIDAS.name(), urlEidas); } - return new EsitoValidazioneEidas(resp); + return new EidasValidationResponse(resp); + + } + + /** + * Invocazione al WS REST di EIDAS con chiamata JSON. + * + * @param dto + * dto associati alla verifica + * + * @return modello contenente l'esito della verifica. + * + * @throws VerificaFirmaConnectionException + * eccezione in caso di mancata risposta + * @throws VerificaFirmaGenericInvokeException + * eccezione in caso di risposta errata + */ + private EidasValidationResponse verificaEidasJson(EidasDataToValidateMetadata dto) + throws VerificaFirmaConnectionException, VerificaFirmaGenericInvokeException { + + RestTemplate restTemplate = buildRestTemplateWithRetry(); + + String preferredUrl = restInvoker.preferredEndpoint(); + String urlEidas = preferredUrl + FIRMA_API_PATH; + LOG.debug("post per {}", urlEidas); + + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + + HttpEntity entity = new HttpEntity<>(dto, headers); + + EidasWSReportsDTOTree resp = null; + try { + resp = restTemplate.postForObject(urlEidas, entity, EidasWSReportsDTOTree.class); + } catch (RestClientException rce) { + throw new VerificaFirmaConnectionException(rce, CdServizioVerificaCompDoc.EIDAS.name(), urlEidas); + } catch (Exception ex) { + throw new VerificaFirmaGenericInvokeException(ex, CdServizioVerificaCompDoc.EIDAS.name(), urlEidas); + } + return new EidasValidationResponse(resp); } @@ -152,25 +205,36 @@ public VerificaFirmaWrapper verificaAndWrapIt(ComponenteVers componenteVers, throws VerificaFirmaWrapperResNotFoundException, VerificaFirmaConnectionException, VerificaFirmaWrapperGenericException, VerificaFirmaGenericInvokeException { - EidasMetadataToValidate metadata = EidasUtils.buildEidasMetadata(componenteVers, sottoComponentiFirma, - controlliAbilitati, verificaAllaDataDiFirma, dataDiRiferimento, uuid); + EidasValidationResponse esito = null; - final boolean hasFirmeDetached = sottoComponentiFirma != null && !sottoComponentiFirma.isEmpty(); - File signed = null; - File original = null; - // - if (!hasFirmeDetached) { - signed = componenteVers.getRifFileBinario().getFileSuDisco(); + // create metadata + EidasDataToValidateMetadata dto = EidasUtils.buildDataToValidateMetadataFromCompVers(componenteVers, + sottoComponentiFirma, controlliAbilitati, dataDiRiferimento, uuid); + + // file from o.s. + if (isComponenteSuObjectStorage(componenteVers)) { + // call + esito = verificaEidasJson(dto); } else { - signed = sottoComponentiFirma.get(0).getRifFileBinario().getFileSuDisco(); - original = componenteVers.getRifFileBinario().getFileSuDisco(); + // file from multipart + final boolean hasFirmeDetached = sottoComponentiFirma != null && !sottoComponentiFirma.isEmpty(); + File signed = null; + File original = null; + // + if (!hasFirmeDetached) { + signed = componenteVers.getRifFileBinario().getFileSuDisco(); + } else { + signed = sottoComponentiFirma.get(0).getRifFileBinario().getFileSuDisco(); + original = componenteVers.getRifFileBinario().getFileSuDisco(); + } + // call + esito = verificaEidasMultipart(dto, signed, original); } - - EsitoValidazioneEidas esito = verificaEidasMultipart(metadata, signed, original); - EidasWrapperResultStrategy strategy = new EidasWrapperResultStrategy(verificaAllaDataDiFirma, - controlliAbilitati, versamento); - VerificaFirmaWrapper wrapper = strategy.buildVFWrapper(esito, dataDiRiferimento, - CollectionUtils.isNotEmpty(sottoComponentiFirma)); + // + EidasWrapperResultStrategy strategy = new EidasWrapperResultStrategy(controlliAbilitati, + !Objects.isNull(componenteVers.withAcdEntity().getTmRifTempVers()), dataDiRiferimento, + versamento.getModificatoriWSCalc()); + VerificaFirmaWrapper wrapper = strategy.buildVFWrapper(esito, CollectionUtils.isNotEmpty(sottoComponentiFirma)); /* * Nota : nella prima versione dei report al fine di non appesanitre l'xml persistito era stata introdotto una * gestione "skinny" del report ossia, una copia dell'oggetto "ripulito" da alcune parti. Nella seconda versione @@ -206,7 +270,7 @@ private RestTemplate buildRestTemplateWithRetry() { template.setErrorHandler(new EidasErrorHandler()); List endpoints = restInvoker.endPoints(); - List endpointsURI = endpoints.stream().map(e -> URI.create(e)).collect(Collectors.toList()); + List endpointsURI = endpoints.stream().map(URI::create).collect(Collectors.toList()); ParerRetryConfiguration retryClient = restInvoker.retryClient(); @@ -215,4 +279,20 @@ private RestTemplate buildRestTemplateWithRetry() { return template; } + /** + * ATTENZIONE a questo livello ho bisogno di capire se il componente di cui devo effettaure la + * verifica sia su file system oppure sull'object storage. Questo metodo ha proprio lo scopo di individuare questo + * caso ma, per ora, non ho trovato un modo migliore per capire dove sia l'oggetto. Non è scorretto ma forse non è + * molto robusto perché valuta solamente il componente principale. + * + * + * @param componenteVers + * componente versato + * + * @return true se il riferimento al file del componente è sull'object storage. + */ + private boolean isComponenteSuObjectStorage(ComponenteVers componenteVers) { + return componenteVers.getRifFileBinario().getObjectStorageResource() != null; + } + } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/FirmeFormatiVers.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/FirmeFormatiVers.java index ee95330..f68c0ae 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/FirmeFormatiVers.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/FirmeFormatiVers.java @@ -1,6 +1,24 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.firma.ejb; import java.math.BigDecimal; +import java.math.BigInteger; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -45,7 +63,8 @@ import it.eng.parer.ws.versamento.dto.AbsVersamentoExt; import it.eng.parer.ws.versamento.dto.ComponenteVers; import it.eng.parer.ws.versamento.ejb.ControlliPerFirme; -import it.eng.parer.ws.versamento.utils.DocumentoVersVFirmeHash; +import it.eng.parer.ws.versamento.ejb.DocumentoVersVFirmeHash; + import java.time.ZonedDateTime; /** @@ -107,34 +126,44 @@ public RispostaControlli verifica(ComponenteVers componenteVers, List + * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/IVerificaFirmaInvoker.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/IVerificaFirmaInvoker.java index 346f581..bc5fef9 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/IVerificaFirmaInvoker.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/IVerificaFirmaInvoker.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.firma.ejb; import java.util.List; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/SalvataggioFirmaManager.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/SalvataggioFirmaManager.java index 5a2d465..762a0e0 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/SalvataggioFirmaManager.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/SalvataggioFirmaManager.java @@ -1,7 +1,20 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . */ + package it.eng.parer.firma.ejb; import java.io.IOException; @@ -11,6 +24,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; import javax.ejb.EJB; @@ -18,17 +32,13 @@ import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; +import javax.persistence.TypedQuery; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.exception.ExceptionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.amazonaws.services.s3.model.PutObjectResult; - -import it.eng.parer.crypto.model.CryptoEnums.EsitoControllo; -import it.eng.parer.crypto.model.CryptoEnums.TipoControlli; -import it.eng.parer.crypto.model.CryptoEnums.TipoControlliMarca; import it.eng.parer.eidas.model.EidasWSReportsDTOTree; import it.eng.parer.entity.AroBustaCrittog; import it.eng.parer.entity.AroCompDoc; @@ -40,7 +50,7 @@ import it.eng.parer.entity.AroMarcaComp; import it.eng.parer.entity.AroUsoCertifCaContrComp; import it.eng.parer.entity.AroUsoCertifCaContrMarca; -import it.eng.parer.entity.AroVerifFirmaDtVer; +import it.eng.parer.entity.DecBackend; import it.eng.parer.entity.DecFormatoFileStandard; import it.eng.parer.entity.DecReportServizioVerificaCompDoc; import it.eng.parer.entity.DecServizioVerificaCompDoc; @@ -48,7 +58,6 @@ import it.eng.parer.entity.FirCertifFirmatario; import it.eng.parer.entity.FirCertifOcsp; import it.eng.parer.entity.FirCrl; -import it.eng.parer.entity.FirFilePerFirma; import it.eng.parer.entity.FirOcsp; import it.eng.parer.entity.FirReport; import it.eng.parer.entity.FirUrlDistribCrl; @@ -59,7 +68,7 @@ import it.eng.parer.entity.constraint.DecServizioVerificaCompDoc.CdServizioVerificaCompDoc; import it.eng.parer.entity.constraint.FiUrnReport.TiUrnReport; import it.eng.parer.firma.exception.VerificaFirmaException; -import it.eng.parer.firma.util.VerificaFirmaEnums; +import it.eng.parer.firma.util.VerificaFirmaEnums.SacerIndication; import it.eng.parer.firma.xml.VFCertifCaType; import it.eng.parer.firma.xml.VFCertifFirmatarioType; import it.eng.parer.firma.xml.VFContrFirmaCompType; @@ -80,10 +89,14 @@ import it.eng.parer.ws.utils.MessaggiWSBundle; import it.eng.parer.ws.utils.MessaggiWSFormat; import it.eng.parer.ws.utils.XmlDateUtility; +import it.eng.parer.ws.versamento.dto.BackendStorage; import it.eng.parer.ws.versamento.dto.FileBinario; +import it.eng.parer.ws.versamento.dto.ObjectStorageResource; import it.eng.parer.ws.versamento.dto.StrutturaVersamento; import it.eng.parer.ws.versamento.ejb.ControlliPerFirme; +import it.eng.parer.ws.versamento.ejb.ObjectStorageService; import it.eng.parer.ws.versamento.ejb.oracleBlb.WriteCompBlbOracle; +import it.eng.parer.ws.versamento.exceptions.ObjectStorageException; /** * Parser (base) per la gestione del result wrapper post verifica documento firmato @@ -110,7 +123,7 @@ public class SalvataggioFirmaManager { private VerificaFirmaReportHelper verificaFirmaReportHelper; @EJB - private VerificaFirmaReportAwsClient verificaFirmaReportAwsClient; + private ObjectStorageService objectStorageService; @EJB private WriteCompBlbOracle writeCompBlbOracle; @@ -147,19 +160,17 @@ public boolean salvaBustaCrittografica(RispostaControlli risposta, String idComp || busta.getMarcaComps().stream().filter(m -> m.getId().equals(idCompVers)).count() != 0) { // create AroBustaCrittog componente - AroBustaCrittog tmpBustaCrittogComp = buildAroBustaCrittog(tmpTabCDComponente, busta.getPgBusta(), - busta.getAdditionalInfo().getIdFormatoFileStandard()); + AroBustaCrittog tmpBustaCrittogComp = buildAroBustaCrittog(tmpTabCDComponente, busta); // create AroBustaCrittog sotto componente AroBustaCrittog tmpBustaCrittogSottoComp = null; if (tmpTabCDSottoComp != null) { // create empty list if (tmpTabCDSottoComp.getAroBustaCrittogs() == null) { - tmpTabCDSottoComp.setAroBustaCrittogs(new ArrayList()); + tmpTabCDSottoComp.setAroBustaCrittogs(new ArrayList<>()); } - tmpBustaCrittogSottoComp = buildAroBustaCrittog(tmpTabCDSottoComp, busta.getPgBusta(), - busta.getAdditionalInfo().getIdFormatoFileStandard()); + tmpBustaCrittogSottoComp = buildAroBustaCrittog(tmpTabCDSottoComp, busta); } @@ -169,8 +180,8 @@ public boolean salvaBustaCrittografica(RispostaControlli risposta, String idComp // for (VFFirmaCompType firmaCompType : firmaCompById) { // FIRMA - AroFirmaComp tmpFirmaComp = this.buildAroFirmaComp(wrapper, busta, firmaCompType, - tmpTabCDComponente, tmpBustaCrittogComp, tmpBustaCrittogSottoComp, null); + AroFirmaComp tmpFirmaComp = buildAroFirmaComp(wrapper, busta, firmaCompType, tmpTabCDComponente, + tmpBustaCrittogComp, tmpBustaCrittogSottoComp, null); // MARCHE buildAroMarcaCompFromFirma(idCompVers, wrapper, busta, firmaCompType, tmpTabCDComponente, @@ -207,16 +218,17 @@ public boolean salvaBustaCrittografica(RispostaControlli risposta, String idComp // flush entityManager.flush(); } catch (VerificaFirmaException ex) { - LOG.error("Errore durante il popolamento della busta"); + LOG.error("Errore durante il popolamento della busta", ex); risposta.setrBoolean(false); risposta.setCodErr(ex.getCodiceErrore()); risposta.setDsErr(ex.getDescrizioneErrore()); result = false; } catch (Exception ex) { - LOG.error("Errore durante il popolamento della busta"); + LOG.error("Errore generico durante il popolamento della busta", ex); risposta.setrBoolean(false); risposta.setCodErr(MessaggiWSBundle.ERR_666P); - risposta.setDsErr("Errore generico durante il popolamento della busta " + ExceptionUtils.getMessage(ex)); + risposta.setDsErr( + "Errore generico durante il popolamento della busta " + ExceptionUtils.getRootCauseMessage(ex)); result = false; } @@ -234,11 +246,13 @@ public boolean salvaBustaCrittografica(RispostaControlli risposta, String idComp * oggetto standard con dati di versamento * @param tmpAroCompDoc * componente + * @param nomeWs + * nome del servizio che invoca il salvataggio del report * * @return true/false con risultato dell'operazione */ public boolean salvaReportVerificaCompDoc(RispostaControlli risposta, VerificaFirmaWrapper wrapper, - StrutturaVersamento strutV, AroCompDoc tmpAroCompDoc) { + StrutturaVersamento strutV, AroCompDoc tmpAroCompDoc, String nomeWs) { boolean result = true; try { @@ -256,7 +270,7 @@ public boolean salvaReportVerificaCompDoc(RispostaControlli risposta, VerificaFi if (StringUtils.isNotBlank(strutV.getGenerazioneRerortVerificaFirma()) && !strutV.getGenerazioneRerortVerificaFirma().equalsIgnoreCase(GenReportVerificaFirma.OFF.name()) && wrapper.getAdditionalInfo().getReportContent() != null) { - buildFirReport(tmpAroCompDoc, wrapper, strutV); + buildFirReport(tmpAroCompDoc, wrapper, strutV, nomeWs); } // flush entityManager.flush(); @@ -308,31 +322,29 @@ private void buildAroMarcaCompFromFirma(String idCompVers, VerificaFirmaWrapper } } - private AroBustaCrittog buildAroBustaCrittog(AroCompDoc tmpAroCompDoc, BigDecimal pgBusta, - long idFormatoFileStandard) { - // FIXME FIXME FIXME PLEASE - if (tmpAroCompDoc.getAroBustaCrittogs() != null && !tmpAroCompDoc.getAroBustaCrittogs().isEmpty()) { - for (AroBustaCrittog aroBustaCrittog : tmpAroCompDoc.getAroBustaCrittogs()) { - if (aroBustaCrittog.getPgBustaCrittog().equals(pgBusta)) { - return aroBustaCrittog; - } - + private AroBustaCrittog buildAroBustaCrittog(AroCompDoc tmpAroCompDoc, VFBusta busta) { + // restituisci AroBustaCrittog se già presente + if (tmpAroCompDoc.getAroBustaCrittogs() != null) { + Optional findedBustaCrittog = tmpAroCompDoc.getAroBustaCrittogs().stream() + .filter(b -> b.getPgBustaCrittog().compareTo(busta.getPgBusta()) == 0).findFirst(); + if (findedBustaCrittog.isPresent()) { + return findedBustaCrittog.get(); } } - + // create new entity AroBustaCrittog tmpBustaCrittog = new AroBustaCrittog(); tmpBustaCrittog.setAroCompDoc(tmpAroCompDoc); - tmpBustaCrittog.setAroFirmaComps(new ArrayList()); - tmpBustaCrittog.setAroMarcaComps(new ArrayList()); - tmpBustaCrittog.setPgBustaCrittog(pgBusta); + tmpBustaCrittog.setAroFirmaComps(new ArrayList<>()); + tmpBustaCrittog.setAroMarcaComps(new ArrayList<>()); + tmpBustaCrittog.setPgBustaCrittog(busta.getPgBusta()); tmpBustaCrittog.setIdStrut(tmpAroCompDoc.getIdStrut()); - // FIXME: questo è brutto - if (idFormatoFileStandard > 0L) { + if (busta.getAdditionalInfo() != null && busta.getAdditionalInfo().getIdFormatoFileStandard() != null) { // additional info (ottenute in precedenza -> vedi check formati) - tmpBustaCrittog - .setDecFormatoFileStandard(entityManager.find(DecFormatoFileStandard.class, idFormatoFileStandard)); + tmpBustaCrittog.setDecFormatoFileStandard(entityManager.find(DecFormatoFileStandard.class, + busta.getAdditionalInfo().getIdFormatoFileStandard().longValue())); } + tmpAroCompDoc.getAroBustaCrittogs().add(tmpBustaCrittog); return tmpBustaCrittog; @@ -388,10 +400,53 @@ private AroFirmaComp buildAroFirmaComp(VerificaFirmaWrapper wrapper, VFBusta bus // FIRMA AroFirmaComp tmpFirmaComp = new AroFirmaComp(); - tmpFirmaComp.setAroContrFirmaComps(new ArrayList()); - tmpFirmaComp.setAroControfirmaFirmaFiglios(new ArrayList()); - tmpFirmaComp.setAroControfirmaFirmaPadres(new ArrayList()); - tmpFirmaComp.setAroVerifFirmaDtVers(new ArrayList()); + tmpFirmaComp.setAroContrFirmaComps(new ArrayList<>()); + tmpFirmaComp.setAroControfirmaFirmaFiglios(new ArrayList<>()); + tmpFirmaComp.setAroControfirmaFirmaPadres(new ArrayList<>()); + tmpFirmaComp.setAroVerifFirmaDtVers(new ArrayList<>()); + // Aggiungo la firma al componente e viceversa + tmpFirmaComp.setAroCompDoc(tmpTabCDComponente); + // Setto id struttura + tmpFirmaComp.setIdStrut(tmpTabCDComponente.getIdStrut()); + tmpTabCDComponente.getAroFirmaComps().add(tmpFirmaComp); + tmpFirmaComp.setCdFirmatario(firmaCompType.getCdFirmatario()); + tmpFirmaComp.setNmCognomeFirmatario(firmaCompType.getNmCognomeFirmatario()); + tmpFirmaComp.setNmFirmatario(firmaCompType.getNmFirmatario()); + tmpFirmaComp.setDlDnFirmatario(firmaCompType.getDlDnFirmatario()); + tmpFirmaComp.setBlFirmaBase64(firmaCompType.getDsFirmaBase64()); + tmpFirmaComp.setDsAlgoFirma(firmaCompType.getDsAlgoFirma()); + tmpFirmaComp.setTiFormatoFirma(firmaCompType.getTiFormatoFirma()); + tmpFirmaComp.setTiFirma(firmaCompType.getTiFirma().name()); + + tmpFirmaComp.setFirCertifFirmatario(tmpCertifFirmatario); + // + if (firmaCompType.getDtFirma() != null) { + tmpFirmaComp.setDtFirma(XmlDateUtility.xmlGregorianCalendarToDate(firmaCompType.getDtFirma())); + } + if (firmaCompType.getTmRifTempUsato() != null) { + tmpFirmaComp + .setTmRifTempUsato(XmlDateUtility.xmlGregorianCalendarToDate(firmaCompType.getTmRifTempUsato())); + } + // + tmpFirmaComp.setTiRifTempUsato(firmaCompType.getTipoRiferimentoTemporaleUsato()); + + tmpFirmaComp.setTiEsitoContrConforme(firmaCompType.getTiEsitoContrConforme()); + tmpFirmaComp.setDsMsgEsitoContrConforme(firmaCompType.getDsMsgEsitoContrConforme()); + // + tmpFirmaComp.setTiEsitoVerifFirma(firmaCompType.getTiEsitoVerifFirma()); + tmpFirmaComp.setDsMsgEsitoVerifFirma(firmaCompType.getDsMsgEsitoVerifFirma()); + + tmpFirmaComp.setPgFirma(firmaCompType.getPgFirma()); + tmpFirmaComp.setPgBusta(busta.getPgBusta()); + + boolean isDetachedSignature = wrapper.getAdditionalInfo().isIsDetached(); + if (isDetachedSignature) { + tmpBustaCrittogSottoComp.getAroFirmaComps().add(tmpFirmaComp); + tmpFirmaComp.setAroBustaCrittog(tmpBustaCrittogSottoComp); + } else { + tmpBustaCrittogComp.getAroFirmaComps().add(tmpFirmaComp); + tmpFirmaComp.setAroBustaCrittog(tmpBustaCrittogComp); + } // Creo una mappa di CONTR_FIRMA_COMP identificati dalla costante enumerata in // VFTipoControlloType @@ -406,10 +461,9 @@ private AroFirmaComp buildAroFirmaComp(VerificaFirmaWrapper wrapper, VFBusta bus controllo.setTiContr(VFTipoControlloType.CRITTOGRAFICO.name()); controllo.setTiEsitoContrFirma(vfControllo.getTiEsitoContrFirma()); controllo.setDsMsgEsitoContrFirma(vfControllo.getDsMsgEsitoContrFirma()); - - tmpFirmaComp.getAroContrFirmaComps().add(controllo); // persist entityManager.persist(controllo); + tmpFirmaComp.getAroContrFirmaComps().add(controllo); } // CONTROLLI FIRMA - CRITTOGRAFICO ABILITATO { @@ -419,10 +473,9 @@ private AroFirmaComp buildAroFirmaComp(VerificaFirmaWrapper wrapper, VFBusta bus controllo.setTiContr(VFTipoControlloType.CRITTOGRAFICO_ABILITATO.name()); controllo.setTiEsitoContrFirma(vfControllo.getTiEsitoContrFirma()); controllo.setDsMsgEsitoContrFirma(vfControllo.getDsMsgEsitoContrFirma()); - - tmpFirmaComp.getAroContrFirmaComps().add(controllo); // persist entityManager.persist(controllo); + tmpFirmaComp.getAroContrFirmaComps().add(controllo); } // CONTROLLI FIRMA - CATENA TRUSTED { @@ -437,8 +490,6 @@ private AroFirmaComp buildAroFirmaComp(VerificaFirmaWrapper wrapper, VFBusta bus AroUsoCertifCaContrComp usoCertifCatena = new AroUsoCertifCaContrComp(); usoCertifCatena.setPgCertifCa(BigDecimal.ONE); - usoCertifCatena.setAroContrFirmaComp(controllo); - // CA usoCertifCatena.setFirCertifCa(caUso); // CRL (se presente) @@ -447,12 +498,12 @@ private AroFirmaComp buildAroFirmaComp(VerificaFirmaWrapper wrapper, VFBusta bus usoCertifCatena.setFirOcsp(ocspUso); // usoCerifiCaContrComp.add(usoCertifCatena); + // persist + entityManager.persist(controllo); + usoCertifCatena.setAroContrFirmaComp(controllo); entityManager.persist(usoCertifCatena); controllo.setAroUsoCertifCaContrComps(usoCerifiCaContrComp); - tmpFirmaComp.getAroContrFirmaComps().add(controllo); - // persist - entityManager.persist(controllo); } // CONTROLLI FIRMA - CATENA TRUSTED ABILITATO { @@ -462,10 +513,9 @@ private AroFirmaComp buildAroFirmaComp(VerificaFirmaWrapper wrapper, VFBusta bus controllo.setTiContr(VFTipoControlloType.CATENA_TRUSTED_ABILITATO.name()); controllo.setTiEsitoContrFirma(vfControllo.getTiEsitoContrFirma()); controllo.setDsMsgEsitoContrFirma(vfControllo.getDsMsgEsitoContrFirma()); - - tmpFirmaComp.getAroContrFirmaComps().add(controllo); // persist entityManager.persist(controllo); + tmpFirmaComp.getAroContrFirmaComps().add(controllo); } // CONTROLLI FIRMA - CRL { @@ -476,9 +526,9 @@ private AroFirmaComp buildAroFirmaComp(VerificaFirmaWrapper wrapper, VFBusta bus controllo.setTiEsitoContrFirma(vfControllo.getTiEsitoContrFirma()); controllo.setDsMsgEsitoContrFirma(vfControllo.getDsMsgEsitoContrFirma()); controllo.setFirCrl(crlContr); - tmpFirmaComp.getAroContrFirmaComps().add(controllo); // persist entityManager.persist(controllo); + tmpFirmaComp.getAroContrFirmaComps().add(controllo); } // CONTROLLI FIRMA - OCSP { @@ -504,7 +554,6 @@ private AroFirmaComp buildAroFirmaComp(VerificaFirmaWrapper wrapper, VFBusta bus // usoCerifiCaContrComp.add(usoCertifOcsp); - entityManager.persist(usoCertifOcsp); // controllo.setAroUsoCertifCaContrComps(usoCerifiCaContrComp); } @@ -521,61 +570,17 @@ private AroFirmaComp buildAroFirmaComp(VerificaFirmaWrapper wrapper, VFBusta bus controllo.setTiContr(VFTipoControlloType.CERTIFICATO.name()); controllo.setTiEsitoContrFirma(vfControllo.getTiEsitoContrFirma()); controllo.setDsMsgEsitoContrFirma(vfControllo.getDsMsgEsitoContrFirma()); - - tmpFirmaComp.getAroContrFirmaComps().add(controllo); // persist entityManager.persist(controllo); + tmpFirmaComp.getAroContrFirmaComps().add(controllo); } // - tmpFirmaComp.setCdFirmatario(firmaCompType.getCdFirmatario()); - tmpFirmaComp.setNmCognomeFirmatario(firmaCompType.getNmCognomeFirmatario()); - tmpFirmaComp.setNmFirmatario(firmaCompType.getNmFirmatario()); - tmpFirmaComp.setDlDnFirmatario(firmaCompType.getDlDnFirmatario()); - tmpFirmaComp.setBlFirmaBase64(firmaCompType.getDsFirmaBase64()); - tmpFirmaComp.setDsAlgoFirma(firmaCompType.getDsAlgoFirma()); - tmpFirmaComp.setTiFormatoFirma(firmaCompType.getTiFormatoFirma()); - tmpFirmaComp.setTiFirma(firmaCompType.getTiFirma().name()); - - tmpFirmaComp.setFirCertifFirmatario(tmpCertifFirmatario); - // - if (firmaCompType.getDtFirma() != null) { - tmpFirmaComp.setDtFirma(XmlDateUtility.xmlGregorianCalendarToDate(firmaCompType.getDtFirma())); - } - if (firmaCompType.getTmRifTempUsato() != null) { - tmpFirmaComp - .setTmRifTempUsato(XmlDateUtility.xmlGregorianCalendarToDate(firmaCompType.getTmRifTempUsato())); - } - // - tmpFirmaComp.setTiRifTempUsato(firmaCompType.getTipoRiferimentoTemporaleUsato()); - - tmpFirmaComp.setTiEsitoContrConforme(firmaCompType.getTiEsitoContrConforme()); - tmpFirmaComp.setDsMsgEsitoContrConforme(firmaCompType.getDsMsgEsitoContrConforme()); - // - tmpFirmaComp.setTiEsitoVerifFirma(firmaCompType.getTiEsitoVerifFirma()); - tmpFirmaComp.setDsMsgEsitoVerifFirma(firmaCompType.getDsMsgEsitoVerifFirma()); - tmpFirmaComp.setPgFirma(firmaCompType.getPgFirma()); - tmpFirmaComp.setPgBusta(busta.getPgBusta()); - - boolean isDetachedSignature = wrapper.getAdditionalInfo().isIsDetached(); - if (isDetachedSignature) { - tmpBustaCrittogSottoComp.getAroFirmaComps().add(tmpFirmaComp); - tmpFirmaComp.setAroBustaCrittog(tmpBustaCrittogSottoComp); - } else { - tmpBustaCrittogComp.getAroFirmaComps().add(tmpFirmaComp); - tmpFirmaComp.setAroBustaCrittog(tmpBustaCrittogComp); - } - // Aggiungo la firma al componente e viceversa - tmpFirmaComp.setAroCompDoc(tmpTabCDComponente); - // Setto id struttura - tmpFirmaComp.setIdStrut(tmpTabCDComponente.getIdStrut()); - tmpTabCDComponente.getAroFirmaComps().add(tmpFirmaComp); /* * Esitono eccezioni gestibili per questi casi (quelle per cui RispostaControlli#rBoolean dovrebbe valore false? * Nel caso utilizzare VerificaFirmaException */ - // if (tmpFirmaCompPadre != null) { AroControfirmaFirma tmpControfirmaFirma = new AroControfirmaFirma(); @@ -587,7 +592,6 @@ private AroFirmaComp buildAroFirmaComp(VerificaFirmaWrapper wrapper, VFBusta bus // persist entityManager.persist(tmpControfirmaFirma); } - return tmpFirmaComp; } @@ -610,7 +614,30 @@ private AroMarcaComp buildAroMarcaComp(VFBusta busta, VFMarcaCompType marcaCompT throws VerificaFirmaException { // AroMarcaComp tmpMarcaComp = new AroMarcaComp(); - tmpMarcaComp.setAroContrMarcaComps(new ArrayList()); + tmpMarcaComp.setAroContrMarcaComps(new ArrayList<>()); + + tmpMarcaComp.setDsMarcaBase64(marcaCompType.getDsMarcaBase64()); + tmpMarcaComp.setDsAlgoMarca(marcaCompType.getDsAlgoMarca()); + tmpMarcaComp.setTmMarcaTemp(XmlDateUtility.xmlGregorianCalendarToDate(marcaCompType.getTmMarcaTemp())); + tmpMarcaComp.setTiFormatoMarca(marcaCompType.getTiFormatoMarca()); + tmpMarcaComp.setDtScadMarca(XmlDateUtility.xmlGregorianCalendarToDate(marcaCompType.getDtScadMarca())); + + tmpMarcaComp.setTiEsitoVerifMarca(marcaCompType.getTiEsitoVerifMarca()); + tmpMarcaComp.setDsMsgEsitoVerifMarca(marcaCompType.getDsMsgEsitoVerifMarca()); + + tmpMarcaComp.setTiEsitoContrConforme(marcaCompType.getTiEsitoContrConforme()); + tmpMarcaComp.setDsMsgEsitoContrConforme(marcaCompType.getDsMsgEsitoContrConforme()); + + tmpMarcaComp.setPgBusta(busta.getPgBusta()); + tmpMarcaComp.setPgMarca(marcaCompType.getPgMarca()); + + if (isDetached) { + tmpBustaCrittogSottoComp.getAroMarcaComps().add(tmpMarcaComp); + tmpMarcaComp.setAroBustaCrittog(tmpBustaCrittogSottoComp); + } else { + tmpBustaCrittogComp.getAroMarcaComps().add(tmpMarcaComp); + tmpMarcaComp.setAroBustaCrittog(tmpBustaCrittogComp); + } // Creo una mappa di CONTR_MARCA_COMP identificati dalla costante enumerata in // VFTipoControlloType @@ -618,8 +645,7 @@ private AroMarcaComp buildAroMarcaComp(VFBusta busta, VFMarcaCompType marcaCompT .collect(Collectors.toMap(VFContrMarcaCompType::getTiContr, t -> t)); // TOFIX : corretto ?! - if (!marcaCompType.getTiEsitoContrConforme() - .equals(VerificaFirmaEnums.EsitoControllo.FORMATO_NON_CONOSCIUTO.name())) { + if (!marcaCompType.getTiEsitoContrConforme().equals(SacerIndication.FORMATO_NON_CONOSCIUTO.name())) { VFCertifCaType certifTsaType = marcaCompType.getCertifTsa(); // CERTIFICATO TSA + BLOB @@ -646,7 +672,6 @@ private AroMarcaComp buildAroMarcaComp(VFBusta busta, VFMarcaCompType marcaCompT controllo.setTiContr(VFTipoControlloType.CRITTOGRAFICO.name()); controllo.setTiEsitoContrMarca(vfControllo.getTiEsitoContrMarca()); controllo.setDsMsgEsitoContrMarca(vfControllo.getDsMsgEsitoContrMarca()); - entityManager.persist(controllo); } // CONTROLLI MARCA - CATENA_TRUSTED CertificateAssociation && @@ -654,7 +679,7 @@ private AroMarcaComp buildAroMarcaComp(VFBusta busta, VFMarcaCompType marcaCompT { VFContrMarcaCompType vfControllo = controlliMarca.get(VFTipoControlloType.CATENA_TRUSTED); AroContrMarcaComp controllo = new AroContrMarcaComp(); - controllo.setAroUsoCertifCaContrMarcas(new ArrayList()); + controllo.setAroUsoCertifCaContrMarcas(new ArrayList<>()); controllo.setAroMarcaComp(tmpMarcaComp); tmpMarcaComp.getAroContrMarcaComps().add(controllo); controllo.setTiContr(VFTipoControlloType.CATENA_TRUSTED.name()); @@ -675,13 +700,7 @@ private AroMarcaComp buildAroMarcaComp(VFBusta busta, VFMarcaCompType marcaCompT usoCertifCatena.setFirOcsp(ocspTsa); // usoCerifiCaContrComp.add(usoCertifCatena); - // persist - entityManager.persist(usoCertifCatena); controllo.getAroUsoCertifCaContrMarcas().add(usoCertifCatena); - - // persist - entityManager.persist(controllo); - } // CONTROLLI MARCA - CERTIFICATO CertificateExpiration @@ -693,7 +712,6 @@ private AroMarcaComp buildAroMarcaComp(VFBusta busta, VFMarcaCompType marcaCompT controllo.setTiContr(VFTipoControlloType.CERTIFICATO.name()); controllo.setTiEsitoContrMarca(vfControllo.getTiEsitoContrMarca()); controllo.setDsMsgEsitoContrMarca(vfControllo.getDsMsgEsitoContrMarca()); - entityManager.persist(controllo); } // CONTROLLI MARCA - CRL CertificateRevocation @@ -706,7 +724,6 @@ private AroMarcaComp buildAroMarcaComp(VFBusta busta, VFMarcaCompType marcaCompT controllo.setFirCrl(crlTsa); controllo.setTiEsitoContrMarca(vfControllo.getTiEsitoContrMarca()); controllo.setDsMsgEsitoContrMarca(vfControllo.getDsMsgEsitoContrMarca()); - entityManager.persist(controllo); } // CONTROLLI MARCA - OCSP CertificateRevocation @@ -714,7 +731,6 @@ private AroMarcaComp buildAroMarcaComp(VFBusta busta, VFMarcaCompType marcaCompT VFContrMarcaCompType vfControllo = controlliMarca.get(VFTipoControlloType.OCSP); AroContrMarcaComp controllo = new AroContrMarcaComp(); controllo.setAroMarcaComp(tmpMarcaComp); - tmpMarcaComp.getAroContrMarcaComps().add(controllo); controllo.setTiContr(VFTipoControlloType.OCSP.name()); controllo.setFirOcsp(ocspTsa); controllo.setTiEsitoContrMarca(vfControllo.getTiEsitoContrMarca()); @@ -734,14 +750,11 @@ private AroMarcaComp buildAroMarcaComp(VFBusta busta, VFMarcaCompType marcaCompT // usoCerifiCaContrComp.add(usoCertifOcsp); - entityManager.persist(usoCertifOcsp); - // + controllo.setAroUsoCertifCaContrMarcas(usoCerifiCaContrComp); } // tmpMarcaComp.getAroContrMarcaComps().add(controllo); - // persist - entityManager.persist(controllo); } tmpMarcaComp.setFirCertifCa(certificatoTsa); @@ -749,30 +762,6 @@ private AroMarcaComp buildAroMarcaComp(VFBusta busta, VFMarcaCompType marcaCompT // } // crl } - tmpMarcaComp.setDsMarcaBase64(marcaCompType.getDsMarcaBase64()); - tmpMarcaComp.setDsAlgoMarca(marcaCompType.getDsAlgoMarca()); - tmpMarcaComp.setTmMarcaTemp(XmlDateUtility.xmlGregorianCalendarToDate(marcaCompType.getTmMarcaTemp())); - tmpMarcaComp.setTiFormatoMarca(marcaCompType.getTiFormatoMarca()); - tmpMarcaComp.setDtScadMarca(XmlDateUtility.xmlGregorianCalendarToDate(marcaCompType.getDtScadMarca())); - - tmpMarcaComp.setTiEsitoVerifMarca(marcaCompType.getTiEsitoVerifMarca()); - tmpMarcaComp.setDsMsgEsitoVerifMarca(marcaCompType.getDsMsgEsitoVerifMarca()); - - tmpMarcaComp.setTiEsitoContrConforme(marcaCompType.getTiEsitoContrConforme()); - tmpMarcaComp.setDsMsgEsitoContrConforme(marcaCompType.getDsMsgEsitoContrConforme()); - - tmpMarcaComp.setPgBusta(busta.getPgBusta()); - tmpMarcaComp.setPgMarca(marcaCompType.getPgMarca()); - - if (isDetached) { - tmpBustaCrittogSottoComp.getAroMarcaComps().add(tmpMarcaComp); - tmpMarcaComp.setAroBustaCrittog(tmpBustaCrittogSottoComp); - } else { - tmpBustaCrittogComp.getAroMarcaComps().add(tmpMarcaComp); - tmpMarcaComp.setAroBustaCrittog(tmpBustaCrittogComp); - } - // Aggiungo la marca al componente e viceversa - tmpMarcaComp.setAroCompDoc(tmpTabCDComponente); tmpTabCDComponente.getAroMarcaComps().add(tmpMarcaComp); @@ -803,18 +792,13 @@ private FirCertifCa buildFirCertifCa(VFCertifCaType certifCaType) throws Verific certifCaType.getDlDnIssuerCertifCa()); } - // FIX MAC 26836, compilo il subject mancante e correggo il subject keyId: - if (tmpCertificatoCa != null) { - correggiInformazioniCA(tmpCertificatoCa, certifCaType); - } - // not found if (tmpCertificatoCa == null) { tmpCertificatoCa = new FirCertifCa(); - tmpCertificatoCa.setFirUrlDistribCrls(new ArrayList()); - tmpCertificatoCa.setFirUrlDistribOcsps(new ArrayList()); - tmpCertificatoCa.setFirCertifFirmatarios(new ArrayList()); - tmpCertificatoCa.setFirCrls(new ArrayList()); + tmpCertificatoCa.setFirUrlDistribCrls(new ArrayList<>()); + tmpCertificatoCa.setFirUrlDistribOcsps(new ArrayList<>()); + tmpCertificatoCa.setFirCertifFirmatarios(new ArrayList<>()); + tmpCertificatoCa.setFirCrls(new ArrayList<>()); tmpCertificatoCa.setNiSerialCertifCa(certifCaType.getNiSerialCertifCa()); tmpCertificatoCa.setDsSubjectKeyId(certifCaType.getDsSubjectKeyId()); @@ -845,24 +829,33 @@ private FirCertifCa buildFirCertifCa(VFCertifCaType certifCaType) throws Verific tmpCertificatoCa.getFirUrlDistribOcsps().add(firUrl); idx++; } - - // se il file non presente -> non lo si persiste - if (certifCaType.getFilePerFirma() != null) { - FirFilePerFirma blobCertCa = new FirFilePerFirma(); - blobCertCa.setTiFilePerFirma(certifCaType.getFilePerFirma().getTiFilePerFirma().name()); - blobCertCa.setBlFilePerFirma(certifCaType.getFilePerFirma().getBlFilePerFirma()); - blobCertCa.setFirCertifCa(tmpCertificatoCa); - tmpCertificatoCa.setFirFilePerFirma(blobCertCa); - } else { - LOG.warn("File per firma non presente per CA serial {} Issuer {} Subject {}", - tmpCertificatoCa.getNiSerialCertifCa(), tmpCertificatoCa.getDlDnIssuerCertifCa(), - tmpCertificatoCa.getDlDnSubjectCertifCa()); - } - - // persist - entityManager.persist(tmpCertificatoCa); } else { - // pregresso URL OCSP + /* + * assumo che la CA trovata sul DB non sia correttamente censita; se ci sono differenze aggiorno con le + * informazioni prevenienti dalla verifica delle firme. + * + */ + if (tmpCertificatoCa.getDlDnSubjectCertifCa() == null + || !tmpCertificatoCa.getDlDnSubjectCertifCa().equals(certifCaType.getDlDnSubjectCertifCa())) { + tmpCertificatoCa.setDlDnSubjectCertifCa(certifCaType.getDlDnSubjectCertifCa()); + } + boolean isSubjectKeyIdEsistenteNullOrNonValorizzato = tmpCertificatoCa.getDsSubjectKeyId() == null + || tmpCertificatoCa.getDsSubjectKeyId().equals("NON_VALORIZZATO"); + boolean isSubjectKeyIdNuovoNotNullAndValorizzato = certifCaType.getDsSubjectKeyId() != null + && !certifCaType.getDsSubjectKeyId().equals("NON_VALORIZZATO"); + if (isSubjectKeyIdEsistenteNullOrNonValorizzato && isSubjectKeyIdNuovoNotNullAndValorizzato) { + tmpCertificatoCa.setDsSubjectKeyId(certifCaType.getDsSubjectKeyId()); + } + /* + * aggiornamento di inizio e fine validità del certificato della CA con quelle recepite dalla verifica + */ + tmpCertificatoCa + .setDtIniValCertifCa(XmlDateUtility.xmlGregorianCalendarToDate(certifCaType.getDtIniValCertifCa())); + tmpCertificatoCa + .setDtFinValCertifCa(XmlDateUtility.xmlGregorianCalendarToDate(certifCaType.getDtFinValCertifCa())); + /* + * gestione del pregresso URL OCSP (qualora non presenti per la CA presente in anagrafica) + */ if (tmpCertificatoCa.getFirUrlDistribOcsps().isEmpty()) { // urls ocsp int idx = 1; @@ -878,6 +871,8 @@ private FirCertifCa buildFirCertifCa(VFCertifCaType certifCaType) throws Verific } } } + // persist + entityManager.persist(tmpCertificatoCa); /* * Esitono eccezioni gestibili per questi casi (quelle per cui RispostaControlli#rBoolean dovrebbe valore false? * Nel caso utilizzare VerificaFirmaException @@ -885,52 +880,6 @@ private FirCertifCa buildFirCertifCa(VFCertifCaType certifCaType) throws Verific return tmpCertificatoCa; } - /** - * Assumo che la CA trovata sul DB non sia correttamente censita; se ci sono differenze aggiorno con le informazioni - * prevenienti dalla verifica delle firme. - * - * @param tmpCertificatoCa, - * entity esistente - * @param certifCaType, - * oggetto che identifica la CA proveniente dalla verifica firme - */ - private void correggiInformazioniCA(FirCertifCa tmpCertificatoCa, VFCertifCaType certifCaType) { - boolean pleasePersist = false; - // Controllo su DL_DN_SUBJECT - if (tmpCertificatoCa.getDlDnSubjectCertifCa() == null - || !tmpCertificatoCa.getDlDnSubjectCertifCa().equals(certifCaType.getDlDnSubjectCertifCa())) { - tmpCertificatoCa.setDlDnSubjectCertifCa(certifCaType.getDlDnSubjectCertifCa()); - pleasePersist = true; - } - boolean isSubjectKeyIdEsistenteNullOrNonValorizzato = tmpCertificatoCa.getDsSubjectKeyId() == null - || tmpCertificatoCa.getDsSubjectKeyId().equals("NON_VALORIZZATO"); - boolean isSubjectKeyIdNuovoNotNullAndValorizzato = certifCaType.getDsSubjectKeyId() != null - && !certifCaType.getDsSubjectKeyId().equals("NON_VALORIZZATO"); - // Controllo su SUBJECT_KEY_ID - if (isSubjectKeyIdEsistenteNullOrNonValorizzato && isSubjectKeyIdNuovoNotNullAndValorizzato) { - tmpCertificatoCa.setDsSubjectKeyId(certifCaType.getDsSubjectKeyId()); - pleasePersist = true; - } - // controllo su DT_INI_VAL - if (!tmpCertificatoCa.getDtIniValCertifCa() - .equals(XmlDateUtility.xmlGregorianCalendarToDate(certifCaType.getDtIniValCertifCa()))) { - tmpCertificatoCa - .setDtIniValCertifCa(XmlDateUtility.xmlGregorianCalendarToDate(certifCaType.getDtIniValCertifCa())); - pleasePersist = true; - } - // controllo su DT_FIN_VAL - if (!tmpCertificatoCa.getDtFinValCertifCa() - .equals(XmlDateUtility.xmlGregorianCalendarToDate(certifCaType.getDtFinValCertifCa()))) { - tmpCertificatoCa - .setDtFinValCertifCa(XmlDateUtility.xmlGregorianCalendarToDate(certifCaType.getDtIniValCertifCa())); - pleasePersist = true; - } - - if (pleasePersist) { - entityManager.persist(tmpCertificatoCa); - } - } - private FirCrl buildFirCrl(VFCrlType crl) throws VerificaFirmaException { FirCrl tmpFirCrl = null; @@ -956,17 +905,6 @@ private FirCrl buildFirCrl(VFCrlType crl) throws VerificaFirmaException { // add on list parent tmpCertifCa.getFirCrls().add(tmpFirCrl); - // se il file non presente -> non lo si persiste - if (crl.getFilePerFirma() != null) { - FirFilePerFirma tmpFilePerFirma = new FirFilePerFirma(); - tmpFilePerFirma.setTiFilePerFirma(crl.getFilePerFirma().getTiFilePerFirma().name());// TipoFileEnum.CRL.name() - tmpFilePerFirma.setBlFilePerFirma(crl.getFilePerFirma().getBlFilePerFirma()); - tmpFilePerFirma.setFirCrl(tmpFirCrl); - tmpFirCrl.setFirFilePerFirma(tmpFilePerFirma); - } else { - LOG.warn("File per firma non presente per CRL serial {}", tmpFirCrl.getNiSerialCrl()); - } - // persist entityManager.persist(tmpFirCrl); } @@ -1008,18 +946,6 @@ private FirOcsp buildFirOcspWithCertif(VFOcspType ocsp) throws VerificaFirmaExce // add on list parent tmpCertifCa.getFirCertifOcsps().add(tmpFirCertifOcsp); - // se il file non presente -> non lo si persiste - if (ocsp.getCertifOcsp().getFilePerFirma() != null) { - FirFilePerFirma tmpFilePerFirma = new FirFilePerFirma(); - tmpFilePerFirma.setTiFilePerFirma(ocsp.getCertifOcsp().getFilePerFirma().getTiFilePerFirma().name());// TipoFileEnum.CERTIF_OCSP.name() - tmpFilePerFirma.setBlFilePerFirma(ocsp.getCertifOcsp().getFilePerFirma().getBlFilePerFirma()); - tmpFilePerFirma.setFirCertifOcsp(tmpFirCertifOcsp); - tmpFirCertifOcsp.setFirFilePerFirma(tmpFilePerFirma); - } else { - LOG.warn("File per firma non presente per OCSP serial {} issuer {}", - tmpFirCertifOcsp.getNiSerialCertifOcsp(), tmpFirCertifOcsp.getDlDnSubjectCertifOcsp()); - } - // persist entityManager.persist(tmpFirCertifOcsp); } @@ -1044,12 +970,6 @@ private FirOcsp buildFirOcspWithCertif(VFOcspType ocsp) throws VerificaFirmaExce // add parent tmpFirCertifOcsp.getFirOcsps().add(tmpFirOcsp); - FirFilePerFirma tmpFilePerFirma = new FirFilePerFirma(); - tmpFilePerFirma.setTiFilePerFirma(ocsp.getFilePerFirma().getTiFilePerFirma().name());// TipoFileEnum.OCSP.name() - tmpFilePerFirma.setBlFilePerFirma(ocsp.getFilePerFirma().getBlFilePerFirma()); - tmpFilePerFirma.setFirOcsp(tmpFirOcsp); - tmpFirOcsp.setFirFilePerFirma(tmpFilePerFirma); - // persist entityManager.persist(tmpFirOcsp); } @@ -1099,23 +1019,9 @@ private FirCertifFirmatario buildFirCertifFirmatario(FirCertifCa tmpFirCertifCa, // firCertifFirmatario.setFirCertifCa(tmpFirCertifCa); - tmpFirCertifCa.setFirCertifFirmatarios(new ArrayList()); + tmpFirCertifCa.setFirCertifFirmatarios(new ArrayList<>()); tmpFirCertifCa.getFirCertifFirmatarios().add(firCertifFirmatario); - // se il file non presente -> non lo si persiste - if (certifFirmatarioType.getFilePerFirma() != null) { - FirFilePerFirma blobCertFirmatario = new FirFilePerFirma(); - blobCertFirmatario - .setTiFilePerFirma(certifFirmatarioType.getFilePerFirma().getTiFilePerFirma().name());// TipoFileEnum.CERTIF_FIRMATARIO.name() - blobCertFirmatario.setBlFilePerFirma(certifFirmatarioType.getFilePerFirma().getBlFilePerFirma()); - blobCertFirmatario.setFirCertifFirmatario(firCertifFirmatario); - // - firCertifFirmatario.setFirFilePerFirma(blobCertFirmatario); - } else { - LOG.warn("File per firma non presente per Firmatario serial {}", - firCertifFirmatario.getNiSerialCertifFirmatario()); - } - // persist entityManager.persist(firCertifFirmatario); @@ -1131,7 +1037,7 @@ private FirCertifFirmatario buildFirCertifFirmatario(FirCertifCa tmpFirCertifCa, } private void buildFirReport(AroCompDoc tmpVerificaAroCompDoc, VerificaFirmaWrapper wrapper, - StrutturaVersamento strutV) throws VerificaFirmaException { + StrutturaVersamento strutV, String nomeWs) throws VerificaFirmaException { // servizio verifica firma determinato in precedenza DecServizioVerificaCompDoc servizioFirma = tmpVerificaAroCompDoc.getDecServizioVerificaCompDoc(); @@ -1203,37 +1109,34 @@ private void buildFirReport(AroCompDoc tmpVerificaAroCompDoc, VerificaFirmaWrapp // URN buildFirUrnReport(tmpFirReport, compUrnOrig, compUrnNorm); - // persist - entityManager.persist(tmpFirReport); - - // aws - Map awsPutReportZipResult = verificaFirmaReportAwsClient - .sendReportZipToObjStorage(tmpVerificaAroCompDoc.getIdCompDoc(), tmpFirReport.getIdFirReport(), - strutV, servizioFirma, tmpFirReport.getFirUrnReports(), reportZip); - if (awsPutReportZipResult != null) { - tmpFirReport.setNmBucket(verificaFirmaReportAwsClient.getBucketName()); - tmpFirReport.setCdKeyFile((String) awsPutReportZipResult.keySet().toArray()[0]); - } else { - LOG.warn("SalvataggioFirmaManager.buildFirRepor persistenza report verifica firma su BLOB"); - // force insert before update - entityManager.flush(); - // procedo alla memorizzazione del file sul blob, via JDBC - WriteCompBlbOracle.DatiAccessori datiAccessori = new WriteCompBlbOracle().new DatiAccessori(); - datiAccessori.setTabellaBlob(WriteCompBlbOracle.TabellaBlob.FIR_REPORT); - datiAccessori.setIdPadre(tmpFirReport.getIdFirReport()); - // - FileBinario fileB = new FileBinario(); - fileB.setFileSuDisco(reportZip.toFile()); - RispostaControlli tmpControlli = writeCompBlbOracle.aggiornaStreamSuBlobComp(datiAccessori, fileB); - if (!tmpControlli.isrBoolean()) { - throw new VerificaFirmaException(tmpControlli.getCodErr(), tmpControlli.getDsErr()); + BackendStorage backendVerificaFirme = objectStorageService + .lookupBackendByServiceName(strutV.getIdTipologiaUnitaDocumentaria(), nomeWs); + if (backendVerificaFirme.isObjectStorage()) { + + ObjectStorageResource savedReport = objectStorageService.createResourceInRerportvf( + backendVerificaFirme.getBackendName(), tmpVerificaAroCompDoc.getIdCompDoc(), + tmpFirReport.getIdFirReport(), strutV, servizioFirma, tmpFirReport.getFirUrnReports(), + reportZip); + if (savedReport == null) { + // Caso 1: il salvataggio su object storage non è andato a buon fine + saveReportFallback(tmpFirReport, reportZip); + } else { + tmpFirReport.setNmBucket(savedReport.getBucket()); + tmpFirReport.setCdKeyFile(savedReport.getKey()); + buildDecBackend(tmpFirReport, backendVerificaFirme.getBackendName()); + + // persist + entityManager.persist(tmpFirReport); } + } else { + // Caso 2: il backend è Database + saveReportFallback(tmpFirReport, reportZip); } // flush entityManager.flush(); } - } /* try */ catch (IOException ex) { + } /* try */ catch (IOException | ObjectStorageException ex) { throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "SalvataggioFirmaManager.buildFirReport errore generico durante elaborazione file report" @@ -1251,6 +1154,40 @@ private void buildFirReport(AroCompDoc tmpVerificaAroCompDoc, VerificaFirmaWrapp } } + /** + * Effettua il salvataggio del report su DB. Questo può accadere in due casi: + *

    + *
  • C'è stato un errore sul salvataggio su Object Storage
  • + *
  • Il backend configurato per il salvataggio dei report è il Database
  • + *
+ * + * @param tmpFirReport + * tabella FirReport + * @param reportZip + * Path file zip + * + * @throws VerificaFirmaException + */ + private void saveReportFallback(FirReport tmpFirReport, Path reportZip) throws VerificaFirmaException { + LOG.warn("SalvataggioFirmaManager.buildFirRepor persistenza report verifica firma su BLOB"); + + // Se ricadiamo in questo caso dobbiamo essere sicuri di rispettare il vincolo + // CK_BL_OR_BUCKET + tmpFirReport.setCdKeyFile(null); + tmpFirReport.setNmBucket(null); + entityManager.persist(tmpFirReport); + // force insert before update + entityManager.flush(); + // procedo alla memorizzazione del file sul blob, via JDBC + FileBinario fileB = new FileBinario(); + fileB.setFileSuDisco(reportZip.toFile()); + RispostaControlli tmpControlli = writeCompBlbOracle.aggiornaStreamSuBlobComp(fileB, + tmpFirReport.getIdFirReport()); + if (!tmpControlli.isrBoolean()) { + throw new VerificaFirmaException(tmpControlli.getCodErr(), tmpControlli.getDsErr()); + } + } + /* * Elab/Calc URN report file compressed */ @@ -1276,4 +1213,13 @@ private void buildFirUrnReport(FirReport tmpFirReport, String urnBase, String ur tmpFirReport.getFirUrnReports().add(tmpUrnReport); } + private void buildDecBackend(FirReport tmpFirReport, String nomeBackend) { + TypedQuery query = entityManager + .createQuery("Select d from DecBackend d where d.nmBackend = :nomeBackend", DecBackend.class); + query.setParameter("nomeBackend", nomeBackend); + DecBackend backend = query.getSingleResult(); + tmpFirReport.setDecBackend(backend); + + } + } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaReportAwsClient.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaReportAwsClient.java deleted file mode 100644 index e3c574d..0000000 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaReportAwsClient.java +++ /dev/null @@ -1,211 +0,0 @@ -package it.eng.parer.firma.ejb; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.stream.Collectors; - -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.ejb.EJB; -import javax.ejb.LocalBean; -import javax.ejb.Stateless; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.amazonaws.AmazonClientException; -import com.amazonaws.auth.AWSStaticCredentialsProvider; -import com.amazonaws.auth.BasicAWSCredentials; -import com.amazonaws.client.builder.AwsClientBuilder; -import com.amazonaws.regions.Regions; -import com.amazonaws.services.s3.AmazonS3; -import com.amazonaws.services.s3.AmazonS3Client; -import com.amazonaws.services.s3.model.ObjectMetadata; -import com.amazonaws.services.s3.model.ObjectTagging; -import com.amazonaws.services.s3.model.PutObjectRequest; -import com.amazonaws.services.s3.model.PutObjectResult; -import com.amazonaws.services.s3.model.Tag; - -import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; -import it.eng.parer.entity.DecServizioVerificaCompDoc; -import it.eng.parer.entity.FirUrnReport; -import it.eng.parer.entity.constraint.FiUrnReport.TiUrnReport; -import it.eng.parer.exception.SacerWsException; -import it.eng.parer.util.ejb.help.ConfigurationHelper; -import it.eng.parer.ws.utils.MessaggiWSFormat; -import it.eng.parer.ws.utils.ParametroApplDB; -import it.eng.parer.ws.utils.Costanti.AwsFormatter; -import it.eng.parer.ws.versamento.dto.StrutturaVersamento; -import static it.eng.parer.util.DateUtilsConverter.format; - -@Stateless(mappedName = "VerificaFirmaReportAwsClient") -@LocalBean -public class VerificaFirmaReportAwsClient { - - private static final Logger LOG = LoggerFactory.getLogger(VerificaFirmaReportAwsClient.class); - - private AmazonS3 awsClient = null; - - @EJB - private ConfigurationHelper configHelper; - - /* - *

Buffer per la lettura da blob. Il valore è stato preso da {@link BufferedInputStream#DEFAULT_BUFFER_SIZE}. - *

Hint per la scelta della dimensione del buffer:

 {@code SELECT AVG(DBMS_LOB.GETLENGTH
-     * ("BL_CONTEN_COMP")) as "Media byte di un documento" FROM aro_contenuto_comp WHERE rownum < 1000000 } 

- * Il risultato della dimensione media di un blob (per 1M di blob inseriti) è - * 253337,3456413456413456413456413456413456 byte.

- */ - private static final int BUFFER = 8192; - - private String bucketName; - - /** - * Inizializzazione del client S3. L'indirizzo corretto dovrebbe essere - * https://s3.storagegrid.ente.regione.emr.it:8082 - */ - @PostConstruct - private void init() { - // address - String storageAddress = configHelper.getParamApplicValue(ParametroApplDB.OBJECT_STORAGE_ADDR); - // aws credentials - final String reportvfAccessKeyId = configHelper.getParamApplicValue(ParametroApplDB.REPORTVF_S3_ACCESS_KEY_ID); - final String reportvfSecretKeyId = configHelper.getParamApplicValue(ParametroApplDB.REPORTVF_S3_SECRET_KEY); - // recupero le system properties - final String accessKeyId = System.getProperty(reportvfAccessKeyId); - final String secretKey = System.getProperty(reportvfSecretKeyId); - // create basic credentials - BasicAWSCredentials awsCreds = new BasicAWSCredentials(accessKeyId, secretKey); - - LOG.info("Sto per effettuare il collegamento all'endpoint S3 [{}]", storageAddress); - awsClient = AmazonS3Client.builder() - .withEndpointConfiguration( - new AwsClientBuilder.EndpointConfiguration(storageAddress, Regions.US_EAST_1.name())) - .withCredentials(new AWSStaticCredentialsProvider(awsCreds)).withPathStyleAccessEnabled(Boolean.TRUE) - .build(); - - // bucket - bucketName = configHelper.getParamApplicValue(ParametroApplDB.BUCKET_REPORT_VERIFICAFIRMA); - } - - /** - * Invio report verifica firma (zip archive) - * - * @param idCompDoc - * id componente - * @param idFirReport - * id report - * @param strutV - * wrapper dati versamento - * @param servizioFirma - * servizio verifica firma - * @param firUrnReports - * URN generati - * @param reportZip - * report verifia firma (zip archive) - * - * @return mappa immutabile (single element) con risultato chiamata e chiave file calcolato - */ - public Map sendReportZipToObjStorage(long idCompDoc, long idFirReport, - StrutturaVersamento strutV, DecServizioVerificaCompDoc servizioFirma, List firUrnReports, - Path reportZip) { - try { - // calculate key - final String cdKeyFile = MessaggiWSFormat.formattaComponenteCdKeyFile(strutV.getVersatoreNonverificato(), - strutV.getChiaveNonVerificata(), idCompDoc, Optional.of(idFirReport), - AwsFormatter.COMP_REPORTVF_CD_KEY_FILE_FMT); - - // 1. generate metadata - ObjectMetadata metadata = new ObjectMetadata(); - metadata.addUserMetadata("cd-service", servizioFirma.getCdServizio().toString()); - metadata.addUserMetadata("nm-version", servizioFirma.getNmVersione()); - metadata.addUserMetadata("creation-date", format(strutV.getDataVersamento())); - metadata.setContentType("Content-Type: application/zip; charset=UTF-8"); - metadata.setContentLength(reportZip.toFile().length()); - - // 2. generate tags - List tags = new ArrayList<>(); - // Opzionale - tags.add(new Tag("urn-originale", - firUrnReports.stream().filter(r -> r.getTiUrn().equals(TiUrnReport.ORIGINALE)) - .collect(Collectors.toList()).get(0).getDsUrn())); - tags.add(new Tag("urn-normalizzato", - firUrnReports.stream().filter(r -> r.getTiUrn().equals(TiUrnReport.NORMALIZZATO)) - .collect(Collectors.toList()).get(0).getDsUrn())); - - PutObjectResult result = putObjectAsStream(cdKeyFile, metadata, Optional.of(new ObjectTagging(tags)), - reportZip.toFile()); - // immutable map - return Collections.singletonMap(cdKeyFile, result); - } catch (SacerWsException ex) { - LOG.error("VerificaFirmaReportAwsClient.sendReportZipToObjStorage errore su invio report ad object storage", - ex); - return null; - } - } - - /** - * - * Send report file - * - * @param key - * chiave file - * @param metadata - * metadati (se esistono) - * @param tags - * tag (se esistono) - * @param reportVerificaFirma - * file report - * - * @return object result from AWS - * - * @throws SacerWsException - * eccezione generica - */ - private PutObjectResult putObjectAsStream(String key, ObjectMetadata metadata, Optional tags, - File reportVerificaFirma) throws SacerWsException { - try { - // 1. create request (base) - PutObjectRequest req = new PutObjectRequest(bucketName, key, - new BufferedInputStream(new FileInputStream(reportVerificaFirma), BUFFER), metadata); - // 1.b check tags - if (tags.isPresent()) { - req.withTagging(tags.get()); - } - // 2. put object - return awsClient.putObject(req); - } catch (AmazonClientException | FileNotFoundException ex) { - throw new SacerWsException("AWS: Errore generico su invio file, bucketname " + bucketName + " key " + key, - ex, SacerWsErrorCategory.INTERNAL_ERROR); - } - } - - /** - * Nome bucket (da configurazione database) - * - * @return nome bucket - */ - public String getBucketName() { - return bucketName; - } - - /* - * Client Shutdown - */ - @PreDestroy - private void destroy() { - LOG.info("Shutdown endpoint S3..."); - if (awsClient != null) { - awsClient.shutdown(); - } - } - -} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaReportHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaReportHelper.java index 775a9ff..630cc4a 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaReportHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaReportHelper.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -397,6 +414,7 @@ private ZipArchiveEntry filterZipEntry(ZipArchiveEntry entry) { return entry; } + @SuppressWarnings({ "rawtypes", "unchecked" }) private void marshalReport(Object response, BufferedOutputStream bwriter, boolean prettyPrint) throws JAXBException { JAXBContext jc = JAXBContext.newInstance(response.getClass()); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaWrapperManager.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaWrapperManager.java index 00ef872..782270b 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaWrapperManager.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaWrapperManager.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.firma.ejb; import java.math.BigInteger; @@ -7,7 +24,6 @@ import javax.ejb.Stateless; import org.apache.commons.lang3.BooleanUtils; -import org.apache.commons.lang3.exception.ExceptionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -114,19 +130,18 @@ private VerificaFirmaWrapper invokeEidas(InvokeVerificaInput in, AbsVersamentoEx try { wrapper = eidasInvoker.verificaAndWrapIt(in.getComponenteVers(), in.getSottoComponentiFirma(), in.getSottoComponentiMarca(), in.getAbilitazioni(), in.getDataDiRiferimento(), - in.isVerificaAllaDataDiFirma(), in.getUuid(), versamento); + Boolean.FALSE/* default */, in.getUuid(), versamento); } catch (VerificaFirmaConnectionException ex) { /* Errore su invocazione (GRAVE) */ LOG.error("Errore invocazione servizio verifica firma {}", ex.getCdService(), ex); /* Si passa ad invocazione CRYPTO..... */ } catch (VerificaFirmaGenericInvokeException epex) { /* Errore restituito da endpoint (gestito) */ - LOG.debug("Risposta con errore restituito da verifica firma {} {}", epex.getCdService(), - ExceptionUtils.getRootCauseMessage(epex), epex); + LOG.debug("Risposta con errore restituito da verifica firma {}", epex.getCdService(), epex); /* Si passa ad invocazione CRYPTO..... */ } catch (VerificaFirmaWrapperResNotFoundException | VerificaFirmaWrapperGenericException wrapex) { - /* Errore restituito da endpoint o su wrapping della risposta (GRAVE) */ - LOG.error("Errore wrapping risultato ottenuto da verifica firma EIDAS", wrapex); + /* Errore restituito da endpoint o su wrapping della risposta */ + LOG.warn("Errore generico", wrapex); /* Si passa ad invocazione CRYPTO..... */ } return wrapper; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/IVerificaFirmaInvokeException.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/IVerificaFirmaInvokeException.java index b7a799c..b19c56b 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/IVerificaFirmaInvokeException.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/IVerificaFirmaInvokeException.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /** * */ @@ -7,4 +24,6 @@ public interface IVerificaFirmaInvokeException { String getCdService(); -} \ No newline at end of file + String getUrl(); + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaConnectionException.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaConnectionException.java index 1bd67cb..4bb1a55 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaConnectionException.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaConnectionException.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -46,15 +63,11 @@ public String getCdService() { return cdService; } + @Override public String getUrl() { return url; } - /* - * (non-Javadoc) - * - * @see java.lang.Throwable#getLocalizedMessage() - */ @Override public String getMessage() { return "Servizio di verifica firma " + getCdService() + " non attivo o non raggiungibile ( " + getUrl() + ")"; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaException.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaException.java index 05c4f6d..2699ed9 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaException.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaException.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaGenericInvokeException.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaGenericInvokeException.java index d9ae61c..566af6c 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaGenericInvokeException.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaGenericInvokeException.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -48,15 +65,11 @@ public String getCdService() { return cdService; } + @Override public String getUrl() { return url; } - /* - * (non-Javadoc) - * - * @see java.lang.Throwable#getLocalizedMessage() - */ @Override public String getMessage() { return "Servizio di verifica firma " + getCdService() + " errore generico su gestione risposta da endpoint " diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaWrapperGenericException.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaWrapperGenericException.java index 9e963f2..595d7d6 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaWrapperGenericException.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaWrapperGenericException.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -38,15 +55,11 @@ public VerificaFirmaWrapper getVerificaFirmaWrapper() { return wrapper; } - /* - * (non-Javadoc) - * - * @see java.lang.Throwable#getLocalizedMessage() - */ @Override public String getMessage() { - return "Versione servizio v." + wrapper.getServiceVersion() + " libreria " - + wrapper.getAdditionalInfo().getServiceCode() + " v. " + wrapper.getLibraryVersion(); + return "Servizio di verifica firma " + wrapper.getAdditionalInfo().getServiceCode() + " [versione=" + + wrapper.getServiceVersion() + ", libreria=" + wrapper.getLibraryVersion() + + "] errore durante elaborazione report verifica " + super.getMessage(); } } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaWrapperResNotFoundException.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaWrapperResNotFoundException.java index c55fe6d..5248cec 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaWrapperResNotFoundException.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/exception/VerificaFirmaWrapperResNotFoundException.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -10,9 +27,6 @@ */ public class VerificaFirmaWrapperResNotFoundException extends Exception { - /** - * - */ private static final long serialVersionUID = 8471637049988191811L; private final String wichOne; @@ -21,11 +35,14 @@ public VerificaFirmaWrapperResNotFoundException(String message, String wichOne) this.wichOne = wichOne; } - /** - * @return the wichOne - */ public String getWichOne() { return wichOne; } + @Override + public String getMessage() { + return "Servizio di verifica firma " + wichOne + + " report verifica mancante, non possibile estrarre il risultato per elaborazione successiva."; + } + } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/CryptoWrapperResultStrategy.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/CryptoWrapperResultStrategy.java index 215c59e..25c3e87 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/CryptoWrapperResultStrategy.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/CryptoWrapperResultStrategy.java @@ -1,13 +1,33 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.firma.strategy; import static it.eng.parer.ws.utils.XmlDateUtility.dateToXMLGregorianCalendar; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; -import java.util.List; +import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -23,10 +43,9 @@ import it.eng.parer.crypto.model.verifica.CryptoFirCertifCa; import it.eng.parer.crypto.model.verifica.CryptoFirCertifFirmatario; import it.eng.parer.crypto.model.verifica.CryptoFirCrl; -import it.eng.parer.crypto.model.verifica.CryptoFirFilePerFirma; import it.eng.parer.crypto.model.verifica.CryptoFirUrlDistribCrl; import it.eng.parer.entity.constraint.DecServizioVerificaCompDoc.CdServizioVerificaCompDoc; -import it.eng.parer.firma.util.VerificaFirmaEnums; +import it.eng.parer.firma.util.VerificaFirmaEnums.SacerIndication; import it.eng.parer.firma.xml.VFAdditionalInfoFirmaCompType; import it.eng.parer.firma.xml.VFAdditionalInfoMarcaCompType; import it.eng.parer.firma.xml.VFCertifCaType; @@ -34,30 +53,20 @@ import it.eng.parer.firma.xml.VFContrFirmaCompType; import it.eng.parer.firma.xml.VFContrMarcaCompType; import it.eng.parer.firma.xml.VFCrlType; -import it.eng.parer.firma.xml.VFFilePerFirmaType; import it.eng.parer.firma.xml.VFFirmaCompType; import it.eng.parer.firma.xml.VFMarcaCompType; import it.eng.parer.firma.xml.VFTipoControlloType; -import it.eng.parer.firma.xml.VFTipoFileType; import it.eng.parer.firma.xml.VFTipoFirmaType; import it.eng.parer.firma.xml.VFUrlDistribCrlType; import it.eng.parer.firma.xml.VerificaFirmaWrapper; import it.eng.parer.firma.xml.VerificaFirmaWrapper.VFBusta; -import it.eng.parer.ws.versamento.dto.AbsVersamentoExt; - -import java.time.ZonedDateTime; -import java.util.ArrayList; -import java.util.Objects; -import java.util.stream.Collectors; public class CryptoWrapperResultStrategy implements IVerificaFirmaWrapperResultStrategy { private final Logger LOG = LoggerFactory.getLogger(CryptoWrapperResultStrategy.class); - private AbsVersamentoExt versamento; - - public CryptoWrapperResultStrategy(AbsVersamentoExt versamento) { - this.versamento = versamento; + public CryptoWrapperResultStrategy() { + super(); } @Override @@ -66,7 +75,7 @@ public String getCode() { } @Override - public void fromVerificaOutOnWrapper(CryptoAroCompDoc result, VerificaFirmaWrapper wrapper, ZonedDateTime dtRef) { + public void fromVerificaOutOnWrapper(CryptoAroCompDoc result, VerificaFirmaWrapper wrapper) { // Inizio e fine validazione wrapper.setStartDate(dateToXMLGregorianCalendar(result.getInizioValidazione())); @@ -333,8 +342,8 @@ private VFFirmaCompType buildFirma(CryptoAroFirmaComp cryptoFirma) { // Aggiungo il controllo OCSP (con esito NON_NECESSARIO) VFContrFirmaCompType contrFirmaCompOCSP = new VFContrFirmaCompType(); contrFirmaCompOCSP.setTiContr(VFTipoControlloType.OCSP); - contrFirmaCompOCSP.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO.name()); - contrFirmaCompOCSP.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO.message()); + contrFirmaCompOCSP.setTiEsitoContrFirma(SacerIndication.NON_NECESSARIO.name()); + contrFirmaCompOCSP.setDsMsgEsitoContrFirma(SacerIndication.NON_NECESSARIO.message()); firma.getContrFirmaComps().add(contrFirmaCompOCSP); firma.setDlDnFirmatario(cryptoFirma.getDlDnFirmatario()); @@ -448,8 +457,8 @@ private VFMarcaCompType buildMarca(CryptoAroMarcaComp cryptoMarca) { // Aggiungo il controllo OCSP (con esito NON_NECESSARIO) VFContrMarcaCompType contrMarcaCompOCSP = new VFContrMarcaCompType(); contrMarcaCompOCSP.setTiContr(VFTipoControlloType.OCSP); - contrMarcaCompOCSP.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO.name()); - contrMarcaCompOCSP.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO.message()); + contrMarcaCompOCSP.setTiEsitoContrMarca(SacerIndication.NON_NECESSARIO.name()); + contrMarcaCompOCSP.setDsMsgEsitoContrMarca(SacerIndication.NON_NECESSARIO.message()); marca.getContrMarcaComps().add(contrMarcaCompOCSP); return marca; @@ -470,11 +479,7 @@ private VFCertifFirmatarioType buildFirmatario(CryptoFirCertifFirmatario cryptoF certifFirmatario.setDtFinValCertifFirmatario( dateToXMLGregorianCalendar(cryptoFirmatario.getDtFinValCertifFirmatario())); certifFirmatario.setNiSerialCertifFirmatario(cryptoFirmatario.getNiSerialCertifFirmatario()); - if (cryptoFirmatario.getFirFilePerFirma() != null) { - VFFilePerFirmaType filePerFirmaFirmatario = buildFilePerFirma(cryptoFirmatario.getFirFilePerFirma()); - certifFirmatario.setFilePerFirma(filePerFirmaFirmatario); - } if (cryptoFirmatario.getFirCertifCa() != null) { VFCertifCaType certifCA = buildCertifCA(cryptoFirmatario.getFirCertifCa()); certifFirmatario.setCertifCaFirmatario(certifCA); @@ -509,36 +514,9 @@ private VFCertifCaType buildCertifCA(CryptoFirCertifCa cryptoCa) { certifCA.getUrlDistribCrls().add(urlDistribCrlType); } - // Blob della firma può essere NULL? - if (cryptoCa.getFirFilePerFirma() != null) { - VFFilePerFirmaType filePerFirma = buildFilePerFirma(cryptoCa.getFirFilePerFirma()); - certifCA.setFilePerFirma(filePerFirma); - } return certifCA; } - /** - * Compila la busta che contiene il blob, e relativi metadati, contenente: - *

    - *
  • {@link VFTipoFileType#CERTIF_CA}
  • - *
  • {@link VFTipoFileType#CERTIF_CRL}
  • - *
  • {@link VFTipoFileType#CERTIF_FIRMATARIO}
  • - *
- * - * @param crytpoFilePerFirma - * Modello restituito da crypto - * - * @return modello di file per firma del wrapper - */ - private VFFilePerFirmaType buildFilePerFirma(CryptoFirFilePerFirma crytpoFilePerFirma) { - VFFilePerFirmaType filePerFirma = new VFFilePerFirmaType(); - filePerFirma.setNmFileDownload(crytpoFilePerFirma.getNmFileDownload()); - filePerFirma.setBlFilePerFirma(crytpoFilePerFirma.getBlFilePerFirma()); - // FIXME enum - filePerFirma.setTiFilePerFirma(VFTipoFileType.valueOf(crytpoFilePerFirma.getTiFilePerFirma())); - return filePerFirma; - } - /** * Compila la busta relativa alle CRL. ATTENZIONE: il blob delle crl ({@code parerCrl.getEncoded()}) può * arrivare a superare i 40MB. @@ -553,8 +531,6 @@ private VFCrlType buildCrl(CryptoFirCrl cryptoCrl) { crl.setDtIniCrl(dateToXMLGregorianCalendar(cryptoCrl.getDtIniCrl())); crl.setDtScadCrl(dateToXMLGregorianCalendar(cryptoCrl.getDtScadCrl())); crl.setNiSerialCrl(cryptoCrl.getNiSerialCrl()); - VFFilePerFirmaType buildFilePerFirma = buildFilePerFirma(cryptoCrl.getFirFilePerFirma()); - crl.setFilePerFirma(buildFilePerFirma); CryptoFirCertifCa firCertifCa = cryptoCrl.getFirCertifCa(); VFCertifCaType buildCertifCA = buildCertifCA(firCertifCa); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/EidasBaseWrapperResult.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/EidasBaseWrapperResult.java deleted file mode 100644 index 7718c00..0000000 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/EidasBaseWrapperResult.java +++ /dev/null @@ -1,184 +0,0 @@ -package it.eng.parer.firma.strategy; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion; -import eu.europa.esig.dss.detailedreport.jaxb.XmlMessage; -import eu.europa.esig.dss.diagnostic.AbstractTokenProxy; -import eu.europa.esig.dss.diagnostic.CertificateRevocationWrapper; -import eu.europa.esig.dss.diagnostic.CertificateWrapper; -import eu.europa.esig.dss.enumerations.CertificateSourceType; -import eu.europa.esig.dss.enumerations.RevocationType; -import it.eng.parer.eidas.model.EidasWSReportsDTOTree; -import it.eng.parer.firma.exception.VerificaFirmaWrapperGenericException; -import it.eng.parer.firma.xml.VerificaFirmaWrapper; -import java.time.ZonedDateTime; -import static it.eng.parer.util.DateUtilsConverter.convert; - -public abstract class EidasBaseWrapperResult { - - private static final Logger LOG = LoggerFactory.getLogger(EidasBaseWrapperResult.class); - - protected String getCertificateCAId(AbstractTokenProxy sigts, CertificateWrapper xmlcertificate) { - // se trusted o selfsigned è la CA - if (xmlcertificate.isTrusted() || xmlcertificate.isSelfSigned()) { - return xmlcertificate.getId(); - } - // se non è la CA la individua dalla chain - // nota : non esiste più di una CA nella catena - if (sigts.isTrustedChain()) { - return sigts.getCertificateChain().stream() - .filter(c -> c.getSources().contains(CertificateSourceType.TRUSTED_STORE) - || c.getSources().contains(CertificateSourceType.TRUSTED_LIST)) - .collect(Collectors.toList()).get(0).getId(); - } - // verifica se esite in chain un certificato selfsigned - if (sigts.getCertificateChain().stream().anyMatch(c -> c.isSelfSigned())) { - return sigts.getCertificateChain().stream().filter(c -> c.isSelfSigned()).collect(Collectors.toList()) - .get(0).getId(); - } - - // ultimo scenario : restituisce l'id dell'ultimo elemento della catena - return sigts.getCertificateChain().get(sigts.getCertificateChain().size() - 1).getId(); - } - - protected CertificateRevocationWrapper findRevocationByType(CertificateWrapper certificate, ZonedDateTime dtRef, - RevocationType type) { - // - CertificateRevocationWrapper revocation = null; - // no revocation - if (certificate.getCertificateRevocationData().stream().noneMatch(r -> r.getRevocationType().equals(type))) { - // null - return revocation; - } - - // extract revocations by source type - List revocationFilteredBySource = certificate.getCertificateRevocationData() - .stream().filter(r -> r.getRevocationType().equals(type)).collect(Collectors.toList()); - - // get only one - if (revocationFilteredBySource.size() == 1) { - revocation = revocationFilteredBySource.get(0); - } else { - // - List revocationFilteredByOriginDate = null; - - // filter by RevocationOrigin (EXTERNAL / CACHED) - // verify - // https://github.com/esig/dss/blob/5.8/dss-enumerations/src/main/java/eu/europa/esig/dss/enumerations/RevocationOrigin.java - if (revocationFilteredBySource.stream().filter(c -> !c.getOrigin().isInternalOrigin()).count() != 0) { - revocationFilteredByOriginDate = revocationFilteredBySource.stream() - .filter(c -> !c.getOrigin().isInternalOrigin()).collect(Collectors.toList()); - } else if (revocationFilteredBySource.stream().filter(c -> c.getOrigin().isInternalOrigin()).count() != 0) { - // filter by RevocationOrigin (embedded) - revocationFilteredByOriginDate = revocationFilteredBySource.stream() - .filter(c -> c.getOrigin().isInternalOrigin()).collect(Collectors.toList()); - } else { - // filter by date - revocationFilteredByOriginDate = revocationFilteredBySource.stream().filter( - c -> c.getThisUpdate().after(convert(dtRef)) && c.getNextUpdate().before(convert(dtRef))) - .collect(Collectors.toList()); - } - - // error - if (revocationFilteredByOriginDate.isEmpty() && LOG.isErrorEnabled()) { - LOG.error("{} certificate id {} not found", type.name(), certificate.getId()); - // null - return revocation; - } - - // warn - if (revocationFilteredByOriginDate.size() > 1 && LOG.isWarnEnabled()) { - LOG.warn("{} certificate id {} more than one (get first of list)", type.name(), certificate.getId()); - } - // get first - revocation = revocationFilteredByOriginDate.get(0); - } - // - return revocation; - } - - /* - * OCSP REVOCATION + CERTIFICATE - */ - - /* - * Accedendo fino all'ultimo elemento a partire da sinistra percorrendo i successivi livelli - * - */ - protected String getMimeTypeUnsigned(EidasWSReportsDTOTree parent, List child) { - // condizioni di uscita - // ultimo elemento unsigned non trovato - if (child == null || child.isEmpty()) { - return parent.getMimeType(); - } - // left child - EidasWSReportsDTOTree leftChild = child.get(0); - // mime found - if (leftChild.isUnsigned()) { - return leftChild.getMimeType(); - } else { - return getMimeTypeUnsigned(leftChild, leftChild.getChildren()); - } - - } - - protected void logEidasConclusion(CertificateWrapper certificate, XmlConclusion conclusion) { - logEidasConclusion(certificate, conclusion, null); - } - - protected void logEidasConclusion(CertificateWrapper certificate, XmlConclusion conclusion, String tipo) { - StringBuilder msg = new StringBuilder(); - if (conclusion.getWarnings().stream().count() != 0) { - msg.append(conclusion.getWarnings().stream().map(XmlMessage::getValue).collect(Collectors.joining(";"))); - } - if (conclusion.getErrors().stream().count() != 0) { - msg.append(conclusion.getErrors().stream().map(XmlMessage::getValue).collect(Collectors.joining(";"))); - } - LOG.debug("EIDAS FIRMA CONCLUSION ID = {} {}, msg {}", certificate.getId(), - tipo == null ? "" : " tipo controllo " + tipo, msg); - } - - protected static class EidasWrapperResultControl { - - private EidasWrapperResultControl() { - throw new IllegalStateException("Utility class"); - } - - public static void fieldCannotBeNull(VerificaFirmaWrapper wrapper, Object obj, String fieldName, - Optional param) throws VerificaFirmaWrapperGenericException { - try { - Method getField = findMethod(obj, fieldName); - if (getField.invoke(obj) == null) { - final String msg = "[" + obj.getClass().getName() + " nome campo " + fieldName + " risulta null, " - + (param.isPresent() ? " EIDAS signature id = " + param.get() : "") + "]"; - LOG.error(msg); - // - throw new VerificaFirmaWrapperGenericException(msg, wrapper); - } - } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException - | NoSuchMethodException | SecurityException e) { - throw new VerificaFirmaWrapperGenericException(e, wrapper); - } - } - - private static Method findMethod(Object obj, String fieldName) throws NoSuchMethodException { - Method getField; - try { - getField = obj.getClass().getDeclaredMethod("get" + StringUtils.capitalize(fieldName)); - } catch (NoSuchMethodException e) { - getField = obj.getClass().getSuperclass().getDeclaredMethod("get" + StringUtils.capitalize(fieldName)); - } - return getField; - } - } - -} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/EidasWrapperResultStrategy.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/EidasWrapperResultStrategy.java index c859d9b..99cc251 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/EidasWrapperResultStrategy.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/EidasWrapperResultStrategy.java @@ -1,100 +1,82 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.firma.strategy; +import java.lang.reflect.InvocationTargetException; import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.ZoneId; import java.time.ZonedDateTime; -import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import eu.europa.esig.dss.detailedreport.jaxb.XmlBasicBuildingBlocks; -import eu.europa.esig.dss.detailedreport.jaxb.XmlCV; -import eu.europa.esig.dss.detailedreport.jaxb.XmlISC; -import eu.europa.esig.dss.detailedreport.jaxb.XmlRAC; -import eu.europa.esig.dss.detailedreport.jaxb.XmlSubXCV; -import eu.europa.esig.dss.detailedreport.jaxb.XmlXCV; -import eu.europa.esig.dss.diagnostic.CertificateRevocationWrapper; -import eu.europa.esig.dss.diagnostic.CertificateWrapper; -import eu.europa.esig.dss.diagnostic.RevocationWrapper; import eu.europa.esig.dss.diagnostic.SignatureWrapper; import eu.europa.esig.dss.diagnostic.TimestampWrapper; -import eu.europa.esig.dss.enumerations.Indication; -import eu.europa.esig.dss.enumerations.RevocationType; -import eu.europa.esig.dss.enumerations.SignatureLevel; -import eu.europa.esig.dss.enumerations.SubIndication; import eu.europa.esig.dss.validation.reports.Reports; +import it.eng.parer.eidas.model.EidasValidationResponse; import it.eng.parer.eidas.model.EidasWSReportsDTOTree; -import it.eng.parer.eidas.model.EsitoValidazioneEidas; -import it.eng.parer.eidas.model.ExtensionsDTO; import it.eng.parer.entity.constraint.DecServizioVerificaCompDoc.CdServizioVerificaCompDoc; -import it.eng.parer.firma.exception.VerificaFirmaWrapperGenericException; -import it.eng.parer.firma.util.VerificaFirmaEnums; +import it.eng.parer.firma.strategy.eidas.EidasBaseWrapperResult; +import it.eng.parer.firma.strategy.eidas.factory.EidasVFFirmaCompBuilder; +import it.eng.parer.firma.strategy.eidas.factory.EidasVFMarcaCompBuilder; import it.eng.parer.firma.xml.VFAdditionalInfoBustaType; -import it.eng.parer.firma.xml.VFAdditionalInfoFirmaCompType; -import it.eng.parer.firma.xml.VFAdditionalInfoMarcaCompType; -import it.eng.parer.firma.xml.VFCertifCaType; -import it.eng.parer.firma.xml.VFCertifFirmatarioType; -import it.eng.parer.firma.xml.VFCertifOcspType; -import it.eng.parer.firma.xml.VFContrFirmaCompType; -import it.eng.parer.firma.xml.VFContrMarcaCompType; -import it.eng.parer.firma.xml.VFCrlType; -import it.eng.parer.firma.xml.VFFilePerFirmaType; import it.eng.parer.firma.xml.VFFirmaCompType; import it.eng.parer.firma.xml.VFMarcaCompType; -import it.eng.parer.firma.xml.VFOcspType; -import it.eng.parer.firma.xml.VFTipoControlloType; -import it.eng.parer.firma.xml.VFTipoFileType; -import it.eng.parer.firma.xml.VFTipoFirmaType; -import it.eng.parer.firma.xml.VFUrlDistribCrlType; -import it.eng.parer.firma.xml.VFUrlDistribOcspType; import it.eng.parer.firma.xml.VerificaFirmaWrapper; import it.eng.parer.firma.xml.VerificaFirmaWrapper.VFBusta; -import it.eng.parer.ws.utils.ParametroApplDB.ParametroApplFl; -import it.eng.parer.ws.versamento.dto.AbsVersamentoExt; import it.eng.parer.ws.utils.Costanti; import it.eng.parer.ws.utils.XmlDateUtility; public class EidasWrapperResultStrategy extends EidasBaseWrapperResult - implements IVerificaFirmaWrapperResultStrategy { + implements IVerificaFirmaWrapperResultStrategy { private static final Logger LOG = LoggerFactory.getLogger(EidasWrapperResultStrategy.class); - private static final String LOG_FMT_SUBINDICATION = "Eidas esito = {} controllo tipo = {} subindication = {}"; - private boolean verificaAllaDataDiFirma; private Map controlliAbilitati; - private AbsVersamentoExt versamento; - - private static final int PG_BUSTA = 0; - private static final int PG_FIRMA = 1; - private static final int PG_MARCA = 2; + private boolean isDataDiRiferimentoOnCompVers; + private ZonedDateTime dataDiRiferimento; + private Set modificatoriWSCalc; /** * Firma necessaria al costrutture per le logiche successive che serviranno a determinare, sulla base dell'output di * verifica, come gestire determinate casistiche (vedi controlli e tipo rif alla data) - * - * @param verificaAllaDataDiFirma - * boolean true/false per verifica alla data firma - * @param versamento - * astrazione con metadati di versamento * * @param controlliAbilitati * lista dei controlli (flag true/false) + * @param isDataDiRiferimentoOnCompVers + * data di riferimento specificata su componente + * @param dataDiRiferimento + * data di rifiremento da utilizzare per verifica firma + * @param modificatoriWSCalc + * modificatori versione SIP */ - public EidasWrapperResultStrategy(boolean verificaAllaDataDiFirma, Map controlliAbilitati, - AbsVersamentoExt versamento) { - this.verificaAllaDataDiFirma = verificaAllaDataDiFirma; + public EidasWrapperResultStrategy(Map controlliAbilitati, boolean isDataDiRiferimentoOnCompVers, + ZonedDateTime dataDiRiferimento, Set modificatoriWSCalc) { + super(); this.controlliAbilitati = controlliAbilitati; - this.versamento = versamento; + this.isDataDiRiferimentoOnCompVers = isDataDiRiferimentoOnCompVers; + this.dataDiRiferimento = dataDiRiferimento; + this.modificatoriWSCalc = modificatoriWSCalc; } @Override @@ -102,17 +84,9 @@ public String getCode() { return CdServizioVerificaCompDoc.EIDAS.name(); } - private Map getControlliAbilitati() { - return controlliAbilitati; - } - - private boolean isVerificaAllaDataDiFirma() { - return verificaAllaDataDiFirma; - } - @Override - public void fromVerificaOutOnWrapper(EsitoValidazioneEidas esito, VerificaFirmaWrapper wrapper, ZonedDateTime dtRef) - throws VerificaFirmaWrapperGenericException { + public void fromVerificaOutOnWrapper(EidasValidationResponse esito, VerificaFirmaWrapper wrapper) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { /* * Nota: contatori GLOBALI */ @@ -140,40 +114,33 @@ public void fromVerificaOutOnWrapper(EsitoValidazioneEidas esito, VerificaFirmaW } wrapper.getAdditionalInfo().setTikaMime(tikaMime); // - compileWrapper(wrapper, esito.getEidasWSReportsDTOTree(), dtRef, pgs); + compileWrapper(wrapper, esito.getEidasWSReportsDTOTree(), pgs); } - private void compileWrapper(VerificaFirmaWrapper wrapper, EidasWSReportsDTOTree dto, ZonedDateTime dtRef, - BigDecimal[] pgs) throws VerificaFirmaWrapperGenericException { + private void compileWrapper(VerificaFirmaWrapper wrapper, EidasWSReportsDTOTree dto, BigDecimal[] pgs) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { // root element if (!dto.isParent()) { - // reports by dss - Reports reports = new Reports(dto.getReport().getDiagnosticData(), dto.getReport().getDetailedReport(), - dto.getReport().getSimpleReport(), null /* validation report non gestito */); - pgs = buildBusta(wrapper, dtRef, dto, reports, pgs); + // build busta + buildBusta(wrapper, dto, pgs); } - // per ogni figlio - for (EidasWSReportsDTOTree child : dto.getChildren()) { - if (child.isUnsigned() /* ultimo livello documento non firmato */) { - break; - } - if (child.getReport().getSimpleReport() - .getSignaturesCount() != 0/* report "valido" esiste almeno una firma */) { - // reports by dss - Reports reports = new Reports(child.getReport().getDiagnosticData(), - child.getReport().getDetailedReport(), child.getReport().getSimpleReport(), - null /* validation report non gestito */); - pgs = buildBusta(wrapper, dtRef, child, reports, pgs); - // recursive call - compileWrapper(wrapper, child, dtRef, pgs); - } + // only signed child && at least one signature + List childSigned = dto.getChildren().stream() + .filter(c -> !c.isUnsigned() && c.getReport().getSimpleReport().getSignaturesCount() != 0) + .collect(Collectors.toList()); + for (EidasWSReportsDTOTree child : childSigned) { + // build busta + buildBusta(wrapper, child, pgs); + // recursive + compileWrapper(wrapper, child, pgs); } } - private BigDecimal[] buildBusta(VerificaFirmaWrapper wrapper, ZonedDateTime dtRef, EidasWSReportsDTOTree tree, - Reports reports, BigDecimal[] pgs) throws VerificaFirmaWrapperGenericException { - // Extensions - Map extensions = tree.getExtensions(); + private void buildBusta(VerificaFirmaWrapper wrapper, EidasWSReportsDTOTree dto, BigDecimal[] pgs) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + // reports by dss + Reports reports = new Reports(dto.getReport().getDiagnosticData(), dto.getReport().getDetailedReport(), + dto.getReport().getSimpleReport(), null /* validation report non gestito */); // creo busta VFBusta busta = new VFBusta(); @@ -192,33 +159,24 @@ private BigDecimal[] buildBusta(VerificaFirmaWrapper wrapper, ZonedDateTime dtRe // strutta per gestione firme e contro firme Map firmaCompParent = new HashMap<>(); for (SignatureWrapper signature : signatures) { - - // FIRMA - VFFirmaCompType firmaCompType = new VFFirmaCompType(); - // set setPgFirma - firmaCompType.setPgFirma(pgs[PG_FIRMA]); - // set id (id componente PARER) - firmaCompType.setId(tree.getIdComponente()); - // build firma - buildFirmaComp(wrapper, extensions, firmaCompType, signature, dtRef, reports); + VFFirmaCompType firmaCompType = new EidasVFFirmaCompBuilder().create(controlliAbilitati, + isDataDiRiferimentoOnCompVers, dataDiRiferimento, modificatoriWSCalc, dto, wrapper, signature, + Optional.empty(), pgs); // inc pgFirma pgs[PG_FIRMA] = pgs[PG_FIRMA].add(BigDecimal.ONE); // marche temporali for (TimestampWrapper ts : signature.getTimestampList()) { - // MARCHE - VFMarcaCompType marcaCompType = new VFMarcaCompType(); - // set pgMarche - marcaCompType.setPgMarca(pgs[PG_MARCA]); - // set id (id componente PARER) - marcaCompType.setId(tree.getIdComponente()); + // build marca + VFMarcaCompType marcaCompType = new EidasVFMarcaCompBuilder().create(controlliAbilitati, + isDataDiRiferimentoOnCompVers, dataDiRiferimento, modificatoriWSCalc, dto, wrapper, signature, + Optional.of(ts), pgs); + // add on list firmaCompType.getMarcaComps().add(marcaCompType); - // build marca - buildMarcaComp(wrapper, reports, extensions, marcaCompType, ts, signature.getSignatureFormat(), dtRef); // inc pgMarche pgs[PG_MARCA] = pgs[PG_MARCA].add(BigDecimal.ONE); } @@ -238,1513 +196,6 @@ private BigDecimal[] buildBusta(VerificaFirmaWrapper wrapper, ZonedDateTime dtRe }); } } - - return pgs; - } - - private void buildMarcaComp(VerificaFirmaWrapper wrapper, Reports reports, Map extensions, - VFMarcaCompType marcaCompType, TimestampWrapper ts, SignatureLevel signatureFormat, ZonedDateTime dtRef) - throws VerificaFirmaWrapperGenericException { - - // add info (empty) - VFAdditionalInfoMarcaCompType additionalInfoMarcaCompType = new VFAdditionalInfoMarcaCompType(); - marcaCompType.setAdditionalInfo(additionalInfoMarcaCompType); - - // ******************************** - // USED CERTIFICATE - // ******************************** - // CERTIFICATO TSA + BLOB - VFCertifCaType certifCaType = new VFCertifCaType(); - marcaCompType.setCertifTsa(certifCaType); - - CertificateWrapper xmlcertificateTsa = reports.getDiagnosticData() - .getUsedCertificateById(ts.getSigningCertificate().getId()); - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificateTsa, "serialNumber", - Optional.ofNullable(ts.getSigningCertificate().getId())); - certifCaType.setNiSerialCertifCa(new BigDecimal(xmlcertificateTsa.getSerialNumber())); - - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificateTsa, "notAfter", - Optional.ofNullable(ts.getSigningCertificate().getId())); - certifCaType.setDtFinValCertifCa(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateTsa.getNotAfter())); - - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificateTsa, "notBefore", - Optional.ofNullable(ts.getSigningCertificate().getId())); - certifCaType.setDtIniValCertifCa(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateTsa.getNotBefore())); - - // check subjectKeyId - if (extensions.containsKey(xmlcertificateTsa.getId())) { - certifCaType.setDsSubjectKeyId(extensions.get(xmlcertificateTsa.getId()).getSubjectKeyIdentifier()); - } - - int urlIdx = 1; - for (String url : xmlcertificateTsa.getCRLDistributionPoints()) { - VFUrlDistribCrlType urlDistribCrlType = new VFUrlDistribCrlType(); - urlDistribCrlType.setDlUrlDistribCrl(url); - urlDistribCrlType.setNiOrdUrlDistribCrl(new BigDecimal(urlIdx)); - - certifCaType.getUrlDistribCrls().add(urlDistribCrlType); - - // inc idc - urlIdx++; - } - // CA - String certificateCAId = getCertificateCAId(ts, xmlcertificateTsa); - // - CertificateWrapper xmlcertificateCA = reports.getDiagnosticData().getUsedCertificateById(certificateCAId); - // ocsp (from CA+certificate) - Iterable ocspCombinedUrls = CollectionUtils.union(xmlcertificateCA.getOCSPAccessUrls(), - xmlcertificateTsa.getOCSPAccessUrls()); - // ocsp - urlIdx = 1; - for (String url : ocspCombinedUrls) { - VFUrlDistribOcspType urlDistribOcspType = new VFUrlDistribOcspType(); - urlDistribOcspType.setDlUrlDistribOcsp(url); - urlDistribOcspType.setNiOrdUrlDistribOcsp(new BigDecimal(urlIdx)); - - certifCaType.getUrlDistribOcsps().add(urlDistribOcspType); - // inc idx - urlIdx++; - } - - certifCaType.setDlDnIssuerCertifCa(xmlcertificateTsa.getCertificateIssuerDN()); - certifCaType.setDlDnSubjectCertifCa(xmlcertificateTsa.getCertificateDN()); - - VFFilePerFirmaType filePerFirmaType = new VFFilePerFirmaType(); - certifCaType.setFilePerFirma(filePerFirmaType); - - filePerFirmaType.setBlFilePerFirma(xmlcertificateTsa.getBinaries()); - filePerFirmaType.setTiFilePerFirma(VFTipoFileType.CERTIF_CA); - - // ************************* - // nullable element - String dsAlgoMarca = null; - if (ts.getDigestAlgorithm() != null && ts.getEncryptionAlgorithm() != null) { - dsAlgoMarca = ts.getDigestAlgorithm().getName().concat("with") - .concat(ts.getEncryptionAlgorithm().getName()); - } - marcaCompType.setDsAlgoMarca(dsAlgoMarca); - marcaCompType.setTmMarcaTemp(XmlDateUtility.dateToXMLGregorianCalendar(ts.getProductionTime())); - marcaCompType.setTiFormatoMarca(signatureFormat.toString());// ereditato dalla firma - marcaCompType.setDtScadMarca(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateTsa.getNotAfter())); - // check marcaBase64 - if (extensions.containsKey(ts.getId())) { - marcaCompType.setDsMarcaBase64(extensions.get(ts.getId()).getMarcaBase64()); - } - /** - * CONTROLLI / ESITI MARCA - */ - // building block - XmlBasicBuildingBlocks bbb = reports.getDetailedReport().getBasicBuildingBlockById(ts.getId()); - if (bbb == null) { - // TOFIX: cosa fare in questi casi ?! - LOG.warn("BasicBuildingBlockById not found TS ID = {}", ts.getId()); - } - // CONTROLLI MARCA - buildContrMarcaComp(marcaCompType, ts, xmlcertificateTsa, bbb); - - // esito controllo CERTIFICATO - VFContrMarcaCompType contrMarcaCompCert = marcaCompType.getContrMarcaComps().stream() - .filter(c -> c.getTiContr().equals(VFTipoControlloType.CERTIFICATO)).collect(Collectors.toList()) - .get(0); - - // OCSP - buildMarcaCompTSAwithOCSP(wrapper, marcaCompType, reports, xmlcertificateTsa, dtRef, extensions, bbb); - - // CRL - buildMarcaCompTSAwithCRL(wrapper, marcaCompType, certifCaType, xmlcertificateTsa, dtRef, extensions, bbb, - contrMarcaCompCert); - - } - - /* - * Nota: non possiamo persistere più di una CRL (non supportato), viene costruita un'apposita lista "filtrata" con - * il solo elemento utile - * - */ - private void buildMarcaCompTSAwithCRL(VerificaFirmaWrapper wrapper, VFMarcaCompType marcaCompType, - VFCertifCaType certifCaType, CertificateWrapper xmlcertificateTsa, ZonedDateTime dtRef, - Map extensions, XmlBasicBuildingBlocks bbb, VFContrMarcaCompType contrMarcaCompCert) - throws VerificaFirmaWrapperGenericException { - - // OCSP prioritario rispetto CRL - boolean hasOcsp = xmlcertificateTsa.getCertificateRevocationData().stream() - .anyMatch(r -> r.getRevocationType().equals(RevocationType.OCSP)); - - // CRL - RevocationWrapper crl = findRevocationByType(xmlcertificateTsa, dtRef, RevocationType.CRL); - if (hasOcsp || crl == null) { - // - buildContrCRLNotFoundMarcaComp(marcaCompType, xmlcertificateTsa, hasOcsp); - return; - } // no crl - - // CRL - VFCrlType crlTypeTsa = buildCrl(wrapper, extensions, crl); - // CRL : CA - crlTypeTsa.setCertifCa(certifCaType); - // MARCA : CRL - marcaCompType.setCrlTsa(crlTypeTsa); - - // controlli CRL - buildContrCRLMarcaComp(marcaCompType, xmlcertificateTsa, crl, bbb, contrMarcaCompCert, hasOcsp); - // CRL - End - } - - private void buildMarcaCompTSAwithOCSP(VerificaFirmaWrapper wrapper, VFMarcaCompType marcaCompType, Reports reports, - CertificateWrapper xmlcertificateTsa, ZonedDateTime dtRef, Map extensions, - XmlBasicBuildingBlocks bbb) throws VerificaFirmaWrapperGenericException { - // verifica presenza CRL - boolean hasCrl = xmlcertificateTsa.getCertificateRevocationData().stream() - .anyMatch(r -> r.getRevocationType().equals(RevocationType.CRL)); - - // OCSP - CertificateRevocationWrapper ocsp = findRevocationByType(xmlcertificateTsa, dtRef, RevocationType.OCSP); - if (ocsp == null) { - // - buildContrOCSPNotFoundMarcaComp(marcaCompType, xmlcertificateTsa, hasCrl); - return; - } // no crl - - // CA - VFCertifCaType certifCaOcspType = buildOcspCertifCA(wrapper, reports, xmlcertificateTsa, extensions, ocsp); - - // build OCSP - VFOcspType ocspTypeTsa = buildOcspWithCertif(wrapper, certifCaOcspType, ocsp); - marcaCompType.setOcspTsa(ocspTypeTsa); - // - // CRONTROLLI OCSP - buildContrOCSPMarcaComp(marcaCompType, xmlcertificateTsa, ocsp, bbb, hasCrl); - // OCSP - End - } - - private void buildContrCRLNotFoundMarcaComp(VFMarcaCompType marcaCompType, CertificateWrapper xmlcertificateTsa, - boolean hasOcsp) { - buildContrCRLMarcaComp(marcaCompType, xmlcertificateTsa, null, null, null, hasOcsp); - } - - private void buildContrCRLMarcaComp(VFMarcaCompType marcaCompType, CertificateWrapper xmlcertificateTsa, - RevocationWrapper crl, XmlBasicBuildingBlocks bbb, VFContrMarcaCompType contrMarcaCompCert, - boolean hasOcsp) { - /* - * caso "particolare" di building block non trovato (vedi controllo precedente con WARNING) in questi casi si - * assumono come NON PASSATI i controlli sull'oggetto perché non reperibili - */ - boolean bbbFounded = bbb != null; - // presente la CRL - boolean hasCrl = crl != null; - // presente solo la CRL - boolean onlyCrl = hasCrl && !hasOcsp; - // presente solo OCSP - boolean onlyOcsp = !onlyCrl; - // no revoche - boolean noRevocations = !hasCrl && !hasOcsp; - - // CONTROLLI MARCA - CRL - VFContrMarcaCompType contrMarcaCompType = new VFContrMarcaCompType(); - marcaCompType.getContrMarcaComps().add(contrMarcaCompType); - contrMarcaCompType.setTiContr(VFTipoControlloType.CRL); - - if (!getControlliAbilitati().get(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS).booleanValue()) { - // - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.DISABILITATO.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.DISABILITATO.message()); - } else { - // scenario 1 : solo crl ed errore su certificato - if (onlyCrl && !contrMarcaCompCert.getTiEsitoContrMarca() - .equals(VerificaFirmaEnums.EsitoControllo.POSITIVO.name())) { - // presente crl e non ocsp, errore sul controllo del certificato - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO.message()); - } else /* scenario 2 : crl e ocsp non presente */ if (noRevocations) { - // caso 1 : 3/12/2009 <= notAfter && 3/12/2009 >= notBefore - Date revokedDate = Date - .from(LocalDate.of(2009, 12, 3).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()); - if (xmlcertificateTsa.getNotAfter().before(revokedDate) - && xmlcertificateTsa.getNotBefore().after(revokedDate)) { - contrMarcaCompType.setTiEsitoContrMarca( - VerificaFirmaEnums.EsitoControllo.CERTIFICATO_SCADUTO_3_12_2009.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca( - VerificaFirmaEnums.EsitoControllo.CERTIFICATO_SCADUTO_3_12_2009.message()); - } else /* caso 2 */ { - contrMarcaCompType - .setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.CRL_NON_SCARICABILE.name()); - contrMarcaCompType - .setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.CRL_NON_SCARICABILE.message()); - - } - } else /* scenario 3 : solo ocsp */ if (onlyOcsp) { - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.CRL_NON_SCARICABILE.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca( - VerificaFirmaEnums.EsitoControllo.CRL_NON_SCARICABILE.alternative()[0]); - } /* scenario 4 : solo CRL disponibile */ else { - if (!bbbFounded || bbb.getXCV().getSubXCV().stream() - .noneMatch(c -> c.getId().equals(xmlcertificateTsa.getId()))) { - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - } else { - // - XmlSubXCV subXvc = bbb.getXCV().getSubXCV().stream() - .filter(c -> c.getId().equals(xmlcertificateTsa.getId())).collect(Collectors.toList()) - .get(0); - // - List xmlRacs = subXvc.getRAC().stream().filter(r -> r.getId().equals(crl.getId())) - .collect(Collectors.toList()); - if (xmlRacs.isEmpty()) { - contrMarcaCompType - .setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - } else if (!xmlRacs.get(0).getConclusion().getIndication().equals(Indication.PASSED)) { - // evaluate subindication (Revocation acceptence) - VerificaFirmaEnums.EsitoControllo esito = evaluateCRLXmlRacSubIndication( - contrMarcaCompType.getTiContr().name(), xmlRacs); - - // log eidas message - logEidasConclusion(xmlcertificateTsa, bbb.getConclusion(), VFTipoControlloType.CRL.name()); - - contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); - contrMarcaCompType.setTiEsitoContrMarca(esito.name()); - } else { - contrMarcaCompType - .setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.POSITIVO.message()); - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.POSITIVO.name()); - } - } - } - } - } - - private void buildContrOCSPNotFoundMarcaComp(VFMarcaCompType marcaCompType, CertificateWrapper xmlcertificateTsa, - boolean hasCrl) { - buildContrOCSPMarcaComp(marcaCompType, xmlcertificateTsa, null, null, hasCrl); - } - - private void buildContrOCSPMarcaComp(VFMarcaCompType marcaCompType, CertificateWrapper xmlcertificateTsa, - CertificateRevocationWrapper ocsp, XmlBasicBuildingBlocks bbb, boolean hasCrl) { - - /* - * caso "particolare" di building block non trovato (vedi controllo precedente con WARNING) in questi casi si - * assumono come NON PASSATI i controlli sull'oggetto perché non reperibili - */ - boolean bbbFounded = bbb != null; - // presente OCSP - boolean hasOcsp = ocsp != null; - // no revoche - boolean noRevocations = !hasCrl && !hasOcsp; - - // CONTROLLI MARCA - OCSP - VFContrMarcaCompType contrMarcaCompType = new VFContrMarcaCompType(); - marcaCompType.getContrMarcaComps().add(contrMarcaCompType); - contrMarcaCompType.setTiContr(VFTipoControlloType.OCSP); - - if (!getControlliAbilitati().get(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS).booleanValue()) { - // - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.DISABILITATO.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.DISABILITATO.message()); - } else { - // scenario 1 : revoche non presenti - if (noRevocations) { - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.OCSP_NON_SCARICABILE.name()); - contrMarcaCompType - .setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.OCSP_NON_SCARICABILE.message()); - } else if (hasCrl && !hasOcsp) /* scenario 2 : presente la CRL ma NON OCSP */ { - // - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO.message()); - } else /* scenario 3 : ocsp presente */ { - // Nota : non trovato il build block oppure l'indicazione con il risultato di - // validazione del certifcato - if (!bbbFounded || bbb.getXCV().getSubXCV().stream() - .noneMatch(c -> c.getId().equals(xmlcertificateTsa.getId()))) { - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - } else { - // - XmlSubXCV subXvc = bbb.getXCV().getSubXCV().stream() - .filter(c -> c.getId().equals(xmlcertificateTsa.getId())).collect(Collectors.toList()) - .get(0); - // - List xmlRacs = subXvc.getRAC().stream().filter(r -> r.getId().equals(ocsp.getId())) - .collect(Collectors.toList()); - - if (xmlRacs.isEmpty() - || !xmlRacs.get(0).getConclusion().getIndication().equals(Indication.PASSED)) { - // evalutate subindication - VerificaFirmaEnums.EsitoControllo esito = evaluateOCSPXmlRacSubIndication(ocsp, - contrMarcaCompType.getTiContr().name(), xmlRacs); - - logEidasConclusion(xmlcertificateTsa, xmlRacs.get(0).getConclusion(), - VFTipoControlloType.OCSP.name()); - - contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); - contrMarcaCompType.setTiEsitoContrMarca(esito.name()); - } else { - contrMarcaCompType - .setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.OCSP_VALIDO.message()); - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.OCSP_VALIDO.name()); - } - } - } - } - } - - private void buildContrMarcaComp(VFMarcaCompType marcaCompType, TimestampWrapper ts, - CertificateWrapper xmlcertificateTsa, XmlBasicBuildingBlocks bbb) { - // - boolean bbbFounded = bbb != null; - // - boolean isTimestampCompliant = ts.isSignatureIntact() && ts.isSignatureValid(); // TODO: da verificare se - // diversa condizione - marcaCompType.setTiEsitoContrConforme(isTimestampCompliant ? VerificaFirmaEnums.EsitoControllo.POSITIVO.name() - : VerificaFirmaEnums.EsitoControllo.FORMATO_NON_CONOSCIUTO.name()); - marcaCompType - .setDsMsgEsitoContrConforme(isTimestampCompliant ? VerificaFirmaEnums.EsitoControllo.POSITIVO.message() - : VerificaFirmaEnums.EsitoControllo.FORMATO_NON_CONOSCIUTO.name()); - - if (!bbbFounded) { - marcaCompType.setTiEsitoVerifMarca(VerificaFirmaEnums.EsitoControllo.WARNING.name()); - marcaCompType.setDsMsgEsitoVerifMarca(VerificaFirmaEnums.EsitoControllo.WARNING.message()); - } else { - if (!bbb.getConclusion().getIndication().equals(Indication.PASSED)) { - logEidasConclusion(xmlcertificateTsa, bbb.getConclusion()); - // - marcaCompType.setTiEsitoVerifMarca(VerificaFirmaEnums.EsitoControllo.WARNING.name()); - marcaCompType.setDsMsgEsitoVerifMarca(VerificaFirmaEnums.EsitoControllo.WARNING.message()); - } else { - marcaCompType.setTiEsitoVerifMarca(VerificaFirmaEnums.EsitoControllo.POSITIVO.name()); - marcaCompType.setDsMsgEsitoVerifMarca(VerificaFirmaEnums.EsitoControllo.POSITIVO.message()); - } - } - - VFContrMarcaCompType contrMarcaCompType = new VFContrMarcaCompType(); - marcaCompType.getContrMarcaComps().add(contrMarcaCompType); - contrMarcaCompType.setTiContr(VFTipoControlloType.CRITTOGRAFICO); - - XmlCV cv = bbbFounded ? bbb.getCV() : null; - - if (!getControlliAbilitati().get(ParametroApplFl.FL_ABILITA_CONTR_CRITTOG_VERS).booleanValue()) { - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.DISABILITATO.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.DISABILITATO.message()); - } else { - if (!isTimestampCompliant) { - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.message()); - } else if (!bbbFounded) { - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.ERRORE.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.ERRORE.message()); - } else { - if (!cv.getConclusion().getIndication().equals(Indication.PASSED)) { - VerificaFirmaEnums.EsitoControllo esito = VerificaFirmaEnums.EsitoControllo.NEGATIVO; // getSubIndication - // == - // null - // subindication - if (cv.getConclusion().getSubIndication() != null) { - switch (cv.getConclusion().getSubIndication()) { - case FORMAT_FAILURE: - esito = VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO; - break; - case NO_POE: - esito = VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO; - break; - default: - esito = VerificaFirmaEnums.EsitoControllo.NEGATIVO; // default - LOG.debug(LOG_FMT_SUBINDICATION, esito, contrMarcaCompType.getTiContr(), - cv.getConclusion().getSubIndication()); - break; - } - } - // log eidas message - logEidasConclusion(xmlcertificateTsa, cv.getConclusion(), VFTipoControlloType.CRITTOGRAFICO.name()); - - contrMarcaCompType.setTiEsitoContrMarca(esito.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); - } else { - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.POSITIVO.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.POSITIVO.message()); - } - } - } - - // CONTROLLI MARCA - CERTIFICATO - contrMarcaCompType = new VFContrMarcaCompType(); - marcaCompType.getContrMarcaComps().add(contrMarcaCompType); - contrMarcaCompType.setTiContr(VFTipoControlloType.CERTIFICATO); - - if (!getControlliAbilitati().get(ParametroApplFl.FL_ABILITA_CONTR_CERTIF_VERS).booleanValue()) { - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.DISABILITATO.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.DISABILITATO.message()); - } else { - // identificazione certificato - XmlISC isc = bbbFounded ? bbb.getISC() : null; - // validità del certificato - XmlXCV xcv = bbbFounded ? bbb.getXCV() : null; - // - if (!isTimestampCompliant) { - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.message()); - } else if (!bbbFounded) { - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.ERRORE.message()); - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.ERRORE.name()); - } else { - if (!isc.getConclusion().getIndication().equals(Indication.PASSED)) { - // log eidas message - logEidasConclusion(xmlcertificateTsa, xcv.getConclusion(), VFTipoControlloType.CERTIFICATO.name()); - - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - } else if (!xcv.getConclusion().getIndication().equals(Indication.PASSED)) { - /* - * Unico esito supportato nelle marche è NEGATIVO (ERRORE su EIDAS non trova traduzione.....) Lo - * switch/case è "over" rispetto l'unico caso di esito possibile (se non PASSED), viene comunque - * implementato per "traccare" le possibili subindication - */ - VerificaFirmaEnums.EsitoControllo esito = VerificaFirmaEnums.EsitoControllo.NEGATIVO; // getSubIndication - // == - // null - // subindication - if (xcv.getConclusion().getSubIndication() != null) { - switch (xcv.getConclusion().getSubIndication()) { - case OUT_OF_BOUNDS_NO_POE: - esito = VerificaFirmaEnums.EsitoControllo.NEGATIVO; - break; - case OUT_OF_BOUNDS_NOT_REVOKED: - // The current time is not in the validity range of the signers certificate. - // Non è chiaro se la data di firma sia precedente o successiva alla validità - // del - // certificato. - // vedi anche https://ec.europa.eu/cefdigital/tracker/browse/DSS-2070 - esito = VerificaFirmaEnums.EsitoControllo.NEGATIVO; - break; - default: - esito = VerificaFirmaEnums.EsitoControllo.NEGATIVO; // default - LOG.debug(LOG_FMT_SUBINDICATION, esito, contrMarcaCompType.getTiContr(), - cv.getConclusion().getSubIndication()); - break; - } - } - - // log eidas message - logEidasConclusion(xmlcertificateTsa, xcv.getConclusion(), VFTipoControlloType.CERTIFICATO.name()); - - contrMarcaCompType.setTiEsitoContrMarca(esito.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); - } else { - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.POSITIVO.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.POSITIVO.message()); - } - } - } - - // CONTROLLI MARCA - CATENA_TRUSTED - contrMarcaCompType = new VFContrMarcaCompType(); - marcaCompType.getContrMarcaComps().add(contrMarcaCompType); - contrMarcaCompType.setTiContr(VFTipoControlloType.CATENA_TRUSTED); - // - if (!getControlliAbilitati().get(ParametroApplFl.FL_ABILITA_CONTR_TRUST_VERS).booleanValue()) { - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.DISABILITATO.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.DISABILITATO.message()); - } else if (!isTimestampCompliant) { - contrMarcaCompType.setTiEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.name()); - contrMarcaCompType.setDsMsgEsitoContrMarca(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.message()); - } else { - // - contrMarcaCompType.setTiEsitoContrMarca( - xmlcertificateTsa.isTrustedChain() ? VerificaFirmaEnums.EsitoControllo.POSITIVO.name() - : VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - // - contrMarcaCompType.setDsMsgEsitoContrMarca( - xmlcertificateTsa.isTrustedChain() ? VerificaFirmaEnums.EsitoControllo.POSITIVO.message() - : VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - } - - } - - private void buildFirmaComp(VerificaFirmaWrapper wrapper, Map extensions, - VFFirmaCompType firmaCompType, SignatureWrapper signature, ZonedDateTime dtRef, Reports reports) - throws VerificaFirmaWrapperGenericException { - - // add info (empty) - VFAdditionalInfoFirmaCompType additionalInfoFirmaCompType = new VFAdditionalInfoFirmaCompType(); - firmaCompType.setAdditionalInfo(additionalInfoFirmaCompType); - - // SIGNATURE CERTIFICATE - // certificate - CertificateWrapper xmlcertificate = reports.getDiagnosticData() - .getUsedCertificateById(signature.getSigningCertificate().getId()); - - // FIRMATARIO + BLOB - VFCertifFirmatarioType certifFirmatarioType = new VFCertifFirmatarioType(); - firmaCompType.setCertifFirmatario(certifFirmatarioType); - - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificate, "serialNumber", - Optional.ofNullable(xmlcertificate.getId())); - certifFirmatarioType.setNiSerialCertifFirmatario(new BigDecimal(xmlcertificate.getSerialNumber())); - - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificate, "notBefore", - Optional.ofNullable(xmlcertificate.getId())); - certifFirmatarioType - .setDtIniValCertifFirmatario(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificate.getNotBefore())); - - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificate, "notAfter", - Optional.ofNullable(xmlcertificate.getId())); - certifFirmatarioType - .setDtFinValCertifFirmatario(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificate.getNotAfter())); - - VFFilePerFirmaType filePerFirmaType = new VFFilePerFirmaType(); - certifFirmatarioType.setFilePerFirma(filePerFirmaType); - - filePerFirmaType.setBlFilePerFirma(xmlcertificate.getBinaries()); - filePerFirmaType.setTiFilePerFirma(VFTipoFileType.CERTIF_FIRMATARIO); - - // CA - String certificateCAId = getCertificateCAId(signature, xmlcertificate); - // - CertificateWrapper xmlcertificateCA = reports.getDiagnosticData().getUsedCertificateById(certificateCAId); - - VFCertifCaType certifCaType = new VFCertifCaType(); - certifFirmatarioType.setCertifCaFirmatario(certifCaType); - - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificateCA, "serialNumber", - Optional.ofNullable(xmlcertificateCA.getId())); - certifCaType.setNiSerialCertifCa(new BigDecimal(xmlcertificateCA.getSerialNumber())); - - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificateCA, "notBefore", - Optional.ofNullable(xmlcertificateCA.getId())); - certifCaType.setDtIniValCertifCa(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateCA.getNotBefore())); - - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificateCA, "notAfter", - Optional.ofNullable(xmlcertificateCA.getId())); - certifCaType.setDtFinValCertifCa(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateCA.getNotAfter())); - // check subjectKeyId - if (extensions.containsKey(xmlcertificateCA.getId())) { - certifCaType.setDsSubjectKeyId(extensions.get(xmlcertificateCA.getId()).getSubjectKeyIdentifier()); - } - certifCaType.setDlDnIssuerCertifCa(xmlcertificateCA.getCertificateIssuerDN()); - certifCaType.setDlDnSubjectCertifCa(xmlcertificateCA.getCertificateDN()); - - int urlIdx = 1; - for (String url : xmlcertificateCA.getCRLDistributionPoints()) { - VFUrlDistribCrlType urlDistribCrlType = new VFUrlDistribCrlType(); - urlDistribCrlType.setDlUrlDistribCrl(url); - urlDistribCrlType.setNiOrdUrlDistribCrl(new BigDecimal(urlIdx)); - - certifCaType.getUrlDistribCrls().add(urlDistribCrlType); - // inc idx - urlIdx++; - } - // ocsp (from CA+certificate) - Iterable ocspCombinedUrls = CollectionUtils.union(xmlcertificateCA.getOCSPAccessUrls(), - xmlcertificate.getOCSPAccessUrls()); - urlIdx = 1; - for (String url : ocspCombinedUrls) { - VFUrlDistribOcspType urlDistribOcspType = new VFUrlDistribOcspType(); - urlDistribOcspType.setDlUrlDistribOcsp(url); - urlDistribOcspType.setNiOrdUrlDistribOcsp(new BigDecimal(urlIdx)); - - certifCaType.getUrlDistribOcsps().add(urlDistribOcspType); - // inc idx - urlIdx++; - } - // - filePerFirmaType = new VFFilePerFirmaType(); - certifCaType.setFilePerFirma(filePerFirmaType); - - filePerFirmaType.setBlFilePerFirma(xmlcertificateCA.getBinaries()); - filePerFirmaType.setTiFilePerFirma(VFTipoFileType.CERTIF_CA); - // FIRMA : CA - firmaCompType.setCertifCa(certifCaType); - // nullable element - String dsAlgoFirma = null; - if (signature.getDigestAlgorithm() != null && signature.getEncryptionAlgorithm() != null) { - dsAlgoFirma = signature.getDigestAlgorithm().getName().concat("with") - .concat(signature.getEncryptionAlgorithm().getName()); - } - firmaCompType.setDsAlgoFirma(dsAlgoFirma); - firmaCompType.setDlDnFirmatario(xmlcertificate.getCertificateDN()); - firmaCompType.setDsFirmaBase64(Base64.encodeBase64String(signature.getSignatureValue())); - - String cdFirmatario = null; - if (StringUtils.isNotBlank(xmlcertificate.getSubjectSerialNumber())) { - cdFirmatario = xmlcertificate.getSubjectSerialNumber(); - } else { - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificate, "serialNumber", - Optional.ofNullable(xmlcertificate.getId())); - cdFirmatario = xmlcertificate.getSerialNumber(); - } - firmaCompType.setCdFirmatario(cdFirmatario); - firmaCompType.setDtFirma(XmlDateUtility.dateToXMLGregorianCalendar(signature.getClaimedSigningTime())); - - // - if (!signature.getTimestampList().isEmpty()) { - firmaCompType - .setTmRifTempUsato(XmlDateUtility.dateToXMLGregorianCalendar(signature.getClaimedSigningTime())); - firmaCompType.setTipoRiferimentoTemporaleUsato(VerificaFirmaEnums.TipoRifTemporale.MT_VERS_NORMA.name()); - } else if (isVerificaAllaDataDiFirma()) { - firmaCompType - .setTmRifTempUsato(XmlDateUtility.dateToXMLGregorianCalendar(signature.getClaimedSigningTime())); - firmaCompType.setTipoRiferimentoTemporaleUsato(VerificaFirmaEnums.TipoRifTemporale.DATA_FIRMA.name()); - } else { - firmaCompType.setTmRifTempUsato(XmlDateUtility.dateToXMLGregorianCalendar(dtRef)); - firmaCompType.setTipoRiferimentoTemporaleUsato(VerificaFirmaEnums.TipoRifTemporale.RIF_TEMP_VERS.name()); - } - - // - firmaCompType.setTiFormatoFirma(signature.getSignatureFormat().toString()); - // - firmaCompType.setNmCognomeFirmatario(xmlcertificate.getSurname()); - firmaCompType.setNmFirmatario(xmlcertificate.getGivenName()); - // - firmaCompType.setTiFirma(VFTipoFirmaType.DIGITALE); - - // basic building block - XmlBasicBuildingBlocks bbb = reports.getDetailedReport().getBasicBuildingBlockById(signature.getId()); - if (bbb == null) { - // TOFIX: cosa fare in questi casi ?! - LOG.warn("BasicBuildingBlockById not found SIGNATURE ID = {}", signature.getId()); - } - // basic building block counter signature parent - XmlBasicBuildingBlocks bbbParent = null; - if (signature.isCounterSignature()) { - bbbParent = reports.getDetailedReport().getBasicBuildingBlockById(signature.getParent().getId()); - if (bbbParent == null) { - // TOFIX: cosa fare in questi casi ?! - LOG.warn("Parent BasicBuildingBlockById not found SIGNATURE ID = {}", signature.getParent().getId()); - } - } - // CONTROLLI FIRMA - // global result - boolean isSignaturePassed = reports.getSimpleReport().isValid(signature.getId()); - buildContrFirmaComp(firmaCompType, isSignaturePassed, signature, xmlcertificateCA, bbb, bbbParent); - - // controllo CERTIFICATO (CRL+OCSP) - VFContrFirmaCompType contrFirmaCert = firmaCompType.getContrFirmaComps().stream() - .filter(c -> c.getTiContr().equals(VFTipoControlloType.CERTIFICATO)).collect(Collectors.toList()) - .get(0); - - // OCSP CA - buildFirmaCompCAwithOCSP(wrapper, reports, xmlcertificateCA, firmaCompType, dtRef, extensions); - // OCSP + CONTR - buildFirmaCompCERwithOCSP(wrapper, reports, xmlcertificate, firmaCompType, dtRef, extensions, bbb); - - // CRL CA - buildFirmaCompCAwithCRL(wrapper, xmlcertificateCA, certifCaType, firmaCompType, dtRef, extensions); - // CRL + CONTR - buildFirmaCompCERwithCRL(wrapper, xmlcertificate, certifCaType, firmaCompType, dtRef, extensions, bbb, - contrFirmaCert); - - } - - private void buildContrFirmaComp(VFFirmaCompType firmaCompType, boolean isSignaturePassed, - SignatureWrapper signature, CertificateWrapper xmlcertificate, XmlBasicBuildingBlocks bbb, - XmlBasicBuildingBlocks bbbParent) { - - // format checking - boolean isFormatCompliant = false; - if (bbbParent != null) { - // counter signature : non ha il controllo di formato (lo eredita dal padre) - isFormatCompliant = bbbParent.getFC() != null - && bbbParent.getFC().getConclusion().getIndication().equals(Indication.PASSED); - } else { - isFormatCompliant = bbb != null && bbb.getFC() != null - && bbb.getFC().getConclusion().getIndication().equals(Indication.PASSED); - } - firmaCompType.setTiEsitoContrConforme(isFormatCompliant ? VerificaFirmaEnums.EsitoControllo.POSITIVO.name() - : VerificaFirmaEnums.EsitoControllo.FORMATO_NON_CONFORME.name()); - // - firmaCompType - .setDsMsgEsitoContrConforme(isFormatCompliant ? VerificaFirmaEnums.EsitoControllo.POSITIVO.message() - : VerificaFirmaEnums.EsitoControllo.FORMATO_NON_CONFORME.name()); - - // verifica risultato "globale" di verifica firma - firmaCompType.setTiEsitoVerifFirma(isSignaturePassed ? VerificaFirmaEnums.EsitoControllo.POSITIVO.name() - : VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - // - firmaCompType.setDsMsgEsitoVerifFirma(isSignaturePassed ? VerificaFirmaEnums.EsitoControllo.POSITIVO.message() - : VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - - // caso "particolare" di building block non trovato (vedi controllo - // precedente con WARNING) - // in questi casi si assumono come NON PASSATI i controlli sull'oggetto perché - // non reperibili - boolean bbbFounded = bbb != null; - - // CONTROLLI FIRMA - CRITTOGRAFICO signatureValidations - // CertificateReliability - VFContrFirmaCompType contrFirmaCompType = new VFContrFirmaCompType(); - firmaCompType.getContrFirmaComps().add(contrFirmaCompType); - contrFirmaCompType.setTiContr(VFTipoControlloType.CRITTOGRAFICO); - - // valiazione crittografica - XmlCV cv = bbbFounded ? bbb.getCV() : null; - if (!getControlliAbilitati().get(ParametroApplFl.FL_ABILITA_CONTR_CRITTOG_VERS).booleanValue()) { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.DISABILITATO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.DISABILITATO.message()); - } else { - if (!isFormatCompliant) { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.message()); - } else if (!bbbFounded) { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - } else { - if (!cv.getConclusion().getIndication().equals(Indication.PASSED) && !isSignaturePassed) { - VerificaFirmaEnums.EsitoControllo esito = VerificaFirmaEnums.EsitoControllo.NEGATIVO; // getSubIndication - // == - // null // - // subindication - if (cv.getConclusion().getSubIndication() != null) { - switch (cv.getConclusion().getSubIndication()) { - case FORMAT_FAILURE: - esito = VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO; - break; - case NO_POE: - esito = VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO; - break; - case SIG_CRYPTO_FAILURE: - esito = VerificaFirmaEnums.EsitoControllo.NEGATIVO; - break; - case HASH_FAILURE: - esito = VerificaFirmaEnums.EsitoControllo.NEGATIVO; - break; - default: - esito = VerificaFirmaEnums.EsitoControllo.NEGATIVO; // default - LOG.debug(LOG_FMT_SUBINDICATION, esito, contrFirmaCompType.getTiContr(), - cv.getConclusion().getSubIndication()); - break; - } - } - // log eidas message - logEidasConclusion(xmlcertificate, cv.getConclusion(), VFTipoControlloType.CRITTOGRAFICO.name()); - - contrFirmaCompType.setTiEsitoContrFirma(esito.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); - } else { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.POSITIVO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.POSITIVO.message()); - } - } - } - - // TOFIX: al momento è lo stesso risultato raccolto sopra - // CONTROLLI FIRMA - CRITTOGRAFICO_ABILITATO signatureValidations - contrFirmaCompType = new VFContrFirmaCompType(); - firmaCompType.getContrFirmaComps().add(contrFirmaCompType); - contrFirmaCompType.setTiContr(VFTipoControlloType.CRITTOGRAFICO_ABILITATO); - - if (!isFormatCompliant) { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.message()); - } else if (!bbbFounded) { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - } else { - if (!cv.getConclusion().getIndication().equals(Indication.PASSED) && !isSignaturePassed) { - VerificaFirmaEnums.EsitoControllo esito = VerificaFirmaEnums.EsitoControllo.NEGATIVO; // getSubIndication - // == - // null // - // subindication - // subindication - if (cv.getConclusion().getSubIndication() != null) { - switch (cv.getConclusion().getSubIndication()) { - case FORMAT_FAILURE: - esito = VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO; - break; - case NO_POE: - esito = VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO; - break; - case SIG_CRYPTO_FAILURE: - esito = VerificaFirmaEnums.EsitoControllo.NEGATIVO; - break; - case HASH_FAILURE: - esito = VerificaFirmaEnums.EsitoControllo.NEGATIVO; - break; - default: - esito = VerificaFirmaEnums.EsitoControllo.NEGATIVO; // default - LOG.debug(LOG_FMT_SUBINDICATION, esito, contrFirmaCompType.getTiContr(), - cv.getConclusion().getSubIndication()); - break; - } - } - // log eidas message - logEidasConclusion(xmlcertificate, cv.getConclusion(), - VFTipoControlloType.CRITTOGRAFICO_ABILITATO.name()); - - contrFirmaCompType.setTiEsitoContrFirma(esito.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); - } else { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.POSITIVO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.POSITIVO.message()); - } - } - - // CONTROLLI FIRMA - CATENA_TRUSTED_ABILITATO CertificateAssociation && - // CertificateReliability - contrFirmaCompType = new VFContrFirmaCompType(); - firmaCompType.getContrFirmaComps().add(contrFirmaCompType); - contrFirmaCompType.setTiContr(VFTipoControlloType.CATENA_TRUSTED_ABILITATO); - - if (!getControlliAbilitati().get(ParametroApplFl.FL_ABILITA_CONTR_TRUST_VERS).booleanValue()) { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.DISABILITATO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.DISABILITATO.message()); - } else if (!isFormatCompliant) { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.message()); - } else { - contrFirmaCompType.setTiEsitoContrFirma( - signature.isTrustedChain() || isSignaturePassed ? VerificaFirmaEnums.EsitoControllo.POSITIVO.name() - : VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(signature.isTrustedChain() || isSignaturePassed - ? VerificaFirmaEnums.EsitoControllo.POSITIVO.message() - : VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - } - - // CONTROLLI FIRMA - CERTIFICATO CertificateExpiration - contrFirmaCompType = new VFContrFirmaCompType(); - firmaCompType.getContrFirmaComps().add(contrFirmaCompType); - contrFirmaCompType.setTiContr(VFTipoControlloType.CERTIFICATO); - - if (!getControlliAbilitati().get(ParametroApplFl.FL_ABILITA_CONTR_CERTIF_VERS).booleanValue()) { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.DISABILITATO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.DISABILITATO.message()); - } else { - if (!isFormatCompliant) { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.message()); - } else { - // identificazione certificato - XmlISC isc = bbbFounded ? bbb.getISC() : null; - // validità del certificato - XmlXCV xcv = bbbFounded ? bbb.getXCV() : null; - if (!bbbFounded) { - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - } else { - // isc - if (!isc.getConclusion().getIndication().equals(Indication.PASSED) && !isSignaturePassed) { - // log eidas message - logEidasConclusion(xmlcertificate, isc.getConclusion(), VFTipoControlloType.CERTIFICATO.name()); - - // Nota: non si effettua verifica di sottoindicazione in quanto se questo tipo - // di controllo è - // errato - // si assume che il certificato di firma non è valido - contrFirmaCompType - .setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.CERTIFICATO_NON_VALIDO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma( - VerificaFirmaEnums.EsitoControllo.CERTIFICATO_NON_VALIDO.alternative()[0]); - } else if (!xcv.getConclusion().getIndication().equals(Indication.PASSED) && !isSignaturePassed) { - String alternativeMsg = null; - VerificaFirmaEnums.EsitoControllo esito = VerificaFirmaEnums.EsitoControllo.CERTIFICATO_ERRATO; // getSubIndication - // == - // null - // subindication xcv - if (xcv.getConclusion().getSubIndication() != null) { - switch (xcv.getConclusion().getSubIndication()) { - case OUT_OF_BOUNDS_NO_POE: - esito = VerificaFirmaEnums.EsitoControllo.CERTIFICATO_SCADUTO; - break; - case OUT_OF_BOUNDS_NOT_REVOKED: - // The current time is not in the validity range of the signers certificate. - // Non è chiaro se la data di firma sia precedente o successiva alla validità - // del - // certificato. - // vedi anche https://ec.europa.eu/cefdigital/tracker/browse/DSS-2070 - esito = VerificaFirmaEnums.EsitoControllo.CERTIFICATO_SCADUTO; - /* - * MAC 25213 - in questo caso abbiamo un esito INDETERMINATE da eidas MA sia che la - * verifica sia a alla data di versamento, sia che lo sia alla data della firma se - * rientra nel periodo di valità del certificato deve essere positivo. - */ - Date dataRiferimento = XmlDateUtility - .xmlGregorianCalendarToDate(firmaCompType.getTmRifTempUsato()); - Date dataInizio = XmlDateUtility.xmlGregorianCalendarToDate( - firmaCompType.getCertifFirmatario().getDtIniValCertifFirmatario()); - Date dataFine = XmlDateUtility.xmlGregorianCalendarToDate( - firmaCompType.getCertifFirmatario().getDtFinValCertifFirmatario()); - - if (dataRiferimento != null && isBetween(dataRiferimento, dataInizio, dataFine)) { - esito = VerificaFirmaEnums.EsitoControllo.POSITIVO; - } - - break; - case EXPIRED: - esito = VerificaFirmaEnums.EsitoControllo.CERTIFICATO_SCADUTO; - break; - case CRYPTO_CONSTRAINTS_FAILURE_NO_POE: - esito = VerificaFirmaEnums.EsitoControllo.CERTIFICATO_NON_VALIDO; - break; - case NOT_YET_VALID: - esito = VerificaFirmaEnums.EsitoControllo.CERTIFICATO_NON_VALIDO; - break; - case TRY_LATER: - // revoche non presenti - if (versamento.getModificatoriWSCalc() - .contains(Costanti.ModificatoriWS.TAG_FIRMA_1_5)) { - esito = VerificaFirmaEnums.EsitoControllo.REVOCHE_NON_CONSISTENTI; - } else { - esito = VerificaFirmaEnums.EsitoControllo.CERTIFICATO_ERRATO; - // alternative message (che quindi non è il defalut dell'esito) - alternativeMsg = VerificaFirmaEnums.EsitoControllo.CERTIFICATO_ERRATO - .alternative()[0]; - } - break; - case REVOKED: - esito = VerificaFirmaEnums.EsitoControllo.CERTIFICATO_REVOCATO; - break; - case NO_POE: - esito = VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO; - break; - default: - esito = VerificaFirmaEnums.EsitoControllo.CERTIFICATO_ERRATO; // default - LOG.debug(LOG_FMT_SUBINDICATION, esito, contrFirmaCompType.getTiContr(), - cv.getConclusion().getSubIndication()); - break; - } - } - - // log eidas message - logEidasConclusion(xmlcertificate, xcv.getConclusion(), VFTipoControlloType.CERTIFICATO.name()); - - contrFirmaCompType.setTiEsitoContrFirma(esito.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma( - StringUtils.isBlank(alternativeMsg) ? esito.message() : alternativeMsg); - } else { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.POSITIVO.name()); - contrFirmaCompType - .setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.POSITIVO.message()); - } - } - } - } - - // CONTROLLI FIRMA - CATENA_TRUSTED CertificateAssociation && - // CertificateReliability - // Nota: su DB risultano solo per casi molto vecchi il riferimento di questo - // controllo con la relativa CRL - contrFirmaCompType = new VFContrFirmaCompType(); - firmaCompType.getContrFirmaComps().add(contrFirmaCompType); - contrFirmaCompType.setTiContr(VFTipoControlloType.CATENA_TRUSTED); - - if (!getControlliAbilitati().get(ParametroApplFl.FL_ABILITA_CONTR_TRUST_VERS).booleanValue()) { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.DISABILITATO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.DISABILITATO.message()); - } else { - if (!isFormatCompliant) { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.message()); - } else { - contrFirmaCompType.setTiEsitoContrFirma(signature.isTrustedChain() || isSignaturePassed - ? VerificaFirmaEnums.EsitoControllo.POSITIVO.name() - : VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(signature.isTrustedChain() || isSignaturePassed - ? VerificaFirmaEnums.EsitoControllo.POSITIVO.message() - : VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - } - } - - } - - private void buildFirmaCompCERwithCRL(VerificaFirmaWrapper wrapper, CertificateWrapper xmlcertificate, - VFCertifCaType certifCaType, VFFirmaCompType firmaCompType, ZonedDateTime dtRef, - Map extensions, XmlBasicBuildingBlocks bbb, VFContrFirmaCompType contrFirmaCert) - throws VerificaFirmaWrapperGenericException { - // OCSP prioritario rispetto CRL - boolean hasOcsp = xmlcertificate.getCertificateRevocationData().stream() - .anyMatch(r -> r.getRevocationType().equals(RevocationType.OCSP)); - - // CRL - RevocationWrapper crl = findRevocationByType(xmlcertificate, dtRef, RevocationType.CRL); - if (hasOcsp || crl == null) { - // - buildContrCRLNotFoundFirmaComp(firmaCompType, xmlcertificate, contrFirmaCert, hasOcsp); - return; - } - - // CRL - VFCrlType crlType = buildCrl(wrapper, extensions, crl); - - // FIRMA : CRL - firmaCompType.setCrl(crlType); - // CRL: CA - crlType.setCertifCa(certifCaType); - - // controlli CRL - buildContrCRLFirmaComp(firmaCompType, xmlcertificate, crl, bbb, contrFirmaCert, hasOcsp); - // CRL - END - } - - private void buildFirmaCompCERwithOCSP(VerificaFirmaWrapper wrapper, Reports reports, - CertificateWrapper xmlcertificate, VFFirmaCompType firmaCompType, ZonedDateTime dtRef, - Map extensions, XmlBasicBuildingBlocks bbb) - throws VerificaFirmaWrapperGenericException { - // verifica presenza CRL - boolean hasCrl = xmlcertificate.getCertificateRevocationData().stream() - .anyMatch(r -> r.getRevocationType().equals(RevocationType.CRL)); - // OCSP - CertificateRevocationWrapper ocsp = findRevocationByType(xmlcertificate, dtRef, RevocationType.OCSP); - if (ocsp == null) { - // - buildContrOCSPNotFoundFirmaComp(firmaCompType, xmlcertificate, hasCrl); - return; - } // no ocsp - - // CA - VFCertifCaType certifCaOcspType = buildOcspCertifCA(wrapper, reports, xmlcertificate, extensions, ocsp); - - // OCSP + certif - VFOcspType ocspType = buildOcspWithCertif(wrapper, certifCaOcspType, ocsp); - // FIRMA : OCSP - firmaCompType.setOcsp(ocspType); - - // controlli OCSP - buildContrOCSPFirmaComp(firmaCompType, xmlcertificate, ocsp, bbb, hasCrl); - // OCSP - END - - } - - private void buildFirmaCompCAwithCRL(VerificaFirmaWrapper wrapper, CertificateWrapper xmlcertificateCA, - VFCertifCaType certifCaType, VFFirmaCompType firmaCompType, ZonedDateTime dtRef, - Map extensions) throws VerificaFirmaWrapperGenericException { - - // OCSP prioritario rispetto CRL - boolean hasOcsp = xmlcertificateCA.getCertificateRevocationData().stream() - .anyMatch(r -> r.getRevocationType().equals(RevocationType.OCSP)); - - // CRL - RevocationWrapper crl = findRevocationByType(xmlcertificateCA, dtRef, RevocationType.CRL); - if (hasOcsp || crl == null) { - return; - } - - // CRL - VFCrlType crlType = buildCrl(wrapper, extensions, crl); - - // CRL : CA - crlType.setCertifCa(certifCaType); - // FIRMA : CRL CA - firmaCompType.setCrlCertifCa(crlType); - // CRL - END - } - - private void buildFirmaCompCAwithOCSP(VerificaFirmaWrapper wrapper, Reports reports, - CertificateWrapper xmlcertificateCA, VFFirmaCompType firmaCompType, ZonedDateTime dtRef, - Map extensions) throws VerificaFirmaWrapperGenericException { - // OCSP - RevocationWrapper ocsp = findRevocationByType(xmlcertificateCA, dtRef, RevocationType.OCSP); - if (ocsp == null) { - return; - } // no ocsp - - // CA - VFCertifCaType certifCaOcspType = buildOcspCertifCA(wrapper, reports, xmlcertificateCA, extensions, ocsp); - - // OCSP + certif - VFOcspType ocspType = buildOcspWithCertif(wrapper, certifCaOcspType, ocsp); - // FIRMA : OCSP - firmaCompType.setOcspCertifCa(ocspType); - // OCSP - END - } - - private VFCertifCaType buildOcspCertifCA(VerificaFirmaWrapper wrapper, Reports reports, - CertificateWrapper xmlcertificate, Map extensions, RevocationWrapper ocsp) - throws VerificaFirmaWrapperGenericException { - // CA - String certificateCAId = getCertificateCAId(ocsp, xmlcertificate); - // - CertificateWrapper xmlcertificateCAOCSP = reports.getDiagnosticData().getUsedCertificateById(certificateCAId); - - VFCertifCaType certifCaOcspType = new VFCertifCaType(); - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificateCAOCSP, "serialNumber", - Optional.ofNullable(xmlcertificateCAOCSP.getId())); - certifCaOcspType.setNiSerialCertifCa(new BigDecimal(xmlcertificate.getSerialNumber())); - - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificateCAOCSP, "notBefore", - Optional.ofNullable(xmlcertificate.getId())); - certifCaOcspType.setDtIniValCertifCa(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificate.getNotBefore())); - - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificateCAOCSP, "notAfter", - Optional.ofNullable(xmlcertificate.getId())); - certifCaOcspType - .setDtFinValCertifCa(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateCAOCSP.getNotAfter())); - // check subjectKeyId - if (extensions.containsKey(xmlcertificateCAOCSP.getId())) { - certifCaOcspType.setDsSubjectKeyId(extensions.get(xmlcertificateCAOCSP.getId()).getSubjectKeyIdentifier()); - } - certifCaOcspType.setDlDnIssuerCertifCa(xmlcertificateCAOCSP.getCertificateIssuerDN()); - certifCaOcspType.setDlDnSubjectCertifCa(xmlcertificateCAOCSP.getCertificateDN()); - - int urlIdx = 1; - for (String url : xmlcertificateCAOCSP.getCRLDistributionPoints()) { - VFUrlDistribCrlType urlDistribCrlType = new VFUrlDistribCrlType(); - urlDistribCrlType.setDlUrlDistribCrl(url); - urlDistribCrlType.setNiOrdUrlDistribCrl(new BigDecimal(urlIdx)); - - certifCaOcspType.getUrlDistribCrls().add(urlDistribCrlType); - // inc idx - urlIdx++; - } - // ocsp (from CA+certificate) - Iterable ocspCombinedUrls = CollectionUtils.union(xmlcertificateCAOCSP.getOCSPAccessUrls(), - xmlcertificate.getOCSPAccessUrls()); - urlIdx = 1; - for (String url : ocspCombinedUrls) { - VFUrlDistribOcspType urlDistribOcspType = new VFUrlDistribOcspType(); - urlDistribOcspType.setDlUrlDistribOcsp(url); - urlDistribOcspType.setNiOrdUrlDistribOcsp(new BigDecimal(urlIdx)); - - certifCaOcspType.getUrlDistribOcsps().add(urlDistribOcspType); - // inc idx - urlIdx++; - } - - VFFilePerFirmaType filePerFirmaType = new VFFilePerFirmaType(); - certifCaOcspType.setFilePerFirma(filePerFirmaType); - - filePerFirmaType.setBlFilePerFirma(xmlcertificate.getBinaries()); - filePerFirmaType.setTiFilePerFirma(VFTipoFileType.CERTIF_CA); - - return certifCaOcspType; - } - - // No CRL - private void buildContrCRLNotFoundFirmaComp(VFFirmaCompType firmaCompType, CertificateWrapper xmlcertificate, - VFContrFirmaCompType contrFirmaCert, boolean hasOcsp) { - buildContrCRLFirmaComp(firmaCompType, xmlcertificate, null, null, contrFirmaCert, hasOcsp); - } - - private void buildContrCRLFirmaComp(VFFirmaCompType firmaCompType, CertificateWrapper xmlcertificate, - RevocationWrapper crl, XmlBasicBuildingBlocks bbb, VFContrFirmaCompType contrFirmaCert, boolean hasOcsp) { - - /* - * caso "particolare" di building block non trovato (vedi controllo precedente con WARNING) in questi casi si - * assumono come NON PASSATI i controlli sull'oggetto perché non reperibili - */ - boolean bbbFounded = bbb != null; - // presente la CRL - boolean hasCrl = crl != null; - // presente solo la CRL - boolean onlyCrl = hasCrl && !hasOcsp; - // presente solo OCSP - boolean onlyOcsp = !onlyCrl; - // no revoche - boolean noRevocations = !hasCrl && !hasOcsp; - - VFContrFirmaCompType contrFirmaCompType = new VFContrFirmaCompType(); - firmaCompType.getContrFirmaComps().add(contrFirmaCompType); - contrFirmaCompType.setTiContr(VFTipoControlloType.CRL); - - if (!getControlliAbilitati().get(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS).booleanValue()) { - // - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.DISABILITATO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.DISABILITATO.message()); - } else { - // scenario 1 : solo crl ed errore su certificato - if (onlyCrl - && !contrFirmaCert.getTiEsitoContrFirma().equals(VerificaFirmaEnums.EsitoControllo.POSITIVO.name()) - && !contrFirmaCert.getTiEsitoContrFirma() - .equals(VerificaFirmaEnums.EsitoControllo.DISABILITATO.name()) - && !contrFirmaCert.getTiEsitoContrFirma() - .equals(VerificaFirmaEnums.EsitoControllo.REVOCHE_NON_CONSISTENTI.name())) { - // presente crl e non ocsp, errore sul controllo del certificato - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO.message()); - } else if (noRevocations) /* scenario 2 : crl e ocsp non presente */ { - // valutazione CERTIFICATO_SCADUTO_3_12_2009 - // caso 1 : 3/12/2009 <= notAfter && 3/12/2009 >= notBefore - Date revokedDate = Date - .from(LocalDate.of(2009, 12, 3).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()); - if (xmlcertificate.getNotAfter().before(revokedDate) - && xmlcertificate.getNotBefore().after(revokedDate)) { - contrFirmaCompType.setTiEsitoContrFirma( - VerificaFirmaEnums.EsitoControllo.CERTIFICATO_SCADUTO_3_12_2009.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma( - VerificaFirmaEnums.EsitoControllo.CERTIFICATO_SCADUTO_3_12_2009.message()); - } else /* caso 2 */ { - contrFirmaCompType - .setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.CRL_NON_SCARICABILE.name()); - contrFirmaCompType - .setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.CRL_NON_SCARICABILE.message()); - } - } else if (onlyOcsp) /* scenario 3 : solo ocsp */ { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO.name()); - contrFirmaCompType - .setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO.alternative()[0]); - } else /* scenario 4 : solo CRL disponibile */ { - // Nota : non trovato il build block oppure l'indicazione con il risultato di - // validazione del certifcato - if (!bbbFounded - || bbb.getXCV().getSubXCV().stream().noneMatch(c -> c.getId().equals(xmlcertificate.getId()))) { - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - } else { - // - XmlSubXCV subXvc = bbb.getXCV().getSubXCV().stream() - .filter(c -> c.getId().equals(xmlcertificate.getId())).collect(Collectors.toList()).get(0); - // - List xmlRacs = subXvc.getRAC().stream().filter(r -> r.getId().equals(crl.getId())) - .collect(Collectors.toList()); - - if (xmlRacs.isEmpty()) { - contrFirmaCompType - .setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - } else if (!xmlRacs.get(0).getConclusion().getIndication().equals(Indication.PASSED)) { - // evaluate subindication (Revocation acceptence) - VerificaFirmaEnums.EsitoControllo esito = evaluateCRLXmlRacSubIndication( - contrFirmaCompType.getTiContr().name(), xmlRacs); - - // log eidas message - logEidasConclusion(xmlcertificate, bbb.getConclusion(), VFTipoControlloType.CRL.name()); - - contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); - contrFirmaCompType.setTiEsitoContrFirma(esito.name()); - } else { - contrFirmaCompType - .setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.POSITIVO.message()); - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.POSITIVO.name()); - } - } - } - } - } - - private VerificaFirmaEnums.EsitoControllo evaluateCRLXmlRacSubIndication(String tiContr, List xmlRacs) { - VerificaFirmaEnums.EsitoControllo esito = VerificaFirmaEnums.EsitoControllo.CRL_NON_VALIDA; - SubIndication subIndication = xmlRacs.get(0).getConclusion().getSubIndication(); - if (subIndication != null) { - switch (subIndication) { - case OUT_OF_BOUNDS_NO_POE: - esito = VerificaFirmaEnums.EsitoControllo.CERTIFICATO_SCADUTO; - break; - case REVOKED: - esito = VerificaFirmaEnums.EsitoControllo.CERTIFICATO_REVOCATO; - break; - case TRY_LATER: - esito = VerificaFirmaEnums.EsitoControllo.CRL_NON_VALIDA; - break; - case NOT_YET_VALID: - esito = VerificaFirmaEnums.EsitoControllo.CRL_NON_VALIDA; - break; - case EXPIRED: - esito = VerificaFirmaEnums.EsitoControllo.CRL_SCADUTA; - break; - default: - esito = VerificaFirmaEnums.EsitoControllo.CRL_NON_VALIDA; // default - LOG.debug(LOG_FMT_SUBINDICATION, esito, tiContr, subIndication); - break; - } - } - return esito; - } - - /* - * CRL + FILE - */ - private VFCrlType buildCrl(VerificaFirmaWrapper wrapper, Map extensions, - RevocationWrapper crl) throws VerificaFirmaWrapperGenericException { - VFCrlType crlType = new VFCrlType(); - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, crl, "thisUpdate", Optional.ofNullable(crl.getId())); - crlType.setDtIniCrl(XmlDateUtility.dateToXMLGregorianCalendar(crl.getThisUpdate())); - - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, crl, "nextUpdate", Optional.ofNullable(crl.getId())); - crlType.setDtScadCrl(XmlDateUtility.dateToXMLGregorianCalendar(crl.getNextUpdate())); - - if (extensions.containsKey(crl.getId()) && extensions.get(crl.getId()).getCrlNumber() != null) { - crlType.setNiSerialCrl(new BigDecimal(extensions.get(crl.getId()).getCrlNumber())); - } - - VFFilePerFirmaType filePerFirmaType = new VFFilePerFirmaType(); - crlType.setFilePerFirma(filePerFirmaType); - - filePerFirmaType.setBlFilePerFirma(crl.getBinaries()); - filePerFirmaType.setTiFilePerFirma(VFTipoFileType.CRL); - - return crlType; - } - - /* - * OCSP REVOCATION + CERTIFICATE - */ - private VFOcspType buildOcspWithCertif(VerificaFirmaWrapper wrapper, VFCertifCaType certifCaType, - RevocationWrapper ocsp) throws VerificaFirmaWrapperGenericException { - // certificate - CertificateWrapper xmlcertificateOcspResp = ocsp.getSigningCertificate(); - - // certif - VFCertifOcspType certifOcspType = new VFCertifOcspType(); - certifOcspType.setCertifCa(certifCaType); - // Nota: certificato ocsp responder presenta un serialnumber e non un - // subjectserial number - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificateOcspResp, "serialNumber", - Optional.ofNullable(xmlcertificateOcspResp.getId())); - certifOcspType.setNiSerialCertifOcsp(new BigDecimal(xmlcertificateOcspResp.getSerialNumber())); - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificateOcspResp, "notBefore", - Optional.ofNullable(xmlcertificateOcspResp.getId())); - certifOcspType.setDtIniValCertifOcsp( - XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateOcspResp.getNotBefore())); - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificateOcspResp, "notAfter", - Optional.ofNullable(xmlcertificateOcspResp.getId())); - certifOcspType - .setDtFinValCertifOcsp(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateOcspResp.getNotAfter())); - // test - EidasWrapperResultControl.fieldCannotBeNull(wrapper, xmlcertificateOcspResp, "certificateDN", - Optional.ofNullable(xmlcertificateOcspResp.getId())); - certifOcspType.setDlDnSubject(xmlcertificateOcspResp.getCertificateDN()); - - // file - VFFilePerFirmaType filePerFirmaCertifOcspType = new VFFilePerFirmaType(); - certifOcspType.setFilePerFirma(filePerFirmaCertifOcspType); - - filePerFirmaCertifOcspType.setBlFilePerFirma(ocsp.getBinaries()); - filePerFirmaCertifOcspType.setTiFilePerFirma(VFTipoFileType.CERTIF_OCSP); - - // OCSP - VFOcspType ocspType = new VFOcspType(); - // TOFIX: da verificare (ResponderID) - // https://tools.ietf.org/html/rfc6960#section-4.2.2.3 - if (StringUtils.isNotBlank(ocsp.getSigningCertificateReference().getIssuerName())) { - ocspType.setDsCertifIssuername(ocsp.getSigningCertificateReference().getIssuerName()); - } - if (ocsp.getSigningCertificateReference().isIssuerSerialPresent()) { - ocspType.setDsCertifSerialBase64( - Base64.encodeBase64String(ocsp.getSigningCertificateReference().getIssuerSerial())); - } - if (ocsp.getSigningCertificateReference().getSki() != null) { - ocspType.setDsCertifSkiBase64(Base64.encodeBase64String(ocsp.getSigningCertificateReference().getSki())); - } - - ocspType.setCertifOcsp(certifOcspType); - // file - VFFilePerFirmaType filePerFirmaOcspType = new VFFilePerFirmaType(); - ocspType.setFilePerFirma(filePerFirmaOcspType); - - filePerFirmaOcspType.setBlFilePerFirma(ocsp.getBinaries()); - filePerFirmaOcspType.setTiFilePerFirma(VFTipoFileType.OCSP); - - return ocspType; - } - - private void buildContrOCSPNotFoundFirmaComp(VFFirmaCompType firmaCompType, CertificateWrapper xmlcertificate, - boolean hasCrl) { - buildContrOCSPFirmaComp(firmaCompType, xmlcertificate, null, null, hasCrl); - } - - private void buildContrOCSPFirmaComp(VFFirmaCompType firmaCompType, CertificateWrapper xmlcertificate, - CertificateRevocationWrapper ocsp, XmlBasicBuildingBlocks bbb, boolean hasCrl) { - - /* - * caso "particolare" di building block non trovato (vedi controllo precedente con WARNING) in questi casi si - * assumono come NON PASSATI i controlli sull'oggetto perché non reperibili - */ - boolean bbbFounded = bbb != null; - // presente OCSP - boolean hasOcsp = ocsp != null; - // no revoche - boolean noRevocations = !hasCrl && !hasOcsp; - - VFContrFirmaCompType contrFirmaCompType = new VFContrFirmaCompType(); - firmaCompType.getContrFirmaComps().add(contrFirmaCompType); - contrFirmaCompType.setTiContr(VFTipoControlloType.OCSP); - - if (!getControlliAbilitati().get(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS).booleanValue()) { - // - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.DISABILITATO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.DISABILITATO.message()); - } else { - // scenario 1 : revoche non presenti - if (noRevocations) { - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.OCSP_NON_SCARICABILE.name()); - contrFirmaCompType - .setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.OCSP_NON_SCARICABILE.message()); - } else if (hasCrl && !hasOcsp) /* scenario 2 : presente la CRL ma NON OCSP */ { - // - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO.name()); - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NON_NECESSARIO.message()); - } else /* scenario 3 : ocsp presente */ { - // Nota : non trovato il build block oppure l'indicazione con il risultato di - // validazione del certifcato - if (!bbbFounded - || bbb.getXCV().getSubXCV().stream().noneMatch(c -> c.getId().equals(xmlcertificate.getId()))) { - contrFirmaCompType.setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - } else { - // - XmlSubXCV subXvc = bbb.getXCV().getSubXCV().stream() - .filter(c -> c.getId().equals(xmlcertificate.getId())).collect(Collectors.toList()).get(0); - // - List xmlRacs = subXvc.getRAC().stream().filter(r -> r.getId().equals(ocsp.getId())) - .collect(Collectors.toList()); - - if (xmlRacs.isEmpty()) { - contrFirmaCompType - .setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - } else if (!xmlRacs.get(0).getConclusion().getIndication().equals(Indication.PASSED)) { - // evalutate subindication - VerificaFirmaEnums.EsitoControllo esito = evaluateOCSPXmlRacSubIndication(ocsp, - contrFirmaCompType.getTiContr().name(), xmlRacs); - - // log eidas message - logEidasConclusion(xmlcertificate, xmlRacs.get(0).getConclusion(), - VFTipoControlloType.OCSP.name()); - - contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); - contrFirmaCompType.setTiEsitoContrFirma(esito.name()); - } else { - contrFirmaCompType - .setDsMsgEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.OCSP_VALIDO.message()); - contrFirmaCompType.setTiEsitoContrFirma(VerificaFirmaEnums.EsitoControllo.OCSP_VALIDO.name()); - } - } - } - } - } - - private VerificaFirmaEnums.EsitoControllo evaluateOCSPXmlRacSubIndication(CertificateRevocationWrapper ocsp, - String tiContr, List xmlRacs) { - VerificaFirmaEnums.EsitoControllo esito = VerificaFirmaEnums.EsitoControllo.OCSP_SCONOSCIUTO; - // ocsp response known by server - if (ocsp.isKnown()) { - // subindication - SubIndication subIndication = xmlRacs.get(0).getConclusion().getSubIndication(); - if (subIndication != null) { - switch (subIndication) { - case TRY_LATER: - esito = VerificaFirmaEnums.EsitoControllo.OCSP_NON_AGGIORNATO; - break; - default: - esito = VerificaFirmaEnums.EsitoControllo.OCSP_SCONOSCIUTO; // default - LOG.debug(LOG_FMT_SUBINDICATION, esito, tiContr, subIndication); - break; - } - } - } - // revoked response by server - if (ocsp.isRevoked()) { - esito = VerificaFirmaEnums.EsitoControllo.OCSP_REVOCATO; - } - return esito; - } - - private boolean isBetween(Date ref, Date from, Date to) { - return !ref.after(to) && !ref.before(from); } } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/IVerificaFirmaWrapperResultStrategy.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/IVerificaFirmaWrapperResultStrategy.java index 22c9784..75ba809 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/IVerificaFirmaWrapperResultStrategy.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/IVerificaFirmaWrapperResultStrategy.java @@ -1,9 +1,28 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.firma.strategy; +import java.lang.reflect.InvocationTargetException; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -12,7 +31,6 @@ import it.eng.parer.firma.exception.VerificaFirmaWrapperResNotFoundException; import it.eng.parer.firma.xml.VFAdditionalInfoWrapperType; import it.eng.parer.firma.xml.VerificaFirmaWrapper; -import java.time.ZonedDateTime; public interface IVerificaFirmaWrapperResultStrategy { @@ -21,15 +39,17 @@ public interface IVerificaFirmaWrapperResultStrategy { String getCode(); // business logic - default VerificaFirmaWrapper fromVerificaOutOnWrapper(E esito, ZonedDateTime dtRef) throws Exception { + default VerificaFirmaWrapper fromVerificaOutOnWrapper(E esito) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { VerificaFirmaWrapper localWrapper = new VerificaFirmaWrapper(); - this.fromVerificaOutOnWrapper(esito, localWrapper, dtRef); + this.fromVerificaOutOnWrapper(esito, localWrapper); return localWrapper; } - void fromVerificaOutOnWrapper(E esito, VerificaFirmaWrapper wrapper, ZonedDateTime dtRef) throws Exception; + void fromVerificaOutOnWrapper(E esito, VerificaFirmaWrapper wrapper) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException; - default VerificaFirmaWrapper buildVFWrapper(E result, ZonedDateTime dtRef, boolean isDetached) + default VerificaFirmaWrapper buildVFWrapper(E result, boolean isDetached) throws VerificaFirmaWrapperResNotFoundException, VerificaFirmaWrapperGenericException, VerificaFirmaConnectionException { @@ -50,7 +70,7 @@ default VerificaFirmaWrapper buildVFWrapper(E result, ZonedDateTime dtRef, boole try { LOG.debug("Inizio popolamento esito da [ {} ]", getCode()); // populate with output firma - fromVerificaOutOnWrapper(result, wrapper, dtRef); + fromVerificaOutOnWrapper(result, wrapper); LOG.debug("Termine popolamento esito da [{}]", getCode()); } catch (Exception ex) { throw new VerificaFirmaWrapperGenericException(ex, wrapper); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/EidasBaseWrapperResult.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/EidasBaseWrapperResult.java new file mode 100644 index 0000000..495a899 --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/EidasBaseWrapperResult.java @@ -0,0 +1,432 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.firma.strategy.eidas; + +import static it.eng.parer.util.DateUtilsConverter.convert; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.text.MessageFormat; +import java.time.ZonedDateTime; +import java.util.List; +import java.util.Locale; +import java.util.Optional; +import java.util.stream.Collectors; + +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ClassUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion; +import eu.europa.esig.dss.detailedreport.jaxb.XmlConstraintsConclusion; +import eu.europa.esig.dss.detailedreport.jaxb.XmlMessage; +import eu.europa.esig.dss.detailedreport.jaxb.XmlRAC; +import eu.europa.esig.dss.diagnostic.AbstractTokenProxy; +import eu.europa.esig.dss.diagnostic.CertificateRevocationWrapper; +import eu.europa.esig.dss.diagnostic.CertificateWrapper; +import eu.europa.esig.dss.diagnostic.RevocationWrapper; +import eu.europa.esig.dss.enumerations.CertificateSourceType; +import eu.europa.esig.dss.enumerations.RevocationType; +import eu.europa.esig.dss.enumerations.SubIndication; +import eu.europa.esig.dss.enumerations.UriBasedEnum; +import eu.europa.esig.dss.validation.reports.Reports; +import it.eng.parer.eidas.model.EidasWSReportsDTOTree; +import it.eng.parer.firma.util.VerificaFirmaEnums.SacerIndication; +import it.eng.parer.firma.xml.VFCertifCaType; +import it.eng.parer.firma.xml.VFCertifOcspType; +import it.eng.parer.firma.xml.VFCrlType; +import it.eng.parer.firma.xml.VFOcspType; +import it.eng.parer.firma.xml.VFUrlDistribCrlType; +import it.eng.parer.firma.xml.VFUrlDistribOcspType; +import it.eng.parer.ws.utils.XmlDateUtility; + +public abstract class EidasBaseWrapperResult { + + private static final Logger LOG = LoggerFactory.getLogger(EidasBaseWrapperResult.class); + protected static final String LOG_FMT_SUBINDICATION = "Eidas esito = {} controllo tipo = {} subindication = {}"; + private static final String MESSAGE_ESITO_CONTR_WITH_ERRORS = "{0} [{1}]"; + private static final String MESSAGE_ESITO_CONTR_WITH_DETAILS = MESSAGE_ESITO_CONTR_WITH_ERRORS + " : {2}"; + protected static final String MESSAGE_NO_INDICATION = "no indication uri"; + protected static final String MESSAGE_ERROR_SEPARATOR = ";"; + + protected DateFormat dateFormatter = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, Locale.ITALY); + + protected static final int PG_BUSTA = 0; + protected static final int PG_FIRMA = 1; + protected static final int PG_MARCA = 2; + + protected String getCertificateCAId(AbstractTokenProxy sigts, CertificateWrapper xmlcertificate) { + // se trusted o selfsigned è la CA + if (xmlcertificate.isTrusted() || xmlcertificate.isSelfSigned()) { + return xmlcertificate.getId(); + } + // se non è la CA la individua dalla chain + // nota : non esiste più di una CA nella catena + if (sigts.isTrustedChain()) { + return sigts.getCertificateChain().stream() + .filter(c -> c.getSources().contains(CertificateSourceType.TRUSTED_STORE) + || c.getSources().contains(CertificateSourceType.TRUSTED_LIST)) + .collect(Collectors.toList()).get(0).getId(); + } + // verifica se esite in chain un certificato selfsigned + if (sigts.getCertificateChain().stream().anyMatch(CertificateWrapper::isSelfSigned)) { + return sigts.getCertificateChain().stream().filter(CertificateWrapper::isSelfSigned) + .collect(Collectors.toList()).get(0).getId(); + } + + // ultimo scenario : restituisce l'id dell'ultimo elemento della catena + return sigts.getCertificateChain().get(sigts.getCertificateChain().size() - 1).getId(); + } + + protected CertificateRevocationWrapper findRevocationByType(CertificateWrapper certificate, ZonedDateTime dtRef, + RevocationType type) { + // + CertificateRevocationWrapper revocation = null; + // no revocation + if (certificate.getCertificateRevocationData().stream().noneMatch(r -> r.getRevocationType().equals(type))) { + // null + return revocation; + } + + // extract revocations by source type + List revocationFilteredBySource = certificate.getCertificateRevocationData() + .stream().filter(r -> r.getRevocationType().equals(type)).collect(Collectors.toList()); + + // get only one + if (revocationFilteredBySource.size() == 1) { + revocation = revocationFilteredBySource.get(0); + } else { + // + List revocationFilteredByOriginDate = null; + + // filter by RevocationOrigin (EXTERNAL / CACHED) + // verify + // https://github.com/esig/dss/blob/5.8/dss-enumerations/src/main/java/eu/europa/esig/dss/enumerations/RevocationOrigin.java + if (revocationFilteredBySource.stream().filter(c -> !c.getOrigin().isInternalOrigin()).count() != 0) { + revocationFilteredByOriginDate = revocationFilteredBySource.stream() + .filter(c -> !c.getOrigin().isInternalOrigin()).collect(Collectors.toList()); + } else if (revocationFilteredBySource.stream().filter(c -> c.getOrigin().isInternalOrigin()).count() != 0) { + // filter by RevocationOrigin (embedded) + revocationFilteredByOriginDate = revocationFilteredBySource.stream() + .filter(c -> c.getOrigin().isInternalOrigin()).collect(Collectors.toList()); + } else { + // filter by date + revocationFilteredByOriginDate = revocationFilteredBySource.stream().filter( + c -> c.getThisUpdate().after(convert(dtRef)) && c.getNextUpdate().before(convert(dtRef))) + .collect(Collectors.toList()); + } + + // error + if (revocationFilteredByOriginDate.isEmpty() && LOG.isErrorEnabled()) { + LOG.error("{} certificate id {} not found", type.name(), certificate.getId()); + // null + return revocation; + } + + // warn + if (revocationFilteredByOriginDate.size() > 1 && LOG.isWarnEnabled()) { + LOG.warn("{} certificate id {} more than one (get first of list)", type.name(), certificate.getId()); + } + // get first + revocation = revocationFilteredByOriginDate.get(0); + } + // + return revocation; + } + + /* + * OCSP REVOCATION + CERTIFICATE + */ + + /* + * Accedendo fino all'ultimo elemento a partire da sinistra percorrendo i successivi livelli + * + */ + protected String getMimeTypeUnsigned(EidasWSReportsDTOTree parent, List child) { + // condizioni di uscita + // ultimo elemento unsigned non trovato + if (child == null || child.isEmpty()) { + return parent.getMimeType(); + } + // left child + EidasWSReportsDTOTree leftChild = child.get(0); + // mime found + if (leftChild.isUnsigned()) { + return leftChild.getMimeType(); + } else { + return getMimeTypeUnsigned(leftChild, leftChild.getChildren()); + } + + } + + protected void logEidasConclusion(CertificateWrapper certificate, XmlConclusion conclusion) { + logEidasConclusion(certificate, conclusion, null); + } + + protected void logEidasConclusion(CertificateWrapper certificate, XmlConstraintsConclusion contraints, + String tipo) { + logEidasConclusion(certificate, contraints.getConclusion(), tipo); + } + + protected void logEidasConclusion(CertificateWrapper certificate, XmlConclusion conclusion, String tipo) { + StringBuilder msg = new StringBuilder(); + if (conclusion.getWarnings().stream().count() != 0) { + msg.append(conclusion.getWarnings().stream().map(XmlMessage::getValue).collect(Collectors.joining(";"))); + } + if (conclusion.getErrors().stream().count() != 0) { + msg.append(conclusion.getErrors().stream().map(XmlMessage::getValue).collect(Collectors.joining(";"))); + } + LOG.debug("EIDAS FIRMA CONCLUSION ID = {} {}, msg {}", + certificate != null ? certificate.getId() : "ID_FIRMA_NOT_FOUND", + tipo == null ? "" : " tipo controllo " + tipo, msg); + } + + protected static class EidasWrapperResultControl { + + private EidasWrapperResultControl() { + throw new IllegalStateException("Utility class"); + } + + public static void fieldCannotBeNull(Object obj, String fieldName, Optional param) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, + InvocationTargetException { + Method getField = findMethod(obj, fieldName); + if (getField.invoke(obj) == null) { + final String msg = "[" + obj.getClass().getName() + "] il campo " + fieldName + + " richiesto alla compilazione è NULL." + + (param.isPresent() ? " EIDAS signature id = " + param.get() : ""); + throw new NullPointerException(msg); + } + } + + private static Method findMethod(Object obj, String fieldName) throws NoSuchMethodException { + Method getField; + try { + getField = ClassUtils.getPublicMethod(obj.getClass(), "get" + StringUtils.capitalize(fieldName)); + } catch (NoSuchMethodException e) { + getField = obj.getClass().getSuperclass().getDeclaredMethod("get" + StringUtils.capitalize(fieldName)); + } + return getField; + } + } + + protected SacerIndication evaluateOCSPXmlRacSubIndication(CertificateRevocationWrapper ocsp, String tiContr, + List xmlRacs) { + SacerIndication esito = SacerIndication.OCSP_SCONOSCIUTO; + // ocsp response known by server + if (ocsp.isKnown()) { + // subindication + SubIndication subIndication = xmlRacs.get(0).getConclusion().getSubIndication(); + if (subIndication != null) { + switch (subIndication) { + case TRY_LATER: + esito = SacerIndication.OCSP_NON_AGGIORNATO; + break; + default: + esito = SacerIndication.OCSP_SCONOSCIUTO; // default + LOG.debug(LOG_FMT_SUBINDICATION, esito, tiContr, subIndication); + break; + } + } + } + // revoked response by server + if (ocsp.isRevoked()) { + esito = SacerIndication.OCSP_REVOCATO; + } + return esito; + } + + protected SacerIndication evaluateCRLXmlRacSubIndication(String tiContr, List xmlRacs) { + SacerIndication esito = SacerIndication.CRL_NON_VALIDA; + SubIndication subIndication = xmlRacs.get(0).getConclusion().getSubIndication(); + if (subIndication != null) { + switch (subIndication) { + case OUT_OF_BOUNDS_NO_POE: + esito = SacerIndication.CERTIFICATO_SCADUTO; + break; + case REVOKED: + esito = SacerIndication.CERTIFICATO_REVOCATO; + break; + case TRY_LATER: + case NOT_YET_VALID: + esito = SacerIndication.CRL_NON_VALIDA; + break; + case EXPIRED: + esito = SacerIndication.CRL_SCADUTA; + break; + default: + esito = SacerIndication.CRL_NON_VALIDA; // default + LOG.debug(LOG_FMT_SUBINDICATION, esito, tiContr, subIndication); + break; + } + } + return esito; + } + + protected VFCertifCaType buildOcspCertifCA(Reports reports, CertificateWrapper xmlcertificate, + RevocationWrapper ocsp) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + // CA + String certificateCAId = getCertificateCAId(ocsp, xmlcertificate); + // + CertificateWrapper xmlcertificateCAOCSP = reports.getDiagnosticData().getUsedCertificateById(certificateCAId); + + VFCertifCaType certifCaOcspType = new VFCertifCaType(); + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificateCAOCSP, "serialNumber", + Optional.ofNullable(xmlcertificateCAOCSP.getId())); + certifCaOcspType.setNiSerialCertifCa(new BigDecimal(xmlcertificate.getSerialNumber())); + + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificateCAOCSP, "notBefore", + Optional.ofNullable(xmlcertificate.getId())); + certifCaOcspType.setDtIniValCertifCa(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificate.getNotBefore())); + + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificateCAOCSP, "notAfter", + Optional.ofNullable(xmlcertificate.getId())); + certifCaOcspType + .setDtFinValCertifCa(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateCAOCSP.getNotAfter())); + // Note: report EIDAS doens't cover it ! ( SubjectKeyId non presente su rerport) + // certifCaOcspType.setDsSubjectKeyId(); + certifCaOcspType.setDlDnIssuerCertifCa(xmlcertificateCAOCSP.getCertificateIssuerDN()); + certifCaOcspType.setDlDnSubjectCertifCa(xmlcertificateCAOCSP.getCertificateDN()); + + int urlIdx = 1; + // check NON empty URL + List crlFiltered = xmlcertificateCAOCSP.getCRLDistributionPoints().stream() + .filter(StringUtils::isNotBlank).collect(Collectors.toList()); + for (String url : crlFiltered) { + VFUrlDistribCrlType urlDistribCrlType = new VFUrlDistribCrlType(); + urlDistribCrlType.setDlUrlDistribCrl(url); + urlDistribCrlType.setNiOrdUrlDistribCrl(new BigDecimal(urlIdx)); + + certifCaOcspType.getUrlDistribCrls().add(urlDistribCrlType); + // inc idx + urlIdx++; + } + // ocsp (from CA+certificate) + // check NON empty URL + Iterable ocspCombinedUrls = CollectionUtils + .union(xmlcertificateCAOCSP.getOCSPAccessUrls(), xmlcertificate.getOCSPAccessUrls()).stream() + .filter(StringUtils::isNotBlank).collect(Collectors.toList()); + urlIdx = 1; + for (String url : ocspCombinedUrls) { + VFUrlDistribOcspType urlDistribOcspType = new VFUrlDistribOcspType(); + urlDistribOcspType.setDlUrlDistribOcsp(url); + urlDistribOcspType.setNiOrdUrlDistribOcsp(new BigDecimal(urlIdx)); + + certifCaOcspType.getUrlDistribOcsps().add(urlDistribOcspType); + // inc idx + urlIdx++; + } + + return certifCaOcspType; + } + + /* + * OCSP REVOCATION + CERTIFICATE + */ + protected VFOcspType buildOcspWithCertif(VFCertifCaType certifCaType, RevocationWrapper ocsp) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + // certificate + CertificateWrapper xmlcertificateOcspResp = ocsp.getSigningCertificate(); + + // certif + VFCertifOcspType certifOcspType = new VFCertifOcspType(); + certifOcspType.setCertifCa(certifCaType); + // Nota: certificato ocsp responder presenta un serialnumber e non un + // subjectserial number + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificateOcspResp, "serialNumber", + Optional.ofNullable(xmlcertificateOcspResp.getId())); + certifOcspType.setNiSerialCertifOcsp(new BigDecimal(xmlcertificateOcspResp.getSerialNumber())); + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificateOcspResp, "notBefore", + Optional.ofNullable(xmlcertificateOcspResp.getId())); + certifOcspType.setDtIniValCertifOcsp( + XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateOcspResp.getNotBefore())); + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificateOcspResp, "notAfter", + Optional.ofNullable(xmlcertificateOcspResp.getId())); + certifOcspType + .setDtFinValCertifOcsp(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateOcspResp.getNotAfter())); + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificateOcspResp, "certificateDN", + Optional.ofNullable(xmlcertificateOcspResp.getId())); + certifOcspType.setDlDnSubject(xmlcertificateOcspResp.getCertificateDN()); + + // OCSP + VFOcspType ocspType = new VFOcspType(); + // TOFIX: da verificare (ResponderID) + // https://tools.ietf.org/html/rfc6960#section-4.2.2.3 + if (StringUtils.isNotBlank(ocsp.getSigningCertificateReference().getIssuerName())) { + ocspType.setDsCertifIssuername(ocsp.getSigningCertificateReference().getIssuerName()); + } + if (ocsp.getSigningCertificateReference().isIssuerSerialPresent()) { + ocspType.setDsCertifSerialBase64( + Base64.encodeBase64String(ocsp.getSigningCertificateReference().getIssuerSerial())); + } + if (ocsp.getSigningCertificateReference().getSki() != null) { + ocspType.setDsCertifSkiBase64(Base64.encodeBase64String(ocsp.getSigningCertificateReference().getSki())); + } + + ocspType.setCertifOcsp(certifOcspType); + + return ocspType; + } + + /* + * CRL + FILE + */ + protected VFCrlType buildCrl(RevocationWrapper crl) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + VFCrlType crlType = new VFCrlType(); + // test + EidasWrapperResultControl.fieldCannotBeNull(crl, "thisUpdate", Optional.ofNullable(crl.getId())); + crlType.setDtIniCrl(XmlDateUtility.dateToXMLGregorianCalendar(crl.getThisUpdate())); + + // test + EidasWrapperResultControl.fieldCannotBeNull(crl, "nextUpdate", Optional.ofNullable(crl.getId())); + crlType.setDtScadCrl(XmlDateUtility.dateToXMLGregorianCalendar(crl.getNextUpdate())); + // Note: report EIDAS doens't cover it ! ( SubjectKeyId non presente su rerport) + // crlType.setNiSerialCrl(); + + return crlType; + } + + /* + * formatter message esito + */ + protected String generateErrorContrMsgEsito(String localmsg, UriBasedEnum indication, Optional details) { + if (details.isPresent()) { + return MessageFormat.format(MESSAGE_ESITO_CONTR_WITH_DETAILS, localmsg, + indication != null ? indication.getUri() : MESSAGE_NO_INDICATION, details.get()); + } else { + return MessageFormat.format(MESSAGE_ESITO_CONTR_WITH_ERRORS, localmsg, + indication != null ? indication.getUri() : MESSAGE_NO_INDICATION); + + } + } + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/EidasFirmaBuilder.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/EidasFirmaBuilder.java new file mode 100644 index 0000000..d618674 --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/EidasFirmaBuilder.java @@ -0,0 +1,873 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.firma.strategy.eidas; + +import java.lang.reflect.InvocationTargetException; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import eu.europa.esig.dss.detailedreport.jaxb.XmlBasicBuildingBlocks; +import eu.europa.esig.dss.detailedreport.jaxb.XmlCV; +import eu.europa.esig.dss.detailedreport.jaxb.XmlConstraint; +import eu.europa.esig.dss.detailedreport.jaxb.XmlConstraintsConclusion; +import eu.europa.esig.dss.detailedreport.jaxb.XmlISC; +import eu.europa.esig.dss.detailedreport.jaxb.XmlRAC; +import eu.europa.esig.dss.detailedreport.jaxb.XmlSAV; +import eu.europa.esig.dss.detailedreport.jaxb.XmlStatus; +import eu.europa.esig.dss.detailedreport.jaxb.XmlSubXCV; +import eu.europa.esig.dss.detailedreport.jaxb.XmlXCV; +import eu.europa.esig.dss.diagnostic.CertificateRevocationWrapper; +import eu.europa.esig.dss.diagnostic.CertificateWrapper; +import eu.europa.esig.dss.diagnostic.RevocationWrapper; +import eu.europa.esig.dss.diagnostic.SignatureWrapper; +import eu.europa.esig.dss.diagnostic.TimestampWrapper; +import eu.europa.esig.dss.enumerations.Indication; +import eu.europa.esig.dss.enumerations.RevocationType; +import eu.europa.esig.dss.enumerations.SubIndication; +import eu.europa.esig.dss.validation.reports.Reports; +import it.eng.parer.eidas.model.EidasWSReportsDTOTree; +import it.eng.parer.firma.util.VerificaFirmaEnums; +import it.eng.parer.firma.util.VerificaFirmaEnums.SacerIndication; +import it.eng.parer.firma.xml.VFAdditionalInfoFirmaCompType; +import it.eng.parer.firma.xml.VFCertifCaType; +import it.eng.parer.firma.xml.VFCertifFirmatarioType; +import it.eng.parer.firma.xml.VFContrFirmaCompType; +import it.eng.parer.firma.xml.VFCrlType; +import it.eng.parer.firma.xml.VFFirmaCompType; +import it.eng.parer.firma.xml.VFOcspType; +import it.eng.parer.firma.xml.VFTipoControlloType; +import it.eng.parer.firma.xml.VFTipoFirmaType; +import it.eng.parer.firma.xml.VFUrlDistribCrlType; +import it.eng.parer.firma.xml.VFUrlDistribOcspType; +import it.eng.parer.firma.xml.VerificaFirmaWrapper; +import it.eng.parer.ws.utils.Costanti; +import it.eng.parer.ws.utils.ParametroApplDB.ParametroApplFl; +import it.eng.parer.ws.utils.XmlDateUtility; + +public class EidasFirmaBuilder extends EidasBaseWrapperResult implements IEidasBuilderVFObj { + + private static final Logger LOG = LoggerFactory.getLogger(EidasFirmaBuilder.class); + + private Map controlliAbilitati; + private boolean isDataDiRiferimentoOnCompVers; + private Set modificatoriWSCalc; + + public EidasFirmaBuilder(Map controlliAbilitati, boolean isDataDiRiferimentoOnCompVers, + Set modificatoriWSCalc) { + super(); + this.controlliAbilitati = controlliAbilitati; + this.isDataDiRiferimentoOnCompVers = isDataDiRiferimentoOnCompVers; + this.modificatoriWSCalc = modificatoriWSCalc; + } + + @Override + public VFFirmaCompType build(EidasWSReportsDTOTree eidasReportsDto, VerificaFirmaWrapper vfWrapper, + SignatureWrapper signatureW, Optional timestampW, ZonedDateTime dataDiRiferimento, + BigDecimal[] pgs) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + + // reports by dss + Reports reports = new Reports(eidasReportsDto.getReport().getDiagnosticData(), + eidasReportsDto.getReport().getDetailedReport(), eidasReportsDto.getReport().getSimpleReport(), + null /* validation report non gestito */); + + // FIRMA + VFFirmaCompType firmaCompType = new VFFirmaCompType(); + // set setPgFirma + firmaCompType.setPgFirma(pgs[PG_FIRMA]); + // set id (id componente PARER) + firmaCompType.setId(eidasReportsDto.getIdComponente()); + + // add info (empty) + VFAdditionalInfoFirmaCompType additionalInfoFirmaCompType = new VFAdditionalInfoFirmaCompType(); + firmaCompType.setAdditionalInfo(additionalInfoFirmaCompType); + + // test + EidasWrapperResultControl.fieldCannotBeNull(signatureW, "signingCertificate", Optional.empty()); + // SIGNATURE CERTIFICATE + // certificate + CertificateWrapper xmlcertificate = reports.getDiagnosticData() + .getUsedCertificateById(signatureW.getSigningCertificate().getId()); + + // FIRMATARIO + BLOB + VFCertifFirmatarioType certifFirmatarioType = new VFCertifFirmatarioType(); + firmaCompType.setCertifFirmatario(certifFirmatarioType); + + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificate, "serialNumber", + Optional.ofNullable(xmlcertificate.getId())); + certifFirmatarioType.setNiSerialCertifFirmatario(new BigDecimal(xmlcertificate.getSerialNumber())); + + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificate, "notBefore", + Optional.ofNullable(xmlcertificate.getId())); + certifFirmatarioType + .setDtIniValCertifFirmatario(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificate.getNotBefore())); + + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificate, "notAfter", + Optional.ofNullable(xmlcertificate.getId())); + certifFirmatarioType + .setDtFinValCertifFirmatario(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificate.getNotAfter())); + + // CA + String certificateCAId = getCertificateCAId(signatureW, xmlcertificate); + // + CertificateWrapper xmlcertificateCA = reports.getDiagnosticData().getUsedCertificateById(certificateCAId); + + VFCertifCaType certifCaType = new VFCertifCaType(); + certifFirmatarioType.setCertifCaFirmatario(certifCaType); + + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificateCA, "serialNumber", + Optional.ofNullable(xmlcertificateCA.getId())); + certifCaType.setNiSerialCertifCa(new BigDecimal(xmlcertificateCA.getSerialNumber())); + + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificateCA, "notBefore", + Optional.ofNullable(xmlcertificateCA.getId())); + certifCaType.setDtIniValCertifCa(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateCA.getNotBefore())); + + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificateCA, "notAfter", + Optional.ofNullable(xmlcertificateCA.getId())); + certifCaType.setDtFinValCertifCa(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateCA.getNotAfter())); + // Note: report EIDAS doens't cover it ! ( SubjectKeyId non presente su rerport) + // certifCaType.setDsSubjectKeyId(); + certifCaType.setDlDnIssuerCertifCa(xmlcertificateCA.getCertificateIssuerDN()); + certifCaType.setDlDnSubjectCertifCa(xmlcertificateCA.getCertificateDN()); + + int urlIdx = 1; + // check NON empty URL + List crlFiltered = xmlcertificateCA.getCRLDistributionPoints().stream().filter(StringUtils::isNotBlank) + .collect(Collectors.toList()); + for (String url : crlFiltered) { + VFUrlDistribCrlType urlDistribCrlType = new VFUrlDistribCrlType(); + urlDistribCrlType.setDlUrlDistribCrl(url); + urlDistribCrlType.setNiOrdUrlDistribCrl(new BigDecimal(urlIdx)); + + certifCaType.getUrlDistribCrls().add(urlDistribCrlType); + // inc idx + urlIdx++; + } + // ocsp (from CA+certificate) + Iterable ocspCombinedUrls = CollectionUtils + .union(xmlcertificateCA.getOCSPAccessUrls(), xmlcertificate.getOCSPAccessUrls()).stream() + .filter(StringUtils::isNotBlank).collect(Collectors.toList()); + urlIdx = 1; + for (String url : ocspCombinedUrls) { + VFUrlDistribOcspType urlDistribOcspType = new VFUrlDistribOcspType(); + urlDistribOcspType.setDlUrlDistribOcsp(url); + urlDistribOcspType.setNiOrdUrlDistribOcsp(new BigDecimal(urlIdx)); + + certifCaType.getUrlDistribOcsps().add(urlDistribOcspType); + // inc idx + urlIdx++; + } + + // FIRMA : CA + firmaCompType.setCertifCa(certifCaType); + // nullable element + String dsAlgoFirma = null; + if (signatureW.getDigestAlgorithm() != null && signatureW.getEncryptionAlgorithm() != null) { + dsAlgoFirma = signatureW.getDigestAlgorithm().getName().concat("with") + .concat(signatureW.getEncryptionAlgorithm().getName()); + } + firmaCompType.setDsAlgoFirma(dsAlgoFirma); + firmaCompType.setDlDnFirmatario(xmlcertificate.getCertificateDN()); + firmaCompType.setDsFirmaBase64(Base64.encodeBase64String(signatureW.getSignatureValue())); + + String cdFirmatario = null; + if (StringUtils.isNotBlank(xmlcertificate.getSubjectSerialNumber())) { + cdFirmatario = xmlcertificate.getSubjectSerialNumber(); + } else { + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificate, "serialNumber", + Optional.ofNullable(xmlcertificate.getId())); + cdFirmatario = xmlcertificate.getSerialNumber(); + } + firmaCompType.setCdFirmatario(cdFirmatario); + firmaCompType.setDtFirma(XmlDateUtility.dateToXMLGregorianCalendar(signatureW.getClaimedSigningTime())); + + // + if (!signatureW.getTimestampList().isEmpty()) { + firmaCompType + .setTmRifTempUsato(XmlDateUtility.dateToXMLGregorianCalendar(signatureW.getClaimedSigningTime())); + firmaCompType.setTipoRiferimentoTemporaleUsato(VerificaFirmaEnums.TipoRifTemporale.MT_VERS_NORMA.name()); + } else { + firmaCompType.setTmRifTempUsato(XmlDateUtility.dateToXMLGregorianCalendar(dataDiRiferimento)); + firmaCompType.setTipoRiferimentoTemporaleUsato( + isDataDiRiferimentoOnCompVers ? VerificaFirmaEnums.TipoRifTemporale.RIF_TEMP_VERS.name() + : VerificaFirmaEnums.TipoRifTemporale.DATA_VERS.name()); + } + + // + firmaCompType.setTiFormatoFirma(signatureW.getSignatureFormat().toString()); + // + firmaCompType.setNmCognomeFirmatario(xmlcertificate.getSurname()); + firmaCompType.setNmFirmatario(xmlcertificate.getGivenName()); + // + firmaCompType.setTiFirma(VFTipoFirmaType.DIGITALE); + + // basic building block + XmlBasicBuildingBlocks bbb = reports.getDetailedReport().getBasicBuildingBlockById(signatureW.getId()); + if (bbb == null) { + // TOFIX: cosa fare in questi casi ?! + LOG.warn("BasicBuildingBlockById not found SIGNATURE ID = {}", signatureW.getId()); + } + // basic building block counter signature parent + XmlBasicBuildingBlocks bbbParent = null; + if (signatureW.isCounterSignature()) { + bbbParent = reports.getDetailedReport().getBasicBuildingBlockById(signatureW.getParent().getId()); + if (bbbParent == null) { + // TOFIX: cosa fare in questi casi ?! + LOG.warn("Parent BasicBuildingBlockById not found SIGNATURE ID = {}", signatureW.getParent().getId()); + } + } + // CONTROLLI FIRMA + // global result + boolean isSignaturePassed = reports.getSimpleReport().isValid(signatureW.getId()); + buildContrFirmaComp(firmaCompType, isSignaturePassed, signatureW, xmlcertificate, bbb, bbbParent); + + // OCSP CA + buildFirmaCompCAwithOCSP(reports, xmlcertificateCA, firmaCompType, dataDiRiferimento); + // OCSP + CONTR + buildFirmaCompCERwithOCSP(reports, xmlcertificate, firmaCompType, dataDiRiferimento, bbb); + + // CRL CA + buildFirmaCompCAwithCRL(xmlcertificateCA, certifCaType, firmaCompType, dataDiRiferimento); + // CRL + CONTR + buildFirmaCompCERwithCRL(xmlcertificate, certifCaType, firmaCompType, dataDiRiferimento, bbb); + + return firmaCompType; + } + + private void buildContrFirmaComp(VFFirmaCompType firmaCompType, boolean isSignaturePassed, + SignatureWrapper signature, CertificateWrapper xmlcertificate, XmlBasicBuildingBlocks bbb, + XmlBasicBuildingBlocks bbbParent) { + + // format checking + boolean isFormatCompliant = false; + XmlConstraintsConclusion formatCompliantConstraint = null; + if (bbbParent != null) { + formatCompliantConstraint = bbbParent.getFC(); + // counter signature : non ha il controllo di formato (lo eredita dal padre) + isFormatCompliant = formatCompliantConstraint != null + && formatCompliantConstraint.getConclusion().getIndication().equals(Indication.PASSED); + } else { + formatCompliantConstraint = bbb.getFC(); + isFormatCompliant = bbb != null && formatCompliantConstraint != null + && formatCompliantConstraint.getConclusion().getIndication().equals(Indication.PASSED); + } + SacerIndication esitoContrConforme = isFormatCompliant ? SacerIndication.POSITIVO + : SacerIndication.FORMATO_NON_CONFORME; + + firmaCompType.setTiEsitoContrConforme(esitoContrConforme.name()); + // + firmaCompType.setDsMsgEsitoContrConforme(esitoContrConforme.equals(SacerIndication.POSITIVO) + ? esitoContrConforme.message() : generateErrorContrMsgEsito(esitoContrConforme.message(), + formatCompliantConstraint.getConclusion().getIndication(), Optional.empty())); + // + SacerIndication esitoVerifFirma = isSignaturePassed ? SacerIndication.POSITIVO : SacerIndication.NEGATIVO; + // verifica risultato "globale" di verifica firma + firmaCompType.setTiEsitoVerifFirma(esitoVerifFirma.name()); + // + firmaCompType.setDsMsgEsitoVerifFirma(esitoVerifFirma.message()); + + // caso "particolare" di building block non trovato (vedi controllo + // precedente con WARNING) + // in questi casi si assumono come NON PASSATI i controlli sull'oggetto perché + // non reperibili + boolean bbbFounded = bbb != null; + + // CONTROLLI FIRMA - CRITTOGRAFICO signatureValidations + // CertificateReliability + VFContrFirmaCompType contrFirmaCompType = new VFContrFirmaCompType(); + firmaCompType.getContrFirmaComps().add(contrFirmaCompType); + contrFirmaCompType.setTiContr(VFTipoControlloType.CRITTOGRAFICO); + + // valiazione crittografica + XmlCV cv = bbbFounded ? bbb.getCV() : null; + if (!controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_CRITTOG_VERS).booleanValue()) { + SacerIndication esito = SacerIndication.DISABILITATO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else { + if (!bbbFounded) { + SacerIndication esito = SacerIndication.NEGATIVO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else { + if (!cv.getConclusion().getIndication().equals(Indication.PASSED) && !isSignaturePassed) { + // init + SacerIndication esito = SacerIndication.NEGATIVO; // getSubIndication + SubIndication subIndication = cv.getConclusion().getSubIndication(); + if (subIndication != null) { + switch (subIndication) { + case FORMAT_FAILURE: + esito = SacerIndication.NON_ESEGUITO; + break; + case NO_POE: + esito = SacerIndication.NON_NECESSARIO; + break; + case SIG_CRYPTO_FAILURE: + case HASH_FAILURE: + esito = SacerIndication.NEGATIVO; + break; + default: + esito = SacerIndication.NEGATIVO; // default + LOG.debug(LOG_FMT_SUBINDICATION, esito, contrFirmaCompType.getTiContr(), subIndication); + break; + } + } + // log eidas message + logEidasConclusion(xmlcertificate, cv, VFTipoControlloType.CRITTOGRAFICO.name()); + + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma( + generateErrorContrMsgEsito(esito.message(), subIndication, Optional.empty())); + } else { + contrFirmaCompType.setTiEsitoContrFirma(SacerIndication.POSITIVO.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(SacerIndication.POSITIVO.message()); + } + } + } + + // TOFIX: al momento è lo stesso risultato raccolto sopra + // CONTROLLI FIRMA - CRITTOGRAFICO_ABILITATO signatureValidations + contrFirmaCompType = new VFContrFirmaCompType(); + firmaCompType.getContrFirmaComps().add(contrFirmaCompType); + contrFirmaCompType.setTiContr(VFTipoControlloType.CRITTOGRAFICO_ABILITATO); + + if (!bbbFounded) { + SacerIndication esito = SacerIndication.NEGATIVO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else { + if (!cv.getConclusion().getIndication().equals(Indication.PASSED) && !isSignaturePassed) { + // init + SacerIndication esito = SacerIndication.NEGATIVO; // getSubIndication + SubIndication subIndication = cv.getConclusion().getSubIndication(); + // + if (subIndication != null) { + switch (subIndication) { + case FORMAT_FAILURE: + esito = SacerIndication.NON_ESEGUITO; + break; + case NO_POE: + esito = SacerIndication.NON_NECESSARIO; + break; + case SIG_CRYPTO_FAILURE: + case HASH_FAILURE: + esito = SacerIndication.NEGATIVO; + break; + default: + esito = SacerIndication.NEGATIVO; // default + LOG.debug(LOG_FMT_SUBINDICATION, esito, contrFirmaCompType.getTiContr(), subIndication); + break; + } + } + // log eidas message + logEidasConclusion(xmlcertificate, cv, VFTipoControlloType.CRITTOGRAFICO_ABILITATO.name()); + + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma( + generateErrorContrMsgEsito(esito.message(), subIndication, Optional.empty())); + } else { + contrFirmaCompType.setTiEsitoContrFirma(SacerIndication.POSITIVO.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(SacerIndication.POSITIVO.message()); + } + } + + // CONTROLLI FIRMA - CATENA_TRUSTED_ABILITATO CertificateAssociation && + // CertificateReliability + contrFirmaCompType = new VFContrFirmaCompType(); + firmaCompType.getContrFirmaComps().add(contrFirmaCompType); + contrFirmaCompType.setTiContr(VFTipoControlloType.CATENA_TRUSTED_ABILITATO); + + if (!controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_TRUST_VERS).booleanValue()) { + SacerIndication esito = SacerIndication.DISABILITATO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else { + // + SacerIndication esito = signature.isTrustedChain() || isSignaturePassed ? SacerIndication.POSITIVO + : SacerIndication.NEGATIVO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } + + // CONTROLLI FIRMA - CERTIFICATO CertificateExpiration + contrFirmaCompType = new VFContrFirmaCompType(); + firmaCompType.getContrFirmaComps().add(contrFirmaCompType); + contrFirmaCompType.setTiContr(VFTipoControlloType.CERTIFICATO); + + if (!controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_CERTIF_VERS).booleanValue()) { + SacerIndication esito = SacerIndication.DISABILITATO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else { + // identificazione certificato + XmlISC isc = bbbFounded ? bbb.getISC() : null; + // validità firma + XmlSAV sav = bbbFounded ? bbb.getSAV() : null; + // validità del certificato + XmlXCV xcv = bbbFounded ? bbb.getXCV() : null; + if (!bbbFounded) { + SacerIndication esito = SacerIndication.NEGATIVO; + + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else { + // isc + if ((!isc.getConclusion().getIndication().equals(Indication.PASSED) + || !sav.getConclusion().getIndication().equals(Indication.PASSED)) && !isSignaturePassed) { + // log eidas message + XmlConstraintsConclusion constraint = !isc.getConclusion().getIndication().equals(Indication.PASSED) + ? isc : sav; + logEidasConclusion(xmlcertificate, constraint, VFTipoControlloType.CERTIFICATO.name()); + + SacerIndication esito = SacerIndication.CERTIFICATO_NON_VALIDO; + // Nota: non si effettua verifica di sottoindicazione in quanto se questo tipo + // di controllo è + // errato + // si assume che il certificato di firma non è valido + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(generateErrorContrMsgEsito(esito.message(), + constraint.getConclusion().getIndication(), Optional.of( + "il certificato non presenta alcuni degli attributi previsti dallo standard ('signing-certificate', 'cert-diget', ecc.)"))); + } else if (!xcv.getConclusion().getIndication().equals(Indication.PASSED) && !isSignaturePassed) { + // init + SacerIndication esito = SacerIndication.CERTIFICATO_ERRATO; // getSubIndication + SubIndication subIndication = xcv.getConclusion().getSubIndication(); + Optional details = Optional.empty(); + // get SubXCV for more infos + Optional subXCV = xcv.getSubXCV().stream() + .filter(c -> c.getId().equals(xmlcertificate.getId())).findFirst(); + // + if (subIndication != null) { + switch (subIndication) { + case EXPIRED: + case OUT_OF_BOUNDS_NO_POE: + case OUT_OF_BOUNDS_NOT_REVOKED: + // The current time is not in the validity range of the signers certificate. + // Non è chiaro se la data di firma sia precedente o successiva alla validità + // del + // certificato. + // vedi anche https://ec.europa.eu/cefdigital/tracker/browse/DSS-2070 + esito = SacerIndication.CERTIFICATO_SCADUTO; + details = Optional.of((xmlcertificate.getNotAfter() != null + ? " scaduto in data " + dateFormatter.format(xmlcertificate.getNotAfter()) : "") + + (xmlcertificate.getNotBefore() != null ? " valido a partire dalla data " + + dateFormatter.format(xmlcertificate.getNotBefore()) : "") + + " successivo al riferimento temporale utilizzato " + + dateFormatter.format(XmlDateUtility + .xmlGregorianCalendarToDate(firmaCompType.getTmRifTempUsato()))); + break; + case NO_POE: + case CRYPTO_CONSTRAINTS_FAILURE_NO_POE: + case NOT_YET_VALID: + esito = SacerIndication.CERTIFICATO_NON_VALIDO; + details = Optional.of("certificato non è ancora valido"); + break; + case TRY_LATER: + case REVOCATION_OUT_OF_BOUNDS_NO_POE: + // revoche non presenti + if (modificatoriWSCalc.contains(Costanti.ModificatoriWS.TAG_FIRMA_1_5)) { + esito = SacerIndication.REVOCHE_NON_CONSISTENTI; + } else { + esito = SacerIndication.CERTIFICATO_ERRATO; + // alternative message (che quindi non è il defalut dell'esito) + details = Optional.of( + "errore sul controllo delle revoche del certificato, informazioni non scaricabili o non affidabili"); + } + break; + case REVOKED_NO_POE: + case REVOKED: + // + esito = SacerIndication.CERTIFICATO_REVOCATO; + // message details + if (subXCV.isPresent()) { + StringBuilder detailedMsg = new StringBuilder(); + detailedMsg.append((subXCV.get().getRevocationInfo() != null + && subXCV.get().getRevocationInfo().getRevocationDate() != null + ? "revocato in data " + dateFormatter + .format(subXCV.get().getRevocationInfo().getRevocationDate()) + : "data revoca non presente")); + // + detailedMsg.append(MESSAGE_ERROR_SEPARATOR); + // + detailedMsg.append(subXCV.get().getConstraint().stream() + .filter(s -> s.getStatus().equals(XmlStatus.NOT_OK) + && s.getAdditionalInfo() != null) + .map(XmlConstraint::getAdditionalInfo) + .collect(Collectors.joining(MESSAGE_ERROR_SEPARATOR))); + // details + details = Optional.of(detailedMsg.toString()); + } + break; + default: + esito = SacerIndication.CERTIFICATO_ERRATO; // default + details = Optional.of("il certificato non è un certificato di firma"); + LOG.debug(LOG_FMT_SUBINDICATION, esito, contrFirmaCompType.getTiContr(), + cv.getConclusion().getSubIndication()); + break; + } + } + + // log eidas message + logEidasConclusion(xmlcertificate, xcv, VFTipoControlloType.CERTIFICATO.name()); + + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma( + generateErrorContrMsgEsito(esito.message(), subIndication, details)); + } else { + contrFirmaCompType.setTiEsitoContrFirma(SacerIndication.POSITIVO.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(SacerIndication.POSITIVO.message()); + } + } + } + + // CONTROLLI FIRMA - CATENA_TRUSTED CertificateAssociation && + // CertificateReliability + // Nota: su DB risultano solo per casi molto vecchi il riferimento di questo + // controllo con la relativa CRL + contrFirmaCompType = new VFContrFirmaCompType(); + firmaCompType.getContrFirmaComps().add(contrFirmaCompType); + contrFirmaCompType.setTiContr(VFTipoControlloType.CATENA_TRUSTED); + + if (!controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_TRUST_VERS).booleanValue()) { + SacerIndication esito = SacerIndication.DISABILITATO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else { + SacerIndication esito = signature.isTrustedChain() || isSignaturePassed ? SacerIndication.POSITIVO + : SacerIndication.NEGATIVO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } + } + + private void buildFirmaCompCERwithCRL(CertificateWrapper xmlcertificate, VFCertifCaType certifCaType, + VFFirmaCompType firmaCompType, ZonedDateTime dataDiRiferimento, XmlBasicBuildingBlocks bbb) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + // OCSP prioritario rispetto CRL + boolean hasOcsp = xmlcertificate.getCertificateRevocationData().stream() + .anyMatch(r -> r.getRevocationType().equals(RevocationType.OCSP)); + + // CRL + RevocationWrapper crl = findRevocationByType(xmlcertificate, dataDiRiferimento, RevocationType.CRL); + if (hasOcsp || crl == null) { + // + buildContrCRLNotFoundFirmaComp(firmaCompType, xmlcertificate, hasOcsp); + return; + } + + // CRL + VFCrlType crlType = buildCrl(crl); + + // FIRMA : CRL + firmaCompType.setCrl(crlType); + // CRL: CA + crlType.setCertifCa(certifCaType); + + // controlli CRL + buildContrCRLFirmaComp(firmaCompType, xmlcertificate, crl, bbb, hasOcsp); + // CRL - END + } + + private void buildFirmaCompCERwithOCSP(Reports reports, CertificateWrapper xmlcertificate, + VFFirmaCompType firmaCompType, ZonedDateTime dataDiRiferimento, XmlBasicBuildingBlocks bbb) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + // verifica presenza CRL + boolean hasCrl = xmlcertificate.getCertificateRevocationData().stream() + .anyMatch(r -> r.getRevocationType().equals(RevocationType.CRL)); + // OCSP + CertificateRevocationWrapper ocsp = findRevocationByType(xmlcertificate, dataDiRiferimento, + RevocationType.OCSP); + if (ocsp == null) { + // + buildContrOCSPNotFoundFirmaComp(firmaCompType, xmlcertificate, hasCrl); + return; + } // no ocsp + + // CA + VFCertifCaType certifCaOcspType = buildOcspCertifCA(reports, xmlcertificate, ocsp); + + // OCSP + certif + VFOcspType ocspType = buildOcspWithCertif(certifCaOcspType, ocsp); + // FIRMA : OCSP + firmaCompType.setOcsp(ocspType); + + // controlli OCSP + buildContrOCSPFirmaComp(firmaCompType, xmlcertificate, ocsp, bbb, hasCrl); + // OCSP - END + + } + + private void buildFirmaCompCAwithCRL(CertificateWrapper xmlcertificateCA, VFCertifCaType certifCaType, + VFFirmaCompType firmaCompType, ZonedDateTime dataDiRiferimento) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + + // OCSP prioritario rispetto CRL + boolean hasOcsp = xmlcertificateCA.getCertificateRevocationData().stream() + .anyMatch(r -> r.getRevocationType().equals(RevocationType.OCSP)); + + // CRL + RevocationWrapper crl = findRevocationByType(xmlcertificateCA, dataDiRiferimento, RevocationType.CRL); + if (hasOcsp || crl == null) { + return; + } + + // CRL + VFCrlType crlType = buildCrl(crl); + + // CRL : CA + crlType.setCertifCa(certifCaType); + // FIRMA : CRL CA + firmaCompType.setCrlCertifCa(crlType); + // CRL - END + } + + private void buildFirmaCompCAwithOCSP(Reports reports, CertificateWrapper xmlcertificateCA, + VFFirmaCompType firmaCompType, ZonedDateTime dataDiRiferimento) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + // OCSP + RevocationWrapper ocsp = findRevocationByType(xmlcertificateCA, dataDiRiferimento, RevocationType.OCSP); + if (ocsp == null) { + return; + } // no ocsp + + // CA + VFCertifCaType certifCaOcspType = buildOcspCertifCA(reports, xmlcertificateCA, ocsp); + + // OCSP + certif + VFOcspType ocspType = buildOcspWithCertif(certifCaOcspType, ocsp); + // FIRMA : OCSP + firmaCompType.setOcspCertifCa(ocspType); + // OCSP - END + } + + // No CRL + private void buildContrCRLNotFoundFirmaComp(VFFirmaCompType firmaCompType, CertificateWrapper xmlcertificate, + boolean hasOcsp) { + buildContrCRLFirmaComp(firmaCompType, xmlcertificate, null, null, hasOcsp); + } + + private void buildContrCRLFirmaComp(VFFirmaCompType firmaCompType, CertificateWrapper xmlcertificate, + RevocationWrapper crl, XmlBasicBuildingBlocks bbb, boolean hasOcsp) { + + /* + * caso "particolare" di building block non trovato (vedi controllo precedente con WARNING) in questi casi si + * assumono come NON PASSATI i controlli sull'oggetto perché non reperibili + */ + boolean bbbFounded = bbb != null; + // presente la CRL + boolean hasCrl = crl != null; + // presente solo la CRL + boolean onlyCrl = hasCrl && !hasOcsp; + // presente solo OCSP + boolean onlyOcsp = !onlyCrl; + // no revoche + boolean noRevocations = !hasCrl && !hasOcsp; + + VFContrFirmaCompType contrFirmaCompType = new VFContrFirmaCompType(); + firmaCompType.getContrFirmaComps().add(contrFirmaCompType); + contrFirmaCompType.setTiContr(VFTipoControlloType.CRL); + + if (!controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS).booleanValue()) { + SacerIndication esito = SacerIndication.DISABILITATO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else { + // scenario 1 : crl e ocsp non presente + if (noRevocations) { + // valutazione CERTIFICATO_SCADUTO_3_12_2009 + // caso 1 : 3/12/2009 <= notAfter && 3/12/2009 >= notBefore + Date revokedDate = Date + .from(LocalDate.of(2009, 12, 3).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()); + if (xmlcertificate.getNotAfter().before(revokedDate) + && xmlcertificate.getNotBefore().after(revokedDate)) { + SacerIndication esito = SacerIndication.CERTIFICATO_SCADUTO_3_12_2009; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else /* caso 2 */ { + SacerIndication esito = SacerIndication.CRL_NON_SCARICABILE; + + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } + } else if (onlyOcsp) /* scenario 3 : solo ocsp */ { + SacerIndication esito = SacerIndication.NON_NECESSARIO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma( + esito.message() + ": controllo non necessario in quanto avviene tramite OCSP"); + } else /* scenario 4 : solo CRL disponibile */ { + // Nota : non trovato il build block oppure l'indicazione con il risultato di + // validazione del certifcato + if (!bbbFounded + || bbb.getXCV().getSubXCV().stream().noneMatch(c -> c.getId().equals(xmlcertificate.getId()))) { + SacerIndication esito = SacerIndication.NEGATIVO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else { + // + XmlSubXCV subXvc = bbb.getXCV().getSubXCV().stream() + .filter(c -> c.getId().equals(xmlcertificate.getId())).collect(Collectors.toList()).get(0); + // + List xmlRacs = subXvc.getCRS().getRAC().stream().filter(r -> r.getId().equals(crl.getId())) + .collect(Collectors.toList()); + + if (xmlRacs.isEmpty()) { + SacerIndication esito = SacerIndication.NEGATIVO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else if (!xmlRacs.get(0).getConclusion().getIndication().equals(Indication.PASSED)) { + // log eidas message + logEidasConclusion(xmlcertificate, xmlRacs.get(0), VFTipoControlloType.CRL.name()); + + // evaluate subindication (Revocation acceptence) + SacerIndication esito = evaluateCRLXmlRacSubIndication(contrFirmaCompType.getTiContr().name(), + xmlRacs); + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(generateErrorContrMsgEsito(esito.message(), + xmlRacs.get(0).getConclusion().getIndication(), Optional.empty())); + } else { + SacerIndication esito = SacerIndication.POSITIVO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } + } + } + } + } + + private void buildContrOCSPNotFoundFirmaComp(VFFirmaCompType firmaCompType, CertificateWrapper xmlcertificate, + boolean hasCrl) { + buildContrOCSPFirmaComp(firmaCompType, xmlcertificate, null, null, hasCrl); + } + + private void buildContrOCSPFirmaComp(VFFirmaCompType firmaCompType, CertificateWrapper xmlcertificate, + CertificateRevocationWrapper ocsp, XmlBasicBuildingBlocks bbb, boolean hasCrl) { + + /* + * caso "particolare" di building block non trovato (vedi controllo precedente con WARNING) in questi casi si + * assumono come NON PASSATI i controlli sull'oggetto perché non reperibili + */ + boolean bbbFounded = bbb != null; + // presente OCSP + boolean hasOcsp = ocsp != null; + // no revoche + boolean noRevocations = !hasCrl && !hasOcsp; + + VFContrFirmaCompType contrFirmaCompType = new VFContrFirmaCompType(); + firmaCompType.getContrFirmaComps().add(contrFirmaCompType); + contrFirmaCompType.setTiContr(VFTipoControlloType.OCSP); + + if (!controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS).booleanValue()) { + SacerIndication esito = SacerIndication.DISABILITATO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else { + // scenario 1 : revoche non presenti + if (noRevocations) { + SacerIndication esito = SacerIndication.OCSP_NON_SCARICABILE; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else if (hasCrl && !hasOcsp) /* scenario 2 : presente la CRL ma NON OCSP */ { + SacerIndication esito = SacerIndication.NON_NECESSARIO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma( + esito.message() + ": controllo non necessario in quanto avviene tramite CRL"); + } else /* scenario 3 : ocsp presente */ { + // Nota : non trovato il build block oppure l'indicazione con il risultato di + // validazione del certifcato + if (!bbbFounded + || bbb.getXCV().getSubXCV().stream().noneMatch(c -> c.getId().equals(xmlcertificate.getId()))) { + SacerIndication esito = SacerIndication.NEGATIVO; + + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else { + // + XmlSubXCV subXvc = bbb.getXCV().getSubXCV().stream() + .filter(c -> c.getId().equals(xmlcertificate.getId())).collect(Collectors.toList()).get(0); + // + List xmlRacs = subXvc.getCRS().getRAC().stream().filter(r -> r.getId().equals(ocsp.getId())) + .collect(Collectors.toList()); + + if (xmlRacs.isEmpty()) { + SacerIndication esito = SacerIndication.NEGATIVO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } else if (!xmlRacs.get(0).getConclusion().getIndication().equals(Indication.PASSED)) { + // log eidas message + logEidasConclusion(xmlcertificate, xmlRacs.get(0), VFTipoControlloType.OCSP.name()); + + // evalutate subindication + SacerIndication esito = evaluateOCSPXmlRacSubIndication(ocsp, + contrFirmaCompType.getTiContr().name(), xmlRacs); + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(generateErrorContrMsgEsito(esito.message(), + xmlRacs.get(0).getConclusion().getIndication(), Optional.empty())); + } else { + SacerIndication esito = SacerIndication.OCSP_VALIDO; + // + contrFirmaCompType.setTiEsitoContrFirma(esito.name()); + contrFirmaCompType.setDsMsgEsitoContrFirma(esito.message()); + } + } + } + } + } + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/EidasMarcaBuilder.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/EidasMarcaBuilder.java new file mode 100644 index 0000000..3638243 --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/EidasMarcaBuilder.java @@ -0,0 +1,660 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.firma.strategy.eidas; + +import java.lang.reflect.InvocationTargetException; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import eu.europa.esig.dss.detailedreport.jaxb.XmlBasicBuildingBlocks; +import eu.europa.esig.dss.detailedreport.jaxb.XmlCV; +import eu.europa.esig.dss.detailedreport.jaxb.XmlISC; +import eu.europa.esig.dss.detailedreport.jaxb.XmlRAC; +import eu.europa.esig.dss.detailedreport.jaxb.XmlSubXCV; +import eu.europa.esig.dss.detailedreport.jaxb.XmlXCV; +import eu.europa.esig.dss.diagnostic.CertificateRevocationWrapper; +import eu.europa.esig.dss.diagnostic.CertificateWrapper; +import eu.europa.esig.dss.diagnostic.RevocationWrapper; +import eu.europa.esig.dss.diagnostic.SignatureWrapper; +import eu.europa.esig.dss.diagnostic.TimestampWrapper; +import eu.europa.esig.dss.enumerations.Indication; +import eu.europa.esig.dss.enumerations.RevocationType; +import eu.europa.esig.dss.enumerations.SubIndication; +import eu.europa.esig.dss.validation.reports.Reports; +import it.eng.parer.eidas.model.EidasWSReportsDTOTree; +import it.eng.parer.firma.util.VerificaFirmaEnums.SacerIndication; +import it.eng.parer.firma.xml.VFAdditionalInfoMarcaCompType; +import it.eng.parer.firma.xml.VFCertifCaType; +import it.eng.parer.firma.xml.VFContrMarcaCompType; +import it.eng.parer.firma.xml.VFCrlType; +import it.eng.parer.firma.xml.VFMarcaCompType; +import it.eng.parer.firma.xml.VFOcspType; +import it.eng.parer.firma.xml.VFTipoControlloType; +import it.eng.parer.firma.xml.VFUrlDistribCrlType; +import it.eng.parer.firma.xml.VFUrlDistribOcspType; +import it.eng.parer.firma.xml.VerificaFirmaWrapper; +import it.eng.parer.ws.utils.ParametroApplDB.ParametroApplFl; +import it.eng.parer.ws.utils.XmlDateUtility; + +public class EidasMarcaBuilder extends EidasBaseWrapperResult implements IEidasBuilderVFObj { + + private static final Logger LOG = LoggerFactory.getLogger(EidasMarcaBuilder.class); + + private Map controlliAbilitati; + + public EidasMarcaBuilder(Map controlliAbilitati) { + super(); + this.controlliAbilitati = controlliAbilitati; + } + + @Override + public VFMarcaCompType build(EidasWSReportsDTOTree eidasReportsDto, VerificaFirmaWrapper vfWrapper, + SignatureWrapper signatureW, Optional timestampW, ZonedDateTime dataDiRiferimento, + BigDecimal[] pgs) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + + // get TimestampWrapper + TimestampWrapper ts = timestampW + .orElseThrow(() -> new NullPointerException("Errore compilazione marca, timestamp NULL.")); + + // reports by dss + Reports reports = new Reports(eidasReportsDto.getReport().getDiagnosticData(), + eidasReportsDto.getReport().getDetailedReport(), eidasReportsDto.getReport().getSimpleReport(), + null /* validation report non gestito */); + + // MARCHE + VFMarcaCompType marcaCompType = new VFMarcaCompType(); + // set pgMarche + marcaCompType.setPgMarca(pgs[PG_MARCA]); + // set id (id componente PARER) + marcaCompType.setId(eidasReportsDto.getIdComponente()); + + // add info (empty) + VFAdditionalInfoMarcaCompType additionalInfoMarcaCompType = new VFAdditionalInfoMarcaCompType(); + marcaCompType.setAdditionalInfo(additionalInfoMarcaCompType); + + // ******************************** + // USED CERTIFICATE + // ******************************** + // CERTIFICATO TSA + BLOB + VFCertifCaType certifCaType = new VFCertifCaType(); + marcaCompType.setCertifTsa(certifCaType); + + // Timestamp no signing certificate ! + if (ts.getSigningCertificate() == null) { + // building block + XmlBasicBuildingBlocks bbb = reports.getDetailedReport().getBasicBuildingBlockById(ts.getId()); + if (bbb == null) { + // TOFIX: cosa fare in questi casi ?! + LOG.warn("BasicBuildingBlockById not found TS ID = {}", ts.getId()); + } + // CONTROLLI MARCA + buildContrMarcaComp(marcaCompType, ts, null, bbb); + return marcaCompType; + } + + CertificateWrapper xmlcertificateTsa = reports.getDiagnosticData() + .getUsedCertificateById(ts.getSigningCertificate().getId()); + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificateTsa, "serialNumber", + Optional.ofNullable(ts.getSigningCertificate().getId())); + certifCaType.setNiSerialCertifCa(new BigDecimal(xmlcertificateTsa.getSerialNumber())); + + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificateTsa, "notAfter", + Optional.ofNullable(ts.getSigningCertificate().getId())); + certifCaType.setDtFinValCertifCa(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateTsa.getNotAfter())); + + // test + EidasWrapperResultControl.fieldCannotBeNull(xmlcertificateTsa, "notBefore", + Optional.ofNullable(ts.getSigningCertificate().getId())); + certifCaType.setDtIniValCertifCa(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateTsa.getNotBefore())); + // Note: report EIDAS doens't cover it ! ( SubjectKeyId non presente su rerport) + // certifCaType.setDsSubjectKeyId(); + int urlIdx = 1; + // check NON empty URL + List crlFiltered = xmlcertificateTsa.getCRLDistributionPoints().stream().filter(StringUtils::isNotBlank) + .collect(Collectors.toList()); + for (String url : crlFiltered) { + VFUrlDistribCrlType urlDistribCrlType = new VFUrlDistribCrlType(); + urlDistribCrlType.setDlUrlDistribCrl(url); + urlDistribCrlType.setNiOrdUrlDistribCrl(new BigDecimal(urlIdx)); + + certifCaType.getUrlDistribCrls().add(urlDistribCrlType); + + // inc idc + urlIdx++; + } + // CA + String certificateCAId = getCertificateCAId(ts, xmlcertificateTsa); + // + CertificateWrapper xmlcertificateCA = reports.getDiagnosticData().getUsedCertificateById(certificateCAId); + // ocsp (from CA+certificate) + // check NON empty URL + Iterable ocspCombinedUrls = CollectionUtils + .union(xmlcertificateCA.getOCSPAccessUrls(), xmlcertificateTsa.getOCSPAccessUrls()).stream() + .filter(StringUtils::isNotBlank).collect(Collectors.toList()); + // ocsp + urlIdx = 1; + for (String url : ocspCombinedUrls) { + VFUrlDistribOcspType urlDistribOcspType = new VFUrlDistribOcspType(); + urlDistribOcspType.setDlUrlDistribOcsp(url); + urlDistribOcspType.setNiOrdUrlDistribOcsp(new BigDecimal(urlIdx)); + + certifCaType.getUrlDistribOcsps().add(urlDistribOcspType); + // inc idx + urlIdx++; + } + + certifCaType.setDlDnIssuerCertifCa(xmlcertificateTsa.getCertificateIssuerDN()); + certifCaType.setDlDnSubjectCertifCa(xmlcertificateTsa.getCertificateDN()); + + // ************************* + // nullable element + String dsAlgoMarca = null; + if (ts.getDigestAlgorithm() != null && ts.getEncryptionAlgorithm() != null) { + dsAlgoMarca = ts.getDigestAlgorithm().getName().concat("with") + .concat(ts.getEncryptionAlgorithm().getName()); + } + marcaCompType.setDsAlgoMarca(dsAlgoMarca); + marcaCompType.setTmMarcaTemp(XmlDateUtility.dateToXMLGregorianCalendar(ts.getProductionTime())); + marcaCompType.setTiFormatoMarca(signatureW.getSignatureFormat().toString());// ereditato dalla firma + marcaCompType.setDtScadMarca(XmlDateUtility.dateToXMLGregorianCalendar(xmlcertificateTsa.getNotAfter())); + // Note: report EIDAS doens't cover it ! ( MarcaBase64 non presente su rerport) + // marcaCompType.setDsMarcaBase64(); + /** + * CONTROLLI / ESITI MARCA + */ + // building block + XmlBasicBuildingBlocks bbb = reports.getDetailedReport().getBasicBuildingBlockById(ts.getId()); + if (bbb == null) { + // TOFIX: cosa fare in questi casi ?! + LOG.warn("BasicBuildingBlockById not found TS ID = {}", ts.getId()); + } + // CONTROLLI MARCA + buildContrMarcaComp(marcaCompType, ts, xmlcertificateTsa, bbb); + + // OCSP + buildMarcaCompTSAwithOCSP(marcaCompType, reports, xmlcertificateTsa, dataDiRiferimento, bbb); + + // CRL + buildMarcaCompTSAwithCRL(marcaCompType, certifCaType, xmlcertificateTsa, dataDiRiferimento, bbb); + + return marcaCompType; + } + + /* + * Nota: non possiamo persistere più di una CRL (non supportato), viene costruita un'apposita lista "filtrata" con + * il solo elemento utile + * + */ + private void buildMarcaCompTSAwithCRL(VFMarcaCompType marcaCompType, VFCertifCaType certifCaType, + CertificateWrapper xmlcertificateTsa, ZonedDateTime dataDiRiferimento, XmlBasicBuildingBlocks bbb) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + + // OCSP prioritario rispetto CRL + boolean hasOcsp = xmlcertificateTsa.getCertificateRevocationData().stream() + .anyMatch(r -> r.getRevocationType().equals(RevocationType.OCSP)); + + // CRL + RevocationWrapper crl = findRevocationByType(xmlcertificateTsa, dataDiRiferimento, RevocationType.CRL); + if (hasOcsp || crl == null) { + // + buildContrCRLNotFoundMarcaComp(marcaCompType, xmlcertificateTsa, hasOcsp); + return; + } // no crl + + // CRL + VFCrlType crlTypeTsa = buildCrl(crl); + // CRL : CA + crlTypeTsa.setCertifCa(certifCaType); + // MARCA : CRL + marcaCompType.setCrlTsa(crlTypeTsa); + + // controlli CRL + buildContrCRLMarcaComp(marcaCompType, xmlcertificateTsa, crl, bbb, hasOcsp); + // CRL - End + } + + private void buildMarcaCompTSAwithOCSP(VFMarcaCompType marcaCompType, Reports reports, + CertificateWrapper xmlcertificateTsa, ZonedDateTime dataDiRiferimento, XmlBasicBuildingBlocks bbb) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + // verifica presenza CRL + boolean hasCrl = xmlcertificateTsa.getCertificateRevocationData().stream() + .anyMatch(r -> r.getRevocationType().equals(RevocationType.CRL)); + + // OCSP + CertificateRevocationWrapper ocsp = findRevocationByType(xmlcertificateTsa, dataDiRiferimento, + RevocationType.OCSP); + if (ocsp == null) { + // + buildContrOCSPNotFoundMarcaComp(marcaCompType, xmlcertificateTsa, hasCrl); + return; + } // no crl + + // CA + VFCertifCaType certifCaOcspType = buildOcspCertifCA(reports, xmlcertificateTsa, ocsp); + + // build OCSP + VFOcspType ocspTypeTsa = buildOcspWithCertif(certifCaOcspType, ocsp); + marcaCompType.setOcspTsa(ocspTypeTsa); + // + // CRONTROLLI OCSP + buildContrOCSPMarcaComp(marcaCompType, xmlcertificateTsa, ocsp, bbb, hasCrl); + // OCSP - End + } + + private void buildContrOCSPNotFoundMarcaComp(VFMarcaCompType marcaCompType, CertificateWrapper xmlcertificateTsa, + boolean hasCrl) { + buildContrOCSPMarcaComp(marcaCompType, xmlcertificateTsa, null, null, hasCrl); + } + + private void buildContrOCSPMarcaComp(VFMarcaCompType marcaCompType, CertificateWrapper xmlcertificateTsa, + CertificateRevocationWrapper ocsp, XmlBasicBuildingBlocks bbb, boolean hasCrl) { + + /* + * caso "particolare" di building block non trovato (vedi controllo precedente con WARNING) in questi casi si + * assumono come NON PASSATI i controlli sull'oggetto perché non reperibili + */ + boolean bbbFounded = bbb != null; + // presente OCSP + boolean hasOcsp = ocsp != null; + // no revoche + boolean noRevocations = !hasCrl && !hasOcsp; + + // CONTROLLI MARCA - OCSP + VFContrMarcaCompType contrMarcaCompType = new VFContrMarcaCompType(); + marcaCompType.getContrMarcaComps().add(contrMarcaCompType); + contrMarcaCompType.setTiContr(VFTipoControlloType.OCSP); + + if (!controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS).booleanValue()) { + SacerIndication esito = SacerIndication.DISABILITATO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else { + // scenario 1 : revoche non presenti + if (noRevocations) { + SacerIndication esito = SacerIndication.OCSP_NON_SCARICABILE; + + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else if (hasCrl && !hasOcsp) /* scenario 2 : presente la CRL ma NON OCSP */ { + SacerIndication esito = SacerIndication.NON_NECESSARIO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType + .setDsMsgEsitoContrMarca(esito.message() + ": non è necessario in quanto avviene tramite CRL"); + } else /* scenario 2 : ocsp presente */ { + // Nota : non trovato il build block oppure l'indicazione con il risultato di + // validazione del certifcato + if (!bbbFounded || bbb.getXCV().getSubXCV().stream() + .noneMatch(c -> c.getId().equals(xmlcertificateTsa.getId()))) { + SacerIndication esito = SacerIndication.NEGATIVO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else { + // + XmlSubXCV subXvc = bbb.getXCV().getSubXCV().stream() + .filter(c -> c.getId().equals(xmlcertificateTsa.getId())).collect(Collectors.toList()) + .get(0); + // + List xmlRacs = subXvc.getCRS().getRAC().stream().filter(r -> r.getId().equals(ocsp.getId())) + .collect(Collectors.toList()); + + if (xmlRacs.isEmpty() + || !xmlRacs.get(0).getConclusion().getIndication().equals(Indication.PASSED)) { + // + logEidasConclusion(xmlcertificateTsa, xmlRacs.get(0), VFTipoControlloType.OCSP.name()); + // evalutate subindication + SacerIndication esito = evaluateOCSPXmlRacSubIndication(ocsp, + contrMarcaCompType.getTiContr().name(), xmlRacs); + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(generateErrorContrMsgEsito(esito.message(), + xmlRacs.get(0).getConclusion().getIndication(), Optional.empty())); + } else { + SacerIndication esito = SacerIndication.OCSP_VALIDO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } + } + } + } + } + + private void buildContrMarcaComp(VFMarcaCompType marcaCompType, TimestampWrapper ts, + CertificateWrapper xmlcertificateTsa, XmlBasicBuildingBlocks bbb) { + // + boolean bbbFounded = bbb != null; + // TOFIX: da verificare se diversa condizione + boolean isTimestampCompliant = ts.isSignatureIntact() && ts.isSignatureValid(); + + SacerIndication esitoContrConforme = isTimestampCompliant ? SacerIndication.POSITIVO + : SacerIndication.FORMATO_NON_CONOSCIUTO; + + marcaCompType.setTiEsitoContrConforme(esitoContrConforme.name()); + marcaCompType.setDsMsgEsitoContrConforme(esitoContrConforme.message()); + + if (!bbbFounded) { + SacerIndication esito = SacerIndication.NEGATIVO; + // + marcaCompType.setTiEsitoVerifMarca(esito.name()); + marcaCompType.setDsMsgEsitoVerifMarca(esito.message()); + } else { + if (!bbb.getConclusion().getIndication().equals(Indication.PASSED)) { + logEidasConclusion(xmlcertificateTsa, bbb.getConclusion()); + // + SacerIndication esito = SacerIndication.WARNING; + // + marcaCompType.setTiEsitoVerifMarca(esito.name()); + marcaCompType.setDsMsgEsitoVerifMarca(generateErrorContrMsgEsito(esito.message(), + bbb.getConclusion().getIndication(), Optional.empty())); + } else { + SacerIndication esito = SacerIndication.POSITIVO; + // + marcaCompType.setTiEsitoVerifMarca(esito.name()); + marcaCompType.setDsMsgEsitoVerifMarca(esito.message()); + } + } + + VFContrMarcaCompType contrMarcaCompType = new VFContrMarcaCompType(); + marcaCompType.getContrMarcaComps().add(contrMarcaCompType); + contrMarcaCompType.setTiContr(VFTipoControlloType.CRITTOGRAFICO); + + XmlCV cv = bbbFounded ? bbb.getCV() : null; + + if (!controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_CRITTOG_VERS).booleanValue()) { + SacerIndication esito = SacerIndication.DISABILITATO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else { + if (!isTimestampCompliant) { + SacerIndication esito = SacerIndication.NON_ESEGUITO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else if (!bbbFounded) { + SacerIndication esito = SacerIndication.ERRORE; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else { + if (!cv.getConclusion().getIndication().equals(Indication.PASSED)) { + // init + SacerIndication esito = SacerIndication.NEGATIVO; // getSubIndication + SubIndication subIndication = cv.getConclusion().getSubIndication(); + // + if (subIndication != null) { + switch (subIndication) { + case FORMAT_FAILURE: + esito = SacerIndication.NON_ESEGUITO; + break; + case NO_POE: + esito = SacerIndication.NON_NECESSARIO; + break; + default: + esito = SacerIndication.NEGATIVO; // default + LOG.debug(LOG_FMT_SUBINDICATION, esito, contrMarcaCompType.getTiContr(), subIndication); + break; + } + } + // log eidas message + logEidasConclusion(xmlcertificateTsa, cv, VFTipoControlloType.CRITTOGRAFICO.name()); + + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca( + generateErrorContrMsgEsito(esito.message(), subIndication, Optional.empty())); + } else { + contrMarcaCompType.setTiEsitoContrMarca(SacerIndication.POSITIVO.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(SacerIndication.POSITIVO.message()); + } + } + } + + // CONTROLLI MARCA - CERTIFICATO + contrMarcaCompType = new VFContrMarcaCompType(); + marcaCompType.getContrMarcaComps().add(contrMarcaCompType); + contrMarcaCompType.setTiContr(VFTipoControlloType.CERTIFICATO); + + if (!controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_CERTIF_VERS).booleanValue()) { + SacerIndication esito = SacerIndication.DISABILITATO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else { + // identificazione certificato + XmlISC isc = bbbFounded ? bbb.getISC() : null; + // validità del certificato + XmlXCV xcv = bbbFounded ? bbb.getXCV() : null; + // + if (!isTimestampCompliant) { + SacerIndication esito = SacerIndication.DISABILITATO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else if (!bbbFounded) { + SacerIndication esito = SacerIndication.ERRORE; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else { + if (!isc.getConclusion().getIndication().equals(Indication.PASSED)) { + // log eidas message + logEidasConclusion(xmlcertificateTsa, isc, VFTipoControlloType.CERTIFICATO.name()); + + SacerIndication esito = SacerIndication.NEGATIVO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(generateErrorContrMsgEsito(esito.message(), + isc.getConclusion().getIndication(), Optional.empty())); + } else if (!xcv.getConclusion().getIndication().equals(Indication.PASSED)) { + /* + * Unico esito supportato nelle marche è NEGATIVO (ERRORE su EIDAS non trova traduzione.....) Lo + * switch/case è "over" rispetto l'unico caso di esito possibile (se non PASSED), viene comunque + * implementato per "traccare" le possibili subindication + */ + // init + SacerIndication esito = SacerIndication.NEGATIVO; // getSubIndication + SubIndication subIndication = xcv.getConclusion().getSubIndication(); + Optional details = Optional.empty(); + // + if (subIndication != null) { + switch (subIndication) { + case OUT_OF_BOUNDS_NO_POE: + case OUT_OF_BOUNDS_NOT_REVOKED: + // The current time is not in the validity range of the signers certificate. + // Non è chiaro se la data di firma sia precedente o successiva alla validità + // del + // certificato. + // vedi anche https://ec.europa.eu/cefdigital/tracker/browse/DSS-2070 + esito = SacerIndication.NEGATIVO; + details = Optional.of( + (xmlcertificateTsa.getNotAfter() != null || xmlcertificateTsa.getNotBefore() != null + ? ": Il certificato " : "") + + (xmlcertificateTsa.getNotAfter() != null + ? " scaduto in data " + + dateFormatter.format(xmlcertificateTsa.getNotAfter()) + : "") + + (xmlcertificateTsa.getNotBefore() != null + ? " valido a partire dalla data " + + dateFormatter.format(xmlcertificateTsa.getNotBefore()) + + " successivo al riferimento temporale utilizzato " + + dateFormatter.format(xmlcertificateTsa.getNotAfter()) + : "")); + break; + default: + esito = SacerIndication.NEGATIVO; // default + LOG.debug(LOG_FMT_SUBINDICATION, esito, contrMarcaCompType.getTiContr(), + cv.getConclusion().getSubIndication()); + break; + } + } + + // log eidas message + logEidasConclusion(xmlcertificateTsa, xcv, VFTipoControlloType.CERTIFICATO.name()); + + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca( + generateErrorContrMsgEsito(esito.message(), subIndication, details)); + } else { + contrMarcaCompType.setTiEsitoContrMarca(SacerIndication.POSITIVO.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(SacerIndication.POSITIVO.message()); + } + } + } + + // CONTROLLI MARCA - CATENA_TRUSTED + contrMarcaCompType = new VFContrMarcaCompType(); + marcaCompType.getContrMarcaComps().add(contrMarcaCompType); + contrMarcaCompType.setTiContr(VFTipoControlloType.CATENA_TRUSTED); + // + if (!controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_TRUST_VERS).booleanValue()) { + SacerIndication esito = SacerIndication.DISABILITATO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else if (!isTimestampCompliant || xmlcertificateTsa == null) { + SacerIndication esito = SacerIndication.NON_ESEGUITO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else { + SacerIndication esito = xmlcertificateTsa.isTrustedChain() ? SacerIndication.POSITIVO + : SacerIndication.NEGATIVO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } + + } + + private void buildContrCRLNotFoundMarcaComp(VFMarcaCompType marcaCompType, CertificateWrapper xmlcertificateTsa, + boolean hasOcsp) { + buildContrCRLMarcaComp(marcaCompType, xmlcertificateTsa, null, null, hasOcsp); + } + + private void buildContrCRLMarcaComp(VFMarcaCompType marcaCompType, CertificateWrapper xmlcertificateTsa, + RevocationWrapper crl, XmlBasicBuildingBlocks bbb, boolean hasOcsp) { + /* + * caso "particolare" di building block non trovato (vedi controllo precedente con WARNING) in questi casi si + * assumono come NON PASSATI i controlli sull'oggetto perché non reperibili + */ + boolean bbbFounded = bbb != null; + // presente la CRL + boolean hasCrl = crl != null; + // presente solo la CRL + boolean onlyCrl = hasCrl && !hasOcsp; + // presente solo OCSP + boolean onlyOcsp = !onlyCrl; + // no revoche + boolean noRevocations = !hasCrl && !hasOcsp; + + // CONTROLLI MARCA - CRL + VFContrMarcaCompType contrMarcaCompType = new VFContrMarcaCompType(); + marcaCompType.getContrMarcaComps().add(contrMarcaCompType); + contrMarcaCompType.setTiContr(VFTipoControlloType.CRL); + + if (!controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS).booleanValue()) { + SacerIndication esito = SacerIndication.DISABILITATO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else { + // scenario 1 : crl e ocsp non presente + if (noRevocations) { + // caso 1 : 3/12/2009 <= notAfter && 3/12/2009 >= notBefore + Date revokedDate = Date + .from(LocalDate.of(2009, 12, 3).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()); + if (xmlcertificateTsa.getNotAfter().before(revokedDate) + && xmlcertificateTsa.getNotBefore().after(revokedDate)) { + SacerIndication esito = SacerIndication.CERTIFICATO_SCADUTO_3_12_2009; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else /* caso 2 */ { + SacerIndication esito = SacerIndication.CRL_NON_SCARICABILE; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + + } + } else /* scenario 2 : solo ocsp */ if (onlyOcsp) { + SacerIndication esito = SacerIndication.CRL_NON_SCARICABILE; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message() + + ": non scaricabile dal server perché il controllo sulla revoca avviene tramite OCSP"); + } /* scenario 3 : solo CRL disponibile */ else { + if (!bbbFounded || bbb.getXCV().getSubXCV().stream() + .noneMatch(c -> c.getId().equals(xmlcertificateTsa.getId()))) { + SacerIndication esito = SacerIndication.NEGATIVO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else { + // + XmlSubXCV subXvc = bbb.getXCV().getSubXCV().stream() + .filter(c -> c.getId().equals(xmlcertificateTsa.getId())).collect(Collectors.toList()) + .get(0); + // + List xmlRacs = subXvc.getCRS().getRAC().stream().filter(r -> r.getId().equals(crl.getId())) + .collect(Collectors.toList()); + if (xmlRacs.isEmpty()) { + SacerIndication esito = SacerIndication.NEGATIVO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } else if (!xmlRacs.get(0).getConclusion().getIndication().equals(Indication.PASSED)) { + // log eidas message + logEidasConclusion(xmlcertificateTsa, bbb.getConclusion(), VFTipoControlloType.CRL.name()); + + // evaluate subindication (Revocation acceptence) + SacerIndication esito = evaluateCRLXmlRacSubIndication(contrMarcaCompType.getTiContr().name(), + xmlRacs); + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(generateErrorContrMsgEsito(esito.message(), + xmlRacs.get(0).getConclusion().getIndication(), Optional.empty())); + } else { + SacerIndication esito = SacerIndication.POSITIVO; + // + contrMarcaCompType.setTiEsitoContrMarca(esito.name()); + contrMarcaCompType.setDsMsgEsitoContrMarca(esito.message()); + } + } + } + } + } + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/IEidasBuilderVFObj.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/IEidasBuilderVFObj.java new file mode 100644 index 0000000..2a73f6d --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/IEidasBuilderVFObj.java @@ -0,0 +1,71 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package it.eng.parer.firma.strategy.eidas; + +import java.lang.reflect.InvocationTargetException; +import java.math.BigDecimal; +import java.time.ZonedDateTime; +import java.util.Optional; + +import eu.europa.esig.dss.diagnostic.SignatureWrapper; +import eu.europa.esig.dss.diagnostic.TimestampWrapper; +import it.eng.parer.eidas.model.EidasWSReportsDTOTree; +import it.eng.parer.firma.xml.VFFirmaCompType; +import it.eng.parer.firma.xml.VFMarcaCompType; +import it.eng.parer.firma.xml.VerificaFirmaWrapper; + +public interface IEidasBuilderVFObj { + + /** + * Main method per la generazione del dto trattatot nel singolo strategy (vedi {@link EidasFirmaBuilder} + * {@link EidasMarcaBuilder}), viene restituito un oggetto di tipo {@link VFFirmaCompType} / {@link VFMarcaCompType} + * + * @param eidasReportsDto + * dto contentenete la risposta del servizio di verifica firma EIDAS + * @param vfWrapper + * wrapper finale che conterrà i report EIDAS mappati opportunamente + * @param signatureW + * wrapper firma EIDAS + * @param timestampW + * timestamp wrapper EIDAS + * @param dataDiRiferimento + * data di verifica (esplicitata su metadati o sysdate) + * @param pgs + * array di progressivi busta/firma/marca + * + * @return restituitisce un oggetto di tipo {@link VFFirmaCompType} o {@link VFMarcaCompType} + * + * @throws InvocationTargetException + * eccezione generica + * @throws IllegalArgumentException + * eccezione generica + * @throws IllegalAccessException + * eccezione generica + * @throws NoSuchMethodException + * eccezione generica + * + */ + public T build(EidasWSReportsDTOTree eidasReportsDto, VerificaFirmaWrapper vfWrapper, SignatureWrapper signatureW, + Optional timestampW, ZonedDateTime dataDiRiferimento, BigDecimal[] pgs) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException; + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/factory/EidasAbsBuilderFactory.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/factory/EidasAbsBuilderFactory.java new file mode 100644 index 0000000..d8f26a9 --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/factory/EidasAbsBuilderFactory.java @@ -0,0 +1,98 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.firma.strategy.eidas.factory; + +import java.lang.reflect.InvocationTargetException; +import java.math.BigDecimal; +import java.time.ZonedDateTime; +import java.util.Map; +import java.util.Optional; +import java.util.Set; + +import eu.europa.esig.dss.diagnostic.SignatureWrapper; +import eu.europa.esig.dss.diagnostic.TimestampWrapper; +import it.eng.parer.eidas.model.EidasWSReportsDTOTree; +import it.eng.parer.firma.strategy.eidas.EidasMarcaBuilder; +import it.eng.parer.firma.strategy.eidas.IEidasBuilderVFObj; +import it.eng.parer.firma.xml.VFFirmaCompType; +import it.eng.parer.firma.xml.VFMarcaCompType; +import it.eng.parer.firma.xml.VerificaFirmaWrapper; +import it.eng.parer.ws.utils.Costanti; + +public abstract class EidasAbsBuilderFactory { + + /** + * + * Factory creazione e build del dto di tipo "verifica firma", che ospiterà firma o marca. + * + * @param controlliAbilitati + * controlli abilitati recuperti a sistema + * @param isDataDiRiferimentoOnCompVers + * se data riferimento per verifica esplicita + * @param dataDiRiferimento + * data di verifica (esplicitata su metadati o sysdate) + * @param modificatoriWSCalc + * modificatori ws (dipendono dalla versione) + * @param eidasReportsDto + * dto contentenete la risposta del servizio di verifica firma EIDAS + * @param vfWrapper + * wrapper finale che conterrà i report EIDAS mappati opportunamente + * @param signatureW + * wrapper firma EIDAS + * @param timestampW + * timestamp wrapper EIDAS + * @param pgs + * array di progressivi busta/firma/marca + * + * @return restituitisce un oggetto di tipo {@link VFFirmaCompType} o {@link VFMarcaCompType} + * + * @throws InvocationTargetException + * eccezione generica + * @throws IllegalArgumentException + * eccezione generica + * @throws IllegalAccessException + * eccezione generica + * @throws NoSuchMethodException + * eccezione generica + */ + public V create(Map controlliAbilitati, boolean isDataDiRiferimentoOnCompVers, + ZonedDateTime dataDiRiferimento, Set modificatoriWSCalc, + EidasWSReportsDTOTree eidasReportsDto, VerificaFirmaWrapper vfWrapper, SignatureWrapper signatureW, + Optional timestampW, BigDecimal[] pgs) + throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + + IEidasBuilderVFObj buider = init(controlliAbilitati, isDataDiRiferimentoOnCompVers, modificatoriWSCalc); + + return buider.build(eidasReportsDto, vfWrapper, signatureW, timestampW, dataDiRiferimento, pgs); + } + + /** + * Creazione strategy ({@link EidasVFFirmaCompBuilder} e {@link EidasMarcaBuilder}) + * + * @param controlliAbilitati + * controlli abilitati recuperti a sistema + * @param isDataDiRiferimentoOnCompVers + * data di verifica (esplicitata su metadati o sysdate) + * @param modificatoriWSCalc + * modificatori ws (dipendono dalla versione) + * + * @return implementazione stratey effettivo + */ + protected abstract IEidasBuilderVFObj init(Map controlliAbilitati, + boolean isDataDiRiferimentoOnCompVers, Set modificatoriWSCalc); +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/factory/EidasVFFirmaCompBuilder.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/factory/EidasVFFirmaCompBuilder.java new file mode 100644 index 0000000..0959765 --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/factory/EidasVFFirmaCompBuilder.java @@ -0,0 +1,36 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.firma.strategy.eidas.factory; + +import java.util.Map; +import java.util.Set; + +import it.eng.parer.firma.strategy.eidas.EidasFirmaBuilder; +import it.eng.parer.firma.strategy.eidas.IEidasBuilderVFObj; +import it.eng.parer.firma.xml.VFFirmaCompType; +import it.eng.parer.ws.utils.Costanti.ModificatoriWS; + +public class EidasVFFirmaCompBuilder extends EidasAbsBuilderFactory { + + @Override + protected IEidasBuilderVFObj init(Map controlliAbilitati, + boolean isDataDiRiferimentoOnCompVers, Set modificatoriWSCalc) { + return new EidasFirmaBuilder(controlliAbilitati, isDataDiRiferimentoOnCompVers, modificatoriWSCalc); + } + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/factory/EidasVFMarcaCompBuilder.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/factory/EidasVFMarcaCompBuilder.java new file mode 100644 index 0000000..1b46cde --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/strategy/eidas/factory/EidasVFMarcaCompBuilder.java @@ -0,0 +1,36 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.firma.strategy.eidas.factory; + +import java.util.Map; +import java.util.Set; + +import it.eng.parer.firma.strategy.eidas.EidasMarcaBuilder; +import it.eng.parer.firma.strategy.eidas.IEidasBuilderVFObj; +import it.eng.parer.firma.xml.VFMarcaCompType; +import it.eng.parer.ws.utils.Costanti.ModificatoriWS; + +public class EidasVFMarcaCompBuilder extends EidasAbsBuilderFactory { + + @Override + protected IEidasBuilderVFObj init(Map controlliAbilitati, + boolean isDataDiRiferimentoOnCompVers, Set modificatoriWSCalc) { + return new EidasMarcaBuilder(controlliAbilitati); + } + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/util/CryptoErrorHandler.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/util/CryptoErrorHandler.java index 7ffabde..70ddda8 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/util/CryptoErrorHandler.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/util/CryptoErrorHandler.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.firma.util; import java.io.IOException; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/util/EidasErrorHandler.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/util/EidasErrorHandler.java index 5cdf909..065b028 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/util/EidasErrorHandler.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/util/EidasErrorHandler.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.firma.util; import java.io.IOException; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/util/EidasUtils.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/util/EidasUtils.java index a25a018..792c58b 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/util/EidasUtils.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/util/EidasUtils.java @@ -1,13 +1,29 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.firma.util; -import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.time.ZonedDateTime; import java.util.Arrays; import java.util.Date; import java.util.List; @@ -19,8 +35,6 @@ import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.xml.sax.SAXException; @@ -30,16 +44,12 @@ import eu.europa.esig.dss.diagnostic.DiagnosticDataXmlDefiner; import eu.europa.esig.dss.simplereport.SimpleReportFacade; import eu.europa.esig.dss.simplereport.SimpleReportXmlDefiner; -import it.eng.parer.eidas.model.DataToValidateDTOExt; -import it.eng.parer.eidas.model.EidasMetadataToValidate; +import it.eng.parer.eidas.model.EidasDataToValidateMetadata; import it.eng.parer.eidas.model.EidasWSReportsDTOTree; -import it.eng.parer.eidas.model.RemoteDocumentExt; -import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; -import it.eng.parer.exception.SacerWsRuntimeException; +import it.eng.parer.eidas.model.EidasRemoteDocument; import it.eng.parer.ws.utils.ParametroApplDB.ParametroApplFl; import it.eng.parer.ws.versamento.dto.ComponenteVers; import it.eng.parer.ws.versamento.dto.FileBinario; -import java.time.ZonedDateTime; /** * @@ -52,10 +62,9 @@ private EidasUtils() { } /** - * @deprecated * - * Compila l'input per la verifica firma tramite DSS. Utilizzata la versione /v2 in cui si utilizza - * multipart con stream da file. + * Compila l'input per la verifica firma tramite DSS. Utilizzata la versione /v2 in cui si utilizza multipart con + * stream da file. * * @param componenteVers * componente versato @@ -65,95 +74,44 @@ private EidasUtils() { * lista controlli abilitati (flag true/false) * @param dataDiRiferimento * data di riferimento - * @param verificaAllaDataDiFirma - * flag true/false per verifica alla data firma * @param uuid * UUID generato * * @return Bean utilizzato per invocare il servizio di verifica EIDAS. */ - @Deprecated - public static DataToValidateDTOExt buildEidasDtoFromCompVers(ComponenteVers componenteVers, - List sottoComponentiFirma, Map controlliAbilitati, Date dataDiRiferimento, - boolean verificaAllaDataDiFirma, String uuid) { - final boolean hasFirmeDetached = sottoComponentiFirma != null && !sottoComponentiFirma.isEmpty(); + public static EidasDataToValidateMetadata buildDataToValidateMetadataFromCompVers(ComponenteVers componenteVers, + List sottoComponentiFirma, Map controlliAbilitati, + ZonedDateTime dataDiRiferimento, String uuid) { + final boolean hasFirmeDetached = sottoComponentiFirma != null && !sottoComponentiFirma.isEmpty(); // if (!hasFirmeDetached) { /* * Firma non detached : il file firmato è su componente */ FileBinario signedFB = componenteVers.getRifFileBinario(); - return buildDocuments(controlliAbilitati, verificaAllaDataDiFirma, dataDiRiferimento, - signedFB.getFileName(), componenteVers.getId(), signedFB.getFileSuDisco(), uuid); + return buildDocuments(controlliAbilitati, dataDiRiferimento, signedFB, componenteVers.getId(), uuid); } else { /* * Firma detached : il file firmato è su sottocomponente */ FileBinario signedFB = sottoComponentiFirma.get(0).getRifFileBinario(); FileBinario originalFB = componenteVers.getRifFileBinario(); - return buildDocuments(controlliAbilitati, verificaAllaDataDiFirma, dataDiRiferimento, - signedFB.getFileName(), componenteVers.getId(), signedFB.getFileSuDisco(), true, - originalFB.getFileName(), sottoComponentiFirma.get(0).getId(), originalFB.getFileSuDisco(), uuid); - } - } - - /** - * @deprecated - * - * Compila l'input per la verifica firma tramite DSS. Utilizzata la versione /v2 in cui si utilizza - * multipart con stream da file. - * - * @param signedDoc - * documento firma - * @param firme - * lista file firmati - * @param marche - * lista file di tipo marche - * @param controlliAbilitati - * lista controlli abilitati (flag true/false) - * @param verificaAllaDataDiFirma - * flag true/false per verifica alla data firma - * @param dataDiRiferimento - * data di riferimento - * @param uuid - * UUID generato - * @param idComponente - * ID componente firmato - * @param idSottoComponente - * ID sotto componente firmato - * - * @return Bean utilizzato per invocare il servizio di verifica EIDAS. - */ - @Deprecated - public static DataToValidateDTOExt buildEidasDtoFromFiles(File signedDoc, List firme, List marche, - Map controlliAbilitati, boolean verificaAllaDataDiFirma, Date dataDiRiferimento, - String uuid, String idComponente, String idSottoComponente) { - final boolean hasFirmeDetached = firme != null && !firme.isEmpty(); - - if (!hasFirmeDetached) { - return buildDocuments(controlliAbilitati, verificaAllaDataDiFirma, dataDiRiferimento, signedDoc.getName(), - idComponente, signedDoc, uuid); - } else { - File originalDoc = firme.get(0); - return buildDocuments(controlliAbilitati, verificaAllaDataDiFirma, dataDiRiferimento, signedDoc.getName(), - idComponente, signedDoc, true, idSottoComponente, originalDoc.getName(), originalDoc, uuid); + return buildDocuments(controlliAbilitati, dataDiRiferimento, signedFB, componenteVers.getId(), true, + originalFB, sottoComponentiFirma.get(0).getId(), uuid); } } - private static DataToValidateDTOExt buildDocuments(Map controlliAbilitati, - boolean verificaAllaDataDiFirma, Date dataDiRiferimento, String fileName, String idComponente, - File signedDoc, String uuid) { - return buildDocuments(controlliAbilitati, verificaAllaDataDiFirma, dataDiRiferimento, fileName, idComponente, - signedDoc, false, null, null, null, uuid); + private static EidasDataToValidateMetadata buildDocuments(Map controlliAbilitati, + ZonedDateTime dataDiRiferimento, FileBinario signedDoc, String idComponente, String uuid) { + return buildDocuments(controlliAbilitati, dataDiRiferimento, signedDoc, idComponente, false, null, null, uuid); } - private static DataToValidateDTOExt buildDocuments(Map controlliAbilitati, - boolean verificaAllaDataDiFirma, Date dataDiRiferimento, String signedDocFileName, String idComponente, - File signedDoc, boolean hasFirmeDetached, String originalDocFileName, String idSottoComponente, - File originalDoc, String uuid) { + private static EidasDataToValidateMetadata buildDocuments(Map controlliAbilitati, + ZonedDateTime dataDiRiferimento, FileBinario signedDoc, String idComponente, boolean hasFirmeDetached, + FileBinario originalDoc, String idSottoComponente, String uuid) { - DataToValidateDTOExt input = new DataToValidateDTOExt(); + EidasDataToValidateMetadata input = new EidasDataToValidateMetadata(); boolean controlloCrittogaficoAbilitato = controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_CRITTOG_VERS); boolean controlloCatenaTrustAbilitato = controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_TRUST_VERS); @@ -164,105 +122,37 @@ private static DataToValidateDTOExt buildDocuments(Map controll input.setControlloCertificatoIgnorato(!controlloCertificatoAbilitato); input.setControlloRevocaIgnorato(!controlloRevocaAbilitato); - if (!hasFirmeDetached) { - // signed - RemoteDocumentExt signedDocument = new RemoteDocumentExt(); - signedDocument.setName(StringUtils.defaultString(signedDocFileName, signedDoc.getName())); - signedDocument.setBytes(toByteArray(signedDoc)); - input.setSignedDocumentExt(signedDocument); - // id componente firmato - input.setIdComponente(idComponente); - } else { - RemoteDocumentExt originalDocument = new RemoteDocumentExt(); - originalDocument.setName(StringUtils.defaultString(originalDocFileName, originalDoc.getName())); - originalDocument.setBytes(toByteArray(originalDoc)); - input.setOriginalDocumentsExt(Arrays.asList(originalDocument)); - // signed - RemoteDocumentExt signedDocument = new RemoteDocumentExt(); - signedDocument.setName(StringUtils.defaultString(signedDocFileName, signedDoc.getName())); - signedDocument.setBytes(toByteArray(signedDoc)); - input.setSignedDocumentExt(signedDocument); - // id componente firmato - input.setIdComponente(idSottoComponente); + // no raw + boolean includeValues = controlliAbilitati.get(ParametroApplFl.FL_EIDAS_INCLUDI_FILEBASE64); + input.setIncludeCertificateRevocationValues(includeValues); + input.setIncludeCertificateTokenValues(includeValues); + input.setIncludeTimestampTokenValues(includeValues); + // id componente firmato + input.setDocumentId(hasFirmeDetached ? idSottoComponente : idComponente); + + // signed + EidasRemoteDocument eidasRemoteDocument = new EidasRemoteDocument(); + eidasRemoteDocument.setName(signedDoc.getFileName()); + if (signedDoc.getObjectStorageResource() != null) { + eidasRemoteDocument.setUri(signedDoc.getObjectStorageResource().getPresignedURL()); } - // - input.setUuid(uuid); - // - input.setVerificaAllaDataDiFirma(verificaAllaDataDiFirma); - // - input.setDataDiRiferimento(dataDiRiferimento); + input.setRemoteSignedDocument(eidasRemoteDocument); - return input; - } - - public static EidasMetadataToValidate buildEidasMetadata(ComponenteVers componenteVers, - List sottoComponentiFirma, Map controlliAbilitati, - boolean verificaAllaDataDiFirma, ZonedDateTime dataDiRiferimento, String uuid) { - - final boolean hasFirmeDetached = sottoComponentiFirma != null && !sottoComponentiFirma.isEmpty(); - - if (!hasFirmeDetached) { - return buildEidasMetadata(controlliAbilitati, verificaAllaDataDiFirma, dataDiRiferimento, - componenteVers.getId(), componenteVers.getRifFileBinario().getFileName(), StringUtils.EMPTY, uuid); - } else { - return buildEidasMetadata(controlliAbilitati, verificaAllaDataDiFirma, dataDiRiferimento, - sottoComponentiFirma.get(0).getId(), sottoComponentiFirma.get(0).getRifFileBinario().getFileName(), - componenteVers.getRifFileBinario().getFileName(), uuid); + if (hasFirmeDetached) { + EidasRemoteDocument eidasRemoteDocumentOrig = new EidasRemoteDocument(); + eidasRemoteDocumentOrig.setName(originalDoc.getFileName()); + if (originalDoc.getObjectStorageResource() != null) { + eidasRemoteDocumentOrig.setUri(originalDoc.getObjectStorageResource().getPresignedURL()); + } + input.setRemoteOriginalDocuments(Arrays.asList(eidasRemoteDocumentOrig)); } - - } - - private static EidasMetadataToValidate buildEidasMetadata(Map controlliAbilitati, - boolean verificaAllaDataDiFirma, ZonedDateTime dataDiRiferimento, String idDocuments, - String signedDocumentName, String originalDocumentName, String uuid) { - - EidasMetadataToValidate input = new EidasMetadataToValidate(); - - // control flag - boolean controlloCrittogaficoAbilitato = controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_CRITTOG_VERS); - boolean controlloCatenaTrustAbilitato = controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_TRUST_VERS); - boolean controlloCertificatoAbilitato = controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_CERTIF_VERS); - boolean controlloRevocaAbilitato = controlliAbilitati.get(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS); - - input.setControlloCrittograficoIgnorato(!controlloCrittogaficoAbilitato); - input.setControlloCatenaTrustIgnorato(!controlloCatenaTrustAbilitato); - input.setControlloCertificatoIgnorato(!controlloCertificatoAbilitato); - input.setControlloRevocaIgnorato(!controlloRevocaAbilitato); - // uuid + // input.setUuid(uuid); - // verificaAllaDataDiFirma - input.setVerificaAllaDataDiFirma(verificaAllaDataDiFirma); - // dataDiRiferimento - if (dataDiRiferimento != null) { - input.setDataDiRiferimento(Date.from(dataDiRiferimento.toInstant())); - } + input.setDataDiRiferimento(Date.from(dataDiRiferimento.toInstant())); - // id componente / sotto componente - input.setIdDocuments(idDocuments); - // signed document name - input.setSignedDocumentName(signedDocumentName); - // original document name - /* - * nota: attenzione questo meccanismo è posizionale ossia, fa il "paio" con l'array di file originali passati - * nel body del multipart (parametro "originalFiles") e.g. pos = 0 file0.ext / originalFiles 0 pos = 1 file1.ext - * / originalFiles 1 - */ - input.setOriginalDocumentNames(new String[] { originalDocumentName }); return input; } - private static byte[] toByteArray(File file) { - if (file == null) { - return ArrayUtils.EMPTY_BYTE_ARRAY; - } - try (FileInputStream fis = new FileInputStream(file)) { - return IOUtils.toByteArray(fis); - - } catch (IOException e) { - throw new SacerWsRuntimeException(e, SacerWsErrorCategory.INTERNAL_ERROR); - } - } - // tree no binaries /** * @deprecated @@ -345,8 +235,6 @@ private static void removeraw(EidasWSReportsDTOTree dto) { // set null on chain s.getCertificateChain().forEach(c -> c.getCertificate().setBase64Encoded(StringUtils.EMPTY.getBytes())); }); - // extensions - dto.setExtensions(null); } /* diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/util/VerificaFirmaEnums.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/util/VerificaFirmaEnums.java index bfc6920..7dc0b60 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/util/VerificaFirmaEnums.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/util/VerificaFirmaEnums.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -13,31 +30,19 @@ */ public class VerificaFirmaEnums { - public enum EsitoControllo { + public enum SacerIndication { - POSITIVO("Controllo OK"), NEGATIVO("Controllo fallito"), WARNING("Controllo con Warning"), /**/ - NON_ESEGUITO("Non eseguito perchè il formato non è conforme"), FORMATO_NON_CONOSCIUTO, /**/ - FORMATO_NON_CONFORME, NON_AMMESSO_DELIB_45_CNIPA, DISABILITATO("Il controllo è disabilitato"), /**/ - NON_NECESSARIO("Il controllo non è necessario", - "Il controllo non è necessario in quanto avviene tramite OCSP"), /**/ - ERRORE("Controllo non svolto per errore del sistema"), /**/ - CERTIFICATO_ERRATO("Il certificato non è un certificato di firma", - "Errore sul controllo delle revoche del certificato, informazioni non scaricabili o non affidabili"), /**/ - CERTIFICATO_NON_VALIDO("Il certificato non è ancora valido", - "Il certificato non presenta alcuni degli attributi previsti dallo standard ('signing-certificate', 'cert-diget', ecc.)"), /**/ - CERTIFICATO_REVOCATO("Il certificato è stato revocato o sospeso"), /**/ - CERTIFICATO_SCADUTO("Il certificato è scaduto"), /**/ + POSITIVO("Controllo OK"), NEGATIVO("Controllo fallito"), WARNING("Controllo con Warning"), + NON_ESEGUITO("Non eseguito perchè il formato non è conforme"), FORMATO_NON_CONOSCIUTO("Formato non conosciuto"), + FORMATO_NON_CONFORME("Formato non conforme"), NON_AMMESSO_DELIB_45_CNIPA("Non ammetto delib45 cnipa"), + DISABILITATO("Il controllo è disabilitato"), NON_NECESSARIO("Il controllo non è necessario"), + ERRORE("Controllo non svolto per errore del sistema"), CERTIFICATO_ERRATO("Errore su certificato"), + CERTIFICATO_NON_VALIDO("Errore validità del certificato"), + CERTIFICATO_REVOCATO("Il certificato è stato revocato o sospeso"), + CERTIFICATO_SCADUTO("Il certificato è scaduto"), CERTIFICATO_SCADUTO_3_12_2009( "Il controllo non è svolto perché la CRL non è disponibile ed il certificato è scaduto prima del 3/12/2009"), /**/ - CRL_NON_SCARICABILE("Il controllo non è svolto perché la CRL non è scaricabile dal server", - "CRL non scaricabile dal server perché il controllo sulla revoca avviene tramite OCSP"), /* - * esiste anche - * un messaggio - * alternativo - * derivante - * dal caso - * OCSP - */ + CRL_NON_SCARICABILE("Il controllo non è svolto perché la CRL non è scaricabile dal server"), CRL_NON_VALIDA("Il controllo non è svolto perché la CRL non è valida"), /**/ CRL_SCADUTA("Il controllo non è svolto perché la CRL scaricata è scaduta"), SCONOSCIUTO, /**/ OCSP_NON_SCARICABILE("Il controllo non è svolto perché la risposta OCSP non è scaricabile dal server"), /**/ @@ -49,25 +54,19 @@ FORMATO_NON_CONFORME, NON_AMMESSO_DELIB_45_CNIPA, DISABILITATO("Il controllo è "Errore sul controllo delle revoche del certificato, informazioni non scaricabili o non affidabili"); private final String message; - private final String[] alternative; - private EsitoControllo() { + private SacerIndication() { this.message = null; - this.alternative = null; } - private EsitoControllo(final String message, final String... alternative) { + private SacerIndication(final String message) { this.message = message; - this.alternative = alternative; } public String message() { return this.message; } - public String[] alternative() { - return this.alternative != null && alternative.length > 0 ? alternative : new String[] { this.message }; - } } public enum TipoRifTemporale { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/util/VerificaFirmaWrapperVersamentoUtil.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/util/VerificaFirmaWrapperVersamentoUtil.java index 398909a..c7238a4 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/util/VerificaFirmaWrapperVersamentoUtil.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/util/VerificaFirmaWrapperVersamentoUtil.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -11,7 +28,7 @@ import org.slf4j.LoggerFactory; import it.eng.parer.firma.dto.StatoComponente; -import it.eng.parer.firma.util.VerificaFirmaEnums.EsitoControllo; +import it.eng.parer.firma.util.VerificaFirmaEnums.SacerIndication; import it.eng.parer.firma.xml.VFContrFirmaCompType; import it.eng.parer.firma.xml.VFContrMarcaCompType; import it.eng.parer.firma.xml.VFFirmaCompType; @@ -121,7 +138,7 @@ private static void buildECMarcaType(AbsVersamentoExt versamento, ComponenteVers tmpMarcaResp.getEsitoMarca().setDettaglioControlloConformita(marcaCompType.getDsMsgEsitoContrConforme()); scriviDettagliContrMarca = true; } - if (esitoContrConf.equals(EsitoControllo.POSITIVO.name())) { + if (esitoContrConf.equals(SacerIndication.POSITIVO.name())) { tmpMarcaResp.getEsitoMarca().setControlloConformita(ECEsitoControlloType.POSITIVO); // Se l'esito è positivo imposto il tag di VerificaMarca @@ -141,7 +158,7 @@ private static void buildECMarcaType(AbsVersamentoExt versamento, ComponenteVers tmpMarcaResp.getEsitoMarca().getVerificaMarca() .setDettaglioControlloCrittografico(messaggioEsitoCMarca); } - if (!tmpTiEsitoControlloMarca.equals(EsitoControllo.POSITIVO.name())) { + if (!tmpTiEsitoControlloMarca.equals(SacerIndication.POSITIVO.name())) { statoComponente.ctrlMarcheCrittNegativo = true; // memorizzo l'anomalia relativa alla marca del componente. alla fine del ciclo // firme-marche aggiungerò un warning @@ -153,7 +170,7 @@ private static void buildECMarcaType(AbsVersamentoExt versamento, ComponenteVers tmpMarcaResp.getEsitoMarca().getVerificaMarca() .setDettaglioControlloCatenaTrusted(messaggioEsitoCMarca); } - if (!tmpTiEsitoControlloMarca.equals(EsitoControllo.POSITIVO.name())) { + if (!tmpTiEsitoControlloMarca.equals(SacerIndication.POSITIVO.name())) { statoComponente.ctrlMarcheCatenaNegativo = true; // memorizzo l'anomalia relativa alla marca del componente. alla fine del ciclo // firme-marche aggiungerò un warning @@ -165,7 +182,7 @@ private static void buildECMarcaType(AbsVersamentoExt versamento, ComponenteVers tmpMarcaResp.getEsitoMarca().getVerificaMarca() .setDettaglioControlloCertificato(messaggioEsitoCMarca); } - if (!tmpTiEsitoControlloMarca.equals(EsitoControllo.POSITIVO.name())) { + if (!tmpTiEsitoControlloMarca.equals(SacerIndication.POSITIVO.name())) { statoComponente.ctrlMarcheCertificatoNegativo = true; // memorizzo l'anomalia relativa alla marca del componente. alla fine del ciclo // firme-marche aggiungerò un warning @@ -176,8 +193,8 @@ private static void buildECMarcaType(AbsVersamentoExt versamento, ComponenteVers if (scriviDettagliContrMarca) { tmpMarcaResp.getEsitoMarca().getVerificaMarca().setDettaglioControlloCRL(messaggioEsitoCMarca); } - if (!tmpTiEsitoControlloMarca.equals(EsitoControllo.POSITIVO.name()) - && !tmpTiEsitoControlloMarca.equals(EsitoControllo.NON_NECESSARIO.name())) { + if (!tmpTiEsitoControlloMarca.equals(SacerIndication.POSITIVO.name()) + && !tmpTiEsitoControlloMarca.equals(SacerIndication.NON_NECESSARIO.name())) { statoComponente.ctrlMarcheCrlNegativo = true; // memorizzo l'anomalia relativa alla marca del componente. alla fine del ciclo // firme-marche aggiungerò un warning @@ -190,8 +207,8 @@ private static void buildECMarcaType(AbsVersamentoExt versamento, ComponenteVers if (scriviDettagliContrMarca) { tmpMarcaResp.getEsitoMarca().getVerificaMarca().setDettaglioControlloOCSP(messaggioEsitoCMarca); } - if (!tmpTiEsitoControlloMarca.equals(EsitoControllo.OCSP_VALIDO.name()) - && !tmpTiEsitoControlloMarca.equals(EsitoControllo.NON_NECESSARIO.name())) { + if (!tmpTiEsitoControlloMarca.equals(SacerIndication.OCSP_VALIDO.name()) + && !tmpTiEsitoControlloMarca.equals(SacerIndication.NON_NECESSARIO.name())) { statoComponente.ctrlMarcheOcspNegativo = true; // memorizzo l'anomalia relativa alla marca del componente. alla fine del ciclo // firme-marche aggiungerò un warning @@ -200,7 +217,7 @@ private static void buildECMarcaType(AbsVersamentoExt versamento, ComponenteVers } // Quindi valorizzo VerificaMarca.CodiceEsito - if (marcaCompType.getTiEsitoVerifMarca().equals(EsitoControllo.POSITIVO.name())) { + if (marcaCompType.getTiEsitoVerifMarca().equals(SacerIndication.POSITIVO.name())) { tmpMarcaResp.getEsitoMarca().getVerificaMarca().setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); } else { tmpMarcaResp.getEsitoMarca().getVerificaMarca().setCodiceEsito(ECEsitoPosNegWarType.WARNING); @@ -254,20 +271,20 @@ private static void buildECFirmatarioType(AbsVersamentoExt versamento, Component // ControlloConformità String esitoContrConf = firmaCompType.getTiEsitoContrConforme(); - if (esitoContrConf.equals(EsitoControllo.FORMATO_NON_CONOSCIUTO.name())) { + if (esitoContrConf.equals(SacerIndication.FORMATO_NON_CONOSCIUTO.name())) { tmpFirmatarioResp.getEsitoFirma().setControlloConformita(ECEsitoControlloType.FORMATO_NON_CONOSCIUTO); firmaVerificabile = false; // nota bene: SOLO in questo caso, viene considerato come NON FIRMATO statoComponente.ctrlConfFirmeHasFormatoNonConosciuto = true; // memorizzo l'anomalia relativa alla firma del componente. // alla fine del ciclo firme-marche aggiungerò un warning o un errore in // funzione di forzature varie - } else if (esitoContrConf.equals(EsitoControllo.FORMATO_NON_CONFORME.name())) { + } else if (esitoContrConf.equals(SacerIndication.FORMATO_NON_CONFORME.name())) { tmpFirmatarioResp.getEsitoFirma().setControlloConformita(ECEsitoControlloType.FORMATO_NON_CONFORME); statoComponente.ctrlConfFirmeHasFormatoNonConforme = true; // memorizzo l'anomalia relativa alla firma del componente. // alla fine del ciclo firme-marche aggiungerò un warning o un errore in // funzione di forzature varie - } else if (esitoContrConf.equals(EsitoControllo.NON_AMMESSO_DELIB_45_CNIPA.name())) { + } else if (esitoContrConf.equals(SacerIndication.NON_AMMESSO_DELIB_45_CNIPA.name())) { tmpFirmatarioResp.getEsitoFirma().setControlloConformita(ECEsitoControlloType.NON_AMMESSO_DELIB_45_CNIPA); statoComponente.ctrlConfFirmeHasNonAmmessoDelib45 = true; // memorizzo l'anomalia relativa alla firma del componente. @@ -303,7 +320,7 @@ private static void buildECFirmatarioType(AbsVersamentoExt versamento, Component esitoControlloFirma = contrFirmaCompType.getTiEsitoContrFirma(); messaggioEsitoCFirma = contrFirmaCompType.getDsMsgEsitoContrFirma(); - final boolean esitoControlloPositivo = esitoControlloFirma.equals(EsitoControllo.POSITIVO.name()); + final boolean esitoControlloPositivo = esitoControlloFirma.equals(SacerIndication.POSITIVO.name()); if (contrFirmaCompType.getTiContr().name().equals(VFTipoControlloType.CRITTOGRAFICO.name())) { // imposto il valore e l'eventuale messaggio di dettaglio nell'esito @@ -316,16 +333,16 @@ private static void buildECFirmatarioType(AbsVersamentoExt versamento, Component // valuto gli esiti negativi o warning if (!esitoControlloPositivo) { // verifico lo stato: - if (esitoControlloFirma.equals(EsitoControllo.NON_ESEGUITO.name())) { + if (esitoControlloFirma.equals(SacerIndication.NON_ESEGUITO.name())) { // se non eseguito la firma è in warn e aggiungo il warn alla lista statoComponente.ctrlFirmeCrittWarning = true; firmaWarn = true; - } else if (esitoControlloFirma.equals(EsitoControllo.ERRORE.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.ERRORE.name())) { // se è andato in errore, la firma è in err, il componente è in err e aggiungo // l'errore alla lista statoComponente.ctrlFirmeCrittErrore = true; firmaErr = true; - } else if (esitoControlloFirma.equals(EsitoControllo.NEGATIVO.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.NEGATIVO.name())) { statoComponente.ctrlFirmeCrittNegativo = true; firmaErr = true; } else { @@ -343,16 +360,16 @@ private static void buildECFirmatarioType(AbsVersamentoExt versamento, Component // valuto gli esiti negativi o warning if (!esitoControlloPositivo) { // verifico lo stato: - if (esitoControlloFirma.equals(EsitoControllo.NON_ESEGUITO.name())) { + if (esitoControlloFirma.equals(SacerIndication.NON_ESEGUITO.name())) { // se non eseguito la firma è in warn e aggiungo il warn alla lista statoComponente.ctrlFirmeCatenaWarning = true; firmaWarn = true; - } else if (esitoControlloFirma.equals(EsitoControllo.ERRORE.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.ERRORE.name())) { // se è andato in errore, la firma è in err, il componente è in err e aggiungo // l'errore alla lista statoComponente.ctrlFirmeCatenaErrore = true; firmaErr = true; - } else if (esitoControlloFirma.equals(EsitoControllo.NEGATIVO.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.NEGATIVO.name())) { statoComponente.ctrlFirmeCatenaNegativo = true; firmaErr = true; } else { @@ -370,23 +387,24 @@ private static void buildECFirmatarioType(AbsVersamentoExt versamento, Component // valuto gli esiti negativi o warning if (!esitoControlloPositivo) { // verifico lo stato: - if (esitoControlloFirma.equals(EsitoControllo.NON_ESEGUITO.name())) { + if (esitoControlloFirma.equals(SacerIndication.NON_ESEGUITO.name())) { // se non eseguito la firma è in warn e aggiungo il warn alla lista statoComponente.ctrlFirmeCertificatoWarning = true; firmaWarn = true; - } else if (esitoControlloFirma.equals(EsitoControllo.ERRORE.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.ERRORE.name())) { // se è andato in errore, la firma è in err, il componente è in err e aggiungo // l'errore alla lista statoComponente.ctrlFirmeCertificatoErrore = true; firmaErr = true; - } else if (esitoControlloFirma.equals(EsitoControllo.CERTIFICATO_SCADUTO.name()) - || esitoControlloFirma.equals(EsitoControllo.REVOCHE_NON_CONSISTENTI.name())) { - statoComponente.ctrlFirmeCertificatoScad = true; + } else if (esitoControlloFirma.equals(SacerIndication.CERTIFICATO_SCADUTO.name()) + || esitoControlloFirma.equals(SacerIndication.REVOCHE_NON_CONSISTENTI.name()) + || esitoControlloFirma.equals(SacerIndication.CERTIFICATO_REVOCATO.name())) { + statoComponente.ctrlFirmeCertificatoScadRev = true; firmaErr = true; - } else if (esitoControlloFirma.equals(EsitoControllo.CERTIFICATO_NON_VALIDO.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.CERTIFICATO_NON_VALIDO.name())) { statoComponente.ctrlFirmeCertificatoNoValid = true; firmaErr = true; - } else if (esitoControlloFirma.equals(EsitoControllo.CERTIFICATO_ERRATO.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.CERTIFICATO_ERRATO.name())) { statoComponente.ctrlFirmeCertificatoErrato = true; firmaErr = true; } else { @@ -404,23 +422,23 @@ private static void buildECFirmatarioType(AbsVersamentoExt versamento, Component // valuto gli esiti negativi o warning if (!esitoControlloPositivo) { // verifico lo stato: - if (esitoControlloFirma.equals(EsitoControllo.NON_ESEGUITO.name()) - || esitoControlloFirma.equals(EsitoControllo.CERTIFICATO_SCADUTO_3_12_2009.name())) { + if (esitoControlloFirma.equals(SacerIndication.NON_ESEGUITO.name()) + || esitoControlloFirma.equals(SacerIndication.CERTIFICATO_SCADUTO_3_12_2009.name())) { statoComponente.ctrlFirmeCRLWarning = true; firmaWarn = true; - } else if (esitoControlloFirma.equals(EsitoControllo.ERRORE.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.ERRORE.name())) { statoComponente.ctrlFirmeCRLErrore = true; firmaErr = true; - } else if (esitoControlloFirma.equals(EsitoControllo.CERTIFICATO_REVOCATO.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.CERTIFICATO_REVOCATO.name())) { statoComponente.ctrlFirmeCRLCertRev = true; firmaErr = true; - } else if (esitoControlloFirma.equals(EsitoControllo.CRL_SCADUTA.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.CRL_SCADUTA.name())) { statoComponente.ctrlFirmeCRLScad = true; firmaErr = true; - } else if (esitoControlloFirma.equals(EsitoControllo.CRL_NON_VALIDA.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.CRL_NON_VALIDA.name())) { statoComponente.ctrlFirmeCRLNoValid = true; firmaErr = true; - } else if (esitoControlloFirma.equals(EsitoControllo.CRL_NON_SCARICABILE.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.CRL_NON_SCARICABILE.name())) { statoComponente.ctrlFirmeCRLNoScaric = true; firmaErr = true; } else { @@ -440,17 +458,17 @@ private static void buildECFirmatarioType(AbsVersamentoExt versamento, Component // valuto gli esiti negativi o warning if (!esitoControlloPositivo) { // verifico lo stato: - if (esitoControlloFirma.equals(EsitoControllo.NON_ESEGUITO.name()) - || esitoControlloFirma.equals(EsitoControllo.OCSP_NON_AGGIORNATO.name())) { + if (esitoControlloFirma.equals(SacerIndication.NON_ESEGUITO.name()) + || esitoControlloFirma.equals(SacerIndication.OCSP_NON_AGGIORNATO.name())) { statoComponente.ctrlFirmeOCSPWarning = true; firmaWarn = true; - } else if (esitoControlloFirma.equals(EsitoControllo.OCSP_SCONOSCIUTO.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.OCSP_SCONOSCIUTO.name())) { statoComponente.ctrlFirmeOCSPNoValid = true; firmaErr = true; - } else if (esitoControlloFirma.equals(EsitoControllo.OCSP_REVOCATO.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.OCSP_REVOCATO.name())) { statoComponente.ctrlFirmeOCSPRev = true; firmaErr = true; - } else if (esitoControlloFirma.equals(EsitoControllo.OCSP_NON_SCARICABILE.name())) { + } else if (esitoControlloFirma.equals(SacerIndication.OCSP_NON_SCARICABILE.name())) { statoComponente.ctrlFirmeOCSPNoScaric = true; firmaErr = true; } else { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/util/Constants.java b/sacerws-ejb/src/main/java/it/eng/parer/util/Constants.java index 2dc3d7d..8de1732 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/util/Constants.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/util/Constants.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -10,31 +27,10 @@ */ public class Constants { - public final static int PASSWORD_EXPIRATION_DAYS = 90; - public final static String SACER = "SACER"; - public final static String SACERWS = "SACERWS"; - // Constants for Transformer - public final static String ENTITY_PACKAGE_NAME = "it.eng.parer.entity"; - public final static String GRANTED_ENTITY_PACKAGE_NAME = "it.eng.parer.grantedEntity"; - public final static String VIEWENTITY_PACKAGE_NAME = "it.eng.parer.viewEntity"; - public final static String GRANTED_VIEWENTITY_PACKAGE_NAME = "it.eng.parer.grantedViewEntity"; - public final static String ROWBEAN_PACKAGE_NAME = "it.eng.parer.slite.gen.tablebean"; - public final static String VIEWROWBEAN_PACKAGE_NAME = "it.eng.parer.slite.gen.viewbean"; - // Costanti per lista "Totale Definito Da" nella gestione dei dati specifici - public final static String TI_UNI_DOC = "Tipo unità doc."; - public final static String TI_DOC = "Tipo doc."; - public final static String TI_SIS_MIGR_UD = "Migraz. unità doc."; - public final static String TI_SIS_MIGR_DOC = "Migraz. doc."; - // Costanti per dati specifici - public final static String TI_USO_XSD_VERS = "VERS"; - public final static String TI_USO_XSD_MIGR = "MIGRAZ"; - - // Formato data/ora - public static final String DATE_FORMAT_TIMESTAMP_TYPE = "dd/MM/yyyy HH:mm:ss"; - public static final String DATE_FORMAT_DATE_TYPE = "dd/MM/yyyy"; - public static final String DATE_FORMAT_HOUR_MINUTE_TYPE = "dd/MM/yyyy HH:mm"; - public static final String DATE_FORMAT_DAY_MONTH_TYPE = "dd/MM"; - public static final String DATE_FORMAT_DATE_COMPACT_TYPE = "dd/MM/yy"; + public static final String SACERWS = "SACERWS"; + public static final String JAVAX_PERSISTENCE_LOCK_TIMEOUT = "javax.persistence.lock.timeout"; + public static final String FLAG_TRUE = "1"; + public static final String FLAG_FALSE = "0"; // Enum per tipo sessione public enum TipoSessione { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/util/DateUtilsConverter.java b/sacerws-ejb/src/main/java/it/eng/parer/util/DateUtilsConverter.java index d155d0c..ae27ee0 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/util/DateUtilsConverter.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/util/DateUtilsConverter.java @@ -1,5 +1,23 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.util; +import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; @@ -33,6 +51,22 @@ public static Date convert(ZonedDateTime zdt) { return null; } + /** + * Conversione della data espressa con il fuso orario in data locale. + * + * @param zdt + * data in input + * + * @return oggetto java.time.LocalDate oppure null + */ + public static LocalDate convertLocal(ZonedDateTime zdt) { + LocalDate localDate = null; + if (zdt != null) { + return zdt.toLocalDate(); + } + return localDate; + } + /** * Conversione della data locale ad una data con fuso orario. * diff --git a/sacerws-ejb/src/main/java/it/eng/parer/util/FlagUtilsConverter.java b/sacerws-ejb/src/main/java/it/eng/parer/util/FlagUtilsConverter.java new file mode 100644 index 0000000..94798fe --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/util/FlagUtilsConverter.java @@ -0,0 +1,33 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.util; + +import static it.eng.parer.util.Constants.FLAG_FALSE; +import static it.eng.parer.util.Constants.FLAG_TRUE; + +public class FlagUtilsConverter { + + private FlagUtilsConverter() { + throw new IllegalStateException("Classe di utility"); + } + + public static String booleanToFlag(Boolean b) { + return Boolean.TRUE.equals(b) ? FLAG_TRUE : FLAG_FALSE; + } + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/util/ejb/AppServerInstance.java b/sacerws-ejb/src/main/java/it/eng/parer/util/ejb/AppServerInstance.java index 7a60c9a..ff04cc8 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/util/ejb/AppServerInstance.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/util/ejb/AppServerInstance.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.util.ejb; import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; @@ -39,6 +56,7 @@ public class AppServerInstance { private static final Logger LOG = LoggerFactory.getLogger(AppServerInstance.class); String servername = null; + @SuppressWarnings("unchecked") @PostConstruct protected void initSingleton() { try { @@ -102,8 +120,8 @@ private InetAddress getMyHostAddress() throws UnknownHostException { for (Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); ifaces.hasMoreElements();) { NetworkInterface iface = (NetworkInterface) ifaces.nextElement(); // Scorri su tutti gli indirizzi IP associati ad una scheda di rete - for (Enumeration inetAddrs = iface.getInetAddresses(); inetAddrs.hasMoreElements();) { - InetAddress inetAddr = (InetAddress) inetAddrs.nextElement(); + for (Enumeration inetAddrs = iface.getInetAddresses(); inetAddrs.hasMoreElements();) { + InetAddress inetAddr = inetAddrs.nextElement(); LOG.debug("Verifico l'indirizzo {}", inetAddr.getHostAddress()); AddressTypes tipo = decodeAddrType(inetAddr); // se è già presente un indirizzo di questo tipo (per esempio se diff --git a/sacerws-ejb/src/main/java/it/eng/parer/util/ejb/help/ConfigurationHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/util/ejb/help/ConfigurationHelper.java index 087edd4..6b25a7c 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/util/ejb/help/ConfigurationHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/util/ejb/help/ConfigurationHelper.java @@ -1,10 +1,33 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.util.ejb.help; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; +import it.eng.parer.entity.AplParamApplic; +import it.eng.parer.entity.constraint.AplValoreParamApplic.TiAppart; +import it.eng.parer.exception.ParamApplicNotFoundException; +import it.eng.parer.util.ejb.help.dto.AplVGetValParamDto; +import it.eng.parer.ws.utils.FlagConverter; +import it.eng.parer.ws.utils.ParametroApplDB; +import it.eng.parer.ws.utils.ParametroApplDB.TipoAplVGetValAppart; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.StringSubstitutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.ejb.EJB; import javax.ejb.LocalBean; @@ -13,20 +36,13 @@ import javax.persistence.PersistenceContext; import javax.persistence.Query; import javax.persistence.TypedQuery; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.text.StrSubstitutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import it.eng.parer.entity.AplParamApplic; -import it.eng.parer.entity.constraint.AplValoreParamApplic.TiAppart; -import it.eng.parer.exception.ParamApplicNotFoundException; -import it.eng.parer.util.ejb.help.dto.AplVGetValParamDto; -import it.eng.parer.ws.utils.FlagConverter; -import it.eng.parer.ws.utils.ParametroApplDB; -import it.eng.parer.ws.utils.ParametroApplDB.TipoAplVGetValAppart; - +@SuppressWarnings("unchecked") @Stateless @LocalBean public class ConfigurationHelper { @@ -46,33 +62,87 @@ public Map getConfiguration() { String queryStr = "SELECT config FROM AplParamApplic config"; // CREO LA QUERY ATTRAVERSO L'ENTITY MANAGER Query query = entityManager.createQuery(queryStr); - List configurazioni = query.getResultList(); - Map config = new HashMap(); + Map config = new HashMap<>(); for (AplParamApplic configurazione : configurazioni) { - config.put(configurazione.getNmParamApplic(), me.getParamApplicValue(configurazione.getNmParamApplic())); + config.put(configurazione.getNmParamApplic(), + me.getValoreParamApplicByApplic(configurazione.getNmParamApplic())); } return config; } - public String getParamApplicValue(String nmParamApplic) { + /** + * Ottieni il valore del parametro indicato dal codice in input. Il valore viene ottenuto filtrando per tipologia + * APPLIC {@link TipoAplVGetValAppart#APPLIC} + * + * @param nmParamApplic + * codice del parametro + * + * @return valore del parametro filtrato per tipologia APPLIC . + */ + public String getValoreParamApplicByApplic(String nmParamApplic) { return getParamApplicValue(nmParamApplic, Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE, TipoAplVGetValAppart.APPLIC); } - public String getParamApplicValue(String nmParamApplic, long idStrut, long idAmbiente) { + /** + * Ottieni il valore del parametro indicato dal codice in input. Il valore viene ottenuto filtrando per tipologia + * STRUT {@link TipoAplVGetValAppart#STRUT} + * + * @param nmParamApplic + * codice del parametro + * @param idAmbiente + * id ambiente + * @param idStrut + * id struttura + * + * + * @return valore del parametro filtrato per tipologia STRUT . + */ + public String getValoreParamApplicByStrut(String nmParamApplic, long idStrut, long idAmbiente) { return getParamApplicValue(nmParamApplic, idStrut, idAmbiente, Integer.MIN_VALUE, Integer.MIN_VALUE, TipoAplVGetValAppart.STRUT); } - public String getParamApplicValue(String nmParamApplic, long idStrut, long idAmbiente, long idTipoUnitaDoc) { + /** + * Ottieni il valore del parametro indicato dal codice in input. Il valore viene ottenuto filtrando per tipologia + * TIPOUNITADOC {@link TipoAplVGetValAppart#TIPOUNITADOC} + * + * @param nmParamApplic + * codice del parametro + * @param idAmbiente + * id ambiente + * @param idStrut + * id struttura + * @param idTipoUnitaDoc + * id tipologia unità documentaria + * + * @return valore del parametro filtrato per tipologia TIPOUNITADOC . + */ + public String getValoreParamApplicByTipoUd(String nmParamApplic, long idStrut, long idAmbiente, + long idTipoUnitaDoc) { return getParamApplicValue(nmParamApplic, idStrut, idAmbiente, idTipoUnitaDoc, Integer.MIN_VALUE, TipoAplVGetValAppart.TIPOUNITADOC); } - public String getParamApplicValue(String nmParamApplic, long idStrut, long idAmbiente, long idTipoUnitaDoc, + /** + * Ottieni il valore del parametro indicato dal codice in input. Il valore viene ottenuto filtrando per tipologia + * AATIPOFASCICOLO {@link TipoAplVGetValAppart#AATIPOFASCICOLO} + * + * @param nmParamApplic + * codice del parametro + * @param idAmbiente + * id ambiente + * @param idStrut + * id struttura + * @param idAaTipoFascicolo + * id tipologia anno fascicolo + * + * @return valore del parametro filtrato per tipologia AATIPOFASCICOLO . + */ + public String getValoreParamApplicByAaTipoFasc(String nmParamApplic, long idStrut, long idAmbiente, long idAaTipoFascicolo) { - return getParamApplicValue(nmParamApplic, idStrut, idAmbiente, idTipoUnitaDoc, idAaTipoFascicolo, + return getParamApplicValue(nmParamApplic, idStrut, idAmbiente, Integer.MIN_VALUE, idAaTipoFascicolo, TipoAplVGetValAppart.AATIPOFASCICOLO); } @@ -82,7 +152,7 @@ public String getParamApplicValue(String nmParamApplic, long idStrut, long idAmb private static final String IDAPLVGETVALPARAMBY = "idAplVGetvalParamBy"; /** - * + * * @param nmParamApplic * nome parametro * @param idStrut @@ -98,7 +168,6 @@ public String getParamApplicValue(String nmParamApplic, long idStrut, long idAmb * * @return Valore del parametro indicato secondo nome */ - @SuppressWarnings("unchecked") private String getParamApplicValue(String nmParamApplic, long idStrut, long idAmbiente, long idTipoUnitaDoc, long idAaTipoFascicolo, TipoAplVGetValAppart tipoAplVGetValAppart) { @@ -131,7 +200,7 @@ private String getParamApplicValue(String nmParamApplic, long idStrut, long idAm queryData.put(FLAPLPARAMAPPLICAPPART, "flAppartAaTipoFascicolo"); queryData.put(IDAPLVGETVALPARAMBY, "AND getvalParam.idAaTipoFascicolo = :id"); // replace - queryStr = StrSubstitutor.replace(queryStrTempl, queryData); + queryStr = StringSubstitutor.replace(queryStrTempl, queryData); break; case TIPOUNITADOC: // @@ -144,7 +213,7 @@ private String getParamApplicValue(String nmParamApplic, long idStrut, long idAm queryData.put(FLAPLPARAMAPPLICAPPART, "flAppartTipoUnitaDoc"); queryData.put(IDAPLVGETVALPARAMBY, "AND getvalParam.idTipoUnitaDoc = :id"); // replace - queryStr = StrSubstitutor.replace(queryStrTempl, queryData); + queryStr = StringSubstitutor.replace(queryStrTempl, queryData); break; case STRUT: // @@ -157,7 +226,7 @@ private String getParamApplicValue(String nmParamApplic, long idStrut, long idAm queryData.put(FLAPLPARAMAPPLICAPPART, "flAppartStrut"); queryData.put(IDAPLVGETVALPARAMBY, "AND getvalParam.idStrut = :id"); // replace - queryStr = StrSubstitutor.replace(queryStrTempl, queryData); + queryStr = StringSubstitutor.replace(queryStrTempl, queryData); break; case AMBIENTE: // @@ -170,7 +239,7 @@ private String getParamApplicValue(String nmParamApplic, long idStrut, long idAm queryData.put(FLAPLPARAMAPPLICAPPART, "flAppartAmbiente"); queryData.put(IDAPLVGETVALPARAMBY, "AND getvalParam.idAmbiente = :id"); // replace - queryStr = StrSubstitutor.replace(queryStrTempl, queryData); + queryStr = StringSubstitutor.replace(queryStrTempl, queryData); break; default: // @@ -181,7 +250,7 @@ private String getParamApplicValue(String nmParamApplic, long idStrut, long idAm queryData.put(FLAPLPARAMAPPLICAPPART, "flAppartApplic"); queryData.put(IDAPLVGETVALPARAMBY, ""); // replace - queryStr = StrSubstitutor.replace(queryStrTempl, queryData); + queryStr = StringSubstitutor.replace(queryStrTempl, queryData); break; } @@ -191,7 +260,7 @@ private String getParamApplicValue(String nmParamApplic, long idStrut, long idAm query.setParameter("flAppart", "1");// fixed // solo nel caso in cui contenga la condition sull'ID if (StringUtils.isNotBlank(queryData.get(IDAPLVGETVALPARAMBY))) { - query.setParameter("id", id); + query.setParameter("id", new BigDecimal(id)); } // get result result = query.getResultList(); @@ -230,7 +299,6 @@ private String getParamApplicValue(String nmParamApplic, long idStrut, long idAm } } - @SuppressWarnings("unchecked") private String getDsValoreParamApplicByTiAppart(String nmParamApplic, List result, final TiAppart tiAppart) { // get entity from list @@ -269,10 +337,6 @@ private String getDsValoreParamApplicByTiAppart(String nmParamApplic, List getValoreParamApplicByTiParamApplicAsMap(String tiParamApplic) { - return getValoreParamApplicByTiParamApplicAsMap(Arrays.asList(tiParamApplic)); - } - public Map getValoreParamApplicByTiParamApplicAsMap(List tiParamApplics) { Map config = new HashMap<>(); @@ -284,7 +348,7 @@ public Map getValoreParamApplicByTiParamApplicAsMap(List List result = query.getResultList(); for (AplParamApplic cfg : result) { - config.put(cfg.getNmParamApplic(), me.getParamApplicValue(cfg.getNmParamApplic())); + config.put(cfg.getNmParamApplic(), me.getValoreParamApplicByApplic(cfg.getNmParamApplic())); } return config; @@ -292,15 +356,15 @@ public Map getValoreParamApplicByTiParamApplicAsMap(List /** * - * Gestione FLAG true -gt; 1, false -> 0 + * Gestione FLAG true = 1, false = 0 * * @param nmParamApplic * nome parametro applicativo * * @return Valore del flag indicato secondo nome */ - public String getParamApplicValueAsFl(String nmParamApplic) { - return FlagConverter.fromBoolToFl(me.getParamApplicValue(nmParamApplic)); + public String getValoreParamApplicByApplicAsFl(String nmParamApplic) { + return FlagConverter.fromBoolToFl(me.getValoreParamApplicByApplic(nmParamApplic)); } /** @@ -318,8 +382,10 @@ public String getParamApplicValueAsFl(String nmParamApplic) { * * @return Valore del flag indicato secondo nome */ - public String getParamApplicValueAsFl(String nmParamApplic, long idStrut, long idAmbiente, long idTipoUnitaDoc) { - return FlagConverter.fromBoolToFl(me.getParamApplicValue(nmParamApplic, idStrut, idAmbiente, idTipoUnitaDoc)); + public String getValoreParamApplicByTipoUdAsFl(String nmParamApplic, long idStrut, long idAmbiente, + long idTipoUnitaDoc) { + return FlagConverter + .fromBoolToFl(me.getValoreParamApplicByTipoUd(nmParamApplic, idStrut, idAmbiente, idTipoUnitaDoc)); } /** @@ -332,16 +398,14 @@ public String getParamApplicValueAsFl(String nmParamApplic, long idStrut, long i * id struttura * @param idAmbiente * id ambiente - * @param idTipoUnitaDoc - * id tipo unita doc * @param idAaTipoFascicolo * id anno tipo fascicolo * * @return Valore del flag indicato secondo nome */ - public String getParamApplicValueAsFl(String nmParamApplic, long idStrut, long idAmbiente, long idTipoUnitaDoc, + public String getValoreParamApplicByAaTipoFascAsFl(String nmParamApplic, long idStrut, long idAmbiente, long idAaTipoFascicolo) { return FlagConverter.fromBoolToFl( - me.getParamApplicValue(nmParamApplic, idStrut, idAmbiente, idTipoUnitaDoc, idAaTipoFascicolo)); + me.getValoreParamApplicByAaTipoFasc(nmParamApplic, idStrut, idAmbiente, idAaTipoFascicolo)); } } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/util/ejb/help/dto/AplVGetValParamDto.java b/sacerws-ejb/src/main/java/it/eng/parer/util/ejb/help/dto/AplVGetValParamDto.java index bcd023f..5170ec4 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/util/ejb/help/dto/AplVGetValParamDto.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/util/ejb/help/dto/AplVGetValParamDto.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.util.ejb.help.dto; import java.io.Serializable; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSChiave.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSChiave.java index 54ad97f..69c7fc9 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSChiave.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSChiave.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -86,4 +103,4 @@ public boolean equals(Object obj) { return false; return true; } -} \ No newline at end of file +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSChiaveFasc.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSChiaveFasc.java index b255c14..0a6d26c 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSChiaveFasc.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSChiaveFasc.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -10,6 +27,7 @@ */ public class CSChiaveFasc implements java.io.Serializable { + private static final long serialVersionUID = 1L; private String numero; private Integer anno; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSChiaveSottFasc.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSChiaveSottFasc.java index 9c9a040..e0e019c 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSChiaveSottFasc.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSChiaveSottFasc.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSVersatore.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSVersatore.java index 1d46b11..9ddc925 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSVersatore.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/CSVersatore.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -10,6 +27,7 @@ */ public class CSVersatore implements java.io.Serializable { + private static final long serialVersionUID = 1L; private String sistemaConservazione; private String ambiente; private String ente; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IErroriMultipli.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IErroriMultipli.java index 42a22a0..e4367c7 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IErroriMultipli.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IErroriMultipli.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,9 +22,10 @@ */ package it.eng.parer.ws.dto; -import it.eng.parer.ws.versamento.dto.VoceDiErrore; import java.util.List; +import it.eng.parer.ws.versamento.dto.VoceDiErrore; + /** * * @author fioravanti_f diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IRestWSBase.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IRestWSBase.java index 01b2ad3..56db42b 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IRestWSBase.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IRestWSBase.java @@ -1,11 +1,29 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.dto; +import java.util.Set; + import it.eng.parer.ws.utils.Costanti; -import java.util.EnumSet; /** * @@ -35,6 +53,6 @@ public interface IRestWSBase { public String getVersioneCalc(); - public EnumSet getModificatoriWSCalc(); + public Set getModificatoriWSCalc(); // } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IRispostaWS.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IRispostaWS.java index 14ed389..a8cde06 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IRispostaWS.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IRispostaWS.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IWSDesc.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IWSDesc.java index 7f9756d..7aa3bdc 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IWSDesc.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/IWSDesc.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/RispostaControlli.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/RispostaControlli.java index f1564e2..628f9d8 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/RispostaControlli.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/dto/RispostaControlli.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.dto; import java.util.Date; @@ -10,6 +27,7 @@ */ public class RispostaControlli implements java.io.Serializable { + private static final long serialVersionUID = 1L; private long rLong = -1; private long rLongExtended = -1; private int rInt = -1; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliMM.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliMM.java index 266f9aa..7663342 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliMM.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliMM.java @@ -1,13 +1,26 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.ejb; -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - import javax.ejb.EJB; import javax.ejb.LocalBean; import javax.ejb.Stateless; @@ -17,10 +30,10 @@ import javax.persistence.NoResultException; import javax.persistence.PersistenceContext; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import it.eng.parer.entity.AplParamApplic; import it.eng.parer.util.ejb.help.ConfigurationHelper; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.MessaggiWSBundle; @@ -40,7 +53,7 @@ public class ControlliMM { private EntityManager entityManager; @EJB - ConfigurationHelper config; + private ConfigurationHelper configurationHelper; public enum TipiRootPath { @@ -53,71 +66,34 @@ public RispostaControlli caricaRootPath(String appVersante, TipiRootPath tipoRoo rispostaControlli.setrLong(-1); rispostaControlli.setrBoolean(false); - Properties props = new Properties(); - boolean useDb = false; - boolean prosegui = true; - String rootftp = null; + try { + String paramName = StringUtils.EMPTY; - try (InputStream tmpStream = this.getClass().getClassLoader().getResourceAsStream("/sacerEjb.properties")) { - props.load(tmpStream); - if (props.getProperty("rootFtp.overrideDbUrl").equals("true")) { - switch (tipoRootPath) { - case In: - rootftp = props.getProperty("rootFtp.url." + ParametroApplDB.PATH_MM_IN_ + appVersante); - break; - case Out: - rootftp = props.getProperty("rootFtp.url." + ParametroApplDB.PATH_MM_OUT_ + appVersante); - break; - default: - break; - } - rispostaControlli.setrString(rootftp); - rispostaControlli.setrBoolean(true); - } else { - useDb = true; + switch (tipoRootPath) { + case In: + paramName = ParametroApplDB.PATH_MM_IN + appVersante; + break; + case Out: + paramName = ParametroApplDB.PATH_MM_OUT + appVersante; + break; + default: + break; } - } catch (IOException ex) { - prosegui = false; + rispostaControlli.setrString(configurationHelper.getValoreParamApplicByApplic(paramName)); + rispostaControlli.setrBoolean(true); + } catch (NoResultException e) { + rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); + rispostaControlli + .setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliMM.caricaRootPath - " + + "Applicativo chiamante non correttamente configurato nella tabella AplParamApplic")); + } catch (Exception e) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "ControlliMM.caricaRootPath - properties: " + ex.getMessage())); - log.error("Eccezione nella lettura del file di properties ", ex); - } - - if (prosegui && useDb) { - try { - // carico i parametri applicativi - String queryStr = "select tpa " + "from AplParamApplic tpa " - + "where tpa.tiParamApplic = :tiParamApplicIn " + "and tpa.nmParamApplic = :nmParamAppliciN "; - - javax.persistence.Query query = entityManager.createQuery(queryStr, AplParamApplic.class); - query.setParameter("tiParamApplicIn", ParametroApplDB.TipoParametroAppl.PATH); - switch (tipoRootPath) { - case In: - query.setParameter("nmParamAppliciN", ParametroApplDB.PATH_MM_IN_ + appVersante); - break; - case Out: - query.setParameter("nmParamAppliciN", ParametroApplDB.PATH_MM_OUT_ + appVersante); - break; - default: - break; - } - AplParamApplic tud = (AplParamApplic) query.getSingleResult(); - rispostaControlli.setrString(config.getParamApplicValue(tud.getNmParamApplic())); - rispostaControlli.setrBoolean(true); - } catch (NoResultException e) { - rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlli - .setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliMM.caricaRootPath - " - + "Applicativo chiamante non correttamente configurato nella tabella AplParamApplic")); - } catch (Exception e) { - rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "ControlliMM.caricaRootPath - AplParamApplic: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella AplParamApplic", e); - } + "ControlliMM.caricaRootPath - AplParamApplic: " + e.getMessage())); + log.error("Eccezione nella lettura della tabella AplParamApplic", e); } return rispostaControlli; } + } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliSemantici.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliSemantici.java index 3c037f2..7df962b 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliSemantici.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliSemantici.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -23,10 +40,12 @@ import javax.persistence.PersistenceContext; import javax.persistence.Query; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import it.eng.paginator.util.HibernateUtils; import it.eng.parer.entity.AroCompDoc; import it.eng.parer.entity.AroDoc; import it.eng.parer.entity.AroUnitaDoc; @@ -47,7 +66,7 @@ import it.eng.parer.entity.OrgEnte; import it.eng.parer.entity.OrgStrut; import it.eng.parer.util.ejb.help.ConfigurationHelper; -import it.eng.parer.viewEntity.AroVDtVersMaxByUnitaDoc; +import it.eng.parer.view_entity.AroVDtVersMaxByUnitaDoc; import it.eng.parer.ws.dto.CSChiave; import it.eng.parer.ws.dto.CSVersatore; import it.eng.parer.ws.dto.RispostaControlli; @@ -64,13 +83,13 @@ import it.eng.parer.ws.versamento.dto.DatiRegistroFiscale; import it.eng.parer.ws.versamento.dto.DatoSpecifico; import it.eng.parer.ws.versamento.dto.RispostaControlliAttSpec; -import org.apache.commons.lang3.StringUtils; /** * * @author Pagani_S (iniziata) * @author Fioravanti_F */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "ControlliSemantici") @LocalBean @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) @@ -81,7 +100,7 @@ public class ControlliSemantici { private EntityManager entityManager; @EJB - ConfigurationHelper config; + private ConfigurationHelper config; public enum TipologieComponente { @@ -116,8 +135,9 @@ public RispostaControlli caricaDefaultDaDB(String[] tipoPars) { "ControlliSemantici.caricaDefaultDaDB: " + "Parametri applicativi non correttamente configurati per " + String.join(",", tipoPars))); - log.error("ControlliSemantici.caricaDefaultDaDB: " - + "Parametri applicativi non correttamente configurati per " + String.join(",", tipoPars)); + log.atError().setMessage( + "ControlliSemantici.caricaDefaultDaDB: Parametri applicativi non correttamente configurati per {}.") + .addArgument(() -> String.join(",", tipoPars)).log(); } } catch (Exception e) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); @@ -160,6 +180,7 @@ public RispostaControlli checkIdStrut(CSVersatore vers, Costanti.TipiWSPerContro if (orgAmbienteS.isEmpty()) { switch (tipows) { case VERSAMENTO_RECUPERO: + case AGGIORNAMENTO_VERSAMENTO: rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_001); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_001, amb)); break; @@ -171,10 +192,6 @@ public RispostaControlli checkIdStrut(CSVersatore vers, Costanti.TipiWSPerContro rispostaControlli.setCodErr(MessaggiWSBundle.FAS_CONFIG_001_001); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.FAS_CONFIG_001_001, amb)); break; - case AGGIORNAMENTO_VERSAMENTO: - rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_001); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_001, amb)); - break; } return rispostaControlli; } @@ -201,6 +218,7 @@ public RispostaControlli checkIdStrut(CSVersatore vers, Costanti.TipiWSPerContro if (orgEnteS.isEmpty()) { switch (tipows) { case VERSAMENTO_RECUPERO: + case AGGIORNAMENTO_VERSAMENTO: rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_002); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_002, ente)); break; @@ -212,10 +230,6 @@ public RispostaControlli checkIdStrut(CSVersatore vers, Costanti.TipiWSPerContro rispostaControlli.setCodErr(MessaggiWSBundle.FAS_CONFIG_001_002); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.FAS_CONFIG_001_002, ente)); break; - case AGGIORNAMENTO_VERSAMENTO: - rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_002); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_002, ente)); - break; } return rispostaControlli; } @@ -242,6 +256,7 @@ public RispostaControlli checkIdStrut(CSVersatore vers, Costanti.TipiWSPerContro if (orgStrutS.isEmpty()) { switch (tipows) { case VERSAMENTO_RECUPERO: + case AGGIORNAMENTO_VERSAMENTO: rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_003); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_003, strut)); break; @@ -253,10 +268,6 @@ public RispostaControlli checkIdStrut(CSVersatore vers, Costanti.TipiWSPerContro rispostaControlli.setCodErr(MessaggiWSBundle.FAS_CONFIG_001_003); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.FAS_CONFIG_001_003, strut)); break; - case AGGIORNAMENTO_VERSAMENTO: - rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_003); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_003, strut)); - break; } return rispostaControlli; } @@ -302,10 +313,6 @@ public RispostaControlli checkIdStrut(CSVersatore vers, Costanti.TipiWSPerContro } else if (orgStrutS.get(0).getDtIniValStrut() != null && orgStrutS.get(0).getDtFineValStrut() != null) { // In tutta l'applicazione viene utilizzato joda time solo per questo metodo. refactor senza usare la // libreria - // hasDateErr = !new Interval( - // DateUtils.truncate(orgStrutS.get(0).getDtIniValStrut(), Calendar.DATE).getTime(), - // DateUtils.truncate(orgStrutS.get(0).getDtFineValStrut(), Calendar.DATE).getTime()) - // .contains(DateUtils.truncate(dataVersamento, Calendar.DATE).getTime()); long dtIni = DateUtils.truncate(orgStrutS.get(0).getDtIniValStrut(), Calendar.DATE).getTime(); long dtFine = DateUtils.truncate(orgStrutS.get(0).getDtFineValStrut(), Calendar.DATE).getTime(); long dtVers = DateUtils.truncate(dataVersamento, Calendar.DATE).getTime(); @@ -329,7 +336,7 @@ public RispostaControlli checkIdStrut(CSVersatore vers, Costanti.TipiWSPerContro rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkIdStrut: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; @@ -358,7 +365,7 @@ public RispostaControlli checkSistemaMigraz(String sistemaMig) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkSistemaMigraz: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; @@ -388,13 +395,13 @@ public RispostaControlli checkChiave(CSChiave key, long idStruttura, TipiGestion javax.persistence.Query query = entityManager.createQuery(queryStr, AroUnitaDoc.class); query.setParameter("idStrutIn", idStruttura); query.setParameter("cdKeyUnitaDocIn", numero); - query.setParameter("aaKeyUnitaDocIn", anno); + query.setParameter("aaKeyUnitaDocIn", new BigDecimal(anno)); query.setParameter("cdRegistroKeyUnitaDocIn", tipoReg); unitaDocS = query.getResultList(); // chiave già presente (uno o più righe trovate, mi interessa solo l'ultima - // più recente) - if (unitaDocS.size() > 0) { + if (!unitaDocS.isEmpty()) { StatoConservazioneUnitaDoc scud = StatoConservazioneUnitaDoc .valueOf(unitaDocS.get(0).getTiStatoConservazione()); if (scud == StatoConservazioneUnitaDoc.ANNULLATA @@ -452,7 +459,7 @@ public RispostaControlli checkChiave(CSChiave key, long idStruttura, TipiGestion rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkChiave: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; @@ -509,7 +516,7 @@ public RispostaControlli checkTipologiaUD(String tipologiaUD, String descKey, lo rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkTipologiaUD: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; @@ -534,7 +541,7 @@ public RispostaControlli checkTipoRegistro(String nomeTipoRegistro, String descK // STRETTAMENTE // MAGGIORE della // data di - // riferimento!!!; + // riferimento!!! javax.persistence.Query query = entityManager.createQuery(queryStr, DecRegistroUnitaDoc.class); query.setParameter("idStrutIn", idStruttura); @@ -563,7 +570,7 @@ public RispostaControlli checkTipoRegistro(String nomeTipoRegistro, String descK rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkTipoRegistro: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; } @@ -590,7 +597,7 @@ public RispostaControlli checkTipoRegistroTipoUD(String nomeTipoRegistro, String // STRETTAMENTE // MAGGIORE della // data di - // riferimento!!!; + // riferimento!!! javax.persistence.Query query = entityManager.createQuery(queryStr, DecRegistroUnitaDoc.class); query.setParameter("idStrutIn", idStruttura); @@ -636,7 +643,7 @@ public RispostaControlli checkTipoRegistroTipoUD(String nomeTipoRegistro, String rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkTipoRegistroTipoUD: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; @@ -661,14 +668,14 @@ public RispostaControlli caricaRegistroAnno(String nomeTipoRegistro, String desc javax.persistence.Query query = entityManager.createQuery(queryStr); query.setParameter("idRegistroUnitaDocIn", idRegistroUnitaDoc); - query.setParameter("annoUDIn", anno); - query.setParameter("annoCorrenteIn", new GregorianCalendar().get(Calendar.YEAR)); + query.setParameter("annoUDIn", new BigDecimal(anno)); + query.setParameter("annoCorrenteIn", new BigDecimal(new GregorianCalendar().get(Calendar.YEAR))); - List tmpLst = (List) query.getResultList(); + List tmpLst = query.getResultList(); if (tmpLst.size() == 1) { DecAaRegistroUnitaDoc tmpAaRegistroUnitaDoc = tmpLst.get(0); ConfigRegAnno tmpConfAnno = this.caricaPartiAARegistro(tmpAaRegistroUnitaDoc.getIdAaRegistroUnitaDoc()); - if (tmpConfAnno.getParti().size() > 0) { + if (!tmpConfAnno.getParti().isEmpty()) { rispostaControlli.setrObject(tmpConfAnno); rispostaControlli.setrBoolean(true); } else { @@ -700,7 +707,7 @@ public RispostaControlli caricaRegistroAnno(String nomeTipoRegistro, String desc rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkTipoRegistroAnno: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; @@ -716,7 +723,7 @@ public ConfigRegAnno caricaPartiAARegistro(long idAaRegistroUnitaDoc) { + "order by t.niParteNumeroRegistro"; javax.persistence.Query query = entityManager.createQuery(queryStr); query.setParameter("idAaRegistroUnitaDoc", idAaRegistroUnitaDoc); - List tmpLstP = (List) query.getResultList(); + List tmpLstP = query.getResultList(); for (DecParteNumeroRegistro tmpParte : tmpLstP) { ConfigRegAnno.ParteRegAnno tmpPRanno = tmpConfAnno.aggiungiParte(); @@ -815,7 +822,7 @@ public RispostaControlli checkTipoDocumento(String nomeTipoDoc, long idStruttura rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkTipoDocumento: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; @@ -866,7 +873,7 @@ public RispostaControlli checkTipoStruttura(String nomeTipoStruttura, long idStr rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkTipoStruttura: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; @@ -954,7 +961,7 @@ public RispostaControlli checkTipoComponente(String nomeTipoComponente, long idT rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkTipoComponente: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; @@ -997,49 +1004,12 @@ public RispostaControlli checkTipoRappComponente(String nomeTipoRapprComponente, rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkTipoRappComponente: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; } - // public RispostaControlli checkFlagFC(long idTipologiaUD) { - // RispostaControlli rispostaControlli; - // rispostaControlli = new RispostaControlli(); - // - // rispostaControlli.setrInt(1); - // - // // lista entity JPA ritornate dalle Query - // List tipoUnitaDocS = null; - // - // // lancio query di controllo - // try { - // - // // ricavo le ud presenti in base ai parametri impostati - // String queryStr = "select tud " - // + "from DecTipoUnitaDoc tud " - // + "where tud.idTipoUnitaDoc = :idTipoUnitaDocIn "; - // - // javax.persistence.Query query = entityManager.createQuery(queryStr, DecTipoUnitaDoc.class); - // query.setParameter("idTipoUnitaDocIn", idTipologiaUD); - // tipoUnitaDocS = query.getResultList(); - // - // for (DecTipoUnitaDoc tud : tipoUnitaDocS) { - // if (tud.getFlForzaCollegamento().equals("0")) { - // rispostaControlli.setrInt(0); - // } - // } - // } catch (Exception e) { - // rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); - // rispostaControlli.setDsErr( - // MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - // "ControlliSemantici.checkFlagFC: " + e.getMessage())); - // log.error("Eccezione nella lettura della tabella di decodifica ", e); - // } - // - // return rispostaControlli; - // } - public RispostaControlli checkPresenzaDatiSpec(TipiUsoDatiSpec tiUsoXsd, TipiEntitaSacer tipoEntitySacer, String sistemaMig, long idStruttura, long idTipoEntitySacer, Date dataRiferimento) { RispostaControlli rispostaControlli; @@ -1090,7 +1060,7 @@ public RispostaControlli checkPresenzaDatiSpec(TipiUsoDatiSpec tiUsoXsd, TipiEnt // da notare STRETTAMENTE MAGGIORE della data di riferimento!!! tmpTipoEntita); - javax.persistence.Query query = entityManager.createQuery(queryStr, DecXsdDatiSpec.class); + javax.persistence.Query query = entityManager.createQuery(queryStr, Long.class); query.setParameter("idStrutIn", idStruttura); query.setParameter("tiUsoXsdIn", tiUsoXsd.name()); query.setParameter("idTipoEntitySacerIn", idTipoEntitySacer); @@ -1108,7 +1078,7 @@ public RispostaControlli checkPresenzaDatiSpec(TipiUsoDatiSpec tiUsoXsd, TipiEnt rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkPresenzaDatiSpec: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; @@ -1188,7 +1158,7 @@ public RispostaControlli checkXSDDatiSpec(TipiUsoDatiSpec tiUsoXsd, TipiEntitaSa rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkXSDDatiSpec: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; @@ -1239,7 +1209,7 @@ public RispostaControlli checkPresenzaVersioneDatiSpec(TipiUsoDatiSpec tiUsoXsd, + " and %s = :idTipoEntitySacerIn " + " and t.tiEntitaSacer = :tiEntitaSacerIn " + " and t.cdVersioneXsd = :cdVersioneXsdIn ", tmpTipoEntita); - javax.persistence.Query query = entityManager.createQuery(queryStr, DecXsdDatiSpec.class); + javax.persistence.Query query = entityManager.createQuery(queryStr); query.setParameter("idStrutIn", idStruttura); query.setParameter("tiUsoXsdIn", tiUsoXsd.name()); query.setParameter("idTipoEntitySacerIn", idTipoEntitySacer); @@ -1257,7 +1227,7 @@ public RispostaControlli checkPresenzaVersioneDatiSpec(TipiUsoDatiSpec tiUsoXsd, rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkPresenzaVersioneDatiSpec: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; @@ -1268,7 +1238,7 @@ public RispostaControlliAttSpec checkDatiSpecifici(TipiUsoDatiSpec tipoUsoAttr, RispostaControlliAttSpec rispostaControlli; rispostaControlli = new RispostaControlliAttSpec(); rispostaControlli.setrBoolean(false); - rispostaControlli.setDatiSpecifici(new LinkedHashMap()); + rispostaControlli.setDatiSpecifici(new LinkedHashMap<>()); DatoSpecifico tmpDatoSpecifico; List lstAttribDatiSpecs = null; @@ -1287,7 +1257,7 @@ public RispostaControlliAttSpec checkDatiSpecifici(TipiUsoDatiSpec tipoUsoAttr, query.setParameter("idXsdDatiSpecIn", idXsdDatiSpec); lstAttribDatiSpecs = query.getResultList(); - if (lstAttribDatiSpecs.size() > 0) { + if (!lstAttribDatiSpecs.isEmpty()) { rispostaControlli.setrBoolean(true); for (DecAttribDatiSpec td : lstAttribDatiSpecs) { tmpDatoSpecifico = new DatoSpecifico(); @@ -1328,7 +1298,7 @@ public RispostaControlliAttSpec checkDatiSpecifici(TipiUsoDatiSpec tipoUsoAttr, query.setParameter("idXsdDatiSpecIn", idXsdDatiSpec); lstAttribDatiSpecs = query.getResultList(); - if (lstAttribDatiSpecs.size() > 0) { + if (!lstAttribDatiSpecs.isEmpty()) { rispostaControlli.setrBoolean(true); for (DecAttribDatiSpec td : lstAttribDatiSpecs) { tmpDatoSpecifico = new DatoSpecifico(); @@ -1343,14 +1313,14 @@ public RispostaControlliAttSpec checkDatiSpecifici(TipiUsoDatiSpec tipoUsoAttr, rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkDatiSpecifici: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; } - public RispostaControlli checkRiferimentoUD(CSChiave key, long idUnitaDoc, long idStrutturaVersante, - TipologieComponente tComp, String descChiaveComp) { + public RispostaControlli checkRiferimentoUD(CSChiave key, long idStrutturaVersante, TipologieComponente tComp, + String descChiaveComp) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); @@ -1377,11 +1347,11 @@ public RispostaControlli checkRiferimentoUD(CSChiave key, long idUnitaDoc, long javax.persistence.Query query = entityManager.createQuery(queryStr); query.setParameter("idStrutIn", idStrutturaVersante); query.setParameter("cdRegistroKeyUnitaDocIn", tipoReg); - query.setParameter("aaKeyUnitaDocIn", anno); + query.setParameter("aaKeyUnitaDocIn", new BigDecimal(anno)); query.setParameter("cdKeyUnitaDocIn", numero); query.setParameter("dataDiOggiIn", new Date()); - aroCompDocs = (List) query.getResultList(); + aroCompDocs = query.getResultList(); if (aroCompDocs == null || aroCompDocs.isEmpty()) { if (tComp == TipologieComponente.COMPONENTE) { // Nel documento PRINCIPALE dell?unit� documentaria indicata dal riferimento, @@ -1447,7 +1417,7 @@ public RispostaControlli checkRiferimentoUD(CSChiave key, long idUnitaDoc, long rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.checkRiferimentoUD: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; } @@ -1552,7 +1522,6 @@ public RispostaControlli trovaNuovoProgDocumento(long idUnitaDoc, String categor rispostaControlli.setrBoolean(false); BigDecimal max = null; // lista entity JPA ritornate dalle Query - List aroDocs = null; // lancio query di controllo try { @@ -1709,7 +1678,7 @@ private RispostaControlli checkCdKeyNormalized(long idRegistro, CSChiave key, St javax.persistence.Query query = entityManager.createQuery(queryStr); query.setParameter("idRegistro", idRegistro); - query.setParameter("aaKeyUnitaDoc", key.getAnno()); + query.setParameter("aaKeyUnitaDoc", HibernateUtils.bigDecimalFrom(key.getAnno())); query.setParameter("cdKeyUnitaDoc", key.getNumero()); query.setParameter("cdKeyUnitaDocNormaliz", cdKeyUnitaDocNormaliz); @@ -1781,7 +1750,7 @@ private RispostaControlli getDtMaxVersMaxByUd(long idUnitaDoc) { try { Query query = entityManager .createQuery("SELECT aro FROM AroVDtVersMaxByUnitaDoc aro WHERE aro.idUnitaDoc = :idUnitaDoc "); - query.setParameter("idUnitaDoc", idUnitaDoc); + query.setParameter("idUnitaDoc", HibernateUtils.bigDecimalFrom(idUnitaDoc)); aroVDtVersMaxByUnitaDoc = (AroVDtVersMaxByUnitaDoc) query.getSingleResult(); if (aroVDtVersMaxByUnitaDoc == null) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666P); @@ -1794,7 +1763,7 @@ private RispostaControlli getDtMaxVersMaxByUd(long idUnitaDoc) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.getDtMaxVersMaxByUd: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica " + e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; } @@ -1808,7 +1777,7 @@ public RispostaControlli getDtCalcInizioNuoviUrn() { // recupero parametro SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); Date dtInizioCalcNuoviUrn = dateFormat - .parse(config.getParamApplicValue(ParametroApplDB.DATA_INIZIO_CALC_NUOVI_URN)); + .parse(config.getValoreParamApplicByApplic(ParametroApplDB.DATA_INIZIO_CALC_NUOVI_URN)); rispostaControlli.setrDate(dtInizioCalcNuoviUrn); } catch (Exception e) { @@ -1816,7 +1785,7 @@ public RispostaControlli getDtCalcInizioNuoviUrn() { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliSemantici.getDtCalcInizioNuoviUrn: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica " + e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliTpi.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliTpi.java index 74b14cc..5226c74 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliTpi.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliTpi.java @@ -1,32 +1,42 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.ejb; -import it.eng.parer.entity.AplParamApplic; -import it.eng.parer.util.ejb.help.ConfigurationHelper; -import it.eng.parer.ws.dto.RispostaControlli; -import it.eng.parer.ws.utils.CostantiDB; -import it.eng.parer.ws.utils.MessaggiWSBundle; -import it.eng.parer.ws.utils.ParametroApplDB; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - import javax.ejb.EJB; import javax.ejb.LocalBean; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import javax.persistence.EntityManager; -import javax.persistence.NoResultException; import javax.persistence.PersistenceContext; -import org.apache.commons.io.IOUtils; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import it.eng.parer.util.ejb.help.ConfigurationHelper; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.utils.MessaggiWSBundle; +import it.eng.parer.ws.utils.ParametroApplDB; + /** * * @author Fioravanti_F @@ -41,7 +51,7 @@ public class ControlliTpi { private EntityManager entityManager; @EJB - ConfigurationHelper config; + private ConfigurationHelper configurationHelper; public RispostaControlli caricaRootPath() { RispostaControlli rispostaControlli; @@ -49,57 +59,17 @@ public RispostaControlli caricaRootPath() { rispostaControlli.setrLong(-1); rispostaControlli.setrBoolean(false); - Properties props = new Properties(); - boolean useDb = false; - boolean prosegui = true; - InputStream tmpStream = null; - String rootftp = null; - try { - tmpStream = this.getClass().getClassLoader().getResourceAsStream("/sacerEjb.properties"); - props.load(tmpStream); - if (props.getProperty("tpiFs.overrideDbUrl").equals("true")) { - rootftp = props.getProperty("tpiFs.url." + ParametroApplDB.TPI_ROOT_SACER); - rispostaControlli.setrString(rootftp); - rispostaControlli.setrBoolean(true); - } else { - useDb = true; - } - } catch (IOException ex) { - prosegui = false; + rispostaControlli + .setrString(configurationHelper.getValoreParamApplicByApplic(ParametroApplDB.TPI_ROOT_SACER)); + rispostaControlli.setrBoolean(true); + } catch (Exception e) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "ControlliTpi.caricaRootPath - properties: " + ex.getMessage())); - log.error("Eccezione nella lettura del file di properties ", ex); - } finally { - IOUtils.closeQuietly(tmpStream); + "ControlliTpi.caricaRootPath - AplParamApplic: " + e.getMessage())); + log.error("Eccezione nella lettura della tabella AplParamApplic ", e); } - if (prosegui && useDb) { - try { - // carico i parametri applicativi - String queryStr = "select tpa " + "from AplParamApplic tpa " + "where " - + "tpa.tiParamApplic = :tiParamApplicIn " + "and tpa.nmParamApplic = :nmParamAppliciN "; - - javax.persistence.Query query = entityManager.createQuery(queryStr, AplParamApplic.class); - query.setParameter("tiParamApplicIn", ParametroApplDB.TipoParametroAppl.TPI); - query.setParameter("nmParamAppliciN", ParametroApplDB.TPI_ROOT_SACER); - - AplParamApplic tud = (AplParamApplic) query.getSingleResult(); - rispostaControlli.setrString(config.getParamApplicValue(tud.getNmParamApplic())); - rispostaControlli.setrBoolean(true); - } catch (NoResultException e) { - rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlli - .setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliTpi.caricaRootPath - " - + "Applicativo chiamante non correttamente configurato nella tabella AplParamApplic")); - } catch (Exception e) { - rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "ControlliTpi.caricaRootPath - AplParamApplic: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella AplParamApplic " + e); - } - } return rispostaControlli; } @@ -114,25 +84,9 @@ public RispostaControlli verificaAbilitazioneTpi() { rispostaControlli.setrLong(-1); rispostaControlli.setrBoolean(false); - Properties props = new Properties(); - InputStream tmpStream = null; - - try { - tmpStream = this.getClass().getClassLoader().getResourceAsStream("/sacerEjb.properties"); - props.load(tmpStream); - if (props.getProperty("tpi.TPIAbilitato").equals("true")) { - rispostaControlli.setrBoolean(true); - } else { - rispostaControlli.setrBoolean(false); - } - } catch (IOException ex) { - rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "ControlliTpi.verificaAbilitazioneTpi - properties: " + ex.getMessage())); - log.error("Eccezione nella lettura del file di properties ", ex); - } finally { - IOUtils.closeQuietly(tmpStream); - } + boolean isTpiEnable = Boolean + .parseBoolean(configurationHelper.getValoreParamApplicByApplic(ParametroApplDB.TPI_ENABLE)); + rispostaControlli.setrBoolean(isTpiEnable); return rispostaControlli; } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliWS.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliWS.java index 769399f..07e7d06 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliWS.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/ControlliWS.java @@ -1,12 +1,31 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.ejb; +import java.math.BigDecimal; import java.util.Date; import java.util.HashMap; import java.util.List; +import java.util.Map; import javax.ejb.EJB; import javax.ejb.LocalBean; @@ -15,13 +34,14 @@ import javax.ejb.TransactionAttributeType; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; +import javax.persistence.TypedQuery; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import it.eng.parer.entity.IamUser; -import it.eng.parer.grantedEntity.UsrUser; +import it.eng.parer.granted_entity.UsrUser; import it.eng.parer.idpjaas.logutils.LogDto; import it.eng.parer.ws.dto.IWSDesc; import it.eng.parer.ws.dto.RispostaControlli; @@ -37,23 +57,25 @@ * * @author Fioravanti_F */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "ControlliWS") @LocalBean @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) public class ControlliWS { + private static final String ERRORE_AUTENTICAZIONE = "Eccezione nella fase di autenticazione del EJB "; @EJB - WsIdpLogger idpLogger; + private WsIdpLogger idpLogger; @EJB - ControlliSemantici controlliSemantici; + private ControlliSemantici controlliSemantici; private static final Logger log = LoggerFactory.getLogger(ControlliWS.class); // @PersistenceContext(unitName = "ParerJPA") private EntityManager entityManager; - public RispostaControlli checkVersione(String versione, String versioniWsKey, HashMap xmlDefaults, + public RispostaControlli checkVersione(String versione, String versioniWsKey, Map xmlDefaults, TipiWSPerControlli tipows) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); @@ -62,10 +84,8 @@ public RispostaControlli checkVersione(String versione, String versioniWsKey, Ha if (versione == null || versione.isEmpty()) { switch (tipows) { case VERSAMENTO_RECUPERO: - rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_010); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_010)); - break; case ANNULLAMENTO: + case AGGIORNAMENTO_VERSAMENTO: rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_010); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_010)); break; @@ -73,10 +93,6 @@ public RispostaControlli checkVersione(String versione, String versioniWsKey, Ha rispostaControlli.setCodErr(MessaggiWSBundle.FAS_CONFIG_003_001); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.FAS_CONFIG_003_001)); break; - case AGGIORNAMENTO_VERSAMENTO: - rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_010); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_010)); - break; } return rispostaControlli; @@ -98,6 +114,7 @@ public RispostaControlli checkVersione(String versione, String versioniWsKey, Ha if (!rispostaControlli.isrBoolean()) { switch (tipows) { case VERSAMENTO_RECUPERO: + case AGGIORNAMENTO_VERSAMENTO: rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_011); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_011, versione)); break; @@ -110,10 +127,6 @@ public RispostaControlli checkVersione(String versione, String versioniWsKey, Ha rispostaControlli.setCodErr(MessaggiWSBundle.FAS_CONFIG_003_002); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.FAS_CONFIG_003_002, versione)); break; - case AGGIORNAMENTO_VERSAMENTO: - rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_011); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_011, versione)); - break; } } @@ -127,16 +140,13 @@ public RispostaControlli checkCredenziali(String loginName, String password, Str rispostaControlli = new RispostaControlli(); rispostaControlli.setrBoolean(false); - log.info("Indirizzo IP del chiamante - access: ws - IP: " + indirizzoIP); - // log.debug("Indirizzo IP del chiamante: " + indirizzoIP); + log.info("Indirizzo IP del chiamante - access: ws - IP: {}", indirizzoIP); if (loginName == null || loginName.isEmpty()) { switch (tipows) { case VERSAMENTO_RECUPERO: - rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_004); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_004)); - break; case ANNULLAMENTO: + case AGGIORNAMENTO_VERSAMENTO: rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_004); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_004)); break; @@ -144,10 +154,6 @@ public RispostaControlli checkCredenziali(String loginName, String password, Str rispostaControlli.setCodErr(MessaggiWSBundle.FAS_CONFIG_002_007); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.FAS_CONFIG_002_007)); break; - case AGGIORNAMENTO_VERSAMENTO: - rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_004); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_004)); - break; } return rispostaControlli; } @@ -168,7 +174,7 @@ public RispostaControlli checkCredenziali(String loginName, String password, Str UsrUser usrUser; String queryStr = "select iu, usr from IamUser iu, UsrUser usr " + "where iu.nmUserid = :nmUseridIn and iu.idUserIam = usr.idUserIam"; - javax.persistence.Query query = entityManager.createQuery(queryStr, IamUser.class); + javax.persistence.Query query = entityManager.createQuery(queryStr); query.setParameter("nmUseridIn", loginName); Object[] result = (Object[]) query.getSingleResult(); iamUser = (IamUser) result[0]; // IamUser @@ -190,9 +196,9 @@ public RispostaControlli checkCredenziali(String loginName, String password, Str rispostaControlli.setrObject(utente); rispostaControlli.setrBoolean(true); } catch (AuthWSException e) { - log.warn("ERRORE DI AUTENTICAZIONE WS." + " Funzionalità: " + tipows.name() + " Utente: " + loginName - + " Tipo errore: " + e.getCodiceErrore().name() + " Indirizzo IP: " + indirizzoIP + " Descrizione: " - + e.getDescrizioneErrore()); + log.warn( + "ERRORE DI AUTENTICAZIONE WS. Funzionalità: {} Utente: {} Tipo errore: {} Indirizzo IP: {} Descrizione: {}", + tipows.name(), loginName, e.getCodiceErrore().name(), indirizzoIP, e.getDescrizioneErrore()); switch (tipows) { case VERSAMENTO_RECUPERO: if (e.getCodiceErrore().equals(AuthWSException.CodiceErrore.UTENTE_SCADUTO)) { @@ -258,7 +264,7 @@ public RispostaControlli checkCredenziali(String loginName, String password, Str String queryStr = "select count(iu) from IamUser iu where iu.nmUserid = :nmUseridIn"; javax.persistence.Query query = entityManager.createQuery(queryStr); query.setParameter("nmUseridIn", loginName); - long tmpNumUtenti = (Long) query.getSingleResult(); + long tmpNumUtenti = (long) query.getSingleResult(); if (tmpNumUtenti > 0) { tmpLogDto.setTipoEvento(LogDto.TipiEvento.BAD_PASS); tmpLogDto.setDsEvento("WS, bad password"); @@ -269,9 +275,9 @@ public RispostaControlli checkCredenziali(String loginName, String password, Str } } catch (Exception e) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "Eccezione nella fase di autenticazione del EJB " + e.getMessage())); - log.error("Eccezione nella fase di autenticazione del EJB ", e); + rispostaControlli.setDsErr( + MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, ERRORE_AUTENTICAZIONE + e.getMessage())); + log.error(ERRORE_AUTENTICAZIONE, e); } // scrittura log @@ -291,8 +297,8 @@ public RispostaControlli checkUtente(String loginName) { String queryStr = "select iu from IamUser iu where iu.nmUserid = :nmUseridIn"; javax.persistence.Query query = entityManager.createQuery(queryStr, IamUser.class); query.setParameter("nmUseridIn", loginName); - List tmpUsers = (List) query.getResultList(); - if (tmpUsers != null && tmpUsers.size() > 0) { + List tmpUsers = query.getResultList(); + if (tmpUsers != null && !tmpUsers.isEmpty()) { iamUser = tmpUsers.get(0); if (!iamUser.getFlAttivo().equals("1")) { @@ -321,9 +327,9 @@ public RispostaControlli checkUtente(String loginName) { } } catch (Exception e) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "Eccezione nella fase di autenticazione del EJB " + e.getMessage())); - log.error("Eccezione nella fase di autenticazione del EJB ", e); + rispostaControlli.setDsErr( + MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, ERRORE_AUTENTICAZIONE + e.getMessage())); + log.error(ERRORE_AUTENTICAZIONE, e); } return rispostaControlli; @@ -334,7 +340,6 @@ public RispostaControlli checkAuthWS(User utente, IWSDesc descrizione, TipiWSPer rispostaControlli = new RispostaControlli(); rispostaControlli.setrBoolean(false); boolean checkOrgVersAuth = false; - long numAbil = 0; Integer tmpIdOrganizz = utente.getIdOrganizzazioneFoglia() != null ? utente.getIdOrganizzazioneFoglia().intValue() : null; try { @@ -344,6 +349,7 @@ public RispostaControlli checkAuthWS(User utente, IWSDesc descrizione, TipiWSPer checkOrgVersAuth = true; switch (tipows) { case VERSAMENTO_RECUPERO: + case AGGIORNAMENTO_VERSAMENTO: // L''utente {0} non è abilitato entro la struttura versante rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_009); rispostaControlli @@ -358,11 +364,6 @@ public RispostaControlli checkAuthWS(User utente, IWSDesc descrizione, TipiWSPer rispostaControlli.setDsErr( MessaggiWSBundle.getString(MessaggiWSBundle.FAS_CONFIG_002_006, utente.getUsername())); break; - case AGGIORNAMENTO_VERSAMENTO: - rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_009); - rispostaControlli - .setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_009, utente.getUsername())); - break; } } catch (Exception ex) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); @@ -375,14 +376,14 @@ public RispostaControlli checkAuthWS(User utente, IWSDesc descrizione, TipiWSPer try { String queryStr = "select count(t) from IamAbilOrganiz t where " + "t.iamUser.idUserIam = :idUserIamIn " + "and t.idOrganizApplic = :idOrganizApplicIn"; - javax.persistence.Query query = entityManager.createQuery(queryStr, IamUser.class); + TypedQuery query = entityManager.createQuery(queryStr, Long.class); query.setParameter("idUserIamIn", utente.getIdUtente()); - query.setParameter("idOrganizApplicIn", tmpIdOrganizz); - numAbil = (long) query.getSingleResult(); - if (numAbil > 0) { + query.setParameter("idOrganizApplicIn", new BigDecimal(tmpIdOrganizz)); + Long numAbil = query.getSingleResult(); + if (numAbil != null && numAbil > 0) { switch (tipows) { case VERSAMENTO_RECUPERO: - // L''utente {0} non è autorizzato alla funzione {1} + case AGGIORNAMENTO_VERSAMENTO: rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_008); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_008, utente.getUsername(), descrizione.getNomeWs())); @@ -392,16 +393,10 @@ public RispostaControlli checkAuthWS(User utente, IWSDesc descrizione, TipiWSPer rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.RICH_ANN_VERS_008)); break; case VERSAMENTO_FASCICOLO: - // L''utente {0} non è autorizzato alla funzione {1} rispostaControlli.setCodErr(MessaggiWSBundle.FAS_CONFIG_002_005); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.FAS_CONFIG_002_005, utente.getUsername(), descrizione.getNomeWs())); break; - case AGGIORNAMENTO_VERSAMENTO: - rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_008); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_008, - utente.getUsername(), descrizione.getNomeWs())); - break; } } } catch (Exception ex) { @@ -432,7 +427,7 @@ public RispostaControlli checkAuthWSNoOrg(User utente, IWSDesc descrizione, Tipi } else { switch (tipows) { case VERSAMENTO_RECUPERO: - // L''utente {0} non è autorizzato alla funzione {1} + case AGGIORNAMENTO_VERSAMENTO: rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_008); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_008, utente.getUsername(), descrizione.getNomeWs())); @@ -442,24 +437,17 @@ public RispostaControlli checkAuthWSNoOrg(User utente, IWSDesc descrizione, Tipi rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.RICH_ANN_VERS_008)); break; case VERSAMENTO_FASCICOLO: - // L''utente {0} non è autorizzato alla funzione {1} rispostaControlli.setCodErr(MessaggiWSBundle.FAS_CONFIG_002_005); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.FAS_CONFIG_002_005, utente.getUsername(), descrizione.getNomeWs())); break; - case AGGIORNAMENTO_VERSAMENTO: - // L''utente {0} non è autorizzato alla funzione {1} - rispostaControlli.setCodErr(MessaggiWSBundle.UD_001_008); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_001_008, - utente.getUsername(), descrizione.getNomeWs())); - break; } } } catch (Exception e) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "Eccezione nella fase di autenticazione del EJB " + e.getMessage())); - log.error("Eccezione nella fase di autenticazione del EJB ", e); + rispostaControlli.setDsErr( + MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, ERRORE_AUTENTICAZIONE + e.getMessage())); + log.error(ERRORE_AUTENTICAZIONE, e); } return rispostaControlli; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/WsIdpLogger.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/WsIdpLogger.java index 915fc56..452b404 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/WsIdpLogger.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/WsIdpLogger.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,17 +22,10 @@ */ package it.eng.parer.ws.ejb; -import it.eng.parer.idpjaas.logutils.IdpConfigLog; -import it.eng.parer.idpjaas.logutils.IdpLogger; -import it.eng.parer.idpjaas.logutils.LogDto; -import it.eng.parer.util.ejb.AppServerInstance; -import it.eng.parer.ws.dto.RispostaControlli; -import it.eng.parer.ws.utils.CostantiDB; -import it.eng.parer.ws.utils.ParametroApplDB; - import java.net.UnknownHostException; import java.sql.SQLException; import java.util.HashMap; + import javax.ejb.EJB; import javax.ejb.LocalBean; import javax.ejb.Stateless; @@ -23,13 +33,23 @@ import javax.ejb.TransactionAttributeType; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import it.eng.parer.idpjaas.logutils.IdpConfigLog; +import it.eng.parer.idpjaas.logutils.IdpLogger; +import it.eng.parer.idpjaas.logutils.LogDto; +import it.eng.parer.util.ejb.AppServerInstance; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.utils.ParametroApplDB; +import it.eng.spagoCore.util.JpaUtils; + /** * * @author fioravanti_f */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "WsIdpLogger") @LocalBean @TransactionAttribute(value = TransactionAttributeType.REQUIRED) @@ -67,6 +87,7 @@ public void scriviLog(LogDto logDto) { && !iamDefaults.get(ParametroApplDB.IDP_MAX_GIORNI).isEmpty() && iamDefaults.get(ParametroApplDB.IDP_MAX_TENTATIVI_FALLITI) != null && !iamDefaults.get(ParametroApplDB.IDP_MAX_TENTATIVI_FALLITI).isEmpty()) { + java.sql.Connection connection = null; try { IdpConfigLog icl = new IdpConfigLog(); icl.setQryRegistraEventoUtente(iamDefaults.get(ParametroApplDB.IDP_QRY_REGISTRA_EVENTO_UTENTE)); @@ -78,7 +99,7 @@ public void scriviLog(LogDto logDto) { logDto.setServername(asi.getName()); - java.sql.Connection connection = entityManager.unwrap(java.sql.Connection.class); + connection = JpaUtils.provideConnectionFrom(entityManager); IdpLogger.EsitiLog risposta = (new IdpLogger(icl).scriviLog(logDto, connection)); @@ -107,6 +128,14 @@ public void scriviLog(LogDto logDto) { throw new RuntimeException("WsIdpLogger: Errore nell'accesso ai dati di log: " + ex.getMessage()); } catch (Exception ex) { throw new RuntimeException("WsIdpLogger: Errore: " + ex.getMessage()); + } finally { + if (connection != null) { + try { + connection.close(); + } catch (SQLException ex) { + throw new RuntimeException("WsIdpLogger: Errore: " + ex.getMessage()); + } + } } } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/XmlFascCache.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/XmlFascCache.java index 1c11766..4d2d01f 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/XmlFascCache.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/XmlFascCache.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,9 +22,8 @@ */ package it.eng.parer.ws.ejb; -import it.eng.parer.ws.xml.versfascicolo.IndiceSIPFascicolo; -import it.eng.parer.ws.xml.versfascicoloresp.EsitoVersamentoFascicolo; import java.io.InputStream; + import javax.annotation.PostConstruct; import javax.ejb.LocalBean; import javax.ejb.Lock; @@ -19,10 +35,14 @@ import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; + import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import it.eng.parer.ws.xml.versfascicolo.IndiceSIPFascicolo; +import it.eng.parer.ws.xml.versfascicoloresp.EsitoVersamentoFascicolo; + /** * * @author fioravanti_f @@ -34,7 +54,7 @@ public class XmlFascCache { private static final Logger log = LoggerFactory.getLogger(XmlFascCache.class); - private final String URL_SCHEMA_REQUEST_FASCICOLO = "/it/eng/parer/ws/xml/versfascicolo/WSRequestIndiceSIPFascicolo_1.0.xsd"; + private final String URL_SCHEMA_REQUEST_FASCICOLO = "/it/eng/parer/ws/xml/versfascicolo/WSRequestIndiceSIPFascicolo.xsd"; // JAXBContext versReqFascicoloCtx; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/XmlUpdVersCache.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/XmlUpdVersCache.java index afd0e5a..12ecf0a 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/XmlUpdVersCache.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/XmlUpdVersCache.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.ejb; import javax.annotation.PostConstruct; @@ -102,4 +119,4 @@ public Schema getSchemaOfAggVersReq() { public Schema getSchemaOfAggVersResp() { return aggVersRespSchema; } -} \ No newline at end of file +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/XmlVersCache.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/XmlVersCache.java index 82be01d..0cb14a1 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/XmlVersCache.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/ejb/XmlVersCache.java @@ -1,16 +1,22 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.ejb; -import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; -import it.eng.parer.exception.SacerWsRuntimeException; -import it.eng.parer.ws.xml.versReq.DatiSpecificiType; -import it.eng.parer.ws.xml.versReq.UnitaDocAggAllegati; -import it.eng.parer.ws.xml.versReq.UnitaDocumentaria; -import it.eng.parer.ws.xml.versReqMultiMedia.IndiceMM; -import it.eng.parer.ws.xml.versResp.EsitoVersAggAllegati; -import it.eng.parer.ws.xml.versResp.EsitoVersamento; -import it.eng.parer.ws.xml.versResp.RapportoVersamento; -import it.eng.parerxml.xsd.FileXSD; -import it.eng.parerxml.xsd.FileXSDUtil; import javax.annotation.PostConstruct; import javax.ejb.LocalBean; import javax.ejb.Lock; @@ -22,10 +28,23 @@ import javax.xml.bind.JAXBException; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xml.sax.SAXException; +import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; +import it.eng.parer.exception.SacerWsRuntimeException; +import it.eng.parer.ws.xml.versReq.DatiSpecificiType; +import it.eng.parer.ws.xml.versReq.UnitaDocAggAllegati; +import it.eng.parer.ws.xml.versReq.UnitaDocumentaria; +import it.eng.parer.ws.xml.versReqMultiMedia.IndiceMM; +import it.eng.parer.ws.xml.versResp.EsitoVersAggAllegati; +import it.eng.parer.ws.xml.versResp.EsitoVersamento; +import it.eng.parer.ws.xml.versResp.RapportoVersamento; +import it.eng.parerxml.xsd.FileXSD; +import it.eng.parerxml.xsd.FileXSDUtil; + /** * Contains the JAXBContext for versamento ws * @@ -126,4 +145,4 @@ public Schema getSchemaOfVersReq() { public Schema getSchemaOfVersResp() { return versRespSchema; } -} \ No newline at end of file +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/AvanzamentoWs.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/AvanzamentoWs.java index 737573c..48af1ba 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/AvanzamentoWs.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/AvanzamentoWs.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* */ package it.eng.parer.ws.utils; @@ -11,6 +28,7 @@ */ public class AvanzamentoWs implements java.io.Serializable { + private static final long serialVersionUID = 1L; private static final Logger log = LoggerFactory.getLogger(AvanzamentoWs.class); public enum Funzioni { @@ -23,8 +41,8 @@ public enum Funzioni { public enum CheckPoints { Inizio, TrasferimentoPayloadIn, VerificaStrutturaChiamataWs, VerificaSemantica, VerificaCoerenzaComponentiFile, - VerificaFirmeComponenti, VerificaFormatoFileComponenti, SalvataggioDatiVersati, SalvataggioSessioneWS, - InvioMessaggioCodaJMS, CreazioneRisposta, InvioRisposta, Pulizia, Fine + VerificaFirmeComponenti, VerificaFormatoFileComponenti, CopiaBackendStaging, SalvataggioDatiVersati, + SalvataggioSessioneWS, InvioMessaggioCodaJMS, CreazioneRisposta, InvioRisposta, Pulizia, Fine } // diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/BinEncUtility.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/BinEncUtility.java index 71c8c3f..dbc7518 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/BinEncUtility.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/BinEncUtility.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,13 +22,18 @@ */ package it.eng.parer.ws.utils; -import java.io.UnsupportedEncodingException; -import org.apache.commons.codec.DecoderException; +import java.nio.charset.StandardCharsets; + import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Hex; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; +import it.eng.parer.exception.SacerWsRuntimeException; + /** * * @author fioravanti_f @@ -20,6 +42,10 @@ public class BinEncUtility { private static final Logger logger = LoggerFactory.getLogger(BinEncUtility.class); + private BinEncUtility() { + throw new IllegalStateException("Utility class"); + } + public static boolean isBase64String(String utf8str) { return Base64.isBase64(utf8str); } @@ -27,22 +53,23 @@ public static boolean isBase64String(String utf8str) { public static String encodeUTF8Base64String(byte[] barray) { if (barray != null && barray.length > 0) { try { - return new String(Base64.encodeBase64(barray), "UTF-8"); - } catch (UnsupportedEncodingException ex) { - logger.error("Encoding UTF-8 non supportato"); - throw new RuntimeException(ex.getMessage()); + return new String(Base64.encodeBase64(barray), StandardCharsets.UTF_8.name()); + } catch (Exception ex) { + /* critical error */ + throw new SacerWsRuntimeException(ex, SacerWsErrorCategory.INTERNAL_ERROR); } } else { - return ""; + return StringUtils.EMPTY; } } public static byte[] decodeUTF8Base64String(String utf8str) { try { - return Base64.decodeBase64(utf8str.getBytes("UTF-8")); - } catch (UnsupportedEncodingException ex) { - logger.error("Encoding UTF-8 non supportato"); - throw new RuntimeException(ex.getMessage()); + return Base64.decodeBase64(utf8str.getBytes(StandardCharsets.UTF_8.name())); + } catch (Exception ex) { + /* managed error */ + logger.warn("Encoding UTF-8 non supportato", ex); + return ArrayUtils.EMPTY_BYTE_ARRAY; } } @@ -54,16 +81,17 @@ public static String encodeUTF8HexString(byte[] barray) { if (barray != null && barray.length > 0) { return Hex.encodeHexString(barray); } else { - return ""; + return StringUtils.EMPTY; } } public static byte[] decodeUTF8HexString(String hexstr) { try { return Hex.decodeHex(hexstr.toCharArray()); - } catch (DecoderException ex) { - logger.error("La stringa non rappresenta un numero in base 16"); - throw new RuntimeException(ex.getMessage()); + } catch (Exception ex) { + /* managed error */ + logger.warn("La stringa non rappresenta un numero in base 16", ex); + return ArrayUtils.EMPTY_BYTE_ARRAY; } } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/CollectionUtility.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/CollectionUtility.java index 262276c..42ac801 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/CollectionUtility.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/CollectionUtility.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ControlliWSBundle.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ControlliWSBundle.java index 38ad945..5a9d0c3 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ControlliWSBundle.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ControlliWSBundle.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -11,9 +28,9 @@ import javax.naming.NamingException; import org.apache.commons.lang3.exception.ExceptionUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; +import it.eng.parer.exception.SacerWsRuntimeException; import it.eng.parer.ws.versamentoUpd.dto.ControlloWSResp; /** @@ -23,8 +40,6 @@ public class ControlliWSBundle { - private static Logger log = LoggerFactory.getLogger(ControlliWSBundle.class); - public static final String DEFAULT_LOCALE = "it"; /* @@ -61,9 +76,9 @@ private static ControlliWSCache lookupCacheRef() { try { return (ControlliWSCache) new InitialContext().lookup("java:app/sacerws-ejb/ControlliWSCache"); } catch (NamingException ex) { - log.error("Errore lookup dei messaggi " + ExceptionUtils.getRootCauseMessage(ex), ex); - throw new RuntimeException( - "Errore lookup singleton dei messaggi " + ExceptionUtils.getRootCauseMessage(ex)); + throw new SacerWsRuntimeException( + "Errore lookup singleton dei messaggi " + ExceptionUtils.getRootCauseMessage(ex), + SacerWsErrorCategory.INTERNAL_ERROR); } } @@ -127,6 +142,8 @@ private static ControlliWSCache lookupCacheRef() { public static final String CTRL_UD_PROFILOUD = "controlloProfiloUnitaDoc"; + public static final String CTRL_UD_PROFILONORMATIVO = "controlloProfiloNormativo"; + public static final String CTRL_UD_DATISPECIFICI = "controlloDatiSpecUnitaDoc"; public static final String CTRL_UD_DATISPECIFICIMIGRAZ = "controlloDatiSpecUnitaDocMigraz"; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ControlliWSCache.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ControlliWSCache.java index 6aad550..e51cf43 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ControlliWSCache.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ControlliWSCache.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,11 +22,8 @@ */ package it.eng.parer.ws.utils; -import java.math.BigDecimal; import java.text.MessageFormat; -import java.util.Comparator; import java.util.HashMap; -import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -26,6 +40,8 @@ import org.slf4j.LoggerFactory; import it.eng.parer.entity.DecControlloWs; +import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; +import it.eng.parer.exception.SacerWsRuntimeException; import it.eng.parer.ws.versamentoUpd.dto.ControlloWSResp; /** @@ -57,9 +73,7 @@ public void initSingleton() { cnt.getCdFamigliaControllo(), cnt.getDsControlloWs(), cnt.getNiOrdControllo())); } } catch (RuntimeException ex) { - // log.fatal("Inizializzazione singleton ControlliWSCache fallita! ", ex); - log.error("Inizializzazione singleton ControlliWSCache fallita! ", ex); - throw ex; + throw new SacerWsRuntimeException(ex, SacerWsErrorCategory.INTERNAL_ERROR); } log.info("Inizializzazione singleton ControlliWSCache... completata."); } @@ -71,7 +85,7 @@ public String getString(String cdControllo) { @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public String getString(String cdControllo, Object... params) { - return StringEscapeUtils.unescapeJava(MessageFormat.format(controlliMap.get(controlliMap).toString(), params)); + return StringEscapeUtils.unescapeJava(MessageFormat.format(controlliMap.get(cdControllo).toString(), params)); } @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ControlliWSHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ControlliWSHelper.java index fd65a14..831a8a1 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ControlliWSHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ControlliWSHelper.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -21,11 +38,10 @@ import org.slf4j.LoggerFactory; import it.eng.parer.entity.DecControlloWs; +import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; +import it.eng.parer.exception.SacerWsRuntimeException; -/** - * - * @author sinatti_s - */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "ControlliWSHelper") @LocalBean @TransactionManagement(TransactionManagementType.CONTAINER) @@ -52,9 +68,7 @@ public DecControlloWs caricaCdControlloWs(String cdControlloWs) { query.setParameter("cdControlloWs", cdControlloWs); tmperr = (DecControlloWs) query.getSingleResult(); } catch (RuntimeException ex) { - // log.fatal("ControlliWSHelper.caricaDecControlloWs fallita! ", ex); - log.error("ControlliWSHelper.caricaDecControlloWs fallita! ", ex); - throw ex; + throw new SacerWsRuntimeException(ex, SacerWsErrorCategory.INTERNAL_ERROR); } return tmperr; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/Costanti.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/Costanti.java index 33d8859..cd28a67 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/Costanti.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/Costanti.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -17,16 +34,10 @@ public class Costanti { public static final String WS_VERSAMENTO_VRSN = "1.5"; public static final String WS_AGGIUNTA_VRSN = "1.4"; public static final String WS_VERS_FASCICOLO_VRSN = "1.0"; - public static final String WS_AGGIORNAMENTO_VERS_VRSN = "1.4"; + public static final String WS_AGGIORNAMENTO_VERS_VRSN = "1.5"; /** * Si reperiscono da DB (parametri applicativi) */ - // public static final String[] WS_VERSAMENTO_COMP = {"1.1", "1.2", "1.25", - // "1.3", "1.4", "1.5"}; - // public static final String[] WS_AGGIUNTA_COMP = {"1.3", "1.4","1.5"}; - // public static final String[] WS_VERS_FASCICOLO_COMP = {"1.0"}; - // public static final String[] WS_AGGIORNAMENTO_VERS_COMP = {"1.4"}; - // public static final String WS_VERSAMENTO_NOME = "VersamentoSync"; public static final String WS_AGGIUNTA_DOC_NOME = "AggiuntaAllegatiSync"; @@ -46,7 +57,7 @@ public class Costanti { public class UrnFormatter { private UrnFormatter() { - throw new IllegalStateException("Utility class"); + throw new IllegalStateException("UrnFormatter Utility class"); } public static final char URN_STD_SEPARATOR = ':'; @@ -168,24 +179,53 @@ private UrnFormatter() { // AWS public class AwsFormatter { + + private AwsFormatter() { + throw new IllegalStateException("AwsFormatter Utility class"); + } + public static final String COMP_CD_KEY_FILE_FMT = "{0}/{1}/{2}/{3}/{4}/{5}"; public static final String COMP_REPORTVF_CD_KEY_FILE_FMT = COMP_CD_KEY_FILE_FMT + "/{6}"; } + // + public class AwsConstants { + + private AwsConstants() { + throw new IllegalStateException("AwsS3Constants Utility class"); + } + + // custom tags + public static final String TAG_KEY_VRSOBJ_TYPE = "vrs-object-type"; + public static final String TAG_VALUE_VRSOBJ_FILE_COMP = "file_componente_uddoc"; + public static final String TAG_VALUE_VRSOBJ_METADATI = "xml_metadati_uddoc"; + public static final String TAG_VALUE_VRSOBJ_TMP = "temporany"; + + public static final String TAG_KEY_RVF_CDSERV = "rvf-cd-service"; + public static final String TAG_KEY_RVF_NMVERS = "rvf-nm-version"; + + // custom metadata + public static final String MEATADATA_INGEST_NODE = "ingest-node"; + public static final String MEATADATA_INGEST_TIME = "ingest-time"; + + } + // public class JMSMsgProperties { + private JMSMsgProperties() { + throw new IllegalStateException("JMSMsgProperties Utility class"); + } + // msg properties - public final static String MSG_K_PAYLOADTYPE = "tipoPayload"; - public final static String MSG_K_STATUS = "statoElenco"; - public final static String MSG_K_APP = "fromApplication"; + public static final String MSG_K_PAYLOADTYPE = "tipoPayload"; + public static final String MSG_K_STATUS = "statoElenco"; + public static final String MSG_K_APP = "fromApplication"; } - // - // // public enum ModificatoriWS { @@ -215,8 +255,13 @@ public enum ModificatoriWS { // end MEV#23176 TAG_PROFILI_1_5, // MEV#25288 - TAG_URN_SIP_FASC_1_1 // tag per urn dei sip in Esito Versamento e Rapporto di Versamento dei Fascicoli + TAG_URN_SIP_FASC_1_1, // tag per urn dei sip in Esito Versamento e Rapporto di Versamento dei + // Fascicoli // end MEV#25288 + // MEV#26423 + TAG_PROFILI_UPD_1_6, // tag per ProfiloNormativo servizio aggiornamento versamento + // MEV#28309 + TAG_DATISPEC_DEL_1_6 // tag per eliminazione DatiSpecifici servizio aggiornamento versamento } @@ -225,18 +270,18 @@ public enum CategoriaDocumento { Principale(CostantiDB.TipoDocumento.PRINCIPALE, 1), Allegato(CostantiDB.TipoDocumento.ALLEGATO, 2), Annotazione(CostantiDB.TipoDocumento.ANNOTAZIONE, 3), Annesso(CostantiDB.TipoDocumento.ANNESSO, 4), Documento(Costanti.UrnFormatter.URN_DOC_PREFIX);// "categoria" - // speciale, - // in - // quanto - // utilizzata - // esclusivamente - // per - // il - // supporto - // legato - // alla - // composizione - // dell'URN + // speciale, + // in + // quanto + // utilizzata + // esclusivamente + // per + // il + // supporto + // legato + // alla + // composizione + // dell'URN private String valore; private int ordine; @@ -286,7 +331,8 @@ public enum TipiWSPerControlli { */ public enum VersioneWS { - V_EMPTY(""), V1_0("1.0"), V1_1("1.1"), V1_2("1.2"), V1_25("1.25"), V1_3("1.3"), V1_4("1.4"), V1_5("1.5"); + V_EMPTY(""), V1_0("1.0"), V1_1("1.1"), V1_2("1.2"), V1_25("1.25"), V1_3("1.3"), V1_4("1.4"), V1_5("1.5"), + V1_6("1.6"); private String version; @@ -312,10 +358,12 @@ public static VersioneWS evalute(String versione) { } public static final String VERIFICA_FIRMA_METADATI_REPORT_NOVERSION = "NO_VERSION"; // VERS_FMT_STRING + - // UD_FMT_STRING + // UD_FMT_STRING public enum GenReportVerificaFirma { OFF, ON, ALL; } + public static final String ERRORE_CLIENT_ERRATO = "QUESTO E' UN ERRORE PROVOCATO DA UN CLIENT SCRITTO MALE: SQLIntegrityConstraintViolationException "; + } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/CostantiDB.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/CostantiDB.java index 1e2b6b4..7c2ae01 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/CostantiDB.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/CostantiDB.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -16,6 +33,9 @@ public class CostantiDB { // public class DatiCablati { + private DatiCablati() { + throw new IllegalStateException("DatiCablati Utility class"); + } public static final String TPI_PATH_LISTA_FILE = "ListaFile"; public static final String VERS_TIPO_CONSERVAZIONE_DEFAULT = "VERSAMENTO_ANTICIPATO"; @@ -23,6 +43,9 @@ public class DatiCablati { // public class TipoDocumento { + private TipoDocumento() { + throw new IllegalStateException("TipoDocumento Utility class"); + } public static final String PRINCIPALE = "PRINCIPALE"; public static final String ALLEGATO = "ALLEGATO"; @@ -33,6 +56,10 @@ public class TipoDocumento { // public class TipiXmlDati { + private TipiXmlDati() { + throw new IllegalStateException("TipiXmlDati Utility class"); + } + public static final String INDICE_FILE = "INDICE_FILE"; public static final String RICHIESTA = "RICHIESTA"; public static final String RISPOSTA = "RISPOSTA"; @@ -42,6 +69,10 @@ public class TipiXmlDati { // public class TipoUsoComponente { + private TipoUsoComponente() { + throw new IllegalStateException("TipoUsoComponente Utility class"); + } + public static final String CONTENUTO = "CONTENUTO"; public static final String CONVERTITORE = "CONVERTITORE"; public static final String FIRMA = "FIRMA"; @@ -53,6 +84,10 @@ public class TipoUsoComponente { public class SubStruttura { + private SubStruttura() { + throw new IllegalStateException("SubStruttura Utility class"); + } + public static final String DEFAULT_NAME = "DEFAULT"; public static final String DEFAULT_DESC = "Sub struttura di default per la struttura "; public static final String DEFAULT_TEMPLATE_DESC = "Sub struttura di default"; @@ -659,8 +694,8 @@ public enum TipoModLacuna { DESCRIZIONE, RANGE_PROGRESSIVI } - public static final BigDecimal NUM_SERIE_36 = new BigDecimal(0.3); - public static final BigDecimal NUM_SERIE_24 = new BigDecimal(0.5); + public static final BigDecimal NUM_SERIE_36 = BigDecimal.valueOf(0.3); + public static final BigDecimal NUM_SERIE_24 = BigDecimal.valueOf(0.5); public static final BigDecimal NUM_SERIE_12 = new BigDecimal(1); public static final BigDecimal NUM_SERIE_6 = new BigDecimal(2); public static final BigDecimal NUM_SERIE_4 = new BigDecimal(3); @@ -831,11 +866,9 @@ public static String[] getStatiControlloItem() { // DA MODIFICARE IN CASO DI // AGGIUNTE - String[] stati = new String[] { CostantiDB.TipoErrRichAnnulVers.ITEM_IN_CORSO_DI_ANNUL.name(), - CostantiDB.TipoErrRichAnnulVers.ITEM_RIFERITO.name(), - CostantiDB.TipoErrRichAnnulVers.ITEM_VERSATA_IN_DATA_RICH.name(), - CostantiDB.TipoErrRichAnnulVers.STATO_CONSERV_NON_AMMESSO.name() }; - return stati; + return new String[] { TipoErrRichAnnulVers.ITEM_IN_CORSO_DI_ANNUL.name(), + TipoErrRichAnnulVers.ITEM_RIFERITO.name(), TipoErrRichAnnulVers.ITEM_VERSATA_IN_DATA_RICH.name(), + TipoErrRichAnnulVers.STATO_CONSERV_NON_AMMESSO.name() }; } } @@ -899,6 +932,10 @@ public enum TiParte { ANNO, CLASSIF, PROGR_FASC, PROGR_SUB_FASC } + public enum TiStatoSesioneVers { + CHIUSA_OK, CHIUSA_ERR + } + // public class Flag { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/FlagConverter.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/FlagConverter.java index e4bc2a9..cfad3e4 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/FlagConverter.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/FlagConverter.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.utils; /** diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/HashCalculator.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/HashCalculator.java index cda833b..be1c46f 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/HashCalculator.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/HashCalculator.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -12,6 +29,7 @@ import java.security.DigestInputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; + import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/HashUtility.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/HashUtility.java index 296ad3c..39a4d82 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/HashUtility.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/HashUtility.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,15 +22,17 @@ */ package it.eng.parer.ws.utils; -import it.eng.parer.ws.utils.CostantiDB.TipiHash; import java.io.IOException; import java.io.InputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; + import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import it.eng.parer.ws.utils.CostantiDB.TipiHash; + /** * * @author fioravanti_f @@ -22,6 +41,10 @@ public class HashUtility { private static final Logger logger = LoggerFactory.getLogger(HashUtility.class); + private HashUtility() { + throw new IllegalStateException("Utility class"); + } + public static Hashresult calculate(InputStream is) throws NoSuchAlgorithmException, IOException { MessageDigest mdMd5 = MessageDigest.getInstance(TipiHash.MD5.descrivi()); MessageDigest mdSha1 = MessageDigest.getInstance(TipiHash.SHA_1.descrivi()); @@ -35,12 +58,12 @@ public static Hashresult calculate(InputStream is) throws NoSuchAlgorithmExcepti int BUFFER_SIZE = 10 * 1024 * 1024; try { - logger.debug("Provider md5" + mdMd5.getProvider()); - logger.debug("Provider sha1" + mdSha1.getProvider()); - logger.debug("Provider sha224" + mdSha224.getProvider()); - logger.debug("Provider sha256" + mdSha256.getProvider()); - logger.debug("Provider sha384" + mdSha384.getProvider()); - logger.debug("Provider sha512" + mdSha512.getProvider()); + logger.debug("Provider md5 {}", mdMd5.getProvider()); + logger.debug("Provider sha1 {}", mdSha1.getProvider()); + logger.debug("Provider sha224 {}", mdSha224.getProvider()); + logger.debug("Provider sha256 {}", mdSha256.getProvider()); + logger.debug("Provider sha384 {}", mdSha384.getProvider()); + logger.debug("Provider sha512 {}", mdSha512.getProvider()); byte[] buffer = new byte[BUFFER_SIZE]; while ((letti = is.read(buffer)) != -1) { mdMd5.update(buffer, 0, letti); @@ -49,7 +72,7 @@ public static Hashresult calculate(InputStream is) throws NoSuchAlgorithmExcepti mdSha256.update(buffer, 0, letti); mdSha384.update(buffer, 0, letti); mdSha512.update(buffer, 0, letti); - logger.trace("Letti " + letti + " bytes"); + logger.trace("Letti {} bytes", letti); } } finally { IOUtils.closeQuietly(is); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/Hashresult.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/Hashresult.java index 0b4d03f..f1ff952 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/Hashresult.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/Hashresult.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/JAXBUtils.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/JAXBUtils.java index 671b387..56d07c5 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/JAXBUtils.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/JAXBUtils.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.utils; import javax.xml.bind.JAXBElement; @@ -10,7 +27,12 @@ */ public class JAXBUtils { - // standard di estrazione valore stringa di un elemento opzionale con nillable=true + private JAXBUtils() { + throw new IllegalStateException("Utility class"); + } + + // standard di estrazione valore stringa di un elemento opzionale con + // nillable=true // default null if black or null or not present public static String getStringValFromJAXBElement(JAXBElement node) { return node != null && !node.isNil() && StringUtils.isNotBlank(node.getValue()) ? node.getValue() : null; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/KeyOrdUtility.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/KeyOrdUtility.java index 3b10410..d94bc09 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/KeyOrdUtility.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/KeyOrdUtility.java @@ -1,12 +1,26 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.utils; -import it.eng.parer.ws.dto.CSChiave; -import it.eng.parer.ws.dto.RispostaControlli; -import it.eng.parer.ws.versamento.dto.ConfigRegAnno; import java.util.Arrays; import java.util.Objects; import java.util.regex.Matcher; @@ -14,6 +28,10 @@ import org.apache.commons.lang3.StringUtils; +import it.eng.parer.ws.dto.CSChiave; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.versamento.dto.ConfigRegAnno; + /** * * @author Fioravanti_F diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/KeySizeUtility.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/KeySizeUtility.java index 140e3ca..a899b6e 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/KeySizeUtility.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/KeySizeUtility.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,13 +22,12 @@ */ package it.eng.parer.ws.utils; -import it.eng.parer.entity.constraint.AroCompUrnCalc.TiUrn; +import java.util.Date; + import it.eng.parer.ws.dto.CSChiave; import it.eng.parer.ws.dto.CSVersatore; import it.eng.parer.ws.utils.Costanti.CategoriaDocumento; -import java.util.Date; - /** * * @author fioravanti_f @@ -46,11 +62,11 @@ public void setTpiRootArkVers(String tpiRootArkVers) { } - public final static int MAX_LEN_REGISTRO_IN_CHIAVEORD = 75; + public static final int MAX_LEN_REGISTRO_IN_CHIAVEORD = 75; // - public final static int MAX_LEN_CHIAVEORD = 100; - public final static int MAX_LEN_URN = 254; - public final static int MAX_LEN_FILENAME_ARK = 254; + public static final int MAX_LEN_CHIAVEORD = 100; + public static final int MAX_LEN_URN = 254; + public static final int MAX_LEN_FILENAME_ARK = 254; // private int maxLenNumero = 0; private int lenURN = 0; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/LogSessioneUtils.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/LogSessioneUtils.java index 69ad222..c8ff5b1 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/LogSessioneUtils.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/LogSessioneUtils.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -17,7 +34,11 @@ public class LogSessioneUtils { // - private final static int DS_ERR_MAX_LEN = 1024; + private static final int DS_ERR_MAX_LEN = 1024; + + private LogSessioneUtils() { + throw new IllegalStateException("Utility class"); + } public static Date getDatePart(Date date) { Calendar cal = Calendar.getInstance(); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSBundle.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSBundle.java index b07d69e..96e5118 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSBundle.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSBundle.java @@ -1,3 +1,19 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ /* * (written by Francesco Fioravanti) @@ -58,7 +74,6 @@ private static MessaggiWSCache lookupCacheRef() { try { return (MessaggiWSCache) new InitialContext().lookup("java:app/sacerws-ejb/MessaggiWSCache"); } catch (NamingException ex) { - log.error("Errore lookup dei messaggi {}", ExceptionUtils.getRootCauseMessage(ex), ex); throw new SacerWsRuntimeException( "Errore lookup singleton dei messaggi " + ExceptionUtils.getRootCauseMessage(ex), SacerWsErrorCategory.INTERNAL_ERROR); @@ -1213,6 +1228,11 @@ private static String getDefaultErrorMessage(String key, Object... params) { */ public static final String DATISPEC_003_001 = "DATISPEC-003-001"; + /** + * {0} {1}: I dati specifici attesi non coincidono con l''XSD + */ + public static final String DATISPEC_003_002 = "DATISPEC-003-002"; + /** * {0} {1}: La versione di dati specifici {2} indicata per il tipo {0} {3} non esiste. */ @@ -1271,6 +1291,20 @@ private static String getDefaultErrorMessage(String key, Object... params) { */ public static final String PROFNORM_001_004 = "PROFNORM-001-004"; + /** + * {0} {1}: Esiste un xsd di profilo normativo associato a {2} attivo alla data di versamento. Eliminazione non + * consentita per l''elemento ProfiloNormativo. + */ + public static final String PROFNORM_001_005 = "PROFNORM-001-005"; + /** + * {0} {1}: Profilo Normativo non presente nell''xml del SIP per l''Unità Documentaria. Eliminazione non consentita + * per l''elemento ProfiloNormativo. + */ + public static final String PROFNORM_001_006 = "PROFNORM-001-006"; + /** + * Necessario valorizzare xml del Profilo Normativo per la versione specificata + */ + public static final String PROFNORM_001_007 = "PROFNORM-001-007"; /** * Componente {0}: per questo componente è obbligatorio indicare l''hash */ @@ -1704,5 +1738,4 @@ private static String getDefaultErrorMessage(String key, Object... params) { public static final String SERVIZI_USR_005 = "SERVIZI-USR-005"; // - } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSCache.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSCache.java index fbc3278..b5558c3 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSCache.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSCache.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,14 +22,14 @@ */ package it.eng.parer.ws.utils; -import it.eng.parer.entity.DecErrSacer; -import it.eng.parer.exception.SacerWsRuntimeException; -import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; - import java.text.MessageFormat; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; +import java.util.stream.Stream; + import javax.annotation.PostConstruct; import javax.ejb.EJB; import javax.ejb.Singleton; @@ -24,6 +41,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import it.eng.parer.entity.DecErrSacer; +import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; +import it.eng.parer.exception.SacerWsRuntimeException; + /** * * @author fioravanti_f @@ -47,7 +68,8 @@ public void initSingleton() { List list = messaggiWSHelper.caricaListaErrori(); errorMap = new HashMap<>(); for (DecErrSacer err : list) { - errorMap.put(err.getCdErr(), err.getDsErr()); + errorMap.put(err.getCdErr(), StringEscapeUtils.unescapeJava(err.getDsErr())); // Unescape java-like + // every message } } catch (RuntimeException ex) { throw new SacerWsRuntimeException(ex, SacerWsErrorCategory.INTERNAL_ERROR); @@ -57,12 +79,31 @@ public void initSingleton() { @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public String getString(String key) { - return StringEscapeUtils.unescapeJava(errorMap.get(key)); + return errorMap.get(key); } @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public String getString(String key, Object... params) { - return StringEscapeUtils.unescapeJava(MessageFormat.format(errorMap.get(key), params)); + return MessageFormat.format(errorMap.get(key), cleanTextContent(params)); + } + + /* + * Clean up placeholder (from XML) + */ + private Object[] cleanTextContent(Object... params) { + List cleanedTxtParams = new ArrayList<>(); + Stream.of(params).filter(Objects::nonNull).forEach(param -> { + String sparam = param.toString(); // force toString() + // erases all the ASCII control characters + sparam = sparam.replaceAll("[\\p{Cntrl}&&[^\r\n\t]]", "?"); + // removes non-printable characters from Unicode + sparam = sparam.replaceAll("\\p{C}", "?"); + // unescape XML of sparam + sparam = StringEscapeUtils.unescapeXml(sparam); + // final result + cleanedTxtParams.add(sparam); + }); + return cleanedTxtParams.toArray(new Object[0]); } } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSFormat.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSFormat.java index b0255a2..6bcb4ac 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSFormat.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSFormat.java @@ -1,12 +1,32 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.utils; +import static it.eng.parer.util.DateUtilsConverter.convert; + import java.text.MessageFormat; import java.text.Normalizer; import java.text.SimpleDateFormat; +import java.time.ZonedDateTime; import java.util.Calendar; import java.util.Date; import java.util.Optional; @@ -21,8 +41,6 @@ import it.eng.parer.ws.dto.CSChiaveFasc; import it.eng.parer.ws.dto.CSVersatore; import it.eng.parer.ws.utils.Costanti.CategoriaDocumento; -import java.time.ZonedDateTime; -import static it.eng.parer.util.DateUtilsConverter.convert; /** * @@ -35,13 +53,6 @@ private MessaggiWSFormat() { } // - public static String bonificaUrnPerNomeFile(String urn) { - return urn.replaceAll("[^A-Za-z0-9\\. _-]", "_"); - } - - public static String bonificaID(String iD) { - return iD.replace(" ", "_"); - } // MEV#16490 public static String formattaUrnPartVersatore(CSVersatore versatore) { @@ -89,12 +100,6 @@ public static String formattaUrnPartDocumento(CategoriaDocumento categoria, int pgpad ? String.format(padfmtUsed, progressivo) : progressivo); } - // - public static String formattaChiaveDocumento(String chiaveUd, CategoriaDocumento categoria, int progressivo) { - return formattaChiaveDocumento(chiaveUd, categoria, progressivo, false, - Costanti.UrnFormatter.CHIAVE_DOC_FMT_STRING, Costanti.UrnFormatter.PADNODIGITS_FMT); - } - // public static String formattaChiaveDocumento(String chiaveUd, CategoriaDocumento categoria, int progressivo, boolean pgpad, String fmtUsed, String padfmtUsed) { @@ -102,15 +107,6 @@ public static String formattaChiaveDocumento(String chiaveUd, CategoriaDocumento formattaUrnPartDocumento(categoria, progressivo, pgpad, fmtUsed, padfmtUsed)); } - /* - * OLD ONE (in questo caso non si è "generalizzato" dato che la logica di calcola della chiave del componentente è - * del tutto nuova) Vedi sotto : è di fatto cambiata la firma del metodo ! - */ - public static String formattaChiaveComponente(String chiaveDoc, int progressivoStrutDoc, long progressivoComp) { - return MessageFormat.format(Costanti.UrnFormatter.CHIAVE_COMP_FMT_STRING, chiaveDoc, progressivoStrutDoc, - progressivoComp); - } - // public static String formattaChiaveComponente(String chiaveDoc, long ordinePresentazione, String fmtUsed, String padfmtUsed) { @@ -191,12 +187,6 @@ public static String formattaFilePathArk(String root, String rootVers, String pa pathVersatore, pathUd, nomeFile); } - public static String formattaFileLogRetrieve(CSVersatore versatore, CSChiave chiave) { - return MessageFormat.format(Costanti.UrnFormatter.FNAME_LOG_TSM_RETRIEVE, versatore.getAmbiente(), - versatore.getEnte(), versatore.getStruttura(), chiave.getTipoRegistro(), chiave.getAnno().toString(), - chiave.getNumero()); - } - public static Long formattaKeyPartAnnoMeseVers(Date dtVersamento) { Calendar date = Calendar.getInstance(); date.setTime(dtVersamento); @@ -227,36 +217,18 @@ public static String formattaUrnDocUniDoc(String urnBase) { return MessageFormat.format(Costanti.UrnFormatter.URN_DOC_UNI_DOC_FMT_STRING, urnBase); } - // old URN - public static String formattaUrnIndiceSip(String urnBase) { - return formattaUrnIndiceSip(urnBase, Costanti.UrnFormatter.URN_INDICE_SIP_FMT_STRING); // default - } - public static String formattaUrnIndiceSip(String urnBase, String fmtUsed) { return MessageFormat.format(fmtUsed, urnBase); } - public static String formattaUrnPiSip(String urnBase) { - return formattaUrnPiSip(urnBase, Costanti.UrnFormatter.URN_PI_SIP_FMT_STRING); - } - public static String formattaUrnPiSip(String urnBase, String fmtUsed) { return MessageFormat.format(fmtUsed, urnBase); } - public static String formattaUrnEsitoVers(String urnBase) { - return formattaUrnEsitoVers(urnBase, Costanti.UrnFormatter.URN_ESITO_VERS_FMT_STRING); - } - public static String formattaUrnEsitoVers(String urnBase, String fmtUsed) { return MessageFormat.format(fmtUsed, urnBase); } - // old urn - public static String formattaUrnRappVers(String urnBase) { - return formattaUrnRappVers(urnBase, Costanti.UrnFormatter.URN_RAPP_VERS_FMT_STRING); - } - public static String formattaUrnRappVers(String urnBase, String fmtUsed) { return MessageFormat.format(fmtUsed, urnBase); } @@ -292,45 +264,23 @@ public static String formattaChiaveFascicolo(CSVersatore versatore, CSChiaveFasc } } - public static String formattaUrnIndiceSipFasc(String urnBase) { - return formattaUrnIndiceSip(urnBase, Costanti.UrnFormatter.URN_INDICE_SIP_FASC_FMT_STRING); - } - public static String formattaUrnIndiceSipFasc(String urnBase, String fmtUsed) { return MessageFormat.format(fmtUsed, urnBase); } - public static String formattaUrnRappVersFasc(String urnBase) { - return formattaUrnRappVersFasc(urnBase, Costanti.UrnFormatter.URN_RAPP_VERS_FASC_FMT_STRING); - } - public static String formattaUrnRappVersFasc(String urnBase, String fmtUsed) { return MessageFormat.format(fmtUsed, urnBase); } - public static String formattaUrnRappNegFasc(String urnBase) { - return MessageFormat.format(Costanti.UrnFormatter.URN_RAPP_NEG_FASC_FMT_STRING, urnBase); - } - public static String formattaUrnPartFasc(CSChiaveFasc chiave) { return MessageFormat.format(Costanti.UrnFormatter.FASC_FMT_STRING, chiave.getAnno().toString(), chiave.getNumero()); } - // AGGIORNAMENTO UD - public static String formattaBaseUrnUpdUnitaDoc(String versatore, String unitaDoc) { - return formattaBaseUrnUpdUnitaDoc(versatore, unitaDoc, Costanti.UrnFormatter.UPD_FMT_STRING); - } - public static String formattaBaseUrnUpdUnitaDoc(String versatore, String unitaDoc, String fmtUsed) { return MessageFormat.format(fmtUsed, versatore, unitaDoc, -1); } - // OLD URN - public static String formattaBaseUrnUpdUnitaDoc(String versatore, String unitaDoc, long progressivo) { - return formattaBaseUrnUpdUnitaDoc(versatore, unitaDoc, progressivo, false); - } - // NEW URN /* * Al passaggio dei nuovi URN (V2) sarà sufficiente cambiare il valore del boolean (vedi sopra) @@ -347,37 +297,20 @@ public static String formattaBaseUrnUpdUnitaDoc(String versatore, String unitaDo pgpad ? String.format(padFmtUsed, progressivo) : progressivo); } - public static String formattaUrnPartRappVersUpd(String urnBase) { - return formattaUrnPartRappVersUpd(urnBase, Costanti.UrnFormatter.URN_RAPP_VERS_FMT_STRING); - } - public static String formattaUrnPartRappVersUpd(String urnBase, String fmtUsed) { return MessageFormat.format(fmtUsed, urnBase); } - public static String formattaUrnIndiceSipUpd(String urnBase) { - return formattaUrnIndiceSipUpd(urnBase, Costanti.UrnFormatter.URN_INDICE_SIP_FMT_STRING); - } - public static String formattaUrnIndiceSipUpd(String urnBase, String fmtUsed) { return MessageFormat.format(fmtUsed, urnBase); } public static String formattaUrnReportVerificaFirma(String urnBase, String fmtUsed) { - return formattaUrnReportVerificaFirma(urnBase, fmtUsed, false); - } - - private static String formattaUrnReportVerificaFirma(String urnBase, String fmtUsed, boolean toNormalize) { - return MessageFormat.format(fmtUsed, toNormalize ? MessaggiWSFormat.normalizingKey(urnBase) : urnBase); + return MessageFormat.format(fmtUsed, urnBase); } public static String formattaUrnReportVerificaFirma(String urnBase, long pgBusta, String fmtUsed) { - return formattaUrnReportVerificaFirma(urnBase, pgBusta, fmtUsed, false); - } - - private static String formattaUrnReportVerificaFirma(String urnBase, long pgBusta, String fmtUsed, - boolean toNormalize) { - return MessageFormat.format(fmtUsed, toNormalize ? MessaggiWSFormat.normalizingKey(urnBase) : urnBase, pgBusta); + return MessageFormat.format(fmtUsed, urnBase, pgBusta); } /* AWS : RULES FOR CD_KEY_FILE SU COMPONENTE */ @@ -410,4 +343,9 @@ public static String normalizingKey(String value) { .replaceAll("\\p{InCombiningDiacriticalMarks}+", "").replaceAll("[^A-Za-z0-9\\. _-]", "_"); } + public static int formattaKeyPartAnnoVers(ZonedDateTime dtVersamento) { + Calendar date = Calendar.getInstance(); + date.setTime(convert(dtVersamento)); + return date.get(Calendar.YEAR); + } } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSHelper.java index fea37fd..f662b6c 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/MessaggiWSHelper.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,11 +22,8 @@ */ package it.eng.parer.ws.utils; -import it.eng.parer.entity.DecErrSacer; -import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; -import it.eng.parer.exception.SacerWsRuntimeException; - import java.util.List; + import javax.ejb.LocalBean; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; @@ -19,13 +33,19 @@ import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import it.eng.parer.entity.DecErrSacer; +import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; +import it.eng.parer.exception.SacerWsRuntimeException; + /** * * @author fioravanti_f */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "MessaggiWSHelper") @LocalBean @TransactionManagement(TransactionManagementType.CONTAINER) @@ -45,7 +65,7 @@ public List caricaListaErrori() { @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public DecErrSacer caricaDecErrore(String cdErrore) { - DecErrSacer tmperr = null; + DecErrSacer tmperr; try { String qlString = "SELECT e FROM DecErrSacer e " + "where e.cdErr = :cdErr"; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ParametroApplDB.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ParametroApplDB.java index bf3d008..442b2a3 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ParametroApplDB.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ParametroApplDB.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.utils; import it.eng.parer.entity.AplParamApplic; @@ -5,6 +22,12 @@ // public class ParametroApplDB { + private static final IllegalStateException UTILITY_CLASS_EXCP = new IllegalStateException("Classi di utilità"); + + private ParametroApplDB() { + throw UTILITY_CLASS_EXCP; + } + public static final String NM_APPLIC = "NM_APPLIC"; public static final String TIPO_STRUT_DOC = "TIPO_STRUT_DOC"; @@ -15,8 +38,8 @@ public class ParametroApplDB { public static final String FMT_UNKNOWN = "FMT_UNKNOWN"; public static final String SERVER_NAME_SYSTEM_PROPERTY = "SERVER_NAME_SYSTEM_PROPERTY"; // - public static final String PATH_MM_IN_ = "PATH_MM_IN_"; - public static final String PATH_MM_OUT_ = "PATH_MM_OUT_"; + public static final String PATH_MM_IN = "PATH_MM_IN_"; + public static final String PATH_MM_OUT = "PATH_MM_OUT_"; // public static final String TPI_ROOT_SACER = "root_SACER"; public static final String TPI_ROOT_TPI = "root_TPI"; @@ -39,6 +62,7 @@ public class ParametroApplDB { public static final String TPI_NI_GG_MAX_MIGRAZ = "niGgMaxMigraz"; public static final String TPI_TIMEOUT = "timeoutTPI"; public static final String TPI_TIMEOUT_RETRIEVE = "timeoutTPIRetrieve"; + public static final String TPI_ENABLE = "TPI_Enable"; // // questi verranno rimossi quando la migrazione sarà completata public static final String TPI_NM_USER_MIG_BLB = "nmUserMigBlb"; @@ -79,7 +103,6 @@ public class ParametroApplDB { public static final String VERIFICA_FIRMA_TIMEOUT = "VERIFICA_FIRMA_TIMEOUT"; /* CRYPTO */ - public static final String CRYPTO_VERIFICA_FIRMA_RETRY_TIMEOUT = "CRYPTO_VERIFICA_FIRMA_RETRY_TIMEOUT"; public static final String CRYPTO_VERIFICA_FIRMA_MAX_TENTATIVI = "CRYPTO_VERIFICA_FIRMA_MAX_TENTATIVI"; @@ -91,7 +114,6 @@ public class ParametroApplDB { public static final String CRYPTO_VERIFICA_FIRMA_PERIODO_BACKOFF = "CRYPTO_VERIFICA_FIRMA_PERIODO_BACKOFF"; /* EIDAS */ - public static final String EIDAS_VERIFICA_FIRMA_RETRY_TIMEOUT = "EIDAS_VERIFICA_FIRMA_RETRY_TIMEOUT"; public static final String EIDAS_VERIFICA_FIRMA_MAX_TENTATIVI = "EIDAS_VERIFICA_FIRMA_MAX_TENTATIVI"; @@ -102,14 +124,22 @@ public class ParametroApplDB { public static final String EIDAS_VERIFICA_FIRMA_PERIODO_BACKOFF = "EIDAS_VERIFICA_FIRMA_PERIODO_BACKOFF"; - /* AWS */ - public static final String OBJECT_STORAGE_ADDR = "OBJECT_STORAGE_ADDR"; public static final String TENANT_OBJECT_STORAGE = "TENANT_OBJECT_STORAGE"; - // Report verifica firma su Object storage - public static final String REPORTVF_S3_ACCESS_KEY_ID = "REPORTVF_S3_ACCESS_KEY_ID"; - public static final String REPORTVF_S3_SECRET_KEY = "REPORTVF_S3_SECRET_KEY"; - public static final String BUCKET_REPORT_VERIFICAFIRMA = "BUCKET_REPORT_VERIFICAFIRMA"; + // Configurazioni Storage + public static final String BACKEND_VRS_SES_UD_STAGING = "BACKEND_VRS_SES_UD_STAGING"; + public static final String BACKEND_VERSAMENTO_SYNC = "BACKEND_VERSAMENTO_SYNC"; + public static final String BACKEND_AGGIUNTALLEGATI_SYNC = "BACKEND_AGGIUNTALLEGATI_SYNC"; + public static final String BACKEND_VERSAMENTO_MULTIMEDIA = "BACKEND_VERSAMENTO_MULTIMEDIA"; + // MEV#29276 + public static final String BACKEND_VERSAMENTO_AGG_MD = "BACKEND_VERSAMENTO_AGG_MD"; + public static final String BACKEND_XML_SES_AGG_MD_ERR_KO = "BACKEND_XML_SES_AGG_MD_ERR_KO"; + // end MEV#29276 + // Configurazioni S3 + public static final String S3_PRESIGNED_URL_DURATION = "S3_PRESIGNED_URL_DURATION"; + public static final String S3_CLIENT_MAX_CONNECTIONS = "S3_CLIENT_MAX_CONNECTIONS"; + public static final String S3_CLIENT_CONNECTION_TIMEOUT = "S3_CLIENT_CONNECTION_TIMEOUT"; + public static final String S3_CLIENT_SOCKET_TIMEOUT = "S3_CLIENT_SOCKET_TIMEOUT"; /** * Flags (specializzazione) {@link AplParamApplic} @@ -117,6 +147,10 @@ public class ParametroApplDB { */ public class ParametroApplFl { + private ParametroApplFl() { + throw UTILITY_CLASS_EXCP; + } + public static final String FL_GEST_FASCICOLI = "FL_GEST_FASCICOLI"; public static final String FL_ACCETTA_CONTR_CRL_NOVAL = "FL_ACCETTA_CONTR_CRL_NOVAL"; public static final String FL_ACCETTA_CONTR_CRL_SCAD = "FL_ACCETTA_CONTR_CRL_SCAD"; @@ -188,15 +222,22 @@ public class ParametroApplFl { public static final String FL_ACCETTA_CONTR_OCSP_NEG = "FL_ACCETTA_CONTR_OCSP_NEG"; public static final String FL_ACCETTA_CONTR_OCSP_NOSCAR = "FL_ACCETTA_CONTR_OCSP_NOSCAR"; public static final String FL_ACCETTA_CONTR_OCSP_NOVAL = "FL_ACCETTA_CONTR_OCSP_NOVAL"; + // + public static final String FL_EIDAS_INCLUDI_FILEBASE64 = "FL_EIDAS_INCLUDI_FILEBASE64"; + public static final String FL_CRYPTO_INCLUDI_FILEBASE64 = "FL_CRYPTO_INCLUDI_FILEBASE64"; } /** * {@link AplParamApplic} - * + * */ public class TipoParametroAppl { + private TipoParametroAppl() { + throw UTILITY_CLASS_EXCP; + } + public static final String VERSAMENTO_DEFAULT = "Default di versamento"; public static final String MAX_RESULT = "Paginazione risultati"; public static final String PATH = "Gestione servizi asincroni"; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/PayLoad.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/PayLoad.java index 28b135f..472bcce 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/PayLoad.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/PayLoad.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -13,6 +30,8 @@ */ public class PayLoad implements Serializable { + private static final long serialVersionUID = -5370296207518208965L; + private long id; private long idStrut; @@ -26,6 +45,7 @@ public class PayLoad implements Serializable { private long dtCreazione; public PayLoad() { + // default } public long getId() { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/RomanConverter.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/RomanConverter.java index cdb7fa3..2b61cd9 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/RomanConverter.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/RomanConverter.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.utils; /** diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/VerificaVersione.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/VerificaVersione.java index 7acbf1e..3422a0c 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/VerificaVersione.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/VerificaVersione.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.utils; import java.util.ArrayList; @@ -10,7 +27,6 @@ import org.apache.commons.lang3.StringUtils; -import it.eng.parer.entity.constraint.DecModelloXsdUd.TiModelloXsdUd; import it.eng.parer.ws.utils.Costanti.ModificatoriWS; import it.eng.parer.ws.utils.CostantiDB.TipiEntitaSacer; import it.eng.parer.ws.versFascicoli.dto.CompRapportoVersFascicolo; @@ -279,7 +295,7 @@ public void verifica(RispostaWS rispostaWS, VersamentoExt versamento) { parseOk = false; tmpEsitiVerfica.setFlagConfigVersNonSupp(true); // which one - List tags = new ArrayList<>(); + List tags = new ArrayList<>(); if (parsedUnitaDoc.getConfigurazione().isForzaHash() != null) { tags.add(""); } @@ -314,7 +330,7 @@ public void verifica(RispostaWS rispostaWS, VersamentoExt versamento) { tmpEsitiVerfica.setTagEsteso15VersNonSupp(true); // which one - List tags = new ArrayList<>(); + List tags = new ArrayList<>(); if (parsedUnitaDoc.getIntestazione().getVersatore().getUtente() != null) { tags.add(""); } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/WsTransactionManager.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/WsTransactionManager.java index c5fc273..4282f5f 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/WsTransactionManager.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/WsTransactionManager.java @@ -1,15 +1,29 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.utils; -import it.eng.parer.ws.dto.IRispostaWS; -import javax.transaction.HeuristicMixedException; -import javax.transaction.HeuristicRollbackException; -import javax.transaction.NotSupportedException; -import javax.transaction.RollbackException; -import javax.transaction.SystemException; import javax.transaction.UserTransaction; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import it.eng.parer.ws.dto.IRispostaWS; + /** * * @author Bonora_L @@ -26,83 +40,33 @@ public WsTransactionManager(UserTransaction utx) { public void beginTrans(IRispostaWS rispostaWs) { try { utx.begin(); - } catch (NotSupportedException e) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setErrorMessage("Errore nella fase di apertura transazione db del EJB " + e.getMessage()); - log.error("Eccezione nell'init ejb ", e); - } catch (SystemException e) { + } catch (Exception e) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); rispostaWs.setErrorMessage("Errore nella fase di apertura transazione db del EJB " + e.getMessage()); - log.error("Eccezione nell'init ejb ", e); + log.error("Eccezione beginTrans ", e); } } public void commit(IRispostaWS rispostaWs) { try { utx.commit(); - } catch (RollbackException ex) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setErrorMessage("Errore nella fase di commit del EJB " + ex.getMessage()); - log.error("Eccezione nell'init ejb ", ex); - } catch (HeuristicMixedException ex) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setErrorMessage("Errore nella fase di commit del EJB " + ex.getMessage()); - log.error("Eccezione nell'init ejb ", ex); - } catch (HeuristicRollbackException ex) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setErrorMessage("Errore nella fase di commit del EJB " + ex.getMessage()); - log.error("Eccezione nell'init ejb ", ex); - } catch (SecurityException ex) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setErrorMessage("Errore nella fase di commit del EJB " + ex.getMessage()); - log.error("Eccezione nell'init ejb ", ex); - } catch (IllegalStateException ex) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setErrorMessage("Errore nella fase di commit del EJB " + ex.getMessage()); - log.error("Eccezione nell'init ejb ", ex); - } catch (SystemException ex) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setErrorMessage("Errore nella fase di commit del EJB " + ex.getMessage()); - log.error("Eccezione nell'init ejb ", ex); } catch (Exception ex) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); rispostaWs.setErrorMessage("Errore nella fase di commit del EJB " + ex.getMessage()); - log.error("Eccezione nell'init ejb ", ex); + log.error("Eccezione commit ", ex); } } public void rollback(IRispostaWS rispostaWs) { try { utx.rollback(); - } catch (IllegalStateException ex) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setErrorMessage("Errore nella fase di rollback del EJB " + ex.getMessage()); - log.error("Eccezione nell'init ejb ", ex); - } catch (SecurityException ex) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setErrorMessage("Errore nella fase di rollback del EJB " + ex.getMessage()); - log.error("Eccezione nell'init ejb ", ex); - } catch (SystemException ex) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setErrorMessage("Errore nella fase di rollback del EJB " + ex.getMessage()); - log.error("Eccezione nell'init ejb ", ex); } catch (Exception ex) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); rispostaWs.setErrorMessage("Errore nella fase di rollback del EJB " + ex.getMessage()); - log.error("Eccezione nell'init ejb ", ex); + log.error("Eccezione rollback ", ex); } } } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/WsXAUtil.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/WsXAUtil.java index c5480e6..c33643c 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/WsXAUtil.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/WsXAUtil.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.utils; import java.io.File; @@ -69,7 +86,6 @@ public static InputStream createFileIS(XADiskBasicIOOperations session, File fil throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); } catch (InterruptedException e) { - log.warn("Interrupted createFileIS!", e); // Restore interrupted state... Thread.currentThread().interrupt(); throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); @@ -103,7 +119,6 @@ public static File[] listFiles(XADiskBasicIOOperations session, File root) throw | InsufficientPermissionOnFileException e) { throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); } catch (InterruptedException e) { - log.warn("Interrupted listFiles!", e); // Restore interrupted state... Thread.currentThread().interrupt(); throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); @@ -117,7 +132,6 @@ public static void moveFile(XADiskBasicIOOperations session, File file, File des | InsufficientPermissionOnFileException | FileAlreadyExistsException | FileUnderUseException e) { throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); } catch (InterruptedException e) { - log.warn("Interrupted moveFile!", e); // Restore interrupted state... Thread.currentThread().interrupt(); throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); @@ -131,7 +145,6 @@ public static void copyFile(XADiskBasicIOOperations session, File file, File des | LockingFailedException | NoTransactionAssociatedException e) { throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); } catch (InterruptedException e) { - log.warn("Interrupted!", e); // Restore interrupted state... Thread.currentThread().interrupt(); throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); @@ -146,7 +159,6 @@ public static void deleteFile(XADiskBasicIOOperations session, File file) throws | InsufficientPermissionOnFileException | LockingFailedException | NoTransactionAssociatedException e) { throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); } catch (InterruptedException e) { - log.warn("Interrupted deleteFile!", e); // Restore interrupted state... Thread.currentThread().interrupt(); throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); @@ -160,7 +172,6 @@ public static boolean fileExistsAndIsDirectory(XADiskBasicIOOperations session, } catch (InsufficientPermissionOnFileException | LockingFailedException | NoTransactionAssociatedException e) { throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); } catch (InterruptedException e) { - log.warn("Interrupted fileExistsAndIsDirectory!", e); // Restore interrupted state... Thread.currentThread().interrupt(); throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); @@ -175,7 +186,6 @@ public static boolean fileExistsAndIsDirectoryLockExclusive(XADiskBasicIOOperati } catch (InsufficientPermissionOnFileException | LockingFailedException | NoTransactionAssociatedException e) { throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); } catch (InterruptedException e) { - log.warn("Interrupted!", e); // Restore interrupted state... Thread.currentThread().interrupt(); throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); @@ -189,7 +199,6 @@ public static boolean fileExists(XADiskBasicIOOperations session, File file) thr } catch (InsufficientPermissionOnFileException | LockingFailedException | NoTransactionAssociatedException e) { throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); } catch (InterruptedException e) { - log.warn("Interrupted fileExists!", e); // Restore interrupted state... Thread.currentThread().interrupt(); throw new SacerWsException(e, SacerWsErrorCategory.INTERNAL_ERROR); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/WsXmlValidationEventHandler.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/WsXmlValidationEventHandler.java index 21a9c4c..511d003 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/WsXmlValidationEventHandler.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/WsXmlValidationEventHandler.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -7,6 +24,7 @@ import javax.xml.bind.ValidationEvent; import javax.xml.bind.ValidationEventHandler; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/XmlDateUtility.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/XmlDateUtility.java index e99f067..f7d6f86 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/XmlDateUtility.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/XmlDateUtility.java @@ -1,15 +1,34 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.utils; +import static it.eng.parer.util.DateUtilsConverter.convert; + +import java.time.ZonedDateTime; import java.util.Date; import java.util.GregorianCalendar; import java.util.TimeZone; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; + import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; import it.eng.parer.exception.SacerWsRuntimeException; -import java.time.ZonedDateTime; -import static it.eng.parer.util.DateUtilsConverter.convert; /** * diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/XmlUtils.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/XmlUtils.java index e732aba..f108952 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/XmlUtils.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/XmlUtils.java @@ -1,6 +1,24 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.utils; import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; @@ -16,18 +34,15 @@ import org.apache.commons.lang3.StringUtils; import org.apache.xml.security.c14n.Canonicalizer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.xml.sax.InputSource; - -import it.eng.parer.exception.SacerWsException; -import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; - import org.dom4j.DocumentException; import org.dom4j.DocumentHelper; import org.dom4j.io.OutputFormat; import org.dom4j.io.XMLWriter; +import org.w3c.dom.Document; +import org.xml.sax.InputSource; + +import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; +import it.eng.parer.exception.SacerWsException; /** * @@ -63,7 +78,7 @@ public static String unPrettyPrint(final String xmlSip) throws IOException, Docu public static String doCanonicalizzazioneXml(final String xml, final boolean unPrettyPrint) throws SacerWsException { String xmlOut = null; - try { + try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { org.apache.xml.security.Init.init(); // DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -91,8 +106,8 @@ public static String doCanonicalizzazioneXml(final String xml, final boolean unP org.apache.xml.security.c14n.Canonicalizer canonicalizer = Canonicalizer .getInstance(Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS); - byte[] res = canonicalizer.canonicalizeSubtree(doc); - xmlOut = new String(res, StandardCharsets.UTF_8); + canonicalizer.canonicalizeSubtree(doc, baos); + xmlOut = new String(baos.toByteArray(), StandardCharsets.UTF_8); if (unPrettyPrint) { xmlOut = XmlUtils.unPrettyPrint(xmlOut); } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/XmlValidationEventHandler.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/XmlValidationEventHandler.java index f4af7bd..77eef0f 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/XmlValidationEventHandler.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/XmlValidationEventHandler.java @@ -1,7 +1,25 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.utils; import javax.xml.bind.ValidationEvent; import javax.xml.bind.ValidationEventHandler; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ejb/JmsProducerUtilEjb.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ejb/JmsProducerUtilEjb.java index 2ae7fc1..83dcb1e 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ejb/JmsProducerUtilEjb.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/utils/ejb/JmsProducerUtilEjb.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -32,7 +49,7 @@ @LocalBean public class JmsProducerUtilEjb { - private final static Logger log = LoggerFactory.getLogger(JmsProducerUtilEjb.class); + private static final Logger log = LoggerFactory.getLogger(JmsProducerUtilEjb.class); public RispostaControlli inviaMessaggioInFormatoJson(ConnectionFactory connectionFactory, Queue queue, Object objectToSerializeInJson, String tipoPayload) { @@ -53,7 +70,7 @@ public RispostaControlli inviaMessaggioInFormatoJson(ConnectionFactory connectio textMessage.setStringProperty("tipoPayload", tipoPayload); ObjectMapper jsonMapper = new ObjectMapper(); textMessage.setText(jsonMapper.writeValueAsString(objectToSerializeInJson)); - log.debug(String.format("JmsProducer [JSON] %s", textMessage.getText())); + log.debug("JmsProducer [JSON] {}", textMessage.getText()); messageProducer.send(textMessage); log.debug("JmsProducer messaggio inviato"); tmpRispostaControlli.setrBoolean(true); @@ -90,4 +107,67 @@ public RispostaControlli inviaMessaggioInFormatoJson(ConnectionFactory connectio return tmpRispostaControlli; } + + // MAC#27513 + public RispostaControlli manageMessageGroupingInFormatoJson(ConnectionFactory connectionFactory, Queue queue, + Object objectToSerializeInJson, String tipoPayload, String groupId) { + RispostaControlli tmpRispostaControlli = new RispostaControlli(); + tmpRispostaControlli.setrBoolean(false); + + MessageProducer messageProducer = null; + TextMessage textMessage = null; + Connection connection = null; + Session session = null; + try { + connection = connectionFactory.createConnection(); + session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE); + messageProducer = session.createProducer(queue); + textMessage = session.createTextMessage(); + textMessage.setStringProperty("JMSXGroupID", groupId); + // app selector + textMessage.setStringProperty(Costanti.JMSMsgProperties.MSG_K_APP, Constants.SACERWS); + textMessage.setStringProperty("tipoPayload", tipoPayload); + ObjectMapper jsonMapper = new ObjectMapper(); + textMessage.setText(jsonMapper.writeValueAsString(objectToSerializeInJson)); + log.debug(String.format("JmsProducer [JSON] %s", textMessage.getText())); + messageProducer.send(textMessage); + log.debug(String.format("JmsProducer messaggio inviato con groupId %s", groupId)); + tmpRispostaControlli.setrBoolean(true); + } catch (JMSException ex) { + tmpRispostaControlli.setCodErr("ERR"); + tmpRispostaControlli + .setDsErr(String.format("Errore nell'invio del messaggio con groupId %s in coda: ", groupId) + + ex.getMessage()); + log.error(String.format("Errore nell'invio del messaggio con groupId %s in coda: ", groupId), ex); + tmpRispostaControlli.setrBoolean(false); + } catch (JsonProcessingException ex) { + tmpRispostaControlli.setCodErr("ERR"); + tmpRispostaControlli + .setDsErr("Errore nella serializzazione in JSON del messaggio per la coda: " + ex.getMessage()); + log.error("Errore nella serializzazione in JSON del messaggio per la coda: ", ex); + tmpRispostaControlli.setrBoolean(false); + } finally { + try { + if (messageProducer != null) { + messageProducer.close(); + } + if (session != null) { + session.close(); + } + if (connection != null) { + connection.close(); + } + } catch (JMSException ex) { + tmpRispostaControlli.setCodErr("ERR"); + tmpRispostaControlli + .setDsErr("Errore (trappato) JMS durante la chiusura delle risorse: " + ex.getMessage()); + log.error("Errore (trappato) JMS durante la chiusura delle risorse: ", ex); + tmpRispostaControlli.setrBoolean(false); + } + } + + return tmpRispostaControlli; + } + // MAC#27513 + } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/AbsVersFascicoloExt.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/AbsVersFascicoloExt.java index 42585cd..61d3ec8 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/AbsVersFascicoloExt.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/AbsVersFascicoloExt.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,6 +22,10 @@ */ package it.eng.parer.ws.versFascicoli.dto; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + import it.eng.parer.ws.dto.IErroriMultipli; import it.eng.parer.ws.dto.IRispostaWS; import it.eng.parer.ws.utils.MessaggiWSBundle; @@ -15,9 +36,6 @@ import it.eng.parer.ws.xml.versfascicoloresp.ECWarningUlterioriType; import it.eng.parer.ws.xml.versfascicoloresp.EsitoGeneraleType; import it.eng.spagoLite.security.User; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; /** * @@ -25,6 +43,7 @@ */ public abstract class AbsVersFascicoloExt implements IVersFascicoliExt, IErroriMultipli { + private static final long serialVersionUID = 1L; private User utente; private String versioneWsChiamata; private String loginName; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/CompRapportoVersFascicolo.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/CompRapportoVersFascicolo.java index e1a54d5..626710d 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/CompRapportoVersFascicolo.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/CompRapportoVersFascicolo.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,6 +22,8 @@ */ package it.eng.parer.ws.versFascicoli.dto; +import javax.xml.datatype.XMLGregorianCalendar; + import it.eng.parer.ws.xml.versfascicoloresp.CodiceEsitoType; import it.eng.parer.ws.xml.versfascicoloresp.ECConfigurazioneSIPType; import it.eng.parer.ws.xml.versfascicoloresp.ECConfigurazioneType; @@ -19,7 +38,6 @@ import it.eng.parer.ws.xml.versfascicoloresp.EsitoVersamentoNegativoType; import it.eng.parer.ws.xml.versfascicoloresp.RapportoVersamentoFascicoloType; import it.eng.parer.ws.xml.versfascicoloresp.SIPType; -import javax.xml.datatype.XMLGregorianCalendar; /** * diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/ConfigNumFasc.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/ConfigNumFasc.java index 6b6ccc9..1e2dd22 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/ConfigNumFasc.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/ConfigNumFasc.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPAFascicoloCollegato.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPAFascicoloCollegato.java index cbc52c8..9776cd0 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPAFascicoloCollegato.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPAFascicoloCollegato.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versFascicoli.dto; import it.eng.parer.ws.dto.CSChiaveFasc; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPAVoceClassificazione.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPAVoceClassificazione.java index f34bea2..a2f36bc 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPAVoceClassificazione.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPAVoceClassificazione.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versFascicoli.dto; public class DXPAVoceClassificazione { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGAmminPartecipante.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGAmminPartecipante.java index dd7f6dc..0b80691 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGAmminPartecipante.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGAmminPartecipante.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versFascicoli.dto; public class DXPGAmminPartecipante { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGAmminTitolare.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGAmminTitolare.java index 969e452..bc3efe9 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGAmminTitolare.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGAmminTitolare.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versFascicoli.dto; public class DXPGAmminTitolare { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGProcAmmininistrativo.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGProcAmmininistrativo.java index 52e2e1e..ff74c42 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGProcAmmininistrativo.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGProcAmmininistrativo.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versFascicoli.dto; public class DXPGProcAmmininistrativo { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGRespFascicolo.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGRespFascicolo.java index 3a6e6e4..e9ba5f2 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGRespFascicolo.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGRespFascicolo.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versFascicoli.dto; public class DXPGRespFascicolo { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGSoggettoCoinvolto.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGSoggettoCoinvolto.java index 5d0f1f1..1d378d8 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGSoggettoCoinvolto.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DXPGSoggettoCoinvolto.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versFascicoli.dto; public class DXPGSoggettoCoinvolto { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DatiXmlProfiloArchivistico.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DatiXmlProfiloArchivistico.java index a1683b9..8e60c7d 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DatiXmlProfiloArchivistico.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DatiXmlProfiloArchivistico.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DatiXmlProfiloGenerale.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DatiXmlProfiloGenerale.java index bc02c76..6171d4f 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DatiXmlProfiloGenerale.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/DatiXmlProfiloGenerale.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -109,7 +126,7 @@ public void setNoteFascicolo(String noteFascicolo) { public List getAmmPartecipanti() { if (ammPartecipanti == null) { - ammPartecipanti = new ArrayList(0); + ammPartecipanti = new ArrayList<>(0); } return ammPartecipanti; } @@ -131,7 +148,7 @@ public DXPGAmminPartecipante removeAmminPartecipanteFasc(DXPGAmminPartecipante a // public List getSoggettiCoinvolti() { if (soggettiCoinvolti == null) { - soggettiCoinvolti = new ArrayList(0); + soggettiCoinvolti = new ArrayList<>(0); } return soggettiCoinvolti; } @@ -203,7 +220,7 @@ public String addUoOrgResponsabile(String uo) { return uo; } - public String removeUoOrgResponsabile(String uo) { + public DXPGRespFascicolo removeUoOrgResponsabile(DXPGRespFascicolo uo) { getResponsabili().remove(uo); return uo; } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/FascicoloLink.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/FascicoloLink.java index ace13d2..45b392b 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/FascicoloLink.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/FascicoloLink.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versFascicoli.dto; public class FascicoloLink extends DXPAFascicoloCollegato { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/FlControlliFasc.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/FlControlliFasc.java index dfebf56..cabfdb0 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/FlControlliFasc.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/FlControlliFasc.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/IVersFascicoliExt.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/IVersFascicoliExt.java index c5004ab..42cd934 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/IVersFascicoliExt.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/IVersFascicoliExt.java @@ -1,12 +1,30 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.versFascicoli.dto; +import java.io.Serializable; + import it.eng.parer.ws.dto.IRestWSBase; import it.eng.spagoLite.security.User; -import java.io.Serializable; /** * diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/RispostaWSFascicolo.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/RispostaWSFascicolo.java index 9013e95..7ba7800 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/RispostaWSFascicolo.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/RispostaWSFascicolo.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/StrutturaVersFascicolo.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/StrutturaVersFascicolo.java index 076660f..baf2ea1 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/StrutturaVersFascicolo.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/StrutturaVersFascicolo.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,13 +22,14 @@ */ package it.eng.parer.ws.versFascicoli.dto; +import java.util.Date; +import java.util.List; +import java.util.Map; + import it.eng.parer.ws.dto.CSChiaveFasc; import it.eng.parer.ws.dto.CSVersatore; import it.eng.parer.ws.versamento.dto.DatoSpecifico; import it.eng.parer.ws.versamento.dto.IDatiSpecEntity; -import java.util.Date; -import java.util.HashMap; -import java.util.List; /** * @@ -19,6 +37,8 @@ */ public class StrutturaVersFascicolo implements java.io.Serializable, IDatiSpecEntity { + private static final long serialVersionUID = 1L; + private Date dataVersamento; private long idStruttura; @@ -42,22 +62,22 @@ public class StrutturaVersFascicolo implements java.io.Serializable, IDatiSpecEn private long idRecXsdProfiloArchivistico; private long idRecxsdProfiloGenerale; - private DatiXmlProfiloGenerale datiXmlProfiloGenerale; - private DatiXmlProfiloArchivistico datiXmlProfiloArchivistico; + private transient DatiXmlProfiloGenerale datiXmlProfiloGenerale; + private transient DatiXmlProfiloArchivistico datiXmlProfiloArchivistico; private long idRecXsdDatiSpec; private long idRecXsdDatiSpecMigrazione; - private HashMap datiSpecifici; - private HashMap datiSpecificiMigrazione; + private Map datiSpecifici; + private Map datiSpecificiMigrazione; - private FlControlliFasc flControlliFasc; - private ConfigNumFasc configNumFasc; + private transient FlControlliFasc flControlliFasc; + private transient ConfigNumFasc configNumFasc; private String keyOrdCalcolata; private Long progressivoCalcolato; private boolean warningFormatoNumero; - private List fascicoliLinked; + private transient List fascicoliLinked; private Long idVoceTitol; @@ -198,24 +218,22 @@ public void setDatiXmlProfiloArchivistico(DatiXmlProfiloArchivistico datiXmlProf } @Override - public HashMap getDatiSpecifici() { - + public Map getDatiSpecifici() { return datiSpecifici; } @Override - public void setDatiSpecifici(HashMap datiSpecifici) { + public void setDatiSpecifici(Map datiSpecifici) { this.datiSpecifici = datiSpecifici; } @Override - public HashMap getDatiSpecificiMigrazione() { - + public Map getDatiSpecificiMigrazione() { return datiSpecificiMigrazione; } @Override - public void setDatiSpecificiMigrazione(HashMap datiSpecificiMigrazione) { + public void setDatiSpecificiMigrazione(Map datiSpecificiMigrazione) { this.datiSpecificiMigrazione = datiSpecificiMigrazione; } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/VersFascicoloExt.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/VersFascicoloExt.java index c3ffd27..011f824 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/VersFascicoloExt.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/VersFascicoloExt.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,12 +22,13 @@ */ package it.eng.parer.ws.versFascicoli.dto; +import java.util.EnumSet; + import it.eng.parer.ws.dto.IWSDesc; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.Costanti; import it.eng.parer.ws.utils.Costanti.VersioneWS; import it.eng.parer.ws.xml.versfascicolo.IndiceSIPFascicolo; -import java.util.EnumSet; /** * diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/WSDescVersFascicolo.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/WSDescVersFascicolo.java index a57cf4d..e52169d 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/WSDescVersFascicolo.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/dto/WSDescVersFascicolo.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ControlliCollFascicolo.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ControlliCollFascicolo.java index f007460..aa3614c 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ControlliCollFascicolo.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ControlliCollFascicolo.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -188,7 +205,7 @@ public RispostaControlli buildCollegamentiFascicolo(VersFascicoloExt versamento, for (Iterator it = setDuplicateCsFKeys.iterator(); it.hasNext();) { CSChiaveFasc csKey = it.next(); StringBuilder sb = new StringBuilder(0); - Set setUniqueDesc = new HashSet(0); + Set setUniqueDesc = new HashSet(0); for (DXPAFascicoloCollegato coll : svf.getDatiXmlProfiloArchivistico().getFascCollegati()) { if (coll.getCsChiaveFasc().equals(csKey)) { if (StringUtils.isNotBlank(coll.getDescCollegamento())) { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ControlliFascicoli.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ControlliFascicoli.java index 43f7e12..5bafdfb 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ControlliFascicoli.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ControlliFascicoli.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -39,9 +56,8 @@ import it.eng.parer.entity.IamAbilTipoDato; import it.eng.parer.entity.OrgStrut; import it.eng.parer.entity.constraint.FasFascicolo.TiStatoConservazione; -import it.eng.parer.grantedEntity.SIOrgEnteSiam; import it.eng.parer.util.ejb.help.ConfigurationHelper; -import it.eng.parer.viewEntity.OrgVChkPartitionFascByAa; +import it.eng.parer.view_entity.OrgVChkPartitionFascByAa; import it.eng.parer.ws.dto.CSChiaveFasc; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.CostantiDB; @@ -52,19 +68,20 @@ import it.eng.parer.ws.versFascicoli.dto.DatiXmlProfiloArchivistico; import it.eng.parer.ws.versFascicoli.dto.FlControlliFasc; import it.eng.parer.ws.versFascicoli.dto.StrutturaVersFascicolo; -import it.eng.parer.ws.versFascicoli.dto.VersFascicoloExt; import it.eng.parer.ws.versFascicoli.utils.KeyOrdFascUtility.TipiCalcolo; /** * * @author fioravanti_f */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "ControlliFascicoli") @LocalBean @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) public class ControlliFascicoli { private static final Logger log = LoggerFactory.getLogger(ControlliFascicoli.class); + private static final String ERRORE_TABELLA_DECODIFICA = "Eccezione nella lettura della tabella di decodifica "; @PersistenceContext(unitName = "ParerJPA") private EntityManager entityManager; @@ -76,7 +93,7 @@ public enum TipiGestioneFascAnnullati { CARICA, CONSIDERA_ASSENTE } - final static String NOME_FASCICOLO_SCONOSCIUTO = "Tipo fascicolo sconosciuto"; + static final String NOME_FASCICOLO_SCONOSCIUTO = "Tipo fascicolo sconosciuto"; public RispostaControlli verificaPartizioniStruttAnnoFascicoli(String descKey, long idStruttura, long anno) { RispostaControlli rispostaControlli; @@ -93,12 +110,12 @@ public RispostaControlli verificaPartizioniStruttAnnoFascicoli(String descKey, l query.setParameter("annoIn", new BigDecimal(anno)); ovcspfs = query.getResultList(); - if (ovcspfs.size() == 1) { - // trovata la struttura, vediamo se è tutta ben partizionata. - // se ci sono problemi il versamento è sempre e comunque errato - if (ovcspfs.get(0).getFlPartFascOk().equals("1")) { - rispostaControlli.setrBoolean(true); - } + /* + * trovata una struttura ben partizionata. se ci sono problemi il versamento è sempre e comunque errato + */ + if (ovcspfs.size() == 1 && ovcspfs.get(0).getFlPartFascOk().equals("1")) { + + rispostaControlli.setrBoolean(true); } if (!rispostaControlli.isrBoolean()) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666P); @@ -109,7 +126,7 @@ public RispostaControlli verificaPartizioniStruttAnnoFascicoli(String descKey, l rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliFascicoli.verificaPartizioniStruttFascicoli: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error(ERRORE_TABELLA_DECODIFICA, e); } return rispostaControlli; @@ -126,7 +143,7 @@ public RispostaControlli checkTipoFascicolo(String nomeTipoFascicolo, String des String queryStr = "select t from DecTipoFascicolo t " + "where t.orgStrut.idStrut = :idStrutIn " + "and upper(t.nmTipoFascicolo) = :nmTipoFascicolo " + " and t.dtIstituz <= :dataDiOggiIn " + " and t.dtSoppres > :dataDiOggiIn "; // da notare STRETTAMENTE MAGGIORE della data di - // riferimento!!!; + // riferimento!!! javax.persistence.Query query = entityManager.createQuery(queryStr, DecTipoFascicolo.class); query.setParameter("idStrutIn", idStruttura); query.setParameter("nmTipoFascicolo", nomeTipoFascicolo.toUpperCase()); @@ -146,7 +163,7 @@ public RispostaControlli checkTipoFascicolo(String nomeTipoFascicolo, String des rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliFascicoli.checkTipoFascicolo: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error(ERRORE_TABELLA_DECODIFICA, e); } return rispostaControlli; @@ -166,9 +183,9 @@ public RispostaControlli checkTipoFascicoloIamUserOrganizzazione(String descKey, + "and t.iamAbilOrganiz.idOrganizApplic = :idOrganizApplic " + "and t.idTipoDatoApplic = :idTipoFasc " + "and t.nmClasseTipoDato = 'TIPO_FASCICOLO' "; javax.persistence.Query query = entityManager.createQuery(queryStr, IamAbilTipoDato.class); - query.setParameter("idOrganizApplic", idStruttura); + query.setParameter("idOrganizApplic", new BigDecimal(idStruttura)); query.setParameter("idUserIam", idUser); - query.setParameter("idTipoFasc", idTipoFasc); + query.setParameter("idTipoFasc", new BigDecimal(idTipoFasc)); iamAbilTipoDatos = query.getResultList(); @@ -185,7 +202,7 @@ public RispostaControlli checkTipoFascicoloIamUserOrganizzazione(String descKey, rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliFascicoli.checkTipoFascicoloOrganizzazione: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error(ERRORE_TABELLA_DECODIFICA, e); } return rispostaControlli; @@ -203,16 +220,16 @@ public RispostaControlli checkTipoFascicoloAnno(String descChiaveFasc, String ti String queryStr = "select t from DecAaTipoFascicolo t " + "where t.decTipoFascicolo.idTipoFascicolo = :idTipoFascicolo " + "and t.aaIniTipoFascicolo <= :aaFasc " + "and t.aaFinTipoFascicolo >= :aaFasc ";// gli anni NON - // si - // sovrappongono - // quindi esiste - // un risultato - // per la - // verifica su - // tipo fasc + // si + // sovrappongono + // quindi esiste + // un risultato + // per la + // verifica su + // tipo fasc javax.persistence.Query query = entityManager.createQuery(queryStr, DecAaTipoFascicolo.class); query.setParameter("idTipoFascicolo", idTipoFascicolo); - query.setParameter("aaFasc", anno); + query.setParameter("aaFasc", new BigDecimal(anno)); decAaTipoFascicolos = query.getResultList(); // ne esiste almeno uno @@ -229,7 +246,7 @@ public RispostaControlli checkTipoFascicoloAnno(String descChiaveFasc, String ti rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliFascicoli.checkTipoFascicoloAnno: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error(ERRORE_TABELLA_DECODIFICA, e); } return rispostaControlli; @@ -244,7 +261,7 @@ public RispostaControlli checkTipoFascicoloSconosciuto(long idStruttura) { try { String queryStr = "select t from DecTipoFascicolo t " + "where t.orgStrut.idStrut = :idStrutIn " + "and upper(t.nmTipoFascicolo) = :nmTipoFascicolo "; - // da notare che non viene indicata la data di riferimento!!!; + // da notare che non viene indicata la data di riferimento!!! javax.persistence.Query query = entityManager.createQuery(queryStr, DecTipoFascicolo.class); query.setParameter("idStrutIn", idStruttura); query.setParameter("nmTipoFascicolo", NOME_FASCICOLO_SCONOSCIUTO.toUpperCase()); @@ -263,7 +280,7 @@ public RispostaControlli checkTipoFascicoloSconosciuto(long idStruttura) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliFascicoli.checkTipoFascicoloSconosciuto: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error(ERRORE_TABELLA_DECODIFICA, e); } return rispostaControlli; @@ -288,17 +305,20 @@ public RispostaControlli checkChiave(CSChiaveFasc key, String descKey, long idSt query.setParameter("cdKeyFascicolo", key.getNumero()); query.setParameter("aaFascicolo", new BigDecimal(key.getAnno())); fasFascicolos = query.getResultList(); - // chiave già presente (uno o più righe trovate, mi interessa solo l'ultima - più recente) - if (fasFascicolos.size() > 0) { + // chiave già presente (uno o più righe trovate, mi interessa solo l'ultima - + // più recente) + if (!fasFascicolos.isEmpty()) { TiStatoConservazione scud = fasFascicolos.get(0).getTiStatoConservazione(); if (scud == TiStatoConservazione.ANNULLATO && tgfa == TipiGestioneFascAnnullati.CONSIDERA_ASSENTE) { // mi comporto come se non avesse trovato il fascicolo - // NOTA: quando questo metodo verrà usato in un ws di recupero, qui dovrà costruire + // NOTA: quando questo metodo verrà usato in un ws di recupero, qui dovrà + // costruire // un messaggio di errore, come in ControlliSemantici#checkChiave rispostaControlli.setrBoolean(true); } else { // gestione normale: ho trovato il fascicolo e non è annullato. - // Oppure è annullato e voglio caricarlo lo stesso (il solo caso è nel ws recupero stato fascicolo) + // Oppure è annullato e voglio caricarlo lo stesso (il solo caso è nel ws + // recupero stato fascicolo) // intanto rendo l'errore di chiave già presente rispostaControlli.setCodErr(MessaggiWSBundle.FASC_001_001); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.FASC_001_001, descKey)); @@ -315,7 +335,8 @@ public RispostaControlli checkChiave(CSChiaveFasc key, String descKey, long idSt } // Chiave non trovata - // NOTA: quando questo metodo verrà usato in un ws di recupero, qui dovrà costruire + // NOTA: quando questo metodo verrà usato in un ws di recupero, qui dovrà + // costruire // un messaggio di errore, come in ControlliSemantici#checkChiave rispostaControlli.setrBoolean(true); @@ -323,7 +344,7 @@ public RispostaControlli checkChiave(CSChiaveFasc key, String descKey, long idSt rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliFascicoli.checkChiave: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error(ERRORE_TABELLA_DECODIFICA, e); } return rispostaControlli; @@ -333,90 +354,6 @@ public RispostaControlli checkChiave(CSChiaveFasc key, String descKey, long idSt * ######## FASE II ######## * */ - public RispostaControlli verificaCodSoggettoProduttore(VersFascicoloExt versamento, String codice) { - return verificaSoggettoProduttore(versamento, codice, null); - } - - public RispostaControlli verificaDenSoggettoProduttore(VersFascicoloExt versamento, String denominazione) { - return verificaSoggettoProduttore(versamento, null, denominazione); - } - - private RispostaControlli verificaSoggettoProduttore(VersFascicoloExt versamento, String codice, - String denominazione) { - RispostaControlli rispostaControlli; - rispostaControlli = new RispostaControlli(); - rispostaControlli.setrBoolean(false); - - StrutturaVersFascicolo svf = versamento.getStrutturaComponenti(); - - List siOrgEnteConvenzs = null; - - try { - /* - * case 1 - * - * Nota: al momento NON si controlla se l'ente risulta valido nel range di date SYSDATE <= DT_CESSAZIONE AND - * SYSDATE >= DT_INI_VAL - */ - String queryStr = "select e from SIOrgEnteConvenz e where "; - StringBuilder sb = new StringBuilder(); - if (codice != null) { - sb.append(" "); - sb.append("upper(e.cdEnteConvenz) = :cdEnteConvenz"); - } - - if (denominazione != null) { - sb.append(" "); - sb.append("upper(e.nmEnteConvenz) = :nmEnteConvenz"); - } - sb.append(" "); - - queryStr += sb.toString(); - - javax.persistence.Query query = entityManager.createQuery(queryStr, SIOrgEnteSiam.class); - if (codice != null) { - query.setParameter("cdEnteConvenz", codice.toUpperCase().trim());// rispulisco da eventuali spazi - } - if (denominazione != null) { - query.setParameter("nmEnteSiam", denominazione.toUpperCase().trim());// rispulisco da eventuali spazi - } - - siOrgEnteConvenzs = query.getResultList(); - - /* - * codice + denominazione - * - * Nota: si verifica che ne esista almeno uno in quanto la chiave univoca legata al codice dell'ente riporta - * anche al tipo (constraint UN_ENTE_CONVENZ_CD) dato che attualmente non è presente su xml (non previsto - * dall'xsd) - */ - if (siOrgEnteConvenzs.size() >= 1) { - // se trovato, rendo l'id dell'ente convenzionato / -> non per il momento (vedi - // Nota) - rispostaControlli.setrLong(siOrgEnteConvenzs.get(0).getIdEnteSiam());// considero sempre come un solo - // risultato (TODO: da verificare) - rispostaControlli.setrBoolean(true); - } else { - if (codice != null) { - versamento.listErrAddError(svf.getUrnPartChiaveFascicolo(), MessaggiWSBundle.FAS_CONFIG_004_001, - codice); - } - if (denominazione != null) { - versamento.listErrAddError(svf.getUrnPartChiaveFascicolo(), MessaggiWSBundle.FAS_CONFIG_004_002, - denominazione); - } - - } - - } catch (Exception e) { - rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "ControlliFascicoli.verificaSoggettoProduttore: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella enti convenzionati ", e); - } - - return rispostaControlli; - } public RispostaControlli verificaSIPTitolario(StrutturaVersFascicolo svf) { RispostaControlli rispostaControlli; @@ -437,7 +374,7 @@ public RispostaControlli verificaSIPTitolario(StrutturaVersFascicolo svf) { if (dxpa != null && StringUtils.isNotBlank(dxpa.getIndiceClassificazione())) { // verifica sulle singole (composito) - tmpControlli = this.checkVoceDescTitol(dxpa.getVociClassificazione(), svf.getIdStruttura(), + tmpControlli = this.checkVoceDescTitol(dxpa.getVociClassificazione(), svf.getDatiXmlProfiloGenerale().getDataApertura(), decTitol.getIdTitol()); if (!tmpControlli.isrBoolean()) { @@ -462,8 +399,8 @@ public RispostaControlli verificaSIPTitolario(StrutturaVersFascicolo svf) { // StrutTitolariEjb.creaVoce) query.setParameter("cdCompositoVoceTitol", StringEscapeUtils .escapeEcmaScript(dxpa.getIndiceClassificazione().toUpperCase().trim().toUpperCase()));// ripulisco - // dagli - // spazi + // dagli + // spazi query.setParameter("dtApertura", svf.getDatiXmlProfiloGenerale().getDataApertura()); decVoceTitols = query.getResultList(); @@ -504,10 +441,10 @@ public RispostaControlli verificaSIPTitolario(StrutturaVersFascicolo svf) { return rispostaControlli; } - private RispostaControlli checkVoceDescTitol(List vociClassificazione, long idStrutt, - Date dtApertura, long idTitol) { + private RispostaControlli checkVoceDescTitol(List vociClassificazione, Date dtApertura, + long idTitol) { - Map decLvlVoceTitols = new HashMap(); + Map decLvlVoceTitols = new HashMap<>(); RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); @@ -525,7 +462,8 @@ private RispostaControlli checkVoceDescTitol(List vociC voce.getDescrizioneVoce())); return tmpControlli; } - // serve per la gestione del composito da confrontare con l'indice di classificazione + // serve per la gestione del composito da confrontare con l'indice di + // classificazione DecValVoceTitol decValVoceTitol = (DecValVoceTitol) tmpControlli.getrObject(); decLvlVoceTitols.put(decValVoceTitol.getDecVoceTitol().getDecLivelloTitol().getNiLivello(), decValVoceTitol); @@ -540,7 +478,8 @@ private RispostaControlli checkVoceDescTitol(List vociC // recupero la voce dalla mappa DecValVoceTitol decValVoceTitol = decLvlVoceTitols.get(nextniLivello); - // se esiste recupero il livello successivo per ottenere il separatore da usare alla prossima iterazione + // se esiste recupero il livello successivo per ottenere il separatore da usare + // alla prossima iterazione RispostaControlli tmpControlli = this.getDecLvlVoceTitolWithNiLivello(nextniLivello.longValue(), idTitol); if (tmpControlli.isrBoolean()) { @@ -583,7 +522,7 @@ public RispostaControlli getDecAaTipoFascicolo(long idAaTipoFascicolo) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliFascicoli.getDecAaTipoFascicolo: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica " + e); + log.error(ERRORE_TABELLA_DECODIFICA, e); } return rispostaControlli; } @@ -619,35 +558,35 @@ public RispostaControlli checkFlDecAaTipoFascicoloOrgStrutt(long idAaTipoFasc) { } // fl (possono essere nulli -> recepisco quelli dell'organizzazione) - flAbilitaContrClassif = configurationHelper.getParamApplicValueAsFl( + flAbilitaContrClassif = configurationHelper.getValoreParamApplicByAaTipoFascAsFl( ParametroApplFl.FL_ABILITA_CONTR_CLASSIF, orgStrut.getIdStrut(), - orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), Integer.MIN_VALUE, idAaTipoFasc); - flAccettaContrClassifNeg = configurationHelper.getParamApplicValueAsFl( + orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idAaTipoFasc); + flAccettaContrClassifNeg = configurationHelper.getValoreParamApplicByAaTipoFascAsFl( ParametroApplFl.FL_ACCETTA_CONTR_CLASSIF_NEG, orgStrut.getIdStrut(), - orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), Integer.MIN_VALUE, idAaTipoFasc); - flForzaContrClassif = configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_CLASSIF, - orgStrut.getIdStrut(), orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), Integer.MIN_VALUE, - idAaTipoFasc); + orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idAaTipoFasc); + flForzaContrClassif = configurationHelper.getValoreParamApplicByAaTipoFascAsFl( + ParametroApplFl.FL_FORZA_CONTR_CLASSIF, orgStrut.getIdStrut(), + orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idAaTipoFasc); // - flAbilitaContrNum = configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_NUMERO, - orgStrut.getIdStrut(), orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), Integer.MIN_VALUE, - idAaTipoFasc); - flAccettaContrNumNeg = configurationHelper.getParamApplicValueAsFl( + flAbilitaContrNum = configurationHelper.getValoreParamApplicByAaTipoFascAsFl( + ParametroApplFl.FL_ABILITA_CONTR_NUMERO, orgStrut.getIdStrut(), + orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idAaTipoFasc); + flAccettaContrNumNeg = configurationHelper.getValoreParamApplicByAaTipoFascAsFl( ParametroApplFl.FL_ACCETTA_CONTR_NUMERO_NEG, orgStrut.getIdStrut(), - orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), Integer.MIN_VALUE, idAaTipoFasc); - flForzaContrNum = configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_NUMERO, - orgStrut.getIdStrut(), orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), Integer.MIN_VALUE, - idAaTipoFasc); + orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idAaTipoFasc); + flForzaContrNum = configurationHelper.getValoreParamApplicByAaTipoFascAsFl( + ParametroApplFl.FL_FORZA_CONTR_NUMERO, orgStrut.getIdStrut(), + orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idAaTipoFasc); // - flAbilitaContrColl = configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_COLLEG, - orgStrut.getIdStrut(), orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), Integer.MIN_VALUE, - idAaTipoFasc); - flAccettaContrCollNeg = configurationHelper.getParamApplicValueAsFl( + flAbilitaContrColl = configurationHelper.getValoreParamApplicByAaTipoFascAsFl( + ParametroApplFl.FL_ABILITA_CONTR_COLLEG, orgStrut.getIdStrut(), + orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idAaTipoFasc); + flAccettaContrCollNeg = configurationHelper.getValoreParamApplicByAaTipoFascAsFl( ParametroApplFl.FL_ACCETTA_CONTR_COLLEG_NEG_FAS, orgStrut.getIdStrut(), - orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), Integer.MIN_VALUE, idAaTipoFasc); - flForzaContrColl = configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_COLLEG, - orgStrut.getIdStrut(), orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), Integer.MIN_VALUE, - idAaTipoFasc); + orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idAaTipoFasc); + flForzaContrColl = configurationHelper.getValoreParamApplicByAaTipoFascAsFl( + ParametroApplFl.FL_FORZA_CONTR_COLLEG, orgStrut.getIdStrut(), + orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idAaTipoFasc); FlControlliFasc flControlliFasc = new FlControlliFasc(); @@ -690,7 +629,7 @@ public RispostaControlli getPartiAANumero(String descChiaveFasc, long idAATipoFa ConfigNumFasc tmpConfigNumFasc = this.caricaPartiAANumero(decAaTipoFascicolo.getIdAaTipoFascicolo(), decAaTipoFascicolo.getNiCharPadParteClassif().longValue()); - if (tmpConfigNumFasc.getParti().size() > 0) { + if (!tmpConfigNumFasc.getParti().isEmpty()) { rispostaControlli.setrObject(tmpConfigNumFasc); rispostaControlli.setrBoolean(true); } else { @@ -719,7 +658,7 @@ private ConfigNumFasc caricaPartiAANumero(long idAaNumeroFasc, long niCharPadPar javax.persistence.Query query = entityManager.createQuery(queryStr); query.setParameter("idAaTipoFascicolo", idAaNumeroFasc); - List tmpLstP = (List) query.getResultList(); + List tmpLstP = query.getResultList(); for (DecParteNumeroFascicolo tmpParte : tmpLstP) { ConfigNumFasc.ParteNumero tmpPRanno = tmpConfAnno.aggiungiParte(); @@ -792,12 +731,13 @@ public RispostaControlli checkDecVoceTitolWithCompAndVoce(String cdVoceTitol, St if (StringUtils.isNotBlank(cdVoceTitol)) { query.setParameter("cdVoceTitol", StringEscapeUtils.escapeEcmaScript(cdVoceTitol.toUpperCase().trim()));// ripulisco dagli - // spazi + // spazi } - // escaping (stessa gestione della fase di inserimento sulle voci vedi StrutTitolariEjb.creaVoce) + // escaping (stessa gestione della fase di inserimento sulle voci vedi + // StrutTitolariEjb.creaVoce) query.setParameter("cdCompositoVoceTitol", StringEscapeUtils.escapeEcmaScript(cdCompositoVoceTitol.toUpperCase().trim()));// ripulisco - // dagli spazi + // dagli spazi query.setParameter("dtApertura", dtApertura); decVoceTitols = query.getResultList(); @@ -877,20 +817,21 @@ public RispostaControlli checkCdVoceDescDecValVoceTitol(String cdVoceTitol, Stri javax.persistence.Query query = entityManager.createQuery(queryStr, DecValVoceTitol.class); query.setParameter("idTitol", idTitol); - // escaping (stessa gestione della fase di inserimento sulle voci vedi StrutTitolariEjb.creaVoce) + // escaping (stessa gestione della fase di inserimento sulle voci vedi + // StrutTitolariEjb.creaVoce) if (StringUtils.isNotBlank(cdVoceTitol)) { query.setParameter("cdVoceTitol", StringEscapeUtils.escapeEcmaScript(cdVoceTitol.toUpperCase().trim()));// ripulisco - // dagli - // spazi + // dagli + // spazi } if (StringUtils.isNotBlank(cdCompositoVoceTitol)) { query.setParameter("cdCompositoVoceTitol", StringEscapeUtils.escapeEcmaScript(cdCompositoVoceTitol.toUpperCase().trim()));// ripulisco - // dagli spazi + // dagli spazi } query.setParameter("dsVoceTitol", StringEscapeUtils.escapeEcmaScript(dsVoceTitol.toUpperCase().trim()));// ripulisco - // dagli - // spazi + // dagli + // spazi query.setParameter("dtApertura", dtApertura); decValVoceTitols = query.getResultList(); @@ -950,7 +891,7 @@ public RispostaControlli getDecLvlVoceTitolWithNiLivello(long niLivello, long id javax.persistence.Query query = entityManager.createQuery(queryStr, DecLivelloTitol.class); query.setParameter("idTitol", idTitol); - query.setParameter("niLivello", niLivello);// livello successivo + query.setParameter("niLivello", new BigDecimal(niLivello));// livello successivo decLivelloTitols = query.getResultList(); @@ -965,7 +906,7 @@ public RispostaControlli getDecLvlVoceTitolWithNiLivello(long niLivello, long id rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliFascicoli.getDecLvlVoceTitolWithNiLivello: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error(ERRORE_TABELLA_DECODIFICA, e); } return rispostaControlli; @@ -997,7 +938,7 @@ public RispostaControlli getDecTitolStrutt(long idStruttura, Date dtApertura) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliFascicoli.getDecTitol: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica " + e); + log.error(ERRORE_TABELLA_DECODIFICA, e); } return rispostaControlli; } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ControlliProfiliFascicolo.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ControlliProfiliFascicolo.java index 020b4e0..60fe471 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ControlliProfiliFascicolo.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ControlliProfiliFascicolo.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -41,6 +58,8 @@ import org.xml.sax.SAXException; import it.eng.parer.entity.DecModelloXsdFascicolo; +import it.eng.parer.entity.constraint.DecModelloXsdFascicolo.TiModelloXsd; +import it.eng.parer.entity.constraint.DecModelloXsdFascicolo.TiUsoModelloXsd; import it.eng.parer.ws.dto.CSChiave; import it.eng.parer.ws.dto.CSChiaveFasc; import it.eng.parer.ws.dto.CSChiaveSottFasc; @@ -70,6 +89,7 @@ * * @author fioravanti_f */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "ControlliProfiliFascicolo") @LocalBean @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) @@ -82,12 +102,6 @@ public class ControlliProfiliFascicolo { @EJB protected ControlliSemantici controlliSemantici; - public static final String NOME_SEGNATURA_ARCHIVISTICA = "PROFILO_ARCHIVISTICO_FASCICOLO"; - public static final String NOME_METADATI_PROFILO = "PROFILO_GENERALE_FASCICOLO"; - public static final String NOME_METADATI_SPECIFICI = "PROFILO_SPECIFICO_FASCICOLO"; - // - static final String NOME_USO_VERSAMENTO = "VERS"; - public RispostaControlli verificaProfiloArchivistico(VersFascicoloExt versamento) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); @@ -108,10 +122,10 @@ public RispostaControlli verificaProfiloArchivistico(VersFascicoloExt versamento + "and t.decModelloXsdFascicolo.dtIstituz <= :dataDiOggiIn " + "and t.decModelloXsdFascicolo.dtSoppres > :dataDiOggiIn "; // da notare STRETTAMENTE MAGGIORE ; javax.persistence.Query query = entityManager.createQuery(queryStr); - query.setParameter("idTipoFascicolo", new BigDecimal(svf.getIdTipoFascicolo())); + query.setParameter("idTipoFascicolo", svf.getIdTipoFascicolo()); query.setParameter("annoIn", new BigDecimal(svf.getChiaveNonVerificata().getAnno())); - query.setParameter("segnatura", NOME_SEGNATURA_ARCHIVISTICA); - query.setParameter("usoversamento", NOME_USO_VERSAMENTO); + query.setParameter("segnatura", TiModelloXsd.PROFILO_ARCHIVISTICO_FASCICOLO); + query.setParameter("usoversamento", TiUsoModelloXsd.VERS); query.setParameter("dataDiOggiIn", new Date()); conta = (Long) query.getSingleResult(); // @@ -138,10 +152,10 @@ public RispostaControlli verificaProfiloArchivistico(VersFascicoloExt versamento + "and uf.decAaTipoFascicolo.aaFinTipoFascicolo >= :annoIn "; query = entityManager.createQuery(queryStr, DecModelloXsdFascicolo.class); query.setParameter("cdXsd", versione); - query.setParameter("idTipoFascicolo", new BigDecimal(svf.getIdTipoFascicolo())); + query.setParameter("idTipoFascicolo", svf.getIdTipoFascicolo()); query.setParameter("annoIn", new BigDecimal(svf.getChiaveNonVerificata().getAnno())); - query.setParameter("segnatura", NOME_SEGNATURA_ARCHIVISTICA); - query.setParameter("usoversamento", NOME_USO_VERSAMENTO); + query.setParameter("segnatura", TiModelloXsd.PROFILO_ARCHIVISTICO_FASCICOLO); + query.setParameter("usoversamento", TiUsoModelloXsd.VERS); query.setParameter("dataDiOggiIn", new Date()); // dmxfs = query.getResultList(); @@ -162,10 +176,10 @@ public RispostaControlli verificaProfiloArchivistico(VersFascicoloExt versamento + "and uf.decAaTipoFascicolo.aaFinTipoFascicolo >= :annoIn "; query = entityManager.createQuery(queryStr, DecModelloXsdFascicolo.class); query.setParameter("flDefault", "1"); - query.setParameter("idTipoFascicolo", new BigDecimal(svf.getIdTipoFascicolo())); + query.setParameter("idTipoFascicolo", svf.getIdTipoFascicolo()); query.setParameter("annoIn", new BigDecimal(svf.getChiaveNonVerificata().getAnno())); - query.setParameter("segnatura", NOME_SEGNATURA_ARCHIVISTICA); - query.setParameter("usoversamento", NOME_USO_VERSAMENTO); + query.setParameter("segnatura", TiModelloXsd.PROFILO_ARCHIVISTICO_FASCICOLO); + query.setParameter("usoversamento", TiUsoModelloXsd.VERS); query.setParameter("dataDiOggiIn", new Date()); // dmxfs = query.getResultList(); @@ -370,10 +384,10 @@ public RispostaControlli verificaProfiloGenerale(VersFascicoloExt versamento, EC + "and uf.decAaTipoFascicolo.aaFinTipoFascicolo >= :annoIn "; javax.persistence.Query query = entityManager.createQuery(queryStr, DecModelloXsdFascicolo.class); query.setParameter("cdXsd", versione); - query.setParameter("idTipoFascicolo", new BigDecimal(svf.getIdTipoFascicolo())); + query.setParameter("idTipoFascicolo", svf.getIdTipoFascicolo()); query.setParameter("annoIn", new BigDecimal(svf.getChiaveNonVerificata().getAnno())); - query.setParameter("segnatura", NOME_METADATI_PROFILO); - query.setParameter("usoversamento", NOME_USO_VERSAMENTO); + query.setParameter("segnatura", TiModelloXsd.PROFILO_GENERALE_FASCICOLO); + query.setParameter("usoversamento", TiUsoModelloXsd.VERS); query.setParameter("dataDiOggiIn", new Date()); // dmxfs = query.getResultList(); @@ -393,10 +407,10 @@ public RispostaControlli verificaProfiloGenerale(VersFascicoloExt versamento, EC + "and uf.decAaTipoFascicolo.aaFinTipoFascicolo >= :annoIn "; javax.persistence.Query query = entityManager.createQuery(queryStr, DecModelloXsdFascicolo.class); query.setParameter("flDefault", "1"); - query.setParameter("idTipoFascicolo", new BigDecimal(svf.getIdTipoFascicolo())); + query.setParameter("idTipoFascicolo", svf.getIdTipoFascicolo()); query.setParameter("annoIn", new BigDecimal(svf.getChiaveNonVerificata().getAnno())); - query.setParameter("segnatura", NOME_METADATI_PROFILO); - query.setParameter("usoversamento", NOME_USO_VERSAMENTO); + query.setParameter("segnatura", TiModelloXsd.PROFILO_GENERALE_FASCICOLO); + query.setParameter("usoversamento", TiUsoModelloXsd.VERS); query.setParameter("dataDiOggiIn", new Date()); // dmxfs = query.getResultList(); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ElencoVersamentoFascicoli.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ElencoVersamentoFascicoli.java index a9d36bb..e41458a 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ElencoVersamentoFascicoli.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ElencoVersamentoFascicoli.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versFascicoli.ejb; import javax.annotation.Resource; @@ -10,9 +27,6 @@ import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import it.eng.parer.entity.FasFascicolo; import it.eng.parer.entity.constraint.ElvFascDaElabElenco.TiStatoFascDaElab; import it.eng.parer.entity.constraint.FasStatoConservFascicolo.TiStatoConservazione; @@ -32,7 +46,6 @@ @LocalBean public class ElencoVersamentoFascicoli { - private static final Logger log = LoggerFactory.getLogger(ElencoVersamentoFascicoli.class); // @EJB ElencoVersamentoFascicoliHelper elencoVersamentoFascicoliHelper; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ElencoVersamentoFascicoliHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ElencoVersamentoFascicoliHelper.java index 5598a4d..d97b761 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ElencoVersamentoFascicoliHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/ElencoVersamentoFascicoliHelper.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versFascicoli.ejb; import java.math.BigDecimal; @@ -7,13 +24,10 @@ import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import it.eng.parer.entity.ElvFascDaElabElenco; +import it.eng.parer.entity.FasFascicolo; import it.eng.parer.entity.FasStatoConservFascicolo; import it.eng.parer.entity.FasStatoFascicoloElenco; -import it.eng.parer.entity.FasFascicolo; import it.eng.parer.entity.constraint.ElvFascDaElabElenco.TiStatoFascDaElab; import it.eng.parer.entity.constraint.FasStatoConservFascicolo.TiStatoConservazione; import it.eng.parer.entity.constraint.FasStatoFascicoloElenco.TiStatoFascElenco; @@ -26,16 +40,9 @@ @LocalBean public class ElencoVersamentoFascicoliHelper { - private static final Logger log = LoggerFactory.getLogger(ElencoVersamentoFascicoliHelper.class); - @PersistenceContext(unitName = "ParerJPA") private EntityManager em; - public void insertFascicoloOnCodaDaElab(long idFascicolo, long idTipoFasc, TiStatoFascDaElab status) { - FasFascicolo fascicolo = em.find(FasFascicolo.class, idFascicolo); - insertFascicoloOnCodaDaElab(fascicolo, idTipoFasc, status); - } - public void insertFascicoloOnCodaDaElab(FasFascicolo fascicolo, long idTipoFasc, TiStatoFascDaElab status) { ElvFascDaElabElenco fascVersDaElab = new ElvFascDaElabElenco(); fascVersDaElab.setFasFascicolo(fascicolo); @@ -50,24 +57,6 @@ public void insertFascicoloOnCodaDaElab(FasFascicolo fascicolo, long idTipoFasc, em.flush(); } - public void deleteElencoVersDaElab(Long idElvFascDaElabElenco) { - ElvFascDaElabElenco eevde = em.find(ElvFascDaElabElenco.class, idElvFascDaElabElenco); - em.remove(eevde); - } - - public void aggiornaElencoDaElabCorrente(long idElencoDaEleb, TiStatoFascDaElab stato) { - ElvFascDaElabElenco elencoCorrenteDaElab = em.find(ElvFascDaElabElenco.class, idElencoDaEleb); - elencoCorrenteDaElab.setTiStatoFascDaElab(stato); - em.persist(elencoCorrenteDaElab); - } - - // - - public void insertFascicoloOnStatoCons(long idFascicolo, TiStatoConservazione status) { - FasFascicolo fascicolo = em.find(FasFascicolo.class, idFascicolo); - insertFascicoloOnStatoCons(fascicolo, status); - } - public void insertFascicoloOnStatoCons(FasFascicolo fascicolo, TiStatoConservazione status) { FasStatoConservFascicolo statoConservFascicolo = new FasStatoConservFascicolo(); statoConservFascicolo.setFasFascicolo(fascicolo); @@ -80,24 +69,6 @@ public void insertFascicoloOnStatoCons(FasFascicolo fascicolo, TiStatoConservazi em.flush(); } - public void deleteStatoConservFascicolo(Long idStatoConservFascicolo) { - FasStatoConservFascicolo eevde = em.find(FasStatoConservFascicolo.class, idStatoConservFascicolo); - em.remove(eevde); - } - - public void aggiornaStatoConservFascicoloCorrente(long idStatoConservFasc, TiStatoConservazione stato) { - FasStatoConservFascicolo statoConservFascCorrente = em.find(FasStatoConservFascicolo.class, idStatoConservFasc); - statoConservFascCorrente.setTiStatoConservazione(stato); - em.persist(statoConservFascCorrente); - } - - // - - public void insertFascicoloOnStatoElenco(long idFascicolo, TiStatoFascElenco status) { - FasFascicolo fascicolo = em.find(FasFascicolo.class, idFascicolo); - insertFascicoloOnStatoElenco(fascicolo, status); - } - public void insertFascicoloOnStatoElenco(FasFascicolo fascicolo, TiStatoFascElenco status) { FasStatoFascicoloElenco statoFascicoloElenco = new FasStatoFascicoloElenco(); statoFascicoloElenco.setFasFascicolo(fascicolo); @@ -109,16 +80,4 @@ public void insertFascicoloOnStatoElenco(FasFascicolo fascicolo, TiStatoFascElen em.persist(statoFascicoloElenco); em.flush(); } - - public void deleteStatoFascicoloElenco(Long idStatoFascicoloElenco) { - FasStatoFascicoloElenco eevde = em.find(FasStatoFascicoloElenco.class, idStatoFascicoloElenco); - em.remove(eevde); - } - - public void aggiornaStatoFascicoloElencoCorrente(long idStatoFascicoloElenco, TiStatoFascElenco stato) { - FasStatoFascicoloElenco statoFascicoloElenco = em.find(FasStatoFascicoloElenco.class, idStatoFascicoloElenco); - statoFascicoloElenco.setTiStatoFascElencoVers(stato); - em.persist(statoFascicoloElenco); - } - -} \ No newline at end of file +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/LogSessioneFascicoli.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/LogSessioneFascicoli.java index c78bb65..361795d 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/LogSessioneFascicoli.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/LogSessioneFascicoli.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,16 +22,6 @@ */ package it.eng.parer.ws.versFascicoli.ejb; -import it.eng.parer.entity.FasFascicolo; -import it.eng.parer.entity.VrsFascicoloKo; -import it.eng.parer.entity.VrsSesFascicoloErr; -import it.eng.parer.entity.VrsSesFascicoloKo; -import it.eng.parer.ws.dto.IRispostaWS; -import it.eng.parer.ws.dto.RispostaControlli; -import it.eng.parer.ws.utils.MessaggiWSBundle; -import it.eng.parer.ws.versFascicoli.dto.RispostaWSFascicolo; -import it.eng.parer.ws.versFascicoli.dto.VersFascicoloExt; -import it.eng.parer.ws.versamento.dto.SyncFakeSessn; import javax.annotation.Resource; import javax.ejb.EJB; import javax.ejb.EJBContext; @@ -24,9 +31,21 @@ import javax.ejb.TransactionAttributeType; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import it.eng.parer.entity.FasFascicolo; +import it.eng.parer.entity.VrsFascicoloKo; +import it.eng.parer.entity.VrsSesFascicoloErr; +import it.eng.parer.entity.VrsSesFascicoloKo; +import it.eng.parer.ws.dto.IRispostaWS; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.utils.MessaggiWSBundle; +import it.eng.parer.ws.versFascicoli.dto.RispostaWSFascicolo; +import it.eng.parer.ws.versFascicoli.dto.VersFascicoloExt; +import it.eng.parer.ws.versamento.dto.SyncFakeSessn; + /** * * @author fioravanti_f @@ -132,7 +151,7 @@ public boolean registraSessioneFallita(RispostaWSFascicolo rispostaWs, VersFasci } else { // altrimenti -> cerco se esiste una precedente registrazione fallita dello // stesso fascicolo e se esiste, lo blocco in modo esclusivo: lo devo modificare - tmpRispostaControlli = logSessioneFascicoliHelper.cercaFascicoloKo(rispostaWs, versamento, sessione); + tmpRispostaControlli = logSessioneFascicoliHelper.cercaFascicoloKo(versamento); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); @@ -142,8 +161,8 @@ public boolean registraSessioneFallita(RispostaWSFascicolo rispostaWs, VersFasci tmpFascicoloKo = (VrsFascicoloKo) tmpRispostaControlli.getrObject(); } else { // verifica se posso salvare la sessione fallita - tmpRispostaControlli = logSessioneFascicoliHelper.verificaPartizioneFascicoloByAaStrutKo(rispostaWs, - versamento, sessione); + tmpRispostaControlli = logSessioneFascicoliHelper + .verificaPartizioneFascicoloByAaStrutKo(versamento); if (!tmpRispostaControlli.isrBoolean()) { // c'è un problema del partizionamento. Si tratta di un'evenienza rara ma // possibile. In questo caso non posso salvare la sessione fallita. @@ -183,7 +202,7 @@ public boolean registraSessioneFallita(RispostaWSFascicolo rispostaWs, VersFasci } // salvo i warning e gli errori ulteriori - tmpRispostaControlli = logSessioneFascicoliHelper.scriviErroriFascicoloKo(rispostaWs, versamento, sessione, + tmpRispostaControlli = logSessioneFascicoliHelper.scriviErroriFascicoloKo(rispostaWs, versamento, tmpSesFascicoloKo); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/LogSessioneFascicoliHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/LogSessioneFascicoliHelper.java index 767d1bd..21b6939 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/LogSessioneFascicoliHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/LogSessioneFascicoliHelper.java @@ -1,5 +1,49 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versFascicoli.ejb; +import static it.eng.parer.util.DateUtilsConverter.convert; +import static it.eng.parer.util.DateUtilsConverter.convertLocal; +import static it.eng.parer.util.FlagUtilsConverter.booleanToFlag; + +import java.io.StringWriter; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; +import javax.ejb.TransactionAttribute; +import javax.ejb.TransactionAttributeType; +import javax.persistence.EntityManager; +import javax.persistence.LockModeType; +import javax.persistence.PersistenceContext; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import it.eng.parer.entity.DecErrSacer; import it.eng.parer.entity.DecTipoFascicolo; import it.eng.parer.entity.FasFascicolo; @@ -12,8 +56,9 @@ import it.eng.parer.entity.VrsSesFascicoloKo; import it.eng.parer.entity.VrsXmlSesFascicoloErr; import it.eng.parer.entity.VrsXmlSesFascicoloKo; +import it.eng.parer.util.Constants; import it.eng.parer.util.ejb.AppServerInstance; -import it.eng.parer.viewEntity.VrsVUpdFascicoloKo; +import it.eng.parer.view_entity.VrsVUpdFascicoloKo; import it.eng.parer.ws.dto.IRispostaWS; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.ejb.XmlFascCache; @@ -27,31 +72,12 @@ import it.eng.parer.ws.versFascicoli.dto.VersFascicoloExt; import it.eng.parer.ws.versamento.dto.SyncFakeSessn; import it.eng.parer.ws.versamento.dto.VoceDiErrore; -import java.io.StringWriter; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.ejb.EJB; -import javax.ejb.LocalBean; -import javax.ejb.Stateless; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.persistence.EntityManager; -import javax.persistence.LockModeType; -import javax.persistence.PersistenceContext; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import static it.eng.parer.util.DateUtilsConverter.convert; /** * * @author fioravanti_f */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "LogSessioneFascicoliHelper") @LocalBean public class LogSessioneFascicoliHelper { @@ -72,12 +98,10 @@ public class LogSessioneFascicoliHelper { private EntityManager entityManager; // costanti per la tabella VrsSesFascicoloErr - private final static String SESSIONE_NON_VERIFICATA = "NON_VERIFICATO"; + private static final String SESSIONE_NON_VERIFICATA = "NON_VERIFICATO"; // costanti per la tabella VrsFascicoloKo public static final String FAS_NON_VERIFICATO = "NON_VERIFICATO"; - public static final String FAS_VERIFICATO = "VERIFICATO"; - public static final String FAS_NON_RISOLUBILE = "NON_RISOLUBILE"; public static final String FAS_RISOLTO = "RISOLTO"; // private static final String TIPO_ERR_FATALE = "FATALE"; @@ -109,15 +133,14 @@ public RispostaControlli verificaPartizioneFascicoloErr() { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "LogSessioneFascicoliHelper.verificaPartizioneFascicoloErr: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli verificaPartizioneFascicoloByAaStrutKo(RispostaWSFascicolo rispostaWs, - VersFascicoloExt versamento, SyncFakeSessn sessione) { + public RispostaControlli verificaPartizioneFascicoloByAaStrutKo(VersFascicoloExt versamento) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); rispostaControlli.setrBoolean(false); @@ -133,8 +156,8 @@ public RispostaControlli verificaPartizioneFascicoloByAaStrutKo(RispostaWSFascic + "and t.flPartXmlsesfasckoDataOk = :flPartXmlsesfasckoDataOk "; javax.persistence.Query query = entityManager.createQuery(queryStr); - query.setParameter("idStrut", svf.getIdStruttura()); - query.setParameter("anno", svf.getChiaveNonVerificata().getAnno()); + query.setParameter("idStrut", new BigDecimal(svf.getIdStruttura())); + query.setParameter("anno", new BigDecimal(svf.getChiaveNonVerificata().getAnno())); query.setParameter("flPartFasckoOk", "1"); query.setParameter("flPartFasckoAnnoOk", "1"); @@ -158,7 +181,7 @@ public RispostaControlli verificaPartizioneFascicoloByAaStrutKo(RispostaWSFascic rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "LogSessioneFascicoliHelper.verificaPartizioneFascicoloKo: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error("Eccezione nella lettura della tabella di decodifica ", e); } return rispostaControlli; @@ -235,12 +258,6 @@ public RispostaControlli scriviXmlFascicoloErr(RispostaWSFascicolo rispostaWs, V tmpXmlSesFascicoloErr.setTiXml(CostantiDB.TipiXmlDati.RICHIESTA); tmpXmlSesFascicoloErr.setCdVersioneXml(svf.getVersioneIndiceSipNonVerificata()); tmpXmlSesFascicoloErr.setBlXml(versamento.getDatiXml().length() == 0 ? "--" : versamento.getDatiXml()); - // tmpXmlSesFascicoloErr.setCdEncodingHashXml(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()); - // tmpXmlSesFascicoloErr.setDsAlgoHashXml(CostantiDB.TipiHash.SHA_1.descrivi()); - // tmpXmlSesFascicoloErr.setDsUrnXml(MessaggiWSFormat - // .formattaUrnIndiceSipFasc(Long.toString(fascicoloErr.getIdSesFascicoloErr()))); - // tmpXmlSesFascicoloErr.setDsHashXml(new - // HashCalculator().calculateHash(versamento.getDatiXml()).toHexBinary()); entityManager.persist(tmpXmlSesFascicoloErr); String xmlesito = this.generaRapportoVersamento(rispostaWs); @@ -250,11 +267,6 @@ public RispostaControlli scriviXmlFascicoloErr(RispostaWSFascicolo rispostaWs, V tmpXmlSesFascicoloErr.setTiXml(CostantiDB.TipiXmlDati.RISPOSTA); tmpXmlSesFascicoloErr.setCdVersioneXml(esito.getVersioneRapportoVersamento()); tmpXmlSesFascicoloErr.setBlXml(xmlesito); - // tmpXmlSesFascicoloErr.setCdEncodingHashXml(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()); - // tmpXmlSesFascicoloErr.setDsAlgoHashXml(CostantiDB.TipiHash.SHA_1.descrivi()); - // tmpXmlSesFascicoloErr.setDsUrnXml(MessaggiWSFormat - // .formattaUrnRappNegFasc(Long.toString(fascicoloErr.getIdSesFascicoloErr()))); - // tmpXmlSesFascicoloErr.setDsHashXml(new HashCalculator().calculateHash(xmlesito).toHexBinary()); entityManager.persist(tmpXmlSesFascicoloErr); tmpRispostaControlli.setrBoolean(true); @@ -269,8 +281,7 @@ public RispostaControlli scriviXmlFascicoloErr(RispostaWSFascicolo rispostaWs, V } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli cercaFascicoloKo(RispostaWSFascicolo rispostaWs, VersFascicoloExt versamento, - SyncFakeSessn sessione) { + public RispostaControlli cercaFascicoloKo(VersFascicoloExt versamento) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); // cerco e recupero il fascicolo fallito tmpRispostaControlli.setrBoolean(false); @@ -290,11 +301,11 @@ public RispostaControlli cercaFascicoloKo(RispostaWSFascicolo rispostaWs, VersFa // errore per il fascicolo. in questo caso dovrò creare la riga in tabella // nel caso di scrittura di sessione fallita. tmpRispostaControlli.setrBoolean(true); - if (fasFascicolos.size() > 0) { + if (!fasFascicolos.isEmpty()) { // se poi ho anche trovato qualcosa di utile, lo restituisco al // chiamante dopo averlo bloccato in modo esclusivo - Map properties = new HashMap(); - properties.put("javax.persistence.lock.timeout", 25); + Map properties = new HashMap<>(); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, 25000); VrsFascicoloKo tmpFascicoloKo = entityManager.find(VrsFascicoloKo.class, fasFascicolos.get(0).getIdFascicoloKo(), LockModeType.PESSIMISTIC_WRITE, properties); @@ -467,7 +478,7 @@ public RispostaControlli scriviSessioneFascicoloKo(RispostaWSFascicolo rispostaW return tmpRispostaControlli; } - private void aggiornaConteggioMonContaFasKo(VrsFascicoloKo fascicoloKo) { + public void aggiornaConteggioMonContaFasKo(VrsFascicoloKo fascicoloKo) { List mcfks; String queryStr = "select ud " + "from MonContaFascicoliKo ud " + "where ud.orgStrut.idStrut = :idStrutIn " @@ -482,7 +493,7 @@ private void aggiornaConteggioMonContaFasKo(VrsFascicoloKo fascicoloKo) { query.setParameter("idTipoFascicolo", fascicoloKo.getDecTipoFascicolo().getIdTipoFascicolo()); mcfks = query.getResultList(); - if (mcfks.size() > 0) { + if (!mcfks.isEmpty()) { mcfks.get(0).setNiFascicoliKo(mcfks.get(0).getNiFascicoliKo().subtract(BigDecimal.ONE)); entityManager.flush(); } @@ -506,9 +517,12 @@ public RispostaControlli scriviXmlFascicoloKo(RispostaWSFascicolo rispostaWs, Ve tmpXmlSesFascicoloErr.setBlXml(versamento.getDatiXml().length() == 0 ? "--" : versamento.getDatiXml()); tmpXmlSesFascicoloErr.setIdStrut(new BigDecimal(svf.getIdStruttura())); - tmpXmlSesFascicoloErr.setDtRegXmlSesKo(convert(sessione.getTmApertura())); + tmpXmlSesFascicoloErr.setDtRegXmlSesKo(convertLocal(sessione.getTmApertura())); entityManager.persist(tmpXmlSesFascicoloErr); + if (sessFascicoloKo.getVrsXmlSesFascicoloKos() == null) { + sessFascicoloKo.setVrsXmlSesFascicoloKos(new ArrayList<>()); + } sessFascicoloKo.getVrsXmlSesFascicoloKos().add(tmpXmlSesFascicoloErr); String xmlesito = this.generaRapportoVersamento(rispostaWs); @@ -519,7 +533,7 @@ public RispostaControlli scriviXmlFascicoloKo(RispostaWSFascicolo rispostaWs, Ve tmpXmlSesFascicoloErr.setCdVersioneXml(esito.getVersioneRapportoVersamento()); tmpXmlSesFascicoloErr.setBlXml(xmlesito); tmpXmlSesFascicoloErr.setIdStrut(new BigDecimal(svf.getIdStruttura())); - tmpXmlSesFascicoloErr.setDtRegXmlSesKo(convert(sessione.getTmApertura())); + tmpXmlSesFascicoloErr.setDtRegXmlSesKo(convertLocal(sessione.getTmApertura())); entityManager.persist(tmpXmlSesFascicoloErr); sessFascicoloKo.getVrsXmlSesFascicoloKos().add(tmpXmlSesFascicoloErr); @@ -538,7 +552,7 @@ public RispostaControlli scriviXmlFascicoloKo(RispostaWSFascicolo rispostaWs, Ve @TransactionAttribute(TransactionAttributeType.REQUIRED) public RispostaControlli scriviErroriFascicoloKo(RispostaWSFascicolo rispostaWs, VersFascicoloExt versamento, - SyncFakeSessn sessione, VrsSesFascicoloKo sessFascicoloKo) { + VrsSesFascicoloKo sessFascicoloKo) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); // salvo gli errori ed i warning sessione fallita tmpRispostaControlli.setrBoolean(false); @@ -559,7 +573,7 @@ public RispostaControlli scriviErroriFascicoloKo(RispostaWSFascicolo rispostaWs, tmpErrSessioneVers.setDecErrSacer(messaggiWSHelper.caricaDecErrore(tmpVoceDiErrore.getErrorCode())); tmpErrSessioneVers.setDsErr(LogSessioneUtils.getDsErrAtMaxLen(tmpVoceDiErrore.getErrorMessage())); - tmpErrSessioneVers.setFlErrPrinc(tmpVoceDiErrore.isElementoPrincipale() ? "1" : "0"); + tmpErrSessioneVers.setFlErrPrinc(booleanToFlag(tmpVoceDiErrore.isElementoPrincipale())); // entityManager.persist(tmpErrSessioneVers); sessFascicoloKo.getVrsErrSesFascicoloKos().add(tmpErrSessioneVers); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/RecupSessDubbieFasc.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/RecupSessDubbieFasc.java index abbb078..cc80c6c 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/RecupSessDubbieFasc.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/RecupSessDubbieFasc.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,17 +22,9 @@ */ package it.eng.parer.ws.versFascicoli.ejb; -import it.eng.parer.ws.dto.CSChiaveFasc; -import it.eng.parer.ws.dto.CSVersatore; -import it.eng.parer.ws.dto.IRispostaWS; -import it.eng.parer.ws.dto.RispostaControlli; -import it.eng.parer.ws.ejb.ControlliSemantici; -import it.eng.parer.ws.ejb.ControlliWS; -import it.eng.parer.ws.utils.Costanti; -import it.eng.parer.ws.versFascicoli.dto.RispostaWSFascicolo; -import it.eng.parer.ws.versFascicoli.dto.VersFascicoloExt; import java.io.IOException; import java.io.StringReader; + import javax.ejb.EJB; import javax.ejb.LocalBean; import javax.ejb.Stateless; @@ -31,6 +40,7 @@ import javax.xml.xpath.XPathExpression; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -39,6 +49,16 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; +import it.eng.parer.ws.dto.CSChiaveFasc; +import it.eng.parer.ws.dto.CSVersatore; +import it.eng.parer.ws.dto.IRispostaWS; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.ejb.ControlliSemantici; +import it.eng.parer.ws.ejb.ControlliWS; +import it.eng.parer.ws.utils.Costanti; +import it.eng.parer.ws.versFascicoli.dto.RispostaWSFascicolo; +import it.eng.parer.ws.versFascicoli.dto.VersFascicoloExt; + /** * * @author fioravanti_f diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/SalvataggioFascicoli.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/SalvataggioFascicoli.java index 8af8e9d..b7a6eab 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/SalvataggioFascicoli.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/SalvataggioFascicoli.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -64,7 +81,7 @@ public boolean salvaFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt v // cerco se esiste una precedente registrazione fallita dello // stesso fascicolo e se esiste, lo blocco in modo esclusivo: lo devo rimuovere // e devo riallocare tutte le sue sessioni al fascicolo che sto creando - tmpRispostaControlli = logSessioneFascicoliHelper.cercaFascicoloKo(rispostaWs, versamento, sessione); + tmpRispostaControlli = logSessioneFascicoliHelper.cercaFascicoloKo(versamento); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); @@ -75,8 +92,7 @@ public boolean salvaFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt v } // salvo fascicolo - tmpRispostaControlli = salvataggioFascicoliHelper.scriviFascicolo(rispostaWs, versamento, sessione, - tmpFascicoloKo); + tmpRispostaControlli = salvataggioFascicoliHelper.scriviFascicolo(versamento, sessione, tmpFascicoloKo); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); @@ -87,8 +103,7 @@ public boolean salvaFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt v } // salvo ammin. partecipanti (se esistono) da profilo generale - tmpRispostaControlli = salvataggioFascicoliHelper.scriviAmmPartecipanti(rispostaWs, versamento, sessione, - tmpFasFascicolo); + tmpRispostaControlli = salvataggioFascicoliHelper.scriviAmmPartecipanti(versamento, tmpFasFascicolo); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); @@ -96,8 +111,7 @@ public boolean salvaFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt v } // salvo soggetti coinvolti (se esistono) da profilo generale - tmpRispostaControlli = salvataggioFascicoliHelper.scriviSoggCoinvolti(rispostaWs, versamento, sessione, - tmpFasFascicolo); + tmpRispostaControlli = salvataggioFascicoliHelper.scriviSoggCoinvolti(versamento, tmpFasFascicolo); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); @@ -105,8 +119,7 @@ public boolean salvaFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt v } // salvo responsabili (se esistono) da profilo generale - tmpRispostaControlli = salvataggioFascicoliHelper.scriviResponsabili(rispostaWs, versamento, sessione, - tmpFasFascicolo); + tmpRispostaControlli = salvataggioFascicoliHelper.scriviResponsabili(versamento, tmpFasFascicolo); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); @@ -114,8 +127,7 @@ public boolean salvaFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt v } // salvo uo responsabili (se esistono) da profilo generale - tmpRispostaControlli = salvataggioFascicoliHelper.scriviUoOrgResponsabili(rispostaWs, versamento, sessione, - tmpFasFascicolo); + tmpRispostaControlli = salvataggioFascicoliHelper.scriviUoOrgResponsabili(versamento, tmpFasFascicolo); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); @@ -132,8 +144,8 @@ public boolean salvaFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt v } // salvo profili archivistico e generale - tmpRispostaControlli = salvataggioFascicoliHelper.scriviProfiliXMLFascicolo(rispostaWs, versamento, - sessione, tmpFasFascicolo); + tmpRispostaControlli = salvataggioFascicoliHelper.scriviProfiliXMLFascicolo(versamento, sessione, + tmpFasFascicolo); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); @@ -141,8 +153,7 @@ public boolean salvaFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt v } // salvo unità documentarie - tmpRispostaControlli = salvataggioFascicoliHelper.scriviUnitaDocFascicolo(rispostaWs, versamento, sessione, - tmpFasFascicolo); + tmpRispostaControlli = salvataggioFascicoliHelper.scriviUnitaDocFascicolo(versamento, tmpFasFascicolo); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); @@ -150,8 +161,7 @@ public boolean salvaFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt v } // salvo fascicoli collegati - tmpRispostaControlli = salvataggioFascicoliHelper.scriviLinkFascicolo(rispostaWs, versamento, sessione, - tmpFasFascicolo); + tmpRispostaControlli = salvataggioFascicoliHelper.scriviLinkFascicolo(versamento, tmpFasFascicolo); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); @@ -159,8 +169,7 @@ public boolean salvaFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt v } // salvo warning - tmpRispostaControlli = salvataggioFascicoliHelper.scriviWarningFascicolo(rispostaWs, versamento, sessione, - tmpFasFascicolo); + tmpRispostaControlli = salvataggioFascicoliHelper.scriviWarningFascicolo(versamento, tmpFasFascicolo); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); @@ -169,8 +178,7 @@ public boolean salvaFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt v // salvo warning aa if (versamento.getStrutturaComponenti().isWarningFormatoNumero()) { - tmpRispostaControlli = salvataggioFascicoliHelper.salvaWarningAATipoFascicolo(rispostaWs, versamento, - sessione, tmpFasFascicolo); + tmpRispostaControlli = salvataggioFascicoliHelper.salvaWarningAATipoFascicolo(versamento); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); @@ -215,10 +223,6 @@ public boolean salvaFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt v return false; } } - - // TODO: RIMUOVERE - // context.setRollbackOnly(); - // TODO: RIMUOVI COMMENTO entityManager.flush(); } catch (Exception e) { // l'errore di persistenza viene aggiunto alla pila diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/SalvataggioFascicoliHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/SalvataggioFascicoliHelper.java index 18cfecc..fd406a4 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/SalvataggioFascicoliHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/SalvataggioFascicoliHelper.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -6,11 +23,11 @@ package it.eng.parer.ws.versFascicoli.ejb; import static it.eng.parer.util.DateUtilsConverter.convert; +import static it.eng.parer.util.FlagUtilsConverter.booleanToFlag; import java.io.StringWriter; import java.math.BigDecimal; import java.util.Calendar; -import java.util.GregorianCalendar; import javax.ejb.EJB; import javax.ejb.LocalBean; @@ -19,7 +36,6 @@ import javax.ejb.TransactionAttributeType; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; -import javax.xml.bind.JAXBException; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; @@ -28,7 +44,6 @@ import org.apache.commons.lang3.StringUtils; import org.w3c.dom.Node; -import org.xml.sax.SAXException; import it.eng.parer.entity.AroUnitaDoc; import it.eng.parer.entity.DecAaTipoFascicolo; @@ -50,6 +65,7 @@ import it.eng.parer.entity.OrgStrut; import it.eng.parer.entity.VrsFascicoloKo; import it.eng.parer.entity.VrsSesFascicoloKo; +import it.eng.parer.entity.constraint.FasXmlFascicolo.TiModXsdFasXmlFascicolo; import it.eng.parer.util.ejb.AppServerInstance; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.ejb.XmlFascCache; @@ -83,8 +99,6 @@ @LocalBean public class SalvataggioFascicoliHelper { - // - @EJB MessaggiWSHelper messaggiWSHelper; @@ -105,14 +119,14 @@ public class SalvataggioFascicoliHelper { private static final int DS_OGGETTO_FASC_MAX_LEN = 4000; @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli scriviFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt versamento, - SyncFakeSessn sessione, VrsFascicoloKo fascicoloKo) { + public RispostaControlli scriviFascicolo(VersFascicoloExt versamento, SyncFakeSessn sessione, + VrsFascicoloKo fascicoloKo) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); StrutturaVersFascicolo svf = versamento.getStrutturaComponenti(); // salvo il fascicolo quando il versamento è andato bene tmpRispostaControlli.setrBoolean(false); try { - Calendar tmpCal = GregorianCalendar.getInstance(); + Calendar tmpCal = Calendar.getInstance(); tmpCal.set(2444, 11, 31, 0, 0, 0); // 31 dicembre 2444, data di annullo fittizia FasFascicolo tmpFascicolo = new FasFascicolo(); @@ -135,9 +149,9 @@ public RispostaControlli scriviFascicolo(RispostaWSFascicolo rispostaWs, VersFas .valueOf(versamento.getVersamento().getParametri().getTipoConservazione().name())); // TODO IL sistema di migraziobe va gestito // - tmpFascicolo.setFlForzaContrClassif(svf.getFlControlliFasc().isFlForzaContrFlassif() ? "1" : "0"); - tmpFascicolo.setFlForzaContrColleg(svf.getFlControlliFasc().isFlForzaContrColleg() ? "1" : "0"); - tmpFascicolo.setFlForzaContrNumero(svf.getFlControlliFasc().isFlForzaContrNumero() ? "1" : "0"); + tmpFascicolo.setFlForzaContrClassif(booleanToFlag(svf.getFlControlliFasc().isFlForzaContrFlassif())); + tmpFascicolo.setFlForzaContrColleg(booleanToFlag(svf.getFlControlliFasc().isFlForzaContrColleg())); + tmpFascicolo.setFlForzaContrNumero(booleanToFlag(svf.getFlControlliFasc().isFlForzaContrNumero())); tmpFascicolo.setFlUpdAnnulUnitaDoc("0"); // fixed // if (svf.getDatiXmlProfiloArchivistico() != null) { @@ -150,7 +164,7 @@ public RispostaControlli scriviFascicolo(RispostaWSFascicolo rispostaWs, VersFas } if (svf.getIdVoceTitol() != null) { - tmpFascicolo.setDecVoceTitol(entityManager.find(DecVoceTitol.class, svf.getIdVoceTitol().longValue())); + tmpFascicolo.setDecVoceTitol(entityManager.find(DecVoceTitol.class, svf.getIdVoceTitol())); } if (svf.getDatiXmlProfiloGenerale() != null) { @@ -174,10 +188,6 @@ public RispostaControlli scriviFascicolo(RispostaWSFascicolo rispostaWs, VersFas } else { tmpFascicolo.setNiAaConservazione(new BigDecimal(9999)); } - /* - * if(!dxpg.getAmmPartecipanti().isEmpty()) { - * tmpFascicolo.setFasAmminPartecs(dxpg.getAmmPartecipanti()); } - */ if (StringUtils.isNotBlank(dxpg.getNoteFascicolo())) { tmpFascicolo .setDsNota(LogSessioneUtils.getStringAtMaxLen(dxpg.getNoteFascicolo(), DS_NOTA_MAX_LEN)); @@ -233,15 +243,14 @@ public RispostaControlli scriviFascicolo(RispostaWSFascicolo rispostaWs, VersFas } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli scriviAmmPartecipanti(RispostaWSFascicolo rispostaWs, VersFascicoloExt versamento, - SyncFakeSessn sessione, FasFascicolo fascicolo) { + public RispostaControlli scriviAmmPartecipanti(VersFascicoloExt versamento, FasFascicolo fascicolo) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); StrutturaVersFascicolo svf = versamento.getStrutturaComponenti(); // salvo amm. partecipanti del fascicolo tmpRispostaControlli.setrBoolean(false); try { if (svf.getDatiXmlProfiloGenerale() != null - && svf.getDatiXmlProfiloGenerale().getAmmPartecipanti().size() > 0) { + && !svf.getDatiXmlProfiloGenerale().getAmmPartecipanti().isEmpty()) { DatiXmlProfiloGenerale dxpg = svf.getDatiXmlProfiloGenerale(); for (DXPGAmminPartecipante ammPart : dxpg.getAmmPartecipanti()) { FasAmminPartec fasAmminPartec = new FasAmminPartec(); @@ -267,15 +276,14 @@ public RispostaControlli scriviAmmPartecipanti(RispostaWSFascicolo rispostaWs, V } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli scriviSoggCoinvolti(RispostaWSFascicolo rispostaWs, VersFascicoloExt versamento, - SyncFakeSessn sessione, FasFascicolo fascicolo) { + public RispostaControlli scriviSoggCoinvolti(VersFascicoloExt versamento, FasFascicolo fascicolo) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); StrutturaVersFascicolo svf = versamento.getStrutturaComponenti(); // salvo amm. partecipanti del fascicolo tmpRispostaControlli.setrBoolean(false); try { if (svf.getDatiXmlProfiloGenerale() != null - && svf.getDatiXmlProfiloGenerale().getSoggettiCoinvolti().size() > 0) { + && !svf.getDatiXmlProfiloGenerale().getSoggettiCoinvolti().isEmpty()) { DatiXmlProfiloGenerale dxpg = svf.getDatiXmlProfiloGenerale(); for (DXPGSoggettoCoinvolto sogg : dxpg.getSoggettiCoinvolti()) { FasSogFascicolo fasSogFascicolo = new FasSogFascicolo(); @@ -309,15 +317,14 @@ public RispostaControlli scriviSoggCoinvolti(RispostaWSFascicolo rispostaWs, Ver } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli scriviResponsabili(RispostaWSFascicolo rispostaWs, VersFascicoloExt versamento, - SyncFakeSessn sessione, FasFascicolo fascicolo) { + public RispostaControlli scriviResponsabili(VersFascicoloExt versamento, FasFascicolo fascicolo) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); StrutturaVersFascicolo svf = versamento.getStrutturaComponenti(); // salvo amm. partecipanti del fascicolo tmpRispostaControlli.setrBoolean(false); try { if (svf.getDatiXmlProfiloGenerale() != null - && svf.getDatiXmlProfiloGenerale().getResponsabili().size() > 0) { + && !svf.getDatiXmlProfiloGenerale().getResponsabili().isEmpty()) { DatiXmlProfiloGenerale dxpg = svf.getDatiXmlProfiloGenerale(); for (DXPGRespFascicolo resp : dxpg.getResponsabili()) { FasRespFascicolo fasRespFascicolo = new FasRespFascicolo(); @@ -350,15 +357,14 @@ public RispostaControlli scriviResponsabili(RispostaWSFascicolo rispostaWs, Vers } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli scriviUoOrgResponsabili(RispostaWSFascicolo rispostaWs, VersFascicoloExt versamento, - SyncFakeSessn sessione, FasFascicolo fascicolo) { + public RispostaControlli scriviUoOrgResponsabili(VersFascicoloExt versamento, FasFascicolo fascicolo) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); StrutturaVersFascicolo svf = versamento.getStrutturaComponenti(); // salvo amm. partecipanti del fascicolo tmpRispostaControlli.setrBoolean(false); try { if (svf.getDatiXmlProfiloGenerale() != null - && svf.getDatiXmlProfiloGenerale().getUoOrgResponsabili().size() > 0) { + && !svf.getDatiXmlProfiloGenerale().getUoOrgResponsabili().isEmpty()) { DatiXmlProfiloGenerale dxpg = svf.getDatiXmlProfiloGenerale(); for (String uo : dxpg.getUoOrgResponsabili()) { FasUniOrgRespFascicolo fasUniOrgRespFascicolo = new FasUniOrgRespFascicolo(); @@ -395,10 +401,10 @@ public RispostaControlli scriviRequestResponseFascicolo(RispostaWSFascicolo risp tmpXmlVersFascicolo.setFasFascicolo(fascicolo); tmpXmlVersFascicolo.setTiXmlVers(CostantiDB.TipiXmlDati.RICHIESTA); tmpXmlVersFascicolo.setCdVersioneXml(svf.getVersioneIndiceSipNonVerificata()); + tmpXmlVersFascicolo.setFlCanonicalized(CostantiDB.Flag.TRUE); tmpXmlVersFascicolo.setBlXmlVers( sessione.getDatiDaSalvareIndiceSip().length() == 0 ? "--" : sessione.getDatiDaSalvareIndiceSip()); tmpXmlVersFascicolo.setCdEncodingHashXmlVers(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()); - // tmpXmlVersFascicolo.setDsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_1.descrivi()); tmpXmlVersFascicolo.setDsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_256.descrivi()); tmpXmlVersFascicolo.setDsUrnXmlVers(MessaggiWSFormat.formattaUrnIndiceSipFasc( versamento.getStrutturaComponenti().getUrnPartChiaveFascicolo(), @@ -420,9 +426,9 @@ public RispostaControlli scriviRequestResponseFascicolo(RispostaWSFascicolo risp tmpXmlVersFascicolo.setFasFascicolo(fascicolo); tmpXmlVersFascicolo.setTiXmlVers(CostantiDB.TipiXmlDati.RISPOSTA); tmpXmlVersFascicolo.setCdVersioneXml(esito.getVersioneRapportoVersamento()); + tmpXmlVersFascicolo.setFlCanonicalized(CostantiDB.Flag.TRUE); tmpXmlVersFascicolo.setBlXmlVers(xmlesito); tmpXmlVersFascicolo.setCdEncodingHashXmlVers(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()); - // tmpXmlVersFascicolo.setDsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_1.descrivi()); tmpXmlVersFascicolo.setDsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_256.descrivi()); tmpXmlVersFascicolo.setDsUrnXmlVers(MessaggiWSFormat.formattaUrnRappVersFasc( versamento.getStrutturaComponenti().getUrnPartChiaveFascicolo(), @@ -431,7 +437,6 @@ public RispostaControlli scriviRequestResponseFascicolo(RispostaWSFascicolo risp tmpXmlVersFascicolo.setDsUrnNormalizXmlVers(MessaggiWSFormat.formattaUrnRappVersFasc( versamento.getStrutturaComponenti().getUrnPartChiaveFascicoloNormalized(), Costanti.UrnFormatter.URN_RAPP_VERS_V2)); - // tmpXmlVersFascicolo.setDsHashXmlVers(new HashCalculator().calculateHash(xmlesito).toHexBinary()); tmpXmlVersFascicolo .setDsHashXmlVers(new HashCalculator().calculateHashSHAX(xmlesito, TipiHash.SHA_256).toHexBinary()); tmpXmlVersFascicolo.setIdStrut(new BigDecimal(svf.getIdStruttura())); @@ -452,8 +457,8 @@ public RispostaControlli scriviRequestResponseFascicolo(RispostaWSFascicolo risp } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli scriviProfiliXMLFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt versamento, - SyncFakeSessn sessione, FasFascicolo fascicolo) { + public RispostaControlli scriviProfiliXMLFascicolo(VersFascicoloExt versamento, SyncFakeSessn sessione, + FasFascicolo fascicolo) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); StrutturaVersFascicolo svf = versamento.getStrutturaComponenti(); // salvo gli XML relativi al profilo Archivistico ed al profilo Generale @@ -462,7 +467,7 @@ public RispostaControlli scriviProfiliXMLFascicolo(RispostaWSFascicolo rispostaW try { FasXmlFascicolo fasXmlFascicolo = new FasXmlFascicolo(); fasXmlFascicolo.setFasFascicolo(fascicolo); - fasXmlFascicolo.setTiModelloXsd(ControlliProfiliFascicolo.NOME_METADATI_PROFILO); + fasXmlFascicolo.setTiModelloXsd(TiModXsdFasXmlFascicolo.PROFILO_GENERALE_FASCICOLO); fasXmlFascicolo.setDecModelloXsdFascicolo( entityManager.find(DecModelloXsdFascicolo.class, svf.getIdRecxsdProfiloGenerale())); String xmlProfilo = this.generaXmlProfilo(versamento.getVersamento().getProfiloGenerale().getAny()); @@ -476,7 +481,7 @@ public RispostaControlli scriviProfiliXMLFascicolo(RispostaWSFascicolo rispostaW if (svf.getIdRecXsdProfiloArchivistico() > 0) { fasXmlFascicolo = new FasXmlFascicolo(); fasXmlFascicolo.setFasFascicolo(fascicolo); - fasXmlFascicolo.setTiModelloXsd(ControlliProfiliFascicolo.NOME_SEGNATURA_ARCHIVISTICA); + fasXmlFascicolo.setTiModelloXsd(TiModXsdFasXmlFascicolo.PROFILO_ARCHIVISTICO_FASCICOLO); fasXmlFascicolo.setDecModelloXsdFascicolo( entityManager.find(DecModelloXsdFascicolo.class, svf.getIdRecXsdProfiloArchivistico())); xmlProfilo = this @@ -500,8 +505,7 @@ public RispostaControlli scriviProfiliXMLFascicolo(RispostaWSFascicolo rispostaW } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli scriviUnitaDocFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt versamento, - SyncFakeSessn sessione, FasFascicolo fascicolo) { + public RispostaControlli scriviUnitaDocFascicolo(VersFascicoloExt versamento, FasFascicolo fascicolo) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); StrutturaVersFascicolo svf = versamento.getStrutturaComponenti(); // salvo i riferimenti alle unità documentarie del fascicolo @@ -530,8 +534,7 @@ public RispostaControlli scriviUnitaDocFascicolo(RispostaWSFascicolo rispostaWs, } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli scriviLinkFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt versamento, - SyncFakeSessn sessione, FasFascicolo tmpFasFascicolo) { + public RispostaControlli scriviLinkFascicolo(VersFascicoloExt versamento, FasFascicolo tmpFasFascicolo) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); StrutturaVersFascicolo svf = versamento.getStrutturaComponenti(); // salvo i riferimenti alle unità documentarie del fascicolo @@ -545,8 +548,8 @@ public RispostaControlli scriviLinkFascicolo(RispostaWSFascicolo rispostaWs, Ver fasLinkFascicolo.setDsLink(link.getDescCollegamento()); fasLinkFascicolo.setFasFascicolo(tmpFasFascicolo); if (link.getIdLinkFasc() != null) { - fasLinkFascicolo.setFasFascicoloLink( - entityManager.find(FasFascicolo.class, link.getIdLinkFasc().longValue())); + fasLinkFascicolo + .setFasFascicoloLink(entityManager.find(FasFascicolo.class, link.getIdLinkFasc())); } entityManager.persist(fasLinkFascicolo); @@ -566,8 +569,7 @@ public RispostaControlli scriviLinkFascicolo(RispostaWSFascicolo rispostaWs, Ver } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli scriviWarningFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt versamento, - SyncFakeSessn sessione, FasFascicolo fascicolo) { + public RispostaControlli scriviWarningFascicolo(VersFascicoloExt versamento, FasFascicolo fascicolo) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); // salvo i warning della sessione di versamento // Nota: al momento della stesura di questo codice il web service @@ -601,8 +603,7 @@ public RispostaControlli scriviWarningFascicolo(RispostaWSFascicolo rispostaWs, } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli salvaWarningAATipoFascicolo(RispostaWSFascicolo rispostaWs, VersFascicoloExt versamento, - SyncFakeSessn sessione, FasFascicolo tmpFasFascicolo) { + public RispostaControlli salvaWarningAATipoFascicolo(VersFascicoloExt versamento) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); try { @@ -673,7 +674,7 @@ public RispostaControlli ereditaVersamentiKoFascicolo(RispostaWSFascicolo rispos return tmpRispostaControlli; } - private String generaXmlProfilo(Node profilo) throws JAXBException, SAXException, TransformerException { + private String generaXmlProfilo(Node profilo) throws TransformerException { TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/VersFascicoloExtPrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/VersFascicoloExtPrsr.java similarity index 86% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/VersFascicoloExtPrsr.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/VersFascicoloExtPrsr.java index dbf4b4d..00f1729 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/VersFascicoloExtPrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/VersFascicoloExtPrsr.java @@ -1,9 +1,26 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package it.eng.parer.ws.versFascicoli.utils; +package it.eng.parer.ws.versFascicoli.ejb; import java.io.StringReader; import java.math.BigDecimal; @@ -11,8 +28,9 @@ import java.util.Iterator; import java.util.List; -import javax.naming.InitialContext; -import javax.naming.NamingException; +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; @@ -31,9 +49,9 @@ import it.eng.parer.ws.ejb.ControlliWS; import it.eng.parer.ws.ejb.XmlFascCache; import it.eng.parer.ws.utils.Costanti; -import it.eng.parer.ws.utils.LogSessioneUtils; import it.eng.parer.ws.utils.Costanti.ModificatoriWS; import it.eng.parer.ws.utils.Costanti.TipiWSPerControlli; +import it.eng.parer.ws.utils.LogSessioneUtils; import it.eng.parer.ws.utils.MessaggiWSBundle; import it.eng.parer.ws.utils.MessaggiWSFormat; import it.eng.parer.ws.utils.ParametroApplDB; @@ -47,9 +65,9 @@ import it.eng.parer.ws.versFascicoli.dto.RispostaWSFascicolo; import it.eng.parer.ws.versFascicoli.dto.StrutturaVersFascicolo; import it.eng.parer.ws.versFascicoli.dto.VersFascicoloExt; -import it.eng.parer.ws.versFascicoli.ejb.ControlliCollFascicolo; -import it.eng.parer.ws.versFascicoli.ejb.ControlliFascicoli; -import it.eng.parer.ws.versFascicoli.ejb.ControlliProfiliFascicolo; +import it.eng.parer.ws.versFascicoli.utils.CostantiFasc; +import it.eng.parer.ws.versFascicoli.utils.KeyOrdFascUtility; +import it.eng.parer.ws.versFascicoli.utils.KeySizeFascUtility; import it.eng.parer.ws.versamento.dto.SyncFakeSessn; import it.eng.parer.ws.versamento.dto.VoceDiErrore; import it.eng.parer.ws.versamento.ejb.RapportoVersBuilder; @@ -70,171 +88,61 @@ * * @author fioravanti_f */ +@Stateless(mappedName = "VersFascicoloExtPrsr") +@LocalBean public class VersFascicoloExtPrsr { private static final Logger log = LoggerFactory.getLogger(VersFascicoloExtPrsr.class); - private VersFascicoloExt versamento; - private RispostaWSFascicolo rispostaWs; - private RispostaControlli rispostaControlli; - // l'istanza dell'indice SIP del fascicolo, decodificata dall'XML di versamento - IndiceSIPFascicolo parsedIndiceFasc = null; - // - private CSVersatore tagCSVersatore = new CSVersatore(); - private CSChiaveFasc tagCSChiave = new CSChiaveFasc(); - private String descChiaveFasc = ""; - private String sistema = ""; // // stateless ejb per i controlli sul db - ControlliSemantici controlliSemantici = null; + @EJB + private ControlliSemantici controlliSemantici; // stateless ejb per i controlli specifici del fascicolo - ControlliFascicoli controlliFascicoli = null; + @EJB + private ControlliFascicoli controlliFascicoli; // stateless ejb per i controlli su profilo archivistico e profilo generale fascicolo - ControlliProfiliFascicolo controlliProfiliFascicolo = null; + @EJB + private ControlliProfiliFascicolo controlliProfiliFascicolo; // stateless ejb dei controlli collegamenti dei fascicoli - ControlliCollFascicolo controlliCollFascicolo = null; + @EJB + private ControlliCollFascicolo controlliCollFascicolo; // stateless ejb per verifica autorizzazione ws - ControlliWS controlliEjb = null; + @EJB + private ControlliWS controlliEjb; // singleton ejb di gestione cache dei parser jaxb dei fascicoli - XmlFascCache xmlFascCache = null; + @EJB + private XmlFascCache xmlFascCache; // stateless ejb: crea il rapporto di versamento e canonicalizza (C14N) il SIP - RapportoVersBuilder rapportoVersBuilder = null; + @EJB + private RapportoVersBuilder rapportoVersBuilder; // singleton ejb di gestione configurazioni applicative - ConfigurationHelper configurationHelper = null; - - public VersFascicoloExt getVersamento() { - return versamento; - } - - public RispostaWSFascicolo getRispostaWs() { - return rispostaWs; - } - - public VersFascicoloExtPrsr(VersFascicoloExt versamento, RispostaWSFascicolo rispostaWs) { - this.versamento = versamento; - this.rispostaWs = rispostaWs; - this.rispostaControlli = new RispostaControlli(); - } + @EJB + private ConfigurationHelper configurationHelper; - public void parseXML(SyncFakeSessn sessione) { + public void parseXML(SyncFakeSessn sessione, RispostaWSFascicolo rispostaWs, VersFascicoloExt versamento) { // istanzia la classe di verifica retrocompatibilità VerificaVersione tmpVerificaVersione = new VerificaVersione(); VerificaVersione.EsitiVerfica tmpEsitiVerfica; + CSVersatore tagCSVersatore = new CSVersatore(); + CSChiaveFasc tagCSChiave = new CSChiaveFasc(); + String descChiaveFasc = ""; + String sistema = ""; + CompRapportoVersFascicolo myEsito = rispostaWs.getCompRapportoVersFascicolo(); // AvanzamentoWs myAvanzamentoWs = rispostaWs.getAvanzamento(); StringReader tmpReader; - parsedIndiceFasc = null; + IndiceSIPFascicolo parsedIndiceFasc = null; // a priori, un problema in questo punto provoca il fallimento completo del versamento rispostaWs.setStatoSessioneVersamento(IRispostaWS.StatiSessioneVersEnum.ERRATA); - // recupera l'ejb singleton, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - xmlFascCache = (XmlFascCache) new InitialContext().lookup("java:module/XmlFascCache"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB singleton XMLContext " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB singleton XMLContext ", ex); - } - } - - // recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliSemantici = (ControlliSemantici) new InitialContext().lookup("java:module/ControlliSemantici"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB dei controlli semantici " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli semantici ", ex); - } - } - - // recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliFascicoli = (ControlliFascicoli) new InitialContext().lookup("java:module/ControlliFascicoli"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB dei controlli specifici dei fascicoli " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli specifici dei fascicoli ", ex); - } - } - - // recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliProfiliFascicolo = (ControlliProfiliFascicolo) new InitialContext() - .lookup("java:module/ControlliProfiliFascicolo"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB dei controlli Profili Fascicolo dei fascicoli " - + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli Profili Fascicolo dei fascicoli ", ex); - } - } - - // recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliCollFascicolo = (ControlliCollFascicolo) new InitialContext() - .lookup("java:module/ControlliCollFascicolo"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB dei controlli collegamenti dei fascicoli " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli collegamenti dei fascicoli ", ex); - } - } - - // recupera l'ejb dell'autenticazione, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliEjb = (ControlliWS) new InitialContext().lookup("java:module/ControlliWS"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB di verifica delle autorizzazioni " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB di verifica delle autorizzazioni ", ex); - } - } - - // recupera l'ejb C14N, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - rapportoVersBuilder = (RapportoVersBuilder) new InitialContext() - .lookup("java:module/RapportoVersBuilder"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB RapportoVersBuilder " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB RapportoVersBuilder ", ex); - } - } - - // recupera l'ejb per il recupero delle configurazioni applicative - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - configurationHelper = (ConfigurationHelper) new InitialContext() - .lookup("java:module/ConfigurationHelper"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB ConfigurationHelper " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB ConfigurationHelper ", ex); - } - } - /* * produco la versione canonicalizzata del SIP. Gestisco l'eventuale errore relativo all'encoding indicato in * maniera errata (es. "ISO8859/1" oppure "utf8"), non rilevato dalla verifica precedente. */ if (rispostaWs.getSeverity() == SeverityEnum.OK) { - rispostaControlli = rapportoVersBuilder.canonicalizzaDaSalvareIndiceSip(sessione); - if (rispostaControlli.isrBoolean() == false) { + RispostaControlli rispostaControlli = rapportoVersBuilder.canonicalizzaDaSalvareIndiceSip(sessione); + if (!rispostaControlli.isrBoolean()) { rispostaWs.setSeverity(SeverityEnum.ERROR); rispostaWs.setErrorCode(rispostaControlli.getCodErr()); @@ -282,7 +190,7 @@ public void parseXML(SyncFakeSessn sessione) { versamento.getStrutturaComponenti().setChiaveNonVerificata(tagCSChiave); // // sistema = configurationHelper.getParamApplicValue(ParametroApplDB.NM_SISTEMACONSERVAZIONE); - sistema = configurationHelper.getParamApplicValue(ParametroApplDB.NM_SISTEMACONSERVAZIONE); + sistema = configurationHelper.getValoreParamApplicByApplic(ParametroApplDB.NM_SISTEMACONSERVAZIONE); versamento.getStrutturaComponenti().setUrnPartChiaveFascicolo( MessaggiWSFormat.formattaChiaveFascicolo(tagCSVersatore, tagCSChiave, sistema)); // normalized key @@ -370,7 +278,7 @@ public void parseXML(SyncFakeSessn sessione) { // MEV#25288 if (rispostaWs.getSeverity() == SeverityEnum.OK) { // prepara risposta con urn sip - this.buildUrnSipOnEsito(myEsito); + this.buildUrnSipOnEsito(myEsito, versamento); } // end MEV#25288 @@ -404,13 +312,14 @@ public void parseXML(SyncFakeSessn sessione) { // come prima cosa verifico che il versatore e la versione dichiarati nel WS coincidano // con quelli nell'xml if (rispostaWs.getSeverity() == SeverityEnum.OK) { - this.controllaVersatore(myControlliFascicolo); + this.controllaVersatore(myControlliFascicolo, versamento, rispostaWs, parsedIndiceFasc); } // se ho passato la verifica strutturale... // verifica la struttura versante if (rispostaWs.getSeverity() == SeverityEnum.OK) { - this.controllaStruttura(myControlliFascicolo); + this.controllaStruttura(myControlliFascicolo, versamento, rispostaWs, tagCSVersatore, tagCSChiave, + descChiaveFasc); } // se il versatore alla fine è ok e la struttura è utilizzabile, lo scrivo @@ -422,19 +331,19 @@ public void parseXML(SyncFakeSessn sessione) { // verifico il tipo fascicolo - in caso di errore la sessione è DUBBIA // if (rispostaWs.getSeverity() == SeverityEnum.OK) { - this.controllaTipoFasc(myControlliFascicolo); + this.controllaTipoFasc(myControlliFascicolo, versamento, rispostaWs, descChiaveFasc); } // verifico il tipo fascicolo - abilitato su utente // if (rispostaWs.getSeverity() == SeverityEnum.OK) { - this.controllaTipoFascUserOrg(myControlliFascicolo); + this.controllaTipoFascUserOrg(myControlliFascicolo, versamento, rispostaWs, descChiaveFasc); } // verifico il tipo fascicolo - abilitato su anno // if (rispostaWs.getSeverity() == SeverityEnum.OK) { - this.controllaTipoFascAnno(myControlliFascicolo); + this.controllaTipoFascAnno(myControlliFascicolo, versamento, rispostaWs, descChiaveFasc); } // nota: comunque vada, da qui in poi la sessione non può essere più DUBBIA @@ -450,12 +359,12 @@ public void parseXML(SyncFakeSessn sessione) { // verifico la chiave if (rispostaWs.getSeverity() == SeverityEnum.OK) { - this.controllaChiave(myControlliFascicolo, myEsito); + this.controllaChiave(myControlliFascicolo, myEsito, versamento, rispostaWs, tagCSChiave, descChiaveFasc); } // verifico tipo conservazione if (rispostaWs.getSeverity() == SeverityEnum.OK) { - this.controllaTipoConservazione(myControlliFascicolo, myEsito); + this.controllaTipoConservazione(myControlliFascicolo, parsedIndiceFasc, rispostaWs, descChiaveFasc); } // questi controlli li faccio sempre tutti, dal momento che ognuno di essi @@ -464,34 +373,42 @@ public void parseXML(SyncFakeSessn sessione) { // blocco controlli profilo archivistico - boolean prosegui = this.controllaProfiloArchivistico(myEsito); + boolean prosegui = this.controllaProfiloArchivistico(myEsito, versamento, descChiaveFasc); if (prosegui) { - prosegui = this.controllaProfiloSpecifico(myEsito);// TODO: al momento non supportato verificare se va - // bene in questo punto + prosegui = this.controllaProfiloSpecifico(myEsito, versamento, parsedIndiceFasc, descChiaveFasc);// TODO: + // al + // momento + // non + // supportato + // verificare + // se + // va + // bene in questo punto } // viene sempre eseguito // blocco controlli profilo generale - prosegui = this.controllaProfiloGenerale(myEsito, myControlliFascicolo); + prosegui = this.controllaProfiloGenerale(myEsito, myControlliFascicolo, versamento); if (prosegui) { - prosegui = this.controllaSoggettoProd(myEsito); + prosegui = this.controllaSoggettoProd(myEsito, versamento, parsedIndiceFasc, descChiaveFasc); } // viene sempre eseguito (dati già controllati in precedenza) if (prosegui) { - prosegui = this.controllaFlagStruttura(myEsito); + prosegui = this.controllaFlagStruttura(myEsito, rispostaWs, versamento, descChiaveFasc); } if (prosegui) { - prosegui = this.controllaClassificazione(myEsito); + prosegui = this.controllaClassificazione(myEsito, versamento, parsedIndiceFasc, descChiaveFasc); } if (prosegui) { - prosegui = this.controllaFormatoNumero(myEsito); + prosegui = this.controllaFormatoNumero(myEsito, versamento, parsedIndiceFasc, descChiaveFasc, + tagCSChiave, sistema); } if (prosegui) { - prosegui = this.controllaCollegamenti(myEsito); + this.controllaCollegamenti(myEsito, versamento, parsedIndiceFasc); } // calcolo l'esito del ws in funzione di warning ed errori (sia degli errori @@ -521,7 +438,7 @@ public void parseXML(SyncFakeSessn sessione) { } private void controllaTipoConservazione(EsitoControlliFascicolo myControlliFascicolo, - CompRapportoVersFascicolo myEsito) { + IndiceSIPFascicolo parsedIndiceFasc, RispostaWSFascicolo rispostaWs, String descChiaveFasc) { // tipo conservazione VERSAMENTO_ANTICIPATO al momento non supportata // if (parsedIndiceFasc.getParametri().getTipoConservazione() @@ -536,7 +453,8 @@ private void controllaTipoConservazione(EsitoControlliFascicolo myControlliFasci } } - private boolean controllaFlagStruttura(CompRapportoVersFascicolo myEsito) { + private boolean controllaFlagStruttura(CompRapportoVersFascicolo myEsito, RispostaWSFascicolo rispostaWs, + VersFascicoloExt versamento, String descChiaveFasc) { ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo = myEsito.getFascicolo() .getEsitoControlliFascicolo(); StrutturaVersFascicolo svf = versamento.getStrutturaComponenti(); @@ -544,7 +462,8 @@ private boolean controllaFlagStruttura(CompRapportoVersFascicolo myEsito) { boolean prosegui = true; // verifico se abilitato controllo di classificazione alla struttura - rispostaControlli = controlliFascicoli.checkFlDecAaTipoFascicoloOrgStrutt(svf.getIdAATipoFasc()); + RispostaControlli rispostaControlli = controlliFascicoli + .checkFlDecAaTipoFascicoloOrgStrutt(svf.getIdAATipoFasc()); if (rispostaControlli.isrBoolean()) { FlControlliFasc flControlliFasc = (FlControlliFasc) rispostaControlli.getrObject(); @@ -578,7 +497,8 @@ private boolean controllaFlagStruttura(CompRapportoVersFascicolo myEsito) { return prosegui;// i controlli successivi, senza il flag, non possono continuare! (non dovrebbe mai accadere!) } - private boolean controllaClassificazione(CompRapportoVersFascicolo myEsito) { + private boolean controllaClassificazione(CompRapportoVersFascicolo myEsito, VersFascicoloExt versamento, + IndiceSIPFascicolo parsedIndiceFasc, String descChiaveFasc) { ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo = myEsito.getFascicolo() .getEsitoControlliFascicolo(); @@ -612,7 +532,7 @@ private boolean controllaClassificazione(CompRapportoVersFascicolo myEsito) { myControlliFascicolo.setControlloClassificazione(ECEsitoPosNegWarType.NON_ATTIVATO); } else { // verifica sul titolario - rispostaControlli = controlliFascicoli.verificaSIPTitolario(svf); + RispostaControlli rispostaControlli = controlliFascicoli.verificaSIPTitolario(svf); if (!rispostaControlli.isrBoolean()) { boolean isWarn = false; @@ -670,7 +590,8 @@ private boolean controllaClassificazione(CompRapportoVersFascicolo myEsito) { return prosegui; } - private boolean controllaFormatoNumero(CompRapportoVersFascicolo myEsito) { + private boolean controllaFormatoNumero(CompRapportoVersFascicolo myEsito, VersFascicoloExt versamento, + IndiceSIPFascicolo parsedIndiceFasc, String descChiaveFasc, CSChiaveFasc tagCSChiave, String sistema) { ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo = myEsito.getFascicolo() .getEsitoControlliFascicolo(); @@ -690,7 +611,8 @@ private boolean controllaFormatoNumero(CompRapportoVersFascicolo myEsito) { } // verifica formato numero e generazione chiave ordinata - rispostaControlli = controlliFascicoli.getPartiAANumero(descChiaveFasc, svf.getIdAATipoFasc()); + RispostaControlli rispostaControlli = controlliFascicoli.getPartiAANumero(descChiaveFasc, + svf.getIdAATipoFasc()); // ritorna eventuali errori e prosegue con successivi controlli if (!rispostaControlli.isrBoolean()) { @@ -793,7 +715,8 @@ private boolean controllaFormatoNumero(CompRapportoVersFascicolo myEsito) { return prosegui; } - private boolean controllaCollegamenti(CompRapportoVersFascicolo myEsito) { + private boolean controllaCollegamenti(CompRapportoVersFascicolo myEsito, VersFascicoloExt versamento, + IndiceSIPFascicolo parsedIndiceFasc) { ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo = myEsito.getFascicolo() .getEsitoControlliFascicolo(); // recupero flag per risposta @@ -819,7 +742,8 @@ private boolean controllaCollegamenti(CompRapportoVersFascicolo myEsito) { flForzaContrColl = flContrFasc.isFlForzaContrColleg();// altrimenti, usa quello di struttura } - rispostaControlli = controlliCollFascicolo.buildCollegamentiFascicolo(versamento, myControlliFascicolo); + RispostaControlli rispostaControlli = controlliCollFascicolo.buildCollegamentiFascicolo(versamento, + myControlliFascicolo); // terminata elaborazone finale della lista dei collegamenti.... // TODO: non dovrebbe mai verificarsi (vedi check sopra), trattasi di un "overcheck" if (!rispostaControlli.isrBoolean()) { @@ -947,7 +871,8 @@ private boolean controllaCollegamenti(CompRapportoVersFascicolo myEsito) { return prosegui; } - private void controllaVersatore(ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo) { + private void controllaVersatore(ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo, + VersFascicoloExt versamento, RispostaWSFascicolo rispostaWs, IndiceSIPFascicolo parsedIndiceFasc) { // come prima cosa verifico che il versatore e la versione dichiarati nel WS coincidano // con quelli nell'xml if (!parsedIndiceFasc.getIntestazione().getVersatore().getUserID().equals(versamento.getLoginName())) { @@ -978,10 +903,12 @@ private void controllaVersatore(ECFascicoloType.EsitoControlliFascicolo myContro } } - private void controllaStruttura(ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo) { + private void controllaStruttura(ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo, + VersFascicoloExt versamento, RispostaWSFascicolo rispostaWs, CSVersatore tagCSVersatore, + CSChiaveFasc tagCSChiave, String descChiaveFasc) { // verifica la struttura versante - rispostaControlli = controlliSemantici.checkIdStrut(tagCSVersatore, TipiWSPerControlli.VERSAMENTO_FASCICOLO, - versamento.getStrutturaComponenti().getDataVersamento()); + RispostaControlli rispostaControlli = controlliSemantici.checkIdStrut(tagCSVersatore, + TipiWSPerControlli.VERSAMENTO_FASCICOLO, versamento.getStrutturaComponenti().getDataVersamento()); if (rispostaControlli.getrLong() < 1) { myControlliFascicolo.setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myControlliFascicolo.setIdentificazioneVersatore(ECEsitoPosNegType.NEGATIVO); @@ -1043,10 +970,11 @@ private void controllaStruttura(ECFascicoloType.EsitoControlliFascicolo myContro } } - private void controllaTipoFasc(ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo) { + private void controllaTipoFasc(ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo, + VersFascicoloExt versamento, RispostaWSFascicolo rispostaWs, String descChiaveFasc) { // verifico il tipo fascicolo - in caso di errore la sessione è DUBBIA // - rispostaControlli = controlliFascicoli.checkTipoFascicolo( + RispostaControlli rispostaControlli = controlliFascicoli.checkTipoFascicolo( versamento.getStrutturaComponenti().getTipoFascicoloNonverificato(), descChiaveFasc, versamento.getStrutturaComponenti().getIdStruttura()); if (!rispostaControlli.isrBoolean()) { @@ -1066,11 +994,12 @@ private void controllaTipoFasc(ECFascicoloType.EsitoControlliFascicolo myControl } } - private void controllaTipoFascUserOrg(EsitoControlliFascicolo myControlliFascicolo) { + private void controllaTipoFascUserOrg(EsitoControlliFascicolo myControlliFascicolo, VersFascicoloExt versamento, + RispostaWSFascicolo rispostaWs, String descChiaveFasc) { // verifico il tipo fascicolo abilitato per utente/org - in caso di errore la sessione è DUBBIA // StrutturaVersFascicolo svf = versamento.getStrutturaComponenti(); - rispostaControlli = controlliFascicoli.checkTipoFascicoloIamUserOrganizzazione(descChiaveFasc, + RispostaControlli rispostaControlli = controlliFascicoli.checkTipoFascicoloIamUserOrganizzazione(descChiaveFasc, svf.getTipoFascicoloNonverificato(), svf.getIdStruttura(), svf.getIdUser(), svf.getIdTipoFascicolo()); if (!rispostaControlli.isrBoolean()) { myControlliFascicolo.setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); @@ -1088,11 +1017,12 @@ private void controllaTipoFascUserOrg(EsitoControlliFascicolo myControlliFascico } } - private void controllaTipoFascAnno(EsitoControlliFascicolo myControlliFascicolo) { + private void controllaTipoFascAnno(EsitoControlliFascicolo myControlliFascicolo, VersFascicoloExt versamento, + RispostaWSFascicolo rispostaWs, String descChiaveFasc) { // verifico il tipo fascicolo abilito su anno - in caso di errore la sessione è DUBBIA // StrutturaVersFascicolo svf = versamento.getStrutturaComponenti(); - rispostaControlli = controlliFascicoli.checkTipoFascicoloAnno(descChiaveFasc, + RispostaControlli rispostaControlli = controlliFascicoli.checkTipoFascicoloAnno(descChiaveFasc, svf.getTipoFascicoloNonverificato(), svf.getChiaveNonVerificata().getAnno(), svf.getIdTipoFascicolo()); if (!rispostaControlli.isrBoolean()) { myControlliFascicolo.setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); @@ -1113,8 +1043,9 @@ private void controllaTipoFascAnno(EsitoControlliFascicolo myControlliFascicolo) } private void controllaChiave(ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo, - CompRapportoVersFascicolo myEsito) { - rispostaControlli = controlliFascicoli.checkChiave(tagCSChiave, descChiaveFasc, + CompRapportoVersFascicolo myEsito, VersFascicoloExt versamento, RispostaWSFascicolo rispostaWs, + CSChiaveFasc tagCSChiave, String descChiaveFasc) { + RispostaControlli rispostaControlli = controlliFascicoli.checkChiave(tagCSChiave, descChiaveFasc, versamento.getStrutturaComponenti().getIdStruttura(), ControlliFascicoli.TipiGestioneFascAnnullati.CONSIDERA_ASSENTE); if (!rispostaControlli.isrBoolean()) { @@ -1137,13 +1068,14 @@ private void controllaChiave(ECFascicoloType.EsitoControlliFascicolo myControlli } } - private boolean controllaProfiloArchivistico(CompRapportoVersFascicolo myEsito) { + private boolean controllaProfiloArchivistico(CompRapportoVersFascicolo myEsito, VersFascicoloExt versamento, + String descChiaveFasc) { boolean prosegui = true; ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo = myEsito.getFascicolo() .getEsitoControlliFascicolo(); // Controllo profilo Archivistico - rispostaControlli = controlliProfiliFascicolo.verificaProfiloArchivistico(versamento); + RispostaControlli rispostaControlli = controlliProfiliFascicolo.verificaProfiloArchivistico(versamento); if (!rispostaControlli.isrBoolean()) { myControlliFascicolo.setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myControlliFascicolo.setControlloProfiloArchivistico(ECEsitoPosNegType.NEGATIVO); @@ -1159,10 +1091,11 @@ private boolean controllaProfiloArchivistico(CompRapportoVersFascicolo myEsito) } private boolean controllaProfiloGenerale(CompRapportoVersFascicolo myEsito, - ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo) { + ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo, VersFascicoloExt versamento) { // Controllo Consistenza; è bloccante per quanto riguarda il controllo successivo boolean prosegui = true; - rispostaControlli = controlliCollFascicolo.verificaUdFascicolo(versamento, myEsito.getFascicolo()); + RispostaControlli rispostaControlli = controlliCollFascicolo.verificaUdFascicolo(versamento, + myEsito.getFascicolo()); if (!rispostaControlli.isrBoolean()) { myControlliFascicolo.setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myControlliFascicolo.setControlloConsistenza(ECEsitoPosNegType.NEGATIVO); @@ -1187,7 +1120,8 @@ private boolean controllaProfiloGenerale(CompRapportoVersFascicolo myEsito, return prosegui; } - private boolean controllaProfiloSpecifico(CompRapportoVersFascicolo myEsito) { + private boolean controllaProfiloSpecifico(CompRapportoVersFascicolo myEsito, VersFascicoloExt versamento, + IndiceSIPFascicolo parsedIndiceFasc, String descChiaveFasc) { ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo = myEsito.getFascicolo() .getEsitoControlliFascicolo(); boolean prosegui = true; @@ -1205,7 +1139,8 @@ private boolean controllaProfiloSpecifico(CompRapportoVersFascicolo myEsito) { return prosegui; } - private boolean controllaSoggettoProd(CompRapportoVersFascicolo myEsito) { + private boolean controllaSoggettoProd(CompRapportoVersFascicolo myEsito, VersFascicoloExt versamento, + IndiceSIPFascicolo parsedIndiceFasc, String descChiaveFasc) { ECFascicoloType.EsitoControlliFascicolo myControlliFascicolo = myEsito.getFascicolo() .getEsitoControlliFascicolo(); boolean prosegui = true; @@ -1269,7 +1204,7 @@ private boolean controllaSoggettoProd(CompRapportoVersFascicolo myEsito) { /** * @param myEsito */ - private void buildUrnSipOnEsito(CompRapportoVersFascicolo myEsito) { + private void buildUrnSipOnEsito(CompRapportoVersFascicolo myEsito, VersFascicoloExt versamento) { if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_URN_SIP_FASC_1_1)) { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/VersFascicoloSync.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/VersFascicoloSync.java index 7ed56d3..de6522d 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/VersFascicoloSync.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/ejb/VersFascicoloSync.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -32,7 +49,6 @@ import it.eng.parer.ws.versFascicoli.dto.CompRapportoVersFascicolo; import it.eng.parer.ws.versFascicoli.dto.RispostaWSFascicolo; import it.eng.parer.ws.versFascicoli.dto.VersFascicoloExt; -import it.eng.parer.ws.versFascicoli.utils.VersFascicoloExtPrsr; import it.eng.parer.ws.versamento.dto.SyncFakeSessn; import it.eng.parer.ws.xml.versfascicoloresp.CodiceEsitoType; import it.eng.parer.ws.xml.versfascicoloresp.ECEsitoChiamataWSType; @@ -44,23 +60,26 @@ * * @author fioravanti_f */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "VersamentoSync") @LocalBean @TransactionManagement(TransactionManagementType.CONTAINER) public class VersFascicoloSync { // - protected static final Logger logger = LoggerFactory.getLogger(VersFascicoloSync.class); + private static final Logger logger = LoggerFactory.getLogger(VersFascicoloSync.class); + @EJB + private ControlliWS myControlliWs; @EJB - protected ControlliWS myControlliWs; + private SalvataggioFascicoli mySalvataggioFascicoli; @EJB - protected SalvataggioFascicoli mySalvataggioFascicoli; + private LogSessioneFascicoli myLogSessioneFascicoli; @EJB - protected LogSessioneFascicoli myLogSessioneFascicoli; + private RecupSessDubbieFasc myRecupSessDubbieFasc; @EJB - protected RecupSessDubbieFasc myRecupSessDubbieFasc; + private ControlliSemantici myControlliSemantici; @EJB - protected ControlliSemantici myControlliSemantici; + private VersFascicoloExtPrsr tmpPrsr; public void init(RispostaWSFascicolo rispostaWs, AvanzamentoWs avanzamento, VersFascicoloExt versamento) { logger.debug("sono nel metodo init"); @@ -171,8 +190,7 @@ public void parseXML(SyncFakeSessn sessione, RispostaWSFascicolo rispostaWs, Ver } try { - VersFascicoloExtPrsr tmpPrsr = new VersFascicoloExtPrsr(versamento, rispostaWs); - tmpPrsr.parseXML(sessione); + tmpPrsr.parseXML(sessione, rispostaWs, versamento); } catch (Exception e) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); if (ExceptionUtils.getRootCause(e) instanceof ParamApplicNotFoundException) { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/CostantiFasc.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/CostantiFasc.java index eab67cd..d3fdb2e 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/CostantiFasc.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/CostantiFasc.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/KeyOrdFascUtility.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/KeyOrdFascUtility.java index da111ae..aee6196 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/KeyOrdFascUtility.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/KeyOrdFascUtility.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/KeySizeFascUtility.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/KeySizeFascUtility.java index 283b0b4..2a6a32a 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/KeySizeFascUtility.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versFascicoli/utils/KeySizeFascUtility.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/AbsVersamentoExt.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/AbsVersamentoExt.java index d26673b..0c1e344 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/AbsVersamentoExt.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/AbsVersamentoExt.java @@ -1,5 +1,26 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.dto; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + import it.eng.parer.ws.dto.IErroriMultipli; import it.eng.parer.ws.dto.IRispostaWS; import it.eng.parer.ws.utils.Costanti; @@ -10,9 +31,6 @@ import it.eng.parer.ws.xml.versResp.ECWarningSecondariType; import it.eng.parer.ws.xml.versResp.ECWarningType; import it.eng.spagoLite.security.User; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; /** * @@ -20,6 +38,7 @@ */ public abstract class AbsVersamentoExt implements IVersamentoExt, IErroriMultipli { + private static final long serialVersionUID = 1L; private User utente; private String versioneWsChiamata; private String loginName; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/BackendStorage.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/BackendStorage.java new file mode 100644 index 0000000..648f0a7 --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/BackendStorage.java @@ -0,0 +1,50 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.dto; + +import java.io.Serializable; + +/** + * Backend su cui viene salvata la risorsa. + * + * + * @author Snidero_L + */ +public interface BackendStorage extends Serializable { + + enum STORAGE_TYPE { + OS, BLOB, FILE + } + + STORAGE_TYPE getType(); + + String getBackendName(); + + default boolean isObjectStorage() { + return STORAGE_TYPE.OS.equals(getType()); + } + + default boolean isDataBase() { + return STORAGE_TYPE.BLOB.equals(getType()); + } + + default boolean isFile() { + return STORAGE_TYPE.FILE.equals(getType()); + } + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ComponenteVers.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ComponenteVers.java index 6e5db15..1916559 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ComponenteVers.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ComponenteVers.java @@ -1,14 +1,30 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.dto; import java.util.Date; -import java.util.HashMap; +import java.util.Map; import org.apache.poi.ss.formula.eval.NotImplementedException; import it.eng.parer.firma.dto.CompDocMock; import it.eng.parer.firma.xml.VerificaFirmaWrapper; import it.eng.parer.ws.utils.CostantiDB; -import it.eng.parer.ws.utils.CostantiDB.TipiEntitaSacer; import it.eng.parer.ws.utils.CostantiDB.TipoAlgoritmoRappr; import it.eng.parer.ws.versamentoMM.dto.ComponenteMM; @@ -78,30 +94,30 @@ public class ComponenteVers implements java.io.Serializable, IDatiSpecEntity, IP // riferimento alle classi di xml di risposta utilizzate per salvare le // informazioni di dimensione file // NOTA BENE: solo uno tra componente e sottocomponente è valorizzato - private it.eng.parer.ws.xml.versResp.ECComponenteType rifComponenteResp; - private it.eng.parer.ws.xml.versResp.ECSottoComponenteType rifSottoComponenteResp; + private transient it.eng.parer.ws.xml.versResp.ECComponenteType rifComponenteResp; + private transient it.eng.parer.ws.xml.versResp.ECSottoComponenteType rifSottoComponenteResp; // riferimento all'entity del componente // private AroCompDoc acdEntity; - private CompDocMock acdEntity; + private transient CompDocMock acdEntity; // MEV#18660 - private VerificaFirmaWrapper vfWrapper; + private transient VerificaFirmaWrapper vfWrapper; // dati specifici del componente o del sottocomnponente - private HashMap datiSpecifici; - private HashMap datiSpecificiMigrazione; + private Map datiSpecifici; + private Map datiSpecificiMigrazione; // riferimento al ComponenteMM: questo è non null solo se il versamento è di // tipo VersamentoMM - private ComponenteMM rifComponenteMM = null; + private transient ComponenteMM rifComponenteMM = null; // i componenti sono: // 1.SottoComponente = NULL // 2.rifComponenteVersPadre = NULL // i sottocomponenti sono: // 1.SottoComponente è valorizzato // 2.rifComponenteVersPadre è valorizzato - private it.eng.parer.ws.xml.versReq.ComponenteType myComponente; - private it.eng.parer.ws.xml.versReq.SottoComponenteType mySottoComponente; + private transient it.eng.parer.ws.xml.versReq.ComponenteType myComponente; + private transient it.eng.parer.ws.xml.versReq.SottoComponenteType mySottoComponente; // private DocumentoVers rifDocumentoVers; private ComponenteVers rifComponenteVersPadre; @@ -115,6 +131,7 @@ public class ComponenteVers implements java.io.Serializable, IDatiSpecEntity, IP private String urnPartComponenteNiOrdDoc = ""; public ComponenteVers() { + // } public String getId() { @@ -396,22 +413,22 @@ public void setIdUnitaDocRif(long idUnitaDocRif) { this.idUnitaDocRif = idUnitaDocRif; } - public HashMap getDatiSpecifici() { + public Map getDatiSpecifici() { return datiSpecifici; } @Override - public void setDatiSpecifici(HashMap datiSpecifici) { + public void setDatiSpecifici(Map datiSpecifici) { this.datiSpecifici = datiSpecifici; } @Override - public HashMap getDatiSpecificiMigrazione() { + public Map getDatiSpecificiMigrazione() { return datiSpecificiMigrazione; } @Override - public void setDatiSpecificiMigrazione(HashMap datiSpecificiMigrazione) { + public void setDatiSpecificiMigrazione(Map datiSpecificiMigrazione) { this.datiSpecificiMigrazione = datiSpecificiMigrazione; } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ConfigRegAnno.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ConfigRegAnno.java index c1275d0..6ec20f0 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ConfigRegAnno.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ConfigRegAnno.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,12 +22,13 @@ */ package it.eng.parer.ws.versamento.dto; -import it.eng.parer.ws.utils.KeyOrdUtility; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; +import it.eng.parer.ws.utils.KeyOrdUtility; + /** * * @author fioravanti_f diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DatabaseStorageBackend.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DatabaseStorageBackend.java new file mode 100644 index 0000000..0bf35b0 --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DatabaseStorageBackend.java @@ -0,0 +1,31 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.dto; + +/** + * Backend predefinito, ovvero il database a cui è collegata l'applicazione. + * + * @author Snidero_L + */ +public interface DatabaseStorageBackend extends BackendStorage { + + @Override + default STORAGE_TYPE getType() { + return STORAGE_TYPE.BLOB; + } +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DatiRegistroFiscale.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DatiRegistroFiscale.java index 2f444ba..fc8a54b 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DatiRegistroFiscale.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DatiRegistroFiscale.java @@ -1,11 +1,26 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.versamento.dto; -import java.math.BigDecimal; - /** * * @author Fioravanti_F diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DatoSpecifico.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DatoSpecifico.java index 51f7ea0..6213679 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DatoSpecifico.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DatoSpecifico.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.dto; /** diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DocumentoVers.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DocumentoVers.java index 19e649a..36cbc11 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DocumentoVers.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/DocumentoVers.java @@ -1,16 +1,32 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.versamento.dto; -import java.util.HashMap; import java.util.List; +import java.util.Map; import org.apache.poi.ss.formula.eval.NotImplementedException; import it.eng.parer.ws.utils.Costanti.CategoriaDocumento; -import it.eng.parer.ws.utils.CostantiDB.TipiEntitaSacer; import it.eng.parer.ws.xml.versReq.DocumentoType; /** @@ -27,9 +43,9 @@ public class DocumentoVers implements java.io.Serializable, IDatiSpecEntity, IPr private int progressivo; private CategoriaDocumento categoriaDoc; private String urnPartDocumento = ""; - private DocumentoType rifDocumento; - protected HashMap datiSpecifici; - protected HashMap datiSpecificiMigrazione; + private transient DocumentoType rifDocumento; + protected transient Map datiSpecifici; + protected transient Map datiSpecificiMigrazione; private long idRecXsdDatiSpec; private long idRecXsdDatiSpecMigrazione; private List fileAttesi; @@ -138,7 +154,7 @@ public void setIdRecStrutturaDB(long idRecStrutturaDB) { * @return the datiSpecDocumento */ @Override - public HashMap getDatiSpecifici() { + public Map getDatiSpecifici() { return datiSpecifici; } @@ -147,17 +163,17 @@ public HashMap getDatiSpecifici() { * the datiSpecDocumento to set */ @Override - public void setDatiSpecifici(HashMap datiSpecifici) { + public void setDatiSpecifici(Map datiSpecifici) { this.datiSpecifici = datiSpecifici; } @Override - public HashMap getDatiSpecificiMigrazione() { + public Map getDatiSpecificiMigrazione() { return datiSpecificiMigrazione; } @Override - public void setDatiSpecificiMigrazione(HashMap datiSpecificiMigrazione) { + public void setDatiSpecificiMigrazione(Map datiSpecificiMigrazione) { this.datiSpecificiMigrazione = datiSpecificiMigrazione; } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/FileBinario.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/FileBinario.java index 7246e67..a0e5768 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/FileBinario.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/FileBinario.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.dto; import java.io.File; @@ -8,16 +25,12 @@ */ public class FileBinario implements java.io.Serializable { - /** - * - */ private static final long serialVersionUID = 3038080614562309178L; private String id; - private byte[] dati; - private boolean inMemoria; private File fileSuDisco; private long dimensione; private String fileName; + private transient ObjectStorageResource objectStorageResource; public String getId() { return id; @@ -27,29 +40,6 @@ public void setId(String id) { this.id = id; } - public byte[] getDati() { - return dati; - } - - public void setDati(byte[] dati) { - this.dati = dati; - } - - /** - * @return the inMemoria - */ - public boolean isInMemoria() { - return inMemoria; - } - - /** - * @param inMemoria - * the inMemoria to set - */ - public void setInMemoria(boolean inMemoria) { - this.inMemoria = inMemoria; - } - /** * @return the fileSuDisco */ @@ -94,4 +84,13 @@ public String getFileName() { public void setFileName(String fileName) { this.fileName = fileName; } + + public ObjectStorageResource getObjectStorageResource() { + return objectStorageResource; + } + + public void setObjectStorageResource(ObjectStorageResource objectStorageResource) { + this.objectStorageResource = objectStorageResource; + } + } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/FileStorageBackend.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/FileStorageBackend.java new file mode 100644 index 0000000..84af85d --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/FileStorageBackend.java @@ -0,0 +1,33 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.dto; + +/** + * Backend di tipo file. Attualmente non è utilizzato serve solo come riferimento per eventuali evoluzioni. + * + * @author Snidero_L + */ +public interface FileStorageBackend extends BackendStorage { + + String getRootFolder(); + + @Override + default STORAGE_TYPE getType() { + return STORAGE_TYPE.FILE; + } +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IDatiSpecEntity.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IDatiSpecEntity.java index ada1237..5e5d460 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IDatiSpecEntity.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IDatiSpecEntity.java @@ -1,10 +1,27 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.versamento.dto; -import java.util.HashMap; +import java.util.Map; /** * @@ -16,15 +33,15 @@ public interface IDatiSpecEntity { public void setIdRecXsdDatiSpec(long idRecXsdDatiSpec); - public HashMap getDatiSpecifici(); + public Map getDatiSpecifici(); - public void setDatiSpecifici(HashMap datiSpecifici); + public void setDatiSpecifici(Map datiSpecifici); public long getIdRecXsdDatiSpecMigrazione(); public void setIdRecXsdDatiSpecMigrazione(long idRecXsdDatiSpec); - public HashMap getDatiSpecificiMigrazione(); + public Map getDatiSpecificiMigrazione(); - public void setDatiSpecificiMigrazione(HashMap datiSpecificiMigrazione); + public void setDatiSpecificiMigrazione(Map datiSpecificiMigrazione); } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IProfiloEntity.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IProfiloEntity.java index 6c99dc8..9e6b168 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IProfiloEntity.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IProfiloEntity.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IRispostaVersWS.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IRispostaVersWS.java index 633f892..024c037 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IRispostaVersWS.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IRispostaVersWS.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IVersamentoExt.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IVersamentoExt.java index 6f9a983..b4be2e7 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IVersamentoExt.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/IVersamentoExt.java @@ -1,12 +1,30 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.versamento.dto; +import java.io.Serializable; + import it.eng.parer.ws.dto.IRestWSBase; import it.eng.spagoLite.security.User; -import java.io.Serializable; /** * diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ObjectStorageBackend.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ObjectStorageBackend.java new file mode 100644 index 0000000..ba6ff29 --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ObjectStorageBackend.java @@ -0,0 +1,47 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.dto; + +import java.net.URI; + +/** + * Backend di tipo Object Storage + * + * @author Snidero_L + */ +public interface ObjectStorageBackend extends BackendStorage { + + /** + * Indirizzo dell'object storage + * + * @return URI dell'object storage + */ + URI getAddress(); + + String getBucket(); + + String getAccessKeyId(); + + String getSecretKey(); + + @Override + default STORAGE_TYPE getType() { + return STORAGE_TYPE.OS; + } + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ObjectStorageResource.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ObjectStorageResource.java new file mode 100644 index 0000000..7fbab40 --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/ObjectStorageResource.java @@ -0,0 +1,58 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.dto; + +import java.net.URI; + +import it.eng.parer.ws.utils.ParametroApplDB; + +/** + * Informazioni per la risorsa salvata sull'object storage. + * + * @author Snidero_L + */ +public interface ObjectStorageResource { + + /** + * Questo metodo esiste per ragioni storiche. Tecnicamente non serve a nulla + * + * @return il nome del tenant come indicato nel parametro applicativo {@link ParametroApplDB#TENANT_OBJECT_STORAGE} + */ + String getTenant(); + + String getBucket(); + + String getKey(); + + String getETag(); + + /** + * Scadenza della risorsa (nel caso ci siano lifecycle policy configurate sul bucket) + * + * @return scadenza della risorsa + */ + String getExpiration(); + + /** + * Ottiene una URI utilizzabile per scaricare l'oggetto senza autenticazione alcuna per un lasso di + * tempo limitato. + * + * @return URI da cui effettuare una HTTP GET + */ + URI getPresignedURL(); +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/RispostaControlliAttSpec.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/RispostaControlliAttSpec.java index 1458fe5..3a50b29 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/RispostaControlliAttSpec.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/RispostaControlliAttSpec.java @@ -1,18 +1,37 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.versamento.dto; -import it.eng.parer.ws.dto.RispostaControlli; import java.util.HashMap; +import it.eng.parer.ws.dto.RispostaControlli; + /** * * @author Fioravanti_F */ public class RispostaControlliAttSpec extends RispostaControlli { + private static final long serialVersionUID = 1L; private long idRecXsdDatiSpec; private HashMap datiSpecifici; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/RispostaWS.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/RispostaWS.java index 0fc106c..33fd5e5 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/RispostaWS.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/RispostaWS.java @@ -1,9 +1,26 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.dto; import it.eng.parer.ws.utils.AvanzamentoWs; import it.eng.parer.ws.utils.MessaggiWSBundle; -import it.eng.parer.ws.xml.versResp.EsitoVersamento; import it.eng.parer.ws.xml.versResp.ECEsitoExtType; +import it.eng.parer.ws.xml.versResp.EsitoVersamento; /** * diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/RispostaWSAggAll.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/RispostaWSAggAll.java index fd8710d..7bd516e 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/RispostaWSAggAll.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/RispostaWSAggAll.java @@ -1,9 +1,26 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.dto; import it.eng.parer.ws.utils.AvanzamentoWs; import it.eng.parer.ws.utils.MessaggiWSBundle; -import it.eng.parer.ws.xml.versResp.EsitoVersAggAllegati; import it.eng.parer.ws.xml.versResp.ECEsitoExtType; +import it.eng.parer.ws.xml.versResp.EsitoVersAggAllegati; /** * diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/StrutturaVersamento.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/StrutturaVersamento.java index f793ece..b2734bf 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/StrutturaVersamento.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/StrutturaVersamento.java @@ -1,14 +1,31 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.dto; +import java.time.ZonedDateTime; import java.util.Date; -import java.util.HashMap; import java.util.List; +import java.util.Map; import it.eng.parer.ws.dto.CSChiave; import it.eng.parer.ws.dto.CSVersatore; import it.eng.parer.ws.utils.CostantiDB; import it.eng.parer.ws.utils.CostantiDB.TipoSalvataggioFile; -import java.time.ZonedDateTime; /** * @@ -16,9 +33,11 @@ */ public class StrutturaVersamento implements java.io.Serializable, IDatiSpecEntity, IProfiloEntity { + private static final long serialVersionUID = 3514833629482500859L; + private ZonedDateTime dataVersamento; // - private HashMap fileAttesi; + private Map fileAttesi; private List documentiAttesi; // private boolean trovatiIdCompDuplicati; @@ -97,8 +116,8 @@ public class StrutturaVersamento implements java.io.Serializable, IDatiSpecEntit private boolean warningFormatoNumero; // private String sistemaDiMigrazione = null; - private HashMap datiSpecifici; - private HashMap datiSpecificiMigrazione; + private Map datiSpecifici; + private Map datiSpecificiMigrazione; private long idRecXsdDatiSpec; private long idRecXsdDatiSpecMigrazione; // @@ -137,7 +156,7 @@ public void setDataVersamento(ZonedDateTime dataVersamento) { /** * @return the fileAttesi */ - public HashMap getFileAttesi() { + public Map getFileAttesi() { return fileAttesi; } @@ -145,7 +164,7 @@ public HashMap getFileAttesi() { * @param fileAttesi * the fileAttesi to set */ - public void setFileAttesi(HashMap fileAttesi) { + public void setFileAttesi(Map fileAttesi) { this.fileAttesi = fileAttesi; } @@ -497,22 +516,22 @@ public void setSistemaDiMigrazione(String sistemaDiMigrazione) { } @Override - public HashMap getDatiSpecifici() { + public Map getDatiSpecifici() { return datiSpecifici; } @Override - public void setDatiSpecifici(HashMap datiSpecifici) { + public void setDatiSpecifici(Map datiSpecifici) { this.datiSpecifici = datiSpecifici; } @Override - public HashMap getDatiSpecificiMigrazione() { + public Map getDatiSpecificiMigrazione() { return datiSpecificiMigrazione; } @Override - public void setDatiSpecificiMigrazione(HashMap datiSpecificiMigrazione) { + public void setDatiSpecificiMigrazione(Map datiSpecificiMigrazione) { this.datiSpecificiMigrazione = datiSpecificiMigrazione; } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/SyncFakeSessn.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/SyncFakeSessn.java index ab2b646..bfed762 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/SyncFakeSessn.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/SyncFakeSessn.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -14,6 +31,8 @@ */ public class SyncFakeSessn implements java.io.Serializable { + private static final long serialVersionUID = 1L; + public enum TipiSessioneVersamento { AGGIUNGI_DOCUMENTO, VERSAMENTO @@ -336,14 +355,6 @@ public List getFileBinari() { return fileBinari; } - /** - * @param fileBinari - * the fileBinari to set - */ - public void setFileBinari(List fileBinari) { - this.fileBinari = fileBinari; - } - public String getDatiC14NPackInfoSipXml() { return datiC14NPackInfoSipXml; } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/UnitaDocColl.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/UnitaDocColl.java index b827450..c15e930 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/UnitaDocColl.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/UnitaDocColl.java @@ -1,22 +1,43 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.versamento.dto; -import it.eng.parer.ws.xml.versReq.ChiaveType; import java.io.Serializable; import java.util.LinkedHashSet; import java.util.Set; + import org.apache.commons.lang3.StringUtils; +import it.eng.parer.ws.xml.versReq.ChiaveType; + /** * * @author Fioravanti_F */ public class UnitaDocColl implements Serializable { - public final static int MAX_LEN_DESCRIZIONE = 254; + private static final long serialVersionUID = 1L; + + public static final int MAX_LEN_DESCRIZIONE = 254; private ChiaveType chiave; private long idUnitaDocLink; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/VersamentoExt.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/VersamentoExt.java index 1ba1052..f02917b 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/VersamentoExt.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/VersamentoExt.java @@ -1,12 +1,31 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.dto; +import java.util.EnumSet; +import java.util.Set; + import it.eng.parer.ws.dto.IWSDesc; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.Costanti; import it.eng.parer.ws.utils.Costanti.ModificatoriWS; import it.eng.parer.ws.utils.Costanti.VersioneWS; import it.eng.parer.ws.xml.versReq.UnitaDocumentaria; -import java.util.EnumSet; /** * @@ -17,11 +36,11 @@ public class VersamentoExt extends AbsVersamentoExt { private static final long serialVersionUID = 5261426459498072293L; private String datiXml; private boolean simulaScrittura; - private UnitaDocumentaria versamento; - private IWSDesc descrizione; + private transient UnitaDocumentaria versamento; + private transient IWSDesc descrizione; // private VersioneWS versioneCalc = null; - private EnumSet modificatoriWS = EnumSet.noneOf(Costanti.ModificatoriWS.class); + private Set modificatoriWS = EnumSet.noneOf(Costanti.ModificatoriWS.class); @Override public void setDatiXml(String datiXml) { @@ -123,7 +142,7 @@ public RispostaControlli checkVersioneRequest(String versione) { } @Override - public EnumSet getModificatoriWSCalc() { + public Set getModificatoriWSCalc() { return this.modificatoriWS; } @@ -132,11 +151,11 @@ public String getVersioneCalc() { return this.versioneCalc.getVersion(); } - public EnumSet getModificatoriWS() { + public Set getModificatoriWS() { return modificatoriWS; } - public void setModificatoriWS(EnumSet modificatoriWS) { + public void setModificatoriWS(Set modificatoriWS) { this.modificatoriWS = modificatoriWS; } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/VersamentoExtAggAll.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/VersamentoExtAggAll.java index 2c2a585..742a2fd 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/VersamentoExtAggAll.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/VersamentoExtAggAll.java @@ -1,12 +1,30 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.dto; +import java.util.EnumSet; + import it.eng.parer.ws.dto.IWSDesc; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.Costanti; import it.eng.parer.ws.utils.Costanti.ModificatoriWS; import it.eng.parer.ws.utils.Costanti.VersioneWS; import it.eng.parer.ws.xml.versReq.UnitaDocAggAllegati; -import java.util.EnumSet; /** * diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/VoceDiErrore.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/VoceDiErrore.java index 5f28144..f33fcad 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/VoceDiErrore.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/VoceDiErrore.java @@ -1,12 +1,30 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.versamento.dto; +import java.io.Serializable; + import it.eng.parer.ws.dto.IRispostaWS; import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; -import java.io.Serializable; /** * @@ -14,6 +32,8 @@ */ public class VoceDiErrore implements Serializable { + private static final long serialVersionUID = 1L; + public enum ResponsabilitaErrore { NON_APPLICABILE, UNI_DOC, DOC } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/WSDescVersamento.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/WSDescVersamento.java index c4ff6c4..5e21eaa 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/WSDescVersamento.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/WSDescVersamento.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -27,4 +44,4 @@ public String getNomeWs() { // public String[] getCompatibilitaWS() { // return Costanti.WS_VERSAMENTO_COMP; // } -} \ No newline at end of file +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/WSDescVersamentoAggAll.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/WSDescVersamentoAggAll.java index 9ed456b..8dd6d9c 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/WSDescVersamentoAggAll.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/dto/WSDescVersamentoAggAll.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -27,4 +44,4 @@ public String getNomeWs() { // public String[] getCompatibilitaWS() { // return Costanti.WS_AGGIUNTA_COMP; // } -} \ No newline at end of file +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/AggiuntaAllSync.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/AggiuntaAllSync.java index 67799a3..4cb61fd 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/AggiuntaAllSync.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/AggiuntaAllSync.java @@ -1,10 +1,41 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.ejb; -import it.eng.parer.ws.dto.IRispostaWS.ErrorTypeEnum; -import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; +import java.math.BigInteger; +import java.time.ZonedDateTime; +import java.util.Date; + +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; +import javax.ejb.TransactionManagement; +import javax.ejb.TransactionManagementType; + +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import it.eng.parer.exception.ParamApplicNotFoundException; import it.eng.parer.util.DateUtilsConverter; import it.eng.parer.ws.dto.IRispostaWS; +import it.eng.parer.ws.dto.IRispostaWS.ErrorTypeEnum; +import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.AvanzamentoWs; import it.eng.parer.ws.utils.Costanti.TipiWSPerControlli; @@ -18,28 +49,15 @@ import it.eng.parer.ws.versamento.dto.RispostaWSAggAll; import it.eng.parer.ws.versamento.dto.SyncFakeSessn; import it.eng.parer.ws.versamento.dto.VersamentoExtAggAll; -import static it.eng.parer.ws.versamento.ejb.VersamentoSyncBase.logger; -import it.eng.parer.ws.versamento.utils.VerificaFirmeHashAggAll; -import it.eng.parer.ws.versamento.utils.VersamentoExtAggAllPrsr; +import it.eng.parer.ws.versamento.ejb.prs.VersamentoExtAggAllPrsr; import it.eng.parer.ws.versamentoTpi.utils.FileServUtils; import it.eng.parer.ws.xml.versResp.ECEsitoChiamataWSType; -import it.eng.parer.ws.xml.versResp.EsitoVersAggAllegati; import it.eng.parer.ws.xml.versResp.ECEsitoExtType; import it.eng.parer.ws.xml.versResp.ECEsitoGeneraleType; import it.eng.parer.ws.xml.versResp.ECEsitoPosNegType; import it.eng.parer.ws.xml.versResp.ECEsitoXSDAggAllType; +import it.eng.parer.ws.xml.versResp.EsitoVersAggAllegati; import it.eng.spagoLite.security.User; -import java.math.BigInteger; -import java.time.ZonedDateTime; -import java.util.Date; -import javax.ejb.LocalBean; -import javax.ejb.Stateless; -import javax.ejb.TransactionManagement; -import javax.ejb.TransactionManagementType; - -import org.apache.commons.lang3.exception.ExceptionUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * @@ -56,6 +74,10 @@ public class AggiuntaAllSync extends VersamentoSyncBase { // private static final Logger log = LoggerFactory.getLogger(AggiuntaAllSync.class); // + @EJB + VersamentoExtAggAllPrsr tmpPrsr; + @EJB + VerificaFirmeHashAggAll veriFirme; public void init(RispostaWSAggAll rispostaWs, AvanzamentoWs avanzamento, VersamentoExtAggAll versamento, EsitoVersAggAllegati myEsito) { @@ -149,8 +171,7 @@ public void parseXML(SyncFakeSessn sessione, RispostaWSAggAll rispostaWs, Versam } try { - VersamentoExtAggAllPrsr tmpPrsr = new VersamentoExtAggAllPrsr(versamento, rispostaWs); - tmpPrsr.parseXML(sessione); + tmpPrsr.parseXML(sessione, versamento, rispostaWs); tmpAvanzamentoWs.resetFase(); } catch (Exception e) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); @@ -172,8 +193,8 @@ public void parseXML(SyncFakeSessn sessione, RispostaWSAggAll rispostaWs, Versam if (tmpRispostaControlli.getCodErr() != null) { rispostaWs.setSeverity(SeverityEnum.ERROR); rispostaWs.setEsitoWsErrBundle(tmpRispostaControlli.getCodErr(), tmpRispostaControlli.getDsErr()); - logger.error("Eccezione nella fase di produzione Rapporto di versamento Documento doppio " - + tmpRispostaControlli.getDsErr()); + logger.error("Eccezione nella fase di produzione Rapporto di versamento Documento doppio {}", + tmpRispostaControlli.getDsErr()); } } else { myEsito.setXMLVersamento(sessione.getDatiIndiceSipXml()); @@ -186,10 +207,12 @@ public void addFile(FileBinario fileIn, RispostaWSAggAll rispostaWs, VersamentoE if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { try { - // verifica se il file doveva essere inserito, cercandolo nella lista dei componenti + // verifica se il file doveva essere inserito, cercandolo nella lista dei + // componenti // se c'è lo imposta nel componente trovato // setta a true il flag di dati letti - // imposta il valore della dimensione del file nel frammento di xml di risposta già pronto + // imposta il valore della dimensione del file nel frammento di xml di risposta + // già pronto ComponenteVers tmpComponenteVers; tmpComponenteVers = versamento.getStrutturaComponenti().getFileAttesi().get(fileIn.getId()); if (tmpComponenteVers != null) { @@ -197,9 +220,11 @@ public void addFile(FileBinario fileIn, RispostaWSAggAll rispostaWs, VersamentoE if (tmpComponenteVers.getTipoSupporto() == ComponenteVers.TipiSupporto.FILE) { tmpComponenteVers.setRifFileBinario(fileIn); tmpComponenteVers.setDatiLetti(true); - // imposta la dimensione file nell'XML di risposta associato al componente trovato + // imposta la dimensione file nell'XML di risposta associato al componente + // trovato // NOTA BENE: solo uno tra componente e sottocomponente è valorizzato, - // perciò il doppio IF che segue comporta la scrittura della dimensione su un solo elemento + // perciò il doppio IF che segue comporta la scrittura della dimensione su un + // solo elemento if (tmpComponenteVers.getRifComponenteResp() != null) { tmpComponenteVers.getRifComponenteResp() .setDimensioneFile(BigInteger.valueOf(fileIn.getDimensione())); @@ -252,7 +277,8 @@ public void verificaCoerenzaComponenti(RispostaWSAggAll rispostaWs, VersamentoEx } if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - // verifica che il payload del versamento possa essere contenuto nel filesystem di destinazione + // verifica che il payload del versamento possa essere contenuto nel filesystem + // di destinazione if (versamento.getStrutturaComponenti().getTipoSalvataggioFile() == CostantiDB.TipoSalvataggioFile.FILE) { try { FileServUtils fileServUtils = new FileServUtils(); @@ -280,8 +306,7 @@ public void controllaFirmeAndHash(RispostaWSAggAll rispostaWs, VersamentoExtAggA if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { try { - VerificaFirmeHashAggAll veriFirme = new VerificaFirmeHashAggAll(versamento, rispostaWs); - veriFirme.controlloFirmeMarcheHash(); + veriFirme.controlloFirmeMarcheHash(versamento, rispostaWs); } catch (Exception e) { rispostaWs.setSeverity(SeverityEnum.ERROR); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, @@ -292,8 +317,6 @@ public void controllaFirmeAndHash(RispostaWSAggAll rispostaWs, VersamentoExtAggA if (rispostaWs.getSeverity() == SeverityEnum.ERROR) { myEsito.setXMLVersamento(versamento.getDatiXml()); - } else { - // myEsito.getUnitaDocumentariaAggAll().setStatoConservazione(ECStatoConsType.IN_ATTESA_SCHED); } } @@ -304,7 +327,8 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWSAggAll rispostaWs, Vers AvanzamentoWs tmpAvanzamentoWs = rispostaWs.getAvanzamento(); boolean prosegui = true; - // patch di dubbio gusto per includere la riga di errore eventualmente individuata nei controlli precedenti + // patch di dubbio gusto per includere la riga di errore eventualmente + // individuata nei controlli precedenti // nella lista di messaggi if (myEsito.getEsitoGenerale().getCodiceEsito() == ECEsitoExtType.NEGATIVO && !versamento.isTrovatiErrori()) { versamento.aggiungErroreFatale(myEsito.getEsitoGenerale().getCodiceErrore(), @@ -315,7 +339,7 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWSAggAll rispostaWs, Vers myEsito.setWarningUlteriori(versamento.produciEsitoWarningSec()); // if (versamento.getXmlDefaults().get(ParametroApplDB.VERIFICA_PARTIZIONI) != null && versamento.getXmlDefaults() - .get(ParametroApplDB.VERIFICA_PARTIZIONI).trim().toUpperCase().equals("TRUE")) { + .get(ParametroApplDB.VERIFICA_PARTIZIONI).trim().equalsIgnoreCase("TRUE")) { String tmpDescStrut; if (versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti().getIdStruttura() != 0) { @@ -330,7 +354,8 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWSAggAll rispostaWs, Vers rispostaWs.setEsitoWsError(tmpRispostaControlli.getCodErr(), tmpRispostaControlli.getDsErr()); versamento.aggiungErroreFatale(myEsito.getEsitoGenerale().getCodiceErrore(), myEsito.getEsitoGenerale().getMessaggioErrore()); - // rigenera la lista errori e warning secondari - forse cambiata in caso di errore + // rigenera la lista errori e warning secondari - forse cambiata in caso di + // errore myEsito.setErroriUlteriori(versamento.produciEsitoErroriSec()); myEsito.setWarningUlteriori(versamento.produciEsitoWarningSec()); prosegui = false; @@ -349,7 +374,8 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWSAggAll rispostaWs, Vers this.beginTrans(rispostaWs); versamento.aggiungErroreFatale(myEsito.getEsitoGenerale().getCodiceErrore(), myEsito.getEsitoGenerale().getMessaggioErrore()); - // rigenera la lista errori e warning secondari - forse cambiata in caso di errore di persistenza + // rigenera la lista errori e warning secondari - forse cambiata in caso di + // errore di persistenza myEsito.setErroriUlteriori(versamento.produciEsitoErroriSec()); myEsito.setWarningUlteriori(versamento.produciEsitoWarningSec()); } @@ -365,13 +391,14 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWSAggAll rispostaWs, Vers if (tmpRispostaControlli.getCodErr() != null) { rispostaWs.setSeverity(SeverityEnum.ERROR); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, tmpRispostaControlli.getDsErr()); - logger.error("Eccezione nella fase di produzione Rapporto di versamento " - + tmpRispostaControlli.getDsErr()); + logger.error("Eccezione nella fase di produzione Rapporto di versamento {}", + tmpRispostaControlli.getDsErr()); this.rollback(rispostaWs); this.beginTrans(rispostaWs); versamento.aggiungErroreFatale(myEsito.getEsitoGenerale().getCodiceErrore(), myEsito.getEsitoGenerale().getMessaggioErrore()); - // rigenera la lista errori e warning secondari - forse cambiata in caso di errore + // rigenera la lista errori e warning secondari - forse cambiata in caso di + // errore myEsito.setErroriUlteriori(versamento.produciEsitoErroriSec()); myEsito.setWarningUlteriori(versamento.produciEsitoWarningSec()); } @@ -384,12 +411,13 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWSAggAll rispostaWs, Vers if (tmpRispostaControlli.getCodErr() != null) { // nota l'errore critico di persistenza viene contrassegnato con la lettera P // per dare la possibilità all'eventuale chiamante di ripetere il tentativo - // quando possibile (non è infatti un errore "definitivo" dato dall'input, ma bensì + // quando possibile (non è infatti un errore "definitivo" dato dall'input, ma + // bensì // un errore interno provocato da problemi al database) rispostaWs.setSeverity(SeverityEnum.ERROR); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, tmpRispostaControlli.getDsErr()); - log.error("Eccezione nella fase di Salvataggio dei dati di sessione " - + tmpRispostaControlli.getDsErr()); + log.error("Eccezione nella fase di Salvataggio dei dati di sessione {}", + tmpRispostaControlli.getDsErr()); this.rollback(rispostaWs); prosegui = false; } @@ -411,13 +439,13 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWSAggAll rispostaWs, Vers pl.setDtCreazione(DateUtilsConverter .convert(versamento.getStrutturaComponenti().getDataVersamento()).getTime()); - tmpRispostaControlli = jmsProducerUtilEjb.inviaMessaggioInFormatoJson(connectionFactory, queue, pl, - "CodaElenchiDaElabInAttesaSched"); + tmpRispostaControlli = jmsProducerUtilEjb.manageMessageGroupingInFormatoJson(connectionFactory, + queue, pl, "CodaElenchiDaElab", String.valueOf(pl.getIdStrut())); if (tmpRispostaControlli.getCodErr() != null) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, tmpRispostaControlli.getDsErr()); - logger.error("Eccezione nella fase di Invio messaggio alla coda JMS " - + tmpRispostaControlli.getDsErr()); + logger.error("Eccezione nella fase di Invio messaggio alla coda JMS {}", + tmpRispostaControlli.getDsErr()); this.rollback(rispostaWs); prosegui = false; } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/AwsClient.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/AwsClient.java new file mode 100644 index 0000000..cd97e28 --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/AwsClient.java @@ -0,0 +1,194 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb; + +import java.net.URI; +import java.time.Duration; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import javax.annotation.PreDestroy; +import javax.ejb.EJB; +import javax.ejb.Singleton; + +import org.apache.commons.lang3.math.NumberUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import it.eng.parer.util.ejb.help.ConfigurationHelper; +import it.eng.parer.ws.utils.ParametroApplDB; +import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; +import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; +import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; +import software.amazon.awssdk.http.apache.ApacheHttpClient; +import software.amazon.awssdk.regions.Region; +import software.amazon.awssdk.services.s3.S3Client; + +/** + * Cache per i client AWS. Siccome la creazione di un client è un'attività computazionalmente pesante e a noi ne servono + * pochi (direi al massimo 2) lasciamoli in memoria + * + * @author Snidero_L + */ +@Singleton +public class AwsClient { + + private final Logger log = LoggerFactory.getLogger(AwsClient.class); + + private final Map clientCache = new HashMap<>(); + + @EJB + protected ConfigurationHelper configurationHelper; + + private S3Client lookupClient(URI storageAddress, String accessKeyId, String secretKey) { + + final CacheKey key = new CacheKey(storageAddress, accessKeyId, secretKey); + + S3Client client = clientCache.computeIfAbsent(key, k -> createS3Client(storageAddress, accessKeyId, secretKey)); + log.debug("Sto per effettuare il collegamento all'endpoint S3 [{}] dal thread {}", storageAddress, + Thread.currentThread().getName()); + return client; + + } + + /* + * Nota: con l'introduzione di https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html è + * necessario abilitare "forzatamente" la modalità path style (attenzione: in futuro sarà deprecata!) + */ + private S3Client createS3Client(URI storageAddress, String accessKeyId, String secretKey) { + + final AwsCredentialsProvider credProvider = StaticCredentialsProvider + .create(AwsBasicCredentials.create(accessKeyId, secretKey)); + + return S3Client.builder().endpointOverride(storageAddress).region(Region.US_EAST_1) + .credentialsProvider(credProvider).forcePathStyle(true) + .httpClientBuilder(ApacheHttpClient.builder().maxConnections(maxConnections()) + .connectionTimeout(connectionTimeoutOfMinutes()).socketTimeout(socketTimeoutOfMinutes())) + .build(); + } + + /** + * Ottiene il numero di connessioni massimo per client. Se parametro non impostato corettamente, viene utilizzato un + * default di 100 + * + * @return numero di connessioni + * + */ + private final Integer maxConnections() { + final String longParameterString = configurationHelper + .getValoreParamApplicByApplic(ParametroApplDB.S3_CLIENT_MAX_CONNECTIONS); + return NumberUtils.isDigits(longParameterString) ? Integer.valueOf(longParameterString) : 100; // default + } + + /** + * Ottiene il timeout di connessione espresso in minuti. Se parametro non impostato corettamente, viene utilizzato + * un default di 1 minuto + * + * @return minuti + * + */ + private final Duration connectionTimeoutOfMinutes() { + final String longParameterString = configurationHelper + .getValoreParamApplicByApplic(ParametroApplDB.S3_CLIENT_CONNECTION_TIMEOUT); + return Duration.ofMinutes(NumberUtils.isDigits(longParameterString) ? Long.valueOf(longParameterString) : 1L); // default + } + + /** + * Ottiene il timeout di socket espresso in minuti. Se parametro non impostato corettamente, viene utilizzato un + * default di 10 minuti + * + * @return minuti + * + */ + private final Duration socketTimeoutOfMinutes() { + final String longParameterString = configurationHelper + .getValoreParamApplicByApplic(ParametroApplDB.S3_CLIENT_SOCKET_TIMEOUT); + return Duration.ofMinutes(NumberUtils.isDigits(longParameterString) ? Long.valueOf(longParameterString) : 10L); // default + } + + /** + * Ottieni il client (possibilmente in cache) per il collegamento a questo OS + * + * @param storageAddress + * URI dell'object storage + * @param accessKeyId + * accessKeyID per l'accesso a questo bucket + * @param secretKey + * secretKe per l'accesso a questo bucket + * + * @return client S3 configurato + */ + public S3Client getClient(URI storageAddress, String accessKeyId, String secretKey) { + return lookupClient(storageAddress, accessKeyId, secretKey); + } + + @PreDestroy + private void clear() { + for (S3Client s3Client : clientCache.values()) { + if (s3Client != null) { + s3Client.close(); + } + } + } + + private static class CacheKey { + + private URI storageAddress; + private String accessKeyId; + private String secretKey; + + public CacheKey(URI storageAddress, String accessKeyId, String secretKey) { + this.storageAddress = storageAddress; + this.accessKeyId = accessKeyId; + this.secretKey = secretKey; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((storageAddress == null) ? 0 : storageAddress.hashCode()); + result = prime * result + ((accessKeyId == null) ? 0 : accessKeyId.hashCode()); + result = prime * result + ((secretKey == null) ? 0 : secretKey.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CacheKey other = (CacheKey) obj; + if (!Objects.equals(this.accessKeyId, other.accessKeyId)) { + return false; + } + if (!Objects.equals(this.secretKey, other.secretKey)) { + return false; + } + return Objects.equals(this.storageAddress, other.storageAddress); + } + } + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/AwsPresigner.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/AwsPresigner.java new file mode 100644 index 0000000..5bc146b --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/AwsPresigner.java @@ -0,0 +1,196 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb; + +import java.net.URI; +import java.net.URL; +import java.time.Duration; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import javax.annotation.PreDestroy; +import javax.ejb.EJB; +import javax.ejb.Singleton; + +import org.apache.commons.lang3.math.NumberUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import it.eng.parer.util.ejb.help.ConfigurationHelper; +import it.eng.parer.ws.utils.ParametroApplDB; +import it.eng.parer.ws.versamento.dto.ObjectStorageBackend; +import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; +import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; +import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; +import software.amazon.awssdk.regions.Region; +import software.amazon.awssdk.services.s3.S3Configuration; +import software.amazon.awssdk.services.s3.model.GetObjectRequest; +import software.amazon.awssdk.services.s3.presigner.S3Presigner; +import software.amazon.awssdk.services.s3.presigner.model.GetObjectPresignRequest; +import software.amazon.awssdk.services.s3.presigner.model.PresignedGetObjectRequest; + +/** + * Classe che si occupa di istanziare un presigner S3. Nella nostra applicazione dobbiamo poter gestire più Object + * storage e, di conseguenza, più presigner. + * + * Questa classe si occupa di creare una cache per questi oggetti. + * + * https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/s3/presigner/S3Presigner.html + * + * @author Snidero_L + */ +@Singleton +public class AwsPresigner { + + private Logger log = LoggerFactory.getLogger(AwsPresigner.class); + + private final Map presignerCache = new HashMap<>(); + + @EJB + protected ConfigurationHelper configurationHelper; + + private S3Presigner lookupPresigner(ObjectStorageBackend configuration) { + + final CacheKey cacheKey = new CacheKey(configuration.getAddress(), configuration.getBucket()); + S3Presigner presigner = presignerCache.computeIfAbsent(cacheKey, k -> createPresigner(configuration)); + log.debug("Il presigner per il bucket {} dell'object storage {} utilizzato", configuration.getBucket(), + configuration.getAddress()); + return presigner; + } + + /* + * Nota: con l'introduzione di https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html è + * necessario abilitare "forzatamente" la modalità path style (attenzione: in futuro sarà deprecata!) + */ + private S3Presigner createPresigner(ObjectStorageBackend configuration) { + + final AwsCredentialsProvider credProvider = StaticCredentialsProvider + .create(AwsBasicCredentials.create(configuration.getAccessKeyId(), configuration.getSecretKey())); + + return S3Presigner.builder().endpointOverride(configuration.getAddress()).region(Region.US_EAST_1) + .credentialsProvider(credProvider) + .serviceConfiguration(S3Configuration.builder().pathStyleAccessEnabled(true).build()).build(); + } + + /** + * Ottieni la PRE-signed URL per il backend indicato dalla configurazione. La durata predefinita è di 10 minuti. Se + * risulta necessario modificare la durata utilizzare + * {@link #getPresignedUrl(it.eng.parer.ws.versamento.dto.ObjectStorageBackend, java.lang.String, java.time.Duration) } + * + * @param configuration + * configurazione backend + * @param key + * chiave per cui fornire la presigned URL + * + * @return URL pre firmata (accessibile per i prossimi 10 minuti) + */ + public URL getPresignedUrl(ObjectStorageBackend configuration, String key) { + return getPresignedUrl(configuration, key, presignedUrlDurationOfMinutes()); + + } + + /** + * Ottieni la PRE-signed URL per il backend indicato dalla configurazione. + * + * + * @param configuration + * configurazione backend + * @param key + * chiave per cui fornire la presigned URL + * @param signatureDuration + * la validità temporale dell'URL firmata + * + * @return URL pre firmata (accessibile per la durata passata come parametro) + */ + public URL getPresignedUrl(ObjectStorageBackend configuration, String key, Duration signatureDuration) { + S3Presigner presigner = lookupPresigner(configuration); + + GetObjectRequest getObjectRequest = GetObjectRequest.builder().bucket(configuration.getBucket()).key(key) + .build(); + + GetObjectPresignRequest getObjectPresignRequest = GetObjectPresignRequest.builder() + .signatureDuration(signatureDuration).getObjectRequest(getObjectRequest).build(); + + PresignedGetObjectRequest presignedGetObjectRequest = presigner.presignGetObject(getObjectPresignRequest); + log.debug("Ora puoi accedere a questa URL per {} minuti {}", signatureDuration.toMinutes(), + presignedGetObjectRequest.url()); + return presignedGetObjectRequest.url(); + } + + /** + * Ottiene la durata, espressa in minuti, dei presigned URI. Se parametro non impostato corettamente, viene + * utilizzato un default di 10 minuti. + * + * @return durata in minuti + * + */ + private final Duration presignedUrlDurationOfMinutes() { + final String longParameterString = configurationHelper + .getValoreParamApplicByApplic(ParametroApplDB.S3_PRESIGNED_URL_DURATION); + return Duration.ofMinutes(NumberUtils.isDigits(longParameterString) ? Long.valueOf(longParameterString) : 10L); // default + } + + @PreDestroy + private void clear() { + for (S3Presigner s3Presigner : presignerCache.values()) { + if (s3Presigner != null) { + s3Presigner.close(); + } + } + } + + private static class CacheKey { + + private URI storageAddress; + private String bucket; + + CacheKey(URI storageAddress, String bucket) { + this.storageAddress = storageAddress; + this.bucket = bucket; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((storageAddress == null) ? 0 : storageAddress.hashCode()); + result = prime * result + ((bucket == null) ? 0 : bucket.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CacheKey other = (CacheKey) obj; + if (!Objects.equals(this.bucket, other.bucket)) { + return false; + } + return Objects.equals(this.storageAddress, other.storageAddress); + } + + } +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliPartizioni.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliPartizioni.java index 9d7cffb..44eacdd 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliPartizioni.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliPartizioni.java @@ -1,32 +1,54 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.ejb; -import it.eng.parer.entity.OrgPartition; -import it.eng.parer.entity.OrgPartitionStrut; import static it.eng.parer.util.DateUtilsConverter.convert; import static it.eng.parer.util.DateUtilsConverter.format; -import it.eng.parer.ws.dto.CSChiave; -import it.eng.parer.ws.dto.CSVersatore; -import it.eng.parer.ws.dto.RispostaControlli; -import it.eng.parer.ws.utils.CostantiDB; -import it.eng.parer.ws.utils.MessaggiWSBundle; -import it.eng.parer.ws.utils.MessaggiWSFormat; -import it.eng.parer.ws.versamento.dto.StrutturaVersamento; -import it.eng.parer.ws.versamento.dto.SyncFakeSessn; -import it.eng.parer.ws.versamento.dto.VersamentoExt; + +import java.math.BigDecimal; import java.util.List; + import javax.ejb.LocalBean; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import it.eng.parer.entity.OrgPartition; +import it.eng.parer.entity.OrgPartitionStrut; +import it.eng.parer.ws.dto.CSVersatore; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.utils.CostantiDB; +import it.eng.parer.ws.utils.MessaggiWSBundle; +import it.eng.parer.ws.utils.MessaggiWSFormat; +import it.eng.parer.ws.versamento.dto.StrutturaVersamento; +import it.eng.parer.ws.versamento.dto.SyncFakeSessn; +import it.eng.parer.ws.versamento.dto.VersamentoExt; + /** * * @author Fioravanti_F */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "ControlliPartizioni") @LocalBean @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) @@ -37,8 +59,7 @@ public class ControlliPartizioni { @PersistenceContext(unitName = "ParerJPA") private EntityManager entityManager; - public RispostaControlli verificaPartizioniBlob(StrutturaVersamento strutV, CSVersatore versatore, - CSChiave chiave) { + public RispostaControlli verificaPartizioniBlob(StrutturaVersamento strutV, CSVersatore versatore) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); rispostaControlli.setrBoolean(false); @@ -204,7 +225,7 @@ public RispostaControlli verificaPartizioniVers(StrutturaVersamento strutV, Sync queryStr = "select count(t) from OrgVValSubPartition t " + "where t.idPartition = :idPartitionIn " + "and t.cdValSubPartition > :cdValSubPartitionIn"; query = entityManager.createQuery(queryStr); - query.setParameter("idPartitionIn", idPart); + query.setParameter("idPartitionIn", new BigDecimal(idPart)); query.setParameter("cdValSubPartitionIn", convert(sessione.getTmApertura())); if ((Long) query.getSingleResult() == 0) { /* diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliPerFirme.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliPerFirme.java index 7c1e860..6fb725a 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliPerFirme.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliPerFirme.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.ejb; import java.math.BigDecimal; @@ -17,6 +34,7 @@ import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Root; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -29,6 +47,7 @@ import it.eng.parer.entity.FirCertifOcsp; import it.eng.parer.entity.FirCrl; import it.eng.parer.entity.FirOcsp; +import it.eng.parer.entity.OrgEnte; import it.eng.parer.entity.OrgStrut; import it.eng.parer.entity.constraint.DecServizioVerificaCompDoc.CdServizioVerificaCompDoc; import it.eng.parer.entity.converter.NeverendingDateConverter; @@ -42,6 +61,7 @@ * @author Gilioli_P ... edited by Francesco Fioravanti * */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "ControlliPerFirme") @LocalBean public class ControlliPerFirme { @@ -57,16 +77,18 @@ public RispostaControlli getOrgStrutt(long idStrutVers) { RispostaControlli rs; rs = new RispostaControlli(); rs.setrLong(-1); - OrgStrut os = null; try { - os = entityManager.find(OrgStrut.class, idStrutVers); + final TypedQuery query = entityManager.createQuery( + "SELECT org FROM OrgStrut org JOIN FETCH org.orgEnte WHERE org.idStrut=:idStrut", OrgStrut.class); + query.setParameter("idStrut", idStrutVers); + OrgStrut os = query.getSingleResult(); rs.setrLong(0); rs.setrObject(os); } catch (Exception e) { rs.setCodErr(MessaggiWSBundle.ERR_666); rs.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "ControlliPerFirme.getOrgStrutt: " + e.getMessage())); + "ControlliPerFirme.getOrgStrutt: " + ExceptionUtils.getRootCauseMessage(e))); LOG.error(LOG_BASEMSG_ERROR_ON_DECTABLE, e); } return rs; @@ -88,8 +110,10 @@ public OrgStrut getOrgStruttAsEntity(long idStrutVers) throws VerificaFirmaExcep try { return entityManager.find(OrgStrut.class, idStrutVers); } catch (Exception e) { - throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle.getString( - MessaggiWSBundle.ERR_666, "ControlliPerFirme.getOrgStruttAsEntity: " + e.getMessage()), e); + throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, + MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "ControlliPerFirme.getOrgStruttAsEntity: " + ExceptionUtils.getRootCauseMessage(e)), + e); } } @@ -110,9 +134,11 @@ public DecFormatoFileStandard getDecFormatoFileStandardAsEntity(long idDecFormat try { return entityManager.find(DecFormatoFileStandard.class, idDecFormatoFileStandard); } catch (Exception e) { - LOG.error("Eccezione nella lettura della tabella di decodifica " + e); - throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle.getString( - MessaggiWSBundle.ERR_666, "ControlliPerFirme.getDecFormatoFileStandard: " + e.getMessage()), e); + LOG.error("Eccezione nella lettura della tabella di decodifica ", e); + throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, + MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "ControlliPerFirme.getDecFormatoFileStandard: " + ExceptionUtils.getRootCauseMessage(e)), + e); } } @@ -145,7 +171,7 @@ public RispostaControlli confrontaFormati(long idFormatoStd, long idFormatoVers) } catch (Exception e) { rs.setCodErr(MessaggiWSBundle.ERR_666); rs.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "ControlliPerFirme.confrontaFormati: " + e.getMessage())); + "ControlliPerFirme.confrontaFormati: " + ExceptionUtils.getRootCauseMessage(e))); LOG.error(LOG_BASEMSG_ERROR_ON_DECTABLE, e); } return rs; @@ -171,8 +197,10 @@ public List getDecEstensioneFiles(String formato) throws Veri q.setParameter("formato", formato); return q.getResultList(); } catch (Exception e) { - throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle.getString( - MessaggiWSBundle.ERR_666, "ControlliPerFirme.getDecEstensioneFiles: " + e.getMessage()), e); + throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, + MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "ControlliPerFirme.getDecEstensioneFiles: " + ExceptionUtils.getRootCauseMessage(e)), + e); } } @@ -196,9 +224,9 @@ public List getDecFmtFileStdFromEstensioneFiles(String f q.setParameter("estensioneFile", formatoVersato); return q.getResultList(); } catch (Exception e) { - throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, - MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "ControlliPerFirme.getDecFmtFileStdFromEstensioneFiles: " + e.getMessage()), + throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle.getString( + MessaggiWSBundle.ERR_666, + "ControlliPerFirme.getDecFmtFileStdFromEstensioneFiles: " + ExceptionUtils.getRootCauseMessage(e)), e); } } @@ -223,9 +251,9 @@ public List getDecFmtFileStandardFromTikaMimes(String ti q.setParameter("formatoTika", tikaMime); return q.getResultList(); } catch (Exception e) { - throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, - MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "ControlliPerFirme.getDecFmtFileStandardFromTikaMimes: " + e.getMessage()), + throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle.getString( + MessaggiWSBundle.ERR_666, + "ControlliPerFirme.getDecFmtFileStandardFromTikaMimes: " + ExceptionUtils.getRootCauseMessage(e)), e); } } @@ -251,9 +279,9 @@ public List getDecFmtFileStandardFromFmtMarcas(Set getDecFmtFileStandardFromFmtDocs(long idForm dffs = q.getResultList(); } catch (Exception e) { throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle.getString( - MessaggiWSBundle.ERR_666, "ControlliPerFirme.getDecFmtFileStandardFromFmtDocs: " + e.getMessage())); + MessaggiWSBundle.ERR_666, + "ControlliPerFirme.getDecFmtFileStandardFromFmtDocs: " + ExceptionUtils.getRootCauseMessage(e))); } // configuration error (666 blocking error code) if (dffs == null || dffs.isEmpty()) { @@ -313,8 +342,10 @@ public DecFormatoFileDoc getDecFormatoFileDoc(long idFormatoFileDoc) throws Veri try { return entityManager.find(DecFormatoFileDoc.class, idFormatoFileDoc); } catch (Exception e) { - throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle.getString( - MessaggiWSBundle.ERR_666, "ControlliPerFirme.getDecFormatoFileDoc: " + e.getMessage()), e); + throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, + MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "ControlliPerFirme.getDecFormatoFileDoc: " + ExceptionUtils.getRootCauseMessage(e)), + e); } } @@ -351,8 +382,9 @@ public FirCertifCa getFirCertifCa(BigDecimal niSerialCertifCa, String dlDnIssuer firCertifCa = firCertifCas.get(0); } } catch (Exception e) { - throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle - .getString(MessaggiWSBundle.ERR_666, "ControlliPerFirme.getFirCertifCa: " + e.getMessage())); + throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, + MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "ControlliPerFirme.getFirCertifCa: " + ExceptionUtils.getRootCauseMessage(e))); } // result return firCertifCa; @@ -403,8 +435,8 @@ public FirCrl getFirCrl(FirCertifCa firCertifCa, BigDecimal niSerialCrl, Date dt } return firCrl; } catch (Exception e) { - throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle - .getString(MessaggiWSBundle.ERR_666, "ControlliPerFirme.getFirCrl: " + e.getMessage())); + throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle.getString( + MessaggiWSBundle.ERR_666, "ControlliPerFirme.getFirCrl: " + ExceptionUtils.getRootCauseMessage(e))); } } @@ -423,8 +455,9 @@ public FirCertifOcsp getFirCertifOcsp(FirCertifCa firCertifCa, BigDecimal niSeri return firCertifOcsp; } catch (Exception e) { - throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle - .getString(MessaggiWSBundle.ERR_666, "ControlliPerFirme.getFirCertifOcsp: " + e.getMessage())); + throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, + MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "ControlliPerFirme.getFirCertifOcsp: " + ExceptionUtils.getRootCauseMessage(e))); } } @@ -468,8 +501,9 @@ public FirOcsp getFirOcsp(FirCertifOcsp firCertifOcsp, String dsCertifIssuername } return firOcsp; } catch (Exception e) { - throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle - .getString(MessaggiWSBundle.ERR_666, "ControlliPerFirme.getFirOcsp: " + e.getMessage())); + throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, + MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "ControlliPerFirme.getFirOcsp: " + ExceptionUtils.getRootCauseMessage(e))); } } @@ -503,8 +537,9 @@ public FirCertifFirmatario getFirCertifFirmatario(FirCertifCa firCertifCa, BigDe return firFirCertifFirmatario; } catch (Exception e) { LOG.error("Eccezione nella lettura della tabella FirCertifFirmatario ", e); - throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle.getString( - MessaggiWSBundle.ERR_666, "ControlliPerFirme.getFirCertifFirmatario: " + e.getMessage())); + throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, + MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "ControlliPerFirme.getFirCertifFirmatario: " + ExceptionUtils.getRootCauseMessage(e))); } } @@ -539,8 +574,10 @@ public List getFirCertifFirmatarioIds(BigDecimal niSerialCertifFirmatario, firFirCertifFirmatarios = entityManager.createQuery(criteriaQuery).getResultList(); return firFirCertifFirmatarios; } catch (Exception e) { - throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle.getString( - MessaggiWSBundle.ERR_666, "ControlliPerFirme.getFirCertifFirmatarioIds: " + e.getMessage()), e); + throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, + MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "ControlliPerFirme.getFirCertifFirmatarioIds: " + ExceptionUtils.getRootCauseMessage(e)), + e); } } @@ -564,7 +601,13 @@ public DecServizioVerificaCompDoc getDecServizioVerificaCompDoc(String cdService return dec.get(0); } catch (Exception e) { throw new VerificaFirmaException(MessaggiWSBundle.ERR_666, MessaggiWSBundle.getString( - MessaggiWSBundle.ERR_666, "ControlliPerFirme.getDecServizioVerificaCompDoc: " + e.getMessage()), e); + MessaggiWSBundle.ERR_666, + "ControlliPerFirme.getDecServizioVerificaCompDoc: " + ExceptionUtils.getRootCauseMessage(e)), e); } } + + public void retrieveOrgEnteFor(OrgStrut os) { + OrgEnte orgEnte = entityManager.find(OrgEnte.class, os.getOrgEnte().getIdEnte()); + os.setOrgEnte(orgEnte); + } } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliProfiliUd.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliProfiliUd.java index 7111345..f655307 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliProfiliUd.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliProfiliUd.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -8,7 +25,6 @@ import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; -import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -46,6 +62,7 @@ import it.eng.parer.ws.utils.XmlUtils; import it.eng.parer.ws.xml.versReq.ProfiloNormativoType; +@SuppressWarnings("unchecked") @Stateless(mappedName = "ControlliProfiliUd") @LocalBean @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) @@ -126,7 +143,7 @@ public RispostaControlli checkProfiloNormativo(ProfiloNormativoType pfNormType, return rispostaControlli; } - private List checkXsdProfileExistence(long idTiEntita, TipiEntitaSacer tiEntitaSacer, + public List checkXsdProfileExistence(long idTiEntita, TipiEntitaSacer tiEntitaSacer, TiModelloXsdUd tiModelloXsdUd) { // StringBuilder queryStr = new StringBuilder(); @@ -136,7 +153,7 @@ private List checkXsdProfileExistence(long idTiEntita, TipiEntitaSacer tiE queryStr.append("where uso.decTipoUnitaDoc.idTipoUnitaDoc = :idTiEntita "); } else if (tiEntitaSacer.equals(TipiEntitaSacer.DOC)) { queryStr.append("select uso.idUsoModelloXsdDoc " + "from DecUsoModelloXsdDoc uso "); - queryStr.append("where uso.decTipoUnitaDoc.idTipoUnitaDoc = :idTiEntita "); + queryStr.append("where uso.decTipoDoc.idTipoDoc = :idTiEntita "); } else if (tiEntitaSacer.equals(TipiEntitaSacer.COMP) || tiEntitaSacer.equals(TipiEntitaSacer.SUB_COMP)) { queryStr.append("select uso.idUsoModelloXsdCompDoc " + "from DecUsoModelloXsdCompDoc uso "); queryStr.append("where uso.decTipoCompDoc.idTipoCompDoc = :idTiEntita "); @@ -149,7 +166,7 @@ private List checkXsdProfileExistence(long idTiEntita, TipiEntitaSacer tiE + "and uso.dtSoppres > :dataDiOggiIn "); javax.persistence.Query query = entityManager.createQuery(queryStr.toString()); - query.setParameter("idTiEntita", new BigDecimal(idTiEntita)); + query.setParameter("idTiEntita", idTiEntita); query.setParameter("tiModelloXsdUd", tiModelloXsdUd); query.setParameter("tiUsoModelloXsd", TiUsoModelloXsd.VERS.name()); query.setParameter("dataDiOggiIn", new Date()); @@ -159,7 +176,7 @@ private List checkXsdProfileExistence(long idTiEntita, TipiEntitaSacer tiE /* * Nota: restituisce modello+pk uso del modello */ - private Object[] getXsdProfileByVersion(List idUsoModelloXsds, TipiEntitaSacer tiEntitaSacer, + public Object[] getXsdProfileByVersion(List idUsoModelloXsds, TipiEntitaSacer tiEntitaSacer, TiModelloXsdUd tiModelloXsdUd, String version) { Object[] result = null; @@ -170,15 +187,15 @@ private Object[] getXsdProfileByVersion(List idUsoModelloXsds, TipiEntitaS if (tiEntitaSacer.equals(TipiEntitaSacer.UNI_DOC)) { queryStr.append(", uso.idUsoModelloXsdUniDoc "); // pk queryStr.append("from DecUsoModelloXsdUniDoc uso "); - queryStr.append("where uso.idUsoModelloXsdUniDoc in :idUsoModelloXsds "); + queryStr.append("where uso.idUsoModelloXsdUniDoc in (:idUsoModelloXsds) "); } else if (tiEntitaSacer.equals(TipiEntitaSacer.DOC)) { queryStr.append(", uso.idUsoModelloXsdDoc "); // pk queryStr.append("from DecUsoModelloXsdDoc uso "); - queryStr.append("where uso.idUsoModelloXsdDoc in :idUsoModelloXsds "); + queryStr.append("where uso.idUsoModelloXsdDoc in (:idUsoModelloXsds) "); } else if (tiEntitaSacer.equals(TipiEntitaSacer.COMP) || tiEntitaSacer.equals(TipiEntitaSacer.SUB_COMP)) { queryStr.append(", uso.idUsoModelloXsdCompDoc "); // pk queryStr.append("from DecUsoModelloXsdCompDoc uso "); - queryStr.append("where uso.idUsoModelloXsdCompDoc in :idUsoModelloXsds "); + queryStr.append("where uso.idUsoModelloXsdCompDoc in (:idUsoModelloXsds)"); } // queryStr.append("and uso.decModelloXsdUd.tiModelloXsd = :tiModelloXsdUd " diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliRappVers.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliRappVers.java index fbf724b..5fe7b23 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliRappVers.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliRappVers.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,19 +22,23 @@ */ package it.eng.parer.ws.versamento.ejb; -import it.eng.parer.entity.VrsSessioneVers; -import it.eng.parer.entity.VrsXmlDatiSessioneVers; -import it.eng.parer.ws.dto.RispostaControlli; -import it.eng.parer.ws.utils.CostantiDB; import java.util.List; +import java.util.Map; + +import javax.ejb.EJB; import javax.ejb.LocalBean; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import javax.persistence.TypedQuery; + +import it.eng.parer.entity.VrsSessioneVers; +import it.eng.parer.entity.VrsXmlDatiSessioneVers; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.utils.CostantiDB; +import static it.eng.parer.ws.utils.CostantiDB.TiStatoSesioneVers.CHIUSA_OK; /** * @@ -28,23 +49,25 @@ @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) public class ControlliRappVers { - private static final Logger log = LoggerFactory.getLogger(ControlliRappVers.class); @PersistenceContext(unitName = "ParerJPA") private EntityManager entityManager; + @EJB + private ObjectStorageService objectStorageService; + public RispostaControlli trovaVersSessUd(long idUd) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); rispostaControlli.setrBoolean(false); String queryStr = "select t from VrsSessioneVers t " + "where t.aroUnitaDoc.idUnitaDoc = :idUnitaDoc " - + "and t.tiStatoSessioneVers = 'CHIUSA_OK' " + "and t.tiSessioneVers = 'VERSAMENTO' "; + + "and t.tiStatoSessioneVers = '" + CHIUSA_OK + "' " + "and t.tiSessioneVers = 'VERSAMENTO' "; - javax.persistence.Query query = entityManager.createQuery(queryStr); + TypedQuery query = entityManager.createQuery(queryStr, VrsSessioneVers.class); query.setParameter("idUnitaDoc", idUd); List vsv = query.getResultList(); - if (vsv.size() > 0) { + if (!vsv.isEmpty()) { rispostaControlli.setrBoolean(true); rispostaControlli.setrLong(vsv.get(0).getIdSessioneVers()); } @@ -58,31 +81,33 @@ public RispostaControlli trovaVersSessDoc(long idDoc, long idUd) { rispostaControlli.setrBoolean(false); String queryStr = "select t from VrsSessioneVers t " + "where t.aroUnitaDoc.idUnitaDoc = :idUnitaDoc " - + "and t.aroDoc.idDoc = :idDoc " + "and t.tiStatoSessioneVers = 'CHIUSA_OK' " + + "and t.aroDoc.idDoc = :idDoc " + "and t.tiStatoSessioneVers = '" + CHIUSA_OK + "' " + "and t.tiSessioneVers = 'AGGIUNGI_DOCUMENTO' "; - javax.persistence.Query query = entityManager.createQuery(queryStr); + TypedQuery query = entityManager.createQuery(queryStr, VrsSessioneVers.class); query.setParameter("idUnitaDoc", idUd); query.setParameter("idDoc", idDoc); List vsvs = query.getResultList(); - if (vsvs.size() > 0) { + if (!vsvs.isEmpty()) { rispostaControlli.setrBoolean(true); rispostaControlli.setrLong(vsvs.get(0).getIdSessioneVers()); - // restituisco anche il tipo di sessione (versamento o aggiunta) che ha prodotto il doc + // restituisco anche il tipo di sessione (versamento o aggiunta) che ha prodotto + // il doc rispostaControlli.setrString(vsvs.get(0).getTiSessioneVers()); } else { queryStr = "select t from VrsSessioneVers t " + "where t.aroUnitaDoc.idUnitaDoc = :idUnitaDoc " - + "and t.tiStatoSessioneVers = 'CHIUSA_OK' " + "and t.tiSessioneVers = 'VERSAMENTO' "; + + "and t.tiStatoSessioneVers = '" + CHIUSA_OK + "' " + "and t.tiSessioneVers = 'VERSAMENTO' "; - query = entityManager.createQuery(queryStr); + query = entityManager.createQuery(queryStr, VrsSessioneVers.class); query.setParameter("idUnitaDoc", idUd); List vsv = query.getResultList(); - if (vsv.size() > 0) { + if (!vsv.isEmpty()) { rispostaControlli.setrBoolean(true); rispostaControlli.setrLong(vsv.get(0).getIdSessioneVers()); - // restituisco anche il tipo di sessione (versamento o aggiunta) che ha prodotto il doc + // restituisco anche il tipo di sessione (versamento o aggiunta) che ha prodotto + // il doc rispostaControlli.setrString(vsv.get(0).getTiSessioneVers()); } } @@ -90,7 +115,21 @@ public RispostaControlli trovaVersSessDoc(long idDoc, long idUd) { return rispostaControlli; } - public RispostaControlli leggiXmlRappVers(long idSessVers) { + public RispostaControlli leggiXmlRappVersFromUd(long idSessVers, long idUd) { + // 1. find from os + Map xmlVersamentoOs = objectStorageService.getObjectSipUnitaDoc(idUd); + // 2. find from db + return leggiXmlRappVers(idSessVers, xmlVersamentoOs); + } + + public RispostaControlli leggiXmlRappVersFromDoc(long idSessVers, long idDoc) { + // 1. find from os + Map xmlVersamentoOs = objectStorageService.getObjectSipDoc(idDoc); + // 2. find from db + return leggiXmlRappVers(idSessVers, xmlVersamentoOs); + } + + private RispostaControlli leggiXmlRappVers(long idSessVers, Map xmlVersamentoOs) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); rispostaControlli.setrBoolean(false); @@ -99,13 +138,15 @@ public RispostaControlli leggiXmlRappVers(long idSessVers) { + "where xml.vrsDatiSessioneVers.vrsSessioneVers.idSessioneVers = :idSessioneVers " + "and xml.vrsDatiSessioneVers.tiDatiSessioneVers = 'XML_DOC' " + "and xml.tiXmlDati = :tiXmlDati "; - javax.persistence.Query query = entityManager.createQuery(queryStr); + TypedQuery query = entityManager.createQuery(queryStr, VrsXmlDatiSessioneVers.class); query.setParameter("idSessioneVers", idSessVers); query.setParameter("tiXmlDati", CostantiDB.TipiXmlDati.RAPP_VERS); List vxdsv = query.getResultList(); - if (vxdsv.size() > 0) { + if (!xmlVersamentoOs.isEmpty()) { + rispostaControlli.setrString(xmlVersamentoOs.get(CostantiDB.TipiXmlDati.RAPP_VERS)); + } else if (!vxdsv.isEmpty()) { rispostaControlli.setrString(vxdsv.get(0).getBlXml()); } else { rispostaControlli.setrString(null); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliSubStrut.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliSubStrut.java index 8e4689b..6a7a246 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliSubStrut.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ControlliSubStrut.java @@ -1,25 +1,46 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.ejb; -import it.eng.parer.entity.DecAttribDatiSpec; -import it.eng.parer.entity.OrgCampoValSubStrut; -import it.eng.parer.entity.OrgRegolaValSubStrut; -import it.eng.parer.entity.OrgSubStrut; -import it.eng.parer.ws.dto.RispostaControlli; -import it.eng.parer.ws.utils.CostantiDB; -import it.eng.parer.ws.utils.MessaggiWSBundle; -import it.eng.parer.ws.versamento.dto.DatoSpecifico; -import it.eng.parer.ws.versamento.dto.StrutturaVersamento; -import java.util.HashMap; +import static it.eng.parer.util.DateUtilsConverter.convert; + import java.util.List; +import java.util.Map; + import javax.ejb.LocalBean; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static it.eng.parer.util.DateUtilsConverter.convert; + +import it.eng.parer.entity.DecAttribDatiSpec; +import it.eng.parer.entity.OrgCampoValSubStrut; +import it.eng.parer.entity.OrgRegolaValSubStrut; +import it.eng.parer.entity.OrgSubStrut; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.utils.CostantiDB; +import it.eng.parer.ws.utils.MessaggiWSBundle; +import it.eng.parer.ws.versamento.dto.DatoSpecifico; +import it.eng.parer.ws.versamento.dto.StrutturaVersamento; /** * @@ -40,6 +61,7 @@ private enum TipiDatiSpecCalcSubStrut { UNITA_DOC, DOCUMENTO_PRINCIPALE } + @SuppressWarnings("unchecked") public RispostaControlli calcolaSubStrut(StrutturaVersamento strutV) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); @@ -126,13 +148,14 @@ public RispostaControlli calcolaSubStrut(StrutturaVersamento strutV) { return rispostaControlli; } + @SuppressWarnings("unchecked") private RispostaControlli calcolaSubStrutDaDatoSpec(StrutturaVersamento strutV, TipiDatiSpecCalcSubStrut tipiDatiSpecCalcSubStrut, DecAttribDatiSpec dads) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); rispostaControlli.setrBoolean(false); String descElemento = null; - HashMap datiSpecifici = null; + Map datiSpecifici = null; String queryStr; javax.persistence.Query query; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/DocumentoVersVFirmeHash.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/DocumentoVersVFirmeHash.java similarity index 92% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/DocumentoVersVFirmeHash.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/DocumentoVersVFirmeHash.java index b5174a8..60d5e5b 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/DocumentoVersVFirmeHash.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/DocumentoVersVFirmeHash.java @@ -1,33 +1,54 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package it.eng.parer.ws.versamento.utils; +package it.eng.parer.ws.versamento.ejb; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.math.BigDecimal; import java.security.NoSuchAlgorithmException; +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.naming.InitialContext; -import javax.naming.NamingException; +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; import org.apache.commons.lang3.exception.ExceptionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import it.eng.parer.firma.exception.VerificaFirmaException; import it.eng.parer.entity.DecFormatoFileStandard; import it.eng.parer.firma.dto.CompDocMock; import it.eng.parer.firma.dto.StatoComponente; import it.eng.parer.firma.dto.StatoDocumento; import it.eng.parer.firma.ejb.FirmeFormatiVers; -import it.eng.parer.firma.util.VerificaFirmaEnums.EsitoControllo; +import it.eng.parer.firma.exception.VerificaFirmaException; +import it.eng.parer.firma.util.VerificaFirmaEnums.SacerIndication; import it.eng.parer.firma.util.VerificaFirmaWrapperVersamentoUtil; import it.eng.parer.util.ejb.help.ConfigurationHelper; import it.eng.parer.ws.dto.IRispostaWS; @@ -45,95 +66,34 @@ import it.eng.parer.ws.versamento.dto.AbsVersamentoExt; import it.eng.parer.ws.versamento.dto.ComponenteVers; import it.eng.parer.ws.versamento.dto.DocumentoVers; -import it.eng.parer.ws.versamento.ejb.ControlliPerFirme; import it.eng.parer.ws.xml.versResp.ECConfigurazioneType; import it.eng.parer.ws.xml.versResp.ECDocumentoType; import it.eng.parer.ws.xml.versResp.ECEsitoIdonFormatoType; import it.eng.parer.ws.xml.versResp.ECEsitoPosNegWarDisType; import it.eng.parer.ws.xml.versResp.ECEsitoPosNegWarType; -import java.time.Instant; -import java.time.ZoneId; -import java.time.ZonedDateTime; /** * * @author Fioravanti_F */ +@Stateless(mappedName = "DocumentoVersVFirmeHash") +@LocalBean public class DocumentoVersVFirmeHash { private static final Logger log = LoggerFactory.getLogger(DocumentoVersVFirmeHash.class); - private IRispostaWS rispostaWs; // nel costruttore - private AbsVersamentoExt versamento; // nel costruttore - private ECConfigurazioneType esitoConfigurazione; // nel costruttore - private RispostaControlli rispostaControlli; // interno allocare nel costruttore // Stateless ejb per la verifica delle firme - FirmeFormatiVers firmeFormatiEjb; + @EJB + private FirmeFormatiVers firmeFormatiEjb; // stateless ejb per i controlli sul db - ControlliSemantici controlliSemantici = null; - ControlliPerFirme controlliPerFirme = null; - ConfigurationHelper configurationHelper = null; - - public DocumentoVersVFirmeHash(AbsVersamentoExt abstractVersamento, IRispostaWS iRisposta, - ECConfigurazioneType configurazione) { - versamento = abstractVersamento; - rispostaWs = iRisposta; - esitoConfigurazione = configurazione; - - // istanzia la risposta controlli - rispostaControlli = new RispostaControlli(); - - // Recupera l'ejb delle verifiche firma, se possibile - altrimenti segnala - // errore - if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - try { - firmeFormatiEjb = (FirmeFormatiVers) new InitialContext().lookup("java:module/FirmeFormatiVers"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB delle verifiche firma " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB delle verifiche firma ", ex); - } - } - - // recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - try { - controlliSemantici = (ControlliSemantici) new InitialContext().lookup("java:module/ControlliSemantici"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB dei controlli semantici " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli semantici ", ex); - } - } - - // Recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - try { - controlliPerFirme = (ControlliPerFirme) new InitialContext().lookup("java:module/ControlliPerFirme"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB dei controlli per firme " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli per firme ", ex); - } - } - - // Recupera l'ejb per il recupero delle configurazioni applicative - if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - try { - configurationHelper = (ConfigurationHelper) new InitialContext() - .lookup("java:module/ConfigurationHelper"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB ConfigurationHelper " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB ConfigurationHelper ", ex); - } - } - } + @EJB + private ControlliSemantici controlliSemantici; + @EJB + private ControlliPerFirme controlliPerFirme; + @EJB + private ConfigurationHelper configurationHelper; - public boolean verificaDocumentoGenFirma(DocumentoVers documento, long idTipoUd) { + public boolean verificaDocumentoGenFirma(DocumentoVers documento, long idTipoUd, AbsVersamentoExt versamento, + IRispostaWS rispostaWs, ECConfigurazioneType esitoConfigurazione) { ECDocumentoType esitoDoc = documento.getRifDocumentoResp(); esitoDoc.setFirmatoDigitalmente(false); @@ -213,8 +173,9 @@ public boolean verificaDocumentoGenFirma(DocumentoVers documento, long idTipoUd) // posso lanciare la verifica delle firme e marche che mi restituirà una entity // AroCompDoc decorata // con la quale popolo il componente versato - rispostaControlli = this.elabCompDocMockWithVerificaFirmaAndFormatoResult(tmpCV, - sottoComponentiFirma, sottoComponentiMarca, sottoComponentiAltri, idTipoUd); + RispostaControlli rispostaControlli = this.elabCompDocMockWithVerificaFirmaAndFormatoResult(tmpCV, + sottoComponentiFirma, sottoComponentiMarca, sottoComponentiAltri, idTipoUd, versamento, + esitoConfigurazione); if (rispostaControlli.getrLong() == -1) { // se il valore è -1, allora codErr è un codice di errore proseguiElaborazione = false; @@ -253,20 +214,20 @@ public boolean verificaDocumentoGenFirma(DocumentoVers documento, long idTipoUd) // esito verifica firme comp if (statoCompCorrente.compEsitoVerFirmeHasErr) { - tmpCV.withAcdEntity().setTiEsitoVerifFirme(EsitoControllo.NEGATIVO.name()); - tmpCV.withAcdEntity().setDsMsgEsitoVerifFirme(EsitoControllo.NEGATIVO.message()); + tmpCV.withAcdEntity().setTiEsitoVerifFirme(SacerIndication.NEGATIVO.name()); + tmpCV.withAcdEntity().setDsMsgEsitoVerifFirme(SacerIndication.NEGATIVO.message()); tmpCV.getRifComponenteResp().getEsitoComponente() .setVerificaFirmeComponente(ECEsitoPosNegWarType.NEGATIVO); statoDocumento.verFirmeCompCodiceEsitoNeg = true; } else if (statoCompCorrente.compEsitoVerFirmeHasWarn) { - tmpCV.withAcdEntity().setTiEsitoVerifFirme(EsitoControllo.WARNING.name()); - tmpCV.withAcdEntity().setDsMsgEsitoVerifFirme(EsitoControllo.WARNING.message()); + tmpCV.withAcdEntity().setTiEsitoVerifFirme(SacerIndication.WARNING.name()); + tmpCV.withAcdEntity().setDsMsgEsitoVerifFirme(SacerIndication.WARNING.message()); tmpCV.getRifComponenteResp().getEsitoComponente() .setVerificaFirmeComponente(ECEsitoPosNegWarType.WARNING); statoDocumento.verFirmeCompCodiceEsitoWar = true; } else { - tmpCV.withAcdEntity().setTiEsitoVerifFirme(EsitoControllo.POSITIVO.name()); - tmpCV.withAcdEntity().setDsMsgEsitoVerifFirme(EsitoControllo.POSITIVO.message()); + tmpCV.withAcdEntity().setTiEsitoVerifFirme(SacerIndication.POSITIVO.name()); + tmpCV.withAcdEntity().setDsMsgEsitoVerifFirme(SacerIndication.POSITIVO.message()); tmpCV.getRifComponenteResp().getEsitoComponente() .setVerificaFirmeComponente(ECEsitoPosNegWarType.POSITIVO); } @@ -413,7 +374,7 @@ public boolean verificaDocumentoGenFirma(DocumentoVers documento, long idTipoUd) tmpCV.getChiaveComp()); tmpComponenteErr = true; } - if (statoCompCorrente.ctrlFirmeCertificatoScad) { + if (statoCompCorrente.ctrlFirmeCertificatoScadRev) { if (versamento.getStrutturaComponenti().isConfigFlagForzaControlloCertificato() || isForzaAccett && esitoConfigurazione.isAccettaControlloCertificatoScaduto().booleanValue()) { versamento.listErrAddWarningDoc(documento, tmpCV.getChiaveComp(), @@ -578,7 +539,8 @@ public boolean verificaDocumentoGenFirma(DocumentoVers documento, long idTipoUd) // valutare sia i componenti che i sottocomponenti if (proseguiElaborazione) { // MEV#18660 - rispostaControlli = this.verificaFormatiCompDoc(documento, statoDocumento); + RispostaControlli rispostaControlli = this.verificaFormatiCompDoc(documento, statoDocumento, versamento, + esitoConfigurazione); if (rispostaControlli.getrLong() == -1) { // se il valore è -1, allora codErr è un codice di errore 666 proseguiElaborazione = false; @@ -594,16 +556,16 @@ public boolean verificaDocumentoGenFirma(DocumentoVers documento, long idTipoUd) */ if (esitoDoc.isFirmatoDigitalmente().booleanValue()) { if (statoDocumento.verFirmeCompCodiceEsitoNeg) { - documento.setTiEsitoVerifFirme(EsitoControllo.NEGATIVO.name()); - documento.setDsMsgEsitoVerifica(EsitoControllo.NEGATIVO.message()); + documento.setTiEsitoVerifFirme(SacerIndication.NEGATIVO.name()); + documento.setDsMsgEsitoVerifica(SacerIndication.NEGATIVO.message()); esitoDoc.getEsitoDocumento().setVerificaFirmeDocumento(ECEsitoPosNegWarType.NEGATIVO); } else if (statoDocumento.verFirmeCompCodiceEsitoWar) { - documento.setTiEsitoVerifFirme(EsitoControllo.WARNING.name()); - documento.setDsMsgEsitoVerifica(EsitoControllo.WARNING.message()); + documento.setTiEsitoVerifFirme(SacerIndication.WARNING.name()); + documento.setDsMsgEsitoVerifica(SacerIndication.WARNING.message()); esitoDoc.getEsitoDocumento().setVerificaFirmeDocumento(ECEsitoPosNegWarType.WARNING); } else { - documento.setTiEsitoVerifFirme(EsitoControllo.POSITIVO.name()); - documento.setDsMsgEsitoVerifica(EsitoControllo.POSITIVO.message()); + documento.setTiEsitoVerifFirme(SacerIndication.POSITIVO.name()); + documento.setDsMsgEsitoVerifica(SacerIndication.POSITIVO.message()); esitoDoc.getEsitoDocumento().setVerificaFirmeDocumento(ECEsitoPosNegWarType.POSITIVO); } } @@ -627,7 +589,8 @@ public boolean verificaDocumentoGenFirma(DocumentoVers documento, long idTipoUd) } /// - public void verificaDocumentoGenHash(DocumentoVers documento) { + public void verificaDocumentoGenHash(DocumentoVers documento, AbsVersamentoExt versamento, IRispostaWS rispostaWs, + ECConfigurazioneType esitoConfigurazione) { ECDocumentoType esitoDoc = documento.getRifDocumentoResp(); StatoDocumento statoDocumento = new StatoDocumento(); @@ -661,7 +624,7 @@ public void verificaDocumentoGenHash(DocumentoVers documento) { // if (versamento.getStrutturaComponenti().isFlagVerificaHash() && !tmpCV.isHashForzato() && !tmpCV.isHashVersNonDefinito()) { - this.elabAroCompDocHash(tmpCV); + RispostaControlli rispostaControlli = this.elabAroCompDocHash(tmpCV); if (rispostaControlli.getrLong() == -1) { // se il valore è -1, allora codErr è un codice di errore // 666 rispostaWs.setSeverity(SeverityEnum.ERROR); @@ -717,7 +680,8 @@ public void verificaDocumentoGenHash(DocumentoVers documento) { } } - private RispostaControlli verificaFormatiCompDoc(DocumentoVers documento, StatoDocumento statoDoc) { + private RispostaControlli verificaFormatiCompDoc(DocumentoVers documento, StatoDocumento statoDoc, + AbsVersamentoExt versamento, ECConfigurazioneType esitoConfigurazione) { // RispostaControlli rc = new RispostaControlli(); rc.setrLong(0); // se in uscita vale -1, allora il chiamante lo interpreta come eccezione @@ -762,8 +726,8 @@ private RispostaControlli verificaFormatiCompDoc(DocumentoVers documento, StatoD } // verifico per errori - if ((mock.getTiEsitoContrFormatoFile().equals(EsitoControllo.POSITIVO.name()) - || mock.getTiEsitoContrFormatoFile().equals(EsitoControllo.WARNING.name())) + if ((mock.getTiEsitoContrFormatoFile().equals(SacerIndication.POSITIVO.name()) + || mock.getTiEsitoContrFormatoFile().equals(SacerIndication.WARNING.name())) && tmpDecFormatoFileStandard != null/* MEV#18660 */) { // caso positivo o warning tmpIdoneitaStdSbustato = tmpDecFormatoFileStandard.getTiEsitoContrFormato(); @@ -772,7 +736,7 @@ private RispostaControlli verificaFormatiCompDoc(DocumentoVers documento, StatoD tagEsitoRiconoscimentoFormato = ECEsitoPosNegWarDisType.valueOf(mock.getTiEsitoContrFormatoFile()); // imposta anche esitoCompHasWar - if (mock.getTiEsitoContrFormatoFile().equals(EsitoControllo.WARNING.name())) { + if (mock.getTiEsitoContrFormatoFile().equals(SacerIndication.WARNING.name())) { tagEsitoComponente = ECEsitoPosNegWarType.WARNING; statoDoc.docEsitoCompHasWar = true; // propago la condizione di warning del componente versamento.listErrAddWarningDoc(documento, tmpCV.getChiaveComp(), @@ -780,7 +744,7 @@ private RispostaControlli verificaFormatiCompDoc(DocumentoVers documento, StatoD } else { tagEsitoComponente = ECEsitoPosNegWarType.POSITIVO; } - } else if (mock.getTiEsitoContrFormatoFile().equals(EsitoControllo.NEGATIVO.name())) { + } else if (mock.getTiEsitoContrFormatoFile().equals(SacerIndication.NEGATIVO.name())) { // caso negativo if (tmpDecFormatoFileStandard != null/* MEV#18660 */) { tmpIdoneitaStdSbustato = tmpDecFormatoFileStandard.getTiEsitoContrFormato(); @@ -870,7 +834,7 @@ private RispostaControlli verificaFormatiCompDoc(DocumentoVers documento, StatoD tagMessRiconoscimentoFormato); } } - } else if (mock.getTiEsitoContrFormatoFile().equals(EsitoControllo.DISABILITATO.name())) { + } else if (mock.getTiEsitoContrFormatoFile().equals(SacerIndication.DISABILITATO.name())) { // caso disattivato if (tmpDecFormatoFileStandard != null) { tmpIdoneitaStdSbustato = tmpDecFormatoFileStandard.getTiEsitoContrFormato(); @@ -1046,6 +1010,8 @@ private RispostaControlli elabAroCompDocHash(ComponenteVers componente) { // visto che l'ho calcolato, memorizzo l'hash SHA-256, per non doverlo // ricalcolare al salvataggio componente.setHashCalcolato(hr.getHashSha256()); + // OK + rc.setrLong(0); } catch (IOException | NoSuchAlgorithmException e) { rc.setrLong(-1); // se in uscita vale -1, allora il chiamante lo interpreta come eccezione rc.setCodErr(MessaggiWSBundle.ERR_666); @@ -1059,7 +1025,8 @@ private RispostaControlli elabAroCompDocHash(ComponenteVers componente) { private RispostaControlli elabCompDocMockWithVerificaFirmaAndFormatoResult(ComponenteVers componente, List sottoComponentiFirma, List sottoComponentiMarca, - List sottoComponentiAltri, long idTipoUd) { + List sottoComponentiAltri, long idTipoUd, AbsVersamentoExt versamento, + ECConfigurazioneType esitoConfigurazione) { RispostaControlli rs = new RispostaControlli(); rs.setrLong(-1); // se in uscita vale -1, allora il chiamante lo interpreta come eccezione List tmpEmptyComponenteVerses = new ArrayList<>(); @@ -1080,7 +1047,7 @@ private RispostaControlli elabCompDocMockWithVerificaFirmaAndFormatoResult(Compo .getMyComponenteMM(); CompDocMock mock = componente.withAcdEntity(); - mock.setTiEsitoContrFormatoFile(EsitoControllo.DISABILITATO.name()); + mock.setTiEsitoContrFormatoFile(SacerIndication.DISABILITATO.name()); mock.setFlNoCalcFmtVerifFirme("1"); mock.setDsMsgEsitoVerifFirme(null); @@ -1101,10 +1068,10 @@ private RispostaControlli elabCompDocMockWithVerificaFirmaAndFormatoResult(Compo tmpComponente.getForzaFormato().getFormatoRappresentazioneEsteso()); if (rs.isrBoolean()) { - mock.setTiEsitoContrFormatoFile(EsitoControllo.POSITIVO.name()); + mock.setTiEsitoContrFormatoFile(SacerIndication.POSITIVO.name()); mock.setDsMsgEsitoContrFormato("Controllo OK"); } else { - mock.setTiEsitoContrFormatoFile(EsitoControllo.NEGATIVO.name()); + mock.setTiEsitoContrFormatoFile(SacerIndication.NEGATIVO.name()); mock.setDsMsgEsitoContrFormato(rs.getrString()); } } @@ -1124,7 +1091,7 @@ private RispostaControlli elabCompDocMockWithVerificaFirmaAndFormatoResult(Compo if (sottoComponentiFirma.isEmpty() && sottoComponentiMarca.isEmpty() && sottoComponentiAltri.isEmpty()) { CompDocMock mock = componente.withAcdEntity(); - mock.setTiEsitoContrFormatoFile(EsitoControllo.DISABILITATO.name()); + mock.setTiEsitoContrFormatoFile(SacerIndication.DISABILITATO.name()); mock.setFlNoCalcFmtVerifFirme("1"); mock.setDsMsgEsitoVerifFirme(null); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/GestioneDatiSpec.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/GestioneDatiSpec.java similarity index 64% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/GestioneDatiSpec.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/GestioneDatiSpec.java index 33c6967..b42d124 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/GestioneDatiSpec.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/GestioneDatiSpec.java @@ -1,26 +1,29 @@ -package it.eng.parer.ws.versamento.utils; - -/** +/* + * Engineering Ingegneria Informatica S.p.A. * - * @author Fioravanti_F + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . */ -import it.eng.parer.ws.dto.IRispostaWS; -import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; -import it.eng.parer.ws.dto.RispostaControlli; -import it.eng.parer.ws.ejb.ControlliSemantici; -import it.eng.parer.ws.ejb.XmlVersCache; -import it.eng.parer.ws.utils.CostantiDB.TipiEntitaSacer; -import it.eng.parer.ws.utils.CostantiDB.TipiUsoDatiSpec; -import it.eng.parer.ws.utils.MessaggiWSBundle; -import it.eng.parer.ws.utils.XmlValidationEventHandler; -import it.eng.parer.ws.versamento.dto.DatoSpecifico; -import it.eng.parer.ws.versamento.dto.RispostaControlliAttSpec; -import it.eng.parer.ws.xml.versReq.DatiSpecificiType; + +package it.eng.parer.ws.versamento.ejb; + import java.io.StringReader; import java.io.StringWriter; import java.util.Date; -import javax.naming.InitialContext; -import javax.naming.NamingException; + +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; import javax.xml.XMLConstants; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; @@ -29,65 +32,42 @@ import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; -import javax.xml.validation.Validator; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Element; - import org.xml.sax.SAXException; +import it.eng.parer.ws.dto.IRispostaWS; +import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.ejb.ControlliSemantici; +import it.eng.parer.ws.ejb.XmlVersCache; +import it.eng.parer.ws.utils.CostantiDB.TipiEntitaSacer; +import it.eng.parer.ws.utils.CostantiDB.TipiUsoDatiSpec; +import it.eng.parer.ws.utils.MessaggiWSBundle; +import it.eng.parer.ws.utils.XmlValidationEventHandler; +import it.eng.parer.ws.versamento.dto.DatoSpecifico; +import it.eng.parer.ws.versamento.dto.RispostaControlliAttSpec; +import it.eng.parer.ws.xml.versReq.DatiSpecificiType; + +@Stateless(mappedName = "GestioneDatiSpec") +@LocalBean public class GestioneDatiSpec { private static final Logger log = LoggerFactory.getLogger(GestioneDatiSpec.class); - private IRispostaWS rispostaWs; - private RispostaControlli rispostaControlli; - private RispostaControlliAttSpec rispostaControlliAttSpec = null; - private String sistemaMig = null; - private long idOrgStrutt; // stateless ejb per i controlli sul db - ControlliSemantici controlliSemantici = null; + @EJB + ControlliSemantici controlliSemantici; // singleton ejb di gestione cache dei parser Castor - XmlVersCache xmlVersCache = null; + @EJB + XmlVersCache xmlVersCache; // - public final int MAXLEN_DATOSPEC = 4000; - - public IRispostaWS getRispostaWs() { - return rispostaWs; - } - - public RispostaControlliAttSpec getRispostaControlliAttSpec() { - return rispostaControlliAttSpec; - } - - public GestioneDatiSpec(String sistemaDiMigrazione, long idStrut, IRispostaWS risp) { - this.sistemaMig = sistemaDiMigrazione; - this.idOrgStrutt = idStrut; - rispostaWs = risp; - rispostaControlliAttSpec = new RispostaControlliAttSpec(); - - // recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - try { - controlliSemantici = (ControlliSemantici) new InitialContext().lookup("java:module/ControlliSemantici"); - } catch (NamingException ex) { - this.setRispostaError(MessaggiWSBundle.ERR_666, MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "GestioneDatiSpec.init.ControlliSemantici: " + ex.getMessage())); - log.error("Errore nel recupero dell'EJB dei controlli semantici in GestioneDatiSpec ", ex); - } - - // recupera l'ejb singleton, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - try { - xmlVersCache = (XmlVersCache) new InitialContext().lookup("java:module/XmlVersCache"); - } catch (NamingException ex) { - this.setRispostaError(MessaggiWSBundle.ERR_666, MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "GestioneDatiSpec.init.XmlVersCache: " + ex.getMessage())); - log.error("Errore nel recupero dell'EJB singleton XMLContext ", ex); - } - } - } + private static final int MAXLEN_DATOSPEC = 4000; - public void parseDatiSpec(TipiEntitaSacer tipoEntita, JAXBElement datiSpecificiElement, - long idTipoElemento, String desElemento, String desTipoElemento) { + public RispostaControlliAttSpec parseDatiSpec(TipiEntitaSacer tipoEntita, + JAXBElement datiSpecificiElement, long idTipoElemento, String desElemento, + String desTipoElemento, String sistemaMig, long idOrgStrutt, IRispostaWS rispostaWs) { DatiSpecificiType datiSpecifici; DatoSpecifico tmpAttSpecAtteso; SchemaFactory tmpSchemaFactoryValidazSpec = null; @@ -96,21 +76,24 @@ public void parseDatiSpec(TipiEntitaSacer tipoEntita, JAXBElement datiSpecificiElement, - long idTipoElemento, String desElemento, String desTipoElemento) { + public RispostaControlliAttSpec parseDatiSpecMig(TipiEntitaSacer tipoEntita, + JAXBElement datiSpecificiElement, String desElemento, String desTipoElemento, + String sistemaMig, long idOrgStrutt, IRispostaWS rispostaWs) { DatiSpecificiType datiSpecifici; DatoSpecifico tmpAttSpecAtteso; SchemaFactory tmpSchemaFactoryValidazSpec = null; Schema tmpSchemaValidazSpec = null; - Validator tmpValidatorSpec = null; String versione; long tmpIdVersioneXsd; boolean tmpSistMigDef = true; Date tmpIstanteCorrente = new Date(); - rispostaControlliAttSpec = new RispostaControlliAttSpec(); + RispostaControlliAttSpec rispostaControlliAttSpec = new RispostaControlliAttSpec(); // verifica che il sistema migrante sia definito - if (this.sistemaMig == null || this.sistemaMig.isEmpty()) { + if (sistemaMig == null || sistemaMig.isEmpty()) { tmpSistMigDef = false; } if (datiSpecificiElement == null || datiSpecificiElement.isNil()) { if (tmpSistMigDef) { // verifica che esistano dati specifici attesi per sistema migrante + tipoentita alla data corrente - rispostaControlli = controlliSemantici.checkPresenzaDatiSpec(TipiUsoDatiSpec.MIGRAZ, tipoEntita, - this.sistemaMig, this.idOrgStrutt, 0, tmpIstanteCorrente); + RispostaControlli rispostaControlli = controlliSemantici.checkPresenzaDatiSpec(TipiUsoDatiSpec.MIGRAZ, + tipoEntita, sistemaMig, idOrgStrutt, 0, tmpIstanteCorrente); if (rispostaControlli.getCodErr() != null) { - this.setRispostaError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); - return; + this.setRispostaError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr(), rispostaWs, + rispostaControlliAttSpec); + return rispostaControlliAttSpec; } if (rispostaControlli.isrBoolean()) { // errore, perché non ha inserito il tag datispecifici e questo era richiesto - this.setRispostaError(MessaggiWSBundle.DATISPECM_001_002, MessaggiWSBundle.getString( - MessaggiWSBundle.DATISPECM_001_002, tipoEntita.descrivi(), desElemento, desTipoElemento)); - return; + this.setRispostaError(MessaggiWSBundle.DATISPECM_001_002, + MessaggiWSBundle.getString(MessaggiWSBundle.DATISPECM_001_002, tipoEntita.descrivi(), + desElemento, desTipoElemento), + rispostaWs, rispostaControlliAttSpec); + return rispostaControlliAttSpec; } } } else { @@ -302,11 +311,12 @@ public void parseDatiSpecMig(TipiEntitaSacer tipoEntita, JAXBElement + * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.ejb; +import it.eng.parer.entity.*; +import it.eng.parer.entity.builder.*; +import static it.eng.parer.util.DateUtilsConverter.convert; +import static it.eng.parer.util.FlagUtilsConverter.booleanToFlag; + import java.io.IOException; import java.io.StringWriter; import java.math.BigDecimal; import java.security.NoSuchAlgorithmException; +import java.util.HashMap; import java.util.List; +import java.util.Map; import javax.ejb.EJB; import javax.ejb.LocalBean; @@ -14,6 +38,7 @@ import javax.xml.bind.Marshaller; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -24,16 +49,14 @@ import it.eng.parer.entity.OrgStrut; import it.eng.parer.entity.VrsDatiSessioneVers; import it.eng.parer.entity.VrsDocNonVer; -import it.eng.parer.entity.VrsErrSessioneVers; -import it.eng.parer.entity.VrsFileSessione; import it.eng.parer.entity.VrsSessioneVers; import it.eng.parer.entity.VrsUnitaDocNonVer; -import it.eng.parer.entity.VrsUrnXmlSessioneVers; import it.eng.parer.entity.VrsXmlDatiSessioneVers; import it.eng.parer.entity.VrsXmlModelloSessioneVers; import it.eng.parer.entity.constraint.VrsUrnXmlSessioneVers.TiUrnXmlSessioneVers; import it.eng.parer.util.ejb.AppServerInstance; import it.eng.parer.ws.dto.CSChiave; +import it.eng.parer.ws.dto.IRispostaWS; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.ejb.ControlliSemantici; import it.eng.parer.ws.ejb.XmlVersCache; @@ -44,9 +67,11 @@ import it.eng.parer.ws.utils.HashCalculator; import it.eng.parer.ws.utils.MessaggiWSFormat; import it.eng.parer.ws.versamento.dto.AbsVersamentoExt; +import it.eng.parer.ws.versamento.dto.BackendStorage; import it.eng.parer.ws.versamento.dto.DocumentoVers; import it.eng.parer.ws.versamento.dto.FileBinario; import it.eng.parer.ws.versamento.dto.IRispostaVersWS; +import it.eng.parer.ws.versamento.dto.ObjectStorageResource; import it.eng.parer.ws.versamento.dto.RispostaWS; import it.eng.parer.ws.versamento.dto.RispostaWSAggAll; import it.eng.parer.ws.versamento.dto.SyncFakeSessn; @@ -57,36 +82,28 @@ import it.eng.parer.ws.xml.versReq.ChiaveType; import it.eng.parer.ws.xml.versReq.VersatoreType; import it.eng.parer.ws.xml.versResp.ECEsitoGeneraleType; -import java.io.IOException; -import java.io.StringWriter; -import java.math.BigDecimal; -import java.security.NoSuchAlgorithmException; -import java.util.List; -import javax.ejb.EJB; -import javax.ejb.LocalBean; -import javax.ejb.Stateless; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.xml.bind.Marshaller; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.apache.commons.lang3.StringUtils; -import static it.eng.parer.util.DateUtilsConverter.convert; +import org.springframework.util.Assert; +import java.util.Optional; /** * * @author Fioravanti_F */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "LogSessioneSync") @LocalBean public class LogSessioneSync { + private static final String ECCEZIONE_SALVATAGGIO_SESSIONE = "Eccezione nella persistenza dati di sessione richiesta"; @EJB private XmlVersCache xmlVersCache; // @EJB private WriteCompBlbOracle writeCompBlbOracle; - // + + @EJB + private ObjectStorageService objectStorageService; + @EJB private ControlliSemantici controlliSemantici; @EJB @@ -97,12 +114,10 @@ public class LogSessioneSync { @PersistenceContext(unitName = "ParerJPA") private EntityManager entityManager; // - private final static int DS_ERR_MAX_LEN = 1024; - private final static String SESSIONE_CHIUSA_OK = "CHIUSA_OK"; - private final static String SESSIONE_CHIUSA_ERR = "CHIUSA_ERR"; - private final static String TIPO_ERR_FATALE = "FATALE"; - private final static String TIPO_ERR_WARNING = "WARNING"; - private final static String CD_DS_ERR_DIVERSI = "Diversi"; + private static final int DS_ERR_MAX_LEN = 1024; + private static final String TIPO_ERR_FATALE = "FATALE"; + private static final String TIPO_ERR_WARNING = "WARNING"; + private static final String CD_DS_ERR_DIVERSI = "Diversi"; public RispostaControlli salvaSessioneVersamento(VersamentoExt versamento, RispostaWS rispostaWS, SyncFakeSessn sessione) { @@ -112,8 +127,6 @@ public RispostaControlli salvaSessioneVersamento(VersamentoExt versamento, Rispo ChiaveType tmpChiave = null; RispostaControlli tmpControlli = new RispostaControlli(); String tmpXmlEsito = null; - String tmpVersioneXmlVers = null; - String tmpVersioneXmlEsito = null; if (versamento.getVersamento() != null) { tmpVersatore = versamento.getVersamento().getIntestazione().getVersatore(); @@ -127,25 +140,29 @@ public RispostaControlli salvaSessioneVersamento(VersamentoExt versamento, Rispo tmpXmlEsito = tmpStringWriter.toString(); } catch (Exception ex) { tmpControlli.setCodErr("ERR"); - tmpControlli.setDsErr("Errore interno nella fase salvataggio sessione: " + ex.getMessage()); - log.error("Errore interno nella fase salvataggio sessione: ", ex); + tmpControlli.setDsErr("Errore interno nella fase salvataggio sessione (marshalling esito versamento): " + + ExceptionUtils.getRootCause(ex)); + log.error("Errore interno nella fase salvataggio sessione (marshalling esito versamento): ", ex); tmpReturn = false; } if (tmpReturn) { try { - tmpVersioneXmlVers = rispostaWS.getIstanzaEsito().getVersioneXMLChiamata(); - tmpVersioneXmlEsito = rispostaWS.getIstanzaEsito().getVersione(); - if (!salvaSessione(versamento, rispostaWS, sessione, rispostaWS.getIstanzaEsito().getEsitoGenerale(), - tmpVersatore, tmpChiave, tmpXmlEsito, tmpVersioneXmlVers, tmpVersioneXmlEsito, null)) { + String tmpVersioneXmlVers = rispostaWS.getIstanzaEsito().getVersioneXMLChiamata(); + String tmpVersioneXmlEsito = rispostaWS.getIstanzaEsito().getVersione(); + if (!salvaVrsSessioneVers(versamento, rispostaWS, sessione, + rispostaWS.getIstanzaEsito().getEsitoGenerale(), tmpVersatore, tmpChiave, tmpXmlEsito, + tmpVersioneXmlVers, tmpVersioneXmlEsito, null)) { tmpControlli.setCodErr("ERR"); - tmpControlli.setDsErr("Eccezione nella persistenza della sessione "); + tmpControlli.setDsErr("Eccezione generica nella persistenza della sessione"); } } catch (Exception e) { tmpControlli.setCodErr("ERR"); - tmpControlli.setDsErr("Errore interno nella fase salvataggio sessione: " + e.getMessage()); - log.error("Errore interno nella fase salvataggio sessione: ", e); + tmpControlli + .setDsErr("Errore generico nella fase salvataggio sessione: " + ExceptionUtils.getRootCause(e)); + log.error("Errore generico nella fase salvataggio sessione: ", e); } finally { + entityManager.flush(); entityManager.clear(); } } @@ -161,8 +178,6 @@ public RispostaControlli salvaSessioneVersamento(VersamentoExtAggAll versamento, ChiaveType tmpChiave = null; RispostaControlli tmpControlli = new RispostaControlli(); String tmpXmlEsito = null; - String tmpVersioneXmlVers = null; - String tmpVersioneXmlEsito = null; DocumentoVers tmpDocumentoVers = null; if (versamento.getVersamento() != null) { @@ -175,7 +190,7 @@ public RispostaControlli salvaSessioneVersamento(VersamentoExtAggAll versamento, * ricostruito abbastanza informazioni da recuperare i metadati del doc da versare... */ if (versamento.getStrutturaComponenti() != null - && versamento.getStrutturaComponenti().getDocumentiAttesi().size() > 0) { + && !versamento.getStrutturaComponenti().getDocumentiAttesi().isEmpty()) { tmpDocumentoVers = versamento.getStrutturaComponenti().getDocumentiAttesi().get(0); } @@ -185,26 +200,32 @@ public RispostaControlli salvaSessioneVersamento(VersamentoExtAggAll versamento, tmpXmlEsito = tmpStringWriter.toString(); } catch (Exception ex) { tmpControlli.setCodErr("ERR"); - tmpControlli.setDsErr("Errore interno nella fase salvataggio sessione: " + ex.getMessage()); - log.error("Errore interno nella fase salvataggio sessione: ", ex); + tmpControlli.setDsErr( + "Errore interno nella fase salvataggio sessione (marshalling esito versamento aggiunta documento): " + + ex.getMessage()); + log.error( + "Errore interno nella fase salvataggio sessione (marshalling esito versamento aggiunta documento): ", + ex); tmpReturn = false; } if (tmpReturn) { try { - tmpVersioneXmlVers = rispostaWS.getIstanzaEsito().getVersioneXMLChiamata(); - tmpVersioneXmlEsito = rispostaWS.getIstanzaEsito().getVersione(); - if (!salvaSessione(versamento, rispostaWS, sessione, rispostaWS.getIstanzaEsito().getEsitoGenerale(), - tmpVersatore, tmpChiave, tmpXmlEsito, tmpVersioneXmlVers, tmpVersioneXmlEsito, - tmpDocumentoVers)) { + String tmpVersioneXmlVers = rispostaWS.getIstanzaEsito().getVersioneXMLChiamata(); + String tmpVersioneXmlEsito = rispostaWS.getIstanzaEsito().getVersione(); + if (!salvaVrsSessioneVers(versamento, rispostaWS, sessione, + rispostaWS.getIstanzaEsito().getEsitoGenerale(), tmpVersatore, tmpChiave, tmpXmlEsito, + tmpVersioneXmlVers, tmpVersioneXmlEsito, tmpDocumentoVers)) { tmpControlli.setCodErr("ERR"); - tmpControlli.setDsErr("Eccezione nella persistenza della sessione "); + tmpControlli.setDsErr("Eccezione generica nella persistenza della sessione "); } } catch (Exception e) { tmpControlli.setCodErr("ERR"); - tmpControlli.setDsErr("Errore interno nella fase salvataggio sessione: " + e.getMessage()); - log.error("Errore interno nella fase salvataggio sessione: ", e); + tmpControlli.setDsErr("Errore generico interno nella fase salvataggio sessione: " + + ExceptionUtils.getRootCauseMessage(e)); + log.error("Errore generico interno nella fase salvataggio sessione: ", e); } finally { + entityManager.flush(); entityManager.clear(); } } @@ -212,17 +233,14 @@ public RispostaControlli salvaSessioneVersamento(VersamentoExtAggAll versamento, return tmpControlli; } - private boolean salvaSessione(AbsVersamentoExt versamento, IRispostaVersWS rispostaWS, SyncFakeSessn sessione, - ECEsitoGeneraleType esitoGen, VersatoreType versatore, ChiaveType chiave, String xmlEsito, - String versioneXmlChiamata, String versioneXmlEsito, DocumentoVers documentoVersIn) + private boolean salvaVrsSessioneVers(AbsVersamentoExt versamento, IRispostaVersWS rispostaWS, + SyncFakeSessn sessione, ECEsitoGeneraleType esitoGen, VersatoreType versatore, ChiaveType chiave, + String xmlEsito, String versioneXmlChiamata, String versioneXmlEsito, DocumentoVers documentoVersIn) throws NoSuchAlgorithmException, IOException { boolean tmpReturn = true; - VrsSessioneVers tmpSessioneVer = new VrsSessioneVers(); - VrsDatiSessioneVers tmpDatiSessioneVers = new VrsDatiSessioneVers(); - VrsXmlDatiSessioneVers tmpXmlDatiSessioneVers = null; - - VrsErrSessioneVers tmpErrSessioneVers; - VrsFileSessione tmpFileSessione; + Map sipBlob = new HashMap<>(); + Optional vrsSessioneVersKo = Optional.empty(); + Optional vrsSessioneVers = Optional.empty(); // calcola l'hash dell'esito del versamento. // lo calcolo in questo punto perchè non può più cambiare e in caso di errori da @@ -234,32 +252,31 @@ private boolean salvaSessione(AbsVersamentoExt versamento, IRispostaVersWS rispo * salvo sessione */ // questi dati li scrivo sempre - tmpSessioneVer.setCdVersioneWs(sessione.getVersioneWS()); - tmpSessioneVer.setDtApertura(convert(sessione.getTmApertura())); - tmpSessioneVer.setDtChiusura(convert(sessione.getTmChiusura())); - tmpSessioneVer.setTsApertura(convert(sessione.getTmApertura())); - tmpSessioneVer.setTsChiusura(convert(sessione.getTmChiusura())); - tmpSessioneVer.setTiSessioneVers(sessione.getTipoSessioneVers().name()); // VERSAMENTO o AGGIUNTA - tmpSessioneVer.setNmUseridWs(sessione.getLoginName()); - // salvo il nome del server/istanza nel cluster che sta salvando i dati e ha - // gestito il versamento - tmpSessioneVer.setCdIndServer(appServerInstance.getName()); - // salvo l'indirizzo IP del sistema che ha effettuato la richiesta di - // versamento/aggiunta - tmpSessioneVer.setCdIndIpClient(sessione.getIpChiamante()); - + VrsSessioneVersBuilder vrsSessioneVersBuilder = VrsSessioneVersBuilder.builder() + .cdVersioneWs(sessione.getVersioneWS()).dtApertura(convert(sessione.getTmApertura())) + .dtChiusura(convert(sessione.getTmChiusura())).tsApertura(convert(sessione.getTmApertura())) + .tsChiusura(convert(sessione.getTmChiusura())).tiSessioneVers(sessione.getTipoSessioneVers().name()) // VERSAMENTO + // o + // AGGIUNTA + .nmUseridWs(sessione.getLoginName()) + // salvo il nome del server/istanza nel cluster che sta salvando i dati e ha + // gestito il versamento + .cdIndServer(appServerInstance.getName()) + // salvo l'indirizzo IP del sistema che ha effettuato la richiesta di + // versamento/aggiunta + .cdIndIpClient(sessione.getIpChiamante()); // questi dati li scrivo se l'XML ha superato il controllo formale e quindi sono // definiti i tag Versatore e // Chiave if (versatore != null && chiave != null) { - tmpSessioneVer.setAaKeyUnitaDoc(new BigDecimal(chiave.getAnno())); - tmpSessioneVer.setCdKeyUnitaDoc(chiave.getNumero()); - tmpSessioneVer.setCdRegistroKeyUnitaDoc(chiave.getTipoRegistro()); - tmpSessioneVer.setNmAmbiente(versatore.getAmbiente()); - tmpSessioneVer.setNmEnte(versatore.getEnte()); - tmpSessioneVer.setNmStrut(versatore.getStruttura()); - tmpSessioneVer.setNmUserid(versatore.getUserID()); // questo è l'utente definito nell'xml - tmpSessioneVer.setNmUtente(versatore.getUtente()); // questo è l'utente definito nell'xml + vrsSessioneVersBuilder.aaKeyUnitaDoc(new BigDecimal(chiave.getAnno())).cdKeyUnitaDoc(chiave.getNumero()) + .cdRegistroKeyUnitaDoc(chiave.getTipoRegistro()).nmAmbiente(versatore.getAmbiente()) + .nmEnte(versatore.getEnte()).nmStrut(versatore.getStruttura()).nmUserid(versatore.getUserID()) // questo + // è + // l'utente + // definito + // nell'xml + .nmUtente(versatore.getUtente()); // questo è l'utente definito nell'xml } /* @@ -267,71 +284,70 @@ private boolean salvaSessione(AbsVersamentoExt versamento, IRispostaVersWS rispo * ricostruito abbastanza informazioni da recuperare i metadati del doc da versare... */ if (documentoVersIn != null) { - tmpSessioneVer.setCdKeyDocVers(documentoVersIn.getRifDocumento().getIDDocumento()); + vrsSessioneVersBuilder.cdKeyDocVers(documentoVersIn.getRifDocumento().getIDDocumento()); /* * ...inoltre se è definito l'id del record versato e non ci sono errori precedenti, vuol dire che sono * riuscito ad effettuare il versamento e che devo salvare il riferimento al doc versato nella sessione */ - if (rispostaWS.getSeverity() != RispostaWS.SeverityEnum.ERROR) { - tmpSessioneVer.setAroDoc(entityManager.find(AroDoc.class, documentoVersIn.getIdRecDocumentoDB())); + if (isOkOrWarningResponse(rispostaWS)) { + vrsSessioneVersBuilder.aroDoc(entityManager.find(AroDoc.class, documentoVersIn.getIdRecDocumentoDB())); } } // se ho trovato il codice dell'utente definito nell'XML, lo scrivo if (versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti().getIdUser() != 0) { - tmpSessioneVer - .setIamUser(entityManager.find(IamUser.class, versamento.getStrutturaComponenti().getIdUser())); + vrsSessioneVersBuilder + .iamUser(entityManager.find(IamUser.class, versamento.getStrutturaComponenti().getIdUser())); } // se ho trovato il codice della struttura versante, lo scrivo if (versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti().getIdStruttura() != 0) { - tmpSessioneVer.setOrgStrut( - entityManager.find(OrgStrut.class, versamento.getStrutturaComponenti().getIdStruttura())); + vrsSessioneVersBuilder + .orgStrut(entityManager.find(OrgStrut.class, versamento.getStrutturaComponenti().getIdStruttura())); } // se c'è un ID per l'unità documentaria creata o aggiornata, lo scrivo if (versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti().getIdUnitaDoc() != 0) { - tmpSessioneVer.setAroUnitaDoc( + vrsSessioneVersBuilder.aroUnitaDoc( entityManager.find(AroUnitaDoc.class, versamento.getStrutturaComponenti().getIdUnitaDoc())); } - // questi dati li scrivo se il WS è andato, nel complesso, bene. - if (rispostaWS.getSeverity() != RispostaWS.SeverityEnum.ERROR) { - tmpSessioneVer.setTiStatoSessioneVers(SESSIONE_CHIUSA_OK); - } else { - tmpSessioneVer.setTiStatoSessioneVers(SESSIONE_CHIUSA_ERR); - tmpSessioneVer.setFlSessioneErrVerif("0"); // se è andata in errore, pongo a FALSE il flag di sessione - // verificata dall'operatore - // integro i dati relativi all'errore principale - String tmpErrMess; - if (esitoGen.getMessaggioErrore().isEmpty()) { - tmpErrMess = "(vuoto)"; + try { + if (isOkOrWarningResponse(rispostaWS)) { + // CHIUSA_OK + vrsSessioneVers = Optional.of(vrsSessioneVersBuilder.buildVrsSessioneVers()); + entityManager.persist(vrsSessioneVers.get()); } else { - tmpErrMess = esitoGen.getMessaggioErrore(); - if (tmpErrMess.length() > DS_ERR_MAX_LEN) { - tmpErrMess = tmpErrMess.substring(0, DS_ERR_MAX_LEN); + // CHIUSA_ERR + vrsSessioneVersBuilder.flSessioneErrVerif("0"); // se è andata in errore, pongo a FALSE il flag di + // sessione + // verificata dall'operatore + // integro i dati relativi all'errore principale + String tmpErrMess; + if (esitoGen.getMessaggioErrore().isEmpty()) { + tmpErrMess = "(vuoto)"; + } else { + tmpErrMess = esitoGen.getMessaggioErrore(); + if (tmpErrMess.length() > DS_ERR_MAX_LEN) { + tmpErrMess = tmpErrMess.substring(0, DS_ERR_MAX_LEN); + } } + vrsSessioneVersBuilder.dsErrPrinc(tmpErrMess).cdErrPrinc(esitoGen.getCodiceErrore()); + vrsSessioneVersKo = Optional.of(vrsSessioneVersBuilder.buildVrsSessioneVersKo()); + entityManager.persist(vrsSessioneVersKo.get()); } - tmpSessioneVer.setDsErrPrinc(tmpErrMess); - tmpSessioneVer.setCdErrPrinc(esitoGen.getCodiceErrore()); - } - - try { - entityManager.persist(tmpSessioneVer); - entityManager.flush(); } catch (RuntimeException re) { - /// logga l'errore e blocca tutto - log.error("Eccezione nella persistenza della sessione ", re); + log.error("Eccezione in fase di salvataggio della sessione di versamento", re); tmpReturn = false; } /* - * Salvo i dati relativi all'Unità documentaria o al documento non versato, nel caso il versamento sia andato - * male, ma siano comunque identificabili gli estremi di ciò che si voleva scrivere. In caso di errore per - * elemento duplicato, non deve essere scritto nulla. + * IN CASO DI ERRORE Salvo i dati relativi all'Unità documentaria o al documento non versato, nel caso il + * versamento sia andato male, ma siano comunque identificabili gli estremi di ciò che si voleva scrivere. In + * caso di errore per elemento duplicato, non deve essere scritto nulla. */ - if (tmpReturn && rispostaWS.getSeverity() == RispostaWS.SeverityEnum.ERROR - && (!rispostaWS.isErroreElementoDoppio()) && versamento.getStrutturaComponenti() != null + if (tmpReturn && isErrorResponse(rispostaWS) && !rispostaWS.isErroreElementoDoppio() + && versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti().getIdStruttura() != 0) { CSChiave tmpCSChiave = new CSChiave(); @@ -339,21 +355,12 @@ private boolean salvaSessione(AbsVersamentoExt versamento, IRispostaVersWS rispo tmpCSChiave.setNumero(chiave.getNumero()); tmpCSChiave.setTipoRegistro(chiave.getTipoRegistro()); - String queryStr; - javax.persistence.Query query; - if (sessione.getTipoSessioneVers() == SyncFakeSessn.TipiSessioneVersamento.VERSAMENTO && this .udNonVersataNonPresente(tmpCSChiave, versamento.getStrutturaComponenti().getIdStruttura())) { - queryStr = "select al from VrsUnitaDocNonVer al " + "where al.orgStrut.idStrut = :idStrutIn " - + "and al.aaKeyUnitaDoc = :aaKeyUnitaDocIn " + "and al.cdKeyUnitaDoc = :cdKeyUnitaDocIn " - + "and al.cdRegistroKeyUnitaDoc = :cdRegistroKeyUnitaDocIn "; - query = entityManager.createQuery(queryStr); - query.setParameter("idStrutIn", new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); - query.setParameter("cdRegistroKeyUnitaDocIn", tmpCSChiave.getTipoRegistro()); - query.setParameter("aaKeyUnitaDocIn", new BigDecimal(tmpCSChiave.getAnno())); - query.setParameter("cdKeyUnitaDocIn", tmpCSChiave.getNumero()); + List udnvs = getVrsUnitaDocNonVers( + versamento.getStrutturaComponenti().getIdStruttura(), tmpCSChiave.getTipoRegistro(), + new BigDecimal(tmpCSChiave.getAnno()), tmpCSChiave.getNumero()); try { - List udnvs = (List) query.getResultList(); if (udnvs.isEmpty()) { VrsUnitaDocNonVer tmpUnitaDocNonVer = new VrsUnitaDocNonVer(); tmpUnitaDocNonVer.setAaKeyUnitaDoc(new BigDecimal(tmpCSChiave.getAnno())); @@ -366,7 +373,6 @@ private boolean salvaSessione(AbsVersamentoExt versamento, IRispostaVersWS rispo tmpUnitaDocNonVer.setOrgStrut(entityManager.find(OrgStrut.class, versamento.getStrutturaComponenti().getIdStruttura())); entityManager.persist(tmpUnitaDocNonVer); - entityManager.flush(); } else { VrsUnitaDocNonVer tmpUnitaDocNonVer = udnvs.get(0); tmpUnitaDocNonVer.setDtLastSesErr(convert(sessione.getTmApertura())); @@ -376,29 +382,19 @@ private boolean salvaSessione(AbsVersamentoExt versamento, IRispostaVersWS rispo if (!tmpUnitaDocNonVer.getCdErrPrinc().equals(esitoGen.getCodiceErrore())) { tmpUnitaDocNonVer.setCdErrPrinc(CD_DS_ERR_DIVERSI); } - entityManager.flush(); } } catch (RuntimeException re) { - /// logga l'errore e blocca tutto log.error("Eccezione nella persistenza dell'unità documentaria NON versata ", re); tmpReturn = false; } - } else if (sessione.getTipoSessioneVers() == SyncFakeSessn.TipiSessioneVersamento.AGGIUNGI_DOCUMENTO + } else if (SyncFakeSessn.TipiSessioneVersamento.AGGIUNGI_DOCUMENTO.equals(sessione.getTipoSessioneVers()) && documentoVersIn != null && this.docNonVersatoNonPresente(tmpCSChiave, versamento.getStrutturaComponenti().getIdStruttura(), documentoVersIn.getRifDocumento().getIDDocumento())) { - queryStr = "select al from VrsDocNonVer al " + "where al.orgStrut.idStrut = :idStrutIn " - + "and al.aaKeyUnitaDoc = :aaKeyUnitaDocIn " + "and al.cdKeyUnitaDoc = :cdKeyUnitaDocIn " - + "and al.cdRegistroKeyUnitaDoc = :cdRegistroKeyUnitaDocIn " - + "and al.cdKeyDocVers = :cdKeyDocVersIn"; - query = entityManager.createQuery(queryStr); - query.setParameter("idStrutIn", new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); - query.setParameter("cdRegistroKeyUnitaDocIn", tmpCSChiave.getTipoRegistro()); - query.setParameter("aaKeyUnitaDocIn", new BigDecimal(tmpCSChiave.getAnno())); - query.setParameter("cdKeyUnitaDocIn", tmpCSChiave.getNumero()); - query.setParameter("cdKeyDocVersIn", documentoVersIn.getRifDocumento().getIDDocumento()); + List udnvs = getVrsDocNonVers(versamento.getStrutturaComponenti().getIdStruttura(), + tmpCSChiave.getTipoRegistro(), new BigDecimal(tmpCSChiave.getAnno()), tmpCSChiave.getNumero(), + documentoVersIn.getRifDocumento().getIDDocumento()); try { - List udnvs = (List) query.getResultList(); if (udnvs.isEmpty()) { VrsDocNonVer tmpDocNonVer = new VrsDocNonVer(); tmpDocNonVer.setAaKeyUnitaDoc(new BigDecimal(tmpCSChiave.getAnno())); @@ -412,7 +408,6 @@ private boolean salvaSessione(AbsVersamentoExt versamento, IRispostaVersWS rispo tmpDocNonVer.setOrgStrut(entityManager.find(OrgStrut.class, versamento.getStrutturaComponenti().getIdStruttura())); entityManager.persist(tmpDocNonVer); - entityManager.flush(); } else { VrsDocNonVer tmpDocNonVer = udnvs.get(0); tmpDocNonVer.setDtLastSesErr(convert(sessione.getTmApertura())); @@ -422,331 +417,145 @@ private boolean salvaSessione(AbsVersamentoExt versamento, IRispostaVersWS rispo if (!tmpDocNonVer.getCdErrPrinc().equals(esitoGen.getCodiceErrore())) { tmpDocNonVer.setCdErrPrinc(CD_DS_ERR_DIVERSI); } - entityManager.flush(); } } catch (RuntimeException re) { - /// logga l'errore e blocca tutto log.error("Eccezione nella persistenza del documento NON versato ", re); tmpReturn = false; } } - } + } // fine gestione documenti non versati / non aggiunti /* * salva i dati di sessione */ + Optional vrsDatiSessioneVers = Optional.empty(); + Optional vrsDatiSessioneVersKo = Optional.empty(); if (tmpReturn) { - tmpDatiSessioneVers.setVrsSessioneVers(tmpSessioneVer); - tmpDatiSessioneVers.setTiDatiSessioneVers(sessione.getTipoDatiSessioneVers()); - tmpDatiSessioneVers.setPgDatiSessioneVers(new BigDecimal(1)); - - /* - * scrivo il numero di file arrivati in ogni caso, non è necessaria la compatibilità con la versione - * asincrona dal momento che il versamento asincrono è gestito con un applicativo esterno. Inoltre è stato - * espressamente richiesto che i file delle sessioni errate siano sempre salvati - */ - tmpDatiSessioneVers.setNiFile(new BigDecimal(sessione.getFileBinari().size())); + VrsDatiSessioneVersBuilder vrsDatiSessioneVersBuilder = VrsDatiSessioneVersBuilder.builder() + .vrsSessioneVers(vrsSessioneVers).vrsSessioneVersKo(vrsSessioneVersKo) + .tiDatiSessioneVers(sessione.getTipoDatiSessioneVers()).pgDatiSessioneVers(BigDecimal.ONE) + /* + * scrivo il numero di file arrivati in ogni caso, non è necessaria la compatibilità con la versione + * asincrona dal momento che il versamento asincrono è gestito con un applicativo esterno. Inoltre è + * stato espressamente richiesto che i file delle sessioni errate siano sempre salvati + */ + .niFile(new BigDecimal(sessione.getFileBinari().size())); // se ho trovato il codice della struttura versante, lo scrivo if (versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti().getIdStruttura() != 0) { - tmpDatiSessioneVers.setIdStrut(new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); - } - try { - entityManager.persist(tmpDatiSessioneVers); - entityManager.flush(); - } catch (RuntimeException re) { - /// logga l'errore e blocca tutto - log.error("Eccezione nella persistenza della sessione ", re); - tmpReturn = false; + vrsDatiSessioneVersBuilder + .idStrut(new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); } - } - /* - * salva i dati xml di versamento - */ - if (tmpReturn) { - tmpXmlDatiSessioneVers = new VrsXmlDatiSessioneVers(); - tmpXmlDatiSessioneVers.setVrsDatiSessioneVers(tmpDatiSessioneVers); - tmpXmlDatiSessioneVers.setTiXmlDati(TipiXmlDati.RICHIESTA); - // se ho trovato il codice della struttura versante, lo scrivo - if (versamento.getStrutturaComponenti() != null - && versamento.getStrutturaComponenti().getIdStruttura() != 0) { - tmpXmlDatiSessioneVers.setIdStrut(new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); - } - tmpXmlDatiSessioneVers.setFlCanonicalized(CostantiDB.Flag.TRUE); - tmpXmlDatiSessioneVers.setBlXml( - sessione.getDatiDaSalvareIndiceSip().length() == 0 ? "--" : sessione.getDatiDaSalvareIndiceSip()); - tmpXmlDatiSessioneVers.setCdVersioneXml(versioneXmlChiamata); - if (sessione.getUrnIndiceSipXml() != null) { - tmpXmlDatiSessioneVers.setDsUrnXmlVers(sessione.getUrnIndiceSipXml()); - tmpXmlDatiSessioneVers.setDsHashXmlVers(sessione.getHashIndiceSipXml()); - tmpXmlDatiSessioneVers.setCdEncodingHashXmlVers(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()); - // tmpXmlDatiSessioneVers.setDsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_1.descrivi()); - tmpXmlDatiSessioneVers.setDsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_256.descrivi()); - } try { - entityManager.persist(tmpXmlDatiSessioneVers); - entityManager.flush(); + if (isOkOrWarningResponse(rispostaWS)) { + vrsDatiSessioneVers = Optional.of(vrsDatiSessioneVersBuilder.buildVrsDatiSessioneVers()); + entityManager.persist(vrsDatiSessioneVers.get()); + } else { + vrsDatiSessioneVersKo = Optional.of(vrsDatiSessioneVersBuilder.buildVrsDatiSessioneVersKo()); + entityManager.persist(vrsDatiSessioneVersKo.get()); + } } catch (RuntimeException re) { - /// logga l'errore e blocca tutto - log.error("Eccezione nella persistenza della sessione ", re); + log.error("Eccezione nella persistenza di VrsDatiSessioneVers*", re); tmpReturn = false; } } /* - * calcolo URN + * BACKEND_SIP: se OS effettua salvataggio su bucket (TipiXmlDati.RICHIESTA + TipiXmlDati.RISPOSTA + + * TipiXmlDati.INDICE_FILE + TipiXmlDati.RAPP_VERS) + * + * Nota: in caso di sessione fallita tutti i dati utilizzeranno il backend di tipo "staging" */ - // EVO#16486 - String tmpUrn = null; - String tmpUrnNorm = null; - if (versamento.getStrutturaComponenti() != null - && sessione.getTipoSessioneVers() == SyncFakeSessn.TipiSessioneVersamento.VERSAMENTO) { - // calcolo parte urn ORIGINALE - if (StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartVersatore()) - && StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartChiaveUd())) { - // - tmpUrn = MessaggiWSFormat.formattaBaseUrnUnitaDoc( - versamento.getStrutturaComponenti().getUrnPartVersatore(), - versamento.getStrutturaComponenti().getUrnPartChiaveUd()); - } - // calcolo parte urn NORMALIZZATO - if (StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartVersatoreNormalized()) - && StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartChiaveUdNormalized())) { - // - tmpUrnNorm = MessaggiWSFormat.formattaBaseUrnUnitaDoc( - versamento.getStrutturaComponenti().getUrnPartVersatoreNormalized(), - versamento.getStrutturaComponenti().getUrnPartChiaveUdNormalized()); - } - } else if (documentoVersIn != null - && sessione.getTipoSessioneVers() == SyncFakeSessn.TipiSessioneVersamento.AGGIUNGI_DOCUMENTO) { - // calcolo parte urn ORIGINALE - String tmpUrnPartDoc = null; - // DOCXXXXXX - if (documentoVersIn.getNiOrdDoc() != 0) { - tmpUrnPartDoc = MessaggiWSFormat.formattaUrnPartDocumento(Costanti.CategoriaDocumento.Documento, - documentoVersIn.getNiOrdDoc(), true, Costanti.UrnFormatter.DOC_FMT_STRING_V2, - Costanti.UrnFormatter.PAD5DIGITS_FMT); - } - - if (StringUtils.isNotBlank(tmpUrnPartDoc) - && StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartVersatore()) - && StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartChiaveUd())) { - // - tmpUrn = MessaggiWSFormat.formattaBaseUrnDoc(versamento.getStrutturaComponenti().getUrnPartVersatore(), - versamento.getStrutturaComponenti().getUrnPartChiaveUd(), tmpUrnPartDoc, - Costanti.UrnFormatter.URN_DOC_FMT_STRING_V2); - } - - // calcolo urn NORMALIZZATO - if (StringUtils.isNotBlank(tmpUrnPartDoc) - && StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartVersatoreNormalized()) - && StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartChiaveUdNormalized())) { - // - tmpUrnNorm = MessaggiWSFormat.formattaBaseUrnDoc( - versamento.getStrutturaComponenti().getUrnPartVersatoreNormalized(), - versamento.getStrutturaComponenti().getUrnPartChiaveUdNormalized(), tmpUrnPartDoc, - Costanti.UrnFormatter.URN_DOC_FMT_STRING_V2); + BackendStorage backendMetadata = null; + if (tmpReturn) { + /* sessione OK */ + if (isOkOrWarningResponse(rispostaWS)) { + backendMetadata = objectStorageService.lookupBackendByServiceName( + versamento.getStrutturaComponenti().getIdTipologiaUnitaDocumentaria(), + versamento.getDescrizione().getNomeWs()); + } else /* sessione KO */ { + backendMetadata = objectStorageService.lookupBackendVrsStaging(); } } - // end EVO#16486 /* - * salva i dati dei nuovi URN su VrsUrnXmlSessioneVers + * salva i dati xml di versamento */ if (tmpReturn) { - if (tmpUrn != null) { - // salvo ORIGINALE - tmpReturn = this.salvaUrnXmlSessioneVers(tmpXmlDatiSessioneVers, - MessaggiWSFormat.formattaUrnIndiceSip(tmpUrn, Costanti.UrnFormatter.URN_INDICE_SIP_V2), - TiUrnXmlSessioneVers.ORIGINALE); - } - if (tmpUrnNorm != null) { - // salvo NORMALIZZATO - tmpReturn = this.salvaUrnXmlSessioneVers(tmpXmlDatiSessioneVers, - MessaggiWSFormat.formattaUrnIndiceSip(tmpUrnNorm, Costanti.UrnFormatter.URN_INDICE_SIP_V2), - TiUrnXmlSessioneVers.NORMALIZZATO); - } - if (tmpXmlDatiSessioneVers.getDsUrnXmlVers() != null) { - // salvo INIZIALE - tmpReturn = this.salvaUrnXmlSessioneVers(tmpXmlDatiSessioneVers, - tmpXmlDatiSessioneVers.getDsUrnXmlVers(), TiUrnXmlSessioneVers.INIZIALE); - } + final String blobRichiesta = sessione.getDatiDaSalvareIndiceSip().length() == 0 ? "--" + : sessione.getDatiDaSalvareIndiceSip(); + sipBlob.put(TipiXmlDati.RICHIESTA, blobRichiesta); + tmpReturn = salvaXmlRichiesta(versamento, sessione, versioneXmlChiamata, documentoVersIn, backendMetadata, + vrsDatiSessioneVers, vrsDatiSessioneVersKo, rispostaWS); } /* * salva i dati xml di esito */ if (tmpReturn) { - tmpXmlDatiSessioneVers = new VrsXmlDatiSessioneVers(); - tmpXmlDatiSessioneVers.setVrsDatiSessioneVers(tmpDatiSessioneVers); - tmpXmlDatiSessioneVers.setTiXmlDati(TipiXmlDati.RISPOSTA); - // se ho trovato il codice della struttura versante, lo scrivo - if (versamento.getStrutturaComponenti() != null - && versamento.getStrutturaComponenti().getIdStruttura() != 0) { - tmpXmlDatiSessioneVers.setIdStrut(new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); - } - tmpXmlDatiSessioneVers.setFlCanonicalized(CostantiDB.Flag.FALSE); - tmpXmlDatiSessioneVers.setBlXml(xmlEsito.length() == 0 ? "--" : xmlEsito); - tmpXmlDatiSessioneVers.setCdVersioneXml(versioneXmlEsito); - if (sessione.getUrnEsitoVersamento() != null) { - tmpXmlDatiSessioneVers.setDsUrnXmlVers(sessione.getUrnEsitoVersamento()); - tmpXmlDatiSessioneVers.setDsHashXmlVers(hashXmlEsito); - tmpXmlDatiSessioneVers.setCdEncodingHashXmlVers(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()); - // tmpXmlDatiSessioneVers.setDsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_1.descrivi()); - tmpXmlDatiSessioneVers.setDsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_256.descrivi()); - } - try { - entityManager.persist(tmpXmlDatiSessioneVers); - entityManager.flush(); - } catch (RuntimeException re) { - /// logga l'errore e blocca tutto - log.error("Eccezione nella persistenza della sessione ", re); - tmpReturn = false; - } - } - - if (tmpReturn) { - if (tmpUrn != null) { - // salvo ORIGINALE - tmpReturn = this.salvaUrnXmlSessioneVers(tmpXmlDatiSessioneVers, - MessaggiWSFormat.formattaUrnEsitoVers(tmpUrn, Costanti.UrnFormatter.URN_ESITO_VERS_V2), - TiUrnXmlSessioneVers.ORIGINALE); - } - if (tmpUrnNorm != null) { - // salvo NORMALIZZATO - tmpReturn = this.salvaUrnXmlSessioneVers(tmpXmlDatiSessioneVers, - MessaggiWSFormat.formattaUrnEsitoVers(tmpUrnNorm, Costanti.UrnFormatter.URN_ESITO_VERS_V2), - TiUrnXmlSessioneVers.NORMALIZZATO); - } - if (tmpXmlDatiSessioneVers.getDsUrnXmlVers() != null) { - // salvo INIZIALE - tmpReturn = this.salvaUrnXmlSessioneVers(tmpXmlDatiSessioneVers, - tmpXmlDatiSessioneVers.getDsUrnXmlVers(), TiUrnXmlSessioneVers.INIZIALE); - } + final String xmlRisposta = xmlEsito.length() == 0 ? "--" : xmlEsito; + sipBlob.put(TipiXmlDati.RISPOSTA, xmlRisposta); + tmpReturn = salvaXmlRisposta(versamento, sessione, hashXmlEsito, versioneXmlEsito, xmlEsito, + documentoVersIn, backendMetadata, vrsDatiSessioneVers, vrsDatiSessioneVersKo, rispostaWS); } /* * se sono presenti, salva i dati xml dell'indice MM (solo per VersamentoMM) */ if (tmpReturn && sessione.getDatiPackInfoSipXml() != null) { - tmpXmlDatiSessioneVers = new VrsXmlDatiSessioneVers(); - tmpXmlDatiSessioneVers.setVrsDatiSessioneVers(tmpDatiSessioneVers); - tmpXmlDatiSessioneVers.setTiXmlDati(TipiXmlDati.INDICE_FILE); - // se ho trovato il codice della struttura versante, lo scrivo - if (versamento.getStrutturaComponenti() != null - && versamento.getStrutturaComponenti().getIdStruttura() != 0) { - tmpXmlDatiSessioneVers.setIdStrut(new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); - } - tmpXmlDatiSessioneVers.setFlCanonicalized(CostantiDB.Flag.FALSE); - tmpXmlDatiSessioneVers - .setBlXml(sessione.getDatiPackInfoSipXml().length() == 0 ? "--" : sessione.getDatiPackInfoSipXml()); - tmpXmlDatiSessioneVers.setCdVersioneXml(versioneXmlChiamata); - if (sessione.getUrnPackInfoSipXml() != null) { - tmpXmlDatiSessioneVers.setDsUrnXmlVers(sessione.getUrnPackInfoSipXml()); - tmpXmlDatiSessioneVers.setDsHashXmlVers(sessione.getHashPackInfoSipXml()); - tmpXmlDatiSessioneVers.setCdEncodingHashXmlVers(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()); - // tmpXmlDatiSessioneVers.setDsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_1.descrivi()); - tmpXmlDatiSessioneVers.setDsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_256.descrivi()); - } - try { - entityManager.persist(tmpXmlDatiSessioneVers); - entityManager.flush(); - } catch (RuntimeException re) { - /// logga l'errore e blocca tutto - log.error("Eccezione nella persistenza della sessione ", re); - tmpReturn = false; - } - - if (tmpReturn) { - if (tmpUrn != null) { - // salvo ORIGINALE - tmpReturn = this.salvaUrnXmlSessioneVers(tmpXmlDatiSessioneVers, - MessaggiWSFormat.formattaUrnEsitoVers(tmpUrn, Costanti.UrnFormatter.URN_PI_SIP_V2), - TiUrnXmlSessioneVers.ORIGINALE); - } - if (tmpUrnNorm != null) { - // salvo NORMALIZZATO - tmpReturn = this.salvaUrnXmlSessioneVers(tmpXmlDatiSessioneVers, - MessaggiWSFormat.formattaUrnEsitoVers(tmpUrnNorm, Costanti.UrnFormatter.URN_PI_SIP_V2), - TiUrnXmlSessioneVers.NORMALIZZATO); - } - if (tmpXmlDatiSessioneVers.getDsUrnXmlVers() != null) { - // salvo INIZIALE - tmpReturn = this.salvaUrnXmlSessioneVers(tmpXmlDatiSessioneVers, - tmpXmlDatiSessioneVers.getDsUrnXmlVers(), TiUrnXmlSessioneVers.INIZIALE); - } - } + final String xmlIndice = sessione.getDatiPackInfoSipXml().length() == 0 ? "--" + : sessione.getDatiPackInfoSipXml(); + sipBlob.put(TipiXmlDati.INDICE_FILE, xmlIndice); + tmpReturn = salvaXmlIndiceMMVersamento(versamento, sessione, versioneXmlChiamata, documentoVersIn, + backendMetadata, vrsDatiSessioneVers, vrsDatiSessioneVersKo, rispostaWS); } /* * se sono presenti, salva i dati xml del Rapporto di versamento */ // questi dati li scrivo se il WS è andato, nel complesso, bene. - if (rispostaWS.getSeverity() != RispostaWS.SeverityEnum.ERROR) { - if (tmpReturn && sessione.getDatiRapportoVersamento() != null) { - tmpXmlDatiSessioneVers = new VrsXmlDatiSessioneVers(); - tmpXmlDatiSessioneVers.setVrsDatiSessioneVers(tmpDatiSessioneVers); - tmpXmlDatiSessioneVers.setTiXmlDati(TipiXmlDati.RAPP_VERS); - // se ho trovato il codice della struttura versante, lo scrivo - if (versamento.getStrutturaComponenti() != null - && versamento.getStrutturaComponenti().getIdStruttura() != 0) { - tmpXmlDatiSessioneVers - .setIdStrut(new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); - } - tmpXmlDatiSessioneVers.setFlCanonicalized(CostantiDB.Flag.FALSE); - tmpXmlDatiSessioneVers.setBlXml(sessione.getDatiRapportoVersamento().length() == 0 ? "--" - : sessione.getDatiRapportoVersamento()); - tmpXmlDatiSessioneVers.setCdVersioneXml(Costanti.XML_RAPPORTO_VERS_VRSN); - if (sessione.getUrnRapportoVersamento() != null) { - tmpXmlDatiSessioneVers.setDsUrnXmlVers(sessione.getUrnRapportoVersamento()); - tmpXmlDatiSessioneVers.setDsHashXmlVers(sessione.getHashRapportoVersamento()); - tmpXmlDatiSessioneVers.setCdEncodingHashXmlVers(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()); - // tmpXmlDatiSessioneVers.setDsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_1.descrivi()); - tmpXmlDatiSessioneVers.setDsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_256.descrivi()); - } - try { - entityManager.persist(tmpXmlDatiSessioneVers); - entityManager.flush(); - } catch (RuntimeException re) { - /// logga l'errore e blocca tutto - log.error("Eccezione nella persistenza della sessione ", re); - tmpReturn = false; - } - } + if (isOkOrWarningResponse(rispostaWS) && tmpReturn && sessione.getDatiRapportoVersamento() != null) { + final String xmlRappVers = sessione.getDatiRapportoVersamento().length() == 0 ? "--" + : sessione.getDatiRapportoVersamento(); + sipBlob.put(TipiXmlDati.RAPP_VERS, xmlRappVers); + tmpReturn = salvaXmlRapportoVersamento(versamento, sessione, documentoVersIn, backendMetadata, + vrsDatiSessioneVers, vrsDatiSessioneVersKo, rispostaWS); + } - if (tmpReturn) { - if (tmpUrn != null) { - // salvo ORIGINALE - tmpReturn = this.salvaUrnXmlSessioneVers(tmpXmlDatiSessioneVers, - MessaggiWSFormat.formattaUrnEsitoVers(tmpUrn, Costanti.UrnFormatter.URN_RAPP_VERS_V2), - TiUrnXmlSessioneVers.ORIGINALE); - } - if (tmpUrnNorm != null) { - // salvo NORMALIZZATO - tmpReturn = this.salvaUrnXmlSessioneVers(tmpXmlDatiSessioneVers, - MessaggiWSFormat.formattaUrnEsitoVers(tmpUrnNorm, Costanti.UrnFormatter.URN_RAPP_VERS_V2), - TiUrnXmlSessioneVers.NORMALIZZATO); - } - if (tmpXmlDatiSessioneVers.getDsUrnXmlVers() != null) { - // salvo INIZIALE - tmpReturn = this.salvaUrnXmlSessioneVers(tmpXmlDatiSessioneVers, - tmpXmlDatiSessioneVers.getDsUrnXmlVers(), TiUrnXmlSessioneVers.INIZIALE); + /* + * Se backendMetadata di tipo O.S. si effettua il salvataggio (con link su appasita entity) + */ + if (tmpReturn && backendMetadata.isObjectStorage()) { + ObjectStorageResource res = null; + if (isOkOrWarningResponse(rispostaWS)) /* sessione OK */ { + if (documentoVersIn != null) { + res = objectStorageService.createResourcesInSipDocumento(backendMetadata.getBackendName(), sipBlob, + documentoVersIn.getIdRecDocumentoDB()); + } else { + res = objectStorageService.createResourcesInSipUnitaDoc(backendMetadata.getBackendName(), sipBlob, + versamento.getStrutturaComponenti().getIdUnitaDoc()); } + } else /* sessione KO */ { + res = objectStorageService.createSipInStaging(backendMetadata.getBackendName(), sipBlob, + vrsDatiSessioneVersKo.get().getIdDatiSessioneVersKo(), getIdStrut(versamento)); } + log.debug("Salvati i SIP nel bucket {} con chiave {} ", res.getBucket(), res.getKey()); } /* * se sono presenti, salva i dati xml dei Profili UD/Comp */ - if (rispostaWS.getSeverity() != RispostaWS.SeverityEnum.ERROR && versamento.getStrutturaComponenti() != null + if (isOkOrWarningResponse(rispostaWS) && versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti().hasXsdProfile()) { + Assert.isTrue(vrsDatiSessioneVers.isPresent(), + "VrsDatiSessioneVers deve essere presente in questo caso perché la sessione è andata a buon fine"); // se presente il profilo normativo su unità documentaria if (versamento.getStrutturaComponenti().getIdRecUsoXsdProfiloNormativo() != null) { tmpReturn = salvaXmlModelloProfiloNormativoUniDoc(versamento.getStrutturaComponenti().getIdStruttura(), versamento.getStrutturaComponenti().getIdRecUsoXsdProfiloNormativo().longValue(), - versamento.getStrutturaComponenti().getDatiC14NProfNormXml(), tmpDatiSessioneVers); + versamento.getStrutturaComponenti().getDatiC14NProfNormXml(), vrsDatiSessioneVers.get()); } /* * Possibili future estensioni per nuovi profili su unidoc..... @@ -755,50 +564,46 @@ private boolean salvaSessione(AbsVersamentoExt versamento, IRispostaVersWS rispo /* * salva i dati relativi agli errori */ - if (tmpReturn) { - if (rispostaWS.getSeverity() != RispostaWS.SeverityEnum.OK) { - int progErrore = 1; - String tmpErrMess; - for (VoceDiErrore tmpVoceDiErrore : versamento.getErroriTrovati()) { - tmpErrSessioneVers = new VrsErrSessioneVers(); - tmpErrSessioneVers.setVrsDatiSessioneVers(tmpDatiSessioneVers); - // se ho trovato il codice della struttura versante, lo scrivo - if (versamento.getStrutturaComponenti() != null - && versamento.getStrutturaComponenti().getIdStruttura() != 0) { - tmpErrSessioneVers - .setIdStrut(new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); - } + if (tmpReturn && !isOkResponse(rispostaWS)) { + // CHIUSA_OK con warning o CHIUSA_ERR + int progErrore = 1; + String tmpErrMess; + VrsErrSessioneVersBuilder vrsErrSessioneVersBuilder = VrsErrSessioneVersBuilder.builder(); + for (VoceDiErrore tmpVoceDiErrore : versamento.getErroriTrovati()) { + vrsErrSessioneVersBuilder.vrsDatiSessioneVersKo(vrsDatiSessioneVersKo.orElse(null)); + vrsErrSessioneVersBuilder.vrsDatiSessioneVers(vrsDatiSessioneVers.orElse(null)); + // se ho trovato il codice della struttura versante, lo scrivo + if (versamento.getStrutturaComponenti() != null + && versamento.getStrutturaComponenti().getIdStruttura() != 0) { + vrsErrSessioneVersBuilder + .idStrut(new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); + } - if (tmpVoceDiErrore.getErrorMessage().isEmpty()) { - tmpErrMess = "(vuoto)"; - } else { - tmpErrMess = tmpVoceDiErrore.getErrorMessage(); - if (tmpErrMess.length() > DS_ERR_MAX_LEN) { - tmpErrMess = tmpErrMess.substring(0, DS_ERR_MAX_LEN); - } + if (tmpVoceDiErrore.getErrorMessage().isEmpty()) { + tmpErrMess = "(vuoto)"; + } else { + tmpErrMess = tmpVoceDiErrore.getErrorMessage(); + if (tmpErrMess.length() > DS_ERR_MAX_LEN) { + tmpErrMess = tmpErrMess.substring(0, DS_ERR_MAX_LEN); } - tmpErrSessioneVers.setDsErr(tmpErrMess); - - if (tmpVoceDiErrore.getSeverity() == RispostaWS.SeverityEnum.ERROR) { - tmpErrSessioneVers.setTiErr(TIPO_ERR_FATALE); + } + vrsErrSessioneVersBuilder.dsErr(tmpErrMess).cdErr(tmpVoceDiErrore.getErrorCode()) + .flErrPrinc(booleanToFlag(tmpVoceDiErrore.isElementoPrincipale())) + .pgErrSessioneVers(new BigDecimal(progErrore)); + progErrore++; + try { + if (isErrorResponse(rispostaWS)) { + vrsErrSessioneVersBuilder.tiErr(TIPO_ERR_FATALE); + entityManager.persist(vrsErrSessioneVersBuilder.buildVrsErrSessioneVersKo()); } else { - tmpErrSessioneVers.setTiErr(TIPO_ERR_WARNING); - } - - tmpErrSessioneVers.setPgErrSessioneVers(new BigDecimal(progErrore)); - progErrore++; - - tmpErrSessioneVers.setCdErr(tmpVoceDiErrore.getErrorCode()); - tmpErrSessioneVers.setFlErrPrinc(tmpVoceDiErrore.isElementoPrincipale() ? "1" : "0"); - try { - entityManager.persist(tmpErrSessioneVers); - entityManager.flush(); - } catch (RuntimeException re) { - /// logga l'errore e blocca tutto - log.error("Eccezione nella persistenza della sessione ", re); - tmpReturn = false; - break; + vrsErrSessioneVersBuilder.tiErr(TIPO_ERR_WARNING); + entityManager.persist(vrsErrSessioneVersBuilder.buildVrsErrSessioneVers()); } + } catch (RuntimeException re) { + /// logga l'errore e blocca tutto + log.error("Eccezione nella persistenza degli errori su sessione ", re); + tmpReturn = false; + break; } } } @@ -808,32 +613,37 @@ private boolean salvaSessione(AbsVersamentoExt versamento, IRispostaVersWS rispo * --- --- --- --- NOTA: il salvataggio dei file andati in errore avviene solo nel caso di persistenza degli * stessi su BLOB oppure il tipo salvataggio non sia stato determinato. Nel caso i file siano da versare sul * filesystem (e successivamente su nastro, via Tivoli), i file vengono perduti. Vogliamo evitare di salvare su - * blob file potenzialmente enormi. + * blob file potenzialmente enormi. MEV29384 - Scrivo i file solo per i versamenti CHIUSA_ERR perché per quelli + * andati a buon fine i file sono già salvati su DB */ long contaFileScritti = 0; - if (tmpReturn && (versamento.getStrutturaComponenti() == null) - || (versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti() - .getTipoSalvataggioFile() != CostantiDB.TipoSalvataggioFile.FILE)) { + if (tmpReturn && isErrorResponse(rispostaWS) + && (versamento.getStrutturaComponenti() == null + || (versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti() + .getTipoSalvataggioFile() != CostantiDB.TipoSalvataggioFile.FILE))) + + { + Assert.isTrue(vrsDatiSessioneVersKo.isPresent(), + "VrsFileSessioneKo deve essere presente per sessionie errate/fallite"); long progressivoFile = 0; for (FileBinario tmpFb : sessione.getFileBinari()) { progressivoFile++; - tmpFileSessione = new VrsFileSessione(); - tmpFileSessione.setVrsDatiSessioneVers(tmpDatiSessioneVers); + VrsFileSessioneKo vrsFileSessioneKo = new VrsFileSessioneKo(); + vrsFileSessioneKo.setVrsDatiSessioneVersKo(vrsDatiSessioneVersKo.get()); if (versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti().getIdStruttura() != 0) { - tmpFileSessione.setIdStrut(new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); + vrsFileSessioneKo.setIdStrut(new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); } - tmpFileSessione.setNmFileSessione(tmpFb.getId()); - tmpFileSessione.setPgFileSessione(new BigDecimal(progressivoFile)); - tmpFileSessione.setTiStatoFileSessione("CONTR_FATTI"); // nota, questo campo è del tutto inutile. + vrsFileSessioneKo.setNmFileSessione(tmpFb.getId()); + vrsFileSessioneKo.setPgFileSessione(new BigDecimal(progressivoFile)); + vrsFileSessioneKo.setTiStatoFileSessione("CONTR_FATTI"); // nota, questo campo è del tutto inutile. try { if (tmpReturn) { - entityManager.persist(tmpFileSessione); - entityManager.flush(); + entityManager.persist(vrsFileSessioneKo); } } catch (RuntimeException re) { /// logga l'errore e blocca tutto - log.error("Eccezione nella persistenza della sessione ", re); + log.error("Eccezione nella persistenza dei file di sessione ", re); tmpReturn = false; } @@ -842,12 +652,11 @@ private boolean salvaSessione(AbsVersamentoExt versamento, IRispostaVersWS rispo * "l'elemento corrisponde ad uno già presente nel sistema". dal momento che non ci interessa tenere due * copie di un file che abbiamo già */ - if (tmpReturn && rispostaWS.getSeverity() == RispostaWS.SeverityEnum.ERROR - && (!rispostaWS.isErroreElementoDoppio())) { + if (tmpReturn && isErrorResponse(rispostaWS) && (!rispostaWS.isErroreElementoDoppio())) { // procedo alla memorizzazione del file sul blob, via JDBC WriteCompBlbOracle.DatiAccessori datiAccessori = new WriteCompBlbOracle().new DatiAccessori(); - datiAccessori.setTabellaBlob(WriteCompBlbOracle.TabellaBlob.VRS_CONTENUTO_FILE); - datiAccessori.setIdPadre(tmpFileSessione.getIdFileSessione()); + datiAccessori.setTabellaBlob(WriteCompBlbOracle.TabellaBlob.VRS_CONTENUTO_FILE_KO); + datiAccessori.setIdPadre(vrsFileSessioneKo.getIdFileSessioneKo()); if (versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti().getIdStruttura() != 0) { datiAccessori.setIdStruttura(versamento.getStrutturaComponenti().getIdStruttura()); @@ -855,12 +664,30 @@ private boolean salvaSessione(AbsVersamentoExt versamento, IRispostaVersWS rispo datiAccessori.setDtVersamento(sessione.getTmApertura()); try { - RispostaControlli tmpControlli = writeCompBlbOracle.salvaStreamSuBlobComp(datiAccessori, tmpFb); + + BackendStorage backendStaging = objectStorageService.lookupBackendVrsStaging(); + RispostaControlli tmpControlli = null; + if (backendStaging.isDataBase()) { + tmpControlli = writeCompBlbOracle.salvaStreamSuBlobComp(datiAccessori, tmpFb); + } else { + // tagging object + objectStorageService.tagComponenteInStaging(tmpFb.getObjectStorageResource(), + backendStaging.getBackendName()); + // saving on db + objectStorageService.saveLinkFileSessFromObjectStorage(tmpFb.getObjectStorageResource(), + backendStaging.getBackendName(), vrsFileSessioneKo.getIdFileSessioneKo(), + getIdStrut(versamento)); + // ho già detto che odio l'oggetto RispostaControlli? + tmpControlli = new RispostaControlli(); + tmpControlli.setrBoolean(true); + } + if (tmpControlli.isrBoolean()) { contaFileScritti++; } else { tmpReturn = false; } + } catch (Exception re) { /// logga l'errore e blocca tutto log.error("Eccezione nella persistenza del blob ", re); @@ -872,15 +699,425 @@ private boolean salvaSessione(AbsVersamentoExt versamento, IRispostaVersWS rispo // aggiorno nella tabella principale della Sessione di Versamento // il numero effettivo di file/blob salvati sul DB - if (tmpReturn && rispostaWS.getSeverity() == RispostaWS.SeverityEnum.ERROR) { - tmpSessioneVer = entityManager.find(VrsSessioneVers.class, tmpSessioneVer.getIdSessioneVers()); - tmpSessioneVer.setNiFileErr(new BigDecimal(contaFileScritti)); - entityManager.flush(); + if (tmpReturn && isErrorResponse(rispostaWS)) { + Assert.isTrue(vrsSessioneVersKo.isPresent(), + "VrsSessioneVersKo deve essere presente per le sessioni errate/fallite"); + vrsSessioneVersKo.get().setNiFileErr(new BigDecimal(contaFileScritti)); + } + + return tmpReturn; + } + + private BigDecimal getIdStrut(AbsVersamentoExt versamento) { + if (versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti().getIdStruttura() != 0) { + return BigDecimal.valueOf(versamento.getStrutturaComponenti().getIdStruttura()); + } + return null; + } + + private static boolean isErrorResponse(IRispostaVersWS rispostaWS) { + return IRispostaWS.SeverityEnum.ERROR.equals(rispostaWS.getSeverity()); + } + + private static boolean isOkOrWarningResponse(IRispostaVersWS rispostaWS) { + return !isErrorResponse(rispostaWS); + } + + private static boolean isOkResponse(IRispostaVersWS rispostaWS) { + return IRispostaWS.SeverityEnum.OK.equals(rispostaWS.getSeverity()); + } + + // salva i dati xml di versamento + private boolean salvaXmlRichiesta(AbsVersamentoExt versamento, SyncFakeSessn sessione, String versioneXmlChiamata, + DocumentoVers documentoVersIn, BackendStorage backendMetadata, + Optional vrsDatiSessioneVers, Optional vrsDatiSessioneVersKo, + IRispostaVersWS rispostaWS) { + boolean tmpReturn = true; + VrsXmlDatiSessioneVersBuilder vrsXmlDatiSessioneVersBuilder = VrsXmlDatiSessioneVersBuilder.builder() + .vrsDatiSessioneVers(vrsDatiSessioneVers).vrsDatiSessioneVersKo(vrsDatiSessioneVersKo) + .tiXmlDati(TipiXmlDati.RICHIESTA); + // se ho trovato il codice della struttura versante, lo scrivo + if (versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti().getIdStruttura() != 0) { + vrsXmlDatiSessioneVersBuilder.idStrut(new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); + } + vrsXmlDatiSessioneVersBuilder.flCanonicalized(CostantiDB.Flag.TRUE); + if (backendMetadata.isDataBase()) { + vrsXmlDatiSessioneVersBuilder.blXml( + sessione.getDatiDaSalvareIndiceSip().length() == 0 ? "--" : sessione.getDatiDaSalvareIndiceSip()); + } + + vrsXmlDatiSessioneVersBuilder.cdVersioneXml(versioneXmlChiamata); + if (sessione.getUrnIndiceSipXml() != null) { + vrsXmlDatiSessioneVersBuilder.dsUrnXmlVers(sessione.getUrnIndiceSipXml()) + .dsHashXmlVers(sessione.getHashIndiceSipXml()) + .cdEncodingHashXmlVers(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()) + .dsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_256.descrivi()); + } + Optional vrsXmlDatiSessioneVers = Optional.empty(); + Optional vrsXmlDatiSessioneVersKo = Optional.empty(); + try { + if (isOkOrWarningResponse(rispostaWS)) { + vrsXmlDatiSessioneVers = Optional.of(vrsXmlDatiSessioneVersBuilder.buildVrsXmlDatiSessioneVers()); + entityManager.persist(vrsXmlDatiSessioneVers.get()); + } else { + vrsXmlDatiSessioneVersKo = Optional.of(vrsXmlDatiSessioneVersBuilder.buildVrsXmlDatiSessioneVersKo()); + entityManager.persist(vrsXmlDatiSessioneVersKo.get()); + } + } catch (RuntimeException re) { + log.error(ECCEZIONE_SALVATAGGIO_SESSIONE, re); + tmpReturn = false; + } + + /* + * salva i dati dei nuovi URN su VrsUrnXmlSessioneVers + */ + if (tmpReturn) { + final URNVersamento urns = calcolaUrn(versamento, documentoVersIn, sessione); + if (urns.getUrn() != null) { + // salvo ORIGINALE + tmpReturn = this.salvaVrsUrnXmlSessioneVers( + MessaggiWSFormat.formattaUrnIndiceSip(urns.getUrn(), Costanti.UrnFormatter.URN_INDICE_SIP_V2), + TiUrnXmlSessioneVers.ORIGINALE, vrsXmlDatiSessioneVers, vrsXmlDatiSessioneVersKo, rispostaWS, + getIdStrut(versamento)); + } + if (urns.getUrnNormalizzato() != null) { + // salvo NORMALIZZATO + tmpReturn = this.salvaVrsUrnXmlSessioneVers( + MessaggiWSFormat.formattaUrnIndiceSip(urns.getUrnNormalizzato(), + Costanti.UrnFormatter.URN_INDICE_SIP_V2), + TiUrnXmlSessioneVers.NORMALIZZATO, vrsXmlDatiSessioneVers, vrsXmlDatiSessioneVersKo, rispostaWS, + getIdStrut(versamento)); + } + if (vrsXmlDatiSessioneVersBuilder.getDsUrnXmlVers() != null) { + // salvo INIZIALE + tmpReturn = this.salvaVrsUrnXmlSessioneVers(vrsXmlDatiSessioneVersBuilder.getDsUrnXmlVers(), + TiUrnXmlSessioneVers.INIZIALE, vrsXmlDatiSessioneVers, vrsXmlDatiSessioneVersKo, rispostaWS, + getIdStrut(versamento)); + } + } + + return tmpReturn; + } + + // salva i dati xml di esito + private boolean salvaXmlRisposta(AbsVersamentoExt versamento, SyncFakeSessn sessione, String hashXmlEsito, + String versioneXmlEsito, String xmlEsito, DocumentoVers documentoVersIn, BackendStorage backendMetadata, + Optional vrsDatiSessioneVers, Optional vrsDatiSessioneVersKo, + IRispostaVersWS rispostaWS) { + boolean tmpReturn = true; + VrsXmlDatiSessioneVersBuilder vrsXmlDatiSessioneVersBuilder = VrsXmlDatiSessioneVersBuilder.builder() + .tiXmlDati(TipiXmlDati.RISPOSTA).vrsDatiSessioneVers(vrsDatiSessioneVers) + .vrsDatiSessioneVersKo(vrsDatiSessioneVersKo); + // se ho trovato il codice della struttura versante, lo scrivo + if (versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti().getIdStruttura() != 0) { + vrsXmlDatiSessioneVersBuilder.idStrut(new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); + } + vrsXmlDatiSessioneVersBuilder.flCanonicalized(CostantiDB.Flag.FALSE); + if (backendMetadata.isDataBase()) { + vrsXmlDatiSessioneVersBuilder.blXml(xmlEsito.length() == 0 ? "--" : xmlEsito); + } + vrsXmlDatiSessioneVersBuilder.cdVersioneXml(versioneXmlEsito); + if (sessione.getUrnEsitoVersamento() != null) { + vrsXmlDatiSessioneVersBuilder.dsUrnXmlVers(sessione.getUrnEsitoVersamento()); + vrsXmlDatiSessioneVersBuilder.dsHashXmlVers(hashXmlEsito); + vrsXmlDatiSessioneVersBuilder.cdEncodingHashXmlVers(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()); + vrsXmlDatiSessioneVersBuilder.dsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_256.descrivi()); + } + + Optional vrsXmlDatiSessioneVers = Optional.empty(); + Optional vrsXmlDatiSessioneVersKo = Optional.empty(); + try { + if (isOkOrWarningResponse(rispostaWS)) { + vrsXmlDatiSessioneVers = Optional.of(vrsXmlDatiSessioneVersBuilder.buildVrsXmlDatiSessioneVers()); + entityManager.persist(vrsXmlDatiSessioneVers.get()); + } else { + vrsXmlDatiSessioneVersKo = Optional.of(vrsXmlDatiSessioneVersBuilder.buildVrsXmlDatiSessioneVersKo()); + entityManager.persist(vrsXmlDatiSessioneVersKo.get()); + } + } catch (RuntimeException re) { + log.error(ECCEZIONE_SALVATAGGIO_SESSIONE, re); + tmpReturn = false; } + if (tmpReturn) { + final URNVersamento urns = calcolaUrn(versamento, documentoVersIn, sessione); + if (urns.getUrn() != null) { + // salvo ORIGINALE + tmpReturn = this.salvaVrsUrnXmlSessioneVers( + MessaggiWSFormat.formattaUrnEsitoVers(urns.getUrn(), Costanti.UrnFormatter.URN_ESITO_VERS_V2), + TiUrnXmlSessioneVers.ORIGINALE, vrsXmlDatiSessioneVers, vrsXmlDatiSessioneVersKo, rispostaWS, + getIdStrut(versamento)); + } + if (urns.getUrnNormalizzato() != null) { + // salvo NORMALIZZATO + tmpReturn = this.salvaVrsUrnXmlSessioneVers( + MessaggiWSFormat.formattaUrnEsitoVers(urns.getUrnNormalizzato(), + Costanti.UrnFormatter.URN_ESITO_VERS_V2), + TiUrnXmlSessioneVers.NORMALIZZATO, vrsXmlDatiSessioneVers, vrsXmlDatiSessioneVersKo, rispostaWS, + getIdStrut(versamento)); + } + if (vrsXmlDatiSessioneVersBuilder.getDsUrnXmlVers() != null) { + // salvo INIZIALE + tmpReturn = this.salvaVrsUrnXmlSessioneVers(vrsXmlDatiSessioneVersBuilder.getDsUrnXmlVers(), + TiUrnXmlSessioneVers.INIZIALE, vrsXmlDatiSessioneVers, vrsXmlDatiSessioneVersKo, rispostaWS, + getIdStrut(versamento)); + } + } + return tmpReturn; + } + + // se sono presenti, salva i dati xml dell'indice MM (solo per VersamentoMM) + private boolean salvaXmlIndiceMMVersamento(AbsVersamentoExt versamento, SyncFakeSessn sessione, + String versioneXmlChiamata, DocumentoVers documentoVersIn, BackendStorage backendMetadata, + Optional vrsDatiSessioneVers, Optional vrsDatiSessioneVersKo, + IRispostaVersWS rispostaWS) { + boolean tmpReturn = true; + VrsXmlDatiSessioneVersBuilder vrsXmlDatiSessioneVersBuilder = VrsXmlDatiSessioneVersBuilder.builder() + .vrsDatiSessioneVers(vrsDatiSessioneVers).vrsDatiSessioneVersKo(vrsDatiSessioneVersKo) + .tiXmlDati(TipiXmlDati.INDICE_FILE); + // se ho trovato il codice della struttura versante, lo scrivo + if (versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti().getIdStruttura() != 0) { + vrsXmlDatiSessioneVersBuilder.idStrut(new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); + } + vrsXmlDatiSessioneVersBuilder.flCanonicalized(CostantiDB.Flag.FALSE); + if (backendMetadata.isDataBase()) { + vrsXmlDatiSessioneVersBuilder + .blXml(sessione.getDatiPackInfoSipXml().length() == 0 ? "--" : sessione.getDatiPackInfoSipXml()); + } + vrsXmlDatiSessioneVersBuilder.cdVersioneXml(versioneXmlChiamata); + if (sessione.getUrnPackInfoSipXml() != null) { + vrsXmlDatiSessioneVersBuilder.dsUrnXmlVers(sessione.getUrnPackInfoSipXml()) + .dsHashXmlVers(sessione.getHashPackInfoSipXml()) + .cdEncodingHashXmlVers(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()) + .dsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_256.descrivi()); + } + Optional vrsXmlDatiSessioneVers = Optional.empty(); + Optional vrsXmlDatiSessioneVersKo = Optional.empty(); + try { + if (isOkOrWarningResponse(rispostaWS)) { + vrsXmlDatiSessioneVers = Optional.of(vrsXmlDatiSessioneVersBuilder.buildVrsXmlDatiSessioneVers()); + entityManager.persist(vrsXmlDatiSessioneVers.get()); + } else { + vrsXmlDatiSessioneVersKo = Optional.of(vrsXmlDatiSessioneVersBuilder.buildVrsXmlDatiSessioneVersKo()); + entityManager.persist(vrsXmlDatiSessioneVersKo.get()); + } + } catch (RuntimeException re) { + log.error(ECCEZIONE_SALVATAGGIO_SESSIONE, re); + tmpReturn = false; + } + + if (tmpReturn) { + final URNVersamento urns = calcolaUrn(versamento, documentoVersIn, sessione); + if (urns.getUrn() != null) { + // salvo ORIGINALE + tmpReturn = this.salvaVrsUrnXmlSessioneVers( + MessaggiWSFormat.formattaUrnEsitoVers(urns.getUrn(), Costanti.UrnFormatter.URN_PI_SIP_V2), + TiUrnXmlSessioneVers.ORIGINALE, vrsXmlDatiSessioneVers, vrsXmlDatiSessioneVersKo, rispostaWS, + getIdStrut(versamento)); + } + if (urns.getUrnNormalizzato() != null) { + // salvo NORMALIZZATO + tmpReturn = this.salvaVrsUrnXmlSessioneVers( + MessaggiWSFormat.formattaUrnEsitoVers(urns.getUrnNormalizzato(), + Costanti.UrnFormatter.URN_PI_SIP_V2), + TiUrnXmlSessioneVers.NORMALIZZATO, vrsXmlDatiSessioneVers, vrsXmlDatiSessioneVersKo, rispostaWS, + getIdStrut(versamento)); + } + if (vrsXmlDatiSessioneVersBuilder.getDsUrnXmlVers() != null) { + // salvo INIZIALE + tmpReturn = this.salvaVrsUrnXmlSessioneVers(vrsXmlDatiSessioneVersBuilder.getDsUrnXmlVers(), + TiUrnXmlSessioneVers.INIZIALE, vrsXmlDatiSessioneVers, vrsXmlDatiSessioneVersKo, rispostaWS, + getIdStrut(versamento)); + } + } + return tmpReturn; + } + + // se sono presenti, salva i dati xml del Rapporto di versamento + private boolean salvaXmlRapportoVersamento(AbsVersamentoExt versamento, SyncFakeSessn sessione, + DocumentoVers documentoVersIn, BackendStorage backendMetadata, + Optional vrsDatiSessioneVers, Optional vrsDatiSessioneVersKo, + IRispostaVersWS rispostaWS) { + boolean tmpReturn = true; + VrsXmlDatiSessioneVersBuilder vrsXmlDatiSessioneVersBuilder = VrsXmlDatiSessioneVersBuilder.builder(); + if (sessione.getDatiRapportoVersamento() != null) { + vrsXmlDatiSessioneVersBuilder.vrsDatiSessioneVers(vrsDatiSessioneVers) + .vrsDatiSessioneVersKo(vrsDatiSessioneVersKo).tiXmlDati(TipiXmlDati.RAPP_VERS); + // se ho trovato il codice della struttura versante, lo scrivo + if (versamento.getStrutturaComponenti() != null + && versamento.getStrutturaComponenti().getIdStruttura() != 0) { + vrsXmlDatiSessioneVersBuilder + .idStrut(new BigDecimal(versamento.getStrutturaComponenti().getIdStruttura())); + } + vrsXmlDatiSessioneVersBuilder.flCanonicalized(CostantiDB.Flag.FALSE); + if (backendMetadata.isDataBase()) { + vrsXmlDatiSessioneVersBuilder.blXml(sessione.getDatiRapportoVersamento().length() == 0 ? "--" + : sessione.getDatiRapportoVersamento()); + } + vrsXmlDatiSessioneVersBuilder.cdVersioneXml(Costanti.XML_RAPPORTO_VERS_VRSN); + if (sessione.getUrnRapportoVersamento() != null) { + vrsXmlDatiSessioneVersBuilder.dsUrnXmlVers(sessione.getUrnRapportoVersamento()) + .dsHashXmlVers(sessione.getHashRapportoVersamento()) + .cdEncodingHashXmlVers(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()) + .dsAlgoHashXmlVers(CostantiDB.TipiHash.SHA_256.descrivi()); + } + Optional vrsXmlDatiSessioneVers = Optional.empty(); + Optional vrsXmlDatiSessioneVersKo = Optional.empty(); + try { + if (isOkOrWarningResponse(rispostaWS)) { + vrsXmlDatiSessioneVers = Optional.of(vrsXmlDatiSessioneVersBuilder.buildVrsXmlDatiSessioneVers()); + entityManager.persist(vrsXmlDatiSessioneVers.get()); + } else { + vrsXmlDatiSessioneVersKo = Optional + .of(vrsXmlDatiSessioneVersBuilder.buildVrsXmlDatiSessioneVersKo()); + entityManager.persist(vrsXmlDatiSessioneVersKo.get()); + } + } catch (RuntimeException re) { + log.error(ECCEZIONE_SALVATAGGIO_SESSIONE, re); + tmpReturn = false; + } + if (tmpReturn) { + final URNVersamento urns = calcolaUrn(versamento, documentoVersIn, sessione); + if (urns.getUrn() != null) { + // salvo ORIGINALE + tmpReturn = this.salvaVrsUrnXmlSessioneVers( + MessaggiWSFormat.formattaUrnEsitoVers(urns.getUrn(), + Costanti.UrnFormatter.URN_RAPP_VERS_V2), + TiUrnXmlSessioneVers.ORIGINALE, vrsXmlDatiSessioneVers, vrsXmlDatiSessioneVersKo, + rispostaWS, getIdStrut(versamento)); + } + if (urns.getUrnNormalizzato() != null) { + // salvo NORMALIZZATO + tmpReturn = this.salvaVrsUrnXmlSessioneVers( + MessaggiWSFormat.formattaUrnEsitoVers(urns.getUrnNormalizzato(), + Costanti.UrnFormatter.URN_RAPP_VERS_V2), + TiUrnXmlSessioneVers.NORMALIZZATO, vrsXmlDatiSessioneVers, vrsXmlDatiSessioneVersKo, + rispostaWS, getIdStrut(versamento)); + } + if (vrsXmlDatiSessioneVersBuilder.getDsUrnXmlVers() != null) { + // salvo INIZIALE + tmpReturn = this.salvaVrsUrnXmlSessioneVers(vrsXmlDatiSessioneVersBuilder.getDsUrnXmlVers(), + TiUrnXmlSessioneVers.INIZIALE, vrsXmlDatiSessioneVers, vrsXmlDatiSessioneVersKo, rispostaWS, + getIdStrut(versamento)); + } + } + } return tmpReturn; } + private static URNVersamento calcolaUrn(AbsVersamentoExt versamento, DocumentoVers documentoVersIn, + SyncFakeSessn sessione) { + /* + * calcolo URN + */ + // EVO#16486 + String tmpUrn = null; + String tmpUrnNorm = null; + if (versamento.getStrutturaComponenti() != null + && sessione.getTipoSessioneVers() == SyncFakeSessn.TipiSessioneVersamento.VERSAMENTO) { + // calcolo parte urn ORIGINALE + if (StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartVersatore()) + && StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartChiaveUd())) { + // + tmpUrn = MessaggiWSFormat.formattaBaseUrnUnitaDoc( + versamento.getStrutturaComponenti().getUrnPartVersatore(), + versamento.getStrutturaComponenti().getUrnPartChiaveUd()); + } + // calcolo parte urn NORMALIZZATO + if (StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartVersatoreNormalized()) + && StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartChiaveUdNormalized())) { + // + tmpUrnNorm = MessaggiWSFormat.formattaBaseUrnUnitaDoc( + versamento.getStrutturaComponenti().getUrnPartVersatoreNormalized(), + versamento.getStrutturaComponenti().getUrnPartChiaveUdNormalized()); + } + } else if (documentoVersIn != null + && sessione.getTipoSessioneVers() == SyncFakeSessn.TipiSessioneVersamento.AGGIUNGI_DOCUMENTO) { + // calcolo parte urn ORIGINALE + String tmpUrnPartDoc = null; + // DOCXXXXXX + if (documentoVersIn.getNiOrdDoc() != 0) { + tmpUrnPartDoc = MessaggiWSFormat.formattaUrnPartDocumento(Costanti.CategoriaDocumento.Documento, + documentoVersIn.getNiOrdDoc(), true, Costanti.UrnFormatter.DOC_FMT_STRING_V2, + Costanti.UrnFormatter.PAD5DIGITS_FMT); + } + + if (StringUtils.isNotBlank(tmpUrnPartDoc) + && StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartVersatore()) + && StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartChiaveUd())) { + // + tmpUrn = MessaggiWSFormat.formattaBaseUrnDoc(versamento.getStrutturaComponenti().getUrnPartVersatore(), + versamento.getStrutturaComponenti().getUrnPartChiaveUd(), tmpUrnPartDoc, + Costanti.UrnFormatter.URN_DOC_FMT_STRING_V2); + } + + // calcolo urn NORMALIZZATO + if (StringUtils.isNotBlank(tmpUrnPartDoc) + && StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartVersatoreNormalized()) + && StringUtils.isNotBlank(versamento.getStrutturaComponenti().getUrnPartChiaveUdNormalized())) { + // + tmpUrnNorm = MessaggiWSFormat.formattaBaseUrnDoc( + versamento.getStrutturaComponenti().getUrnPartVersatoreNormalized(), + versamento.getStrutturaComponenti().getUrnPartChiaveUdNormalized(), tmpUrnPartDoc, + Costanti.UrnFormatter.URN_DOC_FMT_STRING_V2); + } + } + final String urn = tmpUrn; + final String urnNormalizzato = tmpUrnNorm; + + // end EVO#16486 + return new URNVersamento() { + @Override + public String getUrn() { + return urn; + } + + @Override + public String getUrnNormalizzato() { + return urnNormalizzato; + } + }; + + } + + private interface URNVersamento { + + String getUrn(); + + String getUrnNormalizzato(); + } + + public List getVrsDocNonVers(long idStruttura, String tipoRegistro, BigDecimal value, String numero, + String idDocumento) { + String queryStr; + javax.persistence.Query query; + queryStr = "select al from VrsDocNonVer al " + "where al.orgStrut.idStrut = :idStrutIn " + + "and al.aaKeyUnitaDoc = :aaKeyUnitaDocIn " + "and al.cdKeyUnitaDoc = :cdKeyUnitaDocIn " + + "and al.cdRegistroKeyUnitaDoc = :cdRegistroKeyUnitaDocIn " + "and al.cdKeyDocVers = :cdKeyDocVersIn"; + query = entityManager.createQuery(queryStr); + query.setParameter("idStrutIn", idStruttura); + query.setParameter("cdRegistroKeyUnitaDocIn", tipoRegistro); + query.setParameter("aaKeyUnitaDocIn", value); + query.setParameter("cdKeyUnitaDocIn", numero); + query.setParameter("cdKeyDocVersIn", idDocumento); + return query.getResultList(); + } + + public List getVrsUnitaDocNonVers(long idStruttura, String tipoRegistro, + BigDecimal aaKeyUnitaDoc, String numero) { + String queryStr; + javax.persistence.Query query; + queryStr = "select al from VrsUnitaDocNonVer al " + "where al.orgStrut.idStrut = :idStrutIn " + + "and al.aaKeyUnitaDoc = :aaKeyUnitaDocIn " + "and al.cdKeyUnitaDoc = :cdKeyUnitaDocIn " + + "and al.cdRegistroKeyUnitaDoc = :cdRegistroKeyUnitaDocIn "; + query = entityManager.createQuery(queryStr); + query.setParameter("idStrutIn", idStruttura); + query.setParameter("cdRegistroKeyUnitaDocIn", tipoRegistro); + query.setParameter("aaKeyUnitaDocIn", aaKeyUnitaDoc); + query.setParameter("cdKeyUnitaDocIn", numero); + return query.getResultList(); + } + /* * Salvataggio XML profilo normativo UniDoc */ @@ -912,10 +1149,7 @@ private boolean udNonVersataNonPresente(CSChiave chiave, long idStruttura) { RispostaControlli rc = controlliSemantici.checkChiave(chiave, idStruttura, ControlliSemantici.TipiGestioneUDAnnullate.CONSIDERA_ASSENTE); - if (rc.getrLong() == -1) { - return true; - } - return false; + return rc.getrLong() == -1; } private boolean docNonVersatoNonPresente(CSChiave chiave, long idStruttura, String idDocumento) { @@ -927,33 +1161,24 @@ private boolean docNonVersatoNonPresente(CSChiave chiave, long idStruttura, Stri } long idUd = rc.getrLong(); rc = controlliSemantici.checkDocumentoInUd(idUd, idDocumento, "DUMMY"); - if (rc.isrBoolean() == true) { - return true; - } - return false; + return rc.isrBoolean(); } - private boolean salvaUrnXmlSessioneVers(VrsXmlDatiSessioneVers xmlDatiSessioneVers, String tmpUrn, - TiUrnXmlSessioneVers tiUrn) { + private boolean salvaVrsUrnXmlSessioneVers(String tmpUrn, TiUrnXmlSessioneVers tiUrn, + Optional xmlDatiSessioneVers, + Optional xmlDatiSessioneVersKo, IRispostaVersWS rispostaWS, BigDecimal idStrut) { boolean tmpReturn = true; - - VrsUrnXmlSessioneVers tmpVrsUrnXmlSessioneVers = new VrsUrnXmlSessioneVers(); - tmpVrsUrnXmlSessioneVers.setDsUrn(tmpUrn); - tmpVrsUrnXmlSessioneVers.setTiUrn(tiUrn); - tmpVrsUrnXmlSessioneVers.setVrsXmlDatiSessioneVers(xmlDatiSessioneVers); - + VrsUrnXmlSessioneVersBuilder builder = VrsUrnXmlSessioneVersBuilder.builder().dsUrn(tmpUrn).tiUrn(tiUrn) + .idStrut(idStrut).vrsXmlDatiSessioneVers(xmlDatiSessioneVers) + .vrsXmlDatiSessioneVersKo(xmlDatiSessioneVersKo); try { - // persist - entityManager.persist(tmpVrsUrnXmlSessioneVers); - entityManager.flush(); + entityManager.persist(isOkOrWarningResponse(rispostaWS) ? builder.buildVrsUrnXmlSessioneVers() + : builder.buildVrsUrnXmlSessioneVersKo()); } catch (RuntimeException re) { - // logga l'errore e blocca tutto log.error("Eccezione nella persistenza della sessione urn xml ", re); tmpReturn = false; } - - xmlDatiSessioneVers.getVrsUrnXmlSessioneVers().add(tmpVrsUrnXmlSessioneVers); - + // TODO#29834 serve? viene usato ? xmlDatiSessioneVers.getVrsUrnXmlSessioneVers().add(tmpVrsUrnXmlSessioneVers) return tmpReturn; } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ObjectStorageService.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ObjectStorageService.java new file mode 100644 index 0000000..0e3571c --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/ObjectStorageService.java @@ -0,0 +1,871 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb; + +import static it.eng.parer.ws.utils.Costanti.AwsConstants.TAG_KEY_RVF_CDSERV; +import static it.eng.parer.ws.utils.Costanti.AwsConstants.TAG_KEY_RVF_NMVERS; +import static it.eng.parer.ws.utils.Costanti.AwsConstants.TAG_KEY_VRSOBJ_TYPE; +import static it.eng.parer.ws.utils.Costanti.AwsConstants.TAG_VALUE_VRSOBJ_FILE_COMP; +import static it.eng.parer.ws.utils.Costanti.AwsConstants.TAG_VALUE_VRSOBJ_METADATI; +import static it.eng.parer.ws.utils.Costanti.AwsConstants.TAG_VALUE_VRSOBJ_TMP; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.time.Instant; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.Base64; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.UUID; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +import javax.ejb.EJB; +import javax.ejb.EJBException; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; + +import org.apache.commons.collections4.SetUtils; +import org.apache.commons.io.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import it.eng.parer.entity.DecServizioVerificaCompDoc; +import it.eng.parer.entity.FirUrnReport; +import it.eng.parer.entity.constraint.AroUpdDatiSpecUnitaDoc.TiEntitaAroUpdDatiSpecUnitaDoc; +import it.eng.parer.entity.constraint.AroVersIniDatiSpec.TiEntitaSacerAroVersIniDatiSpec; +import it.eng.parer.entity.inheritance.oop.AroXmlObjectStorage; +import it.eng.parer.ws.dto.IWSDesc; +import it.eng.parer.ws.utils.Costanti; +import it.eng.parer.ws.utils.CostantiDB; +import it.eng.parer.ws.utils.CostantiDB.TipiHash; +import it.eng.parer.ws.utils.MessaggiWSFormat; +import it.eng.parer.ws.versamento.dto.BackendStorage; +import it.eng.parer.ws.versamento.dto.FileBinario; +import it.eng.parer.ws.versamento.dto.ObjectStorageBackend; +import it.eng.parer.ws.versamento.dto.ObjectStorageResource; +import it.eng.parer.ws.versamento.dto.StrutturaVersamento; +import it.eng.parer.ws.versamento.ejb.help.SalvataggioBackendHelper; +import it.eng.parer.ws.versamento.exceptions.ObjectStorageException; +import it.eng.spagoCore.util.UUIDMdcLogUtil; +import org.apache.commons.lang3.StringUtils; +import software.amazon.awssdk.core.ResponseInputStream; +import software.amazon.awssdk.services.s3.model.GetObjectResponse; +import software.amazon.awssdk.services.s3.model.Tag; + +@Stateless(mappedName = "ObjectStorageService") +@LocalBean +public class ObjectStorageService { + + private final Logger log = LoggerFactory.getLogger(ObjectStorageService.class); + + private static final String STAGING_W = "WRITE_STAGING"; + private static final String COMPONENTI_W = "WRITE_COMPONENTI"; + private static final String SIP_W = "WRITE_SIP"; + private static final String SIP_R = "READ_SIP"; + private static final String REPORTVF_W = "WRITE_REPORTVF"; + // MEV#29276 + private static final String AGG_MD_W = "WRITE_AGG_MD"; + private static final String AGG_MD_SES_ERR_KO_W = "WRITE_SESSIONI_AGG_MD_ERR_KO"; + // end MEV#29276 + + private static final String PATTERN_FORMAT = "yyyyMMdd/HH/mm"; + // + private static final int BUFFER_SIZE = 10 * 1024 * 1024; + + @EJB + private SalvataggioBackendHelper salvataggioBackendHelper; + + /** + * Effettua la lookup per stabilire come sia configurato il backend per l'area di staging + * + * @return tipologia di backend. Al momento sono supportate {@link BackendStorage.STORAGE_TYPE#BLOB} e + * {@link BackendStorage.STORAGE_TYPE#OS} + */ + public BackendStorage lookupBackendVrsStaging() { + try { + String tipoBackend = salvataggioBackendHelper.getBackendStaging(); + + // tipo backend + return salvataggioBackendHelper.getBackend(tipoBackend); + + } catch (ObjectStorageException e) { + // EJB spec (14.2.2 in the EJB 3) + throw new EJBException(e); + } + } + + // MEV#29276 + /** + * Effettua la lookup per stabilire come sia configurato il backend per le sessioni errate/fallite + * dell'aggiornamento metadati + * + * @return tipologia di backend. Al momento sono supportate {@link BackendStorage.STORAGE_TYPE#BLOB} e + * {@link BackendStorage.STORAGE_TYPE#OS} + */ + public BackendStorage lookupBackendVrsSessioniErrKoAggMd() { + try { + String tipoBackend = salvataggioBackendHelper.getBackendSessioniErrKoAggMd(); + + // tipo backend + return salvataggioBackendHelper.getBackend(tipoBackend); + + } catch (Exception e) { + // EJB spec (14.2.2 in the EJB 3) + throw new EJBException(e); + } + } + // end MEV#29276 + + /** + * Effettua il lookup per stabilire come sia configurato il backend per ogni tipo di servizio + * + * @param idTipoUnitaDoc + * id tipologia di unità documentaria + * @param nomeWs + * nome del servizio (vedere {@link IWSDesc}) + * + * @return tipologia di backend. Al momento sono supportate {@link BackendStorage.STORAGE_TYPE#BLOB} e + * {@link BackendStorage.STORAGE_TYPE#OS} + */ + public BackendStorage lookupBackendByServiceName(long idTipoUnitaDoc, String nomeWs) { + try { + + String tipoBackend = salvataggioBackendHelper.getBackendByServiceName(idTipoUnitaDoc, nomeWs); + return salvataggioBackendHelper.getBackend(tipoBackend); + + } catch (ObjectStorageException e) { + // EJB spec (14.2.2 in the EJB 3) + throw new EJBException(e); + } + } + + /** + * Salva il file nel bucket di Staging. + * + * @param nomeBackend + * backend configurato (per esempio OBJECT_STORAGE_PRIMARIO) + * @param resource + * file da salvare + * + * @return risorsa su OS che identifica il file caricato + */ + public ObjectStorageResource createComponenteInStaging(String nomeBackend, File resource) { + try { + ObjectStorageBackend configuration = salvataggioBackendHelper.getObjectStorageConfiguration(nomeBackend, + STAGING_W); + // 1. generate key + final String key = createRandomKey(); + // 2. generate std tag + Set tags = new HashSet<>(); + tags.add(Tag.builder().key(TAG_KEY_VRSOBJ_TYPE).value(TAG_VALUE_VRSOBJ_TMP).build()); + + // 3. put on o.s. + save link + try (FileInputStream fis = new FileInputStream(resource)) { + + ObjectStorageResource savedFile = salvataggioBackendHelper.putObject(fis, resource.length(), key, + configuration, Optional.empty(), Optional.of(tags), + Optional.of(calculateFileBase64(resource.toPath()))); + log.debug("Salvato file {}/{}", savedFile.getBucket(), savedFile.getKey()); + + return savedFile; + } + } catch (ObjectStorageException | NoSuchAlgorithmException | IOException ex) { + throw new EJBException(ex); + } + + } + + /** + * Salva i metadati nel bucket di Staging. + * + * @param nomeBackend + * backend configurato (per esempio OBJECT_STORAGE_PRIMARIO) + * @param xmlFiles + * mappa con i metadati da salvare + * @param idDatiSessioneVersKo + * id dati sessione di versamento + * @param idStrut + * id della struttura versante + * + * @return risorsa su OS che identifica il file caricato + */ + public ObjectStorageResource createSipInStaging(String nomeBackend, Map xmlFiles, + long idDatiSessioneVersKo, BigDecimal idStrut) { + try { + ObjectStorageBackend configuration = salvataggioBackendHelper.getObjectStorageConfiguration(nomeBackend, + STAGING_W); + // generate std tag + Set tags = new HashSet<>(); + tags.add(Tag.builder().key(TAG_KEY_VRSOBJ_TYPE).value(TAG_VALUE_VRSOBJ_METADATI).build()); + // punt on O.S. + ObjectStorageResource savedFile = createSipXmlMapAndPutOnBucket(xmlFiles, configuration, tags); + // link + salvataggioBackendHelper.saveObjectStorageLinkSipSessione(savedFile, nomeBackend, idDatiSessioneVersKo, + idStrut); + return savedFile; + } catch (ObjectStorageException | IOException | NoSuchAlgorithmException ex) { + throw new EJBException(ex); + } + } + + /** + * Aggiunti l'oggetto all'object storage di destinazione, sul bucket definitivo. + * + * @param nomeBackendDest + * nome del backend di destinazione (tendenzialmente OBJECT_STORAGE_PRIMARIO) + * @param idCompDoc + * id del componente + * @param riferimentoBlob + * File (o riferimento) da caricare + * + * @return Dettaglio della risorsa caricata + */ + public ObjectStorageResource createOrCopyResourceInComponenti(String nomeBackendDest, long idCompDoc, + FileBinario riferimentoBlob) { + try { + + ObjectStorageBackend destinationConfiguration = salvataggioBackendHelper + .getObjectStorageConfiguration(nomeBackendDest, COMPONENTI_W); + + final String destKey = salvataggioBackendHelper.generateKeyComponente(idCompDoc); + + ObjectStorageResource newComponente; + // stabilisci dove sia l'oggetto in staging (object storage o filesystem). + BackendStorage lookupBackendStaging = lookupBackendVrsStaging(); + if (lookupBackendStaging.isObjectStorage()) { + ObjectStorageBackend sourceConfiguration = salvataggioBackendHelper + .getObjectStorageConfiguration(lookupBackendStaging.getBackendName(), STAGING_W); + final String sourceKey = riferimentoBlob.getObjectStorageResource().getKey(); + newComponente = salvataggioBackendHelper.createObjectComponenti(sourceKey, sourceConfiguration, destKey, + destinationConfiguration); + } else { + newComponente = salvataggioBackendHelper.createObjectComponenti(riferimentoBlob.getFileSuDisco(), + destKey, destinationConfiguration); + } + + salvataggioBackendHelper.saveObjectStorageLinkCompDoc(newComponente, nomeBackendDest, idCompDoc); + + return newComponente; + + } catch (ObjectStorageException ex) { + throw new EJBException(ex); + } + + } + + /** + * Salva il file nel bucket dei SIP per l'unita documentaria + * + * @param nomeBackend + * backend configurato (per esempio OBJECT_STORAGE_PRIMARIO) + * @param xmlFiles + * file Xml da salvare (previa creazione file zip) + * @param idUnitaDoc + * id unita documentaria + * + * @return risorsa su OS che identifica il file caricato + */ + public ObjectStorageResource createResourcesInSipUnitaDoc(String nomeBackend, Map xmlFiles, + long idUnitaDoc) { + try { + ObjectStorageBackend configuration = salvataggioBackendHelper.getObjectStorageConfiguration(nomeBackend, + SIP_W); + // put on O.S. + ObjectStorageResource savedFile = createSipXmlMapAndPutOnBucket(xmlFiles, configuration, + SetUtils.emptySet()); + // link + salvataggioBackendHelper.saveObjectStorageLinkSipUd(savedFile, nomeBackend, idUnitaDoc); + return savedFile; + } catch (ObjectStorageException | IOException | NoSuchAlgorithmException ex) { + throw new EJBException(ex); + } + + } + + /** + * Salva il file nel bucket dei SIP per il documento + * + * @param nomeBackend + * backend configurato (per esempio OBJECT_STORAGE_PRIMARIO) + * @param xmlFiles + * file Xml da salvare (previa creazione file zip) + * @param idDoc + * id documento + * + * @return risorsa su OS che identifica il file caricato + */ + public ObjectStorageResource createResourcesInSipDocumento(String nomeBackend, Map xmlFiles, + long idDoc) { + try { + ObjectStorageBackend configuration = salvataggioBackendHelper.getObjectStorageConfiguration(nomeBackend, + SIP_W); + // put on O.S. + ObjectStorageResource savedFile = createSipXmlMapAndPutOnBucket(xmlFiles, configuration, + SetUtils.emptySet()); + // link + salvataggioBackendHelper.saveObjectStorageLinkSipDoc(savedFile, nomeBackend, idDoc); + return savedFile; + } catch (ObjectStorageException | IOException | NoSuchAlgorithmException ex) { + throw new EJBException(ex); + } + + } + + // MEV#29276 + /** + * Salva i metadati nel bucket delle sessioni fallite. + * + * @param nomeBackend + * backend configurato (per esempio OBJECT_STORAGE_PRIMARIO) + * @param xmlFiles + * mappa con i metadati da salvare + * @param idSesUpdUnitaDocKo + * id sessione fallita + * @param idStrut + * id della struttura versante + * + * @return risorsa su OS che identifica il file caricato + */ + public ObjectStorageResource createSipInSessioniKoAggMd(String nomeBackend, Map xmlFiles, + long idSesUpdUnitaDocKo, BigDecimal idStrut) { + try { + ObjectStorageBackend configuration = salvataggioBackendHelper.getObjectStorageConfiguration(nomeBackend, + AGG_MD_SES_ERR_KO_W); + // punt on O.S. + ObjectStorageResource savedFile = createSipXmlMapAndPutOnBucket(xmlFiles, configuration, + SetUtils.emptySet()); + // link + salvataggioBackendHelper.saveObjectStorageLinkSipSessioneKoAggMd(savedFile, nomeBackend, idSesUpdUnitaDocKo, + idStrut); + return savedFile; + } catch (ObjectStorageException | IOException | NoSuchAlgorithmException ex) { + throw new EJBException(ex); + } + } + + /** + * Salva i metadati nel bucket delle sessioni errate. + * + * @param nomeBackend + * backend configurato (per esempio OBJECT_STORAGE_PRIMARIO) + * @param xmlFiles + * mappa con i metadati da salvare + * @param idSesUpdUnitaDocErr + * id sessione errata + * @param idStrut + * id della struttura versante + * + * @return risorsa su OS che identifica il file caricato + */ + public ObjectStorageResource createSipInSessioniErrAggMd(String nomeBackend, Map xmlFiles, + long idSesUpdUnitaDocErr, BigDecimal idStrut) { + try { + ObjectStorageBackend configuration = salvataggioBackendHelper.getObjectStorageConfiguration(nomeBackend, + AGG_MD_SES_ERR_KO_W); + // punt on O.S. + ObjectStorageResource savedFile = createSipXmlMapAndPutOnBucket(xmlFiles, configuration, + SetUtils.emptySet()); + // link + salvataggioBackendHelper.saveObjectStorageLinkSipSessioneErrAggMd(savedFile, nomeBackend, + idSesUpdUnitaDocErr, idStrut); + return savedFile; + } catch (ObjectStorageException | IOException | NoSuchAlgorithmException ex) { + throw new EJBException(ex); + } + } + + /** + * Salva il file nel bucket dei SIP per l'aggiornamento metadati + * + * @param urn + * urn normalizzato + * @param nomeBackend + * backend configurato (per esempio OBJECT_STORAGE_PRIMARIO) + * @param xmlFiles + * file Xml da salvare (previa creazione file zip) + * @param idUpdUnitaDoc + * id aggiornamento metadati + * @param idStrut + * id della struttura versante + * + * @return risorsa su OS che identifica il file caricato + */ + public ObjectStorageResource createResourcesInSipAggMd(final String urn, String nomeBackend, + Map xmlFiles, long idUpdUnitaDoc, BigDecimal idStrut) { + try { + ObjectStorageBackend configuration = salvataggioBackendHelper.getObjectStorageConfiguration(nomeBackend, + AGG_MD_W); + // put on O.S. + ObjectStorageResource savedFile = createSipXmlMapAndPutOnBucket(urn, xmlFiles, configuration, + SetUtils.emptySet()); + // link + salvataggioBackendHelper.saveObjectStorageLinkSipAggMd(savedFile, nomeBackend, idUpdUnitaDoc, idStrut); + return savedFile; + } catch (ObjectStorageException | IOException | NoSuchAlgorithmException ex) { + throw new EJBException(ex); + } + + } + + /** + * Salva il file nel bucket dei Dati Specifici per l'aggiornamento metadati + * + * @param urn + * urn normalizzato + * @param nomeBackend + * backend configurato (per esempio OBJECT_STORAGE_PRIMARIO) + * @param xmlFiles + * file Xml da salvare (previa creazione file zip) + * @param idEntitySacerUpd + * id aggiornamento metadati + * @param tipoEntitySacerUpd + * tipo entità aggiornamento (per esempio UPD_UNI_DOC) + * @param idStrut + * id della struttura versante + * + * @return risorsa su OS che identifica il file caricato + */ + public ObjectStorageResource createResourcesInUpdDatiSpecAggMd(final String urn, String nomeBackend, + Map xmlFiles, long idEntitySacerUpd, TiEntitaAroUpdDatiSpecUnitaDoc tipoEntitySacerUpd, + BigDecimal idStrut) { + try { + ObjectStorageBackend configuration = salvataggioBackendHelper.getObjectStorageConfiguration(nomeBackend, + AGG_MD_W); + + // put on O.S. + ObjectStorageResource savedFile = createDatiSpecXmlMapAndPutOnBucket(urn, xmlFiles, configuration, + SetUtils.emptySet()); + // link + salvataggioBackendHelper.saveObjectStorageLinkUpdDatiSpecAggMd(savedFile, nomeBackend, idEntitySacerUpd, + tipoEntitySacerUpd, idStrut); + return savedFile; + } catch (ObjectStorageException | IOException | NoSuchAlgorithmException ex) { + throw new EJBException(ex); + } + + } + + /** + * Salva il file nel bucket dei Dati Specifici relativi ai metadati iniziali per l'aggiornamento metadati + * + * @param urn + * urn normalizzato + * @param nomeBackend + * backend configurato (per esempio OBJECT_STORAGE_PRIMARIO) + * @param xmlFiles + * file Xml da salvare (previa creazione file zip) + * @param idEntitySacerVersIni + * id versamento iniziale + * @param tipoEntitySacerVersIni + * tipo entità versamento iniziale (per esempio UNI_DOC) + * @param idStrut + * id della struttura versante + * + * @return risorsa su OS che identifica il file caricato + */ + public ObjectStorageResource createResourcesInVersIniDatiSpecAggMd(final String urn, String nomeBackend, + Map xmlFiles, long idEntitySacerVersIni, + TiEntitaSacerAroVersIniDatiSpec tipoEntitySacerVersIni, BigDecimal idStrut) { + try { + ObjectStorageBackend configuration = salvataggioBackendHelper.getObjectStorageConfiguration(nomeBackend, + AGG_MD_W); + + // put on O.S. + ObjectStorageResource savedFile = createDatiSpecXmlMapAndPutOnBucket(urn, xmlFiles, configuration, + SetUtils.emptySet()); + // link + salvataggioBackendHelper.saveObjectStorageLinkVersIniDatiSpecAggMd(savedFile, nomeBackend, + idEntitySacerVersIni, tipoEntitySacerVersIni, idStrut); + return savedFile; + } catch (ObjectStorageException | IOException | NoSuchAlgorithmException ex) { + throw new EJBException(ex); + } + + } + + private ObjectStorageResource createDatiSpecXmlMapAndPutOnBucket(final String urn, Map xmlFiles, + ObjectStorageBackend configuration, Set tags) + throws IOException, ObjectStorageException, NoSuchAlgorithmException { + ObjectStorageResource savedFile = null; + Path tempZip = Files.createTempFile("dati_spec-", ".zip"); + // + try (InputStream is = Files.newInputStream(tempZip)) { + // create key + final String key = createRandomKey(urn) + ".zip"; + // create zip file + createZipFile(xmlFiles, tempZip); + // put on O.S. + savedFile = salvataggioBackendHelper.putObject(is, Files.size(tempZip), key, configuration, + Optional.empty(), Optional.of(tags), Optional.of(calculateFileBase64(tempZip))); + log.debug("Salvato file {}/{}", savedFile.getBucket(), savedFile.getKey()); + } finally { + if (tempZip != null) { + Files.delete(tempZip); + } + } + + return savedFile; + } + // end MEV#29276 + + private ObjectStorageResource createSipXmlMapAndPutOnBucket(Map xmlFiles, + ObjectStorageBackend configuration, Set tags) + throws IOException, ObjectStorageException, NoSuchAlgorithmException { + + return createSipXmlMapAndPutOnBucket(null, xmlFiles, configuration, tags); + } + + private ObjectStorageResource createSipXmlMapAndPutOnBucket(final String urn, Map xmlFiles, + ObjectStorageBackend configuration, Set tags) + throws IOException, ObjectStorageException, NoSuchAlgorithmException { + ObjectStorageResource savedFile = null; + Path tempZip = Files.createTempFile("sip-", ".zip"); + // + try (InputStream is = Files.newInputStream(tempZip)) { + // create key + final String key; + if (StringUtils.isBlank(urn)) { + key = createRandomKey() + ".zip"; + } else { + key = createRandomKey(urn) + ".zip"; + } + // create zip file + createZipFile(xmlFiles, tempZip); + // put on O.S. + savedFile = salvataggioBackendHelper.putObject(is, Files.size(tempZip), key, configuration, + Optional.empty(), Optional.of(tags), Optional.of(calculateFileBase64(tempZip))); + log.debug("Salvato file {}/{}", savedFile.getBucket(), savedFile.getKey()); + } finally { + if (tempZip != null) { + Files.delete(tempZip); + } + } + + return savedFile; + } + + /** + * Salva, nella tabella di raccordo VRS_FILE_SES_OBJECT_STORAGE_KO, la chiave del file presente + * nell'area di staging che rappresenta il versamento fallito. Grazie alla policy di lifecycle dopo 6 mesi verrà + * eliminato. + * + * @param stagingResource + * risorsa salvata in staging + * @param nomeBackend + * nome del backend della suddetta risorsa + * @param idFileSessioneKo + * identificativo del fiele delle sessione + * @param idStrut + * id della struttura versante + */ + public void saveLinkFileSessFromObjectStorage(ObjectStorageResource stagingResource, String nomeBackend, + long idFileSessioneKo, BigDecimal idStrut) { + try { + salvataggioBackendHelper.saveObjectStorageLinkFileSessione(stagingResource, nomeBackend, idFileSessioneKo, + idStrut); + } catch (ObjectStorageException ex) { + throw new EJBException(ex); + + } + } + + /** + * Invio report verifica firma (zip archive) + * + * A differenza degli altri metodi definiti in questa classe, questo può fallire. In caso di + * fallimento, quindi, verrà restituto null. + * + * @param nomeBackend + * ome del backend dei report della verifica delle firme + * @param idCompDoc + * id componente + * @param idFirReport + * id report + * @param strutV + * wrapper dati versamento + * @param servizioFirma + * servizio verifica firma + * @param firUrnReports + * URN generati + * @param reportZip + * report verifia firma (zip archive) + * + * @return risorsa su OS che identifica il file caricato oppure null + * + * @throws ObjectStorageException + * eccezione generica + */ + public ObjectStorageResource createResourceInRerportvf(String nomeBackend, long idCompDoc, long idFirReport, + StrutturaVersamento strutV, DecServizioVerificaCompDoc servizioFirma, List firUrnReports, + Path reportZip) throws ObjectStorageException { + try (InputStream is = Files.newInputStream(reportZip)) { + + ObjectStorageBackend configuration = salvataggioBackendHelper.getObjectStorageConfiguration(nomeBackend, + REPORTVF_W); + + // calculate key + final String cdKeyFile = MessaggiWSFormat.formattaComponenteCdKeyFile(strutV.getVersatoreNonverificato(), + strutV.getChiaveNonVerificata(), idCompDoc, Optional.of(idFirReport), + Costanti.AwsFormatter.COMP_REPORTVF_CD_KEY_FILE_FMT); + + // 1. generate tags + Set tags = new HashSet<>(); + // Opzionale + tags.add(Tag.builder().key(TAG_KEY_RVF_CDSERV).value(servizioFirma.getCdServizio().toString()).build()); + tags.add(Tag.builder().key(TAG_KEY_RVF_NMVERS).value(servizioFirma.getNmVersione()).build()); + + ObjectStorageResource resource = salvataggioBackendHelper.putObject(is, Files.size(reportZip), cdKeyFile, + configuration, Optional.empty(), Optional.of(tags), Optional.of(calculateFileBase64(reportZip))); + + log.debug("Salvato {} sul bucket {} con eTag {}", cdKeyFile, resource.getBucket(), resource.getETag()); + + return resource; + } catch (IOException | NoSuchAlgorithmException ex) { + log.error("createResourceInRerportvf errore su invio report ad object storage", ex); + return null; + } + } + + /** + * Crea i file zip contenente i vari xml di versamento.Possono essere di tipo: + *

    + *
  • {@link CostantiDB.TipiXmlDati#RICHIESTA}, obbligatorio è il sip di versamento
  • + *
  • {@link CostantiDB.TipiXmlDati#RISPOSTA}, obbligatorio è la risposta del sip di versamento
  • + *
  • {@link CostantiDB.TipiXmlDati#RAPP_VERS}, obbligatorio è il rapporto di versamento
  • + *
  • {@link CostantiDB.TipiXmlDati#INDICE_FILE}, è presente solo nel caso di Versamento Multimedia
  • + *
+ * + * + * @param xmlFiles + * mappa dei file delle tipologie indicate in descrizione. + * @param zipFile + * file zip su cui salvare tutto + * + * @throws IOException + * in caso di errore + */ + private void createZipFile(Map xmlFiles, Path zipFile) throws IOException { + try (ZipOutputStream out = new ZipOutputStream(Files.newOutputStream(zipFile))) { + for (Entry sipBlob : xmlFiles.entrySet()) { + ZipEntry entry = new ZipEntry(sipBlob.getKey() + ".xml"); + out.putNextEntry(entry); + out.write(sipBlob.getValue().getBytes()); + out.closeEntry(); + } + } + } + + /** + * Crea una chiave utilizzando i seguenti elementi separati dal carattere /: + *
    + *
  • data in formato anno mese giorno (per esempio 20221124)
  • + *
  • ora a due cifre (per esempio 14)
  • + *
  • minuto a due cifre (per esempio 05)
  • + *
  • UUID sessione di versamento 550e8400-e29b-41d4-a716-446655440000) recuperato dall'MDC ossia + * dal Mapped Diagnostic Context (se non esiste viene generato comunque un UUID)
  • + *
  • UUID generato runtime 28fd282d-fbe6-4528-bd28-2dfbe685286f) per ogni oggetto caricato
  • + *
+ * + * Esempio di chiave completa: + * 20221124/14/05/550e8400-e29b-41d4-a716-446655440000/28fd282d-fbe6-4528-bd28-2dfbe685286f + * + * @return chiave dell'oggetto + */ + private static String createRandomKey() { + + String when = DateTimeFormatter.ofPattern(PATTERN_FORMAT).withZone(ZoneId.systemDefault()) + .format(Instant.now()); + + return when + "/" + UUIDMdcLogUtil.getUuid() + "/" + UUID.randomUUID().toString(); + } + + /** + * Crea una chiave utilizzando i seguenti elementi separati dal carattere /: + *
    + *
  • data in formato anno mese giorno (per esempio 20221124)
  • + *
  • ora a due cifre (per esempio 14)
  • + *
  • minuto a due cifre (per esempio 05)
  • + *
  • URN
  • + *
  • UUID generato runtime 28fd282d-fbe6-4528-bd28-2dfbe685286f) per ogni oggetto caricato
  • + *
+ * + * Esempio di chiave completa: + * 20221124/14/05/550e8400-e29b-41d4-a716-446655440000/28fd282d-fbe6-4528-bd28-2dfbe685286f + * + * @return chiave dell'oggetto + */ + private static String createRandomKey(final String urn) { + + String when = DateTimeFormatter.ofPattern(PATTERN_FORMAT).withZone(ZoneId.systemDefault()) + .format(Instant.now()); + + return when + "/" + urn + "/" + UUID.randomUUID().toString(); + } + + /** + * Calcola il message digest MD5 (base64 encoded) del file da inviare via S3 + * + * Nota: questa scelta deriva dal modello supportato dal vendor + * (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) * + * + * @param path + * file + * + * @return rappresentazione base64 del contenuto calcolato + * + * @throws NoSuchAlgorithmException + * errore generico + * @throws IOException + * errore generico + */ + private String calculateFileBase64(Path resource) throws NoSuchAlgorithmException, IOException { + byte[] buffer = new byte[BUFFER_SIZE]; + int readed; + MessageDigest digester = MessageDigest.getInstance(TipiHash.MD5.descrivi()); + try (InputStream is = Files.newInputStream(resource)) { + while ((readed = is.read(buffer)) != -1) { + digester.update(buffer, 0, readed); + } + } + return Base64.getEncoder().encodeToString(digester.digest()); + + } + + /** + * Ottieni, in una mappa, la lista degli xml di versamento classificati nelle tipologie definite qui + * {@link it.eng.parer.ws.utils.CostantiDB.TipiXmlDati} per l'unita documentaria + * + * @param idUnitaDoc + * id unita documentaria + * + * @return mappa degli XML + */ + public Map getObjectSipUnitaDoc(long idUnitaDoc) { + try { + + return getObjectSip(salvataggioBackendHelper.getLinkSipUnitaDocOs(idUnitaDoc)); + } catch (IOException | ObjectStorageException e) { + // EJB spec (14.2.2 in the EJB 3) + throw new EJBException(e); + } + } + + /** + * Ottieni, in una mappa, la lista degli xml di versamento classificati nelle tipologie definite qui + * {@link it.eng.parer.ws.utils.CostantiDB.TipiXmlDati} per il documento + * + * @param idDoc + * id documento + * + * @return mappa degli XML + */ + public Map getObjectSipDoc(long idDoc) { + try { + return getObjectSip(salvataggioBackendHelper.getLinkSipDocOs(idDoc)); + } catch (IOException | ObjectStorageException e) { + // EJB spec (14.2.2 in the EJB 3) + throw new EJBException(e); + } + } + + private Map getObjectSip(AroXmlObjectStorage xmlObjectStorage) + throws ObjectStorageException, IOException { + if (!Objects.isNull(xmlObjectStorage)) { + ObjectStorageBackend config = salvataggioBackendHelper + .getObjectStorageConfiguration(xmlObjectStorage.getDecBackend().getNmBackend(), SIP_R); + ResponseInputStream object = salvataggioBackendHelper.getObject(config, + xmlObjectStorage.getNmBucket(), xmlObjectStorage.getCdKeyFile()); + return unzipFile(object); + } else { + return Collections.emptyMap(); + } + } + + private Map unzipFile(ResponseInputStream inputStream) throws IOException { + // TipiXmlDati + final String xml = ".xml"; + final Map xmlVers = new HashMap<>(); + try (ZipInputStream zis = new ZipInputStream(inputStream);) { + ZipEntry ze = zis.getNextEntry(); + while (ze != null) { + String value = IOUtils.toString(zis, StandardCharsets.UTF_8); + if (ze.getName().equals(CostantiDB.TipiXmlDati.RICHIESTA + xml)) { + xmlVers.put(CostantiDB.TipiXmlDati.RICHIESTA, value); + } else if (ze.getName().equals(CostantiDB.TipiXmlDati.RISPOSTA + xml)) { + xmlVers.put(CostantiDB.TipiXmlDati.RISPOSTA, value); + } else if (ze.getName().equals(CostantiDB.TipiXmlDati.RAPP_VERS + xml)) { + xmlVers.put(CostantiDB.TipiXmlDati.RAPP_VERS, value); + } else if (ze.getName().equals(CostantiDB.TipiXmlDati.INDICE_FILE + xml)) { + xmlVers.put(CostantiDB.TipiXmlDati.INDICE_FILE, value); + } else { + log.warn( + "Attenzione, l'entry con nome {} non è stata riconosciuta nel file zip dei SIP di versamento", + ze.getName()); + } + zis.closeEntry(); + ze = zis.getNextEntry(); + } + } + return xmlVers; + } + + /** + * + * Tagging della componente su bucket per gestione lifecycle su tagging vrs-object-type=file_componente_uddoc + * + * @param stagingResource + * risorsa salvata in staging + * @param nomeBackend + * nome del backend della suddetta risorsa + */ + public void tagComponenteInStaging(ObjectStorageResource stagingResource, String nomeBackend) { + try { + // get base config for staging writing + ObjectStorageBackend configuration = salvataggioBackendHelper.getObjectStorageConfiguration(nomeBackend, + STAGING_W); + + // generate std tag + Set tags = new HashSet<>(); + tags.add(Tag.builder().key(TAG_KEY_VRSOBJ_TYPE).value(TAG_VALUE_VRSOBJ_FILE_COMP).build()); + + salvataggioBackendHelper.taggingObject(stagingResource, configuration, tags); + } catch (ObjectStorageException ex) { + throw new EJBException(ex); + + } + } + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/RapportoVersBuilder.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/RapportoVersBuilder.java index 6bd49fe..84db7b6 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/RapportoVersBuilder.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/RapportoVersBuilder.java @@ -1,9 +1,24 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.ejb; -import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.StringWriter; -import java.nio.charset.StandardCharsets; import java.security.NoSuchAlgorithmException; import java.text.MessageFormat; @@ -13,16 +28,10 @@ import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import javax.xml.bind.Marshaller; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.apache.xml.security.c14n.Canonicalizer; -import org.w3c.dom.Document; -import org.xml.sax.InputSource; -import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; import it.eng.parer.exception.SacerWsException; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.ejb.XmlVersCache; @@ -165,7 +174,7 @@ public RispostaControlli produciEsitoVecchioRapportoVers(VersamentoExt versament try { RispostaControlli tmpRisp = controlliRappVers.trovaVersSessUd(idElemento); if (tmpRisp.getrLong() > 0) { - tmpRisp = controlliRappVers.leggiXmlRappVers(tmpRisp.getrLong()); + tmpRisp = controlliRappVers.leggiXmlRappVersFromUd(tmpRisp.getrLong(), idElemento); String xml; if (tmpRisp.getrString() != null) { xml = tmpRisp.getrString(); @@ -207,7 +216,7 @@ public RispostaControlli produciEsitoVecchioRapportoVers(VersamentoExtAggAll ver RispostaControlli tmpRisp = controlliRappVers.trovaVersSessDoc(idElemento, versamento.getStrutturaComponenti().getIdUnitaDoc()); if (tmpRisp.getrLong() > 0) { - tmpRisp = controlliRappVers.leggiXmlRappVers(tmpRisp.getrLong()); + tmpRisp = controlliRappVers.leggiXmlRappVersFromDoc(tmpRisp.getrLong(), idElemento); String xml; if (tmpRisp.getrString() != null) { @@ -305,10 +314,7 @@ public RispostaControlli produciEsitoNuovoRapportoVers(VersamentoExt versamento, tmpMarshaller.marshal(tmpRappVers, tmpStringWriter); sessione.setDatiRapportoVersamento(tmpStringWriter.toString()); - /* - * sessione.setHashRapportoVersamento( new HashCalculator() - * .calculateHash(sessione.getDatiRapportoVersamento()) .toHexBinary()); - */ + sessione.setHashRapportoVersamento(new HashCalculator() .calculateHashSHAX(sessione.getDatiRapportoVersamento(), TipiHash.SHA_256).toHexBinary()); // @@ -332,12 +338,6 @@ public RispostaControlli produciEsitoNuovoRapportoVers(VersamentoExtAggAll versa try { // calcolo l'URN del documento - /* - * String tmpUrn = MessaggiWSFormat.formattaBaseUrnDoc( - * versamento.getStrutturaComponenti().getUrnPartVersatore(), - * versamento.getStrutturaComponenti().getUrnPartChiaveUd(), - * versamento.getStrutturaComponenti().getDocumentiAttesi().get(0).getUrnPartDocumento()); - */ String tmpUrn = MessaggiWSFormat .formattaBaseUrnDoc(versamento.getStrutturaComponenti().getUrnPartVersatore(), @@ -386,10 +386,7 @@ public RispostaControlli produciEsitoNuovoRapportoVers(VersamentoExtAggAll versa tmpMarshaller.marshal(tmpRappVers, tmpStringWriter); sessione.setDatiRapportoVersamento(tmpStringWriter.toString()); - /* - * sessione.setHashRapportoVersamento( new HashCalculator() - * .calculateHash(sessione.getDatiRapportoVersamento()) .toHexBinary()); - */ + sessione.setHashRapportoVersamento(new HashCalculator() .calculateHashSHAX(sessione.getDatiRapportoVersamento(), TipiHash.SHA_256).toHexBinary()); // @@ -444,13 +441,11 @@ private RapportoVersamento inizializzaRapportoVersamento(String tmpUrn, SyncFake rapportoVersamento.setSIP(tmpSip); tmpSip.setURNIndiceSIP(sessione.getUrnIndiceSipXml()); tmpSip.setHashIndiceSIP(sessione.getHashIndiceSipXml()); - // tmpSip.setAlgoritmoHashIndiceSIP(CostantiDB.TipiHash.SHA_1.descrivi()); tmpSip.setAlgoritmoHashIndiceSIP(CostantiDB.TipiHash.SHA_256.descrivi()); tmpSip.setEncodingHashIndiceSIP(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()); if (sessione.getDatiPackInfoSipXml() != null) { tmpSip.setURNPISIP(sessione.getUrnPackInfoSipXml()); tmpSip.setHashPISIP(sessione.getHashPackInfoSipXml()); - // tmpSip.setAlgoritmoHashPISIP(CostantiDB.TipiHash.SHA_1.descrivi()); tmpSip.setAlgoritmoHashPISIP(CostantiDB.TipiHash.SHA_256.descrivi()); tmpSip.setEncodingHashPISIP(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()); } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/SalvataggioSync.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/SalvataggioSync.java index ff496ba..f235876 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/SalvataggioSync.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/SalvataggioSync.java @@ -1,13 +1,64 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.ejb; +import static it.eng.parer.util.DateUtilsConverter.convert; +import static it.eng.parer.util.DateUtilsConverter.format; +import static it.eng.parer.util.FlagUtilsConverter.booleanToFlag; +import static it.eng.parer.ws.utils.Costanti.ERRORE_CLIENT_ERRATO; + +import java.io.FileInputStream; +import java.io.IOException; +import java.math.BigDecimal; +import java.security.NoSuchAlgorithmException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; +import javax.ejb.TransactionAttribute; +import javax.ejb.TransactionAttributeType; +import javax.persistence.EntityManager; +import javax.persistence.LockModeType; +import javax.persistence.PersistenceContext; +import javax.persistence.Query; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import it.eng.parer.entity.AroArchivSec; -import it.eng.parer.entity.AroBustaCrittog; import it.eng.parer.entity.AroCompDoc; import it.eng.parer.entity.AroCompUrnCalc; import it.eng.parer.entity.AroDoc; -import it.eng.parer.entity.AroFirmaComp; import it.eng.parer.entity.AroLinkUnitaDoc; -import it.eng.parer.entity.AroMarcaComp; import it.eng.parer.entity.AroStrutDoc; import it.eng.parer.entity.AroUnitaDoc; import it.eng.parer.entity.AroUpdUnitaDoc; @@ -31,7 +82,6 @@ import it.eng.parer.entity.ElvDocAggDaElabElenco; import it.eng.parer.entity.ElvUdVersDaElabElenco; import it.eng.parer.entity.FasFascicolo; -import it.eng.parer.entity.FirReport; import it.eng.parer.entity.IamUser; import it.eng.parer.entity.MonAaUnitaDocRegistro; import it.eng.parer.entity.OrgStrut; @@ -41,12 +91,13 @@ import it.eng.parer.entity.VrsXmlDatiSessioneVers; import it.eng.parer.entity.constraint.AroCompUrnCalc.TiUrn; import it.eng.parer.entity.constraint.VrsUrnXmlSessioneVers.TiUrnXmlSessioneVers; -import it.eng.parer.viewEntity.VrsVLisXmlDocUrnDaCalc; -import it.eng.parer.viewEntity.VrsVLisXmlUdUrnDaCalc; -import it.eng.parer.viewEntity.VrsVLisXmlUpdUrnDaCalc; import it.eng.parer.firma.dto.CompDocMock; import it.eng.parer.firma.ejb.SalvataggioFirmaManager; -import it.eng.parer.firma.util.VerificaFirmaEnums; +import it.eng.parer.firma.util.VerificaFirmaEnums.SacerIndication; +import it.eng.parer.util.Constants; +import it.eng.parer.view_entity.VrsVLisXmlDocUrnDaCalc; +import it.eng.parer.view_entity.VrsVLisXmlUdUrnDaCalc; +import it.eng.parer.view_entity.VrsVLisXmlUpdUrnDaCalc; import it.eng.parer.ws.dto.IRispostaWS; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.BinEncUtility; @@ -64,11 +115,13 @@ import it.eng.parer.ws.utils.MessaggiWSBundle; import it.eng.parer.ws.utils.MessaggiWSFormat; import it.eng.parer.ws.versamento.dto.AbsVersamentoExt; +import it.eng.parer.ws.versamento.dto.BackendStorage; import it.eng.parer.ws.versamento.dto.ComponenteVers; import it.eng.parer.ws.versamento.dto.DatoSpecifico; import it.eng.parer.ws.versamento.dto.DocumentoVers; import it.eng.parer.ws.versamento.dto.FileBinario; import it.eng.parer.ws.versamento.dto.IRispostaVersWS; +import it.eng.parer.ws.versamento.dto.ObjectStorageResource; import it.eng.parer.ws.versamento.dto.RispostaWS; import it.eng.parer.ws.versamento.dto.RispostaWSAggAll; import it.eng.parer.ws.versamento.dto.StrutturaVersamento; @@ -83,48 +136,18 @@ import it.eng.parer.ws.xml.versReq.ChiaveType; import it.eng.parer.ws.xml.versReq.UnitaDocAggAllegati; import it.eng.parer.ws.xml.versReq.UnitaDocumentaria; -import java.io.FileInputStream; -import java.io.IOException; -import java.math.BigDecimal; -import java.security.NoSuchAlgorithmException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Calendar; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import javax.ejb.EJB; -import javax.ejb.LocalBean; -import javax.ejb.Stateless; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.persistence.EntityManager; -import javax.persistence.LockModeType; -import javax.persistence.PersistenceContext; -import javax.persistence.Query; -import org.apache.commons.lang3.StringUtils; -import static it.eng.parer.util.DateUtilsConverter.convert; -import static it.eng.parer.util.DateUtilsConverter.format; - -import org.apache.commons.lang3.exception.ExceptionUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * * @author Fioravanti_F */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "SalvataggioSync") @LocalBean public class SalvataggioSync { private static final Logger log = LoggerFactory.getLogger(SalvataggioSync.class); + public static final String ERROR_PERSISTENZA_UD = "Eccezione nella persistenza dell'unità documentaria "; // @PersistenceContext(unitName = "ParerJPA") private EntityManager entityManager; @@ -134,12 +157,14 @@ public class SalvataggioSync { // @EJB private WriteCompBlbOracle writeCompBlbOracle; + + @EJB + private ObjectStorageService objectStorageService; + @EJB private SalvataggioFirmaManager salvataggioFirmaManager; // - private final static int DS_ERR_MAX_LEN = 1024; - // - private final static String LOCKNAME_CREA_DIRECTORY_VERS_TPI = "CREA_DIRECTORY_VERS_TPI"; + private static final int DS_ERR_MAX_LEN = 1024; @TransactionAttribute(TransactionAttributeType.REQUIRED) public boolean salvaDatiVersamento(VersamentoExt versamento, RispostaWS rispostaWS) { @@ -160,59 +185,52 @@ public boolean salvaDatiVersamento(VersamentoExt versamento, RispostaWS risposta } // SALVO UNITA' DOCUMENTARIA - if (prosegui) { - if (!this.salvaUnitaDoc(versamento.getStrutturaComponenti(), versamento.getVersamento(), rispostaWS)) { - prosegui = false; - } + if (prosegui && !this.salvaUnitaDoc(versamento.getStrutturaComponenti(), versamento.getVersamento(), + rispostaWS)) { + prosegui = false; } // SALVO UNITA' DOCUMENTARIA DA INSERIRE NELL'ELENCO DI VERSAMENTO - if (prosegui) { - if (!this.salvaUdElencoVers(versamento.getStrutturaComponenti(), versamento.getVersamento())) { - rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, - "Eccezione nella persistenza dell'unità documentaria da inserire nell'elenco di versamento"); - prosegui = false; - } + if (prosegui && !this.salvaUdElencoVers(versamento.getStrutturaComponenti(), versamento.getVersamento())) { + rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, + "Eccezione nella persistenza dell'unità documentaria da inserire nell'elenco di versamento"); + prosegui = false; } // SALVO IL PROFILO ARCHIVISTICO - if (prosegui) { - if (!this.salvaFascicoliSecondari(versamento.getStrutturaComponenti(), versamento.getVersamento())) { - rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, - "Eccezione nella persistenza del Profilo Archivistico "); - prosegui = false; - } + if (prosegui + && !this.salvaFascicoliSecondari(versamento.getStrutturaComponenti(), versamento.getVersamento())) { + rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, + "Eccezione nella persistenza del Profilo Archivistico "); + prosegui = false; } // SALVO I DOCUMENTI COLLEGATI - if (prosegui) { - if (!this.salvaDocumentiCollegati(versamento.getStrutturaComponenti(), versamento.getVersamento())) { - rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, - "Eccezione nella persistenza dei Documenti Collegati "); - prosegui = false; - } + if (prosegui + && !this.salvaDocumentiCollegati(versamento.getStrutturaComponenti(), versamento.getVersamento())) { + rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, + "Eccezione nella persistenza dei Documenti Collegati "); + prosegui = false; } // SALVO I Dati specifici UD - if (prosegui) { - if (!this.salvaDatiSpecUD(versamento.getStrutturaComponenti())) { - rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, - "Eccezione nella persistenza dei Dati Specifici UD "); - prosegui = false; - } + if (prosegui && !this.salvaDatiSpecUD(versamento.getStrutturaComponenti())) { + rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, + "Eccezione nella persistenza dei Dati Specifici UD "); + prosegui = false; } // SALVO I DOCUMENTI PRINCIPALE / ALLEGATI / ANNESSI / ANNOTAZIONI if (prosegui) { ConfigPerDoc tmpConfigPerDoc = new ConfigPerDoc(); tmpConfigPerDoc.setForzaAccettazione( - rispostaWS.getIstanzaEsito().getConfigurazione().isForzaAccettazione() ? "1" : "0"); + booleanToFlag(rispostaWS.getIstanzaEsito().getConfigurazione().isForzaAccettazione())); tmpConfigPerDoc.setForzaConservazione( - versamento.getStrutturaComponenti().isConfigFlagForzaConservazione() ? "1" : "0"); + booleanToFlag(versamento.getStrutturaComponenti().isConfigFlagForzaConservazione())); tmpConfigPerDoc .setTipoConservazione(rispostaWS.getIstanzaEsito().getConfigurazione().getTipoConservazione()); tmpConfigPerDoc.setSistemaDiMigrazione( @@ -226,33 +244,27 @@ public boolean salvaDatiVersamento(VersamentoExt versamento, RispostaWS risposta } // SALVO I WARNING - if (prosegui) { - if (!this.salvaDatiWarning(versamento)) { - rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, - "Eccezione nella persistenza dei warning"); - prosegui = false; - } + if (prosegui && !this.salvaDatiWarning(versamento)) { + rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, "Eccezione nella persistenza dei warning"); + prosegui = false; } // salvo i componenti ed i sottocomponenti - if (prosegui) { - if (!this.salvaComponenti(tmpRispostaControlli, versamento.getStrutturaComponenti(), - versamento.getVersamento().getIntestazione().getChiave())) { - rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, - "Eccezione nella persistenza dei componenti " + tmpRispostaControlli.getDsErr()); - prosegui = false; - } + if (prosegui && !this.salvaComponenti(tmpRispostaControlli, versamento.getStrutturaComponenti(), + versamento.getVersamento().getIntestazione().getChiave(), + versamento.getDescrizione().getNomeWs())) { + rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, + "Eccezione nella persistenza dei componenti " + tmpRispostaControlli.getDsErr()); + prosegui = false; } // SALVO I Dati specifici Comp e Sub-Comp - if (prosegui) { - if (!this.salvaDatiSpecCompUD(versamento.getStrutturaComponenti())) { - rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, - "Eccezione nella persistenza dei Dati Specifici Componenti "); - } + if (prosegui && !this.salvaDatiSpecCompUD(versamento.getStrutturaComponenti())) { + rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, + "Eccezione nella persistenza dei Dati Specifici Componenti "); } } catch (Exception e) { @@ -287,20 +299,17 @@ public boolean salvaDatiVersamento(VersamentoExtAggAll versamento, RispostaWSAgg // Aggiorno UNITA' DOCUMENTARIA if (prosegui) { - boolean result = this.aggiornaUnitaDoc(versamento.getStrutturaComponenti(), versamento.getVersamento(), - rispostaWS); + boolean result = this.aggiornaUnitaDoc(versamento.getStrutturaComponenti(), rispostaWS); if (!result) { rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, - "Eccezione nella persistenza dell'unità documentaria "); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, ERROR_PERSISTENZA_UD); prosegui = false; } } // Aggiorno DOCUMENTI (niOrdDoc e calcolo UrnComponente) if (prosegui) { - boolean result = this.aggiornaDocumenti(versamento.getStrutturaComponenti(), versamento.getVersamento(), - rispostaWS); + boolean result = this.aggiornaDocumenti(versamento.getStrutturaComponenti()); if (!result) { rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, @@ -311,8 +320,7 @@ public boolean salvaDatiVersamento(VersamentoExtAggAll versamento, RispostaWSAgg // Aggiorno PREGRESSO if (prosegui) { - boolean result = this.aggiornaPregressoDocumenti(versamento.getStrutturaComponenti(), - versamento.getVersamento(), rispostaWS); + boolean result = this.aggiornaPregressoDocumenti(versamento.getStrutturaComponenti()); if (!result) { rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, @@ -325,9 +333,9 @@ public boolean salvaDatiVersamento(VersamentoExtAggAll versamento, RispostaWSAgg if (prosegui) { ConfigPerDoc tmpConfigPerDoc = new ConfigPerDoc(); tmpConfigPerDoc.setForzaAccettazione( - rispostaWS.getIstanzaEsito().getConfigurazione().isForzaAccettazione() ? "1" : "0"); + booleanToFlag(rispostaWS.getIstanzaEsito().getConfigurazione().isForzaAccettazione())); tmpConfigPerDoc.setForzaConservazione( - versamento.getStrutturaComponenti().isConfigFlagForzaConservazione() ? "1" : "0"); + booleanToFlag(versamento.getStrutturaComponenti().isConfigFlagForzaConservazione())); tmpConfigPerDoc .setTipoConservazione(rispostaWS.getIstanzaEsito().getConfigurazione().getTipoConservazione()); tmpConfigPerDoc.setSistemaDiMigrazione( @@ -341,52 +349,42 @@ public boolean salvaDatiVersamento(VersamentoExtAggAll versamento, RispostaWSAgg } // SALVO DOCUMENTO DA INSERIRE NELL'ELENCO DI VERSAMENTO - if (prosegui) { - if (!this.salvaDocElencoVers(versamento.getStrutturaComponenti(), versamento.getVersamento())) { - rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, - "Eccezione nella persistenza del documento da inserire nell'elenco di versamento"); - prosegui = false; - } + if (prosegui && !this.salvaDocElencoVers(versamento.getStrutturaComponenti(), versamento.getVersamento())) { + rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, + "Eccezione nella persistenza del documento da inserire nell'elenco di versamento"); + prosegui = false; } // SALVO I WARNING - if (prosegui) { - if (!this.salvaDatiWarning(versamento)) { - rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, - "Eccezione nella persistenza dei warning"); - prosegui = false; - } + if (prosegui && !this.salvaDatiWarning(versamento)) { + rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, "Eccezione nella persistenza dei warning"); + prosegui = false; } // salvo i componenti ed i sottocomponenti - if (prosegui) { - if (!this.salvaComponenti(tmpRispostaControlli, versamento.getStrutturaComponenti(), - versamento.getVersamento().getIntestazione().getChiave())) { - rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, - "Eccezione nella persistenza dei componenti " + tmpRispostaControlli.getDsErr()); - prosegui = false; - } + if (prosegui && !this.salvaComponenti(tmpRispostaControlli, versamento.getStrutturaComponenti(), + versamento.getVersamento().getIntestazione().getChiave(), + versamento.getDescrizione().getNomeWs())) { + rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, + "Eccezione nella persistenza dei componenti " + tmpRispostaControlli.getDsErr()); + prosegui = false; } // SALVO I Dati specifici Comp e Sub-Comp - if (prosegui) { - if (!this.salvaDatiSpecCompUD(versamento.getStrutturaComponenti())) { - rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, - "Eccezione nella persistenza dei Dati Specifici Componenti "); - } + if (prosegui && !this.salvaDatiSpecCompUD(versamento.getStrutturaComponenti())) { + rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, + "Eccezione nella persistenza dei Dati Specifici Componenti "); } // SALVO I dati di aggregazioni - if (prosegui) { - if (!this.salvaDatiAggregazioni(versamento.getStrutturaComponenti())) { - rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, - "Eccezione nella persistenza dei Dati di Aggregazioni "); - } + if (prosegui && !this.salvaDatiAggregazioni(versamento.getStrutturaComponenti())) { + rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, + "Eccezione nella persistenza dei Dati di Aggregazioni "); } } catch (Exception e) { @@ -415,7 +413,7 @@ private boolean salvaUnitaDoc(StrutturaVersamento strutV, UnitaDocumentaria ud, // informazioni di base // intestazione tmpTabUD.setCdRegistroKeyUnitaDoc(ud.getIntestazione().getChiave().getTipoRegistro()); - tmpTabUD.setAaKeyUnitaDoc(new BigDecimal(ud.getIntestazione().getChiave().getAnno())); + tmpTabUD.setAaKeyUnitaDoc(BigDecimal.valueOf(ud.getIntestazione().getChiave().getAnno())); tmpTabUD.setCdKeyUnitaDoc(ud.getIntestazione().getChiave().getNumero()); // salvo il registro anche come FK, utile per le ricerche @@ -434,17 +432,15 @@ private boolean salvaUnitaDoc(StrutturaVersamento strutV, UnitaDocumentaria ud, Integer numeroAllegati = ud.getNumeroAllegati() != null ? ud.getNumeroAllegati() : 0; Integer numeroAnnessi = ud.getNumeroAnnessi() != null ? ud.getNumeroAnnessi() : 0; Integer numeroAnnotazioni = ud.getNumeroAnnotazioni() != null ? ud.getNumeroAnnotazioni() : 0; - tmpTabUD.setNiAlleg(new BigDecimal(numeroAllegati)); - tmpTabUD.setNiAnnessi(new BigDecimal(numeroAnnessi)); - tmpTabUD.setNiAnnot(new BigDecimal(numeroAnnotazioni)); + tmpTabUD.setNiAlleg(BigDecimal.valueOf(numeroAllegati)); + tmpTabUD.setNiAnnessi(BigDecimal.valueOf(numeroAnnessi)); + tmpTabUD.setNiAnnot(BigDecimal.valueOf(numeroAnnotazioni)); tmpTabUD.setIamUser(entityManager.find(IamUser.class, strutV.getIdUser())); // aggiunti da Paolo tmpTabUD.setFlUnitaDocFirmato( - rispostaWS.getIstanzaEsito().getUnitaDocumentaria().isFirmatoDigitalmente() != null - && rispostaWS.getIstanzaEsito().getUnitaDocumentaria().isFirmatoDigitalmente().booleanValue() - ? "1" : "0"); + booleanToFlag(rispostaWS.getIstanzaEsito().getUnitaDocumentaria().isFirmatoDigitalmente())); tmpTabUD.setDsMsgEsitoVerifFirme(strutV.getDsMsgEsitoVerifica()); tmpTabUD.setTiEsitoVerifFirme(strutV.getTiEsitoVerifFirme()); @@ -453,19 +449,19 @@ private boolean salvaUnitaDoc(StrutturaVersamento strutV, UnitaDocumentaria ud, // salva il progressivo calcolato, estratto dal numero della chiave.. potrebbe // non esistere if (strutV.getProgressivoCalcolato() != null) { - tmpTabUD.setPgUnitaDoc(new BigDecimal(strutV.getProgressivoCalcolato())); + tmpTabUD.setPgUnitaDoc(BigDecimal.valueOf(strutV.getProgressivoCalcolato())); } // configurazione tmpTabUD.setFlForzaAccettazione( - rispostaWS.getIstanzaEsito().getConfigurazione().isForzaAccettazione() ? "1" : "0"); - tmpTabUD.setFlForzaConservazione(strutV.isConfigFlagForzaConservazione() ? "1" : "0"); + booleanToFlag(rispostaWS.getIstanzaEsito().getConfigurazione().isForzaAccettazione())); + tmpTabUD.setFlForzaConservazione(booleanToFlag(strutV.isConfigFlagForzaConservazione())); tmpTabUD.setTiConservazione(rispostaWS.getIstanzaEsito().getConfigurazione().getTipoConservazione()); tmpTabUD.setNmSistemaMigraz(rispostaWS.getIstanzaEsito().getConfigurazione().getSistemaDiMigrazione() != null ? rispostaWS.getIstanzaEsito().getConfigurazione().getSistemaDiMigrazione() : ""); tmpTabUD.setFlForzaCollegamento( - rispostaWS.getIstanzaEsito().getConfigurazione().isForzaCollegamento() ? "1" : "0"); + booleanToFlag(rispostaWS.getIstanzaEsito().getConfigurazione().isForzaCollegamento())); // profilo archivistico - principale (il fascicolo principale esiste sempre se // esiste il profilo archivistico) @@ -491,7 +487,7 @@ private boolean salvaUnitaDoc(StrutturaVersamento strutV, UnitaDocumentaria ud, tmpTabUD.setFlCartaceo("0"); if (ud.getProfiloUnitaDocumentaria() != null) { Boolean cartaceo = ud.getProfiloUnitaDocumentaria().isCartaceo(); - tmpTabUD.setFlCartaceo((cartaceo != null && cartaceo) ? "1" : "0"); + tmpTabUD.setFlCartaceo(booleanToFlag(cartaceo != null && cartaceo)); tmpTabUD.setDlOggettoUnitaDoc(ud.getProfiloUnitaDocumentaria().getOggetto()); if (ud.getProfiloUnitaDocumentaria().getData() != null) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); @@ -500,12 +496,10 @@ private boolean salvaUnitaDoc(StrutturaVersamento strutV, UnitaDocumentaria ud, d = format.parse(ud.getProfiloUnitaDocumentaria().getData()); } catch (ParseException ex) { tmpReturn = false; - - log.info( - "QUESTO E' UN ERRORE PROVOCATO DA UN CLIENT SCRITTO MALE: SQLIntegrityConstraintViolationException "); - rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.UD_002_001, strutV.getUrnPartChiaveUd()); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, + "Eccezione salvaUnitaDoc su parsing date ProfiloUnitaDocumentaria.Data " + + ExceptionUtils.getRootCauseMessage(ex)); rispostaWS.getIstanzaEsito() .setXMLVersamento("La sessione di versamento per l'UD da versare non è presente."); return tmpReturn; @@ -537,8 +531,7 @@ private boolean salvaUnitaDoc(StrutturaVersamento strutV, UnitaDocumentaria ud, } catch (RuntimeException re) { tmpReturn = false; if (ExceptionUtils.indexOfThrowable(re, java.sql.SQLIntegrityConstraintViolationException.class) > -1) { - log.info( - "QUESTO E' UN ERRORE PROVOCATO DA UN CLIENT SCRITTO MALE: SQLIntegrityConstraintViolationException "); + log.info(ERRORE_CLIENT_ERRATO); rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.UD_002_001, strutV.getUrnPartChiaveUd()); rispostaWS.setErroreElementoDoppio(true); @@ -550,21 +543,20 @@ private boolean salvaUnitaDoc(StrutturaVersamento strutV, UnitaDocumentaria ud, return tmpReturn; } else { /// logga l'errore e blocca tutto - log.error("Eccezione nella persistenza dell'unità documentaria ", re); + log.error(ERROR_PERSISTENZA_UD, re); } } if (tmpReturn && strutV.isWarningFormatoNumero()) { try { - tmpReturn = salvaWarningAARegistroUd(strutV, ud, rispostaWS); + tmpReturn = salvaWarningAARegistroUd(strutV, ud); } catch (RuntimeException re) { tmpReturn = false; if (ExceptionUtils.indexOfThrowable(re, java.sql.SQLIntegrityConstraintViolationException.class) > -1) { // se sono arrivato qui, vuol dire che un versamento in parallelo ha creato il // record // prima di me, provocando un errore di chiave duplicata. - log.info( - "QUESTO E' UN ERRORE PROVOCATO DA UN CLIENT SCRITTO MALE: SQLIntegrityConstraintViolationException "); + log.info(ERRORE_CLIENT_ERRATO); rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, "Impossibile salvare i dati di warning sul formato del numero, " @@ -572,7 +564,7 @@ private boolean salvaUnitaDoc(StrutturaVersamento strutV, UnitaDocumentaria ud, return tmpReturn; } else { /// logga l'errore e blocca tutto - log.error("Eccezione nella persistenza dell'unità documentaria ", re); + log.error(ERROR_PERSISTENZA_UD, re); } } } @@ -588,16 +580,14 @@ private boolean salvaUnitaDoc(StrutturaVersamento strutV, UnitaDocumentaria ud, } if (!tmpReturn) { - rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, - "Eccezione nella persistenza dell'unità documentaria "); + rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, ERROR_PERSISTENZA_UD); rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); } return tmpReturn; } - // TODO !!!!!! - private boolean salvaWarningAARegistroUd(StrutturaVersamento strutV, UnitaDocumentaria ud, RispostaWS rispostaWS) { + private boolean salvaWarningAARegistroUd(StrutturaVersamento strutV, UnitaDocumentaria ud) { // qui, in caso di eccezione, rendo un 666P con un messaggio che indica il // problema di // aggiornamento parallelo nella tabella. @@ -611,12 +601,13 @@ private boolean salvaWarningAARegistroUd(StrutturaVersamento strutV, UnitaDocume javax.persistence.Query query = entityManager.createQuery(queryStr); query.setParameter("flWarnAaRegistroUnitaDocIn", "1"); query.setParameter("idAaRegistroUnitaDocIn", strutV.getConfigRegAnno().getIdAaRegistroUnitaDoc()); - query.setParameter("aaRegistroUnitaDocIn", new BigDecimal(ud.getIntestazione().getChiave().getAnno())); + query.setParameter("aaRegistroUnitaDocIn", BigDecimal.valueOf(ud.getIntestazione().getChiave().getAnno())); numWarningAggiornati = query.executeUpdate(); // se non ho aggiornato alcun record, vuol dire che lo devo creare... if (numWarningAggiornati == 0) { DecWarnAaRegistroUd tmpDecWarnAaRegistroUd = new DecWarnAaRegistroUd(); - tmpDecWarnAaRegistroUd.setAaRegistroUnitaDoc(new BigDecimal(ud.getIntestazione().getChiave().getAnno())); + tmpDecWarnAaRegistroUd + .setAaRegistroUnitaDoc(BigDecimal.valueOf(ud.getIntestazione().getChiave().getAnno())); tmpDecWarnAaRegistroUd.setDecAaRegistroUnitaDoc(entityManager.find(DecAaRegistroUnitaDoc.class, strutV.getConfigRegAnno().getIdAaRegistroUnitaDoc())); tmpDecWarnAaRegistroUd.setFlWarnAaRegistroUnitaDoc("1"); @@ -642,11 +633,11 @@ private boolean aggiornaRegistriFiscaliUd(StrutturaVersamento strutV, UnitaDocum + "and ud.aaUnitaDocRegistro = :aaUnitaDocRegistroIn "; javax.persistence.Query query = entityManager.createQuery(queryStr); query.setParameter("idRegistroUnitaDocIn", strutV.getIdRegistroUnitaDoc()); - query.setParameter("aaUnitaDocRegistroIn", new BigDecimal(ud.getIntestazione().getChiave().getAnno())); + query.setParameter("aaUnitaDocRegistroIn", BigDecimal.valueOf(ud.getIntestazione().getChiave().getAnno())); numAaUdReg = (Long) query.getSingleResult(); if (numAaUdReg == 0) { - Map properties = new HashMap(); - properties.put("javax.persistence.lock.timeout", 25); + Map properties = new HashMap<>(); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, 25000); /* * se il registro è da inserire, lock esclusivo sul registro (che funge da semaforo) @@ -657,7 +648,7 @@ private boolean aggiornaRegistriFiscaliUd(StrutturaVersamento strutV, UnitaDocum LockModeType.PESSIMISTIC_WRITE, properties); } catch (Exception re) { /// logga l'errore e blocca tutto - log.error("Eccezione nella persistenza dell'unità documentaria ", re); + log.error(ERROR_PERSISTENZA_UD, re); tmpReturn = false; } @@ -671,13 +662,14 @@ private boolean aggiornaRegistriFiscaliUd(StrutturaVersamento strutV, UnitaDocum + "and ud.aaUnitaDocRegistro = :aaUnitaDocRegistroIn "; query = entityManager.createQuery(queryStr); query.setParameter("idRegistroUnitaDocIn", strutV.getIdRegistroUnitaDoc()); - query.setParameter("aaUnitaDocRegistroIn", new BigDecimal(ud.getIntestazione().getChiave().getAnno())); + query.setParameter("aaUnitaDocRegistroIn", + BigDecimal.valueOf(ud.getIntestazione().getChiave().getAnno())); numAaUdReg = (Long) query.getSingleResult(); if (numAaUdReg == 0) { MonAaUnitaDocRegistro tmpAaUnitaDocRegistro; tmpAaUnitaDocRegistro = new MonAaUnitaDocRegistro(); tmpAaUnitaDocRegistro - .setAaUnitaDocRegistro(new BigDecimal(ud.getIntestazione().getChiave().getAnno())); + .setAaUnitaDocRegistro(BigDecimal.valueOf(ud.getIntestazione().getChiave().getAnno())); tmpAaUnitaDocRegistro.setDecRegistroUnitaDoc( entityManager.find(DecRegistroUnitaDoc.class, strutV.getIdRegistroUnitaDoc())); @@ -722,15 +714,14 @@ private boolean riparaCollegamentiUdNonRisolti(StrutturaVersamento strutV, Unita + "and al.cdRegistroKeyUnitaDocLink = :cdRegistroKeyUnitaDocLinkIn "; javax.persistence.Query query = entityManager.createQuery(queryStr); query.setParameter("aroUnitaDocLinkIn", entityManager.find(AroUnitaDoc.class, strutV.getIdUnitaDoc())); - query.setParameter("idStrutIn", new BigDecimal(strutV.getIdStruttura())); + query.setParameter("idStrutIn", BigDecimal.valueOf(strutV.getIdStruttura())); query.setParameter("cdRegistroKeyUnitaDocLinkIn", ud.getIntestazione().getChiave().getTipoRegistro()); - query.setParameter("aaKeyUnitaDocLinkIn", new BigDecimal(ud.getIntestazione().getChiave().getAnno())); + query.setParameter("aaKeyUnitaDocLinkIn", BigDecimal.valueOf(ud.getIntestazione().getChiave().getAnno())); query.setParameter("cdKeyUnitaDocLinkIn", ud.getIntestazione().getChiave().getNumero()); try { numCollAggiustati = query.executeUpdate(); if (numCollAggiustati > 0) { - log.debug(String.format("Sono stati connessi %s collegamenti forzati da precedenti versamenti", - numCollAggiustati)); + log.debug("Sono stati connessi {} collegamenti forzati da precedenti versamenti", numCollAggiustati); } } catch (RuntimeException re) { /// logga l'errore e blocca tutto @@ -753,15 +744,14 @@ private boolean rimuoviUdNonVersate(StrutturaVersamento strutV, UnitaDocumentari + "and al.aaKeyUnitaDoc = :aaKeyUnitaDocIn " + "and al.cdKeyUnitaDoc = :cdKeyUnitaDocIn " + "and al.cdRegistroKeyUnitaDoc = :cdRegistroKeyUnitaDocIn "; javax.persistence.Query query = entityManager.createQuery(queryStr); - query.setParameter("idStrutIn", new BigDecimal(strutV.getIdStruttura())); + query.setParameter("idStrutIn", strutV.getIdStruttura()); query.setParameter("cdRegistroKeyUnitaDocIn", ud.getIntestazione().getChiave().getTipoRegistro()); - query.setParameter("aaKeyUnitaDocIn", new BigDecimal(ud.getIntestazione().getChiave().getAnno())); + query.setParameter("aaKeyUnitaDocIn", BigDecimal.valueOf(ud.getIntestazione().getChiave().getAnno())); query.setParameter("cdKeyUnitaDocIn", ud.getIntestazione().getChiave().getNumero()); try { numUdNonVersRimosse = query.executeUpdate(); if (numUdNonVersRimosse > 0) { - log.debug(String.format("Sono stati rimossi %s tentativi falliti di versamento UD ", - numUdNonVersRimosse)); + log.debug("Sono stati rimossi {} tentativi falliti di versamento UD ", numUdNonVersRimosse); } } catch (RuntimeException re) { /// logga l'errore e blocca tutto @@ -776,9 +766,9 @@ private boolean salvaUdElencoVers(StrutturaVersamento strutV, UnitaDocumentaria boolean tmpReturn = true; ElvUdVersDaElabElenco tmpTab = new ElvUdVersDaElabElenco(); tmpTab.setAroUnitaDoc(entityManager.find(AroUnitaDoc.class, strutV.getIdUnitaDoc())); - tmpTab.setAaKeyUnitaDoc(new BigDecimal(ud.getIntestazione().getChiave().getAnno())); + tmpTab.setAaKeyUnitaDoc(BigDecimal.valueOf(ud.getIntestazione().getChiave().getAnno())); tmpTab.setDtCreazione(convert(strutV.getDataVersamento())); - tmpTab.setIdStrut(new BigDecimal(strutV.getIdStruttura())); + tmpTab.setIdStrut(BigDecimal.valueOf(strutV.getIdStruttura())); // nel caso il salvataggio sia su filesystem/Tivoli, // lo stato dell'UD passerà ad IN_ATTESA_SCHED // solo dopo la effettiva memorizzazione in Tivoli @@ -829,7 +819,7 @@ private boolean salvaFascicoliSecondari(StrutturaVersamento strutV, UnitaDocumen && !tmpFp.getSottoFascicolo().getOggetto().isNil()) { tmpArrP[4] = tmpFp.getSottoFascicolo().getOggetto().getValue(); } - List tmpListP = Arrays.asList(tmpArrP); + List tmpListP = Arrays.asList(tmpArrP); // elimina i fascicoli/sottofascicoli inseriti due volte // il problema si presenta con alcuni versatori poco precisi. @@ -855,7 +845,7 @@ private boolean salvaFascicoliSecondari(StrutturaVersamento strutV, UnitaDocumen && !tmpFs.getSottoFascicolo().getOggetto().isNil()) { tmpArr[4] = tmpFs.getSottoFascicolo().getOggetto().getValue(); } - List tmpList = Arrays.asList(tmpArr); + List tmpList = Arrays.asList(tmpArr); if (!tmpListP.equals(tmpList)) { // se il fascicolo è uguale al principale, non lo considero // in ogni caso inserisco il dato in un'hashmap, così i fascicoli duplicati @@ -869,7 +859,7 @@ private boolean salvaFascicoliSecondari(StrutturaVersamento strutV, UnitaDocumen for (CamiciaFascicoloType tmpFascicolo : tmpFascicoliUnivoci.values()) { tmpTabAS = new AroArchivSec(); tmpTabAS.setAroUnitaDoc(entityManager.find(AroUnitaDoc.class, strutV.getIdUnitaDoc())); - tmpTabAS.setIdStrut(new BigDecimal(strutV.getIdStruttura())); + tmpTabAS.setIdStrut(BigDecimal.valueOf(strutV.getIdStruttura())); tmpTabAS.setDsClassif(tmpFascicolo.getClassifica()); if (tmpFascicolo.getFascicolo() != null) { tmpTabAS.setCdFascic(tmpFascicolo.getFascicolo().getIdentificativo()); @@ -907,9 +897,9 @@ private boolean salvaDocumentiCollegati(StrutturaVersamento strutV, UnitaDocumen AroLinkUnitaDoc tmpTabLUD = new AroLinkUnitaDoc(); tmpTabLUD.setAroUnitaDoc(entityManager.find(AroUnitaDoc.class, strutV.getIdUnitaDoc())); - tmpTabLUD.setIdStrut(new BigDecimal(strutV.getIdStruttura())); + tmpTabLUD.setIdStrut(BigDecimal.valueOf(strutV.getIdStruttura())); tmpTabLUD.setCdRegistroKeyUnitaDocLink(tmpUnitaDocColl.getChiave().getTipoRegistro()); - tmpTabLUD.setAaKeyUnitaDocLink(new BigDecimal(tmpUnitaDocColl.getChiave().getAnno())); + tmpTabLUD.setAaKeyUnitaDocLink(BigDecimal.valueOf(tmpUnitaDocColl.getChiave().getAnno())); tmpTabLUD.setCdKeyUnitaDocLink(tmpUnitaDocColl.getChiave().getNumero()); // Se il Documento Collegato non è presente, non ha chiave. @@ -960,7 +950,7 @@ private boolean salvaDatiSpecUD(StrutturaVersamento strutturaVersIn) { * ************************************************************************** salvataggio dati e metadati per * aggiunta documenti ************************************************************************** */ - private boolean aggiornaUnitaDoc(StrutturaVersamento strutV, UnitaDocAggAllegati ud, RispostaWSAggAll rispostaWS) { + private boolean aggiornaUnitaDoc(StrutturaVersamento strutV, RispostaWSAggAll rispostaWS) { AroUnitaDoc tmpTabUD = null; boolean tmpReturn = true; int progressivoVersione = 0; @@ -973,25 +963,24 @@ private boolean aggiornaUnitaDoc(StrutturaVersamento strutV, UnitaDocAggAllegati tmpTabUD = entityManager.find(AroUnitaDoc.class, strutV.getIdUnitaDoc(), LockModeType.PESSIMISTIC_WRITE); } catch (Exception re) { /// logga l'errore e blocca tutto - log.error("Eccezione nella persistenza dell'unità documentaria ", re); + log.error(ERROR_PERSISTENZA_UD, re); tmpReturn = false; } if (tmpReturn) { // prima di tutto aggiungo un elemento if (strutV.getDocumentiAttesi().get(0).getCategoriaDoc() == CategoriaDocumento.Allegato) { - tmpTabUD.setNiAlleg(tmpTabUD.getNiAlleg().add(new BigDecimal(1))); + tmpTabUD.setNiAlleg(tmpTabUD.getNiAlleg().add(BigDecimal.valueOf(1))); } if (strutV.getDocumentiAttesi().get(0).getCategoriaDoc() == CategoriaDocumento.Annesso) { - tmpTabUD.setNiAnnessi(tmpTabUD.getNiAnnessi().add(new BigDecimal(1))); + tmpTabUD.setNiAnnessi(tmpTabUD.getNiAnnessi().add(BigDecimal.valueOf(1))); } if (strutV.getDocumentiAttesi().get(0).getCategoriaDoc() == CategoriaDocumento.Annotazione) { - tmpTabUD.setNiAnnot(tmpTabUD.getNiAnnot().add(new BigDecimal(1))); + tmpTabUD.setNiAnnot(tmpTabUD.getNiAnnot().add(BigDecimal.valueOf(1))); } // se sono già stati creati degli AIP, pongo lo stato conservazione ad AIP IN // AGGIORNAMENTO - if (progressivoVersione > 0 - // MAC#26281 + if (progressivoVersione > 0 // MAC#26281 // /* MAC#22948 */ // || tmpTabUD.getTiStatoConservazione() // .equals(CostantiDB.StatoConservazioneUnitaDoc.IN_VOLUME_DI_CONSERVAZIONE.name()) @@ -1019,7 +1008,7 @@ private boolean aggiornaUnitaDoc(StrutturaVersamento strutV, UnitaDocAggAllegati * ogni caso con il valore NEGATIVO. * */ - if (strutV.getTiEsitoVerifFirme().equals(VerificaFirmaEnums.EsitoControllo.NEGATIVO.name())) { + if (strutV.getTiEsitoVerifFirme().equals(SacerIndication.NEGATIVO.name())) { tmpTabUD.setTiEsitoVerifFirme(strutV.getTiEsitoVerifFirme()); tmpTabUD.setDsMsgEsitoVerifFirme(strutV.getDsMsgEsitoVerifica()); } @@ -1028,8 +1017,8 @@ private boolean aggiornaUnitaDoc(StrutturaVersamento strutV, UnitaDocAggAllegati * se il doc appena aggiunto è in warning, mentre l'unità doc già presente è POSITIVO, aggiorna l'unità * doc a WARNING */ - if (strutV.getTiEsitoVerifFirme().equals(VerificaFirmaEnums.EsitoControllo.WARNING.name()) - && tmpTabUD.getTiEsitoVerifFirme().equals(VerificaFirmaEnums.EsitoControllo.POSITIVO.name())) { + if (strutV.getTiEsitoVerifFirme().equals(SacerIndication.WARNING.name()) + && tmpTabUD.getTiEsitoVerifFirme().equals(SacerIndication.POSITIVO.name())) { tmpTabUD.setTiEsitoVerifFirme(strutV.getTiEsitoVerifFirme()); tmpTabUD.setDsMsgEsitoVerifFirme(strutV.getDsMsgEsitoVerifica()); } @@ -1047,7 +1036,7 @@ private boolean aggiornaUnitaDoc(StrutturaVersamento strutV, UnitaDocAggAllegati entityManager.flush(); } catch (RuntimeException re) { /// logga l'errore e blocca tutto - log.error("Eccezione nella persistenza dell'unità documentaria ", re); + log.error(ERROR_PERSISTENZA_UD, re); tmpReturn = false; } } @@ -1055,8 +1044,7 @@ private boolean aggiornaUnitaDoc(StrutturaVersamento strutV, UnitaDocAggAllegati return tmpReturn; } - private boolean aggiornaDocumenti(StrutturaVersamento strutV, UnitaDocAggAllegati versamento, - RispostaWSAggAll rispostaWS) { + private boolean aggiornaDocumenti(StrutturaVersamento strutV) { boolean tmpReturn = true; try { @@ -1201,8 +1189,7 @@ private void salvaURNComponente(StrutturaVersamento strutV, AroDoc tmpAroDoc, Ar } } - private boolean aggiornaPregressoDocumenti(StrutturaVersamento strutV, UnitaDocAggAllegati versamento, - RispostaWSAggAll rispostaWS) { + private boolean aggiornaPregressoDocumenti(StrutturaVersamento strutV) { boolean tmpReturn = true; // A. check data massima versamento recuperata in precedenza rispetto parametro // su db @@ -1309,9 +1296,8 @@ private boolean scriviUrnSipUdPreg(AroUnitaDoc tmpTabUD, StrutturaVersamento str private List retrieveVrsVLisXmlUdUrnDaCalcByUd(long idUnitaDoc) { Query query = entityManager .createQuery("SELECT vrs FROM VrsVLisXmlUdUrnDaCalc vrs WHERE vrs.idUnitaDoc = :idUnitaDoc "); - query.setParameter("idUnitaDoc", idUnitaDoc); - List vrs = query.getResultList(); - return vrs; + query.setParameter("idUnitaDoc", BigDecimal.valueOf(idUnitaDoc)); + return query.getResultList(); } private boolean salvaUrnXmlSessioneVers(VrsXmlDatiSessioneVers xmlDatiSessioneVers, String tmpUrn, @@ -1405,9 +1391,8 @@ private void scriviUrnSipDocAggPreg(AroUnitaDoc tmpAroUnitaDoc, StrutturaVersame private List retrieveVrsVLisXmlDocUrnDaCalcByDoc(long idDoc) { Query query = entityManager.createQuery("SELECT vrs FROM VrsVLisXmlDocUrnDaCalc vrs WHERE vrs.idDoc = :idDoc "); - query.setParameter("idDoc", idDoc); - List vrs = query.getResultList(); - return vrs; + query.setParameter("idDoc", BigDecimal.valueOf(idDoc)); + return query.getResultList(); } private void scriviUrnSipUpdPreg(AroUnitaDoc tmpAroUnitaDoc, StrutturaVersamento svf) { @@ -1460,17 +1445,15 @@ private void scriviUrnSipUpdPreg(AroUnitaDoc tmpAroUnitaDoc, StrutturaVersamento private List retrieveAroUpdUnitaDocByUd(long idUnitaDoc) { Query query = entityManager .createQuery("SELECT upd FROM AroUpdUnitaDoc upd WHERE upd.aroUnitaDoc.idUnitaDoc = :idUnitaDoc "); - query.setParameter("idUnitaDoc", idUnitaDoc); - List upds = query.getResultList(); - return upds; + query.setParameter("idUnitaDoc", Long.valueOf(idUnitaDoc)); + return query.getResultList(); } private List retrieveVrsVLisXmlUpdUrnDaCalcByUpd(long idUpdUnitaDoc) { Query query = entityManager .createQuery("SELECT vrs FROM VrsVLisXmlUpdUrnDaCalc vrs WHERE vrs.idUpdUnitaDoc = :idUpdUnitaDoc "); - query.setParameter("idUpdUnitaDoc", idUpdUnitaDoc); - List vrs = query.getResultList(); - return vrs; + query.setParameter("idUpdUnitaDoc", BigDecimal.valueOf(idUpdUnitaDoc)); + return query.getResultList(); } // @@ -1478,9 +1461,9 @@ private boolean salvaDocElencoVers(StrutturaVersamento strutV, UnitaDocAggAllega boolean tmpReturn = true; ElvDocAggDaElabElenco tmpTab = new ElvDocAggDaElabElenco(); tmpTab.setAroDoc(entityManager.find(AroDoc.class, strutV.getDocumentiAttesi().get(0).getIdRecDocumentoDB())); - tmpTab.setAaKeyUnitaDoc(new BigDecimal(ud.getIntestazione().getChiave().getAnno())); + tmpTab.setAaKeyUnitaDoc(BigDecimal.valueOf(ud.getIntestazione().getChiave().getAnno())); tmpTab.setDtCreazione(convert(strutV.getDataVersamento())); - tmpTab.setIdStrut(new BigDecimal(strutV.getIdStruttura())); + tmpTab.setIdStrut(BigDecimal.valueOf(strutV.getIdStruttura())); // nel caso il salvataggio sia su filesystem/Tivoli, // lo stato del documento passerà ad IN_ATTESA_SCHED // solo dopo la effettiva memorizzazione in Tivoli @@ -1634,7 +1617,7 @@ private boolean salvaDocumenti(StrutturaVersamento strutV, ConfigPerDoc configPe // setto i valori generici tmpTabD.setAroUnitaDoc(entityManager.find(AroUnitaDoc.class, strutV.getIdUnitaDoc())); - tmpTabD.setPgDoc(new BigDecimal(valueDocVers.getProgressivo())); + tmpTabD.setPgDoc(BigDecimal.valueOf(valueDocVers.getProgressivo())); tmpTabD.setDecTipoDoc(entityManager.find(DecTipoDoc.class, valueDocVers.getIdTipoDocumentoDB())); // if (configPerDoc.getTipoCreazioneDoc() == TipoCreazioneDoc.AGGIUNTA_DOCUMENTO) { @@ -1654,7 +1637,7 @@ private boolean salvaDocumenti(StrutturaVersamento strutV, ConfigPerDoc configPe tmpTabD.setDtAnnul(tmpCal.getTime()); // tmpTabD.setCdKeyDocVers(valueDocVers.getRifDocumento().getIDDocumento()); - tmpTabD.setIdStrut(new BigDecimal(strutV.getIdStruttura())); + tmpTabD.setIdStrut(BigDecimal.valueOf(strutV.getIdStruttura())); // aggiunti da Paolo tmpTabD.setFlDocFirmato(valueDocVers.getFlFileFirmato()); @@ -1683,7 +1666,7 @@ private boolean salvaDocumenti(StrutturaVersamento strutV, ConfigPerDoc configPe // tipo documento (PRINCIPALE, ALLEGATO, ANNOTAZIONE, ANNESSO) tmpTabD.setTiDoc(valueDocVers.getCategoriaDoc().getValoreDb()); // niOrd - tmpTabD.setNiOrdDoc(new BigDecimal(valueDocVers.getNiOrdDoc())); + tmpTabD.setNiOrdDoc(BigDecimal.valueOf(valueDocVers.getNiOrdDoc())); // inserisco su DB try { @@ -1695,8 +1678,7 @@ private boolean salvaDocumenti(StrutturaVersamento strutV, ConfigPerDoc configPe tmpReturn = false; if (configPerDoc.getTipoCreazioneDoc() == TipoCreazioneDoc.AGGIUNTA_DOCUMENTO && ExceptionUtils .indexOfThrowable(re, java.sql.SQLIntegrityConstraintViolationException.class) > -1) { - log.info( - "QUESTO E' UN ERRORE PROVOCATO DA UN CLIENT SCRITTO MALE: SQLIntegrityConstraintViolationException "); + log.info(ERRORE_CLIENT_ERRATO); rispostaWS.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWS.setEsitoWsErrBundle(MessaggiWSBundle.DOC_008_001, valueDocVers.getRifDocumento().getIDDocumento(), strutV.getUrnPartChiaveUd()); @@ -1733,15 +1715,11 @@ private boolean salvaDocumenti(StrutturaVersamento strutV, ConfigPerDoc configPe } private boolean salvaDatiAccessoriDocumenti(DocumentoVers documentoVersIn, StrutturaVersamento strutV) { - boolean tmpReturn = true; AroStrutDoc tmpTabSD = null; - // salvo dati specifici, tabelle nuove - if (tmpReturn) { - tmpReturn = this.salvaDatiSpecGen(CostantiDB.TipiUsoDatiSpec.VERS, TipiEntitaSacer.DOC, - documentoVersIn.getIdRecDocumentoDB(), strutV.getIdStruttura(), - documentoVersIn.getIdRecXsdDatiSpec(), documentoVersIn.getDatiSpecifici(), strutV.getIdUnitaDoc()); - } + boolean tmpReturn = this.salvaDatiSpecGen(CostantiDB.TipiUsoDatiSpec.VERS, TipiEntitaSacer.DOC, + documentoVersIn.getIdRecDocumentoDB(), strutV.getIdStruttura(), documentoVersIn.getIdRecXsdDatiSpec(), + documentoVersIn.getDatiSpecifici(), strutV.getIdUnitaDoc()); if (tmpReturn) { tmpReturn = this.salvaDatiSpecGen(CostantiDB.TipiUsoDatiSpec.MIGRAZ, TipiEntitaSacer.DOC, @@ -1757,11 +1735,11 @@ private boolean salvaDatiAccessoriDocumenti(DocumentoVers documentoVersIn, Strut // setto i valori generici tmpTabSD.setAroDoc(entityManager.find(AroDoc.class, documentoVersIn.getIdRecDocumentoDB())); - tmpTabSD.setNiOrdStrutDoc(new BigDecimal(1)); + tmpTabSD.setNiOrdStrutDoc(BigDecimal.valueOf(1)); tmpTabSD.setDecTipoStrutDoc( entityManager.find(DecTipoStrutDoc.class, documentoVersIn.getIdTipoStrutturaDB())); tmpTabSD.setFlStrutOrig("1"); - tmpTabSD.setIdStrut(new BigDecimal(strutV.getIdStruttura())); + tmpTabSD.setIdStrut(BigDecimal.valueOf(strutV.getIdStruttura())); // inserisco su DB try { @@ -1786,16 +1764,15 @@ private boolean rimuoviSessVersDocErrate(DocumentoVers documentoVersIn, Struttur + "and al.aaKeyUnitaDoc = :aaKeyUnitaDocIn " + "and al.cdKeyUnitaDoc = :cdKeyUnitaDocIn " + "and al.cdRegistroKeyUnitaDoc = :cdRegistroKeyUnitaDocIn " + "and al.cdKeyDocVers = :cdKeyDocVersIn"; javax.persistence.Query query = entityManager.createQuery(queryStr); - query.setParameter("idStrutIn", new BigDecimal(strutV.getIdStruttura())); + query.setParameter("idStrutIn", strutV.getIdStruttura()); query.setParameter("cdRegistroKeyUnitaDocIn", chiaveUd.getTipoRegistro()); - query.setParameter("aaKeyUnitaDocIn", new BigDecimal(chiaveUd.getAnno())); + query.setParameter("aaKeyUnitaDocIn", BigDecimal.valueOf(chiaveUd.getAnno())); query.setParameter("cdKeyUnitaDocIn", chiaveUd.getNumero()); query.setParameter("cdKeyDocVersIn", documentoVersIn.getRifDocumento().getIDDocumento()); try { numUdNonVersRimosse = query.executeUpdate(); if (numUdNonVersRimosse > 0) { - log.debug(String.format("Sono stati rimossi %s tentativi falliti di versamento UD ", - numUdNonVersRimosse)); + log.debug("Sono stati rimossi {} tentativi falliti di versamento UD ", numUdNonVersRimosse); } } catch (RuntimeException re) { /// logga l'errore e blocca tutto @@ -1839,7 +1816,7 @@ private boolean salvaDatiWarning(AbsVersamentoExt versamento) { } tmpWarnUnitaDoc.setDsWarn(tmpErrMess); - tmpWarnUnitaDoc.setPgWarnUnitaDoc(new BigDecimal(progWarn)); + tmpWarnUnitaDoc.setPgWarnUnitaDoc(BigDecimal.valueOf(progWarn)); tmpWarnUnitaDoc.setTiEntitaSacer(tmpVdE.getElementoResponsabile().name()); tmpWarnUnitaDoc.setAroUnitaDoc( entityManager.find(AroUnitaDoc.class, versamento.getStrutturaComponenti().getIdUnitaDoc())); @@ -1861,35 +1838,25 @@ private boolean salvaDatiWarning(AbsVersamentoExt versamento) { return tmpReturn; } - private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento strutV, ChiaveType chiave) { + private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento strutV, ChiaveType chiave, + String nomeWs) { boolean tmpReturn = true; AroCompDoc tmpTabCDComponente = null; - AroCompDoc tmpTabCDSottoComp = null; AroStrutDoc tmpAroStrutDoc = null; AroStrutDoc tmpAroStrutDocMerged = null; - // String tmpUrnCalc; risposta.reset(); for (DocumentoVers valueDocVers : strutV.getDocumentiAttesi()) { // recupero la struttura documento a cui agganciare i componenti del documento tmpAroStrutDoc = entityManager.find(AroStrutDoc.class, valueDocVers.getIdRecStrutturaDB()); for (ComponenteVers tmpCV : valueDocVers.getFileAttesi()) { - // tmpUrnCalc = this.calcolaUrnComp(tmpCV, strutV.getUrnPartVersatore()); if (tmpCV.getMySottoComponente() == null) { - // sto elaborando un componente - // MEV#18660 { - // tmpTabCDComponente = tmpCV.getAcdEntity(); - // if (tmpTabCDComponente == null) { // questo caso si verifica se il tipo - // supporto è diverso da - // FILE - // tmpTabCDComponente = new AroCompDoc(); - // } tmpTabCDComponente = new AroCompDoc(); // } MEV#18660 tmpTabCDComponente.setAroStrutDoc(tmpAroStrutDoc); tmpTabCDComponente - .setNiOrdCompDoc(new BigDecimal(tmpCV.getMyComponente().getOrdinePresentazione())); + .setNiOrdCompDoc(BigDecimal.valueOf(tmpCV.getMyComponente().getOrdinePresentazione())); tmpTabCDComponente .setTiSupportoComp(tmpCV.getMyComponente().getTipoSupportoComponente().toString()); tmpTabCDComponente @@ -1902,7 +1869,8 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento switch (tmpCV.getTipoSupporto()) { case FILE: - tmpTabCDComponente.setNiSizeFileCalc(new BigDecimal(tmpCV.getRifFileBinario().getDimensione())); + tmpTabCDComponente + .setNiSizeFileCalc(BigDecimal.valueOf(tmpCV.getRifFileBinario().getDimensione())); tmpTabCDComponente.setDecFormatoFileDoc( entityManager.find(DecFormatoFileDoc.class, tmpCV.getIdFormatoFileVers())); break; @@ -1923,10 +1891,7 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento tmpTabCDComponente.setDsRifTempVers(tmpCV.getMyComponente().getDescrizioneRiferimentoTemporale()); // non viene più persistito - // tmpTabCDComponente.setDsUrnCompCalc(tmpUrnCalc); - - tmpTabCDComponente.setIdStrut(new BigDecimal(strutV.getIdStruttura())); - //// MEV#18660 { + tmpTabCDComponente.setIdStrut(BigDecimal.valueOf(strutV.getIdStruttura())); // TODO: (da firma MEV#18660) CompDocMock mock = tmpCV.withAcdEntity(); Date tmRifTempVers = null; @@ -1962,14 +1927,16 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento //// } MEV#18660 // salvo nell'esito del componente il valore dell'URN calcolato - // tmpCV.getRifComponenteResp().setURN(tmpUrnCalc); // aggiungo alla struttura documento il componente appena elaborato + if (tmpAroStrutDoc.getAroCompDocs() == null) { + tmpAroStrutDoc.setAroCompDocs(new ArrayList<>()); + } tmpAroStrutDoc.getAroCompDocs().add(tmpTabCDComponente); // salvo l'ordine di presentazione nella struttura documento, per recuperarlo in // seguito tmpCV.setOrdinePresentazione(tmpCV.getMyComponente().getOrdinePresentazione()); // - tmpTabCDComponente.setAroAroCompUrnCalcs(new ArrayList()); + tmpTabCDComponente.setAroAroCompUrnCalcs(new ArrayList<>()); // gestione nuovo urn ORIGINALE String tmpUrn = MessaggiWSFormat.formattaBaseUrnDoc(strutV.getUrnPartVersatore(), @@ -1988,10 +1955,10 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento this.salvaCompUrnCalc(tmpTabCDComponente, tmpUrn, TiUrn.NORMALIZZATO); // init bi-directionals - tmpTabCDComponente.setAroMarcaComps(new ArrayList()); - tmpTabCDComponente.setAroFirmaComps(new ArrayList()); - tmpTabCDComponente.setAroBustaCrittogs(new ArrayList()); - tmpTabCDComponente.setFirReport(new ArrayList()); + tmpTabCDComponente.setAroMarcaComps(new ArrayList<>()); + tmpTabCDComponente.setAroFirmaComps(new ArrayList<>()); + tmpTabCDComponente.setAroBustaCrittogs(new ArrayList<>()); + tmpTabCDComponente.setFirReport(new ArrayList<>()); // flag di verifica firma attivati e almeno una busta presente boolean elabResultVerificaFirma = strutV.effettuaVerificaFirma() @@ -1999,7 +1966,7 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento if (elabResultVerificaFirma) { // per ogni componente salvo i dati relativi alla firma (se esistono) tmpReturn = salvataggioFirmaManager.salvaBustaCrittografica(risposta, tmpCV.getId(), - tmpCV.getVfWrapper(), tmpTabCDComponente, tmpTabCDSottoComp); + tmpCV.getVfWrapper(), tmpTabCDComponente, null); // se ci sono problemi nel salvataggio, blocco tutto if (!tmpReturn) { return tmpReturn; @@ -2009,7 +1976,7 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento if (StringUtils.isNotBlank(tmpTabCDComponente.getFlCompFirmato()) && tmpTabCDComponente.getFlCompFirmato().equals(Flag.TRUE)) { tmpReturn = salvataggioFirmaManager.salvaReportVerificaCompDoc(risposta, - tmpCV.getVfWrapper(), strutV, tmpTabCDComponente); + tmpCV.getVfWrapper(), strutV, tmpTabCDComponente, nomeWs); // se ci sono problemi nel salvataggio, blocco tutto if (!tmpReturn) { return tmpReturn; @@ -2017,14 +1984,7 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento } } } else { - // MEV#18660 { - // sto elaborando un sottocomponente - // tmpTabCDSottoComp = tmpCV.getAcdEntity(); - // if (tmpTabCDSottoComp == null) { // questo caso si verifica se il tipo - // supporto è diverso da FILE - // tmpTabCDSottoComp = new AroCompDoc(); - // } - tmpTabCDSottoComp = new AroCompDoc(); + AroCompDoc tmpTabCDSottoComp = new AroCompDoc(); // } MEV#18660 // imposto il riferimento al componente padre @@ -2032,7 +1992,7 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento tmpTabCDSottoComp.setAroStrutDoc(tmpAroStrutDoc); tmpTabCDSottoComp - .setNiOrdCompDoc(new BigDecimal(tmpCV.getMySottoComponente().getOrdinePresentazione())); + .setNiOrdCompDoc(BigDecimal.valueOf(tmpCV.getMySottoComponente().getOrdinePresentazione())); tmpTabCDSottoComp .setTiSupportoComp(tmpCV.getMySottoComponente().getTipoSupportoComponente().toString()); tmpTabCDSottoComp @@ -2043,7 +2003,8 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento switch (tmpCV.getTipoSupporto()) { case FILE: - tmpTabCDSottoComp.setNiSizeFileCalc(new BigDecimal(tmpCV.getRifFileBinario().getDimensione())); + tmpTabCDSottoComp + .setNiSizeFileCalc(BigDecimal.valueOf(tmpCV.getRifFileBinario().getDimensione())); tmpTabCDSottoComp.setDecFormatoFileDoc( entityManager.find(DecFormatoFileDoc.class, tmpCV.getIdFormatoFileVers())); break; @@ -2058,11 +2019,12 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento } // non viene più persistito - // tmpTabCDSottoComp.setDsUrnCompCalc(tmpUrnCalc); - tmpTabCDSottoComp.setIdStrut(new BigDecimal(strutV.getIdStruttura())); + tmpTabCDSottoComp.setIdStrut(BigDecimal.valueOf(strutV.getIdStruttura())); // salvo nell'esito del sottocomponente il valore dell'URN calcolato - // tmpCV.getRifSottoComponenteResp().setURN(tmpUrnCalc); + if (tmpAroStrutDoc.getAroCompDocs() == null) { + tmpAroStrutDoc.setAroCompDocs(new ArrayList<>()); + } // aggiungo alla struttura documento il componente appena elaborato tmpAroStrutDoc.getAroCompDocs().add(tmpTabCDSottoComp); // salvo l'ordine di presentazione nella struttura documento, per recuperarlo in @@ -2070,7 +2032,7 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento tmpCV.setOrdinePresentazione(tmpCV.getMySottoComponente().getOrdinePresentazione()); // - tmpTabCDSottoComp.setAroAroCompUrnCalcs(new ArrayList()); + tmpTabCDSottoComp.setAroAroCompUrnCalcs(new ArrayList<>()); // gestione nuovo urn ORIGINALE String tmpUrn = MessaggiWSFormat.formattaBaseUrnDoc(strutV.getUrnPartVersatore(), @@ -2089,7 +2051,6 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento this.salvaCompUrnCalc(tmpTabCDSottoComp, tmpUrn, TiUrn.NORMALIZZATO); - //// MEV#18660 { // TODO: (da firma MEV#18660) CompDocMock mock = tmpCV.withAcdEntity(); Date tmRifTempVers = null; @@ -2124,10 +2085,10 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento mock.getIdDecFormatoFileStandard().longValue())); } // init bi-directionals - tmpTabCDSottoComp.setAroMarcaComps(new ArrayList()); - tmpTabCDSottoComp.setAroFirmaComps(new ArrayList()); - tmpTabCDSottoComp.setAroBustaCrittogs(new ArrayList()); - tmpTabCDSottoComp.setFirReport(new ArrayList()); + tmpTabCDSottoComp.setAroMarcaComps(new ArrayList<>()); + tmpTabCDSottoComp.setAroFirmaComps(new ArrayList<>()); + tmpTabCDSottoComp.setAroBustaCrittogs(new ArrayList<>()); + tmpTabCDSottoComp.setFirReport(new ArrayList<>()); //// } MEV#18660 boolean elabResultVerificaFirma = strutV.effettuaVerificaFirma() @@ -2145,7 +2106,7 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento if (StringUtils.isNotBlank(tmpTabCDSottoComp.getFlCompFirmato()) && tmpTabCDSottoComp.getFlCompFirmato().equals(Flag.TRUE)) { tmpReturn = salvataggioFirmaManager.salvaReportVerificaCompDoc(risposta, - tmpCV.getVfWrapper(), strutV, tmpTabCDSottoComp); + tmpCV.getVfWrapper(), strutV, tmpTabCDSottoComp, nomeWs); // se ci sono problemi nel salvataggio, blocco tutto if (!tmpReturn) { return tmpReturn; @@ -2165,7 +2126,7 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento switch (strutV.getTipoSalvataggioFile()) { case BLOB: tmpReturn = this.salvaBlobStrutDoc(tmpAroStrutDocMerged, valueDocVers, risposta, strutV, chiave, - WriteCompBlbOracle.TabellaBlob.ARO_CONTENUTO_COMP); + WriteCompBlbOracle.TabellaBlob.ARO_CONTENUTO_COMP, nomeWs); break; case FILE: if (strutV.isTpiAbilitato()) { @@ -2177,7 +2138,7 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento * tabella di blob dedicata chiamata ARO_FILE_COMP con struttura identica a ARO_CONTENUTO_COMP */ tmpReturn = this.salvaBlobStrutDoc(tmpAroStrutDocMerged, valueDocVers, risposta, strutV, chiave, - WriteCompBlbOracle.TabellaBlob.ARO_FILE_COMP); + WriteCompBlbOracle.TabellaBlob.ARO_FILE_COMP, nomeWs); } break; } @@ -2201,7 +2162,7 @@ private boolean salvaComponenti(RispostaControlli risposta, StrutturaVersamento /** * Rispetta la firma degli altri metodi privati, di fatto restituisce sempre true, non esistono infatti casistiche * per cui debba fallire - * + * * @param aroCompDoc * @param tmpUrn * @param tiUrn @@ -2218,7 +2179,7 @@ private void salvaCompUrnCalc(AroCompDoc aroCompDoc, String tmpUrn, TiUrn tiUrn) } private boolean salvaBlobStrutDoc(AroStrutDoc aroStrutDoc, DocumentoVers valueDocVers, RispostaControlli risposta, - StrutturaVersamento strutV, ChiaveType chiave, WriteCompBlbOracle.TabellaBlob tabellaBlob) { + StrutturaVersamento strutV, ChiaveType chiave, WriteCompBlbOracle.TabellaBlob tabellaBlob, String nomeWs) { // ricarico i componenti appena salvati per recuperare gli ID e conservarli in // memoria // inoltre preparo e salvo i record di contenuto componente relativi ai file @@ -2226,7 +2187,7 @@ private boolean salvaBlobStrutDoc(AroStrutDoc aroStrutDoc, DocumentoVers valueDo for (ComponenteVers tmpCV : valueDocVers.getFileAttesi()) { if (tmpCV.getOrdinePresentazione() == tmpCompDoc.getNiOrdCompDoc().longValue()) { tmpCV.setIdRecDB(tmpCompDoc.getIdCompDoc()); - if (!this.aggiungiBlobSuBlob(risposta, tmpCV, tmpCompDoc, strutV, chiave, tabellaBlob)) { + if (!this.aggiungiBlobSuBlob(risposta, tmpCV, tmpCompDoc, strutV, chiave, tabellaBlob, nomeWs)) { return false; } } @@ -2254,7 +2215,7 @@ private boolean salvaFileStrutDoc(AroStrutDoc aroStrutDoc, DocumentoVers valueDo } private boolean aggiungiBlobSuBlob(RispostaControlli risposta, ComponenteVers componente, AroCompDoc compntEntity, - StrutturaVersamento strutV, ChiaveType chiave, WriteCompBlbOracle.TabellaBlob tabellaBlob) { + StrutturaVersamento strutV, ChiaveType chiave, WriteCompBlbOracle.TabellaBlob tabellaBlob, String nomeWs) { boolean tmpReturn = true; FileBinario tmpFb; byte[] hash; @@ -2264,11 +2225,6 @@ private boolean aggiungiBlobSuBlob(RispostaControlli risposta, ComponenteVers co } tmpFb = componente.getRifFileBinario(); - if (tmpFb.isInMemoria()) { - risposta.setrBoolean(false); - risposta.setDsErr("[BLOB] Errore: non è possibile archiviare un file gestito in memoria."); - tmpReturn = false; - } if (tmpReturn) { try (FileInputStream fis = new FileInputStream(tmpFb.getFileSuDisco())) { @@ -2309,7 +2265,6 @@ private boolean aggiungiBlobSuBlob(RispostaControlli risposta, ComponenteVers co } // in ogni caso algoritmo ed encoding sono considerati costanti - // compntEntity.setDsAlgoHashFileCalc(CostantiDB.TipiHash.SHA_1.descrivi()); compntEntity.setDsAlgoHashFileCalc(CostantiDB.TipiHash.SHA_256.descrivi()); compntEntity.setCdEncodingHashFileCalc(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()); @@ -2338,18 +2293,32 @@ private boolean aggiungiBlobSuBlob(RispostaControlli risposta, ComponenteVers co if (tmpReturn) { try { - // procedo alla memorizzazione del file sul blob, via JDBC - WriteCompBlbOracle.DatiAccessori datiAccessori = new WriteCompBlbOracle().new DatiAccessori(); - datiAccessori.setTabellaBlob(tabellaBlob); - datiAccessori.setIdPadre(compntEntity.getIdCompDoc()); - datiAccessori.setIdStruttura(compntEntity.getIdStrut().longValue()); - datiAccessori.setAaKeyUnitaDoc(chiave.getAnno()); - datiAccessori.setDtVersamento(strutV.getDataVersamento()); - - RispostaControlli tmpControlli = writeCompBlbOracle.salvaStreamSuBlobComp(datiAccessori, tmpFb); - if (!tmpControlli.isrBoolean()) { - risposta.setDsErr(tmpControlli.getDsErr()); - tmpReturn = false; + AroDoc docRif = compntEntity.getAroStrutDoc().getAroDoc(); + long idTipoUnitaDoc = docRif.getAroUnitaDoc().getDecTipoUnitaDoc().getIdTipoUnitaDoc().longValue(); + BackendStorage backendComponenti = objectStorageService.lookupBackendByServiceName(idTipoUnitaDoc, + nomeWs); + + if (backendComponenti.isDataBase()) { + + // procedo alla memorizzazione del file sul blob, via JDBC + WriteCompBlbOracle.DatiAccessori datiAccessori = new WriteCompBlbOracle().new DatiAccessori(); + datiAccessori.setTabellaBlob(tabellaBlob); + datiAccessori.setIdPadre(compntEntity.getIdCompDoc()); + datiAccessori.setIdStruttura(compntEntity.getIdStrut().longValue()); + datiAccessori.setAaKeyUnitaDoc(chiave.getAnno()); + datiAccessori.setDtVersamento(strutV.getDataVersamento()); + + RispostaControlli tmpControlli = writeCompBlbOracle.salvaStreamSuBlobComp(datiAccessori, tmpFb); + if (!tmpControlli.isrBoolean()) { + risposta.setDsErr(tmpControlli.getDsErr()); + tmpReturn = false; + } + } else { // Backend Object storage + ObjectStorageResource componenteSuOS = objectStorageService.createOrCopyResourceInComponenti( + backendComponenti.getBackendName(), compntEntity.getIdCompDoc().longValue(), tmpFb); + log.debug("Salvato il componente su Object storage nel bucket {} con chiave {}! ", + componenteSuOS.getBucket(), componenteSuOS.getKey()); + } } catch (Exception re) { /// logga l'errore e blocca tutto @@ -2386,11 +2355,6 @@ private boolean aggiungiBlobSuFile(RispostaControlli risposta, ComponenteVers co } tmpFb = componente.getRifFileBinario(); - if (tmpFb.isInMemoria()) { - risposta.setrBoolean(false); - risposta.setDsErr("[TIVOLI] Errore: non è possibile archiviare su nastro un file gestito in memoria."); - tmpReturn = false; - } if (tmpReturn) { try (FileInputStream fis = new FileInputStream(tmpFb.getFileSuDisco())) { @@ -2438,7 +2402,6 @@ private boolean aggiungiBlobSuFile(RispostaControlli risposta, ComponenteVers co compntEntity.setDsNomeFileArk(tmpFilePath); // in ogni caso algoritmo ed encoding sono considerati costanti - // compntEntity.setDsAlgoHashFileCalc(CostantiDB.TipiHash.SHA_1.descrivi()); compntEntity.setDsAlgoHashFileCalc(CostantiDB.TipiHash.SHA_256.descrivi()); compntEntity.setCdEncodingHashFileCalc(CostantiDB.TipiEncBinari.HEX_BINARY.descrivi()); @@ -2531,7 +2494,7 @@ private boolean salvaDatiSpecCompUD(StrutturaVersamento strutturaVersIn) { } private boolean salvaDatiSpecGen(CostantiDB.TipiUsoDatiSpec tipoUso, TipiEntitaSacer tipoEntity, long idEntity, - long idStrut, long idXsd, HashMap datiSpecifici, long idAroUnitaDoc) { + long idStrut, long idXsd, Map datiSpecifici, long idAroUnitaDoc) { boolean tmpReturn = true; AroUsoXsdDatiSpec tmpAroUsoXsdDatiSpec = null; AroValoreAttribDatiSpec tmpAroValoreAttribDatiSpec = null; @@ -2560,7 +2523,7 @@ private boolean salvaDatiSpecGen(CostantiDB.TipiUsoDatiSpec tipoUso, TipiEntitaS break; } - tmpAroUsoXsdDatiSpec.setIdStrut(new BigDecimal(idStrut)); + tmpAroUsoXsdDatiSpec.setIdStrut(BigDecimal.valueOf(idStrut)); tmpAroUsoXsdDatiSpec.setDecXsdDatiSpec(entityManager.find(DecXsdDatiSpec.class, idXsd)); // inserisco su DB @@ -2578,7 +2541,7 @@ private boolean salvaDatiSpecGen(CostantiDB.TipiUsoDatiSpec tipoUso, TipiEntitaS for (DatoSpecifico tmpDS : datiSpecifici.values()) { tmpAroValoreAttribDatiSpec = new AroValoreAttribDatiSpec(); tmpAroValoreAttribDatiSpec.setAroUsoXsdDatiSpec(tmpAroUsoXsdDatiSpec); - tmpAroValoreAttribDatiSpec.setIdStrut(new BigDecimal(idStrut)); + tmpAroValoreAttribDatiSpec.setIdStrut(BigDecimal.valueOf(idStrut)); tmpAroValoreAttribDatiSpec .setDecAttribDatiSpec(entityManager.find(DecAttribDatiSpec.class, tmpDS.getIdDatoSpec())); tmpAroValoreAttribDatiSpec.setDlValore(tmpDS.getValore()); @@ -2604,7 +2567,7 @@ private boolean salvaDatiSpecGen(CostantiDB.TipiUsoDatiSpec tipoUso, TipiEntitaS * * * @param strutturaVersIn - * + * * @return */ private boolean salvaDatiAggregazioni(StrutturaVersamento strutV) { @@ -2649,11 +2612,10 @@ private boolean salvaDatiAggregazioni(StrutturaVersamento strutV) { * return list of idVerSerie */ private List retrieveSerVLisVerserByUpdUd(long idUnitaDoc) { - Query query = entityManager - .createQuery("SELECT ser.idVerSerie FROM SerVLisVerserByUpdUd ser WHERE ser.idUnitaDoc = :idUnitaDoc "); - query.setParameter("idUnitaDoc", idUnitaDoc); - List serie = query.getResultList(); - return serie; + Query query = entityManager.createQuery( + "SELECT ser.serVLisVerserByUpdUdId.idVerSerie FROM SerVLisVerserByUpdUd ser WHERE ser.serVLisVerserByUpdUdId.idUnitaDoc = :idUnitaDoc "); + query.setParameter("idUnitaDoc", BigDecimal.valueOf(idUnitaDoc)); + return query.getResultList(); } /* @@ -2664,28 +2626,27 @@ private List retrieveSerVLisVerserByUpdUd(long idUnitaDoc) { * return list of idFascicolo */ private List retrieveFasVLisFascByUpdUd(long idUnitaDoc) { - Query query = entityManager - .createQuery("SELECT ser.idFascicolo FROM FasVLisFascByUpdUd ser WHERE ser.idUnitaDoc = :idUnitaDoc "); - query.setParameter("idUnitaDoc", idUnitaDoc); - List fascicoli = query.getResultList(); - return fascicoli; + Query query = entityManager.createQuery( + "SELECT ser.fasVLisFascByUpdUdId.idFascicolo FROM FasVLisFascByUpdUd ser WHERE ser.fasVLisFascByUpdUdId.idUnitaDoc = :idUnitaDoc "); + query.setParameter("idUnitaDoc", BigDecimal.valueOf(idUnitaDoc)); + return query.getResultList(); } /** * Restituisce il valore del progressivo versione indice AIP di tipo UNISINCRO * * @param idUnitaDoc - * + * * @return il progressivo versione oppure 0 se questo ancora non esiste */ - private int recuperaProgressivoVersione(Long idUnitaDoc) { + private int recuperaProgressivoVersione(long idUnitaDoc) { List aroVerIndiceAipList; String queryStr = "SELECT u FROM AroVerIndiceAipUd u " + "WHERE u.aroIndiceAipUd.aroUnitaDoc.idUnitaDoc = :idUnitaDoc " + "AND u.aroIndiceAipUd.tiFormatoIndiceAip = 'UNISYNCRO' " + "ORDER BY u.pgVerIndiceAip DESC "; javax.persistence.Query query = entityManager.createQuery(queryStr); - query.setParameter("idUnitaDoc", idUnitaDoc); - aroVerIndiceAipList = (List) query.getResultList(); + query.setParameter("idUnitaDoc", Long.valueOf(idUnitaDoc)); + aroVerIndiceAipList = query.getResultList(); if (aroVerIndiceAipList != null && !aroVerIndiceAipList.isEmpty()) { return aroVerIndiceAipList.get(0).getPgVerIndiceAip().intValue(); } else { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/VerificaFirmeHash.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/VerificaFirmeHash.java similarity index 60% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/VerificaFirmeHash.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/VerificaFirmeHash.java index 0043a5c..3358d89 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/VerificaFirmeHash.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/VerificaFirmeHash.java @@ -1,18 +1,39 @@ -package it.eng.parer.ws.versamento.utils; +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb; -import javax.naming.InitialContext; -import javax.naming.NamingException; +import java.util.Objects; + +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import it.eng.parer.entity.OrgStrut; -import it.eng.parer.firma.util.VerificaFirmaEnums; +import it.eng.parer.firma.util.VerificaFirmaEnums.SacerIndication; import it.eng.parer.util.ejb.help.ConfigurationHelper; import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.AvanzamentoWs; -import it.eng.parer.ws.utils.CostantiDB; import it.eng.parer.ws.utils.Costanti.ModificatoriWS; +import it.eng.parer.ws.utils.CostantiDB; import it.eng.parer.ws.utils.MessaggiWSBundle; import it.eng.parer.ws.utils.ParametroApplDB.ParametroApplFl; import it.eng.parer.ws.versamento.dto.DocumentoVers; @@ -20,8 +41,6 @@ import it.eng.parer.ws.versamento.dto.StrutturaVersamento; import it.eng.parer.ws.versamento.dto.VersamentoExt; import it.eng.parer.ws.versamento.dto.VoceDiErrore; -import it.eng.parer.ws.versamento.ejb.ControlliPerFirme; -import it.eng.parer.ws.xml.versReq.ConfigType; import it.eng.parer.ws.xml.versResp.ECEsitoPosNegWarDisType; import it.eng.parer.ws.xml.versResp.ECEsitoPosNegWarType; import it.eng.parer.ws.xml.versResp.EsitoVersamento; @@ -31,30 +50,24 @@ * @author Fioravanti_F * @author Sinatti_S (revision) */ +@Stateless +@LocalBean public class VerificaFirmeHash { private static final Logger log = LoggerFactory.getLogger(VerificaFirmeHash.class); - private RispostaWS rispostaWs; - private VersamentoExt versamento; - private RispostaControlli rispostaControlli; - // EJB - private ControlliPerFirme controlliPerFirme = null; - private ConfigurationHelper configurationHelper = null; - - public VerificaFirmeHash(VersamentoExt vers, RispostaWS risp) { - versamento = vers; - rispostaWs = risp; - rispostaControlli = new RispostaControlli(); - } - - public void controlloFirmeMarcheHash() { + @EJB + private ControlliPerFirme controlliPerFirme; + @EJB + private ConfigurationHelper configurationHelper; + @EJB + private DocumentoVersVFirmeHash myDocumentoVersVFirme; + + public void controlloFirmeMarcheHash(VersamentoExt versamento, RispostaWS rispostaWs) { // Richiamo l'istanza dell'esito generale EsitoVersamento myEsito = rispostaWs.getIstanzaEsito(); StrutturaVersamento strutV = versamento.getStrutturaComponenti(); AvanzamentoWs myAvanzamentoWs = rispostaWs.getAvanzamento(); - - // classe di verifica firme documenti - generica - DocumentoVersVFirmeHash myDocumentoVersVFirme = null; + RispostaControlli rispostaControlli = new RispostaControlli(); boolean verFirmeDocCodiceEsitoNeg = false; boolean verFirmeDocCodiceEsitoWar = false; @@ -65,39 +78,10 @@ public void controlloFirmeMarcheHash() { myAvanzamentoWs.setFase("Inizializzazione...").logAvanzamento(); - // Recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - try { - controlliPerFirme = (ControlliPerFirme) new InitialContext().lookup("java:module/ControlliPerFirme"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dei controlli per firme " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli per firme ", ex); - } - } - - // Recupera l'ejb per il recupero delle configurazioni applicative - if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - try { - configurationHelper = (ConfigurationHelper) new InitialContext() - .lookup("java:module/ConfigurationHelper"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB ConfigurationHelper " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB ConfigurationHelper ", ex); - } - } - // §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ // inizializzazione verifica firme del documento // NB: può fallire, quindi passo RispostaWS che può tornare in stato di errore // §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ - if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - myDocumentoVersVFirme = new DocumentoVersVFirmeHash(versamento, rispostaWs, myEsito.getConfigurazione()); - } - if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { rispostaControlli = controlliPerFirme.getOrgStrutt(strutV.getIdStruttura()); if (rispostaControlli.getrLong() != -1) { @@ -112,9 +96,9 @@ public void controlloFirmeMarcheHash() { if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { // - elabFlagSipVDB(os); + elabFlagSipVDB(versamento, os); // - buildFlagsOnEsito(myEsito, os.getIdStrut(), os.getOrgEnte().getOrgAmbiente().getIdAmbiente(), + buildFlagsOnEsito(versamento, myEsito, os.getIdStrut(), os.getOrgEnte().getOrgAmbiente().getIdAmbiente(), versamento.getStrutturaComponenti().getIdTipologiaUnitaDocumentaria()); // Scorro i documenti myAvanzamentoWs.setFase("Ciclo sui documenti - inizio").logAvanzamento(); @@ -124,7 +108,8 @@ public void controlloFirmeMarcheHash() { // verifica firma if (versamento.getStrutturaComponenti().effettuaVerificaFirma() && myDocumentoVersVFirme.verificaDocumentoGenFirma(valueDocVers, - versamento.getStrutturaComponenti().getIdTipologiaUnitaDocumentaria())) { + versamento.getStrutturaComponenti().getIdTipologiaUnitaDocumentaria(), versamento, + rispostaWs, myEsito.getConfigurazione())) { // se non si sono verificati errori catastrofici, aggiorno alcune variabili // interne if (valueDocVers.getFlFileFirmato().equals(CostantiDB.Flag.TRUE)) { @@ -148,7 +133,8 @@ public void controlloFirmeMarcheHash() { } // verifica hash - myDocumentoVersVFirme.verificaDocumentoGenHash(valueDocVers); + myDocumentoVersVFirme.verificaDocumentoGenHash(valueDocVers, versamento, rispostaWs, + myEsito.getConfigurazione()); // codice esito (verifica se negativo in precedenza) if (!esitoDocHasNeg) { @@ -167,10 +153,8 @@ public void controlloFirmeMarcheHash() { // versione 1.5 if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_FIRMA_1_5)) { - versamento.getStrutturaComponenti() - .setTiEsitoVerifFirme(VerificaFirmaEnums.EsitoControllo.DISABILITATO.name()); - versamento.getStrutturaComponenti() - .setDsMsgEsitoVerifica(VerificaFirmaEnums.EsitoControllo.DISABILITATO.message()); + versamento.getStrutturaComponenti().setTiEsitoVerifFirme(SacerIndication.DISABILITATO.name()); + versamento.getStrutturaComponenti().setDsMsgEsitoVerifica(SacerIndication.DISABILITATO.message()); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setVerificaFirmeUnitaDocumentaria(ECEsitoPosNegWarDisType.DISABILITATO); @@ -180,24 +164,18 @@ public void controlloFirmeMarcheHash() { Boolean bool = myEsito.getUnitaDocumentaria().isFirmatoDigitalmente(); if (bool != null && bool) { if (verFirmeDocCodiceEsitoNeg) { - versamento.getStrutturaComponenti() - .setTiEsitoVerifFirme(VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - versamento.getStrutturaComponenti() - .setDsMsgEsitoVerifica(VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); + versamento.getStrutturaComponenti().setTiEsitoVerifFirme(SacerIndication.NEGATIVO.name()); + versamento.getStrutturaComponenti().setDsMsgEsitoVerifica(SacerIndication.NEGATIVO.message()); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setVerificaFirmeUnitaDocumentaria(ECEsitoPosNegWarDisType.NEGATIVO); } else if (verFirmeDocCodiceEsitoWar) { - versamento.getStrutturaComponenti() - .setTiEsitoVerifFirme(VerificaFirmaEnums.EsitoControllo.WARNING.name()); - versamento.getStrutturaComponenti() - .setDsMsgEsitoVerifica(VerificaFirmaEnums.EsitoControllo.WARNING.message()); + versamento.getStrutturaComponenti().setTiEsitoVerifFirme(SacerIndication.WARNING.name()); + versamento.getStrutturaComponenti().setDsMsgEsitoVerifica(SacerIndication.WARNING.message()); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setVerificaFirmeUnitaDocumentaria(ECEsitoPosNegWarDisType.WARNING); } else { - versamento.getStrutturaComponenti() - .setTiEsitoVerifFirme(VerificaFirmaEnums.EsitoControllo.POSITIVO.name()); - versamento.getStrutturaComponenti() - .setDsMsgEsitoVerifica(VerificaFirmaEnums.EsitoControllo.POSITIVO.message()); + versamento.getStrutturaComponenti().setTiEsitoVerifFirme(SacerIndication.POSITIVO.name()); + versamento.getStrutturaComponenti().setDsMsgEsitoVerifica(SacerIndication.POSITIVO.message()); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setVerificaFirmeUnitaDocumentaria(ECEsitoPosNegWarDisType.POSITIVO); } @@ -256,26 +234,31 @@ public void controlloFirmeMarcheHash() { } } - private void elabFlagSipVDB(OrgStrut os) { + private void elabFlagSipVDB(VersamentoExt versamento, OrgStrut os) { + // + boolean isConfigurazioneOnSip = !Objects.isNull(versamento.getVersamento().getConfigurazione()); + // long idStrut = os.getIdStrut(); long idAmbiente = os.getOrgEnte().getOrgAmbiente().getIdAmbiente(); long idTipoUd = versamento.getStrutturaComponenti().getIdTipologiaUnitaDocumentaria(); // - versamento.getStrutturaComponenti().setFlagAbilitaVerificaFirma(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_VERIFICA_FIRMA, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAbilitaVerificaFirma( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_VERIFICA_FIRMA, idStrut, + idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); // - versamento.getStrutturaComponenti().setFlagAbilitaVerificaFirmaSoloCrypto( - configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_VERIFICA_FIRMA_SOLO_CRYPTO, - idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti() + .setFlagAbilitaVerificaFirmaSoloCrypto(configurationHelper + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_VERIFICA_FIRMA_SOLO_CRYPTO, + idStrut, idAmbiente, idTipoUd) + .equals(CostantiDB.Flag.TRUE)); // - versamento.getStrutturaComponenti().setFlagAbilitaConservazioneNonFirmati(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_NON_FIRMATI, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAbilitaConservazioneNonFirmati( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_NON_FIRMATI, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); // versamento.getStrutturaComponenti().setFlagAccettaConservazioneNonFirmatiNeg( - configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_NON_FIRMATI_NEG, idStrut, - idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_NON_FIRMATI_NEG, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); /* * MAC #23544: La gestione del parametro FORZA_CONSERVAZIONE è opzionale sul SIP. Nel caso non siano configurati @@ -285,121 +268,120 @@ private void elabFlagSipVDB(OrgStrut os) { * versamento.getVersamento().getConfigurazione() I* Cerca lo stesso commento in VersamentoExtPrsr, * VersamentoExtAggAllPrsr e VerificaFirmeHashAggAll (tramite la stringa MAC #23544) */ - ConfigType configurazioneXML = versamento.getVersamento().getConfigurazione(); // SIP vs DB boolean forzaCons = false; - if (configurazioneXML.isForzaConservazione() != null) { - forzaCons = configurazioneXML.isForzaConservazione(); + if (isConfigurazioneOnSip && versamento.getVersamento().getConfigurazione().isForzaConservazione() != null) { + forzaCons = versamento.getVersamento().getConfigurazione().isForzaConservazione(); } else { - forzaCons = configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_NON_FIRMATI_NEG, - idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE); + forzaCons = configurationHelper + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_CONTR_NON_FIRMATI_NEG, idStrut, + idAmbiente, idTipoUd) + .equals(CostantiDB.Flag.TRUE); } versamento.getStrutturaComponenti().setConfigFlagForzaConservazione(forzaCons); // forzature controlli - versamento.getStrutturaComponenti().setConfigFlagForzaControlloRevoca(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_REVOCA_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setConfigFlagForzaControlloRevoca( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_CONTR_REVOCA_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti().setConfigFlagForzaControlloTrust(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_TRUST_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setConfigFlagForzaControlloTrust( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_CONTR_TRUST_VERS, idStrut, + idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti().setConfigFlagForzaControlloCrittografico(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_CRITTOG_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setConfigFlagForzaControlloCrittografico( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_CONTR_CRITTOG_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti().setConfigFlagForzaControlloCertificato(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_CERTIF_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setConfigFlagForzaControlloCertificato( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_CONTR_CERTIF_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti() - .setConfigFlagForzaControlloNonConformita(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_NOCONF, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setConfigFlagForzaControlloNonConformita(configurationHelper + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_CONTR_NOCONF, idStrut, idAmbiente, idTipoUd) + .equals(CostantiDB.Flag.TRUE)); // revoca - versamento.getStrutturaComponenti().setFlagAbilitaControlloRevoca(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAbilitaControlloRevoca( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); // ocsp - versamento.getStrutturaComponenti().setFlagAccettaControlloOCSPNegativo(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_OCSP_NEG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAccettaControlloOCSPNegativo( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_OCSP_NEG, idStrut, + idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti().setFlagAccettaControlloOCSPNoScaric(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_OCSP_NOSCAR, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAccettaControlloOCSPNoScaric( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_OCSP_NOSCAR, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti().setFlagAccettaControlloOCSPNoValido(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_OCSP_NOVAL, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAccettaControlloOCSPNoValido( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_OCSP_NOVAL, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti().setGenerazioneRerortVerificaFirma(configurationHelper - .getParamApplicValue(ParametroApplFl.GENERAZIONE_REPORT_VERIFICA_FIRMA, idStrut, idAmbiente, idTipoUd)); + versamento.getStrutturaComponenti().setGenerazioneRerortVerificaFirma( + configurationHelper.getValoreParamApplicByTipoUd(ParametroApplFl.GENERAZIONE_REPORT_VERIFICA_FIRMA, + idStrut, idAmbiente, idTipoUd)); } - private void buildFlagsOnEsito(EsitoVersamento myEsito, long idStrut, long idAmbiente, long idTipoUd) { + private void buildFlagsOnEsito(VersamentoExt versamento, EsitoVersamento myEsito, long idStrut, long idAmbiente, + long idTipoUd) { // Imposto da DB i valori di configurazione prettamente legati alla verifica // firme/marche // pre versione 1.5 if (!versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_FIRMA_1_5)) { - // Nota: viene utilizzato il flag FL_ABILITA_CONTR_REVOCA_VERS sia per setAbilitaControlloCRL che per + // Nota: viene utilizzato il flag FL_ABILITA_CONTR_REVOCA_VERS sia per + // setAbilitaControlloCRL che per // setAbilitaControlloRevoca - // questo in quanto tale flag include sia le CRL che OCSP, cambia esclusivamente il tag dell'esito + // questo in quanto tale flag include sia le CRL che OCSP, cambia esclusivamente + // il tag dell'esito myEsito.getConfigurazione().setAbilitaControlloCRL( - configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS, idStrut, - idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); } - myEsito.getConfigurazione().setAbilitaControlloCertificato(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_CERTIF_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAbilitaControlloCrittografico(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_CRITTOG_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAbilitaControlloTrust(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_TRUST_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCRLNegativo(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRL_NEG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCRLNoScaric(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRL_NOSCAR, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCRLNoValida(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRL_NOVAL, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCRLScaduta(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRL_SCAD, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCertificatoNoFirma(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CERTIF_NOCERT, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCertificatoNoValido(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CERTIF_NOVAL, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCertificatoScaduto(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CERTIF_SCAD, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCrittograficoNegativo(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRITTOG_NEG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloTrustNegativo(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_TRUST_NEG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaFirmaNoDelibera45(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_FIRMA_GIUGNO_2011, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione() - .setAccettaFirmaNonConforme(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_FIRMA_NOCONF, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaFirmaSconosciuta(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_FIRMA_NOCONOS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAbilitaControlloCertificato( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_CERTIF_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAbilitaControlloCrittografico( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_CRITTOG_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAbilitaControlloTrust( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_TRUST_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCRLNegativo(configurationHelper.getValoreParamApplicByTipoUdAsFl( + ParametroApplFl.FL_ACCETTA_CONTR_CRL_NEG, idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCRLNoScaric( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRL_NOSCAR, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCRLNoValida( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRL_NOVAL, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCRLScaduta(configurationHelper.getValoreParamApplicByTipoUdAsFl( + ParametroApplFl.FL_ACCETTA_CONTR_CRL_SCAD, idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCertificatoNoFirma( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CERTIF_NOCERT, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCertificatoNoValido( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CERTIF_NOVAL, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCertificatoScaduto( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CERTIF_SCAD, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCrittograficoNegativo( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRITTOG_NEG, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloTrustNegativo( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_TRUST_NEG, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaFirmaNoDelibera45( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_FIRMA_GIUGNO_2011, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaFirmaNonConforme(configurationHelper.getValoreParamApplicByTipoUdAsFl( + ParametroApplFl.FL_ACCETTA_FIRMA_NOCONF, idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaFirmaSconosciuta(configurationHelper.getValoreParamApplicByTipoUdAsFl( + ParametroApplFl.FL_ACCETTA_FIRMA_NOCONOS, idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); // MAC #23544 // aggiorna il tag [Configurazione] dell'esito (vedi elabFlagSipVDB) @@ -410,15 +392,14 @@ private void buildFlagsOnEsito(EsitoVersamento myEsito, long idStrut, long idAmb if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_VERIFICA_FORMATI_1_25)) { // Imposto da DB i valori di configurazione prettamente legati alla verifica // formati - myEsito.getConfigurazione().setAbilitaControlloFormato(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_FMT, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloFormatoNegativo(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_FMT_NEG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaMarcaSconosciuta(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_MARCA_NOCONOS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAbilitaControlloFormato(configurationHelper.getValoreParamApplicByTipoUdAsFl( + ParametroApplFl.FL_ABILITA_CONTR_FMT, idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloFormatoNegativo( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_FMT_NEG, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaMarcaSconosciuta( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_MARCA_NOCONOS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); } // if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_FIRMA_1_5)) { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/VerificaFirmeHashAggAll.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/VerificaFirmeHashAggAll.java similarity index 62% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/VerificaFirmeHashAggAll.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/VerificaFirmeHashAggAll.java index 38203b0..c89a621 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/VerificaFirmeHashAggAll.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/VerificaFirmeHashAggAll.java @@ -1,13 +1,32 @@ -package it.eng.parer.ws.versamento.utils; +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb; -import javax.naming.InitialContext; +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; import javax.naming.NamingException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import it.eng.parer.entity.OrgStrut; -import it.eng.parer.firma.util.VerificaFirmaEnums; +import it.eng.parer.firma.util.VerificaFirmaEnums.SacerIndication; import it.eng.parer.util.ejb.help.ConfigurationHelper; import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; import it.eng.parer.ws.dto.RispostaControlli; @@ -21,42 +40,30 @@ import it.eng.parer.ws.versamento.dto.StrutturaVersamento; import it.eng.parer.ws.versamento.dto.VersamentoExtAggAll; import it.eng.parer.ws.versamento.dto.VoceDiErrore; -import it.eng.parer.ws.versamento.ejb.ControlliPerFirme; import it.eng.parer.ws.xml.versReq.ConfigAggAllType; import it.eng.parer.ws.xml.versResp.ECEsitoPosNegWarDisType; import it.eng.parer.ws.xml.versResp.ECEsitoPosNegWarType; import it.eng.parer.ws.xml.versResp.EsitoVersAggAllegati; -/** - * - * @author Fioravanti_F - * @author Sinatti_S (revision) - */ +@Stateless(mappedName = "VerificaFirmeHashAggAll") +@LocalBean public class VerificaFirmeHashAggAll { private static final Logger log = LoggerFactory.getLogger(VerificaFirmeHashAggAll.class); - private RispostaWSAggAll rispostaWs; - private VersamentoExtAggAll versamento; - private RispostaControlli rispostaControlli; // EJB - private ControlliPerFirme controlliPerFirme = null; - private ConfigurationHelper configurationHelper = null; - - public VerificaFirmeHashAggAll(VersamentoExtAggAll vers, RispostaWSAggAll risp) { - versamento = vers; - rispostaWs = risp; - rispostaControlli = new RispostaControlli(); - } - - public void controlloFirmeMarcheHash() { + @EJB + private ControlliPerFirme controlliPerFirme; + @EJB + private ConfigurationHelper configurationHelper; + @EJB + private DocumentoVersVFirmeHash myDocumentoVersVFirme; + + public void controlloFirmeMarcheHash(VersamentoExtAggAll versamento, RispostaWSAggAll rispostaWs) { // Richiamo l'istanza dell'esito generale EsitoVersAggAllegati myEsito = rispostaWs.getIstanzaEsito(); StrutturaVersamento strutV = versamento.getStrutturaComponenti(); AvanzamentoWs myAvanzamentoWs = rispostaWs.getAvanzamento(); - // classe di verifica firme documenti - generica - DocumentoVersVFirmeHash myDocumentoVersVFirme = null; - boolean verFirmeDocCodiceEsitoNeg = false; boolean verFirmeDocCodiceEsitoWar = false; boolean esitoDocHasWar = false; @@ -66,41 +73,12 @@ public void controlloFirmeMarcheHash() { myAvanzamentoWs.setFase("Inizializzazione...").logAvanzamento(); - // Recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - try { - controlliPerFirme = (ControlliPerFirme) new InitialContext().lookup("java:module/ControlliPerFirme"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dei controlli per firme " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli per firme ", ex); - } - } - - // Recupera l'ejb per il recupero delle configurazioni applicative - if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - try { - configurationHelper = (ConfigurationHelper) new InitialContext() - .lookup("java:module/ConfigurationHelper"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB ConfigurationHelper " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB ConfigurationHelper ", ex); - } - } - // §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ // inizializzazione verifica firme del documento // NB: può fallire, quindi passo RispostaWS che può tornare in stato di errore // §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - myDocumentoVersVFirme = new DocumentoVersVFirmeHash(versamento, rispostaWs, myEsito.getConfigurazione()); - } - - if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - rispostaControlli = controlliPerFirme.getOrgStrutt(strutV.getIdStruttura()); + RispostaControlli rispostaControlli = controlliPerFirme.getOrgStrutt(strutV.getIdStruttura()); if (rispostaControlli.getrLong() != -1) { os = (OrgStrut) rispostaControlli.getrObject(); } else { @@ -113,10 +91,10 @@ public void controlloFirmeMarcheHash() { if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { // - elabFlagSipVDB(os); + elabFlagSipVDB(os, versamento); // buildFlEsito(myEsito, os.getIdStrut(), os.getOrgEnte().getOrgAmbiente().getIdAmbiente(), - versamento.getStrutturaComponenti().getIdTipologiaUnitaDocumentaria()); + versamento.getStrutturaComponenti().getIdTipologiaUnitaDocumentaria(), versamento); // Scorro i documenti /* @@ -133,7 +111,8 @@ public void controlloFirmeMarcheHash() { // verifica firma if (versamento.getStrutturaComponenti().effettuaVerificaFirma() && myDocumentoVersVFirme.verificaDocumentoGenFirma(valueDocVers, - versamento.getStrutturaComponenti().getIdTipologiaUnitaDocumentaria())) { + versamento.getStrutturaComponenti().getIdTipologiaUnitaDocumentaria(), versamento, + rispostaWs, myEsito.getConfigurazione())) { // se non si sono verificati errori catastrofici, aggiorno alcune variabili // interne if (valueDocVers.getFlFileFirmato().equals(CostantiDB.Flag.TRUE)) { @@ -157,7 +136,8 @@ public void controlloFirmeMarcheHash() { } // verifica hash - myDocumentoVersVFirme.verificaDocumentoGenHash(valueDocVers); + myDocumentoVersVFirme.verificaDocumentoGenHash(valueDocVers, versamento, rispostaWs, + myEsito.getConfigurazione()); // codice esito (verifica se negativo in precedenza) if (!esitoDocHasNeg) { @@ -174,10 +154,8 @@ public void controlloFirmeMarcheHash() { if (!versamento.getStrutturaComponenti().effettuaVerificaFirma()) { // versione 1.5 if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_FIRMA_1_5)) { - versamento.getStrutturaComponenti() - .setTiEsitoVerifFirme(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.name()); - versamento.getStrutturaComponenti() - .setDsMsgEsitoVerifica(VerificaFirmaEnums.EsitoControllo.NON_ESEGUITO.message()); + versamento.getStrutturaComponenti().setTiEsitoVerifFirme(SacerIndication.NON_ESEGUITO.name()); + versamento.getStrutturaComponenti().setDsMsgEsitoVerifica(SacerIndication.NON_ESEGUITO.message()); // myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setVerificaFirmeUnitaDocumentaria(ECEsitoPosNegWarDisType.DISABILITATO); @@ -187,24 +165,18 @@ public void controlloFirmeMarcheHash() { Boolean bool = myEsito.getUnitaDocumentaria().isFirmatoDigitalmente(); if (bool != null && bool) { if (verFirmeDocCodiceEsitoNeg) { - versamento.getStrutturaComponenti() - .setTiEsitoVerifFirme(VerificaFirmaEnums.EsitoControllo.NEGATIVO.name()); - versamento.getStrutturaComponenti() - .setDsMsgEsitoVerifica(VerificaFirmaEnums.EsitoControllo.NEGATIVO.message()); + versamento.getStrutturaComponenti().setTiEsitoVerifFirme(SacerIndication.NEGATIVO.name()); + versamento.getStrutturaComponenti().setDsMsgEsitoVerifica(SacerIndication.NEGATIVO.message()); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setVerificaFirmeUnitaDocumentaria(ECEsitoPosNegWarDisType.NEGATIVO); } else if (verFirmeDocCodiceEsitoWar) { - versamento.getStrutturaComponenti() - .setTiEsitoVerifFirme(VerificaFirmaEnums.EsitoControllo.WARNING.name()); - versamento.getStrutturaComponenti() - .setDsMsgEsitoVerifica(VerificaFirmaEnums.EsitoControllo.WARNING.message()); + versamento.getStrutturaComponenti().setTiEsitoVerifFirme(SacerIndication.WARNING.name()); + versamento.getStrutturaComponenti().setDsMsgEsitoVerifica(SacerIndication.WARNING.message()); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setVerificaFirmeUnitaDocumentaria(ECEsitoPosNegWarDisType.WARNING); } else { - versamento.getStrutturaComponenti() - .setTiEsitoVerifFirme(VerificaFirmaEnums.EsitoControllo.POSITIVO.name()); - versamento.getStrutturaComponenti() - .setDsMsgEsitoVerifica(VerificaFirmaEnums.EsitoControllo.POSITIVO.message()); + versamento.getStrutturaComponenti().setTiEsitoVerifFirme(SacerIndication.POSITIVO.name()); + versamento.getStrutturaComponenti().setDsMsgEsitoVerifica(SacerIndication.POSITIVO.message()); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setVerificaFirmeUnitaDocumentaria(ECEsitoPosNegWarDisType.POSITIVO); } @@ -261,26 +233,28 @@ public void controlloFirmeMarcheHash() { } } - private void elabFlagSipVDB(OrgStrut os) { + private void elabFlagSipVDB(OrgStrut os, VersamentoExtAggAll versamento) { long idStrut = os.getIdStrut(); long idAmbiente = os.getOrgEnte().getOrgAmbiente().getIdAmbiente(); long idTipoUd = versamento.getStrutturaComponenti().getIdTipologiaUnitaDocumentaria(); // - versamento.getStrutturaComponenti().setFlagAbilitaVerificaFirma(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_VERIFICA_FIRMA, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAbilitaVerificaFirma( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_VERIFICA_FIRMA, idStrut, + idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); // - versamento.getStrutturaComponenti().setFlagAbilitaVerificaFirmaSoloCrypto( - configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_VERIFICA_FIRMA_SOLO_CRYPTO, - idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti() + .setFlagAbilitaVerificaFirmaSoloCrypto(configurationHelper + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_VERIFICA_FIRMA_SOLO_CRYPTO, + idStrut, idAmbiente, idTipoUd) + .equals(CostantiDB.Flag.TRUE)); // - versamento.getStrutturaComponenti().setFlagAbilitaConservazioneNonFirmati(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_NON_FIRMATI, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAbilitaConservazioneNonFirmati( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_NON_FIRMATI, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); // versamento.getStrutturaComponenti().setFlagAccettaConservazioneNonFirmatiNeg( - configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_NON_FIRMATI_NEG, idStrut, - idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_NON_FIRMATI_NEG, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); /* * MAC #23544: La gestione dei parametri FORZA_COLLEGAMENTO (solo su versamento sincrono) e FORZA_CONSERVAZIONE * sono opzionali sul SIP. Nel caso non siano configurati sul SIP viene utilizzato il valore impostato sul DB. A @@ -293,59 +267,62 @@ private void elabFlagSipVDB(OrgStrut os) { // SIP vs DB boolean forzaCons = false; - if (configurazioneXML.isForzaConservazione() != null) { + if (configurazioneXML != null && configurazioneXML.isForzaConservazione() != null) { forzaCons = configurazioneXML.isForzaConservazione(); } else { - forzaCons = configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_NON_FIRMATI_NEG, - idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE); + forzaCons = configurationHelper + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_CONTR_NON_FIRMATI_NEG, idStrut, + idAmbiente, idTipoUd) + .equals(CostantiDB.Flag.TRUE); } versamento.getStrutturaComponenti().setConfigFlagForzaConservazione(forzaCons); // forzature controlli - versamento.getStrutturaComponenti().setConfigFlagForzaControlloRevoca(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_REVOCA_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setConfigFlagForzaControlloRevoca( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_CONTR_REVOCA_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti().setConfigFlagForzaControlloTrust(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_TRUST_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setConfigFlagForzaControlloTrust( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_CONTR_TRUST_VERS, idStrut, + idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti().setConfigFlagForzaControlloCrittografico(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_CRITTOG_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setConfigFlagForzaControlloCrittografico( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_CONTR_CRITTOG_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti().setConfigFlagForzaControlloCertificato(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_CERTIF_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setConfigFlagForzaControlloCertificato( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_CONTR_CERTIF_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti() - .setConfigFlagForzaControlloNonConformita(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_CONTR_NOCONF, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setConfigFlagForzaControlloNonConformita(configurationHelper + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_CONTR_NOCONF, idStrut, idAmbiente, idTipoUd) + .equals(CostantiDB.Flag.TRUE)); // revoca - versamento.getStrutturaComponenti().setFlagAbilitaControlloRevoca(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAbilitaControlloRevoca( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); // ocsp - versamento.getStrutturaComponenti().setFlagAccettaControlloOCSPNegativo(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_OCSP_NEG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAccettaControlloOCSPNegativo( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_OCSP_NEG, idStrut, + idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti().setFlagAccettaControlloOCSPNoScaric(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_OCSP_NOSCAR, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAccettaControlloOCSPNoScaric( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_OCSP_NOSCAR, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti().setFlagAccettaControlloOCSPNoValido(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_OCSP_NOVAL, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAccettaControlloOCSPNoValido( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_OCSP_NOVAL, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti().setGenerazioneRerortVerificaFirma(configurationHelper - .getParamApplicValue(ParametroApplFl.GENERAZIONE_REPORT_VERIFICA_FIRMA, idStrut, idAmbiente, idTipoUd)); + versamento.getStrutturaComponenti().setGenerazioneRerortVerificaFirma( + configurationHelper.getValoreParamApplicByTipoUd(ParametroApplFl.GENERAZIONE_REPORT_VERIFICA_FIRMA, + idStrut, idAmbiente, idTipoUd)); } - private void buildFlEsito(EsitoVersAggAllegati myEsito, long idStrut, long idAmbiente, long idTipoUd) { + private void buildFlEsito(EsitoVersAggAllegati myEsito, long idStrut, long idAmbiente, long idTipoUd, + VersamentoExtAggAll versamento) { // Imposto da DB i valori di configurazione prettamente legati alla verifica // firme/marche // pre versione 1.5 @@ -354,55 +331,50 @@ private void buildFlEsito(EsitoVersAggAllegati myEsito, long idStrut, long idAmb // setAbilitaControlloRevoca // questo in quanto tale flag include sia le CRL che OCSP, cambia esclusivamente il tag dell'esito myEsito.getConfigurazione().setAbilitaControlloCRL( - configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS, idStrut, - idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_REVOCA_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); } - myEsito.getConfigurazione().setAbilitaControlloCertificato(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_CERTIF_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAbilitaControlloCrittografico(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_CRITTOG_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAbilitaControlloTrust(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_TRUST_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCRLNegativo(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRL_NEG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCRLNoScaric(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRL_NOSCAR, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCRLNoValida(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRL_NOVAL, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCRLScaduta(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRL_SCAD, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCertificatoNoFirma(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CERTIF_NOCERT, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCertificatoNoValido(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CERTIF_NOVAL, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCertificatoScaduto(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CERTIF_SCAD, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloCrittograficoNegativo(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRITTOG_NEG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloTrustNegativo(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_TRUST_NEG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaFirmaNoDelibera45(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_FIRMA_GIUGNO_2011, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione() - .setAccettaFirmaNonConforme(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_FIRMA_NOCONF, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaFirmaSconosciuta(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_FIRMA_NOCONOS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAbilitaControlloCertificato( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_CERTIF_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAbilitaControlloCrittografico( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_CRITTOG_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAbilitaControlloTrust( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_TRUST_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCRLNegativo(configurationHelper.getValoreParamApplicByTipoUdAsFl( + ParametroApplFl.FL_ACCETTA_CONTR_CRL_NEG, idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCRLNoScaric( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRL_NOSCAR, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCRLNoValida( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRL_NOVAL, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCRLScaduta(configurationHelper.getValoreParamApplicByTipoUdAsFl( + ParametroApplFl.FL_ACCETTA_CONTR_CRL_SCAD, idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCertificatoNoFirma( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CERTIF_NOCERT, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCertificatoNoValido( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CERTIF_NOVAL, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCertificatoScaduto( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CERTIF_SCAD, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloCrittograficoNegativo( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_CRITTOG_NEG, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloTrustNegativo( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_TRUST_NEG, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaFirmaNoDelibera45( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_FIRMA_GIUGNO_2011, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaFirmaNonConforme(configurationHelper.getValoreParamApplicByTipoUdAsFl( + ParametroApplFl.FL_ACCETTA_FIRMA_NOCONF, idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaFirmaSconosciuta(configurationHelper.getValoreParamApplicByTipoUdAsFl( + ParametroApplFl.FL_ACCETTA_FIRMA_NOCONOS, idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); // MAC #23544 // aggiorna il tag [Configurazione] dell'esito (vedi elabFlagSipVDB) @@ -413,15 +385,14 @@ private void buildFlEsito(EsitoVersAggAllegati myEsito, long idStrut, long idAmb if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_VERIFICA_FORMATI_1_25)) { // Imposto da DB i valori di configurazione prettamente legati alla verifica // formati - myEsito.getConfigurazione().setAbilitaControlloFormato(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_FMT, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaControlloFormatoNegativo(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_FMT_NEG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); - myEsito.getConfigurazione().setAccettaMarcaSconosciuta(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_MARCA_NOCONOS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAbilitaControlloFormato(configurationHelper.getValoreParamApplicByTipoUdAsFl( + ParametroApplFl.FL_ABILITA_CONTR_FMT, idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaControlloFormatoNegativo( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_FMT_NEG, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); + myEsito.getConfigurazione().setAccettaMarcaSconosciuta( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_MARCA_NOCONOS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); } // if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_FIRMA_1_5)) { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/VersamentoSync.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/VersamentoSync.java index b6c89bc..f21841f 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/VersamentoSync.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/VersamentoSync.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.ejb; import javax.ejb.LocalBean; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/VersamentoSyncBase.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/VersamentoSyncBase.java index b7c04b5..aaf7259 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/VersamentoSyncBase.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/VersamentoSyncBase.java @@ -1,11 +1,31 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.ejb; import java.math.BigInteger; +import java.time.ZonedDateTime; import java.util.Date; import java.util.HashMap; import javax.annotation.Resource; import javax.ejb.EJB; +import javax.jms.ConnectionFactory; +import javax.jms.Queue; import javax.transaction.HeuristicMixedException; import javax.transaction.HeuristicRollbackException; import javax.transaction.NotSupportedException; @@ -20,8 +40,8 @@ import it.eng.parer.exception.ParamApplicNotFoundException; import it.eng.parer.util.DateUtilsConverter; import it.eng.parer.ws.dto.IRispostaWS; -import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; +import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.ejb.ControlliSemantici; import it.eng.parer.ws.ejb.ControlliWS; import it.eng.parer.ws.utils.AvanzamentoWs; @@ -33,14 +53,14 @@ import it.eng.parer.ws.utils.XmlDateUtility; import it.eng.parer.ws.utils.ejb.JmsProducerUtilEjb; import it.eng.parer.ws.versamento.dto.AbsVersamentoExt; +import it.eng.parer.ws.versamento.dto.BackendStorage; import it.eng.parer.ws.versamento.dto.ComponenteVers; import it.eng.parer.ws.versamento.dto.FileBinario; +import it.eng.parer.ws.versamento.dto.ObjectStorageResource; import it.eng.parer.ws.versamento.dto.RispostaWS; import it.eng.parer.ws.versamento.dto.SyncFakeSessn; -import it.eng.parer.ws.versamento.dto.SyncFakeSessn.TipiSessioneVersamento; import it.eng.parer.ws.versamento.dto.VersamentoExt; -import it.eng.parer.ws.versamento.utils.VerificaFirmeHash; -import it.eng.parer.ws.versamento.utils.VersamentoExtPrsr; +import it.eng.parer.ws.versamento.ejb.prs.VersamentoExtPrsr; import it.eng.parer.ws.versamentoTpi.utils.FileServUtils; import it.eng.parer.ws.xml.versResp.ECEsitoChiamataWSType; import it.eng.parer.ws.xml.versResp.ECEsitoExtType; @@ -50,15 +70,6 @@ import it.eng.parer.ws.xml.versResp.ECStatoConsType; import it.eng.parer.ws.xml.versResp.EsitoVersamento; import it.eng.spagoLite.security.User; -import java.time.ZonedDateTime; -import javax.ejb.EJBException; -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.JMSException; -import javax.jms.MessageProducer; -import javax.jms.Queue; -import javax.jms.Session; -import javax.jms.TextMessage; /** * @@ -72,7 +83,7 @@ public abstract class VersamentoSyncBase { // MEV#27048 @Resource(mappedName = "jms/ProducerConnectionFactory") protected ConnectionFactory connectionFactory; - @Resource(mappedName = "jms/ElenchiDaElabInAttesaSchedQueue") + @Resource(mappedName = "jms/queue/ElenchiDaElabQueue") protected Queue queue; // end MEV#27048 // @@ -92,6 +103,16 @@ public abstract class VersamentoSyncBase { protected ControlliSubStrut myControlliSubStrut; @EJB protected ControlliSemantici myControlliSemantici; + + @EJB + protected ObjectStorageService objectStorageService; + + @EJB + protected VerificaFirmeHash veriFirme; + + @EJB + protected VersamentoExtPrsr tmpPrsr; + // MEV#27048 @EJB protected JmsProducerUtilEjb jmsProducerUtilEjb; @@ -168,8 +189,7 @@ public void verificaCredenziali(String loginName, String password, String indiri logger.debug("sono nel metodo verificaCredenziali"); EsitoVersamento myEsito = rispostaWs.getIstanzaEsito(); - RispostaControlli tmpRispostaControlli = null; - tmpRispostaControlli = myControlliWs.checkCredenziali(loginName, password, indirizzoIp, + RispostaControlli tmpRispostaControlli = myControlliWs.checkCredenziali(loginName, password, indirizzoIp, TipiWSPerControlli.VERSAMENTO_RECUPERO); if (!tmpRispostaControlli.isrBoolean()) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); @@ -193,8 +213,7 @@ public void parseXML(SyncFakeSessn sessione, RispostaWS rispostaWs, VersamentoEx } try { - VersamentoExtPrsr tmpPrsr = new VersamentoExtPrsr(versamento, rispostaWs); - tmpPrsr.parseXML(sessione); + tmpPrsr.parseXML(sessione, rispostaWs, versamento); tmpAvanzamentoWs.resetFase(); } catch (Exception e) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); @@ -220,7 +239,7 @@ public void parseXML(SyncFakeSessn sessione, RispostaWS rispostaWs, VersamentoEx // verifica il partizionamento per la substruttura if (versamento.getXmlDefaults().get(ParametroApplDB.VERIFICA_PARTIZIONI) != null && versamento.getXmlDefaults() - .get(ParametroApplDB.VERIFICA_PARTIZIONI).trim().toUpperCase().equals("TRUE")) { + .get(ParametroApplDB.VERIFICA_PARTIZIONI).trim().equalsIgnoreCase("TRUE")) { if (rispostaWs.getSeverity() != IRispostaWS.SeverityEnum.ERROR) { RispostaControlli tmpRispostaControlli; tmpRispostaControlli = mycontrolliPartizioni.verificaPartizioniSubStrutt(versamento); @@ -239,8 +258,8 @@ public void parseXML(SyncFakeSessn sessione, RispostaWS rispostaWs, VersamentoEx if (tmpRispostaControlli.getCodErr() != null) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWs.setEsitoWsError(tmpRispostaControlli.getCodErr(), tmpRispostaControlli.getDsErr()); - logger.error("Eccezione nella fase di produzione Rapporto di versamento UD Doppia " - + tmpRispostaControlli.getDsErr()); + logger.error("Eccezione nella fase di produzione Rapporto di versamento UD Doppia {}", + tmpRispostaControlli.getDsErr()); } } else { myEsito.setXMLVersamento(sessione.getDatiIndiceSipXml()); @@ -252,10 +271,12 @@ public void addFile(FileBinario fileIn, RispostaWS rispostaWs, VersamentoExt ver EsitoVersamento myEsito = rispostaWs.getIstanzaEsito(); if (rispostaWs.getSeverity() != IRispostaWS.SeverityEnum.ERROR) { try { - // verifica se il file doveva essere inserito, cercandolo nella lista dei componenti + // verifica se il file doveva essere inserito, cercandolo nella lista dei + // componenti // se c'è lo imposta nel componente trovato // setta a true il flag di dati letti - // imposta il valore della dimensione del file nel frammento di xml di risposta già pronto + // imposta il valore della dimensione del file nel frammento di xml di risposta + // già pronto ComponenteVers tmpComponenteVers; tmpComponenteVers = versamento.getStrutturaComponenti().getFileAttesi().get(fileIn.getId()); if (tmpComponenteVers != null) { @@ -263,9 +284,11 @@ public void addFile(FileBinario fileIn, RispostaWS rispostaWs, VersamentoExt ver if (tmpComponenteVers.getTipoSupporto() == ComponenteVers.TipiSupporto.FILE) { tmpComponenteVers.setRifFileBinario(fileIn); tmpComponenteVers.setDatiLetti(true); - // imposta la dimensione file nell'XML di risposta associato al componente trovato + // imposta la dimensione file nell'XML di risposta associato al componente + // trovato // NOTA BENE: solo uno tra componente e sottocomponente è valorizzato, - // perciò il doppio IF che segue comporta la scrittura della dimensione su un solo elemento + // perciò il doppio IF che segue comporta la scrittura della dimensione su un + // solo elemento if (tmpComponenteVers.getRifComponenteResp() != null) { tmpComponenteVers.getRifComponenteResp() .setDimensioneFile(BigInteger.valueOf(fileIn.getDimensione())); @@ -337,6 +360,29 @@ public void verificaCoerenzaComponenti(RispostaWS rispostaWs, VersamentoExt vers } } + /** + * Effettua l'upload dei file sull'object storage nel caso il backend configurato sia di tipo OS - Versamento + * sync/Aggiunta documenti. Nel caso in cui non risulti disponibile l'object storage verrà emesso un errore + * bloccante non gestito. + * + * @param sessioneFinta + * Contenitore dei file + */ + public void uploadComponentiStaging(SyncFakeSessn sessioneFinta) { + + BackendStorage backendStaging = objectStorageService.lookupBackendVrsStaging(); + + if (backendStaging.isObjectStorage()) { + for (FileBinario rifFileBinario : sessioneFinta.getFileBinari()) { + logger.debug("Sto per salvare {} su OS", rifFileBinario.getFileName()); + ObjectStorageResource componenteStaging = objectStorageService + .createComponenteInStaging(backendStaging.getBackendName(), rifFileBinario.getFileSuDisco()); + rifFileBinario.setObjectStorageResource(componenteStaging); + } + } + + } + public void controllaFirmeAndHash(RispostaWS rispostaWs, VersamentoExt versamento) { logger.debug("sono nel metodo controllaFirme"); EsitoVersamento myEsito = rispostaWs.getIstanzaEsito(); @@ -349,8 +395,7 @@ public void controllaFirmeAndHash(RispostaWS rispostaWs, VersamentoExt versament if (rispostaWs.getSeverity() != IRispostaWS.SeverityEnum.ERROR) { try { - VerificaFirmeHash veriFirme = new VerificaFirmeHash(versamento, rispostaWs); - veriFirme.controlloFirmeMarcheHash(); + veriFirme.controlloFirmeMarcheHash(versamento, rispostaWs); } catch (Exception e) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); if (ExceptionUtils.getRootCause(e) instanceof ParamApplicNotFoundException) { @@ -386,7 +431,8 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWS rispostaWs, Versamento AvanzamentoWs tmpAvanzamentoWs = rispostaWs.getAvanzamento(); boolean prosegui = true; - // patch di dubbio gusto per includere la riga di errore eventualmente individuata nei controlli precedenti + // patch di dubbio gusto per includere la riga di errore eventualmente + // individuata nei controlli precedenti // nella lista di messaggi if (myEsito.getEsitoGenerale().getCodiceEsito() == ECEsitoExtType.NEGATIVO && !versamento.isTrovatiErrori()) { versamento.aggiungErroreFatale(myEsito.getEsitoGenerale().getCodiceErrore(), @@ -397,7 +443,7 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWS rispostaWs, Versamento myEsito.setWarningUlteriori(versamento.produciEsitoWarningSec()); // if (versamento.getXmlDefaults().get(ParametroApplDB.VERIFICA_PARTIZIONI) != null && versamento.getXmlDefaults() - .get(ParametroApplDB.VERIFICA_PARTIZIONI).trim().toUpperCase().equals("TRUE")) { + .get(ParametroApplDB.VERIFICA_PARTIZIONI).trim().equalsIgnoreCase("TRUE")) { String tmpDescStrut; if (versamento.getStrutturaComponenti() != null && versamento.getStrutturaComponenti().getIdStruttura() != 0) { @@ -412,17 +458,14 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWS rispostaWs, Versamento rispostaWs.setEsitoWsError(tmpRispostaControlli.getCodErr(), tmpRispostaControlli.getDsErr()); versamento.aggiungErroreFatale(myEsito.getEsitoGenerale().getCodiceErrore(), myEsito.getEsitoGenerale().getMessaggioErrore()); - // rigenera la lista errori e warning secondari - forse cambiata in caso di errore + // rigenera la lista errori e warning secondari - forse cambiata in caso di + // errore myEsito.setErroriUlteriori(versamento.produciEsitoErroriSec()); myEsito.setWarningUlteriori(versamento.produciEsitoWarningSec()); prosegui = false; } } - // togliere! - // prosegui = false; - // togliere! - // versamento.setSimulaScrittura(true); if (prosegui && !versamento.isSimulaScrittura()) { this.beginTrans(rispostaWs); @@ -435,7 +478,8 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWS rispostaWs, Versamento this.beginTrans(rispostaWs); versamento.aggiungErroreFatale(myEsito.getEsitoGenerale().getCodiceErrore(), myEsito.getEsitoGenerale().getMessaggioErrore()); - // rigenera la lista errori e warning secondari - forse cambiata in caso di errore di persistenza + // rigenera la lista errori e warning secondari - forse cambiata in caso di + // errore di persistenza myEsito.setErroriUlteriori(versamento.produciEsitoErroriSec()); myEsito.setWarningUlteriori(versamento.produciEsitoWarningSec()); } @@ -451,13 +495,14 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWS rispostaWs, Versamento if (tmpRispostaControlli.getCodErr() != null) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, tmpRispostaControlli.getDsErr()); - logger.error("Eccezione nella fase di produzione Rapporto di versamento " - + tmpRispostaControlli.getDsErr()); + logger.error("Eccezione nella fase di produzione Rapporto di versamento {}", + tmpRispostaControlli.getDsErr()); this.rollback(rispostaWs); this.beginTrans(rispostaWs); versamento.aggiungErroreFatale(myEsito.getEsitoGenerale().getCodiceErrore(), myEsito.getEsitoGenerale().getMessaggioErrore()); - // rigenera la lista errori e warning secondari - forse cambiata in caso di errore + // rigenera la lista errori e warning secondari - forse cambiata in caso di + // errore myEsito.setErroriUlteriori(versamento.produciEsitoErroriSec()); myEsito.setWarningUlteriori(versamento.produciEsitoWarningSec()); } @@ -472,12 +517,13 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWS rispostaWs, Versamento if (tmpRispostaControlli.getCodErr() != null) { // nota l'errore critico di persistenza viene contrassegnato con la lettera P // per dare la possibilità all'eventuale chiamante di ripetere il tentativo - // quando possibile (non è infatti un errore "definitivo" dato dall'input, ma bensì + // quando possibile (non è infatti un errore "definitivo" dato dall'input, ma + // bensì // un errore interno provocato da problemi al database) rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, tmpRispostaControlli.getDsErr()); - logger.error("Eccezione nella fase di Salvataggio dei dati di sessione " - + tmpRispostaControlli.getDsErr()); + logger.error("Eccezione nella fase di Salvataggio dei dati di sessione {}", + tmpRispostaControlli.getDsErr()); this.rollback(rispostaWs); prosegui = false; } @@ -499,13 +545,13 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWS rispostaWs, Versamento pl.setDtCreazione(DateUtilsConverter .convert(versamento.getStrutturaComponenti().getDataVersamento()).getTime()); - tmpRispostaControlli = jmsProducerUtilEjb.inviaMessaggioInFormatoJson(connectionFactory, queue, pl, - "CodaElenchiDaElabInAttesaSched"); + tmpRispostaControlli = jmsProducerUtilEjb.manageMessageGroupingInFormatoJson(connectionFactory, + queue, pl, "CodaElenchiDaElab", String.valueOf(pl.getIdStrut())); if (tmpRispostaControlli.getCodErr() != null) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, tmpRispostaControlli.getDsErr()); - logger.error("Eccezione nella fase di Invio messaggio alla coda JMS " - + tmpRispostaControlli.getDsErr()); + logger.error("Eccezione nella fase di Invio messaggio alla coda JMS {}", + tmpRispostaControlli.getDsErr()); this.rollback(rispostaWs); prosegui = false; } @@ -515,14 +561,12 @@ public void salvaTutto(SyncFakeSessn sessione, RispostaWS rispostaWs, Versamento // end MEV#27048 if (prosegui && rispostaWs.getErrorType() != IRispostaWS.ErrorTypeEnum.DB_FATAL) { - // DEBUG: togliere il commento! this.commit(rispostaWs); - // DEBUG: commentare la riga sotto!! - // this.rollback(rispostaWs); } } } + @SuppressWarnings("unchecked") protected RispostaControlli caricaXmlDefault(AbsVersamentoExt ave) { RispostaControlli rs = myControlliSemantici .caricaDefaultDaDB(ParametroApplDB.TipoParametroAppl.VERSAMENTO_DEFAULT); @@ -533,6 +577,7 @@ protected RispostaControlli caricaXmlDefault(AbsVersamentoExt ave) { return rs; } + @SuppressWarnings("unchecked") protected RispostaControlli loadWsVersions(AbsVersamentoExt versamento) { RispostaControlli rs = myControlliWs.loadWsVersions(versamento.getDescrizione()); // if positive ... @@ -545,17 +590,11 @@ protected RispostaControlli loadWsVersions(AbsVersamentoExt versamento) { protected void beginTrans(IRispostaWS rispostaWs) { try { utx.begin(); - } catch (NotSupportedException e) { + } catch (NotSupportedException | SystemException e) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nella fase di apertura transazione db del EJB " + e.getMessage()); - logger.error("Eccezione nell'init ejb versamento ", e); - } catch (SystemException e) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nella fase di apertura transazione db del EJB " + e.getMessage()); + "Errore nella fase di apertura transazione db del EJB " + ExceptionUtils.getRootCauseMessage(e)); logger.error("Eccezione nell'init ejb versamento ", e); } } @@ -563,41 +602,12 @@ protected void beginTrans(IRispostaWS rispostaWs) { protected void commit(IRispostaWS rispostaWs) { try { utx.commit(); - } catch (SecurityException e) { + } catch (SecurityException | IllegalStateException | RollbackException | HeuristicMixedException + | HeuristicRollbackException | SystemException e) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nella fase di commit transazione db del EJB " + e.getMessage()); - logger.error("Eccezione nel commit ejb versamento ", e); - } catch (IllegalStateException e) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nella fase di commit transazione db del EJB " + e.getMessage()); - logger.error("Eccezione nel commit ejb versamento ", e); - } catch (RollbackException e) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nella fase di commit transazione db del EJB " + e.getMessage()); - logger.error("Eccezione nel commit ejb versamento ", e); - } catch (HeuristicMixedException e) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nella fase di commit transazione db del EJB " + e.getMessage()); - logger.error("Eccezione nel commit ejb versamento ", e); - } catch (HeuristicRollbackException e) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nella fase di commit transazione db del EJB " + e.getMessage()); - logger.error("Eccezione nel commit ejb versamento ", e); - } catch (SystemException e) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nella fase di commit transazione db del EJB " + e.getMessage()); + "Errore nella fase di commit transazione db del EJB " + ExceptionUtils.getRootCauseMessage(e)); logger.error("Eccezione nel commit ejb versamento ", e); } } @@ -605,23 +615,11 @@ protected void commit(IRispostaWS rispostaWs) { protected void rollback(IRispostaWS rispostaWs) { try { utx.rollback(); - } catch (IllegalStateException e) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nella fase di rollack transazione db del EJB " + e.getMessage()); - logger.error("Eccezione nel rollback ejb versamento ", e); - } catch (SecurityException e) { - rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); - rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nella fase di rollack transazione db del EJB " + e.getMessage()); - logger.error("Eccezione nel rollback ejb versamento ", e); - } catch (SystemException e) { + } catch (IllegalStateException | SecurityException | SystemException e) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWs.setErrorType(IRispostaWS.ErrorTypeEnum.DB_FATAL); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nella fase di rollack transazione db del EJB " + e.getMessage()); + "Errore nella fase di rollack transazione db del EJB " + ExceptionUtils.getRootCauseMessage(e)); logger.error("Eccezione nel rollback ejb versamento ", e); } } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/help/SalvataggioBackendHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/help/SalvataggioBackendHelper.java new file mode 100644 index 0000000..1cbd839 --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/help/SalvataggioBackendHelper.java @@ -0,0 +1,1279 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb.help; + +import static it.eng.parer.ws.utils.Costanti.WS_AGGIUNTA_DOC_NOME; +import static it.eng.parer.ws.utils.Costanti.WS_VERSAMENTO_MM_NOME; +import static it.eng.parer.ws.utils.Costanti.WS_VERSAMENTO_NOME; +import static it.eng.parer.ws.utils.Costanti.WS_AGGIORNAMENTO_VERS_NOME; +import static it.eng.parer.ws.utils.Costanti.AwsConstants.MEATADATA_INGEST_NODE; +import static it.eng.parer.ws.utils.Costanti.AwsConstants.MEATADATA_INGEST_TIME; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.net.URI; +import java.net.URL; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; + +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.NonUniqueResultException; +import javax.persistence.PersistenceContext; +import javax.persistence.TypedQuery; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import it.eng.parer.entity.AroCompDoc; +import it.eng.parer.entity.AroCompObjectStorage; +import it.eng.parer.entity.AroDoc; +import it.eng.parer.entity.AroUnitaDoc; +import it.eng.parer.entity.AroUpdCompUnitaDoc; +import it.eng.parer.entity.AroUpdDatiSpecUdObjectStorage; +import it.eng.parer.entity.AroUpdDocUnitaDoc; +import it.eng.parer.entity.AroUpdUnitaDoc; +import it.eng.parer.entity.AroVersIniComp; +import it.eng.parer.entity.AroVersIniDatiSpecObjectStorage; +import it.eng.parer.entity.AroVersIniDoc; +import it.eng.parer.entity.AroVersIniUnitaDoc; +import it.eng.parer.entity.AroXmlDocObjectStorage; +import it.eng.parer.entity.AroXmlUnitaDocObjectStorage; +import it.eng.parer.entity.AroXmlUpdUdObjectStorage; +import it.eng.parer.entity.DecBackend; +import it.eng.parer.entity.DecConfigObjectStorage; +import it.eng.parer.entity.DecTipoUnitaDoc; +import it.eng.parer.entity.VrsDatiSessioneVersKo; +import it.eng.parer.entity.VrsFileSesObjectStorageKo; +import it.eng.parer.entity.VrsFileSessioneKo; +import it.eng.parer.entity.VrsSesUpdUnitaDocErr; +import it.eng.parer.entity.VrsSesUpdUnitaDocKo; +import it.eng.parer.entity.VrsXmlDatiSesObjectStorageKo; +import it.eng.parer.entity.VrsXmlSesUpdUdErrObjectStorage; +import it.eng.parer.entity.VrsXmlSesUpdUdKoObjectStorage; +import it.eng.parer.entity.constraint.AroUpdDatiSpecUnitaDoc.TiEntitaAroUpdDatiSpecUnitaDoc; +import it.eng.parer.entity.constraint.AroVersIniDatiSpec.TiEntitaSacerAroVersIniDatiSpec; +import it.eng.parer.entity.inheritance.oop.AroXmlObjectStorage; +import it.eng.parer.exception.ParamApplicNotFoundException; +import it.eng.parer.util.ejb.help.ConfigurationHelper; +import it.eng.parer.ws.utils.ParametroApplDB; +import it.eng.parer.ws.versamento.dto.BackendStorage; +import it.eng.parer.ws.versamento.dto.ObjectStorageBackend; +import it.eng.parer.ws.versamento.dto.ObjectStorageResource; +import it.eng.parer.ws.versamento.ejb.AwsClient; +import it.eng.parer.ws.versamento.ejb.AwsPresigner; +import it.eng.parer.ws.versamento.exceptions.ObjectStorageException; +import software.amazon.awssdk.awscore.exception.AwsServiceException; +import software.amazon.awssdk.core.ResponseInputStream; +import software.amazon.awssdk.core.exception.SdkClientException; +import software.amazon.awssdk.core.sync.RequestBody; +import software.amazon.awssdk.services.s3.S3Client; +import software.amazon.awssdk.services.s3.model.CopyObjectRequest; +import software.amazon.awssdk.services.s3.model.CopyObjectResponse; +import software.amazon.awssdk.services.s3.model.GetObjectRequest; +import software.amazon.awssdk.services.s3.model.GetObjectResponse; +import software.amazon.awssdk.services.s3.model.GetUrlRequest; +import software.amazon.awssdk.services.s3.model.PutObjectRequest; +import software.amazon.awssdk.services.s3.model.PutObjectRequest.Builder; +import software.amazon.awssdk.services.s3.model.PutObjectResponse; +import software.amazon.awssdk.services.s3.model.PutObjectTaggingRequest; +import software.amazon.awssdk.services.s3.model.PutObjectTaggingResponse; +import software.amazon.awssdk.services.s3.model.Tag; +import software.amazon.awssdk.services.s3.model.Tagging; + +@Stateless(mappedName = "SalvataggioBackendHelper") +@LocalBean +public class SalvataggioBackendHelper { + + private final Logger log = LoggerFactory.getLogger(SalvataggioBackendHelper.class); + + private static final String NO_PARAMETER = "Impossibile ottenere il parametro {0}"; + private static final String LOG_MESSAGE_NO_SAVED = "Impossibile salvare il link dell'oggetto su DB"; + + @EJB + protected ConfigurationHelper configurationHelper; + + @EJB + protected AwsPresigner presigner; + + @EJB + protected AwsClient s3Clients; + + @PersistenceContext(unitName = "ParerJPA") + private EntityManager entityManager; + + public enum BACKEND_VERSAMENTO { + DATABASE, OBJECT_STORAGE + } + + /** + * Ottieni la configurazione applicativa relativa alla tipologia di Backend per il salvataggio in "staging" + * + * @return configurazione del backend. Può essere, per esempio OBJECT_STORAGE_STAGING oppure DATABASE_PRIMARIO + * + * @throws ObjectStorageException + * in caso di errore di recupero del parametro + */ + public String getBackendStaging() throws ObjectStorageException { + try { + return configurationHelper.getValoreParamApplicByApplic(ParametroApplDB.BACKEND_VRS_SES_UD_STAGING); + + } catch (ParamApplicNotFoundException | IllegalArgumentException e) { + throw ObjectStorageException.builder().message(NO_PARAMETER, ParametroApplDB.BACKEND_VRS_SES_UD_STAGING) + .cause(e).build(); + } + } + + // MEV#29276 + /** + * Ottieni la configurazione applicativa relativa alla tipologia di Backend per il salvataggio delle sessioni + * errate/fallite dell'aggiornamento metadati + * + * @return configurazione del backend. Può essere, per esempio OBJECT_STORAGE_STAGING oppure DATABASE_PRIMARIO + * + * @throws ObjectStorageException + * in caso di errore di recupero del parametro + */ + public String getBackendSessioniErrKoAggMd() throws ObjectStorageException { + try { + return configurationHelper.getValoreParamApplicByApplic(ParametroApplDB.BACKEND_XML_SES_AGG_MD_ERR_KO); + + } catch (ParamApplicNotFoundException | IllegalArgumentException e) { + throw ObjectStorageException.builder().message(NO_PARAMETER, ParametroApplDB.BACKEND_XML_SES_AGG_MD_ERR_KO) + .cause(e).build(); + } + } + // end MEV#29276 + + /** + * Ottieni la tipologia di backend per servizio + * + * @param idTipoUnitaDoc + * id della tipologia dell'UD + * @param nomeWs + * nome del servizio + * + * @return configurazione del backend. Può essere, per esempio OBJECT_STORAGE_STAGING oppure DATABASE_PRIMARIO + * + * @throws ObjectStorageException + * in caso di errore + */ + public String getBackendByServiceName(long idTipoUnitaDoc, String nomeWs) throws ObjectStorageException { + try { + + final String backendDatiVersamento; + switch (nomeWs) { + case WS_VERSAMENTO_NOME: + backendDatiVersamento = ParametroApplDB.BACKEND_VERSAMENTO_SYNC; + break; + case WS_AGGIUNTA_DOC_NOME: + backendDatiVersamento = ParametroApplDB.BACKEND_AGGIUNTALLEGATI_SYNC; + break; + case WS_VERSAMENTO_MM_NOME: + backendDatiVersamento = ParametroApplDB.BACKEND_VERSAMENTO_MULTIMEDIA; + break; + // MEV#29276 + case WS_AGGIORNAMENTO_VERS_NOME: + backendDatiVersamento = ParametroApplDB.BACKEND_VERSAMENTO_AGG_MD; + break; + // end MEV#29276 + default: + throw new IllegalArgumentException("Tipo creazione documento non supportato"); + } + + return getParameter(backendDatiVersamento, idTipoUnitaDoc); + + } catch (ParamApplicNotFoundException | IllegalArgumentException e) { + throw ObjectStorageException.builder() + .message("Impossibile ottenere il parametro per id tipo unita doc {0} e nome servizio {1}", + idTipoUnitaDoc, nomeWs) + .cause(e).build(); + } + } + + private String getParameter(String parameterName, long idTipoUnitaDoc) { + DecTipoUnitaDoc tipoUd = entityManager.find(DecTipoUnitaDoc.class, idTipoUnitaDoc); + long idStrut = tipoUd.getOrgStrut().getIdStrut(); + + long idAmbiente = tipoUd.getOrgStrut().getOrgEnte().getOrgAmbiente().getIdAmbiente(); + + return configurationHelper.getValoreParamApplicByTipoUd(parameterName, idStrut, idAmbiente, idTipoUnitaDoc); + } + + /** + * Salva lo stream di dati sull'object storage della configurazione identificandolo con la chiave passata come + * parametro. + * + * @param blob + * stream di dati + * @param blobLength + * dimensione dello stream di dati + * @param key + * chiave dell'oggetto + * @param configuration + * configurazione dell'object storage in cui aggiungere l'oggetto + * + * @return riferimento alla risorsa appena inserita + * + * @throws ObjectStorageException + * in caso di errore + */ + public ObjectStorageResource putObject(InputStream blob, long blobLength, final String key, + ObjectStorageBackend configuration) throws ObjectStorageException { + checkFullConfiguration(configuration); + try { + return putObject(blob, blobLength, key, configuration, Optional.empty(), Optional.empty(), + Optional.empty()); + } catch (Exception e) { + throw ObjectStorageException.builder() + .message("Impossibile salvare oggetto {0} sul bucket {1}", key, configuration.getBucket()).cause(e) + .build(); + } + + } + + /** + * Salva lo stream di dati sull'object storage della configurazione identificandolo con la chiave passata come + * parametro. + * + * @param blob + * stream di dati + * @param blobLength + * dimensione dello stream di dati + * @param key + * chiave dell'oggetto + * @param configuration + * configurazione dell'object storage in cui aggiungere l'oggetto + * @param metadata + * eventuali metadati (nel caso non vengano passati vengono utilizzati quelli predefiniti) + * @param tags + * eventuali tag (nel caso non vengano passati non vengnono apposti) + * @param base64md5 + * eventuale base64-encoded MD5 del file per data integrity check + * + * @return riferimento alla risorsa appena inserita + * + * @throws ObjectStorageException + * in caso di errore + */ + public ObjectStorageResource putObject(InputStream blob, long blobLength, final String key, + ObjectStorageBackend configuration, Optional> metadata, Optional> tags, + Optional base64md5) throws ObjectStorageException { + + checkFullConfiguration(configuration); + + final URI storageAddress = configuration.getAddress(); + final String accessKeyId = configuration.getAccessKeyId(); + final String secretKey = configuration.getSecretKey(); + final String bucket = configuration.getBucket(); + + log.debug("Sto per inserire nell'os {} la chiave {} sul bucket {}", storageAddress, key, bucket); + + try { + S3Client s3Client = s3Clients.getClient(storageAddress, accessKeyId, secretKey); + + Builder putObjectBuilder = PutObjectRequest.builder().bucket(bucket).key(key); + + if (metadata.isPresent()) { + putObjectBuilder.metadata(metadata.get()); + } else { + putObjectBuilder.metadata(defaultMetadata()); + } + if (tags.isPresent()) { + putObjectBuilder.tagging(Tagging.builder().tagSet(tags.get()).build()); + } + if (base64md5.isPresent()) { + putObjectBuilder.contentMD5(base64md5.get()); + } + + PutObjectRequest objectRequest = putObjectBuilder.build(); + final long start = System.currentTimeMillis(); + PutObjectResponse response = s3Client.putObject(objectRequest, + RequestBody.fromInputStream(blob, blobLength)); + + final long end = System.currentTimeMillis() - start; + if (log.isDebugEnabled()) { + log.debug("Salvato oggetto {} di {} byte sul bucket {} con ETag {} in {} ms", key, blobLength, bucket, + response.eTag(), end); + } + final URL presignedUrl = presigner.getPresignedUrl(configuration, key); + // + final URI presignedURLasURI = presignedUrl.toURI(); + + final String tenant = getDefaultTenant(); + + return new ObjectStorageResource() { + @Override + public String getBucket() { + return bucket; + } + + @Override + public String getKey() { + return key; + } + + @Override + public String getETag() { + return response.eTag(); + } + + @Override + public String getExpiration() { + return response.expiration(); + } + + @Override + public URI getPresignedURL() { + return presignedURLasURI; + } + + @Override + public String getTenant() { + return tenant; + } + }; + + } catch (Exception e) { + throw ObjectStorageException.builder().message("{0}: impossibile salvare oggetto {1} sul bucket {2}", + configuration.getBackendName(), key, configuration.getBucket()).cause(e).build(); + } + } + + private Map defaultMetadata() { + + Map defaultMetadata = new HashMap<>(); + defaultMetadata.put(MEATADATA_INGEST_NODE, System.getProperty("jboss.node.name")); + defaultMetadata.put(MEATADATA_INGEST_TIME, ZonedDateTime.now().format(DateTimeFormatter.ISO_INSTANT)); + return defaultMetadata; + } + + /** + * Copia dal bucket di staging l'oggetto sul bucket definitivo. + * + * @param sourceKey + * chiave del bucket sorgente + * @param sourceConfiguration + * configurazione del bucket sorgente + * @param destKey + * chiave del bucket destinazione + * @param destConfiguration + * configurazione del bucket di destinazione + * + * @return riferimento della risorsa caricata + * + * @throws ObjectStorageException + * in caso di errore + */ + public ObjectStorageResource createObjectComponenti(String sourceKey, ObjectStorageBackend sourceConfiguration, + String destKey, ObjectStorageBackend destConfiguration) throws ObjectStorageException { + + checkFullConfiguration(sourceConfiguration); + checkFullConfiguration(destConfiguration); + + S3Client s3SourceClient; + GetObjectRequest getObjectRequest; + try { + s3SourceClient = s3Clients.getClient(sourceConfiguration.getAddress(), sourceConfiguration.getAccessKeyId(), + sourceConfiguration.getSecretKey()); + + getObjectRequest = GetObjectRequest.builder().bucket(sourceConfiguration.getBucket()).key(sourceKey) + .build(); + } catch (Exception e) { + throw ObjectStorageException.builder().message( + "{0}: impossibile spostare dal bucket {1} oggetto con chiave {2} sul bucket {3} con chiave {4}", + sourceConfiguration.getBackendName(), sourceConfiguration.getBucket(), sourceKey, + destConfiguration.getBucket(), destKey).cause(e).build(); + } + try (ResponseInputStream objectStream = s3SourceClient.getObject(getObjectRequest);) { + long objectLength = objectStream.response().contentLength(); + return putObject(objectStream, objectLength, destKey, destConfiguration); + + } catch (Exception e) { + throw ObjectStorageException.builder().message( + "{0}: impossibile spostare dal bucket {1} oggetto con chiave {2} sul bucket {3} con chiave {4}", + sourceConfiguration.getBackendName(), sourceConfiguration.getBucket(), sourceKey, + destConfiguration.getBucket(), destKey).cause(e).build(); + } + + } + + /** + * Copia il file memorizzato nel filesystem sul un oggetto nel bucket definitivo. + * + * @param componente + * file del componente + * @param destKey + * chiave del bucket destinazione + * @param destConfiguration + * configurazione del bucket di destinazione + * + * @return riferimento della risorsa caricata + * + * @throws ObjectStorageException + * in caso di errore + */ + public ObjectStorageResource createObjectComponenti(File componente, String destKey, + ObjectStorageBackend destConfiguration) throws ObjectStorageException { + checkFullConfiguration(destConfiguration); + + try (FileInputStream fis = new FileInputStream(componente)) { + return putObject(fis, componente.length(), destKey, destConfiguration); + } catch (IOException e) { + throw ObjectStorageException.builder() + .message("Impossibile caricare il file {0} sul bucket {1} con chiave {2}", componente.getName(), + destConfiguration.getBucket(), destKey) + .cause(e).build(); + } + + } + + /** + * Effettua il salvataggio del collegamento tra l'id componente e la chiave sull'object storage + * + * @param object + * informazioni dell'oggetto salvato + * @param nmBackend + * nome del backend (di tipo OS) su cui è stato salvato + * @param idCompDoc + * id del componente + * + * @throws ObjectStorageException + * in caso di errore + */ + public void saveObjectStorageLinkCompDoc(ObjectStorageResource object, String nmBackend, long idCompDoc) + throws ObjectStorageException { + try { + AroCompDoc aroCompDoc = entityManager.find(AroCompDoc.class, idCompDoc); + AroCompObjectStorage osLink = new AroCompObjectStorage(); + osLink.setAroCompDoc(aroCompDoc); + + osLink.setCdKeyFile(object.getKey()); + osLink.setNmBucket(object.getBucket()); + osLink.setNmTenant(object.getTenant()); + + osLink.setDecBackend(getBackendEntity(nmBackend)); + entityManager.persist(osLink); + + } catch (Exception e) { + throw ObjectStorageException.builder().message(LOG_MESSAGE_NO_SAVED).cause(e).build(); + } + } + + /** + * Effettua il salvataggio del collegamento tra i metadati dell'unita documentaria e la chiave sull'object storage + * + * @param object + * informazioni dell'oggetto salvato + * @param nmBackend + * nome del backend (di tipo OS) su cui è stato salvato + * @param idAroUnitaDoc + * id unita documentaria + * + * @throws ObjectStorageException + * in caso di errore + */ + public void saveObjectStorageLinkSipUd(ObjectStorageResource object, String nmBackend, long idAroUnitaDoc) + throws ObjectStorageException { + try { + AroUnitaDoc aroUnitaDoc = entityManager.find(AroUnitaDoc.class, idAroUnitaDoc); + AroXmlUnitaDocObjectStorage osLink = new AroXmlUnitaDocObjectStorage(); + osLink.setAroUnitaDoc(aroUnitaDoc); + + osLink.setCdKeyFile(object.getKey()); + osLink.setNmBucket(object.getBucket()); + osLink.setNmTenant(object.getTenant()); + + osLink.setDecBackend(getBackendEntity(nmBackend)); + entityManager.persist(osLink); + + } catch (Exception e) { + throw ObjectStorageException.builder().message(LOG_MESSAGE_NO_SAVED).cause(e).build(); + } + } + + /** + * Effettua il salvataggio del collegamento tra i metadati del documento e la chiave sull'object storage + * + * @param object + * informazioni dell'oggetto salvato + * @param nmBackend + * nome del backend (di tipo OS) su cui è stato salvato + * @param idAroDoc + * id unita documentaria + * + * @throws ObjectStorageException + * in caso di errore + */ + public void saveObjectStorageLinkSipDoc(ObjectStorageResource object, String nmBackend, long idAroDoc) + throws ObjectStorageException { + try { + AroDoc aroDoc = entityManager.find(AroDoc.class, idAroDoc); + AroXmlDocObjectStorage osLink = new AroXmlDocObjectStorage(); + osLink.setAroDoc(aroDoc); + + osLink.setCdKeyFile(object.getKey()); + osLink.setNmBucket(object.getBucket()); + osLink.setNmTenant(object.getTenant()); + + osLink.setDecBackend(getBackendEntity(nmBackend)); + entityManager.persist(osLink); + + } catch (Exception e) { + throw ObjectStorageException.builder().message(LOG_MESSAGE_NO_SAVED).cause(e).build(); + } + } + + // MEV#29276 + /** + * Effettua il salvataggio del collegamento tra i sip degli aggiornamenti metadati e la chiave sull'object storage + * + * @param object + * informazioni dell'oggetto salvato + * @param nmBackend + * nome del backend (di tipo OS) su cui è stato salvato + * @param idUpdUnitaDoc + * id aggiornamento metadati + * @param idStrut + * id della struttura versante + * + * @throws ObjectStorageException + * in caso di errore + */ + public void saveObjectStorageLinkSipAggMd(ObjectStorageResource object, String nmBackend, long idUpdUnitaDoc, + BigDecimal idStrut) throws ObjectStorageException { + try { + AroUpdUnitaDoc aroUpdUnitaDoc = entityManager.find(AroUpdUnitaDoc.class, idUpdUnitaDoc); + + AroXmlUpdUdObjectStorage osLink = new AroXmlUpdUdObjectStorage(); + osLink.setAroUpdUnitaDoc(aroUpdUnitaDoc); + + osLink.setCdKeyFile(object.getKey()); + osLink.setNmBucket(object.getBucket()); + osLink.setNmTenant(object.getTenant()); + osLink.setDecBackend(getBackendEntity(nmBackend)); + osLink.setIdStrut(idStrut); + + entityManager.persist(osLink); + + } catch (Exception e) { + throw ObjectStorageException.builder().message(LOG_MESSAGE_NO_SAVED).cause(e).build(); + } + } + + /** + * Effettua il salvataggio del collegamento tra i dati specifici degli aggiornamenti metadati e la chiave + * sull'object storage + * + * @param object + * informazioni dell'oggetto salvato + * @param nmBackend + * nome del backend (di tipo OS) su cui è stato salvato + * @param idEntitySacerUpd + * id dell'entità sacer associata ai dati specifici dell'aggiornamento metadati + * @param tipoEntitySacerUpd + * tipo entità sacer associata ai dati specifici dell'aggiornamento metadati + * @param idStrut + * id della struttura versante + * + * @throws ObjectStorageException + * in caso di errore + */ + public void saveObjectStorageLinkUpdDatiSpecAggMd(ObjectStorageResource object, String nmBackend, + long idEntitySacerUpd, TiEntitaAroUpdDatiSpecUnitaDoc tipoEntitySacerUpd, BigDecimal idStrut) + throws ObjectStorageException { + + try { + + AroUpdDatiSpecUdObjectStorage osLink = new AroUpdDatiSpecUdObjectStorage(); + + switch (tipoEntitySacerUpd) { + case UPD_UNI_DOC: + AroUpdUnitaDoc aroUpdUnitaDoc = entityManager.find(AroUpdUnitaDoc.class, idEntitySacerUpd); + osLink.setAroUpdUnitaDoc(aroUpdUnitaDoc); + break; + case UPD_DOC: + AroUpdDocUnitaDoc aroUpdDocUnitaDoc = entityManager.find(AroUpdDocUnitaDoc.class, idEntitySacerUpd); + osLink.setAroUpdUnitaDoc(aroUpdDocUnitaDoc.getAroUpdUnitaDoc()); + osLink.setAroUpdDocUnitaDoc(aroUpdDocUnitaDoc); + break; + case UPD_COMP: + AroUpdCompUnitaDoc aroUpdCompUnitaDoc = entityManager.find(AroUpdCompUnitaDoc.class, idEntitySacerUpd); + osLink.setAroUpdUnitaDoc(aroUpdCompUnitaDoc.getAroUpdDocUnitaDoc().getAroUpdUnitaDoc()); + osLink.setAroUpdDocUnitaDoc(aroUpdCompUnitaDoc.getAroUpdDocUnitaDoc()); + osLink.setAroUpdCompUnitaDoc(aroUpdCompUnitaDoc); + break; + } + + osLink.setTiEntitaSacer(tipoEntitySacerUpd); + osLink.setCdKeyFile(object.getKey()); + osLink.setNmBucket(object.getBucket()); + osLink.setNmTenant(object.getTenant()); + osLink.setDecBackend(getBackendEntity(nmBackend)); + osLink.setIdStrut(idStrut); + + entityManager.persist(osLink); + + } catch (Exception e) { + throw ObjectStorageException.builder().message(LOG_MESSAGE_NO_SAVED).cause(e).build(); + } + } + + /** + * Effettua il salvataggio del collegamento tra i dati specifici degli aggiornamenti metadati relativi ai metadati + * iniziali e la chiave sull'object storage + * + * @param object + * informazioni dell'oggetto salvato + * @param nmBackend + * nome del backend (di tipo OS) su cui è stato salvato + * @param idEntitySacerVersIni + * id dell'entità sacer associata ai dati specifici dell'aggiornamento metadati relativi ai metadati + * iniziali + * @param tipoEntitySacerVersIni + * tipo entità sacer associata ai dati specifici dell'aggiornamento metadati relativi ai metadati + * iniziali + * @param idStrut + * id della struttura versante + * + * @throws ObjectStorageException + * in caso di errore + */ + public void saveObjectStorageLinkVersIniDatiSpecAggMd(ObjectStorageResource object, String nmBackend, + long idEntitySacerVersIni, TiEntitaSacerAroVersIniDatiSpec tipoEntitySacerVersIni, BigDecimal idStrut) + throws ObjectStorageException { + + try { + + AroVersIniDatiSpecObjectStorage osLink = new AroVersIniDatiSpecObjectStorage(); + + switch (tipoEntitySacerVersIni) { + case UNI_DOC: + AroVersIniUnitaDoc aroVersIniUnitaDoc = entityManager.find(AroVersIniUnitaDoc.class, + idEntitySacerVersIni); + osLink.setAroVersIniUnitaDoc(aroVersIniUnitaDoc); + break; + case DOC: + AroVersIniDoc aroVersIniDoc = entityManager.find(AroVersIniDoc.class, idEntitySacerVersIni); + osLink.setAroVersIniUnitaDoc(aroVersIniDoc.getAroVersIniUnitaDoc()); + osLink.setAroVersIniDoc(aroVersIniDoc); + break; + case COMP: + AroVersIniComp aroVersIniComp = entityManager.find(AroVersIniComp.class, idEntitySacerVersIni); + osLink.setAroVersIniUnitaDoc(aroVersIniComp.getAroVersIniDoc().getAroVersIniUnitaDoc()); + osLink.setAroVersIniDoc(aroVersIniComp.getAroVersIniDoc()); + osLink.setAroVersIniComp(aroVersIniComp); + break; + } + + osLink.setTiEntitaSacer(tipoEntitySacerVersIni); + osLink.setCdKeyFile(object.getKey()); + osLink.setNmBucket(object.getBucket()); + osLink.setNmTenant(object.getTenant()); + osLink.setDecBackend(getBackendEntity(nmBackend)); + osLink.setIdStrut(idStrut); + + entityManager.persist(osLink); + + } catch (Exception e) { + throw ObjectStorageException.builder().message(LOG_MESSAGE_NO_SAVED).cause(e).build(); + } + } + + /** + * Effettua il salvataggio del collegamento tra i versamenti falliti e la loro chiave sull'object storage (nel + * bucket "sessioni-err-ko-agg-md") + * + * @param object + * informazioni dell'oggetto salvato + * @param nmBackend + * nome del backend (di tipo OS) su cui è stato salvato + * @param idSesUpdUnitaDocKo + * id sessione fallita + * @param idStrut + * id della struttura versante + * + * @throws ObjectStorageException + * in caso di errore + */ + public void saveObjectStorageLinkSipSessioneKoAggMd(ObjectStorageResource object, String nmBackend, + long idSesUpdUnitaDocKo, BigDecimal idStrut) throws ObjectStorageException { + try { + + VrsSesUpdUnitaDocKo sesUpdUnitaDocKo = entityManager.find(VrsSesUpdUnitaDocKo.class, idSesUpdUnitaDocKo); + + VrsXmlSesUpdUdKoObjectStorage linkFalliti = new VrsXmlSesUpdUdKoObjectStorage(); + linkFalliti.setVrsSesUpdUnitaDocKo(sesUpdUnitaDocKo); + linkFalliti.setDecBackend(getBackendEntity(nmBackend)); + linkFalliti.setNmTenant(object.getTenant()); + linkFalliti.setNmBucket(object.getBucket()); + linkFalliti.setCdKeyFile(object.getKey()); + linkFalliti.setIdStrut(idStrut); + entityManager.persist(linkFalliti); + + } catch (Exception e) { + throw ObjectStorageException.builder().message(LOG_MESSAGE_NO_SAVED).cause(e).build(); + } + } + + /** + * Effettua il salvataggio del collegamento tra i versamenti errati e la loro chiave sull'object storage (nel bucket + * "sessioni-err-ko-agg-md") + * + * @param object + * informazioni dell'oggetto salvato + * @param nmBackend + * nome del backend (di tipo OS) su cui è stato salvato + * @param idSesUpdUnitaDocErr + * id sessione errata + * @param idStrut + * id della struttura versante + * + * @throws ObjectStorageException + * in caso di errore + */ + public void saveObjectStorageLinkSipSessioneErrAggMd(ObjectStorageResource object, String nmBackend, + long idSesUpdUnitaDocErr, BigDecimal idStrut) throws ObjectStorageException { + try { + + VrsSesUpdUnitaDocErr sesUpdUnitaDocErr = entityManager.find(VrsSesUpdUnitaDocErr.class, + idSesUpdUnitaDocErr); + + VrsXmlSesUpdUdErrObjectStorage linkErrati = new VrsXmlSesUpdUdErrObjectStorage(); + linkErrati.setVrsSesUpdUnitaDocErr(sesUpdUnitaDocErr); + linkErrati.setDecBackend(getBackendEntity(nmBackend)); + linkErrati.setNmTenant(object.getTenant()); + linkErrati.setNmBucket(object.getBucket()); + linkErrati.setCdKeyFile(object.getKey()); + linkErrati.setIdStrut(idStrut); + entityManager.persist(linkErrati); + + } catch (Exception e) { + throw ObjectStorageException.builder().message(LOG_MESSAGE_NO_SAVED).cause(e).build(); + } + } + // end MEV#29276 + + /** + * Effettua il salvataggio del collegamento tra i sip di versamento (raggruppati dall'id dati sessione vers) e la + * chiave sull'object storage + * + * @param object + * informazioni dell'oggetto salvato + * @param nmBackend + * nome del backend (di tipo OS) su cui è stato salvato + * @param idDatiSessioneVers + * id dati sessione vers + * @param idStrut + * id della struttura versante + * + * @throws ObjectStorageException + * in caso di errore + */ + public void saveObjectStorageLinkSipSessione(ObjectStorageResource object, String nmBackend, + long idDatiSessioneVers, BigDecimal idStrut) throws ObjectStorageException { + try { + VrsXmlDatiSesObjectStorageKo vrsXmlDatiSesObjectStorageKo = new VrsXmlDatiSesObjectStorageKo(); + vrsXmlDatiSesObjectStorageKo.setDecBackend(getBackendEntity(nmBackend)); + vrsXmlDatiSesObjectStorageKo.setNmTenant(object.getTenant()); + vrsXmlDatiSesObjectStorageKo.setNmBucket(object.getBucket()); + vrsXmlDatiSesObjectStorageKo.setNmKeyFile(object.getKey()); + vrsXmlDatiSesObjectStorageKo.setIdStrut(idStrut); + vrsXmlDatiSesObjectStorageKo + .setDatiSessioneVersKo(entityManager.find(VrsDatiSessioneVersKo.class, idDatiSessioneVers)); + entityManager.persist(vrsXmlDatiSesObjectStorageKo); + } catch (Exception e) { + throw ObjectStorageException.builder().message(LOG_MESSAGE_NO_SAVED).cause(e).build(); + } + } + + /** + * Effettua il salvataggio del collegamento tra i versamenti falliti e la loro chiave sull'object storage (nel + * bucket di staging) + * + * @param stagingResource + * informazioni dell'oggetto salvato + * @param nmBackend + * nome del backend (di tipo OS) su cui è stato salvato + * @param idFileSessione + * id file sessione + * @param idStrut + * id della struttura versante + * + * @throws ObjectStorageException + * in caso di errore + */ + public void saveObjectStorageLinkFileSessione(ObjectStorageResource stagingResource, String nmBackend, + long idFileSessione, BigDecimal idStrut) throws ObjectStorageException { + try { + VrsFileSessioneKo fileSessioneKo = entityManager.find(VrsFileSessioneKo.class, idFileSessione); + + VrsFileSesObjectStorageKo linkFalliti = new VrsFileSesObjectStorageKo(); + linkFalliti.setFileSessioneKo(fileSessioneKo); + linkFalliti.setDecBackend(getBackendEntity(nmBackend)); + linkFalliti.setNmTenant(stagingResource.getTenant()); + linkFalliti.setNmBucket(stagingResource.getBucket()); + linkFalliti.setNmKeyFile(stagingResource.getKey()); + linkFalliti.setIdStrut(idStrut); + entityManager.persist(linkFalliti); + } catch (Exception e) { + throw ObjectStorageException.builder().message(LOG_MESSAGE_NO_SAVED).cause(e).build(); + } + } + + /** + * Effettua la copia dell'oggetto dal bucket di staging a quello definitivo (dei componenti).Questo metodo + * funziona solamente se entrambi i bucket sono all'interno del medesimo OS. + * + * ATTENZIONE Questo metodo non è mai stato testato né chiamato. Rappresenta, però, una possibile + * ottimizzazione della fase di versamento. + * + * + * @param sourceKey + * chiave dell'oggetto nel bucket di staging + * @param sourceConfiguration + * configurazione dell'Object storage sorgente + * @param destKey + * chiave dell'oggetto nel bucket dei componenti + * @param destConfiguration + * configurazione dell'Object storage destinazione + * + * @throws ObjectStorageException + * in caso di eccezione + */ + public void copyObjectFromStaging(String sourceKey, ObjectStorageBackend sourceConfiguration, String destKey, + ObjectStorageBackend destConfiguration) throws ObjectStorageException { + + checkFullConfiguration(sourceConfiguration); + checkFullConfiguration(destConfiguration); + + // non è lo stesso Object storage, non posso effettuare la copia tra bucket. + if (!sameServiceAccount(destConfiguration, destConfiguration)) { + return; + } + + final URI storageAddress = sourceConfiguration.getAddress(); + final String accessKeyId = sourceConfiguration.getAccessKeyId(); + final String secretKey = sourceConfiguration.getSecretKey(); + + try { + S3Client s3Client = s3Clients.getClient(storageAddress, accessKeyId, secretKey); + GetUrlRequest request = GetUrlRequest.builder().bucket(sourceConfiguration.getBucket()).key(sourceKey) + .build(); + + URL sourceUrl = s3Client.utilities().getUrl(request); + + CopyObjectRequest copyReq = CopyObjectRequest.builder().copySourceIfMatch(sourceUrl.toExternalForm()) + .destinationBucket(destConfiguration.getBucket()).destinationKey(destKey).build(); + + CopyObjectResponse copyRes = s3Client.copyObject(copyReq); + if (log.isDebugEnabled()) { + log.debug( + "Copiato oggetto {} dal bucket di staging {} al bucket dei componenti {} con chiave {} e con ETag {}", + sourceKey, sourceConfiguration.getBucket(), destConfiguration.getBucket(), destKey, + copyRes.copyObjectResult().eTag()); + } + + } catch (Exception e) { + throw ObjectStorageException.builder().message("Impossibile copiare tra staging e componenti").cause(e) + .build(); + } + } + + /** + * Controlla se il service account utilizzato per accedere all'object storage è lo stesso. In questo caso si può + * procedere all'operazione di copia tra bucket. + * + * @param conf1 + * prima configurazione + * @param conf2 + * seconda configurazione + * + * @return true se il service account è il medesimo + */ + private static boolean sameServiceAccount(ObjectStorageBackend conf1, ObjectStorageBackend conf2) { + return conf1.getAddress().equals(conf2.getAddress()) && conf1.getAccessKeyId().equals(conf2.getAccessKeyId()) + && conf1.getSecretKey().equals(conf2.getSecretKey()); + } + + private DecBackend getBackendEntity(String nomeBackend) { + TypedQuery query = entityManager + .createQuery("Select d from DecBackend d where d.nmBackend = :nomeBackend", DecBackend.class); + query.setParameter("nomeBackend", nomeBackend); + return query.getSingleResult(); + } + + /** + * Ottieni la configurazione del backend a partire dal nome del backend + * + * @param nomeBackend + * per esempio "OBJECT_STORAGE_PRIMARIO" + * + * @return Informazioni sul Backend identificato + * + * @throws ObjectStorageException + * in caso di errore + */ + public BackendStorage getBackend(String nomeBackend) throws ObjectStorageException { + try { + + DecBackend backend = getBackendEntity(nomeBackend); + final BackendStorage.STORAGE_TYPE type = BackendStorage.STORAGE_TYPE.valueOf(backend.getNmTipoBackend()); + final String backendName = backend.getNmBackend(); + + return new BackendStorage() { + private static final long serialVersionUID = 1L; + + @Override + public BackendStorage.STORAGE_TYPE getType() { + return type; + } + + @Override + public String getBackendName() { + return backendName; + } + }; + + } catch (IllegalArgumentException | NonUniqueResultException e) { + throw ObjectStorageException.builder().message("Impossibile ottenere le informazioni di backend").cause(e) + .build(); + } + + } + + private static final String BUCKET = "BUCKET"; + private static final String ACCESS_KEY_ID_SYS_PROP = "ACCESS_KEY_ID_SYS_PROP"; + private static final String SECRET_KEY_SYS_PROP = "SECRET_KEY_SYS_PROP"; + + /** + * Ottieni la configurazione per potersi collegare a quel bucket dell'Object Storage scelto. + * + * @param nomeBackend + * nome del backend di tipo DEC_BACKEND.NM_TIPO_BACKEND = 'OS' come censito su + * DEC_BACKEND (per esempio OBJECT_STORAGE_PRIMARIO) + * @param tipoUsoOs + * ambito di utilizzo di questo backend (per esempio STAGING) + * + * @return Configurazione dell'Object Storage per quell'ambito + * + * @throws ObjectStorageException + * in caso di errore + */ + public ObjectStorageBackend getObjectStorageConfiguration(final String nomeBackend, final String tipoUsoOs) + throws ObjectStorageException { + TypedQuery query = entityManager.createQuery( + "Select c from DecConfigObjectStorage c where c.tiUsoConfigObjectStorage = :tipoUsoOs and c.decBackend.nmBackend = :nomeBackend order by c.nmConfigObjectStorage", + DecConfigObjectStorage.class); + query.setParameter("tipoUsoOs", tipoUsoOs).setParameter("nomeBackend", nomeBackend); + List resultList = query.getResultList(); + String bucket = null; + String nomeSystemPropertyAccessKeyId = null; + String nomeSystemPropertySecretKey = null; + String storageAddress = null; + + for (DecConfigObjectStorage decConfigObjectStorage : resultList) { + switch (decConfigObjectStorage.getNmConfigObjectStorage()) { + case ACCESS_KEY_ID_SYS_PROP: + nomeSystemPropertyAccessKeyId = decConfigObjectStorage.getDsValoreConfigObjectStorage(); + break; + case BUCKET: + bucket = decConfigObjectStorage.getDsValoreConfigObjectStorage(); + break; + case SECRET_KEY_SYS_PROP: + nomeSystemPropertySecretKey = decConfigObjectStorage.getDsValoreConfigObjectStorage(); + break; + default: + throw ObjectStorageException.builder() + .message("Impossibile stabilire la tipologia del parametro per l'object storage").build(); + } + // identico per tutti perché definito nella tabella padre + storageAddress = decConfigObjectStorage.getDecBackend().getDlBackendUri(); + } + if (StringUtils.isBlank(bucket) || StringUtils.isBlank(nomeSystemPropertyAccessKeyId) + || StringUtils.isBlank(nomeSystemPropertySecretKey) || StringUtils.isBlank(storageAddress)) { + throw ObjectStorageException.builder() + .message("Impossibile stabilire la tipologia del parametro per l'object storage").build(); + } + + final String accessKeyId = System.getProperty(nomeSystemPropertyAccessKeyId); + final String secretKey = System.getProperty(nomeSystemPropertySecretKey); + final URI osURI = URI.create(storageAddress); + final String stagingBucket = bucket; + + return new ObjectStorageBackend() { + private static final long serialVersionUID = -7818781527374773374L; + + @Override + public String getBackendName() { + return nomeBackend; + } + + @Override + public URI getAddress() { + return osURI; + } + + @Override + public String getBucket() { + return stagingBucket; + } + + @Override + public String getAccessKeyId() { + return accessKeyId; + } + + @Override + public String getSecretKey() { + return secretKey; + } + }; + + } + + /** + * Genera la chiave del componente da salvare sull'object storage. + * + * @param idComponente + * identificativo del componente di cui salvare il contenuto + * + * @return chiave che verrà utilizzata sul bucket componenti + * + * @throws ObjectStorageException + * in caso di errore. + */ + public String generateKeyComponente(long idComponente) throws ObjectStorageException { + try { + + AroCompDoc compDoc = entityManager.find(AroCompDoc.class, idComponente); + + // la devo "pescare" l'UD passando dalla ARO_STRUT_DOC + AroUnitaDoc unitaDoc = compDoc.getAroStrutDoc().getAroDoc().getAroUnitaDoc(); + + String nmStrutNorm = unitaDoc.getOrgStrut().getCdStrutNormaliz(); + + String nmEnteNorm = unitaDoc.getOrgStrut().getOrgEnte().getCdEnteNormaliz(); + + String cdRegistroNorm = unitaDoc.getDecRegistroUnitaDoc().getCdRegistroNormaliz(); + int anno = unitaDoc.getAaKeyUnitaDoc().intValue(); + + return createKeyComponenti(nmEnteNorm, nmStrutNorm, cdRegistroNorm, anno, idComponente); + + } catch (Exception e) { + throw ObjectStorageException.builder().message("Impossibile generare la chiave del componente").cause(e) + .build(); + } + } + + private String getDefaultTenant() { + return configurationHelper.getValoreParamApplicByApplic(ParametroApplDB.TENANT_OBJECT_STORAGE); + + } + + private String createKeyComponenti(String nmEnteNorm, String nmStrutNorm, String cdRegistroNorm, int anno, + long idCompDoc) { + // Non serve a nulla + String nmTenant = getDefaultTenant(); + + return nmTenant + "/" + nmEnteNorm + "/" + nmStrutNorm + "/" + cdRegistroNorm + "/" + anno + "/" + idCompDoc; + } + + /* + * Full configuration = S3 URI + access_key + secret_key + bucket name + */ + private static void checkFullConfiguration(ObjectStorageBackend configuration) throws ObjectStorageException { + checkConfiguration(configuration, true); + } + + /* + * Minimal configuration = S3 URI + access_key + secret_key + */ + private static void checkMinimalConfiguration(ObjectStorageBackend configuration) throws ObjectStorageException { + checkConfiguration(configuration, false); + } + + private static void checkConfiguration(ObjectStorageBackend configuration, boolean checkIfBucketExists) + throws ObjectStorageException { + List errors = new ArrayList<>(); + if (configuration.getAddress() == null) { + errors.add("indirizzo object storage"); + } + if (StringUtils.isBlank(configuration.getAccessKeyId())) { + errors.add("access key Id"); + } + if (StringUtils.isBlank(configuration.getSecretKey())) { + errors.add("secret Key"); + } + if (checkIfBucketExists && StringUtils.isBlank(configuration.getBucket())) { + errors.add("nome bucket"); + } + if (!errors.isEmpty()) { + throw ObjectStorageException.builder() + .message("Parametri mancanti per il collegamento a object storage: {0}", String.join(",", errors)) + .build(); + } + + } + + /** + * Ottieni il collegamento tra sip dell'unita documentaria e il suo bucket/chiave su OS. + * + * @param idUnitaDoc + * id unita documentaria + * + * @return record contenete il link + * + * @throws ObjectStorageException + * in caso di errore + */ + public AroXmlObjectStorage getLinkSipUnitaDocOs(long idUnitaDoc) throws ObjectStorageException { + try { + return entityManager.find(AroXmlUnitaDocObjectStorage.class, idUnitaDoc); + + } catch (IllegalArgumentException e) { + throw ObjectStorageException.builder() + .message("Errore durante il recupero da AroXmlUnitaDocObjectStorage per id unita doc vers {0} ", + idUnitaDoc) + .cause(e).build(); + } + + } + + /** + * Ottieni il collegamento tra sip del documento e il suo bucket/chiave su OS. + * + * @param idDoc + * id documento + * + * @return record contenete il link + * + * @throws ObjectStorageException + * in caso di errore + */ + public AroXmlObjectStorage getLinkSipDocOs(long idDoc) throws ObjectStorageException { + try { + return entityManager.find(AroXmlDocObjectStorage.class, idDoc); + + } catch (IllegalArgumentException e) { + throw ObjectStorageException.builder() + .message("Errore durante il recupero da AroXmlUnitaDocObjectStorage per id doc vers {0} ", idDoc) + .cause(e).build(); + } + + } + + /** + * Ottieni l'oggetto dall'object storage selezionato sotto-forma di InputStream. + * + * @param configuration + * configurazione per accedere all'object storage + * @param bucket + * bucket + * @param objectKey + * chiave + * + * @return InputStream dell'oggetto ottenuto + * + * @throws ObjectStorageException + * in caso di errore + */ + public ResponseInputStream getObject(ObjectStorageBackend configuration, String bucket, + String objectKey) throws ObjectStorageException { + try { + S3Client s3SourceClient = s3Clients.getClient(configuration.getAddress(), configuration.getAccessKeyId(), + configuration.getSecretKey()); + + GetObjectRequest getObjectRequest = GetObjectRequest.builder().bucket(bucket).key(objectKey).build(); + return s3SourceClient.getObject(getObjectRequest); + + } catch (AwsServiceException | SdkClientException e) { + throw ObjectStorageException.builder() + .message("{0}: impossibile ottenere dal bucket {1} oggetto con chiave {2}", + configuration.getBackendName(), bucket, objectKey) + .cause(e).build(); + } + + } + + /** + * Effettua il tagging di un oggetto esistente su bucket con chiave e nell'object storage indicato (su base + * configurazioni) + * + * @param osResource + * risorsa salvata su object storage + * @param configuration + * configurazione per accedere all'object storage + * @param tags + * tag da impostare sull'oggetto + * + * @throws ObjectStorageException + * eccezzione generica (S3 error code / varie) + */ + public void taggingObject(ObjectStorageResource osResource, ObjectStorageBackend configuration, Set tags) + throws ObjectStorageException { + + checkMinimalConfiguration(configuration); + + final URI storageAddress = configuration.getAddress(); + final String accessKeyId = configuration.getAccessKeyId(); + final String secretKey = configuration.getSecretKey(); + + log.debug("Sto per taggare con {} nell'os {} la chiave {} sul bucket {}", tags, storageAddress, + osResource.getKey(), osResource.getBucket()); + + try { + S3Client s3Client = s3Clients.getClient(storageAddress, accessKeyId, secretKey); + PutObjectTaggingRequest objectRequest = PutObjectTaggingRequest.builder().bucket(osResource.getBucket()) + .key(osResource.getKey()).tagging(Tagging.builder().tagSet(tags).build()).build(); + final long start = System.currentTimeMillis(); + // s3 tagging + PutObjectTaggingResponse response = s3Client.putObjectTagging(objectRequest); + // + if (!response.sdkHttpResponse().isSuccessful()) { + throw ObjectStorageException.builder() + .message("{0}: errore tagging oggetto {1} sul bucket {2}, response {3}", + configuration.getBackendName(), osResource.getKey(), osResource.getBucket(), response) + .build(); + } + + final long end = System.currentTimeMillis() - start; + if (log.isDebugEnabled()) { + log.debug("Tagging oggetto {} sul bucket {} effettuato in {} ms", osResource.getKey(), + osResource.getBucket(), end); + } + } catch (Exception e) { + throw ObjectStorageException.builder() + .message("{0}: errore imprevisto tagging oggetto {1} sul bucket {2}", + configuration.getBackendName(), osResource.getKey(), osResource.getBucket()) + .cause(e).build(); + } + } +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/ISequenceGen.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/ISequenceGen.java index e073c15..cd827d7 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/ISequenceGen.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/ISequenceGen.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/MonotonicSequenceGen.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/MonotonicSequenceGen.java index 4fc406d..10f959f 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/MonotonicSequenceGen.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/MonotonicSequenceGen.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/NonMonotonicSequenceGen.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/NonMonotonicSequenceGen.java index 8be976f..bcc9e19 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/NonMonotonicSequenceGen.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/NonMonotonicSequenceGen.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/WriteCompBlbOracle.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/WriteCompBlbOracle.java index 9590042..7db216f 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/WriteCompBlbOracle.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/oracleBlb/WriteCompBlbOracle.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* Attenzione Il codice di questo modulo software è legato: @@ -16,27 +33,30 @@ */ package it.eng.parer.ws.versamento.ejb.oracleBlb; +import it.eng.parer.exception.ConnectionException; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.MessaggiWSBundle; import it.eng.parer.ws.utils.MessaggiWSFormat; import it.eng.parer.ws.versamento.dto.FileBinario; +import it.eng.spagoCore.util.JpaUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.ejb.LocalBean; +import javax.ejb.Stateless; +import javax.ejb.TransactionAttribute; +import javax.ejb.TransactionAttributeType; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; import java.io.BufferedInputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.time.ZonedDateTime; -import javax.ejb.LocalBean; -import javax.ejb.Stateless; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * @@ -62,13 +82,13 @@ public class WriteCompBlbOracle { + "VALUES (?, ?, ?, ?, ?, ?)"; // private static final String QRY_SVRS_CONTENUTO_FILE = "SELECT SVRS_CONTENUTO_FILE.NEXTVAL FROM DUAL"; - private static final String QRY_VRS_CONTENUTO_FILE = "INSERT INTO VRS_CONTENUTO_FILE " - + "(ID_CONTENUTO_FILE, ID_FILE_SESSIONE, BL_CONTENUTO_FILE_SESSIONE, ID_STRUT, MM_VERS) " - + "VALUES (?, ?, ?, ?, ?)"; + private static final String QRY_VRS_CONTENUTO_FILE = "INSERT INTO VRS_CONTENUTO_FILE_KO " + + "(ID_CONTENUTO_FILE_KO, ID_FILE_SESSIONE_KO, BL_CONTENUTO_FILE_SESSIONE, ID_STRUT, MM_VERS, AA_VERS) " + + "VALUES (?, ?, ?, ?, ?, ?)"; // - private final static String QRY_FIR_CONTENUTO_REPORT = "UPDATE FIR_REPORT " + "SET BL_CONTENUTO_REPORT = ? " + private static final String QRY_FIR_CONTENUTO_REPORT = "UPDATE FIR_REPORT " + "SET BL_CONTENUTO_REPORT = ? " + "WHERE ID_FIR_REPORT = ?"; - private final static int BUFFERSIZE = 10 * 1024 * 1024; + private static final int BUFFERSIZE = 10 * 1024 * 1024; public RispostaControlli salvaStreamSuBlobComp(WriteCompBlbOracle.DatiAccessori datiAccessori, FileBinario fb) { RispostaControlli rispostaControlli; @@ -77,10 +97,7 @@ public RispostaControlli salvaStreamSuBlobComp(WriteCompBlbOracle.DatiAccessori // ISequenceGen sequenceGen = new NonMonotonicSequenceGen(); // - InputStream inputStream = null; - BufferedInputStream bufFis = null; - ResultSet rs = null; - PreparedStatement pstmt = null; + String queryStrSeq = null; String queryStrInsrt = null; long sequenceVal = 0; @@ -94,33 +111,33 @@ public RispostaControlli salvaStreamSuBlobComp(WriteCompBlbOracle.DatiAccessori queryStrSeq = QRY_SARO_FILE_COMP; queryStrInsrt = QRY_ARO_FILE_COMP; break; - case VRS_CONTENUTO_FILE: + case VRS_CONTENUTO_FILE_KO: queryStrSeq = QRY_SVRS_CONTENUTO_FILE; queryStrInsrt = QRY_VRS_CONTENUTO_FILE; break; } + java.sql.Connection connection; try { - java.sql.Connection connection = entityManager.unwrap(java.sql.Connection.class); - // - try { // ottengo il nuovo valore per la sequence - log.debug(queryStrSeq); - pstmt = (PreparedStatement) connection.prepareStatement(queryStrSeq); - rs = (ResultSet) pstmt.executeQuery(); + connection = JpaUtils.provideConnectionFrom(entityManager); + } catch (SQLException e) { + throw new ConnectionException("Impossibile ottenere una connessione", e); + } + try { + log.debug(queryStrSeq); + try (PreparedStatement pstmt = connection.prepareStatement(queryStrSeq); + ResultSet rs = pstmt.executeQuery()) { // ottengo il nuovo valore per la sequence while (rs.next()) { sequenceVal = rs.getLong(1); } - } finally { - rs.close(); - pstmt.close(); } // - try { // scrivo il blob ed i dati accessori sulla tabella - inputStream = new FileInputStream(fb.getFileSuDisco()); - bufFis = new BufferedInputStream(inputStream, BUFFERSIZE); + try (PreparedStatement pstmt = connection.prepareStatement(queryStrInsrt); + InputStream inputStream = new FileInputStream(fb.getFileSuDisco()); + BufferedInputStream bufFis = new BufferedInputStream(inputStream, BUFFERSIZE)) { + // scrivo il blob e i dati accessori sulla tabella log.debug("Aperto il BufferedInputStream."); log.debug("Query: {}", queryStrInsrt); - pstmt = (PreparedStatement) connection.prepareStatement(queryStrInsrt); pstmt.setLong(1, sequenceGen.newSequenceNum(sequenceVal)); pstmt.setLong(2, datiAccessori.getIdPadre()); log.debug("Prima di setBlob"); @@ -132,17 +149,18 @@ public RispostaControlli salvaStreamSuBlobComp(WriteCompBlbOracle.DatiAccessori pstmt.setNull(4, java.sql.Types.INTEGER); } pstmt.setLong(5, datiAccessori.calcolaProgAnnoMeseVers()); - if (datiAccessori.getTabellaBlob() == WriteCompBlbOracle.TabellaBlob.ARO_CONTENUTO_COMP - || datiAccessori.getTabellaBlob() == WriteCompBlbOracle.TabellaBlob.ARO_FILE_COMP) { + switch (datiAccessori.getTabellaBlob()) { + case ARO_CONTENUTO_COMP: + case ARO_FILE_COMP: pstmt.setLong(6, datiAccessori.getAaKeyUnitaDoc()); + break; + case VRS_CONTENUTO_FILE_KO: + pstmt.setInt(6, datiAccessori.calcolaAnnoVers()); + break; } log.debug("Prima di executeUpdate"); int count = pstmt.executeUpdate(); log.debug("Record scritti/aggiornati: {}", count); - } finally { - IOUtils.closeQuietly(inputStream); - IOUtils.closeQuietly(bufFis); - pstmt.close(); } // rispostaControlli.setrBoolean(true); @@ -151,43 +169,56 @@ public RispostaControlli salvaStreamSuBlobComp(WriteCompBlbOracle.DatiAccessori rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "Eccezione WriteCompBlbOracle.salvaStreamSuBlobComp " + ex.getMessage())); log.error("Eccezione WriteCompBlbOracle.salvaStreamSuBlobComp ", ex); + } finally { + closeConnection(connection); } return rispostaControlli; } - public RispostaControlli aggiornaStreamSuBlobComp(WriteCompBlbOracle.DatiAccessori datiAccessori, FileBinario fb) { + private void closeConnection(Connection connection) { + if (connection != null) { + try { + connection.close(); + } catch (SQLException ex) { + log.error("Impossibile chiudere la connessione: ", ex); + } + } + } + + public RispostaControlli aggiornaStreamSuBlobComp(FileBinario fb, long idPadre) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); rispostaControlli.setrBoolean(false); - // - String queryStrUpd = null; - // - switch (datiAccessori.getTabellaBlob()) { - case FIR_REPORT: - queryStrUpd = QRY_FIR_CONTENUTO_REPORT; - break; - } + String queryStrUpd = QRY_FIR_CONTENUTO_REPORT; // get connection - java.sql.Connection connection = entityManager.unwrap(java.sql.Connection.class); - - try (BufferedInputStream bufFis = new BufferedInputStream(new FileInputStream(fb.getFileSuDisco()), BUFFERSIZE); - PreparedStatement pstmt = connection.prepareStatement(queryStrUpd);) { - // - log.debug("Aperto il BufferedInputStream."); - log.debug("Query: {}", queryStrUpd); - pstmt.setBlob(1, bufFis, fb.getFileSuDisco().length()); - pstmt.setLong(2, datiAccessori.getIdPadre()); - log.debug("Prima di executeUpdate"); - int count = pstmt.executeUpdate(); - log.debug("Record scritti/aggiornati: {}", count); - // - rispostaControlli.setrBoolean(true); - } catch (IOException | SQLException ex) { - rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "Eccezione WriteCompBlbOracle.aggiornaStreamSuBlobComp " + ex.getMessage())); - log.error("Eccezione WriteCompBlbOracle.aggiornaStreamSuBlobComp ", ex); + java.sql.Connection connection = null; + try { + connection = JpaUtils.provideConnectionFrom(entityManager); + } catch (SQLException e) { + throw new ConnectionException("Impossibile recuperare la connessione", e); + } + if (connection != null) { + try (BufferedInputStream bufFis = new BufferedInputStream(new FileInputStream(fb.getFileSuDisco()), + BUFFERSIZE); PreparedStatement pstmt = connection.prepareStatement(queryStrUpd)) { + // + log.debug("Aperto il BufferedInputStream."); + log.debug("Query: {}", queryStrUpd); + pstmt.setBlob(1, bufFis, fb.getFileSuDisco().length()); + pstmt.setLong(2, idPadre); + log.debug("Prima di executeUpdate"); + int count = pstmt.executeUpdate(); + log.debug("Record scritti/aggiornati: {}", count); + // + rispostaControlli.setrBoolean(true); + } catch (IOException | SQLException ex) { + rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); + rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "Eccezione WriteCompBlbOracle.aggiornaStreamSuBlobComp " + ex.getMessage())); + log.error("Eccezione WriteCompBlbOracle.aggiornaStreamSuBlobComp ", ex); + } finally { + closeConnection(connection); + } } return rispostaControlli; @@ -195,7 +226,7 @@ public RispostaControlli aggiornaStreamSuBlobComp(WriteCompBlbOracle.DatiAccesso public enum TabellaBlob { - ARO_CONTENUTO_COMP, ARO_FILE_COMP, VRS_CONTENUTO_FILE, FIR_REPORT + ARO_CONTENUTO_COMP, ARO_FILE_COMP, VRS_CONTENUTO_FILE_KO } public class DatiAccessori { @@ -250,5 +281,9 @@ public long calcolaProgAnnoMeseVers() { return MessaggiWSFormat.formattaKeyPartAnnoMeseVers(dtVersamento); } + public int calcolaAnnoVers() { + return MessaggiWSFormat.formattaKeyPartAnnoVers(dtVersamento); + } + } } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/DocumentoVersPrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/prs/DocumentoVersPrsr.java similarity index 91% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/DocumentoVersPrsr.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/prs/DocumentoVersPrsr.java index 8da7fc4..9990a20 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/DocumentoVersPrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/prs/DocumentoVersPrsr.java @@ -1,7 +1,33 @@ -package it.eng.parer.ws.versamento.utils; +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb.prs; + +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; + +import java.math.BigInteger; +import java.util.HashSet; +import java.util.Set; + +import javax.xml.bind.JAXBElement; import it.eng.parer.entity.DecTipoRapprComp; -import it.eng.parer.entity.constraint.AroCompUrnCalc.TiUrn; import it.eng.parer.ws.dto.CSChiave; import it.eng.parer.ws.dto.IRispostaWS; import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; @@ -23,75 +49,38 @@ import it.eng.parer.ws.versamento.dto.DocumentoVers; import it.eng.parer.ws.versamento.dto.RispostaControlliAttSpec; import it.eng.parer.ws.versamento.dto.VoceDiErrore; +import it.eng.parer.ws.versamento.ejb.GestioneDatiSpec; import it.eng.parer.ws.versamentoTpi.utils.FileServUtils; import it.eng.parer.ws.xml.versReq.DatiSpecificiType; import it.eng.parer.ws.xml.versResp.ECComponenteType; -import it.eng.parer.ws.xml.versResp.ECConfigurazioneType; import it.eng.parer.ws.xml.versResp.ECDocumentoType; -import it.eng.parer.ws.xml.versResp.ECSottoComponenteType; import it.eng.parer.ws.xml.versResp.ECEsitoPosNegType; import it.eng.parer.ws.xml.versResp.ECEsitoPosNegWarType; -import java.math.BigInteger; -import java.util.HashSet; -import java.util.Set; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.xml.bind.JAXBElement; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import it.eng.parer.ws.xml.versResp.ECSottoComponenteType; /** * * @author Fioravanti_F */ +@Stateless(mappedName = "DocumentoVersPrsr") +@LocalBean public class DocumentoVersPrsr { - private static final Logger log = LoggerFactory.getLogger(DocumentoVersPrsr.class); - private AbsVersamentoExt versamento; // nel costruttore - private IRispostaWS rispostaWs; // nel costruttore - private RispostaControlli rispostaControlli; // interno allocare nel costruttore // classe di supporto per la verifica e l'estrazione dei dati specifici - GestioneDatiSpec gestioneDatiSpec = null; // allocata nel costruttore + @EJB + GestioneDatiSpec gestioneDatiSpec; // stateless ejb per i controlli sul db - ControlliSemantici controlliSemantici = null; // allocare nel costruttore - // - Set ordiniDiPresentazioneUnici; - - public DocumentoVersPrsr(AbsVersamentoExt absVersamento, IRispostaWS iRisposta, - ECConfigurazioneType configurazione) { - versamento = absVersamento; - rispostaWs = iRisposta; - - // istanzia la risposta controlli - rispostaControlli = new RispostaControlli(); - - // recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - try { - controlliSemantici = (ControlliSemantici) new InitialContext().lookup("java:module/ControlliSemantici"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB dei controlli semantici " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli semantici ", ex); - } - - if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - // alloca la classe di verifica ed estrazione dei dati specifici e dei dati specifici di migrazione - // NB: questa allocazione può fallire. Al termine devo verificare lo stato di RispostaWS e gestire il - // problema - gestioneDatiSpec = new GestioneDatiSpec(versamento.getStrutturaComponenti().getSistemaDiMigrazione(), - versamento.getStrutturaComponenti().getIdStruttura(), rispostaWs); - if (rispostaWs.getSeverity() == SeverityEnum.ERROR) { - rispostaWs.setEsitoWsError(rispostaWs.getErrorCode(), rispostaWs.getErrorMessage()); - } - } - - } + @EJB + ControlliSemantici controlliSemantici; // §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ // INIZIO METODI DI VERIFICA §§§§§§§§§§§§§§§§§§§§§§§§§§§§§ // §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ - public void parseDocumentoGen(DocumentoVers documento, ECDocumentoType esitoDoc) { + public void parseDocumentoGen(DocumentoVers documento, ECDocumentoType esitoDoc, AbsVersamentoExt versamento, + IRispostaWS rispostaWs) { + // + RispostaControlli rispostaControlli = new RispostaControlli(); + AvanzamentoWs myAvanzamentoWs = rispostaWs.getAvanzamento(); myAvanzamentoWs.setFase("Verifica semantica documento") @@ -108,22 +97,22 @@ public void parseDocumentoGen(DocumentoVers documento, ECDocumentoType esitoDoc) // verifica il tipo documento if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - this.verificaTipoDoc(documento, esitoDoc); + this.verificaTipoDoc(documento, esitoDoc, versamento, rispostaWs, rispostaControlli); } // verifico la presenza dei DATI FISCALI - non devono essere presenti in alcun caso. if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - this.parseDatiFisc(documento, esitoDoc); + this.parseDatiFisc(documento, esitoDoc, rispostaWs, rispostaControlli); } // verifico la corrispondenza dei DATI SPECIFICI del Documento if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - this.parseDatiSpecDoc(documento, esitoDoc); + this.parseDatiSpecDoc(documento, esitoDoc, versamento, rispostaWs); } // verifico tipo struttura if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - this.verificaTipoStruttura(documento, esitoDoc); + this.verificaTipoStruttura(documento, esitoDoc, versamento, rispostaWs, rispostaControlli); } // creo il ramo dell'xml di risposta relativo ai controlli componenti @@ -132,18 +121,19 @@ public void parseDocumentoGen(DocumentoVers documento, ECDocumentoType esitoDoc) } if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - this.verificaComponenti(documento, esitoDoc); + this.verificaComponenti(documento, esitoDoc, versamento, rispostaWs, rispostaControlli); } } - private void verificaTipoDoc(DocumentoVers documento, ECDocumentoType esitoDoc) { + private void verificaTipoDoc(DocumentoVers documento, ECDocumentoType esitoDoc, AbsVersamentoExt versamento, + IRispostaWS rispostaWs, RispostaControlli rispostaControlli) { rispostaControlli.reset(); rispostaControlli = controlliSemantici.checkTipoDocumento(documento.getRifDocumento().getTipoDocumento(), versamento.getStrutturaComponenti().getIdStruttura(), (documento.getCategoriaDoc() == Costanti.CategoriaDocumento.Principale), documento.getRifDocumentoResp().getChiaveDoc()); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); esitoDoc.getEsitoDocumento().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); esitoDoc.getEsitoDocumento().setVerificaTipoDocumento(ECEsitoPosNegType.NEGATIVO); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); @@ -155,10 +145,11 @@ private void verificaTipoDoc(DocumentoVers documento, ECDocumentoType esitoDoc) } } - private void parseDatiFisc(DocumentoVers documento, ECDocumentoType esitoDoc) { + private void parseDatiFisc(DocumentoVers documento, ECDocumentoType esitoDoc, IRispostaWS rispostaWs, + RispostaControlli rispostaControlli) { if (documento.getRifDocumento().getDatiFiscali() != null) { // esiste il tag : errore, perchè non dovrebbe esserci! - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); esitoDoc.getEsitoDocumento().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); esitoDoc.getEsitoDocumento().setCorrispondenzaDatiFiscali(ECEsitoPosNegType.NEGATIVO); // Documento {0}: L''utilizzo del Tag <DatiFiscali> è DEPRECATO dal 17 Ottobre 2013 @@ -170,13 +161,14 @@ private void parseDatiFisc(DocumentoVers documento, ECDocumentoType esitoDoc) { } } - private void verificaTipoStruttura(DocumentoVers documento, ECDocumentoType esitoDoc) { + private void verificaTipoStruttura(DocumentoVers documento, ECDocumentoType esitoDoc, AbsVersamentoExt versamento, + IRispostaWS rispostaWs, RispostaControlli rispostaControlli) { rispostaControlli.reset(); rispostaControlli = controlliSemantici.checkTipoStruttura( documento.getRifDocumento().getStrutturaOriginale().getTipoStruttura(), versamento.getStrutturaComponenti().getIdStruttura(), documento.getRifDocumentoResp().getChiaveDoc()); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); esitoDoc.getEsitoDocumento().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); esitoDoc.getEsitoDocumento().setVerificaTipoStruttura(ECEsitoPosNegType.NEGATIVO); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); @@ -189,11 +181,12 @@ private void verificaTipoStruttura(DocumentoVers documento, ECDocumentoType esit } } - private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDoc) { + private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDoc, AbsVersamentoExt versamento, + IRispostaWS rispostaWs, RispostaControlli rispostaControlli) { ControlliSemantici.TipologieComponente tipologiaComponente = ControlliSemantici.TipologieComponente.COMPONENTE; FileServUtils fileServUtils = new FileServUtils(); - ordiniDiPresentazioneUnici = new HashSet<>(); + Set ordiniDiPresentazioneUnici = new HashSet<>(); // loop sui componenti (e sottocomponenti) for (ComponenteVers valueCompVers : documento.getFileAttesi()) { @@ -209,11 +202,6 @@ private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDo // crea la chiave del componente if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - /* - * valueCompVers.setChiaveComp( MessaggiWSFormat.formattaChiaveComponente( - * documento.getRifDocumentoResp().getChiaveDoc(), 1, - * valueCompVers.getMyComponente().getOrdinePresentazione())); - */ valueCompVers.setChiaveComp( MessaggiWSFormat.formattaChiaveComponente(documento.getRifDocumentoResp().getChiaveDoc(), valueCompVers.getMyComponente().getOrdinePresentazione(), @@ -253,7 +241,7 @@ private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDo versamento.getStrutturaComponenti().getSubPathUnitaDocArk(), tmpNomeFile); if (!fileServUtils.controllaPath(tmpFilePath)) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); componenteResp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); // il componente {0} non può essere archiviato su filesystem perchè il suo pathname supera i 255 // caratteri @@ -266,7 +254,7 @@ private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDo // salvo il controlloUnivocitaOrdinePresentazione if (valueCompVers.getMyComponente().getOrdinePresentazione() <= 0) { // sollevo l'errore di connessione UnivocitaOrdinePresentazione - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); componenteResp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); esitoDoc.getEsitoDocumento().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); esitoDoc.getEsitoDocumento().setUnivocitaOrdinePresentazione(ECEsitoPosNegType.NEGATIVO); @@ -289,7 +277,7 @@ private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDo BigInteger.valueOf(valueCompVers.getMyComponente().getOrdinePresentazione())); } else { // sollevo l'errore di connessione UnivocitaOrdinePresentazione - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); componenteResp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); esitoDoc.getEsitoDocumento().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); esitoDoc.getEsitoDocumento().setUnivocitaOrdinePresentazione(ECEsitoPosNegType.NEGATIVO); @@ -308,8 +296,8 @@ private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDo rispostaControlli = controlliSemantici.checkTipoComponente( valueCompVers.getMyComponente().getTipoComponente(), documento.getIdTipoStrutturaDB(), tipologiaComponente, valueCompVers.getChiaveComp()); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); componenteResp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); componenteResp.getEsitoComponente().setVerificaTipoComponente(ECEsitoPosNegType.NEGATIVO); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); @@ -394,8 +382,8 @@ private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDo rispostaControlli = controlliSemantici.checkTipoRappComponente( valueCompVers.getMyComponente().getTipoRappresentazioneComponente(), versamento.getStrutturaComponenti().getIdStruttura(), valueCompVers.getChiaveComp()); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); componenteResp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); componenteResp.getEsitoComponente().setVerificaTipoRappresentazione(ECEsitoPosNegType.NEGATIVO); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); @@ -423,7 +411,7 @@ private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDo .setVerificaTipoRappresentazione(ECEsitoPosNegType.POSITIVO); } else { // il tipo output deve essere uguale a DIP - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); componenteResp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); componenteResp.getEsitoComponente() .setVerificaTipoRappresentazione(ECEsitoPosNegType.NEGATIVO); @@ -437,7 +425,7 @@ private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDo if ((rispostaWs.getSeverity() != SeverityEnum.ERROR && trovatoTipoRappComp)) { if (versamento.getStrutturaComponenti() .getTipoSalvataggioFile() != CostantiDB.TipoSalvataggioFile.BLOB) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); componenteResp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); componenteResp.getEsitoComponente().setVerificaTipoRappresentazione(ECEsitoPosNegType.NEGATIVO); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.COMP_003_004, valueCompVers.getChiaveComp()); @@ -447,7 +435,7 @@ private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDo // se presente tipo Rappresentazione Componente, verifico che il tipo supporto sia FILE if ((rispostaWs.getSeverity() != SeverityEnum.ERROR && trovatoTipoRappComp)) { if (valueCompVers.getTipoSupporto() != ComponenteVers.TipiSupporto.FILE) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); componenteResp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); componenteResp.getEsitoComponente().setVerificaTipoRappresentazione(ECEsitoPosNegType.NEGATIVO); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.COMP_003_002, valueCompVers.getChiaveComp()); @@ -457,7 +445,7 @@ private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDo // se presente tipo Rappresentazione Componente, verifico che il tipo uso componente sia CONTENUTO if ((rispostaWs.getSeverity() != SeverityEnum.ERROR && trovatoTipoRappComp)) { if (!valueCompVers.getTipoUso().equals(CostantiDB.TipoUsoComponente.CONTENUTO)) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); componenteResp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); componenteResp.getEsitoComponente().setVerificaTipoRappresentazione(ECEsitoPosNegType.NEGATIVO); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.COMP_003_005, valueCompVers.getChiaveComp()); @@ -513,12 +501,12 @@ private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDo // verifico che l'unità doc riferita sia composta da un solo componente e che questo sia di tipo // CONVERTITORE // che sia stata salvata su BLOB e che abbia tipo supporto uguale a FILE - long tmpIdUnitaDoc = rispostaControlli.getrLong(); - rispostaControlli = controlliSemantici.checkRiferimentoUD(chiave, tmpIdUnitaDoc, + rispostaControlli.getrLong(); + rispostaControlli = controlliSemantici.checkRiferimentoUD(chiave, versamento.getStrutturaComponenti().getIdStruttura(), ControlliSemantici.TipologieComponente.COMPONENTE, valueCompVers.getChiaveComp()); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); componenteResp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); componenteResp.getEsitoComponente() .setVerificaRiferimentoUnitaDocumentaria(ECEsitoPosNegType.NEGATIVO); @@ -581,7 +569,7 @@ private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDo // verifico che il formato del file versato coincida con quello atteso dal convertitore if (trovatoTipoRappComp && valueCompVers.getIdFormatoFileVers() != valueCompVers.getIdFormatoFileDocCont()) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); componenteResp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); componenteResp.getEsitoComponente() .setVerificaAmmissibilitaFormato(ECEsitoPosNegType.NEGATIVO); @@ -656,21 +644,23 @@ private void verificaComponenti(DocumentoVers documento, ECDocumentoType esitoDo // verifico gli eventuali dati specifici e di migrazione if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - this.parseDatiSpecComp(valueCompVers, componenteResp); + this.parseDatiSpecComp(valueCompVers, componenteResp, versamento, rispostaWs); } /* * verifico i sottocomponenti del componente */ if ((rispostaWs.getSeverity() != SeverityEnum.ERROR)) { - this.verificaSottoComponentiComp(valueCompVers, documento, esitoDoc); + this.verificaSottoComponentiComp(valueCompVers, documento, esitoDoc, versamento, rispostaWs, + rispostaControlli, ordiniDiPresentazioneUnici); } } } // fine loop sui componenti } private void verificaSottoComponentiComp(ComponenteVers componentePadre, DocumentoVers documento, - ECDocumentoType esitoDoc) { + ECDocumentoType esitoDoc, AbsVersamentoExt versamento, IRispostaWS rispostaWs, + RispostaControlli rispostaControlli, Set ordiniDiPresentazioneUnici) { ControlliSemantici.TipologieComponente tipologiaComponente = ControlliSemantici.TipologieComponente.SOTTOCOMPONENTE; ECComponenteType componenteResp = componentePadre.getRifComponenteResp(); FileServUtils fileServUtils = new FileServUtils(); @@ -704,11 +694,6 @@ private void verificaSottoComponentiComp(ComponenteVers componentePadre, Documen // crea la chiave del componente if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - /* - * valueCompVers.setChiaveComp( MessaggiWSFormat.formattaChiaveComponente( - * documento.getRifDocumentoResp().getChiaveDoc(), 1, - * valueCompVers.getMySottoComponente().getOrdinePresentazione())); - */ valueCompVers.setChiaveComp(MessaggiWSFormat.formattaChiaveComponente( componentePadre.getChiaveComp(), @@ -747,7 +732,7 @@ private void verificaSottoComponentiComp(ComponenteVers componentePadre, Documen versamento.getStrutturaComponenti().getSubPathUnitaDocArk(), tmpNomeFile); if (!fileServUtils.controllaPath(tmpFilePath)) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); sottoComponenteResp.getEsitoSottoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); // il sottocomponente {0} non può essere archiviato su filesystem perchè il suo pathname // supera i 255 caratteri @@ -761,7 +746,7 @@ private void verificaSottoComponentiComp(ComponenteVers componentePadre, Documen // salvo il controlloUnivocitaOrdinePresentazione if (valueCompVers.getMySottoComponente().getOrdinePresentazione() <= 0) { // sollevo l'errore di connessione UnivocitaOrdinePresentazione - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); sottoComponenteResp.getEsitoSottoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); esitoDoc.getEsitoDocumento().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); esitoDoc.getEsitoDocumento().setUnivocitaOrdinePresentazione(ECEsitoPosNegType.NEGATIVO); @@ -784,7 +769,7 @@ private void verificaSottoComponentiComp(ComponenteVers componentePadre, Documen BigInteger.valueOf(valueCompVers.getMySottoComponente().getOrdinePresentazione())); } else { // sollevo l'errore di connessione UnivocitaOrdinePresentazione - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); sottoComponenteResp.getEsitoSottoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); esitoDoc.getEsitoDocumento().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); esitoDoc.getEsitoDocumento().setUnivocitaOrdinePresentazione(ECEsitoPosNegType.NEGATIVO); @@ -804,7 +789,7 @@ private void verificaSottoComponentiComp(ComponenteVers componentePadre, Documen valueCompVers.getMySottoComponente().getTipoComponente(), documento.getIdTipoStrutturaDB(), tipologiaComponente, valueCompVers.getChiaveComp()); if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); sottoComponenteResp.getEsitoSottoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); sottoComponenteResp.getEsitoSottoComponente() .setVerificaTipoComponente(ECEsitoPosNegType.NEGATIVO); @@ -987,12 +972,12 @@ private void verificaSottoComponentiComp(ComponenteVers componentePadre, Documen // tipo CONVERTITORE, // che sia stata salvata su BLOB e che abbia tipo supporto uguale a FILE long tmpIdUnitaDoc = rispostaControlli.getrLong(); - rispostaControlli = controlliSemantici.checkRiferimentoUD(chiave, tmpIdUnitaDoc, + rispostaControlli = controlliSemantici.checkRiferimentoUD(chiave, versamento.getStrutturaComponenti().getIdStruttura(), ControlliSemantici.TipologieComponente.SOTTOCOMPONENTE, valueCompVers.getChiaveComp()); if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); sottoComponenteResp.getEsitoSottoComponente() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); sottoComponenteResp.getEsitoSottoComponente() @@ -1004,7 +989,7 @@ private void verificaSottoComponentiComp(ComponenteVers componentePadre, Documen * versato coincida */ if (trovatoConvRapp && verificaFormatoConvertitore && rispostaControlli.getrLong() != componentePadre.getIdFormatoFileDocConv()) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); sottoComponenteResp.getEsitoSottoComponente() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); sottoComponenteResp.getEsitoSottoComponente() @@ -1075,7 +1060,7 @@ private void verificaSottoComponentiComp(ComponenteVers componentePadre, Documen */ if (trovatoConvRapp && verificaFormatoConvertitore && valueCompVers .getIdFormatoFileVers() != componentePadre.getIdFormatoFileDocConv()) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); sottoComponenteResp.getEsitoSottoComponente() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); sottoComponenteResp.getEsitoSottoComponente() @@ -1104,7 +1089,7 @@ private void verificaSottoComponentiComp(ComponenteVers componentePadre, Documen // verifico gli eventuali dati specifici e di migrazione if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - this.parseDatiSpecSottoComp(valueCompVers, sottoComponenteResp); + this.parseDatiSpecSottoComp(valueCompVers, sottoComponenteResp, versamento, rispostaWs); } } @@ -1116,7 +1101,7 @@ private void verificaSottoComponentiComp(ComponenteVers componentePadre, Documen * tipo uso CONVERTITORE o RAPPRESENTAZIONE */ if (rispostaWs.getSeverity() != SeverityEnum.ERROR && (!trovatoTipoRappComp) && contaConvRapp > 0) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); componenteResp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); componenteResp.getEsitoComponente().setVerificaSottoComponenteRappresentazione("NEGATIVO"); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.COMP_004_001, componentePadre.getChiaveComp()); @@ -1127,23 +1112,26 @@ private void verificaSottoComponentiComp(ComponenteVers componentePadre, Documen */ if (rispostaWs.getSeverity() != SeverityEnum.ERROR && trovatoTipoRappComp && verificaFormatoConvertitore && contaConvRapp != 1) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); componenteResp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); componenteResp.getEsitoComponente().setVerificaSottoComponenteRappresentazione("NEGATIVO"); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.COMP_004_002, componentePadre.getChiaveComp()); } } - private void parseDatiSpecDoc(DocumentoVers documento, ECDocumentoType esitoDoc) { + private void parseDatiSpecDoc(DocumentoVers documento, ECDocumentoType esitoDoc, AbsVersamentoExt versamento, + IRispostaWS rispostaWs) { JAXBElement tmpDatiSpecifici; JAXBElement tmpDatiSpecificiMigrazione; RispostaControlliAttSpec tmpControlliAttSpec = null; tmpDatiSpecifici = documento.getRifDocumento().getDatiSpecifici(); - gestioneDatiSpec.parseDatiSpec(TipiEntitaSacer.DOC, tmpDatiSpecifici, documento.getIdTipoDocumentoDB(), - esitoDoc.getChiaveDoc(), documento.getRifDocumento().getTipoDocumento()); + tmpControlliAttSpec = gestioneDatiSpec.parseDatiSpec(TipiEntitaSacer.DOC, tmpDatiSpecifici, + documento.getIdTipoDocumentoDB(), esitoDoc.getChiaveDoc(), + documento.getRifDocumento().getTipoDocumento(), + versamento.getStrutturaComponenti().getSistemaDiMigrazione(), + versamento.getStrutturaComponenti().getIdStruttura(), rispostaWs); if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - tmpControlliAttSpec = gestioneDatiSpec.getRispostaControlliAttSpec(); documento.setDatiSpecifici(tmpControlliAttSpec.getDatiSpecifici()); documento.setIdRecXsdDatiSpec(tmpControlliAttSpec.getIdRecXsdDatiSpec()); esitoDoc.getEsitoDocumento().setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); @@ -1158,11 +1146,11 @@ private void parseDatiSpecDoc(DocumentoVers documento, ECDocumentoType esitoDoc) && rispostaWs.getSeverity() != SeverityEnum.ERROR && versamento.getStrutturaComponenti().getSistemaDiMigrazione() != null) { tmpDatiSpecificiMigrazione = documento.getRifDocumento().getDatiSpecificiMigrazione(); - gestioneDatiSpec.parseDatiSpecMig(TipiEntitaSacer.DOC, tmpDatiSpecificiMigrazione, - documento.getIdTipoDocumentoDB(), esitoDoc.getChiaveDoc(), - documento.getRifDocumento().getTipoDocumento()); + tmpControlliAttSpec = gestioneDatiSpec.parseDatiSpecMig(TipiEntitaSacer.DOC, tmpDatiSpecificiMigrazione, + esitoDoc.getChiaveDoc(), documento.getRifDocumento().getTipoDocumento(), + versamento.getStrutturaComponenti().getSistemaDiMigrazione(), + versamento.getStrutturaComponenti().getIdStruttura(), rispostaWs); if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - tmpControlliAttSpec = gestioneDatiSpec.getRispostaControlliAttSpec(); documento.setDatiSpecificiMigrazione(tmpControlliAttSpec.getDatiSpecifici()); documento.setIdRecXsdDatiSpecMigrazione(tmpControlliAttSpec.getIdRecXsdDatiSpec()); esitoDoc.getEsitoDocumento().setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); @@ -1227,17 +1215,20 @@ private boolean impostaAlgoHash(ComponenteVers componente, int lunghezza) { return trovato; } - private void parseDatiSpecComp(ComponenteVers componente, ECComponenteType esitoComp) { + private void parseDatiSpecComp(ComponenteVers componente, ECComponenteType esitoComp, AbsVersamentoExt versamento, + IRispostaWS rispostaWs) { JAXBElement tmpDatiSpecifici; JAXBElement tmpDatiSpecificiMigrazione; RispostaControlliAttSpec tmpControlliAttSpec = null; if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_DATISPEC_EXT)) { tmpDatiSpecifici = componente.getMyComponente().getDatiSpecifici(); - gestioneDatiSpec.parseDatiSpec(TipiEntitaSacer.COMP, tmpDatiSpecifici, componente.getIdTipoComponente(), - componente.getChiaveComp(), componente.getMyComponente().getTipoComponente()); + tmpControlliAttSpec = gestioneDatiSpec.parseDatiSpec(TipiEntitaSacer.COMP, tmpDatiSpecifici, + componente.getIdTipoComponente(), componente.getChiaveComp(), + componente.getMyComponente().getTipoComponente(), + versamento.getStrutturaComponenti().getSistemaDiMigrazione(), + versamento.getStrutturaComponenti().getIdStruttura(), rispostaWs); if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - tmpControlliAttSpec = gestioneDatiSpec.getRispostaControlliAttSpec(); componente.setDatiSpecifici(tmpControlliAttSpec.getDatiSpecifici()); componente.setIdRecXsdDatiSpec(tmpControlliAttSpec.getIdRecXsdDatiSpec()); esitoComp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); @@ -1252,11 +1243,12 @@ private void parseDatiSpecComp(ComponenteVers componente, ECComponenteType esito && rispostaWs.getSeverity() != SeverityEnum.ERROR && versamento.getStrutturaComponenti().getSistemaDiMigrazione() != null) { tmpDatiSpecificiMigrazione = componente.getMyComponente().getDatiSpecificiMigrazione(); - gestioneDatiSpec.parseDatiSpecMig(TipiEntitaSacer.COMP, tmpDatiSpecificiMigrazione, - componente.getIdTipoComponente(), componente.getChiaveComp(), - componente.getMyComponente().getTipoComponente()); + tmpControlliAttSpec = gestioneDatiSpec.parseDatiSpecMig(TipiEntitaSacer.COMP, + tmpDatiSpecificiMigrazione, componente.getChiaveComp(), + componente.getMyComponente().getTipoComponente(), + versamento.getStrutturaComponenti().getSistemaDiMigrazione(), + versamento.getStrutturaComponenti().getIdStruttura(), rispostaWs); if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - tmpControlliAttSpec = gestioneDatiSpec.getRispostaControlliAttSpec(); componente.setDatiSpecificiMigrazione(tmpControlliAttSpec.getDatiSpecifici()); componente.setIdRecXsdDatiSpecMigrazione(tmpControlliAttSpec.getIdRecXsdDatiSpec()); esitoComp.getEsitoComponente().setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); @@ -1270,17 +1262,20 @@ private void parseDatiSpecComp(ComponenteVers componente, ECComponenteType esito } } - private void parseDatiSpecSottoComp(ComponenteVers componente, ECSottoComponenteType esitoComp) { + private void parseDatiSpecSottoComp(ComponenteVers componente, ECSottoComponenteType esitoComp, + AbsVersamentoExt versamento, IRispostaWS rispostaWs) { JAXBElement tmpDatiSpecifici; JAXBElement tmpDatiSpecificiMigrazione; RispostaControlliAttSpec tmpControlliAttSpec = null; if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_DATISPEC_EXT)) { tmpDatiSpecifici = componente.getMySottoComponente().getDatiSpecifici(); - gestioneDatiSpec.parseDatiSpec(TipiEntitaSacer.SUB_COMP, tmpDatiSpecifici, componente.getIdTipoComponente(), - componente.getChiaveComp(), componente.getMySottoComponente().getTipoComponente()); + tmpControlliAttSpec = gestioneDatiSpec.parseDatiSpec(TipiEntitaSacer.SUB_COMP, tmpDatiSpecifici, + componente.getIdTipoComponente(), componente.getChiaveComp(), + componente.getMySottoComponente().getTipoComponente(), + versamento.getStrutturaComponenti().getSistemaDiMigrazione(), + versamento.getStrutturaComponenti().getIdStruttura(), rispostaWs); if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - tmpControlliAttSpec = gestioneDatiSpec.getRispostaControlliAttSpec(); componente.setDatiSpecifici(tmpControlliAttSpec.getDatiSpecifici()); componente.setIdRecXsdDatiSpec(tmpControlliAttSpec.getIdRecXsdDatiSpec()); esitoComp.getEsitoSottoComponente().setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); @@ -1295,11 +1290,12 @@ private void parseDatiSpecSottoComp(ComponenteVers componente, ECSottoComponente && rispostaWs.getSeverity() != SeverityEnum.ERROR && versamento.getStrutturaComponenti().getSistemaDiMigrazione() != null) { tmpDatiSpecificiMigrazione = componente.getMySottoComponente().getDatiSpecificiMigrazione(); - gestioneDatiSpec.parseDatiSpecMig(TipiEntitaSacer.SUB_COMP, tmpDatiSpecificiMigrazione, - componente.getIdTipoComponente(), componente.getChiaveComp(), - componente.getMySottoComponente().getTipoComponente()); + tmpControlliAttSpec = gestioneDatiSpec.parseDatiSpecMig(TipiEntitaSacer.SUB_COMP, + tmpDatiSpecificiMigrazione, componente.getChiaveComp(), + componente.getMySottoComponente().getTipoComponente(), + versamento.getStrutturaComponenti().getSistemaDiMigrazione(), + versamento.getStrutturaComponenti().getIdStruttura(), rispostaWs); if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - tmpControlliAttSpec = gestioneDatiSpec.getRispostaControlliAttSpec(); componente.setDatiSpecificiMigrazione(tmpControlliAttSpec.getDatiSpecifici()); componente.setIdRecXsdDatiSpecMigrazione(tmpControlliAttSpec.getIdRecXsdDatiSpec()); esitoComp.getEsitoSottoComponente().setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); @@ -1313,7 +1309,7 @@ private void parseDatiSpecSottoComp(ComponenteVers componente, ECSottoComponente } } - private void setRispostaWsError() { + private void setRispostaWsError(IRispostaWS rispostaWs, RispostaControlli rispostaControlli) { rispostaWs.setSeverity(SeverityEnum.ERROR); rispostaWs.setErrorCode(rispostaControlli.getCodErr()); rispostaWs.setErrorMessage(rispostaControlli.getDsErr()); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/VersamentoExtAggAllPrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/prs/VersamentoExtAggAllPrsr.java similarity index 78% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/VersamentoExtAggAllPrsr.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/prs/VersamentoExtAggAllPrsr.java index ade68a2..51d7114 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/VersamentoExtAggAllPrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/prs/VersamentoExtAggAllPrsr.java @@ -1,17 +1,40 @@ -package it.eng.parer.ws.versamento.utils; +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb.prs; + +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; + +import static it.eng.parer.util.DateUtilsConverter.convert; import java.io.StringReader; import java.math.BigDecimal; import java.util.HashMap; -import javax.naming.InitialContext; -import javax.naming.NamingException; import javax.xml.bind.UnmarshalException; import javax.xml.bind.Unmarshaller; import javax.xml.bind.ValidationEvent; import javax.xml.bind.ValidationException; import javax.xml.validation.Schema; +import org.apache.commons.lang3.SerializationUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,8 +58,8 @@ import it.eng.parer.ws.utils.MessaggiWSBundle; import it.eng.parer.ws.utils.MessaggiWSFormat; import it.eng.parer.ws.utils.ParametroApplDB; -import it.eng.parer.ws.utils.VerificaVersione; import it.eng.parer.ws.utils.ParametroApplDB.ParametroApplFl; +import it.eng.parer.ws.utils.VerificaVersione; import it.eng.parer.ws.utils.XmlDateUtility; import it.eng.parer.ws.utils.XmlValidationEventHandler; import it.eng.parer.ws.versamento.dto.DocumentoVers; @@ -46,6 +69,7 @@ import it.eng.parer.ws.versamento.ejb.ControlliPartizioni; import it.eng.parer.ws.versamento.ejb.ControlliPerFirme; import it.eng.parer.ws.versamento.ejb.RapportoVersBuilder; +import it.eng.parer.ws.versamento.utils.Conteggi; import it.eng.parer.ws.versamentoTpi.utils.FileServUtils; import it.eng.parer.ws.xml.versReq.IntestazioneAggAllType; import it.eng.parer.ws.xml.versReq.TipoConservazioneType; @@ -57,67 +81,48 @@ import it.eng.parer.ws.xml.versResp.ECUnitaDocAggAllType; import it.eng.parer.ws.xml.versResp.EsitoVersAggAllegati; import it.eng.parer.ws.xml.versResp.SCVersatoreType; -import static it.eng.parer.util.DateUtilsConverter.convert; -import org.apache.commons.lang3.SerializationUtils; -import org.apache.commons.lang3.StringUtils; +@Stateless(mappedName = "VersamentoExtAggAllPrsr") +@LocalBean public class VersamentoExtAggAllPrsr { private static final Logger log = LoggerFactory.getLogger(VersamentoExtAggAllPrsr.class); - private VersamentoExtAggAll versamento; - private RispostaWSAggAll rispostaWs; - private RispostaControlli rispostaControlli; - // l'istanza dell'unità documentaria decodificata dall'XML di versamento - UnitaDocAggAllegati parsedUnitaDoc = null; // stateless ejb per i controlli sul db - ControlliSemantici controlliSemantici = null; + @EJB + private ControlliSemantici controlliSemantici; // un altro stateless ejb per altri controlli sul db - ControlliPerFirme controlliPerFirme = null; + @EJB + private ControlliPerFirme controlliPerFirme; // stateless ejb per verifica autorizzazione ws - ControlliWS controlliEjb = null; + @EJB + private ControlliWS controlliEjb; // stateless ejb per verifica del corretto partizionamento in funzione della // struttura da versare - ControlliPartizioni controlliPartizioni = null; + @EJB + private ControlliPartizioni controlliPartizioni; // singleton ejb di gestione cache dei parser Castor - XmlVersCache xmlVersCache = null; + @EJB + private XmlVersCache xmlVersCache; // stateless ejb per le operazioni relative al versamento su filesystem - ControlliTpi controlliTpi = null; + @EJB + private ControlliTpi controlliTpi; // stateless ejb crea il rapporto di versamento e canonicalizza (C14N) il SIP - RapportoVersBuilder rapportoVersBuilder = null; + @EJB + private RapportoVersBuilder rapportoVersBuilder; // stateless ejb per recupero configurazioni - ConfigurationHelper configurationHelper = null; - - public VersamentoExtAggAll getVersamento() { - return versamento; - } - - /** - * @return dto con risposta al ws {@link RispostaWSAggAll} - */ - public RispostaWSAggAll getRispostaWs() { - return rispostaWs; - } - - /** - * Default constructor. - * - * @param vers - * dto versamento su servizio aggiunta documento - * @param risp - * risposta di tipo {@link RispostaWSAggAll} - */ - public VersamentoExtAggAllPrsr(VersamentoExtAggAll vers, RispostaWSAggAll risp) { - versamento = vers; - rispostaWs = risp; - rispostaControlli = new RispostaControlli(); - - } - - public void parseXML(SyncFakeSessn sessione) { + @EJB + private ConfigurationHelper configurationHelper; + // stateless ejb di verifica e parsing dei documenti (tutti i tipi) + @EJB + DocumentoVersPrsr myDocumentoVersPrsr; + + @SuppressWarnings("unchecked") + public void parseXML(SyncFakeSessn sessione, VersamentoExtAggAll versamento, RispostaWSAggAll rispostaWs) { EsitoVersAggAllegati myEsito = rispostaWs.getIstanzaEsito(); AvanzamentoWs myAvanzamentoWs = rispostaWs.getAvanzamento(); StringReader tmpReader; - parsedUnitaDoc = null; + // l'istanza dell'unità documentaria decodificata dall'XML di versamento + UnitaDocAggAllegati parsedUnitaDoc = null; // istanzia la classe di verifica strutturale Conteggi tmpConteggi = new Conteggi(); @@ -125,54 +130,10 @@ public void parseXML(SyncFakeSessn sessione) { // istanzia la classe di verifica retrocompatibilità VerificaVersione tmpVerificaVersione = new VerificaVersione(); VerificaVersione.EsitiVerfica tmpEsitiVerfica; + // + RispostaControlli rispostaControlli = new RispostaControlli(); - // stateless ejb per i controlli sul db - controlliSemantici = null; - - // stateless ejb per verifica autorizzazione - controlliEjb = null; - - // classe di verifica e parsing dei documenti (tutti i tipi) - DocumentoVersPrsr myDocumentoVersPrsr = null; - - // recupera l'ejb singleton, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - xmlVersCache = (XmlVersCache) new InitialContext().lookup("java:module/XmlVersCache"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB singleton XMLContext " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB singleton XMLContext ", ex); - } - } - - // recupera l'ejb C14N, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - rapportoVersBuilder = (RapportoVersBuilder) new InitialContext() - .lookup("java:module/RapportoVersBuilder"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB RapportoVersBuilder " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB RapportoVersBuilder ", ex); - } - } - - // recupera l'ejb per il recupero delle configurazioni applicative - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - configurationHelper = (ConfigurationHelper) new InitialContext() - .lookup("java:module/ConfigurationHelper"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB ConfigurationHelper " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB ConfigurationHelper ", ex); - } - } - + // versamento.setDatiXml(sessione.getDatiIndiceSipXml()); /* @@ -181,8 +142,8 @@ public void parseXML(SyncFakeSessn sessione) { */ if (rispostaWs.getSeverity() == SeverityEnum.OK) { rispostaControlli = rapportoVersBuilder.canonicalizzaDaSalvareIndiceSip(sessione); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); myEsito.getEsitoXSD().setControlloStrutturaXML(rispostaControlli.getDsErr()); } @@ -257,11 +218,11 @@ public void parseXML(SyncFakeSessn sessione) { // (opzionale, solo per le versioni // recenti del WS) if (rispostaWs.getSeverity() == SeverityEnum.OK) { - it.eng.parer.ws.xml.versResp.SCChiaveType ChiaveResp = new it.eng.parer.ws.xml.versResp.SCChiaveType(); - ChiaveResp.setAnno(Long.toString(parsedUnitaDoc.getIntestazione().getChiave().getAnno())); - ChiaveResp.setNumero(parsedUnitaDoc.getIntestazione().getChiave().getNumero()); - ChiaveResp.setTipoRegistro(parsedUnitaDoc.getIntestazione().getChiave().getTipoRegistro()); - myEsito.getUnitaDocumentaria().setChiave(ChiaveResp); + it.eng.parer.ws.xml.versResp.SCChiaveType chiaveType = new it.eng.parer.ws.xml.versResp.SCChiaveType(); + chiaveType.setAnno(Long.toString(parsedUnitaDoc.getIntestazione().getChiave().getAnno())); + chiaveType.setNumero(parsedUnitaDoc.getIntestazione().getChiave().getNumero()); + chiaveType.setTipoRegistro(parsedUnitaDoc.getIntestazione().getChiave().getTipoRegistro()); + myEsito.getUnitaDocumentaria().setChiave(chiaveType); myEsito.getUnitaDocumentaria().setDataVersamento(myEsito.getDataVersamento()); if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_ESTESI_1_3_OUT)) { @@ -298,85 +259,6 @@ public void parseXML(SyncFakeSessn sessione) { } } - // recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliSemantici = (ControlliSemantici) new InitialContext().lookup("java:module/ControlliSemantici"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB dei controlli semantici " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli semantici ", ex); - } - } - - // Recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliPerFirme = (ControlliPerFirme) new InitialContext().lookup("java:module/ControlliPerFirme"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dei controlli per firme " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli per firme ", ex); - } - } - - // recupera l'ejb dei controlli di partizionamento, se possibile - altrimenti - // segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliPartizioni = (ControlliPartizioni) new InitialContext() - .lookup("java:module/ControlliPartizioni"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB dei controlli di partizionamento " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli di partizionamento ", ex); - } - } - - // recupera l'ejb dell'autenticazione, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliEjb = (ControlliWS) new InitialContext().lookup("java:module/ControlliWS"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB di verifica delle autorizzazioni " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB di verifica delle autorizzazioni ", ex); - } - } - - // recupera l'ejb per le operazioni relative al versamento su filesystem, se - // possibile - altrimenti segnala - // errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliTpi = (ControlliTpi) new InitialContext().lookup("java:module/ControlliTpi"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB per le operazioni relative al versamento su filesystem " - + ex.getMessage()); - log.error("Errore nel recupero dell'EJB per le operazioni relative al versamento su filesystem ", ex); - } - } - - // recupera l'ejb per la gestione delle configurazioni applicative se possibile - // - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - configurationHelper = (ConfigurationHelper) new InitialContext() - .lookup("java:module/ConfigurationHelper"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB ConfigurationHelper " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB ConfigurationHelper ", ex); - } - } - myAvanzamentoWs.setFase("verifica semantica unità documentaria - inizio").logAvanzamento(); /* @@ -406,8 +288,8 @@ public void parseXML(SyncFakeSessn sessione) { rispostaControlli.reset(); rispostaControlli = controlliSemantici .caricaDefaultDaDB(ParametroApplDB.TipoParametroAppl.VERSAMENTO_DEFAULT); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); } else { xmlDefaults = (HashMap) rispostaControlli.getrObject(); @@ -419,17 +301,6 @@ public void parseXML(SyncFakeSessn sessione) { if (rispostaWs.getSeverity() == SeverityEnum.OK) { tmpConteggi.verifica(parsedUnitaDoc, xmlDefaults); - if (tmpConteggi.getStrutturaVersamentoAtteso().getTrovataDataNullaIn() != null) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setErrorCode("-1"); - rispostaWs.setErrorMessage("Errore: trovati uno o più campi di tipo data breve vuoti."); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.XSD_002_003, - tmpConteggi.getStrutturaVersamentoAtteso().getTrovataDataNullaIn()); - myEsito.getEsitoXSD().setCodiceEsito(ECEsitoPosNegType.NEGATIVO); - myEsito.getEsitoXSD().setControlloStrutturaXML( - "Un campo di tipo data breve deve essere espresso nella forma aaaa-mm-gg"); - } - // questo test, sui documenti, ha senso perché l'ID Documento può essere nullo if (rispostaWs.getSeverity() == SeverityEnum.OK && tmpConteggi.getStrutturaVersamentoAtteso().isTrovatiIdDocDuplicati()) { @@ -487,15 +358,20 @@ public void parseXML(SyncFakeSessn sessione) { } // recupera il sistema di migrazione, se presente - tmpConfigurazione.setSistemaDiMigrazione(parsedUnitaDoc.getConfigurazione().getSistemaDiMigrazione()); - versamento.getStrutturaComponenti() - .setSistemaDiMigrazione(parsedUnitaDoc.getConfigurazione().getSistemaDiMigrazione()); + if (parsedUnitaDoc.getConfigurazione().getSistemaDiMigrazione() != null) { + tmpConfigurazione + .setSistemaDiMigrazione(parsedUnitaDoc.getConfigurazione().getSistemaDiMigrazione()); + versamento.getStrutturaComponenti() + .setSistemaDiMigrazione(parsedUnitaDoc.getConfigurazione().getSistemaDiMigrazione()); + } - if (parsedUnitaDoc.getConfigurazione().getTipoConservazione() == TipoConservazioneType.FISCALE) { + if (parsedUnitaDoc.getConfigurazione().getTipoConservazione() != null + && parsedUnitaDoc.getConfigurazione().getTipoConservazione() == TipoConservazioneType.FISCALE) { tmpConfigurazione.setTipoConservazione(TipoConservazioneType.FISCALE.name()); } - if (parsedUnitaDoc.getConfigurazione().getTipoConservazione() == TipoConservazioneType.MIGRAZIONE) { + if (parsedUnitaDoc.getConfigurazione().getTipoConservazione() != null && parsedUnitaDoc + .getConfigurazione().getTipoConservazione() == TipoConservazioneType.MIGRAZIONE) { tmpConfigurazione.setTipoConservazione(TipoConservazioneType.MIGRAZIONE.name()); } @@ -513,12 +389,6 @@ public void parseXML(SyncFakeSessn sessione) { rispostaWs.setEsitoWsError(tmpEsitiVerfica.getCodErrore(), tmpEsitiVerfica.getMessaggio()); myEsito.getEsitoXSD().setCodiceEsito(ECEsitoPosNegType.NEGATIVO); } - if (tmpEsitiVerfica.isFlgWarning()) { - // rispostaWs.setSeverity(SeverityEnum.WARNING); - // rispostaWs.setEsitoWsError(tmpEsitiVerfica.getCodErrore(), - // tmpEsitiVerfica.getMessaggio()); - // myEsito.getEsitoXSD().setCodiceEsito(ECEsitoPosNegWarType.WARNING); - } } // se ho passato la verifica strutturale, creo il ramo dell'xml di risposta @@ -541,7 +411,7 @@ public void parseXML(SyncFakeSessn sessione) { } // sistema (new URN) String sistemaConservazione = configurationHelper - .getParamApplicValue(ParametroApplDB.NM_SISTEMACONSERVAZIONE); + .getValoreParamApplicByApplic(ParametroApplDB.NM_SISTEMACONSERVAZIONE); tmpCSVersatore.setSistemaConservazione(sistemaConservazione); // set versatore @@ -551,7 +421,7 @@ public void parseXML(SyncFakeSessn sessione) { rispostaControlli = controlliSemantici.checkIdStrut(tmpCSVersatore, TipiWSPerControlli.VERSAMENTO_RECUPERO, convert(versamento.getStrutturaComponenti().getDataVersamento())); if (rispostaControlli.getrLong() < 1) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() @@ -600,7 +470,7 @@ public void parseXML(SyncFakeSessn sessione) { versamento.getStrutturaComponenti().getIdStruttura(), ControlliSemantici.TipiGestioneUDAnnullate.CONSIDERA_ASSENTE); if (rispostaControlli.isrBoolean() || rispostaControlli.getrLong() == -1) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() @@ -647,7 +517,7 @@ public void parseXML(SyncFakeSessn sessione) { rispostaControlli = controlliSemantici.getDtCalcInizioNuoviUrn(); if (rispostaControlli.getCodErr() != null) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); } else { // dt inizio calcolo nuovi urn @@ -670,7 +540,7 @@ public void parseXML(SyncFakeSessn sessione) { // 666 error if (rispostaControlli.getCodErr() != null) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); } else { // cd key normalized (se calcolato) @@ -701,7 +571,7 @@ public void parseXML(SyncFakeSessn sessione) { // 666 error if (rispostaControlli.getCodErr() != null) { cdKeyUnitaDocNormalizExists = false; - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); } else { // normalized cd_key @@ -726,7 +596,7 @@ public void parseXML(SyncFakeSessn sessione) { if (rispostaControlli.getrLong() != -1) { OrgStrut os = (OrgStrut) rispostaControlli.getrObject(); // build flags - this.elabFlagSipVDB(myEsito, os); + this.elabFlagSipVDB(myEsito, os, versamento, parsedUnitaDoc); } else { rispostaWs.setSeverity(SeverityEnum.ERROR); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, @@ -754,16 +624,18 @@ public void parseXML(SyncFakeSessn sessione) { .getStatoConservazioneUnitaDoc(); // forza - boolean flForzaAggiuntaDocumento = parsedUnitaDoc.getConfigurazione().isForzaAggiuntaDocumento() != null - ? parsedUnitaDoc.getConfigurazione().isForzaAggiuntaDocumento().booleanValue() - : versamento.getStrutturaComponenti().isFlagForzaDocAgg(); + boolean flForzaAggiuntaDocumento = parsedUnitaDoc.getConfigurazione() != null + && parsedUnitaDoc.getConfigurazione().isForzaAggiuntaDocumento() != null + ? parsedUnitaDoc.getConfigurazione().isForzaAggiuntaDocumento().booleanValue() + : versamento.getStrutturaComponenti().isFlagForzaDocAgg(); // warning boolean isWarn = false; if (flForzaAggiuntaDocumento) { isWarn = true; } else { isWarn = versamento.getStrutturaComponenti().isFlagAccettaDocNeg() - && (parsedUnitaDoc.getConfigurazione().isForzaAccettazione() != null + && (parsedUnitaDoc.getConfigurazione() != null + && parsedUnitaDoc.getConfigurazione().isForzaAccettazione() != null && parsedUnitaDoc.getConfigurazione().isForzaAccettazione().booleanValue()); } @@ -786,12 +658,11 @@ public void parseXML(SyncFakeSessn sessione) { // add on list versamento.listErrAddWarningUd(descChiaveUD, MessaggiWSBundle.UD_013_001, descChiaveUD); } else { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setVerificaStatoConservazione(ECEsitoPosNegWarType.NEGATIVO); - // errore UD-013-001 L'unità documentaria è inserita in almeno una serie; rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.UD_013_001, MessaggiWSFormat.formattaUrnPartUnitaDoc(tmpCSChiave)); @@ -816,27 +687,27 @@ public void parseXML(SyncFakeSessn sessione) { .getTipoSalvataggioFile() == CostantiDB.TipoSalvataggioFile.FILE) { FileServUtils fileServUtils = new FileServUtils(); if (!fileServUtils.controllaSubPath(tmpCSVersatore.getAmbiente())) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.FILESYS_001_001, tmpCSVersatore.getAmbiente()); } else if (!fileServUtils.controllaSubPath(tmpCSVersatore.getEnte())) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.FILESYS_001_002, tmpCSVersatore.getEnte()); } else if (!fileServUtils.controllaSubPath(tmpCSVersatore.getStruttura())) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.FILESYS_001_003, tmpCSVersatore.getStruttura()); } else if (!fileServUtils.controllaSubPath(tmpCSChiave.getTipoRegistro())) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.FILESYS_001_004, tmpCSChiave.getTipoRegistro()); } else if (!fileServUtils.controllaSubPath(tmpCSChiave.getNumero())) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.FILESYS_001_005, tmpCSChiave.getNumero()); @@ -849,8 +720,8 @@ public void parseXML(SyncFakeSessn sessione) { HashMap tpiDefaults = new HashMap<>(); rispostaControlli.reset(); rispostaControlli = controlliSemantici.caricaDefaultDaDB(ParametroApplDB.TipoParametroAppl.TPI); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); } else { tpiDefaults = (HashMap) rispostaControlli.getrObject(); @@ -862,8 +733,8 @@ public void parseXML(SyncFakeSessn sessione) { .setTpiRootArkVers(tpiDefaults.get(ParametroApplDB.TPI_ROOT_ARK_VERS)); rispostaControlli.reset(); rispostaControlli = controlliTpi.caricaRootPath(); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); } else { versamento.getStrutturaComponenti().setTpiRootTpiDaSacer(rispostaControlli.getrString()); @@ -887,7 +758,7 @@ public void parseXML(SyncFakeSessn sessione) { if (rispostaControlli.isrBoolean()) { versamento.getStrutturaComponenti().setTpiAbilitato(true); } else if (rispostaControlli.getCodErr() != null) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); } } @@ -902,9 +773,9 @@ public void parseXML(SyncFakeSessn sessione) { && xmlDefaults.get(ParametroApplDB.VERIFICA_PARTIZIONI).trim().equalsIgnoreCase("TRUE")) { rispostaControlli.reset(); rispostaControlli = controlliPartizioni.verificaPartizioniBlob(versamento.getStrutturaComponenti(), - tmpCSVersatore, tmpCSChiave); + tmpCSVersatore); if (!rispostaControlli.isrBoolean()) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); @@ -922,7 +793,6 @@ public void parseXML(SyncFakeSessn sessione) { // §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { myAvanzamentoWs.setFase("verifica semantica documento - inizio").logAvanzamento(); - myDocumentoVersPrsr = new DocumentoVersPrsr(versamento, rispostaWs, myEsito.getConfigurazione()); } // §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ @@ -938,7 +808,7 @@ public void parseXML(SyncFakeSessn sessione) { if (rispostaControlli.getrLong() != -1) { valueDocVers.setProgressivo((int) rispostaControlli.getrLong()); } else { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setSeverity(SeverityEnum.ERROR); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); } @@ -949,7 +819,7 @@ public void parseXML(SyncFakeSessn sessione) { if (rispostaControlli.getrLong() != -1) { valueDocVers.setNiOrdDoc((int) rispostaControlli.getrLong()); } else { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); } @@ -965,8 +835,8 @@ public void parseXML(SyncFakeSessn sessione) { String tmpDescUd = MessaggiWSFormat.formattaUrnPartUnitaDoc(tmpCSChiave); rispostaControlli = controlliSemantici.checkDocumentoInUd( versamento.getStrutturaComponenti().getIdUnitaDoc(), tmpIdDocumento, tmpDescUd); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() @@ -995,7 +865,7 @@ public void parseXML(SyncFakeSessn sessione) { CategoriaDocumento.Documento, valueDocVers.getNiOrdDoc(), true, Costanti.UrnFormatter.DOC_FMT_STRING_V2, Costanti.UrnFormatter.PAD5DIGITS_FMT); tmpDocumento.setChiaveDoc(tmpChiaveDoc); - tmpDocumento.setTipoDocumento((String) valueDocVers.getRifDocumento().getTipoDocumento()); + tmpDocumento.setTipoDocumento(valueDocVers.getRifDocumento().getTipoDocumento()); tmpDocumento.setEsitoDocumento(new ECDocumentoType.EsitoDocumento()); tmpDocumento.getEsitoDocumento().setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); tmpDocumento.getEsitoDocumento().setUnivocitaOrdinePresentazione(ECEsitoPosNegType.POSITIVO); @@ -1016,42 +886,43 @@ public void parseXML(SyncFakeSessn sessione) { } valueDocVers.setRifDocumentoResp(tmpDocumento); - myDocumentoVersPrsr.parseDocumentoGen(valueDocVers, tmpDocumento); + myDocumentoVersPrsr.parseDocumentoGen(valueDocVers, tmpDocumento, versamento, rispostaWs); } myAvanzamentoWs.resetFase().setFase("verifica semantica documento - fine").logAvanzamento(); } if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { // prepara risposta con flag - this.buildFlagsOnEsito(myEsito); + this.buildFlagsOnEsito(myEsito, versamento); } // MEV#23176 if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { // prepara risposta con urn sip - this.buildUrnSipOnEsito(myEsito); + this.buildUrnSipOnEsito(myEsito, versamento); } // end MEV#23176 } - private void elabFlagSipVDB(EsitoVersAggAllegati myEsito, OrgStrut os) { + private void elabFlagSipVDB(EsitoVersAggAllegati myEsito, OrgStrut os, VersamentoExtAggAll versamento, + UnitaDocAggAllegati parsedUnitaDoc) { long idStrut = os.getIdStrut(); long idAmbiente = os.getOrgEnte().getOrgAmbiente().getIdAmbiente(); long idTipoUd = versamento.getStrutturaComponenti().getIdTipologiaUnitaDocumentaria(); // forza accettazione - boolean isForzaAccettazione = parsedUnitaDoc.getConfigurazione().isForzaAccettazione() != null + boolean isForzaAccettazione = parsedUnitaDoc.getConfigurazione() != null + && parsedUnitaDoc.getConfigurazione().isForzaAccettazione() != null && parsedUnitaDoc.getConfigurazione().isForzaAccettazione().booleanValue(); // flags - versamento.getStrutturaComponenti().setFlagVerificaHash(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_HASH_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagVerificaHash( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_HASH_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); boolean flForzaHashVers = configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_HASH_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE); - boolean flAccettaContrHashNeg = configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_HASH_NEG, idStrut, idAmbiente, idTipoUd) + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_HASH_VERS, idStrut, idAmbiente, idTipoUd) .equals(CostantiDB.Flag.TRUE); + boolean flAccettaContrHashNeg = configurationHelper.getValoreParamApplicByTipoUdAsFl( + ParametroApplFl.FL_ACCETTA_CONTR_HASH_NEG, idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE); versamento.getStrutturaComponenti().setFlagAccettaContrHashNeg(flAccettaContrHashNeg); if (flForzaHashVers || (flAccettaContrHashNeg && isForzaAccettazione)) { @@ -1059,24 +930,22 @@ private void elabFlagSipVDB(EsitoVersAggAllegati myEsito, OrgStrut os) { } // - versamento.getStrutturaComponenti().setFlagAbilitaForzaDocAgg(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_FORZA_DOC_AGG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAbilitaForzaDocAgg( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_FORZA_DOC_AGG, idStrut, + idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti() - .setFlagForzaDocAgg(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_DOC_AGG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagForzaDocAgg(configurationHelper + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_DOC_AGG, idStrut, idAmbiente, idTipoUd) + .equals(CostantiDB.Flag.TRUE)); - versamento.getStrutturaComponenti() - .setFlagAccettaDocNeg(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_DOC_AGG_NEG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAccettaDocNeg(configurationHelper + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_DOC_AGG_NEG, idStrut, idAmbiente, idTipoUd) + .equals(CostantiDB.Flag.TRUE)); // default pre 1.5 versamento.getStrutturaComponenti() .setConfigFlagForzaFormato(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_FMT, idStrut, idAmbiente, idTipoUd) + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_FMT, idStrut, idAmbiente, idTipoUd) .equals(CostantiDB.Flag.TRUE)); // v1.5 @@ -1084,10 +953,16 @@ private void elabFlagSipVDB(EsitoVersAggAllegati myEsito, OrgStrut os) { // SIP vs DB boolean forzaAggDoc = false; - if (parsedUnitaDoc.getConfigurazione().isForzaAggiuntaDocumento() != null) { - forzaAggDoc = parsedUnitaDoc.getConfigurazione().isForzaAggiuntaDocumento().booleanValue(); - } else { - forzaAggDoc = versamento.getStrutturaComponenti().isFlagAbilitaForzaDocAgg(); + if (parsedUnitaDoc.getConfigurazione() != null) { + if (parsedUnitaDoc.getConfigurazione().isForzaAggiuntaDocumento() != null) { + forzaAggDoc = parsedUnitaDoc.getConfigurazione().isForzaAggiuntaDocumento().booleanValue(); + } else { + forzaAggDoc = versamento.getStrutturaComponenti().isFlagAbilitaForzaDocAgg(); + } + + flForzaHashVers = parsedUnitaDoc.getConfigurazione().isForzaHash() != null + ? parsedUnitaDoc.getConfigurazione().isForzaHash().booleanValue() : flForzaHashVers;// se non da + // SIP } myEsito.getConfigurazione().setForzaAggiuntaDocumento(forzaAggDoc); @@ -1097,9 +972,6 @@ private void elabFlagSipVDB(EsitoVersAggAllegati myEsito, OrgStrut os) { // myEsito.getConfigurazione().setAccettaControlloDocumentoAggiuntoNegativo( versamento.getStrutturaComponenti().isFlagAccettaDocNeg()); - - flForzaHashVers = parsedUnitaDoc.getConfigurazione().isForzaHash() != null - ? parsedUnitaDoc.getConfigurazione().isForzaHash().booleanValue() : flForzaHashVers;// se non da SIP // è immutato // (vedi valore // precedente da @@ -1112,9 +984,11 @@ private void elabFlagSipVDB(EsitoVersAggAllegati myEsito, OrgStrut os) { versamento.getStrutturaComponenti().setFlagAccettaHashErrato(true); } - boolean flForzaFmt = parsedUnitaDoc.getConfigurazione().isForzaFormatoFile() != null - ? parsedUnitaDoc.getConfigurazione().isForzaFormatoFile().booleanValue() - : versamento.getStrutturaComponenti().isConfigFlagForzaFormato();// se non da SIP è immutato (vedi + boolean flForzaFmt = parsedUnitaDoc.getConfigurazione() != null + && parsedUnitaDoc.getConfigurazione().isForzaFormatoFile() != null + ? parsedUnitaDoc.getConfigurazione().isForzaFormatoFile().booleanValue() + : versamento.getStrutturaComponenti().isConfigFlagForzaFormato();// se non da SIP è immutato + // (vedi // valore precedente da DB) // override versamento.getStrutturaComponenti().setConfigFlagForzaFormato(flForzaFmt); @@ -1126,7 +1000,7 @@ private void elabFlagSipVDB(EsitoVersAggAllegati myEsito, OrgStrut os) { * @param myEsito * esito versamento {@link EsitoVersAggAllegati} con flag impostati */ - private void buildFlagsOnEsito(EsitoVersAggAllegati myEsito) { + private void buildFlagsOnEsito(EsitoVersAggAllegati myEsito, VersamentoExtAggAll versamento) { // prepara risposta con flag (v1.5) if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_ABILITA_FORZA_1_5)) { myEsito.getConfigurazione() @@ -1147,7 +1021,7 @@ private void buildFlagsOnEsito(EsitoVersAggAllegati myEsito) { /** * @param myEsito */ - private void buildUrnSipOnEsito(EsitoVersAggAllegati myEsito) { + private void buildUrnSipOnEsito(EsitoVersAggAllegati myEsito, VersamentoExtAggAll versamento) { if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_URN_SIP_1_5)) { // @@ -1167,7 +1041,7 @@ private void buildUrnSipOnEsito(EsitoVersAggAllegati myEsito) { } // end MEV#23176 - private void setRispostaWsError() { + private void setRispostaWsError(RispostaWSAggAll rispostaWs, RispostaControlli rispostaControlli) { rispostaWs.setSeverity(SeverityEnum.ERROR); rispostaWs.setErrorCode(rispostaControlli.getCodErr()); rispostaWs.setErrorMessage(rispostaControlli.getDsErr()); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/VersamentoExtPrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/prs/VersamentoExtPrsr.java similarity index 84% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/VersamentoExtPrsr.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/prs/VersamentoExtPrsr.java index 086bb9e..1cc7402 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/VersamentoExtPrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/ejb/prs/VersamentoExtPrsr.java @@ -1,4 +1,21 @@ -package it.eng.parer.ws.versamento.utils; +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb.prs; import static it.eng.parer.util.DateUtilsConverter.convert; @@ -9,9 +26,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; -import javax.naming.InitialContext; -import javax.naming.NamingException; +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; +import javax.ejb.TransactionAttribute; +import javax.ejb.TransactionAttributeType; import javax.xml.bind.JAXBException; import javax.xml.bind.UnmarshalException; import javax.xml.bind.Unmarshaller; @@ -61,7 +82,9 @@ import it.eng.parer.ws.versamento.ejb.ControlliPartizioni; import it.eng.parer.ws.versamento.ejb.ControlliPerFirme; import it.eng.parer.ws.versamento.ejb.ControlliProfiliUd; +import it.eng.parer.ws.versamento.ejb.GestioneDatiSpec; import it.eng.parer.ws.versamento.ejb.RapportoVersBuilder; +import it.eng.parer.ws.versamento.utils.Conteggi; import it.eng.parer.ws.versamentoTpi.utils.FileServUtils; import it.eng.parer.ws.xml.versReq.DocumentoCollegatoType; import it.eng.parer.ws.xml.versReq.IntestazioneType; @@ -76,66 +99,53 @@ import it.eng.parer.ws.xml.versResp.EsitoVersamento; import it.eng.parer.ws.xml.versResp.SCVersatoreType; +@Stateless(mappedName = "VersamentoExtPrsr") +@LocalBean public class VersamentoExtPrsr { private static final Logger log = LoggerFactory.getLogger(VersamentoExtPrsr.class); - private VersamentoExt versamento; - private RispostaWS rispostaWs; - private RispostaControlli rispostaControlli; - // l'istanza dell'unità documentaria decodificata dall'XML di versamento - UnitaDocumentaria parsedUnitaDoc = null; // stateless ejb per i controlli sul db - ControlliSemantici controlliSemantici = null; + @EJB + private ControlliSemantici controlliSemantici; // un altro stateless ejb per altri controlli sul db - ControlliPerFirme controlliPerFirme = null; + @EJB + private ControlliPerFirme controlliPerFirme; // stateless ejb per verifica autorizzazione ws - ControlliWS controlliEjb = null; + @EJB + private ControlliWS controlliEjb; // stateless ejb per verifica del corretto partizionamento in funzione della // struttura da versare - ControlliPartizioni controlliPartizioni = null; + @EJB + private ControlliPartizioni controlliPartizioni; // singleton ejb di gestione cache dei parser Castor - XmlVersCache xmlVersCache = null; + @EJB + private XmlVersCache xmlVersCache; // stateless ejb per le operazioni relative al versamento su filesystem - ControlliTpi controlliTpi = null; + @EJB + private ControlliTpi controlliTpi; // stateless ejb: crea il rapporto di versamento e canonicalizza (C14N) il SIP - RapportoVersBuilder rapportoVersBuilder = null; - // classe di supporto per la verifica e l'estrazione dei dati specifici - GestioneDatiSpec gestioneDatiSpec = null; // allocata nel costruttore + @EJB + private RapportoVersBuilder rapportoVersBuilder; // stateless ejb per recupero configurazioni - ConfigurationHelper configurationHelper = null; + @EJB + private ConfigurationHelper configurationHelper; // stateless ejb per i controlli sui profili ud - ControlliProfiliUd controlliProfiliUd = null; - - public VersamentoExt getVersamento() { - return versamento; - } - - /** - * @return the rispostaWs - */ - public RispostaWS getRispostaWs() { - return rispostaWs; - } - - /** - * Default constructor. - * - * @param vers - * dto versamento {@link VersamentoExt} - * @param risp - * risposta ws {@link RispostaWS} - */ - public VersamentoExtPrsr(VersamentoExt vers, RispostaWS risp) { - versamento = vers; - rispostaWs = risp; - rispostaControlli = new RispostaControlli(); - } - - public void parseXML(SyncFakeSessn sessione) { + @EJB + private ControlliProfiliUd controlliProfiliUd; + // stateless ejb di verifica e parsing dei documenti (tutti i tipi) + @EJB + private DocumentoVersPrsr myDocumentoVersPrsr; + // + @EJB + private GestioneDatiSpec gestioneDatiSpec; + + @SuppressWarnings("unchecked") + @TransactionAttribute(TransactionAttributeType.REQUIRED) + public void parseXML(SyncFakeSessn sessione, RispostaWS rispostaWs, VersamentoExt versamento) { EsitoVersamento myEsito = rispostaWs.getIstanzaEsito(); AvanzamentoWs myAvanzamentoWs = rispostaWs.getAvanzamento(); StringReader tmpReader; - parsedUnitaDoc = null; + UnitaDocumentaria parsedUnitaDoc = null; // istanzia la classe di verifica strutturale Conteggi tmpConteggi = new Conteggi(); @@ -144,50 +154,7 @@ public void parseXML(SyncFakeSessn sessione) { VerificaVersione tmpVerificaVersione = new VerificaVersione(); VerificaVersione.EsitiVerfica tmpEsitiVerfica; - // stateless ejb per i controlli sul db - controlliSemantici = null; - - // stateless ejb per verifica autorizzazione - controlliEjb = null; - - // recupera l'ejb singleton, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - xmlVersCache = (XmlVersCache) new InitialContext().lookup("java:module/XmlVersCache"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB singleton XMLContext " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB singleton XMLContext ", ex); - } - } - - // recupera l'ejb C14N, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - rapportoVersBuilder = (RapportoVersBuilder) new InitialContext() - .lookup("java:module/RapportoVersBuilder"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB RapportoVersBuilder " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB RapportoVersBuilder ", ex); - } - } - - // recupera l'ejb per la gestione delle configurazioni applicative se possibile - // - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - configurationHelper = (ConfigurationHelper) new InitialContext() - .lookup("java:module/ConfigurationHelper"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB ConfigurationHelper " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB ConfigurationHelper ", ex); - } - } + RispostaControlli rispostaControlli = new RispostaControlli(); XmlValidationEventHandler validationHandler = new XmlValidationEventHandler(); Unmarshaller unmarshaller = null; @@ -212,8 +179,8 @@ public void parseXML(SyncFakeSessn sessione) { */ if (rispostaWs.getSeverity() == SeverityEnum.OK) { rispostaControlli = rapportoVersBuilder.canonicalizzaDaSalvareIndiceSip(sessione); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); myEsito.getEsitoXSD().setControlloStrutturaXML(rispostaControlli.getDsErr()); } @@ -283,11 +250,11 @@ public void parseXML(SyncFakeSessn sessione) { // (opzionale, solo per le versioni // recenti del WS) if (rispostaWs.getSeverity() == SeverityEnum.OK) { - it.eng.parer.ws.xml.versResp.SCChiaveType ChiaveResp = new it.eng.parer.ws.xml.versResp.SCChiaveType(); - ChiaveResp.setAnno(Long.toString(parsedUnitaDoc.getIntestazione().getChiave().getAnno())); - ChiaveResp.setNumero(parsedUnitaDoc.getIntestazione().getChiave().getNumero()); - ChiaveResp.setTipoRegistro(parsedUnitaDoc.getIntestazione().getChiave().getTipoRegistro()); - myEsito.getUnitaDocumentaria().setChiave(ChiaveResp); + it.eng.parer.ws.xml.versResp.SCChiaveType chiaveType = new it.eng.parer.ws.xml.versResp.SCChiaveType(); + chiaveType.setAnno(Long.toString(parsedUnitaDoc.getIntestazione().getChiave().getAnno())); + chiaveType.setNumero(parsedUnitaDoc.getIntestazione().getChiave().getNumero()); + chiaveType.setTipoRegistro(parsedUnitaDoc.getIntestazione().getChiave().getTipoRegistro()); + myEsito.getUnitaDocumentaria().setChiave(chiaveType); myEsito.getUnitaDocumentaria().setDataVersamento(myEsito.getDataVersamento()); if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_ESTESI_1_3_OUT)) { @@ -329,83 +296,6 @@ public void parseXML(SyncFakeSessn sessione) { } } - // recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliSemantici = (ControlliSemantici) new InitialContext().lookup("java:module/ControlliSemantici"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB dei controlli semantici " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli semantici ", ex); - } - } - - // Recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliPerFirme = (ControlliPerFirme) new InitialContext().lookup("java:module/ControlliPerFirme"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dei controlli per firme " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli per firme ", ex); - } - } - - // recupera l'ejb dei controlli di partizionamento, se possibile - altrimenti - // segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliPartizioni = (ControlliPartizioni) new InitialContext() - .lookup("java:module/ControlliPartizioni"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB dei controlli di partizionamento " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli di partizionamento ", ex); - } - } - - // recupera l'ejb dell'autenticazione, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliEjb = (ControlliWS) new InitialContext().lookup("java:module/ControlliWS"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB di verifica delle autorizzazioni " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB di verifica delle autorizzazioni ", ex); - } - } - - // recupera l'ejb per le operazioni relative al versamento su filesystem, se - // possibile - altrimenti segnala - // errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliTpi = (ControlliTpi) new InitialContext().lookup("java:module/ControlliTpi"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB per le operazioni relative al versamento su filesystem " - + ex.getMessage()); - log.error("Errore nel recupero dell'EJB per le operazioni relative al versamento su filesystem ", ex); - } - } - - // recupera l'ejb per le operazioni relative ai controlli dei profili xsd ud - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliProfiliUd = (ControlliProfiliUd) new InitialContext().lookup("java:module/ControlliProfiliUd"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB dei controlli profili ud " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli profili ud ", ex); - } - } - myAvanzamentoWs.setFase("verifica semantica unità documentaria - inizio").logAvanzamento(); /* @@ -440,8 +330,8 @@ public void parseXML(SyncFakeSessn sessione) { rispostaControlli = controlliSemantici .caricaDefaultDaDB(new String[] { ParametroApplDB.TipoParametroAppl.VERSAMENTO_DEFAULT, ParametroApplDB.TipoParametroAppl.VERSIONI_WS }); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); } else { xmlDefaults = (HashMap) rispostaControlli.getrObject(); @@ -601,7 +491,7 @@ public void parseXML(SyncFakeSessn sessione) { tmpCSVersatore.setStruttura(parsedUnitaDoc.getIntestazione().getVersatore().getStruttura()); // sistema (new URN) String sistemaConservazione = configurationHelper - .getParamApplicValue(ParametroApplDB.NM_SISTEMACONSERVAZIONE); + .getValoreParamApplicByApplic(ParametroApplDB.NM_SISTEMACONSERVAZIONE); tmpCSVersatore.setSistemaConservazione(sistemaConservazione); // set versatore versamento.getStrutturaComponenti().setVersatoreNonverificato(tmpCSVersatore); @@ -610,7 +500,7 @@ public void parseXML(SyncFakeSessn sessione) { rispostaControlli = controlliSemantici.checkIdStrut(tmpCSVersatore, TipiWSPerControlli.VERSAMENTO_RECUPERO, convert(versamento.getStrutturaComponenti().getDataVersamento())); if (rispostaControlli.getrLong() < 1) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() @@ -651,8 +541,8 @@ public void parseXML(SyncFakeSessn sessione) { rispostaControlli.reset(); rispostaControlli = controlliSemantici .checkSistemaMigraz(myEsito.getConfigurazione().getSistemaDiMigrazione()); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() @@ -689,8 +579,8 @@ public void parseXML(SyncFakeSessn sessione) { rispostaControlli = controlliSemantici.checkChiave(tmpCSChiave, versamento.getStrutturaComponenti().getIdStruttura(), ControlliSemantici.TipiGestioneUDAnnullate.CONSIDERA_ASSENTE); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() @@ -714,8 +604,8 @@ public void parseXML(SyncFakeSessn sessione) { rispostaControlli = controlliSemantici.checkTipologiaUD( parsedUnitaDoc.getIntestazione().getTipologiaUnitaDocumentaria(), descChiaveUD, versamento.getStrutturaComponenti().getIdStruttura()); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() @@ -742,27 +632,27 @@ public void parseXML(SyncFakeSessn sessione) { .getTipoSalvataggioFile() == CostantiDB.TipoSalvataggioFile.FILE) { FileServUtils fileServUtils = new FileServUtils(); if (!fileServUtils.controllaSubPath(tmpCSVersatore.getAmbiente())) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.FILESYS_001_001, tmpCSVersatore.getAmbiente()); } else if (!fileServUtils.controllaSubPath(tmpCSVersatore.getEnte())) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.FILESYS_001_002, tmpCSVersatore.getEnte()); } else if (!fileServUtils.controllaSubPath(tmpCSVersatore.getStruttura())) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.FILESYS_001_003, tmpCSVersatore.getStruttura()); } else if (!fileServUtils.controllaSubPath(tmpCSChiave.getTipoRegistro())) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.FILESYS_001_004, tmpCSChiave.getTipoRegistro()); } else if (!fileServUtils.controllaSubPath(tmpCSChiave.getNumero())) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.FILESYS_001_005, tmpCSChiave.getNumero()); @@ -779,8 +669,8 @@ public void parseXML(SyncFakeSessn sessione) { HashMap tpiDefaults = null; rispostaControlli.reset(); rispostaControlli = controlliSemantici.caricaDefaultDaDB(ParametroApplDB.TipoParametroAppl.TPI); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); } else { tpiDefaults = (HashMap) rispostaControlli.getrObject(); @@ -798,8 +688,8 @@ public void parseXML(SyncFakeSessn sessione) { rispostaControlli.reset(); rispostaControlli = controlliTpi.caricaRootPath(); - if (rispostaControlli.isrBoolean() == false) { - setRispostaWsError(); + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); } else { versamento.getStrutturaComponenti().setTpiRootTpiDaSacer(rispostaControlli.getrString()); @@ -823,7 +713,7 @@ public void parseXML(SyncFakeSessn sessione) { if (rispostaControlli.isrBoolean()) { versamento.getStrutturaComponenti().setTpiAbilitato(true); } else if (rispostaControlli.getCodErr() != null) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); } } @@ -835,12 +725,12 @@ public void parseXML(SyncFakeSessn sessione) { */ if (rispostaWs.getSeverity() == SeverityEnum.OK) { if (xmlDefaults.get(ParametroApplDB.VERIFICA_PARTIZIONI) != null - && xmlDefaults.get(ParametroApplDB.VERIFICA_PARTIZIONI).trim().toUpperCase().equals("TRUE")) { + && xmlDefaults.get(ParametroApplDB.VERIFICA_PARTIZIONI).trim().equalsIgnoreCase("TRUE")) { rispostaControlli.reset(); rispostaControlli = controlliPartizioni.verificaPartizioniBlob(versamento.getStrutturaComponenti(), - tmpCSVersatore, tmpCSChiave); + tmpCSVersatore); if (!rispostaControlli.isrBoolean()) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() @@ -868,7 +758,7 @@ public void parseXML(SyncFakeSessn sessione) { versamento.getStrutturaComponenti().setIdRegistroUnitaDoc(rispostaControlli.getrLong()); datiRegistroFiscale = (DatiRegistroFiscale) rispostaControlli.getrObject(); } else { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() @@ -889,7 +779,7 @@ public void parseXML(SyncFakeSessn sessione) { if (rispostaControlli.isrBoolean()) { versamento.getStrutturaComponenti().setConfigRegAnno((ConfigRegAnno) rispostaControlli.getrObject()); } else { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() @@ -913,7 +803,7 @@ public void parseXML(SyncFakeSessn sessione) { versamento.getStrutturaComponenti().getIdRegistroUnitaDoc(), tmpCSChiave, cdKeyNormalized); // 666 error if (rispostaControlli.getCodErr() != null) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); } else { // normalized cd_key @@ -936,8 +826,9 @@ public void parseXML(SyncFakeSessn sessione) { rispostaControlli = controlliPerFirme.getOrgStrutt(versamento.getStrutturaComponenti().getIdStruttura()); if (rispostaControlli.getrLong() != -1) { OrgStrut os = (OrgStrut) rispostaControlli.getrObject(); + controlliPerFirme.retrieveOrgEnteFor(os); // build flags - this.elabFlagSipVDB(os); + this.elabFlagSipVDB(os, versamento, parsedUnitaDoc); } else { rispostaWs.setSeverity(SeverityEnum.ERROR); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, @@ -953,7 +844,7 @@ public void parseXML(SyncFakeSessn sessione) { && (parsedUnitaDoc.getProfiloUnitaDocumentaria() == null || parsedUnitaDoc.getProfiloUnitaDocumentaria().getOggetto() == null || parsedUnitaDoc.getProfiloUnitaDocumentaria().getOggetto().isEmpty())) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() @@ -966,7 +857,7 @@ public void parseXML(SyncFakeSessn sessione) { if (versamento.getStrutturaComponenti().isFlagProfiloUdObbData() && (parsedUnitaDoc.getProfiloUnitaDocumentaria() == null || parsedUnitaDoc.getProfiloUnitaDocumentaria().getData() == null)) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() @@ -1020,7 +911,7 @@ public void parseXML(SyncFakeSessn sessione) { .setVerificaTipologiaUD(ECEsitoPosNegType.NEGATIVO); // se ho accettato con forzatura il numero, verifico che sia ancora possibile - // produrre un URN valido; + // produrre un URN valido // se non è possibile, il versamento viene comunque bloccato if (tmpKeySizeUtility.getLenURN() > KeySizeUtility.MAX_LEN_URN) { versamento.listErrAddErrorUd(descChiaveUD, MessaggiWSBundle.UD_007_003, descChiaveUD); @@ -1058,7 +949,7 @@ public void parseXML(SyncFakeSessn sessione) { if (datiRegistroFiscale.isFlRegistroFisc() && (!(TipoConservazioneType.FISCALE.name().equals(tipoConservazione)) && !(TipoConservazioneType.MIGRAZIONE.name().equals(tipoConservazione)))) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() @@ -1069,7 +960,7 @@ public void parseXML(SyncFakeSessn sessione) { } if (!datiRegistroFiscale.isFlRegistroFisc() && TipoConservazioneType.FISCALE.name().equals(tipoConservazione)) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCodiceEsito(ECEsitoPosNegWarType.NEGATIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() @@ -1091,28 +982,26 @@ public void parseXML(SyncFakeSessn sessione) { // NB: questa allocazione può fallire. Al termine devo verificare lo stato di // RispostaWS e gestire il // problema - - gestioneDatiSpec = new GestioneDatiSpec(versamento.getStrutturaComponenti().getSistemaDiMigrazione(), - versamento.getStrutturaComponenti().getIdStruttura(), rispostaWs); if (rispostaWs.getSeverity() == SeverityEnum.ERROR) { rispostaWs.setEsitoWsError(rispostaWs.getErrorCode(), rispostaWs.getErrorMessage()); } // verifico gli eventuali dati specifici e di migrazione if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - this.parseDatiSpecUnitadoc(); + parseDatiSpecUnitadoc(rispostaWs, versamento, parsedUnitaDoc, gestioneDatiSpec); } } // verifica dei profili if (rispostaWs.getSeverity() != SeverityEnum.ERROR && versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_PROFILI_1_5)) { - this.verificaProfiliUnitaDoc(myEsito); + verificaProfiliUnitaDoc(myEsito, versamento, rispostaControlli); } // verifico la presenza di UD collegate if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - this.verificaUdCollegate(tmpCSVersatore, tpiConfVerificaNumkeyUD); + verificaUdCollegate(tmpCSVersatore, tpiConfVerificaNumkeyUD, rispostaWs, versamento, rispostaControlli, + parsedUnitaDoc); } myAvanzamentoWs.setFase("verifica semantica unità documentaria - fine").logAvanzamento(); @@ -1121,50 +1010,50 @@ public void parseXML(SyncFakeSessn sessione) { // buona parte del lavoro viene svolta dalla classe // DocumentoVersPrsr che viene usata anche per il ws di aggiunta documenti. if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - this.verificaDocumentiUd(); + this.verificaDocumentiUd(rispostaWs, versamento); } if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { // prepara risposta con flag - this.buildFlagsOnEsito(myEsito); + buildFlagsOnEsito(myEsito, versamento); } // MEV#23176 if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { // prepara risposta con urn sip - this.buildUrnSipOnEsito(myEsito); + buildUrnSipOnEsito(myEsito, versamento); } // end MEV#23176 } - private void elabFlagSipVDB(OrgStrut os) { + private void elabFlagSipVDB(OrgStrut os, VersamentoExt versamento, UnitaDocumentaria parsedUnitaDoc) { + // + boolean isConfigurazioneOnSip = !Objects.isNull(parsedUnitaDoc.getConfigurazione()); // long idStrut = os.getIdStrut(); long idAmbiente = os.getOrgEnte().getOrgAmbiente().getIdAmbiente(); long idTipoUd = versamento.getStrutturaComponenti().getIdTipologiaUnitaDocumentaria(); // forza accettazione - boolean isForzaAccettazione = parsedUnitaDoc.getConfigurazione().isForzaAccettazione() != null + boolean isForzaAccettazione = isConfigurazioneOnSip + && parsedUnitaDoc.getConfigurazione().isForzaAccettazione() != null && parsedUnitaDoc.getConfigurazione().isForzaAccettazione().booleanValue(); // flags - versamento.getStrutturaComponenti() - .setFlagAccettaErroreFmtNumero(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_FMT_NUM_NEG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAccettaErroreFmtNumero(configurationHelper + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_FMT_NUM_NEG, idStrut, idAmbiente, idTipoUd) + .equals(CostantiDB.Flag.TRUE)); // - versamento.getStrutturaComponenti() - .setConfigFlagForzaFormatoNumero(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_FMT_NUM, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setConfigFlagForzaFormatoNumero(configurationHelper + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_FMT_NUM, idStrut, idAmbiente, idTipoUd) + .equals(CostantiDB.Flag.TRUE)); // - versamento.getStrutturaComponenti() - .setFlagProfiloUdObbOggetto(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_OBBL_OGGETTO, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagProfiloUdObbOggetto(configurationHelper + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_OBBL_OGGETTO, idStrut, idAmbiente, idTipoUd) + .equals(CostantiDB.Flag.TRUE)); // versamento.getStrutturaComponenti() .setFlagProfiloUdObbData(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_OBBL_DATA, idStrut, idAmbiente, idTipoUd) + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_OBBL_DATA, idStrut, idAmbiente, idTipoUd) .equals(CostantiDB.Flag.TRUE)); /* * MAC #23544: La gestione del parametro FORZA_COLLEGAMENTO è opzionale sul SIP. Nel caso non siano configurati @@ -1175,25 +1064,25 @@ private void elabFlagSipVDB(OrgStrut os) { * VersamentoExtAggAllPrsr e VerificaFirmeHashAggAll (tramite la stringa MAC #23544) */ boolean forzaCollegamento = false; - if (parsedUnitaDoc.getConfigurazione().isForzaCollegamento() != null) { + if (isConfigurazioneOnSip && parsedUnitaDoc.getConfigurazione().isForzaCollegamento() != null) { forzaCollegamento = parsedUnitaDoc.getConfigurazione().isForzaCollegamento().booleanValue(); } else { forzaCollegamento = configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_COLLEG, idStrut, idAmbiente, idTipoUd) + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_COLLEG, idStrut, idAmbiente, idTipoUd) .equals(CostantiDB.Flag.TRUE); } versamento.getStrutturaComponenti().setConfigFlagForzaColleg(forzaCollegamento); // - versamento.getStrutturaComponenti().setFlagVerificaHash(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_HASH_VERS, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagVerificaHash( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_HASH_VERS, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); boolean flForzaHashVers = configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_HASH_VERS, idStrut, idAmbiente, idTipoUd).equals("1"); - boolean flAccettaContrHashNeg = configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_HASH_NEG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE); + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_HASH_VERS, idStrut, idAmbiente, idTipoUd) + .equals("1"); + boolean flAccettaContrHashNeg = configurationHelper.getValoreParamApplicByTipoUdAsFl( + ParametroApplFl.FL_ACCETTA_CONTR_HASH_NEG, idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE); versamento.getStrutturaComponenti().setFlagAccettaContrHashNeg(flAccettaContrHashNeg); if (flForzaHashVers || (flAccettaContrHashNeg && isForzaAccettazione)) { @@ -1201,36 +1090,36 @@ private void elabFlagSipVDB(OrgStrut os) { } // - versamento.getStrutturaComponenti().setConfigFlagAbilitaContrColleg(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_COLLEG_UD, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setConfigFlagAbilitaContrColleg( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_COLLEG_UD, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); // - versamento.getStrutturaComponenti().setFlagAbilitaContrFmtNumero(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_CONTR_FMT_NUM, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAbilitaContrFmtNumero( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_CONTR_FMT_NUM, idStrut, + idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); // - versamento.getStrutturaComponenti().setFlagAccettaContrCollegNeg(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_CONTR_COLLEG_NEG, idStrut, idAmbiente, idTipoUd) - .equals(CostantiDB.Flag.TRUE)); + versamento.getStrutturaComponenti().setFlagAccettaContrCollegNeg( + configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ACCETTA_CONTR_COLLEG_NEG, + idStrut, idAmbiente, idTipoUd).equals(CostantiDB.Flag.TRUE)); // default pre 1.5 versamento.getStrutturaComponenti() .setConfigFlagForzaFormato(configurationHelper - .getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_FMT, idStrut, idAmbiente, idTipoUd) + .getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_FORZA_FMT, idStrut, idAmbiente, idTipoUd) .equals(CostantiDB.Flag.TRUE)); // v1.5 if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_ABILITA_FORZA_1_5)) { // sip vs db - if (parsedUnitaDoc.getConfigurazione().isForzaFormatoNumero() != null) { + if (isConfigurazioneOnSip && parsedUnitaDoc.getConfigurazione().isForzaFormatoNumero() != null) { versamento.getStrutturaComponenti().setConfigFlagForzaFormatoNumero( parsedUnitaDoc.getConfigurazione().isForzaFormatoNumero().booleanValue()); } - flForzaHashVers = parsedUnitaDoc.getConfigurazione().isForzaHash() != null + flForzaHashVers = isConfigurazioneOnSip && parsedUnitaDoc.getConfigurazione().isForzaHash() != null ? parsedUnitaDoc.getConfigurazione().isForzaHash().booleanValue() : flForzaHashVers;// se non da SIP // è immutato // (vedi valore @@ -1243,9 +1132,11 @@ private void elabFlagSipVDB(OrgStrut os) { versamento.getStrutturaComponenti().setFlagAccettaHashErrato(true); } - boolean flForzaFmtNumero = parsedUnitaDoc.getConfigurazione().isForzaFormatoFile() != null - ? parsedUnitaDoc.getConfigurazione().isForzaFormatoFile().booleanValue() - : versamento.getStrutturaComponenti().isConfigFlagForzaFormato();// se non da SIP è immutato (vedi + boolean flForzaFmtNumero = isConfigurazioneOnSip + && parsedUnitaDoc.getConfigurazione().isForzaFormatoFile() != null + ? parsedUnitaDoc.getConfigurazione().isForzaFormatoFile().booleanValue() + : versamento.getStrutturaComponenti().isConfigFlagForzaFormato();// se non da SIP è immutato + // (vedi // valore precedente da DB) // override versamento.getStrutturaComponenti().setConfigFlagForzaFormato(flForzaFmtNumero); @@ -1253,7 +1144,9 @@ private void elabFlagSipVDB(OrgStrut os) { } } - private void verificaUdCollegate(CSVersatore csVersatore, KeySizeUtility.TpiConfig tpiConfVerificaNumkeyUD) { + private void verificaUdCollegate(CSVersatore csVersatore, KeySizeUtility.TpiConfig tpiConfVerificaNumkeyUD, + RispostaWS rispostaWs, VersamentoExt versamento, RispostaControlli rispostaControlli, + UnitaDocumentaria parsedUnitaDoc) { EsitoVersamento myEsito = rispostaWs.getIstanzaEsito(); String descChiaveUD = versamento.getStrutturaComponenti().getUrnPartChiaveUd(); @@ -1268,7 +1161,7 @@ private void verificaUdCollegate(CSVersatore csVersatore, KeySizeUtility.TpiConf CSChiave tmpCsChiaveColl = new CSChiave(); // l'insieme di tutti i collegamenti (già accorpati nelle descrizioni) // che verrà memorizzato sul DB - Map, UnitaDocColl> tmpCollegamentiUd = new HashMap, UnitaDocColl>(); + Map, UnitaDocColl> tmpCollegamentiUd = new HashMap<>(); // CICLO FOR SUI DOCUMENTI COLLEGATI for (DocumentoCollegatoType.DocumentoCollegato documCollMd : parsedUnitaDoc.getDocumentiCollegati() @@ -1282,7 +1175,7 @@ private void verificaUdCollegate(CSVersatore csVersatore, KeySizeUtility.TpiConf tmpArr[0] = tmpCsChiaveColl.getNumero(); tmpArr[1] = tmpCsChiaveColl.getTipoRegistro(); tmpArr[2] = String.valueOf(tmpCsChiaveColl.getAnno()); - List tmpChiaveUdAsList = Arrays.asList(tmpArr); + List tmpChiaveUdAsList = Arrays.asList(tmpArr); UnitaDocColl tmpUnitaDocColl = tmpCollegamentiUd.get(tmpChiaveUdAsList); if (tmpUnitaDocColl == null) { @@ -1347,7 +1240,7 @@ private void verificaUdCollegate(CSVersatore csVersatore, KeySizeUtility.TpiConf // allora è un errore di database.. // non ha trovato la chiave ma non ha impostato a true // il bool di rispostacontrolli - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); break; } @@ -1367,7 +1260,7 @@ private void verificaUdCollegate(CSVersatore csVersatore, KeySizeUtility.TpiConf if (rispostaControlli.getCodErr() != null && rispostaControlli.getCodErr().equals(MessaggiWSBundle.ERR_666)) { // è un errore di database.. - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); break; } else { @@ -1394,7 +1287,7 @@ private void verificaUdCollegate(CSVersatore csVersatore, KeySizeUtility.TpiConf if (rispostaControlli.getCodErr() != null && rispostaControlli.getCodErr().equals(MessaggiWSBundle.ERR_666)) { // è un errore di database.. - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); break; } else { @@ -1459,7 +1352,7 @@ private void verificaUdCollegate(CSVersatore csVersatore, KeySizeUtility.TpiConf } } } - } // fine if (tag DocumentiCollegati != null) + } // fine tag DocumentiCollegati != null // gestione esito // se abilitato @@ -1487,7 +1380,7 @@ private void verificaUdCollegate(CSVersatore csVersatore, KeySizeUtility.TpiConf } - private void verificaDocumentiUd() { + private void verificaDocumentiUd(RispostaWS rispostaWs, VersamentoExt versamento) { AvanzamentoWs myAvanzamentoWs = rispostaWs.getAvanzamento(); EsitoVersamento myEsito = rispostaWs.getIstanzaEsito(); String descChiaveUD = versamento.getStrutturaComponenti().getUrnPartChiaveUd(); @@ -1496,8 +1389,6 @@ private void verificaDocumentiUd() { // classe di verifica e parsing dei documenti (tutti i tipi) // inizializzazione parser del documento // NB: può fallire, quindi passo RispostaWS che può tornare in stato di errore - DocumentoVersPrsr myDocumentoVersPrsr = new DocumentoVersPrsr(versamento, rispostaWs, - myEsito.getConfigurazione()); // GESTIONE DOCUMENTO PRINCIPALE, ALLEGATI, ANNESSI, ANNOTAZIONI // loop sui documenti (Principale, Allegati, Annessi e Annotazioni) @@ -1510,13 +1401,10 @@ private void verificaDocumentiUd() { // creo la parte di risposta versamento relativa al documento principale if (myEsito.getUnitaDocumentaria().getDocumentoPrincipale() == null) { ECDocumentoType documentoPrincipale = new ECDocumentoType(); - // documentoPrincipale.setChiaveDoc(MessaggiWSFormat.formattaChiaveDocumento(descChiaveUD, - // valueDocVers.getCategoriaDoc(), 1)); documentoPrincipale.setChiaveDoc(MessaggiWSFormat.formattaChiaveDocumento(descChiaveUD, CategoriaDocumento.Documento, valueDocVers.getNiOrdDoc(), true, Costanti.UrnFormatter.DOC_FMT_STRING_V2, Costanti.UrnFormatter.PAD5DIGITS_FMT)); - documentoPrincipale - .setTipoDocumento((String) valueDocVers.getRifDocumento().getTipoDocumento()); + documentoPrincipale.setTipoDocumento(valueDocVers.getRifDocumento().getTipoDocumento()); documentoPrincipale.setEsitoDocumento(new ECDocumentoType.EsitoDocumento()); documentoPrincipale.getEsitoDocumento().setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); documentoPrincipale.getEsitoDocumento() @@ -1533,7 +1421,7 @@ private void verificaDocumentiUd() { // verifica completa del documento if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { myDocumentoVersPrsr.parseDocumentoGen(valueDocVers, - myEsito.getUnitaDocumentaria().getDocumentoPrincipale()); + myEsito.getUnitaDocumentaria().getDocumentoPrincipale(), versamento, rispostaWs); } } @@ -1548,12 +1436,10 @@ private void verificaDocumentiUd() { // creo la parte di risposta vesamento relativo ad uno specifico allegato ECDocumentoType allegato = new ECDocumentoType(); - // allegato.setChiaveDoc(MessaggiWSFormat.formattaChiaveDocumento(descChiaveUD, - // valueDocVers.getCategoriaDoc(), valueDocVers.getProgressivo())); allegato.setChiaveDoc(MessaggiWSFormat.formattaChiaveDocumento(descChiaveUD, CategoriaDocumento.Documento, valueDocVers.getNiOrdDoc(), true, Costanti.UrnFormatter.DOC_FMT_STRING_V2, Costanti.UrnFormatter.PAD5DIGITS_FMT)); - allegato.setTipoDocumento((String) valueDocVers.getRifDocumento().getTipoDocumento()); + allegato.setTipoDocumento(valueDocVers.getRifDocumento().getTipoDocumento()); ECDocumentoType.EsitoDocumento esitoDocumento = new ECDocumentoType.EsitoDocumento(); esitoDocumento.setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); esitoDocumento.setUnivocitaOrdinePresentazione(ECEsitoPosNegType.POSITIVO); @@ -1569,7 +1455,7 @@ private void verificaDocumentiUd() { // verifica completa del documento if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - myDocumentoVersPrsr.parseDocumentoGen(valueDocVers, allegato); + myDocumentoVersPrsr.parseDocumentoGen(valueDocVers, allegato, versamento, rispostaWs); } } /////////////////////////////////////////////// @@ -1587,12 +1473,10 @@ private void verificaDocumentiUd() { // creo la parte di risposta vesamento relativo ad uno specifico allegato ECDocumentoType annesso = new ECDocumentoType(); - // annesso.setChiaveDoc(MessaggiWSFormat.formattaChiaveDocumento(descChiaveUD, - // valueDocVers.getCategoriaDoc(), valueDocVers.getProgressivo())); annesso.setChiaveDoc(MessaggiWSFormat.formattaChiaveDocumento(descChiaveUD, CategoriaDocumento.Documento, valueDocVers.getNiOrdDoc(), true, Costanti.UrnFormatter.DOC_FMT_STRING_V2, Costanti.UrnFormatter.PAD5DIGITS_FMT)); - annesso.setTipoDocumento((String) valueDocVers.getRifDocumento().getTipoDocumento()); + annesso.setTipoDocumento(valueDocVers.getRifDocumento().getTipoDocumento()); ECDocumentoType.EsitoDocumento esitoDocumento = new ECDocumentoType.EsitoDocumento(); esitoDocumento.setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); esitoDocumento.setUnivocitaOrdinePresentazione(ECEsitoPosNegType.POSITIVO); @@ -1608,7 +1492,7 @@ private void verificaDocumentiUd() { // verifica completa del documento if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - myDocumentoVersPrsr.parseDocumentoGen(valueDocVers, annesso); + myDocumentoVersPrsr.parseDocumentoGen(valueDocVers, annesso, versamento, rispostaWs); } } /////////////////////////////////////////////// @@ -1626,12 +1510,10 @@ private void verificaDocumentiUd() { // creo la parte di risposta vesamento relativo ad uno specifico allegato ECDocumentoType annotazione = new ECDocumentoType(); - // annotazione.setChiaveDoc(MessaggiWSFormat.formattaChiaveDocumento(descChiaveUD, - // valueDocVers.getCategoriaDoc(), valueDocVers.getProgressivo())); annotazione.setChiaveDoc(MessaggiWSFormat.formattaChiaveDocumento(descChiaveUD, CategoriaDocumento.Documento, valueDocVers.getNiOrdDoc(), true, Costanti.UrnFormatter.DOC_FMT_STRING_V2, Costanti.UrnFormatter.PAD5DIGITS_FMT)); - annotazione.setTipoDocumento((String) valueDocVers.getRifDocumento().getTipoDocumento()); + annotazione.setTipoDocumento(valueDocVers.getRifDocumento().getTipoDocumento()); ECDocumentoType.EsitoDocumento esitoDocumento = new ECDocumentoType.EsitoDocumento(); esitoDocumento.setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); esitoDocumento.setUnivocitaOrdinePresentazione(ECEsitoPosNegType.POSITIVO); @@ -1647,7 +1529,7 @@ private void verificaDocumentiUd() { // verifica completa del documento if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - myDocumentoVersPrsr.parseDocumentoGen(valueDocVers, annotazione); + myDocumentoVersPrsr.parseDocumentoGen(valueDocVers, annotazione, versamento, rispostaWs); } } @@ -1659,19 +1541,21 @@ private void verificaDocumentiUd() { } } - private void parseDatiSpecUnitadoc() { + private void parseDatiSpecUnitadoc(RispostaWS rispostaWs, VersamentoExt versamento, + UnitaDocumentaria parsedUnitaDoc, GestioneDatiSpec gestioneDatiSpec) { RispostaControlliAttSpec tmpControlliAttSpec = null; EsitoVersamento myEsito = rispostaWs.getIstanzaEsito(); - gestioneDatiSpec.parseDatiSpec(TipiEntitaSacer.UNI_DOC, versamento.getVersamento().getDatiSpecifici(), + tmpControlliAttSpec = gestioneDatiSpec.parseDatiSpec(TipiEntitaSacer.UNI_DOC, + versamento.getVersamento().getDatiSpecifici(), versamento.getStrutturaComponenti().getIdTipologiaUnitaDocumentaria(), versamento.getStrutturaComponenti().getUrnPartChiaveUd(), - parsedUnitaDoc.getIntestazione().getTipologiaUnitaDocumentaria()); + parsedUnitaDoc.getIntestazione().getTipologiaUnitaDocumentaria(), + versamento.getStrutturaComponenti().getSistemaDiMigrazione(), + versamento.getStrutturaComponenti().getIdStruttura(), rispostaWs); if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - tmpControlliAttSpec = gestioneDatiSpec.getRispostaControlliAttSpec(); versamento.getStrutturaComponenti().setDatiSpecifici(tmpControlliAttSpec.getDatiSpecifici()); versamento.getStrutturaComponenti().setIdRecXsdDatiSpec(tmpControlliAttSpec.getIdRecXsdDatiSpec()); - // myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria().setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCorrispondenzaDatiSpecifici(ECEsitoPosNegType.POSITIVO); } else { @@ -1685,17 +1569,16 @@ private void parseDatiSpecUnitadoc() { && rispostaWs.getSeverity() != SeverityEnum.ERROR && versamento.getStrutturaComponenti().getSistemaDiMigrazione() != null) { - gestioneDatiSpec.parseDatiSpecMig(TipiEntitaSacer.UNI_DOC, + tmpControlliAttSpec = gestioneDatiSpec.parseDatiSpecMig(TipiEntitaSacer.UNI_DOC, versamento.getVersamento().getDatiSpecificiMigrazione(), - versamento.getStrutturaComponenti().getIdTipologiaUnitaDocumentaria(), versamento.getStrutturaComponenti().getUrnPartChiaveUd(), - parsedUnitaDoc.getIntestazione().getTipologiaUnitaDocumentaria()); + parsedUnitaDoc.getIntestazione().getTipologiaUnitaDocumentaria(), + versamento.getStrutturaComponenti().getSistemaDiMigrazione(), + versamento.getStrutturaComponenti().getIdStruttura(), rispostaWs); if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - tmpControlliAttSpec = gestioneDatiSpec.getRispostaControlliAttSpec(); versamento.getStrutturaComponenti().setDatiSpecificiMigrazione(tmpControlliAttSpec.getDatiSpecifici()); versamento.getStrutturaComponenti() .setIdRecXsdDatiSpecMigrazione(tmpControlliAttSpec.getIdRecXsdDatiSpec()); - // myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria().setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria() .setCorrispondenzaDatiSpecifici(ECEsitoPosNegType.POSITIVO); } else { @@ -1712,7 +1595,7 @@ private void parseDatiSpecUnitadoc() { * @param myEsito * esito versamento {@link EsitoVersamento} */ - private void buildFlagsOnEsito(EsitoVersamento myEsito) { + private void buildFlagsOnEsito(EsitoVersamento myEsito, VersamentoExt versamento) { // MAC #23544 // aggiorna il tag [Configurazione] dell'esito (vedi elabFlagSipVDB) @@ -1759,7 +1642,8 @@ private void buildFlagsOnEsito(EsitoVersamento myEsito) { /* * Controllo profili */ - private void verificaProfiliUnitaDoc(EsitoVersamento myEsito) { + private void verificaProfiliUnitaDoc(EsitoVersamento myEsito, VersamentoExt versamento, + RispostaControlli rispostaControlli) { UnitaDocumentaria parsedUd = versamento.getVersamento(); rispostaControlli.reset(); @@ -1787,7 +1671,7 @@ private void verificaProfiliUnitaDoc(EsitoVersamento myEsito) { } // MEV#23176 - private void buildUrnSipOnEsito(EsitoVersamento myEsito) { + private void buildUrnSipOnEsito(EsitoVersamento myEsito, VersamentoExt versamento) { if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_URN_SIP_1_5)) { // @@ -1805,7 +1689,7 @@ private void buildUrnSipOnEsito(EsitoVersamento myEsito) { } // end MEV#23176 - private void setRispostaWsError() { + private void setRispostaWsError(RispostaWS rispostaWs, RispostaControlli rispostaControlli) { rispostaWs.setSeverity(SeverityEnum.ERROR); rispostaWs.setErrorCode(rispostaControlli.getCodErr()); rispostaWs.setErrorMessage(rispostaControlli.getDsErr()); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/exceptions/ObjectStorageException.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/exceptions/ObjectStorageException.java new file mode 100644 index 0000000..32037c3 --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/exceptions/ObjectStorageException.java @@ -0,0 +1,147 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.exceptions; + +import java.text.MessageFormat; + +public class ObjectStorageException extends Exception { + + private static final long serialVersionUID = -2311721715615582399L; + + private final String bucket; + private final String key; + private final String message; + private final Throwable cause; + private final String eTag; + + private ObjectStorageException(ObjectStorageExceptionBuilder builder) { + super(builder.message, builder.cause); + this.bucket = builder.bucket; + this.key = builder.key; + this.message = builder.message; + this.cause = builder.cause; + this.eTag = builder.eTag; + } + + public static ObjectStorageExceptionBuilder builder() { + return new ObjectStorageExceptionBuilder(); + } + + public String bucket() { + return bucket; + } + + public String key() { + return key; + } + + public String message() { + return message; + } + + public Throwable cause() { + return cause; + } + + public String eTag() { + return eTag; + } + + public static class ObjectStorageExceptionBuilder { + + private String bucket; + private String key; + private String eTag; + private String message; + private Throwable cause; + + public void setBucket(String bucket) { + this.bucket = bucket; + } + + public String getBucket() { + return bucket; + } + + public ObjectStorageExceptionBuilder bucket(String bucket) { + this.setBucket(bucket); + return this; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public ObjectStorageExceptionBuilder key(String key) { + this.setKey(key); + return this; + } + + public String geteTag() { + return eTag; + } + + public void seteTag(String eTag) { + this.eTag = eTag; + } + + public ObjectStorageExceptionBuilder eTag(String eTag) { + this.seteTag(eTag); + return this; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public ObjectStorageExceptionBuilder message(String message) { + this.setMessage(message); + return this; + } + + public ObjectStorageExceptionBuilder message(String messageToFormat, Object... args) { + this.setMessage(MessageFormat.format(messageToFormat, args)); + return this; + } + + public Throwable getCause() { + return cause; + } + + public void setCause(Throwable cause) { + this.cause = cause; + } + + public ObjectStorageExceptionBuilder cause(Throwable cause) { + this.setCause(cause); + return this; + } + + public ObjectStorageException build() { + return new ObjectStorageException(this); + } + } +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/Conteggi.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/Conteggi.java index 7ee5917..6e8a121 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/Conteggi.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/Conteggi.java @@ -1,24 +1,39 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamento.utils; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + import it.eng.parer.ws.utils.Costanti.CategoriaDocumento; import it.eng.parer.ws.utils.ParametroApplDB; import it.eng.parer.ws.versamento.dto.ComponenteVers; import it.eng.parer.ws.versamento.dto.DocumentoVers; import it.eng.parer.ws.versamento.dto.StrutturaVersamento; -import it.eng.parer.ws.versamento.dto.UnitaDocColl; import it.eng.parer.ws.xml.versReq.ComponenteType; import it.eng.parer.ws.xml.versReq.DocumentoType; import it.eng.parer.ws.xml.versReq.SottoComponenteType; +import it.eng.parer.ws.xml.versReq.TipoSupportoType; import it.eng.parer.ws.xml.versReq.UnitaDocAggAllegati; import it.eng.parer.ws.xml.versReq.UnitaDocumentaria; -import it.eng.parer.ws.xml.versReq.TipoSupportoType; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; /** * @@ -34,7 +49,7 @@ public class Conteggi { private String trovataDataNullaIn; private StrutturaVersamento strutturaVersamentoAtteso; // - HashMap xmlDefaults; + Map xmlDefaults; /** * @return dto strutturaVersamentoAtteso @@ -63,7 +78,7 @@ public final void init() { trovatiIdDocDuplicati = false; trovataDataNullaIn = null; strutturaVersamentoAtteso = new StrutturaVersamento(); - strutturaVersamentoAtteso.setUnitaDocCollegate(new ArrayList()); + strutturaVersamentoAtteso.setUnitaDocCollegate(new ArrayList<>()); } /** @@ -75,7 +90,7 @@ public final void init() { * @param defaults * parametri di default */ - public void verifica(UnitaDocumentaria versamento, HashMap defaults) { + public void verifica(UnitaDocumentaria versamento, Map defaults) { int progressivo = 0; // int progressivoDoc = 0; @@ -101,7 +116,7 @@ public void verifica(UnitaDocumentaria versamento, HashMap defau if (versamento.getAllegati() != null) { Iterator tmpEnumDoc = versamento.getAllegati().getAllegato().iterator(); while (tmpEnumDoc.hasNext()) { - DocumentoType tmpDocumentoType = (DocumentoType) tmpEnumDoc.next(); + DocumentoType tmpDocumentoType = tmpEnumDoc.next(); progressivo += 1; progressivoDoc += 1; // globale contaAllegati += 1; @@ -114,7 +129,7 @@ public void verifica(UnitaDocumentaria versamento, HashMap defau if (versamento.getAnnessi() != null) { Iterator tmpEnumDoc = versamento.getAnnessi().getAnnesso().iterator(); while (tmpEnumDoc.hasNext()) { - DocumentoType tmpDocumentoType = (DocumentoType) tmpEnumDoc.next(); + DocumentoType tmpDocumentoType = tmpEnumDoc.next(); progressivo += 1; progressivoDoc += 1; // globale contaAnnessi += 1; @@ -127,7 +142,7 @@ public void verifica(UnitaDocumentaria versamento, HashMap defau if (versamento.getAnnotazioni() != null) { Iterator tmpEnumDoc = versamento.getAnnotazioni().getAnnotazione().iterator(); while (tmpEnumDoc.hasNext()) { - DocumentoType tmpDocumentoType = (DocumentoType) tmpEnumDoc.next(); + DocumentoType tmpDocumentoType = tmpEnumDoc.next(); progressivo += 1; progressivoDoc += 1; // globale contaAnnotazioni += 1; @@ -149,19 +164,6 @@ public void verifica(UnitaDocumentaria versamento, HashMap defau corrAnnotazioniDichiarati = false; } - if (versamento.getProfiloUnitaDocumentaria() != null) { - if (versamento.getProfiloUnitaDocumentaria().getData() == null) { - trovataDataNullaIn = "ProfiloUnitaDocumentaria.Data"; - } else { - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - try { - java.util.Date d = format.parse(versamento.getProfiloUnitaDocumentaria().getData()); - } catch (ParseException ex) { - trovataDataNullaIn = "ProfiloUnitaDocumentaria.Data"; - } - } - } - strutturaVersamentoAtteso.setDocumentiAttesi(documentiAttesi); strutturaVersamentoAtteso.setFileAttesi(fileAttesi); strutturaVersamentoAtteso.setTrovatiIdCompDuplicati(trovatiIdCompDuplicati); @@ -182,7 +184,7 @@ public void verifica(UnitaDocumentaria versamento, HashMap defau * @param defaults * parametri di default */ - public void verifica(UnitaDocAggAllegati versamento, HashMap defaults) { + public void verifica(UnitaDocAggAllegati versamento, Map defaults) { boolean corrispondenzaAllegati = false; this.xmlDefaults = defaults; @@ -218,7 +220,7 @@ private void aggiungiVerificaDocumento(DocumentoType doc, int progressivo, Categ tmpDocumentoVers.setNiOrdDoc(progressivoDoc); tmpDocumentoVers.setCategoriaDoc(categoria); tmpDocumentoVers.setRifDocumento(doc); - tmpDocumentoVers.setFileAttesi(new ArrayList()); + tmpDocumentoVers.setFileAttesi(new ArrayList<>()); // impostazione del valore di default per il tipo struttura documento if (doc.getStrutturaOriginale().getTipoStruttura() == null) { @@ -231,15 +233,11 @@ private void aggiungiVerificaDocumento(DocumentoType doc, int progressivo, Categ * completamente sballato e in un dato salvato sul database con valori altrettanto sballati. */ if (doc.getDatiFiscali() != null) { - if (doc.getDatiFiscali().getDataEmissione() != null) { - if (doc.getDatiFiscali().getDataEmissione() == null) { - trovataDataNullaIn = "DatiFiscali.DataEmissione del documento " + doc.getIDDocumento(); - } + if (doc.getDatiFiscali().getDataEmissione() == null) { + trovataDataNullaIn = "DatiFiscali.DataEmissione del documento " + doc.getIDDocumento(); } - if (doc.getDatiFiscali().getDataTermineEmissione() != null) { - if (doc.getDatiFiscali().getDataTermineEmissione() == null) { - trovataDataNullaIn = "DatiFiscali.DataTermineEmissione del documento " + doc.getIDDocumento(); - } + if (doc.getDatiFiscali().getDataTermineEmissione() == null) { + trovataDataNullaIn = "DatiFiscali.DataTermineEmissione del documento " + doc.getIDDocumento(); } } @@ -264,7 +262,7 @@ private void verificaComponenti(DocumentoVers documentoVersato) { Iterator tmpEnumCompo = documento.getStrutturaOriginale().getComponenti() .getComponente().iterator(); while (tmpEnumCompo.hasNext()) { - ComponenteType tmpComponente = (ComponenteType) tmpEnumCompo.next(); + ComponenteType tmpComponente = tmpEnumCompo.next(); // impostazione valori di default per il componente if (tmpComponente.getTipoComponente() == null) { @@ -300,7 +298,7 @@ private void verificaComponenti(DocumentoVers documentoVersato) { Iterator tmpEnumSottoCompo = tmpComponente.getSottoComponenti() .getSottoComponente().iterator(); while (tmpEnumSottoCompo.hasNext()) { - SottoComponenteType tmpSottoComponente = (SottoComponenteType) tmpEnumSottoCompo.next(); + SottoComponenteType tmpSottoComponente = tmpEnumSottoCompo.next(); // impostazione valori di default per il sottocomponente if (tmpSottoComponente.getTipoSupportoComponente() == null) { @@ -330,4 +328,4 @@ private void verificaComponenti(DocumentoVers documentoVersato) { } } } -} \ No newline at end of file +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/ObjectStorageConnection.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/ObjectStorageConnection.java new file mode 100644 index 0000000..5b0a75c --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamento/utils/ObjectStorageConnection.java @@ -0,0 +1,95 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.utils; + +import java.net.URI; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; +import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; +import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; +import software.amazon.awssdk.regions.Region; +import software.amazon.awssdk.services.s3.S3Client; + +/** + * Metodo alternativo alla cache dei client. Usa il concetto della connection un po' come fa jdbc. + * + * @author Snidero_L + */ +public class ObjectStorageConnection implements AutoCloseable { + + private final Logger log = LoggerFactory.getLogger(ObjectStorageConnection.class); + private final S3Client s3Client; + + /** + * Creazione del client per il collegamento all'object storage + * + * @param storageAddress + * indirizzo dell'object storage scelto + * @param accessKeyId + * access key id S3 + * @param secretKey + * secret key S3 + */ + public ObjectStorageConnection(String storageAddress, String accessKeyId, String secretKey) { + this(URI.create(storageAddress), accessKeyId, secretKey); + } + + /** + * Creazione del client per il collegamento all'object storage + * + * @param storageAddress + * indirizzo dell'object storage scelto (come URI) + * @param accessKeyId + * access key id S3 + * @param secretKey + * secret key S3 + */ + public ObjectStorageConnection(URI storageAddress, String accessKeyId, String secretKey) { + // create basic credentials + + final AwsCredentialsProvider credProvider = StaticCredentialsProvider + .create(AwsBasicCredentials.create(accessKeyId, secretKey)); + + log.info("Sto per effettuare il collegamento all'endpoint S3 [{}] dal thread {}", storageAddress, + Thread.currentThread().getName()); + s3Client = S3Client.builder().endpointOverride(storageAddress).region(Region.US_EAST_1) + .credentialsProvider(credProvider).build(); + } + + /** + * Client S3 già configurato durante la costruzione dell'oggetto + * + * @return client S3 + */ + public S3Client getS3Client() { + return s3Client; + } + + @Override + public void close() throws Exception { + log.info("Close endpoint S3 dal thread {}", Thread.currentThread().getName()); + if (s3Client != null) { + s3Client.close(); + } + + } + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/ComponenteMM.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/ComponenteMM.java index 094784e..563ae6d 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/ComponenteMM.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/ComponenteMM.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamentoMM.dto; import it.eng.parer.ws.versamento.dto.ComponenteVers; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/StrutturaIndiceMM.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/StrutturaIndiceMM.java index d9fd7c6..52ebd17 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/StrutturaIndiceMM.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/StrutturaIndiceMM.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/VersamentoMMExt.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/VersamentoMMExt.java index fe9940e..37de12c 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/VersamentoMMExt.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/VersamentoMMExt.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -13,6 +30,7 @@ */ public class VersamentoMMExt extends VersamentoExt { + private static final long serialVersionUID = 1L; private String datiXmlIndice; private IndiceMM indiceMM; private StrutturaIndiceMM strutturaIndiceMM; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/WSDescVersamentoMM.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/WSDescVersamentoMM.java index 65a2788..12050b8 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/WSDescVersamentoMM.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/dto/WSDescVersamentoMM.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -27,4 +44,4 @@ public String getNomeWs() { // public String[] getCompatibilitaWS() { // return Costanti.WS_VERSAMENTO_COMP; // } -} \ No newline at end of file +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/utils/AllineaFileComponenti.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/ejb/AllineaFileComponenti.java similarity index 90% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/utils/AllineaFileComponenti.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/ejb/AllineaFileComponenti.java index a992f43..fb9651e 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/utils/AllineaFileComponenti.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/ejb/AllineaFileComponenti.java @@ -1,4 +1,21 @@ -package it.eng.parer.ws.versamentoMM.utils; +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamentoMM.ejb; import java.io.File; import java.io.FileOutputStream; @@ -12,6 +29,9 @@ import java.nio.file.attribute.PosixFilePermissions; import java.util.Set; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; + import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipFile; import org.apache.commons.io.IOUtils; @@ -30,27 +50,12 @@ * * @author Fioravanti_F */ +@Stateless(mappedName = "AllineaFileComponenti") +@LocalBean public class AllineaFileComponenti { - private VersamentoMMExt versamento; - private RispostaWS rispostaWs; - private SyncFakeSessn sessioneFinta; - - public VersamentoMMExt getVersamento() { - return versamento; - } - - public RispostaWS getRispostaWs() { - return rispostaWs; - } - - public AllineaFileComponenti(VersamentoMMExt vers, RispostaWS risp, SyncFakeSessn sessione) { - versamento = vers; - rispostaWs = risp; - sessioneFinta = sessione; - } - - public void verificaCoerenza(String pathFileTemporanei) throws IOException { + public void verificaCoerenza(String pathFileTemporanei, VersamentoMMExt versamento, RispostaWS rispostaWs, + SyncFakeSessn sessioneFinta) throws IOException { ComponenteVers tmpComponenteVers; for (ComponenteMM componenteMM : versamento.getStrutturaIndiceMM().getComponenti().values()) { tmpComponenteVers = versamento.getStrutturaComponenti().getFileAttesi().get(componenteMM.getId()); @@ -154,7 +159,6 @@ public void verificaCoerenza(String pathFileTemporanei) throws IOException { tmpFileBinario = new FileBinario(); tmpFileBinario.setId(componente.getRifComponenteMM().getMyComponenteMM().getID()); - tmpFileBinario.setInMemoria(false); tmpFileBinario.setFileSuDisco(tmpFile); tmpFileBinario.setDimensione(tmpFile.length()); componente.setRifFileBinario(tmpFileBinario); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/utils/IndiceMMPrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/ejb/IndiceMMPrsr.java similarity index 80% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/utils/IndiceMMPrsr.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/ejb/IndiceMMPrsr.java index ec5eae5..60107f9 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/utils/IndiceMMPrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/ejb/IndiceMMPrsr.java @@ -1,4 +1,58 @@ -package it.eng.parer.ws.versamentoMM.utils; +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamentoMM.ejb; + +import java.io.File; +import java.io.IOException; +import java.io.StringReader; +import java.util.HashMap; + +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; +import javax.xml.bind.UnmarshalException; +import javax.xml.bind.Unmarshaller; +import javax.xml.bind.ValidationException; + +import org.apache.commons.codec.DecoderException; +import org.apache.commons.codec.binary.Hex; +import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; +import org.apache.commons.compress.archivers.zip.ZipFile; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.io.StringReader; +import java.util.HashMap; + +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.xml.bind.UnmarshalException; +import javax.xml.bind.Unmarshaller; +import javax.xml.bind.ValidationException; + +import org.apache.commons.codec.DecoderException; +import org.apache.commons.codec.binary.Hex; +import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; +import org.apache.commons.compress.archivers.zip.ZipFile; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; import it.eng.parer.ws.dto.RispostaControlli; @@ -18,118 +72,39 @@ import it.eng.parer.ws.versamentoMM.dto.VersamentoMMExt; import it.eng.parer.ws.xml.versReqMultiMedia.ComponenteType; import it.eng.parer.ws.xml.versReqMultiMedia.IndiceMM; -import it.eng.parer.ws.xml.versResp.EsitoVersamento; import it.eng.parer.ws.xml.versResp.ECEsitoPosNegType; -import it.eng.spagoLite.security.User; -import java.io.File; -import java.io.IOException; -import java.io.StringReader; -import java.util.Arrays; -import java.util.HashMap; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.xml.bind.UnmarshalException; -import javax.xml.bind.Unmarshaller; -import javax.xml.bind.ValidationException; -import org.apache.commons.codec.DecoderException; -import org.apache.commons.codec.binary.Hex; -import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; -import org.apache.commons.compress.archivers.zip.ZipFile; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import it.eng.parer.ws.xml.versResp.EsitoVersamento; /** * * @author Fioravanti_F */ +@Stateless(mappedName = "IndiceMMPrsr") +@LocalBean public class IndiceMMPrsr { private static final Logger log = LoggerFactory.getLogger(IndiceMMPrsr.class); - private VersamentoMMExt versamento; - private RispostaWS rispostaWs; - private RispostaControlli rispostaControlli; - // l'istanza dell'unità documentaria decodificata dall'XML di versamento - IndiceMM parsedIndice = null; // stateless ejb per i controlli sul db - ControlliSemantici controlliSemantici = null; + @EJB + private ControlliSemantici controlliSemantici; // stateless ejb per i controlli sul db - ControlliMM controlliMM = null; + @EJB + private ControlliMM controlliMM; // singleton ejb di gestione cache dei parser Castor - XmlVersCache xmlVersCache = null; - // percorso completo e verificato del container .ZIP - String zipFilePath = null; + @EJB + private XmlVersCache xmlVersCache; - RapportoVersBuilder rapportoVersBuilder = null; + @EJB + private RapportoVersBuilder rapportoVersBuilder = null; - public VersamentoMMExt getVersamento() { - return versamento; - } - - public RispostaWS getRispostaWs() { - return rispostaWs; - } - - public IndiceMMPrsr(VersamentoMMExt vers, RispostaWS risp) { - versamento = vers; - rispostaWs = risp; - rispostaControlli = new RispostaControlli(); - } - - public void parseXML(SyncFakeSessn sessione) { + public void parseXML(SyncFakeSessn sessione, VersamentoMMExt versamento, RispostaWS rispostaWs) { EsitoVersamento myEsito = rispostaWs.getIstanzaEsito(); AvanzamentoWs myAvanzamentoWs = rispostaWs.getAvanzamento(); StringReader tmpReader; - parsedIndice = null; - - // stateless ejb per i controlli sul db - controlliSemantici = null; - - log.debug("Recupera ejb di controllo "); - // recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - try { - controlliSemantici = (ControlliSemantici) new InitialContext().lookup("java:module/ControlliSemantici"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB dei controlli semantici " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli semantici ", ex); - } - - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliMM = (ControlliMM) new InitialContext().lookup("java:module/ControlliMM"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB ControlliMM " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB ControlliMM ", ex); - } - } - - // recupera l'ejb singleton, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - xmlVersCache = (XmlVersCache) new InitialContext().lookup("java:module/XmlVersCache"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB singleton XMLContext " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB singleton XMLContext ", ex); - } - } - - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - rapportoVersBuilder = (RapportoVersBuilder) new InitialContext() - .lookup("java:module/RapportoVersBuilder"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB RapportoVersBuilder " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB RapportoVersBuilder ", ex); - } - } - + IndiceMM parsedIndice = null; + // percorso completo e verificato del container .ZIP + String zipFilePath = null; + // versamento.setDatiXmlIndice(sessione.getDatiPackInfoSipXml()); /* @@ -137,9 +112,9 @@ public void parseXML(SyncFakeSessn sessione) { * maniera errata (es. "ISO8859/1" oppure "utf8"), non rilevato dalla verifica precedente. */ if (rispostaWs.getSeverity() == SeverityEnum.OK) { - rispostaControlli = rapportoVersBuilder.canonicalizzaPackInfoSipXml(sessione); + RispostaControlli rispostaControlli = rapportoVersBuilder.canonicalizzaPackInfoSipXml(sessione); if (!rispostaControlli.isrBoolean()) { - setRispostaWsError(); + setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); myEsito.getEsitoXSD().setControlloStrutturaXML(rispostaControlli.getDsErr()); } @@ -178,7 +153,7 @@ public void parseXML(SyncFakeSessn sessione) { String prefissoPathPerApp = ""; if (rispostaWs.getSeverity() == SeverityEnum.OK) { log.debug("Carica root path "); - rispostaControlli = controlliMM.caricaRootPath(parsedIndice.getApplicativoChiamante(), + RispostaControlli rispostaControlli = controlliMM.caricaRootPath(parsedIndice.getApplicativoChiamante(), ControlliMM.TipiRootPath.In); if (rispostaControlli.isrBoolean()) { prefissoPathPerApp = rispostaControlli.getrString(); @@ -215,7 +190,7 @@ public void parseXML(SyncFakeSessn sessione) { if (rispostaWs.getSeverity() == SeverityEnum.OK) { log.debug("Verifica id duplicati "); versamento.setStrutturaIndiceMM(new StrutturaIndiceMM()); - versamento.getStrutturaIndiceMM().setComponenti(new HashMap()); + versamento.getStrutturaIndiceMM().setComponenti(new HashMap<>()); boolean trovatoDuplicati = false; HashMap tmpMap = versamento.getStrutturaIndiceMM().getComponenti(); @@ -246,7 +221,7 @@ public void parseXML(SyncFakeSessn sessione) { tmpMap.put(tmpComponente.getID(), tmpComponenteMM); // if (tmpComponente.getForzaFormato() != null) { - rispostaControlli = controlliSemantici + RispostaControlli rispostaControlli = controlliSemantici .checkFormatoFileStandard(tmpComponente.getForzaFormato().getFormatoStandard()); if (rispostaControlli.isrBoolean() == false) { // Componente Multimedia {0}: Il formato [{1}] non \u00e8 presente nel DB @@ -371,7 +346,7 @@ private boolean verificaPresenzaFileInZip(String zipPathName, String fileInZip) return tmpResult; } - private void setRispostaWsError() { + private void setRispostaWsError(RispostaWS rispostaWs, RispostaControlli rispostaControlli) { rispostaWs.setSeverity(SeverityEnum.ERROR); rispostaWs.setErrorCode(rispostaControlli.getCodErr()); rispostaWs.setErrorMessage(rispostaControlli.getDsErr()); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/ejb/VersamentoSyncMM.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/ejb/VersamentoSyncMM.java index 71f7021..d2663bc 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/ejb/VersamentoSyncMM.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoMM/ejb/VersamentoSyncMM.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -13,12 +30,12 @@ import it.eng.parer.ws.versamento.dto.SyncFakeSessn; import it.eng.parer.ws.versamento.ejb.VersamentoSyncBase; import it.eng.parer.ws.versamentoMM.dto.VersamentoMMExt; -import it.eng.parer.ws.versamentoMM.utils.AllineaFileComponenti; -import it.eng.parer.ws.versamentoMM.utils.IndiceMMPrsr; import it.eng.parer.ws.versamentoTpi.utils.FileServUtils; import it.eng.parer.ws.xml.versResp.EsitoVersamento; import java.io.File; import java.io.IOException; + +import javax.ejb.EJB; import javax.ejb.LocalBean; import javax.ejb.Stateless; import javax.ejb.TransactionManagement; @@ -39,6 +56,12 @@ public class VersamentoSyncMM extends VersamentoSyncBase { private static final Logger log = LoggerFactory.getLogger(VersamentoSyncMM.class); // + @EJB + IndiceMMPrsr tmpPrsr; + + @EJB + AllineaFileComponenti allineaFileComponenti; + public void parseXMLIndiceMM(SyncFakeSessn sessione, RispostaWS rispostaWs, VersamentoMMExt versamento) { log.debug("sono nel metodo parseXMLIndiceMM"); EsitoVersamento myEsito = rispostaWs.getIstanzaEsito(); @@ -51,8 +74,7 @@ public void parseXMLIndiceMM(SyncFakeSessn sessione, RispostaWS rispostaWs, Vers } try { - IndiceMMPrsr tmpPrsr = new IndiceMMPrsr(versamento, rispostaWs); - tmpPrsr.parseXML(sessione); + tmpPrsr.parseXML(sessione, versamento, rispostaWs); tmpAvanzamentoWs.resetFase(); } catch (Exception e) { rispostaWs.setSeverity(SeverityEnum.ERROR); @@ -79,8 +101,7 @@ public void verificaCoerenzaComponenti(RispostaWS rispostaWs, VersamentoMMExt ve } try { - AllineaFileComponenti tmpAllinea = new AllineaFileComponenti(versamento, rispostaWs, sessione); - tmpAllinea.verificaCoerenza(path); + allineaFileComponenti.verificaCoerenza(path, versamento, rispostaWs, sessione); tmpAvanzamentoWs.resetFase(); } catch (Exception e) { rispostaWs.setSeverity(SeverityEnum.ERROR); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoTpi/ejb/SalvataggioCompFS.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoTpi/ejb/SalvataggioCompFS.java index 3a1e69b..398b0bd 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoTpi/ejb/SalvataggioCompFS.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoTpi/ejb/SalvataggioCompFS.java @@ -1,24 +1,41 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamentoTpi.ejb; import it.eng.parer.entity.LogLockElab; import it.eng.parer.entity.VrsDtVers; import it.eng.parer.entity.VrsPathDtVers; -import it.eng.parer.exception.SacerWsException; import it.eng.parer.exception.ParerErrorCategory.SacerWsErrorCategory; +import it.eng.parer.exception.SacerWsException; +import it.eng.parer.util.Constants; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.MessaggiWSBundle; import it.eng.parer.ws.utils.MessaggiWSFormat; import it.eng.parer.ws.utils.WsXAUtil; import it.eng.parer.ws.versamento.dto.ComponenteVers; import it.eng.parer.ws.versamento.dto.StrutturaVersamento; -import java.io.File; -import java.math.BigDecimal; -import java.text.MessageFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.apache.commons.lang3.time.DateUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xadisk.connector.outbound.XADiskConnection; +import org.xadisk.connector.outbound.XADiskConnectionFactory; + import javax.annotation.Resource; import javax.ejb.LocalBean; import javax.ejb.Stateless; @@ -28,14 +45,14 @@ import javax.persistence.LockModeType; import javax.persistence.PersistenceContext; import javax.persistence.Query; -import org.apache.commons.lang3.exception.ExceptionUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.xadisk.connector.outbound.XADiskConnection; -import org.xadisk.connector.outbound.XADiskConnectionFactory; +import java.io.File; +import java.math.BigDecimal; +import java.text.MessageFormat; +import java.util.*; + import static it.eng.parer.util.DateUtilsConverter.convert; import static it.eng.parer.util.DateUtilsConverter.format; +import java.time.ZoneId; /** * @@ -63,6 +80,7 @@ public class SalvataggioCompFS { private static final String LOCKTYPE_LOCK_UNICO = "LOCK_UNICO"; private static final String ARK_STATUS_REGISTRATA = "REGISTRATA"; + @SuppressWarnings("unchecked") @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public RispostaControlli verificaDirTPIDataViaDb(StrutturaVersamento versamento, StatoCreaCartelle statoCreaCartelle, int numeroTentativi) { @@ -170,11 +188,7 @@ public RispostaControlli verificaDirTPIVersatoreViaDb(StrutturaVersamento versam Thread.sleep(ATTESA_RETRY_TEST_IN_MILLISECONDI); } } - if (recordPresente) { - statoCreaCartelle.setCreaCartellaVersatore(false); - } else { - statoCreaCartelle.setCreaCartellaVersatore(true); - } + statoCreaCartelle.setCreaCartellaVersatore(!recordPresente); rispostaControlli.setrLong(1); rispostaControlli.setrBoolean(true); } catch (Exception e) { @@ -257,9 +271,8 @@ public RispostaControlli generaDirDataTPIBlock(StrutturaVersamento versamento, lockRecord = (LogLockElab) query.getSingleResult(); // Map properties = new HashMap<>(); - properties.put("javax.persistence.lock.timeout", LOCK_LOCK_TIMEOUT_IN_SECONDI); - LogLockElab tmpLockElab = entityManager.find(LogLockElab.class, lockRecord.getIdLockElab(), - LockModeType.PESSIMISTIC_WRITE, properties); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, LOCK_LOCK_TIMEOUT_IN_SECONDI * 1000); + entityManager.find(LogLockElab.class, lockRecord.getIdLockElab(), LockModeType.PESSIMISTIC_WRITE, properties); // try { RispostaControlli rc = this.verificaDirTPIDataViaDb(versamento, statoCreaCartelle, 1); @@ -269,7 +282,10 @@ public RispostaControlli generaDirDataTPIBlock(StrutturaVersamento versamento, String testDir = MessageFormat.format("{0}/{1}", versamento.getTpiRootTpi(), versamento.getTpiRootArkVers()); vrsDtVers = new VrsDtVers(); - vrsDtVers.setDtVers(convert(versamento.getDataVersamento())); + // MAC#27269 + vrsDtVers.setDtVers(convert(versamento.getDataVersamento()).toInstant() + .atZone(ZoneId.systemDefault()).toLocalDate()); + // end MAC#27269 vrsDtVers.setTiStatoDtVers(ARK_STATUS_REGISTRATA); vrsDtVers.setFlMigraz("0"); vrsDtVers.setFlArk("0"); @@ -350,9 +366,8 @@ public RispostaControlli generaDirVersatoreTPIBlock(StrutturaVersamento versamen lockRecord = (LogLockElab) query.getSingleResult(); // Map properties = new HashMap<>(); - properties.put("javax.persistence.lock.timeout", LOCK_LOCK_TIMEOUT_IN_SECONDI); - LogLockElab tmpLockElab = entityManager.find(LogLockElab.class, lockRecord.getIdLockElab(), - LockModeType.PESSIMISTIC_WRITE, properties); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, LOCK_LOCK_TIMEOUT_IN_SECONDI * 1000); + entityManager.find(LogLockElab.class, lockRecord.getIdLockElab(), LockModeType.PESSIMISTIC_WRITE, properties); // try { RispostaControlli rc = this.verificaDirTPIVersatoreViaDb(versamento, statoCreaCartelle, 1); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoTpi/ejb/StatoCreaCartelle.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoTpi/ejb/StatoCreaCartelle.java index d15398d..5d00e6e 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoTpi/ejb/StatoCreaCartelle.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoTpi/ejb/StatoCreaCartelle.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoTpi/utils/FileServUtils.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoTpi/utils/FileServUtils.java index f44731d..c931e8b 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoTpi/utils/FileServUtils.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoTpi/utils/FileServUtils.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/CompRapportoUpdVers.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/CompRapportoUpdVers.java index d5d555e..9827d2e 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/CompRapportoUpdVers.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/CompRapportoUpdVers.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/ControlloEseguito.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/ControlloEseguito.java index b96e998..03f3f7f 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/ControlloEseguito.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/ControlloEseguito.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -16,6 +33,8 @@ */ public class ControlloEseguito implements java.io.Serializable { + private static final long serialVersionUID = 1L; + // stabilito un "ordine" per famiglia a livello di codice // TODO : farlo su DB?! public enum FamigliaControllo { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/ControlloWSResp.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/ControlloWSResp.java index 76f7504..aa77ba0 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/ControlloWSResp.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/ControlloWSResp.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -10,6 +27,7 @@ public class ControlloWSResp implements Serializable { + private static final long serialVersionUID = 1L; private String cdCategoria; private String cdFamiglia; private String dsControllo; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/DatiSpecLinkOsKeyMap.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/DatiSpecLinkOsKeyMap.java new file mode 100644 index 0000000..96fb751 --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/DatiSpecLinkOsKeyMap.java @@ -0,0 +1,89 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package it.eng.parer.ws.versamentoUpd.dto; + +import java.io.Serializable; +import java.util.Objects; + +/** + * + * @author DiLorenzo_F + */ +public class DatiSpecLinkOsKeyMap implements Serializable { + + private static final long serialVersionUID = 4124405579586404634L; + + private Long idEntitySacer; + private String tipiEntitaSacer; + + public DatiSpecLinkOsKeyMap(Long idEntitySacer, String tipiEntitaSacer) { + this.idEntitySacer = idEntitySacer; + this.tipiEntitaSacer = tipiEntitaSacer; + } + + public Long getIdEntitySacer() { + return idEntitySacer; + } + + public void setIdEntitySacer(Long idEntitySacer) { + this.idEntitySacer = idEntitySacer; + } + + public String getTipiEntitaSacer() { + return tipiEntitaSacer; + } + + public void setTipiEntitaSacer(String tipiEntitaSacer) { + this.tipiEntitaSacer = tipiEntitaSacer; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 67 * hash + Objects.hashCode(this.idEntitySacer); + hash = 67 * hash + Objects.hashCode(this.tipiEntitaSacer); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final DatiSpecLinkOsKeyMap other = (DatiSpecLinkOsKeyMap) obj; + if (!Objects.equals(this.tipiEntitaSacer, other.tipiEntitaSacer)) { + return false; + } + if (!Objects.equals(this.idEntitySacer, other.idEntitySacer)) { + return false; + } + return true; + } + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/FlControlliUpd.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/FlControlliUpd.java index 9846e57..4eb5f74 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/FlControlliUpd.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/FlControlliUpd.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/RispostaWSUpdVers.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/RispostaWSUpdVers.java index e1222c5..f581006 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/RispostaWSUpdVers.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/RispostaWSUpdVers.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamentoUpd.dto; import it.eng.parer.ws.utils.AvanzamentoWs; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/StrutturaUpdVers.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/StrutturaUpdVers.java index 1e58f1f..b04b087 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/StrutturaUpdVers.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/StrutturaUpdVers.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,24 +22,26 @@ */ package it.eng.parer.ws.versamentoUpd.dto; -import it.eng.parer.entity.constraint.AroUpdUnitaDoc.AroUpdUDTiStatoUpdElencoVers; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; +import java.util.Map; +import it.eng.parer.entity.constraint.AroUpdUnitaDoc.AroUpdUDTiStatoUpdElencoVers; import it.eng.parer.ws.dto.CSChiave; import it.eng.parer.ws.dto.CSVersatore; import it.eng.parer.ws.utils.CostantiDB; import it.eng.parer.ws.utils.CostantiDB.TipoSalvataggioFile; import it.eng.parer.ws.versamento.dto.DatoSpecifico; import it.eng.parer.ws.versamento.dto.IDatiSpecEntity; +import it.eng.parer.ws.versamento.dto.IProfiloEntity; /** * * @author sinatti_s */ -public class StrutturaUpdVers implements java.io.Serializable, IDatiSpecEntity { +public class StrutturaUpdVers implements java.io.Serializable, IDatiSpecEntity, IProfiloEntity { /** * @@ -37,7 +56,7 @@ public class StrutturaUpdVers implements java.io.Serializable, IDatiSpecEntity { private String descTipologiaUnitaDocumentariaNonVerificata; private String descTipoDocPrincipaleNonVerificato; private String descTipologiaUnitaDocumentaria; - private String descTipologiaUnitaDocumentariaUnknown;; + private String descTipologiaUnitaDocumentariaUnknown; private String urnPartChiaveUd; private String urnPartVersatore; private String cdKeyNormalized; @@ -64,20 +83,21 @@ public class StrutturaUpdVers implements java.io.Serializable, IDatiSpecEntity { private long idTipologiaUnitaDocumentaria; private long idTipoDocPrincipale; private long idRecXsdDatiSpec; + private Long idRecUsoXsdProfiloNormativo; + private String datiC14NProfNormXml; private long idRecXsdDatiSpecMigrazione; private long idRecAggiornamentoDB; - private HashMap datiSpecifici; - private HashMap datiSpecificiMigrazione; - private HashMap componentiAttesi; - private HashMap sottoComponentiAttesi; + private Map datiSpecifici; + private Map datiSpecificiMigrazione; + private Map componentiAttesi = new HashMap<>(0); + private Map sottoComponentiAttesi; // private List documentiAttesi; private List unitaDocCollegate; private boolean versatoreVerificato = false; // - // private boolean trovatiIdCompDuplicati; private boolean trovatiIdDocDuplicati; // Nota : solo in presenza di documento e quindi del tag mi aspetto di @@ -113,12 +133,12 @@ public void setIdRecXsdDatiSpec(long idRecXsdDatiSpec) { } @Override - public HashMap getDatiSpecifici() { + public Map getDatiSpecifici() { return this.datiSpecifici; } @Override - public void setDatiSpecifici(HashMap datiSpecifici) { + public void setDatiSpecifici(Map datiSpecifici) { this.datiSpecifici = datiSpecifici; } @@ -141,12 +161,12 @@ public void setIdRecAggiornamentoDB(long idRecAggiornamentoDB) { } @Override - public HashMap getDatiSpecificiMigrazione() { + public Map getDatiSpecificiMigrazione() { return this.datiSpecificiMigrazione; } @Override - public void setDatiSpecificiMigrazione(HashMap datiSpecificiMigrazione) { + public void setDatiSpecificiMigrazione(Map datiSpecificiMigrazione) { this.datiSpecificiMigrazione = datiSpecificiMigrazione; } @@ -240,7 +260,7 @@ public void setDescTipologiaUnitaDocumentariaNonVerificata(String descTipologiaU public List getUnitaDocCollegate() { if (unitaDocCollegate == null) { - unitaDocCollegate = new ArrayList(0); + unitaDocCollegate = new ArrayList<>(0); } return unitaDocCollegate; } @@ -251,7 +271,7 @@ public void setUnitaDocCollegate(List unitaDocCollegate) { public List getDocumentiAttesi() { if (documentiAttesi == null) { - documentiAttesi = new ArrayList(0); + documentiAttesi = new ArrayList<>(0); } return documentiAttesi; } @@ -260,33 +280,28 @@ public void setDocumentiAttesi(List documentiAttesi) { this.documentiAttesi = documentiAttesi; } - public HashMap getComponentiAttesi() { + public Map getComponentiAttesi() { if (componentiAttesi == null) { - componentiAttesi = new HashMap(0); + componentiAttesi = new HashMap<>(0); } return componentiAttesi; } - public void setComponentiAttesi(HashMap sottoComponentiAttesi) { + public void setComponentiAttesi(Map sottoComponentiAttesi) { this.componentiAttesi = sottoComponentiAttesi; } - public HashMap getSottoComponentiAttesi() { + public Map getSottoComponentiAttesi() { if (sottoComponentiAttesi == null) { - sottoComponentiAttesi = new HashMap(0); + sottoComponentiAttesi = new HashMap<>(0); } return componentiAttesi; } - public void setSottoComponentiAttesi(HashMap sottoComponentiAttesi) { + public void setSottoComponentiAttesi(Map sottoComponentiAttesi) { this.sottoComponentiAttesi = sottoComponentiAttesi; } - /* - * public boolean isTrovatiIdCompDuplicati() { return trovatiIdCompDuplicati; } public void - * setTrovatiIdCompDuplicati(boolean trovatiIdCompDuplicati) { this.trovatiIdCompDuplicati = trovatiIdCompDuplicati; - * } - */ public boolean isTrovatiIdDocDuplicati() { return trovatiIdDocDuplicati; } @@ -534,4 +549,24 @@ public Date getDtInizioCalcoloNewUrn() { public void setDtInizioCalcoloNewUrn(Date dtInizioCalcoloNewUrn) { this.dtInizioCalcoloNewUrn = dtInizioCalcoloNewUrn; } + + @Override + public String getDatiC14NProfNormXml() { + return datiC14NProfNormXml; + } + + @Override + public void setDatiC14NProfNormXml(String datiC14NProfNormXml) { + this.datiC14NProfNormXml = datiC14NProfNormXml; + } + + @Override + public Long getIdRecUsoXsdProfiloNormativo() { + return idRecUsoXsdProfiloNormativo; + } + + @Override + public void setIdRecUsoXsdProfiloNormativo(Long idRecUsoXsdProfiloNormativo) { + this.idRecUsoXsdProfiloNormativo = idRecUsoXsdProfiloNormativo; + } } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdComponenteVers.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdComponenteVers.java index f425d91..cb26d48 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdComponenteVers.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdComponenteVers.java @@ -1,14 +1,31 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamentoUpd.dto; import it.eng.parer.ws.versamento.dto.ComponenteVers; -import it.eng.parer.ws.versamento.dto.IDatiSpecEntity; /** * * @author sinatti_s */ -public class UpdComponenteVers extends ComponenteVers implements java.io.Serializable, IDatiSpecEntity { +public class UpdComponenteVers extends ComponenteVers { + private static final long serialVersionUID = 1L; private it.eng.parer.ws.xml.versUpdReq.ComponenteType myUpdComponente; private it.eng.parer.ws.xml.versUpdReq.SottoComponenteType myUpdSottoComponente; private UpdDocumentoVers rifAggDocumentoVers; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdDocumentoVers.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdDocumentoVers.java index bd2d604..1b4362c 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdDocumentoVers.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdDocumentoVers.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -6,16 +23,16 @@ import java.util.HashMap; import java.util.List; +import java.util.Map; import it.eng.parer.ws.versamento.dto.DatoSpecifico; import it.eng.parer.ws.versamento.dto.DocumentoVers; -import it.eng.parer.ws.versamento.dto.IDatiSpecEntity; /** * * @author sinatti_s */ -public class UpdDocumentoVers extends DocumentoVers implements java.io.Serializable, IDatiSpecEntity { +public class UpdDocumentoVers extends DocumentoVers { /** * @@ -98,7 +115,7 @@ public void setCatDocNonverificato(String catDocNonverificato) { } @Override - public HashMap getDatiSpecifici() { + public Map getDatiSpecifici() { if (super.getDatiSpecifici() == null) { super.datiSpecifici = new HashMap(); } @@ -106,7 +123,7 @@ public HashMap getDatiSpecifici() { } @Override - public HashMap getDatiSpecificiMigrazione() { + public Map getDatiSpecificiMigrazione() { if (super.getDatiSpecificiMigrazione() == null) { super.datiSpecificiMigrazione = new HashMap(); } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdFascPrincipale.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdFascPrincipale.java index 2c39d9e..16bca0f 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdFascPrincipale.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdFascPrincipale.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdUnitaDocColl.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdUnitaDocColl.java index cd9fad7..63afdfa 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdUnitaDocColl.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/dto/UpdUnitaDocColl.java @@ -1,22 +1,39 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.eng.parer.ws.versamentoUpd.dto; -import it.eng.parer.ws.versamento.dto.UnitaDocColl; -import it.eng.parer.ws.xml.versUpdReq.ChiaveType; - -import java.io.Serializable; import java.util.LinkedHashSet; import java.util.Set; + import org.apache.commons.lang3.StringUtils; +import it.eng.parer.ws.versamento.dto.UnitaDocColl; +import it.eng.parer.ws.xml.versUpdReq.ChiaveType; + /** * * @author sinatti_s */ -public class UpdUnitaDocColl extends UnitaDocColl implements Serializable { +public class UpdUnitaDocColl extends UnitaDocColl { /** * diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/AggiornamentoVersamentoSync.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/AggiornamentoVersamentoSync.java index 0275130..54292dd 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/AggiornamentoVersamentoSync.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/AggiornamentoVersamentoSync.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -40,8 +57,8 @@ import it.eng.parer.ws.versamentoUpd.dto.ControlloEseguito; import it.eng.parer.ws.versamentoUpd.dto.ControlloWSResp; import it.eng.parer.ws.versamentoUpd.dto.RispostaWSUpdVers; +import it.eng.parer.ws.versamentoUpd.ejb.prs.UpdVersamentoPrsr; import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; -import it.eng.parer.ws.versamentoUpd.prsr.UpdVersamentoPrsr; import it.eng.parer.ws.versamentoUpd.utils.UpdDocumentiUtils; import it.eng.parer.ws.xml.versUpdResp.CodiceEsitoType; import it.eng.parer.ws.xml.versUpdResp.ComponenteType; @@ -65,24 +82,27 @@ public class AggiornamentoVersamentoSync { // - protected static final Logger logger = LoggerFactory.getLogger(AggiornamentoVersamentoSync.class); + private static final Logger logger = LoggerFactory.getLogger(AggiornamentoVersamentoSync.class); @EJB - protected ControlliWS myControlliWs; + private ControlliWS myControlliWs; @EJB - protected ControlliWSHelper controlliWSHelper; + private ControlliWSHelper controlliWSHelper; @EJB - protected ControlliSemantici controlliSemantici; + private ControlliSemantici controlliSemantici; @EJB - protected SalvataggioUpdVersamento salvataggioUpdVersamento; + private SalvataggioUpdVersamento salvataggioUpdVersamento; @EJB - protected RecupSessDubbieUpdVersamento updRecupSessDubbie; + private RecupSessDubbieUpdVersamento updRecupSessDubbie; @EJB - protected LogSessioneUpdVersamento updLogSessione; + private LogSessioneUpdVersamento updLogSessione; + + @EJB + private UpdVersamentoPrsr updVersamentoPrsr; public void init(RispostaWSUpdVers rispostaWs, AvanzamentoWs avanzamento, UpdVersamentoExt versamento) { logger.debug("sono nel metodo init"); @@ -150,6 +170,7 @@ public void init(RispostaWSUpdVers rispostaWs, AvanzamentoWs avanzamento, UpdVer } } + @SuppressWarnings("unchecked") protected RispostaControlli caricaXmlDefault(UpdVersamentoExt versamento) { RispostaControlli rispostaControlli = controlliSemantici .caricaDefaultDaDB(ParametroApplDB.TipoParametroAppl.VERSAMENTO_DEFAULT); @@ -159,6 +180,7 @@ protected RispostaControlli caricaXmlDefault(UpdVersamentoExt versamento) { return rispostaControlli; } + @SuppressWarnings("unchecked") protected RispostaControlli loadWsVersions(UpdVersamentoExt versamento) { RispostaControlli rs = myControlliWs.loadWsVersions(versamento.getDescrizione()); // if positive ... @@ -194,7 +216,7 @@ public void verificaVersione(String versione, RispostaWSUpdVers rispostaWs, UpdV rispostaWs.setStatoSessioneVersamento(IRispostaWS.StatiSessioneVersEnum.DUBBIA); } else { // imposto la versione dell'xml di versamento in via provvisioria al valore del - // ws; + // ws // se riuscirò a leggere l'XML imposterò il valore effettivo versamento.getStrutturaUpdVers().setVersioneIndiceSipNonVerificata(versione); versamento.checkVersioneRequest(versione); @@ -209,7 +231,7 @@ public void verificaVersione(String versione, RispostaWSUpdVers rispostaWs, UpdV public void verificaCredenziali(String loginName, String password, String indirizzoIp, RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento) { logger.debug("sono nel metodo verificaCredenziali"); - CompRapportoUpdVers myEsito = rispostaWs.getCompRapportoUpdVers(); + rispostaWs.getCompRapportoUpdVers(); User tmpUser = null; RispostaControlli tmpRispostaControlli = myControlliWs.checkCredenziali(loginName, password, indirizzoIp, TipiWSPerControlli.AGGIORNAMENTO_VERSAMENTO); @@ -242,7 +264,7 @@ public void verificaCredenziali(String loginName, String password, String indiri public void parseXML(SyncFakeSessn sessione, RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento) { logger.debug("sono nel metodo parseXML"); - CompRapportoUpdVers myEsito = rispostaWs.getCompRapportoUpdVers(); + rispostaWs.getCompRapportoUpdVers(); AvanzamentoWs tmpAvanzamentoWs = rispostaWs.getAvanzamento(); if (versamento.getUtente() == null) { @@ -252,8 +274,7 @@ public void parseXML(SyncFakeSessn sessione, RispostaWSUpdVers rispostaWs, UpdVe } try { - UpdVersamentoPrsr tmpPrsr = new UpdVersamentoPrsr(versamento, rispostaWs); - tmpPrsr.parseXML(sessione); + updVersamentoPrsr.parseXML(sessione, versamento, rispostaWs); tmpAvanzamentoWs.resetFase(); } catch (Exception e) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/ControlliUpdVersamento.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/ControlliUpdVersamento.java index 14127ef..6ebcc34 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/ControlliUpdVersamento.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/ControlliUpdVersamento.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,6 +22,9 @@ */ package it.eng.parer.ws.versamentoUpd.ejb; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; import java.math.BigDecimal; import java.util.Arrays; import java.util.Date; @@ -17,11 +37,23 @@ import javax.ejb.TransactionAttributeType; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; -import javax.persistence.Query; +import javax.xml.XMLConstants; +import javax.xml.bind.JAXBElement; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.w3c.dom.Node; +import org.xml.sax.SAXException; import it.eng.parer.entity.AroCompDoc; import it.eng.parer.entity.AroDoc; @@ -30,42 +62,50 @@ import it.eng.parer.entity.DecTipoUnitaDoc; import it.eng.parer.entity.IamAbilTipoDato; import it.eng.parer.entity.OrgStrut; +import it.eng.parer.entity.VrsXmlModelloSessioneVers; import it.eng.parer.entity.constraint.AroXmlUpdUnitaDoc.TiXmlUpdUnitaDoc; +import it.eng.parer.entity.constraint.DecModelloXsdUd; +import it.eng.parer.exception.SacerWsException; import it.eng.parer.util.ejb.help.ConfigurationHelper; -import it.eng.parer.viewEntity.OrgVChkPartitionUpdByAa; import it.eng.parer.ws.dto.CSChiave; import it.eng.parer.ws.dto.RispostaControlli; -import it.eng.parer.ws.ejb.ControlliSemantici; import it.eng.parer.ws.ejb.ControlliSemantici.TipiGestioneUDAnnullate; +import it.eng.parer.ws.utils.CostantiDB; import it.eng.parer.ws.utils.CostantiDB.StatoConservazioneUnitaDoc; import it.eng.parer.ws.utils.CostantiDB.TipiHash; import it.eng.parer.ws.utils.HashCalculator; import it.eng.parer.ws.utils.MessaggiWSBundle; import it.eng.parer.ws.utils.MessaggiWSFormat; import it.eng.parer.ws.utils.ParametroApplDB.ParametroApplFl; +import it.eng.parer.ws.utils.XmlUtils; +import it.eng.parer.ws.versamento.ejb.ControlliProfiliUd; import it.eng.parer.ws.versamentoUpd.dto.FlControlliUpd; import it.eng.parer.ws.versamentoUpd.dto.UpdFascPrincipale; import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; -import it.eng.parer.ws.versamentoUpd.utils.UpdCostanti.StrutAaPartion; import it.eng.parer.ws.xml.versUpdReq.CamiciaFascicoloType; +import javax.persistence.TypedQuery; +import it.eng.parer.ws.xml.versUpdReq.ProfiloNormativoType; + +import static it.eng.parer.ws.utils.CostantiDB.TiStatoSesioneVers.CHIUSA_OK; /** * * @author sinatti_s */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "ControlliUpdVersamento") @LocalBean @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) public class ControlliUpdVersamento { private static final Logger log = LoggerFactory.getLogger(ControlliUpdVersamento.class); + private static final String ERRORE_TABELLA_DECODIFICA = "Eccezione nella lettura della tabella di decodifica "; @PersistenceContext(unitName = "ParerJPA") private EntityManager entityManager; @EJB - private ControlliSemantici controlliSemantici; - + private ControlliProfiliUd controlliProfiliUd; @EJB private ConfigurationHelper configurationHelper; @@ -73,9 +113,9 @@ public RispostaControlli checkUltimoSIPWithHashBinary(String descKey, long idUni RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); rispostaControlli.setrBoolean(true);// default il controllo passa a meno che il calcolo su SIP non dica il - // contrario ... + // contrario ... - List aroXmlUpdUnitaDocs = null; + List aroXmlUpdUnitaDocs; try { String queryStr = "select t from AroXmlUpdUnitaDoc t " @@ -90,25 +130,25 @@ public RispostaControlli checkUltimoSIPWithHashBinary(String descKey, long idUni // l'ultimo // aggiornamento // registrato - javax.persistence.Query query = entityManager.createQuery(queryStr, AroXmlUpdUnitaDoc.class); + TypedQuery query = entityManager.createQuery(queryStr, AroXmlUpdUnitaDoc.class); query.setParameter("idUnitaDoc", idUnitaDoc); query.setParameter("tiXmlUpdUnitaDoc", TiXmlUpdUnitaDoc.RICHIESTA); aroXmlUpdUnitaDocs = query.getResultList(); - if (aroXmlUpdUnitaDocs.size() >= 1) { + if (!aroXmlUpdUnitaDocs.isEmpty()) { // se trovato, recupero il risultato che interessa per la verifica AroXmlUpdUnitaDoc last = aroXmlUpdUnitaDocs.get(0); // SIP hex binary - String SIPhexBinary = new HashCalculator().calculateHashSHAX(sipXml, TipiHash.SHA_256).toHexBinary(); + String sipHexBinary = new HashCalculator().calculateHashSHAX(sipXml, TipiHash.SHA_256).toHexBinary(); // se stesso hash calcolato .... - if (last.getDsHashXml().equals(SIPhexBinary)) { + if (last.getDsHashXml().equals(sipHexBinary)) { rispostaControlli.setCodErr(MessaggiWSBundle.UD_015_002); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.UD_015_002, descKey)); rispostaControlli.setrBoolean(false); } else { - rispostaControlli.setrString(SIPhexBinary); + rispostaControlli.setrString(sipHexBinary); rispostaControlli.setrBoolean(true); } } @@ -133,15 +173,16 @@ public RispostaControlli checkTipoUDRegIamUserOrganizzazione(CSChiave csChiave, try { - List ids = Arrays.asList(idTipologiaUnitaDocumentaria, idRegistro); + List ids = Arrays.asList(new BigDecimal(idTipologiaUnitaDocumentaria), + new BigDecimal(idRegistro)); String queryStr = "select t from IamAbilTipoDato t " + "where t.iamAbilOrganiz.iamUser.idUserIam = :idUserIam " + "and t.iamAbilOrganiz.idOrganizApplic = :idOrganizApplic " + "and t.idTipoDatoApplic in :idTipoDato " + "and t.nmClasseTipoDato in ('TIPO_UNITA_DOC','REGISTRO') "; - javax.persistence.Query query = entityManager.createQuery(queryStr, IamAbilTipoDato.class); - query.setParameter("idOrganizApplic", idStruttura); + TypedQuery query = entityManager.createQuery(queryStr, IamAbilTipoDato.class); + query.setParameter("idOrganizApplic", new BigDecimal(idStruttura)); query.setParameter("idUserIam", idUser); query.setParameter("idTipoDato", ids); @@ -161,7 +202,7 @@ public RispostaControlli checkTipoUDRegIamUserOrganizzazione(CSChiave csChiave, rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliUpdVersamento.checkTipoUDRegIamUserOrganizzazione: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error(ERRORE_TABELLA_DECODIFICA, e); } return rispostaControlli; @@ -192,26 +233,19 @@ public RispostaControlli getUpdFlagsFromTipoUDOrgStrut(long idTipoUD, Boolean is return rispostaControlli;// errore non previsto ! } - String flAbilitaUpdMeta = null, flAccettaUpdMetaInark = null, flForzaUpdMetaInark = null; - - // fl (possono essere nulli -> recepisco quelli dell'organizzazione) - // flAbilitaUpdMeta = StringUtils.isNotBlank(decTipoUnitaDoc.getFlAbilitaUpdMeta()) - // ? decTipoUnitaDoc.getFlAbilitaUpdMeta() - // : orgStrut.getFlAbilitaUpdMeta(); - // flAccettaUpdMetaInark = StringUtils.isNotBlank(decTipoUnitaDoc.getFlAccettaUpdMetaInark()) - // ? decTipoUnitaDoc.getFlAccettaUpdMetaInark() - // : orgStrut.getFlAccettaUpdMetaInark(); - // flForzaUpdMetaInark = StringUtils.isNotBlank(decTipoUnitaDoc.getFlForzaUpdMetaInark()) - // ? decTipoUnitaDoc.getFlForzaUpdMetaInark() - // : orgStrut.getFlForzaUpdMetaInark(); + String flAbilitaUpdMeta; + String flAccettaUpdMetaInark; + String flForzaUpdMetaInark; // from PigParamApplic - flAbilitaUpdMeta = configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_ABILITA_UPD_META, - orgStrut.getIdStrut(), orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idTipoUD); - flAccettaUpdMetaInark = configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_ACCETTA_UPD_META_INARK, - orgStrut.getIdStrut(), orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idTipoUD); - flForzaUpdMetaInark = configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_FORZA_UPD_META_INARK, + flAbilitaUpdMeta = configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_ABILITA_UPD_META, orgStrut.getIdStrut(), orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idTipoUD); + flAccettaUpdMetaInark = configurationHelper.getValoreParamApplicByTipoUdAsFl( + ParametroApplFl.FL_ACCETTA_UPD_META_INARK, orgStrut.getIdStrut(), + orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idTipoUD); + flForzaUpdMetaInark = configurationHelper.getValoreParamApplicByTipoUdAsFl( + ParametroApplFl.FL_FORZA_UPD_META_INARK, orgStrut.getIdStrut(), + orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idTipoUD); // costruzione oggetto FlControlliUpd flControlliUpd = new FlControlliUpd(); @@ -219,16 +253,16 @@ public RispostaControlli getUpdFlagsFromTipoUDOrgStrut(long idTipoUD, Boolean is flControlliUpd.setFlAbilitaUpdMeta("1".equalsIgnoreCase(flAbilitaUpdMeta)); flControlliUpd.setFlAccettaUpdMetaInark("1".equalsIgnoreCase(flAccettaUpdMetaInark)); if (isForzaAggiornamento != null) { - flControlliUpd.setFlForzaUpdMetaInark(isForzaAggiornamento.booleanValue()); + flControlliUpd.setFlForzaUpdMetaInark(isForzaAggiornamento); } else { flControlliUpd.setFlForzaUpdMetaInark("1".equalsIgnoreCase(flForzaUpdMetaInark)); } // flControlliUpd.setFlProfiloUdObbOggetto( - "1".equals(configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_OBBL_OGGETTO, + "1".equals(configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_OBBL_OGGETTO, orgStrut.getIdStrut(), orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idTipoUD))); flControlliUpd.setFlProfiloUdObbData( - "1".equals(configurationHelper.getParamApplicValueAsFl(ParametroApplFl.FL_OBBL_DATA, + "1".equals(configurationHelper.getValoreParamApplicByTipoUdAsFl(ParametroApplFl.FL_OBBL_DATA, orgStrut.getIdStrut(), orgStrut.getOrgEnte().getOrgAmbiente().getIdAmbiente(), idTipoUD))); rispostaControlli.setrObject(flControlliUpd); @@ -237,8 +271,7 @@ public RispostaControlli getUpdFlagsFromTipoUDOrgStrut(long idTipoUD, Boolean is return rispostaControlli; } - public RispostaControlli checkIdDocumentoInUD(long idUnitaDoc, String idDocumento, String tipoEntita, - String tipoDocumento, String descChiaveDoc) { + public RispostaControlli checkIdDocumentoInUD(long idUnitaDoc, String idDocumento, String descChiaveDoc) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); rispostaControlli.setrBoolean(false); @@ -281,17 +314,17 @@ public RispostaControlli checkTipoDocRegIamUserOrganizzazione(String tipoDocumen rispostaControlli = new RispostaControlli(); rispostaControlli.setrBoolean(false); - List iamAbilTipoDatos = null; + List iamAbilTipoDatos; try { String queryStr = "select t from IamAbilTipoDato t " + "where t.iamAbilOrganiz.iamUser.idUserIam = :idUserIam " + "and t.iamAbilOrganiz.idOrganizApplic = :idOrganizApplic " + "and t.idTipoDatoApplic = :idTipoDocumento " + "and t.nmClasseTipoDato = 'TIPO_DOC' "; - javax.persistence.Query query = entityManager.createQuery(queryStr, IamAbilTipoDato.class); - query.setParameter("idOrganizApplic", idStruttura); + TypedQuery query = entityManager.createQuery(queryStr, IamAbilTipoDato.class); + query.setParameter("idOrganizApplic", new BigDecimal(idStruttura)); query.setParameter("idUserIam", idUser); - query.setParameter("idTipoDocumento", idTipoDocumento); + query.setParameter("idTipoDocumento", new BigDecimal(idTipoDocumento)); iamAbilTipoDatos = query.getResultList(); @@ -307,7 +340,7 @@ public RispostaControlli checkTipoDocRegIamUserOrganizzazione(String tipoDocumen rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliUpdVersamento.checkTipoDocRegIamUserOrganizzazione: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error(ERRORE_TABELLA_DECODIFICA, e); } return rispostaControlli; @@ -323,7 +356,7 @@ public RispostaControlli checkIdComponenteInDoc(long idDocIn, int progressivo, S try { String queryStr = "select t from AroCompDoc t " + "where t.aroStrutDoc.aroDoc.idDoc = :idDocIn " + "and t.niOrdCompDoc = :niOrdCompDocIn "; - javax.persistence.Query query = entityManager.createQuery(queryStr); + TypedQuery query = entityManager.createQuery(queryStr, AroCompDoc.class); query.setParameter("idDocIn", idDocIn); query.setParameter("niOrdCompDocIn", new BigDecimal(progressivo)); @@ -403,7 +436,7 @@ private RispostaControlli getAroCompDocById(long idAroCompDoc) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliFascicoli.getAroCompDocById: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica " + e); + log.error("Eccezione nella lettura della tabella di decodifica", e); } return rispostaControlli; } @@ -428,7 +461,7 @@ private RispostaControlli getDecTipoUnitaDocById(long idTipoUD) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliFascicoli.getDecTipoUnitaDocById: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica " + e); + log.error("Eccezione nella lettura della tabella di decodifica", e); } return rispostaControlli; } @@ -464,7 +497,7 @@ private RispostaControlli getFascicoloPrincipale(long idUd) { rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliUpdVersamento.getFascicoloPrincipale: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella " + e); + log.error("Eccezione nella lettura della tabella ", e); } return rispostaControlli; } @@ -504,7 +537,7 @@ public RispostaControlli checkFascicoliSecondari(UpdVersamentoExt versamento) { tmpArrP[4] = updFascPrincipale.getSottoOggetto(); } - List tmpListP = Arrays.asList(tmpArrP); + List tmpListP = Arrays.asList(tmpArrP); // verifica i fascicoli/sottofascicoli // rispetto il principale for (CamiciaFascicoloType fascicolo : versamento.getVersamento().getUnitaDocumentaria().getProfiloArchivistico() @@ -525,7 +558,7 @@ public RispostaControlli checkFascicoliSecondari(UpdVersamentoExt versamento) { if (fascicolo.getSottoFascicolo() != null && fascicolo.getSottoFascicolo().getOggetto() != null) { tmpArr[4] = fascicolo.getSottoFascicolo().getOggetto(); } - List tmpList = Arrays.asList(tmpArr); + List tmpList = Arrays.asList(tmpArr); if (tmpListP.equals(tmpList)) { // se il fascicolo è uguale al principale, // restituisco errore @@ -540,104 +573,6 @@ public RispostaControlli checkFascicoliSecondari(UpdVersamentoExt versamento) { return rispostaControlli; } - public RispostaControlli checkPartizioniStruttuaByAA(String descKey, long idStruttura, long anno) { - RispostaControlli rispostaControlli; - rispostaControlli = new RispostaControlli(); - rispostaControlli.setrBoolean(false); - StringBuilder sb = new StringBuilder(); - - List ovcspupd = null; - try { - String queryStr = "select t from OrgVChkPartitionUpdByAa t " + "where t.idStrut = :idStrutIn " - + "and t.anno = :annoIn "; - - javax.persistence.Query query = entityManager.createQuery(queryStr, OrgVChkPartitionUpdByAa.class); - query.setParameter("idStrutIn", new BigDecimal(idStruttura)); - query.setParameter("annoIn", new BigDecimal(anno)); - - // - ovcspupd = query.getResultList(); - - if (ovcspupd.size() == 1) { - // trovata la struttura, vediamo se è tutta ben partizionata. - // se ci sono problemi il versamento è sempre e comunque errato - if (ovcspupd.get(0).getFlPartVersinidatispecAaOk().equals("1") - && ovcspupd.get(0).getFlPartVersinidatispecOk().equals("1") - && ovcspupd.get(0).getFlPartUpddatispecAaOk().equals("1") - && ovcspupd.get(0).getFlPartUpddatispecOk().equals("1") - && ovcspupd.get(0).getFlPartXmlupdOk().equals("1") - && ovcspupd.get(0).getFlPartXmlupdAaOk().equals("1") - && ovcspupd.get(0).getFlPartUpdkoAaOk().equals("1") - && ovcspupd.get(0).getFlPartUpdkoOk().equals("1") - && ovcspupd.get(0).getFlPartSesupdkoAaOk().equals("1") - && ovcspupd.get(0).getFlPartSesupdkoOk().equals("1") - && ovcspupd.get(0).getFlPartXmlsesupdkoOk().equals("1") - && ovcspupd.get(0).getFlPartXmlsesupdkpAaOk().equals("1")) { - - rispostaControlli.setrBoolean(true); - - } else { - // recupero i flag settati a 0 e li concateno per inserirli nel messaggio di - // errore - if (ovcspupd.get(0).getFlPartVersinidatispecOk().equals("0") - || ovcspupd.get(0).getFlPartVersinidatispecAaOk().equals("0")) { - sb.append(StrutAaPartion.VERSINIDATISPEC.getPartitionName()); - } - if (ovcspupd.get(0).getFlPartUpddatispecAaOk().equals("0") - || ovcspupd.get(0).getFlPartUpddatispecOk().equals("0")) { - if (sb.length() > 0) { - sb.append(", "); - } - sb.append(StrutAaPartion.UPDDATISPECUNITADOC.getPartitionName()); - } - if (ovcspupd.get(0).getFlPartUpdkoOk().equals("0") - || ovcspupd.get(0).getFlPartUpdkoAaOk().equals("0")) { - if (sb.length() > 0) { - sb.append(", "); - } - sb.append(StrutAaPartion.UPDUNITADOCKO.getPartitionName()); - } - if (ovcspupd.get(0).getFlPartXmlsesupdkoOk().equals("0") - || ovcspupd.get(0).getFlPartXmlsesupdkpAaOk().equals("0")) { - if (sb.length() > 0) { - sb.append(", "); - } - sb.append(StrutAaPartion.XMLSESUPDUNITADOCKO.getPartitionName()); - } - if (ovcspupd.get(0).getFlPartXmlupdOk().equals("0") - || ovcspupd.get(0).getFlPartXmlupdAaOk().equals("0")) { - if (sb.length() > 0) { - sb.append(", "); - } - sb.append(StrutAaPartion.XMLUPDUNITADOC.getPartitionName()); - } - if (ovcspupd.get(0).getFlPartSesupdkoAaOk().equals("0") - || ovcspupd.get(0).getFlPartSesupdkoOk().equals("0")) { - if (sb.length() > 0) { - sb.append(", "); - } - sb.append(StrutAaPartion.SESUPDUNITADOCKO.getPartitionName()); - } - - } - } - - if (!rispostaControlli.isrBoolean()) { - rispostaControlli.setCodErr(MessaggiWSBundle.PART_006_001); - rispostaControlli - .setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.PART_006_001, String.valueOf(anno), - (sb.length() == 0 ? sb.append(StrutAaPartion.printAll()) : sb.toString()))); - } - } catch (Exception e) { - rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "UpdControlliPartizioni.verificaPartizioniStruttuaByAA: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); - } - - return rispostaControlli; - } - public RispostaControlli checkChiaveAndTipoDocPrinc(CSChiave key, long idStruttura, TipiGestioneUDAnnullate tguda) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); @@ -650,7 +585,7 @@ public RispostaControlli checkChiaveAndTipoDocPrinc(CSChiave key, long idStruttu String tipoReg = key.getTipoRegistro(); // lista entity JPA ritornate dalle Query - List results = null; + List results = null; // lancio query di controllo try { @@ -664,7 +599,7 @@ public RispostaControlli checkChiaveAndTipoDocPrinc(CSChiave key, long idStruttu javax.persistence.Query query = entityManager.createQuery(queryStr); query.setParameter("idStrutIn", idStruttura); query.setParameter("cdKeyUnitaDocIn", numero); - query.setParameter("aaKeyUnitaDocIn", anno); + query.setParameter("aaKeyUnitaDocIn", new BigDecimal(anno)); query.setParameter("cdRegistroKeyUnitaDocIn", tipoReg); query.setParameter("documentoPrinc", "1");// fixed : non ha senso recuperare altri tipi dato il controllo // adhoc @@ -672,8 +607,8 @@ public RispostaControlli checkChiaveAndTipoDocPrinc(CSChiave key, long idStruttu // chiave già presente (uno o più righe trovate, mi interessa solo l'ultima - // più recente) - if (results.size() > 0) { - Object[] result = (Object[]) results.get(0); // get first + if (!results.isEmpty()) { + Object[] result = results.get(0); // get first // recupero aroUnitaDoc AroUnitaDoc aroUnitaDoc = (AroUnitaDoc) (result)[0]; // recupero aroDoc (se esiste) @@ -747,10 +682,171 @@ public RispostaControlli checkChiaveAndTipoDocPrinc(CSChiave key, long idStruttu rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, "ControlliUpdVersamento.checkChiave: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); + log.error(ERRORE_TABELLA_DECODIFICA, e); + } + + return rispostaControlli; + } + + public RispostaControlli checkProfiloNormativo(UpdVersamentoExt versamento, CostantiDB.TipiEntitaSacer tiEntita, + long idTiEntita, String descrEntita, String descrTiEntita, long idEntita) { + // + final int IDX_DEC_MODELLO_XSD = 0; + final int IDX_DEC_USO_MODELLO_XSD = 1; + // + RispostaControlli rispostaControlli; + rispostaControlli = new RispostaControlli(); + rispostaControlli.setrBoolean(false); + + ProfiloNormativoType pfNormType = null; + JAXBElement pfNormTypeElement = versamento.getVersamento().getUnitaDocumentaria() + .getProfiloNormativo(); + pfNormType = pfNormTypeElement.getValue(); + try { + // verifico se esiste almeno un USO di modello sul tiEntita / idTiEntita + List idUsoModelloXsds = controlliProfiliUd.checkXsdProfileExistence(idTiEntita, tiEntita, + DecModelloXsdUd.TiModelloXsdUd.PROFILO_NORMATIVO_UNITA_DOC); + if (!idUsoModelloXsds.isEmpty()) { + // esiste un modello XSD, devo vedere se è dichiarato nell'XML e se va bene + if (pfNormType == null) { + rispostaControlli.setCodErr(MessaggiWSBundle.PROFNORM_001_001); + rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.PROFNORM_001_001, + tiEntita.descrivi(), descrEntita, descrTiEntita)); + return rispostaControlli; + } else if (pfNormType.getVersione() == null) { + rispostaControlli.setCodErr(MessaggiWSBundle.PROFNORM_001_005); // Eliminazione ProfiloNormativo + // non consentita. Esiste + // profilo normativo associato + // al TipoUD attivo alla data di + // versamento. + rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.PROFNORM_001_005, + tiEntita.descrivi(), descrEntita, pfNormType.getVersione(), descrTiEntita)); + return rispostaControlli; + } else if (pfNormType.getVersione() != null && pfNormType.getAny() == null) { + rispostaControlli.setCodErr(MessaggiWSBundle.PROFNORM_001_003); + rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.PROFNORM_001_003, + tiEntita.descrivi(), descrEntita, descrTiEntita, + MessaggiWSBundle.getString(MessaggiWSBundle.PROFNORM_001_007))); + return rispostaControlli; + } + Object[] dmxud = controlliProfiliUd.getXsdProfileByVersion(idUsoModelloXsds, tiEntita, + DecModelloXsdUd.TiModelloXsdUd.PROFILO_NORMATIVO_UNITA_DOC, pfNormType.getVersione()); + if (dmxud == null) { + rispostaControlli.setCodErr(MessaggiWSBundle.PROFNORM_001_002); + rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.PROFNORM_001_002, + tiEntita.descrivi(), descrEntita, pfNormType.getVersione(), descrTiEntita)); + return rispostaControlli; + } + + // Object[] = 1 pk uso + long idRecUsoXsdProfiloNormativo = ((Long) (dmxud[IDX_DEC_USO_MODELLO_XSD])); + // Object[] = 0 DecModelloXsdUd + String paXsd = ((it.eng.parer.entity.DecModelloXsdUd) dmxud[IDX_DEC_MODELLO_XSD]).getBlXsd(); + RispostaControlli rc = validateXmlProfileOnXsd(paXsd, pfNormType); + if (!rc.isrBoolean()) { + rispostaControlli.setCodErr(MessaggiWSBundle.PROFNORM_001_003); + rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.PROFNORM_001_003, + tiEntita.descrivi(), descrEntita, descrTiEntita, rc.getDsErr())); + return rispostaControlli; + } + // generate xml + canonicalize + String xml = generaXmlProfilo(pfNormType.getAny()); + rispostaControlli.setrString(XmlUtils.doCanonicalizzazioneXml(xml, false)); + rispostaControlli.setrLong(idRecUsoXsdProfiloNormativo); + rispostaControlli.setrBoolean(true); + } else { + if (pfNormType != null && pfNormType.getVersione() == null) { + if (!existUpdProfiloNormativo(DecModelloXsdUd.TiModelloXsdUd.PROFILO_NORMATIVO_UNITA_DOC, + idEntita)) { + rispostaControlli.setCodErr(MessaggiWSBundle.PROFNORM_001_006); + rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.PROFNORM_001_006, + tiEntita.descrivi(), descrEntita, descrTiEntita)); + return rispostaControlli; + } + // Se l'elemento esite per l'UD e viene passato vuoto e privo di attributi allora l'elemento + // ProfiloNormativo + // presente nell'UD può essere eliminato solo se a livello di TipoUD non c'è una profilo + // normativo attivo alla data di versamento + rispostaControlli.setrLong(0); + rispostaControlli.setrBoolean(true); + } else if (pfNormType != null) { + rispostaControlli.setCodErr(MessaggiWSBundle.PROFNORM_001_004); + rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.PROFNORM_001_004, + tiEntita.descrivi(), descrEntita, descrTiEntita)); + return rispostaControlli; + } + // il modello non c'è e non è presente nell'XSD... la verifica è andata bene. + rispostaControlli.setrBoolean(true); + } + } catch (SacerWsException | TransformerException e) { + rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); + rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "ControlliProfiliUd.checkProfiloNormativo: " + e.getMessage())); + log.error("Eccezione nella verifica profilo normativo ", e); + } + + return rispostaControlli; + } + + private RispostaControlli validateXmlProfileOnXsd(String xsd, ProfiloNormativoType pNormType) { + RispostaControlli rispostaControlli; + rispostaControlli = new RispostaControlli(); + rispostaControlli.setrBoolean(false); + + try { + Node xml = pNormType.getAny(); + String language = XMLConstants.W3C_XML_SCHEMA_NS_URI; + SchemaFactory factory = SchemaFactory.newInstance(language); + Schema schema = factory.newSchema(new StreamSource(new StringReader(xsd))); + Validator validator = schema.newValidator(); + validator.validate(new DOMSource(xml)); + rispostaControlli.setrBoolean(true); + } catch (IOException | SAXException e) { + rispostaControlli.setDsErr(e.getLocalizedMessage()); } return rispostaControlli; } + private String generaXmlProfilo(Node profilo) throws TransformerException { + + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + DOMSource source = new DOMSource(profilo); + StreamResult result = new StreamResult(new StringWriter()); + transformer.transform(source, result); + return result.getWriter().toString(); + } + + private boolean existUpdProfiloNormativo(DecModelloXsdUd.TiModelloXsdUd tiModelloXsdUd, long idUnitaDoc) { + + List lstXmlModelloSessioneVers = null; + + try { + + String queryStr = "select xms.idXmlModelloSessioneVers from VrsXmlModelloSessioneVers xms " + + "join xms.decUsoModelloXsdUniDoc usomodelloxsdunidoc " + + "join xms.decUsoModelloXsdUniDoc.decModelloXsdUd modello_xsd " + + "join xms.vrsDatiSessioneVers dati_ses " + "join dati_ses.vrsSessioneVers ses " + + "where modello_xsd.tiUsoModelloXsd = 'VERS' " + "and modello_xsd.tiModelloXsd = :tiModelloXsdUd " + + "and dati_ses.tiDatiSessioneVers = 'XML_DOC' " + "and ses.aroUnitaDoc.idUnitaDoc = :idUnitaDoc " + + "and ses.aroDoc is null " + "and ses.tiStatoSessioneVers = '" + CHIUSA_OK + "' " + + "and ses.tiSessioneVers = 'VERSAMENTO' "; + + TypedQuery query = entityManager.createQuery(queryStr, + VrsXmlModelloSessioneVers.class); + query.setParameter("tiModelloXsdUd", tiModelloXsdUd); + query.setParameter("idUnitaDoc", idUnitaDoc); + + lstXmlModelloSessioneVers = query.getResultList(); + if (lstXmlModelloSessioneVers != null && !lstXmlModelloSessioneVers.isEmpty()) { + return true; + } + + } catch (Exception e) { + log.error("Eccezione durante il recupero del profilo normativo ud " + e.getMessage(), e); + } + return false; + } + } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/LogSessioneUpdVersamento.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/LogSessioneUpdVersamento.java index 13c6047..9851158 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/LogSessioneUpdVersamento.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/LogSessioneUpdVersamento.java @@ -1,5 +1,24 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamentoUpd.ejb; +import static it.eng.parer.util.DateUtilsConverter.convert; + import java.util.HashMap; import java.util.Map; @@ -22,16 +41,21 @@ import it.eng.parer.entity.VrsSesUpdUnitaDocErr; import it.eng.parer.entity.VrsSesUpdUnitaDocKo; import it.eng.parer.entity.VrsUpdUnitaDocKo; +import it.eng.parer.util.Constants; import it.eng.parer.ws.dto.IRispostaWS; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.ControlliWSBundle; +import it.eng.parer.ws.utils.Costanti; import it.eng.parer.ws.utils.MessaggiWSBundle; +import it.eng.parer.ws.versamento.dto.BackendStorage; +import it.eng.parer.ws.versamento.dto.ObjectStorageResource; import it.eng.parer.ws.versamento.dto.SyncFakeSessn; +import it.eng.parer.ws.versamento.ejb.ObjectStorageService; import it.eng.parer.ws.versamentoUpd.dto.RispostaWSUpdVers; import it.eng.parer.ws.versamentoUpd.dto.StrutturaUpdVers; import it.eng.parer.ws.versamentoUpd.ejb.help.LogSessioneUpdVersamentoHelper; import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; -import static it.eng.parer.util.DateUtilsConverter.convert; +import java.math.BigDecimal; /** * @@ -47,6 +71,11 @@ public class LogSessioneUpdVersamento { @EJB private LogSessioneUpdVersamentoHelper updLogSessioneHelper; + // MEV#29276 + @EJB + ObjectStorageService objectStorageService; + // end MEV#29276 + @PersistenceContext(unitName = "ParerJPA") private EntityManager entityManager; @@ -63,19 +92,15 @@ public boolean registraSessioneErrata(RispostaWSUpdVers rispostaWs, UpdVersament // un errore interno provocato da problemi al database) RispostaControlli tmpRispostaControlli = null; VrsSesUpdUnitaDocErr tmpSesUpdUnitaDocErr = null; - + // MEV#29276 + BackendStorage backendMetadata = null; + Map sipBlob = new HashMap<>(); + // end MEV#29276 try { - // verifica se posso salvare la sessione errata - tmpRispostaControlli = updLogSessioneHelper.verificaPartizioneUpdErr(); - if (!tmpRispostaControlli.isrBoolean()) { - // c'è un problema del partizionamento. Si tratta di un'evenienza rara ma - // possibile. In questo caso non posso salvare la sessione errata. - // Mi limito a restituire un errore al chiamante e spero che qualcuno lo legga. - context.setRollbackOnly(); - // errore di persistenza da aggiungere tra i controlli ?! - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); - return false; - } + + // MEV#29276 + backendMetadata = objectStorageService.lookupBackendVrsSessioniErrKoAggMd(); + // end MEV#29276 // salvo sessione errata: tmpRispostaControlli = updLogSessioneHelper.scriviUpdUnitaDocErr(rispostaWs, versamento, sessione); @@ -86,21 +111,21 @@ public boolean registraSessioneErrata(RispostaWSUpdVers rispostaWs, UpdVersament // eccezione (magari in altri metodi invocati con lo stesso pattern) context.setRollbackOnly(); // errore di persistenza da aggiungere tra i controlli ?! - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } // salvo gli xml di request & response tmpSesUpdUnitaDocErr = (VrsSesUpdUnitaDocErr) tmpRispostaControlli.getrObject(); tmpRispostaControlli = updLogSessioneHelper.scriviXmlSesUpdUnitaDocErr(rispostaWs, versamento, sessione, - tmpSesUpdUnitaDocErr); + tmpSesUpdUnitaDocErr, backendMetadata, sipBlob); if (!tmpRispostaControlli.isrBoolean()) { // probabilmente è inutile visto che se arrivo qui è per una runtimeexception // che forza il rollback in ogni caso, ma meglio andare sul sicuro, dal momento // che non posso escludere di terminare male un salvataggio anche senza una // eccezione (magari in altri metodi invocati con lo stesso pattern) context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -110,10 +135,21 @@ public boolean registraSessioneErrata(RispostaWSUpdVers rispostaWs, UpdVersament if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); // errore di persistenza da aggiungere tra i controlli ?! - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } - + // + // MEV#29276 + /* + * Se backendMetadata di tipo O.S. si effettua il salvataggio (con link su apposita entity) + */ + if (backendMetadata.isObjectStorage()) { + ObjectStorageResource res = objectStorageService.createSipInSessioniErrAggMd( + backendMetadata.getBackendName(), sipBlob, tmpSesUpdUnitaDocErr.getIdSesUpdUnitaDocErr(), + getIdStrut(versamento)); + log.debug("Salvati i SIP nel bucket {} con chiave {} ", res.getBucket(), res.getKey()); + } + // end MEV#29276 entityManager.flush(); } catch (Exception e) { // l'errore di persistenza viene aggiunto alla pila @@ -145,48 +181,44 @@ public boolean registraSessioneFallita(RispostaWSUpdVers rispostaWs, UpdVersamen VrsUpdUnitaDocKo tmpUpdUnitaDocKo = null; VrsSesUpdUnitaDocKo tmpSesUpdUnitaDocKo = null; StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); - + // MEV#29276 + BackendStorage backendMetadata = null; + Map sipBlob = new HashMap<>(); + // end MEV#29276 try { + + // MEV#29276 + backendMetadata = objectStorageService.lookupBackendVrsSessioniErrKoAggMd(); + // end MEV#29276 + // se esiste LOCK SU UD // dovranno aspettare il rilascio del LOCK che avverrà al termine di tutte le // operazioni di aggiornamento) if (strutturaUpdVers.getIdUd() > 0) { - Map properties = new HashMap(); - properties.put("javax.persistence.lock.timeout", 25); - AroUnitaDoc tmpAroUnitaDoc = entityManager.find(AroUnitaDoc.class, strutturaUpdVers.getIdUd(), - LockModeType.PESSIMISTIC_WRITE, properties); + Map properties = new HashMap<>(); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, 25000); + entityManager.find(AroUnitaDoc.class, strutturaUpdVers.getIdUd(), LockModeType.PESSIMISTIC_WRITE, + properties); } // cerco se esiste una precedente registrazione fallita della // stesso aggiornamento UD e se esiste, lo blocco in modo esclusivo: lo devo modificare - tmpRispostaControlli = updLogSessioneHelper.cercaAggiornamentoKo(rispostaWs, versamento, sessione); + tmpRispostaControlli = updLogSessioneHelper.cercaAggiornamentoKo(versamento); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); // errore di persistenza da aggiungere tra i controlli ?! - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } if (tmpRispostaControlli.getrObject() != null) { tmpUpdUnitaDocKo = (VrsUpdUnitaDocKo) tmpRispostaControlli.getrObject(); } else { - // verifica se posso salvare la sessione fallita - tmpRispostaControlli = updLogSessioneHelper.verificaPartizioneUpdByAaStrutKo(rispostaWs, versamento, - sessione); - if (!tmpRispostaControlli.isrBoolean()) { - // c'è un problema del partizionamento. Si tratta di un'evenienza rara ma - // possibile. In questo caso non posso salvare la sessione fallita. - // Mi limito a restituire un errore al chiamante e spero che qualcuno lo legga. - context.setRollbackOnly(); - // errore di persistenza da aggiungere tra i controlli ?! - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); - return false; - } // se non ho aggiornamento buoni o cattivi già creati -> creo aggiornamento fallito tmpRispostaControlli = updLogSessioneHelper.scriviVrsUpdUnitaDocKo(rispostaWs, versamento, sessione); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); // errore di persistenza da aggiungere tra i controlli ?! - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } tmpUpdUnitaDocKo = (VrsUpdUnitaDocKo) tmpRispostaControlli.getrObject(); @@ -199,7 +231,7 @@ public boolean registraSessioneFallita(RispostaWSUpdVers rispostaWs, UpdVersamen convert(sessione.getTmApertura())); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -207,10 +239,10 @@ public boolean registraSessioneFallita(RispostaWSUpdVers rispostaWs, UpdVersamen * determina il primo aggiornamento avvenuto con successo (ARO_UPD_UNITA_DOC) il cui timestamp di inizio * sessione sia successivo al timestamp di inizio sessione errata */ - tmpRispostaControlli = updLogSessioneHelper.recuperoUpdUnitaDocOk(rispostaWs, versamento, sessione); + tmpRispostaControlli = updLogSessioneHelper.recuperoUpdUnitaDocOk(versamento, sessione); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -223,17 +255,17 @@ public boolean registraSessioneFallita(RispostaWSUpdVers rispostaWs, UpdVersamen tmpUpdUnitaDocKo, tmpAroUpdUnitaDoc); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } tmpSesUpdUnitaDocKo = (VrsSesUpdUnitaDocKo) tmpRispostaControlli.getrObject(); // salvo xml di request & response tmpRispostaControlli = updLogSessioneHelper.scriviXmlUpdUnitaDocKo(rispostaWs, versamento, sessione, - tmpSesUpdUnitaDocKo); + tmpSesUpdUnitaDocKo, backendMetadata, sipBlob); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); // errore di persistenza da aggiungere tra i controlli ?! - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -243,9 +275,21 @@ public boolean registraSessioneFallita(RispostaWSUpdVers rispostaWs, UpdVersamen if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); // errore di persistenza da aggiungere tra i controlli ?! - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } + // + // MEV#29276 + /* + * Se backendMetadata di tipo O.S. si effettua il salvataggio (con link su apposita entity) + */ + if (backendMetadata.isObjectStorage()) { + ObjectStorageResource res = objectStorageService.createSipInSessioniKoAggMd( + backendMetadata.getBackendName(), sipBlob, tmpSesUpdUnitaDocKo.getIdSesUpdUnitaDocKo(), + getIdStrut(versamento)); + log.debug("Salvati i SIP nel bucket {} con chiave {} ", res.getBucket(), res.getKey()); + } + // end MEV#29276 entityManager.flush(); } catch (Exception e) { // l'errore di persistenza viene aggiunto alla pila @@ -262,11 +306,17 @@ public boolean registraSessioneFallita(RispostaWSUpdVers rispostaWs, UpdVersamen return true; } - private void impostaErrore(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - RispostaControlli tmpRispostaControlli) { + private void impostaErrore(RispostaWSUpdVers rispostaWs, RispostaControlli tmpRispostaControlli) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWs.setEsitoWsError(tmpRispostaControlli.getCodErr(), tmpRispostaControlli.getDsErr()); } + private BigDecimal getIdStrut(UpdVersamentoExt versamento) { + if (versamento.getStrutturaUpdVers() != null && versamento.getStrutturaUpdVers().getIdStruttura() != 0) { + return BigDecimal.valueOf(versamento.getStrutturaUpdVers().getIdStruttura()); + } + return null; + } + } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/RecupSessDubbieUpdVersamento.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/RecupSessDubbieUpdVersamento.java index b5ec8b6..a915bb6 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/RecupSessDubbieUpdVersamento.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/RecupSessDubbieUpdVersamento.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -39,6 +56,7 @@ import org.xml.sax.SAXException; import it.eng.parer.entity.AroUnitaDoc; +import it.eng.parer.util.Constants; import it.eng.parer.ws.dto.CSChiave; import it.eng.parer.ws.dto.CSVersatore; import it.eng.parer.ws.dto.IRispostaWS; @@ -106,15 +124,15 @@ public void recuperaSessioneErrata(RispostaWSUpdVers rispostaWs, UpdVersamentoEx // verifico se sono fallito per un errore del parser if (versamento.getUtente() == null || versamento.getVersamento() == null) { // recupero dati - this.recuperaDatiDaXml(versamento, rispostaWs); + this.recuperaDatiDaXml(versamento); // recupero struttura - if (!this.recuperaStrutturaDaVersatore(versamento, rispostaWs)) { + if (!this.recuperaStrutturaDaVersatore(versamento)) { return; } // recupero tipo ud, registro e tipo doc princ this.recuperaTipologiaUDRegDocPrinc(versamento, rispostaWs); // verifica partizione - if (!this.verificaPartizionamentoStruttura(versamento, rispostaWs)) { + if (!this.verificaPartizionamentoStruttura(versamento)) { return; } // verifica esistenza unita doc @@ -126,11 +144,11 @@ public void recuperaSessioneErrata(RispostaWSUpdVers rispostaWs, UpdVersamentoEx // verifico se ho effettuato il marshall ma non ho un id struttura // avviene se versatore e/o versione xml non coincidono con la chiamata ws if (versamento.getVersamento() != null && versamento.getStrutturaUpdVers().getIdStruttura() < 1) { - if (!this.recuperaStrutturaDaVersatore(versamento, rispostaWs)) { + if (!this.recuperaStrutturaDaVersatore(versamento)) { return; } // verifica partizione - if (!this.verificaPartizionamentoStruttura(versamento, rispostaWs)) { + if (!this.verificaPartizionamentoStruttura(versamento)) { return; } // recupero tipo ud, registro e tipo doc princ @@ -148,7 +166,7 @@ public void recuperaSessioneErrata(RispostaWSUpdVers rispostaWs, UpdVersamentoEx // recupero tipo ud, registro e tipo doc princ this.recuperaTipologiaUDRegDocPrinc(versamento, rispostaWs); // verifica partizione - if (!this.verificaPartizionamentoStruttura(versamento, rispostaWs)) { + if (!this.verificaPartizionamentoStruttura(versamento)) { return; } // verifica esistenza unita doc @@ -164,7 +182,7 @@ public void recuperaSessioneErrata(RispostaWSUpdVers rispostaWs, UpdVersamentoEx } } - private void recuperaDatiDaXml(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs) { + private void recuperaDatiDaXml(UpdVersamentoExt versamento) { if (versamento.getDatiXml() != null) { CSVersatore tmpVersatore = new CSVersatore(); // init @@ -205,7 +223,6 @@ private void recuperaDatiDaXml(UpdVersamentoExt versamento, RispostaWSUpdVers ri for (int i = 0; i < nodes.getLength(); i++) { tmpVersatore.setStruttura(nodes.item(i).getNodeValue()); } - // cercaStruttura = nodes.getLength() != 0 && cercaStruttura; // cerca la chiave (o almeno le parti da cui è definita) expr = xpath.compile("//Intestazione/Chiave/Anno/text()"); nodes = (NodeList) expr.evaluate(tmpDati, XPathConstants.NODESET); @@ -264,7 +281,7 @@ private void recuperaDatiDaXml(UpdVersamentoExt versamento, RispostaWSUpdVers ri } } - private boolean recuperaStrutturaDaVersatore(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs) { + private boolean recuperaStrutturaDaVersatore(UpdVersamentoExt versamento) { boolean prosegui = false; // i dati successivi senza struttura non potranno essere recuperati long idStruttura; CSVersatore tmpVersatore = versamento.getStrutturaUpdVers().getVersatoreNonverificato(); @@ -306,18 +323,6 @@ private boolean recuperaStrutturaDaVersatore(UpdVersamentoExt versamento, Rispos break; case MessaggiWSBundle.UD_001_003: - // struttura - // aggiunta su controlli generali - versamento.addEsitoControlloOnGenerali( - ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_STRUTTURA), SeverityEnum.ERROR, - TipiEsitoErrore.NEGATIVO, rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); - // check su ambiente/ente superato - // aggiunta su controlli generali - versamento - .addControlloOkOnGenerali(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_AMBIENTE)); - versamento.addControlloOkOnGenerali(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_ENTE)); - - break; case MessaggiWSBundle.UD_001_015: // struttura // aggiunta su controlli generali @@ -331,6 +336,9 @@ private boolean recuperaStrutturaDaVersatore(UpdVersamentoExt versamento, Rispos .addControlloOkOnGenerali(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_AMBIENTE)); versamento.addControlloOkOnGenerali(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_ENTE)); + break; + default: + // niente da fare negli altri casi break; } } @@ -338,27 +346,14 @@ private boolean recuperaStrutturaDaVersatore(UpdVersamentoExt versamento, Rispos return prosegui; } - private boolean verificaPartizionamentoStruttura(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs) { + private boolean verificaPartizionamentoStruttura(UpdVersamentoExt versamento) { boolean trovato = false; CSChiave tagCSChiave = versamento.getStrutturaUpdVers().getChiaveNonVerificata(); if (verificaCSChiave(tagCSChiave) && versamento.getStrutturaUpdVers().getIdStruttura() > 0) { - RispostaControlli rispostaControlli = updVersamentoControlli.checkPartizioniStruttuaByAA("dummy", - versamento.getStrutturaUpdVers().getIdStruttura(), tagCSChiave.getAnno()); - if (!rispostaControlli.isrBoolean()) { - // se il partizionamento è scorretto, la sessione di versamento è errata senza - // possibilità di recupero (anche le sessioni fallite sono partizionate sul db) - // esito negativo - versamento.addEsitoControlloOnGenerali( - ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_PARTIZIONI), SeverityEnum.ERROR, - TipiEsitoErrore.NEGATIVO, rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); - } else { - trovato = true; - // esito positivo - versamento.addControlloOkOnGenerali( - ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_PARTIZIONI)); - } + trovato = true; + /* MEV 30089 - non faccio più controlli sulle partizioni, ci sono partizionamenti automatici */ + versamento.addControlloOkOnGenerali(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_PARTIZIONI)); } - return trovato; } @@ -466,7 +461,6 @@ private void recuperaTipologiaUDRegDocPrinc(UpdVersamentoExt versamento, Rispost private void recuperaUnitaDoc(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); CompRapportoUpdVers myEsito = rispostaWs.getCompRapportoUpdVers(); - CSChiave tagCSChiave = versamento.getStrutturaUpdVers().getChiaveNonVerificata(); // controlla prensa chiave UD RispostaControlli rispostaControlli = updVersamentoControlli.checkChiaveAndTipoDocPrinc( @@ -476,10 +470,10 @@ private void recuperaUnitaDoc(UpdVersamentoExt versamento, RispostaWSUpdVers ris if (!rispostaControlli.isrBoolean()) { // si assume il LOCK ESCLUSIVO su UNITA_DOC determinata - Map properties = new HashMap(); - properties.put("javax.persistence.lock.timeout", 25); - AroUnitaDoc tmpAroUnitaDoc = entityManager.find(AroUnitaDoc.class, rispostaControlli.getrLong(), - LockModeType.PESSIMISTIC_WRITE, properties); + Map properties = new HashMap<>(); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, 25000); + entityManager.find(AroUnitaDoc.class, rispostaControlli.getrLong(), LockModeType.PESSIMISTIC_WRITE, + properties); // set esito positivo versamento.addControlloOkOnGenerali(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_CHIAVEUD)); @@ -544,8 +538,7 @@ private Document convertStringToDocument(String xmlStr) { DocumentBuilder builder; try { builder = factory.newDocumentBuilder(); - Document doc = builder.parse(new InputSource(new StringReader(xmlStr))); - return doc; + return builder.parse(new InputSource(new StringReader(xmlStr))); } catch (IOException | ParserConfigurationException | SAXException e) { // in caso di eccezione non faccio nulla: // è perfettamente accettabile che questa stringa, che ha già fallito una diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/SalvataggioUpdVersamento.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/SalvataggioUpdVersamento.java index 34960dc..fe12a78 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/SalvataggioUpdVersamento.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/SalvataggioUpdVersamento.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -16,6 +33,8 @@ import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; +import javax.jms.ConnectionFactory; +import javax.jms.Queue; import javax.persistence.EntityManager; import javax.persistence.LockModeType; import javax.persistence.PersistenceContext; @@ -33,15 +52,23 @@ import it.eng.parer.entity.VrsUpdUnitaDocKo; import it.eng.parer.entity.constraint.AroUpdDatiSpecUnitaDoc.TiEntitaAroUpdDatiSpecUnitaDoc; import it.eng.parer.entity.constraint.AroUpdDatiSpecUnitaDoc.TiUsoXsdAroUpdDatiSpecUnitaDoc; +import it.eng.parer.entity.constraint.AroVersIniDatiSpec.TiEntitaSacerAroVersIniDatiSpec; +import it.eng.parer.util.Constants; import it.eng.parer.ws.dto.IRispostaWS; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.ControlliWSBundle; +import it.eng.parer.ws.utils.Costanti; import it.eng.parer.ws.utils.CostantiDB; import it.eng.parer.ws.utils.MessaggiWSBundle; +import it.eng.parer.ws.utils.MessaggiWSFormat; import it.eng.parer.ws.utils.PayLoad; import it.eng.parer.ws.utils.ejb.JmsProducerUtilEjb; +import it.eng.parer.ws.versamento.dto.BackendStorage; +import it.eng.parer.ws.versamento.dto.ObjectStorageResource; import it.eng.parer.ws.versamento.dto.SyncFakeSessn; +import it.eng.parer.ws.versamento.ejb.ObjectStorageService; import it.eng.parer.ws.versamentoUpd.dto.CompRapportoUpdVers; +import it.eng.parer.ws.versamentoUpd.dto.DatiSpecLinkOsKeyMap; import it.eng.parer.ws.versamentoUpd.dto.RispostaWSUpdVers; import it.eng.parer.ws.versamentoUpd.dto.StrutturaUpdVers; import it.eng.parer.ws.versamentoUpd.dto.UpdComponenteVers; @@ -52,8 +79,7 @@ import it.eng.parer.ws.versamentoUpd.ejb.help.SalvataggioUpdVersamentoIniHelper; import it.eng.parer.ws.versamentoUpd.ejb.help.SalvataggioUpdVersamentoUpdHelper; import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; -import javax.jms.ConnectionFactory; -import javax.jms.Queue; +import java.math.BigDecimal; /** * @@ -68,7 +94,7 @@ public class SalvataggioUpdVersamento { // MEV#27048 @Resource(mappedName = "jms/ProducerConnectionFactory") private ConnectionFactory connectionFactory; - @Resource(mappedName = "jms/ElenchiDaElabInAttesaSchedQueue") + @Resource(mappedName = "jms/queue/ElenchiDaElabQueue") private Queue queue; // end MEV#27048 // @@ -93,6 +119,11 @@ public class SalvataggioUpdVersamento { private JmsProducerUtilEjb jmsProducerUtilEjb; // end MEV#27048 + // MEV#29276 + @EJB + ObjectStorageService objectStorageService; + // end MEV#29276 + @PersistenceContext(unitName = "ParerJPA") private EntityManager entityManager; @@ -110,13 +141,24 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt tmpRispostaControlli.setrBoolean(false); StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); CompRapportoUpdVers myEsito = rispostaWs.getCompRapportoUpdVers(); - + // MEV#29276 + BackendStorage backendMetadata = null; + Map sipBlob = new HashMap<>(); + Map> updDatiSpecBlob = new HashMap(); + Map> versIniDatiSpecBlob = new HashMap(); + // end MEV#29276 try { + // MEV#29276 + backendMetadata = objectStorageService.lookupBackendByServiceName( + versamento.getStrutturaUpdVers().getIdTipologiaUnitaDocumentaria(), + Costanti.WS_AGGIORNAMENTO_VERS_NOME); + // end MEV#29276 + // 0. si assume LOCK esclusivo su UD da aggiornare (in modo tale che altri // dovranno aspettare il rilascio del LOCK che avverrà al termine di tutte le // operazioni di aggiornamento) - Map properties = new HashMap(); - properties.put("javax.persistence.lock.timeout", 25); + Map properties = new HashMap<>(); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, 25000); AroUnitaDoc tmpAroUnitaDoc = entityManager.find(AroUnitaDoc.class, strutturaUpdVers.getIdUd(), LockModeType.PESSIMISTIC_WRITE, properties); @@ -127,7 +169,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt tmpRispostaControlli.setCodErr(MessaggiWSBundle.ERR_666P); tmpRispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666P, "Errore interno nella lettura dell'unità documentaria da aggiornare")); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -143,21 +185,21 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt */ // 1. se il numero normalizzato sull’unità doc nel DB è nullo -> // il sistema aggiorna ARO_UNITA_DOC - tmpRispostaControlli = salvataggioPregVersamentoAroHelper.salvaCdKeyNormUnitaDocumentaria(rispostaWs, - versamento, sessione, tmpAroUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioPregVersamentoAroHelper.salvaCdKeyNormUnitaDocumentaria(tmpAroUnitaDoc, + strutturaUpdVers); // errore query if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } // 2. verifica pregresso - tmpRispostaControlli = salvataggioPregVersamentoAroHelper.aggiornaPregCompDocUrnSip(rispostaWs, versamento, - sessione, tmpAroUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioPregVersamentoAroHelper.aggiornaPregCompDocUrnSip(tmpAroUnitaDoc, + strutturaUpdVers); // errore query if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -184,7 +226,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt // in caso di errore esecuzione query if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -195,7 +237,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt sessione, tmpAroUnitaDoc, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -206,7 +248,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt sessione, tmpAroUnitaDoc, tmpAroVersIniUnitaDoc, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -215,7 +257,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, sessione, tmpAroUnitaDoc, tmpAroVersIniUnitaDoc, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -228,7 +270,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt // errore query if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -237,11 +279,12 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt AroUsoXsdDatiSpec tmpUsoXsdDatiSpec = (AroUsoXsdDatiSpec) tmpRispostaControlli.getrObject(); // per ogni record in ARO_VALORE_ATTRIB_DATI_SPEC relativo al xsd usato - tmpRispostaControlli = salvataggioUpdIniVersamentoHelper.scriviAroIniDatiSpecUd(rispostaWs, - versamento, sessione, tmpAroVersIniUnitaDoc, tmpUsoXsdDatiSpec, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdIniVersamentoHelper.scriviAroIniDatiSpecUd(sessione, + tmpAroVersIniUnitaDoc, tmpUsoXsdDatiSpec, backendMetadata, versIniDatiSpecBlob, + strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -256,7 +299,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt // errore query if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -265,11 +308,12 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt AroUsoXsdDatiSpec tmpUsoXsdDatiSpec = (AroUsoXsdDatiSpec) tmpRispostaControlli.getrObject(); // per ogni record in ARO_VALORE_ATTRIB_DATI_SPEC relativo al xsd usato - tmpRispostaControlli = salvataggioUpdIniVersamentoHelper.scriviAroIniDatiSpecUd(rispostaWs, - versamento, sessione, tmpAroVersIniUnitaDoc, tmpUsoXsdDatiSpec, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdIniVersamentoHelper.scriviAroIniDatiSpecUd(sessione, + tmpAroVersIniUnitaDoc, tmpUsoXsdDatiSpec, backendMetadata, versIniDatiSpecBlob, + strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } } // AroUsoXsdDatiSpec @@ -291,7 +335,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt // errore esecuzione query if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -303,7 +347,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt sessione, tmpAroVersIniUnitaDoc, updDocumentoVers.getIdRecDocumentoDB(), strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -316,7 +360,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt // errore query if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -325,12 +369,12 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt AroUsoXsdDatiSpec tmpUsoXsdDatiSpec = (AroUsoXsdDatiSpec) tmpRispostaControlli.getrObject(); // per ogni record in ARO_VALORE_ATTRIB_DATI_SPEC relativo al xsd usato - tmpRispostaControlli = salvataggioUpdIniVersamentoHelper.scriviAroIniDatiSpecDoc(rispostaWs, - versamento, sessione, tmpAroVersIniUnitaDoc, tmpAroVersIniDoc, null, tmpUsoXsdDatiSpec, - strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdIniVersamentoHelper.scriviAroIniDatiSpecDoc(sessione, + tmpAroVersIniUnitaDoc, tmpAroVersIniDoc, tmpUsoXsdDatiSpec, backendMetadata, + versIniDatiSpecBlob, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } } // AroUsoXsdDatiSpec @@ -341,7 +385,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -350,12 +394,12 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt AroUsoXsdDatiSpec tmpUsoXsdDatiSpec = (AroUsoXsdDatiSpec) tmpRispostaControlli.getrObject(); // per ogni record in ARO_VALORE_ATTRIB_DATI_SPEC relativo al xsd usato - tmpRispostaControlli = salvataggioUpdIniVersamentoHelper.scriviAroIniDatiSpecDoc(rispostaWs, - versamento, sessione, tmpAroVersIniUnitaDoc, tmpAroVersIniDoc, null, tmpUsoXsdDatiSpec, - strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdIniVersamentoHelper.scriviAroIniDatiSpecDoc(sessione, + tmpAroVersIniUnitaDoc, tmpAroVersIniDoc, tmpUsoXsdDatiSpec, backendMetadata, + versIniDatiSpecBlob, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } } // AroUsoXsdDatiSpec @@ -376,7 +420,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt // errore esecuzione query if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -388,7 +432,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -402,7 +446,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt // errore query if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -412,12 +456,12 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt AroUsoXsdDatiSpec tmpUsoXsdDatiSpec = (AroUsoXsdDatiSpec) tmpRispostaControlli.getrObject(); // per ogni record in ARO_VALORE_ATTRIB_DATI_SPEC relativo al xsd usato - tmpRispostaControlli = salvataggioUpdIniVersamentoHelper.scriviAroIniDatiSpecDoc(rispostaWs, - versamento, sessione, tmpAroVersIniUnitaDoc, tmpAroVersIniDoc, tmpAroVersIniComp, - tmpUsoXsdDatiSpec, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdIniVersamentoHelper.scriviAroIniDatiSpecComp(sessione, + tmpAroVersIniUnitaDoc, tmpAroVersIniDoc, tmpAroVersIniComp, tmpUsoXsdDatiSpec, + backendMetadata, versIniDatiSpecBlob, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } } // AroUsoXsdDatiSpec @@ -429,7 +473,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt // errore query if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -439,12 +483,12 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt AroUsoXsdDatiSpec tmpUsoXsdDatiSpec = (AroUsoXsdDatiSpec) tmpRispostaControlli.getrObject(); // per ogni record in ARO_VALORE_ATTRIB_DATI_SPEC relativo al xsd usato - tmpRispostaControlli = salvataggioUpdIniVersamentoHelper.scriviAroIniDatiSpecDoc(rispostaWs, - versamento, sessione, tmpAroVersIniUnitaDoc, tmpAroVersIniDoc, tmpAroVersIniComp, - tmpUsoXsdDatiSpec, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdIniVersamentoHelper.scriviAroIniDatiSpecComp(sessione, + tmpAroVersIniUnitaDoc, tmpAroVersIniDoc, tmpAroVersIniComp, tmpUsoXsdDatiSpec, + backendMetadata, versIniDatiSpecBlob, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } } // AroUsoXsdDatiSpec @@ -459,10 +503,10 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt // l'aggiornamento dell'unità documentaria, lo blocco in modo esclusivo: lo devo // rimuovere // e devo riallocare tutte le sue sessioni all'aggiornamento che sto creando - tmpRispostaControlli = updLogSessioneHelper.cercaAggiornamentoKo(rispostaWs, versamento, sessione); + tmpRispostaControlli = updLogSessioneHelper.cercaAggiornamentoKo(versamento); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -486,7 +530,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt .getNextPgAroUpdUnitaDoc(tmpAroUnitaDoc.getIdUnitaDoc()); if (!tmpRispostaControlli.isrBoolean() && tmpRispostaControlli.getrLong() != -1) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } else { pgAroUpdUnitaDoc = tmpRispostaControlli.getrLong(); @@ -495,48 +539,48 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt } // 1. inserisci record in ARO_UPD_UNITA_DOC, ...: - tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroUpdUnitaDoc(rispostaWs, versamento, sessione, + tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroUpdUnitaDoc(versamento, sessione, tmpAroUnitaDoc, pgAroUpdUnitaDoc, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } // 2. inserisci record in ARO_XML_UPD_UNITA_DOC, ...: AroUpdUnitaDoc tmpAroUpdUnitaDoc = (AroUpdUnitaDoc) tmpRispostaControlli.getrObject(); tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroXmlUpdUnitaDoc(rispostaWs, versamento, - sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, backendMetadata, sipBlob, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } // 3. per ogni controllo svolto sull’unità doc da aggiornare con esito = WARNING // (in ordine di numero d’ordine del controllo) - tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroWarnUpdUnitaDocForUD(rispostaWs, versamento, - sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroWarnUpdUnitaDocForUD(versamento, + tmpAroUpdUnitaDoc); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } // 4. fine per ogni controllo svolto sull’unità doc // 5. per ogni documento da aggiornare - tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroWarnUpdUnitaDocForDoc(rispostaWs, versamento, - sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroWarnUpdUnitaDocForDoc(versamento, + tmpAroUpdUnitaDoc, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } // 5.3. per ogni componente da aggiornare - tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroWarnUpdUnitaDocForComp(rispostaWs, - versamento, sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroWarnUpdUnitaDocForComp(versamento, + tmpAroUpdUnitaDoc, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } // 5.4. fine per ogni componente da aggiornare @@ -546,62 +590,62 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } // 8. fine per ogni ogni tag “FascicoloSecondario “ // 9. per ogni documento collegato definito su unita doc da aggiornare - tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroUpdLinkUnitaDoc(rispostaWs, versamento, - sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroUpdLinkUnitaDoc(versamento, tmpAroUnitaDoc, + tmpAroUpdUnitaDoc, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } // 11. se nel XML in input il tag “DatiSpecifici” e’ definito - tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroUpdDatiSpecUnitaDoc(rispostaWs, versamento, - sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS, - TiEntitaAroUpdDatiSpecUnitaDoc.UPD_UNI_DOC, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroUpdDatiSpecUnitaDoc(versamento, sessione, + tmpAroUnitaDoc, tmpAroUpdUnitaDoc, TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS, + TiEntitaAroUpdDatiSpecUnitaDoc.UPD_UNI_DOC, backendMetadata, updDatiSpecBlob, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } // 12. fine se // 13. se nel XML in input il tag “DatiSpecificiMigrazione” e’ definito - tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroUpdDatiSpecUnitaDoc(rispostaWs, versamento, - sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, TiUsoXsdAroUpdDatiSpecUnitaDoc.MIGRAZ, - TiEntitaAroUpdDatiSpecUnitaDoc.UPD_UNI_DOC, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroUpdDatiSpecUnitaDoc(versamento, sessione, + tmpAroUnitaDoc, tmpAroUpdUnitaDoc, TiUsoXsdAroUpdDatiSpecUnitaDoc.MIGRAZ, + TiEntitaAroUpdDatiSpecUnitaDoc.UPD_UNI_DOC, backendMetadata, updDatiSpecBlob, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } // 14. fine se // 15. inserisci record in ELV_UPD_UD_DA_ELAB_ELENCO - tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviElvUpdUdDaElabElenco(rispostaWs, versamento, - sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviElvUpdUdDaElabElenco(sessione, tmpAroUnitaDoc, + tmpAroUpdUnitaDoc, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } // 16. fine se // 17. inserisci record in MON_KEY_TOTAL_UD - tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviMonKeyTotalUd(rispostaWs, versamento, sessione, - tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviMonKeyTotalUd(tmpAroUnitaDoc, tmpAroUpdUnitaDoc, + strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } // 17. per ogni documento da aggiornare contenuto in unita doc da aggiornare // 17.1. inserisci record in ARO_UPD_DOC_UNITA_DOC - tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroUpdDocUnitaDoc(rispostaWs, versamento, - sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdVersamentoHelper.scriviAroUpdDocUnitaDoc(versamento, sessione, + tmpAroUpdUnitaDoc, backendMetadata, updDatiSpecBlob, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -617,87 +661,103 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt * §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ */ - // 1. se stato di conservazione per unita doc = AIP_GENERATO o AIP_FIRMATO o AIP_IN_ARCHIVIO o + // 1. se stato di conservazione per unita doc = AIP_GENERATO o AIP_FIRMATO o + // AIP_IN_ARCHIVIO o // AIP_IN_CUSTODIA - tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaStatoConservazione(rispostaWs, versamento, - sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaStatoConservazione(tmpAroUnitaDoc, + strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } // 2. se su unità doc da aggiornare il tag “ProfiloArchivistico” e’ da // aggiornare if (versamento.hasProfiloArchivisticoToUpd()) { - tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaProfiloArchivistico(rispostaWs, - versamento, sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaProfiloArchivistico(versamento, + tmpAroUnitaDoc, tmpAroUpdUnitaDoc); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } } - // 3. se su unità doc da aggiornare il tag “ProfiloUnitaDocumentaria” e’ da aggiornare + // 3. se su unità doc da aggiornare il tag “ProfiloUnitaDocumentaria” e’ da + // aggiornare if (versamento.hasProfiloUnitaDocumentariaToUpd()) { - tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaProfiloUnitaDocumentaria(rispostaWs, - versamento, sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdAroVersamentoHelper + .aggiornaProfiloUnitaDocumentaria(tmpAroUnitaDoc, tmpAroUpdUnitaDoc); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); + return false; + } + } + // 3.1 se su unità doc da aggiornare è presente il tag “ProfiloNormativo” e’ da + // aggiornare + if (versamento.hasProfiloNormativoToUpd()) { + + // se presente il profilo normativo su unità documentaria + if (strutturaUpdVers.getIdRecUsoXsdProfiloNormativo() != null) { + tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaProfiloNormativo(tmpAroUnitaDoc, + strutturaUpdVers); + } + + if (!tmpRispostaControlli.isrBoolean()) { + context.setRollbackOnly(); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } } // 4. se su unità doc da aggiornare il tag “DocumentiCollegati” e’ da aggiornare if (versamento.hasDocumentiCollegatiToUpd()) { - tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaDocumentiCollegati(rispostaWs, - versamento, sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaDocumentiCollegati(tmpAroUnitaDoc, + tmpAroUpdUnitaDoc); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } } // 5. se su unità doc da aggiornare il tag “DatiSpecifici” e’ da aggiornare if (versamento.hasDatiSpecificiToBeUpdated()) { - tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaDatiSpecificiUd(rispostaWs, versamento, - sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS, - strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaDatiSpecificiUd(tmpAroUnitaDoc, + tmpAroUpdUnitaDoc, TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } } - // 6. se su unità doc da aggiornare il tag “DatiSpecificiMigrazione” e’ da aggiornare + // 6. se su unità doc da aggiornare il tag “DatiSpecificiMigrazione” e’ da + // aggiornare if (versamento.hasDatiSpecificiMigrazioneToUpd()) { - tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaDatiSpecificiUd(rispostaWs, versamento, - sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, TiUsoXsdAroUpdDatiSpecUnitaDoc.MIGRAZ, - strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaDatiSpecificiUd(tmpAroUnitaDoc, + tmpAroUpdUnitaDoc, TiUsoXsdAroUpdDatiSpecUnitaDoc.MIGRAZ, strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } } // 7. per ogni aggiornamento documento contenuto in un aggiornamento unita doc if (versamento.hasDocumentiToUpd()) { - tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaDocumento(rispostaWs, versamento, - sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaDocumento(tmpAroUpdUnitaDoc, + strutturaUpdVers); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } } // 8. aggiorna aggregazioni - tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaAggregazioni(rispostaWs, versamento, - sessione, tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + tmpRispostaControlli = salvataggioUpdAroVersamentoHelper.aggiornaAggregazioni(tmpAroUnitaDoc); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } @@ -711,7 +771,7 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt if (!tmpRispostaControlli.isrBoolean()) { // errore su db context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } if (tmpRispostaControlli.getrObject() != null) { @@ -719,16 +779,59 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt } if (tmpMonKeyTotalUdKo != null) { - tmpRispostaControlli = salvataggioUpdVersamentoHelper.ereditaVrsSesUpdUnitaDocKoRisolte(rispostaWs, - versamento, sessione, tmpAroUpdUnitaDoc, tmpUpdUnitaDocKo, tmpMonKeyTotalUdKo); + tmpRispostaControlli = salvataggioUpdVersamentoHelper + .ereditaVrsSesUpdUnitaDocKoRisolte(tmpAroUpdUnitaDoc, tmpUpdUnitaDocKo, tmpMonKeyTotalUdKo); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); return false; } } } + // MEV#29276 + /* + * Se backendMetadata di tipo O.S. si effettua il salvataggio (con link su apposita entity) + */ + if (backendMetadata.isObjectStorage()) { + // calculate normalized URN + final String urn = MessaggiWSFormat.formattaBaseUrnUpdUnitaDoc( + MessaggiWSFormat.formattaUrnPartVersatore( + versamento.getStrutturaUpdVers().getVersatoreNonverificato(), true, + Costanti.UrnFormatter.VERS_FMT_STRING), + MessaggiWSFormat.formattaUrnPartUnitaDoc( + versamento.getStrutturaUpdVers().getChiaveNonVerificata(), true, + Costanti.UrnFormatter.UD_FMT_STRING), + tmpAroUpdUnitaDoc.getPgUpdUnitaDoc().longValue(), true, Costanti.UrnFormatter.UPD_FMT_STRING_V3, + Costanti.UrnFormatter.PAD5DIGITS_FMT); + ObjectStorageResource res = objectStorageService.createResourcesInSipAggMd(urn, + backendMetadata.getBackendName(), sipBlob, tmpAroUpdUnitaDoc.getIdUpdUnitaDoc(), + getIdStrut(versamento)); + log.debug("Salvati i SIP nel bucket {} con chiave {} ", res.getBucket(), res.getKey()); + // Salvataggio Dati Specifici realtivi ai metadati iniziali + for (Map.Entry> versIniDatiSpecBlobEntry : versIniDatiSpecBlob + .entrySet()) { + res = objectStorageService.createResourcesInVersIniDatiSpecAggMd(urn, + backendMetadata.getBackendName(), versIniDatiSpecBlobEntry.getValue(), + versIniDatiSpecBlobEntry.getKey().getIdEntitySacer(), TiEntitaSacerAroVersIniDatiSpec + .valueOf(versIniDatiSpecBlobEntry.getKey().getTipiEntitaSacer()), + getIdStrut(versamento)); + log.debug("Salvati i Dati Specifici relativi ai metadati iniziali nel bucket {} con chiave {} ", + res.getBucket(), res.getKey()); + } + // Salvataggio Dati Specifici + for (Map.Entry> updDatiSpecBlobEntry : updDatiSpecBlob + .entrySet()) { + res = objectStorageService.createResourcesInUpdDatiSpecAggMd(urn, backendMetadata.getBackendName(), + updDatiSpecBlobEntry.getValue(), updDatiSpecBlobEntry.getKey().getIdEntitySacer(), + TiEntitaAroUpdDatiSpecUnitaDoc.valueOf(updDatiSpecBlobEntry.getKey().getTipiEntitaSacer()), + getIdStrut(versamento)); + log.debug("Salvati i Dati Specifici dell'aggiornamento metadati nel bucket {} con chiave {} ", + res.getBucket(), res.getKey()); + } + } + // end MEV#29276 + // MEV#27048 if (CostantiDB.TipiStatoElementoVersato.IN_ATTESA_SCHED.name() .equals(versamento.getStrutturaUpdVers().getTiStatoUpdElencoVers().name())) { @@ -741,14 +844,14 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento.getVersamento().getUnitaDocumentaria().getIntestazione().getChiave().getAnno()); pl.setDtCreazione(versamento.getStrutturaUpdVers().getDataVersamento().getTime()); - tmpRispostaControlli = jmsProducerUtilEjb.inviaMessaggioInFormatoJson(connectionFactory, queue, pl, - "CodaElenchiDaElabInAttesaSched"); + tmpRispostaControlli = jmsProducerUtilEjb.manageMessageGroupingInFormatoJson(connectionFactory, queue, + pl, "CodaElenchiDaElab", String.valueOf(pl.getIdStrut())); if (!tmpRispostaControlli.isrBoolean()) { context.setRollbackOnly(); rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666P, tmpRispostaControlli.getDsErr()); - log.error( - "Eccezione nella fase di Invio messaggio alla coda JMS " + tmpRispostaControlli.getDsErr()); + log.error("Eccezione nella fase di Invio messaggio alla coda JMS {}", + tmpRispostaControlli.getDsErr()); return false; } } @@ -766,18 +869,24 @@ public boolean salvaAggiornamento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt tmpRispostaControlli.setCodErr(MessaggiWSBundle.ERR_666P); tmpRispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666P, "Errore interno nella fase di salvataggio aggiornamento: " + e.getMessage())); - this.impostaErrore(rispostaWs, versamento, tmpRispostaControlli); + this.impostaErrore(rispostaWs, tmpRispostaControlli); log.error("Errore interno nella fase di salvataggio aggiornamento.", e); return false; } return true; } - private void impostaErrore(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - RispostaControlli tmpRispostaControlli) { + private void impostaErrore(RispostaWSUpdVers rispostaWs, RispostaControlli tmpRispostaControlli) { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); rispostaWs.setEsitoWsError(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_ERRORIDB), tmpRispostaControlli.getCodErr(), tmpRispostaControlli.getDsErr()); } + private BigDecimal getIdStrut(UpdVersamentoExt versamento) { + if (versamento.getStrutturaUpdVers() != null && versamento.getStrutturaUpdVers().getIdStruttura() != 0) { + return BigDecimal.valueOf(versamento.getStrutturaUpdVers().getIdStruttura()); + } + return null; + } + } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/UpdGestioneDatiSpec.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/UpdGestioneDatiSpec.java new file mode 100644 index 0000000..db5cf7b --- /dev/null +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/UpdGestioneDatiSpec.java @@ -0,0 +1,516 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package it.eng.parer.ws.versamentoUpd.ejb; + +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Date; + +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; +import javax.xml.XMLConstants; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.ValidationEvent; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Element; +import org.xml.sax.SAXException; + +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.ejb.ControlliSemantici; +import it.eng.parer.ws.ejb.XmlUpdVersCache; +import it.eng.parer.ws.utils.CostantiDB.TipiEntitaSacer; +import it.eng.parer.ws.utils.CostantiDB.TipiUsoDatiSpec; +import it.eng.parer.ws.utils.MessaggiWSBundle; +import it.eng.parer.ws.utils.XmlValidationEventHandler; +import it.eng.parer.ws.versamento.dto.DatoSpecifico; +import it.eng.parer.ws.versamento.dto.RispostaControlliAttSpec; +import it.eng.parer.ws.versamentoUpd.utils.UpdCostanti; +import it.eng.parer.ws.xml.versUpdReq.DatiSpecificiType; + +@Stateless(mappedName = "UpdGestioneDatiSpec") +@LocalBean +public class UpdGestioneDatiSpec { + + private static final Logger log = LoggerFactory.getLogger(UpdGestioneDatiSpec.class); + // stateless ejb per i controlli sul db + @EJB + private ControlliSemantici controlliSemantici; + // singleton ejb di gestione cache dei parser Castor + @EJB + private XmlUpdVersCache xmlVersCache; + + public RispostaControlliAttSpec parseDatiSpec(TipiEntitaSacer tipoEntita, + JAXBElement datiSpecificiElement, long idTipoElemento, String desElemento, + String desTipoElemento, String sistemaDiMigrazione, long idStruttura, boolean candelDatiSpec) { + + DatiSpecificiType datiSpecifici; + DatoSpecifico tmpAttSpecAtteso; + SchemaFactory tmpSchemaFactoryValidazSpec = null; + Schema tmpSchemaValidazSpec = null; + String versione; + long tmpIdVersioneXsd; + Date tmpIstanteCorrente = new Date(); + + RispostaControlliAttSpec rispostaControlliAttSpec = new RispostaControlliAttSpec(); + rispostaControlliAttSpec.setrBoolean(false); + + if (datiSpecificiElement == null || datiSpecificiElement.isNil()) { + // verifica che esistano dati specifici attesi per idTipoEntita + tipoentita + // alla data corrente + RispostaControlli rispostaControlli = controlliSemantici.checkPresenzaDatiSpec(TipiUsoDatiSpec.VERS, + tipoEntita, sistemaDiMigrazione, idStruttura, idTipoElemento, tmpIstanteCorrente); + if (rispostaControlli.getCodErr() != null)/* 666 */ { + // è un errore grave ... + rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); + rispostaControlliAttSpec.setDsErr(rispostaControlli.getDsErr()); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + + } + if (rispostaControlli.isrBoolean()) { + // errore, perché non ha inserito il tag datispecifici e questo era richiesto + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_001_002); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_001_002, + tipoEntita.descrivi(), desElemento, desTipoElemento)); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + } else { + datiSpecifici = datiSpecificiElement.getValue(); + versione = datiSpecifici.getVersioneDatiSpecifici(); + if (candelDatiSpec && (versione == null || versione.trim().isEmpty())) { + if (rispostaControlliAttSpec.getCodErr() != null)/* 666 */ { + // è un errore grave ... + rispostaControlliAttSpec.setCodErr(rispostaControlliAttSpec.getCodErr()); + rispostaControlliAttSpec.setDsErr(rispostaControlliAttSpec.getDsErr()); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + if (rispostaControlliAttSpec.isrBoolean()) { + // errore, perché eliminazione non è consentita, poiche esistono versioni attive alla data corrente + // TODO ADD CONTROLLO + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_001_002); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_001_002, + tipoEntita.descrivi(), desElemento, desTipoElemento)); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } else { + // Se l'elemento DatiSpecifici esite per l'UD e viene passato con solo l'elemento versione vuoto + // può essere eliminato poichè non esistono versioni attive alla data corrente + rispostaControlliAttSpec.setrLong(0); + rispostaControlliAttSpec.setrBoolean(true); + // impostazione dell'Id dell'Xsd + rispostaControlliAttSpec.setIdRecXsdDatiSpec(rispostaControlliAttSpec.getrLong()); + rispostaControlliAttSpec.setrBoolean(true); + return rispostaControlliAttSpec; + } + } else { + RispostaControlli rispostaControlli = controlliSemantici.checkXSDDatiSpec(TipiUsoDatiSpec.VERS, + tipoEntita, sistemaDiMigrazione, idStruttura, idTipoElemento, tmpIstanteCorrente, versione); + if (rispostaControlli.getCodErr() != null) { + // è un errore grave ... + rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); + rispostaControlliAttSpec.setDsErr(rispostaControlli.getDsErr()); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + + if (rispostaControlli.getrString() == null || rispostaControlli.getrString().length() == 0) { + // errore, perché non ha trovato il validatore dei dati specifici per il tipo + // doc e versione indicato + // cerco se per caso quella versione di dati spec esiste ma è disattivata + RispostaControlli rc = controlliSemantici.checkPresenzaVersioneDatiSpec(TipiUsoDatiSpec.VERS, + tipoEntita, sistemaDiMigrazione, idStruttura, idTipoElemento, versione); + if (rc.getCodErr() != null) { + // è un errore grave ... + rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); + rispostaControlliAttSpec.setDsErr(rispostaControlli.getDsErr()); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + if (rc.isrBoolean()) { + // errore, perché la versione di dati specifici indicata è disattiva, quindi non modificabile + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_001_004); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_001_004, + tipoEntita.descrivi(), desElemento, versione, desTipoElemento)); + rispostaControlliAttSpec.setrBoolean(false); + + } else { + // Errore nella verifica dei dati specifici. + // Non sono ammissibili dati per il tipo elemento e la versione indicati. + // errore, perché non ha inserito il tag datispecifici e DATISPEC_001_001 era richiesto + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_001_001); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_001_001, + tipoEntita.descrivi(), desElemento, versione, desTipoElemento)); + rispostaControlliAttSpec.setrBoolean(false); + } + return rispostaControlliAttSpec; + } + + tmpIdVersioneXsd = rispostaControlli.getrLong(); + + // compilazione schema + // 1. Lookup a factory for the W3C XML Schema language + tmpSchemaFactoryValidazSpec = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + // anche in questo caso l'eccezione non deve mai verificarsi, a meno di non aver + // caricato + // nel database un xsd danneggiato... + try { + // 2. Compile the schema. + tmpSchemaValidazSpec = tmpSchemaFactoryValidazSpec + .newSchema(new StreamSource(new StringReader(rispostaControlli.getrString()))); + } catch (SAXException e) { + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "AggGestioneDatiSpec.parseDatiSpec.il validatore xsd specifico è errato: " + + e.getMessage())); + rispostaControlliAttSpec.setrBoolean(false); + log.error("Errore interno: il validatore xsd specifico è errato. Eccezione: " + + e.getLocalizedMessage()); + return rispostaControlliAttSpec; + } + + XmlValidationEventHandler handler = new XmlValidationEventHandler(); + try { + Marshaller m = xmlVersCache.getVersReqCtxforDatiSpecifici().createMarshaller(); + m.setSchema(tmpSchemaValidazSpec); + m.setEventHandler(handler); + // 3. Marshall and validate + m.marshal(datiSpecificiElement, new StringWriter()); + } catch (JAXBException e) { + ValidationEvent events = handler.getFirstErrorValidationEvent(); + + // Errore nella verifica dei dati specifici. + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_003_001); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_003_001, + tipoEntita.descrivi(), desElemento, events.getMessage())); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } catch (Exception e) { + // anche in questo caso l'eccezione non deve mai verificarsi + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "UpdGestioneDatiSpec.parseDatiSpec.problemi nella validazione dei dati spec: " + + e.getMessage())); + rispostaControlliAttSpec.setrBoolean(false); + log.error("Errore interno: problemi nella validazione dei dati spec. Eccezione: ", e); + return rispostaControlliAttSpec; + } + + // leggi la tabella dei dati spec attesi + rispostaControlliAttSpec = controlliSemantici.checkDatiSpecifici(TipiUsoDatiSpec.VERS, tipoEntita, + sistemaDiMigrazione, idStruttura, idTipoElemento, tmpIdVersioneXsd); + if (rispostaControlliAttSpec.getCodErr() != null) { + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + + // impostazione dell'Id dell'Xsd + rispostaControlliAttSpec.setIdRecXsdDatiSpec(tmpIdVersioneXsd); + + for (Element element : datiSpecifici.getAny()) { + String tmpChiave = element.getLocalName(); + tmpAttSpecAtteso = rispostaControlliAttSpec.getDatiSpecifici().get(tmpChiave); + if (tmpAttSpecAtteso != null) { + if (tmpAttSpecAtteso.getValore() == null) { + + if (element.getFirstChild() != null) { + String tmpValore = element.getFirstChild().getNodeValue(); + if (tmpValore.length() <= UpdCostanti.MAXLEN_DATOSPEC) { + tmpAttSpecAtteso.setValore(tmpValore); + } else { + // "Errore nei dati specifici: uno o più valori superano + // la lunghezza di " + MAXLEN_DATOSPEC + " caratteri" + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_002_001); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString( + MessaggiWSBundle.DATISPEC_002_001, tipoEntita.descrivi(), desElemento, + tmpChiave, UpdCostanti.MAXLEN_DATOSPEC)); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + } else { + tmpAttSpecAtteso.setValore(null); + } + } else { + // "Errore nei dati specifici: uno o più dati risultano duplicati"); + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_002_002); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString( + MessaggiWSBundle.DATISPEC_002_002, tipoEntita.descrivi(), desElemento, tmpChiave)); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + } else { + + // MAC#29906 - Correzione della mancata gestione dell'errore per dati specifici che non + // coincidono con l'XSD + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_003_002); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_003_002, + tipoEntita.descrivi(), desElemento, tmpChiave)); + /* + * rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); + * rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + * "UpdGestioneDatiSpec.parseDatiSpec.i dati specifici attesi " + "non coincidono con l'XSD ")); + */ + rispostaControlliAttSpec.setrBoolean(false); + log.error("Errore interno: i dati specifici attesi non coincidono con l'XSD"); + return rispostaControlliAttSpec; + } + } + } + } + rispostaControlliAttSpec.setrBoolean(true); + return rispostaControlliAttSpec; + + } + + // dati di migrazione, non c'è l'id tipo ma si valuta il sistema migrante + public RispostaControlliAttSpec parseDatiSpecMig(TipiEntitaSacer tipoEntita, + JAXBElement datiSpecificiElement, long idTipoElemento, String desElemento, + String desTipoElemento, String sistemaDiMigrazione, long idStruttura, boolean candelDatiSpec) { + DatiSpecificiType datiSpecifici; + DatoSpecifico tmpAttSpecAtteso; + SchemaFactory tmpSchemaFactoryValidazSpec = null; + Schema tmpSchemaValidazSpec = null; + String versione; + long tmpIdVersioneXsd; + boolean tmpSistMigDef = true; + Date tmpIstanteCorrente = new Date(); + + RispostaControlliAttSpec rispostaControlliAttSpec = new RispostaControlliAttSpec(); + rispostaControlliAttSpec.setrBoolean(false); + + // verifica che il sistema migrante sia definito + if (sistemaDiMigrazione == null || sistemaDiMigrazione.isEmpty()) { + tmpSistMigDef = false; + } + + if (tmpSistMigDef) { + datiSpecifici = datiSpecificiElement.getValue(); + versione = datiSpecifici.getVersioneDatiSpecifici(); + if (candelDatiSpec && (versione == null || versione.trim().isEmpty())) { + + // verifica che esistano dati specifici attesi per idTipoEntita + tipoentita + // alla data corrente + RispostaControlli rispostaControlli = controlliSemantici.checkPresenzaDatiSpec(TipiUsoDatiSpec.MIGRAZ, + tipoEntita, sistemaDiMigrazione, idStruttura, idTipoElemento, tmpIstanteCorrente); + if (rispostaControlli.getCodErr() != null)/* 666 */ { + // è un errore grave ... + rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); + rispostaControlliAttSpec.setDsErr(rispostaControlli.getDsErr()); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + if (rispostaControlli.isrBoolean()) { + // errore, perché eliminazione non è consentita, poiche esistono versioni attive alla data corrente + // TODO ADD CONTROLLO + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_001_002); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPECM_001_002, + tipoEntita.descrivi(), desElemento, desTipoElemento)); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } else { + // Se l'elemento DatiSpecifici esite per l'UD e viene passato con solo l'elemento versione vuoto + // può essere eliminato poichè non esistono versioni attive alla data corrente + rispostaControlli.setrLong(0); + rispostaControlli.setrBoolean(true); + // impostazione dell'Id dell'Xsd + rispostaControlliAttSpec.setIdRecXsdDatiSpec(rispostaControlli.getrLong()); + rispostaControlliAttSpec.setrBoolean(true); + return rispostaControlliAttSpec; + } + + } else { + RispostaControlli rispostaControlli = controlliSemantici.checkXSDDatiSpec(TipiUsoDatiSpec.MIGRAZ, + tipoEntita, sistemaDiMigrazione, idStruttura, 0, tmpIstanteCorrente, versione); + if (rispostaControlli.getCodErr() != null) { + rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); + rispostaControlliAttSpec.setDsErr(rispostaControlli.getDsErr()); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + + if (rispostaControlli.getrString() == null || rispostaControlli.getrString().length() == 0) { + // errore, perché non ha trovato il validatore dei dati specifici per il tipo + // doc e versione indicato + // cerco se per caso quella versione di dati spec esiste ma è disattivata + RispostaControlli rc = controlliSemantici.checkPresenzaVersioneDatiSpec(TipiUsoDatiSpec.MIGRAZ, + tipoEntita, sistemaDiMigrazione, idStruttura, 0, versione); + if (rc.getCodErr() != null) { + rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); + rispostaControlliAttSpec.setDsErr(rispostaControlli.getDsErr()); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + if (rc.isrBoolean()) { + // la versione è disattivata + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_001_004); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_001_004, + tipoEntita.descrivi(), desElemento, versione, desTipoElemento)); + rispostaControlliAttSpec.setrBoolean(false); + } else { + // Errore nella verifica dei dati specifici. + // Non sono ammissibili dati per il tipo elemento e la versione indicati. + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_001_001); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPECM_001_001, + tipoEntita.descrivi(), desElemento, versione, desTipoElemento)); + rispostaControlliAttSpec.setrBoolean(false); + } + return rispostaControlliAttSpec; + } + + tmpIdVersioneXsd = rispostaControlli.getrLong(); + + // compilazione schema + // 1. Lookup a factory for the W3C XML Schema language + tmpSchemaFactoryValidazSpec = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + // anche in questo caso l'eccezione non deve mai verificarsi, a meno di non aver + // caricato + // nel database un xsd danneggiato... + try { + // 2. Compile the schema. + tmpSchemaValidazSpec = tmpSchemaFactoryValidazSpec + .newSchema(new StreamSource(new StringReader(rispostaControlli.getrString()))); + } catch (SAXException e) { + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "UpdGestioneDatiSpec.parseDatiSpecMig.il validatore xsd specifico è errato: " + + e.getMessage())); + rispostaControlliAttSpec.setrBoolean(false); + log.error("Errore interno: il validatore xsd di migrazione è errato. Eccezione: " + + e.getLocalizedMessage()); + return rispostaControlliAttSpec; + } + + XmlValidationEventHandler handler = new XmlValidationEventHandler(); + try { + Marshaller m = xmlVersCache.getVersReqCtxforDatiSpecifici().createMarshaller(); + m.setSchema(tmpSchemaValidazSpec); + m.setEventHandler(handler); + // 3. Marshall and validate + m.marshal(datiSpecificiElement, new StringWriter()); + } catch (JAXBException e) { + ValidationEvent events = handler.getFirstErrorValidationEvent(); + + // Errore nella verifica dei dati specifici. + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_003_001); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPECM_003_001, + tipoEntita.descrivi(), desElemento, events.getMessage())); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } catch (Exception e) { + // anche in questo caso l'eccezione non deve mai verificarsi + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "UpdGestioneDatiSpec.parseDatiSpecMig.problemi nella validazione dei dati spec: " + + e.getMessage())); + rispostaControlliAttSpec.setrBoolean(false); + log.error("Errore interno: problemi nella validazione dei dati spec. di migrazione Eccezione: ", e); + return rispostaControlliAttSpec; + } + + // leggi la tabella dei dati spec attesi + rispostaControlliAttSpec = controlliSemantici.checkDatiSpecifici(TipiUsoDatiSpec.MIGRAZ, tipoEntita, + sistemaDiMigrazione, idStruttura, 0, tmpIdVersioneXsd); + if (rispostaControlliAttSpec.getCodErr() != null) { + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + + // impostazione dell'Id dell'Xsd + rispostaControlliAttSpec.setIdRecXsdDatiSpec(tmpIdVersioneXsd); + + // estrazione dati nella collection dei dati spec attesi + for (Element element : datiSpecifici.getAny()) { + String tmpChiave = element.getLocalName(); + tmpAttSpecAtteso = rispostaControlliAttSpec.getDatiSpecifici().get(tmpChiave); + if (tmpAttSpecAtteso != null) { + if (tmpAttSpecAtteso.getValore() == null) { + if (element.getFirstChild() != null) { + String tmpValore = element.getFirstChild().getNodeValue(); + if (tmpValore.length() <= UpdCostanti.MAXLEN_DATOSPEC) { + tmpAttSpecAtteso.setValore(tmpValore); + } else { + // "Errore nei dati specifici: uno o più valori superano + // la lunghezza di " + MAXLEN_DATOSPEC + " caratteri" + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_002_001); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString( + MessaggiWSBundle.DATISPECM_002_001, tipoEntita.descrivi(), desElemento, + tmpChiave, UpdCostanti.MAXLEN_DATOSPEC)); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + } else { + tmpAttSpecAtteso.setValore(null); + } + } else { + // "Errore nei dati specifici: uno o più dati risultano duplicati"); + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_002_002); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString( + MessaggiWSBundle.DATISPECM_002_002, tipoEntita.descrivi(), desElemento, tmpChiave)); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + } else { + // rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); + // rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + // "GestioneDatiSpec.parseDatiSpecMig.i dati specifici attesi" + // + " non coincidono con l'XSD ")); + // MAC#29906 - Correzione della mancata gestione dell'errore per dati specifici che non + // coincidono con l'XSD + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_003_002); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_003_002, + tipoEntita.descrivi(), desElemento, tmpChiave)); + + rispostaControlliAttSpec.setrBoolean(false); + log.error("Errore interno: i dati specifici attesi di migrazione non coincidono con l'XSD"); + return rispostaControlliAttSpec; + } + } + } + } else { + /* + * nota questo è un problema, perché questo controllo deve essere già stato fatto nella classe + * VerificaVersione + */ + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "UpdGestioneDatiSpec.parseDatiSpecMig. Presenti dati specifici di migrazione " + + "e sistema migrante non specificato ")); + rispostaControlliAttSpec.setrBoolean(false); + log.error("Errore interno: Presenti dati specifici di migrazione e sistema migrante non specificato"); + return rispostaControlliAttSpec; + } + + rispostaControlliAttSpec.setrBoolean(true); + return rispostaControlliAttSpec; + } + +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/LogSessioneUpdVersamentoHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/LogSessioneUpdVersamentoHelper.java index 35c5ec8..a85937b 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/LogSessioneUpdVersamentoHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/LogSessioneUpdVersamentoHelper.java @@ -1,48 +1,23 @@ -package it.eng.parer.ws.versamentoUpd.ejb.help; - -import java.io.StringWriter; -import java.math.BigDecimal; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.ejb.EJB; -import javax.ejb.LocalBean; -import javax.ejb.Stateless; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.persistence.EntityManager; -import javax.persistence.LockModeType; -import javax.persistence.PersistenceContext; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +package it.eng.parer.ws.versamentoUpd.ejb.help; -import it.eng.parer.entity.AroUpdUnitaDoc; -import it.eng.parer.entity.AroXmlUpdUnitaDoc; -import it.eng.parer.entity.DecControlloWs; -import it.eng.parer.entity.DecErrSacer; -import it.eng.parer.entity.DecRegistroUnitaDoc; -import it.eng.parer.entity.DecTipoDoc; -import it.eng.parer.entity.DecTipoUnitaDoc; -import it.eng.parer.entity.IamUser; -import it.eng.parer.entity.MonContaSesUpdUdKo; -import it.eng.parer.entity.MonKeyTotalUd; -import it.eng.parer.entity.MonKeyTotalUdKo; -import it.eng.parer.entity.OrgStrut; -import it.eng.parer.entity.VrsErrSesUpdUnitaDocErr; -import it.eng.parer.entity.VrsErrSesUpdUnitaDocKo; -import it.eng.parer.entity.VrsSesUpdUnitaDocErr; -import it.eng.parer.entity.VrsSesUpdUnitaDocKo; -import it.eng.parer.entity.VrsUpdUnitaDocKo; -import it.eng.parer.entity.VrsXmlSesUpdUnitaDocErr; -import it.eng.parer.entity.VrsXmlSesUpdUnitaDocKo; +import it.eng.parer.entity.*; import it.eng.parer.entity.constraint.MonContaSesUpdUdKo.TiStatoUdpUdKoMonContaSesUpdUdKo; import it.eng.parer.entity.constraint.VrsErrSesUpdUnitaDocErr.TiErrVrsErrSesUpdUnitaDocErr; import it.eng.parer.entity.constraint.VrsErrUpdUnitaDocKo.TiErrVrsErrUpdUnitaDocKo; @@ -51,9 +26,10 @@ import it.eng.parer.entity.constraint.VrsUpdUnitaDocKo.TiStatoUdpUdKo; import it.eng.parer.entity.constraint.VrsXmlSesUpdUnitaDocErr.TiXmlVrsXmlSesUpdUnitaDocErr; import it.eng.parer.entity.constraint.VrsXmlSesUpdUnitaDocKo.TiXmlVrsXmlSesUpdUnitaDocKo; +import it.eng.parer.util.Constants; import it.eng.parer.util.ejb.AppServerInstance; -import it.eng.parer.viewEntity.LogVVisLastSched; -import it.eng.parer.viewEntity.VrsVModifUpdUdKo; +import it.eng.parer.view_entity.LogVVisLastSched; +import it.eng.parer.view_entity.VrsVModifUpdUdKo; import it.eng.parer.ws.dto.CSChiave; import it.eng.parer.ws.dto.IRispostaWS; import it.eng.parer.ws.dto.IRispostaWS.StatiSessioneVersEnum; @@ -65,20 +41,33 @@ import it.eng.parer.ws.utils.MessaggiWSHelper; import it.eng.parer.ws.versamento.dto.SyncFakeSessn; import it.eng.parer.ws.versamento.dto.VoceDiErrore; -import it.eng.parer.ws.versamentoUpd.dto.CompRapportoUpdVers; -import it.eng.parer.ws.versamentoUpd.dto.ControlloEseguito; -import it.eng.parer.ws.versamentoUpd.dto.RispostaWSUpdVers; -import it.eng.parer.ws.versamentoUpd.dto.StrutturaUpdVers; -import it.eng.parer.ws.versamentoUpd.dto.UpdComponenteVers; -import it.eng.parer.ws.versamentoUpd.dto.UpdDocumentoVers; -import it.eng.parer.ws.versamentoUpd.dto.UpdUnitaDocColl; +import it.eng.parer.ws.versamentoUpd.dto.*; import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.ejb.*; +import javax.persistence.EntityManager; +import javax.persistence.LockModeType; +import javax.persistence.PersistenceContext; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import java.io.StringWriter; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.*; + import static it.eng.parer.util.DateUtilsConverter.convert; +import static it.eng.parer.util.DateUtilsConverter.convertLocal; +import it.eng.parer.ws.versamento.dto.BackendStorage; /** * * @author sinatti_s */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "LogSessioneUpdVersamentoHelper") @LocalBean public class LogSessioneUpdVersamentoHelper { @@ -101,101 +90,10 @@ public class LogSessioneUpdVersamentoHelper { @PersistenceContext(unitName = "ParerJPA") private EntityManager entityManager; - private final static String CD_DS_ERR_DIVERSI = "Diversi"; - - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli verificaPartizioneUpdErr() { - RispostaControlli rispostaControlli; - rispostaControlli = new RispostaControlli(); - rispostaControlli.setrBoolean(false); - long conta = 0; - try { - String queryStr = "select count(t) from OrgVChkPartitionUpdErr t " - + "where t.flPartSesupderrOk = :flPartSesupderrOk "; - javax.persistence.Query query = entityManager.createQuery(queryStr); - query.setParameter("flPartSesupderrOk", "1"); - conta = (Long) query.getSingleResult(); - - if (conta == 0) { - rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666P); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666P, - "La tabella delle sessioni errate non è correttamente partizionata. " - + "Impossibile salvare aggiornamento di versamento in errore")); - return rispostaControlli; - } - rispostaControlli.setrBoolean(true); - } catch (Exception e) { - rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "UpdLogSessioneHelper.verificaPartizioneUpdErr: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); - } - - return rispostaControlli; - } - - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli verificaPartizioneUpdByAaStrutKo(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione) { - RispostaControlli rispostaControlli; - rispostaControlli = new RispostaControlli(); - rispostaControlli.setrBoolean(false); - StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); - long conta = 0; - try { - String queryStr = "select count(t) from OrgVChkPartitionUpdByAa t " - + "where t.idStrut = :idStrut and t.anno = :anno " - + "and t.flPartSesupdkoAaOk = :flPartSesupdkoAaOk " + "and t.flPartSesupdkoOk = :flPartSesupdkoOk " - + "and t.flPartUpddatispecAaOk = :flPartUpddatispecAaOk " - + "and t.flPartUpddatispecOk = :flPartUpddatispecOk " + "and t.flPartUpdkoAaOk = :flPartUpdkoAaOk " - + "and t.flPartUpdkoOk = :flPartUpdkoOk " - + "and t.flPartVersinidatispecAaOk = :flPartVersinidatispecAaOk " - + "and t.flPartVersinidatispecOk = :flPartVersinidatispecOk " - + "and t.flPartXmlsesupdkoOk = :flPartXmlsesupdkoOk " - + "and t.flPartXmlsesupdkpAaOk = :flPartXmlsesupdkpAaOk " - + "and t.flPartXmlupdAaOk = :flPartXmlupdAaOk " + "and t.flPartXmlupdOk = :flPartXmlupdOk "; - - javax.persistence.Query query = entityManager.createQuery(queryStr); - - query.setParameter("idStrut", strutturaUpdVers.getIdStruttura()); - query.setParameter("anno", strutturaUpdVers.getChiaveNonVerificata().getAnno()); - - query.setParameter("flPartSesupdkoAaOk", "1"); - query.setParameter("flPartSesupdkoOk", "1"); - query.setParameter("flPartUpddatispecAaOk", "1"); - query.setParameter("flPartUpddatispecOk", "1"); - query.setParameter("flPartUpdkoAaOk", "1"); - query.setParameter("flPartUpdkoOk", "1"); - query.setParameter("flPartVersinidatispecAaOk", "1"); - query.setParameter("flPartVersinidatispecOk", "1"); - query.setParameter("flPartXmlsesupdkoOk", "1"); - query.setParameter("flPartXmlsesupdkpAaOk", "1"); - query.setParameter("flPartXmlupdAaOk", "1"); - query.setParameter("flPartXmlupdOk", "1"); - - conta = (Long) query.getSingleResult(); - - if (conta == 0) { - rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666P); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666P, - "La tabella delle sessioni fallite non è correttamente partizionata. " - + "Impossibile salvare l'aggiornamento fallito")); - return rispostaControlli; - } - rispostaControlli.setrBoolean(true); - } catch (Exception e) { - rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "UpdLogSessioneHelper.verificaPartizioneUpdByAaStrutKo: " + e.getMessage())); - log.error("Eccezione nella lettura della tabella di decodifica ", e); - } - - return rispostaControlli; - } + private static final String CD_DS_ERR_DIVERSI = "Diversi"; @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli recuperoUpdUnitaDocOk(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione) { + public RispostaControlli recuperoUpdUnitaDocOk(UpdVersamentoExt versamento, SyncFakeSessn sessione) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); rispostaControlli.setrBoolean(false); @@ -216,7 +114,7 @@ public RispostaControlli recuperoUpdUnitaDocOk(RispostaWSUpdVers rispostaWs, Upd aroUpdUnitaDocs = query.getResultList(); - if (aroUpdUnitaDocs.size() >= 1) { + if (!aroUpdUnitaDocs.isEmpty()) { // se trovato, recupero il risultato che interessa per la verifica rispostaControlli.setrLong(0); @@ -248,12 +146,6 @@ public RispostaControlli scriviUpdUnitaDocErr(RispostaWSUpdVers rispostaWs, UpdV tmpUpdUnitaDocErr.setTsIniSes(convert(sessione.getTmApertura())); tmpUpdUnitaDocErr.setTsFineSes(convert(sessione.getTmChiusura())); tmpUpdUnitaDocErr.setNmUseridWs(sessione.getLoginName()); - // salvo il nome del server/istanza nel cluster che sta salvando i dati e ha - // gestito il versamento - // tmpUpdUnitaDocErr.setCdIndServer(appServerInstance.getName()); - // salvo l'indirizzo IP del sistema che ha effettuato la richiesta di - // versamento/aggiunta - // tmpUpdUnitaDocErr.setCdIndIpClient(sessione.getIpChiamante()); tmpUpdUnitaDocErr.setTiStatoSes(TiStatoSesVrsSesUpdUnitaDocErr.NON_VERIFICATA); if (strutturaUpdVers.getVersatoreNonverificato() != null) { if (StringUtils.isNotBlank(strutturaUpdVers.getVersatoreNonverificato().getAmbiente())) { @@ -330,9 +222,6 @@ public RispostaControlli scriviUpdUnitaDocErr(RispostaWSUpdVers rispostaWs, UpdV entityManager.find(DecRegistroUnitaDoc.class, strutturaUpdVers.getIdTipoREGUnknown())); } - // - // CompRapportoAggiornamentoVers esito = - // rispostaWs.getCompRapportoAggiornamentoVers(); if (rispostaWs.getSeverity() == IRispostaWS.SeverityEnum.ERROR) { // al momento si raccoglie, del controllo, il primo errore collezionato ! tmpUpdUnitaDocErr.setDecErrSacerPrinc(messaggiWSHelper.caricaDecErrore(rispostaWs.getErrorCode())); @@ -358,11 +247,12 @@ public RispostaControlli scriviUpdUnitaDocErr(RispostaWSUpdVers rispostaWs, UpdV @TransactionAttribute(TransactionAttributeType.REQUIRED) public RispostaControlli scriviXmlSesUpdUnitaDocErr(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, VrsSesUpdUnitaDocErr vrsSesUpdUnitaDocErr) { + SyncFakeSessn sessione, VrsSesUpdUnitaDocErr vrsSesUpdUnitaDocErr, BackendStorage backendMetadata, + Map sipBlob) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); // salvo xml di request e response sessione errata tmpRispostaControlli.setrBoolean(false); - CompRapportoUpdVers esito = rispostaWs.getCompRapportoUpdVers(); + rispostaWs.getCompRapportoUpdVers(); StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); try { VrsXmlSesUpdUnitaDocErr tmpXmlSesUpdUnitaDocErr = new VrsXmlSesUpdUnitaDocErr(); @@ -372,8 +262,14 @@ public RispostaControlli scriviXmlSesUpdUnitaDocErr(RispostaWSUpdVers rispostaWs tmpXmlSesUpdUnitaDocErr.setVrsSesUpdUnitaDocErr(vrsSesUpdUnitaDocErr); tmpXmlSesUpdUnitaDocErr.setTiXml(TiXmlVrsXmlSesUpdUnitaDocErr.RICHIESTA); tmpXmlSesUpdUnitaDocErr.setCdVersioneXml(strutturaUpdVers.getVersioneIndiceSipNonVerificata()); - tmpXmlSesUpdUnitaDocErr - .setBlXml(versamento.getDatiXml().length() == 0 ? "--" : versamento.getDatiXml()); + // MEV#29276 + String blXml = versamento.getDatiXml().length() == 0 ? "--" : versamento.getDatiXml(); + if (backendMetadata.isDataBase()) { + tmpXmlSesUpdUnitaDocErr.setBlXml(blXml); + } else { + sipBlob.put(TiXmlVrsXmlSesUpdUnitaDocErr.RICHIESTA.name(), blXml); + } + // end MEV#29276 entityManager.persist(tmpXmlSesUpdUnitaDocErr); } String xmlesito = this.generaRapportoVersamento(rispostaWs); @@ -382,7 +278,13 @@ public RispostaControlli scriviXmlSesUpdUnitaDocErr(RispostaWSUpdVers rispostaWs tmpXmlSesUpdUnitaDocErr.setVrsSesUpdUnitaDocErr(vrsSesUpdUnitaDocErr); tmpXmlSesUpdUnitaDocErr.setTiXml(TiXmlVrsXmlSesUpdUnitaDocErr.RISPOSTA); tmpXmlSesUpdUnitaDocErr.setCdVersioneXml(strutturaUpdVers.getVersioneIndiceSipNonVerificata()); - tmpXmlSesUpdUnitaDocErr.setBlXml(xmlesito); + // MEV#29276 + if (backendMetadata.isDataBase()) { + tmpXmlSesUpdUnitaDocErr.setBlXml(xmlesito); + } else { + sipBlob.put(TiXmlVrsXmlSesUpdUnitaDocErr.RISPOSTA.name(), xmlesito); + } + // end MEV#29276 entityManager.persist(tmpXmlSesUpdUnitaDocErr); tmpRispostaControlli.setrBoolean(true); } catch (Exception e) { @@ -397,8 +299,7 @@ public RispostaControlli scriviXmlSesUpdUnitaDocErr(RispostaWSUpdVers rispostaWs } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli cercaAggiornamentoKo(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione) { + public RispostaControlli cercaAggiornamentoKo(UpdVersamentoExt versamento) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); // cerco e recupero il fascicolo fallito tmpRispostaControlli.setrBoolean(false); @@ -422,11 +323,11 @@ public RispostaControlli cercaAggiornamentoKo(RispostaWSUpdVers rispostaWs, UpdV // errore per l'aggiornamento. in questo caso dovrò creare la riga in tabella // nel caso di scrittura di sessione fallita. tmpRispostaControlli.setrBoolean(true); - if (updUnitaDocKo.size() > 0) { + if (!updUnitaDocKo.isEmpty()) { // se poi ho anche trovato qualcosa di utile, lo restituisco al // chiamante dopo averlo bloccato in modo esclusivo - Map properties = new HashMap(); - properties.put("javax.persistence.lock.timeout", 25); + Map properties = new HashMap<>(); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, 25000); VrsUpdUnitaDocKo tmpVrsUpdUnitaDocKo = entityManager.find(VrsUpdUnitaDocKo.class, updUnitaDocKo.get(0).getIdUpdUnitaDocKo(), LockModeType.PESSIMISTIC_WRITE, properties); @@ -465,7 +366,7 @@ public RispostaControlli scriviVrsUpdUnitaDocKo(RispostaWSUpdVers rispostaWs, Up // scrive una nuova istanza di Fascicolo KO per il versamento tmpRispostaControlli.setrBoolean(false); StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); - CompRapportoUpdVers esito = rispostaWs.getCompRapportoUpdVers(); + rispostaWs.getCompRapportoUpdVers(); try { VrsUpdUnitaDocKo tmpUpdUnitaDocKo = new VrsUpdUnitaDocKo(); @@ -480,7 +381,6 @@ public RispostaControlli scriviVrsUpdUnitaDocKo(RispostaWSUpdVers rispostaWs, Up tmpUpdUnitaDocKo.setDecControlloWsPrinc( controlliWSHelper.caricaCdControlloWs(rispostaWs.getControlloWs().getCdControllo())); tmpUpdUnitaDocKo.setTiStatoUdpUdKo(TiStatoUdpUdKo.NON_VERIFICATO); - // TODO da verificare if (strutturaUpdVers.getIdRegistro() > 0) { tmpUpdUnitaDocKo.setDecRegistroUnitaDocLast( entityManager.find(DecRegistroUnitaDoc.class, strutturaUpdVers.getIdRegistro())); @@ -504,7 +404,6 @@ public RispostaControlli scriviVrsUpdUnitaDocKo(RispostaWSUpdVers rispostaWs, Up tmpUpdUnitaDocKo.setDecTipoUnitaDocLast(decTipoUnitaDoc); } } - // TODO da verificare DecTipoDoc decTipoDocPrinc = null; long idDecTipoDoc = 0; if (strutturaUpdVers.getIdTipoDocPrincipale() > 0) { @@ -519,7 +418,6 @@ public RispostaControlli scriviVrsUpdUnitaDocKo(RispostaWSUpdVers rispostaWs, Up } } - // TODO: necessaria una logica di gestione recupero della prima e dell'ultima // sessione in KO tmpUpdUnitaDocKo.setVrsSesUpdUnitaDocKoFirst(null); tmpUpdUnitaDocKo.setVrsSesUpdUnitaDocKoLast(null); @@ -549,7 +447,7 @@ public RispostaControlli scriviSessioneUpdUnitaDocKo(RispostaWSUpdVers rispostaW RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); - CompRapportoUpdVers esito = rispostaWs.getCompRapportoUpdVers(); + rispostaWs.getCompRapportoUpdVers(); try { TiStatoSesUpdKo tmpStatoSessione = null; @@ -682,7 +580,6 @@ public RispostaControlli scriviSessioneUpdUnitaDocKo(RispostaWSUpdVers rispostaW updModifUpdKo.getIdTipoDocPrincLast().longValue())); } } else { - // TODO : da verificare vrsUpdUnitaDocKo.setDecTipoUnitaDocLast(tmpSesUpdUnitaDocKo.getDecTipoUnitaDoc()); vrsUpdUnitaDocKo.setDecRegistroUnitaDocLast(tmpSesUpdUnitaDocKo.getDecRegistroUnitaDoc()); @@ -696,11 +593,6 @@ public RispostaControlli scriviSessioneUpdUnitaDocKo(RispostaWSUpdVers rispostaW // aggiungo la sessione appena creata all'aggiornamento KO vrsUpdUnitaDocKo.getVrsSesUpdUnitaDocKos().add(tmpSesUpdUnitaDocKo); } - /* - * else { // TODO nel caso dei fascicoli KO veniva settato un flag per segnalare la presenza di una sessione - * fallita ! // altrimenti aggiorno il flag di errore del fascicolo OK, // che forse è già alzato, ma male - * non fa... fascicoloOk.setFlSesFascicoloKo("1"); } - */ tmpRispostaControlli.setrObject(tmpSesUpdUnitaDocKo); entityManager.flush(); tmpRispostaControlli.setrBoolean(true); @@ -762,13 +654,13 @@ public RispostaControlli lockAndGetMonContaSesUpdUdKo(VrsUpdUnitaDocKo updUnitaD query.setParameter("decTipoUnitaDoc", updUnitaDocKo.getDecTipoUnitaDocLast()); mcfks = query.getResultList(); - if (mcfks.size() > 0) { + if (!mcfks.isEmpty()) { MonKeyTotalUdKo tmpMonKeyTotalUdKo = mcfks.get(0); tmpRispostaControlli.setrObject(tmpMonKeyTotalUdKo); // lock each one for (MonContaSesUpdUdKo tmpMonContaSesUpdUdKo : tmpMonKeyTotalUdKo.getMonContaSesUpdUdKos()) { - Map properties = new HashMap(); - properties.put("javax.persistence.lock.timeout", 25); + Map properties = new HashMap<>(); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, 25000); entityManager.find(MonContaSesUpdUdKo.class, tmpMonContaSesUpdUdKo.getIdContaSesUpdUdKo(), LockModeType.PESSIMISTIC_WRITE, properties); } @@ -796,7 +688,7 @@ public RispostaControlli aggiornaConteggioMonContaSesUpdUdKo(VrsSesUpdUnitaDocKo TiStatoUdpUdKoMonContaSesUpdUdKo.valueOf(vrsSesUpdUnitaDocKo.getTiStatoSesUpdKo().name())); mcfks = query.getResultList(); - if (mcfks.size() > 0) { + if (!mcfks.isEmpty()) { if (addOrCreate) { mcfks.get(0).setNiSesUpdUdKo(mcfks.get(0).getNiSesUpdUdKo().add(BigDecimal.ONE)); } else { @@ -834,11 +726,11 @@ public RispostaControlli verificaDataAttivazioneJob() { String queryStr = "select u " + " from LogVVisLastSched u " + " where u.nmJob = 'CALCOLO_CONTENUTO_AGGIORNAMENTI' " + " order by u.dtRegLogJobIni desc "; - javax.persistence.Query query = entityManager.createQuery(queryStr, AroXmlUpdUnitaDoc.class); + javax.persistence.Query query = entityManager.createQuery(queryStr, LogVVisLastSched.class); logVVisLastScheds = query.getResultList(); - if (logVVisLastScheds.size() >= 1) { + if (!logVVisLastScheds.isEmpty()) { // se trovato, recupero il risultato che interessa per la verifica rispostaControlli.setrLong(0); @@ -858,7 +750,8 @@ public RispostaControlli verificaDataAttivazioneJob() { @TransactionAttribute(TransactionAttributeType.REQUIRED) public RispostaControlli scriviXmlUpdUnitaDocKo(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, VrsSesUpdUnitaDocKo sesUpdUnitaDocKo) { + SyncFakeSessn sessione, VrsSesUpdUnitaDocKo sesUpdUnitaDocKo, BackendStorage backendMetadata, + Map sipBlob) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); // salvo xml di request e response sessione fallita tmpRispostaControlli.setrBoolean(false); @@ -866,14 +759,25 @@ public RispostaControlli scriviXmlUpdUnitaDocKo(RispostaWSUpdVers rispostaWs, Up CompRapportoUpdVers esito = rispostaWs.getCompRapportoUpdVers(); try { + final LocalDate dtRegXml = convertLocal(sessione.getTmApertura()); VrsXmlSesUpdUnitaDocKo tmpXmlSesUpdUnitaDocKo = new VrsXmlSesUpdUnitaDocKo(); tmpXmlSesUpdUnitaDocKo.setVrsSesUpdUnitaDocKo(sesUpdUnitaDocKo); tmpXmlSesUpdUnitaDocKo.setTiXml(TiXmlVrsXmlSesUpdUnitaDocKo.RICHIESTA); tmpXmlSesUpdUnitaDocKo.setCdVersioneXml(strutturaUpdVers.getVersioneIndiceSipNonVerificata()); - tmpXmlSesUpdUnitaDocKo.setBlXml(versamento.getDatiXml().length() == 0 ? "--" : versamento.getDatiXml()); + // MEV#29276 + String blXml = versamento.getDatiXml().length() == 0 ? "--" : versamento.getDatiXml(); + if (backendMetadata.isDataBase()) { + tmpXmlSesUpdUnitaDocKo.setBlXml(blXml); + } else { + sipBlob.put(TiXmlVrsXmlSesUpdUnitaDocKo.RICHIESTA.name(), blXml); + } + // end MEV#29276 tmpXmlSesUpdUnitaDocKo.setOrgStrut(sesUpdUnitaDocKo.getOrgStrut()); // da VRS_UPD_UNITA_DOC_KO - tmpXmlSesUpdUnitaDocKo.setDtRegXml(convert(sessione.getTmApertura())); + // TransactionAttribute + tmpXmlSesUpdUnitaDocKo.setDtRegXml(dtRegXml); + // MEV#30089 + tmpXmlSesUpdUnitaDocKo.setAaRegXml(dtRegXml.getYear()); entityManager.persist(tmpXmlSesUpdUnitaDocKo); sesUpdUnitaDocKo.getVrsXmlSesUpdUnitaDocKos().add(tmpXmlSesUpdUnitaDocKo); @@ -884,9 +788,17 @@ public RispostaControlli scriviXmlUpdUnitaDocKo(RispostaWSUpdVers rispostaWs, Up tmpXmlSesUpdUnitaDocKo.setVrsSesUpdUnitaDocKo(sesUpdUnitaDocKo); tmpXmlSesUpdUnitaDocKo.setTiXml(TiXmlVrsXmlSesUpdUnitaDocKo.RISPOSTA); tmpXmlSesUpdUnitaDocKo.setCdVersioneXml(esito.getVersioneRapportoVersamento()); - tmpXmlSesUpdUnitaDocKo.setBlXml(xmlesito); + // MEV#29276 + if (backendMetadata.isDataBase()) { + tmpXmlSesUpdUnitaDocKo.setBlXml(xmlesito); + } else { + sipBlob.put(TiXmlVrsXmlSesUpdUnitaDocKo.RISPOSTA.name(), xmlesito); + } + // end MEV#29276 tmpXmlSesUpdUnitaDocKo.setOrgStrut(sesUpdUnitaDocKo.getOrgStrut()); - tmpXmlSesUpdUnitaDocKo.setDtRegXml(convert(sessione.getTmApertura())); + tmpXmlSesUpdUnitaDocKo.setDtRegXml(dtRegXml); + // MEV#30089 + tmpXmlSesUpdUnitaDocKo.setAaRegXml(dtRegXml.getYear()); entityManager.persist(tmpXmlSesUpdUnitaDocKo); sesUpdUnitaDocKo.getVrsXmlSesUpdUnitaDocKos().add(tmpXmlSesUpdUnitaDocKo); @@ -925,7 +837,7 @@ public RispostaControlli scriviCtrlErrWarnUpdUnitaDocKo(RispostaWSUpdVers rispos // per ogni controllo su collegamento for (UpdUnitaDocColl link : strutturaUpdVers.getUnitaDocCollegate()) { CSChiave key = new CSChiave(); - key.setAnno(new Long(link.getAggChiave().getAnno())); + key.setAnno(Long.valueOf(link.getAggChiave().getAnno())); key.setNumero(link.getAggChiave().getNumero()); key.setTipoRegistro(link.getAggChiave().getTipoRegistro()); @@ -957,6 +869,9 @@ public RispostaControlli scriviCtrlErrWarnUpdUnitaDocKo(RispostaWSUpdVers rispos versamento.getControlliAnnotazione(documento.getRifUpdDocumento().getIDDocumento()), rispostaWs, versamento, sesUpdUnitaDocKo, progErrore); break; + default: + // niente da fare negli altri casi + break; } // per ogni componente @@ -978,6 +893,9 @@ public RispostaControlli scriviCtrlErrWarnUpdUnitaDocKo(RispostaWSUpdVers rispos progErrore = buildKo(versamento.getControlliComponenteAnnotazioni(componente.getKeyCtrl()), rispostaWs, versamento, sesUpdUnitaDocKo, progErrore); break; + default: + // niente da fare negli altri casi + break; } } @@ -1015,6 +933,9 @@ private int buildKo(Set ctrlList, RispostaWSUpdVers rispostaW .setDecControlloWs(controlliWSHelper.caricaCdControlloWs(controlloEseguito.getCdControllo())); tmpErrSesUpdUnitaDocKo.setDecErrSacer(messaggiWSHelper.caricaDecErrore(tmpVoceDiErrore.getErrorCode())); tmpErrSesUpdUnitaDocKo.setDsErr(LogSessioneUtils.getDsErrAtMaxLen(tmpVoceDiErrore.getErrorMessage())); + // MEV#30089 + tmpErrSesUpdUnitaDocKo.setOrgStrut(sesUpdUnitaDocKo.getOrgStrut()); + tmpErrSesUpdUnitaDocKo.setAaKeyUnitaDoc(sesUpdUnitaDocKo.getAaKeyUnitaDoc().intValue()); // gestione errore principale if (versamento.verificaErrorePrinc(rispostaWs, controlloEseguito, tmpVoceDiErrore)) { @@ -1026,8 +947,6 @@ private int buildKo(Set ctrlList, RispostaWSUpdVers rispostaW // entityManager.persist(tmpErrSesUpdUnitaDocKo); sesUpdUnitaDocKo.getVrsErrSesUpdUnitaDocKos().add(tmpErrSesUpdUnitaDocKo); - // TODO: inutile settarlo è già stata impostato il legame con la sessione ! - // sesUpdUnitaDocErr.getVrsXmlSesUpdUnitaDocErrs().add(null); progErrore++; } } @@ -1062,7 +981,7 @@ public RispostaControlli scriviCtrlErrWarnUpdUnitaDocErr(RispostaWSUpdVers rispo // per ogni controllo su collegamento for (UpdUnitaDocColl link : strutturaUpdVers.getUnitaDocCollegate()) { CSChiave key = new CSChiave(); - key.setAnno(new Long(link.getAggChiave().getAnno())); + key.setAnno(Long.valueOf(link.getAggChiave().getAnno())); key.setNumero(link.getAggChiave().getNumero()); key.setTipoRegistro(link.getAggChiave().getTipoRegistro()); @@ -1094,6 +1013,9 @@ public RispostaControlli scriviCtrlErrWarnUpdUnitaDocErr(RispostaWSUpdVers rispo versamento.getControlliAnnotazione(documento.getRifUpdDocumento().getIDDocumento()), rispostaWs, versamento, sesUpdUnitaDocErr, progErrore); break; + default: + // niente da fare negli altri casi + break; } // per ogni componente @@ -1115,6 +1037,9 @@ public RispostaControlli scriviCtrlErrWarnUpdUnitaDocErr(RispostaWSUpdVers rispo progErrore = buildError(versamento.getControlliComponenteAnnotazioni(componente.getKeyCtrl()), rispostaWs, versamento, sesUpdUnitaDocErr, progErrore); break; + default: + // niente da fare negli altri casi + break; } } @@ -1164,8 +1089,6 @@ private int buildError(Set ctrlList, RispostaWSUpdVers rispos // entityManager.persist(tmpErrSesUpdUnitaDocErr); sesUpdUnitaDocErr.getVrsErrSesUpdUnitaDocErrs().add(tmpErrSesUpdUnitaDocErr); - // TODO: inutile settarlo è già stata impostato il legame con la sessione ! - // sesUpdUnitaDocErr.getVrsXmlSesUpdUnitaDocErrs().add(null); progErrore++; } } @@ -1206,11 +1129,11 @@ public RispostaControlli aggiornaMonKeyTotalUdKo(VrsUpdUnitaDocKo updUnitaDocKo, query.setParameter("decTipoDocPrinc", updUnitaDocKo.getDecTipoDocPrincLast()); mktudkos = query.getResultList(); - if (mktudkos.size() > 0) { + if (!mktudkos.isEmpty()) { // TODO: probabilmente lock inutile dato che le condizioni non porteranno mai a // casi di concorrenza tra client nella stessa sottostruttura .... - Map properties = new HashMap(); - properties.put("javax.persistence.lock.timeout", 25); + Map properties = new HashMap<>(); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, 25000); entityManager.find(MonKeyTotalUd.class, mktudkos.get(0).getIdKeyTotalUdKo(), LockModeType.PESSIMISTIC_WRITE, properties); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioPregVersamentoAroHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioPregVersamentoAroHelper.java index bf79ce6..701e70e 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioPregVersamentoAroHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioPregVersamentoAroHelper.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -5,49 +22,31 @@ */ package it.eng.parer.ws.versamentoUpd.ejb.help; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.Iterator; -import java.util.List; - -import javax.ejb.LocalBean; -import javax.ejb.Stateless; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.persistence.Query; - -import org.apache.commons.lang3.StringUtils; - -import it.eng.parer.entity.AroCompDoc; -import it.eng.parer.entity.AroCompUrnCalc; -import it.eng.parer.entity.AroDoc; -import it.eng.parer.entity.AroStrutDoc; -import it.eng.parer.entity.AroUnitaDoc; -import it.eng.parer.entity.AroUpdUnitaDoc; -import it.eng.parer.entity.AroXmlUpdUnitaDoc; -import it.eng.parer.entity.VrsUrnXmlSessioneVers; -import it.eng.parer.entity.VrsXmlDatiSessioneVers; +import it.eng.parer.entity.*; import it.eng.parer.entity.constraint.AroCompUrnCalc.TiUrn; import it.eng.parer.entity.constraint.VrsUrnXmlSessioneVers.TiUrnXmlSessioneVers; -import it.eng.parer.viewEntity.VrsVLisXmlDocUrnDaCalc; -import it.eng.parer.viewEntity.VrsVLisXmlUdUrnDaCalc; -import it.eng.parer.viewEntity.VrsVLisXmlUpdUrnDaCalc; +import it.eng.parer.view_entity.VrsVLisXmlDocUrnDaCalc; +import it.eng.parer.view_entity.VrsVLisXmlUdUrnDaCalc; +import it.eng.parer.view_entity.VrsVLisXmlUpdUrnDaCalc; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.Costanti; import it.eng.parer.ws.utils.Costanti.CategoriaDocumento; import it.eng.parer.ws.utils.CostantiDB.TipiXmlDati; import it.eng.parer.ws.utils.MessaggiWSBundle; import it.eng.parer.ws.utils.MessaggiWSFormat; -import it.eng.parer.ws.versamento.dto.SyncFakeSessn; -import it.eng.parer.ws.versamentoUpd.dto.RispostaWSUpdVers; import it.eng.parer.ws.versamentoUpd.dto.StrutturaUpdVers; -import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; +import javax.ejb.TransactionAttribute; +import javax.ejb.TransactionAttributeType; +import javax.persistence.Query; +import java.math.BigDecimal; +import java.util.*; + /** * * @author sinatti_s @@ -55,13 +54,13 @@ * Gestione salvataggio del pregresso su entity Aro * */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "SalvataggioPregVersamentoAroHelper") @LocalBean public class SalvataggioPregVersamentoAroHelper extends SalvataggioUpdVersamentoBaseHelper { @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli salvaCdKeyNormUnitaDocumentaria(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, StrutturaUpdVers svf) { + public RispostaControlli salvaCdKeyNormUnitaDocumentaria(AroUnitaDoc tmpAroUnitaDoc, StrutturaUpdVers svf) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(true); // default true solo se effettua effettivamente l'update può fallire @@ -83,8 +82,7 @@ public RispostaControlli salvaCdKeyNormUnitaDocumentaria(RispostaWSUpdVers rispo } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli aggiornaPregCompDocUrnSip(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, StrutturaUpdVers svf) { + public RispostaControlli aggiornaPregCompDocUrnSip(AroUnitaDoc tmpAroUnitaDoc, StrutturaUpdVers svf) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(true); // default true solo se effettua effettivamente l'update può fallire @@ -147,7 +145,7 @@ private void getAndSetAroDocOrderedByTypeAndDateProg(AroUnitaDoc aroUnitaDoc) { if (listaDoc != null) { AroDoc aroDocPrinc = null; - ArrayList alNew = new ArrayList(); + ArrayList alNew = new ArrayList<>(); for (AroDoc aroDoc : listaDoc) { if (aroDoc.getTiDoc().equals(CategoriaDocumento.Principale.getValoreDb())) { aroDocPrinc = aroDoc; // memorizza per dopo il doc PRINCIPALE @@ -156,24 +154,21 @@ private void getAndSetAroDocOrderedByTypeAndDateProg(AroUnitaDoc aroUnitaDoc) { } } // Ordina gli elementi tranne il PRINCIPALE... - Collections.sort(alNew, new Comparator() { - @Override - public int compare(AroDoc doc1, AroDoc doc2) { - int comparazionePerData = doc1.getDtCreazione().compareTo(doc2.getDtCreazione()); - if (comparazionePerData == 0) { - int comparazionePerTipo = doc1.getTiDoc().compareTo(doc2.getTiDoc()); - if (comparazionePerTipo == 0) { - return doc1.getPgDoc().compareTo(doc2.getPgDoc()); - } else { - return comparazionePerTipo; - } + Collections.sort(alNew, (doc1, doc2) -> { + int comparazionePerData = doc1.getDtCreazione().compareTo(doc2.getDtCreazione()); + if (comparazionePerData == 0) { + int comparazionePerTipo = doc1.getTiDoc().compareTo(doc2.getTiDoc()); + if (comparazionePerTipo == 0) { + return doc1.getPgDoc().compareTo(doc2.getPgDoc()); } else { - return comparazionePerData; + return comparazionePerTipo; } + } else { + return comparazionePerData; } }); // PRINCIPALE FIRST - alDef = new ArrayList(); + alDef = new ArrayList<>(); if (aroDocPrinc != null) { alDef.add(aroDocPrinc); } @@ -344,9 +339,8 @@ private void scriviUrnSipUdPreg(AroUnitaDoc tmpAroUnitaDoc, StrutturaUpdVers svf private List retrieveVrsVLisXmlUdUrnDaCalcByUd(long idUnitaDoc) { Query query = entityManager .createQuery("SELECT vrs FROM VrsVLisXmlUdUrnDaCalc vrs WHERE vrs.idUnitaDoc = :idUnitaDoc "); - query.setParameter("idUnitaDoc", idUnitaDoc); - List vrs = query.getResultList(); - return vrs; + query.setParameter("idUnitaDoc", new BigDecimal(idUnitaDoc)); + return query.getResultList(); } private void scriviUrnSipDocAggPreg(AroUnitaDoc tmpAroUnitaDoc, StrutturaUpdVers svf) { @@ -422,11 +416,10 @@ private void scriviUrnSipDocAggPreg(AroUnitaDoc tmpAroUnitaDoc, StrutturaUpdVers } } - private List retrieveVrsVLisXmlDocUrnDaCalcByDoc(long idDoc) { + public List retrieveVrsVLisXmlDocUrnDaCalcByDoc(long idDoc) { Query query = entityManager.createQuery("SELECT vrs FROM VrsVLisXmlDocUrnDaCalc vrs WHERE vrs.idDoc = :idDoc "); - query.setParameter("idDoc", idDoc); - List vrs = query.getResultList(); - return vrs; + query.setParameter("idDoc", new BigDecimal(idDoc)); + return query.getResultList(); } private void scriviUrnSipUpdPreg(AroUnitaDoc tmpAroUnitaDoc, StrutturaUpdVers svf) { @@ -484,22 +477,20 @@ private List retrieveAroUpdUnitaDocByUd(long idUnitaDoc) { Query query = entityManager .createQuery("SELECT upd FROM AroUpdUnitaDoc upd WHERE upd.aroUnitaDoc.idUnitaDoc = :idUnitaDoc "); query.setParameter("idUnitaDoc", idUnitaDoc); - List upds = query.getResultList(); - return upds; + return query.getResultList(); } private List retrieveVrsVLisXmlUpdUrnDaCalcByUpd(long idUpdUnitaDoc) { Query query = entityManager .createQuery("SELECT vrs FROM VrsVLisXmlUpdUrnDaCalc vrs WHERE vrs.idUpdUnitaDoc = :idUpdUnitaDoc "); - query.setParameter("idUpdUnitaDoc", idUpdUnitaDoc); - List vrs = query.getResultList(); - return vrs; + query.setParameter("idUpdUnitaDoc", new BigDecimal(idUpdUnitaDoc)); + return query.getResultList(); } private void salvaUrnXmlSessioneVers(VrsXmlDatiSessioneVers xmlDatiSessioneVers, String tmpUrn, TiUrnXmlSessioneVers tiUrn) { - VrsUrnXmlSessioneVers tmpVrsUrnXmlSessioneVers = null; + VrsUrnXmlSessioneVers tmpVrsUrnXmlSessioneVers; tmpVrsUrnXmlSessioneVers = new VrsUrnXmlSessioneVers(); tmpVrsUrnXmlSessioneVers.setDsUrn(tmpUrn); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoAroHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoAroHelper.java index 123540d..3b81669 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoAroHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoAroHelper.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -6,14 +23,15 @@ package it.eng.parer.ws.versamentoUpd.ejb.help; import java.math.BigDecimal; -import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import javax.ejb.LocalBean; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; +import javax.persistence.EntityGraph; import javax.persistence.Query; import org.slf4j.Logger; @@ -33,36 +51,42 @@ import it.eng.parer.entity.AroUsoXsdDatiSpec; import it.eng.parer.entity.AroValoreAttribDatiSpec; import it.eng.parer.entity.DecAttribDatiSpec; +import it.eng.parer.entity.DecUsoModelloXsdUniDoc; import it.eng.parer.entity.FasFascicolo; import it.eng.parer.entity.SerVerSerie; +import it.eng.parer.entity.VrsDatiSessioneVers; +import it.eng.parer.entity.VrsSessioneVers; +import it.eng.parer.entity.VrsXmlModelloSessioneVers; import it.eng.parer.entity.constraint.AroUpdDatiSpecUnitaDoc.TiEntitaAroUpdDatiSpecUnitaDoc; import it.eng.parer.entity.constraint.AroUpdDatiSpecUnitaDoc.TiUsoXsdAroUpdDatiSpecUnitaDoc; +import it.eng.parer.view_entity.FasVLisFascByUpdUdId; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.CostantiDB; -import it.eng.parer.ws.utils.MessaggiWSBundle; import it.eng.parer.ws.utils.CostantiDB.TipiEntitaSacer; import it.eng.parer.ws.utils.CostantiDB.TipiUsoDatiSpec; +import it.eng.parer.ws.utils.MessaggiWSBundle; import it.eng.parer.ws.versamento.dto.DatoSpecifico; -import it.eng.parer.ws.versamento.dto.SyncFakeSessn; -import it.eng.parer.ws.versamentoUpd.dto.RispostaWSUpdVers; import it.eng.parer.ws.versamentoUpd.dto.StrutturaUpdVers; import it.eng.parer.ws.versamentoUpd.dto.UpdComponenteVers; import it.eng.parer.ws.versamentoUpd.dto.UpdDocumentoVers; import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; import it.eng.parer.ws.versamentoUpd.utils.UpdDocumentiUtils; +import javax.persistence.TypedQuery; + +import static it.eng.parer.ws.utils.CostantiDB.TiStatoSesioneVers.CHIUSA_OK; /** * * @author sinatti_s */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "SalvataggioUpdVersamentoAroHelper") @LocalBean public class SalvataggioUpdVersamentoAroHelper extends SalvataggioUpdVersamentoBaseHelper { + public static final String JAVAX_PERSISTENCE_FETCHGRAPH = "javax.persistence.fetchgraph"; @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli aggiornaStatoConservazione(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc, - StrutturaUpdVers strutturaUpdVers) { + public RispostaControlli aggiornaStatoConservazione(AroUnitaDoc tmpAroUnitaDoc, StrutturaUpdVers strutturaUpdVers) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); @@ -100,14 +124,13 @@ public RispostaControlli aggiornaStatoConservazione(RispostaWSUpdVers rispostaWs } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli aggiornaProfiloArchivistico(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc, - StrutturaUpdVers strutturaUpdVers) { + public RispostaControlli aggiornaProfiloArchivistico(UpdVersamentoExt versamento, AroUnitaDoc tmpAroUnitaDoc, + AroUpdUnitaDoc tmpAroUpdUnitaDoc) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); try { - // 1.1. se su unità doc da aggiornare il tag “FascicoloPrincipale” e’ da + // 1.1. se su unit� doc da aggiornare il tag �FascicoloPrincipale� e� da // aggiornare // anche in caso di annullamento dei campi if (versamento.hasPAFascicoloPrincipaleToUpd() || versamento.hasProfiloArchivisticoToUpdNull()) { @@ -119,11 +142,11 @@ public RispostaControlli aggiornaProfiloArchivistico(RispostaWSUpdVers rispostaW tmpAroUnitaDoc.setDsOggettoSottofascicPrinc(tmpAroUpdUnitaDoc.getDsOggettoSottofascicPrinc()); } - // 1.2. se su unità doc da aggiornare il tag “FascicoliSecondari” e’ da + // 1.2. se su unit� doc da aggiornare il tag �FascicoliSecondari� e� da // aggiornare // anche in caso di annullamento dei campi if (versamento.hasPAFascicoliSecondariToUp() || versamento.hasProfiloArchivisticoToUpdNull()) { - // 1.2.1. elimina i record relativi alle archivazioni secondarie dell’unità doc + // 1.2.1. elimina i record relativi alle archivazioni secondarie dell�unit� doc // in modifica (ARO_ARCHIV_SEC) for (AroArchivSec remAroArchivSec : tmpAroUnitaDoc.getAroArchivSecs()) { // remove @@ -172,14 +195,13 @@ public RispostaControlli aggiornaProfiloArchivistico(RispostaWSUpdVers rispostaW } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli aggiornaProfiloUnitaDocumentaria(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc, - StrutturaUpdVers strutturaUpdVers) { + public RispostaControlli aggiornaProfiloUnitaDocumentaria(AroUnitaDoc tmpAroUnitaDoc, + AroUpdUnitaDoc tmpAroUpdUnitaDoc) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); try { - // 2. se su unità doc da aggiornare il tag “ProfiloUnitaDocumentaria” e’ da + // 2. se su unit� doc da aggiornare il tag �ProfiloUnitaDocumentaria� e� da // aggiornare tmpAroUnitaDoc.setDlOggettoUnitaDoc(tmpAroUpdUnitaDoc.getDlOggettoUnitaDoc()); tmpAroUnitaDoc.setDtRegUnitaDoc(tmpAroUpdUnitaDoc.getDtRegUnitaDoc()); @@ -198,15 +220,69 @@ public RispostaControlli aggiornaProfiloUnitaDocumentaria(RispostaWSUpdVers risp } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli aggiornaDocumentiCollegati(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc, - StrutturaUpdVers strutturaUpdVers) { + public RispostaControlli aggiornaProfiloNormativo(AroUnitaDoc tmpAroUnitaDoc, StrutturaUpdVers strutturaUpdVers) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); try { - // 3. se su unità doc da aggiornare il tag “DocumentiCollegati” e’ da aggiornare - // 3.1. elimina i record relativi ai documenti collegati dell’unità doc in + List lstXmlModelloSessioneVers; + lstXmlModelloSessioneVers = retreiveXmlVersamentiModelloXsdUnitaDoc(CostantiDB.TiUsoModelloXsd.VERS.name(), + it.eng.parer.entity.constraint.DecModelloXsdUd.TiModelloXsdUd.PROFILO_NORMATIVO_UNITA_DOC, + tmpAroUnitaDoc.getIdUnitaDoc()); + if (!lstXmlModelloSessioneVers.isEmpty()) { + VrsXmlModelloSessioneVers vrsXmlModelloSessioneVers = lstXmlModelloSessioneVers.get(0); + if (strutturaUpdVers.getIdRecUsoXsdProfiloNormativo() == 0) { + entityManager.remove(vrsXmlModelloSessioneVers); + entityManager.flush(); + } else { + vrsXmlModelloSessioneVers.setBlXml(strutturaUpdVers.getDatiC14NProfNormXml()); + // persist + entityManager.persist(vrsXmlModelloSessioneVers); + entityManager.flush(); + } + } else { + List listDatiSessioneVers; + // recupero la sessione relativa al versamento originale dell'UD + List tmpSessioneVer = tmpAroUnitaDoc.getVrsSessioneVers(); + if (!tmpSessioneVer.isEmpty()) { + listDatiSessioneVers = retreiveVrsDatiSessioneVersByIsSessioneVers( + tmpSessioneVer.get(0).getIdSessioneVers()); + + VrsXmlModelloSessioneVers tmpXmlModelloSessioneVers = new VrsXmlModelloSessioneVers(); + tmpXmlModelloSessioneVers.setVrsDatiSessioneVers(listDatiSessioneVers.get(0)); + + if (strutturaUpdVers.getIdStruttura() != 0) { + tmpXmlModelloSessioneVers.setIdStrut(new BigDecimal(strutturaUpdVers.getIdStruttura())); + } + tmpXmlModelloSessioneVers.setFlCanonicalized(CostantiDB.Flag.TRUE); + tmpXmlModelloSessioneVers.setBlXml(strutturaUpdVers.getDatiC14NProfNormXml()); + tmpXmlModelloSessioneVers.setDecUsoModelloXsdUniDoc(entityManager.find(DecUsoModelloXsdUniDoc.class, + strutturaUpdVers.getIdRecUsoXsdProfiloNormativo())); + + entityManager.persist(tmpXmlModelloSessioneVers); + } + } + entityManager.flush(); + tmpRispostaControlli.setrBoolean(true); + } catch (Exception e) { + tmpRispostaControlli.setCodErr(MessaggiWSBundle.ERR_666P); + tmpRispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666P, + "Errore interno nella fase di aggiornamento profilo ud " + e.getMessage())); + tmpRispostaControlli.setrBoolean(false); + getLogger().error("Errore interno nella fase di aggiornamento profilo ud", e); + } + + return tmpRispostaControlli; + } + + @TransactionAttribute(TransactionAttributeType.REQUIRED) + public RispostaControlli aggiornaDocumentiCollegati(AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc) { + RispostaControlli tmpRispostaControlli = new RispostaControlli(); + tmpRispostaControlli.setrBoolean(false); + + try { + // 3. se su unit� doc da aggiornare il tag �DocumentiCollegati� e� da aggiornare + // 3.1. elimina i record relativi ai documenti collegati dell�unit� doc in // modifica (ARO_LINK_UNITA_DOC) for (AroLinkUnitaDoc remAroLinkUnitaDoc : tmpAroUnitaDoc.getAroLinkUnitaDocs()) { // remove @@ -256,19 +332,18 @@ public RispostaControlli aggiornaDocumentiCollegati(RispostaWSUpdVers rispostaWs } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli aggiornaDatiSpecificiUd(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc, + public RispostaControlli aggiornaDatiSpecificiUd(AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc, TiUsoXsdAroUpdDatiSpecUnitaDoc tiUsoXsdAroUpdDatiSpecUnitaDoc, StrutturaUpdVers strutturaUpdVers) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); try { - // 4. se su unità doc da aggiornare il tag “DatiSpecifici” e’ da aggiornare + // 4. se su unit� doc da aggiornare il tag �DatiSpecifici� e� da aggiornare // per ogni dato specifico for (AroUpdDatiSpecUnitaDoc tmpAroUpdDocUnitaDoc : tmpAroUpdUnitaDoc.getAroUpdDatiSpecUnitaDocs()) { // verifica - // 4.1. se in ARO_UPD_DATI_SPEC_UNITA_DOC e’ presente il record con tipo entita + // 4.1. se in ARO_UPD_DATI_SPEC_UNITA_DOC e� presente il record con tipo entita // = UPD_UNI_DOC e tipo uso = VERS if (tmpAroUpdDocUnitaDoc.getTiEntitaSacer().equals(TiEntitaAroUpdDatiSpecUnitaDoc.UPD_UNI_DOC) && tmpAroUpdDocUnitaDoc.getTiUsoXsd().equals(tiUsoXsdAroUpdDatiSpecUnitaDoc)) { @@ -284,73 +359,72 @@ public RispostaControlli aggiornaDatiSpecificiUd(RispostaWSUpdVers rispostaWs, U return tmpRispostaControlli; } - AroUsoXsdDatiSpec tmpUsoXsdDatiSpec; - // è presente ... + AroUsoXsdDatiSpec tmpUsoXsdDatiSpec = new AroUsoXsdDatiSpec(); + // � presente ... if (tmpRispostaControlli.getrLong() != -1) { tmpUsoXsdDatiSpec = (AroUsoXsdDatiSpec) tmpRispostaControlli.getrObject(); // 4.1.1. elimina i record relativi ai valori dei dati specifici - // (ARO_VALORE_ATTRIB_DATI_SPEC) determinati mediante il record relativo all’uso - // del XSD per dati specifici relativo all’unita doc in modifica con tipo entita + // (ARO_VALORE_ATTRIB_DATI_SPEC) determinati mediante il record relativo all�uso + // del XSD per dati specifici relativo all�unita doc in modifica con tipo entita // = UNI_DOC e tipo uso = VERS (ARO_USO_XSD_DATI_SPEC) for (AroValoreAttribDatiSpec tmpAroValoreAttribDatiSpec : tmpUsoXsdDatiSpec .getAroValoreAttribDatiSpecs()) { // remove entityManager.remove(tmpAroValoreAttribDatiSpec); } - // clear list tmpUsoXsdDatiSpec.getAroValoreAttribDatiSpecs().clear(); // delete entityManager.flush(); - // 4.1.2. se esiste record in ARO_USO_XSD_DATI_SPEC relativo all’unita doc in + // 4.1.2. se esiste record in ARO_USO_XSD_DATI_SPEC relativo all�unita doc in // modifica con tipo entita = UNI_DOC e tipo uso = VERS // FK alla versione XSD per dati specifici con il valore definito // ARO_UPD_DATI_SPEC_UNITA_DOC tmpUsoXsdDatiSpec.setDecXsdDatiSpec(tmpAroUpdDocUnitaDoc.getDecXsdDatiSpec()); - } else { - // 4.1.3.1. inserisci record in ARO_USO_XSD_DATI_SPEC relativo all’unita doc in - // modifica con tipo entita = UNI_DOC e tipo uso = VERS, specificando: - tmpUsoXsdDatiSpec = new AroUsoXsdDatiSpec(); - // FK - tmpUsoXsdDatiSpec.setAroUnitaDoc(tmpAroUnitaDoc); - tmpUsoXsdDatiSpec.setDecXsdDatiSpec(tmpAroUpdDocUnitaDoc.getDecXsdDatiSpec()); - tmpUsoXsdDatiSpec.setIdStrut(new BigDecimal(tmpAroUnitaDoc.getIdOrgStrut())); - // - tmpUsoXsdDatiSpec.setTiEntitaSacer(TipiEntitaSacer.UNI_DOC.name());// fixed - tmpUsoXsdDatiSpec.setTiUsoXsd(tipiUsoDatiSpec.name()); - - // persist - entityManager.persist(tmpUsoXsdDatiSpec); - // add on list - tmpAroUnitaDoc.getAroUsoXsdDatiSpecs().add(tmpUsoXsdDatiSpec); - } + if (strutturaUpdVers.getIdRecXsdDatiSpec() != 0) { + // 4.1.3.1. inserisci record in ARO_USO_XSD_DATI_SPEC relativo all�unita doc in + // modifica con tipo entita = UNI_DOC e tipo uso = VERS, specificando: + // FK + tmpUsoXsdDatiSpec.setAroUnitaDoc(tmpAroUnitaDoc); + tmpUsoXsdDatiSpec.setDecXsdDatiSpec(tmpAroUpdDocUnitaDoc.getDecXsdDatiSpec()); + tmpUsoXsdDatiSpec.setIdStrut(new BigDecimal(tmpAroUnitaDoc.getIdOrgStrut())); + // + tmpUsoXsdDatiSpec.setTiEntitaSacer(TipiEntitaSacer.UNI_DOC.name());// fixed + tmpUsoXsdDatiSpec.setTiUsoXsd(tipiUsoDatiSpec.name()); - HashMap datiSpecifici = TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS - .equals(tiUsoXsdAroUpdDatiSpecUnitaDoc) ? strutturaUpdVers.getDatiSpecifici() - : strutturaUpdVers.getDatiSpecificiMigrazione(); - // 4.1.4.1. registra record in ARO_VALORE_ATTRIB_DATI_SPEC, specificando: - for (DatoSpecifico datoSpec : datiSpecifici.values()) { - AroValoreAttribDatiSpec newAroValoreAttribDatiSpec = new AroValoreAttribDatiSpec(); - // FK - newAroValoreAttribDatiSpec.setDecAttribDatiSpec( - entityManager.find(DecAttribDatiSpec.class, datoSpec.getIdDatoSpec())); - newAroValoreAttribDatiSpec.setIdStrut(new BigDecimal(tmpAroUnitaDoc.getIdOrgStrut())); - newAroValoreAttribDatiSpec.setDlValore(datoSpec.getValore()); - newAroValoreAttribDatiSpec.setAroUsoXsdDatiSpec(tmpUsoXsdDatiSpec); - - // persist - entityManager.persist(newAroValoreAttribDatiSpec); - // add on list - // Nota: se l'entity è appena creata non ho relazione quindi la lista non è - // inizializzata - tmpUsoXsdDatiSpec.getAroValoreAttribDatiSpecs().add(newAroValoreAttribDatiSpec); + // persist + entityManager.persist(tmpUsoXsdDatiSpec); + // add on list + tmpAroUnitaDoc.getAroUsoXsdDatiSpecs().add(tmpUsoXsdDatiSpec); + } } + if (strutturaUpdVers.getIdRecXsdDatiSpec() != 0) { + Map datiSpecifici = TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS + .equals(tiUsoXsdAroUpdDatiSpecUnitaDoc) ? strutturaUpdVers.getDatiSpecifici() + : strutturaUpdVers.getDatiSpecificiMigrazione(); + // 4.1.4.1. registra record in ARO_VALORE_ATTRIB_DATI_SPEC, specificando: + for (DatoSpecifico datoSpec : datiSpecifici.values()) { + AroValoreAttribDatiSpec newAroValoreAttribDatiSpec = new AroValoreAttribDatiSpec(); + // FK + newAroValoreAttribDatiSpec.setDecAttribDatiSpec( + entityManager.find(DecAttribDatiSpec.class, datoSpec.getIdDatoSpec())); + newAroValoreAttribDatiSpec.setIdStrut(new BigDecimal(tmpAroUnitaDoc.getIdOrgStrut())); + newAroValoreAttribDatiSpec.setDlValore(datoSpec.getValore()); + newAroValoreAttribDatiSpec.setAroUsoXsdDatiSpec(tmpUsoXsdDatiSpec); + + // persist + entityManager.persist(newAroValoreAttribDatiSpec); + // add on list + // Nota: se l'entity è appena creata non ho relazione quindi la lista non è + // inizializzata + tmpUsoXsdDatiSpec.getAroValoreAttribDatiSpecs().add(newAroValoreAttribDatiSpec); + } + } } // if } // for AroUpdDatiSpecUnitaDoc - entityManager.flush(); tmpRispostaControlli.setrBoolean(true); } catch (Exception e) { @@ -365,9 +439,7 @@ public RispostaControlli aggiornaDatiSpecificiUd(RispostaWSUpdVers rispostaWs, U } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli aggiornaDocumento(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc, - StrutturaUpdVers strutturaUpdVers) { + public RispostaControlli aggiornaDocumento(AroUpdUnitaDoc tmpAroUpdUnitaDoc, StrutturaUpdVers strutturaUpdVers) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); @@ -396,7 +468,7 @@ public RispostaControlli aggiornaDocumento(RispostaWSUpdVers rispostaWs, UpdVers .filter(d -> d.getIdRecDocumentoDB() == aroDoc.getIdDoc()).collect(Collectors.toList()).get(0); // single // result - // 2. se su documento da aggiornare il tag “DatiSpecifici” e’ da aggiornare + // 2. se su documento da aggiornare il tag �DatiSpecifici� e� da aggiornare if (updDocumentoVers.getRifUpdDocumento().getDatiSpecifici() != null) { for (AroUpdDatiSpecUnitaDoc aroUpdDatiSpecUnitaDoc : aroUpdDocUnitaDoc .getAroUpdDatiSpecUnitaDocs()) { @@ -405,7 +477,7 @@ public RispostaControlli aggiornaDocumento(RispostaWSUpdVers rispostaWs, UpdVers } } - // 3. se su documento da aggiornare il tag “DatiSpecificiMigrazione” e’ da + // 3. se su documento da aggiornare il tag �DatiSpecificiMigrazione� e� da // aggiornare if (updDocumentoVers.getRifUpdDocumento().getDatiSpecificiMigrazione() != null) { for (AroUpdDatiSpecUnitaDoc aroUpdDatiSpecUnitaDoc : aroUpdDocUnitaDoc @@ -418,7 +490,6 @@ public RispostaControlli aggiornaDocumento(RispostaWSUpdVers rispostaWs, UpdVers // ciclo componenti for (AroUpdCompUnitaDoc aroUpdCompUnitaDoc : aroUpdDocUnitaDoc.getAroUpdCompUnitaDocs()) { AroCompDoc aroCompDoc = aroUpdCompUnitaDoc.getAroCompDoc(); - // info su componente pari a quelle definite da ARO_UPD_COMP_UNITA_DOC // (ds_nome_comp_vers, dl_urn_comp_vers, ds_id_comp_vers) aroCompDoc.setDsNomeCompVers(aroUpdCompUnitaDoc.getDsNomeCompVers()); @@ -428,19 +499,20 @@ public RispostaControlli aggiornaDocumento(RispostaWSUpdVers rispostaWs, UpdVers for (UpdComponenteVers updComponenteVers : updDocumentoVers.getUpdComponentiAttesi().stream() .filter(d -> d.getIdRecDB() == aroCompDoc.getIdCompDoc()).collect(Collectors.toList())) { - // 2. se su documento da aggiornare il tag “DatiSpecifici” e’ da aggiornare + // 2. se su documento da aggiornare il tag �DatiSpecifici� e� da aggiornare if (updComponenteVers.getMyUpdComponente().getDatiSpecifici() != null) { - for (AroUpdDatiSpecUnitaDoc aroUpdDatiSpecUnitaDoc : aroUpdCompUnitaDoc + + for (AroUpdDatiSpecUnitaDoc aroUpdDatiSpecUnitaDoc : aroUpdDocUnitaDoc .getAroUpdDatiSpecUnitaDocs()) { tmpRispostaControlli = aggiornaDatiSpecDoc(aroDoc, aroCompDoc, aroUpdDatiSpecUnitaDoc, strutturaUpdVers, TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS, TiEntitaAroUpdDatiSpecUnitaDoc.UPD_COMP); } } - // 2. se su documento da aggiornare il tag “DatiSpecificiMigrazione” e’ da + // 2. se su documento da aggiornare il tag �DatiSpecificiMigrazione� e� da // aggiornare if (updComponenteVers.getMyUpdComponente().getDatiSpecificiMigrazione() != null) { - for (AroUpdDatiSpecUnitaDoc aroUpdDatiSpecUnitaDoc : aroUpdCompUnitaDoc + for (AroUpdDatiSpecUnitaDoc aroUpdDatiSpecUnitaDoc : aroUpdDocUnitaDoc .getAroUpdDatiSpecUnitaDocs()) { tmpRispostaControlli = aggiornaDatiSpecDoc(aroDoc, aroCompDoc, aroUpdDatiSpecUnitaDoc, strutturaUpdVers, TiUsoXsdAroUpdDatiSpecUnitaDoc.MIGRAZ, @@ -448,9 +520,7 @@ public RispostaControlli aggiornaDocumento(RispostaWSUpdVers rispostaWs, UpdVers } } } // for UpdComponenteVers - } - } // for entityManager.flush(); @@ -482,11 +552,11 @@ private RispostaControlli aggiornaDatiSpecDoc(AroDoc aroDoc, AroCompDoc aroCompD tmpRispostaControlli.setrBoolean(false); try { - // 2.1. se in ARO_UPD_DATI_SPEC_UNITA_DOC e’ presente il record con tipo entita + // 2.1. se in ARO_UPD_DATI_SPEC_UNITA_DOC e� presente il record con tipo entita // = UPD_DOC e tipo uso = VERS relativo - // all’aggiornamento del documento corrente (NOTA: la condizione e’ definita per - // precauzione: se il tag “DatiSpecifici” e’ da aggiornare significa che nel XML - // di input il tag c’e’ e che contiene i valori dei dati spec) + // all�aggiornamento del documento corrente (NOTA: la condizione e� definita per + // precauzione: se il tag �DatiSpecifici� e� da aggiornare significa che nel XML + // di input il tag c�e� e che contiene i valori dei dati spec) if (tmpAroUpdDatiSpecUnitaDoc.getTiEntitaSacer().equals(tiEntitaAroUpdDatiSpecUnitaDoc) && tmpAroUpdDatiSpecUnitaDoc.getTiUsoXsd().equals(tiUsoXsdAroUpdDatiSpecUnitaDoc)) { @@ -505,12 +575,12 @@ private RispostaControlli aggiornaDatiSpecDoc(AroDoc aroDoc, AroCompDoc aroCompD } AroUsoXsdDatiSpec tmpUsoXsdDatiSpec; - // è presente ... + // � presente ... if (tmpRispostaControlli.getrLong() != -1) { tmpUsoXsdDatiSpec = (AroUsoXsdDatiSpec) tmpRispostaControlli.getrObject(); // 4.1.1. elimina i record relativi ai valori dei dati specifici - // (ARO_VALORE_ATTRIB_DATI_SPEC) determinati mediante il record relativo all’uso - // del XSD per dati specifici relativo all’unita doc in modifica con tipo entita + // (ARO_VALORE_ATTRIB_DATI_SPEC) determinati mediante il record relativo all�uso + // del XSD per dati specifici relativo all�unita doc in modifica con tipo entita // = UNI_DOC e tipo uso = VERS (ARO_USO_XSD_DATI_SPEC) for (AroValoreAttribDatiSpec tmpAroValoreAttribDatiSpec : tmpUsoXsdDatiSpec .getAroValoreAttribDatiSpecs()) { @@ -523,14 +593,14 @@ private RispostaControlli aggiornaDatiSpecDoc(AroDoc aroDoc, AroCompDoc aroCompD // delete entityManager.flush(); - // 4.1.2. se esiste record in ARO_USO_XSD_DATI_SPEC relativo all’unita doc in + // 4.1.2. se esiste record in ARO_USO_XSD_DATI_SPEC relativo all�unita doc in // modifica con tipo entita = UNI_DOC e tipo uso = VERS // FK alla versione XSD per dati specifici con il valore definito // ARO_UPD_DATI_SPEC_UNITA_DOC tmpUsoXsdDatiSpec.setDecXsdDatiSpec(tmpAroUpdDatiSpecUnitaDoc.getDecXsdDatiSpec()); } else { - // 4.1.3.1. inserisci record in ARO_USO_XSD_DATI_SPEC relativo all’unita doc in + // 4.1.3.1. inserisci record in ARO_USO_XSD_DATI_SPEC relativo all�unita doc in // modifica con tipo entita = UNI_DOC e tipo uso = VERS, specificando: tmpUsoXsdDatiSpec = new AroUsoXsdDatiSpec(); // FK @@ -572,7 +642,7 @@ private RispostaControlli aggiornaDatiSpecDoc(AroDoc aroDoc, AroCompDoc aroCompD // result // 4.1.4.1. registra record in ARO_VALORE_ATTRIB_DATI_SPEC, specificando: - HashMap datiSpecifici = TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS + Map datiSpecifici = TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS .equals(tiUsoXsdAroUpdDatiSpecUnitaDoc) ? updDocumentoVers.getDatiSpecifici() : updDocumentoVers.getDatiSpecificiMigrazione(); // @@ -592,7 +662,7 @@ private RispostaControlli aggiornaDatiSpecDoc(AroDoc aroDoc, AroCompDoc aroCompD .filter(d -> d.getIdRecDB() == aroCompDoc.getIdCompDoc()) .collect(Collectors.toList())) { // 4.1.4.1. registra record in ARO_VALORE_ATTRIB_DATI_SPEC, specificando: - HashMap datiSpecifici = TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS + Map datiSpecifici = TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS .equals(tiUsoXsdAroUpdDatiSpecUnitaDoc) ? updComponenteVers.getDatiSpecifici() : updComponenteVers.getDatiSpecificiMigrazione(); // @@ -620,7 +690,7 @@ private RispostaControlli aggiornaDatiSpecDoc(AroDoc aroDoc, AroCompDoc aroCompD } private void buildDatoSpecifico(AroDoc aroDoc, AroUsoXsdDatiSpec tmpUsoXsdDatiSpec, - HashMap datiSpecifici) { + Map datiSpecifici) { for (DatoSpecifico datoSpec : datiSpecifici.values()) { AroValoreAttribDatiSpec newAroValoreAttribDatiSpec = new AroValoreAttribDatiSpec(); // FK @@ -633,21 +703,19 @@ private void buildDatoSpecifico(AroDoc aroDoc, AroUsoXsdDatiSpec tmpUsoXsdDatiSp // persist entityManager.persist(newAroValoreAttribDatiSpec); // add on list - // Nota: se l'entity è appena creata non ho relazione quindi la lista non è + // Nota: se l'entity � appena creata non ho relazione quindi la lista non � // inizializzata tmpUsoXsdDatiSpec.getAroValoreAttribDatiSpecs().add(newAroValoreAttribDatiSpec); } } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli aggiornaAggregazioni(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc, - StrutturaUpdVers strutturaUpdVers) { + public RispostaControlli aggiornaAggregazioni(AroUnitaDoc tmpAroUnitaDoc) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); try { - // 1. il sistema aggiorna la versione serie settando l’indicatore che segnala + // 1. il sistema aggiorna la versione serie settando l�indicatore che segnala // che la serie deve essere ricalcolata a causa di aggiornamento // (vedi vista SER_V_LIS_VERSER_BY_UPD_UD) List idVerSeries = this.retrieveSerVLisVerserByUpdUd(tmpAroUnitaDoc.getIdUnitaDoc()); @@ -656,14 +724,14 @@ public RispostaControlli aggiornaAggregazioni(RispostaWSUpdVers rispostaWs, UpdV verSerie.setFlUpdModifUnitaDoc("1"); } - // 2. il sistema aggiorna il fascicolo settando l’indicatore che segnala che la + // 2. il sistema aggiorna il fascicolo settando l�indicatore che segnala che la // serie deve essere ricalcolata a causa di aggiornamento - // metadati o aggiunta documento di almeno una unità documentaria + // metadati o aggiunta documento di almeno una unit� documentaria // (vedi vista FAS_V_LIS_FASC_BY_UPD_UD) - List idFascs = this.retrieveFasVLisFascByUpdUd(tmpAroUnitaDoc.getIdUnitaDoc()); - for (BigDecimal idFasc : idFascs) { - FasFascicolo fasFascicolo = entityManager.find(FasFascicolo.class, idFasc.longValue()); + List idFascs = this.retrieveFasVLisFascByUpdUdId(tmpAroUnitaDoc.getIdUnitaDoc()); + for (FasVLisFascByUpdUdId idFasc : idFascs) { + FasFascicolo fasFascicolo = entityManager.find(FasFascicolo.class, idFasc.getIdFascicolo().longValue()); fasFascicolo.setFlUpdModifUnitaDoc("1"); } @@ -679,35 +747,81 @@ public RispostaControlli aggiornaAggregazioni(RispostaWSUpdVers rispostaWs, UpdV return tmpRispostaControlli; } + public List retreiveVrsDatiSessioneVersByIsSessioneVers(Long idSessioneVers) { + /* + * ricavo i documenti XML relativi alla sessione di versamento individuata + */ + String queryStr = "select vrsDatiSessioneVers from VrsDatiSessioneVers vrsDatiSessioneVers " + + "where vrsDatiSessioneVers.vrsSessioneVers.idSessioneVers = :idSessioneVers " + + "and vrsDatiSessioneVers.tiDatiSessioneVers = 'XML_DOC' "; + + TypedQuery query = entityManager.createQuery(queryStr, VrsDatiSessioneVers.class); + query.setParameter("idSessioneVers", idSessioneVers); + + return query.getResultList(); + } + + public List retreiveXmlVersamentiModelloXsdUnitaDoc(String tiUsoModelloXsd, + it.eng.parer.entity.constraint.DecModelloXsdUd.TiModelloXsdUd tiModelloXsdUd, long idUnitaDoc) { + List lstXmlModelloSessioneVers = null; + + try { + + String queryStr = "select xms from VrsXmlModelloSessioneVers xms " + + "join xms.decUsoModelloXsdUniDoc uso_modello " + "join uso_modello.decModelloXsdUd modello_xsd " + + "join xms.vrsDatiSessioneVers dati_ses " + "join dati_ses.vrsSessioneVers ses " + + "where modello_xsd.tiUsoModelloXsd = :tiUsoModelloXsd " + + "and modello_xsd.tiModelloXsd = :tiModelloXsdUd " + "and dati_ses.tiDatiSessioneVers = 'XML_DOC' " + + "and ses.aroUnitaDoc.idUnitaDoc = :idUnitaDoc " + "and ses.aroDoc is null " + + "and ses.tiStatoSessioneVers = '" + CHIUSA_OK + "' " + "and ses.tiSessioneVers = 'VERSAMENTO' "; + EntityGraph entityGraph = entityManager + .createEntityGraph(VrsXmlModelloSessioneVers.class); + entityGraph.addSubgraph("decUsoModelloXsdUniDoc").addAttributeNodes("decModelloXsdUd"); + TypedQuery query = entityManager.createQuery(queryStr, + VrsXmlModelloSessioneVers.class); + query.setHint(JAVAX_PERSISTENCE_FETCHGRAPH, entityGraph); + query.setParameter("tiUsoModelloXsd", tiUsoModelloXsd); + query.setParameter("tiModelloXsdUd", tiModelloXsdUd); + query.setParameter("idUnitaDoc", idUnitaDoc); + + lstXmlModelloSessioneVers = query.getResultList(); + + } catch (Exception e) { + + getLogger().error("Eccezione nella lettura modello xsd unit� documentaria", e); + } + return lstXmlModelloSessioneVers; + } + /* * il sistema determina le versioni serie correnti con stato = CONTROLLATA o VALIDAZIONE_IN_CORSO o VALIDATA o * DA_FIRMARE o FIRMATA o IN_CUSTODIA, oppure con stato = DA_CONTROLLARE e contenuto effettivo con stato = - * CONTROLLO_CONSIST_IN_CORSO, nel cui contenuto di tipo EFFETTIVO sia presente l’unità documentaria in + * CONTROLLO_CONSIST_IN_CORSO, nel cui contenuto di tipo EFFETTIVO sia presente l�unit� documentaria in * aggiornamento * * return list of idVerSerie */ - private List retrieveSerVLisVerserByUpdUd(long idUnitaDoc) { - Query query = entityManager - .createQuery("SELECT ser.idVerSerie FROM SerVLisVerserByUpdUd ser WHERE ser.idUnitaDoc = :idUnitaDoc "); - query.setParameter("idUnitaDoc", idUnitaDoc); - List serie = query.getResultList(); - return serie; + public List retrieveSerVLisVerserByUpdUd(long idUnitaDoc) { + TypedQuery query = entityManager.createQuery( + "SELECT ser.serVLisVerserByUpdUdId.idVerSerie FROM SerVLisVerserByUpdUd ser WHERE ser.serVLisVerserByUpdUdId.idUnitaDoc = :idUnitaDoc ", + BigDecimal.class); + query.setParameter("idUnitaDoc", new BigDecimal(idUnitaDoc)); + return query.getResultList(); } /* - * il sistema determina i fascicoli con stato nell’elenco = IN_ELENCO_IN_CODA_CREAZIONE_AIP o - * IN_ELENCO_CON_AIP_CREATO o IN_ELENCO_CON_ELENCO_INDICI_AIP_CREATO o IN_ELENCO_COMPLETATO nel cui contenuto e’ - * presente l’unità documentaria in aggiornamento + * il sistema determina i fascicoli con stato nell�elenco = IN_ELENCO_IN_CODA_CREAZIONE_AIP o + * IN_ELENCO_CON_AIP_CREATO o IN_ELENCO_CON_ELENCO_INDICI_AIP_CREATO o IN_ELENCO_COMPLETATO nel cui contenuto e� + * presente l�unit� documentaria in aggiornamento * - * return list of idFascicolo + * return list of FasVLisFascByUpdUdId */ - private List retrieveFasVLisFascByUpdUd(long idUnitaDoc) { - Query query = entityManager - .createQuery("SELECT ser.idFascicolo FROM FasVLisFascByUpdUd ser WHERE ser.idUnitaDoc = :idUnitaDoc "); - query.setParameter("idUnitaDoc", idUnitaDoc); - List fascicoli = query.getResultList(); - return fascicoli; + public List retrieveFasVLisFascByUpdUdId(long idUnitaDoc) { + TypedQuery query = entityManager.createQuery( + "SELECT fas.fasVLisFascByUpdUdId FROM FasVLisFascByUpdUd fas WHERE fas.fasVLisFascByUpdUdId.idUnitaDoc = :idUnitaDoc ", + FasVLisFascByUpdUdId.class); + query.setParameter("idUnitaDoc", new BigDecimal(idUnitaDoc)); + return query.getResultList(); } @Override diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoBaseHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoBaseHelper.java index 9caf69d..d9d4760 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoBaseHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoBaseHelper.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -37,7 +54,9 @@ import it.eng.parer.ws.utils.CostantiDB.TipiUsoDatiSpec; import it.eng.parer.ws.utils.MessaggiWSBundle; import it.eng.parer.ws.utils.MessaggiWSHelper; +import java.math.BigDecimal; +@SuppressWarnings("unchecked") public abstract class SalvataggioUpdVersamentoBaseHelper { @EJB @@ -71,7 +90,7 @@ public RispostaControlli checkUsoXsdDatiSpecifici(long idAroUdOrDocOrComp, TipiU rispostaControlli.setrLong(-1); rispostaControlli.setrBoolean(false); - List usoXsdDatiSpecs = null; + List usoXsdDatiSpecs; try { String queryStr = "select ud from AroUsoXsdDatiSpec ud " + "where ud.tiUsoXsd = :tiUsoXsd " @@ -147,12 +166,12 @@ public RispostaControlli getAroValoreAttribDatiSpecs(long idUsoXsdDatiSpec, long javax.persistence.Query query = entityManager.createQuery(queryStr, AroValoreAttribDatiSpec.class); query.setParameter("idUsoXsdDatiSpec", idUsoXsdDatiSpec); query.setParameter("idAttribDatiSpec", idAttribDatiSpec); - query.setParameter("idStrut", idStrut); + query.setParameter("idStrut", new BigDecimal(idStrut)); aroValoreAttribDatiSpec = query.getResultList(); // se esiste ... - if (aroValoreAttribDatiSpec.size() >= 1) { + if (!aroValoreAttribDatiSpec.isEmpty()) { // livello attuale rispostaControlli.setrObject(aroValoreAttribDatiSpec); rispostaControlli.setrLong(0); @@ -185,14 +204,6 @@ protected RispostaControlli generaXmlDatiSpecFromAroUnitaDoc(String versione, St // build object datiSpec.setVersioneDatiSpecifici(versione); - /* - * // per ogni attributo dei dati specifici costruiscta value // ordinando per getNiOrdAttrib - * List sorted = new ArrayList<>(attrDs); sorted.sort(new - * Comparator() { - * - * @Override public int compare(DecXsdAttribDatiSpec d1, DecXsdAttribDatiSpec d2) { return - * d1.getNiOrdAttrib().compareTo(d2.getNiOrdAttrib()); } }); - */ for (DecXsdAttribDatiSpec ds : attrDs) { String attr = ds.getDecAttribDatiSpec().getNmAttribDatiSpec(); @@ -210,12 +221,6 @@ protected RispostaControlli generaXmlDatiSpecFromAroUnitaDoc(String versione, St aroValoreAttribDatiSpecs = (List) tmpRispostaControlli.getrObject(); } - /* - * List aroValoreAttribDatiSpecs = new ArrayList<>(ds.getDecAttribDatiSpec() - * .getAroValoreAttribDatiSpecs()).stream() .filter(d -> d.getAroUsoXsdDatiSpec().getIdUsoXsdDatiSpec() == - * idAroUsoXsdDatiSpec).collect(Collectors.toList()); - */ - for (AroValoreAttribDatiSpec tmpAroValoreAttribDatiSpec : aroValoreAttribDatiSpecs) { // create the element Element element = doc.createElement(attr); @@ -242,8 +247,6 @@ protected RispostaControlli generaXmlDatiSpecFromAroUnitaDoc(String versione, St Marshaller tmpMarshaller = xmlVersCache.getVersReqCtxforUD().createMarshaller(); StringWriter sw = new StringWriter(); tmpMarshaller.marshal(root, sw); - // - // return sw.toString(); tmpRispostaControlli.setrString(sw.toString()); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoIniHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoIniHelper.java index b3a6321..8433437 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoIniHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoIniHelper.java @@ -1,45 +1,55 @@ -package it.eng.parer.ws.versamentoUpd.ejb.help; - -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.ejb.LocalBean; -import javax.ejb.Stateless; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.persistence.LockModeType; +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +package it.eng.parer.ws.versamentoUpd.ejb.help; -import it.eng.parer.entity.AroArchivSec; -import it.eng.parer.entity.AroCompDoc; -import it.eng.parer.entity.AroDoc; -import it.eng.parer.entity.AroLinkUnitaDoc; -import it.eng.parer.entity.AroUnitaDoc; -import it.eng.parer.entity.AroUsoXsdDatiSpec; -import it.eng.parer.entity.AroVersIniArchivSec; -import it.eng.parer.entity.AroVersIniComp; -import it.eng.parer.entity.AroVersIniDatiSpec; -import it.eng.parer.entity.AroVersIniDoc; -import it.eng.parer.entity.AroVersIniLinkUnitaDoc; -import it.eng.parer.entity.AroVersIniUnitaDoc; +import it.eng.parer.entity.*; import it.eng.parer.entity.constraint.AroVersIniDatiSpec.TiEntitaSacerAroVersIniDatiSpec; import it.eng.parer.entity.constraint.AroVersIniDatiSpec.TiUsoXsdAroVersIniDatiSpec; +import it.eng.parer.util.Constants; import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.utils.MessaggiWSBundle; import it.eng.parer.ws.versamento.dto.SyncFakeSessn; import it.eng.parer.ws.versamentoUpd.dto.RispostaWSUpdVers; import it.eng.parer.ws.versamentoUpd.dto.StrutturaUpdVers; import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; -import static it.eng.parer.util.DateUtilsConverter.convert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.ejb.LocalBean; +import javax.ejb.Stateless; +import javax.ejb.TransactionAttribute; +import javax.ejb.TransactionAttributeType; +import javax.persistence.LockModeType; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static it.eng.parer.util.DateUtilsConverter.convertLocal; +import it.eng.parer.ws.versamento.dto.BackendStorage; +import it.eng.parer.ws.versamentoUpd.dto.DatiSpecLinkOsKeyMap; /** * * @author sinatti_s */ +@SuppressWarnings("unchecked") @Stateless(mappedName = "SalvataggioUpdVersamentoIniHelper") @LocalBean public class SalvataggioUpdVersamentoIniHelper extends SalvataggioUpdVersamentoBaseHelper { @@ -51,7 +61,7 @@ public RispostaControlli getAroVersIniUnitaDoc(long idUnitaDoc) { rispostaControlli = new RispostaControlli(); rispostaControlli.setrLong(-1); rispostaControlli.setrBoolean(false); - List aroVersIniUnitaDocs = null; + List aroVersIniUnitaDocs; try { @@ -280,24 +290,96 @@ public RispostaControlli scriviAroIniLinkUnitaDoc(RispostaWSUpdVers rispostaWs, } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli scriviAroIniDatiSpecUd(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroVersIniUnitaDoc tmpAroVersIniUnitaDoc, AroUsoXsdDatiSpec tmpAroUsoXsdDatiSpec, - StrutturaUpdVers svf) { - return scriviAroIniDatiSpec(rispostaWs, versamento, sessione, tmpAroVersIniUnitaDoc, null, null, - tmpAroUsoXsdDatiSpec, svf); + public RispostaControlli scriviAroIniDatiSpecUd(SyncFakeSessn sessione, AroVersIniUnitaDoc tmpAroVersIniUnitaDoc, + AroUsoXsdDatiSpec tmpAroUsoXsdDatiSpec, BackendStorage backendMetadata, + Map> versIniDatiSpecBlob, StrutturaUpdVers svf) { + + // MEV#29276 + DatiSpecLinkOsKeyMap key = new DatiSpecLinkOsKeyMap(tmpAroVersIniUnitaDoc.getIdVersIniUnitaDoc(), + TiEntitaSacerAroVersIniDatiSpec.UNI_DOC.name()); + Map versIniDatiSpecUdBlob = (versIniDatiSpecBlob.containsKey(key)) + ? versIniDatiSpecBlob.get(key) : new HashMap<>(); + // end MEV#29276 + + RispostaControlli tmpRispostaControlli = scriviAroIniDatiSpec(sessione, tmpAroVersIniUnitaDoc, null, null, + tmpAroUsoXsdDatiSpec, backendMetadata, versIniDatiSpecUdBlob, svf); + + // in caso di errore esecuzione query + if (!tmpRispostaControlli.isrBoolean()) { + return tmpRispostaControlli; + } + + // MEV#29276 + if (backendMetadata.isObjectStorage() && !versIniDatiSpecBlob.containsKey(key)) { + versIniDatiSpecBlob.put(key, versIniDatiSpecUdBlob); + } + // end MEV#29276 + + return tmpRispostaControlli; } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli scriviAroIniDatiSpecDoc(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroVersIniUnitaDoc tmpAroVersIniUnitaDoc, AroVersIniDoc tmpAroVersIniDoc, - AroVersIniComp tmpAroVersIniComp, AroUsoXsdDatiSpec tmpAroUsoXsdDatiSpec, StrutturaUpdVers svf) { - return scriviAroIniDatiSpec(rispostaWs, versamento, sessione, tmpAroVersIniUnitaDoc, tmpAroVersIniDoc, - tmpAroVersIniComp, tmpAroUsoXsdDatiSpec, svf); + public RispostaControlli scriviAroIniDatiSpecDoc(SyncFakeSessn sessione, AroVersIniUnitaDoc tmpAroVersIniUnitaDoc, + AroVersIniDoc tmpAroVersIniDoc, AroUsoXsdDatiSpec tmpAroUsoXsdDatiSpec, BackendStorage backendMetadata, + Map> versIniDatiSpecBlob, StrutturaUpdVers svf) { + + // MEV#29276 + DatiSpecLinkOsKeyMap key = new DatiSpecLinkOsKeyMap(tmpAroVersIniDoc.getIdVersIniDoc(), + TiEntitaSacerAroVersIniDatiSpec.DOC.name()); + Map versIniDatiSpecDocBlob = (versIniDatiSpecBlob.containsKey(key)) + ? versIniDatiSpecBlob.get(key) : new HashMap<>(); + // end MEV#29276 + + RispostaControlli tmpRispostaControlli = scriviAroIniDatiSpec(sessione, tmpAroVersIniUnitaDoc, tmpAroVersIniDoc, + null, tmpAroUsoXsdDatiSpec, backendMetadata, versIniDatiSpecDocBlob, svf); + + // in caso di errore esecuzione query + if (!tmpRispostaControlli.isrBoolean()) { + return tmpRispostaControlli; + } + + // MEV#29276 + if (backendMetadata.isObjectStorage() && !versIniDatiSpecBlob.containsKey(key)) { + versIniDatiSpecBlob.put(key, versIniDatiSpecDocBlob); + } + // end MEV#29276 + + return tmpRispostaControlli; } - private RispostaControlli scriviAroIniDatiSpec(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroVersIniUnitaDoc tmpAroVersIniUnitaDoc, AroVersIniDoc tmpAroVersIniDoc, - AroVersIniComp tmpAroVersIniComp, AroUsoXsdDatiSpec tmpAroUsoXsdDatiSpec, StrutturaUpdVers svf) { + @TransactionAttribute(TransactionAttributeType.REQUIRED) + public RispostaControlli scriviAroIniDatiSpecComp(SyncFakeSessn sessione, AroVersIniUnitaDoc tmpAroVersIniUnitaDoc, + AroVersIniDoc tmpAroVersIniDoc, AroVersIniComp tmpAroVersIniComp, AroUsoXsdDatiSpec tmpAroUsoXsdDatiSpec, + BackendStorage backendMetadata, Map> versIniDatiSpecBlob, + StrutturaUpdVers svf) { + + // MEV#29276 + DatiSpecLinkOsKeyMap key = new DatiSpecLinkOsKeyMap(tmpAroVersIniComp.getIdVersIniComp(), + TiEntitaSacerAroVersIniDatiSpec.COMP.name()); + Map versIniDatiSpecCompBlob = (versIniDatiSpecBlob.containsKey(key)) + ? versIniDatiSpecBlob.get(key) : new HashMap<>(); + // end MEV#29276 + + RispostaControlli tmpRispostaControlli = scriviAroIniDatiSpec(sessione, tmpAroVersIniUnitaDoc, tmpAroVersIniDoc, + tmpAroVersIniComp, tmpAroUsoXsdDatiSpec, backendMetadata, versIniDatiSpecCompBlob, svf); + + // in caso di errore esecuzione query + if (!tmpRispostaControlli.isrBoolean()) { + return tmpRispostaControlli; + } + + // MEV#29276 + if (backendMetadata.isObjectStorage() && !versIniDatiSpecBlob.containsKey(key)) { + versIniDatiSpecBlob.put(key, versIniDatiSpecCompBlob); + } + // end MEV#29276 + + return tmpRispostaControlli; + } + + private RispostaControlli scriviAroIniDatiSpec(SyncFakeSessn sessione, AroVersIniUnitaDoc tmpAroVersIniUnitaDoc, + AroVersIniDoc tmpAroVersIniDoc, AroVersIniComp tmpAroVersIniComp, AroUsoXsdDatiSpec tmpAroUsoXsdDatiSpec, + BackendStorage backendMetadata, Map tmpVersIniDatiSpecBlob, StrutturaUpdVers svf) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); @@ -315,7 +397,10 @@ private RispostaControlli scriviAroIniDatiSpec(RispostaWSUpdVers rispostaWs, Upd // FK tmpAroVersIniDatiSpec.setIdStrut(new BigDecimal(svf.getIdStruttura())); - tmpAroVersIniDatiSpec.setDtReg(convert(sessione.getTmApertura())); + final LocalDate dtReg = convertLocal(sessione.getTmApertura()); + tmpAroVersIniDatiSpec.setDtReg(dtReg); + // MEV#30089 + tmpAroVersIniDatiSpec.setAaDtReg(dtReg.getYear()); // tipo di uso del xsd pari a VERS tmpAroVersIniDatiSpec.setTiUsoXsd(TiUsoXsdAroVersIniDatiSpec.valueOf(tmpAroUsoXsdDatiSpec.getTiUsoXsd())); @@ -337,7 +422,15 @@ private RispostaControlli scriviAroIniDatiSpec(RispostaWSUpdVers rispostaWs, Upd return tmpRispostaControlli; } - tmpAroVersIniDatiSpec.setBlXmlDatiSpec(tmpRispostaControlli.getrString()); + // MEV#29276 + // Clob contenente il frammento XML contenuto nel tag “DatiSpecifici” del XML in + String blXmlDatiSpec = tmpRispostaControlli.getrString(); + if (backendMetadata.isDataBase()) { + tmpAroVersIniDatiSpec.setBlXmlDatiSpec(blXmlDatiSpec); + } else { + tmpVersIniDatiSpecBlob.put(tmpAroUsoXsdDatiSpec.getTiUsoXsd(), blXmlDatiSpec); + } + // end MEV#29276 // persist entityManager.persist(tmpAroVersIniDatiSpec); @@ -381,7 +474,7 @@ public RispostaControlli scriviAroIniDoc(RispostaWSUpdVers rispostaWs, UpdVersam // 0. si assume LOCK esclusivo su DOC da aggiornare // find AroDoc Map properties = new HashMap<>(); - properties.put("javax.persistence.lock.timeout", 25); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, 25000); AroDoc aroDoc = entityManager.find(AroDoc.class, idDoc, LockModeType.PESSIMISTIC_WRITE, properties); // info su profilo documento definite dal versamento documento (dl_doc e @@ -421,7 +514,7 @@ public RispostaControlli scriviAroIniComp(RispostaWSUpdVers rispostaWs, UpdVersa // si assume LOCK esclusivo su COMP da aggiornare // find AroCompDoc Map properties = new HashMap<>(); - properties.put("javax.persistence.lock.timeout", 25); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, 25000); AroCompDoc aroCompDoc = entityManager.find(AroCompDoc.class, idCompDoc, LockModeType.PESSIMISTIC_WRITE, properties); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoUpdHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoUpdHelper.java index b895a5d..306b6c1 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoUpdHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoUpdHelper.java @@ -1,94 +1,76 @@ -package it.eng.parer.ws.versamentoUpd.ejb.help; - -import java.io.StringWriter; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Calendar; -import java.util.GregorianCalendar; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -import javax.ejb.LocalBean; -import javax.ejb.Stateless; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.persistence.LockModeType; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import javax.xml.parsers.ParserConfigurationException; +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +package it.eng.parer.ws.versamentoUpd.ejb.help; -import it.eng.parer.entity.AroArchivSec; -import it.eng.parer.entity.AroCompDoc; -import it.eng.parer.entity.AroDoc; -import it.eng.parer.entity.AroLinkUnitaDoc; -import it.eng.parer.entity.AroUnitaDoc; -import it.eng.parer.entity.AroUpdArchivSec; -import it.eng.parer.entity.AroUpdCompUnitaDoc; -import it.eng.parer.entity.AroUpdDatiSpecUnitaDoc; -import it.eng.parer.entity.AroUpdDocUnitaDoc; -import it.eng.parer.entity.AroUpdLinkUnitaDoc; -import it.eng.parer.entity.AroUpdUnitaDoc; -import it.eng.parer.entity.AroUsoXsdDatiSpec; -import it.eng.parer.entity.AroWarnUpdUnitaDoc; -import it.eng.parer.entity.AroXmlUpdUnitaDoc; -import it.eng.parer.entity.DecRegistroUnitaDoc; -import it.eng.parer.entity.DecTipoDoc; -import it.eng.parer.entity.DecTipoUnitaDoc; -import it.eng.parer.entity.DecXsdDatiSpec; -import it.eng.parer.entity.ElvUpdUdDaElabElenco; -import it.eng.parer.entity.IamUser; -import it.eng.parer.entity.MonKeyTotalUd; -import it.eng.parer.entity.MonKeyTotalUdKo; -import it.eng.parer.entity.OrgStrut; -import it.eng.parer.entity.VrsSesUpdUnitaDocKo; -import it.eng.parer.entity.VrsUpdUnitaDocKo; +import it.eng.parer.entity.*; import it.eng.parer.entity.constraint.AroUpdDatiSpecUnitaDoc.TiEntitaAroUpdDatiSpecUnitaDoc; import it.eng.parer.entity.constraint.AroUpdDatiSpecUnitaDoc.TiUsoXsdAroUpdDatiSpecUnitaDoc; import it.eng.parer.entity.constraint.AroUpdUnitaDoc.AroUpdUDTiStatoUpdElencoVers; import it.eng.parer.entity.constraint.AroXmlUpdUnitaDoc.TiXmlUpdUnitaDoc; import it.eng.parer.entity.constraint.ElvUpdUdDaElabElenco.ElvUpdUdDaElabTiStatoUpdElencoVers; import it.eng.parer.entity.constraint.VrsSesUpdUnitaDocKo.TiStatoSesUpdKo; +import it.eng.parer.util.Constants; import it.eng.parer.ws.dto.RispostaControlli; -import it.eng.parer.ws.utils.Costanti; +import it.eng.parer.ws.utils.*; import it.eng.parer.ws.utils.Costanti.CategoriaDocumento; -import it.eng.parer.ws.utils.CostantiDB; import it.eng.parer.ws.utils.CostantiDB.TipiHash; import it.eng.parer.ws.utils.CostantiDB.TipoAnnullamentoUnitaDoc; -import it.eng.parer.ws.utils.HashCalculator; -import it.eng.parer.ws.utils.LogSessioneUtils; -import it.eng.parer.ws.utils.MessaggiWSBundle; -import it.eng.parer.ws.utils.MessaggiWSFormat; import it.eng.parer.ws.versamento.dto.SyncFakeSessn; import it.eng.parer.ws.versamento.dto.VoceDiErrore; -import it.eng.parer.ws.versamentoUpd.dto.CompRapportoUpdVers; -import it.eng.parer.ws.versamentoUpd.dto.ControlloEseguito; -import it.eng.parer.ws.versamentoUpd.dto.RispostaWSUpdVers; -import it.eng.parer.ws.versamentoUpd.dto.StrutturaUpdVers; -import it.eng.parer.ws.versamentoUpd.dto.UpdComponenteVers; -import it.eng.parer.ws.versamentoUpd.dto.UpdDocumentoVers; -import it.eng.parer.ws.versamentoUpd.dto.UpdUnitaDocColl; +import it.eng.parer.ws.versamentoUpd.dto.*; import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; import it.eng.parer.ws.versamentoUpd.utils.UpdDocumentiUtils; import it.eng.parer.ws.xml.versUpdReq.CamiciaFascicoloType; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.ejb.LocalBean; +import javax.ejb.Stateless; +import javax.ejb.TransactionAttribute; +import javax.ejb.TransactionAttributeType; +import javax.persistence.LockModeType; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.parsers.ParserConfigurationException; +import java.io.StringWriter; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.util.*; +import java.util.stream.Collectors; + import static it.eng.parer.util.DateUtilsConverter.convert; +import static it.eng.parer.util.DateUtilsConverter.convertLocal; +import static it.eng.parer.util.FlagUtilsConverter.booleanToFlag; +import it.eng.parer.ws.versamento.dto.BackendStorage; /** * - * @author sinatti_s + * @author sinatti_s, dilorenzo_f */ @Stateless(mappedName = "SalvataggioUpdVersamentoUpdHelper") @LocalBean public class SalvataggioUpdVersamentoUpdHelper extends SalvataggioUpdVersamentoBaseHelper { + public static final String ERR_SALVA_XML_UD = "Errore interno nella fase di salvataggio dell'aggiornamento dell'xml dell'unità documentaria"; + public RispostaControlli getNextPgAroUpdUnitaDoc(long idUnitaDoc) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); @@ -128,8 +110,6 @@ public RispostaControlli getNextPgAroUpdUnitaDoc(long idUnitaDoc) { */ /** * - * @param rispostaWs - * risposta ws {@link RispostaWSUpdVers} * @param versamento * oggetto versamento {@link UpdVersamentoExt} * @param sessione @@ -144,14 +124,14 @@ public RispostaControlli getNextPgAroUpdUnitaDoc(long idUnitaDoc) { * @return RispostaControlli con risultato operazione di persistanza su DB */ @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli scriviAroUpdUnitaDoc(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, long pgUpdUnitaDoc, StrutturaUpdVers svf) { + public RispostaControlli scriviAroUpdUnitaDoc(UpdVersamentoExt versamento, SyncFakeSessn sessione, + AroUnitaDoc tmpAroUnitaDoc, long pgUpdUnitaDoc, StrutturaUpdVers svf) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); try { // dt_annull default - Calendar tmpCal = GregorianCalendar.getInstance(); + Calendar tmpCal = Calendar.getInstance(); tmpCal.set(2444, 11, 31, 0, 0, 0); StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); @@ -181,7 +161,7 @@ public RispostaControlli scriviAroUpdUnitaDoc(RispostaWSUpdVers rispostaWs, UpdV tmpAroUpdUnitaDoc.setIamUser(entityManager.find(IamUser.class, versamento.getUtente().getIdUtente())); // indicatore di forzatura dell’aggiornamento definito da unita doc da // aggiornare - tmpAroUpdUnitaDoc.setFlForzaUpd(svf.getFlControlliUpd().isFlAbilitaUpdMeta() ? "1" : "0"); + tmpAroUpdUnitaDoc.setFlForzaUpd(booleanToFlag(svf.getFlControlliUpd().isFlAbilitaUpdMeta())); // note dell’aggiornamento definito da unita doc da aggiornare tmpAroUpdUnitaDoc.setNtUpd(svf.getNoteAggiornamento()); @@ -216,11 +196,6 @@ public RispostaControlli scriviAroUpdUnitaDoc(RispostaWSUpdVers rispostaWs, UpdV : null); } - /* - * else { tmpAroUpdUnitaDoc.setCdFascicPrinc(tmpAroUnitaDoc.getCdFascicPrinc()); // from aro // - * tmpAroUpdUnitaDoc.setDsOggettoFascicPrinc(tmpAroUnitaDoc. getDsOggettoFascicPrinc()); // from aro // - * } // figlio 1 - */ if (versamento.getVersamento().getUnitaDocumentaria().getProfiloArchivistico().getFascicoloPrincipale() .getSottoFascicolo() != null) /* figlio 2 */ { @@ -238,15 +213,9 @@ public RispostaControlli scriviAroUpdUnitaDoc(RispostaWSUpdVers rispostaWs, UpdV .getFascicoloPrincipale().getSottoFascicolo().getOggetto() : null);// può essere null } - /* - * else { tmpAroUpdUnitaDoc.setCdSottofascicPrinc(tmpAroUnitaDoc.getCdSottofascicPrinc( )); // from aro - * // tmpAroUpdUnitaDoc.setDsOggettoSottofascicPrinc(tmpAroUnitaDoc. getDsOggettoFascicPrinc()); // from - * aro // } - */ } else if (!versamento.hasProfiloArchivisticoToUpdNull()) { // non esiste il ramo ProfiloArchivistico/FascicoloPrincipale // setto / recupero i valori presente nell'attuale ARO_UNITA_DOC - // TODO: verificare se corretto ! tmpAroUpdUnitaDoc.setDsClassifPrinc(tmpAroUnitaDoc.getDsClassifPrinc()); tmpAroUpdUnitaDoc.setCdFascicPrinc(tmpAroUnitaDoc.getCdFascicPrinc()); @@ -274,7 +243,6 @@ public RispostaControlli scriviAroUpdUnitaDoc(RispostaWSUpdVers rispostaWs, UpdV } else { // non esiste il ramo rofiloUnitaDocumentaria // setto / recupero i valori presente nell'attuale ARO_UNITA_DOC - // TODO: verificare se corretto ! tmpAroUpdUnitaDoc.setDlOggettoUnitaDoc(tmpAroUnitaDoc.getDlOggettoUnitaDoc()); tmpAroUpdUnitaDoc.setDtRegUnitaDoc(tmpAroUnitaDoc.getDtRegUnitaDoc()); @@ -300,21 +268,21 @@ public RispostaControlli scriviAroUpdUnitaDoc(RispostaWSUpdVers rispostaWs, UpdV // indicatore di presenza di aggiornamenti falliti risolti = false tmpAroUpdUnitaDoc.setFlSesUpdKoRisolti("0"); // - tmpAroUpdUnitaDoc.setFlUpdProfiloArchiv(versamento.hasProfiloArchivisticoToUpd() ? "1" : "0"); + tmpAroUpdUnitaDoc.setFlUpdProfiloArchiv(booleanToFlag(versamento.hasProfiloArchivisticoToUpd())); // - tmpAroUpdUnitaDoc.setFlUpdFascicoloPrinc(versamento.hasPAFascicoloPrincipaleToUpd() ? "1" : "0"); + tmpAroUpdUnitaDoc.setFlUpdFascicoloPrinc(booleanToFlag(versamento.hasPAFascicoloPrincipaleToUpd())); // - tmpAroUpdUnitaDoc.setFlUpdFascicoliSec(versamento.hasPAFascicoliSecondariToUp() ? "1" : "0"); + tmpAroUpdUnitaDoc.setFlUpdFascicoliSec(booleanToFlag(versamento.hasPAFascicoliSecondariToUp())); // - tmpAroUpdUnitaDoc.setFlUpdProfiloUnitaDoc(versamento.hasProfiloUnitaDocumentariaToUpd() ? "1" : "0"); + tmpAroUpdUnitaDoc.setFlUpdProfiloUnitaDoc(booleanToFlag(versamento.hasProfiloUnitaDocumentariaToUpd())); // - tmpAroUpdUnitaDoc.setFlUpdLinkUnitaDoc(versamento.hasDocumentiCollegatiToUpd() ? "1" : "0"); + tmpAroUpdUnitaDoc.setFlUpdLinkUnitaDoc(booleanToFlag(versamento.hasDocumentiCollegatiToUpd())); // - tmpAroUpdUnitaDoc.setFlUpdDatiSpec(versamento.hasDatiSpecificiToBeUpdated() ? "1" : "0"); + tmpAroUpdUnitaDoc.setFlUpdDatiSpec(booleanToFlag(versamento.hasDatiSpecificiToBeUpdated())); // - tmpAroUpdUnitaDoc.setFlUpdDatiSpecMigraz(versamento.hasDatiSpecificiMigrazioneToUpd() ? "1" : "0"); + tmpAroUpdUnitaDoc.setFlUpdDatiSpecMigraz(booleanToFlag(versamento.hasDatiSpecificiMigrazioneToUpd())); // - // TODO tmpAroUpdUnitaDoc.setElvElencoVer(null); + tmpAroUpdUnitaDoc.setFlUpdProfiloNormativo(booleanToFlag(versamento.hasProfiloNormativoToUpd())); // tmpAroUpdUnitaDoc.setTipoUpdUnitaDoc(strutturaUpdVers.getTipoAggiornamento()); @@ -349,6 +317,10 @@ public RispostaControlli scriviAroUpdUnitaDoc(RispostaWSUpdVers rispostaWs, UpdV * entity {@link AroUnitaDoc} "temporanea" (in lavorazione) * @param tmpAroUpdUnitaDoc * entity {@link AroUpdUnitaDoc} "temporanea" (in lavorazione) + * @param backendMetadata + * backend usato + * @param sipBlob + * mappa contenente i clob del sip * @param strutturaUpdVers * dto con dati controlli {@link StrutturaUpdVers} * @@ -357,22 +329,28 @@ public RispostaControlli scriviAroUpdUnitaDoc(RispostaWSUpdVers rispostaWs, UpdV @TransactionAttribute(TransactionAttributeType.REQUIRED) public RispostaControlli scriviAroXmlUpdUnitaDoc(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc, - StrutturaUpdVers strutturaUpdVers) { + BackendStorage backendMetadata, Map sipBlob, StrutturaUpdVers strutturaUpdVers) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); CompRapportoUpdVers esito = rispostaWs.getCompRapportoUpdVers(); + final LocalDate dtIniSes = convertLocal(sessione.getTmApertura()); try { - AroXmlUpdUnitaDoc tmpAroXmlUpdUnitaDoc = new AroXmlUpdUnitaDoc(); - // FK all’aggiornamento unità doc tmpAroXmlUpdUnitaDoc.setAroUpdUnitaDoc(tmpAroUpdUnitaDoc); // tipo XML pari a RICHIESTA tmpAroXmlUpdUnitaDoc.setTiXmlUpdUnitaDoc(TiXmlUpdUnitaDoc.RICHIESTA); - // clob contenente lo XML in input (canonicalizzato) - tmpAroXmlUpdUnitaDoc.setBlXml( - sessione.getDatiDaSalvareIndiceSip().length() == 0 ? "--" : sessione.getDatiDaSalvareIndiceSip()); + // MEV#29276 + String blXml = sessione.getDatiDaSalvareIndiceSip().length() == 0 ? "--" + : sessione.getDatiDaSalvareIndiceSip(); + if (backendMetadata.isDataBase()) { + // clob contenente lo XML in input (canonicalizzato) + tmpAroXmlUpdUnitaDoc.setBlXml(blXml); + } else { + sipBlob.put(TiXmlUpdUnitaDoc.RICHIESTA.toString(), blXml); + } + // end MEV#29276 // versione xml in input definita da unita doc da aggiornare tmpAroXmlUpdUnitaDoc.setCdVersioneXml(strutturaUpdVers.getVersioneIndiceSipNonVerificata()); @@ -417,7 +395,9 @@ public RispostaControlli scriviAroXmlUpdUnitaDoc(RispostaWSUpdVers rispostaWs, U // identificatore della struttura definito dall’unita doc da aggiornare tmpAroXmlUpdUnitaDoc.setOrgStrut(entityManager.find(OrgStrut.class, strutturaUpdVers.getIdStruttura())); - tmpAroXmlUpdUnitaDoc.setDtIniSes(convert(sessione.getTmApertura())); + tmpAroXmlUpdUnitaDoc.setDtIniSes(dtIniSes); + // MEV#30089 + tmpAroXmlUpdUnitaDoc.setAaIniSes(dtIniSes.getYear()); entityManager.persist(tmpAroXmlUpdUnitaDoc); // add on list @@ -430,8 +410,14 @@ public RispostaControlli scriviAroXmlUpdUnitaDoc(RispostaWSUpdVers rispostaWs, U tmpAroXmlUpdUnitaDoc.setAroUpdUnitaDoc(tmpAroUpdUnitaDoc); // tipo XML pari a RISPOSTA tmpAroXmlUpdUnitaDoc.setTiXmlUpdUnitaDoc(TiXmlUpdUnitaDoc.RISPOSTA); - // clob contenente lo XML in input (canonicalizzato) - tmpAroXmlUpdUnitaDoc.setBlXml(xmlesito); + // MEV#29276 + if (backendMetadata.isDataBase()) { + // clob contenente lo XML in input (canonicalizzato) + tmpAroXmlUpdUnitaDoc.setBlXml(xmlesito); + } else { + sipBlob.put(TiXmlUpdUnitaDoc.RISPOSTA.toString(), xmlesito); + } + // end MEV#29276 // versione xml in input definita da unita doc da aggiornare tmpAroXmlUpdUnitaDoc.setCdVersioneXml(esito.getVersioneRapportoVersamento()); @@ -447,27 +433,25 @@ public RispostaControlli scriviAroXmlUpdUnitaDoc(RispostaWSUpdVers rispostaWs, U // identificatore della struttura definito dall’unita doc da aggiornare tmpAroXmlUpdUnitaDoc.setOrgStrut(entityManager.find(OrgStrut.class, strutturaUpdVers.getIdStruttura())); - tmpAroXmlUpdUnitaDoc.setDtIniSes(convert(sessione.getTmApertura())); + tmpAroXmlUpdUnitaDoc.setDtIniSes(dtIniSes); + // MEV#30089 + tmpAroXmlUpdUnitaDoc.setAaIniSes(dtIniSes.getYear()); entityManager.persist(tmpAroXmlUpdUnitaDoc); entityManager.flush(); tmpRispostaControlli.setrBoolean(true); } catch (Exception e) { tmpRispostaControlli.setCodErr(MessaggiWSBundle.ERR_666P); - tmpRispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666P, - "Errore interno nella fase di salvataggio dell'aggiornamento dell'xml dell'unità documentaria: " - + e.getMessage())); + tmpRispostaControlli.setDsErr( + MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666P, ERR_SALVA_XML_UD + ": " + e.getMessage())); tmpRispostaControlli.setrBoolean(false); - getLogger().error( - "Errore interno nella fase di salvataggio dell'aggiornamento dell'xml dell'unità documentaria", e); + getLogger().error(ERR_SALVA_XML_UD, e); } return tmpRispostaControlli; } - public RispostaControlli scriviAroWarnUpdUnitaDocForUD(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc aroUpdUnitaDoc, - StrutturaUpdVers strutturaUpdVers) { + public RispostaControlli scriviAroWarnUpdUnitaDocForUD(UpdVersamentoExt versamento, AroUpdUnitaDoc aroUpdUnitaDoc) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); int progWarn = 1; @@ -475,11 +459,9 @@ public RispostaControlli scriviAroWarnUpdUnitaDocForUD(RispostaWSUpdVers rispost // per ogni controllo svolto sull’unità doc da aggiornare con esito = WARNING // (in ordine di numero d’ordine del controllo) // NOTA: non serve utilizzare la lista warnings dato che lo stesso errore è - // presente nelle altre due ! progWarn = buildWarn(versamento.getWarnings(), - // rispostaWs, versamento, aroUpdUnitaDoc, progWarn); - progWarn = buildWarn(versamento.getControlliGenerali(), rispostaWs, versamento, aroUpdUnitaDoc, progWarn); - progWarn = buildWarn(versamento.getControlliUnitaDocumentaria(), rispostaWs, versamento, aroUpdUnitaDoc, - progWarn); + // presente nelle altre due + progWarn = buildWarn(versamento.getControlliGenerali(), versamento, aroUpdUnitaDoc, progWarn); + buildWarn(versamento.getControlliUnitaDocumentaria(), versamento, aroUpdUnitaDoc, progWarn); entityManager.flush(); tmpRispostaControlli.setrBoolean(true); @@ -497,8 +479,7 @@ public RispostaControlli scriviAroWarnUpdUnitaDocForUD(RispostaWSUpdVers rispost } - public RispostaControlli scriviAroWarnUpdUnitaDocForDoc(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc aroUpdUnitaDoc, + public RispostaControlli scriviAroWarnUpdUnitaDocForDoc(UpdVersamentoExt versamento, AroUpdUnitaDoc aroUpdUnitaDoc, StrutturaUpdVers strutturaUpdVers) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); @@ -513,22 +494,25 @@ public RispostaControlli scriviAroWarnUpdUnitaDocForDoc(RispostaWSUpdVers rispos case Principale: progWarn = buildWarn( versamento.getControlliDocPrincipale(documento.getRifUpdDocumento().getIDDocumento()), - rispostaWs, versamento, aroUpdUnitaDoc, progWarn); + versamento, aroUpdUnitaDoc, progWarn); break; case Allegato: progWarn = buildWarn( versamento.getControlliAllegato(documento.getRifUpdDocumento().getIDDocumento()), - rispostaWs, versamento, aroUpdUnitaDoc, progWarn); + versamento, aroUpdUnitaDoc, progWarn); break; case Annesso: progWarn = buildWarn( - versamento.getControlliAnnesso(documento.getRifUpdDocumento().getIDDocumento()), rispostaWs, - versamento, aroUpdUnitaDoc, progWarn); + versamento.getControlliAnnesso(documento.getRifUpdDocumento().getIDDocumento()), versamento, + aroUpdUnitaDoc, progWarn); break; case Annotazione: progWarn = buildWarn( versamento.getControlliAnnotazione(documento.getRifUpdDocumento().getIDDocumento()), - rispostaWs, versamento, aroUpdUnitaDoc, progWarn); + versamento, aroUpdUnitaDoc, progWarn); + break; + default: + // niente da fare negli altri casi break; } } @@ -546,8 +530,7 @@ public RispostaControlli scriviAroWarnUpdUnitaDocForDoc(RispostaWSUpdVers rispos return tmpRispostaControlli; } - public RispostaControlli scriviAroWarnUpdUnitaDocForComp(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc aroUpdUnitaDoc, + public RispostaControlli scriviAroWarnUpdUnitaDocForComp(UpdVersamentoExt versamento, AroUpdUnitaDoc aroUpdUnitaDoc, StrutturaUpdVers strutturaUpdVers) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); @@ -562,20 +545,23 @@ public RispostaControlli scriviAroWarnUpdUnitaDocForComp(RispostaWSUpdVers rispo switch (documento.getCategoriaDoc()) { case Principale: progWarn = buildWarn(versamento.getControlliComponenteDocPrincipale(componente.getKeyCtrl()), - rispostaWs, versamento, aroUpdUnitaDoc, progWarn); + versamento, aroUpdUnitaDoc, progWarn); break; case Allegato: progWarn = buildWarn(versamento.getControlliComponenteAllegati(componente.getKeyCtrl()), - rispostaWs, versamento, aroUpdUnitaDoc, progWarn); + versamento, aroUpdUnitaDoc, progWarn); break; case Annesso: progWarn = buildWarn(versamento.getControlliComponenteAnnessi(componente.getKeyCtrl()), - rispostaWs, versamento, aroUpdUnitaDoc, progWarn); + versamento, aroUpdUnitaDoc, progWarn); break; case Annotazione: progWarn = buildWarn(versamento.getControlliComponenteAnnotazioni(componente.getKeyCtrl()), - rispostaWs, versamento, aroUpdUnitaDoc, progWarn); + versamento, aroUpdUnitaDoc, progWarn); + break; + default: + // niente da fare negli altri casi break; } @@ -595,7 +581,7 @@ public RispostaControlli scriviAroWarnUpdUnitaDocForComp(RispostaWSUpdVers rispo return tmpRispostaControlli; } - private int buildWarn(Set ctrlList, RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, + private int buildWarn(Set ctrlList, UpdVersamentoExt versamento, AroUpdUnitaDoc tmpAroUpdUnitaDoc, int progWarn) { AroWarnUpdUnitaDoc tmpAroWarnUpdUnitaDoc; // filter @@ -723,12 +709,10 @@ public RispostaControlli scriviAroUpdArchivSec(RispostaWSUpdVers rispostaWs, Upd tmpRispostaControlli.setrBoolean(true); } catch (Exception e) { tmpRispostaControlli.setCodErr(MessaggiWSBundle.ERR_666P); - tmpRispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666P, - "Errore interno nella fase di salvataggio dell'aggiornamento dell'xml dell'unità documentaria: " - + e.getMessage())); + tmpRispostaControlli + .setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666P, ERR_SALVA_XML_UD + e.getMessage())); tmpRispostaControlli.setrBoolean(false); - getLogger().error( - "Errore interno nella fase di salvataggio dell'aggiornamento dell'xml dell'unità documentaria", e); + getLogger().error(ERR_SALVA_XML_UD, e); } return tmpRispostaControlli; @@ -759,7 +743,7 @@ private Map, CamiciaFascicoloType> removeDuplicateFascicoli(UpdVers tmpArrP[4] = tmpFp.getSottoFascicolo().getOggetto(); } } - List tmpListP = Arrays.asList(tmpArrP); + List tmpListP = Arrays.asList(tmpArrP); // elimina i fascicoli/sottofascicoli inseriti due volte // il problema si presenta con alcuni versatori poco precisi. // non si vuole rendere un messaggio di errore, perciò i doppioni vengono @@ -782,7 +766,7 @@ private Map, CamiciaFascicoloType> removeDuplicateFascicoli(UpdVers if (fascicolo.getSottoFascicolo() != null && fascicolo.getSottoFascicolo().getOggetto() != null) { tmpArr[4] = fascicolo.getSottoFascicolo().getOggetto(); } - List tmpList = Arrays.asList(tmpArr); + List tmpList = Arrays.asList(tmpArr); if (!tmpListP.equals(tmpList)) { // se il fascicolo è uguale al principale, non lo considero // in ogni caso inserisco il dato in un'hashmap, così i fascicoli duplicati @@ -794,9 +778,8 @@ private Map, CamiciaFascicoloType> removeDuplicateFascicoli(UpdVers return tmpFascicoliUnivoci; } - public RispostaControlli scriviAroUpdLinkUnitaDoc(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc, - StrutturaUpdVers strutturaUpdVers) { + public RispostaControlli scriviAroUpdLinkUnitaDoc(UpdVersamentoExt versamento, AroUnitaDoc tmpAroUnitaDoc, + AroUpdUnitaDoc tmpAroUpdUnitaDoc, StrutturaUpdVers strutturaUpdVers) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); @@ -853,32 +836,38 @@ public RispostaControlli scriviAroUpdLinkUnitaDoc(RispostaWSUpdVers rispostaWs, tmpRispostaControlli.setrBoolean(true); } catch (Exception e) { tmpRispostaControlli.setCodErr(MessaggiWSBundle.ERR_666P); - tmpRispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666P, - "Errore interno nella fase di salvataggio dell'aggiornamento dell'xml dell'unità documentaria: " - + e.getMessage())); + tmpRispostaControlli + .setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666P, ERR_SALVA_XML_UD + e.getMessage())); tmpRispostaControlli.setrBoolean(false); - getLogger().error( - "Errore interno nella fase di salvataggio dell'aggiornamento dell'xml dell'unità documentaria", e); + getLogger().error(ERR_SALVA_XML_UD, e); } return tmpRispostaControlli; } - public RispostaControlli scriviAroUpdDatiSpecUnitaDoc(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc, - TiUsoXsdAroUpdDatiSpecUnitaDoc tiUsoXsd, TiEntitaAroUpdDatiSpecUnitaDoc tiEntitaSacer, - StrutturaUpdVers strutturaUpdVers) { + public RispostaControlli scriviAroUpdDatiSpecUnitaDoc(UpdVersamentoExt versamento, SyncFakeSessn sessione, + AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc, TiUsoXsdAroUpdDatiSpecUnitaDoc tiUsoXsd, + TiEntitaAroUpdDatiSpecUnitaDoc tiEntitaSacer, BackendStorage backendMetadata, + Map> updDatiSpecBlob, StrutturaUpdVers strutturaUpdVers) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); try { + // MEV#29276 + DatiSpecLinkOsKeyMap key = new DatiSpecLinkOsKeyMap(tmpAroUpdUnitaDoc.getIdUpdUnitaDoc(), + TiEntitaAroUpdDatiSpecUnitaDoc.UPD_UNI_DOC.name()); + Map updDatiSpecUdBlob = (updDatiSpecBlob.containsKey(key)) ? updDatiSpecBlob.get(key) + : new HashMap<>(); + // end MEV#29276 + if (tiUsoXsd.equals(TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS)) { - if (versamento.hasDatiSpecificiToBeUpdated()) { + if (versamento.hasDatiSpecificiToBeUpdated() && strutturaUpdVers.getIdRecXsdDatiSpec() != 0) { // build entity buildAroUpdDatiSpecUnitaDocFromUpd(sessione, versamento.getVersamento().getUnitaDocumentaria().getDatiSpecifici(), tmpAroUpdUnitaDoc, - null, null, tiUsoXsd, tiEntitaSacer, strutturaUpdVers.getIdRecXsdDatiSpec()); + null, null, tiUsoXsd, tiEntitaSacer, backendMetadata, updDatiSpecUdBlob, + strutturaUpdVers.getIdRecXsdDatiSpec()); } else { tmpRispostaControlli = super.checkUsoXsdDatiSpecifici(tmpAroUnitaDoc.getIdUnitaDoc(), CostantiDB.TipiUsoDatiSpec.VERS, CostantiDB.TipiEntitaSacer.UNI_DOC); @@ -893,23 +882,23 @@ public RispostaControlli scriviAroUpdDatiSpecUnitaDoc(RispostaWSUpdVers risposta AroUsoXsdDatiSpec aroUsoXsdDatiSpec = (AroUsoXsdDatiSpec) tmpRispostaControlli.getrObject(); // tmpRispostaControlli = buildAroUpdDatiSpecUnitaDocFromAro(sessione, tmpAroUpdUnitaDoc, null, - null, aroUsoXsdDatiSpec); + null, aroUsoXsdDatiSpec, backendMetadata, updDatiSpecUdBlob); // in caso di errore esecuzione query per ricerva valori su attributo if (!tmpRispostaControlli.isrBoolean()) { return tmpRispostaControlli; } - } } } // if VERS if (tiUsoXsd.equals(TiUsoXsdAroUpdDatiSpecUnitaDoc.MIGRAZ)) { - if (versamento.hasDatiSpecificiMigrazioneToUpd()) { + if (versamento.hasDatiSpecificiMigrazioneToUpd() + && strutturaUpdVers.getIdRecXsdDatiSpecMigrazione() != 0) { // build entity buildAroUpdDatiSpecUnitaDocFromUpd(sessione, versamento.getVersamento().getUnitaDocumentaria().getDatiSpecificiMigrazione(), - tmpAroUpdUnitaDoc, null, null, tiUsoXsd, tiEntitaSacer, + tmpAroUpdUnitaDoc, null, null, tiUsoXsd, tiEntitaSacer, backendMetadata, updDatiSpecUdBlob, strutturaUpdVers.getIdRecXsdDatiSpecMigrazione()); } else { tmpRispostaControlli = super.checkUsoXsdDatiSpecifici(tmpAroUnitaDoc.getIdUnitaDoc(), @@ -925,7 +914,7 @@ public RispostaControlli scriviAroUpdDatiSpecUnitaDoc(RispostaWSUpdVers risposta AroUsoXsdDatiSpec aroUsoXsdDatiSpec = (AroUsoXsdDatiSpec) tmpRispostaControlli.getrObject(); // tmpRispostaControlli = buildAroUpdDatiSpecUnitaDocFromAro(sessione, tmpAroUpdUnitaDoc, null, - null, aroUsoXsdDatiSpec); + null, aroUsoXsdDatiSpec, backendMetadata, updDatiSpecUdBlob); // in caso di errore esecuzione query per ricerva valori su attributo if (!tmpRispostaControlli.isrBoolean()) { @@ -935,17 +924,21 @@ public RispostaControlli scriviAroUpdDatiSpecUnitaDoc(RispostaWSUpdVers risposta } } // if MIGRAZ + // MEV#29276 + if (backendMetadata.isObjectStorage() && !updDatiSpecBlob.containsKey(key)) { + updDatiSpecBlob.put(key, updDatiSpecUdBlob); + } + // end MEV#29276 + entityManager.flush(); tmpRispostaControlli.setrBoolean(true); } catch (Exception e) { tmpRispostaControlli.setCodErr(MessaggiWSBundle.ERR_666P); - tmpRispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666P, - "Errore interno nella fase di salvataggio dell'aggiornamento dell'xml dell'unità documentaria: " - + e.getMessage())); + tmpRispostaControlli + .setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666P, ERR_SALVA_XML_UD + e.getMessage())); tmpRispostaControlli.setrBoolean(false); - getLogger().error( - "Errore interno nella fase di salvataggio dell'aggiornamento dell'xml dell'unità documentaria", e); + getLogger().error(ERR_SALVA_XML_UD, e); } return tmpRispostaControlli; @@ -955,7 +948,8 @@ private void buildAroUpdDatiSpecUnitaDocFromUpd(SyncFakeSessn sessione, JAXBElement datiSpecifici, AroUpdUnitaDoc tmpAroUpdUnitaDoc, AroUpdDocUnitaDoc tmpAroUpdDocUnitaDoc, AroUpdCompUnitaDoc tmpAroUpdCompUnitaDoc, TiUsoXsdAroUpdDatiSpecUnitaDoc tiUsoXsd, - TiEntitaAroUpdDatiSpecUnitaDoc tiEntitaSacer, long idRecXsdDatiSpec) throws JAXBException { + TiEntitaAroUpdDatiSpecUnitaDoc tiEntitaSacer, BackendStorage backendMetadata, + Map tmpUpdDatiSpecBlob, long idRecXsdDatiSpec) throws JAXBException { AroUpdDatiSpecUnitaDoc tmpAroUpdDatiSpecUnitaDoc = new AroUpdDatiSpecUnitaDoc(); // FK all’aggiornamento unità doc @@ -967,15 +961,25 @@ private void buildAroUpdDatiSpecUnitaDocFromUpd(SyncFakeSessn sessione, // FK struttura tmpAroUpdDatiSpecUnitaDoc.setOrgStrut(tmpAroUpdUnitaDoc.getAroUnitaDoc().getOrgStrut()); // dt inizio sessione - tmpAroUpdDatiSpecUnitaDoc.setDtIniSes(convert(sessione.getTmApertura())); + final LocalDate dtIniSes = convertLocal(sessione.getTmApertura()); + tmpAroUpdDatiSpecUnitaDoc.setDtIniSes(dtIniSes); + // MEV#30089 + tmpAroUpdDatiSpecUnitaDoc.setAaIniSes(dtIniSes.getYear()); // * tipo di uso del xsd pari a tmpAroUpdDatiSpecUnitaDoc.setTiUsoXsd(tiUsoXsd); // tipo entita sacer pari a tmpAroUpdDatiSpecUnitaDoc.setTiEntitaSacer(tiEntitaSacer); // FK alla versione XSD definito dall’unita doc da aggiornare tmpAroUpdDatiSpecUnitaDoc.setDecXsdDatiSpec(entityManager.find(DecXsdDatiSpec.class, idRecXsdDatiSpec)); + // MEV#29276 // Clob contenente il frammento XML contenuto nel tag “DatiSpecifici” del XML in - tmpAroUpdDatiSpecUnitaDoc.setBlXmlDatiSpec(generaXmlDatiSpecFromUpd(datiSpecifici)); + String blXmlDatiSpec = generaXmlDatiSpecFromUpd(datiSpecifici); + if (backendMetadata.isDataBase()) { + tmpAroUpdDatiSpecUnitaDoc.setBlXmlDatiSpec(blXmlDatiSpec); + } else { + tmpUpdDatiSpecBlob.put(tiUsoXsd.name(), blXmlDatiSpec); + } + // end MEV#29276 // persist entityManager.persist(tmpAroUpdDatiSpecUnitaDoc); @@ -1005,9 +1009,8 @@ private String generaXmlDatiSpecFromUpd(JAXBElement> updDatiSpecBlob, StrutturaUpdVers strutturaUpdVers) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); try { List updDocs = null; - List aroDocs = null; if (versamento.hasDocumentoPrincipaleToUpd()) { // recupero documenti di tipo principale da documenti attesi updDocs = strutturaUpdVers.getDocumentiAttesi().stream() .filter(d -> d.getCategoriaDoc().equals(CategoriaDocumento.Principale)) .collect(Collectors.toList()); // build entity AroUpdDocUnitaDoc - tmpRispostaControlli = buildAroUpdDocFromUpd(sessione, tmpAroUpdUnitaDoc, updDocs); + tmpRispostaControlli = buildAroUpdDocFromUpd(sessione, tmpAroUpdUnitaDoc, backendMetadata, + updDatiSpecBlob, updDocs); // in caso di errore esecuzione esco if (!tmpRispostaControlli.isrBoolean()) { return tmpRispostaControlli; } - } /* doc principale */ else { - // aroDocs = new ArrayList<>(tmpAroUnitaDoc.getAroDocs()).stream() - // .filter(d -> d.getTiDoc().equalsIgnoreCase(CategoriaDocumento.Principale.getValoreDb())) - // .collect(Collectors.toList()); - // //build entity - // buildAroUpdDocFromAro(sessione, tmpAroUpdUnitaDoc, aroDocs); } if (versamento.hasAllegatiToUpd()) { // recupero documenti di tipo principale da documenti attesi @@ -1098,60 +1095,45 @@ public RispostaControlli scriviAroUpdDocUnitaDoc(RispostaWSUpdVers rispostaWs, U .filter(d -> d.getCategoriaDoc().equals(CategoriaDocumento.Allegato)) .collect(Collectors.toList()); // build entity - tmpRispostaControlli = buildAroUpdDocFromUpd(sessione, tmpAroUpdUnitaDoc, updDocs); + tmpRispostaControlli = buildAroUpdDocFromUpd(sessione, tmpAroUpdUnitaDoc, backendMetadata, + updDatiSpecBlob, updDocs); // in caso di errore esecuzione esco if (!tmpRispostaControlli.isrBoolean()) { return tmpRispostaControlli; } - } /* allegati */ else { - // aroDocs = new ArrayList<>(tmpAroUnitaDoc.getAroDocs()).stream() - // .filter(d -> d.getTiDoc().equalsIgnoreCase(CategoriaDocumento.Allegato.getValoreDb())) - // .collect(Collectors.toList()); - // //build entity - // buildAroUpdDocFromAro(sessione, tmpAroUpdUnitaDoc, aroDocs); - } + } /* allegati */ if (versamento.hasAnnessiToUpd()) { // recupero documenti di tipo principale da documenti attesi updDocs = strutturaUpdVers.getDocumentiAttesi().stream() .filter(d -> d.getCategoriaDoc().equals(CategoriaDocumento.Annesso)) .collect(Collectors.toList()); // build entity - tmpRispostaControlli = buildAroUpdDocFromUpd(sessione, tmpAroUpdUnitaDoc, updDocs); + tmpRispostaControlli = buildAroUpdDocFromUpd(sessione, tmpAroUpdUnitaDoc, backendMetadata, + updDatiSpecBlob, updDocs); // in caso di errore esecuzione esco if (!tmpRispostaControlli.isrBoolean()) { return tmpRispostaControlli; } - } /* annessi */ else { - // aroDocs = tmpAroUnitaDoc.getAroDocs().stream() - // .filter(d -> d.getTiDoc().equalsIgnoreCase(CategoriaDocumento.Annesso.getValoreDb())) - // .collect(Collectors.toList()); - // //build entity - // buildAroUpdDocFromAro(sessione, tmpAroUpdUnitaDoc, aroDocs); - } + } /* annessi */ if (versamento.hasAnnotazioniToUpd()) { // recupero documenti di tipo principale da documenti attesi updDocs = strutturaUpdVers.getDocumentiAttesi().stream() .filter(d -> d.getCategoriaDoc().equals(CategoriaDocumento.Annotazione)) .collect(Collectors.toList()); // build entity - tmpRispostaControlli = buildAroUpdDocFromUpd(sessione, tmpAroUpdUnitaDoc, updDocs); + tmpRispostaControlli = buildAroUpdDocFromUpd(sessione, tmpAroUpdUnitaDoc, backendMetadata, + updDatiSpecBlob, updDocs); // in caso di errore esecuzione esco if (!tmpRispostaControlli.isrBoolean()) { return tmpRispostaControlli; } - } /* annotazione */ else { - // aroDocs = new ArrayList<>(tmpAroUnitaDoc.getAroDocs()).stream() - // .filter(d -> d.getTiDoc().equalsIgnoreCase(CategoriaDocumento.Annotazione.getValoreDb())) - // .collect(Collectors.toList()); - // //build entity - // buildAroUpdDocFromAro(sessione, tmpAroUpdUnitaDoc, aroDocs); - } + } /* annotazione */ entityManager.flush(); tmpRispostaControlli.setrBoolean(true); @@ -1170,6 +1152,7 @@ public RispostaControlli scriviAroUpdDocUnitaDoc(RispostaWSUpdVers rispostaWs, U } private RispostaControlli buildAroUpdDocFromUpd(SyncFakeSessn sessione, AroUpdUnitaDoc tmpAroUpdUnitaDoc, + BackendStorage backendMetadata, Map> updDatiSpecBlob, List documenti) throws JAXBException, ParserConfigurationException { RispostaControlli tmpRispostaControlli = new RispostaControlli(); @@ -1177,9 +1160,8 @@ private RispostaControlli buildAroUpdDocFromUpd(SyncFakeSessn sessione, AroUpdUn // per ogni documento da aggiornare ... for (UpdDocumentoVers documento : documenti) { - // TODO: valutare se corretto - Map properties = new HashMap(); - properties.put("javax.persistence.lock.timeout", 25); + Map properties = new HashMap<>(); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, 25000); AroDoc aroDoc = entityManager.find(AroDoc.class, documento.getIdRecDocumentoDB(), LockModeType.PESSIMISTIC_WRITE, properties); @@ -1190,8 +1172,7 @@ private RispostaControlli buildAroUpdDocFromUpd(SyncFakeSessn sessione, AroUpdUn tmpAroUpdDocUnitaDoc.setAroDoc(aroDoc); /* * info su profilo documento definite da tag “ProfiloDocumento” (e relativi tag figli) del XML in input - * (dl_doc e ds_autore_doc); - * + * * se tag figlio non presente o con dimensione nulla si assegna valore nullo */ if (documento.getRifUpdDocumento().getProfiloDocumento() != null) { @@ -1212,23 +1193,31 @@ private RispostaControlli buildAroUpdDocFromUpd(SyncFakeSessn sessione, AroUpdUn } // tmpAroUpdDocUnitaDoc - .setFlUpdDatiSpec(documento.getRifUpdDocumento().getDatiSpecifici() != null ? "1" : "0"); + .setFlUpdDatiSpec(booleanToFlag(documento.getRifUpdDocumento().getDatiSpecifici() != null)); // tmpAroUpdDocUnitaDoc.setFlUpdDatiSpecMigraz( - documento.getRifUpdDocumento().getDatiSpecificiMigrazione() != null ? "1" : "0"); + booleanToFlag(documento.getRifUpdDocumento().getDatiSpecificiMigrazione() != null)); // persist entityManager.persist(tmpAroUpdDocUnitaDoc); // add on list tmpAroUpdUnitaDoc.getAroUpdDocUnitaDocs().add(tmpAroUpdDocUnitaDoc); + // MEV#29276 + DatiSpecLinkOsKeyMap key = new DatiSpecLinkOsKeyMap(tmpAroUpdDocUnitaDoc.getIdUpdDocUnitaDoc(), + TiEntitaAroUpdDatiSpecUnitaDoc.UPD_DOC.name()); + Map updDatiSpecDocBlob = (updDatiSpecBlob.containsKey(key)) ? updDatiSpecBlob.get(key) + : new HashMap<>(); + // end MEV#29276 + // 17.2. se nel XML in input il tag “DatiSpecifici” per il documento corrente e’ // definito - if (documento.getRifUpdDocumento().getDatiSpecifici() != null) { + if (documento.getRifUpdDocumento().getDatiSpecifici() != null && documento.getIdRecXsdDatiSpec() != 0) { - buildAroUpdDatiSpecUnitaDocFromUpd(sessione, tmpAroUpdUnitaDoc, tmpAroUpdDocUnitaDoc, null, documento, + buildAroUpdDatiSpecUnitaDocFromUpd(sessione, tmpAroUpdUnitaDoc, tmpAroUpdDocUnitaDoc, null, TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS, TiEntitaAroUpdDatiSpecUnitaDoc.UPD_DOC, - documento.getRifUpdDocumento().getDatiSpecifici(), documento.getIdRecXsdDatiSpec()); + documento.getRifUpdDocumento().getDatiSpecifici(), backendMetadata, updDatiSpecDocBlob, + documento.getIdRecXsdDatiSpec()); } else { // build from aro @@ -1245,7 +1234,7 @@ private RispostaControlli buildAroUpdDocFromUpd(SyncFakeSessn sessione, AroUpdUn AroUsoXsdDatiSpec aroUsoXsdDatiSpec = (AroUsoXsdDatiSpec) tmpRispostaControlli.getrObject(); // tmpRispostaControlli = buildAroUpdDatiSpecUnitaDocFromAro(sessione, tmpAroUpdUnitaDoc, - tmpAroUpdDocUnitaDoc, null, aroUsoXsdDatiSpec); + tmpAroUpdDocUnitaDoc, null, aroUsoXsdDatiSpec, backendMetadata, updDatiSpecDocBlob); // in caso di errore esecuzione query per ricerva valori su attributo if (!tmpRispostaControlli.isrBoolean()) { @@ -1257,12 +1246,13 @@ private RispostaControlli buildAroUpdDocFromUpd(SyncFakeSessn sessione, AroUpdUn // 17.4. se nel XML in input il tag “DatiSpecificiMigrazione” per il documento // corrente e’ definito // definito - if (documento.getRifUpdDocumento().getDatiSpecificiMigrazione() != null) { + if (documento.getRifUpdDocumento().getDatiSpecificiMigrazione() != null + && documento.getIdRecXsdDatiSpecMigrazione() != 0) { - buildAroUpdDatiSpecUnitaDocFromUpd(sessione, tmpAroUpdUnitaDoc, tmpAroUpdDocUnitaDoc, null, documento, + buildAroUpdDatiSpecUnitaDocFromUpd(sessione, tmpAroUpdUnitaDoc, tmpAroUpdDocUnitaDoc, null, TiUsoXsdAroUpdDatiSpecUnitaDoc.MIGRAZ, TiEntitaAroUpdDatiSpecUnitaDoc.UPD_DOC, - documento.getRifUpdDocumento().getDatiSpecificiMigrazione(), - documento.getIdRecXsdDatiSpecMigrazione()); + documento.getRifUpdDocumento().getDatiSpecificiMigrazione(), backendMetadata, + updDatiSpecDocBlob, documento.getIdRecXsdDatiSpecMigrazione()); } else { // build from aro tmpRispostaControlli = super.checkUsoXsdDatiSpecifici(aroDoc.getIdDoc(), @@ -1278,7 +1268,7 @@ private RispostaControlli buildAroUpdDocFromUpd(SyncFakeSessn sessione, AroUpdUn AroUsoXsdDatiSpec aroUsoXsdDatiSpec = (AroUsoXsdDatiSpec) tmpRispostaControlli.getrObject(); // tmpRispostaControlli = buildAroUpdDatiSpecUnitaDocFromAro(sessione, tmpAroUpdUnitaDoc, - tmpAroUpdDocUnitaDoc, null, aroUsoXsdDatiSpec); + tmpAroUpdDocUnitaDoc, null, aroUsoXsdDatiSpec, backendMetadata, updDatiSpecDocBlob); // in caso di errore esecuzione query per ricerva valori su attributo if (!tmpRispostaControlli.isrBoolean()) { @@ -1288,11 +1278,17 @@ private RispostaControlli buildAroUpdDocFromUpd(SyncFakeSessn sessione, AroUpdUn } + // MEV#29276 + if (backendMetadata.isObjectStorage() && !updDatiSpecBlob.containsKey(key)) { + updDatiSpecBlob.put(key, updDatiSpecDocBlob); + } + // end MEV#29276 + // 18. inserisci record in ARO_UPD_COMP_UNITA_DOC: for (UpdComponenteVers componente : documento.getUpdComponentiAttesi()) { tmpRispostaControlli = buildAroUpdCompUnitaDocFromUpd(sessione, tmpAroUpdUnitaDoc, tmpAroUpdDocUnitaDoc, - componente); + backendMetadata, updDatiSpecBlob, componente); // in caso di errore esecuzione if (!tmpRispostaControlli.isrBoolean()) { @@ -1309,14 +1305,15 @@ private RispostaControlli buildAroUpdDocFromUpd(SyncFakeSessn sessione, AroUpdUn } private RispostaControlli buildAroUpdCompUnitaDocFromUpd(SyncFakeSessn sessione, AroUpdUnitaDoc tmpAroUpdUnitaDoc, - AroUpdDocUnitaDoc tmpAroUpdDocUnitaDoc, UpdComponenteVers componente) + AroUpdDocUnitaDoc tmpAroUpdDocUnitaDoc, BackendStorage backendMetadata, + Map> updDatiSpecBlob, UpdComponenteVers componente) throws JAXBException, ParserConfigurationException { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); - Map properties = new HashMap(); - properties.put("javax.persistence.lock.timeout", 25); + Map properties = new HashMap<>(); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, 25000); AroCompDoc tmpAroCompDoc = entityManager.find(AroCompDoc.class, componente.getIdRecDB(), LockModeType.PESSIMISTIC_WRITE, properties); @@ -1339,24 +1336,31 @@ private RispostaControlli buildAroUpdCompUnitaDocFromUpd(SyncFakeSessn sessione, ? componente.getMyUpdComponente().getNomeComponente() : null); // - tmpAroUpdCompUnitaDoc.setFlUpdDatiSpec(componente.getMyUpdComponente().getDatiSpecifici() != null ? "1" : "0"); + tmpAroUpdCompUnitaDoc + .setFlUpdDatiSpec(booleanToFlag(componente.getMyUpdComponente().getDatiSpecifici() != null)); // tmpAroUpdCompUnitaDoc.setFlUpdDatiSpecMigraz( - componente.getMyUpdComponente().getDatiSpecificiMigrazione() != null ? "1" : "0"); + booleanToFlag(componente.getMyUpdComponente().getDatiSpecificiMigrazione() != null)); // persist - entityManager.persist(tmpAroUpdDocUnitaDoc); + entityManager.persist(tmpAroUpdCompUnitaDoc); // add on list tmpAroUpdDocUnitaDoc.getAroUpdCompUnitaDocs().add(tmpAroUpdCompUnitaDoc); + // MEV#29276 + DatiSpecLinkOsKeyMap key = new DatiSpecLinkOsKeyMap(tmpAroUpdCompUnitaDoc.getIdUpdCompUnitaDoc(), + TiEntitaAroUpdDatiSpecUnitaDoc.UPD_COMP.name()); + Map updDatiSpecCompBlob = (updDatiSpecBlob.containsKey(key)) ? updDatiSpecBlob.get(key) + : new HashMap<>(); + // end MEV#29276 + // definito - if (componente.getMyUpdComponente().getDatiSpecifici() != null) { + if (componente.getMyUpdComponente().getDatiSpecifici() != null && componente.getIdRecXsdDatiSpec() != 0) { buildAroUpdDatiSpecUnitaDocFromUpd(sessione, tmpAroUpdUnitaDoc, tmpAroUpdDocUnitaDoc, tmpAroUpdCompUnitaDoc, - componente.getRifUpdDocumentoVers(), TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS, - TiEntitaAroUpdDatiSpecUnitaDoc.UPD_COMP, componente.getMyUpdComponente().getDatiSpecifici(), + TiUsoXsdAroUpdDatiSpecUnitaDoc.VERS, TiEntitaAroUpdDatiSpecUnitaDoc.UPD_COMP, + componente.getMyUpdComponente().getDatiSpecifici(), backendMetadata, updDatiSpecCompBlob, componente.getIdRecXsdDatiSpec()); - } else { // build from aro tmpRispostaControlli = super.checkUsoXsdDatiSpecifici(tmpAroCompDoc.getIdCompDoc(), @@ -1372,23 +1376,25 @@ private RispostaControlli buildAroUpdCompUnitaDocFromUpd(SyncFakeSessn sessione, AroUsoXsdDatiSpec aroUsoXsdDatiSpec = (AroUsoXsdDatiSpec) tmpRispostaControlli.getrObject(); // tmpRispostaControlli = buildAroUpdDatiSpecUnitaDocFromAro(sessione, tmpAroUpdUnitaDoc, - tmpAroUpdDocUnitaDoc, tmpAroUpdCompUnitaDoc, aroUsoXsdDatiSpec); + tmpAroUpdDocUnitaDoc, tmpAroUpdCompUnitaDoc, aroUsoXsdDatiSpec, backendMetadata, + updDatiSpecCompBlob); // in caso di errore esecuzione query per ricerva valori su attributo if (!tmpRispostaControlli.isrBoolean()) { return tmpRispostaControlli; } + } } // 17.4. se nel XML in input il tag “DatiSpecificiMigrazione” per il documento // corrente e’ definito // definito - if (componente.getMyUpdComponente().getDatiSpecificiMigrazione() != null) { + if (componente.getMyUpdComponente().getDatiSpecificiMigrazione() != null + && componente.getIdRecXsdDatiSpecMigrazione() != 0) { buildAroUpdDatiSpecUnitaDocFromUpd(sessione, tmpAroUpdUnitaDoc, tmpAroUpdDocUnitaDoc, tmpAroUpdCompUnitaDoc, - componente.getRifUpdDocumentoVers(), TiUsoXsdAroUpdDatiSpecUnitaDoc.MIGRAZ, - TiEntitaAroUpdDatiSpecUnitaDoc.UPD_COMP, - componente.getMyUpdComponente().getDatiSpecificiMigrazione(), + TiUsoXsdAroUpdDatiSpecUnitaDoc.MIGRAZ, TiEntitaAroUpdDatiSpecUnitaDoc.UPD_COMP, + componente.getMyUpdComponente().getDatiSpecificiMigrazione(), backendMetadata, updDatiSpecCompBlob, componente.getIdRecXsdDatiSpecMigrazione()); } else { // build from aro @@ -1405,15 +1411,23 @@ private RispostaControlli buildAroUpdCompUnitaDocFromUpd(SyncFakeSessn sessione, AroUsoXsdDatiSpec aroUsoXsdDatiSpec = (AroUsoXsdDatiSpec) tmpRispostaControlli.getrObject(); // tmpRispostaControlli = buildAroUpdDatiSpecUnitaDocFromAro(sessione, tmpAroUpdUnitaDoc, - tmpAroUpdDocUnitaDoc, tmpAroUpdCompUnitaDoc, aroUsoXsdDatiSpec); + tmpAroUpdDocUnitaDoc, tmpAroUpdCompUnitaDoc, aroUsoXsdDatiSpec, backendMetadata, + updDatiSpecCompBlob); // in caso di errore esecuzione query per ricerva valori su attributo if (!tmpRispostaControlli.isrBoolean()) { return tmpRispostaControlli; } + } } + // MEV#29276 + if (backendMetadata.isObjectStorage() && !updDatiSpecBlob.containsKey(key)) { + updDatiSpecBlob.put(key, updDatiSpecCompBlob); + } + // end MEV#29276 + tmpRispostaControlli.setrBoolean(true); return tmpRispostaControlli; } @@ -1421,19 +1435,18 @@ private RispostaControlli buildAroUpdCompUnitaDocFromUpd(SyncFakeSessn sessione, // private void buildAroUpdDatiSpecUnitaDocFromUpd(SyncFakeSessn sessione, AroUpdUnitaDoc tmpAroUpdUnitaDoc, AroUpdDocUnitaDoc tmpAroUpdDocUnitaDoc, AroUpdCompUnitaDoc tmpAroUpdCompUnitaDoc, - UpdDocumentoVers documento, TiUsoXsdAroUpdDatiSpecUnitaDoc tiUsoXsd, - TiEntitaAroUpdDatiSpecUnitaDoc tiEntitaSacer, - JAXBElement datiSpec, long idRecXsdDatiSpec) - throws JAXBException { + TiUsoXsdAroUpdDatiSpecUnitaDoc tiUsoXsd, TiEntitaAroUpdDatiSpecUnitaDoc tiEntitaSacer, + JAXBElement datiSpec, BackendStorage backendMetadata, + Map tmpUpdDatiSpecBlob, long idRecXsdDatiSpec) throws JAXBException { buildAroUpdDatiSpecUnitaDocFromUpd(sessione, datiSpec, tmpAroUpdUnitaDoc, tmpAroUpdDocUnitaDoc, - tmpAroUpdCompUnitaDoc, tiUsoXsd, tiEntitaSacer, idRecXsdDatiSpec); - + tmpAroUpdCompUnitaDoc, tiUsoXsd, tiEntitaSacer, backendMetadata, tmpUpdDatiSpecBlob, idRecXsdDatiSpec); } private RispostaControlli buildAroUpdDatiSpecUnitaDocFromAro(SyncFakeSessn sessione, AroUpdUnitaDoc tmpAroUpdUnitaDoc, AroUpdDocUnitaDoc tmpAroUpdDocUnitaDoc, - AroUpdCompUnitaDoc tmpAroUpdCompUnitaDoc, AroUsoXsdDatiSpec aroUsoXsdDatiSpec) + AroUpdCompUnitaDoc tmpAroUpdCompUnitaDoc, AroUsoXsdDatiSpec aroUsoXsdDatiSpec, + BackendStorage backendMetadata, Map tmpUpdDatiSpecBlob) throws JAXBException, ParserConfigurationException { RispostaControlli tmpRispostaControlli = new RispostaControlli(); @@ -1447,8 +1460,10 @@ private RispostaControlli buildAroUpdDatiSpecUnitaDocFromAro(SyncFakeSessn sessi // FK all'aggiornamento comp doc unità doc tmpAroUpdDatiSpecUnitaDoc.setAroUpdCompUnitaDoc(tmpAroUpdCompUnitaDoc); - tmpAroUpdDatiSpecUnitaDoc.setDtIniSes(convert(sessione.getTmApertura())); - + final LocalDate dtIniSes = convertLocal(sessione.getTmApertura()); + tmpAroUpdDatiSpecUnitaDoc.setDtIniSes(dtIniSes); + // MEV#30089 + tmpAroUpdDatiSpecUnitaDoc.setAaIniSes(dtIniSes.getYear()); tmpAroUpdDatiSpecUnitaDoc.setOrgStrut(tmpAroUpdUnitaDoc.getAroUnitaDoc().getOrgStrut()); // * tipo di uso del xsd pari a VERS @@ -1472,8 +1487,14 @@ private RispostaControlli buildAroUpdDatiSpecUnitaDocFromAro(SyncFakeSessn sessi return tmpRispostaControlli; } - // Clob contenente il frammento XML contenuto nel tag “DatiSpecifici” del XML in - tmpAroUpdDatiSpecUnitaDoc.setBlXmlDatiSpec(tmpRispostaControlli.getrString()); + // MEV#29276 + if (backendMetadata.isDataBase()) { + // Clob contenente il frammento XML contenuto nel tag “DatiSpecifici” del XML in + tmpAroUpdDatiSpecUnitaDoc.setBlXmlDatiSpec(tmpRispostaControlli.getrString()); + } else { + tmpUpdDatiSpecBlob.put(aroUsoXsdDatiSpec.getTiUsoXsd(), tmpRispostaControlli.getrString()); + } + // end MEV#29276 // persist entityManager.persist(tmpAroUpdDatiSpecUnitaDoc); @@ -1488,8 +1509,7 @@ private RispostaControlli buildAroUpdDatiSpecUnitaDocFromAro(SyncFakeSessn sessi return tmpRispostaControlli; } - public RispostaControlli ereditaVrsSesUpdUnitaDocKoRisolte(RispostaWSUpdVers rispostaWs, - UpdVersamentoExt versamento, SyncFakeSessn sessione, AroUpdUnitaDoc tmpAroUpdUnitaDoc, + public RispostaControlli ereditaVrsSesUpdUnitaDocKoRisolte(AroUpdUnitaDoc tmpAroUpdUnitaDoc, VrsUpdUnitaDocKo tmpUpdUnitaDocKo, MonKeyTotalUdKo tmpMonKeyTotalUdKo) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); @@ -1527,7 +1547,7 @@ public RispostaControlli ereditaVrsSesUpdUnitaDocKoRisolte(RispostaWSUpdVers ris tmpRispostaControlli = updLogSessioneHelper.verificaDataAttivazioneJob(); if (!tmpRispostaControlli.isrBoolean()) { // errore su db - return tmpRispostaControlli;// TODO: può capitare? + return tmpRispostaControlli; } /* * 2.3.4. se data di inizio sessione fallita e’ minore dell’ultima data di attivazione del job @@ -1539,7 +1559,7 @@ public RispostaControlli ereditaVrsSesUpdUnitaDocKoRisolte(RispostaWSUpdVers ris tmpMonKeyTotalUdKo, true); if (!tmpRispostaControlli.isrBoolean()) { // errore su db - return tmpRispostaControlli;// TODO: può capitare? + return tmpRispostaControlli; } } } @@ -1562,8 +1582,8 @@ public RispostaControlli ereditaVrsSesUpdUnitaDocKoRisolte(RispostaWSUpdVers ris return tmpRispostaControlli; } - public RispostaControlli scriviMonKeyTotalUd(RispostaWSUpdVers rispostaWs, UpdVersamentoExt versamento, - SyncFakeSessn sessione, AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc, + @SuppressWarnings("unchecked") + public RispostaControlli scriviMonKeyTotalUd(AroUnitaDoc tmpAroUnitaDoc, AroUpdUnitaDoc tmpAroUpdUnitaDoc, StrutturaUpdVers strutturaUpdVers) { RispostaControlli tmpRispostaControlli = new RispostaControlli(); tmpRispostaControlli.setrBoolean(false); @@ -1576,19 +1596,18 @@ public RispostaControlli scriviMonKeyTotalUd(RispostaWSUpdVers rispostaWs, UpdVe + " and ud.decTipoUnitaDoc.idTipoUnitaDoc = :idTipoUnitaDoc " + " and ud.decTipoDocPrinc.idTipoDoc = :idTipoDoc "; javax.persistence.Query query = entityManager.createQuery(queryStr, MonKeyTotalUd.class); - // query.setParameter("idStrutIn", strutturaUpdVers.getIdStruttura()); - query.setParameter("aaKeyUnitaDoc", strutturaUpdVers.getChiaveNonVerificata().getAnno()); + query.setParameter("aaKeyUnitaDoc", new BigDecimal(strutturaUpdVers.getChiaveNonVerificata().getAnno())); query.setParameter("idSubStrutIn", tmpAroUnitaDoc.getOrgSubStrut().getIdSubStrut()); query.setParameter("idRegistroUnitaDoc", strutturaUpdVers.getIdRegistro()); query.setParameter("idTipoUnitaDoc", strutturaUpdVers.getIdTipologiaUnitaDocumentaria()); query.setParameter("idTipoDoc", strutturaUpdVers.getIdTipoDocPrincipale()); mktuds = query.getResultList(); - if (mktuds.size() > 0) { + if (!mktuds.isEmpty()) { // TODO: probabilmente lock inutile dato che le condizioni non porteranno mai a // casi di concorrenza tra client nella stessa sottostruttura .... - Map properties = new HashMap(); - properties.put("javax.persistence.lock.timeout", 25); + Map properties = new HashMap<>(); + properties.put(Constants.JAVAX_PERSISTENCE_LOCK_TIMEOUT, 25000); entityManager.find(MonKeyTotalUd.class, mktuds.get(0).getIdKeyTotalUd(), LockModeType.PESSIMISTIC_WRITE, properties); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/UpdBasePrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdBasePrsr.java similarity index 87% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/UpdBasePrsr.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdBasePrsr.java index 7c3cf46..fb57e15 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/UpdBasePrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdBasePrsr.java @@ -1,15 +1,32 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package it.eng.parer.ws.versamentoUpd.prsr.strategy; +package it.eng.parer.ws.versamentoUpd.ejb.prs; import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; import it.eng.parer.ws.utils.ControlliWSBundle; import it.eng.parer.ws.versamentoUpd.utils.IRispostaUpdVersWS; -public abstract class UpdBasePrsr implements IUpdStrategyPrsr { +public abstract class UpdBasePrsr { protected IRispostaUpdVersWS rispostaWs; @@ -104,4 +121,4 @@ protected void setEsitoControlloWarnBundle(String ctrlws, String codErr) { } } -} \ No newline at end of file +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/UpdCollegamentiPrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdCollegamentiPrsr.java similarity index 90% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/UpdCollegamentiPrsr.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdCollegamentiPrsr.java index f60b46b..5f534cf 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/UpdCollegamentiPrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdCollegamentiPrsr.java @@ -1,20 +1,35 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package it.eng.parer.ws.versamentoUpd.prsr.strategy; +package it.eng.parer.ws.versamentoUpd.ejb.prs; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.naming.InitialContext; -import javax.naming.NamingException; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; import it.eng.parer.ws.dto.CSChiave; import it.eng.parer.ws.dto.RispostaControlli; @@ -40,37 +55,21 @@ * * @author sinatti_s */ +@Stateless(mappedName = "UpdCollegamentiPrsr") +@LocalBean public class UpdCollegamentiPrsr extends UpdBasePrsr { - private static final Logger log = LoggerFactory.getLogger(UpdCollegamentiPrsr.class); - - private UpdVersamentoExt versamento; // nel costruttore - private RispostaControlli rispostaControlli; // interno allocare nel costruttore // stateless ejb per i controlli sul db - private ControlliSemantici controlliSemantici = null; - // - private CompRapportoUpdVers myEsito; + @EJB + private ControlliSemantici controlliSemantici; - public UpdCollegamentiPrsr(UpdVersamentoExt versamento, IRispostaUpdVersWS rispostaWs, - CompRapportoUpdVers myEsito) { - this.versamento = versamento; - this.rispostaWs = rispostaWs; - this.myEsito = myEsito; + private void init(UpdVersamentoExt versamento) { - init(); + this.initControlliCollegamenti(versamento); } - private void init() { - - this.initControlliCollegamenti(); - - // istanzia la risposta controlli - this.rispostaControlli = new RispostaControlli(); - - } - - private void initControlliCollegamenti() { + private void initControlliCollegamenti(UpdVersamentoExt versamento) { // init NA for (AggiornamentoDocumentoCollegatoType.DocumentoCollegato documCollMd : versamento.getVersamento() .getUnitaDocumentaria().getDocumentiCollegati().getDocumentoCollegato()) { @@ -87,28 +86,20 @@ private void initControlliCollegamenti() { } } - public boolean eseguiControlli() { + public boolean eseguiControlli(UpdVersamentoExt versamento, IRispostaUpdVersWS rispostaWs, + CompRapportoUpdVers myEsito) { + // init + init(versamento); boolean collegamentoHasErr = false; CSChiave tmpCsChiaveColl = new CSChiave(); // l'insieme di tutti i collegamenti (già accorpati nelle descrizioni) // che verrà memorizzato sul DB - Map, UpdUnitaDocColl> tmpCollegamentiUd = new HashMap, UpdUnitaDocColl>(); + Map, UpdUnitaDocColl> tmpCollegamentiUd = new HashMap<>(); StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); - // recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - try { - controlliSemantici = (ControlliSemantici) new InitialContext().lookup("java:module/ControlliSemantici"); - } catch (NamingException ex) { - this.setEsitoControlloErr(ControlliWSBundle.CTRL_GENERIC_ERROR, MessaggiWSBundle.ERR_666, - MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "UpdCollegamentiPrsr.init.ControlliSemantici: " + ex.getMessage())); - log.error("Errore nel recupero dell'EJB dei controlli semantici in UpdCollegamentiPrsr ", ex); - return false; - } - boolean tmpForzaColl = strutturaUpdVers.isFlForzaCollegamento(); // CICLO FOR SUI DOCUMENTI COLLEGATI @@ -123,7 +114,7 @@ public boolean eseguiControlli() { tmpArr[0] = tmpCsChiaveColl.getNumero(); tmpArr[1] = tmpCsChiaveColl.getTipoRegistro(); tmpArr[2] = String.valueOf(tmpCsChiaveColl.getAnno()); - List tmpChiaveUdAsList = Arrays.asList(tmpArr); + List tmpChiaveUdAsList = Arrays.asList(tmpArr); UpdUnitaDocColl tmpUnitaDocColl = tmpCollegamentiUd.get(tmpChiaveUdAsList); if (tmpUnitaDocColl == null) { @@ -155,7 +146,8 @@ public boolean eseguiControlli() { boolean faiVerificaFormaleChiave = false; // // verifico il collegamento, se punta ad un'UD esistente - rispostaControlli = controlliSemantici.checkChiave(tmpCsChiaveColl, strutturaUpdVers.getIdStruttura(), + RispostaControlli rispostaControlli = controlliSemantici.checkChiave(tmpCsChiaveColl, + strutturaUpdVers.getIdStruttura(), ControlliSemantici.TipiGestioneUDAnnullate.CONSIDERA_ASSENTE); tmpUnitaDocColl.setIdUnitaDocLink(rispostaControlli.getrLong()); @@ -325,7 +317,7 @@ public boolean eseguiControlli() { // valutazione dell'esito // se ho riscontrato un errore ... - this.evaluateControlliOnCollegamenti(collegamentoHasErr, tmpForzaColl); + this.evaluateControlliOnCollegamenti(collegamentoHasErr, tmpForzaColl, versamento); // build on esisto (collegamenti normalizzati) /* aggiunta questa condizione qualora non fossero presenti collegamenti (casistica della cancellazione) */ @@ -336,7 +328,8 @@ public boolean eseguiControlli() { return true;// prosegui con successivi controlli } - private void evaluateControlliOnCollegamenti(boolean collegamentoHasErr, boolean tmpForzaColl) { + private void evaluateControlliOnCollegamenti(boolean collegamentoHasErr, boolean tmpForzaColl, + UpdVersamentoExt versamento) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); if (collegamentoHasErr) { // ...ma esiste la forzatura sui controlli lo trasformo in WARNING diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/UpdDocumentiIdCountPrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdDocumentiIdCountPrsr.java similarity index 65% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/UpdDocumentiIdCountPrsr.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdDocumentiIdCountPrsr.java index 04c5927..4fb5357 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/UpdDocumentiIdCountPrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdDocumentiIdCountPrsr.java @@ -1,9 +1,26 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package it.eng.parer.ws.versamentoUpd.prsr.strategy; +package it.eng.parer.ws.versamentoUpd.ejb.prs; import java.util.ArrayList; import java.util.HashMap; @@ -11,8 +28,12 @@ import java.util.List; import java.util.Map; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; + import it.eng.parer.ws.utils.Costanti.CategoriaDocumento; import it.eng.parer.ws.utils.ParametroApplDB; +import it.eng.parer.ws.versamento.dto.ComponenteVers; import it.eng.parer.ws.versamentoUpd.dto.StrutturaUpdVers; import it.eng.parer.ws.versamentoUpd.dto.UpdComponenteVers; import it.eng.parer.ws.versamentoUpd.dto.UpdDocumentoVers; @@ -26,42 +47,13 @@ * * @author sinatti_s */ +@Stateless(mappedName = "UpdDocumentiIdCountPrsr") +@LocalBean public class UpdDocumentiIdCountPrsr extends UpdBasePrsr { - private HashMap componentiAttesi; - private HashMap sottoComponentiAttesi; - private List documentiAttesi; - private Map tmpDocumentiMap; - // boolean trovatiIdCompDuplicati; - private boolean trovatiIdDocDuplicati; - // - private UpdVersamentoExt versamento; - - public UpdDocumentiIdCountPrsr(UpdVersamentoExt versamento) { - this.versamento = versamento; - - this.init(); - } - - private final void init() { - componentiAttesi = new HashMap<>(); - sottoComponentiAttesi = new HashMap<>(); - documentiAttesi = new ArrayList<>(); - tmpDocumentiMap = new HashMap<>(); - // trovatiIdCompDuplicati = false; - trovatiIdDocDuplicati = false; - - } - - /** - * Questa versione della verifica serve per il versamento sincrono. Analizza ed eventualmente integra dei default - * l'intera unità documentaria versata - * - * @return true/false risultato dei controlli - */ - public boolean eseguiControlli() { - StrutturaUpdVers strutturaUpdVers = this.versamento.getStrutturaUpdVers(); - AggiornamentoUnitaDocumentariaType aggiornamentoUnitaDocumentaria = this.versamento.getVersamento() + public boolean eseguiControlli(UpdVersamentoExt versamento) { + StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); + AggiornamentoUnitaDocumentariaType aggiornamentoUnitaDocumentaria = versamento.getVersamento() .getUnitaDocumentaria(); int progressivo = 0; @@ -73,20 +65,35 @@ public boolean eseguiControlli() { Boolean corrAnnessiDichiarati = null; Boolean corrAnnotazioniDichiarati = null; + HashMap componentiAttesi = new HashMap<>(); + HashMap sottoComponentiAttesi = new HashMap<>(); + List documentiAttesi = new ArrayList<>(); + Map tmpDocumentiMap = new HashMap<>(); + boolean trovatiIdDocDuplicati = false; + if (aggiornamentoUnitaDocumentaria.getDocumentoPrincipale() != null) { progressivo = 1; - this.aggiungiVerificaDocumento(aggiornamentoUnitaDocumentaria.getDocumentoPrincipale(), progressivo, - CategoriaDocumento.Principale); + boolean result = this.aggiungiVerificaDocumento(aggiornamentoUnitaDocumentaria.getDocumentoPrincipale(), + progressivo, CategoriaDocumento.Principale, tmpDocumentiMap, documentiAttesi, versamento, + componentiAttesi, sottoComponentiAttesi); + if (result) { + trovatiIdDocDuplicati = true; + } } progressivo = 0; if (aggiornamentoUnitaDocumentaria.getAllegati() != null) { Iterator tmpEnumDoc = aggiornamentoUnitaDocumentaria.getAllegati().getAllegato() .iterator(); while (tmpEnumDoc.hasNext()) { - DocumentoType tmpDocumentoType = (DocumentoType) tmpEnumDoc.next(); + DocumentoType tmpDocumentoType = tmpEnumDoc.next(); progressivo += 1; contaAllegati += 1; - this.aggiungiVerificaDocumento(tmpDocumentoType, progressivo, CategoriaDocumento.Allegato); + boolean result = this.aggiungiVerificaDocumento(tmpDocumentoType, progressivo, + CategoriaDocumento.Allegato, tmpDocumentiMap, documentiAttesi, versamento, componentiAttesi, + sottoComponentiAttesi); + if (result) { + trovatiIdDocDuplicati = true; + } } } @@ -95,10 +102,15 @@ public boolean eseguiControlli() { Iterator tmpEnumDoc = aggiornamentoUnitaDocumentaria.getAnnessi().getAnnesso() .iterator(); while (tmpEnumDoc.hasNext()) { - DocumentoType tmpDocumentoType = (DocumentoType) tmpEnumDoc.next(); + DocumentoType tmpDocumentoType = tmpEnumDoc.next(); progressivo += 1; contaAnnessi += 1; - this.aggiungiVerificaDocumento(tmpDocumentoType, progressivo, CategoriaDocumento.Annesso); + boolean result = this.aggiungiVerificaDocumento(tmpDocumentoType, progressivo, + CategoriaDocumento.Annesso, tmpDocumentiMap, documentiAttesi, versamento, componentiAttesi, + sottoComponentiAttesi); + if (result) { + trovatiIdDocDuplicati = true; + } } } @@ -107,10 +119,15 @@ public boolean eseguiControlli() { Iterator tmpEnumDoc = aggiornamentoUnitaDocumentaria.getAnnotazioni() .getAnnotazione().iterator(); while (tmpEnumDoc.hasNext()) { - DocumentoType tmpDocumentoType = (DocumentoType) tmpEnumDoc.next(); + DocumentoType tmpDocumentoType = tmpEnumDoc.next(); progressivo += 1; contaAnnotazioni += 1; - this.aggiungiVerificaDocumento(tmpDocumentoType, progressivo, CategoriaDocumento.Annotazione); + boolean result = this.aggiungiVerificaDocumento(tmpDocumentoType, progressivo, + CategoriaDocumento.Annotazione, tmpDocumentiMap, documentiAttesi, versamento, componentiAttesi, + sottoComponentiAttesi); + if (result) { + trovatiIdDocDuplicati = true; + } } } @@ -159,10 +176,7 @@ public boolean eseguiControlli() { strutturaUpdVers.setDocumentiAttesi(documentiAttesi); strutturaUpdVers.setComponentiAttesi(componentiAttesi); strutturaUpdVers.setSottoComponentiAttesi(sottoComponentiAttesi); - // strutturaUpdVers.setTrovatiIdCompDuplicati(trovatiIdCompDuplicati); strutturaUpdVers.setTrovatiIdDocDuplicati(trovatiIdDocDuplicati); - // TODO: non si dovrebbe porre il problema con la validazione XSD operata da JAXB - // strutturaUpdVers.setTrovataDataNullaIn(trovataDataNullaIn); strutturaUpdVers.setCorrAllegatiDichiarati(corrAllegatiDichiarati); strutturaUpdVers.setCorrAnnessiDichiarati(corrAnnessiDichiarati); strutturaUpdVers.setCorrAnnotazioniDichiarati(corrAnnotazioniDichiarati); @@ -170,43 +184,27 @@ public boolean eseguiControlli() { return true;/* fixed non utilizzato nell'ambito di questo controllo */ } - /** + /* * Questa versione della verifica serve per l'aggiunta allegati. Dal momento che i dati relativi all'unità * documentaria vengono versati durante il versamento, questa analizza soltanto il songolo documento che viene * versato dal servizio. (che può essere un Allegato, un Annesso, un'Annotazione) * - * @param doc - * tipo documento - * @param progressivo - * progressivo documento - * @param categoria - * categoria documento * */ - private void aggiungiVerificaDocumento(DocumentoType doc, int progressivo, CategoriaDocumento categoria) { + private boolean aggiungiVerificaDocumento(DocumentoType doc, int progressivo, CategoriaDocumento categoria, + Map tmpDocumentiMap, List documentiAttesi, + UpdVersamentoExt versamento, HashMap componentiAttesi, + HashMap sottoComponentiAttesi) { + boolean trovatiIdDocDuplicati = false; + // UpdDocumentoVers tmpDocumentoVers; tmpDocumentoVers = new UpdDocumentoVers(); tmpDocumentoVers.setProgressivo(progressivo); tmpDocumentoVers.setCategoriaDoc(categoria); tmpDocumentoVers.setRifUpdDocumento(doc); - tmpDocumentoVers.setUpdComponentiAttesi(new ArrayList()); - tmpDocumentoVers.setUpdSottoComponentiAttesi(new ArrayList()); - - /* - * TODO: da verificare se si pono lo stesso tipo di problema in JAXB - * - * verifica se le date dei dati fiscali sono state scritte male: il parser xml di Castor presenta un fastidioso - * bug per cui accetta un tag di tipo xs:date anche se è vuoto. Questo si traduce in un campo Datetime Java - * completamente sballato e in un dato salvato sul database con valori altrettanto sballati. - * - * if (doc.getDatiFiscali() != null) { if (doc.getDatiFiscali().getDataEmissione() != null) { if - * (doc.getDatiFiscali().getDataEmissione() == null) { trovataDataNullaIn = - * "DatiFiscali.DataEmissione del documento " + doc.getIDDocumento(); } } if - * (doc.getDatiFiscali().getDataTermineEmissione() != null) { if (doc.getDatiFiscali().getDataTermineEmissione() - * == null) { trovataDataNullaIn = "DatiFiscali.DataTermineEmissione del documento " + - * doc.getIDDocumento(); } } } - */ + tmpDocumentoVers.setUpdComponentiAttesi(new ArrayList<>()); + tmpDocumentoVers.setUpdSottoComponentiAttesi(new ArrayList<>()); // test di duplicazione dell'id documento all'interno dell'unità documentaria versata if (doc.getIDDocumento() == null || doc.getIDDocumento().length() == 0) { @@ -223,11 +221,15 @@ private void aggiungiVerificaDocumento(DocumentoType doc, int progressivo, Categ * se esistono componenti */ if (doc.getStrutturaOriginale() != null && doc.getStrutturaOriginale().getComponenti() != null) { - this.verificaComponenti(tmpDocumentoVers); + this.verificaComponenti(tmpDocumentoVers, versamento, componentiAttesi, sottoComponentiAttesi); } + + return trovatiIdDocDuplicati; } - private void verificaComponenti(UpdDocumentoVers documentoVersato) { + private void verificaComponenti(UpdDocumentoVers documentoVersato, UpdVersamentoExt versamento, + HashMap componentiAttesi, + HashMap sottoComponentiAttesi) { UpdComponenteVers tmpComponenteVers; UpdComponenteVers tmpSottoComponenteVers; DocumentoType documento = documentoVersato.getRifUpdDocumento(); @@ -242,32 +244,18 @@ private void verificaComponenti(UpdDocumentoVers documentoVersato) { Iterator tmpEnumCompo = documento.getStrutturaOriginale().getComponenti() .getComponente().iterator(); while (tmpEnumCompo.hasNext()) { - ComponenteType tmpComponente = (ComponenteType) tmpEnumCompo.next(); + ComponenteType tmpComponente = tmpEnumCompo.next(); // impostazione valori di default per il componente if (tmpComponente.getTipoComponente() == null) { tmpComponente.setTipoComponente(versamento.getXmlDefaults().get(ParametroApplDB.TIPO_COMP_DOC)); } - // if (tmpComponente.getTipoSupportoComponente() == null) { - // tmpComponente.setTipoSupportoComponente(TipoSupportoType.valueOf(xmlDefaults.get(CostantiDB.ParametroAppl.TIPO_SUPPORTO_COMP))); - // } - // Boolean bool = tmpComponente.isUtilizzoDataFirmaPerRifTemp(); - // if ( (bool != null) && (bool == false) ) { - // tmpComponente.setUtilizzoDataFirmaPerRifTemp(Boolean.parseBoolean(xmlDefaults.get(CostantiDB.ParametroAppl.USO_DATA_FIRMA))); - // } - - /* - * if (fileAttesi.get(tmpComponente.getID()) != null) { trovatiIdCompDuplicati = true; } - */ + tmpComponenteVers = new UpdComponenteVers(); - /* - * if (tmpComponente.getID() == null || tmpComponente.getID().length() == 0) { trovatiIdCompDuplicati = - * true; } - */ tmpComponenteVers.setId(tmpComponente.getID()); tmpComponenteVers.setOrdinePresentazione(tmpComponente.getOrdinePresentazione()); tmpComponenteVers.setTipoSupporto(tmpComponente.getTipoSupportoComponente() != null - ? UpdComponenteVers.TipiSupporto.valueOf(tmpComponente.getTipoSupportoComponente().value()) : null); + ? ComponenteVers.TipiSupporto.valueOf(tmpComponente.getTipoSupportoComponente().value()) : null); tmpComponenteVers.setPresenteRifMeta(tmpComponente.getRiferimento() != null); tmpComponenteVers.setDatiLetti(false); tmpComponenteVers.setMyUpdComponente(tmpComponente); @@ -280,19 +268,7 @@ private void verificaComponenti(UpdDocumentoVers documentoVersato) { while (tmpEnumSottoCompo.hasNext()) { SottoComponenteType tmpSottoComponente = (SottoComponenteType) tmpEnumSottoCompo.next(); - // impostazione valori di default per il sottocomponente - // if (tmpSottoComponente.getTipoSupportoComponente() == null) { - // tmpSottoComponente.setTipoSupportoComponente(TipoSupportoType.valueOf(xmlDefaults.get(CostantiDB.ParametroAppl.TIPO_SUPPORTO_COMP))); - // } - - /* - * if (fileAttesi.get(tmpSottoComponente.getID()) != null) { trovatiIdCompDuplicati = true; } - */ tmpSottoComponenteVers = new UpdComponenteVers(); - /* - * if (tmpSottoComponente.getID() == null || tmpSottoComponente.getID().length() == 0) { - * trovatiIdCompDuplicati = true; } - */ tmpSottoComponenteVers.setId(tmpSottoComponente.getID()); tmpSottoComponenteVers.setOrdinePresentazione(tmpComponente.getOrdinePresentazione()); tmpSottoComponenteVers.setTipoSupporto(UpdComponenteVers.TipiSupporto @@ -310,4 +286,4 @@ private void verificaComponenti(UpdDocumentoVers documentoVersato) { } } -} \ No newline at end of file +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/UpdDocumentiPrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdDocumentiPrsr.java similarity index 87% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/UpdDocumentiPrsr.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdDocumentiPrsr.java index 9dfc8fd..7c59a0a 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/UpdDocumentiPrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdDocumentiPrsr.java @@ -1,9 +1,26 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package it.eng.parer.ws.versamentoUpd.prsr.strategy; +package it.eng.parer.ws.versamentoUpd.ejb.prs; import java.util.ArrayList; import java.util.HashSet; @@ -11,19 +28,18 @@ import java.util.Set; import java.util.stream.Collectors; -import javax.naming.InitialContext; -import javax.naming.NamingException; +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; import javax.xml.bind.JAXBElement; import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; import it.eng.parer.ws.dto.RispostaControlli; -import it.eng.parer.ws.ejb.ControlliSemantici; import it.eng.parer.ws.utils.AvanzamentoWs; import it.eng.parer.ws.utils.ControlliWSBundle; +import it.eng.parer.ws.utils.Costanti; import it.eng.parer.ws.utils.Costanti.CategoriaDocumento; import it.eng.parer.ws.utils.CostantiDB.TipiEntitaSacer; import it.eng.parer.ws.utils.MessaggiWSBundle; @@ -39,10 +55,10 @@ import it.eng.parer.ws.versamentoUpd.dto.UpdComponenteVers; import it.eng.parer.ws.versamentoUpd.dto.UpdDocumentoVers; import it.eng.parer.ws.versamentoUpd.ejb.ControlliUpdVersamento; +import it.eng.parer.ws.versamentoUpd.ejb.UpdGestioneDatiSpec; import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; import it.eng.parer.ws.versamentoUpd.utils.IRispostaUpdVersWS; import it.eng.parer.ws.versamentoUpd.utils.UpdDocumentiUtils; -import it.eng.parer.ws.versamentoUpd.utils.UpdGestioneDatiSpec; import it.eng.parer.ws.xml.versReq.TipoConservazioneType; import it.eng.parer.ws.xml.versUpdReq.DatiSpecificiType; import it.eng.parer.ws.xml.versUpdResp.ComponenteType; @@ -57,49 +73,27 @@ * * @author sinatti_s */ +@Stateless(mappedName = "UpdDocumentiPrsr") +@LocalBean public class UpdDocumentiPrsr extends UpdBasePrsr { - private static final Logger log = LoggerFactory.getLogger(UpdDocumentiPrsr.class); - - private UpdVersamentoExt versamento; // nel costruttore - private RispostaControlli rispostaControlli; // interno allocare nel costruttore // classe di supporto per la verifica e l'estrazione dei dati specifici - private UpdGestioneDatiSpec gestioneDatiSpec = null; // allocata nel costruttore - // stateless ejb per i controlli sul db - private ControlliUpdVersamento updVersamentoControlli = null; + @EJB + private UpdGestioneDatiSpec gestioneDatiSpec; // stateless ejb per i controlli sul db - private ControlliSemantici controlliSemantici = null; - // - private CompRapportoUpdVers myEsito; - - public UpdDocumentiPrsr(UpdVersamentoExt versamento, IRispostaUpdVersWS rispostaWs, CompRapportoUpdVers myEsito) { - this.versamento = versamento; - this.rispostaWs = rispostaWs; - this.myEsito = myEsito; + @EJB + private ControlliUpdVersamento updVersamentoControlli; - // init costruttuore - init(); - - } - - private void init() { + private void init(UpdVersamentoExt versamento, CompRapportoUpdVers myEsito) { // init controlli on documents - this.initEsitoAndControlliDocumenti(); + this.initEsitoAndControlliDocumenti(versamento, myEsito); // init documents on resp - this.buildDocumentoOnResponse(); + this.buildDocumentoOnResponse(versamento, myEsito); - // istanzia la risposta controlli - rispostaControlli = new RispostaControlli(); - - // alloca la classe di verifica ed estrazione dei dati specifici e dei dati - // specifici di migrazione - // NB: questa allocazione può fallire. Al termine devo verificare lo stato di - // RispostaWS e gestire il problema - gestioneDatiSpec = new UpdGestioneDatiSpec(versamento); } - private void initEsitoAndControlliDocumenti() { + private void initEsitoAndControlliDocumenti(UpdVersamentoExt versamento, CompRapportoUpdVers myEsito) { // init NA StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); // doc principale @@ -268,14 +262,14 @@ private void initEsitoAndControlliDocumenti() { } - private void buildDocumentoOnResponse() { + private void buildDocumentoOnResponse(UpdVersamentoExt versamento, CompRapportoUpdVers myEsito) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); for (UpdDocumentoVers documento : strutturaUpdVers.getDocumentiAttesi()) { // build on response DocumentoType documentoType = new DocumentoType(); documentoType.setIDDocumento(documento.getRifUpdDocumento().getIDDocumento()); - documentoType.setTipoDocumento((String) documento.getRifUpdDocumento().getTipoDocumento()); + documentoType.setTipoDocumento(documento.getRifUpdDocumento().getTipoDocumento()); // set response documento.setRifUpdDocumentoResp(documentoType); @@ -309,17 +303,21 @@ private void buildDocumentoOnResponse() { // in cascata per ogni documento si ricostruisce StrutturaOriginale/Componenti // build struttura originale - this.buildStrutturaOrigOnResponse(documento); + this.buildStrutturaOrigOnResponse(documento, versamento, myEsito); // build componente - this.buildComponenteOnResponse(documento); + this.buildComponenteOnResponse(documento, versamento, myEsito); } // documento } // §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ // INIZIO METODI DI VERIFICA §§§§§§§§§§§§§§§§§§§§§§§§§§§§§ // §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ - public boolean eseguiControlli() { + public boolean eseguiControlli(UpdVersamentoExt versamento, IRispostaUpdVersWS rispostaWs, + CompRapportoUpdVers myEsito) { + // init + init(versamento, myEsito); + boolean prosegui = true; AvanzamentoWs myAvanzamentoWs = rispostaWs.getAvanzamento(); StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); @@ -330,42 +328,38 @@ public boolean eseguiControlli() { myAvanzamentoWs.setFase("Verifica semantica documento") .setDocumento(documento.getRifUpdDocumento().getIDDocumento()).logAvanzamento(); - /* - * documento.setUrnPartDocumento( MessaggiWSFormat.formattaUrnPartDocumento(documento.getCategoriaDoc(), - * documento.getProgressivo())); - */ documento.setUrnPartDocumento(documento.getRifUpdDocumento().getIDDocumento()); // verifica id e tipo documento - prosegui = this.verificaIdDocumento(documento); + prosegui = this.verificaIdDocumento(documento, versamento); // verifico il tipo documento if (prosegui) { - prosegui = this.verificaTipoDocumento(documento); + prosegui = this.verificaTipoDocumento(documento, versamento); } // verifico abilitazione al tipo documento if (prosegui) { - prosegui = this.verificaAbilitazioneTipoDocumento(documento); + prosegui = this.verificaAbilitazioneTipoDocumento(documento, versamento); } // verifico la corrispondenza dei DATI SPECIFICI del Documento if (prosegui && documento.getRifUpdDocumento().getDatiSpecifici() != null) { - prosegui = this.parseDatiSpecDoc(documento); + prosegui = this.parseDatiSpecDoc(documento, versamento); } // verifico la corrispondenza dei DATI MIGRAZIONE del Documento if (prosegui && documento.getRifUpdDocumento().getDatiSpecificiMigrazione() != null) { - prosegui = this.parseDatiSpecMigrazDoc(documento); + prosegui = this.parseDatiSpecMigrazDoc(documento, versamento); } // verifico ordine componenti if (prosegui) { - prosegui = this.verificaOrdineComponente(documento); + prosegui = this.verificaOrdineComponente(documento, versamento); } // verifico componenti if (prosegui) { - prosegui = this.verificaComponenti(documento); + prosegui = this.verificaComponenti(documento, versamento); } } @@ -373,19 +367,19 @@ public boolean eseguiControlli() { /* * Valutazione esito "complessivo" dei controlli su componenti */ - this.evaluteControlliOnComponente(strutturaUpdVers.getDocumentiAttesi()); + this.evaluteControlliOnComponente(strutturaUpdVers.getDocumentiAttesi(), versamento); /* * Valutazione esito "complessivo" dei controlli su documenti eseguiti */ - this.evaluteControlliOnDocumento(strutturaUpdVers.getDocumentiAttesi()); + this.evaluteControlliOnDocumento(strutturaUpdVers.getDocumentiAttesi(), versamento); myAvanzamentoWs.resetFase().setFase("verifica semantica documenti - fine").logAvanzamento(); return prosegui;// TODO: verificare se ha senso .. } - private void evaluteControlliOnDocumento(List documenti) { + private void evaluteControlliOnDocumento(List documenti, UpdVersamentoExt versamento) { // 0. merge di tutti i controlli fatti sui componenti dei documenti per singolo // documento // (principale, annessi, allegati, annotazioni ...) @@ -451,7 +445,7 @@ private void evaluteControlliOnDocumento(List documenti) { } } - private void evaluteControlliOnComponente(List documenti) { + private void evaluteControlliOnComponente(List documenti, UpdVersamentoExt versamento) { // 0. merge di tutti i controlli fatti sui componenti dei documenti per singolo documento // (principale, annessi, allegati, annotazioni ...) // per ogni documento @@ -518,7 +512,8 @@ private void evaluteControlliOnComponente(List documenti) { } - private void buildStrutturaOrigOnResponse(UpdDocumentoVers documento) { + private void buildStrutturaOrigOnResponse(UpdDocumentoVers documento, UpdVersamentoExt versamento, + CompRapportoUpdVers myEsito) { // if exists .... if (documento.getRifUpdDocumento().getStrutturaOriginale() != null) { @@ -569,7 +564,8 @@ private void buildStrutturaOrigOnResponse(UpdDocumentoVers documento) { } // if } - private void buildComponenteOnResponse(UpdDocumentoVers documento) { + private void buildComponenteOnResponse(UpdDocumentoVers documento, UpdVersamentoExt versamento, + CompRapportoUpdVers myEsito) { // build on response // TODO: set da verificare successivamente .. Componenti componenti = new Componenti(); @@ -622,26 +618,13 @@ private void buildComponenteOnResponse(UpdDocumentoVers documento) { } } - private boolean verificaIdDocumento(UpdDocumentoVers documento) { + private boolean verificaIdDocumento(UpdDocumentoVers documento, UpdVersamentoExt versamento) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); boolean hasDocError = false; String cdCtrl = ControlliWSBundle.CTRL_KEYDOC_CHIAVEDOC; - // recupera l'ejb per i controlli se possibile - altrimenti segnala errore - try { - updVersamentoControlli = (ControlliUpdVersamento) new InitialContext() - .lookup("java:module/ControlliUpdVersamento"); - } catch (NamingException ex) { - this.setEsitoControlloErr(ControlliWSBundle.CTRL_GENERIC_ERROR, MessaggiWSBundle.ERR_666, - MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "UpdDocumentoPrsr.init.ControlliUpdVersamento: " + ex.getMessage())); - log.error("Errore nel recupero dell'EJB RapportoVersBuilder ", ex); - return false; - } - - rispostaControlli = updVersamentoControlli.checkIdDocumentoInUD(strutturaUpdVers.getIdUd(), - documento.getRifUpdDocumento().getIDDocumento(), documento.getCategoriaDoc().name(), - documento.getRifUpdDocumento().getTipoDocumento(), documento.getUrnPartDocumento()); + RispostaControlli rispostaControlli = updVersamentoControlli.checkIdDocumentoInUD(strutturaUpdVers.getIdUd(), + documento.getRifUpdDocumento().getIDDocumento(), documento.getUrnPartDocumento()); switch (documento.getCategoriaDoc()) { case Principale: @@ -701,9 +684,6 @@ private boolean verificaIdDocumento(UpdDocumentoVers documento) { } // esito generale in caso di errore if (hasDocError) { - /* - * this.setEsitoControlloErr(cdCtrl, rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); - */ return false;// non può effettuare i successivi controlli } else { // memorizzo l'ID della chiave doc trovata e il tipo da verificare @@ -716,23 +696,12 @@ private boolean verificaIdDocumento(UpdDocumentoVers documento) { return true;// prosegui con check successivo } - private boolean verificaTipoDocumento(UpdDocumentoVers documento) { - StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); - String codErr = null, dsErr = null; + private boolean verificaTipoDocumento(UpdDocumentoVers documento, UpdVersamentoExt versamento) { + String codErr = null; + String dsErr = null; String cdCtrl = ControlliWSBundle.CTRL_DOC_TIPODOC; boolean hasDocError = false; - // recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - try { - controlliSemantici = (ControlliSemantici) new InitialContext().lookup("java:module/ControlliSemantici"); - } catch (NamingException ex) { - this.setEsitoControlloErr(ControlliWSBundle.CTRL_GENERIC_ERROR, MessaggiWSBundle.ERR_666, - MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "UpdDocumentoPrsr.init.ControlliSemantici: " + ex.getMessage())); - log.error("Errore nel recupero dell'EJB dei controlli semantici in UpdDocumentoPrsr ", ex); - return false; - } - // TODO : logica da verificare ... if (!documento.getCategoriaDoc().name().equalsIgnoreCase(documento.getCatDocNonverificato())) { // aggiunta su controlli documento @@ -759,19 +728,6 @@ private boolean verificaTipoDocumento(UpdDocumentoVers documento) { versamento.addControlloOkOnControlliDocPrincipale(ControlliWSBundle.getControllo(cdCtrl), documento.getRifUpdDocumento().getIDDocumento()); } else { - /* - * rispostaControlli = controlliSemantici.checkTipoDocumento( - * documento.getRifUpdDocumento().getTipoDocumento(), strutturaUpdVers.getIdStruttura(), true, - * documento.getUrnPartDocumento()); if (rispostaControlli.isrBoolean()) { - * documento.setIdTipoDocumentoDB(rispostaControlli.getrLong()); // id tipo doc da aggiornare // setto - * l'id anche nella struttura (servirà successivamente) - * strutturaUpdVers.setIdTipoDocPrincipale(rispostaControlli.getrLong()); hasDocError = false; } else { - * hasDocError = true; // aggiunta su controlli documento - * versamento.addEsitoControlloOnControlliDocPrincipale( ControlliWSBundle.getControllo(cdCtrl), - * SeverityEnum.ERROR, TipiEsitoErrore.NEGATIVO, documento.getRifUpdDocumento().getIDDocumento(), - * codErr, dsErr); } - */ - // aggiunta su controlli documento versamento.addEsitoControlloOnControlliDocPrincipale(ControlliWSBundle.getControllo(cdCtrl), SeverityEnum.ERROR, TipiEsitoErrore.NEGATIVO, documento.getRifUpdDocumento().getIDDocumento(), @@ -784,16 +740,6 @@ private boolean verificaTipoDocumento(UpdDocumentoVers documento) { versamento.addControlloOkOnControlliAllegati(ControlliWSBundle.getControllo(cdCtrl), documento.getRifUpdDocumento().getIDDocumento()); } else { - /* - * rispostaControlli = controlliSemantici.checkTipoDocumento( - * documento.getRifUpdDocumento().getTipoDocumento(), strutturaUpdVers.getIdStruttura(), false, - * documento.getUrnPartDocumento()); if (rispostaControlli.isrBoolean()) { - * documento.setIdTipoDocumentoDB(rispostaControlli.getrLong()); // id tipo doc da aggiornare - * hasDocError = false; } else { hasDocError = true; // aggiunta su controlli allegati - * versamento.addEsitoControlloOnControlliAllegati( ControlliWSBundle.getControllo(cdCtrl), - * SeverityEnum.ERROR, TipiEsitoErrore.NEGATIVO, documento.getRifUpdDocumento().getIDDocumento(), - * codErr, dsErr); } - */ // aggiunta su controlli allegati versamento.addEsitoControlloOnControlliAllegati(ControlliWSBundle.getControllo(cdCtrl), @@ -808,16 +754,6 @@ private boolean verificaTipoDocumento(UpdDocumentoVers documento) { documento.getRifUpdDocumento().getIDDocumento()); } else { - /* - * rispostaControlli = controlliSemantici.checkTipoDocumento( - * documento.getRifUpdDocumento().getTipoDocumento(), strutturaUpdVers.getIdStruttura(), false, - * documento.getUrnPartDocumento()); if (rispostaControlli.isrBoolean()) { - * documento.setIdTipoDocumentoDB(rispostaControlli.getrLong()); // id tipo doc da aggiornare - * hasDocError = false; } else { hasDocError = true; // aggiunta su controlli annessi - * versamento.addEsitoControlloOnControlliAnnessi( ControlliWSBundle.getControllo(cdCtrl), - * SeverityEnum.ERROR, TipiEsitoErrore.NEGATIVO, documento.getRifUpdDocumento().getIDDocumento(), - * codErr, dsErr); } - */ // aggiunta su controlli annessi versamento.addEsitoControlloOnControlliAnnessi(ControlliWSBundle.getControllo(cdCtrl), SeverityEnum.ERROR, TipiEsitoErrore.NEGATIVO, documento.getRifUpdDocumento().getIDDocumento(), @@ -830,17 +766,6 @@ private boolean verificaTipoDocumento(UpdDocumentoVers documento) { versamento.addControlloOkOnControlliAnnotazioni(ControlliWSBundle.getControllo(cdCtrl), documento.getRifUpdDocumento().getIDDocumento()); } else { - /* - * rispostaControlli = controlliSemantici.checkTipoDocumento( - * documento.getRifUpdDocumento().getTipoDocumento(), strutturaUpdVers.getIdStruttura(), false, - * documento.getUrnPartDocumento()); if (rispostaControlli.isrBoolean()) { - * documento.setIdTipoDocumentoDB(rispostaControlli.getrLong()); // id tipo doc da aggiornare - * hasDocError = false; } else { hasDocError = true; // aggiunta su controlli annotazione - * versamento.addEsitoControlloOnControlliAnnotazioni( ControlliWSBundle.getControllo(cdCtrl), - * SeverityEnum.ERROR, TipiEsitoErrore.NEGATIVO, documento.getRifUpdDocumento().getIDDocumento(), - * codErr, dsErr); } - */ - // aggiunta su controlli annotazione versamento.addEsitoControlloOnControlliAnnotazioni(ControlliWSBundle.getControllo(cdCtrl), SeverityEnum.ERROR, TipiEsitoErrore.NEGATIVO, documento.getRifUpdDocumento().getIDDocumento(), @@ -848,36 +773,16 @@ private boolean verificaTipoDocumento(UpdDocumentoVers documento) { } break; } - // esito generale in caso di errore - if (hasDocError) { - /* - * this.setEsitoControlloErr(cdCtrl, rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); - */ - return false; // id tipo documento non trovato quindi non è possibile effettuare il controllo - // successivo - } - return true;// prosegui con check successivo + return !hasDocError; } - private boolean verificaAbilitazioneTipoDocumento(UpdDocumentoVers documento) { + private boolean verificaAbilitazioneTipoDocumento(UpdDocumentoVers documento, UpdVersamentoExt versamento) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); boolean hasDocError = false; String cdCtrl = ControlliWSBundle.CTRL_DOC_ABILITAZIONEUTENTETIPO; - // recupera l'ejb per i controlli se possibile - altrimenti segnala errore - try { - updVersamentoControlli = (ControlliUpdVersamento) new InitialContext() - .lookup("java:module/ControlliUpdVersamento"); - } catch (NamingException ex) { - this.setEsitoControlloErr(ControlliWSBundle.CTRL_GENERIC_ERROR, MessaggiWSBundle.ERR_666, - MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "UpdDocumentoPrsr.init.ControlliUpdVersamento: " + ex.getMessage())); - log.error("Errore nel recupero dell'EJB RapportoVersBuilder ", ex); - return false; - } - - rispostaControlli = updVersamentoControlli.checkTipoDocRegIamUserOrganizzazione( + RispostaControlli rispostaControlli = updVersamentoControlli.checkTipoDocRegIamUserOrganizzazione( documento.getRifUpdDocumento().getTipoDocumento(), documento.getIdTipoDocumentoDB(), strutturaUpdVers.getIdStruttura(), strutturaUpdVers.getIdUser()); @@ -952,8 +857,7 @@ private boolean verificaAbilitazioneTipoDocumento(UpdDocumentoVers documento) { return true;// prosegui con check successivo } - private boolean parseDatiSpecDoc(UpdDocumentoVers documento) { - StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); + private boolean parseDatiSpecDoc(UpdDocumentoVers documento, UpdVersamentoExt versamento) { String cdCtrlDatiSpec = ControlliWSBundle.CTRL_DOC_DATISPECIFICI; boolean hasDocError = false; @@ -965,7 +869,10 @@ private boolean parseDatiSpecDoc(UpdDocumentoVers documento) { JAXBElement tmpDatiSpecifici = documento.getRifUpdDocumento().getDatiSpecifici(); tmpControlliAttSpec = gestioneDatiSpec.parseDatiSpec(TipiEntitaSacer.DOC, tmpDatiSpecifici, documento.getIdTipoDocumentoDB(), documento.getUrnPartDocumento(), - documento.getRifUpdDocumento().getTipoDocumento()); + documento.getRifUpdDocumento().getTipoDocumento(), + versamento.getStrutturaUpdVers().getSistemaDiMigrazione(), + versamento.getStrutturaUpdVers().getIdStruttura(), + versamento.getModificatoriWSCalc().contains(Costanti.ModificatoriWS.TAG_DATISPEC_DEL_1_6)); switch (documento.getCategoriaDoc()) { case Principale: @@ -1029,11 +936,12 @@ private boolean parseDatiSpecDoc(UpdDocumentoVers documento) { return true;// prosegui } - private boolean parseDatiSpecMigrazDoc(UpdDocumentoVers documento) { + private boolean parseDatiSpecMigrazDoc(UpdDocumentoVers documento, UpdVersamentoExt versamento) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); String cdCtrlDatiSpecMigraz = ControlliWSBundle.CTRL_DOC_DATISPECIFICIMIGRAZ; - String codErr = null, dsErr = null; + String codErr = null; + String dsErr = null; boolean hasDocError = false; RispostaControlliAttSpec tmpControlliAttSpec = new RispostaControlliAttSpec(); @@ -1047,7 +955,10 @@ private boolean parseDatiSpecMigrazDoc(UpdDocumentoVers documento) { .getDatiSpecificiMigrazione(); tmpControlliAttSpec = gestioneDatiSpec.parseDatiSpecMig(TipiEntitaSacer.DOC, tmpDatiSpecificiMigrazione, documento.getIdTipoDocumentoDB(), documento.getUrnPartDocumento(), - documento.getRifUpdDocumento().getTipoDocumento()); + documento.getRifUpdDocumento().getTipoDocumento(), + versamento.getStrutturaUpdVers().getSistemaDiMigrazione(), + versamento.getStrutturaUpdVers().getIdStruttura(), + versamento.getModificatoriWSCalc().contains(Costanti.ModificatoriWS.TAG_DATISPEC_DEL_1_6)); // collect cod and desc error (esito generale) if (!tmpControlliAttSpec.isrBoolean()) { @@ -1151,12 +1062,11 @@ private boolean parseDatiSpecMigrazDoc(UpdDocumentoVers documento) { return true; // prosegui } - private boolean verificaOrdineComponente(UpdDocumentoVers documento) { + private boolean verificaOrdineComponente(UpdDocumentoVers documento, UpdVersamentoExt versamento) { boolean prosegui = true; // di default non prosegue, se esitono componenti va avanti ... - - StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); String cdCtrl = ControlliWSBundle.CTRL_COMP_ORDINE; Set ordiniDiPresentazioneUnici = new HashSet<>(); + RispostaControlli rispostaControlli = new RispostaControlli(); // per ogni componente atteso ... for (UpdComponenteVers componente : documento.getUpdComponentiAttesi()) { @@ -1165,6 +1075,7 @@ private boolean verificaOrdineComponente(UpdDocumentoVers documento) { if (!ordiniDiPresentazioneUnici .contains(Long.valueOf(componente.getMyUpdComponente().getOrdinePresentazione()))) { ordiniDiPresentazioneUnici.add(Long.valueOf(componente.getMyUpdComponente().getOrdinePresentazione())); + rispostaControlli.setrBoolean(true); } else { // aggiunta su controlli componente rispostaControlli.setCodErr(MessaggiWSBundle.DOC_007_003); @@ -1234,73 +1145,51 @@ private boolean verificaOrdineComponente(UpdDocumentoVers documento) { } - // - /* - * if (!hasDocError) { this.setEsitoControlloErr(cdCtrl, rispostaControlli.getCodErr(), - * rispostaControlli.getDsErr()); return false;// non può effettuare i successivi controlli } - */ - return prosegui; } - private boolean verificaComponenti(UpdDocumentoVers documento) { + private boolean verificaComponenti(UpdDocumentoVers documento, UpdVersamentoExt versamento) { boolean prosegui = false; // di default non prosegue, se esitono componenti va avanti ... // per ogni componente atteso ... for (UpdComponenteVers componente : documento.getUpdComponentiAttesi()) { // chiave componente - /* - * componente.setChiaveComp(MessaggiWSFormat.formattaChiaveComponente(documento.getUrnPartDocumento(), 1, - * componente.getMyUpdComponente().getOrdinePresentazione())); - */ componente.setChiaveComp(String.valueOf(componente.getMyUpdComponente().getOrdinePresentazione())); // verifica id componente - prosegui = this.verificaIdComponente(componente, componente.getKeyCtrl()); + prosegui = this.verificaIdComponente(componente, componente.getKeyCtrl(), versamento); // verifico tipo struttura e tipo componente if (prosegui) { - prosegui = this.verificaTipoComponente(componente, componente.getKeyCtrl()); + prosegui = this.verificaTipoComponente(componente, componente.getKeyCtrl(), versamento); } // verifico nome componente if (prosegui) { - prosegui = this.verificaNomeComponenti(componente, componente.getKeyCtrl()); + prosegui = this.verificaNomeComponenti(componente, componente.getKeyCtrl(), versamento); } // verifico dati specifici if (prosegui && componente.getMyUpdComponente().getDatiSpecifici() != null) { - prosegui = this.verificaDatiSpecComponente(componente, componente.getKeyCtrl()); + prosegui = this.verificaDatiSpecComponente(componente, componente.getKeyCtrl(), versamento); } // verifico dati specifici migrazione if (prosegui && componente.getMyUpdComponente().getDatiSpecificiMigrazione() != null) { - prosegui = this.verificaDatiSpecMigrazComponente(componente, componente.getKeyCtrl()); + prosegui = this.verificaDatiSpecMigrazComponente(componente, componente.getKeyCtrl(), versamento); } } return prosegui; } - private boolean verificaIdComponente(UpdComponenteVers componente, String ctrlKey) { - StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); + private boolean verificaIdComponente(UpdComponenteVers componente, String ctrlKey, UpdVersamentoExt versamento) { UpdDocumentoVers documento = componente.getRifUpdDocumentoVers(); boolean hasDocError = false; String cdCtrl = ControlliWSBundle.CTRL_KEYDOC_CHIAVECOMP; - // recupera l'ejb per i controlli se possibile - altrimenti segnala errore - try { - updVersamentoControlli = (ControlliUpdVersamento) new InitialContext() - .lookup("java:module/ControlliUpdVersamento"); - } catch (NamingException ex) { - this.setEsitoControlloErr(ControlliWSBundle.CTRL_GENERIC_ERROR, MessaggiWSBundle.ERR_666, - MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "UpdDocumentoPrsr.init.ControlliUpdVersamento: " + ex.getMessage())); - log.error("Errore nel recupero dell'EJB RapportoVersBuilder ", ex); - return false; - } - - rispostaControlli = updVersamentoControlli.checkIdComponenteInDoc(documento.getIdRecDocumentoDB(), - componente.getMyUpdComponente().getOrdinePresentazione(), componente.getChiaveComp()); + RispostaControlli rispostaControlli = updVersamentoControlli.checkIdComponenteInDoc( + documento.getIdRecDocumentoDB(), componente.getMyUpdComponente().getOrdinePresentazione(), + componente.getChiaveComp()); switch (documento.getCategoriaDoc()) { case Principale: @@ -1356,9 +1245,6 @@ private boolean verificaIdComponente(UpdComponenteVers componente, String ctrlKe } // esito generale in caso di errore if (hasDocError) { - /* - * this.setEsitoControlloErr(cdCtrl, rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); - */ return false;// non può effettuare i successivi controlli } else { // memorizzo l'ID della chiave doc trovata e il tipo da verificare @@ -1375,12 +1261,13 @@ private boolean verificaIdComponente(UpdComponenteVers componente, String ctrlKe return true;// prosegui con check successivo } - private boolean verificaTipoComponente(UpdComponenteVers componente, String ctrlKey) { - StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); + private boolean verificaTipoComponente(UpdComponenteVers componente, String ctrlKey, UpdVersamentoExt versamento) { UpdDocumentoVers documento = componente.getRifUpdDocumentoVers(); boolean hasDocError = false; - String codErr = null, dsErr = null; + String codErr = null; + String dsErr = null; String cdCtrl = ControlliWSBundle.CTRL_COMP_TIPO; + RispostaControlli rispostaControlli = new RispostaControlli(); // controllo tipo struttura componente if (!documento.getRifUpdDocumento().getStrutturaOriginale().getTipoStruttura() @@ -1518,11 +1405,11 @@ private boolean verificaTipoComponente(UpdComponenteVers componente, String ctrl return true; } - private boolean verificaNomeComponenti(UpdComponenteVers componente, String ctrlKey) { - StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); + private boolean verificaNomeComponenti(UpdComponenteVers componente, String ctrlKey, UpdVersamentoExt versamento) { UpdDocumentoVers documento = componente.getRifUpdDocumentoVers(); boolean hasDocCompError = false; String cdCtrl = ControlliWSBundle.CTRL_COMP_NOME; + RispostaControlli rispostaControlli = new RispostaControlli(); // verifico se il tipo supporto componente è diverso da file, NON deve avere // sottocomponenti @@ -1538,6 +1425,8 @@ private boolean verificaNomeComponenti(UpdComponenteVers componente, String ctrl } else { rispostaControlli.setrBoolean(true); } + } else { + rispostaControlli.setrBoolean(true); } switch (documento.getCategoriaDoc()) { @@ -1593,19 +1482,11 @@ private boolean verificaNomeComponenti(UpdComponenteVers componente, String ctrl break; } - // se non presenti errori -> colleziona dati - if (!hasDocCompError) { - // memorizzo l'ID struttura e il l'ID del tipo comp - documento.setIdRecStrutturaDB(rispostaControlli.getrLong()); - componente.setIdTipoComponente(rispostaControlli.getrLongExtended()); - - } - return true; } - private boolean verificaDatiSpecComponente(UpdComponenteVers componente, String ctrlKey) { - StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); + private boolean verificaDatiSpecComponente(UpdComponenteVers componente, String ctrlKey, + UpdVersamentoExt versamento) { UpdDocumentoVers documento = componente.getRifUpdDocumentoVers(); boolean hasDocCompError = false; String cdCtrl = ControlliWSBundle.CTRL_COMP_DATISPEC; @@ -1613,7 +1494,10 @@ private boolean verificaDatiSpecComponente(UpdComponenteVers componente, String JAXBElement tmpDatiSpecifici = componente.getMyUpdComponente().getDatiSpecifici(); RispostaControlliAttSpec tmpControlliAttSpec = gestioneDatiSpec.parseDatiSpec(TipiEntitaSacer.COMP, tmpDatiSpecifici, componente.getIdTipoComponente(), componente.getChiaveComp(), - componente.getMyUpdComponente().getTipoComponente()); + componente.getMyUpdComponente().getTipoComponente(), + versamento.getStrutturaUpdVers().getSistemaDiMigrazione(), + versamento.getStrutturaUpdVers().getIdStruttura(), + versamento.getModificatoriWSCalc().contains(Costanti.ModificatoriWS.TAG_DATISPEC_DEL_1_6)); switch (documento.getCategoriaDoc()) { case Principale: @@ -1678,11 +1562,13 @@ private boolean verificaDatiSpecComponente(UpdComponenteVers componente, String return true; // prosegui } - private boolean verificaDatiSpecMigrazComponente(UpdComponenteVers componente, String ctrlKey) { + private boolean verificaDatiSpecMigrazComponente(UpdComponenteVers componente, String ctrlKey, + UpdVersamentoExt versamento) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); UpdDocumentoVers documento = componente.getRifUpdDocumentoVers(); - String codErr = null, dsErr = null; + String codErr = null; + String dsErr = null; boolean hasDocCompError = false; String cdCtrl = ControlliWSBundle.CTRL_COMP_DATISPECMIGRAZ; @@ -1698,7 +1584,10 @@ private boolean verificaDatiSpecMigrazComponente(UpdComponenteVers componente, S .getDatiSpecificiMigrazione(); tmpControlliAttSpec = gestioneDatiSpec.parseDatiSpecMig(TipiEntitaSacer.COMP, tmpDatiSpecificiMigrazione, componente.getIdTipoComponente(), componente.getChiaveComp(), - componente.getMyUpdComponente().getTipoComponente()); + componente.getMyUpdComponente().getTipoComponente(), + versamento.getStrutturaUpdVers().getSistemaDiMigrazione(), + versamento.getStrutturaUpdVers().getIdStruttura(), + versamento.getModificatoriWSCalc().contains(Costanti.ModificatoriWS.TAG_DATISPEC_DEL_1_6)); // collect cod and desc error (esito generale) if (!tmpControlliAttSpec.isrBoolean()) { @@ -1734,7 +1623,7 @@ private boolean verificaDatiSpecMigrazComponente(UpdComponenteVers componente, S } break; case Annesso: - if (rispostaControlli.isrBoolean()) { + if (tmpControlliAttSpec.isrBoolean()) { // aggiunta su controlli componente versamento.addControlloOkOnControlliComponentiAnnessi(ControlliWSBundle.getControllo(cdCtrl), ctrlKey); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/UpdVersamentoBasePrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdVersamentoBasePrsr.java similarity index 85% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/UpdVersamentoBasePrsr.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdVersamentoBasePrsr.java index 124ebb6..7515730 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/UpdVersamentoBasePrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdVersamentoBasePrsr.java @@ -1,15 +1,32 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package it.eng.parer.ws.versamentoUpd.prsr; +package it.eng.parer.ws.versamentoUpd.ejb.prs; import java.math.BigDecimal; +import javax.ejb.EJB; + import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import it.eng.parer.util.ejb.help.ConfigurationHelper; import it.eng.parer.ws.dto.CSChiave; @@ -21,6 +38,7 @@ import it.eng.parer.ws.ejb.ControlliWS; import it.eng.parer.ws.ejb.XmlUpdVersCache; import it.eng.parer.ws.utils.ControlliWSBundle; +import it.eng.parer.ws.utils.Costanti; import it.eng.parer.ws.utils.Costanti.TipiWSPerControlli; import it.eng.parer.ws.utils.CostantiDB; import it.eng.parer.ws.utils.CostantiDB.TipiEntitaSacer; @@ -34,15 +52,11 @@ import it.eng.parer.ws.versamentoUpd.dto.RispostaWSUpdVers; import it.eng.parer.ws.versamentoUpd.dto.StrutturaUpdVers; import it.eng.parer.ws.versamentoUpd.ejb.ControlliUpdVersamento; +import it.eng.parer.ws.versamentoUpd.ejb.UpdGestioneDatiSpec; import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; -import it.eng.parer.ws.versamentoUpd.prsr.strategy.UpdCollegamentiPrsr; -import it.eng.parer.ws.versamentoUpd.prsr.strategy.UpdDocumentiIdCountPrsr; -import it.eng.parer.ws.versamentoUpd.prsr.strategy.UpdDocumentiPrsr; import it.eng.parer.ws.versamentoUpd.utils.UpdCostanti; import it.eng.parer.ws.versamentoUpd.utils.UpdCostanti.TipoAggiornamento; -import it.eng.parer.ws.versamentoUpd.utils.UpdGestioneDatiSpec; import it.eng.parer.ws.xml.versReq.TipoConservazioneType; -import it.eng.parer.ws.xml.versUpdReq.IndiceSIPAggiornamentoUnitaDocumentaria; /** * @@ -50,46 +64,41 @@ */ public abstract class UpdVersamentoBasePrsr { - private static final Logger log = LoggerFactory.getLogger(UpdVersamentoBasePrsr.class); - - protected UpdVersamentoExt versamento; - protected RispostaWSUpdVers rispostaWs; - protected RispostaControlli rispostaControlli; - // l'istanza dell'indice SIP di aggiornamento - protected IndiceSIPAggiornamentoUnitaDocumentaria parsedIndiceUpd = null; - // - protected CSVersatore tagCSVersatore = new CSVersatore(); - protected CSChiave tagCSChiave = new CSChiave(); - protected String descChiaveUD = ""; - // // stateless ejb per i controlli sul db - protected ControlliSemantici controlliSemantici = null; + @EJB + protected ControlliSemantici controlliSemantici; // stateless ejb per verifica autorizzazione ws - protected ControlliWS controlliEjb = null; + @EJB + protected ControlliWS controlliEjb; // singleton ejb di gestione cache dei parser jaxb dei fascicoli - protected XmlUpdVersCache xmlUpdVersCache = null; + @EJB + protected XmlUpdVersCache xmlUpdVersCache; // stateless ejb: crea il rapporto di versamento e canonicalizza (C14N) il SIP - protected RapportoVersBuilder rapportoVersBuilder = null; + @EJB + protected RapportoVersBuilder rapportoVersBuilder; // controlli su versamento - protected ControlliUpdVersamento updVersamentoControlli = null; + @EJB + protected ControlliUpdVersamento updVersamentoControlli; // classe di supporto per la verifica e l'estrazione dei dati specifici - protected UpdGestioneDatiSpec gestioneDatiSpec = null; // allocata nel costruttore + @EJB + protected UpdGestioneDatiSpec gestioneDatiSpec; // allocata nel costruttore // singleton ejb di gestione configurazioni applicative - protected ConfigurationHelper configurationHelper = null; - - public UpdVersamentoExt getVersamento() { - return versamento; - } - - public RispostaWSUpdVers getRispostaWs() { - return rispostaWs; - } + @EJB + protected ConfigurationHelper configurationHelper; + // + @EJB + protected UpdDocumentiPrsr updDocumentiPrsr; + // + @EJB + protected UpdDocumentiIdCountPrsr updDocumentiIdCountPrsr; + // + @EJB + protected UpdCollegamentiPrsr updCollegamentiPrsr; - protected boolean controllaUnivocitaDocIDs() { + protected boolean controllaUnivocitaDocIDs(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); // - UpdExecutePrsr controllaUnivocitaDocID = new UpdExecutePrsr(); - controllaUnivocitaDocID.eseguiControlli(new UpdDocumentiIdCountPrsr(versamento)); + updDocumentiIdCountPrsr.eseguiControlli(versamento); // questo test, sui documenti, ha senso perché l'ID Documento può essere nullo @@ -118,7 +127,7 @@ protected boolean controllaUnivocitaDocIDs() { // ALLEGATI if (strutturaUpdVers.isCorrAllegatiDichiarati() != null) { - if (!strutturaUpdVers.isCorrAllegatiDichiarati()) { + if (!strutturaUpdVers.isCorrAllegatiDichiarati().booleanValue()) { rispostaWs.setSeverity(SeverityEnum.ERROR); // esito generale @@ -139,7 +148,7 @@ protected boolean controllaUnivocitaDocIDs() { // ANNESSI if (strutturaUpdVers.isCorrAnnessiDichiarati() != null) { - if (!strutturaUpdVers.isCorrAnnessiDichiarati()) { + if (!strutturaUpdVers.isCorrAnnessiDichiarati().booleanValue()) { rispostaWs.setSeverity(SeverityEnum.ERROR); // esito generale @@ -159,7 +168,7 @@ protected boolean controllaUnivocitaDocIDs() { } // ANNOTAZIONI if (strutturaUpdVers.isCorrAnnotazioniDichiarati() != null) { - if (!strutturaUpdVers.isCorrAnnotazioniDichiarati()) { + if (!strutturaUpdVers.isCorrAnnotazioniDichiarati().booleanValue()) { rispostaWs.setSeverity(SeverityEnum.ERROR); // esito generale @@ -181,7 +190,7 @@ protected boolean controllaUnivocitaDocIDs() { return true; // esegui controllo successivo } - protected boolean controllaTipoAggiornamento() { + protected boolean controllaTipoAggiornamento(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs) { // se esiste si esegue il controllo, altrimenti NON_ATTIVATO if (StringUtils.isNotBlank(versamento.getStrutturaUpdVers().getTipoAggiornamento())) { if (!versamento.getStrutturaUpdVers().getTipoAggiornamento().equals(TipoAggiornamento.METADATI.name())) { @@ -212,7 +221,7 @@ protected boolean controllaTipoAggiornamento() { return true; // prosegui controllo successivo } - protected boolean controllaVersioneXSD() { + protected boolean controllaVersioneXSD(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs) { if (!versamento.getVersamento().getUnitaDocumentaria().getIntestazione().getVersione() .equals(versamento.getVersioneWsChiamata())) { rispostaWs.setSeverity(SeverityEnum.ERROR); @@ -240,13 +249,15 @@ protected boolean controllaVersioneXSD() { return true; // prosegui controllo successivo } - protected boolean controllaStrutturaVersatore() { + protected boolean controllaStrutturaVersatore(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs, + CSVersatore tagCSVersatore, String descChiaveUD) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); // verifica la struttura versante e versatore - boolean utenteOk = true, strutturaOk = true; + boolean utenteOk = true; + boolean strutturaOk = true; - rispostaControlli = controlliSemantici.checkIdStrut(tagCSVersatore, TipiWSPerControlli.AGGIORNAMENTO_VERSAMENTO, - versamento.getStrutturaUpdVers().getDataVersamento()); + RispostaControlli rispostaControlli = controlliSemantici.checkIdStrut(tagCSVersatore, + TipiWSPerControlli.AGGIORNAMENTO_VERSAMENTO, versamento.getStrutturaUpdVers().getDataVersamento()); if (rispostaControlli.getrLong() < 1) { rispostaWs.setSeverity(SeverityEnum.ERROR); String cdControllo = ControlliWSBundle.CTRL_GENERIC_ERROR; // default generico @@ -276,37 +287,7 @@ protected boolean controllaStrutturaVersatore() { break; case MessaggiWSBundle.UD_001_003: - // struttura - cdControllo = ControlliWSBundle.CTRL_INTS_STRUTTURA; - // aggiunta su controlli generali - versamento.addEsitoControlloOnGenerali(ControlliWSBundle.getControllo(cdControllo), - rispostaWs.getSeverity(), TipiEsitoErrore.NEGATIVO, rispostaControlli.getCodErr(), - rispostaControlli.getDsErr()); - // controllo struttura KO (non si effettuano ulteriori verifiche) - strutturaOk = false; - // check su ambiente/ente superato - // aggiunta su controlli generali - versamento - .addControlloOkOnGenerali(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_AMBIENTE)); - versamento.addControlloOkOnGenerali(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_ENTE)); - - break; case MessaggiWSBundle.UD_001_015: - // struttura - cdControllo = ControlliWSBundle.CTRL_INTS_STRUTTURA; - // aggiunta su controlli generali - versamento.addEsitoControlloOnGenerali(ControlliWSBundle.getControllo(cdControllo), - rispostaWs.getSeverity(), TipiEsitoErrore.NEGATIVO, rispostaControlli.getCodErr(), - rispostaControlli.getDsErr()); - // controllo struttura KO (non si effettuano ulteriori verifiche) - strutturaOk = false; - // check su ambiente/ente superato - // aggiunta su controlli generali - versamento - .addControlloOkOnGenerali(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_AMBIENTE)); - versamento.addControlloOkOnGenerali(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_ENTE)); - - break; case MessaggiWSBundle.UD_001_019: // struttura cdControllo = ControlliWSBundle.CTRL_INTS_STRUTTURA; @@ -436,9 +417,6 @@ protected boolean controllaStrutturaVersatore() { if (rispostaControlli.isrBoolean()) { // registro ID TIPOREG strutturaUpdVers.setIdTipoREGUnknown(rispostaControlli.getrLong()); - - rispostaControlli = controlliSemantici.checkTipoDocumento(UpdCostanti.TIPDOC_PRINCIPALE_SCONOSCIUTO, - strutturaUpdVers.getIdStruttura(), true, descChiaveUD); } else { hasUnknownErr = true; } @@ -482,46 +460,20 @@ protected boolean controllaStrutturaVersatore() { versamento.addControlloOkOnGenerali( ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_STRUTTURA)); } - - // verifica il partizionamento corretto della struttura - rispostaControlli = updVersamentoControlli.checkPartizioniStruttuaByAA(descChiaveUD, - strutturaUpdVers.getIdStruttura(), strutturaUpdVers.getChiaveNonVerificata().getAnno()); - - if (!rispostaControlli.isrBoolean()) { - // se il partizionamento è scorretto, la sessione di versamento è errata senza - // possibilità di recupero (anche le sessioni fallite sono partizionate sul db) - rispostaWs.setStatoSessioneVersamento(IRispostaWS.StatiSessioneVersEnum.ERRATA); - rispostaWs.setSeverity(SeverityEnum.ERROR); - // esito generale - rispostaWs.setEsitoWsError(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_PARTIZIONI), - rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); - - // aggiunta su controlli generali - versamento.addEsitoControlloOnGenerali( - ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_PARTIZIONI), - rispostaWs.getSeverity(), TipiEsitoErrore.NEGATIVO, rispostaControlli.getCodErr(), - rispostaControlli.getDsErr()); - - strutturaOk = false; - - } else { - // aggiunta su controlli generali - versamento.addControlloOkOnGenerali( - ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_PARTIZIONI)); - - } - + /* MEV 30089 - non faccio più controlli sulle partizioni, ci sono partizionamenti automatici */ + versamento.addControlloOkOnGenerali(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_INTS_PARTIZIONI)); } return strutturaOk && utenteOk; } - protected boolean controlloChiaveECdKeyNorm() { - boolean prosegui = controllaChiave(); + protected boolean controlloChiaveECdKeyNorm(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs, + CSChiave tagCSChiave, String descChiaveUD) { + boolean prosegui = controllaChiave(versamento, rispostaWs, tagCSChiave, descChiaveUD); // se esito precedente positivo - verifico se calcolare chiave normalizzata (se // esiste già su sistema restituisco errore) if (prosegui) { - prosegui = controllaCdKeyNormalized(); + prosegui = controllaCdKeyNormalized(versamento, rispostaWs); } if (prosegui) { // aggiunta su controlli generali @@ -531,14 +483,16 @@ protected boolean controlloChiaveECdKeyNorm() { return prosegui; } - private boolean controllaChiave() { + private boolean controllaChiave(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs, CSChiave tagCSChiave, + String descChiaveUD) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); CompRapportoUpdVers myEsito = rispostaWs.getCompRapportoUpdVers(); boolean prosegui = true; // controlla prensa chiave UD - rispostaControlli = updVersamentoControlli.checkChiaveAndTipoDocPrinc(strutturaUpdVers.getChiaveNonVerificata(), - strutturaUpdVers.getIdStruttura(), ControlliSemantici.TipiGestioneUDAnnullate.CONSIDERA_ASSENTE); + RispostaControlli rispostaControlli = updVersamentoControlli.checkChiaveAndTipoDocPrinc( + strutturaUpdVers.getChiaveNonVerificata(), strutturaUpdVers.getIdStruttura(), + ControlliSemantici.TipiGestioneUDAnnullate.CONSIDERA_ASSENTE); if (rispostaControlli.isrBoolean()) { rispostaWs.setSeverity(SeverityEnum.ERROR); @@ -662,11 +616,12 @@ private boolean controllaChiave() { return prosegui; } - protected boolean controllaHashSIP(SyncFakeSessn sessione) { + protected boolean controllaHashSIP(SyncFakeSessn sessione, UpdVersamentoExt versamento, + RispostaWSUpdVers rispostaWs, String descChiaveUD) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); // dato che su DB verrà salvato il SIP prodotto dalla canonicalizzazione // si effettua il calcolo su quest'ultimo - rispostaControlli = updVersamentoControlli.checkUltimoSIPWithHashBinary(descChiaveUD, + RispostaControlli rispostaControlli = updVersamentoControlli.checkUltimoSIPWithHashBinary(descChiaveUD, versamento.getStrutturaUpdVers().getIdUd(), sessione.getDatiDaSalvareIndiceSip()); if (!rispostaControlli.isrBoolean()) { @@ -698,7 +653,8 @@ protected boolean controllaHashSIP(SyncFakeSessn sessione) { return true; // prosegui } - protected boolean checkTipoUDAndAbilUpdMeta(CompRapportoUpdVers myEsito) { + protected boolean checkTipoUDAndAbilUpdMeta(CompRapportoUpdVers myEsito, UpdVersamentoExt versamento, + RispostaWSUpdVers rispostaWs, String descChiaveUD) { FlControlliUpd flControlliUpd = null; boolean prosegui = true; StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); @@ -734,7 +690,7 @@ protected boolean checkTipoUDAndAbilUpdMeta(CompRapportoUpdVers myEsito) { // controllaChiave // recupero DecTipoUnitaDoc per la costruzione dei flag - rispostaControlli = updVersamentoControlli.getUpdFlagsFromTipoUDOrgStrut( + RispostaControlli rispostaControlli = updVersamentoControlli.getUpdFlagsFromTipoUDOrgStrut( strutturaUpdVers.getIdTipologiaUnitaDocumentaria(), strutturaUpdVers.isFlForzaAggiornamento()); /// 666P @@ -785,10 +741,10 @@ protected boolean checkTipoUDAndAbilUpdMeta(CompRapportoUpdVers myEsito) { return prosegui; // prosegui controlli successivi } - protected boolean controllaAbilUserRegTipoUD() { + protected boolean controllaAbilUserRegTipoUD(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); // verifica abilitazione utente per registro/tipo UD - rispostaControlli = updVersamentoControlli.checkTipoUDRegIamUserOrganizzazione( + RispostaControlli rispostaControlli = updVersamentoControlli.checkTipoUDRegIamUserOrganizzazione( strutturaUpdVers.getChiaveNonVerificata(), strutturaUpdVers.getDescTipologiaUnitaDocumentaria(), strutturaUpdVers.getIdStruttura(), strutturaUpdVers.getIdUser(), strutturaUpdVers.getIdTipologiaUnitaDocumentaria(), strutturaUpdVers.getIdRegistro()); @@ -816,7 +772,8 @@ protected boolean controllaAbilUserRegTipoUD() { return true; // prosegui controlli successivi } - protected boolean controllaStatoConservazione() { + protected boolean controllaStatoConservazione(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs, + String descChiaveUD) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); FlControlliUpd flControlliUpd = strutturaUpdVers.getFlControlliUpd(); boolean isWarn = flControlliUpd.isFlAccettaUpdMetaInark() && flControlliUpd.isFlForzaUpdMetaInark(); @@ -871,14 +828,47 @@ protected boolean controllaStatoConservazione() { return true; // prosegui controlli successivi } - protected boolean controllaCollegamenti(CompRapportoUpdVers myEsito) { + protected boolean controllaCollegamenti(CompRapportoUpdVers myEsito, UpdVersamentoExt versamento, + RispostaWSUpdVers rispostaWs) { // - UpdExecutePrsr controlloCollegamenti = new UpdExecutePrsr(); - return controlloCollegamenti.eseguiControlli(new UpdCollegamentiPrsr(versamento, rispostaWs, myEsito)); + return updCollegamentiPrsr.eseguiControlli(versamento, rispostaWs, myEsito); + } + + protected boolean controllaProfiloNormativo(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs) { + // recupera e controlla fascicolo princ + RispostaControlli rispostaControlli = updVersamentoControlli.checkProfiloNormativo(versamento, + TipiEntitaSacer.UNI_DOC, versamento.getStrutturaUpdVers().getIdTipologiaUnitaDocumentaria(), + versamento.getStrutturaUpdVers().getUrnPartChiaveUd(), + versamento.getVersamento().getUnitaDocumentaria().getIntestazione().getTipologiaUnitaDocumentaria(), + versamento.getStrutturaUpdVers().getIdUd()); + if (!rispostaControlli.isrBoolean()) { + rispostaWs.setSeverity(SeverityEnum.ERROR); + // esito generale + rispostaWs.setEsitoWsError(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_UD_PROFILONORMATIVO), + rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); + + // aggiunta su controlli documento + versamento.addEsitoControlloOnControlliUnitaDocumentaria( + ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_UD_PROFILONORMATIVO), + rispostaWs.getSeverity(), TipiEsitoErrore.NEGATIVO, rispostaControlli.getCodErr(), + rispostaControlli.getDsErr()); + } else { + // id uso + if (rispostaControlli.getrLong() != -1) /* se individuato */ { + versamento.getStrutturaUpdVers().setIdRecUsoXsdProfiloNormativo(rispostaControlli.getrLong()); + // xml canonicalizzato + versamento.getStrutturaUpdVers().setDatiC14NProfNormXml(rispostaControlli.getrString()); + } + // aggiunta OK + versamento.addControlloOkOnControlliUnitaDocumentaria( + ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_UD_PROFILONORMATIVO)); + } + return true; // prosegui controlli successivi } - protected boolean controllaProfiloUnitaDocumentaria() { + protected boolean controllaProfiloUnitaDocumentaria(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs, + String descChiaveUD) { boolean profileHasError = false; StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); @@ -933,15 +923,17 @@ protected boolean controllaProfiloUnitaDocumentaria() { return true; } - protected boolean controllaDatiSpecifici() { + protected boolean controllaDatiSpecifici(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs, + String descChiaveUD) { // - // costruttore - gestioneDatiSpec = new UpdGestioneDatiSpec(versamento); // verifico gli eventuali dati specifici e di migrazione RispostaControlliAttSpec tmpControlliAttSpec = gestioneDatiSpec.parseDatiSpec(TipiEntitaSacer.UNI_DOC, versamento.getVersamento().getUnitaDocumentaria().getDatiSpecifici(), versamento.getStrutturaUpdVers().getIdTipologiaUnitaDocumentaria(), descChiaveUD, - versamento.getStrutturaUpdVers().getDescTipologiaUnitaDocumentaria()); + versamento.getStrutturaUpdVers().getDescTipologiaUnitaDocumentaria(), + versamento.getStrutturaUpdVers().getSistemaDiMigrazione(), + versamento.getStrutturaUpdVers().getIdStruttura(), + versamento.getModificatoriWSCalc().contains(Costanti.ModificatoriWS.TAG_DATISPEC_DEL_1_6)); if (tmpControlliAttSpec.isrBoolean()) { versamento.getStrutturaUpdVers().setDatiSpecifici(tmpControlliAttSpec.getDatiSpecifici()); versamento.getStrutturaUpdVers().setIdRecXsdDatiSpec(tmpControlliAttSpec.getIdRecXsdDatiSpec()); @@ -965,7 +957,8 @@ protected boolean controllaDatiSpecifici() { return true; // prosegui controlli successivi } - protected boolean controllaDatiSpeificiMig() { + protected boolean controllaDatiSpeificiMig(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs, + String descChiaveUD) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); @@ -973,12 +966,14 @@ protected boolean controllaDatiSpeificiMig() { && TipoConservazioneType.MIGRAZIONE.name().equalsIgnoreCase(strutturaUpdVers.getTipoConservazione())) { // costruttore - gestioneDatiSpec = new UpdGestioneDatiSpec(versamento); // verifico gli eventuali dati specifici e di migrazione RispostaControlliAttSpec tmpControlliAttSpec = gestioneDatiSpec.parseDatiSpecMig(TipiEntitaSacer.UNI_DOC, versamento.getVersamento().getUnitaDocumentaria().getDatiSpecificiMigrazione(), versamento.getStrutturaUpdVers().getIdTipologiaUnitaDocumentaria(), descChiaveUD, - versamento.getStrutturaUpdVers().getDescTipologiaUnitaDocumentaria()); + versamento.getStrutturaUpdVers().getDescTipologiaUnitaDocumentaria(), + versamento.getStrutturaUpdVers().getSistemaDiMigrazione(), + versamento.getStrutturaUpdVers().getIdStruttura(), + versamento.getModificatoriWSCalc().contains(Costanti.ModificatoriWS.TAG_DATISPEC_DEL_1_6)); if (tmpControlliAttSpec.isrBoolean()) { versamento.getStrutturaUpdVers().setDatiSpecificiMigrazione(tmpControlliAttSpec.getDatiSpecifici()); @@ -988,9 +983,6 @@ protected boolean controllaDatiSpeificiMig() { // aggiunto esito positivo versamento.addControlloOkOnControlliUnitaDocumentaria( ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_UD_DATISPECIFICIMIGRAZ)); - - // myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria().setCodiceEsito(ECEsitoPosNegWarType.POSITIVO); - // myEsito.getUnitaDocumentaria().getEsitoUnitaDocumentaria().setCorrispondenzaDatiSpecifici("POSITIVO"); } else { // è un errore grave ... rispostaWs.setSeverity(SeverityEnum.ERROR); @@ -1022,15 +1014,14 @@ protected boolean controllaDatiSpeificiMig() { return true; } - protected boolean controllaDocumenti(CompRapportoUpdVers myEsito) { - // - UpdExecutePrsr controlloDocumenti = new UpdExecutePrsr(); - return controlloDocumenti.eseguiControlli(new UpdDocumentiPrsr(versamento, rispostaWs, myEsito)); + protected boolean controllaDocumenti(CompRapportoUpdVers myEsito, UpdVersamentoExt versamento, + RispostaWSUpdVers rispostaWs) { + return updDocumentiPrsr.eseguiControlli(versamento, rispostaWs, myEsito); } - protected boolean controllaFascicoliSecondari() { + protected boolean controllaFascicoliSecondari(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs) { // recupera e controlla fascicolo princ - rispostaControlli = updVersamentoControlli.checkFascicoliSecondari(versamento); + RispostaControlli rispostaControlli = updVersamentoControlli.checkFascicoliSecondari(versamento); if (!rispostaControlli.isrBoolean()) { rispostaWs.setSeverity(SeverityEnum.ERROR); @@ -1054,13 +1045,11 @@ protected boolean controllaFascicoliSecondari() { return true; // prosegui controlli successivi } - private boolean controllaCdKeyNormalized() { + private boolean controllaCdKeyNormalized(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); - CompRapportoUpdVers myEsito = rispostaWs.getCompRapportoUpdVers(); - boolean prosegui = true; // recupero parametro DB per verifica calcolo URN normalizzato - rispostaControlli = controlliSemantici.getDtCalcInizioNuoviUrn(); + RispostaControlli rispostaControlli = controlliSemantici.getDtCalcInizioNuoviUrn(); if (rispostaControlli.isrBoolean()) { rispostaWs.setSeverity(SeverityEnum.ERROR); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/UpdVersamentoPrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdVersamentoPrsr.java similarity index 78% rename from sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/UpdVersamentoPrsr.java rename to sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdVersamentoPrsr.java index 8bda1fb..b26edc6 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/UpdVersamentoPrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdVersamentoPrsr.java @@ -1,16 +1,32 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package it.eng.parer.ws.versamentoUpd.prsr; +package it.eng.parer.ws.versamentoUpd.ejb.prs; -import java.io.StringReader; import java.math.BigDecimal; import java.util.stream.Collectors; -import javax.naming.InitialContext; -import javax.naming.NamingException; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; @@ -19,13 +35,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import it.eng.parer.util.ejb.help.ConfigurationHelper; +import it.eng.parer.ws.dto.CSChiave; +import it.eng.parer.ws.dto.CSVersatore; import it.eng.parer.ws.dto.IRispostaWS; -import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; import it.eng.parer.ws.dto.RispostaControlli; -import it.eng.parer.ws.ejb.ControlliSemantici; -import it.eng.parer.ws.ejb.ControlliWS; -import it.eng.parer.ws.ejb.XmlUpdVersCache; +import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; import it.eng.parer.ws.utils.ControlliWSBundle; import it.eng.parer.ws.utils.Costanti; import it.eng.parer.ws.utils.Costanti.CategoriaDocumento; @@ -39,13 +53,11 @@ import it.eng.parer.ws.versamento.dto.SyncFakeSessn; import it.eng.parer.ws.versamento.dto.VoceDiErrore; import it.eng.parer.ws.versamento.dto.VoceDiErrore.TipiEsitoErrore; -import it.eng.parer.ws.versamento.ejb.RapportoVersBuilder; import it.eng.parer.ws.versamentoUpd.dto.CompRapportoUpdVers; import it.eng.parer.ws.versamentoUpd.dto.RispostaWSUpdVers; import it.eng.parer.ws.versamentoUpd.dto.StrutturaUpdVers; import it.eng.parer.ws.versamentoUpd.dto.UpdComponenteVers; import it.eng.parer.ws.versamentoUpd.dto.UpdDocumentoVers; -import it.eng.parer.ws.versamentoUpd.ejb.ControlliUpdVersamento; import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; import it.eng.parer.ws.versamentoUpd.utils.UpdCostanti.AggiornamentoEffettuato; import it.eng.parer.ws.xml.versUpdReq.IndiceSIPAggiornamentoUnitaDocumentaria; @@ -53,109 +65,36 @@ import it.eng.parer.ws.xml.versUpdResp.ChiaveType; import it.eng.parer.ws.xml.versUpdResp.SIPType; import it.eng.parer.ws.xml.versUpdResp.VersatoreType; -import it.eng.parer.ws.utils.CostantiDB; import it.eng.parer.ws.utils.LogSessioneUtils; +import java.io.StringReader; /** * * @author sinatti_s */ +@Stateless(mappedName = "UpdVersamentoPrsr") +@LocalBean public class UpdVersamentoPrsr extends UpdVersamentoBasePrsr { private static final Logger log = LoggerFactory.getLogger(UpdVersamentoPrsr.class); - public UpdVersamentoPrsr(UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs) { - this.versamento = versamento; - this.rispostaWs = rispostaWs; - this.rispostaControlli = new RispostaControlli(); - } - - public void parseXML(SyncFakeSessn sessione) { - // istanzia la classe di verifica retrocompatibilità + public void parseXML(SyncFakeSessn sessione, UpdVersamentoExt versamento, RispostaWSUpdVers rispostaWs) { + // istanzia la classe di verifica retrocompatibilit� VerificaVersione tmpVerificaVersione = new VerificaVersione(); VerificaVersione.EsitiVerfica tmpEsitiVerfica; CompRapportoUpdVers myEsito = rispostaWs.getCompRapportoUpdVers(); StringReader tmpReader; - parsedIndiceUpd = null; + // l'istanza dell'indice SIP di aggiornamento + IndiceSIPAggiornamentoUnitaDocumentaria parsedIndiceUpd = null; + // + CSVersatore tagCSVersatore = new CSVersatore(); + CSChiave tagCSChiave = new CSChiave(); + String descChiaveUD = ""; + // a priori, un problema in questo punto provoca il fallimento completo del versamento rispostaWs.setStatoSessioneVersamento(IRispostaWS.StatiSessioneVersEnum.ERRATA); - // recupera l'ejb singleton, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - xmlUpdVersCache = (XmlUpdVersCache) new InitialContext().lookup("java:module/XmlUpdVersCache"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB singleton XMLContext " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB singleton XMLContext ", ex); - } - } - - // recupera l'ejb dei controlli, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliSemantici = (ControlliSemantici) new InitialContext().lookup("java:module/ControlliSemantici"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB dei controlli semantici " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB dei controlli semantici ", ex); - } - } - - // recupera l'ejb dell'autenticazione, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - controlliEjb = (ControlliWS) new InitialContext().lookup("java:module/ControlliWS"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB di verifica delle autorizzazioni " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB di verifica delle autorizzazioni ", ex); - } - } - - // recupera l'ejb C14N, se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - rapportoVersBuilder = (RapportoVersBuilder) new InitialContext() - .lookup("java:module/RapportoVersBuilder"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB RapportoVersBuilder " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB RapportoVersBuilder ", ex); - } - } - - // recupera l'ejb per i controlli se possibile - altrimenti segnala errore - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - updVersamentoControlli = (ControlliUpdVersamento) new InitialContext() - .lookup("java:module/ControlliUpdVersamento"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB ControlliUpdVersamento " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB ControlliUpdVersamento ", ex); - } - } - - // recupera l'ejb per il recupero delle configurazioni applicative - if (rispostaWs.getSeverity() == SeverityEnum.OK) { - try { - configurationHelper = (ConfigurationHelper) new InitialContext() - .lookup("java:module/ConfigurationHelper"); - } catch (NamingException ex) { - rispostaWs.setSeverity(SeverityEnum.ERROR); - rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, - "Errore nel recupero dell'EJB ConfigurationHelper " + ex.getMessage()); - log.error("Errore nel recupero dell'EJB ConfigurationHelper ", ex); - } - } - /* * produco la versione canonicalizzata del SIP. Gestisco l'eventuale errore relativo all'encoding indicato in * maniera errata (es. "ISO8859/1" oppure "utf8"), non rilevato dalla verifica precedente. @@ -164,7 +103,7 @@ public void parseXML(SyncFakeSessn sessione) { versamento .addControlloOkOnGenerali(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_GENERALI_XMLVSXSD)); - rispostaControlli = rapportoVersBuilder.canonicalizzaDaSalvareIndiceSip(sessione); + RispostaControlli rispostaControlli = rapportoVersBuilder.canonicalizzaDaSalvareIndiceSip(sessione); if (!rispostaControlli.isrBoolean()) { rispostaWs.setSeverity(SeverityEnum.ERROR); @@ -187,14 +126,16 @@ public void parseXML(SyncFakeSessn sessione) { try { JAXBContext tmpcontesto = xmlUpdVersCache.getVersReqCtxforAggiornamentoUD(); Schema schema = xmlUpdVersCache.getSchemaOfAggVersReq(); + Unmarshaller unmarshaller = tmpcontesto.createUnmarshaller(); unmarshaller.setSchema(schema); unmarshaller.setEventHandler(tmpVEventHandler); parsedIndiceUpd = (IndiceSIPAggiornamentoUnitaDocumentaria) unmarshaller.unmarshal(tmpReader); + versamento.setVersamento(parsedIndiceUpd); log.debug("validazione XML OK"); // memorizzo la tupla che descrive il versatore non ancora verificato. - // in caso di versanento errato, ho già pronti i dati da salvare nella + // in caso di versanento errato, ho gi� pronti i dati da salvare nella // sessione errata. tagCSVersatore.setAmbiente( parsedIndiceUpd.getUnitaDocumentaria().getIntestazione().getVersatore().getAmbiente()); @@ -204,7 +145,7 @@ public void parseXML(SyncFakeSessn sessione) { parsedIndiceUpd.getUnitaDocumentaria().getIntestazione().getVersatore().getStruttura()); // new URN String sistemaConservazione = configurationHelper - .getParamApplicValue(ParametroApplDB.NM_SISTEMACONSERVAZIONE); + .getValoreParamApplicByApplic(ParametroApplDB.NM_SISTEMACONSERVAZIONE); tagCSVersatore.setSistemaConservazione(sistemaConservazione); versamento.getStrutturaUpdVers().setVersatoreNonverificato(tagCSVersatore); @@ -245,10 +186,10 @@ public void parseXML(SyncFakeSessn sessione) { String msg = null; if (ex.getMessage() != null && !ex.getMessage().isEmpty()) { msg = "Impossibile convalidare il documento XML SIP: " + ex.getMessage(); - log.debug("Eccezione: " + ex.getMessage()); + log.debug("Eccezione: {}", ex.getMessage()); } else { msg = tmpVEventHandler.getMessaggio(); - log.debug("Messaggio del validatore: " + tmpVEventHandler.getMessaggio()); + log.debug("Messaggio del validatore: {}", tmpVEventHandler.getMessaggio()); } rispostaWs.setSeverity(SeverityEnum.ERROR); @@ -280,7 +221,7 @@ public void parseXML(SyncFakeSessn sessione) { // sula struttura del versamento basati sulla versione // dichiarata. Gli errori verranno censiti some "errori XSD". // //////////////////////////////////////////////////////////// - // verifica se la struttura della chiamata al ws è coerente con la versione dichiarata + // verifica se la struttura della chiamata al ws � coerente con la versione dichiarata if (rispostaWs.getSeverity() == SeverityEnum.OK) { tmpVerificaVersione.verifica(rispostaWs, versamento); tmpEsitiVerfica = tmpVerificaVersione.getEsitiVerfica(); @@ -295,21 +236,16 @@ public void parseXML(SyncFakeSessn sessione) { TipiEsitoErrore.NEGATIVO, tmpEsitiVerfica.getCodErrore(), tmpEsitiVerfica.getMessaggio()); } - if (tmpEsitiVerfica.isFlgWarning()) { - // rispostaWs.setSeverity(SeverityEnum.WARNING); - // rispostaWs.setEsitoWsError(tmpEsitiVerfica.getCodErrore(), tmpEsitiVerfica.getMessaggio()); - // myEsito.getEsitoXSD().setCodiceEsito(ECEsitoPosNegWarType.WARNING); - } } - // se l'unmarshalling è andato bene + // se l'unmarshalling � andato bene // imposta il flag globale di simulazione scrittura // preparo la risposta relativa alla configurazione SIP if (rispostaWs.getSeverity() == SeverityEnum.OK) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); - // verifica cosa dovrà essere aggiornato e quindi controllato all'interno dell'XML + // verifica cosa dovr� essere aggiornato e quindi controllato all'interno dell'XML // - this.initElementiDaAggiornare(); + this.initElementiDaAggiornare(versamento); // if (versamento.getVersamento().getParametriAggiornamento() != null) { @@ -396,7 +332,7 @@ public void parseXML(SyncFakeSessn sessione) { // MEV#23176 if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { // prepara risposta con urn sip - this.buildUrnSipOnEsito(myEsito); + this.buildUrnSipOnEsito(myEsito, versamento); } // end MEV#23176 @@ -414,33 +350,33 @@ public void parseXML(SyncFakeSessn sessione) { // sula struttura del versamento basati sulla versione // dichiarata. Gli errori verranno censiti some "errori XSD". // //////////////////////////////////////////////////////////// - prosegui = this.controllaUnivocitaDocIDs(); + prosegui = this.controllaUnivocitaDocIDs(versamento, rispostaWs); // tipo aggiornamento if (prosegui) { - prosegui = this.controllaTipoAggiornamento(); + prosegui = this.controllaTipoAggiornamento(versamento, rispostaWs); } // versione XSD if (prosegui) { - prosegui = this.controllaVersioneXSD(); + prosegui = this.controllaVersioneXSD(versamento, rispostaWs); } // se ho passato la verifica strutturale... // verifica la struttura versante e utente if (prosegui) { - prosegui = this.controllaStrutturaVersatore(); + prosegui = this.controllaStrutturaVersatore(versamento, rispostaWs, tagCSVersatore, descChiaveUD); } - // nota: comunque vada, da qui in poi la sessione non può essere più DUBBIA - // (può essere solo OK, FALLITA oppure ERRATA) perché ho tutti gli elementi per memorizzare - // una sessione fallita: id struttura, id tipo fascicolo e chiave, che è certamente + // nota: comunque vada, da qui in poi la sessione non pu� essere pi� DUBBIA + // (pu� essere solo OK, FALLITA oppure ERRATA) perch� ho tutti gli elementi per memorizzare + // una sessione fallita: id struttura, id tipo fascicolo e chiave, che � certamente // valorizzata in quanto ho superato la verifica XSD. // // Predispongo lo stato della sessione a FALLITA, in via precauzionale. - // in caso di verifica positiva dei metadati, porterò questo valore a OK + // in caso di verifica positiva dei metadati, porter� questo valore a OK - // se il versatore alla fine è ok e la struttura è utilizzabile, lo scrivo + // se il versatore alla fine � ok e la struttura � utilizzabile, lo scrivo if (prosegui) { versamento.getStrutturaUpdVers().setVersatoreVerificato(true); rispostaWs.setStatoSessioneVersamento(IRispostaWS.StatiSessioneVersEnum.FALLITA); @@ -448,62 +384,68 @@ public void parseXML(SyncFakeSessn sessione) { // verifico la chiave (se esito struttura positivo - vedi ultimo controllo eseguito) if (prosegui) { - super.controlloChiaveECdKeyNorm(); + super.controlloChiaveECdKeyNorm(versamento, rispostaWs, tagCSChiave, descChiaveUD); } // controlliXSD = POSITVO && controlliIntestazione = POSITVO (controlli generali) -> prosegui - prosegui = this.verificaControlliGenerali(); + prosegui = this.verificaControlliGenerali(versamento); // verifico l'hash del SIP che sto versando if (prosegui) { - prosegui = super.controllaHashSIP(sessione); + prosegui = super.controllaHashSIP(sessione, versamento, rispostaWs, descChiaveUD); } // verifico tipo UD + recupero flag if (prosegui) { - prosegui = super.checkTipoUDAndAbilUpdMeta(myEsito); + prosegui = super.checkTipoUDAndAbilUpdMeta(myEsito, versamento, rispostaWs, descChiaveUD); } // verifico abilitazione utente su REG+tipo UD if (prosegui) { - prosegui = super.controllaAbilUserRegTipoUD(); + prosegui = super.controllaAbilUserRegTipoUD(versamento, rispostaWs); } // verifico tipo conservazione if (prosegui) { - prosegui = super.controllaStatoConservazione(); + prosegui = super.controllaStatoConservazione(versamento, rispostaWs, descChiaveUD); } // prossimi controlli sulla base degli elementi presenti su SIP // se trovati documenti collegati if (prosegui && versamento.hasDocumentiCollegatiToUpd()) { - prosegui = super.controllaCollegamenti(myEsito); + prosegui = super.controllaCollegamenti(myEsito, versamento, rispostaWs); } // se trovato profilo UD if (prosegui && versamento.hasProfiloUnitaDocumentariaToUpd()) { - prosegui = super.controllaProfiloUnitaDocumentaria(); + prosegui = super.controllaProfiloUnitaDocumentaria(versamento, rispostaWs, descChiaveUD); + } + + // se trovato profilo UD + if ((prosegui && versamento.hasProfiloNormativoToUpd()) + && versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_PROFILI_UPD_1_6)) { + prosegui = super.controllaProfiloNormativo(versamento, rispostaWs); } // se trovati dati specifici if (prosegui && versamento.hasDatiSpecificiToBeUpdated()) { - prosegui = super.controllaDatiSpecifici(); + prosegui = super.controllaDatiSpecifici(versamento, rispostaWs, descChiaveUD); } // se trovati dati specifici di migrazione if (prosegui && versamento.hasDatiSpecificiMigrazioneToUpd()) { - prosegui = super.controllaDatiSpeificiMig(); + prosegui = super.controllaDatiSpeificiMig(versamento, rispostaWs, descChiaveUD); } // se fascicolo principale non da aggiornare -> verifica dei secondari if (prosegui && versamento.hasPAFascicoliSecondariToUp() && !versamento.hasPAFascicoloPrincipaleToUpd()) { - prosegui = super.controllaFascicoliSecondari(); + prosegui = super.controllaFascicoliSecondari(versamento, rispostaWs); } // se trovati documenti if (prosegui && versamento.hasDocumentiToUpd()) { - super.controllaDocumenti(myEsito); + super.controllaDocumenti(myEsito, versamento, rispostaWs); } @@ -515,7 +457,7 @@ public void parseXML(SyncFakeSessn sessione) { if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { rispostaWs.setStatoSessioneVersamento(IRispostaWS.StatiSessioneVersEnum.OK); // - this.initAggiornamentiDaEffettuare(); + this.initAggiornamentiDaEffettuare(versamento); } } @@ -524,7 +466,7 @@ public void parseXML(SyncFakeSessn sessione) { * * @return true/false con risultato dei controlli generali */ - private boolean verificaControlliGenerali() { + private boolean verificaControlliGenerali(UpdVersamentoExt versamento) { boolean hasOneError = false; hasOneError = versamento.anyMatchEsitoControlli( versamento.getControlliDiSistema().stream().collect(Collectors.toList()), @@ -535,7 +477,7 @@ private boolean verificaControlliGenerali() { return !hasOneError; } - private void initElementiDaAggiornare() { + private void initElementiDaAggiornare(UpdVersamentoExt versamento) { // ProfiloArchivistico versamento.setHasProfiloArchivisticoToUpd( versamento.getVersamento().getUnitaDocumentaria().getProfiloArchivistico() != null); @@ -552,6 +494,9 @@ private void initElementiDaAggiornare() { // ProfiloUnitaDocumentaria versamento.setHasProfiloUnitaDocumentariaToUpd( versamento.getVersamento().getUnitaDocumentaria().getProfiloUnitaDocumentaria() != null); + // ProfiloNormativo + versamento.setHasProfiloNormativoToUpd( + versamento.getVersamento().getUnitaDocumentaria().getProfiloNormativo() != null); // DatiSpecifici versamento.setHasDatiSpecificiToBeUpdated( versamento.getVersamento().getUnitaDocumentaria().getDatiSpecifici() != null); @@ -578,22 +523,22 @@ private void initElementiDaAggiornare() { } - private void initAggiornamentiDaEffettuare() { + private void initAggiornamentiDaEffettuare(UpdVersamentoExt versamento) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); // - this.aggiornamentiUnitaDoc(strutturaUpdVers); + this.aggiornamentiUnitaDoc(strutturaUpdVers, versamento); // - this.aggiornamentiDocumenti(strutturaUpdVers, CategoriaDocumento.Principale); + this.aggiornamentiDocumenti(strutturaUpdVers, CategoriaDocumento.Principale, versamento); // - this.aggiornamentiDocumenti(strutturaUpdVers, CategoriaDocumento.Allegato); + this.aggiornamentiDocumenti(strutturaUpdVers, CategoriaDocumento.Allegato, versamento); // - this.aggiornamentiDocumenti(strutturaUpdVers, CategoriaDocumento.Annesso); + this.aggiornamentiDocumenti(strutturaUpdVers, CategoriaDocumento.Annesso, versamento); // - this.aggiornamentiDocumenti(strutturaUpdVers, CategoriaDocumento.Annotazione); + this.aggiornamentiDocumenti(strutturaUpdVers, CategoriaDocumento.Annotazione, versamento); } - private void aggiornamentiUnitaDoc(StrutturaUpdVers strutturaUpdVers) { + private void aggiornamentiUnitaDoc(StrutturaUpdVers strutturaUpdVers, UpdVersamentoExt versamento) { if (versamento.hasProfiloArchivisticoToUpd()) { if (versamento.hasPAFascicoloPrincipaleToUpd()) { versamento.addAggiornamentoUnitaDocumentaria(AggiornamentoEffettuato.HASPAFASCICOLOPRINCIPALETOUPD); @@ -607,6 +552,10 @@ private void aggiornamentiUnitaDoc(StrutturaUpdVers strutturaUpdVers) { versamento.addAggiornamentoUnitaDocumentaria(AggiornamentoEffettuato.HASPROFILOUNITADOCUMENTARIATOUPD); } // + if (versamento.hasProfiloNormativoToUpd()) { + versamento.addAggiornamentoUnitaDocumentaria(AggiornamentoEffettuato.HASPROFILONORMATIVOTOUPD); + } + // if (versamento.hasDocumentiCollegatiToUpd()) { versamento.addAggiornamentoUnitaDocumentaria(AggiornamentoEffettuato.HASDOCUMENTICOLLEGATITOUPD); } @@ -627,7 +576,8 @@ private void aggiornamentiUnitaDoc(StrutturaUpdVers strutturaUpdVers) { } } - private void aggiornamentiDocumenti(StrutturaUpdVers strutturaUpdVers, CategoriaDocumento catDoc) { + private void aggiornamentiDocumenti(StrutturaUpdVers strutturaUpdVers, CategoriaDocumento catDoc, + UpdVersamentoExt versamento) { for (UpdDocumentoVers documento : strutturaUpdVers.getDocumentiAttesi().stream() .filter(d -> d.getCategoriaDoc().equals(catDoc)).collect(Collectors.toList())) { // @@ -672,7 +622,7 @@ private void aggiornamentiDocumenti(StrutturaUpdVers strutturaUpdVers, Categoria /** * @param myEsito */ - private void buildUrnSipOnEsito(CompRapportoUpdVers myEsito) { + private void buildUrnSipOnEsito(CompRapportoUpdVers myEsito, UpdVersamentoExt versamento) { if (versamento.getModificatoriWSCalc().contains(ModificatoriWS.TAG_URN_SIP_1_5)) { // diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/AbsUpdVersamentoExt.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/AbsUpdVersamentoExt.java index cec3fd9..830a73d 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/AbsUpdVersamentoExt.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/AbsUpdVersamentoExt.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/IAggiornamentiWsMultipli.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/IAggiornamentiWsMultipli.java index 4743865..116ec81 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/IAggiornamentiWsMultipli.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/IAggiornamentiWsMultipli.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.ws.versamentoUpd.ext; import java.util.Map; @@ -66,4 +83,4 @@ public interface IAggiornamentiWsMultipli { void addAggiornamentoCompAnnotazioni(AggiornamentoEffettuato aggiornamento, String key); -} \ No newline at end of file +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/IControlliWsMultipli.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/IControlliWsMultipli.java index 471e2c9..83c2b3e 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/IControlliWsMultipli.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/IControlliWsMultipli.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -20,9 +37,9 @@ import it.eng.parer.ws.versamento.dto.VoceDiErrore; import it.eng.parer.ws.versamento.dto.VoceDiErrore.TipiEsitoErrore; import it.eng.parer.ws.versamentoUpd.dto.ControlloEseguito; +import it.eng.parer.ws.versamentoUpd.dto.ControlloEseguito.FamigliaControllo; import it.eng.parer.ws.versamentoUpd.dto.ControlloWSResp; import it.eng.parer.ws.versamentoUpd.dto.RispostaWSUpdVers; -import it.eng.parer.ws.versamentoUpd.dto.ControlloEseguito.FamigliaControllo; import it.eng.parer.ws.xml.versUpdResp.CodiceEsitoType; import it.eng.parer.ws.xml.versUpdResp.ControlliFallitiUlterioriType; import it.eng.parer.ws.xml.versUpdResp.ControlliType; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/IUpdVersamentoExt.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/IUpdVersamentoExt.java index b5d31e0..f70efb3 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/IUpdVersamentoExt.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/IUpdVersamentoExt.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/UpdVersamentoExt.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/UpdVersamentoExt.java index 181ed71..83ef052 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/UpdVersamentoExt.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ext/UpdVersamentoExt.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -53,6 +70,7 @@ public class UpdVersamentoExt extends AbsUpdVersamentoExt { private boolean hasPAFascicoloPrincipaleToUpd = hasProfiloArchivisticoToUpd && false; private boolean hasPAFascicoliSecondariToUp = hasProfiloArchivisticoToUpd && false; private boolean hasProfiloUnitaDocumentariaToUpd = false; + private boolean hasProfiloNormativoToUpd = false; private boolean hasDatiSpecificiToBeUpdated = false; private boolean hasDatiSpecificiMigrazioneToUpd = false; private boolean hasDocumentiCollegatiToUpd = false;// NumeroAllegati, NumeroAnnessi, NumeroAnnotazioni @@ -124,9 +142,12 @@ public RispostaControlli checkVersioneRequest(String versione) { // MEV#23176 this.modificatoriWS.add(Costanti.ModificatoriWS.TAG_URN_SIP_1_5); // end MEV#23176 + // MEV#28309 + this.modificatoriWS.add(Costanti.ModificatoriWS.TAG_DATISPEC_DEL_1_6); + // MEV#26423 + this.modificatoriWS.add(Costanti.ModificatoriWS.TAG_PROFILI_UPD_1_6); break; } - return rispostaControlli; } @@ -266,6 +287,14 @@ public void setHasAllProfiloDocumentoToUpd(boolean hasAllProfiloDocumentoToUpd) this.hasAllProfiloDocumentoToUpd = hasAllProfiloDocumentoToUpd; } + public boolean hasProfiloNormativoToUpd() { + return hasProfiloNormativoToUpd; + } + + public void setHasProfiloNormativoToUpd(boolean hasProfiloNormativoToUpd) { + this.hasProfiloNormativoToUpd = hasProfiloNormativoToUpd; + } + public boolean hasAllDatiSpecificiToUpd() { return hasAllDatiSpecificiToUpd; } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/UpdExecutePrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/UpdExecutePrsr.java deleted file mode 100644 index 7401484..0000000 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/UpdExecutePrsr.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package it.eng.parer.ws.versamentoUpd.prsr; - -import it.eng.parer.ws.versamentoUpd.prsr.strategy.IUpdStrategyPrsr; - -/* - * Classe di supporto per l'esecuzione del parsing attraverso una strategia specifica - * A) verifica/parsing dei collegamenti - * B) - su id documenti - * C) .... conteggio documenti - */ -public class UpdExecutePrsr { - - /* - * TODO: per il momento "l'esecutore" prevede attraverso una "strategia" di controllo l'esecuzione dei controlli - * previsti per quell'implementazione - */ - public boolean eseguiControlli(IUpdStrategyPrsr strategy) { - return strategy.eseguiControlli(); - } - -} \ No newline at end of file diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/IUpdStrategyPrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/IUpdStrategyPrsr.java deleted file mode 100644 index 25b7961..0000000 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/prsr/strategy/IUpdStrategyPrsr.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package it.eng.parer.ws.versamentoUpd.prsr.strategy; - -public interface IUpdStrategyPrsr { - - public boolean eseguiControlli(); - -} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/IRispostaUpdVersWS.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/IRispostaUpdVersWS.java index 004dd3a..323e52c 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/IRispostaUpdVersWS.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/IRispostaUpdVersWS.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/UpdCostanti.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/UpdCostanti.java index 809b9c2..c05d0e2 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/UpdCostanti.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/UpdCostanti.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -68,6 +85,7 @@ public enum AggiornamentoEffettuato { HASPAFASCICOLOPRINCIPALETOUPD("Profilo archivistico – fascicolo principale", new BigDecimal(1)), /**/ HASPAFASCICOLISECONDARITOUP("Profilo archivistico – fascicoli secondari", new BigDecimal(2)), /**/ HASPROFILOUNITADOCUMENTARIATOUPD("Profilo unita' documentaria", new BigDecimal(3)), /**/ + HASPROFILONORMATIVOTOUPD("Profilo normativo", new BigDecimal(1)), /**/ HASDOCUMENTICOLLEGATITOUPD("Collegamenti ad unita' documentarie", new BigDecimal(4)), /**/ HASDATISPECIFICITOBEUPDATED("Dati specifici dell'unita' documentaria", new BigDecimal(5)), /**/ HASDATISPECIFICIMIGRAZIONETOUPD("Dati specifici di migrazione dell’unità documentaria", new BigDecimal(6)), /**/ diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/UpdDocumentiUtils.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/UpdDocumentiUtils.java index c085883..db68748 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/UpdDocumentiUtils.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/UpdDocumentiUtils.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -77,4 +94,4 @@ public static Enum convertEnumTipiUsoDatiSpec(boolean jpaEnum, String tipiUso } } -} \ No newline at end of file +} diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/UpdGestioneDatiSpec.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/UpdGestioneDatiSpec.java index cfbff2d..ce2bba3 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/UpdGestioneDatiSpec.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/UpdGestioneDatiSpec.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -28,6 +45,7 @@ import it.eng.parer.ws.dto.RispostaControlli; import it.eng.parer.ws.ejb.ControlliSemantici; import it.eng.parer.ws.ejb.XmlUpdVersCache; +import it.eng.parer.ws.utils.Costanti; import it.eng.parer.ws.utils.CostantiDB.TipiEntitaSacer; import it.eng.parer.ws.utils.CostantiDB.TipiUsoDatiSpec; import it.eng.parer.ws.utils.MessaggiWSBundle; @@ -36,6 +54,8 @@ import it.eng.parer.ws.versamento.dto.RispostaControlliAttSpec; import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; import it.eng.parer.ws.xml.versUpdReq.DatiSpecificiType; +import java.util.EnumSet; +import it.eng.parer.ws.utils.Costanti.ModificatoriWS; public class UpdGestioneDatiSpec { @@ -48,10 +68,12 @@ public class UpdGestioneDatiSpec { private ControlliSemantici controlliSemantici = null; // singleton ejb di gestione cache dei parser Castor private XmlUpdVersCache xmlVersCache = null; + private EnumSet modificatoriWS = EnumSet.noneOf(Costanti.ModificatoriWS.class); public UpdGestioneDatiSpec(UpdVersamentoExt versamento) { this.sistemaDiMigrazione = versamento.getStrutturaUpdVers().getSistemaDiMigrazione(); this.idStruttura = versamento.getStrutturaUpdVers().getIdStruttura(); + this.modificatoriWS = versamento.getModificatoriWSCalc(); } public RispostaControlliAttSpec parseDatiSpec(TipiEntitaSacer tipoEntita, @@ -90,12 +112,12 @@ public RispostaControlliAttSpec parseDatiSpec(TipiEntitaSacer tipoEntita, log.error("Errore nel recupero dell'EJB singleton XMLContext ", ex); return rispostaControlliAttSpec; } - + // verifica che esistano dati specifici attesi per idTipoEntita + tipoentita + // alla data corrente + rispostaControlli = controlliSemantici.checkPresenzaDatiSpec(TipiUsoDatiSpec.VERS, tipoEntita, + this.sistemaDiMigrazione, this.idStruttura, idTipoElemento, tmpIstanteCorrente); if (datiSpecificiElement == null || datiSpecificiElement.isNil()) { - // verifica che esistano dati specifici attesi per idTipoEntita + tipoentita - // alla data corrente - rispostaControlli = controlliSemantici.checkPresenzaDatiSpec(TipiUsoDatiSpec.VERS, tipoEntita, - this.sistemaDiMigrazione, this.idStruttura, idTipoElemento, tmpIstanteCorrente); + if (rispostaControlli.getCodErr() != null)/* 666 */ { // è un errore grave ... rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); @@ -115,161 +137,184 @@ public RispostaControlliAttSpec parseDatiSpec(TipiEntitaSacer tipoEntita, } else { datiSpecifici = datiSpecificiElement.getValue(); versione = datiSpecifici.getVersioneDatiSpecifici(); - - // NOTA: questo errore non può essere mai restituito perché il tag - // VersioneDatiSpecifici è definito - // nell'XSD principale del versamento come stringa avente lunghezza minima di 1 - // char - // - // if (versione == null || "".equals(versione)) { - // //Errore nella verifica dei dati specifici. La versione dei dati specifici è - // obbligatoria. - // this.setRispostaError(MessaggiWSBundle.DATISPEC_001_003, - // MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_001_003, - // tipoEntita.descrivi(), desElemento, desTipoElemento)); - // return; - // } - rispostaControlli = controlliSemantici.checkXSDDatiSpec(TipiUsoDatiSpec.VERS, tipoEntita, - this.sistemaDiMigrazione, this.idStruttura, idTipoElemento, tmpIstanteCorrente, versione); - if (rispostaControlli.getCodErr() != null) { - // è un errore grave ... - rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); - rispostaControlliAttSpec.setDsErr(rispostaControlli.getDsErr()); - rispostaControlliAttSpec.setrBoolean(false); - return rispostaControlliAttSpec; - } - - if (rispostaControlli.getrString() == null || rispostaControlli.getrString().length() == 0) { - // errore, perché non ha trovato il validatore dei dati specifici per il tipo - // doc e versione indicato - // cerco se per caso quella versione di dati spec esiste ma è disattivata - RispostaControlli rc = controlliSemantici.checkPresenzaVersioneDatiSpec(TipiUsoDatiSpec.VERS, - tipoEntita, this.sistemaDiMigrazione, this.idStruttura, idTipoElemento, versione); - if (rc.getCodErr() != null) { + if (this.modificatoriWS.contains(ModificatoriWS.TAG_DATISPEC_DEL_1_6) + && (versione == null || versione.trim().isEmpty())) { + if (rispostaControlli.getCodErr() != null)/* 666 */ { // è un errore grave ... rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); rispostaControlliAttSpec.setDsErr(rispostaControlli.getDsErr()); rispostaControlliAttSpec.setrBoolean(false); return rispostaControlliAttSpec; + } - if (rc.isrBoolean()) { - // la versione è disattivata - // errore, perché non ha inserito il tag datispecifici e questo era richiesto - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_001_004); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_001_004, - tipoEntita.descrivi(), desElemento, versione, desTipoElemento)); + if (rispostaControlli.isrBoolean()) { + // errore, perché eliminazione non è consentita, poiche esistono versioni attive alla data corrente + // TODO ADD CONTROLLO + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_001_002); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_001_002, + tipoEntita.descrivi(), desElemento, desTipoElemento)); rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; } else { - // Errore nella verifica dei dati specifici. - // Non sono ammissibili dati per il tipo elemento e la versione indicati. - // errore, perché non ha inserito il tag datispecifici e DATISPEC_001_001 era richiesto - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_001_001); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_001_001, - tipoEntita.descrivi(), desElemento, versione, desTipoElemento)); + // Se l'elemento DatiSpecifici esite per l'UD e viene passato con solo l'elemento versione vuoto + // può essere eliminato poichè non esistono versioni attive alla data corrente + rispostaControlli.setrLong(0); + rispostaControlli.setrBoolean(true); + // impostazione dell'Id dell'Xsd + rispostaControlliAttSpec.setIdRecXsdDatiSpec(rispostaControlli.getrLong()); + rispostaControlliAttSpec.setrBoolean(true); + return rispostaControlliAttSpec; + } + } else { + rispostaControlli = controlliSemantici.checkXSDDatiSpec(TipiUsoDatiSpec.VERS, tipoEntita, + this.sistemaDiMigrazione, this.idStruttura, idTipoElemento, tmpIstanteCorrente, versione); + if (rispostaControlli.getCodErr() != null) { + // è un errore grave ... + rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); + rispostaControlliAttSpec.setDsErr(rispostaControlli.getDsErr()); rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; } - return rispostaControlliAttSpec; - } - tmpIdVersioneXsd = rispostaControlli.getrLong(); - - // compilazione schema - // 1. Lookup a factory for the W3C XML Schema language - tmpSchemaFactoryValidazSpec = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); - // anche in questo caso l'eccezione non deve mai verificarsi, a meno di non aver - // caricato - // nel database un xsd danneggiato... - try { - // 2. Compile the schema. - tmpSchemaValidazSpec = tmpSchemaFactoryValidazSpec - .newSchema(new StreamSource(new StringReader(rispostaControlli.getrString()))); - } catch (SAXException e) { - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "AggGestioneDatiSpec.parseDatiSpec.il validatore xsd specifico è errato: " + e.getMessage())); - rispostaControlliAttSpec.setrBoolean(false); - log.error( - "Errore interno: il validatore xsd specifico è errato. Eccezione: " + e.getLocalizedMessage()); - return rispostaControlliAttSpec; - } + if (rispostaControlli.getrString() == null || rispostaControlli.getrString().length() == 0) { + // errore, perché non ha trovato il validatore dei dati specifici per il tipo + // doc e versione indicato + // cerco se per caso quella versione di dati spec esiste ma è disattivata + RispostaControlli rc = controlliSemantici.checkPresenzaVersioneDatiSpec(TipiUsoDatiSpec.VERS, + tipoEntita, this.sistemaDiMigrazione, this.idStruttura, idTipoElemento, versione); + if (rc.getCodErr() != null) { + // è un errore grave ... + rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); + rispostaControlliAttSpec.setDsErr(rispostaControlli.getDsErr()); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + if (rc.isrBoolean()) { + // errore, perché la versione di dati specifici indicata è disattiva, quindi non modificabile + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_001_004); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_001_004, + tipoEntita.descrivi(), desElemento, versione, desTipoElemento)); + rispostaControlliAttSpec.setrBoolean(false); - XmlValidationEventHandler handler = new XmlValidationEventHandler(); - try { - Marshaller m = xmlVersCache.getVersReqCtxforDatiSpecifici().createMarshaller(); - m.setSchema(tmpSchemaValidazSpec); - m.setEventHandler(handler); - // 3. Marshall and validate - m.marshal(datiSpecificiElement, new StringWriter()); - } catch (JAXBException e) { - ValidationEvent events = handler.getFirstErrorValidationEvent(); - - // Errore nella verifica dei dati specifici. - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_003_001); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_003_001, - tipoEntita.descrivi(), desElemento, events.getMessage())); - rispostaControlliAttSpec.setrBoolean(false); - return rispostaControlliAttSpec; - } catch (Exception e) { - // anche in questo caso l'eccezione non deve mai verificarsi - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "UpdGestioneDatiSpec.parseDatiSpec.problemi nella validazione dei dati spec: " - + e.getMessage())); - rispostaControlliAttSpec.setrBoolean(false); - log.error("Errore interno: problemi nella validazione dei dati spec. Eccezione: ", e); - return rispostaControlliAttSpec; - } + } else { + // Errore nella verifica dei dati specifici. + // Non sono ammissibili dati per il tipo elemento e la versione indicati. + // errore, perché non ha inserito il tag datispecifici e DATISPEC_001_001 era richiesto + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_001_001); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_001_001, + tipoEntita.descrivi(), desElemento, versione, desTipoElemento)); + rispostaControlliAttSpec.setrBoolean(false); + } + return rispostaControlliAttSpec; + } - // leggi la tabella dei dati spec attesi - rispostaControlliAttSpec = controlliSemantici.checkDatiSpecifici(TipiUsoDatiSpec.VERS, tipoEntita, - this.sistemaDiMigrazione, this.idStruttura, idTipoElemento, tmpIdVersioneXsd); - if (rispostaControlliAttSpec.getCodErr() != null) { - rispostaControlliAttSpec.setrBoolean(false); - return rispostaControlliAttSpec; - } + tmpIdVersioneXsd = rispostaControlli.getrLong(); + + // compilazione schema + // 1. Lookup a factory for the W3C XML Schema language + tmpSchemaFactoryValidazSpec = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + // anche in questo caso l'eccezione non deve mai verificarsi, a meno di non aver + // caricato + // nel database un xsd danneggiato... + try { + // 2. Compile the schema. + tmpSchemaValidazSpec = tmpSchemaFactoryValidazSpec + .newSchema(new StreamSource(new StringReader(rispostaControlli.getrString()))); + } catch (SAXException e) { + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "AggGestioneDatiSpec.parseDatiSpec.il validatore xsd specifico è errato: " + + e.getMessage())); + rispostaControlliAttSpec.setrBoolean(false); + log.error("Errore interno: il validatore xsd specifico è errato. Eccezione: " + + e.getLocalizedMessage()); + return rispostaControlliAttSpec; + } - // impostazione dell'Id dell'Xsd - rispostaControlliAttSpec.setIdRecXsdDatiSpec(tmpIdVersioneXsd); + XmlValidationEventHandler handler = new XmlValidationEventHandler(); + try { + Marshaller m = xmlVersCache.getVersReqCtxforDatiSpecifici().createMarshaller(); + m.setSchema(tmpSchemaValidazSpec); + m.setEventHandler(handler); + // 3. Marshall and validate + m.marshal(datiSpecificiElement, new StringWriter()); + } catch (JAXBException e) { + ValidationEvent events = handler.getFirstErrorValidationEvent(); - for (Element element : datiSpecifici.getAny()) { - String tmpChiave = element.getLocalName(); - tmpAttSpecAtteso = rispostaControlliAttSpec.getDatiSpecifici().get(tmpChiave); - if (tmpAttSpecAtteso != null) { - if (tmpAttSpecAtteso.getValore() == null) { + // Errore nella verifica dei dati specifici. + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_003_001); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_003_001, + tipoEntita.descrivi(), desElemento, events.getMessage())); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } catch (Exception e) { + // anche in questo caso l'eccezione non deve mai verificarsi + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "UpdGestioneDatiSpec.parseDatiSpec.problemi nella validazione dei dati spec: " + + e.getMessage())); + rispostaControlliAttSpec.setrBoolean(false); + log.error("Errore interno: problemi nella validazione dei dati spec. Eccezione: ", e); + return rispostaControlliAttSpec; + } - if (element.getFirstChild() != null) { - String tmpValore = element.getFirstChild().getNodeValue(); - if (tmpValore.length() <= UpdCostanti.MAXLEN_DATOSPEC) { - tmpAttSpecAtteso.setValore(tmpValore); + // leggi la tabella dei dati spec attesi + rispostaControlliAttSpec = controlliSemantici.checkDatiSpecifici(TipiUsoDatiSpec.VERS, tipoEntita, + this.sistemaDiMigrazione, this.idStruttura, idTipoElemento, tmpIdVersioneXsd); + if (rispostaControlliAttSpec.getCodErr() != null) { + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + + // impostazione dell'Id dell'Xsd + rispostaControlliAttSpec.setIdRecXsdDatiSpec(tmpIdVersioneXsd); + + for (Element element : datiSpecifici.getAny()) { + String tmpChiave = element.getLocalName(); + tmpAttSpecAtteso = rispostaControlliAttSpec.getDatiSpecifici().get(tmpChiave); + if (tmpAttSpecAtteso != null) { + if (tmpAttSpecAtteso.getValore() == null) { + + if (element.getFirstChild() != null) { + String tmpValore = element.getFirstChild().getNodeValue(); + if (tmpValore.length() <= UpdCostanti.MAXLEN_DATOSPEC) { + tmpAttSpecAtteso.setValore(tmpValore); + } else { + // "Errore nei dati specifici: uno o più valori superano + // la lunghezza di " + MAXLEN_DATOSPEC + " caratteri" + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_002_001); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString( + MessaggiWSBundle.DATISPEC_002_001, tipoEntita.descrivi(), desElemento, + tmpChiave, UpdCostanti.MAXLEN_DATOSPEC)); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } } else { - // "Errore nei dati specifici: uno o più valori superano - // la lunghezza di " + MAXLEN_DATOSPEC + " caratteri" - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_002_001); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString( - MessaggiWSBundle.DATISPEC_002_001, tipoEntita.descrivi(), desElemento, - tmpChiave, UpdCostanti.MAXLEN_DATOSPEC)); - rispostaControlliAttSpec.setrBoolean(false); - return rispostaControlliAttSpec; + tmpAttSpecAtteso.setValore(null); } } else { - tmpAttSpecAtteso.setValore(null); + // "Errore nei dati specifici: uno o più dati risultano duplicati"); + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_002_002); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString( + MessaggiWSBundle.DATISPEC_002_002, tipoEntita.descrivi(), desElemento, tmpChiave)); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; } } else { - // "Errore nei dati specifici: uno o più dati risultano duplicati"); - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_002_002); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_002_002, + // MAC#29906 - Correzione della mancata gestione dell'errore per dati specifici che non + // coincidono con l'XSD + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_003_002); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_003_002, tipoEntita.descrivi(), desElemento, tmpChiave)); + /* + * rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); + * rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + * "UpdGestioneDatiSpec.parseDatiSpec.i dati specifici attesi " + "non coincidono con l'XSD ")); + */ rispostaControlliAttSpec.setrBoolean(false); + log.error("Errore interno: i dati specifici attesi non coincidono con l'XSD"); return rispostaControlliAttSpec; } - } else { - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "UpdGestioneDatiSpec.parseDatiSpec.i dati specifici attesi " - + "non coincidono con l'XSD ")); - rispostaControlliAttSpec.setrBoolean(false); - log.error("Errore interno: i dati specifici attesi non coincidono con l'XSD"); - return rispostaControlliAttSpec; } } } @@ -326,158 +371,186 @@ public RispostaControlliAttSpec parseDatiSpecMig(TipiEntitaSacer tipoEntita, if (tmpSistMigDef) { datiSpecifici = datiSpecificiElement.getValue(); versione = datiSpecifici.getVersioneDatiSpecifici(); - - // NOTA: questo errore non può essere mai restituito perché il tag - // VersioneDatiSpecifici è definito - // nell'XSD principale del versamento come stringa avente lunghezza minima di 1 - // char - // - // if (versione == null || "".equals(versione)) { - // //Errore nella verifica dei dati specifici. La versione dei dati specifici è - // obbligatoria. - // this.setRispostaError(MessaggiWSBundle.DATISPECM_001_003, - // MessaggiWSBundle.getString(MessaggiWSBundle.DATISPECM_001_003, - // tipoEntita.descrivi(), desElemento, desTipoElemento)); - // return; - // } - rispostaControlli = controlliSemantici.checkXSDDatiSpec(TipiUsoDatiSpec.MIGRAZ, tipoEntita, - this.sistemaDiMigrazione, this.idStruttura, 0, tmpIstanteCorrente, versione); - if (rispostaControlli.getCodErr() != null) { - rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); - rispostaControlliAttSpec.setDsErr(rispostaControlli.getDsErr()); - rispostaControlliAttSpec.setrBoolean(false); - return rispostaControlliAttSpec; - } - - if (rispostaControlli.getrString() == null || rispostaControlli.getrString().length() == 0) { - // errore, perché non ha trovato il validatore dei dati specifici per il tipo - // doc e versione indicato - // cerco se per caso quella versione di dati spec esiste ma è disattivata - RispostaControlli rc = controlliSemantici.checkPresenzaVersioneDatiSpec(TipiUsoDatiSpec.MIGRAZ, - tipoEntita, this.sistemaDiMigrazione, this.idStruttura, 0, versione); - if (rc.getCodErr() != null) { + if (this.modificatoriWS.contains(ModificatoriWS.TAG_DATISPEC_DEL_1_6) + && (versione == null || versione.trim().isEmpty())) { + + // verifica che esistano dati specifici attesi per idTipoEntita + tipoentita + // alla data corrente + rispostaControlli = controlliSemantici.checkPresenzaDatiSpec(TipiUsoDatiSpec.MIGRAZ, tipoEntita, + this.sistemaDiMigrazione, this.idStruttura, idTipoElemento, tmpIstanteCorrente); + if (rispostaControlli.getCodErr() != null)/* 666 */ { + // è un errore grave ... rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); rispostaControlliAttSpec.setDsErr(rispostaControlli.getDsErr()); rispostaControlliAttSpec.setrBoolean(false); return rispostaControlliAttSpec; + } - if (rc.isrBoolean()) { - // la versione è disattivata - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_001_004); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_001_004, - tipoEntita.descrivi(), desElemento, versione, desTipoElemento)); + if (rispostaControlli.isrBoolean()) { + // errore, perché eliminazione non è consentita, poiche esistono versioni attive alla data corrente + // TODO ADD CONTROLLO + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_001_002); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPECM_001_002, + tipoEntita.descrivi(), desElemento, desTipoElemento)); rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; } else { - // Errore nella verifica dei dati specifici. - // Non sono ammissibili dati per il tipo elemento e la versione indicati. - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_001_001); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPECM_001_001, - tipoEntita.descrivi(), desElemento, versione, desTipoElemento)); + // Se l'elemento DatiSpecifici esite per l'UD e viene passato con solo l'elemento versione vuoto + // può essere eliminato poichè non esistono versioni attive alla data corrente + rispostaControlli.setrLong(0); + rispostaControlli.setrBoolean(true); + // impostazione dell'Id dell'Xsd + rispostaControlliAttSpec.setIdRecXsdDatiSpec(rispostaControlli.getrLong()); + rispostaControlliAttSpec.setrBoolean(true); + return rispostaControlliAttSpec; + } + + } else { + rispostaControlli = controlliSemantici.checkXSDDatiSpec(TipiUsoDatiSpec.MIGRAZ, tipoEntita, + this.sistemaDiMigrazione, this.idStruttura, 0, tmpIstanteCorrente, versione); + if (rispostaControlli.getCodErr() != null) { + rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); + rispostaControlliAttSpec.setDsErr(rispostaControlli.getDsErr()); rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; } - return rispostaControlliAttSpec; - } - tmpIdVersioneXsd = rispostaControlli.getrLong(); - - // compilazione schema - // 1. Lookup a factory for the W3C XML Schema language - tmpSchemaFactoryValidazSpec = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); - // anche in questo caso l'eccezione non deve mai verificarsi, a meno di non aver - // caricato - // nel database un xsd danneggiato... - try { - // 2. Compile the schema. - tmpSchemaValidazSpec = tmpSchemaFactoryValidazSpec - .newSchema(new StreamSource(new StringReader(rispostaControlli.getrString()))); - } catch (SAXException e) { - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "UpdGestioneDatiSpec.parseDatiSpecMig.il validatore xsd specifico è errato: " - + e.getMessage())); - rispostaControlliAttSpec.setrBoolean(false); - log.error("Errore interno: il validatore xsd di migrazione è errato. Eccezione: " - + e.getLocalizedMessage()); - return rispostaControlliAttSpec; - } + if (rispostaControlli.getrString() == null || rispostaControlli.getrString().length() == 0) { + // errore, perché non ha trovato il validatore dei dati specifici per il tipo + // doc e versione indicato + // cerco se per caso quella versione di dati spec esiste ma è disattivata + RispostaControlli rc = controlliSemantici.checkPresenzaVersioneDatiSpec(TipiUsoDatiSpec.MIGRAZ, + tipoEntita, this.sistemaDiMigrazione, this.idStruttura, 0, versione); + if (rc.getCodErr() != null) { + rispostaControlliAttSpec.setCodErr(rispostaControlli.getCodErr()); + rispostaControlliAttSpec.setDsErr(rispostaControlli.getDsErr()); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } + if (rc.isrBoolean()) { + // la versione è disattivata + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_001_004); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_001_004, + tipoEntita.descrivi(), desElemento, versione, desTipoElemento)); + rispostaControlliAttSpec.setrBoolean(false); + } else { + // Errore nella verifica dei dati specifici. + // Non sono ammissibili dati per il tipo elemento e la versione indicati. + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_001_001); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPECM_001_001, + tipoEntita.descrivi(), desElemento, versione, desTipoElemento)); + rispostaControlliAttSpec.setrBoolean(false); + } + return rispostaControlliAttSpec; + } - XmlValidationEventHandler handler = new XmlValidationEventHandler(); - try { - Marshaller m = xmlVersCache.getVersReqCtxforDatiSpecifici().createMarshaller(); - m.setSchema(tmpSchemaValidazSpec); - m.setEventHandler(handler); - // 3. Marshall and validate - m.marshal(datiSpecificiElement, new StringWriter()); - } catch (JAXBException e) { - ValidationEvent events = handler.getFirstErrorValidationEvent(); - - // Errore nella verifica dei dati specifici. - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_003_001); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPECM_003_001, - tipoEntita.descrivi(), desElemento, events.getMessage())); - rispostaControlliAttSpec.setrBoolean(false); - return rispostaControlliAttSpec; - } catch (Exception e) { - // anche in questo caso l'eccezione non deve mai verificarsi - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "UpdGestioneDatiSpec.parseDatiSpecMig.problemi nella validazione dei dati spec: " - + e.getMessage())); - rispostaControlliAttSpec.setrBoolean(false); - log.error("Errore interno: problemi nella validazione dei dati spec. di migrazione Eccezione: ", e); - return rispostaControlliAttSpec; - } + tmpIdVersioneXsd = rispostaControlli.getrLong(); + + // compilazione schema + // 1. Lookup a factory for the W3C XML Schema language + tmpSchemaFactoryValidazSpec = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + // anche in questo caso l'eccezione non deve mai verificarsi, a meno di non aver + // caricato + // nel database un xsd danneggiato... + try { + // 2. Compile the schema. + tmpSchemaValidazSpec = tmpSchemaFactoryValidazSpec + .newSchema(new StreamSource(new StringReader(rispostaControlli.getrString()))); + } catch (SAXException e) { + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "UpdGestioneDatiSpec.parseDatiSpecMig.il validatore xsd specifico è errato: " + + e.getMessage())); + rispostaControlliAttSpec.setrBoolean(false); + log.error("Errore interno: il validatore xsd di migrazione è errato. Eccezione: " + + e.getLocalizedMessage()); + return rispostaControlliAttSpec; + } - // leggi la tabella dei dati spec attesi - rispostaControlliAttSpec = controlliSemantici.checkDatiSpecifici(TipiUsoDatiSpec.MIGRAZ, tipoEntita, - this.sistemaDiMigrazione, this.idStruttura, 0, tmpIdVersioneXsd); - if (rispostaControlliAttSpec.getCodErr() != null) { - rispostaControlliAttSpec.setrBoolean(false); - return rispostaControlliAttSpec; - } + XmlValidationEventHandler handler = new XmlValidationEventHandler(); + try { + Marshaller m = xmlVersCache.getVersReqCtxforDatiSpecifici().createMarshaller(); + m.setSchema(tmpSchemaValidazSpec); + m.setEventHandler(handler); + // 3. Marshall and validate + m.marshal(datiSpecificiElement, new StringWriter()); + } catch (JAXBException e) { + ValidationEvent events = handler.getFirstErrorValidationEvent(); + + // Errore nella verifica dei dati specifici. + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_003_001); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPECM_003_001, + tipoEntita.descrivi(), desElemento, events.getMessage())); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } catch (Exception e) { + // anche in questo caso l'eccezione non deve mai verificarsi + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "UpdGestioneDatiSpec.parseDatiSpecMig.problemi nella validazione dei dati spec: " + + e.getMessage())); + rispostaControlliAttSpec.setrBoolean(false); + log.error("Errore interno: problemi nella validazione dei dati spec. di migrazione Eccezione: ", e); + return rispostaControlliAttSpec; + } + + // leggi la tabella dei dati spec attesi + rispostaControlliAttSpec = controlliSemantici.checkDatiSpecifici(TipiUsoDatiSpec.MIGRAZ, tipoEntita, + this.sistemaDiMigrazione, this.idStruttura, 0, tmpIdVersioneXsd); + if (rispostaControlliAttSpec.getCodErr() != null) { + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } - // impostazione dell'Id dell'Xsd - rispostaControlliAttSpec.setIdRecXsdDatiSpec(tmpIdVersioneXsd); - - // estrazione dati nella collection dei dati spec attesi - for (Element element : datiSpecifici.getAny()) { - String tmpChiave = element.getLocalName(); - tmpAttSpecAtteso = rispostaControlliAttSpec.getDatiSpecifici().get(tmpChiave); - if (tmpAttSpecAtteso != null) { - if (tmpAttSpecAtteso.getValore() == null) { - if (element.getFirstChild() != null) { - String tmpValore = element.getFirstChild().getNodeValue(); - if (tmpValore.length() <= UpdCostanti.MAXLEN_DATOSPEC) { - tmpAttSpecAtteso.setValore(tmpValore); + // impostazione dell'Id dell'Xsd + rispostaControlliAttSpec.setIdRecXsdDatiSpec(tmpIdVersioneXsd); + + // estrazione dati nella collection dei dati spec attesi + for (Element element : datiSpecifici.getAny()) { + String tmpChiave = element.getLocalName(); + tmpAttSpecAtteso = rispostaControlliAttSpec.getDatiSpecifici().get(tmpChiave); + if (tmpAttSpecAtteso != null) { + if (tmpAttSpecAtteso.getValore() == null) { + if (element.getFirstChild() != null) { + String tmpValore = element.getFirstChild().getNodeValue(); + if (tmpValore.length() <= UpdCostanti.MAXLEN_DATOSPEC) { + tmpAttSpecAtteso.setValore(tmpValore); + } else { + // "Errore nei dati specifici: uno o più valori superano + // la lunghezza di " + MAXLEN_DATOSPEC + " caratteri" + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_002_001); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString( + MessaggiWSBundle.DATISPECM_002_001, tipoEntita.descrivi(), desElemento, + tmpChiave, UpdCostanti.MAXLEN_DATOSPEC)); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; + } } else { - // "Errore nei dati specifici: uno o più valori superano - // la lunghezza di " + MAXLEN_DATOSPEC + " caratteri" - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_002_001); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString( - MessaggiWSBundle.DATISPECM_002_001, tipoEntita.descrivi(), desElemento, - tmpChiave, UpdCostanti.MAXLEN_DATOSPEC)); - rispostaControlliAttSpec.setrBoolean(false); - return rispostaControlliAttSpec; + tmpAttSpecAtteso.setValore(null); } } else { - tmpAttSpecAtteso.setValore(null); + // "Errore nei dati specifici: uno o più dati risultano duplicati"); + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_002_002); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString( + MessaggiWSBundle.DATISPECM_002_002, tipoEntita.descrivi(), desElemento, tmpChiave)); + rispostaControlliAttSpec.setrBoolean(false); + return rispostaControlliAttSpec; } } else { - // "Errore nei dati specifici: uno o più dati risultano duplicati"); - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPECM_002_002); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPECM_002_002, + // rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); + // rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + // "GestioneDatiSpec.parseDatiSpecMig.i dati specifici attesi" + // + " non coincidono con l'XSD ")); + // MAC#29906 - Correzione della mancata gestione dell'errore per dati specifici che non + // coincidono con l'XSD + rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.DATISPEC_003_002); + rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.DATISPEC_003_002, tipoEntita.descrivi(), desElemento, tmpChiave)); + rispostaControlliAttSpec.setrBoolean(false); + log.error("Errore interno: i dati specifici attesi di migrazione non coincidono con l'XSD"); return rispostaControlliAttSpec; } - } else { - rispostaControlliAttSpec.setCodErr(MessaggiWSBundle.ERR_666); - rispostaControlliAttSpec.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, - "GestioneDatiSpec.parseDatiSpecMig.i dati specifici attesi" - + " non coincidono con l'XSD ")); - rispostaControlliAttSpec.setrBoolean(false); - log.error("Errore interno: i dati specifici attesi di migrazione non coincidono con l'XSD"); - return rispostaControlliAttSpec; } } } else { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/WSDescUpdVers.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/WSDescUpdVers.java index 5247815..3629189 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/WSDescUpdVers.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/utils/WSDescUpdVers.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-ejb/src/main/resources/META-INF/jboss-ejb3.xml b/sacerws-ejb/src/main/resources/META-INF/jboss-ejb3.xml index 36a13c4..2c772d3 100644 --- a/sacerws-ejb/src/main/resources/META-INF/jboss-ejb3.xml +++ b/sacerws-ejb/src/main/resources/META-INF/jboss-ejb3.xml @@ -16,8 +16,8 @@ java:/SacerJmsXA - jms/ElenchiDaElabInAttesaSchedQueue - java:/jms/queue/ElenchiDaElabInAttesaSchedQueue + jms/queue/ElenchiDaElabQueue + java:/jms/queue/ElenchiDaElabQueue @@ -30,8 +30,8 @@ java:/SacerJmsXA - jms/ElenchiDaElabInAttesaSchedQueue - java:/jms/queue/ElenchiDaElabInAttesaSchedQueue + jms/queue/ElenchiDaElabQueue + java:/jms/queue/ElenchiDaElabQueue @@ -44,8 +44,8 @@ java:/SacerJmsXA - jms/ElenchiDaElabInAttesaSchedQueue - java:/jms/queue/ElenchiDaElabInAttesaSchedQueue + jms/queue/ElenchiDaElabQueue + java:/jms/queue/ElenchiDaElabQueue @@ -58,8 +58,8 @@ java:/SacerJmsXA - jms/ElenchiDaElabInAttesaSchedQueue - java:/jms/queue/ElenchiDaElabInAttesaSchedQueue + jms/queue/ElenchiDaElabQueue + java:/jms/queue/ElenchiDaElabQueue diff --git a/sacerws-ejb/src/main/resources/countselectlist.properties b/sacerws-ejb/src/main/resources/countselectlist.properties deleted file mode 100644 index 6202467..0000000 --- a/sacerws-ejb/src/main/resources/countselectlist.properties +++ /dev/null @@ -1,23 +0,0 @@ -#Sacer -getAroVRicUnitaDocRicAvanzataViewBean=idUnitaDoc -getAroVRicUnitaDocRicSempliceViewBean=idUnitaDoc -getAroVLisDocTableBean=idDoc -getAroVLisLinkUnitaDocTableBean= -getAroVLisArchivUnitaDocTableBean= -getAroVLisDatiSpecTableBean= -getAroVRicCompViewBean=idCompDoc -getVolVRicVolumeViewBean=idVolumeConserv -getListaVolumi=idVolumeConserv -getVolVListaCompVolViewBean=idAppartCompVolume -getMonVRiepStrutIamViewBean= -getMonVLisDocViewBean= -getMonVLisVersErrIamViewBean= -##TODO: getMonVLisUdNonVersViewBean HA UNA CHIAVE COMPOSITA -getMonVLisUdNonVersIamViewBean=idStrut,cdRegistroKeyUnitaDoc,aaKeyUnitaDoc,cdKeyUnitaDoc -##TODO: getMonVLisDocNonVersViewBean HA UNA CHIAVE COMPOSITA -getMonVLisDocNonVersIamViewBean=idStrut,cdRegistroKeyUnitaDoc,aaKeyUnitaDoc,cdKeyUnitaDoc,cdKeyDocVers -getSessioniErrateListTB= -getMonVLisOperVolIamViewBean= -getLogVLisSchedViewBean= -getFileListTableBean= -getMonVLisUniDocDaAnnulViewBean=idDoc diff --git a/sacerws-ejb/src/test/java/it/eng/ArquillianTestUtils.java b/sacerws-ejb/src/test/java/it/eng/ArquillianTestUtils.java new file mode 100644 index 0000000..4c424ca --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/ArquillianTestUtils.java @@ -0,0 +1,110 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng; + +import static org.junit.Assert.assertNotEquals; + +import java.io.File; +import java.util.List; + +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.exporter.ZipExporter; +import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; + +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.utils.MessaggiWSBundle; + +public class ArquillianTestUtils { + + public static void saveArchiveTo(Archive testArchive, String path) { + testArchive.as(ZipExporter.class).exportTo(new File(path), true); + } + + public static JavaArchive createSacerLogJavaArchive() { + return ShrinkWrap.create(JavaArchive.class, "sacerlog.jar").addPackages(true, "it.eng.parer.sacerlog") + .addAsResource(ArquillianTestUtils.class.getClassLoader().getResource("ejb-jar-sacerlog.xml"), + "META-INF/ejb-jar.xml") + .addAsResource( + ArquillianTestUtils.class.getClassLoader().getResource("WSRequestIndiceSIPFascicolo_1.0.xsd"), + "/it/eng/parer/ws/xml/versfascicolo/WSRequestIndiceSIPFascicolo_1.0.xsd"); + } + + public static JavaArchive createPaginatorJavaArchive() { + return ShrinkWrap.create(JavaArchive.class, "paginator.jar") + .addPackages(true, "it.eng.paginator", "it.eng.spagoLite") + .addAsResource(ArquillianTestUtils.class.getClassLoader().getResource("ejb-jar-paginator.xml"), + "META-INF/ejb-jar.xml"); + } + + public static JavaArchive createSacerWSJavaArchive(List packages, Class... classes) { + JavaArchive sacerWsJavaArchive = ShrinkWrap.create(JavaArchive.class, "sacerWSEjb.jar"); + sacerWsJavaArchive + .addPackages(true, "it.eng.parer.entity", "it.eng.parer.grantedEntity", "it.eng.parer.view_entity", + "it.eng.parer.util.ejb.help.dto", "it.eng.parer.ws.versamentoUpd.dto", "it.eng.parer.ws.dto", + "it.eng.parer.ws.versamento.dto", "org.apache.commons.lang3", "it.eng.parer.jboss.timer.common", + "it.eng.parer.crypto.model.exceptions", "it.eng.parer.eidas.model.exception", + "org.apache.commons.text", "com.fasterxml.uuid") + .addPackages(false, "it.eng.parer.sacerlog.entity", "it.eng.parer.sacerlog.view_entity", + "it.eng.parer.exception", "it.eng.parer.ws.utils", "it.eng.parer.ws.versamentoUpd.utils", + "it.eng.sequences.hibernate") + .addAsResource(ArquillianTestUtils.class.getClassLoader().getResource("persistence.xml"), + "META-INF/persistence.xml") + .addAsResource(ArquillianTestUtils.class.getClassLoader().getResource("ejb-jar.xml"), + "META-INF/ejb-jar.xml") + .addClass("it.eng.ArquillianTestUtils").addClass(it.eng.parer.util.ejb.help.ConfigurationHelper.class) + .addClass(it.eng.spagoCore.util.UUIDMdcLogUtil.class) + .addClass("org.springframework.http.client.ClientHttpRequestInterceptor") + .addClass("org.springframework.retry.RetryCallback").addClass("org.springframework.http.HttpRequest") + .addClass("org.springframework.http.HttpMessage"); + for (Class c : classes) { + sacerWsJavaArchive.addClass(c); + } + packages.parallelStream().forEach(sacerWsJavaArchive::addPackage); + return sacerWsJavaArchive; + } + + public static EnterpriseArchive createEnterpriseArchive(String archiveName, JavaArchive... modules) { + EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, archiveName + ".ear") + .addAsResource(EmptyAsset.INSTANCE, "beans.xml"); + for (JavaArchive m : modules) { + ear.addAsModule(m); + } + return ear; + } + + public static boolean exceptionMessageContains(Exception e, String... messages) { + for (String m : messages) { + final String message = e.getMessage() != null ? e.getMessage() : e.getClass().getSimpleName(); + if (message.contains(m)) { + return true; + } + } + return false; + } + + public static void assertNoErr(RispostaControlli rispostaControlli) { + assertNotEquals(MessaggiWSBundle.ERR_666, rispostaControlli.getCodErr()); + assertNotEquals(MessaggiWSBundle.ERR_666P, rispostaControlli.getCodErr()); + assertNotEquals(MessaggiWSBundle.ERR_666N, rispostaControlli.getCodErr()); + } + +} diff --git a/sacerws-ejb/src/test/java/it/eng/FakeAuth.java b/sacerws-ejb/src/test/java/it/eng/FakeAuth.java new file mode 100644 index 0000000..88f6968 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/FakeAuth.java @@ -0,0 +1,52 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package it.eng; + +import it.eng.spagoLite.security.User; +import it.eng.spagoLite.security.auth.Authenticator; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; +import javax.servlet.http.HttpSession; + +/** + * + * @author Iacolucci_M Classe finta creata soltanto per darla come risorsa iniettabile a openejb perché una classe di + * spagolite-middle richiede questa risorsa! + */ +@Stateless +@LocalBean +public class FakeAuth extends Authenticator { + + @Override + protected String getAppName() { + throw new UnsupportedOperationException("Not supported yet."); // To change body of generated methods, choose + // Tools | Templates. + } + + @Override + public User recuperoAutorizzazioni(HttpSession hs) { + throw new UnsupportedOperationException("Not supported yet."); // To change body of generated methods, choose + // Tools | Templates. + } + +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelperTest.java new file mode 100644 index 0000000..076baaf --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelperTest.java @@ -0,0 +1,104 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.firma.crypto.helper; + +import static it.eng.ArquillianTestUtils.createEnterpriseArchive; +import static it.eng.ArquillianTestUtils.createSacerLogJavaArchive; +import static it.eng.ArquillianTestUtils.createSacerWSJavaArchive; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.Collections; + +import javax.ejb.EJB; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Test; +import org.junit.runner.RunWith; + +@RunWith(Arquillian.class) + +public class CryptoRestConfiguratorHelperTest { + @Deployment + public static Archive createTestArchive() { + JavaArchive sacerWSJavaArchive = createSacerWSJavaArchive(Collections.emptyList(), + CryptoRestConfiguratorHelper.class, CryptoRestConfiguratorHelperTest.class, + it.eng.parer.util.ejb.help.ConfigurationHelper.class); + sacerWSJavaArchive.addPackage("it.eng.parer.retry"); + return createEnterpriseArchive("CryptoRestConfiguratorHelperTest", sacerWSJavaArchive, + createSacerLogJavaArchive()); + } + + @EJB + private CryptoRestConfiguratorHelper helper; + + @Test + public void getRetryTimeoutParam_queryIsOk() { + helper.getRetryTimeoutParam(); + assertTrue(true); + } + + @Test + public void getMaxRetryParam_queryIsOk() { + helper.getMaxRetryParam(); + assertTrue(true); + } + + @Test + public void getCircuitBreakerOpenTimeoutParam_queryIsOk() { + helper.getCircuitBreakerOpenTimeoutParam(); + assertTrue(true); + } + + @Test + public void getCircuitBreakerResetTimeoutParam_queryIsOk() { + helper.getCircuitBreakerResetTimeoutParam(); + assertTrue(true); + } + + @Test + public void getPeriodoBackOffParam_queryIsOk() { + helper.getPeriodoBackOffParam(); + assertTrue(true); + } + + @Test + public void getClientTimeoutInMinutesParam_queryIsOk() { + helper.getClientTimeoutInMinutesParam(); + assertTrue(true); + } + + @Test + public void isCompositePolicyOptimisticParam_queryIsOk() { + assertNotNull(helper.isCompositePolicyOptimisticParam()); + } + + @Test + public void endPoints_queryIsOk() { + assertNotNull(helper.endPoints()); + } + + @Test + public void preferredEndpoint_queryIsOk() { + helper.preferredEndpoint(); + assertTrue(true); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelperTest.java new file mode 100644 index 0000000..1f3ad3f --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelperTest.java @@ -0,0 +1,105 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.firma.crypto.helper; + +import static it.eng.ArquillianTestUtils.createEnterpriseArchive; +import static it.eng.ArquillianTestUtils.createSacerLogJavaArchive; +import static it.eng.ArquillianTestUtils.createSacerWSJavaArchive; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.Collections; + +import javax.ejb.EJB; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Test; +import org.junit.runner.RunWith; + +@RunWith(Arquillian.class) + +public class EidasRestConfiguratorHelperTest { + @EJB + private EidasRestConfiguratorHelper helper; + + @Deployment + public static Archive createTestArchive() { + JavaArchive sacerWSJavaArchive = createSacerWSJavaArchive(Collections.emptyList(), + EidasRestConfiguratorHelper.class, EidasRestConfiguratorHelperTest.class, + it.eng.parer.util.ejb.help.ConfigurationHelper.class); + sacerWSJavaArchive.addPackage("it.eng.parer.retry"); + return createEnterpriseArchive("EidasRestConfiguratorHelperTest", sacerWSJavaArchive, + createSacerLogJavaArchive()); + } + + @Test + public void getRetryTimeoutParam_queryIsOk() { + helper.getRetryTimeoutParam(); + assertTrue(true); + } + + @Test + public void getMaxRetryParam_queryIsOk() { + helper.getMaxRetryParam(); + assertTrue(true); + } + + @Test + public void getCircuitBreakerOpenTimeoutParam_queryIsOk() { + helper.getCircuitBreakerOpenTimeoutParam(); + assertTrue(true); + } + + @Test + public void getCircuitBreakerResetTimeoutParam_queryIsOk() { + helper.getCircuitBreakerResetTimeoutParam(); + assertTrue(true); + } + + @Test + public void getPeriodoBackOffParam_queryIsOk() { + helper.getPeriodoBackOffParam(); + assertTrue(true); + } + + @Test + public void getClientTimeoutInMinutesParam_queryIsOk() { + helper.getClientTimeoutInMinutesParam(); + assertTrue(true); + } + + @Test + public void isCompositePolicyOptimisticParam_queryIsOk() { + assertNotNull(helper.isCompositePolicyOptimisticParam()); + } + + @Test + public void endPoints_queryIsOk() { + helper.endPoints(); + assertTrue(true); + } + + @Test + public void preferredEndpoint_queryIsOk() { + helper.preferredEndpoint(); + assertTrue(true); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/sacer/ejb/retry/RetryTest.java b/sacerws-ejb/src/test/java/it/eng/parer/sacer/ejb/retry/RetryTest.java index 71ede14..5346eb0 100644 --- a/sacerws-ejb/src/test/java/it/eng/parer/sacer/ejb/retry/RetryTest.java +++ b/sacerws-ejb/src/test/java/it/eng/parer/sacer/ejb/retry/RetryTest.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.sacer.ejb.retry; import java.io.File; @@ -168,14 +185,14 @@ public void testVerificaCrypto() throws FileNotFoundException { * * * Il motivo di questo comportamento sta nel fatto che la seconda POST atterra su una risorsa che risponde - * un codice 404. + * un codice 403 (forbidden). * * Per questa ragione la valutazione finale viene effettuata non sulla nullità dell'oggetto ma sul fatto che * l'oggetto sia vuoto. * * @throws FileNotFoundException */ - @Test + @Test(expected = RestClientException.class) public void testVerificaCryptoEnpointNonValido() throws FileNotFoundException { File fileFirmato = ResourceUtils.getFile("classpath:firme/xml_sig_controfirma_cert_rev.xml"); @@ -201,7 +218,7 @@ public void testVerificaCryptoEnpointNonValido() throws FileNotFoundException { CryptoAroCompDoc componente = restTemplateCrypto.postForObject("/v0/report-verifica", entity, CryptoAroCompDoc.class); - Assert.assertNull(componente.getIdComponente()); + Assert.assertNull(componente); } /** diff --git a/sacerws-ejb/src/test/java/it/eng/parer/sacer/ejb/versamento/dto/TestMessaggiWSFormat.java b/sacerws-ejb/src/test/java/it/eng/parer/sacer/ejb/versamento/dto/TestMessaggiWSFormat.java index 305aeb3..3d8e80c 100644 --- a/sacerws-ejb/src/test/java/it/eng/parer/sacer/ejb/versamento/dto/TestMessaggiWSFormat.java +++ b/sacerws-ejb/src/test/java/it/eng/parer/sacer/ejb/versamento/dto/TestMessaggiWSFormat.java @@ -1,13 +1,28 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.sacer.ejb.versamento.dto; -import it.eng.parer.ws.utils.Costanti; -import it.eng.parer.ws.utils.MessaggiWSFormat; -import java.text.SimpleDateFormat; import java.time.Instant; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.Date; + import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -15,6 +30,8 @@ import org.junit.BeforeClass; import org.junit.Test; +import it.eng.parer.ws.utils.MessaggiWSFormat; + /** * * @author Snidero_L diff --git a/sacerws-ejb/src/test/java/it/eng/parer/util/ejb/help/ConfigurationHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/util/ejb/help/ConfigurationHelperTest.java new file mode 100644 index 0000000..bf031c4 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/util/ejb/help/ConfigurationHelperTest.java @@ -0,0 +1,133 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.util.ejb.help; + +import static it.eng.ArquillianTestUtils.createEnterpriseArchive; +import static it.eng.ArquillianTestUtils.createSacerLogJavaArchive; +import static it.eng.ArquillianTestUtils.createSacerWSJavaArchive; +import static it.eng.ArquillianTestUtils.exceptionMessageContains; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.Collections; +import java.util.Map; + +import javax.ejb.EJB; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; + +import it.eng.parer.exception.ParamApplicNotFoundException; +import it.eng.parer.ws.utils.ParametroApplDB; + +//@RunWith(Arquillian.class) +//@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class ConfigurationHelperTest { + @EJB + private ConfigurationHelper helper; + + @Deployment + public static Archive createTestArchive() { + return createEnterpriseArchive("configurationHelperTest", createSacerWSJavaArchive(Collections.emptyList(), + ConfigurationHelper.class, ConfigurationHelperTest.class), createSacerLogJavaArchive()); + } + + @Test + public void getConfiguration_queryIsOk() { + try { + Map configuration = helper.getConfiguration(); + assertFalse(configuration.isEmpty()); + } catch (ParamApplicNotFoundException e) { + assertTrue(true); + } catch (Exception e) { + assertTrue(exceptionMessageContains(e, "non definito o non valorizzato")); + } + } + + @Test + public void getParamApplicValue_queryIsOk() { + try { + helper.getValoreParamApplicByApplic("NON_ESISTE"); + } catch (Exception e) { + assertTrue(exceptionMessageContains(e, "non definito o non valorizzato")); + } + } + + @Test + public void getParamApplicValueStrutAmbiente_queryIsOk() { + try { + helper.getValoreParamApplicByStrut("NON_ESISTE", 0l, 0L); + } catch (Exception e) { + assertTrue(exceptionMessageContains(e, "non definito o non valorizzato")); + } + } + + @Test + public void getParamApplicValueTipoUD_queryIsOk() { + try { + helper.getValoreParamApplicByTipoUd("NON_ESISTE", 0L, 0L, 0L); + } catch (Exception e) { + assertTrue(exceptionMessageContains(e, "non definito o non valorizzato")); + } + } + + @Test + public void getParamApplicValueAATipoFascicolo_queryIsOk() { + try { + helper.getValoreParamApplicByAaTipoFasc("NON_ESISTE", 0L, 0L, 0L); + } catch (Exception e) { + assertTrue(exceptionMessageContains(e, "non definito o non valorizzato")); + } + } + + @Test + public void getValoreParamApplicByTiParamApplicAsMap_queryIsOk() { + Map map = helper + .getValoreParamApplicByTiParamApplicAsMap(Arrays.asList(ParametroApplDB.TipoParametroAppl.IAM)); + assertFalse(map.isEmpty()); + } + + @Test + public void getParamApplicValueAsFl_queryIsOk() { + try { + helper.getValoreParamApplicByApplicAsFl("NON_ESISTE"); + } catch (Exception e) { + assertTrue(exceptionMessageContains(e, "non definito o non valorizzato")); + } + } + + @Test + public void getParamApplicValueAsFlTipoUD_queryIsOk() { + try { + helper.getValoreParamApplicByTipoUdAsFl("NON_ESISTE", 0L, 0L, 0L); + } catch (Exception e) { + assertTrue(exceptionMessageContains(e, "non definito o non valorizzato")); + } + } + + @Test + public void getParamApplicValueAsFlAAFascicolo_queryIsOk() { + try { + helper.getValoreParamApplicByAaTipoFascAsFl("NON_ESISTE", 0L, 0l, 0L); + } catch (Exception e) { + assertTrue(exceptionMessageContains(e, "non definito o non valorizzato")); + } + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliMMTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliMMTest.java new file mode 100644 index 0000000..97903ef --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliMMTest.java @@ -0,0 +1,54 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.ejb; + +import it.eng.parer.ws.dto.RispostaControlli; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Arrays; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class ControlliMMTest { + + @Deployment + public static Archive createTestArchive() { + return createEnterpriseArchive(ControlliMMTest.class.getSimpleName(), + createSacerWSJavaArchive(Arrays.asList(""), ControlliMMTest.class, ControlliMM.class), + createSacerLogJavaArchive()); + } + + @EJB + private ControlliMM controlliMM; + + @Test + public void caricaRootPath() { + for (ControlliMM.TipiRootPath tipoRootPath : ControlliMM.TipiRootPath.values()) { + final RispostaControlli rispostaControlli = controlliMM.caricaRootPath("SACER_PREINGEST", tipoRootPath); + assertTrue(rispostaControlli.isrBoolean()); + } + + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliSemanticiTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliSemanticiTest.java new file mode 100644 index 0000000..f31e2c8 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliSemanticiTest.java @@ -0,0 +1,295 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.ejb; + +import it.eng.parer.ws.dto.CSChiave; +import it.eng.parer.ws.dto.CSVersatore; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.utils.Costanti; +import it.eng.parer.ws.utils.CostantiDB; +import it.eng.parer.ws.versamento.dto.RispostaControlliAttSpec; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Arrays; +import java.util.Date; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class ControlliSemanticiTest { + + @Deployment + public static Archive createTestArchive_queryIsOk() { + return createEnterpriseArchive(ControlliSemanticiTest.class.getSimpleName(), + createSacerWSJavaArchive(Arrays.asList(""), ControlliSemanticiTest.class, ControlliSemantici.class, + it.eng.paginator.util.HibernateUtils.class), + createSacerLogJavaArchive()); + } + + @EJB + private ControlliSemantici controlliSemantici; + + @Test + public void caricaDefaultDaDB_string_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.caricaDefaultDaDB("Applicazione"); + assertNoErr(rispostaControlli); + } + + @Test + public void caricaDefaultDaDB_list_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici + .caricaDefaultDaDB(new String[] { "Applicazione", "Paginazione risultati" }); + assertNoErr(rispostaControlli); + } + + @Test + public void checkIdStrut_queryIsOk() { + for (Costanti.TipiWSPerControlli aggiornamentoVersamento : Costanti.TipiWSPerControlli.values()) { + final RispostaControlli rispostaControlli = controlliSemantici.checkIdStrut(mockCsVersatore(), + aggiornamentoVersamento, new Date()); + assertNoErr(rispostaControlli); + + } + } + + private CSVersatore mockCsVersatore() { + final CSVersatore vers = new CSVersatore(); + vers.setAmbiente("PARER_TEST"); + vers.setEnte("AOSP_BO"); + vers.setStruttura("080-908"); + return vers; + } + + @Test + public void checkSistemaMigraz_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.checkSistemaMigraz("sistemaMigr"); + assertNoErr(rispostaControlli); + } + + @Test + public void checkChiave_queryIsOk() { + for (ControlliSemantici.TipiGestioneUDAnnullate tipiGestioneUDAnnullate : ControlliSemantici.TipiGestioneUDAnnullate + .values()) { + final RispostaControlli rispostaControlli = controlliSemantici.checkChiave(mockCsChiave(), 0l, + tipiGestioneUDAnnullate); + assertNoErr(rispostaControlli); + } + } + + private CSChiave mockCsChiave() { + final CSChiave key = new CSChiave(); + key.setNumero("2021"); + key.setTipoRegistro("tipoRegistro"); + key.setAnno(2021L); + return key; + } + + @Test + public void checkTipologiaUD_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.checkTipologiaUD("tipologiaUd", "descKey", 0L); + assertNoErr(rispostaControlli); + } + + @Test + public void checkTipoRegistro_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.checkTipoRegistro("nomeTipoRegistro", "descKey", + 0L); + assertNoErr(rispostaControlli); + } + + @Test + public void checkTipoRegistro_descKeyUdColl_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.checkTipoRegistro("nomeTipoRegistro", "descKey", + 0L, "descKeyUdColl"); + assertNoErr(rispostaControlli); + } + + @Test + public void checkTipoRegistroTipoUD_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.checkTipoRegistroTipoUD("nomeTipoRegistro", + "descKey", "tipologiaUd", 0L, 0l); + assertNoErr(rispostaControlli); + } + + @Test + public void caricaRegistroAnno_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.caricaRegistroAnno("nomeTipoRegistro", "descKey", + 2021L, 0L); + assertNoErr(rispostaControlli); + } + + @Test + public void caricaRegistroAnno_descKeyUdColl_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.caricaRegistroAnno("nomeTipoRegistro", "descKey", + 2021L, 0L, "descKeyUdColl"); + assertNoErr(rispostaControlli); + } + + @Test + public void caricaPartiAARegistro_queryIsOk() { + controlliSemantici.caricaPartiAARegistro(2021L); + assertTrue(true); + } + + @Test + public void checkTipoDocumento_queryIsOk() { + RispostaControlli rispostaControlli = controlliSemantici.checkTipoDocumento("nomeTipoDoc", 0L, true, + "descChiaveDoc"); + assertNoErr(rispostaControlli); + rispostaControlli = controlliSemantici.checkTipoDocumento("nomeTipoDoc", 0L, false, "descChiaveDoc"); + assertNoErr(rispostaControlli); + + } + + @Test + public void checkTipoStruttura_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.checkTipoStruttura("nomeTipoStruttura", 0L, + "descChiaveDoc"); + assertNoErr(rispostaControlli); + } + + @Test + public void checkTipoComponente_queryIsOk() { + for (ControlliSemantici.TipologieComponente tipologieComponente : ControlliSemantici.TipologieComponente + .values()) { + final RispostaControlli rispostaControlli = controlliSemantici.checkTipoComponente("nomeTipoComponente", 0l, + tipologieComponente, "descChiaveComp"); + assertNoErr(rispostaControlli); + } + } + + @Test + public void checkTipoRappComponente_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici + .checkTipoRappComponente("nomeTipoRapprComponente", 0L, "descChiaveComp"); + assertNoErr(rispostaControlli); + } + + @Test + public void checkPresenzaDatiSpec_queryIsOk() { + for (CostantiDB.TipiUsoDatiSpec tipiUsoDatiSpec : CostantiDB.TipiUsoDatiSpec.values()) { + for (CostantiDB.TipiEntitaSacer tipoEntitySacer : CostantiDB.TipiEntitaSacer.values()) { + final RispostaControlli rispostaControlli = controlliSemantici.checkPresenzaDatiSpec(tipiUsoDatiSpec, + tipoEntitySacer, "sistemaMig", 0L, 0L, new Date()); + assertNoErr(rispostaControlli); + + } + } + } + + @Test + public void checkXSDDatiSpec_queryIsOk() { + for (CostantiDB.TipiUsoDatiSpec tipiUsoDatiSpec : CostantiDB.TipiUsoDatiSpec.values()) { + for (CostantiDB.TipiEntitaSacer tipoEntitySacer : CostantiDB.TipiEntitaSacer.values()) { + final RispostaControlli rispostaControlli = controlliSemantici.checkXSDDatiSpec(tipiUsoDatiSpec, + tipoEntitySacer, "sistemaMig", 0L, 0L, new Date(), "versioneXsd"); + assertNoErr(rispostaControlli); + } + } + } + + @Test + public void checkPresenzaVersioneDatiSpec_queryIsOk() { + for (CostantiDB.TipiUsoDatiSpec tipiUsoDatiSpec : CostantiDB.TipiUsoDatiSpec.values()) { + for (CostantiDB.TipiEntitaSacer tipoEntitySacer : CostantiDB.TipiEntitaSacer.values()) { + final RispostaControlli rispostaControlli = controlliSemantici.checkPresenzaVersioneDatiSpec( + tipiUsoDatiSpec, tipoEntitySacer, "sistemaMig", 0L, 0L, "versioneXsd"); + assertNoErr(rispostaControlli); + } + } + } + + @Test + public void checkDatiSpecifici_queryIsOk() { + for (CostantiDB.TipiUsoDatiSpec tipiUsoDatiSpec : CostantiDB.TipiUsoDatiSpec.values()) { + for (CostantiDB.TipiEntitaSacer tipoEntitySacer : CostantiDB.TipiEntitaSacer.values()) { + final RispostaControlliAttSpec rispostaControlli = controlliSemantici + .checkDatiSpecifici(tipiUsoDatiSpec, tipoEntitySacer, "sistemaMig", 0L, 0L, 0L); + assertNoErr(rispostaControlli); + + } + } + } + + @Test + public void checkRiferimentoUD_queryIsOk() { + for (ControlliSemantici.TipologieComponente tipologieComponente : ControlliSemantici.TipologieComponente + .values()) { + final RispostaControlli rispostaControlli = controlliSemantici.checkRiferimentoUD(mockCsChiave(), 0L, + tipologieComponente, "descChiaveComp"); + assertNoErr(rispostaControlli); + } + } + + @Test + public void checkFormatoFileVersato_queryIsOk() { + controlliSemantici.checkFormatoFileVersato("PDF", 0L, 0L); + assertTrue(true); + } + + @Test + public void checkDocumentoInUd_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.checkDocumentoInUd(0L, "idDocumento", "descUd"); + assertNoErr(rispostaControlli); + } + + @Test + public void trovaNuovoProgDocumento_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.trovaNuovoProgDocumento(0L, + "categoriaDocumento"); + assertNoErr(rispostaControlli); + } + + @Test + public void trovaNuovoNiOrdDocumento_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.trovaNuovoNiOrdDocumento(0L); + assertNoErr(rispostaControlli); + } + + @Test + public void checkFormatoFileStandard_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.checkFormatoFileStandard("PDF"); + assertNoErr(rispostaControlli); + } + + @Test + public void calcAndcheckCdKeyNormalized_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.calcAndcheckCdKeyNormalized(0L, mockCsChiave(), + "cdKeyUnitaDocNormaliz"); + assertNoErr(rispostaControlli); + } + + @Test + public void checkUniqueCdKeyNormalized_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.checkUniqueCdKeyNormalized(mockCsChiave(), 0l, + 113l, "cdKeyNomarlized", new Date()); + assertNoErr(rispostaControlli); + } + + @Test + public void getDtCalcInizioNuoviUrn_queryIsOk() { + final RispostaControlli rispostaControlli = controlliSemantici.getDtCalcInizioNuoviUrn(); + assertNoErr(rispostaControlli); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliTpiTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliTpiTest.java new file mode 100644 index 0000000..38663b3 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliTpiTest.java @@ -0,0 +1,58 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.ejb; + +import it.eng.parer.ws.dto.RispostaControlli; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Arrays; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.*; + +@RunWith(Arquillian.class) +public class ControlliTpiTest { + + @Deployment + public static Archive createTestArchive() { + return createEnterpriseArchive(ControlliTpiTest.class.getSimpleName(), + createSacerWSJavaArchive(Arrays.asList(""), ControlliTpiTest.class, ControlliTpi.class) + .addPackages(true, "org.apache.commons.io"), + createSacerLogJavaArchive()); + } + + @EJB + private ControlliTpi controlliTpi; + + @Test + public void caricaRootPath() { + final RispostaControlli rispostaControlli = controlliTpi.caricaRootPath(); + assertTrue(rispostaControlli.isrBoolean()); + } + + @Test + public void verificaAbilitazioneTpi() { + final RispostaControlli rispostaControlli = controlliTpi.verificaAbilitazioneTpi(); + assertTrue(rispostaControlli.isrBoolean()); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliWSTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliWSTest.java new file mode 100644 index 0000000..9723c74 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/ControlliWSTest.java @@ -0,0 +1,133 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.ejb; + +import it.eng.parer.idpjaas.logutils.LogDto; +import it.eng.parer.util.ejb.AppServerInstance; +import it.eng.parer.util.ejb.help.ConfigurationHelper; +import it.eng.parer.ws.dto.IWSDesc; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.utils.Costanti; +import it.eng.parer.ws.utils.VerificaVersione; +import it.eng.spagoLite.FrameElement; +import it.eng.spagoLite.security.User; +import it.eng.spagoLite.security.auth.PwdUtil; +import it.eng.spagoLite.security.auth.WSLoginHandler; +import it.eng.spagoLite.security.menu.MenuEntry; +import it.eng.spagoLite.security.menu.impl.Menu; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.HashMap; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class ControlliWSTest { + + @Deployment + public static Archive createTestArchive() { + final JavaArchive sacerWSJavaArchive = createSacerWSJavaArchive( + Arrays.asList("it.eng.spagoLite.security.exception", "it.eng.spagoLite.security", + "org.apache.commons.codec.binary", "org.apache.commons.codec", "it.eng.spagoCore.error"), + ControlliWS.class, ControlliWSTest.class, WsIdpLogger.class, ControlliSemantici.class, + ConfigurationHelper.class, AppServerInstance.class, LogDto.class, Menu.class, WSLoginHandler.class, + PwdUtil.class, MenuEntry.class, FrameElement.class, it.eng.parer.idpjaas.logutils.IdpConfigLog.class, + it.eng.spagoCore.util.JpaUtils.class, it.eng.parer.idpjaas.logutils.IdpLogger.class, + it.eng.parer.idpjaas.queryutils.NamedStatement.class); + sacerWSJavaArchive.addPackages(true, "it.eng.spagoLite"); + return createEnterpriseArchive(ControlliWSTest.class.getSimpleName(), sacerWSJavaArchive, + createSacerLogJavaArchive()); + } + + @EJB + private ControlliWS controlliWS; + + @Test + public void checkVersione() { + for (final Costanti.TipiWSPerControlli tipoWS : Costanti.TipiWSPerControlli.values()) { + final HashMap xmlDefaults = new HashMap<>(); + final String versioniWsKey = "TEST"; + xmlDefaults.put(VerificaVersione.elabWsKey(versioniWsKey), "1.4"); + final RispostaControlli rispostaControlli = controlliWS.checkVersione("1.4", versioniWsKey, xmlDefaults, + tipoWS); + assertTrue(rispostaControlli.isrBoolean()); + } + } + + @Test + public void checkCredenziali() { + for (final Costanti.TipiWSPerControlli tipoWS : Costanti.TipiWSPerControlli.values()) { + final RispostaControlli rispostaControlli = controlliWS.checkCredenziali("admin_generale", "password", + "127.0.0.1", tipoWS); + assertTrue(rispostaControlli.isrBoolean()); + + } + } + + @Test + public void checkUtente() { + final RispostaControlli rispostaControlli = controlliWS.checkUtente("admin_generale"); + assertTrue(rispostaControlli.isrBoolean()); + } + + private User mockUser() { + final User utente = new User(); + utente.setIdUtente(0L); + utente.setUsername("admin_generale"); + utente.setIdOrganizzazioneFoglia(BigDecimal.ZERO); + utente.setIdApplicazione(0L); + return utente; + } + + @Test + public void checkAuthWSNoOrg() { + for (final Costanti.TipiWSPerControlli tipoWS : Costanti.TipiWSPerControlli.values()) { + final RispostaControlli rispostaControlli = controlliWS.checkAuthWSNoOrg(mockUser(), getIwsDesc(), tipoWS); + assertTrue(rispostaControlli.isrBoolean()); + } + } + + @Test + public void loadWsVersions() { + final RispostaControlli rispostaControlli = controlliWS.loadWsVersions(getIwsDesc()); + assertTrue(rispostaControlli.isrBoolean()); + } + + private IWSDesc getIwsDesc() { + return new IWSDesc() { + @Override + public String getNomeWs() { + return "AggiuntaAllegatiSync"; + } + + @Override + public String getVersione() { + return "1.4"; + } + }; + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/WsIdpLoggerTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/WsIdpLoggerTest.java new file mode 100644 index 0000000..274d1d9 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/ejb/WsIdpLoggerTest.java @@ -0,0 +1,58 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.ejb; + +import it.eng.ArquillianTestUtils; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Arrays; + +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class WsIdpLoggerTest { + + @Deployment + public static Archive createTestArchive() { + return ArquillianTestUtils.createEnterpriseArchive(WsIdpLoggerTest.class.getSimpleName(), + ArquillianTestUtils.createSacerLogJavaArchive(), ArquillianTestUtils.createPaginatorJavaArchive(), + ArquillianTestUtils.createSacerWSJavaArchive(Arrays.asList(""), WsIdpLoggerTest.class, + WsIdpLogger.class, it.eng.parer.ws.ejb.ControlliSemantici.class, + it.eng.parer.util.ejb.AppServerInstance.class, it.eng.parer.idpjaas.logutils.LogDto.class)); + } + + @EJB + private WsIdpLogger wsIdpLogger; + + @Test + public void todo() { + assertTrue(true); + } + + @Test + @Ignore("è complicato creare il caso su DB per tetare la parte di query") + public void scriviLog() { + assertTrue(true); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/utils/ControlliWSHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/utils/ControlliWSHelperTest.java new file mode 100644 index 0000000..5caf3f7 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/utils/ControlliWSHelperTest.java @@ -0,0 +1,70 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.utils; + +import it.eng.parer.entity.DecControlloWs; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Collections; +import java.util.List; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class ControlliWSHelperTest { + @EJB + private ControlliWSHelper helper; + + @Deployment + public static Archive createTestArchive() { + return createEnterpriseArchive("ControlliWSHelperTest", + createSacerWSJavaArchive(Collections.emptyList(), ControlliWSHelper.class, ControlliWSHelperTest.class), + createSacerLogJavaArchive()); + } + + @Test + public void caricaListaControlli_queryIsOk() { + final List listaControlli = helper.caricaListaControlli(); + assertFalse(listaControlli.isEmpty()); + } + + @Test + public void caricaCdControlloWs_queryIsOk() { + try { + helper.caricaCdControlloWs("NON_ESISTE"); + } catch (Exception e) { + assertTrue(exceptionMessageContains(e, "No entity found for query")); + } + } + + @Test + public void caricaCdControlloFamiglia_queryIsOk() { + try { + helper.caricaCdControlloFamiglia("NON_ESISTE"); + } catch (Exception e) { + assertTrue(exceptionMessageContains(e, "No entity found for query")); + } + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/utils/MessaggiWSHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/utils/MessaggiWSHelperTest.java new file mode 100644 index 0000000..e15838f --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/utils/MessaggiWSHelperTest.java @@ -0,0 +1,59 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.utils; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Collections; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) + +public class MessaggiWSHelperTest { + @EJB + private MessaggiWSHelper helper; + + @Deployment + public static Archive createTestArchive() { + return createEnterpriseArchive("MessaggiWSHelperTest", + createSacerWSJavaArchive(Collections.emptyList(), MessaggiWSHelper.class, MessaggiWSHelperTest.class), + createSacerLogJavaArchive()); + } + + @Test + public void caricaListaErrori() { + assertNotNull(helper.caricaListaErrori()); + } + + @Test + public void caricaDecErrore() { + try { + helper.caricaDecErrore("NON ESISTE"); + } catch (Exception e) { + assertTrue(exceptionMessageContains(e, "No entity found for query")); + } + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/ControlliFascicoliTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/ControlliFascicoliTest.java new file mode 100644 index 0000000..f4c96e5 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/ControlliFascicoliTest.java @@ -0,0 +1,176 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versFascicoli.ejb; + +import it.eng.parer.ws.dto.CSChiaveFasc; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.versFascicoli.dto.DatiXmlProfiloArchivistico; +import it.eng.parer.ws.versFascicoli.dto.DatiXmlProfiloGenerale; +import it.eng.parer.ws.versFascicoli.dto.StrutturaVersFascicolo; +import it.eng.parer.ws.versFascicoli.dto.VersFascicoloExt; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; + +import static it.eng.ArquillianTestUtils.*; + +@RunWith(Arquillian.class) +public class ControlliFascicoliTest { + + @Deployment + public static Archive createTestArchive_queryIsOk() { + return createEnterpriseArchive(ControlliFascicoliTest.class.getSimpleName(), + createSacerWSJavaArchive(Arrays.asList("it.eng.parer.ws.versFascicoli.dto", "com.fasterxml.uuid.impl"), + ControlliFascicoliTest.class, ControlliFascicoli.class), + createSacerLogJavaArchive()); + } + + @EJB + private ControlliFascicoli ejb; + + @Test + public void verificaPartizioniStruttAnnoFascicoli_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.verificaPartizioniStruttAnnoFascicoli("descKey", 0L, 0L); + assertNoErr(rispostaControlli); + } + + @Test + public void checkTipoFascicolo_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.checkTipoFascicolo("nomeTipoFascicolo", "descKey", 0L); + assertNoErr(rispostaControlli); + } + + @Test + public void checkTipoFascicoloIamUserOrganizzazione_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.checkTipoFascicoloIamUserOrganizzazione("descKey", "tipoFasc", + 0L, 0L, 0L); + assertNoErr(rispostaControlli); + } + + @Test + public void checkTipoFascicoloAnno_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.checkTipoFascicoloAnno("descChiaviFasc", "tipoFasc", 0, 0L); + assertNoErr(rispostaControlli); + } + + @Test + public void checkTipoFascicoloSconosciuto_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.checkTipoFascicoloSconosciuto(0L); + assertNoErr(rispostaControlli); + } + + @Test + public void checkChiave_queryIsOk() { + final CSChiaveFasc key = new CSChiaveFasc(); + key.setNumero("1"); + key.setAnno(0); + for (ControlliFascicoli.TipiGestioneFascAnnullati tgfa : ControlliFascicoli.TipiGestioneFascAnnullati + .values()) { + final RispostaControlli rispostaControlli = ejb.checkChiave(key, "descKey", 0L, tgfa); + assertNoErr(rispostaControlli); + } + } + + private VersFascicoloExt mockVersFascicoloExt() { + final VersFascicoloExt versamento = new VersFascicoloExt(); + versamento.setStrutturaComponenti(new StrutturaVersFascicolo()); + versamento.getStrutturaComponenti().setIdStruttura(0L); + return versamento; + } + + @Test + public void verificaSIPTitolario_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.verificaSIPTitolario(mockStrutturaVersFascicolo()); + assertNoErr(rispostaControlli); + } + + private StrutturaVersFascicolo mockStrutturaVersFascicolo() { + final StrutturaVersFascicolo svf = new StrutturaVersFascicolo(); + svf.setIdStruttura(0l); + svf.setDatiXmlProfiloGenerale(new DatiXmlProfiloGenerale()); + svf.getDatiXmlProfiloGenerale().setDataApertura(new Date()); + svf.setDatiXmlProfiloArchivistico(new DatiXmlProfiloArchivistico()); + svf.getDatiXmlProfiloArchivistico().setIndiceClassificazione("indice"); + svf.getDatiXmlProfiloArchivistico().setVociClassificazione(new ArrayList<>()); + return svf; + } + + @Test + public void getDecAaTipoFascicolo_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.getDecAaTipoFascicolo(0L); + assertNoErr(rispostaControlli); + } + + @Test + public void checkDecVoceTitolWithComp_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.checkDecVoceTitolWithComp("test", 0l, new Date()); + assertNoErr(rispostaControlli); + } + + @Test + public void checkDecVoceTitolWithCompAndVoce_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.checkDecVoceTitolWithCompAndVoce("test", "test", 0L, + new Date()); + assertNoErr(rispostaControlli); + } + + @Test + public void checkCdVoceDescDecValVoceTitol_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.checkCdVoceDescDecValVoceTitol("test", "test", "test", 0L, + new Date()); + assertNoErr(rispostaControlli); + } + + @Test + public void checkCdVoceDescDecValVoceTitol2_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.checkCdVoceDescDecValVoceTitol("test", "test", new Date(), 0L); + assertNoErr(rispostaControlli); + } + + @Test + public void checkCdVoceDescDecValVoceTitol3_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.checkCdVoceDescDecValVoceTitol("test", "test", "test", + new Date(), 0L); + assertNoErr(rispostaControlli); + } + + @Test + public void getDecLvlVoceTitolWithNiLivello_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.getDecLvlVoceTitolWithNiLivello(0L, 0l); + assertNoErr(rispostaControlli); + } + + @Test + public void getDecLvlVoceTitolWithNiLivello2_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.getDecLvlVoceTitolWithNiLivello(0L, 0l, new Date()); + assertNoErr(rispostaControlli); + } + + @Test + public void getDecTitolStrutt_queryIsOk() { + final RispostaControlli rispostaControlli = ejb.getDecTitolStrutt(0L, new Date()); + assertNoErr(rispostaControlli); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/ControlliProfiliFascicoloTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/ControlliProfiliFascicoloTest.java new file mode 100644 index 0000000..438fbf7 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/ControlliProfiliFascicoloTest.java @@ -0,0 +1,114 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versFascicoli.ejb; + +import it.eng.parer.ws.dto.CSChiaveFasc; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.versFascicoli.dto.StrutturaVersFascicolo; +import it.eng.parer.ws.versFascicoli.dto.VersFascicoloExt; +import it.eng.parer.ws.xml.versfascicolo.ConfigType; +import it.eng.parer.ws.xml.versfascicolo.IndiceSIPFascicolo; +import it.eng.parer.ws.xml.versfascicolo.ProfiloArchivisticoType; +import it.eng.parer.ws.xml.versfascicoloresp.ECFascicoloType; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import javax.xml.bind.JAXBElement; +import javax.xml.namespace.QName; +import java.util.Arrays; + +import static it.eng.ArquillianTestUtils.*; + +@RunWith(Arquillian.class) +public class ControlliProfiliFascicoloTest { + + @Deployment + public static Archive createTestArchive() { + return createEnterpriseArchive(ControlliProfiliFascicoloTest.class.getSimpleName(), + createSacerWSJavaArchive( + Arrays.asList("it.eng.parer.ws.xml.versfascicolo", "it.eng.parer.ws.versFascicoli.dto", + "it.eng.parer.ws.xml.versfascicoloresp"), + ControlliProfiliFascicoloTest.class, ControlliProfiliFascicolo.class, + it.eng.parer.ws.ejb.ControlliSemantici.class), + createSacerLogJavaArchive()); + } + + @EJB + private ControlliProfiliFascicolo controlliProfiliFascicolo; + + @Test + public void verificaProfiloArchivistico_queryIsOk() { + final VersFascicoloExt versamento = new VersFascicoloExt(); + versamento.setVersamento(new IndiceSIPFascicolo()); + versamento.getVersamento().setParametri(new ConfigType()); + versamento.getVersamento().getParametri().setVersioneProfiloArchivisticoFascicolo("versione"); + versamento.setStrutturaComponenti(new StrutturaVersFascicolo()); + versamento.getStrutturaComponenti().setIdTipoFascicolo(0L); + versamento.getStrutturaComponenti().setChiaveNonVerificata(new CSChiaveFasc()); + versamento.getStrutturaComponenti().getChiaveNonVerificata().setAnno(2021); + final RispostaControlli rispostaControlli = controlliProfiliFascicolo.verificaProfiloArchivistico(versamento); + assertNoErr(rispostaControlli); + } + + @Test + public void verificaProfiloArchivisticoNoVersione_queryIsOk() { + final VersFascicoloExt versamento = new VersFascicoloExt(); + versamento.setVersamento(new IndiceSIPFascicolo()); + versamento.getVersamento().setProfiloArchivistico(new JAXBElement<>(new QName("http://www.test.eng", "userDN"), + ProfiloArchivisticoType.class, new ProfiloArchivisticoType())); + versamento.setStrutturaComponenti(new StrutturaVersFascicolo()); + versamento.getStrutturaComponenti().setIdTipoFascicolo(0L); + versamento.getStrutturaComponenti().setChiaveNonVerificata(new CSChiaveFasc()); + versamento.getStrutturaComponenti().getChiaveNonVerificata().setAnno(2021); + final RispostaControlli rispostaControlli = controlliProfiliFascicolo.verificaProfiloArchivistico(versamento); + assertNoErr(rispostaControlli); + } + + @Test + public void verificaProfiloGenerale_queryIsOk() { + final VersFascicoloExt versamento = new VersFascicoloExt(); + versamento.setVersamento(new IndiceSIPFascicolo()); + versamento.getVersamento().setProfiloArchivistico(new JAXBElement<>(new QName("http://www.test.eng", "userDN"), + ProfiloArchivisticoType.class, new ProfiloArchivisticoType())); + versamento.setStrutturaComponenti(new StrutturaVersFascicolo()); + versamento.getStrutturaComponenti().setIdTipoFascicolo(0L); + versamento.getStrutturaComponenti().setChiaveNonVerificata(new CSChiaveFasc()); + versamento.getStrutturaComponenti().getChiaveNonVerificata().setAnno(2021); + final RispostaControlli rispostaControlli = controlliProfiliFascicolo.verificaProfiloGenerale(versamento, + new ECFascicoloType()); + assertNoErr(rispostaControlli); + } + + @Test + public void verificaProfiloGeneraleProfiloNull_queryIsOk() { + final VersFascicoloExt versamento = new VersFascicoloExt(); + versamento.setVersamento(new IndiceSIPFascicolo()); + versamento.getVersamento().setProfiloArchivistico(null); + versamento.setStrutturaComponenti(new StrutturaVersFascicolo()); + versamento.getStrutturaComponenti().setIdTipoFascicolo(0L); + versamento.getStrutturaComponenti().setChiaveNonVerificata(new CSChiaveFasc()); + versamento.getStrutturaComponenti().getChiaveNonVerificata().setAnno(2021); + final RispostaControlli rispostaControlli = controlliProfiliFascicolo.verificaProfiloGenerale(versamento, + new ECFascicoloType()); + assertNoErr(rispostaControlli); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/LogSessioneFascicoliHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/LogSessioneFascicoliHelperTest.java new file mode 100644 index 0000000..26d30b5 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/LogSessioneFascicoliHelperTest.java @@ -0,0 +1,104 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versFascicoli.ejb; + +import it.eng.parer.entity.DecTipoFascicolo; +import it.eng.parer.entity.OrgStrut; +import it.eng.parer.entity.VrsFascicoloKo; +import it.eng.parer.util.ejb.AppServerInstance; +import it.eng.parer.ws.dto.CSChiaveFasc; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.ejb.XmlFascCache; +import it.eng.parer.ws.versFascicoli.dto.StrutturaVersFascicolo; +import it.eng.parer.ws.versFascicoli.dto.VersFascicoloExt; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.math.BigDecimal; +import java.util.Collections; +import java.util.Date; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class LogSessioneFascicoliHelperTest { + @EJB + private LogSessioneFascicoliHelper helper; + + @Deployment + public static Archive createTestArchive() { + JavaArchive sacerWSJavaArchive = createSacerWSJavaArchive(Collections.emptyList(), + LogSessioneFascicoliHelper.class, LogSessioneFascicoliHelperTest.class, XmlFascCache.class, + AppServerInstance.class, it.eng.parer.ws.ejb.ControlliSemantici.class); + sacerWSJavaArchive.addPackages(true, "org.apache.commons.io", "it.eng.parer.ws.xml.versfascicolo", + "it.eng.parer.ws.versFascicoli.dto"); + return createEnterpriseArchive("LogSessioneFascicoliHelperTest", sacerWSJavaArchive, + createSacerLogJavaArchive()); + } + + @Test + public void verificaPartizioneFascicoloErr_queryIsOk() { + final RispostaControlli rispostaControlli = helper.verificaPartizioneFascicoloErr(); + assertTrue(rispostaControlli.isrBoolean()); + } + + @Test + public void verificaPartizioneFascicoloByAaStrutKo_queryIsOk() { + final RispostaControlli rispostaControlli = helper + .verificaPartizioneFascicoloByAaStrutKo(getVersFascicoloExt()); + assertTrue(rispostaControlli.isrBoolean()); + } + + @Test + public void cercaFascicoloKo_queryIsOk() { + final RispostaControlli rispostaControlli = helper.cercaFascicoloKo(getVersFascicoloExt()); + assertTrue(rispostaControlli.isrBoolean()); + } + + @Test + public void aggiornaConteggioMonContaFasKo_queryIsOk() { + VrsFascicoloKo vrsFascicoloKo = new VrsFascicoloKo(); + vrsFascicoloKo.setOrgStrut(new OrgStrut()); + vrsFascicoloKo.getOrgStrut().setIdStrut(0L); + vrsFascicoloKo.setTsIniLastSes(new Date()); + vrsFascicoloKo.setAaFascicolo(BigDecimal.valueOf(2020)); + vrsFascicoloKo.setTiStatoFascicoloKo("KO"); + vrsFascicoloKo.setDecTipoFascicolo(new DecTipoFascicolo()); + vrsFascicoloKo.getDecTipoFascicolo().setIdTipoFascicolo(0L); + helper.aggiornaConteggioMonContaFasKo(vrsFascicoloKo); + assertTrue(true); + } + + private VersFascicoloExt getVersFascicoloExt() { + StrutturaVersFascicolo strutturaComponenti = new StrutturaVersFascicolo(); + strutturaComponenti.setIdStruttura(0L); + CSChiaveFasc chiaveNonVerificata = new CSChiaveFasc(); + chiaveNonVerificata.setAnno(2020); + chiaveNonVerificata.setNumero("999999"); + strutturaComponenti.setChiaveNonVerificata(chiaveNonVerificata); + VersFascicoloExt versamento = new VersFascicoloExt(); + versamento.setStrutturaComponenti(strutturaComponenti); + return versamento; + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/SalvataggioFascicoliHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/SalvataggioFascicoliHelperTest.java new file mode 100644 index 0000000..6e27c17 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versFascicoli/ejb/SalvataggioFascicoliHelperTest.java @@ -0,0 +1,78 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versFascicoli.ejb; + +import it.eng.parer.util.ejb.AppServerInstance; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.ejb.ControlliSemantici; +import it.eng.parer.ws.ejb.XmlFascCache; +import it.eng.parer.ws.utils.MessaggiWSCache; +import it.eng.parer.ws.versFascicoli.dto.ConfigNumFasc; +import it.eng.parer.ws.versFascicoli.dto.StrutturaVersFascicolo; +import it.eng.parer.ws.versFascicoli.dto.VersFascicoloExt; +import it.eng.parer.ws.xml.versfascicolo.ChiaveType; +import it.eng.parer.ws.xml.versfascicolo.IndiceSIPFascicolo; +import it.eng.parer.ws.xml.versfascicolo.IntestazioneType; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Collections; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class SalvataggioFascicoliHelperTest { + @Deployment + public static Archive createTestArchive() { + JavaArchive sacerWSJavaArchive = createSacerWSJavaArchive(Collections.emptyList(), + SalvataggioFascicoliHelper.class, SalvataggioFascicoliHelperTest.class, XmlFascCache.class, + AppServerInstance.class, LogSessioneFascicoliHelper.class, LogSessioneFascicoliHelperTest.class, + XmlFascCache.class, ControlliSemantici.class, MessaggiWSCache.class); + sacerWSJavaArchive.addPackages(true, "org.apache.commons.io", "it.eng.parer.ws.xml.versfascicolo", + "it.eng.parer.ws.versFascicoli.dto"); + return createEnterpriseArchive("SalvataggioFascicoliHelperTest", sacerWSJavaArchive, + createSacerLogJavaArchive()); + } + + @EJB + private SalvataggioFascicoliHelper helper; + + @Test + public void salvaWarningAATipoFascicolo_queryIsOk() { + VersFascicoloExt versamento = mockVersFascicoloExt(); + final RispostaControlli rispostaControlli = helper.salvaWarningAATipoFascicolo(versamento); + assertTrue(rispostaControlli.isrBoolean()); + } + + private VersFascicoloExt mockVersFascicoloExt() { + VersFascicoloExt versamento = new VersFascicoloExt(); + versamento.setStrutturaComponenti(new StrutturaVersFascicolo()); + versamento.getStrutturaComponenti().setConfigNumFasc(new ConfigNumFasc(230L)); + versamento.setVersamento(new IndiceSIPFascicolo()); + versamento.getVersamento().setIntestazione(new IntestazioneType()); + versamento.getVersamento().getIntestazione().setChiave(new ChiaveType()); + versamento.getVersamento().getIntestazione().getChiave().setAnno(2018); + return versamento; + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliPartizioniTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliPartizioniTest.java new file mode 100644 index 0000000..82bd5e3 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliPartizioniTest.java @@ -0,0 +1,111 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb; + +import it.eng.parer.ws.dto.CSVersatore; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.utils.CostantiDB; +import it.eng.parer.ws.versamento.dto.StrutturaVersamento; +import it.eng.parer.ws.versamento.dto.SyncFakeSessn; +import it.eng.parer.ws.versamento.dto.VersamentoExt; +import it.eng.parer.ws.xml.versReq.ChiaveType; +import it.eng.parer.ws.xml.versReq.IntestazioneType; +import it.eng.parer.ws.xml.versReq.UnitaDocumentaria; +import it.eng.parer.ws.xml.versReq.VersatoreType; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.time.ZonedDateTime; +import java.util.Arrays; + +import static it.eng.ArquillianTestUtils.*; + +@RunWith(Arquillian.class) +public class ControlliPartizioniTest { + + @Deployment + public static Archive createTestArchive() { + return createEnterpriseArchive(ControlliPartizioniTest.class.getSimpleName(), + createSacerWSJavaArchive(Arrays.asList("it.eng.parer.ws.xml.versReq"), ControlliPartizioniTest.class, + ControlliPartizioni.class, it.eng.parer.util.DateUtilsConverter.class), + createSacerLogJavaArchive()); + } + + @EJB + private ControlliPartizioni controlliPartizioni; + + @Test + public void verificaPartizioniBlob_queryIsOk() { + final CSVersatore versatore = new CSVersatore(); + versatore.setStruttura("struttura"); + final StrutturaVersamento strutV = new StrutturaVersamento(); + strutV.setIdStruttura(0L); + strutV.setTpiAbilitato(false); + strutV.setDataVersamento(ZonedDateTime.now()); + for (final CostantiDB.TipoSalvataggioFile tipoSalvataggioFile : CostantiDB.TipoSalvataggioFile.values()) { + strutV.setTipoSalvataggioFile(tipoSalvataggioFile); + final RispostaControlli rispostaControlli = controlliPartizioni.verificaPartizioniBlob(strutV, versatore); + assertNoErr(rispostaControlli); + } + } + + @Test + public void verificaPartizioniSubStrutt_queryIsOk() { + final VersamentoExt versamento = new VersamentoExt(); + versamento.setStrutturaComponenti(new StrutturaVersamento()); + versamento.getStrutturaComponenti().setIdStruttura(0L); + versamento.getStrutturaComponenti().setIdSubStruttura(0L); + versamento.getStrutturaComponenti().setDescSubStruttura("subStruttura"); + versamento.setVersamento(new UnitaDocumentaria()); + versamento.getVersamento().setIntestazione(new IntestazioneType()); + versamento.getVersamento().getIntestazione().setChiave(new ChiaveType()); + versamento.getVersamento().getIntestazione().getChiave().setAnno(2021); + versamento.getVersamento().getIntestazione().getChiave().setNumero("numero"); + versamento.getVersamento().getIntestazione().getChiave().setTipoRegistro("tipoRegistro"); + versamento.getVersamento().getIntestazione().setVersatore(new VersatoreType()); + versamento.getVersamento().getIntestazione().getVersatore().setStruttura("struttura"); + final RispostaControlli rispostaControlli = controlliPartizioni.verificaPartizioniSubStrutt(versamento); + assertNoErr(rispostaControlli); + } + + @Test + public void verificaPartizioniVers_queryIsOk() { + final StrutturaVersamento strutV = new StrutturaVersamento(); + strutV.setIdStruttura(0L); + final RispostaControlli rispostaControlli = controlliPartizioni.verificaPartizioniVers(strutV, + mockSyncFakeSessn(), "descStrutt"); + assertNoErr(rispostaControlli); + } + + private SyncFakeSessn mockSyncFakeSessn() { + final SyncFakeSessn sessione = new SyncFakeSessn(); + sessione.setTmApertura(ZonedDateTime.now()); + return sessione; + } + + @Test + public void verificaPartizioniVersStruttNull_queryIsOk() { + final RispostaControlli rispostaControlli = controlliPartizioni.verificaPartizioniVers(null, + mockSyncFakeSessn(), "descStrutt"); + assertNoErr(rispostaControlli); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliPerFirmeTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliPerFirmeTest.java new file mode 100644 index 0000000..9ac4b92 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliPerFirmeTest.java @@ -0,0 +1,185 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb; + +import it.eng.parer.entity.*; +import it.eng.parer.entity.constraint.DecServizioVerificaCompDoc; +import it.eng.parer.firma.exception.VerificaFirmaException; +import it.eng.parer.ws.dto.RispostaControlli; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Date; +import java.util.HashSet; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class ControlliPerFirmeTest { + public static final long ID_FORMATO_DOC_PDF = 1L; + public static final long ID_FORMATO_STD_PDF = 1L; + @EJB + private ControlliPerFirme helper; + + @Deployment + public static Archive createTestArchive_queryIsOk() { + return createEnterpriseArchive(ControlliPerFirmeTest.class.getSimpleName(), + createSacerWSJavaArchive( + Arrays.asList("it.eng.parer.firma.exception", "com.fasterxml.uuid.impl", + "org.apache.commons.text", "org.apache.commons.text.translate"), + ControlliPerFirme.class, ControlliPerFirmeTest.class), + createSacerLogJavaArchive()); + } + + @Test + public void getOrgStrutt_queryIsOk() { + final RispostaControlli rispostaControlli = helper.getOrgStrutt(2L); + assertNotNull(rispostaControlli.getrObject()); + } + + @Test + public void getOrgStruttAsEntity_queryIsOk() throws VerificaFirmaException { + helper.getOrgStruttAsEntity(0L); + assertTrue(true); + } + + @Test + public void getDecFormatoFileStandardAsEntity_queryIsOk() throws VerificaFirmaException { + helper.getDecFormatoFileStandardAsEntity(0L); + assertTrue(true); + } + + @Test + public void confrontaFormati_queryIsOk() { + final RispostaControlli rispostaControlli = helper.confrontaFormati(ID_FORMATO_STD_PDF, ID_FORMATO_DOC_PDF); + assertTrue(rispostaControlli.isrBoolean()); + } + + @Test + public void getDecEstensioneFiles_queryIsOk() throws VerificaFirmaException { + helper.getDecEstensioneFiles("PDF"); + assertTrue(true); + } + + @Test + public void getDecFmtFileStdFromEstensioneFiles_queryIsOk() throws VerificaFirmaException { + helper.getDecFmtFileStdFromEstensioneFiles("PDF"); + assertTrue(true); + } + + @Test + public void getDecFmtFileStandardFromTikaMimes_queryIsOk() throws VerificaFirmaException { + helper.getDecFmtFileStandardFromTikaMimes("application/pdf"); + assertTrue(true); + } + + @Test + public void getDecFmtFileStandardFromFmtMarcas_queryIsOk() throws VerificaFirmaException { + final HashSet tiFormatoFirmaMarca = new HashSet<>(); + tiFormatoFirmaMarca.add("pades"); + helper.getDecFmtFileStandardFromFmtMarcas(tiFormatoFirmaMarca); + assertTrue(true); + } + + @Test + public void getDecFmtFileStandardFromFmtDocs_queryIsOk() throws VerificaFirmaException { + helper.getDecFmtFileStandardFromFmtDocs(ID_FORMATO_DOC_PDF, "chiaveComp", "nmFormatoFileDoc"); + assertTrue(true); + } + + @Test + public void getDecFormatoFileDoc_queryIsOk() throws VerificaFirmaException { + helper.getDecFormatoFileDoc(0L); + assertTrue(true); + } + + @Test + public void getFirCertifCa_queryIsOk() throws VerificaFirmaException { + helper.getFirCertifCa(BigDecimal.ZERO, "dlDnIssuerCertifCa"); + assertTrue(true); + } + + @Test + public void getFirCrl_queryIsOk() throws VerificaFirmaException { + final FirCertifCa firCertifCa = aFirCertifCa(); + final BigDecimal niSerialCrl = BigDecimal.ZERO; + final Date dtIniCrl = new Date(); + final Date dtScadCrl = new Date(); + helper.getFirCrl(firCertifCa, niSerialCrl, dtIniCrl, dtScadCrl); + assertTrue(true); + } + + private FirCertifCa aFirCertifCa() { + final FirCertifCa firCertifCa = new FirCertifCa(); + firCertifCa.setIdCertifCa(0L); + return firCertifCa; + } + + @Test + public void getFirCertifOcsp_queryIsOk() throws VerificaFirmaException { + helper.getFirCertifOcsp(aFirCertifCa(), BigDecimal.ZERO); + assertTrue(true); + } + + @Test + public void getFirOcsp_queryIsOk() throws VerificaFirmaException { + final FirCertifOcsp firCertifOcsp = new FirCertifOcsp(); + firCertifOcsp.setIdCertifOcsp(0l); + helper.getFirOcsp(firCertifOcsp, "dsCertifIssuerName", "dsCertifSerialBase64", "dsCertifSkiBase64"); + assertTrue(true); + } + + @Test + public void getFirCertifFirmatario_queryIsOk() throws VerificaFirmaException { + helper.getFirCertifFirmatario(aFirCertifCa(), BigDecimal.ZERO); + assertTrue(true); + } + + @Test + public void getFirCertifFirmatarioIds_queryIsOk() throws VerificaFirmaException { + helper.getFirCertifFirmatarioIds(BigDecimal.ZERO, aFirCertifCa()); + assertTrue(true); + } + + @Test + public void getDecServizioVerificaCompDoc_queryIsOk() throws VerificaFirmaException { + for (DecServizioVerificaCompDoc.CdServizioVerificaCompDoc cdService : DecServizioVerificaCompDoc.CdServizioVerificaCompDoc + .values()) { + helper.getDecServizioVerificaCompDoc(cdService.name(), "cdLibrary"); + } + assertTrue(true); + } + + @Test + public void retrieveOrgEnteFor_queryIsOk() { + final OrgStrut os = new OrgStrut(); + os.setIdStrut(0L); + os.setOrgEnte(new OrgEnte()); + os.getOrgEnte().setIdEnte(0l); + helper.retrieveOrgEnteFor(os); + assertTrue(true); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliProfiliUdTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliProfiliUdTest.java new file mode 100644 index 0000000..7235ea7 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliProfiliUdTest.java @@ -0,0 +1,70 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb; + +import it.eng.parer.entity.constraint.DecModelloXsdUd; +import it.eng.parer.ws.ejb.ControlliSemantici; +import it.eng.parer.ws.utils.CostantiDB; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Arrays; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class ControlliProfiliUdTest { + + @Deployment + public static Archive createTestArchive() { + return createEnterpriseArchive(ControlliProfiliUdTest.class.getSimpleName(), + createSacerWSJavaArchive(Arrays.asList("it.eng.parer.ws.xml.versReq"), ControlliProfiliUdTest.class, + ControlliProfiliUd.class, ControlliSemantici.class), + createSacerLogJavaArchive()); + } + + @EJB + private ControlliProfiliUd controlliProfiliUd; + + @Test + public void checkXsdProfileExistence_queryIsOk() { + for (CostantiDB.TipiEntitaSacer tipiEntitaSacer : CostantiDB.TipiEntitaSacer.values()) { + for (DecModelloXsdUd.TiModelloXsdUd tiModelloXsd : DecModelloXsdUd.TiModelloXsdUd.values()) { + controlliProfiliUd.checkXsdProfileExistence(0L, tipiEntitaSacer, tiModelloXsd); + assertTrue(true); + } + } + + } + + @Test + public void getXsdProfileByVersion_queryIsOk() { + for (CostantiDB.TipiEntitaSacer tipiEntitaSacer : CostantiDB.TipiEntitaSacer.values()) { + for (DecModelloXsdUd.TiModelloXsdUd tiModelloXsd : DecModelloXsdUd.TiModelloXsdUd.values()) { + controlliProfiliUd.getXsdProfileByVersion(Arrays.asList(0L, -1L), tipiEntitaSacer, tiModelloXsd, + "versione"); + } + } + assertTrue(true); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliRappVersTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliRappVersTest.java new file mode 100644 index 0000000..8cadf8d --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliRappVersTest.java @@ -0,0 +1,67 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb; + +import it.eng.parer.ws.dto.RispostaControlli; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Arrays; + +import static it.eng.ArquillianTestUtils.*; + +@RunWith(Arquillian.class) +public class ControlliRappVersTest { + @Deployment + public static Archive createTestArchive() { + return createEnterpriseArchive(ControlliRappVersTest.class.getSimpleName(), + createSacerWSJavaArchive(Arrays.asList(""), ControlliRappVersTest.class, ControlliRappVers.class), + createSacerLogJavaArchive()); + } + + @EJB + private ControlliRappVers controlliRappVers; + + @Test + public void trovaVersSessUd() { + final RispostaControlli rispostaControlli = controlliRappVers.trovaVersSessUd(0L); + assertNoErr(rispostaControlli); + } + + @Test + public void trovaVersSessDoc() { + final RispostaControlli rispostaControlli = controlliRappVers.trovaVersSessDoc(0L, 0L); + assertNoErr(rispostaControlli); + } + + @Test + public void leggiXmlRappVersFromUd() { + final RispostaControlli rispostaControlli = controlliRappVers.leggiXmlRappVersFromUd(0L, 0L); + assertNoErr(rispostaControlli); + } + + @Test + public void leggiXmlRappVersFromDoc() { + final RispostaControlli rispostaControlli = controlliRappVers.leggiXmlRappVersFromDoc(0L, 0L); + assertNoErr(rispostaControlli); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliSubStrutTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliSubStrutTest.java new file mode 100644 index 0000000..511d896 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/ControlliSubStrutTest.java @@ -0,0 +1,61 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb; + +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.versamento.dto.DocumentoVers; +import it.eng.parer.ws.versamento.dto.StrutturaVersamento; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.Arrays; + +import static it.eng.ArquillianTestUtils.*; + +@RunWith(Arquillian.class) +public class ControlliSubStrutTest { + + @Deployment + public static Archive createTestArchive() { + return createEnterpriseArchive(ControlliSubStrutTest.class.getSimpleName(), + createSacerWSJavaArchive(Arrays.asList(""), ControlliSubStrutTest.class, ControlliSubStrut.class, + it.eng.parer.util.DateUtilsConverter.class).addPackages(true, "org.apache.poi.ss.formula"), + createSacerLogJavaArchive()); + } + + @EJB + private ControlliSubStrut controlliSubStrut; + + @Test + public void calcolaSubStrut() { + final StrutturaVersamento strutV = new StrutturaVersamento(); + strutV.setIdTipologiaUnitaDocumentaria(0L); + strutV.setDocumentiAttesi(new ArrayList<>()); + strutV.getDocumentiAttesi().add(new DocumentoVers()); + strutV.getDocumentiAttesi().get(0).setIdTipoDocumentoDB(0L); + strutV.setDataVersamento(ZonedDateTime.now()); + final RispostaControlli rispostaControlli = controlliSubStrut.calcolaSubStrut(strutV); + assertNoErr(rispostaControlli); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/LogSessioneSyncTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/LogSessioneSyncTest.java new file mode 100644 index 0000000..19b2162 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/LogSessioneSyncTest.java @@ -0,0 +1,72 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.math.BigDecimal; +import java.util.Arrays; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class LogSessioneSyncTest { + + @Deployment + public static Archive createTestArchive() { + return createEnterpriseArchive(LogSessioneSyncTest.class.getSimpleName(), + createSacerWSJavaArchive( + Arrays.asList("it.eng.parer.ws.versamento.ejb.oracleBlb", "it.eng.parerxml.xsd", + "it.eng.spagoLite.security.exception", "it.eng.spagoLite.security", + "it.eng.parer.idpjaas.logutils", "org.apache.commons.io.output"), + LogSessioneSyncTest.class, LogSessioneSync.class, it.eng.parer.ws.ejb.ControlliSemantici.class, + it.eng.parer.util.ejb.AppServerInstance.class, org.apache.commons.io.IOUtils.class, + it.eng.parer.ws.ejb.XmlVersCache.class) + .addPackages(true, "it.eng.parer.ws.xml") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader() + .getResource("WSRequestVersamento.xsd"), + "/it/eng/parer/ws/xml/versReq/WSRequestVersamento.xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader() + .getResource("WSResponseVersamento.xsd"), + "/it/eng/parer/ws/xml/versResp/WSResponseVersamento.xsd"), + createSacerLogJavaArchive()); + } + + @EJB + private LogSessioneSync logSessioneSync; + + @Test + public void getVrsDocNonVers() { + logSessioneSync.getVrsDocNonVers(0l, "tipoRegistro", BigDecimal.ZERO, "numero", "idDocumento"); + assertTrue(true); + } + + @Test + public void getVrsUnitaDocNonVers() { + logSessioneSync.getVrsUnitaDocNonVers(0l, "tipoRegistro", BigDecimal.ZERO, "numero"); + assertTrue(true); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/SalvataggioSyncTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/SalvataggioSyncTest.java new file mode 100644 index 0000000..517cbb0 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamento/ejb/SalvataggioSyncTest.java @@ -0,0 +1,102 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamento.ejb; + +import it.eng.ArquillianTestUtils; +import it.eng.parer.firma.ejb.SalvataggioFirmaManager; +import it.eng.parer.firma.ejb.VerificaFirmaReportHelper; +import it.eng.parer.ws.versamento.ejb.oracleBlb.WriteCompBlbOracle; +import it.eng.parer.ws.versamentoTpi.ejb.SalvataggioCompFS; +import it.eng.parer.ws.versamentoTpi.ejb.StatoCreaCartelle; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.xadisk.bridge.proxies.interfaces.XADiskBasicIOOperations; +import org.xadisk.connector.outbound.XADiskConnectionFactory; + +import javax.ejb.EJB; +import java.util.Arrays; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertNotNull; + +@RunWith(Arquillian.class) +public class SalvataggioSyncTest { + + @EJB + private SalvataggioSync salvataggioSync; + + @Test + public void inject_ok() { + assertNotNull(salvataggioSync); + } + + @Deployment + public static Archive createTestArchive() { + final JavaArchive sacerWSJavaArchive = createSacerWSJavaArchive( + Arrays.asList("it.eng.parer.eidas.model", "it.eng.parer.firma.exception", "it.eng.parer.firma.xml", + "org.apache.commons.compress.archivers", "org.apache.commons.compress.archivers.zip", + "eu.europa.esig.dss.ws.validation.dto", "it.eng.parer.ws.xml.versReq", + "it.eng.parer.ws.versamento.ejb.oracleBlb"), + SalvataggioSyncTest.class, SalvataggioSync.class, SalvataggioCompFS.class, + XADiskBasicIOOperations.class, XADiskConnectionFactory.class, StatoCreaCartelle.class, + WriteCompBlbOracle.class, SalvataggioFirmaManager.class, ControlliPerFirme.class, + VerificaFirmaReportHelper.class, ObjectStorageService.class).addPackages(true, "com.amazonaws") + .addAsResource(ArquillianTestUtils.class.getClassLoader().getResource("jboss-ejb3.xml"), + "META-INF/jboss-ejb3.xml"); + return createEnterpriseArchive(SalvataggioSyncTest.class.getSimpleName(), sacerWSJavaArchive, + createSacerLogJavaArchive()); + } + /* + * "java.lang.IllegalArgumentException: Can not set org.xadisk.connector.outbound.XADiskConnectionFactory field it.eng.parer.ws.versamentoTpi.ejb.SalvataggioCompFS.xadCf to org.xadisk.connector.outbound.XADiskConnectionFactoryImpl" + * ) + * + * @Test public void salvaDatiVersamento() { } + * + * @Test public void testSalvaDatiVersamento() { } + * + * @Test public void salvaWarningAARegistroUd() { } + * + * @Test public void aggiornaRegistriFiscaliUd() { } + * + * @Test public void riparaCollegamentiUdNonRisolti() { } + * + * @Test public void rimuoviUdNonVersate() { } + * + * @Test public void retrieveVrsVLisXmlUdUrnDaCalcByUd() { } + * + * @Test public void retrieveVrsVLisXmlDocUrnDaCalcByDoc() { } + * + * @Test public void retrieveAroUpdUnitaDocByUd() { } + * + * @Test public void retrieveVrsVLisXmlUpdUrnDaCalcByUpd() { } + * + * @Test public void rimuoviSessVersDocErrate() { } + * + * @Test public void salvaDatiWarning() { } + * + * @Test public void retrieveSerVLisVerserByUpdUd() { } + * + * @Test public void retrieveFasVLisFascByUpdUd() { } + * + * @Test public void recuperaProgressivoVersione() { } + */ +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoTpi/ejb/SalvataggioCompFSTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoTpi/ejb/SalvataggioCompFSTest.java new file mode 100644 index 0000000..3c7f673 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoTpi/ejb/SalvataggioCompFSTest.java @@ -0,0 +1,109 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamentoTpi.ejb; + +import it.eng.ArquillianTestUtils; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.versamento.dto.StrutturaVersamento; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.xadisk.bridge.proxies.interfaces.XADiskBasicIOOperations; + +import javax.ejb.EJB; +import java.time.ZonedDateTime; +import java.util.Collections; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class SalvataggioCompFSTest { + + @Deployment + public static Archive createTestArchive() { + final JavaArchive sacerWSJavaArchive = createSacerWSJavaArchive(Collections.emptyList(), + SalvataggioCompFSTest.class, SalvataggioCompFS.class, XADiskBasicIOOperations.class, + it.eng.parer.ws.versamentoTpi.ejb.StatoCreaCartelle.class, + org.xadisk.connector.outbound.XADiskConnectionFactory.class); + sacerWSJavaArchive.addAsResource(ArquillianTestUtils.class.getClassLoader().getResource("jboss-ejb3.xml"), + "META-INF/jboss-ejb3.xml"); + return createEnterpriseArchive(SalvataggioCompFSTest.class.getSimpleName(), sacerWSJavaArchive, + createSacerLogJavaArchive()); + } + + @EJB + private SalvataggioCompFS salvataggioCompFS; + + @Test + public void injectOk() { + assertNotNull(salvataggioCompFS); + } + + @Test + @Ignore("java.lang.IllegalArgumentException: Can not set org.xadisk.connector.outbound.XADiskConnectionFactory field it.eng.parer.ws.versamentoTpi.ejb.SalvataggioCompFS.xadCf to org.xadisk.connector.outbound.XADiskConnectionFactoryImpl") + public void verificaDirTPIDataViaDb_queryIsOk() { + final StrutturaVersamento versamento = mockStrutturaVersamento(); + final RispostaControlli rispostaControlli = salvataggioCompFS.verificaDirTPIDataViaDb(versamento, + new StatoCreaCartelle(), 1); + assertTrue(rispostaControlli.isrBoolean()); + } + + private StrutturaVersamento mockStrutturaVersamento() { + final StrutturaVersamento versamento = new StrutturaVersamento(); + versamento.setDataVersamento(ZonedDateTime.now()); + versamento.setTpiRootTpiDaSacer("tpiRootSacer"); + versamento.setTpiRootVers("tpiRootVers"); + versamento.setSubPathDataVers("subPathDataVers"); + versamento.setIdStruttura(0L); + versamento.setTpiRootTpi("tipiRootTpi"); + return versamento; + } + + @Test + @Ignore("java.lang.IllegalArgumentException: Can not set org.xadisk.connector.outbound.XADiskConnectionFactory field it.eng.parer.ws.versamentoTpi.ejb.SalvataggioCompFS.xadCf to org.xadisk.connector.outbound.XADiskConnectionFactoryImpl") + + public void verificaDirTPIVersatoreViaDb_queryIsOk() { + final RispostaControlli rispostaControlli = salvataggioCompFS + .verificaDirTPIVersatoreViaDb(mockStrutturaVersamento(), new StatoCreaCartelle(), 1); + assertTrue(rispostaControlli.isrBoolean()); + } + + @Test + @Ignore("java.lang.IllegalArgumentException: Can not set org.xadisk.connector.outbound.XADiskConnectionFactory field it.eng.parer.ws.versamentoTpi.ejb.SalvataggioCompFS.xadCf to org.xadisk.connector.outbound.XADiskConnectionFactoryImpl") + + public void generaDirDataTPIBlock_queryIsOk() { + final RispostaControlli rispostaControlli = salvataggioCompFS + .generaDirVersatoreTPIBlock(mockStrutturaVersamento(), new StatoCreaCartelle()); + assertTrue(rispostaControlli.isrBoolean()); + } + + @Test + @Ignore("java.lang.IllegalArgumentException: Can not set org.xadisk.connector.outbound.XADiskConnectionFactory field it.eng.parer.ws.versamentoTpi.ejb.SalvataggioCompFS.xadCf to org.xadisk.connector.outbound.XADiskConnectionFactoryImpl") + + public void generaDirVersatoreTPIBlock_queryIsOk() { + final RispostaControlli rispostaControlli = salvataggioCompFS + .generaDirVersatoreTPIBlock(mockStrutturaVersamento(), new StatoCreaCartelle()); + assertTrue(rispostaControlli.isrBoolean()); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/ControlliUpdVersamentoTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/ControlliUpdVersamentoTest.java new file mode 100644 index 0000000..ef100c8 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/ControlliUpdVersamentoTest.java @@ -0,0 +1,138 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamentoUpd.ejb; + +import it.eng.parer.ws.dto.CSChiave; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.ejb.ControlliSemantici; +import it.eng.parer.ws.versamentoUpd.dto.StrutturaUpdVers; +import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; +import it.eng.parer.ws.xml.versUpdReq.AggiornamentoProfiloArchivisticoType; +import it.eng.parer.ws.xml.versUpdReq.AggiornamentoUnitaDocumentariaType; +import it.eng.parer.ws.xml.versUpdReq.IndiceSIPAggiornamentoUnitaDocumentaria; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Arrays; + +import static it.eng.ArquillianTestUtils.*; + +@RunWith(Arquillian.class) +public class ControlliUpdVersamentoTest { + + @Deployment + public static Archive createTestArchive() { + return createEnterpriseArchive(ControlliUpdVersamentoTest.class.getSimpleName(), + createSacerWSJavaArchive( + Arrays.asList("it.eng.parer.ws.versamentoUpd.ext", "it.eng.parer.ws.xml.versUpdReq"), + ControlliUpdVersamentoTest.class, ControlliUpdVersamento.class, ControlliSemantici.class), + createSacerLogJavaArchive()); + } + + @EJB + private ControlliUpdVersamento controlliUpdVersamento; + + @Test + public void checkUltimoSIPWithHashBinary() { + final RispostaControlli rispostaControlli = controlliUpdVersamento.checkUltimoSIPWithHashBinary("descKey", 0l, + "sipxml"); + assertNoErr(rispostaControlli); + } + + @Test + public void checkTipoUDRegIamUserOrganizzazione() { + final RispostaControlli rispostaControlli = controlliUpdVersamento + .checkTipoUDRegIamUserOrganizzazione(mockCsChiave(), "descTipologiaUnitaDocumentaria", 0l, 0l, 0l, 0l); + assertNoErr(rispostaControlli); + } + + @Test + public void getUpdFlagsFromTipoUDOrgStrut() { + RispostaControlli rispostaControlli = controlliUpdVersamento.getUpdFlagsFromTipoUDOrgStrut(0l, false); + assertNoErr(rispostaControlli); + rispostaControlli = controlliUpdVersamento.getUpdFlagsFromTipoUDOrgStrut(0l, true); + assertNoErr(rispostaControlli); + } + + @Test + public void checkIdDocumentoInUD() { + final RispostaControlli rispostaControlli = controlliUpdVersamento.checkIdDocumentoInUD(0l, "idDoc", + "descChiaveDoc"); + assertNoErr(rispostaControlli); + } + + @Test + public void checkTipoDocRegIamUserOrganizzazione() { + final RispostaControlli rispostaControlli = controlliUpdVersamento + .checkTipoDocRegIamUserOrganizzazione("tipoDoc", 0l, 0l, 0l); + assertNoErr(rispostaControlli); + } + + @Test + public void checkIdComponenteInDoc() { + final RispostaControlli rispostaControlli = controlliUpdVersamento.checkIdComponenteInDoc(0l, 0, + "descChiaveComp"); + assertNoErr(rispostaControlli); + } + + @Test + public void checkAroStrutDocAndTipo() { + final RispostaControlli rispostaControlli = controlliUpdVersamento.checkAroStrutDocAndTipo(0L); + assertNoErr(rispostaControlli); + } + + @Test + public void checkFascicoliSecondari() { + final UpdVersamentoExt versamento = new UpdVersamentoExt(); + versamento.setStrutturaUpdVers(new StrutturaUpdVers()); + versamento.getStrutturaUpdVers().setIdStruttura(0L); + versamento.getStrutturaUpdVers().setIdUd(0L); + versamento.setVersamento(new IndiceSIPAggiornamentoUnitaDocumentaria()); + versamento.getVersamento().setUnitaDocumentaria(new AggiornamentoUnitaDocumentariaType()); + versamento.getVersamento().getUnitaDocumentaria() + .setProfiloArchivistico(new AggiornamentoProfiloArchivisticoType()); + versamento.getVersamento().getUnitaDocumentaria().getProfiloArchivistico() + .setFascicoliSecondari(new AggiornamentoProfiloArchivisticoType.FascicoliSecondari()); + versamento.getVersamento().getUnitaDocumentaria().getProfiloArchivistico().getFascicoliSecondari(); + final RispostaControlli rispostaControlli = controlliUpdVersamento.checkFascicoliSecondari(versamento); + assertNoErr(rispostaControlli); + } + + @Test + public void checkChiaveAndTipoDocPrinc() { + for (ControlliSemantici.TipiGestioneUDAnnullate tipiGestioneUDAnnullate : ControlliSemantici.TipiGestioneUDAnnullate + .values()) { + final RispostaControlli rispostaControlli = controlliUpdVersamento + .checkChiaveAndTipoDocPrinc(mockCsChiave(), 0l, tipiGestioneUDAnnullate); + assertNoErr(rispostaControlli); + + } + } + + private CSChiave mockCsChiave() { + final CSChiave key = new CSChiave(); + key.setNumero("2021"); + key.setTipoRegistro("tipoRegistro"); + key.setAnno(2021L); + return key; + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/LogSessioneUpdVersamentoHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/LogSessioneUpdVersamentoHelperTest.java new file mode 100644 index 0000000..f927e9b --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/LogSessioneUpdVersamentoHelperTest.java @@ -0,0 +1,143 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamentoUpd.ejb.help; + +import it.eng.parer.entity.*; +import it.eng.parer.ws.dto.CSChiave; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.utils.MessaggiWSBundle; +import it.eng.parer.ws.versamento.dto.SyncFakeSessn; +import it.eng.parer.ws.versamento.ejb.LogSessioneSyncTest; +import it.eng.parer.ws.versamentoUpd.dto.StrutturaUpdVers; +import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.math.BigDecimal; +import java.time.ZonedDateTime; +import java.util.Arrays; +import java.util.Date; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.*; + +@RunWith(Arquillian.class) +public class LogSessioneUpdVersamentoHelperTest { + @Test + public void itWorks() { + assertTrue(true); + } + + @EJB + private LogSessioneUpdVersamentoHelper helper; + + @Deployment + public static Archive createTestArchive() { + return createEnterpriseArchive(LogSessioneUpdVersamentoHelperTest.class.getSimpleName(), + createSacerWSJavaArchive( + Arrays.asList("it.eng.parer.ws.versamentoUpd.ext", "it.eng.parer.ws.xml.versUpdReq", + "it.eng.parer.ws.xml.versUpdResp"), + LogSessioneUpdVersamentoHelperTest.class, LogSessioneUpdVersamentoHelper.class, + it.eng.parer.ws.ejb.XmlUpdVersCache.class, it.eng.parer.util.ejb.AppServerInstance.class, + it.eng.parer.ws.ejb.ControlliSemantici.class, + it.eng.parer.util.ejb.help.ConfigurationHelper.class, it.eng.parerxml.xsd.FileXSD.class, + it.eng.parerxml.xsd.FileXSDUtil.class, it.eng.parer.util.DateUtilsConverter.class) + .addAsResource( + LogSessioneSyncTest.class.getClassLoader() + .getResource("WSRequestAggiornamentoVersamento_1.5.xsd"), + "/it/eng/parer/ws/xml/versAggiornamentoReq/WSRequestAggiornamentoVersamento_1.5..xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader() + .getResource("WSResponseAggiornamentoVersamento_1.5..xsd"), + "it/eng/parer/ws/xml/versAggiornamentoResp/WSResponseAggiornamentoVersamento_1.5.xsd"), + createSacerLogJavaArchive()); + } + + private UpdVersamentoExt mockUpdVersamentoExt() { + final UpdVersamentoExt versamento = new UpdVersamentoExt(); + versamento.setStrutturaUpdVers(new StrutturaUpdVers()); + versamento.getStrutturaUpdVers().setIdStruttura(0L); + versamento.getStrutturaUpdVers().setIdUd(0L); + versamento.getStrutturaUpdVers().setChiaveNonVerificata(new CSChiave()); + versamento.getStrutturaUpdVers().getChiaveNonVerificata().setAnno(-2020L); + versamento.getStrutturaUpdVers().getChiaveNonVerificata().setNumero("11051985"); + versamento.getStrutturaUpdVers().getChiaveNonVerificata().setTipoRegistro("NON_ESISTE"); + return versamento; + } + + @Test + public void recuperoUpdUnitaDocOk_queryIsOk() { + final SyncFakeSessn sessione = new SyncFakeSessn(); + sessione.setTmApertura(ZonedDateTime.now()); + final RispostaControlli rispostaControlli = helper.recuperoUpdUnitaDocOk(mockUpdVersamentoExt(), sessione); + assertTrue(rispostaControlli.isrBoolean()); + } + + @Test + public void cercaAggiornamentoKo_queryIsOk() { + final RispostaControlli rispostaControlli = helper.cercaAggiornamentoKo(mockUpdVersamentoExt()); + assertTrue(rispostaControlli.isrBoolean()); + } + + @Test + public void lockAndGetMonContaSesUpdUdKo_queryIsOk() { + final RispostaControlli rispostaControlli = helper.lockAndGetMonContaSesUpdUdKo(mockVrsUpdUnitaDocKo()); + assertTrue(rispostaControlli.isrBoolean()); + } + + private VrsUpdUnitaDocKo mockVrsUpdUnitaDocKo() { + final VrsUpdUnitaDocKo updUnitaDocKo = new VrsUpdUnitaDocKo(); + updUnitaDocKo.setOrgStrut(new OrgStrut()); + updUnitaDocKo.getOrgStrut().setIdStrut(0L); + updUnitaDocKo.setAaKeyUnitaDoc(BigDecimal.ZERO); + updUnitaDocKo.setDecRegistroUnitaDocLast(new DecRegistroUnitaDoc()); + updUnitaDocKo.getDecRegistroUnitaDocLast().setIdRegistroUnitaDoc(0L); + updUnitaDocKo.setDecTipoDocPrincLast(new DecTipoDoc()); + updUnitaDocKo.getDecTipoDocPrincLast().setIdTipoDoc(0L); + updUnitaDocKo.setDecTipoUnitaDocLast(new DecTipoUnitaDoc()); + updUnitaDocKo.getDecTipoUnitaDocLast().setIdTipoUnitaDoc(0L); + return updUnitaDocKo; + } + + @Test + public void aggiornaConteggioMonContaSesUpdUdKo_queryIsOk() { + final VrsSesUpdUnitaDocKo vrsSesUpdUnitaDocKo = new VrsSesUpdUnitaDocKo(); + vrsSesUpdUnitaDocKo.setTsIniSes(new Date()); + final MonKeyTotalUdKo monKeyTotalUdKo = new MonKeyTotalUdKo(); + monKeyTotalUdKo.setIdKeyTotalUdKo(0L); + for (it.eng.parer.entity.constraint.VrsSesUpdUnitaDocKo.TiStatoSesUpdKo tiStatoSesUpdKo : it.eng.parer.entity.constraint.VrsSesUpdUnitaDocKo.TiStatoSesUpdKo + .values()) { + vrsSesUpdUnitaDocKo.setTiStatoSesUpdKo(tiStatoSesUpdKo); + RispostaControlli rispostaControlli = helper.aggiornaConteggioMonContaSesUpdUdKo(vrsSesUpdUnitaDocKo, + monKeyTotalUdKo, false); + assertTrue(rispostaControlli.isrBoolean()); + + } + } + + @Test + public void verificaDataAttivazioneJob_queryIsOk() { + final RispostaControlli rispostaControlli = helper.verificaDataAttivazioneJob(); + assertTrue(rispostaControlli.isrBoolean()); + } + +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioPregVersamentoAroHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioPregVersamentoAroHelperTest.java new file mode 100644 index 0000000..3c2b74b --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioPregVersamentoAroHelperTest.java @@ -0,0 +1,76 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamentoUpd.ejb.help; + +import it.eng.parer.ws.versamento.ejb.LogSessioneSyncTest; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Arrays; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class SalvataggioPregVersamentoAroHelperTest { + + @Deployment + public static Archive createTestArchive() { + JavaArchive sacerWSJavaArchive = createSacerWSJavaArchive( + Arrays.asList("it.eng.parer.ws.xml.versUpdReq", "it.eng.parer.ws.xml.versReq", + "it.eng.parer.ws.versamentoUpd.ext", "it.eng.parer.ws.xml.versUpdResp", "it.eng.parerxml.xsd"), + SalvataggioPregVersamentoAroHelper.class, SalvataggioPregVersamentoAroHelperTest.class, + it.eng.parer.ws.versamentoUpd.ejb.help.SalvataggioUpdVersamentoBaseHelper.class, + it.eng.parer.ws.ejb.XmlUpdVersCache.class, it.eng.parer.ws.ejb.XmlVersCache.class, + it.eng.parer.util.ejb.AppServerInstance.class, + it.eng.parer.ws.versamentoUpd.ejb.help.LogSessioneUpdVersamentoHelper.class, + it.eng.parer.ws.versamentoUpd.ejb.help.LogSessioneUpdVersamentoHelper.class, + it.eng.parer.ws.ejb.ControlliSemantici.class, it.eng.parer.util.ejb.help.ConfigurationHelper.class, + it.eng.parer.ws.xml.versReqMultiMedia.IndiceMM.class) + .addAsResource( + LogSessioneSyncTest.class.getClassLoader() + .getResource("WSRequestAggiornamentoVersamento_1.5.xsd"), + "/it/eng/parer/ws/xml/versAggiornamentoReq/WSRequestAggiornamentoVersamento_1.5.xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader() + .getResource("WSResponseAggiornamentoVersamento_1.5.xsd"), + "it/eng/parer/ws/xml/versAggiornamentoResp/WSResponseAggiornamentoVersamento_1.5.xsd"); + return createEnterpriseArchive(SalvataggioPregVersamentoAroHelperTest.class.getSimpleName(), sacerWSJavaArchive, + createSacerLogJavaArchive()); + } + + @Test + public void todo() { + assertTrue(true); + } + + @EJB + private SalvataggioPregVersamentoAroHelper helper; + + @Test + public void retrieveVrsVLisXmlDocUrnDaCalcByDoc() { + + helper.retrieveVrsVLisXmlDocUrnDaCalcByDoc(0L); + assertTrue(true); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoAroHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoAroHelperTest.java new file mode 100644 index 0000000..9c49252 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoAroHelperTest.java @@ -0,0 +1,105 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamentoUpd.ejb.help; + +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.utils.CostantiDB; +import it.eng.parer.ws.versamento.ejb.LogSessioneSyncTest; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Arrays; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class SalvataggioUpdVersamentoAroHelperTest { + + @EJB + private SalvataggioUpdVersamentoAroHelper helper; + + @Deployment + public static Archive createTestArchive() { + final JavaArchive sacerWSJavaArchive = createSacerWSJavaArchive( + Arrays.asList("it.eng.parer.ws.versamentoUpd.ext", "it.eng.parer.ws.versamentoUpd.ext", + "it.eng.parer.ws.xml.versUpdReq", "it.eng.parer.ws.xml.versUpdResp", + "it.eng.parer.ws.xml.versReq", "it.eng.parer.ws.xml.versReqMultiMedia", + "it.eng.parer.ws.xml.versResp"), + SalvataggioUpdVersamentoAroHelper.class, SalvataggioUpdVersamentoAroHelperTest.class, + it.eng.parer.ws.versamentoUpd.ejb.help.SalvataggioUpdVersamentoBaseHelper.class, + it.eng.parer.ws.ejb.XmlUpdVersCache.class, it.eng.parer.ws.ejb.XmlVersCache.class, + it.eng.parer.util.ejb.AppServerInstance.class, + it.eng.parer.ws.versamentoUpd.ejb.help.LogSessioneUpdVersamentoHelper.class, + it.eng.parer.ws.ejb.ControlliSemantici.class, it.eng.parer.util.ejb.help.ConfigurationHelper.class, + it.eng.parerxml.xsd.FileXSD.class, it.eng.parerxml.xsd.FileXSDUtil.class, + it.eng.parer.util.DateUtilsConverter.class, it.eng.parer.ws.xml.versReqMultiMedia.IndiceMM.class) + .addAsResource( + LogSessioneSyncTest.class.getClassLoader() + .getResource("WSRequestAggiornamentoVersamento_1.5.xsd"), + "/it/eng/parer/ws/xml/versAggiornamentoReq/WSRequestAggiornamentoVersamento_1.5.xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader() + .getResource("WSResponseAggiornamentoVersamento_1.5.xsd"), + "it/eng/parer/ws/xml/versAggiornamentoResp/WSResponseAggiornamentoVersamento_1.5.xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader().getResource("WSRequestVersamento.xsd"), + "/it/eng/parer/ws/xml/versReq/WSRequestVersamento.xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader().getResource("WSResponseVersamento.xsd"), + "/it/eng/parer/ws/xml/versResp/WSResponseVersamento.xsd"); + return createEnterpriseArchive(SalvataggioUpdVersamentoAroHelperTest.class.getSimpleName(), sacerWSJavaArchive, + createSacerLogJavaArchive()); + } + + @Test + public void retrieveSerVLisVerserByUpdUd() { + helper.retrieveSerVLisVerserByUpdUd(0L); + Assert.assertTrue(true); + } + + @Test + public void retrieveFasVLisFascByUpdUd() { + helper.retrieveFasVLisFascByUpdUdId(0L); + Assert.assertTrue(true); + } + + @Test + public void checkUsoXsdDatiSpecifici() { + + for (CostantiDB.TipiUsoDatiSpec tiUsoXsd : CostantiDB.TipiUsoDatiSpec.values()) { + for (CostantiDB.TipiEntitaSacer tiEntitaSacer : CostantiDB.TipiEntitaSacer.values()) { + final RispostaControlli rispostaControlli = helper.checkUsoXsdDatiSpecifici(0L, tiUsoXsd, + tiEntitaSacer); + assertTrue(rispostaControlli.isrBoolean()); + } + } + } + + @Test + public void getAroValoreAttribDatiSpecs() { + final RispostaControlli rispostaControlli = helper.getAroValoreAttribDatiSpecs(0L, 0L, 0L); + assertTrue(rispostaControlli.isrBoolean()); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoBaseHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoBaseHelperTest.java new file mode 100644 index 0000000..1e94ca3 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoBaseHelperTest.java @@ -0,0 +1,92 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamentoUpd.ejb.help; + +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.utils.CostantiDB; +import it.eng.parer.ws.versamento.ejb.LogSessioneSyncTest; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Arrays; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.*; + +@RunWith(Arquillian.class) +public class SalvataggioUpdVersamentoBaseHelperTest { + + @Deployment + public static Archive createTestArchive() { + final JavaArchive sacerWSJavaArchive = createSacerWSJavaArchive( + Arrays.asList("it.eng.parer.ws.versamentoUpd.ext", "it.eng.parer.ws.versamentoUpd.ext", + "it.eng.parer.ws.xml.versUpdReq", "it.eng.parer.ws.xml.versUpdResp", + "it.eng.parer.ws.xml.versReq", "it.eng.parer.ws.xml.versReqMultiMedia", + "it.eng.parer.ws.xml.versResp"), + SalvataggioUpdVersamentoAroHelper.class, SalvataggioUpdVersamentoBaseHelper.class, + SalvataggioUpdVersamentoBaseHelperTest.class, it.eng.parer.ws.ejb.XmlUpdVersCache.class, + it.eng.parer.ws.ejb.XmlVersCache.class, it.eng.parer.util.ejb.AppServerInstance.class, + it.eng.parer.ws.versamentoUpd.ejb.help.LogSessioneUpdVersamentoHelper.class, + it.eng.parer.ws.ejb.ControlliSemantici.class, it.eng.parer.util.ejb.help.ConfigurationHelper.class, + it.eng.parerxml.xsd.FileXSD.class, it.eng.parerxml.xsd.FileXSDUtil.class, + it.eng.parer.util.DateUtilsConverter.class, it.eng.parer.ws.xml.versReqMultiMedia.IndiceMM.class) + .addAsResource( + LogSessioneSyncTest.class.getClassLoader() + .getResource("WSRequestAggiornamentoVersamento_1.5.xsd"), + "/it/eng/parer/ws/xml/versAggiornamentoReq/WSRequestAggiornamentoVersamento_1.5.xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader() + .getResource("WSResponseAggiornamentoVersamento_1.5.xsd"), + "it/eng/parer/ws/xml/versAggiornamentoResp/WSResponseAggiornamentoVersamento_1.5.xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader().getResource("WSRequestVersamento.xsd"), + "/it/eng/parer/ws/xml/versReq/WSRequestVersamento.xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader().getResource("WSResponseVersamento.xsd"), + "/it/eng/parer/ws/xml/versResp/WSResponseVersamento.xsd"); + return createEnterpriseArchive(SalvataggioUpdVersamentoBaseHelperTest.class.getSimpleName(), sacerWSJavaArchive, + createSacerLogJavaArchive()); + } + + @EJB + // serve un'istanza concreta, la classe SalvataggioUpdVersamentoBaseHelper è astratta + private SalvataggioUpdVersamentoAroHelper helper; + + @Test + public void checkUsoXsdDatiSpecifici() { + + for (CostantiDB.TipiUsoDatiSpec tiUsoXsd : CostantiDB.TipiUsoDatiSpec.values()) { + for (CostantiDB.TipiEntitaSacer tiEntitaSacer : CostantiDB.TipiEntitaSacer.values()) { + final RispostaControlli rispostaControlli = helper.checkUsoXsdDatiSpecifici(0L, tiUsoXsd, + tiEntitaSacer); + assertTrue(rispostaControlli.isrBoolean()); + } + } + } + + @Test + public void getAroValoreAttribDatiSpecs() { + final RispostaControlli rispostaControlli = helper.getAroValoreAttribDatiSpecs(0L, 0L, 0L); + assertTrue(rispostaControlli.isrBoolean()); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoIniHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoIniHelperTest.java new file mode 100644 index 0000000..5345dd5 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoIniHelperTest.java @@ -0,0 +1,91 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamentoUpd.ejb.help; + +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.versamento.ejb.LogSessioneSyncTest; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Arrays; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.*; + +@RunWith(Arquillian.class) +public class SalvataggioUpdVersamentoIniHelperTest { + + @Deployment + public static Archive createTestArchive() { + final JavaArchive sacerWSJavaArchive = createSacerWSJavaArchive( + Arrays.asList("it.eng.parer.ws.versamentoUpd.ext", "it.eng.parer.ws.versamentoUpd.ext", + "it.eng.parer.ws.xml.versUpdReq", "it.eng.parer.ws.xml.versUpdResp", + "it.eng.parer.ws.xml.versReq", "it.eng.parer.ws.xml.versReqMultiMedia", + "it.eng.parer.ws.xml.versResp"), + SalvataggioUpdVersamentoIniHelper.class, SalvataggioUpdVersamentoIniHelperTest.class, + it.eng.parer.ws.versamentoUpd.ejb.help.SalvataggioUpdVersamentoBaseHelper.class, + it.eng.parer.ws.ejb.XmlUpdVersCache.class, it.eng.parer.ws.ejb.XmlVersCache.class, + it.eng.parer.util.ejb.AppServerInstance.class, + it.eng.parer.ws.versamentoUpd.ejb.help.LogSessioneUpdVersamentoHelper.class, + it.eng.parer.ws.ejb.ControlliSemantici.class, it.eng.parer.util.ejb.help.ConfigurationHelper.class, + it.eng.parerxml.xsd.FileXSD.class, it.eng.parerxml.xsd.FileXSDUtil.class, + it.eng.parer.util.DateUtilsConverter.class, it.eng.parer.ws.xml.versReqMultiMedia.IndiceMM.class) + .addAsResource( + LogSessioneSyncTest.class.getClassLoader() + .getResource("WSRequestAggiornamentoVersamento_1.5.xsd"), + "/it/eng/parer/ws/xml/versAggiornamentoReq/WSRequestAggiornamentoVersamento_1.5.xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader() + .getResource("WSResponseAggiornamentoVersamento_1.5.xsd"), + "it/eng/parer/ws/xml/versAggiornamentoResp/WSResponseAggiornamentoVersamento_1.5.xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader().getResource("WSRequestVersamento.xsd"), + "/it/eng/parer/ws/xml/versReq/WSRequestVersamento.xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader().getResource("WSResponseVersamento.xsd"), + "/it/eng/parer/ws/xml/versResp/WSResponseVersamento.xsd"); + return createEnterpriseArchive(SalvataggioUpdVersamentoIniHelperTest.class.getSimpleName(), sacerWSJavaArchive, + createSacerLogJavaArchive()); + } + + @EJB + private SalvataggioUpdVersamentoIniHelper helper; + + @Test + public void getAroVersIniUnitaDoc() { + final RispostaControlli rispostaControlli = helper.getAroVersIniUnitaDoc(0L); + assertTrue(rispostaControlli.isrBoolean()); + } + + @Test + public void getAroVersIniDoc() { + final RispostaControlli rispostaControlli = helper.getAroVersIniDoc(0L, 0L); + assertTrue(rispostaControlli.isrBoolean()); + } + + @Test + public void getAroVersIniComp() { + final RispostaControlli rispostaControlli = helper.getAroVersIniComp(0L, 0L); + assertTrue(rispostaControlli.isrBoolean()); + } +} diff --git a/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoUpdHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoUpdHelperTest.java new file mode 100644 index 0000000..cd12137 --- /dev/null +++ b/sacerws-ejb/src/test/java/it/eng/parer/ws/versamentoUpd/ejb/help/SalvataggioUpdVersamentoUpdHelperTest.java @@ -0,0 +1,105 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.ws.versamentoUpd.ejb.help; + +import it.eng.parer.entity.AroUnitaDoc; +import it.eng.parer.entity.AroUpdUnitaDoc; +import it.eng.parer.entity.OrgSubStrut; +import it.eng.parer.ws.dto.CSChiave; +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.versamento.ejb.LogSessioneSyncTest; +import it.eng.parer.ws.versamentoUpd.dto.StrutturaUpdVers; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.ejb.EJB; +import java.util.Arrays; +import java.util.Date; + +import static it.eng.ArquillianTestUtils.*; +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class SalvataggioUpdVersamentoUpdHelperTest { + + @Deployment + public static Archive createTestArchive() { + final JavaArchive sacerWSJavaArchive = createSacerWSJavaArchive( + Arrays.asList("it.eng.parer.ws.versamentoUpd.ext", "it.eng.parer.ws.versamentoUpd.ext", + "it.eng.parer.ws.xml.versUpdReq", "it.eng.parer.ws.xml.versUpdResp", + "it.eng.parer.ws.xml.versReq", "it.eng.parer.ws.xml.versReqMultiMedia", + "it.eng.parer.ws.xml.versResp"), + SalvataggioUpdVersamentoUpdHelper.class, SalvataggioUpdVersamentoUpdHelperTest.class, + SalvataggioUpdVersamentoBaseHelper.class, it.eng.parer.ws.ejb.XmlUpdVersCache.class, + it.eng.parer.ws.ejb.XmlVersCache.class, it.eng.parer.util.ejb.AppServerInstance.class, + LogSessioneUpdVersamentoHelper.class, it.eng.parer.ws.ejb.ControlliSemantici.class, + it.eng.parer.util.ejb.help.ConfigurationHelper.class, it.eng.parerxml.xsd.FileXSD.class, + it.eng.parerxml.xsd.FileXSDUtil.class, it.eng.parer.util.DateUtilsConverter.class, + it.eng.parer.ws.xml.versReqMultiMedia.IndiceMM.class) + .addAsResource( + LogSessioneSyncTest.class.getClassLoader() + .getResource("WSRequestAggiornamentoVersamento_1.5.xsd"), + "/it/eng/parer/ws/xml/versAggiornamentoReq/WSRequestAggiornamentoVersamento_1.5.xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader() + .getResource("WSResponseAggiornamentoVersamento_1.5.xsd"), + "it/eng/parer/ws/xml/versAggiornamentoResp/WSResponseAggiornamentoVersamento_1.5.xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader().getResource("WSRequestVersamento.xsd"), + "/it/eng/parer/ws/xml/versReq/WSRequestVersamento.xsd") + .addAsResource( + LogSessioneSyncTest.class.getClassLoader().getResource("WSResponseVersamento.xsd"), + "/it/eng/parer/ws/xml/versResp/WSResponseVersamento.xsd"); + return createEnterpriseArchive(SalvataggioUpdVersamentoUpdHelperTest.class.getSimpleName(), sacerWSJavaArchive, + createSacerLogJavaArchive()); + } + + @EJB + private SalvataggioUpdVersamentoUpdHelper helper; + + @Test + public void getNextPgAroUpdUnitaDoc_queryIsOk() { + final RispostaControlli rispostaControlli = helper.getNextPgAroUpdUnitaDoc(0L); + assertTrue(rispostaControlli.isrBoolean()); + } + + @Test + public void scriviMonKeyTotalUd_queryIsOk() { + final AroUnitaDoc tmpAroUnitaDoc = new AroUnitaDoc(); + tmpAroUnitaDoc.setOrgSubStrut(new OrgSubStrut()); + tmpAroUnitaDoc.getOrgSubStrut().setIdSubStrut(0L); + final AroUpdUnitaDoc tmpAroUpdUnitaDoc = new AroUpdUnitaDoc(); + tmpAroUpdUnitaDoc.setTsIniSes(new Date()); + final StrutturaUpdVers strutturaUpdVers = new StrutturaUpdVers(); + strutturaUpdVers.setIdStruttura(0L); + strutturaUpdVers.setChiaveNonVerificata(new CSChiave()); + strutturaUpdVers.getChiaveNonVerificata().setAnno(2021L); + strutturaUpdVers.setIdRegistro(0L); + strutturaUpdVers.setIdTipologiaUnitaDocumentaria(0L); + strutturaUpdVers.setIdTipoDocPrincipale(0L); + try { + helper.scriviMonKeyTotalUd(tmpAroUnitaDoc, tmpAroUpdUnitaDoc, strutturaUpdVers); + } catch (Exception e) { + assertTrue(exceptionMessageContains(e, "TransientPropertyValueException")); + } + } +} diff --git a/sacerws-ejb/src/test/resources/WSRequestAggiornamentoVersamento_1.4.xsd b/sacerws-ejb/src/test/resources/WSRequestAggiornamentoVersamento_1.4.xsd new file mode 100644 index 0000000..27f8e78 --- /dev/null +++ b/sacerws-ejb/src/test/resources/WSRequestAggiornamentoVersamento_1.4.xsd @@ -0,0 +1,756 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tag aggiornabile; se non definito si intende che non deve essere aggiornato + + + + + + tag aggiornabile; se non definito si intende che non deve essere aggiornato + + + + + + + in aggiornamento metadati FascicoloSecondario ha minOccurs = 0 per consentire la cancellazione di tutti i fascicoli secondari + i fascicoli seocndari sono eliminati e poi reinseriti + + + + + + + + + + + + + + + tag aggiornabile; se non definito si annulla il valore + + + + + tag aggiornabile; se non definito si annulla il valore + + + + + tag aggiornabile; se non definito si annulla il valore + + + + + + + + + + + + + + + + + + tag aggiornabile; se non definito si annulla il valore + + + + + tag aggiornabile; se non definito si annulla il valore + + + + + + + + + + + + tag aggiornabile + + + + + + i dati specifici sono eliminati e reinseriti + + + + + + + + + + + + + + + + + + + + + + + + + + + in aggiornamento metadati DocumentoCollegato ha minOccurs = 0 per consentire la cancellazione di tutti i collegamenti + i collegamenti sono eliminati e reinseriti + + + + + + + + + + + + + + + + + + + + tag non e' aggiornabile + + + + + tag non e' aggiornabile + + + + + tag aggiornabile; se non definito si intende che non si deve aggiornare + + + + + + tag aggiornabile; se non definito si intende che non si deve aggiornare + + + + + tag aggiornabile; se non definito si intende che non si deve aggiornare + + + + + + se non definito si intende che non si devono aggiornare i componenti + + + + + + + + + + + tag aggiornabile; se non definito si annulla il valore + + + + + tag aggiornabile; se non definito si annulla il valore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tag non aggiornabile + + + + + + + + + + + + + + + + + + + + tag non e' aggiornabile + + + + + tag non e' aggiornabile + + + + + tag non e' aggiornabile + + + + + tag non e' aggiornabile + + + + + tag non e' aggiornabile + + + + + + tag non e' aggiornabile + + + + + + tag e' aggiornabile; se non definito si annulla il valore + + + + + + tag non e' aggiornabile + + + + + tag non e' aggiornabile + + + + + + tag e' aggiornabile; se non definito si annulla il valore + + + + + tag e' aggiornabile; se non definito si annulla il valore + + + + + + tag aggiornabile; se non definito si intende che non si deve aggiornare + + + + + tag aggiornabile; se non definito si intende che non si deve aggiornare + + + + + + tag non e' aggiornabile + + + + + tag non e' aggiornabile + + + + + tag non e' aggiornabile + + + + + + tag non e' aggiornabile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tag non aggiornabile + + + + + tag non aggiornabile + + + + + tag aggiornabile; se non definito si intende che non si deve aggiornare + + + + + tag aggiornabile; se non definito si intende che non si deve aggiornare + + + + + + tag aggiornabile; se non definito si intende che non si deve aggiornare + + + + + tag aggiornabile; se non definito si intende che non si deve aggiornare + + + + + + tag aggiornabile; se non definito si intende che non si deve aggiornare + + + + + + Numero allegati presenti nel SIP di aggiornamento metadati + + + + + Numero annessi presenti nel SIP di aggiornamento metadati + + + + + Numero annotazioni presenti nel SIP di aggiornamento metadati + + + + + + + tag aggiornabile; se non definito si intende che non si deve aggiornare + + + + + + tag aggiornabile; se non definito si intende che non si deve aggiornare + + + + + + + + + + tag aggiornabile; se non definito si intende che non si deve aggiornare + + + + + + + + + + tag aggiornabile; se non definito si intende che non si deve aggiornare + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sacerws-ejb/src/test/resources/WSRequestIndiceSIPFascicolo_1.0.xsd b/sacerws-ejb/src/test/resources/WSRequestIndiceSIPFascicolo_1.0.xsd new file mode 100644 index 0000000..b6e67b0 --- /dev/null +++ b/sacerws-ejb/src/test/resources/WSRequestIndiceSIPFascicolo_1.0.xsd @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sacerws-ejb/src/test/resources/WSRequestVersamento.xsd b/sacerws-ejb/src/test/resources/WSRequestVersamento.xsd new file mode 100644 index 0000000..a489789 --- /dev/null +++ b/sacerws-ejb/src/test/resources/WSRequestVersamento.xsd @@ -0,0 +1,439 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sacerws-ejb/src/test/resources/WSResponseAggiornamentoVersamento_1.4.xsd b/sacerws-ejb/src/test/resources/WSResponseAggiornamentoVersamento_1.4.xsd new file mode 100644 index 0000000..6f50289 --- /dev/null +++ b/sacerws-ejb/src/test/resources/WSResponseAggiornamentoVersamento_1.4.xsd @@ -0,0 +1,315 @@ + + + + + + + + + + + + + + + + + + + + + + + + il tag ha stesso valore del tag VersioneEsitoAggiornamento + + + + + + + il tag contiene urn:RapportoVersamento:ambiente:ente:struttura:registro-anno-numero:progressivo aggiornamento + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + contiene urn:IndiceSIP:ambiente:ente:struttura:registro-anno-numero:progressivo aggiornamento + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + il valore e' definito dal tipo ud o dalla struttura + + + + + + + il valore e' definito dal XML in input + + + + + + + il valore e' definito dal XML in input o dal tipo ud o dalla struttura + + + + + + + il valore e' definito dal tipo ud o dalla struttura + + + + + + + il valore e' dalla unita doc in aggiornamento + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sacerws-ejb/src/test/resources/WSResponseVersamento.xsd b/sacerws-ejb/src/test/resources/WSResponseVersamento.xsd new file mode 100644 index 0000000..1592d38 --- /dev/null +++ b/sacerws-ejb/src/test/resources/WSResponseVersamento.xsd @@ -0,0 +1,626 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sacerws-ejb/src/test/resources/ejb-jar-paginator.xml b/sacerws-ejb/src/test/resources/ejb-jar-paginator.xml new file mode 100644 index 0000000..cf4b035 --- /dev/null +++ b/sacerws-ejb/src/test/resources/ejb-jar-paginator.xml @@ -0,0 +1,8 @@ + + + + paginator + diff --git a/sacerws-ejb/src/test/resources/ejb-jar-sacerlog.xml b/sacerws-ejb/src/test/resources/ejb-jar-sacerlog.xml new file mode 100644 index 0000000..59d32a7 --- /dev/null +++ b/sacerws-ejb/src/test/resources/ejb-jar-sacerlog.xml @@ -0,0 +1,9 @@ + + + + + sacerlog-ejb + diff --git a/sacerws-ejb/src/test/resources/ejb-jar.xml b/sacerws-ejb/src/test/resources/ejb-jar.xml new file mode 100644 index 0000000..dc97a95 --- /dev/null +++ b/sacerws-ejb/src/test/resources/ejb-jar.xml @@ -0,0 +1,19 @@ + + + + sacerws-ejb + + + + it.eng.parer.crypto.model.exceptions.CryptoParerException + false + + + it.eng.parer.eidas.model.exception.EidasParerException + false + + + diff --git a/sacerws-ejb/src/test/resources/jboss-ejb3.xml b/sacerws-ejb/src/test/resources/jboss-ejb3.xml new file mode 100644 index 0000000..53b8d27 --- /dev/null +++ b/sacerws-ejb/src/test/resources/jboss-ejb3.xml @@ -0,0 +1,24 @@ + + + + + + + + + SalvataggioCompFS + it.eng.parer.ws.versamentoTpi.ejb.SalvataggioCompFS + + jca/xadiskLocal + java:/jca/xadiskLocal + + + + + \ No newline at end of file diff --git a/sacerws-ejb/src/test/resources/persistence.xml b/sacerws-ejb/src/test/resources/persistence.xml new file mode 100644 index 0000000..8d20cc1 --- /dev/null +++ b/sacerws-ejb/src/test/resources/persistence.xml @@ -0,0 +1,21 @@ + + + + org.hibernate.ejb.HibernatePersistence + jdbc/SacerVersDs + false + + NONE + + + + + + + + + + + + + diff --git a/sacerws-ejb/src/main/resources/sacerEjb.properties b/sacerws-ejb/src/test/resources/sacerEjb.properties similarity index 100% rename from sacerws-ejb/src/main/resources/sacerEjb.properties rename to sacerws-ejb/src/test/resources/sacerEjb.properties diff --git a/sacerws-jpa/pom.xml b/sacerws-jpa/pom.xml new file mode 100644 index 0000000..2b39d13 --- /dev/null +++ b/sacerws-jpa/pom.xml @@ -0,0 +1,160 @@ + + 4.0.0 + + it.eng.parer + sacerws + 5.2.1-SNAPSHOT + + sacerws-jpa + sacerws-jpa + + UTF-8 + 2.3.2 + + false + validate + + + + org.eclipse.persistence + org.eclipse.persistence.moxy + ${org.eclipse.persistence.moxy.version} + + + org.jboss.logging + jboss-logging + provided + + + org.jboss + jboss-vfs + ${jboss-vfs.version} + provided + + + org.jboss.spec + jboss-jakartaee-8.0 + pom + provided + + + it.eng.parer + spagofat-timer-wrapper-common + provided + + + it.eng.parer + spagofat-paginator-ejb + ejb + provided + + + + + it.eng.parer + spagofat-sl-jpa + compile + + + + org.apache.commons + commons-lang3 + + + + org.hibernate + hibernate-core + + + antlr + antlr + + + provided + + + org.hibernate.validator + hibernate-validator + provided + + + org.hibernate + hibernate-jpamodelgen + compile + + + org.slf4j + slf4j-api + + + + + + src/main/resources + true + + + + + + maven-compiler-plugin + + + -proc:none + + + + + org.bsc.maven + maven-processor-plugin + 2.2.4 + + + process + + process + + generate-sources + + + org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor + + -ApersistenceXml=${basedir}/src/main/resources/META-INF/persistence.xml + ${project.build.directory}/generated-sources/metamodel + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + extract-queries-from-sacerlog + generate-resources + + unpack-dependencies + + + ${project.build.outputDirectory} + ${project.groupId} + spagofat-sl-jpa + META-INF/xmldbNativeQueries/xmlQueries.xml + + + + + + + + + + dev + + true + none + + + + diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AplParamApplic.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AplParamApplic.java new file mode 100644 index 0000000..5ad8627 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AplParamApplic.java @@ -0,0 +1,211 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.Cacheable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlTransient; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the APL_PARAM_APPLIC database table. + */ +@Entity +@Cacheable(true) +@Table(name = "APL_PARAM_APPLIC") +public class AplParamApplic implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idParamApplic; + + private String dmParamApplic; + + private String dsParamApplic; + + private String dsListaValoriAmmessi; + + private String flAppartAaTipoFascicolo; + + private String flAppartAmbiente; + + private String flAppartApplic; + + private String flAppartStrut; + + private String flAppartTipoUnitaDoc; + + private String flMulti; + + private String nmParamApplic; + + private String tiGestioneParam; + + private String tiParamApplic; + private String tiValoreParamApplic; + + public AplParamApplic() {/* Hibernate */ + } + + @Id + @Column(name = "ID_PARAM_APPLIC") + @GenericGenerator(name = "SAPL_PARAM_APPLIC_ID_PARAM_APPLIC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SAPL_PARAM_APPLIC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SAPL_PARAM_APPLIC_ID_PARAM_APPLIC_GENERATOR") + public Long getIdParamApplic() { + return this.idParamApplic; + } + + public void setIdParamApplic(Long idParamApplic) { + this.idParamApplic = idParamApplic; + } + + @Column(name = "DM_PARAM_APPLIC") + public String getDmParamApplic() { + return this.dmParamApplic; + } + + public void setDmParamApplic(String dmParamApplic) { + this.dmParamApplic = dmParamApplic; + } + + @Column(name = "DS_PARAM_APPLIC") + public String getDsParamApplic() { + return this.dsParamApplic; + } + + public void setDsParamApplic(String dsParamApplic) { + this.dsParamApplic = dsParamApplic; + } + + @Column(name = "DS_LISTA_VALORI_AMMESSI") + public String getDsListaValoriAmmessi() { + return this.dsListaValoriAmmessi; + } + + public void setDsListaValoriAmmessi(String dsListaValoriAmmessi) { + this.dsListaValoriAmmessi = dsListaValoriAmmessi; + } + + @Column(name = "FL_APPART_AA_TIPO_FASCICOLO", columnDefinition = "char(1)") + public String getFlAppartAaTipoFascicolo() { + return this.flAppartAaTipoFascicolo; + } + + public void setFlAppartAaTipoFascicolo(String flAppartAaTipoFascicolo) { + this.flAppartAaTipoFascicolo = flAppartAaTipoFascicolo; + } + + @Column(name = "FL_APPART_AMBIENTE", columnDefinition = "char(1)") + public String getFlAppartAmbiente() { + return this.flAppartAmbiente; + } + + public void setFlAppartAmbiente(String flAppartAmbiente) { + this.flAppartAmbiente = flAppartAmbiente; + } + + @Column(name = "FL_APPART_APPLIC", columnDefinition = "char(1)") + public String getFlAppartApplic() { + return this.flAppartApplic; + } + + public void setFlAppartApplic(String flAppartApplic) { + this.flAppartApplic = flAppartApplic; + } + + @Column(name = "FL_APPART_STRUT", columnDefinition = "char(1)") + public String getFlAppartStrut() { + return this.flAppartStrut; + } + + public void setFlAppartStrut(String flAppartStrut) { + this.flAppartStrut = flAppartStrut; + } + + @Column(name = "FL_APPART_TIPO_UNITA_DOC", columnDefinition = "char(1)") + public String getFlAppartTipoUnitaDoc() { + return this.flAppartTipoUnitaDoc; + } + + public void setFlAppartTipoUnitaDoc(String flAppartTipoUnitaDoc) { + this.flAppartTipoUnitaDoc = flAppartTipoUnitaDoc; + } + + @Column(name = "FL_MULTI", columnDefinition = "char(1)") + public String getFlMulti() { + return this.flMulti; + } + + public void setFlMulti(String flMulti) { + this.flMulti = flMulti; + } + + @Column(name = "NM_PARAM_APPLIC") + public String getNmParamApplic() { + return this.nmParamApplic; + } + + public void setNmParamApplic(String nmParamApplic) { + this.nmParamApplic = nmParamApplic; + } + + @Column(name = "TI_GESTIONE_PARAM") + public String getTiGestioneParam() { + return this.tiGestioneParam; + } + + public void setTiGestioneParam(String tiGestioneParam) { + this.tiGestioneParam = tiGestioneParam; + } + + @Column(name = "TI_PARAM_APPLIC") + public String getTiParamApplic() { + return this.tiParamApplic; + } + + public void setTiParamApplic(String tiParamApplic) { + this.tiParamApplic = tiParamApplic; + } + + // MEV26587 + @Column(name = "TI_VALORE_PARAM_APPLIC") + public String getTiValoreParamApplic() { + return tiValoreParamApplic; + } + + public void setTiValoreParamApplic(String tiValoreParamApplic) { + this.tiValoreParamApplic = tiValoreParamApplic; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AplSistemaMigraz.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AplSistemaMigraz.java new file mode 100644 index 0000000..3f829a3 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AplSistemaMigraz.java @@ -0,0 +1,86 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Cacheable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlID; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the APL_SISTEMA_MIGRAZ database table. + */ +@Entity +@Cacheable(true) +@Table(name = "APL_SISTEMA_MIGRAZ") +public class AplSistemaMigraz implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idSistemaMigraz; + + private String dsSistemaMigraz; + + private String nmSistemaMigraz; + + public AplSistemaMigraz() {/* Hibernate */ + } + + @Id + @XmlID + @Column(name = "ID_SISTEMA_MIGRAZ") + @GenericGenerator(name = "SAPL_SISTEMA_MIGRAZ_ID_SISTEMA_MIGRAZ_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SAPL_SISTEMA_MIGRAZ"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SAPL_SISTEMA_MIGRAZ_ID_SISTEMA_MIGRAZ_GENERATOR") + public Long getIdSistemaMigraz() { + return this.idSistemaMigraz; + } + + public void setIdSistemaMigraz(Long idSistemaMigraz) { + this.idSistemaMigraz = idSistemaMigraz; + } + + @Column(name = "DS_SISTEMA_MIGRAZ") + public String getDsSistemaMigraz() { + return this.dsSistemaMigraz; + } + + public void setDsSistemaMigraz(String dsSistemaMigraz) { + this.dsSistemaMigraz = dsSistemaMigraz; + } + + @Column(name = "NM_SISTEMA_MIGRAZ") + public String getNmSistemaMigraz() { + return this.nmSistemaMigraz; + } + + public void setNmSistemaMigraz(String nmSistemaMigraz) { + this.nmSistemaMigraz = nmSistemaMigraz; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AplSistemaVersante.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AplSistemaVersante.java new file mode 100644 index 0000000..91e617b --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AplSistemaVersante.java @@ -0,0 +1,105 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlTransient; + +import it.eng.parer.granted_entity.UsrUser; + +/** + * The persistent class for the APL_SISTEMA_VERSANTE database table. + */ +@Entity +@Table(schema = "SACER_IAM", name = "APL_SISTEMA_VERSANTE") +public class AplSistemaVersante implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idSistemaVersante; + + private String cdVersione; + + private String dsSistemaVersante; + + private String nmSistemaVersante; + + private List usrUsers = new ArrayList<>(); + + public AplSistemaVersante() {/* Hibernate */ + } + + @Id + @Column(name = "ID_SISTEMA_VERSANTE") + public Long getIdSistemaVersante() { + return this.idSistemaVersante; + } + + public void setIdSistemaVersante(Long idSistemaVersante) { + this.idSistemaVersante = idSistemaVersante; + } + + @XmlTransient + @Column(name = "CD_VERSIONE") + public String getCdVersione() { + return this.cdVersione; + } + + public void setCdVersione(String cdVersione) { + this.cdVersione = cdVersione; + } + + @XmlTransient + @Column(name = "DS_SISTEMA_VERSANTE") + public String getDsSistemaVersante() { + return this.dsSistemaVersante; + } + + public void setDsSistemaVersante(String dsSistemaVersante) { + this.dsSistemaVersante = dsSistemaVersante; + } + + @Column(name = "NM_SISTEMA_VERSANTE") + public String getNmSistemaVersante() { + return this.nmSistemaVersante; + } + + public void setNmSistemaVersante(String nmSistemaVersante) { + this.nmSistemaVersante = nmSistemaVersante; + } + + // bi-directional many-to-one association to UsrUser + @OneToMany(mappedBy = "aplSistemaVersante") + @XmlTransient + public List getUsrUsers() { + return this.usrUsers; + } + + public void setUsrUsers(List usrUsers) { + this.usrUsers = usrUsers; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroArchivSec.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroArchivSec.java new file mode 100644 index 0000000..61275bc --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroArchivSec.java @@ -0,0 +1,145 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_ARCHIV_SEC database table. + */ +@Entity +@Table(name = "ARO_ARCHIV_SEC") +public class AroArchivSec implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idArchivSec; + + private String cdFascic; + + private String cdSottofascic; + + private String dsClassif; + + private String dsOggettoFascic; + + private String dsOggettoSottofascic; + + private BigDecimal idStrut; + + private AroUnitaDoc aroUnitaDoc; + + public AroArchivSec() {/* Hibernate */ + } + + @Id + @Column(name = "ID_ARCHIV_SEC") + @GenericGenerator(name = "SARO_ARCHIV_SEC_ID_ARCHIV_SEC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_ARCHIV_SEC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_ARCHIV_SEC_ID_ARCHIV_SEC_GENERATOR") + public Long getIdArchivSec() { + return this.idArchivSec; + } + + public void setIdArchivSec(Long idArchivSec) { + this.idArchivSec = idArchivSec; + } + + @Column(name = "CD_FASCIC") + public String getCdFascic() { + return this.cdFascic; + } + + public void setCdFascic(String cdFascic) { + this.cdFascic = cdFascic; + } + + @Column(name = "CD_SOTTOFASCIC") + public String getCdSottofascic() { + return this.cdSottofascic; + } + + public void setCdSottofascic(String cdSottofascic) { + this.cdSottofascic = cdSottofascic; + } + + @Column(name = "DS_CLASSIF") + public String getDsClassif() { + return this.dsClassif; + } + + public void setDsClassif(String dsClassif) { + this.dsClassif = dsClassif; + } + + @Column(name = "DS_OGGETTO_FASCIC") + public String getDsOggettoFascic() { + return this.dsOggettoFascic; + } + + public void setDsOggettoFascic(String dsOggettoFascic) { + this.dsOggettoFascic = dsOggettoFascic; + } + + @Column(name = "DS_OGGETTO_SOTTOFASCIC") + public String getDsOggettoSottofascic() { + return this.dsOggettoSottofascic; + } + + public void setDsOggettoSottofascic(String dsOggettoSottofascic) { + this.dsOggettoSottofascic = dsOggettoSottofascic; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC") + public AroUnitaDoc getAroUnitaDoc() { + return this.aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroBustaCrittog.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroBustaCrittog.java new file mode 100644 index 0000000..c5377a3 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroBustaCrittog.java @@ -0,0 +1,141 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_BUSTA_CRITTOG database table. + */ +@Entity +@Table(name = "ARO_BUSTA_CRITTOG") +public class AroBustaCrittog implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idBustaCrittog; + + private BigDecimal idStrut; + + private BigDecimal pgBustaCrittog; + + private AroCompDoc aroCompDoc; + + private DecFormatoFileStandard decFormatoFileStandard; + + private List aroFirmaComps = new ArrayList<>(); + + private List aroMarcaComps = new ArrayList<>(); + + public AroBustaCrittog() {/* Hibernate */ + } + + @Id + @Column(name = "ID_BUSTA_CRITTOG") + @GenericGenerator(name = "SARO_BUSTA_CRITTOG_ID_BUSTA_CRITTOG_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_BUSTA_CRITTOG"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_BUSTA_CRITTOG_ID_BUSTA_CRITTOG_GENERATOR") + public Long getIdBustaCrittog() { + return this.idBustaCrittog; + } + + public void setIdBustaCrittog(Long idBustaCrittog) { + this.idBustaCrittog = idBustaCrittog; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "PG_BUSTA_CRITTOG") + public BigDecimal getPgBustaCrittog() { + return this.pgBustaCrittog; + } + + public void setPgBustaCrittog(BigDecimal pgBustaCrittog) { + this.pgBustaCrittog = pgBustaCrittog; + } + + // bi-directional many-to-one association to AroCompDoc + @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) + @JoinColumn(name = "ID_COMP_DOC", nullable = false) + public AroCompDoc getAroCompDoc() { + return this.aroCompDoc; + } + + public void setAroCompDoc(AroCompDoc aroCompDoc) { + this.aroCompDoc = aroCompDoc; + } + + // bi-directional many-to-one association to DecFormatoFileStandard + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FORMATO_FILE_CALC") + public DecFormatoFileStandard getDecFormatoFileStandard() { + return this.decFormatoFileStandard; + } + + public void setDecFormatoFileStandard(DecFormatoFileStandard decFormatoFileStandard) { + this.decFormatoFileStandard = decFormatoFileStandard; + } + + // bi-directional many-to-one association to AroFirmaComp + @OneToMany(mappedBy = "aroBustaCrittog") + public List getAroFirmaComps() { + return this.aroFirmaComps; + } + + public void setAroFirmaComps(List aroFirmaComps) { + this.aroFirmaComps = aroFirmaComps; + } + + // bi-directional many-to-one association to AroMarcaComp + @OneToMany(mappedBy = "aroBustaCrittog") + public List getAroMarcaComps() { + return this.aroMarcaComps; + } + + public void setAroMarcaComps(List aroMarcaComps) { + this.aroMarcaComps = aroMarcaComps; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroCompDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroCompDoc.java new file mode 100644 index 0000000..41d7103 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroCompDoc.java @@ -0,0 +1,627 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_COMP_DOC database table. + */ +@Entity +@Table(name = "ARO_COMP_DOC") +public class AroCompDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idCompDoc; + + private String cdEncodingHashFileCalc; + + private String cdEncodingHashFileVers; + + private String dlUrnCompVers; + + private String dsAlgoHashFileCalc; + + private String dsAlgoHashFileVers; + + private String dsEsitoVerifFirmeDtVers; + + private String dsFormatoRapprCalc; + + private String dsFormatoRapprEstesoCalc; + + private String dsHashFileCalc; + + private String dsHashFileContr; + + private String dsHashFileVers; + + private String dsIdCompVers; + + private String dsMsgEsitoContrFormato; + + private String dsMsgEsitoVerifFirme; + + private String dsNomeCompVers; + + private String dsNomeFileArk; + + private String dsRifTempVers; + + private String dsUrnCompCalc; + + private String flCompFirmato; + + private String flNoCalcFmtVerifFirme; + + private String flNoCalcHashFile; + + private String flRifTempDataFirmaVers; + + private BigDecimal idStrut; + + private BigDecimal niOrdCompDoc; + + private BigDecimal niSizeFileCalc; + + private String tiEsitoContrFormatoFile; + + private String tiEsitoContrHashVers; + + private String tiEsitoVerifFirme; + + private String tiEsitoVerifFirmeDtVers; + + private String tiSupportoComp; + + private Date tmRifTempVers; + + private List aroBustaCrittogs = new ArrayList<>(); + + private AroCompDoc aroCompDoc; + + private List aroCompDocs = new ArrayList<>(); + + private AroStrutDoc aroStrutDoc; + + private AroUnitaDoc aroUnitaDoc; + + private DecFormatoFileDoc decFormatoFileDoc; + + private DecFormatoFileStandard decFormatoFileStandard; + + private DecTipoCompDoc decTipoCompDoc; + + private DecTipoRapprComp decTipoRapprComp; + + private List aroFirmaComps = new ArrayList<>(); + + private List aroMarcaComps = new ArrayList<>(); + + private List aroUsoXsdDatiSpecs = new ArrayList<>(); + + private List firReport = new ArrayList<>(); + + private List aroVersIniComps = new ArrayList<>(); + + private List aroUpdCompUnitaDocs = new ArrayList<>(); + + private List aroAroCompUrnCalcs = new ArrayList<>(); + + private DecServizioVerificaCompDoc decServizioVerificaCompDoc; + + public AroCompDoc() { + // hibernate + } + + @Id + @Column(name = "ID_COMP_DOC") + @GenericGenerator(name = "SARO_COMP_DOC_ID_COMP_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_COMP_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_COMP_DOC_ID_COMP_DOC_GENERATOR") + public Long getIdCompDoc() { + return this.idCompDoc; + } + + public void setIdCompDoc(Long idCompDoc) { + this.idCompDoc = idCompDoc; + } + + @Column(name = "CD_ENCODING_HASH_FILE_CALC") + public String getCdEncodingHashFileCalc() { + return this.cdEncodingHashFileCalc; + } + + public void setCdEncodingHashFileCalc(String cdEncodingHashFileCalc) { + this.cdEncodingHashFileCalc = cdEncodingHashFileCalc; + } + + @Column(name = "CD_ENCODING_HASH_FILE_VERS") + public String getCdEncodingHashFileVers() { + return this.cdEncodingHashFileVers; + } + + public void setCdEncodingHashFileVers(String cdEncodingHashFileVers) { + this.cdEncodingHashFileVers = cdEncodingHashFileVers; + } + + @Column(name = "DL_URN_COMP_VERS") + public String getDlUrnCompVers() { + return this.dlUrnCompVers; + } + + public void setDlUrnCompVers(String dlUrnCompVers) { + this.dlUrnCompVers = dlUrnCompVers; + } + + @Column(name = "DS_ALGO_HASH_FILE_CALC") + public String getDsAlgoHashFileCalc() { + return this.dsAlgoHashFileCalc; + } + + public void setDsAlgoHashFileCalc(String dsAlgoHashFileCalc) { + this.dsAlgoHashFileCalc = dsAlgoHashFileCalc; + } + + @Column(name = "DS_ALGO_HASH_FILE_VERS") + public String getDsAlgoHashFileVers() { + return this.dsAlgoHashFileVers; + } + + public void setDsAlgoHashFileVers(String dsAlgoHashFileVers) { + this.dsAlgoHashFileVers = dsAlgoHashFileVers; + } + + @Column(name = "DS_ESITO_VERIF_FIRME_DT_VERS") + public String getDsEsitoVerifFirmeDtVers() { + return this.dsEsitoVerifFirmeDtVers; + } + + public void setDsEsitoVerifFirmeDtVers(String dsEsitoVerifFirmeDtVers) { + this.dsEsitoVerifFirmeDtVers = dsEsitoVerifFirmeDtVers; + } + + @Column(name = "DS_FORMATO_RAPPR_CALC") + public String getDsFormatoRapprCalc() { + return this.dsFormatoRapprCalc; + } + + public void setDsFormatoRapprCalc(String dsFormatoRapprCalc) { + this.dsFormatoRapprCalc = dsFormatoRapprCalc; + } + + @Column(name = "DS_FORMATO_RAPPR_ESTESO_CALC") + public String getDsFormatoRapprEstesoCalc() { + return this.dsFormatoRapprEstesoCalc; + } + + public void setDsFormatoRapprEstesoCalc(String dsFormatoRapprEstesoCalc) { + this.dsFormatoRapprEstesoCalc = dsFormatoRapprEstesoCalc; + } + + @Column(name = "DS_HASH_FILE_CALC") + public String getDsHashFileCalc() { + return this.dsHashFileCalc; + } + + public void setDsHashFileCalc(String dsHashFileCalc) { + this.dsHashFileCalc = dsHashFileCalc; + } + + @Column(name = "DS_HASH_FILE_CONTR") + public String getDsHashFileContr() { + return this.dsHashFileContr; + } + + public void setDsHashFileContr(String dsHashFileContr) { + this.dsHashFileContr = dsHashFileContr; + } + + @Column(name = "DS_HASH_FILE_VERS") + public String getDsHashFileVers() { + return this.dsHashFileVers; + } + + public void setDsHashFileVers(String dsHashFileVers) { + this.dsHashFileVers = dsHashFileVers; + } + + @Column(name = "DS_ID_COMP_VERS") + public String getDsIdCompVers() { + return this.dsIdCompVers; + } + + public void setDsIdCompVers(String dsIdCompVers) { + this.dsIdCompVers = dsIdCompVers; + } + + @Column(name = "DS_MSG_ESITO_CONTR_FORMATO") + public String getDsMsgEsitoContrFormato() { + return this.dsMsgEsitoContrFormato; + } + + public void setDsMsgEsitoContrFormato(String dsMsgEsitoContrFormato) { + this.dsMsgEsitoContrFormato = dsMsgEsitoContrFormato; + } + + @Column(name = "DS_MSG_ESITO_VERIF_FIRME") + public String getDsMsgEsitoVerifFirme() { + return this.dsMsgEsitoVerifFirme; + } + + public void setDsMsgEsitoVerifFirme(String dsMsgEsitoVerifFirme) { + this.dsMsgEsitoVerifFirme = dsMsgEsitoVerifFirme; + } + + @Column(name = "DS_NOME_COMP_VERS") + public String getDsNomeCompVers() { + return this.dsNomeCompVers; + } + + public void setDsNomeCompVers(String dsNomeCompVers) { + this.dsNomeCompVers = dsNomeCompVers; + } + + @Column(name = "DS_NOME_FILE_ARK") + public String getDsNomeFileArk() { + return dsNomeFileArk; + } + + public void setDsNomeFileArk(String dsNomeFileArk) { + this.dsNomeFileArk = dsNomeFileArk; + } + + @Column(name = "DS_RIF_TEMP_VERS") + public String getDsRifTempVers() { + return this.dsRifTempVers; + } + + public void setDsRifTempVers(String dsRifTempVers) { + this.dsRifTempVers = dsRifTempVers; + } + + @Column(name = "DS_URN_COMP_CALC") + public String getDsUrnCompCalc() { + return this.dsUrnCompCalc; + } + + public void setDsUrnCompCalc(String dsUrnCompCalc) { + this.dsUrnCompCalc = dsUrnCompCalc; + } + + @Column(name = "FL_COMP_FIRMATO", columnDefinition = "char(1)") + public String getFlCompFirmato() { + return this.flCompFirmato; + } + + public void setFlCompFirmato(String flCompFirmato) { + this.flCompFirmato = flCompFirmato; + } + + @Column(name = "FL_NO_CALC_FMT_VERIF_FIRME", columnDefinition = "char(1)") + public String getFlNoCalcFmtVerifFirme() { + return this.flNoCalcFmtVerifFirme; + } + + public void setFlNoCalcFmtVerifFirme(String flNoCalcFmtVerifFirme) { + this.flNoCalcFmtVerifFirme = flNoCalcFmtVerifFirme; + } + + @Column(name = "FL_NO_CALC_HASH_FILE", columnDefinition = "char(1)") + public String getFlNoCalcHashFile() { + return this.flNoCalcHashFile; + } + + public void setFlNoCalcHashFile(String flNoCalcHashFile) { + this.flNoCalcHashFile = flNoCalcHashFile; + } + + @Column(name = "FL_RIF_TEMP_DATA_FIRMA_VERS", columnDefinition = "char(1)") + public String getFlRifTempDataFirmaVers() { + return this.flRifTempDataFirmaVers; + } + + public void setFlRifTempDataFirmaVers(String flRifTempDataFirmaVers) { + this.flRifTempDataFirmaVers = flRifTempDataFirmaVers; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "NI_ORD_COMP_DOC") + public BigDecimal getNiOrdCompDoc() { + return this.niOrdCompDoc; + } + + public void setNiOrdCompDoc(BigDecimal niOrdCompDoc) { + this.niOrdCompDoc = niOrdCompDoc; + } + + @Column(name = "NI_SIZE_FILE_CALC") + public BigDecimal getNiSizeFileCalc() { + return this.niSizeFileCalc; + } + + public void setNiSizeFileCalc(BigDecimal niSizeFileCalc) { + this.niSizeFileCalc = niSizeFileCalc; + } + + @Column(name = "TI_ESITO_CONTR_FORMATO_FILE") + public String getTiEsitoContrFormatoFile() { + return this.tiEsitoContrFormatoFile; + } + + public void setTiEsitoContrFormatoFile(String tiEsitoContrFormatoFile) { + this.tiEsitoContrFormatoFile = tiEsitoContrFormatoFile; + } + + @Column(name = "TI_ESITO_CONTR_HASH_VERS") + public String getTiEsitoContrHashVers() { + return this.tiEsitoContrHashVers; + } + + public void setTiEsitoContrHashVers(String tiEsitoContrHashVers) { + this.tiEsitoContrHashVers = tiEsitoContrHashVers; + } + + @Column(name = "TI_ESITO_VERIF_FIRME") + public String getTiEsitoVerifFirme() { + return this.tiEsitoVerifFirme; + } + + public void setTiEsitoVerifFirme(String tiEsitoVerifFirme) { + this.tiEsitoVerifFirme = tiEsitoVerifFirme; + } + + @Column(name = "TI_ESITO_VERIF_FIRME_DT_VERS") + public String getTiEsitoVerifFirmeDtVers() { + return this.tiEsitoVerifFirmeDtVers; + } + + public void setTiEsitoVerifFirmeDtVers(String tiEsitoVerifFirmeDtVers) { + this.tiEsitoVerifFirmeDtVers = tiEsitoVerifFirmeDtVers; + } + + @Column(name = "TI_SUPPORTO_COMP") + public String getTiSupportoComp() { + return this.tiSupportoComp; + } + + public void setTiSupportoComp(String tiSupportoComp) { + this.tiSupportoComp = tiSupportoComp; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TM_RIF_TEMP_VERS") + public Date getTmRifTempVers() { + return this.tmRifTempVers; + } + + public void setTmRifTempVers(Date tmRifTempVers) { + this.tmRifTempVers = tmRifTempVers; + } + + // bi-directional many-to-one association to AroBustaCrittog + @OneToMany(mappedBy = "aroCompDoc", cascade = { CascadeType.PERSIST, CascadeType.DETACH, CascadeType.MERGE, + CascadeType.REFRESH }) + public List getAroBustaCrittogs() { + return this.aroBustaCrittogs; + } + + public void setAroBustaCrittogs(List aroBustaCrittogs) { + this.aroBustaCrittogs = aroBustaCrittogs; + } + + // bi-directional many-to-one association to AroCompDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_COMP_DOC_PADRE") + public AroCompDoc getAroCompDoc() { + return this.aroCompDoc; + } + + public void setAroCompDoc(AroCompDoc aroCompDoc) { + this.aroCompDoc = aroCompDoc; + } + + // bi-directional many-to-one association to AroCompDoc + @OneToMany(mappedBy = "aroCompDoc") + public List getAroCompDocs() { + return this.aroCompDocs; + } + + public void setAroCompDocs(List aroCompDocs) { + this.aroCompDocs = aroCompDocs; + } + + // bi-directional many-to-one association to AroStrutDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT_DOC") + public AroStrutDoc getAroStrutDoc() { + return this.aroStrutDoc; + } + + public void setAroStrutDoc(AroStrutDoc aroStrutDoc) { + this.aroStrutDoc = aroStrutDoc; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC_RIF") + public AroUnitaDoc getAroUnitaDoc() { + return this.aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } + + // bi-directional many-to-one association to DecFormatoFileDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FORMATO_FILE_VERS") + public DecFormatoFileDoc getDecFormatoFileDoc() { + return this.decFormatoFileDoc; + } + + public void setDecFormatoFileDoc(DecFormatoFileDoc decFormatoFileDoc) { + this.decFormatoFileDoc = decFormatoFileDoc; + } + + // bi-directional many-to-one association to DecFormatoFileStandard + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FORMATO_FILE_CALC") + public DecFormatoFileStandard getDecFormatoFileStandard() { + return this.decFormatoFileStandard; + } + + public void setDecFormatoFileStandard(DecFormatoFileStandard decFormatoFileStandard) { + this.decFormatoFileStandard = decFormatoFileStandard; + } + + // bi-directional many-to-one association to DecTipoCompDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_COMP_DOC") + public DecTipoCompDoc getDecTipoCompDoc() { + return this.decTipoCompDoc; + } + + public void setDecTipoCompDoc(DecTipoCompDoc decTipoCompDoc) { + this.decTipoCompDoc = decTipoCompDoc; + } + + // bi-directional many-to-one association to DecTipoRapprComp + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_RAPPR_COMP") + public DecTipoRapprComp getDecTipoRapprComp() { + return this.decTipoRapprComp; + } + + public void setDecTipoRapprComp(DecTipoRapprComp decTipoRapprComp) { + this.decTipoRapprComp = decTipoRapprComp; + } + + // bi-directional many-to-one association to DecTipoRapprComp + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SERVIZIO_VERIFICA_COMP_DOC") + public DecServizioVerificaCompDoc getDecServizioVerificaCompDoc() { + return this.decServizioVerificaCompDoc; + } + + public void setDecServizioVerificaCompDoc(DecServizioVerificaCompDoc decServizioVerificaCompDoc) { + this.decServizioVerificaCompDoc = decServizioVerificaCompDoc; + } + + // bi-directional many-to-one association to AroFirmaComp + @OneToMany(mappedBy = "aroCompDoc", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getAroFirmaComps() { + return this.aroFirmaComps; + } + + public void setAroFirmaComps(List aroFirmaComps) { + this.aroFirmaComps = aroFirmaComps; + } + + // bi-directional many-to-one association to AroMarcaComp + @OneToMany(mappedBy = "aroCompDoc", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getAroMarcaComps() { + return this.aroMarcaComps; + } + + public void setAroMarcaComps(List aroMarcaComps) { + this.aroMarcaComps = aroMarcaComps; + } + + // bi-directional many-to-one association to AroUsoXsdDatiSpec + @OneToMany(mappedBy = "aroCompDoc") + public List getAroUsoXsdDatiSpecs() { + return this.aroUsoXsdDatiSpecs; + } + + public void setAroUsoXsdDatiSpecs(List aroUsoXsdDatiSpecs) { + this.aroUsoXsdDatiSpecs = aroUsoXsdDatiSpecs; + } + + // bi-directional many-to-one association to FirReport + @OneToMany(mappedBy = "aroCompDoc", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getFirReport() { + return firReport; + } + + public void setFirReport(List firReport) { + this.firReport = firReport; + } + + // bi-directional many-to-one association to AroVersIniComp + @OneToMany(mappedBy = "aroCompDoc") + public List getAroVersIniComps() { + return this.aroVersIniComps; + } + + public void setAroVersIniComps(List aroVersIniComps) { + this.aroVersIniComps = aroVersIniComps; + } + + // bi-directional many-to-one association to AroVersIniComp + @OneToMany(mappedBy = "aroCompDoc") + public List getAroUpdCompUnitaDocs() { + return this.aroUpdCompUnitaDocs; + } + + public void setAroUpdCompUnitaDocs(List aroUpdCompUnitaDocs) { + this.aroUpdCompUnitaDocs = aroUpdCompUnitaDocs; + } + + // bi-directional many-to-one association to AroCompUrnCalc + @OneToMany(mappedBy = "aroCompDoc", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getAroAroCompUrnCalcs() { + return this.aroAroCompUrnCalcs; + } + + public void setAroAroCompUrnCalcs(List aroAroCompUrnCalcs) { + this.aroAroCompUrnCalcs = aroAroCompUrnCalcs; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroCompObjectStorage.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroCompObjectStorage.java new file mode 100644 index 0000000..dbc9232 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroCompObjectStorage.java @@ -0,0 +1,122 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_COMP_OBJECT_STORAGE database table. + */ +@Entity +@Table(name = "ARO_COMP_OBJECT_STORAGE") +public class AroCompObjectStorage implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idCompObjectStorage; + + private String cdKeyFile; + + private String nmBucket; + + private String nmTenant; + + private AroCompDoc aroCompDoc; + + private DecBackend decBackend; + + public AroCompObjectStorage() {/* Hibernate */ + } + + @Id + @Column(name = "ID_COMP_OBJECT_STORAGE") + @GenericGenerator(name = "SARO_COMP_OBJECT_STORAGE_ID_COMP_OBJECT_STORAGE_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_COMP_OBJECT_STORAGE"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_COMP_OBJECT_STORAGE_ID_COMP_OBJECT_STORAGE_GENERATOR") + public Long getIdCompObjectStorage() { + return this.idCompObjectStorage; + } + + public void setIdCompObjectStorage(Long idCompObjectStorage) { + this.idCompObjectStorage = idCompObjectStorage; + } + + @Column(name = "CD_KEY_FILE") + public String getCdKeyFile() { + return this.cdKeyFile; + } + + public void setCdKeyFile(String cdKeyFile) { + this.cdKeyFile = cdKeyFile; + } + + @Column(name = "NM_BUCKET") + public String getNmBucket() { + return this.nmBucket; + } + + public void setNmBucket(String nmBucket) { + this.nmBucket = nmBucket; + } + + @Column(name = "NM_TENANT") + public String getNmTenant() { + return this.nmTenant; + } + + public void setNmTenant(String nmTenant) { + this.nmTenant = nmTenant; + } + + // bi-directional many-to-one association to AroCompDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_COMP_DOC") + public AroCompDoc getAroCompDoc() { + return this.aroCompDoc; + } + + public void setAroCompDoc(AroCompDoc aroCompDoc) { + this.aroCompDoc = aroCompDoc; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DEC_BACKEND") + public DecBackend getDecBackend() { + return decBackend; + } + + public void setDecBackend(DecBackend decBackend) { + this.decBackend = decBackend; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroCompUrnCalc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroCompUrnCalc.java new file mode 100644 index 0000000..d4da570 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroCompUrnCalc.java @@ -0,0 +1,103 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.AroCompUrnCalc.TiUrn; + +/** + * The persistent class for the ARO_COMP_URN_CALC database table. + */ +@Entity +@Table(name = "ARO_COMP_URN_CALC") +public class AroCompUrnCalc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idCompUrnCalc; + + private String dsUrn; + + private TiUrn tiUrn; + + private AroCompDoc aroCompDoc; + + public AroCompUrnCalc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_COMP_URN_CALC") + @GenericGenerator(name = "SARO_COMP_URN_CALC_ID_COMP_URN_CALC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_COMP_URN_CALC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_COMP_URN_CALC_ID_COMP_URN_CALC_GENERATOR") + public Long getIdCompUrnCalc() { + return this.idCompUrnCalc; + } + + public void setIdCompUrnCalc(Long idCompUrnCalc) { + this.idCompUrnCalc = idCompUrnCalc; + } + + @Column(name = "DS_URN") + public String getDsUrn() { + return this.dsUrn; + } + + public void setDsUrn(String dsUrn) { + this.dsUrn = dsUrn; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_URN") + public TiUrn getTiUrn() { + return this.tiUrn; + } + + public void setTiUrn(TiUrn tiUrn) { + this.tiUrn = tiUrn; + } + + // bi-directional many-to-one association to AroCompDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_COMP_DOC") + public AroCompDoc getAroCompDoc() { + return this.aroCompDoc; + } + + public void setAroCompDoc(AroCompDoc aroCompDoc) { + this.aroCompDoc = aroCompDoc; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroContrFirmaComp.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroContrFirmaComp.java new file mode 100644 index 0000000..a021493 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroContrFirmaComp.java @@ -0,0 +1,152 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_CONTR_FIRMA_COMP database table. + */ +@Entity +@Table(name = "ARO_CONTR_FIRMA_COMP") +public class AroContrFirmaComp implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idContrFirmaComp; + + private String dsMsgEsitoContrFirma; + + private String tiContr; + + private String tiEsitoContrFirma; + + private AroFirmaComp aroFirmaComp; + + private FirCrl firCrl; + private FirOcsp firOcsp; + private List aroUsoCertifCaContrComps = new ArrayList<>(); + + public AroContrFirmaComp() { + // hibernate + } + + @Id + @Column(name = "ID_CONTR_FIRMA_COMP") + @GenericGenerator(name = "SARO_CONTR_FIRMA_COMP_ID_CONTR_FIRMA_COMP_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_CONTR_FIRMA_COMP"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_CONTR_FIRMA_COMP_ID_CONTR_FIRMA_COMP_GENERATOR") + public Long getIdContrFirmaComp() { + return this.idContrFirmaComp; + } + + public void setIdContrFirmaComp(Long idContrFirmaComp) { + this.idContrFirmaComp = idContrFirmaComp; + } + + @Column(name = "DS_MSG_ESITO_CONTR_FIRMA") + public String getDsMsgEsitoContrFirma() { + return this.dsMsgEsitoContrFirma; + } + + public void setDsMsgEsitoContrFirma(String dsMsgEsitoContrFirma) { + this.dsMsgEsitoContrFirma = dsMsgEsitoContrFirma; + } + + @Column(name = "TI_CONTR") + public String getTiContr() { + return this.tiContr; + } + + public void setTiContr(String tiContr) { + this.tiContr = tiContr; + } + + @Column(name = "TI_ESITO_CONTR_FIRMA") + public String getTiEsitoContrFirma() { + return this.tiEsitoContrFirma; + } + + public void setTiEsitoContrFirma(String tiEsitoContrFirma) { + this.tiEsitoContrFirma = tiEsitoContrFirma; + } + + // bi-directional many-to-one association to AroFirmaComp + @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) + @JoinColumn(name = "ID_FIRMA_COMP", nullable = false) + public AroFirmaComp getAroFirmaComp() { + return this.aroFirmaComp; + } + + public void setAroFirmaComp(AroFirmaComp aroFirmaComp) { + this.aroFirmaComp = aroFirmaComp; + } + + // uni-directional many-to-one association to FirCrl + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CRL_USATA") + public FirCrl getFirCrl() { + return this.firCrl; + } + + public void setFirCrl(FirCrl firCrl) { + this.firCrl = firCrl; + } + + // uni-directional many-to-one association to FirCrl + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_OCSP_USATA") + public FirOcsp getFirOcsp() { + return this.firOcsp; + } + + public void setFirOcsp(FirOcsp firOcsp) { + this.firOcsp = firOcsp; + } + + // bi-directional many-to-one association to AroUsoCertifCaContrComp + @OneToMany(mappedBy = "aroContrFirmaComp", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.DETACH, + CascadeType.REFRESH }) + public List getAroUsoCertifCaContrComps() { + return this.aroUsoCertifCaContrComps; + } + + public void setAroUsoCertifCaContrComps(List aroUsoCertifCaContrComps) { + this.aroUsoCertifCaContrComps = aroUsoCertifCaContrComps; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroContrMarcaComp.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroContrMarcaComp.java new file mode 100644 index 0000000..205d95d --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroContrMarcaComp.java @@ -0,0 +1,153 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_CONTR_MARCA_COMP database table. + */ +@Entity +@Table(name = "ARO_CONTR_MARCA_COMP") +public class AroContrMarcaComp implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idContrMarcaComp; + + private String dsMsgEsitoContrMarca; + + private String tiContr; + + private String tiEsitoContrMarca; + + private AroMarcaComp aroMarcaComp; + + private FirCrl firCrl; + + private FirOcsp firOcsp; + + private List aroUsoCertifCaContrMarcas = new ArrayList<>(); + + public AroContrMarcaComp() {/* Hibernate */ + } + + @Id + @Column(name = "ID_CONTR_MARCA_COMP") + @GenericGenerator(name = "SARO_CONTR_MARCA_COMP_ID_CONTR_MARCA_COMP_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_CONTR_MARCA_COMP"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_CONTR_MARCA_COMP_ID_CONTR_MARCA_COMP_GENERATOR") + public Long getIdContrMarcaComp() { + return this.idContrMarcaComp; + } + + public void setIdContrMarcaComp(Long idContrMarcaComp) { + this.idContrMarcaComp = idContrMarcaComp; + } + + @Column(name = "DS_MSG_ESITO_CONTR_MARCA") + public String getDsMsgEsitoContrMarca() { + return this.dsMsgEsitoContrMarca; + } + + public void setDsMsgEsitoContrMarca(String dsMsgEsitoContrMarca) { + this.dsMsgEsitoContrMarca = dsMsgEsitoContrMarca; + } + + @Column(name = "TI_CONTR") + public String getTiContr() { + return this.tiContr; + } + + public void setTiContr(String tiContr) { + this.tiContr = tiContr; + } + + @Column(name = "TI_ESITO_CONTR_MARCA") + public String getTiEsitoContrMarca() { + return this.tiEsitoContrMarca; + } + + public void setTiEsitoContrMarca(String tiEsitoContrMarca) { + this.tiEsitoContrMarca = tiEsitoContrMarca; + } + + // bi-directional many-to-one association to AroMarcaComp + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_MARCA_COMP", nullable = false) + public AroMarcaComp getAroMarcaComp() { + return this.aroMarcaComp; + } + + public void setAroMarcaComp(AroMarcaComp aroMarcaComp) { + this.aroMarcaComp = aroMarcaComp; + } + + // uni-directional many-to-one association to FirCrl + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CRL_USATA") + public FirCrl getFirCrl() { + return this.firCrl; + } + + public void setFirCrl(FirCrl firCrl) { + this.firCrl = firCrl; + } + + // uni-directional many-to-one association to FirCrl + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_OCSP_USATA") + public FirOcsp getFirOcsp() { + return this.firOcsp; + } + + public void setFirOcsp(FirOcsp firOcsp) { + this.firOcsp = firOcsp; + } + + // bi-directional many-to-one association to AroUsoCertifCaContrMarca + @OneToMany(mappedBy = "aroContrMarcaComp", cascade = { CascadeType.PERSIST, CascadeType.MERGE, + CascadeType.REFRESH }) + public List getAroUsoCertifCaContrMarcas() { + return this.aroUsoCertifCaContrMarcas; + } + + public void setAroUsoCertifCaContrMarcas(List aroUsoCertifCaContrMarcas) { + this.aroUsoCertifCaContrMarcas = aroUsoCertifCaContrMarcas; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroControfirmaFirma.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroControfirmaFirma.java new file mode 100644 index 0000000..197ae90 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroControfirmaFirma.java @@ -0,0 +1,92 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_CONTROFIRMA_FIRMA database table. + */ +@Entity +@Table(name = "ARO_CONTROFIRMA_FIRMA") +public class AroControfirmaFirma implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idControfirmaFirma; + + private AroFirmaComp aroFirmaFiglio; + + private AroFirmaComp aroFirmaPadre; + + public AroControfirmaFirma() {/* Hibernate */ + } + + @Id + @Column(name = "ID_CONTROFIRMA_FIRMA") + @GenericGenerator(name = "SARO_CONTROFIRMA_FIRMA_ID_CONTROFIRMA_FIRMA_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_CONTROFIRMA_FIRMA"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_CONTROFIRMA_FIRMA_ID_CONTROFIRMA_FIRMA_GENERATOR") + public Long getIdControfirmaFirma() { + return this.idControfirmaFirma; + } + + public void setIdControfirmaFirma(Long idControfirmaFirma) { + this.idControfirmaFirma = idControfirmaFirma; + } + + // bi-directional many-to-one association to AroFirmaComp + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.DETACH, + CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FIRMA_FIGLIO") + public AroFirmaComp getAroFirmaFiglio() { + return this.aroFirmaFiglio; + } + + public void setAroFirmaFiglio(AroFirmaComp aroFirmaFiglio) { + this.aroFirmaFiglio = aroFirmaFiglio; + } + + // bi-directional many-to-one association to AroFirmaComp + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FIRMA_PADRE") + public AroFirmaComp getAroFirmaPadre() { + return this.aroFirmaPadre; + } + + public void setAroFirmaPadre(AroFirmaComp aroFirmaPadre) { + this.aroFirmaPadre = aroFirmaPadre; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroDoc.java new file mode 100644 index 0000000..20fff6f --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroDoc.java @@ -0,0 +1,462 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.PrimaryKeyJoinColumn; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_DOC database table. + * + */ +@Entity +@Table(name = "ARO_DOC") +public class AroDoc implements Serializable { + + private static final long serialVersionUID = 1L; + private Long idDoc; + private String cdKeyDocVers; + private String dlDoc; + private String dsAutoreDoc; + private String dsMsgEsitoVerifFirme; + private Date dtAnnul; + private Date dtCreazione; + private String flDocFirmato; + private String flDocFisc; + private String flForzaAccettazione; + private String flForzaConservazione; + private BigDecimal idStrut; + private String nmSistemaMigraz; + private String ntAnnul; + private String ntDoc; + private BigDecimal pgDoc; + private BigDecimal niOrdDoc; + private BigDecimal niResetStato; + private String tiAnnul; + private String tiConservazione; + private String tiCreazione; + private String tiDoc; + private String tiEsitoVerifFirme; + private String tiStatoDoc; + private String tiStatoDocElencoVers; + private Date tsStatoElencoVers; + private Date tsLastResetStato; + private AroUnitaDoc aroUnitaDoc; + private DecTipoDoc decTipoDoc; + private Long idDecTipoDoc; + private AroXmlDocObjectStorage aroXmlDocObjectStorage; + + private List aroStrutDocs = new ArrayList<>(); + private List aroUsoXsdDatiSpecs = new ArrayList<>(); + private List aroWarnUnitaDocs = new ArrayList<>(); + private List vrsSessioneVers = new ArrayList<>(); + private List elvDocAggDaElabElencos = new ArrayList<>(); + private List aroVersIniDocs = new ArrayList<>(); + private List aroUpdDocUnitaDocs = new ArrayList<>(); + + public AroDoc() { + // hibernate + } + + @Id + @Column(name = "ID_DOC") + @GenericGenerator(name = "ARO_DOC_ID_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ARO_DOC_ID_DOC_GENERATOR") + public Long getIdDoc() { + return this.idDoc; + } + + public void setIdDoc(Long idDoc) { + this.idDoc = idDoc; + } + + @Column(name = "CD_KEY_DOC_VERS") + public String getCdKeyDocVers() { + return this.cdKeyDocVers; + } + + public void setCdKeyDocVers(String cdKeyDocVers) { + this.cdKeyDocVers = cdKeyDocVers; + } + + @Column(name = "DL_DOC") + public String getDlDoc() { + return this.dlDoc; + } + + public void setDlDoc(String dlDoc) { + this.dlDoc = dlDoc; + } + + @Column(name = "DS_AUTORE_DOC") + public String getDsAutoreDoc() { + return this.dsAutoreDoc; + } + + public void setDsAutoreDoc(String dsAutoreDoc) { + this.dsAutoreDoc = dsAutoreDoc; + } + + @Column(name = "DS_MSG_ESITO_VERIF_FIRME") + public String getDsMsgEsitoVerifFirme() { + return this.dsMsgEsitoVerifFirme; + } + + public void setDsMsgEsitoVerifFirme(String dsMsgEsitoVerifFirme) { + this.dsMsgEsitoVerifFirme = dsMsgEsitoVerifFirme; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ANNUL") + public Date getDtAnnul() { + return this.dtAnnul; + } + + public void setDtAnnul(Date dtAnnul) { + this.dtAnnul = dtAnnul; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_CREAZIONE") + public Date getDtCreazione() { + return this.dtCreazione; + } + + public void setDtCreazione(Date dtCreazione) { + this.dtCreazione = dtCreazione; + } + + @Column(name = "FL_DOC_FIRMATO", columnDefinition = "char(1)") + public String getFlDocFirmato() { + return this.flDocFirmato; + } + + public void setFlDocFirmato(String flDocFirmato) { + this.flDocFirmato = flDocFirmato; + } + + @Column(name = "FL_DOC_FISC", columnDefinition = "char(1)") + public String getFlDocFisc() { + return this.flDocFisc; + } + + public void setFlDocFisc(String flDocFisc) { + this.flDocFisc = flDocFisc; + } + + @Column(name = "FL_FORZA_ACCETTAZIONE", columnDefinition = "char(1)") + public String getFlForzaAccettazione() { + return this.flForzaAccettazione; + } + + public void setFlForzaAccettazione(String flForzaAccettazione) { + this.flForzaAccettazione = flForzaAccettazione; + } + + @Column(name = "FL_FORZA_CONSERVAZIONE", columnDefinition = "char(1)") + public String getFlForzaConservazione() { + return this.flForzaConservazione; + } + + public void setFlForzaConservazione(String flForzaConservazione) { + this.flForzaConservazione = flForzaConservazione; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "NM_SISTEMA_MIGRAZ") + public String getNmSistemaMigraz() { + return this.nmSistemaMigraz; + } + + public void setNmSistemaMigraz(String nmSistemaMigraz) { + this.nmSistemaMigraz = nmSistemaMigraz; + } + + @Column(name = "NT_ANNUL") + public String getNtAnnul() { + return this.ntAnnul; + } + + public void setNtAnnul(String ntAnnul) { + this.ntAnnul = ntAnnul; + } + + @Column(name = "NT_DOC") + public String getNtDoc() { + return this.ntDoc; + } + + public void setNtDoc(String ntDoc) { + this.ntDoc = ntDoc; + } + + @Column(name = "PG_DOC") + public BigDecimal getPgDoc() { + return this.pgDoc; + } + + public void setPgDoc(BigDecimal pgDoc) { + this.pgDoc = pgDoc; + } + + @Column(name = "NI_ORD_DOC") + public BigDecimal getNiOrdDoc() { + return this.niOrdDoc; + } + + public void setNiOrdDoc(BigDecimal niOrdDoc) { + this.niOrdDoc = niOrdDoc; + } + + @Column(name = "NI_RESET_STATO") + public BigDecimal getNiResetStato() { + return this.niResetStato; + } + + public void setNiResetStato(BigDecimal niResetStato) { + this.niResetStato = niResetStato; + } + + @Column(name = "TI_ANNUL") + public String getTiAnnul() { + return this.tiAnnul; + } + + public void setTiAnnul(String tiAnnul) { + this.tiAnnul = tiAnnul; + } + + @Column(name = "TI_CONSERVAZIONE") + public String getTiConservazione() { + return this.tiConservazione; + } + + public void setTiConservazione(String tiConservazione) { + this.tiConservazione = tiConservazione; + } + + @Column(name = "TI_CREAZIONE") + public String getTiCreazione() { + return this.tiCreazione; + } + + public void setTiCreazione(String tiCreazione) { + this.tiCreazione = tiCreazione; + } + + @Column(name = "TI_DOC") + public String getTiDoc() { + return this.tiDoc; + } + + public void setTiDoc(String tiDoc) { + this.tiDoc = tiDoc; + } + + @Column(name = "TI_ESITO_VERIF_FIRME") + public String getTiEsitoVerifFirme() { + return this.tiEsitoVerifFirme; + } + + public void setTiEsitoVerifFirme(String tiEsitoVerifFirme) { + this.tiEsitoVerifFirme = tiEsitoVerifFirme; + } + + @Column(name = "TI_STATO_DOC") + public String getTiStatoDoc() { + return this.tiStatoDoc; + } + + public void setTiStatoDoc(String tiStatoDoc) { + this.tiStatoDoc = tiStatoDoc; + } + + @Column(name = "TI_STATO_DOC_ELENCO_VERS") + public String getTiStatoDocElencoVers() { + return this.tiStatoDocElencoVers; + } + + public void setTiStatoDocElencoVers(String tiStatoDocElencoVers) { + this.tiStatoDocElencoVers = tiStatoDocElencoVers; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_STATO_ELENCO_VERS") + public Date getTsStatoElencoVers() { + return this.tsStatoElencoVers; + } + + public void setTsStatoElencoVers(Date tsStatoElencoVers) { + this.tsStatoElencoVers = tsStatoElencoVers; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_LAST_RESET_STATO") + public Date getTsLastResetStato() { + return this.tsLastResetStato; + } + + public void setTsLastResetStato(Date tsLastResetStato) { + this.tsLastResetStato = tsLastResetStato; + } + + @Column(name = "ID_TIPO_DOC", insertable = false, updatable = false) + public Long getIdDecTipoDoc() { + return idDecTipoDoc; + } + + public void setIdDecTipoDoc(Long idDecTipoDoc) { + this.idDecTipoDoc = idDecTipoDoc; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC") + public AroUnitaDoc getAroUnitaDoc() { + return this.aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } + + // bi-directional many-to-one association to DecTipoDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_DOC") + public DecTipoDoc getDecTipoDoc() { + return this.decTipoDoc; + } + + public void setDecTipoDoc(DecTipoDoc decTipoDoc) { + this.decTipoDoc = decTipoDoc; + } + + // bi-directional many-to-one association to AroStrutDoc + @OneToMany(mappedBy = "aroDoc") + public List getAroStrutDocs() { + return this.aroStrutDocs; + } + + public void setAroStrutDocs(List aroStrutDocs) { + this.aroStrutDocs = aroStrutDocs; + } + + // bi-directional many-to-one association to AroUsoXsdDatiSpec + @OneToMany(mappedBy = "aroDoc") + public List getAroUsoXsdDatiSpecs() { + return this.aroUsoXsdDatiSpecs; + } + + public void setAroUsoXsdDatiSpecs(List aroUsoXsdDatiSpecs) { + this.aroUsoXsdDatiSpecs = aroUsoXsdDatiSpecs; + } + + // bi-directional many-to-one association to AroWarnUnitaDoc + @OneToMany(mappedBy = "aroDoc") + public List getAroWarnUnitaDocs() { + return this.aroWarnUnitaDocs; + } + + public void setAroWarnUnitaDocs(List aroWarnUnitaDocs) { + this.aroWarnUnitaDocs = aroWarnUnitaDocs; + } + + // bi-directional many-to-one association to VrsSessioneVers + @OneToMany(mappedBy = "aroDoc") + public List getVrsSessioneVers() { + return this.vrsSessioneVers; + } + + public void setVrsSessioneVers(List vrsSessioneVers) { + this.vrsSessioneVers = vrsSessioneVers; + } + + // bi-directional many-to-one association to ElvDocAggDaElabElenco + @OneToMany(mappedBy = "aroDoc") + public List getElvDocAggDaElabElencos() { + return this.elvDocAggDaElabElencos; + } + + public void setElvDocAggDaElabElencos(List elvDocAggDaElabElencos) { + this.elvDocAggDaElabElencos = elvDocAggDaElabElencos; + } + + // bi-directional many-to-one association to AroVersIniDoc + @OneToMany(mappedBy = "aroDoc") + public List getAroVersIniDocs() { + return this.aroVersIniDocs; + } + + public void setAroVersIniDocs(List aroVersIniDocs) { + this.aroVersIniDocs = aroVersIniDocs; + } + + // bi-directional many-to-one association to AroVersIniDoc + @OneToMany(mappedBy = "aroDoc") + public List getAroUpdDocUnitaDocs() { + return this.aroUpdDocUnitaDocs; + } + + public void setAroUpdDocUnitaDocs(List aroUpdDocUnitaDocs) { + this.aroUpdDocUnitaDocs = aroUpdDocUnitaDocs; + } + + @OneToOne(cascade = CascadeType.ALL) + @PrimaryKeyJoinColumn + public AroXmlDocObjectStorage getAroXmlDocObjectStorage() { + return aroXmlDocObjectStorage; + } + + public void setAroXmlDocObjectStorage(AroXmlDocObjectStorage aroXmlDocObjectStorage) { + this.aroXmlDocObjectStorage = aroXmlDocObjectStorage; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroFirmaComp.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroFirmaComp.java new file mode 100644 index 0000000..5edaab7 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroFirmaComp.java @@ -0,0 +1,398 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_FIRMA_COMP database table. + */ +@Entity +@Table(name = "ARO_FIRMA_COMP") +public class AroFirmaComp implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idFirmaComp; + + private String cdFirmatario; + + private String dlDnFirmatario; + + private String dsAlgoFirma; + + private String dsFirmaBase64; + + private String blFirmaBase64; + + private String dsMsgEsitoContrConforme; + + private String dsMsgEsitoVerifFirma; + + private Date dtFirma; + + private BigDecimal idStrut; + + private String nmCognomeFirmatario; + + private String nmFirmatario; + + private BigDecimal pgBusta; + + private BigDecimal pgFirma; + + private String tiEsitoContrConforme; + + private String tiEsitoVerifFirma; + + private String tiFirma; + + private String tiFormatoFirma; + + private String tiRifTempUsato; + + private String dsNote; + + private Date tmRifTempUsato; + + private List aroControfirmaFirmaFiglios = new ArrayList<>(); + + private List aroControfirmaFirmaPadres = new ArrayList<>(); + + private List aroContrFirmaComps = new ArrayList<>(); + + private AroBustaCrittog aroBustaCrittog; + + private AroCompDoc aroCompDoc; + + private AroMarcaComp aroMarcaComp; + + private FirCertifFirmatario firCertifFirmatario; + + private List aroVerifFirmaDtVers = new ArrayList<>(); + + public AroFirmaComp() {/* Hibernate */ + } + + @Id + @Column(name = "ID_FIRMA_COMP") + @GenericGenerator(name = "SARO_FIRMA_COMP_ID_FIRMA_COMP_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_FIRMA_COMP"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_FIRMA_COMP_ID_FIRMA_COMP_GENERATOR") + public Long getIdFirmaComp() { + return this.idFirmaComp; + } + + public void setIdFirmaComp(Long idFirmaComp) { + this.idFirmaComp = idFirmaComp; + } + + @Column(name = "CD_FIRMATARIO") + public String getCdFirmatario() { + return this.cdFirmatario; + } + + public void setCdFirmatario(String cdFirmatario) { + this.cdFirmatario = cdFirmatario; + } + + @Column(name = "DL_DN_FIRMATARIO") + public String getDlDnFirmatario() { + return this.dlDnFirmatario; + } + + public void setDlDnFirmatario(String dlDnFirmatario) { + this.dlDnFirmatario = dlDnFirmatario; + } + + @Column(name = "DS_ALGO_FIRMA") + public String getDsAlgoFirma() { + return this.dsAlgoFirma; + } + + public void setDsAlgoFirma(String dsAlgoFirma) { + this.dsAlgoFirma = dsAlgoFirma; + } + + @Column(name = "DS_FIRMA_BASE64") + public String getDsFirmaBase64() { + return this.dsFirmaBase64; + } + + public void setDsFirmaBase64(String dsFirmaBase64) { + this.dsFirmaBase64 = dsFirmaBase64; + } + + @Column(name = "DS_MSG_ESITO_CONTR_CONFORME") + public String getDsMsgEsitoContrConforme() { + return this.dsMsgEsitoContrConforme; + } + + public void setDsMsgEsitoContrConforme(String dsMsgEsitoContrConforme) { + this.dsMsgEsitoContrConforme = dsMsgEsitoContrConforme; + } + + @Column(name = "DS_MSG_ESITO_VERIF_FIRMA") + public String getDsMsgEsitoVerifFirma() { + return this.dsMsgEsitoVerifFirma; + } + + public void setDsMsgEsitoVerifFirma(String dsMsgEsitoVerifFirma) { + this.dsMsgEsitoVerifFirma = dsMsgEsitoVerifFirma; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_FIRMA") + public Date getDtFirma() { + return this.dtFirma; + } + + public void setDtFirma(Date dtFirma) { + this.dtFirma = dtFirma; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "NM_COGNOME_FIRMATARIO") + public String getNmCognomeFirmatario() { + return this.nmCognomeFirmatario; + } + + public void setNmCognomeFirmatario(String nmCognomeFirmatario) { + this.nmCognomeFirmatario = nmCognomeFirmatario; + } + + @Column(name = "NM_FIRMATARIO") + public String getNmFirmatario() { + return this.nmFirmatario; + } + + public void setNmFirmatario(String nmFirmatario) { + this.nmFirmatario = nmFirmatario; + } + + @Column(name = "PG_BUSTA") + public BigDecimal getPgBusta() { + return this.pgBusta; + } + + public void setPgBusta(BigDecimal pgBusta) { + this.pgBusta = pgBusta; + } + + @Column(name = "PG_FIRMA") + public BigDecimal getPgFirma() { + return this.pgFirma; + } + + public void setPgFirma(BigDecimal pgFirma) { + this.pgFirma = pgFirma; + } + + @Column(name = "TI_ESITO_CONTR_CONFORME") + public String getTiEsitoContrConforme() { + return this.tiEsitoContrConforme; + } + + public void setTiEsitoContrConforme(String tiEsitoContrConforme) { + this.tiEsitoContrConforme = tiEsitoContrConforme; + } + + @Column(name = "TI_ESITO_VERIF_FIRMA") + public String getTiEsitoVerifFirma() { + return this.tiEsitoVerifFirma; + } + + public void setTiEsitoVerifFirma(String tiEsitoVerifFirma) { + this.tiEsitoVerifFirma = tiEsitoVerifFirma; + } + + @Column(name = "TI_FIRMA") + public String getTiFirma() { + return this.tiFirma; + } + + public void setTiFirma(String tiFirma) { + this.tiFirma = tiFirma; + } + + @Column(name = "TI_FORMATO_FIRMA") + public String getTiFormatoFirma() { + return this.tiFormatoFirma; + } + + public void setTiFormatoFirma(String tiFormatoFirma) { + this.tiFormatoFirma = tiFormatoFirma; + } + + @Column(name = "TI_RIF_TEMP_USATO") + public String getTiRifTempUsato() { + return this.tiRifTempUsato; + } + + public void setTiRifTempUsato(String tiRifTempUsato) { + this.tiRifTempUsato = tiRifTempUsato; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TM_RIF_TEMP_USATO") + public Date getTmRifTempUsato() { + return this.tmRifTempUsato; + } + + public void setTmRifTempUsato(Date tmRifTempUsato) { + this.tmRifTempUsato = tmRifTempUsato; + } + + @Lob() + @Column(name = "BL_FIRMA_BASE64") + public String getBlFirmaBase64() { + return blFirmaBase64; + } + + public void setBlFirmaBase64(String blFirmaBase64) { + this.blFirmaBase64 = blFirmaBase64; + } + + @Column(name = "DS_NOTE") + public String getDsNote() { + return this.dsNote; + } + + public void setDsNote(String dsNote) { + this.dsNote = dsNote; + } + + // bi-directional many-to-one association to AroControfirmaFirma + @OneToMany(mappedBy = "aroFirmaPadre", cascade = { CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.REFRESH }) + public List getAroControfirmaFirmaFiglios() { + return this.aroControfirmaFirmaFiglios; + } + + public void setAroControfirmaFirmaFiglios(List aroControfirmaFirmaFiglios) { + this.aroControfirmaFirmaFiglios = aroControfirmaFirmaFiglios; + } + + // bi-directional many-to-one association to AroControfirmaFirma + @OneToMany(mappedBy = "aroFirmaFiglio") + public List getAroControfirmaFirmaPadres() { + return this.aroControfirmaFirmaPadres; + } + + public void setAroControfirmaFirmaPadres(List aroControfirmaFirmaPadres) { + this.aroControfirmaFirmaPadres = aroControfirmaFirmaPadres; + } + + // bi-directional many-to-one association to AroContrFirmaComp + @OneToMany(mappedBy = "aroFirmaComp", cascade = { CascadeType.PERSIST, CascadeType.DETACH, CascadeType.MERGE, + CascadeType.REFRESH }) + public List getAroContrFirmaComps() { + return this.aroContrFirmaComps; + } + + public void setAroContrFirmaComps(List aroContrFirmaComps) { + this.aroContrFirmaComps = aroContrFirmaComps; + } + + // bi-directional many-to-one association to AroBustaCrittog + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_BUSTA_CRITTOG") + public AroBustaCrittog getAroBustaCrittog() { + return this.aroBustaCrittog; + } + + public void setAroBustaCrittog(AroBustaCrittog aroBustaCrittog) { + this.aroBustaCrittog = aroBustaCrittog; + } + + // bi-directional many-to-one association to AroCompDoc + @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) + @JoinColumn(name = "ID_COMP_DOC", nullable = false) + public AroCompDoc getAroCompDoc() { + return this.aroCompDoc; + } + + public void setAroCompDoc(AroCompDoc aroCompDoc) { + this.aroCompDoc = aroCompDoc; + } + + // bi-directional many-to-one association to AroMarcaComp + @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) + @JoinColumn(name = "ID_MARCA_COMP") + public AroMarcaComp getAroMarcaComp() { + return this.aroMarcaComp; + } + + public void setAroMarcaComp(AroMarcaComp aroMarcaComp) { + this.aroMarcaComp = aroMarcaComp; + } + + // uni-directional many-to-one association to FirCertifFirmatario + @ManyToOne(cascade = { CascadeType.PERSIST, // CascadeType.MERGE, CascadeType.REFRESH, + CascadeType.DETACH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CERTIF_FIRMATARIO") + public FirCertifFirmatario getFirCertifFirmatario() { + return this.firCertifFirmatario; + } + + public void setFirCertifFirmatario(FirCertifFirmatario firCertifFirmatario) { + this.firCertifFirmatario = firCertifFirmatario; + } + + // bi-directional many-to-one association to AroVerifFirmaDtVer + @OneToMany(mappedBy = "aroFirmaComp", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.DETACH, + CascadeType.REFRESH }) + public List getAroVerifFirmaDtVers() { + return this.aroVerifFirmaDtVers; + } + + public void setAroVerifFirmaDtVers(List aroVerifFirmaDtVers) { + this.aroVerifFirmaDtVers = aroVerifFirmaDtVers; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroIndiceAipUd.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroIndiceAipUd.java new file mode 100644 index 0000000..89e998f --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroIndiceAipUd.java @@ -0,0 +1,113 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_INDICE_AIP_UD database table. + */ +@Entity +@Table(name = "ARO_INDICE_AIP_UD") +public class AroIndiceAipUd implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idIndiceAip; + private BigDecimal idVerIndiceAipLast = BigDecimal.ZERO; + private String tiFormatoIndiceAip; + + private AroUnitaDoc aroUnitaDoc; + + private List aroVerIndiceAipUds = new ArrayList<>(); + + public AroIndiceAipUd() {/* Hibernate */ + } + + @Id + @Column(name = "ID_INDICE_AIP") + @GenericGenerator(name = "SARO_INDICE_AIP_UD_ID_INDICE_AIP_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_INDICE_AIP_UD"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_INDICE_AIP_UD_ID_INDICE_AIP_GENERATOR") + public Long getIdIndiceAip() { + return this.idIndiceAip; + } + + public void setIdIndiceAip(Long idIndiceAip) { + this.idIndiceAip = idIndiceAip; + } + + @Column(name = "ID_VER_INDICE_AIP_LAST") + public BigDecimal getIdVerIndiceAipLast() { + return this.idVerIndiceAipLast; + } + + public void setIdVerIndiceAipLast(BigDecimal idVerIndiceAipLast) { + this.idVerIndiceAipLast = idVerIndiceAipLast; + } + + @Column(name = "TI_FORMATO_INDICE_AIP") + public String getTiFormatoIndiceAip() { + return this.tiFormatoIndiceAip; + } + + public void setTiFormatoIndiceAip(String tiFormatoIndiceAip) { + this.tiFormatoIndiceAip = tiFormatoIndiceAip; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC") + public AroUnitaDoc getAroUnitaDoc() { + return this.aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } + + // bi-directional many-to-one association to AroVerIndiceAipUd + @OneToMany(mappedBy = "aroIndiceAipUd", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getAroVerIndiceAipUds() { + return this.aroVerIndiceAipUds; + } + + public void setAroVerIndiceAipUds(List aroVerIndiceAipUds) { + this.aroVerIndiceAipUds = aroVerIndiceAipUds; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroLinkUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroLinkUnitaDoc.java new file mode 100644 index 0000000..7636a2c --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroLinkUnitaDoc.java @@ -0,0 +1,146 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_LINK_UNITA_DOC database table. + */ +@Entity +@Table(name = "ARO_LINK_UNITA_DOC") +public class AroLinkUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idLinkUnitaDoc; + + private BigDecimal aaKeyUnitaDocLink; + + private String cdKeyUnitaDocLink; + + private String cdRegistroKeyUnitaDocLink; + + private String dsLinkUnitaDoc; + + private BigDecimal idStrut; + + private AroUnitaDoc aroUnitaDocLink; + + private AroUnitaDoc aroUnitaDoc; + + public AroLinkUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_LINK_UNITA_DOC") + @GenericGenerator(name = "SARO_LINK_UNITA_DOC_ID_LINK_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_LINK_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_LINK_UNITA_DOC_ID_LINK_UNITA_DOC_GENERATOR") + public Long getIdLinkUnitaDoc() { + return this.idLinkUnitaDoc; + } + + public void setIdLinkUnitaDoc(Long idLinkUnitaDoc) { + this.idLinkUnitaDoc = idLinkUnitaDoc; + } + + @Column(name = "AA_KEY_UNITA_DOC_LINK") + public BigDecimal getAaKeyUnitaDocLink() { + return this.aaKeyUnitaDocLink; + } + + public void setAaKeyUnitaDocLink(BigDecimal aaKeyUnitaDocLink) { + this.aaKeyUnitaDocLink = aaKeyUnitaDocLink; + } + + @Column(name = "CD_KEY_UNITA_DOC_LINK") + public String getCdKeyUnitaDocLink() { + return this.cdKeyUnitaDocLink; + } + + public void setCdKeyUnitaDocLink(String cdKeyUnitaDocLink) { + this.cdKeyUnitaDocLink = cdKeyUnitaDocLink; + } + + @Column(name = "CD_REGISTRO_KEY_UNITA_DOC_LINK") + public String getCdRegistroKeyUnitaDocLink() { + return this.cdRegistroKeyUnitaDocLink; + } + + public void setCdRegistroKeyUnitaDocLink(String cdRegistroKeyUnitaDocLink) { + this.cdRegistroKeyUnitaDocLink = cdRegistroKeyUnitaDocLink; + } + + @Column(name = "DS_LINK_UNITA_DOC") + public String getDsLinkUnitaDoc() { + return this.dsLinkUnitaDoc; + } + + public void setDsLinkUnitaDoc(String dsLinkUnitaDoc) { + this.dsLinkUnitaDoc = dsLinkUnitaDoc; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC_LINK") + public AroUnitaDoc getAroUnitaDocLink() { + return this.aroUnitaDocLink; + } + + public void setAroUnitaDocLink(AroUnitaDoc aroUnitaDocLink) { + this.aroUnitaDocLink = aroUnitaDocLink; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC") + public AroUnitaDoc getAroUnitaDoc() { + return this.aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroMarcaComp.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroMarcaComp.java new file mode 100644 index 0000000..53bc6a8 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroMarcaComp.java @@ -0,0 +1,280 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_MARCA_COMP database table. + */ +@Entity +@Table(name = "ARO_MARCA_COMP") +public class AroMarcaComp implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idMarcaComp; + + private String dsAlgoMarca; + + private String dsMarcaBase64; + + private String dsMsgEsitoContrConforme; + + private String dsMsgEsitoVerifMarca; + + private Date dtScadMarca; + + private BigDecimal pgBusta; + + private BigDecimal pgMarca; + + private String tiEsitoContrConforme; + + private String tiEsitoVerifMarca; + + private String tiFormatoMarca; + + private String tiMarcaTemp; + + private String dsNote; + + private Date tmMarcaTemp; + + private List aroContrMarcaComps = new ArrayList<>(); + + private List aroFirmaComps = new ArrayList<>(); + + private AroBustaCrittog aroBustaCrittog; + + private AroCompDoc aroCompDoc; + + private FirCertifCa firCertifCa; + + public AroMarcaComp() {/* Hibernate */ + } + + @Id + @Column(name = "ID_MARCA_COMP") + @GenericGenerator(name = "SARO_MARCA_COMP_ID_MARCA_COMP_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_MARCA_COMP"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_MARCA_COMP_ID_MARCA_COMP_GENERATOR") + public Long getIdMarcaComp() { + return this.idMarcaComp; + } + + public void setIdMarcaComp(Long idMarcaComp) { + this.idMarcaComp = idMarcaComp; + } + + @Column(name = "DS_ALGO_MARCA") + public String getDsAlgoMarca() { + return this.dsAlgoMarca; + } + + public void setDsAlgoMarca(String dsAlgoMarca) { + this.dsAlgoMarca = dsAlgoMarca; + } + + @Column(name = "DS_MARCA_BASE64") + public String getDsMarcaBase64() { + return this.dsMarcaBase64; + } + + public void setDsMarcaBase64(String dsMarcaBase64) { + this.dsMarcaBase64 = dsMarcaBase64; + } + + @Column(name = "DS_MSG_ESITO_CONTR_CONFORME") + public String getDsMsgEsitoContrConforme() { + return this.dsMsgEsitoContrConforme; + } + + public void setDsMsgEsitoContrConforme(String dsMsgEsitoContrConforme) { + this.dsMsgEsitoContrConforme = dsMsgEsitoContrConforme; + } + + @Column(name = "DS_MSG_ESITO_VERIF_MARCA") + public String getDsMsgEsitoVerifMarca() { + return this.dsMsgEsitoVerifMarca; + } + + public void setDsMsgEsitoVerifMarca(String dsMsgEsitoVerifMarca) { + this.dsMsgEsitoVerifMarca = dsMsgEsitoVerifMarca; + } + + @Column(name = "DS_NOTE") + public String getDsNote() { + return this.dsNote; + } + + public void setDsNote(String dsNote) { + this.dsNote = dsNote; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SCAD_MARCA") + public Date getDtScadMarca() { + return this.dtScadMarca; + } + + public void setDtScadMarca(Date dtScadMarca) { + this.dtScadMarca = dtScadMarca; + } + + @Column(name = "PG_BUSTA") + public BigDecimal getPgBusta() { + return this.pgBusta; + } + + public void setPgBusta(BigDecimal pgBusta) { + this.pgBusta = pgBusta; + } + + @Column(name = "PG_MARCA") + public BigDecimal getPgMarca() { + return this.pgMarca; + } + + public void setPgMarca(BigDecimal pgMarca) { + this.pgMarca = pgMarca; + } + + @Column(name = "TI_ESITO_CONTR_CONFORME") + public String getTiEsitoContrConforme() { + return this.tiEsitoContrConforme; + } + + public void setTiEsitoContrConforme(String tiEsitoContrConforme) { + this.tiEsitoContrConforme = tiEsitoContrConforme; + } + + @Column(name = "TI_ESITO_VERIF_MARCA") + public String getTiEsitoVerifMarca() { + return this.tiEsitoVerifMarca; + } + + public void setTiEsitoVerifMarca(String tiEsitoVerifMarca) { + this.tiEsitoVerifMarca = tiEsitoVerifMarca; + } + + @Column(name = "TI_FORMATO_MARCA") + public String getTiFormatoMarca() { + return this.tiFormatoMarca; + } + + public void setTiFormatoMarca(String tiFormatoMarca) { + this.tiFormatoMarca = tiFormatoMarca; + } + + @Column(name = "TI_MARCA_TEMP") + public String getTiMarcaTemp() { + return this.tiMarcaTemp; + } + + public void setTiMarcaTemp(String tiMarcaTemp) { + this.tiMarcaTemp = tiMarcaTemp; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TM_MARCA_TEMP") + public Date getTmMarcaTemp() { + return this.tmMarcaTemp; + } + + public void setTmMarcaTemp(Date tmMarcaTemp) { + this.tmMarcaTemp = tmMarcaTemp; + } + + // bi-directional many-to-one association to AroContrMarcaComp + @OneToMany(mappedBy = "aroMarcaComp", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getAroContrMarcaComps() { + return this.aroContrMarcaComps; + } + + public void setAroContrMarcaComps(List aroContrMarcaComps) { + this.aroContrMarcaComps = aroContrMarcaComps; + } + + // bi-directional many-to-one association to AroFirmaComp + @OneToMany(mappedBy = "aroMarcaComp") + public List getAroFirmaComps() { + return this.aroFirmaComps; + } + + public void setAroFirmaComps(List aroFirmaComps) { + this.aroFirmaComps = aroFirmaComps; + } + + // bi-directional many-to-one association to AroBustaCrittog + @ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + @JoinColumn(name = "ID_BUSTA_CRITTOG", nullable = false) + public AroBustaCrittog getAroBustaCrittog() { + return this.aroBustaCrittog; + } + + public void setAroBustaCrittog(AroBustaCrittog aroBustaCrittog) { + this.aroBustaCrittog = aroBustaCrittog; + } + + // bi-directional many-to-one association to AroCompDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_COMP_DOC") + public AroCompDoc getAroCompDoc() { + return this.aroCompDoc; + } + + public void setAroCompDoc(AroCompDoc aroCompDoc) { + this.aroCompDoc = aroCompDoc; + } + + // uni-directional many-to-one association to FirCertifCa + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CERTIF_CA") + public FirCertifCa getFirCertifCa() { + return this.firCertifCa; + } + + public void setFirCertifCa(FirCertifCa firCertifCa) { + this.firCertifCa = firCertifCa; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroStrutDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroStrutDoc.java new file mode 100644 index 0000000..3227230 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroStrutDoc.java @@ -0,0 +1,141 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_STRUT_DOC database table. + */ +@Entity +@Table(name = "ARO_STRUT_DOC") +public class AroStrutDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idStrutDoc; + + private String flStrutOrig; + + private BigDecimal idStrut; + + private BigDecimal niOrdStrutDoc; + + private List aroCompDocs = new ArrayList<>(); + + private AroDoc aroDoc; + + private DecTipoStrutDoc decTipoStrutDoc; + + public AroStrutDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_STRUT_DOC") + @GenericGenerator(name = "SARO_STRUT_DOC_ID_STRUT_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_STRUT_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_STRUT_DOC_ID_STRUT_DOC_GENERATOR") + public Long getIdStrutDoc() { + return this.idStrutDoc; + } + + public void setIdStrutDoc(Long idStrutDoc) { + this.idStrutDoc = idStrutDoc; + } + + @Column(name = "FL_STRUT_ORIG", columnDefinition = "char(1)") + public String getFlStrutOrig() { + return this.flStrutOrig; + } + + public void setFlStrutOrig(String flStrutOrig) { + this.flStrutOrig = flStrutOrig; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "NI_ORD_STRUT_DOC") + public BigDecimal getNiOrdStrutDoc() { + return this.niOrdStrutDoc; + } + + public void setNiOrdStrutDoc(BigDecimal niOrdStrutDoc) { + this.niOrdStrutDoc = niOrdStrutDoc; + } + + // bi-directional many-to-one association to AroCompDoc + @OneToMany(mappedBy = "aroStrutDoc", cascade = { CascadeType.PERSIST, CascadeType.DETACH, CascadeType.MERGE, + CascadeType.REFRESH }) + public List getAroCompDocs() { + return this.aroCompDocs; + } + + public void setAroCompDocs(List aroCompDocs) { + this.aroCompDocs = aroCompDocs; + } + + // bi-directional many-to-one association to AroDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DOC") + public AroDoc getAroDoc() { + return this.aroDoc; + } + + public void setAroDoc(AroDoc aroDoc) { + this.aroDoc = aroDoc; + } + + // bi-directional many-to-one association to DecTipoStrutDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_STRUT_DOC") + public DecTipoStrutDoc getDecTipoStrutDoc() { + return this.decTipoStrutDoc; + } + + public void setDecTipoStrutDoc(DecTipoStrutDoc decTipoStrutDoc) { + this.decTipoStrutDoc = decTipoStrutDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUnitaDoc.java new file mode 100644 index 0000000..a72609f --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUnitaDoc.java @@ -0,0 +1,752 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.PrimaryKeyJoinColumn; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_UNITA_DOC database table. + */ +@Entity +@Table(name = "ARO_UNITA_DOC") +public class AroUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUnitaDoc; + + private BigDecimal aaKeyUnitaDoc; + + private String cdFascicPrinc; + + private String cdKeyUnitaDoc; + + private String cdKeyUnitaDocNormaliz; + + private String cdRegistroKeyUnitaDoc; + + private String cdSottofascicPrinc; + + private String dlOggettoUnitaDoc; + + private String dsClassifPrinc; + + private String dsKeyOrd; + + private String dsMsgEsitoVerifFirme; + + private String dsOggettoFascicPrinc; + + private String dsOggettoSottofascicPrinc; + + private String dsUffCompUnitaDoc; + + private Date dtAnnul; + + private Date dtCreazione; + + private Date dtRegUnitaDoc; + + private String flCartaceo; + + private String flForzaAccettazione; + + private String flForzaCollegamento; + + private String flForzaConservazione; + + private String flUnitaDocFirmato; + + private BigDecimal niAlleg; + + private BigDecimal niAnnessi; + + private BigDecimal niAnnot; + + private BigDecimal niResetStato; + + private String nmSistemaMigraz; + + private String ntAnnul; + + private String ntUnitaDoc; + + private BigDecimal pgUnitaDoc; + + private String tiAnnul; + + private String tiConservazione; + + private String tiEsitoVerifFirme; + + private String tiStatoConservazione; + + private String tiStatoUdElencoVers; + + private Date tsStatoElencoVers; + + private Date tsLastResetStato; + + private List aroArchivSecs = new ArrayList<>(); + + private List aroCompDocs = new ArrayList<>(); + + private List aroDocs = new ArrayList<>(); + + private List aroIndiceAipUds = new ArrayList<>(); + + private List aroLinkUnitaDocLinks = new ArrayList<>(); + + private List aroLinkUnitaDocs = new ArrayList<>(); + + private DecRegistroUnitaDoc decRegistroUnitaDoc; + + private Long idDecRegistroUnitaDoc; + + private DecTipoUnitaDoc decTipoUnitaDoc; + + private Long idDecTipoUnitaDoc; + + private OrgStrut orgStrut; + + private Long idOrgStrut; + + private OrgSubStrut orgSubStrut; + + private Long idOrgSubStrut; + + private IamUser iamUser; + + private List aroUsoXsdDatiSpecs = new ArrayList<>(); + + private List aroWarnUnitaDocs = new ArrayList<>(); + + private List vrsSessioneVers = new ArrayList<>(); + + private AroXmlUnitaDocObjectStorage aroXmlUnitaDocObjectStorage; + + private List elvUdVersDaElabElencos = new ArrayList<>(); + + private List fasUnitaDocFascicolos = new ArrayList<>(); + + private List aroVersIniUnitaDocs = new ArrayList<>(); + + private List aroUpdUnitaDocs = new ArrayList<>(); + + public AroUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UNITA_DOC") + @GenericGenerator(name = "SARO_UNITA_DOC_ID_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_UNITA_DOC_ID_UNITA_DOC_GENERATOR") + public Long getIdUnitaDoc() { + return this.idUnitaDoc; + } + + public void setIdUnitaDoc(Long idUnitaDoc) { + this.idUnitaDoc = idUnitaDoc; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return this.aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + @Column(name = "CD_FASCIC_PRINC") + public String getCdFascicPrinc() { + return this.cdFascicPrinc; + } + + public void setCdFascicPrinc(String cdFascicPrinc) { + this.cdFascicPrinc = cdFascicPrinc; + } + + @Column(name = "CD_KEY_UNITA_DOC") + public String getCdKeyUnitaDoc() { + return this.cdKeyUnitaDoc; + } + + public void setCdKeyUnitaDoc(String cdKeyUnitaDoc) { + this.cdKeyUnitaDoc = cdKeyUnitaDoc; + } + + @Column(name = "CD_KEY_UNITA_DOC_NORMALIZ") + public String getCdKeyUnitaDocNormaliz() { + return this.cdKeyUnitaDocNormaliz; + } + + public void setCdKeyUnitaDocNormaliz(String cdKeyUnitaDocNormaliz) { + this.cdKeyUnitaDocNormaliz = cdKeyUnitaDocNormaliz; + } + + @Column(name = "CD_REGISTRO_KEY_UNITA_DOC") + public String getCdRegistroKeyUnitaDoc() { + return this.cdRegistroKeyUnitaDoc; + } + + public void setCdRegistroKeyUnitaDoc(String cdRegistroKeyUnitaDoc) { + this.cdRegistroKeyUnitaDoc = cdRegistroKeyUnitaDoc; + } + + @Column(name = "CD_SOTTOFASCIC_PRINC") + public String getCdSottofascicPrinc() { + return this.cdSottofascicPrinc; + } + + public void setCdSottofascicPrinc(String cdSottofascicPrinc) { + this.cdSottofascicPrinc = cdSottofascicPrinc; + } + + @Column(name = "DL_OGGETTO_UNITA_DOC") + public String getDlOggettoUnitaDoc() { + return this.dlOggettoUnitaDoc; + } + + public void setDlOggettoUnitaDoc(String dlOggettoUnitaDoc) { + this.dlOggettoUnitaDoc = dlOggettoUnitaDoc; + } + + @Column(name = "DS_CLASSIF_PRINC") + public String getDsClassifPrinc() { + return this.dsClassifPrinc; + } + + public void setDsClassifPrinc(String dsClassifPrinc) { + this.dsClassifPrinc = dsClassifPrinc; + } + + @Column(name = "DS_KEY_ORD") + public String getDsKeyOrd() { + return this.dsKeyOrd; + } + + public void setDsKeyOrd(String dsKeyOrd) { + this.dsKeyOrd = dsKeyOrd; + } + + @Column(name = "DS_MSG_ESITO_VERIF_FIRME") + public String getDsMsgEsitoVerifFirme() { + return this.dsMsgEsitoVerifFirme; + } + + public void setDsMsgEsitoVerifFirme(String dsMsgEsitoVerifFirme) { + this.dsMsgEsitoVerifFirme = dsMsgEsitoVerifFirme; + } + + @Column(name = "DS_OGGETTO_FASCIC_PRINC") + public String getDsOggettoFascicPrinc() { + return this.dsOggettoFascicPrinc; + } + + public void setDsOggettoFascicPrinc(String dsOggettoFascicPrinc) { + this.dsOggettoFascicPrinc = dsOggettoFascicPrinc; + } + + @Column(name = "DS_OGGETTO_SOTTOFASCIC_PRINC") + public String getDsOggettoSottofascicPrinc() { + return this.dsOggettoSottofascicPrinc; + } + + public void setDsOggettoSottofascicPrinc(String dsOggettoSottofascicPrinc) { + this.dsOggettoSottofascicPrinc = dsOggettoSottofascicPrinc; + } + + @Column(name = "DS_UFF_COMP_UNITA_DOC") + public String getDsUffCompUnitaDoc() { + return this.dsUffCompUnitaDoc; + } + + public void setDsUffCompUnitaDoc(String dsUffCompUnitaDoc) { + this.dsUffCompUnitaDoc = dsUffCompUnitaDoc; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ANNUL") + public Date getDtAnnul() { + return this.dtAnnul; + } + + public void setDtAnnul(Date dtAnnul) { + this.dtAnnul = dtAnnul; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_CREAZIONE") + public Date getDtCreazione() { + return this.dtCreazione; + } + + public void setDtCreazione(Date dtCreazione) { + this.dtCreazione = dtCreazione; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_REG_UNITA_DOC") + public Date getDtRegUnitaDoc() { + return this.dtRegUnitaDoc; + } + + public void setDtRegUnitaDoc(Date dtRegUnitaDoc) { + this.dtRegUnitaDoc = dtRegUnitaDoc; + } + + @Column(name = "FL_CARTACEO", columnDefinition = "char(1)") + public String getFlCartaceo() { + return this.flCartaceo; + } + + public void setFlCartaceo(String flCartaceo) { + this.flCartaceo = flCartaceo; + } + + @Column(name = "FL_FORZA_ACCETTAZIONE", columnDefinition = "char(1)") + public String getFlForzaAccettazione() { + return this.flForzaAccettazione; + } + + public void setFlForzaAccettazione(String flForzaAccettazione) { + this.flForzaAccettazione = flForzaAccettazione; + } + + @Column(name = "FL_FORZA_COLLEGAMENTO", columnDefinition = "char(1)") + public String getFlForzaCollegamento() { + return this.flForzaCollegamento; + } + + public void setFlForzaCollegamento(String flForzaCollegamento) { + this.flForzaCollegamento = flForzaCollegamento; + } + + @Column(name = "FL_FORZA_CONSERVAZIONE", columnDefinition = "char(1)") + public String getFlForzaConservazione() { + return this.flForzaConservazione; + } + + public void setFlForzaConservazione(String flForzaConservazione) { + this.flForzaConservazione = flForzaConservazione; + } + + @Column(name = "FL_UNITA_DOC_FIRMATO", columnDefinition = "char(1)") + public String getFlUnitaDocFirmato() { + return this.flUnitaDocFirmato; + } + + public void setFlUnitaDocFirmato(String flUnitaDocFirmato) { + this.flUnitaDocFirmato = flUnitaDocFirmato; + } + + @Column(name = "NI_ALLEG") + public BigDecimal getNiAlleg() { + return this.niAlleg; + } + + public void setNiAlleg(BigDecimal niAlleg) { + this.niAlleg = niAlleg; + } + + @Column(name = "NI_ANNESSI") + public BigDecimal getNiAnnessi() { + return this.niAnnessi; + } + + public void setNiAnnessi(BigDecimal niAnnessi) { + this.niAnnessi = niAnnessi; + } + + @Column(name = "NI_ANNOT") + public BigDecimal getNiAnnot() { + return this.niAnnot; + } + + public void setNiAnnot(BigDecimal niAnnot) { + this.niAnnot = niAnnot; + } + + @Column(name = "NI_RESET_STATO") + public BigDecimal getNiResetStato() { + return this.niResetStato; + } + + public void setNiResetStato(BigDecimal niResetStato) { + this.niResetStato = niResetStato; + } + + @Column(name = "NM_SISTEMA_MIGRAZ") + public String getNmSistemaMigraz() { + return this.nmSistemaMigraz; + } + + public void setNmSistemaMigraz(String nmSistemaMigraz) { + this.nmSistemaMigraz = nmSistemaMigraz; + } + + @Column(name = "NT_ANNUL") + public String getNtAnnul() { + return this.ntAnnul; + } + + public void setNtAnnul(String ntAnnul) { + this.ntAnnul = ntAnnul; + } + + @Column(name = "NT_UNITA_DOC") + public String getNtUnitaDoc() { + return this.ntUnitaDoc; + } + + public void setNtUnitaDoc(String ntUnitaDoc) { + this.ntUnitaDoc = ntUnitaDoc; + } + + @Column(name = "PG_UNITA_DOC") + public BigDecimal getPgUnitaDoc() { + return this.pgUnitaDoc; + } + + public void setPgUnitaDoc(BigDecimal pgUnitaDoc) { + this.pgUnitaDoc = pgUnitaDoc; + } + + @Column(name = "TI_ANNUL") + public String getTiAnnul() { + return this.tiAnnul; + } + + public void setTiAnnul(String tiAnnul) { + this.tiAnnul = tiAnnul; + } + + @Column(name = "TI_CONSERVAZIONE") + public String getTiConservazione() { + return this.tiConservazione; + } + + public void setTiConservazione(String tiConservazione) { + this.tiConservazione = tiConservazione; + } + + @Column(name = "TI_ESITO_VERIF_FIRME") + public String getTiEsitoVerifFirme() { + return this.tiEsitoVerifFirme; + } + + public void setTiEsitoVerifFirme(String tiEsitoVerifFirme) { + this.tiEsitoVerifFirme = tiEsitoVerifFirme; + } + + @Column(name = "TI_STATO_CONSERVAZIONE") + public String getTiStatoConservazione() { + return this.tiStatoConservazione; + } + + public void setTiStatoConservazione(String tiStatoConservazione) { + this.tiStatoConservazione = tiStatoConservazione; + } + + @Column(name = "TI_STATO_UD_ELENCO_VERS") + public String getTiStatoUdElencoVers() { + return this.tiStatoUdElencoVers; + } + + public void setTiStatoUdElencoVers(String tiStatoUdElencoVers) { + this.tiStatoUdElencoVers = tiStatoUdElencoVers; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_STATO_ELENCO_VERS") + public Date getTsStatoElencoVers() { + return this.tsStatoElencoVers; + } + + public void setTsStatoElencoVers(Date tsStatoElencoVers) { + this.tsStatoElencoVers = tsStatoElencoVers; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_LAST_RESET_STATO") + public Date getTsLastResetStato() { + return this.tsLastResetStato; + } + + public void setTsLastResetStato(Date tsLastResetStato) { + this.tsLastResetStato = tsLastResetStato; + } + + // bi-directional many-to-one association to AroArchivSec + @OneToMany(mappedBy = "aroUnitaDoc", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getAroArchivSecs() { + return this.aroArchivSecs; + } + + public void setAroArchivSecs(List aroArchivSecs) { + this.aroArchivSecs = aroArchivSecs; + } + + // bi-directional many-to-one association to AroCompDoc + @OneToMany(mappedBy = "aroUnitaDoc") + public List getAroCompDocs() { + return this.aroCompDocs; + } + + public void setAroCompDocs(List aroCompDocs) { + this.aroCompDocs = aroCompDocs; + } + + // bi-directional many-to-one association to AroDoc + @OneToMany(mappedBy = "aroUnitaDoc") + public List getAroDocs() { + return this.aroDocs; + } + + public void setAroDocs(List aroDocs) { + this.aroDocs = aroDocs; + } + + // bi-directional many-to-one association to AroLinkUnitaDoc + @OneToMany(mappedBy = "aroUnitaDocLink") + public List getAroLinkUnitaDocLinks() { + return this.aroLinkUnitaDocLinks; + } + + public void setAroLinkUnitaDocLinks(List aroLinkUnitaDocLinks) { + this.aroLinkUnitaDocLinks = aroLinkUnitaDocLinks; + } + + // bi-directional many-to-one association to AroLinkUnitaDoc + @OneToMany(mappedBy = "aroUnitaDoc") + public List getAroLinkUnitaDocs() { + return this.aroLinkUnitaDocs; + } + + public void setAroLinkUnitaDocs(List aroLinkUnitaDocs) { + this.aroLinkUnitaDocs = aroLinkUnitaDocs; + } + + // bi-directional many-to-one association to DecRegistroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_REGISTRO_UNITA_DOC") + public DecRegistroUnitaDoc getDecRegistroUnitaDoc() { + return this.decRegistroUnitaDoc; + } + + public void setDecRegistroUnitaDoc(DecRegistroUnitaDoc decRegistroUnitaDoc) { + this.decRegistroUnitaDoc = decRegistroUnitaDoc; + } + + // bi-directional many-to-one association to DecTipoUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_UNITA_DOC") + public DecTipoUnitaDoc getDecTipoUnitaDoc() { + return this.decTipoUnitaDoc; + } + + public void setDecTipoUnitaDoc(DecTipoUnitaDoc decTipoUnitaDoc) { + this.decTipoUnitaDoc = decTipoUnitaDoc; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to OrgSubStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SUB_STRUT") + public OrgSubStrut getOrgSubStrut() { + return this.orgSubStrut; + } + + public void setOrgSubStrut(OrgSubStrut orgSubStrut) { + this.orgSubStrut = orgSubStrut; + } + + @Column(name = "ID_REGISTRO_UNITA_DOC", insertable = false, updatable = false) + public Long getIdDecRegistroUnitaDoc() { + return idDecRegistroUnitaDoc; + } + + public void setIdDecRegistroUnitaDoc(Long idDecRegistroUnitaDoc) { + this.idDecRegistroUnitaDoc = idDecRegistroUnitaDoc; + } + + @Column(name = "ID_TIPO_UNITA_DOC", insertable = false, updatable = false) + public Long getIdDecTipoUnitaDoc() { + return idDecTipoUnitaDoc; + } + + public void setIdDecTipoUnitaDoc(Long idDecTipoUnitaDoc) { + this.idDecTipoUnitaDoc = idDecTipoUnitaDoc; + } + + @Column(name = "ID_STRUT", insertable = false, updatable = false) + public Long getIdOrgStrut() { + return idOrgStrut; + } + + public void setIdOrgStrut(Long idOrgStrut) { + this.idOrgStrut = idOrgStrut; + } + + @Column(name = "ID_SUB_STRUT", insertable = false, updatable = false) + public Long getIdOrgSubStrut() { + return idOrgSubStrut; + } + + public void setIdOrgSubStrut(Long idOrgSubStrut) { + this.idOrgSubStrut = idOrgSubStrut; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USER_VERS") + public IamUser getIamUser() { + return this.iamUser; + } + + public void setIamUser(IamUser iamUser) { + this.iamUser = iamUser; + } + + // bi-directional many-to-one association to VrsSessioneVers + @OneToMany(mappedBy = "aroUnitaDoc") + public List getVrsSessioneVers() { + return this.vrsSessioneVers; + } + + public void setVrsSessioneVers(List vrsSessioneVers) { + this.vrsSessioneVers = vrsSessioneVers; + } + + // bi-directional many-to-one association to AroUsoXsdDatiSpec + @OneToMany(mappedBy = "aroUnitaDoc") + public List getAroUsoXsdDatiSpecs() { + return this.aroUsoXsdDatiSpecs; + } + + public void setAroUsoXsdDatiSpecs(List aroUsoXsdDatiSpecs) { + this.aroUsoXsdDatiSpecs = aroUsoXsdDatiSpecs; + } + + // bi-directional many-to-one association to AroWarnUnitaDoc + @OneToMany(mappedBy = "aroUnitaDoc") + public List getAroWarnUnitaDocs() { + return this.aroWarnUnitaDocs; + } + + public void setAroWarnUnitaDocs(List aroWarnUnitaDocs) { + this.aroWarnUnitaDocs = aroWarnUnitaDocs; + } + + // bi-directional many-to-one association to AroIndiceAipUd + @OneToMany(mappedBy = "aroUnitaDoc", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getAroIndiceAipUds() { + return this.aroIndiceAipUds; + } + + public void setAroIndiceAipUds(List aroIndiceAipUds) { + this.aroIndiceAipUds = aroIndiceAipUds; + } + + // bi-directional many-to-one association to ElvUdVersDaElabElenco + @OneToMany(mappedBy = "aroUnitaDoc") + public List getElvUdVersDaElabElencos() { + return this.elvUdVersDaElabElencos; + } + + public void setElvUdVersDaElabElencos(List elvUdVersDaElabElencos) { + this.elvUdVersDaElabElencos = elvUdVersDaElabElencos; + } + + // bi-directional many-to-one association to FasUnitaDocFascicolo + @OneToMany(mappedBy = "aroUnitaDoc") + public List getFasUnitaDocFascicolos() { + return this.fasUnitaDocFascicolos; + } + + public void setFasUnitaDocFascicolos(List fasUnitaDocFascicolos) { + this.fasUnitaDocFascicolos = fasUnitaDocFascicolos; + } + + // bi-directional one-to-one association to AroVersIniUnitaDoc + @OneToMany(mappedBy = "aroUnitaDoc") + public List getAroVersIniUnitaDocs() { + return this.aroVersIniUnitaDocs; + } + + public void setAroVersIniUnitaDocs(List aroVersIniUnitaDocs) { + this.aroVersIniUnitaDocs = aroVersIniUnitaDocs; + } + + // bi-directional one-to-one association to AroUpdUnitaDoc + @OneToMany(mappedBy = "aroUnitaDoc") + public List getAroUpdUnitaDocs() { + return this.aroUpdUnitaDocs; + } + + public void setAroUpdUnitaDocs(List aroUpdUnitaDocs) { + this.aroUpdUnitaDocs = aroUpdUnitaDocs; + } + + @OneToOne(cascade = CascadeType.ALL) + @PrimaryKeyJoinColumn + public AroXmlUnitaDocObjectStorage getAroXmlUnitaDocObjectStorage() { + return aroXmlUnitaDocObjectStorage; + } + + public void setAroXmlUnitaDocObjectStorage(AroXmlUnitaDocObjectStorage aroXmlUnitaDocObjectStorage) { + this.aroXmlUnitaDocObjectStorage = aroXmlUnitaDocObjectStorage; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdArchivSec.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdArchivSec.java new file mode 100644 index 0000000..0891852 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdArchivSec.java @@ -0,0 +1,132 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_UPD_ARCHIV_SEC database table. + */ +@Entity +@Table(name = "ARO_UPD_ARCHIV_SEC") +public class AroUpdArchivSec implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUpdArchivSec; + + private String cdFascic; + + private String cdSottofascic; + + private String dsClassif; + + private String dsOggettoFascic; + + private String dsOggettoSottofascic; + + private AroUpdUnitaDoc aroUpdUnitaDoc; + + public AroUpdArchivSec() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UPD_ARCHIV_SEC") + @GenericGenerator(name = "SARO_UPD_ARCHIV_SEC_ID_UPD_ARCHIV_SEC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_UPD_ARCHIV_SEC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_UPD_ARCHIV_SEC_ID_UPD_ARCHIV_SEC_GENERATOR") + public Long getIdUpdArchivSec() { + return this.idUpdArchivSec; + } + + public void setIdUpdArchivSec(Long idUpdArchivSec) { + this.idUpdArchivSec = idUpdArchivSec; + } + + @Column(name = "CD_FASCIC") + public String getCdFascic() { + return this.cdFascic; + } + + public void setCdFascic(String cdFascic) { + this.cdFascic = cdFascic; + } + + @Column(name = "CD_SOTTOFASCIC") + public String getCdSottofascic() { + return this.cdSottofascic; + } + + public void setCdSottofascic(String cdSottofascic) { + this.cdSottofascic = cdSottofascic; + } + + @Column(name = "DS_CLASSIF") + public String getDsClassif() { + return this.dsClassif; + } + + public void setDsClassif(String dsClassif) { + this.dsClassif = dsClassif; + } + + @Column(name = "DS_OGGETTO_FASCIC") + public String getDsOggettoFascic() { + return this.dsOggettoFascic; + } + + public void setDsOggettoFascic(String dsOggettoFascic) { + this.dsOggettoFascic = dsOggettoFascic; + } + + @Column(name = "DS_OGGETTO_SOTTOFASCIC") + public String getDsOggettoSottofascic() { + return this.dsOggettoSottofascic; + } + + public void setDsOggettoSottofascic(String dsOggettoSottofascic) { + this.dsOggettoSottofascic = dsOggettoSottofascic; + } + + // bi-directional one-to-one association to AroUpdUnitaDoc + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_UNITA_DOC") + public AroUpdUnitaDoc getAroUpdUnitaDoc() { + return this.aroUpdUnitaDoc; + } + + public void setAroUpdUnitaDoc(AroUpdUnitaDoc aroUpdUnitaDoc) { + this.aroUpdUnitaDoc = aroUpdUnitaDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdCompUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdCompUnitaDoc.java new file mode 100644 index 0000000..f65b439 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdCompUnitaDoc.java @@ -0,0 +1,161 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_UPD_COMP_UNITA_DOC database table. + */ +@Entity +@Table(name = "ARO_UPD_COMP_UNITA_DOC") +public class AroUpdCompUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUpdCompUnitaDoc; + + private String dlUrnCompVers; + + private String dsIdCompVers; + + private String dsNomeCompVers; + + private AroCompDoc aroCompDoc; + + private AroUpdDocUnitaDoc aroUpdDocUnitaDoc; + + private List aroUpdDatiSpecUnitaDocs = new ArrayList<>(); + + private String flUpdDatiSpec; + + private String flUpdDatiSpecMigraz; + + public AroUpdCompUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UPD_COMP_UNITA_DOC") + @GenericGenerator(name = "SARO_UPD_COMP_UNITA_DOC_ID_UPD_COMP_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_UPD_COMP_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_UPD_COMP_UNITA_DOC_ID_UPD_COMP_UNITA_DOC_GENERATOR") + public Long getIdUpdCompUnitaDoc() { + return this.idUpdCompUnitaDoc; + } + + public void setIdUpdCompUnitaDoc(Long idUpdCompUnitaDoc) { + this.idUpdCompUnitaDoc = idUpdCompUnitaDoc; + } + + @Column(name = "DL_URN_COMP_VERS") + public String getDlUrnCompVers() { + return this.dlUrnCompVers; + } + + public void setDlUrnCompVers(String dlUrnCompVers) { + this.dlUrnCompVers = dlUrnCompVers; + } + + @Column(name = "DS_ID_COMP_VERS") + public String getDsIdCompVers() { + return this.dsIdCompVers; + } + + public void setDsIdCompVers(String dsIdCompVers) { + this.dsIdCompVers = dsIdCompVers; + } + + @Column(name = "DS_NOME_COMP_VERS") + public String getDsNomeCompVers() { + return this.dsNomeCompVers; + } + + public void setDsNomeCompVers(String dsNomeCompVers) { + this.dsNomeCompVers = dsNomeCompVers; + } + + // bi-directional many-to-one association to AroDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_COMP_DOC") + public AroCompDoc getAroCompDoc() { + return this.aroCompDoc; + } + + public void setAroCompDoc(AroCompDoc aroCompDoc) { + this.aroCompDoc = aroCompDoc; + } + + // bi-directional many-to-one association to AroDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_DOC_UNITA_DOC") + public AroUpdDocUnitaDoc getAroUpdDocUnitaDoc() { + return this.aroUpdDocUnitaDoc; + } + + public void setAroUpdDocUnitaDoc(AroUpdDocUnitaDoc aroUpdDocUnitaDoc) { + this.aroUpdDocUnitaDoc = aroUpdDocUnitaDoc; + } + + // bi-directional many-to-one association to AroUpdDatiSpecUnitaDoc + @OneToMany(mappedBy = "aroUpdCompUnitaDoc", cascade = { CascadeType.PERSIST, CascadeType.MERGE, + CascadeType.REFRESH }) + public List getAroUpdDatiSpecUnitaDocs() { + return this.aroUpdDatiSpecUnitaDocs; + } + + public void setAroUpdDatiSpecUnitaDocs(List aroUpdDatiSpecUnitaDocs) { + this.aroUpdDatiSpecUnitaDocs = aroUpdDatiSpecUnitaDocs; + } + + @Column(name = "FL_UPD_DATI_SPEC", columnDefinition = "char(1)") + public String getFlUpdDatiSpec() { + return this.flUpdDatiSpec; + } + + public void setFlUpdDatiSpec(String flUpdDatiSpec) { + this.flUpdDatiSpec = flUpdDatiSpec; + } + + @Column(name = "FL_UPD_DATI_SPEC_MIGRAZ", columnDefinition = "char(1)") + public String getFlUpdDatiSpecMigraz() { + return this.flUpdDatiSpecMigraz; + } + + public void setFlUpdDatiSpecMigraz(String flUpdDatiSpecMigraz) { + this.flUpdDatiSpecMigraz = flUpdDatiSpecMigraz; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdDatiSpecUdObjectStorage.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdDatiSpecUdObjectStorage.java new file mode 100644 index 0000000..c967e1a --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdDatiSpecUdObjectStorage.java @@ -0,0 +1,153 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import it.eng.parer.entity.constraint.AroUpdDatiSpecUnitaDoc.TiEntitaAroUpdDatiSpecUnitaDoc; + +@Entity +@Table(name = "ARO_UPD_DATI_SPEC_UD_OBJECT_STORAGE") +public class AroUpdDatiSpecUdObjectStorage implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUpdDatiSpecUdObjectStorage; + private AroUpdUnitaDoc aroUpdUnitaDoc; + private AroUpdDocUnitaDoc aroUpdDocUnitaDoc; + private AroUpdCompUnitaDoc aroUpdCompUnitaDoc; + private TiEntitaAroUpdDatiSpecUnitaDoc tiEntitaSacer; + private DecBackend decBackend; + private String nmTenant; + private String nmBucket; + private String cdKeyFile; + private BigDecimal idStrut; + + public AroUpdDatiSpecUdObjectStorage() { + // hibernate constructor + } + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "ID_UPD_DATI_SPEC_UD_OBJECT_STORAGE") + public Long getIdUpdDatiSpecUdObjectStorage() { + return idUpdDatiSpecUdObjectStorage; + } + + public void setIdUpdDatiSpecUdObjectStorage(Long idUpdDatiSpecUdObjectStorage) { + this.idUpdDatiSpecUdObjectStorage = idUpdDatiSpecUdObjectStorage; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_UNITA_DOC") + public AroUpdUnitaDoc getAroUpdUnitaDoc() { + return aroUpdUnitaDoc; + } + + public void setAroUpdUnitaDoc(AroUpdUnitaDoc aroUpdUnitaDoc) { + this.aroUpdUnitaDoc = aroUpdUnitaDoc; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_DOC_UNITA_DOC") + public AroUpdDocUnitaDoc getAroUpdDocUnitaDoc() { + return aroUpdDocUnitaDoc; + } + + public void setAroUpdDocUnitaDoc(AroUpdDocUnitaDoc aroUpdDocUnitaDoc) { + this.aroUpdDocUnitaDoc = aroUpdDocUnitaDoc; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_COMP_UNITA_DOC") + public AroUpdCompUnitaDoc getAroUpdCompUnitaDoc() { + return aroUpdCompUnitaDoc; + } + + public void setAroUpdCompUnitaDoc(AroUpdCompUnitaDoc aroUpdCompUnitaDoc) { + this.aroUpdCompUnitaDoc = aroUpdCompUnitaDoc; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_ENTITA_SACER") + public TiEntitaAroUpdDatiSpecUnitaDoc getTiEntitaSacer() { + return this.tiEntitaSacer; + } + + public void setTiEntitaSacer(TiEntitaAroUpdDatiSpecUnitaDoc tiEntitaSacer) { + this.tiEntitaSacer = tiEntitaSacer; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DEC_BACKEND") + public DecBackend getDecBackend() { + return decBackend; + } + + public void setDecBackend(DecBackend decBackend) { + this.decBackend = decBackend; + } + + @Column(name = "NM_TENANT") + public String getNmTenant() { + return nmTenant; + } + + public void setNmTenant(String nmTenant) { + this.nmTenant = nmTenant; + } + + @Column(name = "NM_BUCKET") + public String getNmBucket() { + return nmBucket; + } + + public void setNmBucket(String nmBucket) { + this.nmBucket = nmBucket; + } + + @Column(name = "CD_KEY_FILE") + public String getCdKeyFile() { + return cdKeyFile; + } + + public void setCdKeyFile(String cdKeyFile) { + this.cdKeyFile = cdKeyFile; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdDatiSpecUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdDatiSpecUnitaDoc.java new file mode 100644 index 0000000..f1603db --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdDatiSpecUnitaDoc.java @@ -0,0 +1,195 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.time.LocalDate; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.AroUpdDatiSpecUnitaDoc.TiEntitaAroUpdDatiSpecUnitaDoc; +import it.eng.parer.entity.constraint.AroUpdDatiSpecUnitaDoc.TiUsoXsdAroUpdDatiSpecUnitaDoc; + +/** + * The persistent class for the ARO_UPD_DATI_SPEC_UNITA_DOC database table. + */ +@Entity +@Table(name = "ARO_UPD_DATI_SPEC_UNITA_DOC") +public class AroUpdDatiSpecUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUpdDatiSpecUnitaDoc; + + private String blXmlDatiSpec; + + private LocalDate dtIniSes; + + private OrgStrut orgStrut; + + private AroUpdCompUnitaDoc aroUpdCompUnitaDoc; + + private AroUpdDocUnitaDoc aroUpdDocUnitaDoc; + + private AroUpdUnitaDoc aroUpdUnitaDoc; + + private DecXsdDatiSpec decXsdDatiSpec; + + private TiEntitaAroUpdDatiSpecUnitaDoc tiEntitaSacer; + + private TiUsoXsdAroUpdDatiSpecUnitaDoc tiUsoXsd; + + private Integer aaIniSes; + + public AroUpdDatiSpecUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UPD_DATI_SPEC_UNITA_DOC") + @GenericGenerator(name = "SARO_UPD_DATI_SPEC_UNITA_DOC_ID_UPD_DATI_SPEC_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_UPD_DATI_SPEC_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_UPD_DATI_SPEC_UNITA_DOC_ID_UPD_DATI_SPEC_UNITA_DOC_GENERATOR") + public Long getIdUpdDatiSpecUnitaDoc() { + return this.idUpdDatiSpecUnitaDoc; + } + + public void setIdUpdDatiSpecUnitaDoc(Long idUpdDatiSpecUnitaDoc) { + this.idUpdDatiSpecUnitaDoc = idUpdDatiSpecUnitaDoc; + } + + @Lob + @Column(name = "BL_XML_DATI_SPEC") + public String getBlXmlDatiSpec() { + return this.blXmlDatiSpec; + } + + public void setBlXmlDatiSpec(String blXmlDatiSpec) { + this.blXmlDatiSpec = blXmlDatiSpec; + } + + @Column(name = "DT_INI_SES") + public LocalDate getDtIniSes() { + return this.dtIniSes; + } + + public void setDtIniSes(LocalDate dtIniSes) { + this.dtIniSes = dtIniSes; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to AroUpdCompUnitaDoc + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_COMP_UNITA_DOC") + public AroUpdCompUnitaDoc getAroUpdCompUnitaDoc() { + return this.aroUpdCompUnitaDoc; + } + + public void setAroUpdCompUnitaDoc(AroUpdCompUnitaDoc aroUpdCompUnitaDoc) { + this.aroUpdCompUnitaDoc = aroUpdCompUnitaDoc; + } + + // bi-directional many-to-one association to AroUpdDocUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_DOC_UNITA_DOC") + public AroUpdDocUnitaDoc getAroUpdDocUnitaDoc() { + return this.aroUpdDocUnitaDoc; + } + + public void setAroUpdDocUnitaDoc(AroUpdDocUnitaDoc aroUpdDocUnitaDoc) { + this.aroUpdDocUnitaDoc = aroUpdDocUnitaDoc; + } + + // bi-directional many-to-one association to AroUpdUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_UNITA_DOC") + public AroUpdUnitaDoc getAroUpdUnitaDoc() { + return this.aroUpdUnitaDoc; + } + + public void setAroUpdUnitaDoc(AroUpdUnitaDoc aroUpdUnitaDoc) { + this.aroUpdUnitaDoc = aroUpdUnitaDoc; + } + + // bi-directional many-to-one association to DecXsdDatiSpec + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_XSD_DATI_SPEC") + public DecXsdDatiSpec getDecXsdDatiSpec() { + return this.decXsdDatiSpec; + } + + public void setDecXsdDatiSpec(DecXsdDatiSpec decXsdDatiSpec) { + this.decXsdDatiSpec = decXsdDatiSpec; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_ENTITA_SACER") + public TiEntitaAroUpdDatiSpecUnitaDoc getTiEntitaSacer() { + return this.tiEntitaSacer; + } + + public void setTiEntitaSacer(TiEntitaAroUpdDatiSpecUnitaDoc tiEntitaSacer) { + this.tiEntitaSacer = tiEntitaSacer; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_USO_XSD") + public TiUsoXsdAroUpdDatiSpecUnitaDoc getTiUsoXsd() { + return this.tiUsoXsd; + } + + public void setTiUsoXsd(TiUsoXsdAroUpdDatiSpecUnitaDoc tiUsoXsd) { + this.tiUsoXsd = tiUsoXsd; + } + + @Column(name = "AA_INI_SES") + public Integer getAaIniSes() { + return aaIniSes; + } + + public void setAaIniSes(Integer aaIniSes) { + this.aaIniSes = aaIniSes; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdDocUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdDocUnitaDoc.java new file mode 100644 index 0000000..39e0a1f --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdDocUnitaDoc.java @@ -0,0 +1,174 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_UPD_DOC_UNITA_DOC database table. + */ +@Entity +@Table(name = "ARO_UPD_DOC_UNITA_DOC") +public class AroUpdDocUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUpdDocUnitaDoc; + + private String dlDoc; + + private String dsAutoreDoc; + + private AroDoc aroDoc; + + private AroUpdUnitaDoc aroUpdUnitaDoc; + + private List aroUpdCompUnitaDocs = new ArrayList<>(); + + private List aroUpdDatiSpecUnitaDocs = new ArrayList<>(); + + private String flUpdProfiloDoc; + + private String flUpdDatiSpec; + + private String flUpdDatiSpecMigraz; + + public AroUpdDocUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UPD_DOC_UNITA_DOC") + @GenericGenerator(name = "SARO_UPD_DOC_UNITA_DOC_ID_UPD_DOC_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_UPD_DOC_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_UPD_DOC_UNITA_DOC_ID_UPD_DOC_UNITA_DOC_GENERATOR") + public Long getIdUpdDocUnitaDoc() { + return this.idUpdDocUnitaDoc; + } + + public void setIdUpdDocUnitaDoc(Long idUpdDocUnitaDoc) { + this.idUpdDocUnitaDoc = idUpdDocUnitaDoc; + } + + @Column(name = "DL_DOC") + public String getDlDoc() { + return this.dlDoc; + } + + public void setDlDoc(String dlDoc) { + this.dlDoc = dlDoc; + } + + @Column(name = "DS_AUTORE_DOC") + public String getDsAutoreDoc() { + return this.dsAutoreDoc; + } + + public void setDsAutoreDoc(String dsAutoreDoc) { + this.dsAutoreDoc = dsAutoreDoc; + } + + // bi-directional many-to-one association to AroDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DOC") + public AroDoc getAroDoc() { + return this.aroDoc; + } + + public void setAroDoc(AroDoc aroDoc) { + this.aroDoc = aroDoc; + } + + // bi-directional many-to-one association to AroDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_UNITA_DOC") + public AroUpdUnitaDoc getAroUpdUnitaDoc() { + return this.aroUpdUnitaDoc; + } + + public void setAroUpdUnitaDoc(AroUpdUnitaDoc aroUpdUnitaDoc) { + this.aroUpdUnitaDoc = aroUpdUnitaDoc; + } + + // bi-directional many-to-one association to AroUpdCompUnitaDoc + @OneToMany(mappedBy = "aroUpdDocUnitaDoc", cascade = { CascadeType.PERSIST, CascadeType.MERGE, + CascadeType.REFRESH }) + public List getAroUpdCompUnitaDocs() { + return this.aroUpdCompUnitaDocs; + } + + public void setAroUpdCompUnitaDocs(List aroUpdCompUnitaDocs) { + this.aroUpdCompUnitaDocs = aroUpdCompUnitaDocs; + } + + // bi-directional many-to-one association to AroUpdDatiSpecUnitaDoc + @OneToMany(mappedBy = "aroUpdDocUnitaDoc", cascade = { CascadeType.PERSIST, CascadeType.MERGE, + CascadeType.REFRESH }) + public List getAroUpdDatiSpecUnitaDocs() { + return this.aroUpdDatiSpecUnitaDocs; + } + + public void setAroUpdDatiSpecUnitaDocs(List aroUpdDatiSpecUnitaDocs) { + this.aroUpdDatiSpecUnitaDocs = aroUpdDatiSpecUnitaDocs; + } + + @Column(name = "FL_UPD_PROFILO_DOC", columnDefinition = "char(1)") + public String getFlUpdProfiloDoc() { + return this.flUpdProfiloDoc; + } + + public void setFlUpdProfiloDoc(String flUpdProfiloDoc) { + this.flUpdProfiloDoc = flUpdProfiloDoc; + } + + @Column(name = "FL_UPD_DATI_SPEC", columnDefinition = "char(1)") + public String getFlUpdDatiSpec() { + return this.flUpdDatiSpec; + } + + public void setFlUpdDatiSpec(String flUpdDatiSpec) { + this.flUpdDatiSpec = flUpdDatiSpec; + } + + @Column(name = "FL_UPD_DATI_SPEC_MIGRAZ", columnDefinition = "char(1)") + public String getFlUpdDatiSpecMigraz() { + return this.flUpdDatiSpecMigraz; + } + + public void setFlUpdDatiSpecMigraz(String flUpdDatiSpecMigraz) { + this.flUpdDatiSpecMigraz = flUpdDatiSpecMigraz; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdLinkUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdLinkUnitaDoc.java new file mode 100644 index 0000000..2361658 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdLinkUnitaDoc.java @@ -0,0 +1,135 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_UPD_LINK_UNITA_DOC database table. + */ +@Entity +@Table(name = "ARO_UPD_LINK_UNITA_DOC") +public class AroUpdLinkUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUpdLinkUnitaDoc; + + private BigDecimal aaKeyUnitaDocLink; + + private String cdKeyUnitaDocLink; + + private String cdRegistroKeyUnitaDocLink; + + private String dsLinkUnitaDoc; + + private AroUnitaDoc aroUnitaDocLink; + + private AroUpdUnitaDoc aroUpdUnitaDoc; + + public AroUpdLinkUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UPD_LINK_UNITA_DOC") + @GenericGenerator(name = "SARO_UPD_LINK_UNITA_DOC_ID_UPD_LINK_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_UPD_LINK_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_UPD_LINK_UNITA_DOC_ID_UPD_LINK_UNITA_DOC_GENERATOR") + public Long getIdUpdLinkUnitaDoc() { + return this.idUpdLinkUnitaDoc; + } + + public void setIdUpdLinkUnitaDoc(Long idUpdLinkUnitaDoc) { + this.idUpdLinkUnitaDoc = idUpdLinkUnitaDoc; + } + + @Column(name = "AA_KEY_UNITA_DOC_LINK") + public BigDecimal getAaKeyUnitaDocLink() { + return this.aaKeyUnitaDocLink; + } + + public void setAaKeyUnitaDocLink(BigDecimal aaKeyUnitaDocLink) { + this.aaKeyUnitaDocLink = aaKeyUnitaDocLink; + } + + @Column(name = "CD_KEY_UNITA_DOC_LINK") + public String getCdKeyUnitaDocLink() { + return this.cdKeyUnitaDocLink; + } + + public void setCdKeyUnitaDocLink(String cdKeyUnitaDocLink) { + this.cdKeyUnitaDocLink = cdKeyUnitaDocLink; + } + + @Column(name = "CD_REGISTRO_KEY_UNITA_DOC_LINK") + public String getCdRegistroKeyUnitaDocLink() { + return this.cdRegistroKeyUnitaDocLink; + } + + public void setCdRegistroKeyUnitaDocLink(String cdRegistroKeyUnitaDocLink) { + this.cdRegistroKeyUnitaDocLink = cdRegistroKeyUnitaDocLink; + } + + @Column(name = "DS_LINK_UNITA_DOC") + public String getDsLinkUnitaDoc() { + return this.dsLinkUnitaDoc; + } + + public void setDsLinkUnitaDoc(String dsLinkUnitaDoc) { + this.dsLinkUnitaDoc = dsLinkUnitaDoc; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC_LINK") + public AroUnitaDoc getAroUnitaDocLink() { + return this.aroUnitaDocLink; + } + + public void setAroUnitaDocLink(AroUnitaDoc aroUnitaDocLink) { + this.aroUnitaDocLink = aroUnitaDocLink; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_UNITA_DOC") + public AroUpdUnitaDoc getAroUpdUnitaDoc() { + return this.aroUpdUnitaDoc; + } + + public void setAroUpdUnitaDoc(AroUpdUnitaDoc aroUpdUnitaDoc) { + this.aroUpdUnitaDoc = aroUpdUnitaDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdUnitaDoc.java new file mode 100644 index 0000000..3253191 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUpdUnitaDoc.java @@ -0,0 +1,603 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.xml.bind.annotation.XmlTransient; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.AroUpdUnitaDoc.AroUpdUDTiStatoUpdElencoVers; +import javax.persistence.OneToOne; +import javax.persistence.PrimaryKeyJoinColumn; + +/** + * The persistent class for the ARO_UPD_UNITA_DOC database table. + */ +@Entity +@Table(name = "ARO_UPD_UNITA_DOC") +public class AroUpdUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUpdUnitaDoc; + + private String cdFascicPrinc; + + private String cdIndIpClient; + + private String cdIndServer; + + private String cdSottofascicPrinc; + + private String dlOggettoUnitaDoc; + + private String dsClassifPrinc; + + private String dsOggettoFascicPrinc; + + private String dsOggettoSottofascicPrinc; + + private Date dtAnnul; + + private Date dtRegUnitaDoc; + + private String flForzaUpd; + + private AroUnitaDoc aroUnitaDoc; + + private IamUser iamUser; + + private String ntUpd; + + private BigDecimal pgUpdUnitaDoc; + + private AroUpdUDTiStatoUpdElencoVers tiStatoUpdElencoVers; + + private Date tsFineSes; + + private Date tsIniSes; + + private Date tsStatoElencoVers; + + private Date tsLastResetStato; + + private List aroUpdDatiSpecUnitaDocs = new ArrayList<>(); + + private List aroUpdDocUnitaDocs = new ArrayList<>(); + + private List aroUpdLinkUnitaDocs = new ArrayList<>(); + + private List aroWarnUpdUnitaDocs = new ArrayList<>(); + + private List aroXmlUpdUnitaDocs = new ArrayList<>(); + + private List aroUpdArchivSecs = new ArrayList<>(); + + private List elvUpdUdDaElabElencos = new ArrayList<>(); + + private OrgStrut orgStrut; + + private BigDecimal aaKeyUnitaDoc; + + private DecRegistroUnitaDoc decRegistroUnitaDoc; + + private DecTipoUnitaDoc decTipoUnitaDoc; + + private DecTipoDoc decTipoDocPrinc; + + private String flSesUpdKoRisolti; + + private String flUpdProfiloArchiv; + + private String flUpdFascicoloPrinc; + + private String flUpdFascicoliSec; + + private String flUpdProfiloUnitaDoc; + + private String flUpdLinkUnitaDoc; + + private String flUpdDatiSpec; + + private String flUpdDatiSpecMigraz; + + private String flUpdProfiloNormativo; + + private String ntAnnul; + + private String tipoUpdUnitaDoc; + + private BigDecimal niResetStato; + + private AroXmlUpdUdObjectStorage aroXmlUpdUdObjectStorage; + + public AroUpdUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UPD_UNITA_DOC") + @GenericGenerator(name = "SARO_UPD_UNITA_DOC_ID_UPD_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_UPD_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_UPD_UNITA_DOC_ID_UPD_UNITA_DOC_GENERATOR") + public Long getIdUpdUnitaDoc() { + return this.idUpdUnitaDoc; + } + + public void setIdUpdUnitaDoc(Long idUpdUnitaDoc) { + this.idUpdUnitaDoc = idUpdUnitaDoc; + } + + @Column(name = "CD_FASCIC_PRINC") + public String getCdFascicPrinc() { + return this.cdFascicPrinc; + } + + public void setCdFascicPrinc(String cdFascicPrinc) { + this.cdFascicPrinc = cdFascicPrinc; + } + + @Column(name = "CD_IND_IP_CLIENT") + public String getCdIndIpClient() { + return this.cdIndIpClient; + } + + public void setCdIndIpClient(String cdIndIpClient) { + this.cdIndIpClient = cdIndIpClient; + } + + @Column(name = "CD_IND_SERVER") + public String getCdIndServer() { + return this.cdIndServer; + } + + public void setCdIndServer(String cdIndServer) { + this.cdIndServer = cdIndServer; + } + + @Column(name = "CD_SOTTOFASCIC_PRINC") + public String getCdSottofascicPrinc() { + return this.cdSottofascicPrinc; + } + + public void setCdSottofascicPrinc(String cdSottofascicPrinc) { + this.cdSottofascicPrinc = cdSottofascicPrinc; + } + + @Column(name = "DL_OGGETTO_UNITA_DOC") + public String getDlOggettoUnitaDoc() { + return this.dlOggettoUnitaDoc; + } + + public void setDlOggettoUnitaDoc(String dlOggettoUnitaDoc) { + this.dlOggettoUnitaDoc = dlOggettoUnitaDoc; + } + + @Column(name = "DS_CLASSIF_PRINC") + public String getDsClassifPrinc() { + return this.dsClassifPrinc; + } + + public void setDsClassifPrinc(String dsClassifPrinc) { + this.dsClassifPrinc = dsClassifPrinc; + } + + @Column(name = "DS_OGGETTO_FASCIC_PRINC") + public String getDsOggettoFascicPrinc() { + return this.dsOggettoFascicPrinc; + } + + public void setDsOggettoFascicPrinc(String dsOggettoFascicPrinc) { + this.dsOggettoFascicPrinc = dsOggettoFascicPrinc; + } + + @Column(name = "DS_OGGETTO_SOTTOFASCIC_PRINC") + public String getDsOggettoSottofascicPrinc() { + return this.dsOggettoSottofascicPrinc; + } + + public void setDsOggettoSottofascicPrinc(String dsOggettoSottofascicPrinc) { + this.dsOggettoSottofascicPrinc = dsOggettoSottofascicPrinc; + } + + @Temporal(TemporalType.DATE) + @Column(name = "DT_ANNUL") + public Date getDtAnnul() { + return this.dtAnnul; + } + + public void setDtAnnul(Date dtAnnul) { + this.dtAnnul = dtAnnul; + } + + @Temporal(TemporalType.DATE) + @Column(name = "DT_REG_UNITA_DOC") + public Date getDtRegUnitaDoc() { + return this.dtRegUnitaDoc; + } + + public void setDtRegUnitaDoc(Date dtRegUnitaDoc) { + this.dtRegUnitaDoc = dtRegUnitaDoc; + } + + @Column(name = "FL_FORZA_UPD", columnDefinition = "char(1)") + public String getFlForzaUpd() { + return this.flForzaUpd; + } + + public void setFlForzaUpd(String flForzaUpd) { + this.flForzaUpd = flForzaUpd; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC") + public AroUnitaDoc getAroUnitaDoc() { + return this.aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USER_IAM_VERS") + public IamUser getIamUser() { + return this.iamUser; + } + + public void setIamUser(IamUser iamUser) { + this.iamUser = iamUser; + } + + @Column(name = "NT_UPD") + public String getNtUpd() { + return this.ntUpd; + } + + public void setNtUpd(String ntUpd) { + this.ntUpd = ntUpd; + } + + @Column(name = "PG_UPD_UNITA_DOC") + public BigDecimal getPgUpdUnitaDoc() { + return this.pgUpdUnitaDoc; + } + + public void setPgUpdUnitaDoc(BigDecimal pgUpdUnitaDoc) { + this.pgUpdUnitaDoc = pgUpdUnitaDoc; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_STATO_UPD_ELENCO_VERS") + public AroUpdUDTiStatoUpdElencoVers getTiStatoUpdElencoVers() { + return this.tiStatoUpdElencoVers; + } + + public void setTiStatoUpdElencoVers(AroUpdUDTiStatoUpdElencoVers tiStatoUpdElencoVers) { + this.tiStatoUpdElencoVers = tiStatoUpdElencoVers; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_FINE_SES") + public Date getTsFineSes() { + return this.tsFineSes; + } + + public void setTsFineSes(Date tsFineSes) { + this.tsFineSes = tsFineSes; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_INI_SES") + public Date getTsIniSes() { + return this.tsIniSes; + } + + public void setTsIniSes(Date tsIniSes) { + this.tsIniSes = tsIniSes; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_STATO_ELENCO_VERS") + public Date getTsStatoElencoVers() { + return this.tsStatoElencoVers; + } + + public void setTsStatoElencoVers(Date tsStatoElencoVers) { + this.tsStatoElencoVers = tsStatoElencoVers; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_LAST_RESET_STATO") + public Date getTsLastResetStato() { + return this.tsLastResetStato; + } + + public void setTsLastResetStato(Date tsLastResetStato) { + this.tsLastResetStato = tsLastResetStato; + } + + // bi-directional many-to-one association to AroUpdDatiSpecUnitaDoc + @OneToMany(mappedBy = "aroUpdUnitaDoc") + @XmlTransient + public List getAroUpdDatiSpecUnitaDocs() { + return this.aroUpdDatiSpecUnitaDocs; + } + + public void setAroUpdDatiSpecUnitaDocs(List aroUpdDatiSpecUnitaDocs) { + this.aroUpdDatiSpecUnitaDocs = aroUpdDatiSpecUnitaDocs; + } + + // bi-directional many-to-one association to AroUpdDocUnitaDoc + @OneToMany(mappedBy = "aroUpdUnitaDoc") + @XmlTransient + public List getAroUpdDocUnitaDocs() { + return this.aroUpdDocUnitaDocs; + } + + public void setAroUpdDocUnitaDocs(List aroUpdDocUnitaDocs) { + this.aroUpdDocUnitaDocs = aroUpdDocUnitaDocs; + } + + // bi-directional many-to-one association to AroUpdLinkUnitaDoc + @OneToMany(mappedBy = "aroUpdUnitaDoc") + public List getAroUpdLinkUnitaDocs() { + return this.aroUpdLinkUnitaDocs; + } + + public void setAroUpdLinkUnitaDocs(List aroUpdLinkUnitaDocs) { + this.aroUpdLinkUnitaDocs = aroUpdLinkUnitaDocs; + } + + // bi-directional many-to-one association to AroWarnUpdUnitaDoc + @OneToMany(mappedBy = "aroUpdUnitaDoc") + public List getAroWarnUpdUnitaDocs() { + return this.aroWarnUpdUnitaDocs; + } + + public void setAroWarnUpdUnitaDocs(List aroWarnUpdUnitaDocs) { + this.aroWarnUpdUnitaDocs = aroWarnUpdUnitaDocs; + } + + // bi-directional many-to-one association to AroXmlUpdUnitaDoc + @OneToMany(mappedBy = "aroUpdUnitaDoc") + public List getAroXmlUpdUnitaDocs() { + return this.aroXmlUpdUnitaDocs; + } + + public void setAroXmlUpdUnitaDocs(List aroXmlUpdUnitaDocs) { + this.aroXmlUpdUnitaDocs = aroXmlUpdUnitaDocs; + } + + // bi-directional many-to-one association to AroUpdArchivSec + @OneToMany(mappedBy = "aroUpdUnitaDoc") + public List getAroUpdArchivSecs() { + return this.aroUpdArchivSecs; + } + + public void setAroUpdArchivSecs(List aroUpdArchivSecs) { + this.aroUpdArchivSecs = aroUpdArchivSecs; + } + + // bi-directional many-to-one association to AroVersIniLinkUnitaDoc + @OneToMany(mappedBy = "aroUpdUnitaDoc", cascade = CascadeType.PERSIST) + public List getElvUpdUdDaElabElencos() { + return this.elvUpdUdDaElabElencos; + } + + public void setElvUpdUdDaElabElencos(List elvUpdUdDaElabElencos) { + this.elvUpdUdDaElabElencos = elvUpdUdDaElabElencos; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return this.aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + // bi-directional many-to-one association to DecRegistroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_REGISTRO_UNITA_DOC") + public DecRegistroUnitaDoc getDecRegistroUnitaDoc() { + return this.decRegistroUnitaDoc; + } + + public void setDecRegistroUnitaDoc(DecRegistroUnitaDoc decRegistroUnitaDoc) { + this.decRegistroUnitaDoc = decRegistroUnitaDoc; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_UNITA_DOC") + public DecTipoUnitaDoc getDecTipoUnitaDoc() { + return this.decTipoUnitaDoc; + } + + public void setDecTipoUnitaDoc(DecTipoUnitaDoc decTipoUnitaDoc) { + this.decTipoUnitaDoc = decTipoUnitaDoc; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_DOC_PRINC") + public DecTipoDoc getDecTipoDocPrinc() { + return this.decTipoDocPrinc; + } + + public void setDecTipoDocPrinc(DecTipoDoc decTipoDocPrinc) { + this.decTipoDocPrinc = decTipoDocPrinc; + } + + @Column(name = "FL_SES_UPD_KO_RISOLTI", columnDefinition = "char(1)") + public String getFlSesUpdKoRisolti() { + return this.flSesUpdKoRisolti; + } + + public void setFlSesUpdKoRisolti(String flSesUpdKoRisolti) { + this.flSesUpdKoRisolti = flSesUpdKoRisolti; + } + + @Column(name = "FL_UPD_PROFILO_ARCHIV", columnDefinition = "char(1)") + public String getFlUpdProfiloArchiv() { + return this.flUpdProfiloArchiv; + } + + public void setFlUpdProfiloArchiv(String flUpdProfiloArchiv) { + this.flUpdProfiloArchiv = flUpdProfiloArchiv; + } + + @Column(name = "FL_UPD_FASCICOLO_PRINC", columnDefinition = "char(1)") + public String getFlUpdFascicoloPrinc() { + return this.flUpdFascicoloPrinc; + } + + public void setFlUpdFascicoloPrinc(String flUpdFascicoloPrinc) { + this.flUpdFascicoloPrinc = flUpdFascicoloPrinc; + } + + @Column(name = "FL_UPD_FASCICOLI_SEC", columnDefinition = "char(1)") + public String getFlUpdFascicoliSec() { + return this.flUpdFascicoliSec; + } + + public void setFlUpdFascicoliSec(String flUpdFascicoliSec) { + this.flUpdFascicoliSec = flUpdFascicoliSec; + } + + @Column(name = "FL_UPD_PROFILO_UNITA_DOC", columnDefinition = "char(1)") + public String getFlUpdProfiloUnitaDoc() { + return this.flUpdProfiloUnitaDoc; + } + + public void setFlUpdProfiloUnitaDoc(String flUpdProfiloUnitaDoc) { + this.flUpdProfiloUnitaDoc = flUpdProfiloUnitaDoc; + } + + @Column(name = "FL_UPD_LINK_UNITA_DOC", columnDefinition = "char(1)") + public String getFlUpdLinkUnitaDoc() { + return this.flUpdLinkUnitaDoc; + } + + public void setFlUpdLinkUnitaDoc(String flUpdLinkUnitaDoc) { + this.flUpdLinkUnitaDoc = flUpdLinkUnitaDoc; + } + + @Column(name = "FL_UPD_DATI_SPEC", columnDefinition = "char(1)") + public String getFlUpdDatiSpec() { + return this.flUpdDatiSpec; + } + + public void setFlUpdDatiSpec(String flUpdDatiSpec) { + this.flUpdDatiSpec = flUpdDatiSpec; + } + + @Column(name = "FL_UPD_DATI_SPEC_MIGRAZ", columnDefinition = "char(1)") + public String getFlUpdDatiSpecMigraz() { + return this.flUpdDatiSpecMigraz; + } + + public void setFlUpdDatiSpecMigraz(String flUpdDatiSpecMigraz) { + this.flUpdDatiSpecMigraz = flUpdDatiSpecMigraz; + } + + @Column(name = "NT_ANNUL") + public String getNtAnnul() { + return this.ntAnnul; + } + + public void setNtAnnul(String ntAnnul) { + this.ntAnnul = ntAnnul; + } + + @Column(name = "TIPO_UPD_UNITA_DOC") + public String getTipoUpdUnitaDoc() { + return this.tipoUpdUnitaDoc; + } + + public void setTipoUpdUnitaDoc(String tipoUpdUnitaDoc) { + this.tipoUpdUnitaDoc = tipoUpdUnitaDoc; + } + + @Column(name = "NI_RESET_STATO") + public BigDecimal getNiResetStato() { + return this.niResetStato; + } + + public void setNiResetStato(BigDecimal niResetStato) { + this.niResetStato = niResetStato; + } + + @Column(name = "FL_UPD_PROFILO_NORMATIVO", columnDefinition = "char(1)") + public String getFlUpdProfiloNormativo() { + return flUpdProfiloNormativo; + } + + public void setFlUpdProfiloNormativo(String flUpdProfiloNormativo) { + this.flUpdProfiloNormativo = flUpdProfiloNormativo; + } + + @OneToOne(cascade = CascadeType.ALL) + @PrimaryKeyJoinColumn + public AroXmlUpdUdObjectStorage getAroXmlUpdUdObjectStorage() { + return aroXmlUpdUdObjectStorage; + } + + public void setAroXmlUpdUdObjectStorage(AroXmlUpdUdObjectStorage aroXmlUpdUdObjectStorage) { + this.aroXmlUpdUdObjectStorage = aroXmlUpdUdObjectStorage; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUsoCertifCaContrComp.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUsoCertifCaContrComp.java new file mode 100644 index 0000000..4a14a36 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUsoCertifCaContrComp.java @@ -0,0 +1,128 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_USO_CERTIF_CA_CONTR_COMP database table. + */ +@Entity +@Table(name = "ARO_USO_CERTIF_CA_CONTR_COMP") +public class AroUsoCertifCaContrComp implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUsoCertifCaContrComp; + + private BigDecimal pgCertifCa; + + private AroContrFirmaComp aroContrFirmaComp; + + private FirCertifCa firCertifCa; + + private FirCrl firCrl; + + private FirOcsp firOcsp; + + public AroUsoCertifCaContrComp() {/* Hibernate */ + } + + @Id + @Column(name = "ID_USO_CERTIF_CA_CONTR_COMP") + @GenericGenerator(name = "SARO_USO_CERTIF_CA_CONTR_COMP_ID_USO_CERTIF_CA_CONTR_COMP_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_USO_CERTIF_CA_CONTR_COMP"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_USO_CERTIF_CA_CONTR_COMP_ID_USO_CERTIF_CA_CONTR_COMP_GENERATOR") + public Long getIdUsoCertifCaContrComp() { + return this.idUsoCertifCaContrComp; + } + + public void setIdUsoCertifCaContrComp(Long idUsoCertifCaContrComp) { + this.idUsoCertifCaContrComp = idUsoCertifCaContrComp; + } + + @Column(name = "PG_CERTIF_CA") + public BigDecimal getPgCertifCa() { + return this.pgCertifCa; + } + + public void setPgCertifCa(BigDecimal pgCertifCa) { + this.pgCertifCa = pgCertifCa; + } + + // bi-directional many-to-one association to AroContrFirmaComp + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CONTR_FIRMA_COMP", nullable = false) + public AroContrFirmaComp getAroContrFirmaComp() { + return this.aroContrFirmaComp; + } + + public void setAroContrFirmaComp(AroContrFirmaComp aroContrFirmaComp) { + this.aroContrFirmaComp = aroContrFirmaComp; + } + + // uni-directional many-to-one association to FirCertifCa + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CERTIF_CA") + public FirCertifCa getFirCertifCa() { + return this.firCertifCa; + } + + public void setFirCertifCa(FirCertifCa firCertifCa) { + this.firCertifCa = firCertifCa; + } + + // uni-directional many-to-one association to FirCrl + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CRL_USATA") + public FirCrl getFirCrl() { + return this.firCrl; + } + + public void setFirCrl(FirCrl firCrl) { + this.firCrl = firCrl; + } + + // uni-directional many-to-one association to FirCrl + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_OCSP_USATA") + public FirOcsp getFirOcsp() { + return this.firOcsp; + } + + public void setFirOcsp(FirOcsp firOcsp) { + this.firOcsp = firOcsp; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUsoCertifCaContrMarca.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUsoCertifCaContrMarca.java new file mode 100644 index 0000000..2454a00 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUsoCertifCaContrMarca.java @@ -0,0 +1,129 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_USO_CERTIF_CA_CONTR_MARCA database table. + */ +@Entity +@Table(name = "ARO_USO_CERTIF_CA_CONTR_MARCA") +public class AroUsoCertifCaContrMarca implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUsoCertifCaContrMarca; + + private BigDecimal pgCertifCa; + + private AroContrMarcaComp aroContrMarcaComp; + + private FirCertifCa firCertifCa; + + private FirCrl firCrl; + + private FirOcsp firOcsp; + + public AroUsoCertifCaContrMarca() {/* Hibernate */ + } + + @Id + @Column(name = "ID_USO_CERTIF_CA_CONTR_MARCA") + @GenericGenerator(name = "SARO_USO_CERTIF_CA_CONTR_MARCA_ID_USO_CERTIF_CA_CONTR_MARCA_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_USO_CERTIF_CA_CONTR_MARCA"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_USO_CERTIF_CA_CONTR_MARCA_ID_USO_CERTIF_CA_CONTR_MARCA_GENERATOR") + public Long getIdUsoCertifCaContrMarca() { + return this.idUsoCertifCaContrMarca; + } + + public void setIdUsoCertifCaContrMarca(Long idUsoCertifCaContrMarca) { + this.idUsoCertifCaContrMarca = idUsoCertifCaContrMarca; + } + + @Column(name = "PG_CERTIF_CA") + public BigDecimal getPgCertifCa() { + return this.pgCertifCa; + } + + public void setPgCertifCa(BigDecimal pgCertifCa) { + this.pgCertifCa = pgCertifCa; + } + + // bi-directional many-to-one association to AroContrMarcaComp + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CONTR_MARCA_COMP", nullable = false) + public AroContrMarcaComp getAroContrMarcaComp() { + return this.aroContrMarcaComp; + } + + public void setAroContrMarcaComp(AroContrMarcaComp aroContrMarcaComp) { + this.aroContrMarcaComp = aroContrMarcaComp; + } + + // uni-directional many-to-one association to FirCertifCa + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CERTIF_CA") + public FirCertifCa getFirCertifCa() { + return this.firCertifCa; + } + + public void setFirCertifCa(FirCertifCa firCertifCa) { + this.firCertifCa = firCertifCa; + } + + // uni-directional many-to-one association to FirCrl + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CRL_USATA") + public FirCrl getFirCrl() { + return this.firCrl; + } + + public void setFirCrl(FirCrl firCrl) { + this.firCrl = firCrl; + } + + // uni-directional many-to-one association to FirCrl + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_OCSP_USATA") + public FirOcsp getFirOcsp() { + return this.firOcsp; + } + + public void setFirOcsp(FirOcsp firOcsp) { + this.firOcsp = firOcsp; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUsoXsdDatiSpec.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUsoXsdDatiSpec.java new file mode 100644 index 0000000..b56554f --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroUsoXsdDatiSpec.java @@ -0,0 +1,167 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_USO_XSD_DATI_SPEC database table. + */ +@Entity +@Table(name = "ARO_USO_XSD_DATI_SPEC") +public class AroUsoXsdDatiSpec implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUsoXsdDatiSpec; + + private BigDecimal idStrut; + + private String tiEntitaSacer; + + private String tiUsoXsd; + + private AroCompDoc aroCompDoc; + + private AroDoc aroDoc; + + private AroUnitaDoc aroUnitaDoc; + + private DecXsdDatiSpec decXsdDatiSpec; + + private List aroValoreAttribDatiSpecs = new ArrayList<>(); + + public AroUsoXsdDatiSpec() {/* Hibernate */ + } + + @Id + @Column(name = "ID_USO_XSD_DATI_SPEC") + @GenericGenerator(name = "SARO_USO_XSD_DATI_SPEC_ID_USO_XSD_DATI_SPEC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_USO_XSD_DATI_SPEC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_USO_XSD_DATI_SPEC_ID_USO_XSD_DATI_SPEC_GENERATOR") + public Long getIdUsoXsdDatiSpec() { + return this.idUsoXsdDatiSpec; + } + + public void setIdUsoXsdDatiSpec(Long idUsoXsdDatiSpec) { + this.idUsoXsdDatiSpec = idUsoXsdDatiSpec; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "TI_ENTITA_SACER") + public String getTiEntitaSacer() { + return this.tiEntitaSacer; + } + + public void setTiEntitaSacer(String tiEntitaSacer) { + this.tiEntitaSacer = tiEntitaSacer; + } + + @Column(name = "TI_USO_XSD") + public String getTiUsoXsd() { + return this.tiUsoXsd; + } + + public void setTiUsoXsd(String tiUsoXsd) { + this.tiUsoXsd = tiUsoXsd; + } + + // bi-directional many-to-one association to AroCompDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_COMP_DOC") + public AroCompDoc getAroCompDoc() { + return this.aroCompDoc; + } + + public void setAroCompDoc(AroCompDoc aroCompDoc) { + this.aroCompDoc = aroCompDoc; + } + + // bi-directional many-to-one association to AroDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DOC") + public AroDoc getAroDoc() { + return this.aroDoc; + } + + public void setAroDoc(AroDoc aroDoc) { + this.aroDoc = aroDoc; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC") + public AroUnitaDoc getAroUnitaDoc() { + return this.aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } + + // bi-directional many-to-one association to DecXsdDatiSpec + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_XSD_DATI_SPEC") + public DecXsdDatiSpec getDecXsdDatiSpec() { + return this.decXsdDatiSpec; + } + + public void setDecXsdDatiSpec(DecXsdDatiSpec decXsdDatiSpec) { + this.decXsdDatiSpec = decXsdDatiSpec; + } + + // bi-directional many-to-one association to AroValoreAttribDatiSpec + @OneToMany(mappedBy = "aroUsoXsdDatiSpec", cascade = { CascadeType.PERSIST, CascadeType.MERGE, + CascadeType.REFRESH }) + public List getAroValoreAttribDatiSpecs() { + return this.aroValoreAttribDatiSpecs; + } + + public void setAroValoreAttribDatiSpecs(List aroValoreAttribDatiSpecs) { + this.aroValoreAttribDatiSpecs = aroValoreAttribDatiSpecs; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroValoreAttribDatiSpec.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroValoreAttribDatiSpec.java new file mode 100644 index 0000000..27e4700 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroValoreAttribDatiSpec.java @@ -0,0 +1,113 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_VALORE_ATTRIB_DATI_SPEC database table. + */ +@Entity +@Table(name = "ARO_VALORE_ATTRIB_DATI_SPEC") +public class AroValoreAttribDatiSpec implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idValoreAttribDatiSpec; + + private String dlValore; + + private BigDecimal idStrut; + + private AroUsoXsdDatiSpec aroUsoXsdDatiSpec; + + private DecAttribDatiSpec decAttribDatiSpec; + + public AroValoreAttribDatiSpec() {/* Hibernate */ + } + + @Id + @Column(name = "ID_VALORE_ATTRIB_DATI_SPEC") + @GenericGenerator(name = "SARO_VALORE_ATTRIB_DATI_SPEC_ID_VALORE_ATTRIB_DATI_SPEC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_VALORE_ATTRIB_DATI_SPEC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_VALORE_ATTRIB_DATI_SPEC_ID_VALORE_ATTRIB_DATI_SPEC_GENERATOR") + public Long getIdValoreAttribDatiSpec() { + return this.idValoreAttribDatiSpec; + } + + public void setIdValoreAttribDatiSpec(Long idValoreAttribDatiSpec) { + this.idValoreAttribDatiSpec = idValoreAttribDatiSpec; + } + + @Column(name = "DL_VALORE") + public String getDlValore() { + return this.dlValore; + } + + public void setDlValore(String dlValore) { + this.dlValore = dlValore; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + // bi-directional many-to-one association to AroUsoXsdDatiSpec + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USO_XSD_DATI_SPEC") + public AroUsoXsdDatiSpec getAroUsoXsdDatiSpec() { + return this.aroUsoXsdDatiSpec; + } + + public void setAroUsoXsdDatiSpec(AroUsoXsdDatiSpec aroUsoXsdDatiSpec) { + this.aroUsoXsdDatiSpec = aroUsoXsdDatiSpec; + } + + // bi-directional many-to-one association to DecAttribDatiSpec + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ATTRIB_DATI_SPEC") + public DecAttribDatiSpec getDecAttribDatiSpec() { + return this.decAttribDatiSpec; + } + + public void setDecAttribDatiSpec(DecAttribDatiSpec decAttribDatiSpec) { + this.decAttribDatiSpec = decAttribDatiSpec; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVerIndiceAipUd.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVerIndiceAipUd.java new file mode 100644 index 0000000..5501d6f --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVerIndiceAipUd.java @@ -0,0 +1,225 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_VER_INDICE_AIP_UD database table. + */ +@Entity +@Table(name = "ARO_VER_INDICE_AIP_UD") +public class AroVerIndiceAipUd implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idVerIndiceAip; + + private String cdEncodingHashAip; + + private String cdEncodingHashIndiceAip; + + private String cdVerIndiceAip; + + private String cdVerXsdIndiceAip; + + private String dsAlgoHashAip; + + private String dsAlgoHashIndiceAip; + + private String dsCausale; + + private String dsHashIndiceAip; + + private String dsHashAip; + + private String dsUrn; + + private Date dtCreazione; + + private BigDecimal pgVerIndiceAip; + + private BigDecimal idEnteConserv; + + private AroIndiceAipUd aroIndiceAipUd; + + public AroVerIndiceAipUd() {/* Hibernate */ + } + + @Id + @Column(name = "ID_VER_INDICE_AIP") + @GenericGenerator(name = "SARO_VER_INDICE_AIP_UD_ID_VER_INDICE_AIP_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_VER_INDICE_AIP_UD"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_VER_INDICE_AIP_UD_ID_VER_INDICE_AIP_GENERATOR") + public Long getIdVerIndiceAip() { + return this.idVerIndiceAip; + } + + public void setIdVerIndiceAip(Long idVerIndiceAip) { + this.idVerIndiceAip = idVerIndiceAip; + } + + @Column(name = "CD_ENCODING_HASH_AIP") + public String getCdEncodingHashAip() { + return this.cdEncodingHashAip; + } + + public void setCdEncodingHashAip(String cdEncodingHashAip) { + this.cdEncodingHashAip = cdEncodingHashAip; + } + + @Column(name = "CD_ENCODING_HASH_INDICE_AIP") + public String getCdEncodingHashIndiceAip() { + return this.cdEncodingHashIndiceAip; + } + + public void setCdEncodingHashIndiceAip(String cdEncodingHashIndiceAip) { + this.cdEncodingHashIndiceAip = cdEncodingHashIndiceAip; + } + + @Column(name = "CD_VER_INDICE_AIP") + public String getCdVerIndiceAip() { + return this.cdVerIndiceAip; + } + + public void setCdVerIndiceAip(String cdVerIndiceAip) { + this.cdVerIndiceAip = cdVerIndiceAip; + } + + @Column(name = "CD_VER_XSD_INDICE_AIP") + public String getCdVerXsdIndiceAip() { + return this.cdVerXsdIndiceAip; + } + + public void setCdVerXsdIndiceAip(String cdVerXsdIndiceAip) { + this.cdVerXsdIndiceAip = cdVerXsdIndiceAip; + } + + @Column(name = "DS_ALGO_HASH_AIP") + public String getDsAlgoHashAip() { + return this.dsAlgoHashAip; + } + + public void setDsAlgoHashAip(String dsAlgoHashAip) { + this.dsAlgoHashAip = dsAlgoHashAip; + } + + @Column(name = "DS_ALGO_HASH_INDICE_AIP") + public String getDsAlgoHashIndiceAip() { + return this.dsAlgoHashIndiceAip; + } + + public void setDsAlgoHashIndiceAip(String dsAlgoHashIndiceAip) { + this.dsAlgoHashIndiceAip = dsAlgoHashIndiceAip; + } + + @Column(name = "DS_CAUSALE") + public String getDsCausale() { + return this.dsCausale; + } + + public void setDsCausale(String dsCausale) { + this.dsCausale = dsCausale; + } + + @Column(name = "DS_HASH_INDICE_AIP") + public String getDsHashIndiceAip() { + return this.dsHashIndiceAip; + } + + public void setDsHashIndiceAip(String dsHashIndiceAip) { + this.dsHashIndiceAip = dsHashIndiceAip; + } + + @Column(name = "DS_HASH_AIP") + public String getDsHashAip() { + return this.dsHashAip; + } + + public void setDsHashAip(String dsHashAip) { + this.dsHashAip = dsHashAip; + } + + @Column(name = "DS_URN") + public String getDsUrn() { + return this.dsUrn; + } + + public void setDsUrn(String dsUrn) { + this.dsUrn = dsUrn; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_CREAZIONE") + public Date getDtCreazione() { + return this.dtCreazione; + } + + public void setDtCreazione(Date dtCreazione) { + this.dtCreazione = dtCreazione; + } + + @Column(name = "PG_VER_INDICE_AIP") + public BigDecimal getPgVerIndiceAip() { + return this.pgVerIndiceAip; + } + + public void setPgVerIndiceAip(BigDecimal pgVerIndiceAip) { + this.pgVerIndiceAip = pgVerIndiceAip; + } + + @Column(name = "ID_ENTE_CONSERV") + public BigDecimal getIdEnteConserv() { + return this.idEnteConserv; + } + + public void setIdEnteConserv(BigDecimal idEnteConserv) { + this.idEnteConserv = idEnteConserv; + } + + // bi-directional many-to-one association to AroIndiceAipUd + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_INDICE_AIP") + public AroIndiceAipUd getAroIndiceAipUd() { + return this.aroIndiceAipUd; + } + + public void setAroIndiceAipUd(AroIndiceAipUd aroIndiceAipUd) { + this.aroIndiceAipUd = aroIndiceAipUd; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVerifFirmaDtVer.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVerifFirmaDtVer.java new file mode 100644 index 0000000..2552a3f --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVerifFirmaDtVer.java @@ -0,0 +1,98 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_VERIF_FIRMA_DT_VERS database table. + */ +@Entity +@Table(name = "ARO_VERIF_FIRMA_DT_VERS") +public class AroVerifFirmaDtVer implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idVerifFirmaDtVers; + + private String dsMsgEsitoVerifFirma; + + private String tiEsitoVerifFirma; + + private AroFirmaComp aroFirmaComp; + + public AroVerifFirmaDtVer() {/* Hibernate */ + } + + @Id + @Column(name = "ID_VERIF_FIRMA_DT_VERS") + @GenericGenerator(name = "SARO_VERIF_FIRMA_DT_VERS_ID_VERIF_FIRMA_DT_VERS_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_VERIF_FIRMA_DT_VERS"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_VERIF_FIRMA_DT_VERS_ID_VERIF_FIRMA_DT_VERS_GENERATOR") + public Long getIdVerifFirmaDtVers() { + return this.idVerifFirmaDtVers; + } + + public void setIdVerifFirmaDtVers(Long idVerifFirmaDtVers) { + this.idVerifFirmaDtVers = idVerifFirmaDtVers; + } + + @Column(name = "DS_MSG_ESITO_VERIF_FIRMA") + public String getDsMsgEsitoVerifFirma() { + return this.dsMsgEsitoVerifFirma; + } + + public void setDsMsgEsitoVerifFirma(String dsMsgEsitoVerifFirma) { + this.dsMsgEsitoVerifFirma = dsMsgEsitoVerifFirma; + } + + @Column(name = "TI_ESITO_VERIF_FIRMA") + public String getTiEsitoVerifFirma() { + return this.tiEsitoVerifFirma; + } + + public void setTiEsitoVerifFirma(String tiEsitoVerifFirma) { + this.tiEsitoVerifFirma = tiEsitoVerifFirma; + } + + // bi-directional many-to-one association to AroFirmaComp + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FIRMA_COMP") + public AroFirmaComp getAroFirmaComp() { + return this.aroFirmaComp; + } + + public void setAroFirmaComp(AroFirmaComp aroFirmaComp) { + this.aroFirmaComp = aroFirmaComp; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniArchivSec.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniArchivSec.java new file mode 100644 index 0000000..b9951e8 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniArchivSec.java @@ -0,0 +1,133 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_VERS_INI_ARCHIV_SEC database table. + */ +@Entity +@Table(name = "ARO_VERS_INI_ARCHIV_SEC") +public class AroVersIniArchivSec implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idVersIniArchivSec; + + private String cdFascic; + + private String cdSottofascic; + + private String dsClassif; + + private String dsOggettoFascic; + + private String dsOggettoSottofascic; + + private AroVersIniUnitaDoc aroVersIniUnitaDoc; + + public AroVersIniArchivSec() {/* Hibernate */ + } + + @Id + @Column(name = "ID_VERS_INI_ARCHIV_SEC") + @GenericGenerator(name = "SARO_VERS_INI_ARCHIV_SEC_ID_VERS_INI_ARCHIV_SEC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_VERS_INI_ARCHIV_SEC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_VERS_INI_ARCHIV_SEC_ID_VERS_INI_ARCHIV_SEC_GENERATOR") + public Long getIdVersIniArchivSec() { + return this.idVersIniArchivSec; + } + + public void setIdVersIniArchivSec(Long idVersIniArchivSec) { + this.idVersIniArchivSec = idVersIniArchivSec; + } + + @Column(name = "CD_FASCIC") + public String getCdFascic() { + return this.cdFascic; + } + + public void setCdFascic(String cdFascic) { + this.cdFascic = cdFascic; + } + + @Column(name = "CD_SOTTOFASCIC") + public String getCdSottofascic() { + return this.cdSottofascic; + } + + public void setCdSottofascic(String cdSottofascic) { + this.cdSottofascic = cdSottofascic; + } + + @Column(name = "DS_CLASSIF") + public String getDsClassif() { + return this.dsClassif; + } + + public void setDsClassif(String dsClassif) { + this.dsClassif = dsClassif; + } + + @Column(name = "DS_OGGETTO_FASCIC") + public String getDsOggettoFascic() { + return this.dsOggettoFascic; + } + + public void setDsOggettoFascic(String dsOggettoFascic) { + this.dsOggettoFascic = dsOggettoFascic; + } + + @Column(name = "DS_OGGETTO_SOTTOFASCIC") + public String getDsOggettoSottofascic() { + return this.dsOggettoSottofascic; + } + + public void setDsOggettoSottofascic(String dsOggettoSottofascic) { + this.dsOggettoSottofascic = dsOggettoSottofascic; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_VERS_INI_UNITA_DOC") + public AroVersIniUnitaDoc getAroVersIniUnitaDoc() { + return this.aroVersIniUnitaDoc; + } + + public void setAroVersIniUnitaDoc(AroVersIniUnitaDoc aroVersIniUnitaDoc) { + this.aroVersIniUnitaDoc = aroVersIniUnitaDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniComp.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniComp.java new file mode 100644 index 0000000..228606f --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniComp.java @@ -0,0 +1,139 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_VERS_INI_COMP database table. + */ +@Entity +@Table(name = "ARO_VERS_INI_COMP") +public class AroVersIniComp implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idVersIniComp; + + private String dlUrnCompVers; + + private String dsIdCompVers; + + private String dsNomeCompVers; + + private AroCompDoc aroCompDoc; + + private AroVersIniDoc aroVersIniDoc; + + private List aroVersIniDatiSpecs = new ArrayList<>(); + + public AroVersIniComp() {/* Hibernate */ + } + + @Id + @Column(name = "ID_VERS_INI_COMP") + @GenericGenerator(name = "SARO_VERS_INI_COMP_ID_VERS_INI_COMP_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_VERS_INI_COMP"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_VERS_INI_COMP_ID_VERS_INI_COMP_GENERATOR") + public Long getIdVersIniComp() { + return this.idVersIniComp; + } + + public void setIdVersIniComp(Long idVersIniComp) { + this.idVersIniComp = idVersIniComp; + } + + @Column(name = "DL_URN_COMP_VERS") + public String getDlUrnCompVers() { + return this.dlUrnCompVers; + } + + public void setDlUrnCompVers(String dlUrnCompVers) { + this.dlUrnCompVers = dlUrnCompVers; + } + + @Column(name = "DS_ID_COMP_VERS") + public String getDsIdCompVers() { + return this.dsIdCompVers; + } + + public void setDsIdCompVers(String dsIdCompVers) { + this.dsIdCompVers = dsIdCompVers; + } + + @Column(name = "DS_NOME_COMP_VERS") + public String getDsNomeCompVers() { + return this.dsNomeCompVers; + } + + public void setDsNomeCompVers(String dsNomeCompVers) { + this.dsNomeCompVers = dsNomeCompVers; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_COMP_DOC") + public AroCompDoc getAroCompDoc() { + return this.aroCompDoc; + } + + public void setAroCompDoc(AroCompDoc aroCompDoc) { + this.aroCompDoc = aroCompDoc; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_VERS_INI_DOC") + public AroVersIniDoc getAroVersIniDoc() { + return this.aroVersIniDoc; + } + + public void setAroVersIniDoc(AroVersIniDoc aroVersIniDoc) { + this.aroVersIniDoc = aroVersIniDoc; + } + + // bi-directional many-to-one association to AroVersIniComp + @OneToMany(mappedBy = "aroVersIniComp", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getAroVersIniDatiSpecs() { + return this.aroVersIniDatiSpecs; + } + + public void setAroVersIniDatiSpecs(List aroVersIniDatiSpecs) { + this.aroVersIniDatiSpecs = aroVersIniDatiSpecs; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniDatiSpec.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniDatiSpec.java new file mode 100644 index 0000000..4b7a609 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniDatiSpec.java @@ -0,0 +1,192 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDate; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.AroVersIniDatiSpec.TiEntitaSacerAroVersIniDatiSpec; +import it.eng.parer.entity.constraint.AroVersIniDatiSpec.TiUsoXsdAroVersIniDatiSpec; + +/** + * The persistent class for the ARO_VERS_INI_DATI_SPEC database table. + */ +@Entity +@Table(name = "ARO_VERS_INI_DATI_SPEC") +public class AroVersIniDatiSpec implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idVersIniDatiSpec; + + private String blXmlDatiSpec; + + private LocalDate dtReg; + + private BigDecimal idStrut; + + private AroVersIniComp aroVersIniComp; + + private AroVersIniDoc aroVersIniDoc; + + private AroVersIniUnitaDoc aroVersIniUnitaDoc; + + private DecXsdDatiSpec decXsdDatiSpec; + + private TiEntitaSacerAroVersIniDatiSpec tiEntitaSacer; + + private TiUsoXsdAroVersIniDatiSpec tiUsoXsd; + + private Integer aaDtReg; + + public AroVersIniDatiSpec() {/* Hibernate */ + } + + @Id + @Column(name = "ID_VERS_INI_DATI_SPEC") + @GenericGenerator(name = "SARO_VERS_INI_DATI_SPEC_ID_VERS_INI_DATI_SPEC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_VERS_INI_DATI_SPEC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_VERS_INI_DATI_SPEC_ID_VERS_INI_DATI_SPEC_GENERATOR") + public Long getIdVersIniDatiSpec() { + return this.idVersIniDatiSpec; + } + + public void setIdVersIniDatiSpec(Long idVersIniDatiSpec) { + this.idVersIniDatiSpec = idVersIniDatiSpec; + } + + @Lob + @Column(name = "BL_XML_DATI_SPEC") + public String getBlXmlDatiSpec() { + return this.blXmlDatiSpec; + } + + public void setBlXmlDatiSpec(String blXmlDatiSpec) { + this.blXmlDatiSpec = blXmlDatiSpec; + } + + @Column(name = "DT_REG") + public LocalDate getDtReg() { + return this.dtReg; + } + + public void setDtReg(LocalDate dtReg) { + this.dtReg = dtReg; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_VERS_INI_COMP") + public AroVersIniComp getAroVersIniComp() { + return this.aroVersIniComp; + } + + public void setAroVersIniComp(AroVersIniComp aroVersIniComp) { + this.aroVersIniComp = aroVersIniComp; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_VERS_INI_DOC") + public AroVersIniDoc getAroVersIniDoc() { + return this.aroVersIniDoc; + } + + public void setAroVersIniDoc(AroVersIniDoc aroVersIniDoc) { + this.aroVersIniDoc = aroVersIniDoc; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_VERS_INI_UNITA_DOC") + public AroVersIniUnitaDoc getAroVersIniUnitaDoc() { + return this.aroVersIniUnitaDoc; + } + + public void setAroVersIniUnitaDoc(AroVersIniUnitaDoc aroVersIniUnitaDoc) { + this.aroVersIniUnitaDoc = aroVersIniUnitaDoc; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_XSD_DATI_SPEC") + public DecXsdDatiSpec getDecXsdDatiSpec() { + return this.decXsdDatiSpec; + } + + public void setDecXsdDatiSpec(DecXsdDatiSpec decXsdDatiSpec) { + this.decXsdDatiSpec = decXsdDatiSpec; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_ENTITA_SACER") + public TiEntitaSacerAroVersIniDatiSpec getTiEntitaSacer() { + return this.tiEntitaSacer; + } + + public void setTiEntitaSacer(TiEntitaSacerAroVersIniDatiSpec tiEntitaSacer) { + this.tiEntitaSacer = tiEntitaSacer; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_USO_XSD") + public TiUsoXsdAroVersIniDatiSpec getTiUsoXsd() { + return this.tiUsoXsd; + } + + public void setTiUsoXsd(TiUsoXsdAroVersIniDatiSpec tiUsoXsd) { + this.tiUsoXsd = tiUsoXsd; + } + + @Column(name = "AA_DT_REG") + public Integer getAaDtReg() { + return aaDtReg; + } + + public void setAaDtReg(Integer aaDtReg) { + this.aaDtReg = aaDtReg; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniDatiSpecObjectStorage.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniDatiSpecObjectStorage.java new file mode 100644 index 0000000..5d72192 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniDatiSpecObjectStorage.java @@ -0,0 +1,153 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import it.eng.parer.entity.constraint.AroVersIniDatiSpec.TiEntitaSacerAroVersIniDatiSpec; + +@Entity +@Table(name = "ARO_VERS_INI_DATI_SPEC_OBJECT_STORAGE") +public class AroVersIniDatiSpecObjectStorage implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idVersIniDatiSpecObjectStorage; + private AroVersIniUnitaDoc aroVersIniUnitaDoc; + private AroVersIniDoc aroVersIniDoc; + private AroVersIniComp aroVersIniComp; + private TiEntitaSacerAroVersIniDatiSpec tiEntitaSacer; + private DecBackend decBackend; + private String nmTenant; + private String nmBucket; + private String cdKeyFile; + private BigDecimal idStrut; + + public AroVersIniDatiSpecObjectStorage() { + // hibernate constructor + } + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "ID_VERS_INI_DATI_SPEC_OBJECT_STORAGE") + public Long getIdVersIniDatiSpecObjectStorage() { + return idVersIniDatiSpecObjectStorage; + } + + public void setIdVersIniDatiSpecObjectStorage(Long idVersIniDatiSpecObjectStorage) { + this.idVersIniDatiSpecObjectStorage = idVersIniDatiSpecObjectStorage; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_VERS_INI_UNITA_DOC") + public AroVersIniUnitaDoc getAroVersIniUnitaDoc() { + return aroVersIniUnitaDoc; + } + + public void setAroVersIniUnitaDoc(AroVersIniUnitaDoc aroVersIniUnitaDoc) { + this.aroVersIniUnitaDoc = aroVersIniUnitaDoc; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_VERS_INI_DOC") + public AroVersIniDoc getAroVersIniDoc() { + return aroVersIniDoc; + } + + public void setAroVersIniDoc(AroVersIniDoc aroVersIniDoc) { + this.aroVersIniDoc = aroVersIniDoc; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_VERS_INI_COMP") + public AroVersIniComp getAroVersIniComp() { + return aroVersIniComp; + } + + public void setAroVersIniComp(AroVersIniComp aroVersIniComp) { + this.aroVersIniComp = aroVersIniComp; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_ENTITA_SACER") + public TiEntitaSacerAroVersIniDatiSpec getTiEntitaSacer() { + return this.tiEntitaSacer; + } + + public void setTiEntitaSacer(TiEntitaSacerAroVersIniDatiSpec tiEntitaSacer) { + this.tiEntitaSacer = tiEntitaSacer; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DEC_BACKEND") + public DecBackend getDecBackend() { + return decBackend; + } + + public void setDecBackend(DecBackend decBackend) { + this.decBackend = decBackend; + } + + @Column(name = "NM_TENANT") + public String getNmTenant() { + return nmTenant; + } + + public void setNmTenant(String nmTenant) { + this.nmTenant = nmTenant; + } + + @Column(name = "NM_BUCKET") + public String getNmBucket() { + return nmBucket; + } + + public void setNmBucket(String nmBucket) { + this.nmBucket = nmBucket; + } + + @Column(name = "CD_KEY_FILE") + public String getCdKeyFile() { + return cdKeyFile; + } + + public void setCdKeyFile(String cdKeyFile) { + this.cdKeyFile = cdKeyFile; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniDoc.java new file mode 100644 index 0000000..69ab1c3 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniDoc.java @@ -0,0 +1,140 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_VERS_INI_DOC database table. + */ +@Entity +@Table(name = "ARO_VERS_INI_DOC") +public class AroVersIniDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idVersIniDoc; + + private String dlDoc; + + private String dsAutoreDoc; + + private AroDoc aroDoc; + + private AroVersIniUnitaDoc aroVersIniUnitaDoc; + + private List aroVersIniComps = new ArrayList<>(); + + private List aroVersIniDatiSpecs = new ArrayList<>(); + + public AroVersIniDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_VERS_INI_DOC") + @GenericGenerator(name = "SARO_VERS_INI_DOC_ID_VERS_INI_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_VERS_INI_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_VERS_INI_DOC_ID_VERS_INI_DOC_GENERATOR") + public Long getIdVersIniDoc() { + return this.idVersIniDoc; + } + + public void setIdVersIniDoc(Long idVersIniDoc) { + this.idVersIniDoc = idVersIniDoc; + } + + @Column(name = "DL_DOC") + public String getDlDoc() { + return this.dlDoc; + } + + public void setDlDoc(String dlDoc) { + this.dlDoc = dlDoc; + } + + @Column(name = "DS_AUTORE_DOC") + public String getDsAutoreDoc() { + return this.dsAutoreDoc; + } + + public void setDsAutoreDoc(String dsAutoreDoc) { + this.dsAutoreDoc = dsAutoreDoc; + } + + // bi-directional many-to-one association to AroDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DOC") + public AroDoc getAroDoc() { + return this.aroDoc; + } + + public void setAroDoc(AroDoc aroDoc) { + this.aroDoc = aroDoc; + } + + // bi-directional many-to-one association to AroVersIniUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_VERS_INI_UNITA_DOC") + public AroVersIniUnitaDoc getAroVersIniUnitaDoc() { + return this.aroVersIniUnitaDoc; + } + + public void setAroVersIniUnitaDoc(AroVersIniUnitaDoc aroVersIniUnitaDoc) { + this.aroVersIniUnitaDoc = aroVersIniUnitaDoc; + } + + // bi-directional many-to-one association to AroVersIniComp + @OneToMany(mappedBy = "aroVersIniDoc") + public List getAroVersIniComps() { + return this.aroVersIniComps; + } + + public void setAroVersIniComps(List aroVersIniComps) { + this.aroVersIniComps = aroVersIniComps; + } + + // bi-directional many-to-one association to AroVersIniComp + @OneToMany(mappedBy = "aroVersIniDoc", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getAroVersIniDatiSpecs() { + return this.aroVersIniDatiSpecs; + } + + public void setAroVersIniDatiSpecs(List aroVersIniDatiSpecs) { + this.aroVersIniDatiSpecs = aroVersIniDatiSpecs; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniLinkUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniLinkUnitaDoc.java new file mode 100644 index 0000000..a36747d --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniLinkUnitaDoc.java @@ -0,0 +1,135 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_VERS_INI_LINK_UNITA_DOC database table. + */ +@Entity +@Table(name = "ARO_VERS_INI_LINK_UNITA_DOC") +public class AroVersIniLinkUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idVersIniLinkUnitaDoc; + + private BigDecimal aaKeyUnitaDocLink; + + private String cdKeyUnitaDocLink; + + private String cdRegistroKeyUnitaDocLink; + + private String dsLinkUnitaDoc; + + private AroUnitaDoc aroVersUnitaDocLink; + + private AroVersIniUnitaDoc aroVersIniUnitaDoc; + + public AroVersIniLinkUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_VERS_INI_LINK_UNITA_DOC") + @GenericGenerator(name = "SARO_VERS_INI_LINK_UNITA_DOC_ID_VERS_INI_LINK_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_VERS_INI_LINK_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_VERS_INI_LINK_UNITA_DOC_ID_VERS_INI_LINK_UNITA_DOC_GENERATOR") + public Long getIdVersIniLinkUnitaDoc() { + return this.idVersIniLinkUnitaDoc; + } + + public void setIdVersIniLinkUnitaDoc(Long idVersIniLinkUnitaDoc) { + this.idVersIniLinkUnitaDoc = idVersIniLinkUnitaDoc; + } + + @Column(name = "AA_KEY_UNITA_DOC_LINK") + public BigDecimal getAaKeyUnitaDocLink() { + return this.aaKeyUnitaDocLink; + } + + public void setAaKeyUnitaDocLink(BigDecimal aaKeyUnitaDocLink) { + this.aaKeyUnitaDocLink = aaKeyUnitaDocLink; + } + + @Column(name = "CD_KEY_UNITA_DOC_LINK") + public String getCdKeyUnitaDocLink() { + return this.cdKeyUnitaDocLink; + } + + public void setCdKeyUnitaDocLink(String cdKeyUnitaDocLink) { + this.cdKeyUnitaDocLink = cdKeyUnitaDocLink; + } + + @Column(name = "CD_REGISTRO_KEY_UNITA_DOC_LINK") + public String getCdRegistroKeyUnitaDocLink() { + return this.cdRegistroKeyUnitaDocLink; + } + + public void setCdRegistroKeyUnitaDocLink(String cdRegistroKeyUnitaDocLink) { + this.cdRegistroKeyUnitaDocLink = cdRegistroKeyUnitaDocLink; + } + + @Column(name = "DS_LINK_UNITA_DOC") + public String getDsLinkUnitaDoc() { + return this.dsLinkUnitaDoc; + } + + public void setDsLinkUnitaDoc(String dsLinkUnitaDoc) { + this.dsLinkUnitaDoc = dsLinkUnitaDoc; + } + + // bi-directional many-to-one association to AroVersIniUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC_LINK") + public AroUnitaDoc getAroVersUnitaDocLink() { + return this.aroVersUnitaDocLink; + } + + public void setAroVersUnitaDocLink(AroUnitaDoc aroVersUnitaDocLink) { + this.aroVersUnitaDocLink = aroVersUnitaDocLink; + } + + // bi-directional many-to-one association to AroVersIniUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_VERS_INI_UNITA_DOC") + public AroVersIniUnitaDoc getAroVersIniUnitaDoc() { + return this.aroVersIniUnitaDoc; + } + + public void setAroVersIniUnitaDoc(AroVersIniUnitaDoc aroVersIniUnitaDoc) { + this.aroVersIniUnitaDoc = aroVersIniUnitaDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniUnitaDoc.java new file mode 100644 index 0000000..e98d59e --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroVersIniUnitaDoc.java @@ -0,0 +1,211 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_VERS_INI_UNITA_DOC database table. + */ +@Entity +@Table(name = "ARO_VERS_INI_UNITA_DOC") +public class AroVersIniUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idVersIniUnitaDoc; + + private String cdFascicPrinc; + + private String cdSottofascicPrinc; + + private String dlOggettoUnitaDoc; + + private String dsClassifPrinc; + + private String dsOggettoFascicPrinc; + + private String dsOggettoSottofascicPrinc; + + private Date dtRegUnitaDoc; + + private AroUnitaDoc aroUnitaDoc; + + private List aroVersIniArchivSecs = new ArrayList<>(); + + private List aroVersIniLinkUnitaDocs = new ArrayList<>(); + + private List aroVersIniDocs = new ArrayList<>(); + + private List aroVersIniDatiSpecs = new ArrayList<>(); + + public AroVersIniUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_VERS_INI_UNITA_DOC") + @GenericGenerator(name = "SARO_VERS_INI_UNITA_DOC_ID_VERS_INI_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_VERS_INI_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_VERS_INI_UNITA_DOC_ID_VERS_INI_UNITA_DOC_GENERATOR") + public Long getIdVersIniUnitaDoc() { + return this.idVersIniUnitaDoc; + } + + public void setIdVersIniUnitaDoc(Long idVersIniUnitaDoc) { + this.idVersIniUnitaDoc = idVersIniUnitaDoc; + } + + @Column(name = "CD_FASCIC_PRINC") + public String getCdFascicPrinc() { + return this.cdFascicPrinc; + } + + public void setCdFascicPrinc(String cdFascicPrinc) { + this.cdFascicPrinc = cdFascicPrinc; + } + + @Column(name = "CD_SOTTOFASCIC_PRINC") + public String getCdSottofascicPrinc() { + return this.cdSottofascicPrinc; + } + + public void setCdSottofascicPrinc(String cdSottofascicPrinc) { + this.cdSottofascicPrinc = cdSottofascicPrinc; + } + + @Column(name = "DL_OGGETTO_UNITA_DOC") + public String getDlOggettoUnitaDoc() { + return this.dlOggettoUnitaDoc; + } + + public void setDlOggettoUnitaDoc(String dlOggettoUnitaDoc) { + this.dlOggettoUnitaDoc = dlOggettoUnitaDoc; + } + + @Column(name = "DS_CLASSIF_PRINC") + public String getDsClassifPrinc() { + return this.dsClassifPrinc; + } + + public void setDsClassifPrinc(String dsClassifPrinc) { + this.dsClassifPrinc = dsClassifPrinc; + } + + @Column(name = "DS_OGGETTO_FASCIC_PRINC") + public String getDsOggettoFascicPrinc() { + return this.dsOggettoFascicPrinc; + } + + public void setDsOggettoFascicPrinc(String dsOggettoFascicPrinc) { + this.dsOggettoFascicPrinc = dsOggettoFascicPrinc; + } + + @Column(name = "DS_OGGETTO_SOTTOFASCIC_PRINC") + public String getDsOggettoSottofascicPrinc() { + return this.dsOggettoSottofascicPrinc; + } + + public void setDsOggettoSottofascicPrinc(String dsOggettoSottofascicPrinc) { + this.dsOggettoSottofascicPrinc = dsOggettoSottofascicPrinc; + } + + @Temporal(TemporalType.DATE) + @Column(name = "DT_REG_UNITA_DOC") + public Date getDtRegUnitaDoc() { + return this.dtRegUnitaDoc; + } + + public void setDtRegUnitaDoc(Date dtRegUnitaDoc) { + this.dtRegUnitaDoc = dtRegUnitaDoc; + } + + // bi-directional one-to-one association to AroUnitaDoc + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC") + public AroUnitaDoc getAroUnitaDoc() { + return this.aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } + + // bi-directional many-to-one association to AroVersIniArchivSec + @OneToMany(mappedBy = "aroVersIniUnitaDoc", cascade = { CascadeType.PERSIST, CascadeType.MERGE, + CascadeType.REFRESH }) + public List getAroVersIniArchivSecs() { + return this.aroVersIniArchivSecs; + } + + public void setAroVersIniArchivSecs(List aroVersIniArchivSecs) { + this.aroVersIniArchivSecs = aroVersIniArchivSecs; + } + + // bi-directional many-to-one association to AroVersIniLinkUnitaDoc + @OneToMany(mappedBy = "aroVersIniUnitaDoc") + public List getAroVersIniLinkUnitaDocs() { + return this.aroVersIniLinkUnitaDocs; + } + + public void setAroVersIniLinkUnitaDocs(List aroVersIniLinkUnitaDocs) { + this.aroVersIniLinkUnitaDocs = aroVersIniLinkUnitaDocs; + } + + // bi-directional many-to-one association to AroVersIniDoc + @OneToMany(mappedBy = "aroVersIniUnitaDoc") + public List getAroVersIniDocs() { + return this.aroVersIniDocs; + } + + public void setAroVersIniDocs(List aroVersIniDocs) { + this.aroVersIniDocs = aroVersIniDocs; + } + + // bi-directional many-to-one association to AroVersIniDoc + @OneToMany(mappedBy = "aroVersIniUnitaDoc") + public List getAroVersIniDatiSpecs() { + return this.aroVersIniDatiSpecs; + } + + public void setAroVersIniDatiSpecs(List aroVersIniDatiSpecs) { + this.aroVersIniDatiSpecs = aroVersIniDatiSpecs; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroWarnUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroWarnUnitaDoc.java new file mode 100644 index 0000000..4dc644e --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroWarnUnitaDoc.java @@ -0,0 +1,134 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_WARN_UNITA_DOC database table. + */ +@Entity +@Table(name = "ARO_WARN_UNITA_DOC") +public class AroWarnUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idWarnUnitaDoc; + + private String cdWarn; + + private String dsWarn; + + private BigDecimal pgWarnUnitaDoc; + + private String tiEntitaSacer; + + private AroDoc aroDoc; + + private AroUnitaDoc aroUnitaDoc; + + public AroWarnUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_WARN_UNITA_DOC") + @GenericGenerator(name = "SARO_WARN_UNITA_DOC_ID_WARN_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_WARN_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_WARN_UNITA_DOC_ID_WARN_UNITA_DOC_GENERATOR") + public Long getIdWarnUnitaDoc() { + return this.idWarnUnitaDoc; + } + + public void setIdWarnUnitaDoc(Long idWarnUnitaDoc) { + this.idWarnUnitaDoc = idWarnUnitaDoc; + } + + @Column(name = "CD_WARN") + public String getCdWarn() { + return this.cdWarn; + } + + public void setCdWarn(String cdWarn) { + this.cdWarn = cdWarn; + } + + @Column(name = "DS_WARN") + public String getDsWarn() { + return this.dsWarn; + } + + public void setDsWarn(String dsWarn) { + this.dsWarn = dsWarn; + } + + @Column(name = "PG_WARN_UNITA_DOC") + public BigDecimal getPgWarnUnitaDoc() { + return this.pgWarnUnitaDoc; + } + + public void setPgWarnUnitaDoc(BigDecimal pgWarnUnitaDoc) { + this.pgWarnUnitaDoc = pgWarnUnitaDoc; + } + + @Column(name = "TI_ENTITA_SACER") + public String getTiEntitaSacer() { + return this.tiEntitaSacer; + } + + public void setTiEntitaSacer(String tiEntitaSacer) { + this.tiEntitaSacer = tiEntitaSacer; + } + + // bi-directional many-to-one association to AroDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DOC") + public AroDoc getAroDoc() { + return this.aroDoc; + } + + public void setAroDoc(AroDoc aroDoc) { + this.aroDoc = aroDoc; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC") + public AroUnitaDoc getAroUnitaDoc() { + return this.aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroWarnUpdUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroWarnUpdUnitaDoc.java new file mode 100644 index 0000000..d7b7631 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroWarnUpdUnitaDoc.java @@ -0,0 +1,127 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ARO_WARN_UPD_UNITA_DOC database table. + */ +@Entity +@Table(name = "ARO_WARN_UPD_UNITA_DOC") +public class AroWarnUpdUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idWarnUpdUnitaDoc; + + private String dsErr; + + private DecControlloWs decControlloWs; + + private DecErrSacer decErrSacer; + + private AroUpdUnitaDoc aroUpdUnitaDoc; + + private BigDecimal pgWarn; + + public AroWarnUpdUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_WARN_UPD_UNITA_DOC") + @GenericGenerator(name = "SARO_WARN_UPD_UNITA_DOC_ID_WARN_UPD_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_WARN_UPD_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_WARN_UPD_UNITA_DOC_ID_WARN_UPD_UNITA_DOC_GENERATOR") + public Long getIdWarnUpdUnitaDoc() { + return this.idWarnUpdUnitaDoc; + } + + public void setIdWarnUpdUnitaDoc(Long idWarnUpdUnitaDoc) { + this.idWarnUpdUnitaDoc = idWarnUpdUnitaDoc; + } + + @Column(name = "DS_ERR") + public String getDsErr() { + return this.dsErr; + } + + public void setDsErr(String dsErr) { + this.dsErr = dsErr; + } + + // bi-directional many-to-one association to DecControlloWs + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CONTROLLO_WS") + public DecControlloWs getDecControlloWs() { + return this.decControlloWs; + } + + public void setDecControlloWs(DecControlloWs decControlloWs) { + this.decControlloWs = decControlloWs; + } + + // bi-directional many-to-one association to DecErrSacer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ERR_SACER") + public DecErrSacer getDecErrSacer() { + return this.decErrSacer; + } + + public void setDecErrSacer(DecErrSacer decErrSacer) { + this.decErrSacer = decErrSacer; + } + + // bi-directional one-to-one association to AroUpdUnitaDoc + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_UNITA_DOC") + public AroUpdUnitaDoc getAroUpdUnitaDoc() { + return this.aroUpdUnitaDoc; + } + + public void setAroUpdUnitaDoc(AroUpdUnitaDoc aroUpdUnitaDoc) { + this.aroUpdUnitaDoc = aroUpdUnitaDoc; + } + + @Column(name = "PG_WARN") + public BigDecimal getPgWarn() { + return this.pgWarn; + } + + public void setPgWarn(BigDecimal pgWarn) { + this.pgWarn = pgWarn; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlDocObjectStorage.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlDocObjectStorage.java new file mode 100644 index 0000000..9b4c7b9 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlDocObjectStorage.java @@ -0,0 +1,63 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.MapsId; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +import it.eng.parer.entity.inheritance.oop.AroXmlObjectStorage; + +@Entity +@Table(name = "ARO_XML_DOC_OBJECT_STORAGE") +public class AroXmlDocObjectStorage extends AroXmlObjectStorage { + + private static final long serialVersionUID = 1L; + + public AroXmlDocObjectStorage() { + super(); + } + + private Long idDoc; + private AroDoc aroDoc; + + @Id + @Column(name = "ID_DOC") + public Long getIdDoc() { + return idDoc; + } + + public void setIdDoc(Long idDoc) { + this.idDoc = idDoc; + } + + @MapsId + @OneToOne(mappedBy = "aroXmlDocObjectStorage") + @JoinColumn(name = "ID_DOC") + public AroDoc getAroDoc() { + return aroDoc; + } + + public void setAroDoc(AroDoc aroDoc) { + this.aroDoc = aroDoc; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlUnitaDocObjectStorage.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlUnitaDocObjectStorage.java new file mode 100644 index 0000000..a2d3709 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlUnitaDocObjectStorage.java @@ -0,0 +1,63 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.MapsId; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +import it.eng.parer.entity.inheritance.oop.AroXmlObjectStorage; + +@Entity +@Table(name = "ARO_XML_UNITA_DOC_OBJECT_STORAGE") +public class AroXmlUnitaDocObjectStorage extends AroXmlObjectStorage { + + private static final long serialVersionUID = 1L; + + public AroXmlUnitaDocObjectStorage() { + super(); + } + + private Long idUnitaDoc; + private AroUnitaDoc aroUnitaDoc; + + @Id + @Column(name = "ID_UNITA_DOC") + public Long getIdUnitaDoc() { + return idUnitaDoc; + } + + public void setIdUnitaDoc(Long idUnitaDoc) { + this.idUnitaDoc = idUnitaDoc; + } + + @MapsId + @OneToOne(mappedBy = "aroXmlUnitaDocObjectStorage") + @JoinColumn(name = "ID_UNITA_DOC") + public AroUnitaDoc getAroUnitaDoc() { + return aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlUpdUdObjectStorage.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlUpdUdObjectStorage.java new file mode 100644 index 0000000..82a74a1 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlUpdUdObjectStorage.java @@ -0,0 +1,116 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.MapsId; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "ARO_XML_UPD_UD_OBJECT_STORAGE") +public class AroXmlUpdUdObjectStorage implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUpdUnitaDoc; + private AroUpdUnitaDoc aroUpdUnitaDoc; + private DecBackend decBackend; + private String nmTenant; + private String nmBucket; + private String cdKeyFile; + private BigDecimal idStrut; + + public AroXmlUpdUdObjectStorage() { + // hibernate constructor + } + + @Id + @Column(name = "ID_UPD_UNITA_DOC") + public Long getIdUpdUnitaDoc() { + return idUpdUnitaDoc; + } + + public void setIdUpdUnitaDoc(Long idUpdUnitaDoc) { + this.idUpdUnitaDoc = idUpdUnitaDoc; + } + + @MapsId + @OneToOne(mappedBy = "aroXmlUpdUdObjectStorage") + @JoinColumn(name = "ID_UPD_UNITA_DOC") + public AroUpdUnitaDoc getAroUpdUnitaDoc() { + return aroUpdUnitaDoc; + } + + public void setAroUpdUnitaDoc(AroUpdUnitaDoc aroUpdUnitaDoc) { + this.aroUpdUnitaDoc = aroUpdUnitaDoc; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DEC_BACKEND") + public DecBackend getDecBackend() { + return decBackend; + } + + public void setDecBackend(DecBackend decBackend) { + this.decBackend = decBackend; + } + + @Column(name = "NM_TENANT") + public String getNmTenant() { + return nmTenant; + } + + public void setNmTenant(String nmTenant) { + this.nmTenant = nmTenant; + } + + @Column(name = "NM_BUCKET") + public String getNmBucket() { + return nmBucket; + } + + public void setNmBucket(String nmBucket) { + this.nmBucket = nmBucket; + } + + @Column(name = "CD_KEY_FILE") + public String getCdKeyFile() { + return cdKeyFile; + } + + public void setCdKeyFile(String cdKeyFile) { + this.cdKeyFile = cdKeyFile; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlUpdUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlUpdUnitaDoc.java new file mode 100644 index 0000000..00c35ed --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/AroXmlUpdUnitaDoc.java @@ -0,0 +1,208 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.time.LocalDate; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.AroXmlUpdUnitaDoc.TiXmlUpdUnitaDoc; + +/** + * The persistent class for the ARO_XML_UPD_UNITA_DOC database table. + */ +@Entity +@Table(name = "ARO_XML_UPD_UNITA_DOC") +public class AroXmlUpdUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idXmlUpdUnitaDoc; + + private String blXml; + + private String cdEncodingHashXml; + + private String cdVersioneXml; + + private String dsAlgoHashXml; + + private String dsHashXml; + + private String dsUrnXml; + + private String dsUrnNormalizXml; + + private LocalDate dtIniSes; + + private OrgStrut orgStrut; + + private AroUpdUnitaDoc aroUpdUnitaDoc; + + private TiXmlUpdUnitaDoc tiXmlUpdUnitaDoc; + + private Integer aaIniSes; + + public AroXmlUpdUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_XML_UPD_UNITA_DOC") + @GenericGenerator(name = "SARO_XML_UPD_UNITA_DOC_ID_XML_UPD_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_XML_UPD_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SARO_XML_UPD_UNITA_DOC_ID_XML_UPD_UNITA_DOC_GENERATOR") + public Long getIdXmlUpdUnitaDoc() { + return this.idXmlUpdUnitaDoc; + } + + public void setIdXmlUpdUnitaDoc(Long idXmlUpdUnitaDoc) { + this.idXmlUpdUnitaDoc = idXmlUpdUnitaDoc; + } + + @Lob + @Column(name = "BL_XML") + public String getBlXml() { + return this.blXml; + } + + public void setBlXml(String blXml) { + this.blXml = blXml; + } + + @Column(name = "CD_ENCODING_HASH_XML") + public String getCdEncodingHashXml() { + return this.cdEncodingHashXml; + } + + public void setCdEncodingHashXml(String cdEncodingHashXml) { + this.cdEncodingHashXml = cdEncodingHashXml; + } + + @Column(name = "CD_VERSIONE_XML") + public String getCdVersioneXml() { + return this.cdVersioneXml; + } + + public void setCdVersioneXml(String cdVersioneXml) { + this.cdVersioneXml = cdVersioneXml; + } + + @Column(name = "DS_ALGO_HASH_XML") + public String getDsAlgoHashXml() { + return this.dsAlgoHashXml; + } + + public void setDsAlgoHashXml(String dsAlgoHashXml) { + this.dsAlgoHashXml = dsAlgoHashXml; + } + + @Column(name = "DS_HASH_XML") + public String getDsHashXml() { + return this.dsHashXml; + } + + public void setDsHashXml(String dsHashXml) { + this.dsHashXml = dsHashXml; + } + + @Column(name = "DS_URN_XML") + public String getDsUrnXml() { + return this.dsUrnXml; + } + + public void setDsUrnXml(String dsUrnXml) { + this.dsUrnXml = dsUrnXml; + } + + @Column(name = "DS_URN_NORMALIZ_XML") + public String getDsUrnNormalizXml() { + return this.dsUrnNormalizXml; + } + + public void setDsUrnNormalizXml(String dsUrnNormalizXml) { + this.dsUrnNormalizXml = dsUrnNormalizXml; + } + + @Column(name = "DT_INI_SES") + public LocalDate getDtIniSes() { + return this.dtIniSes; + } + + public void setDtIniSes(LocalDate dtIniSes) { + this.dtIniSes = dtIniSes; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to AroUpdUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_UNITA_DOC") + public AroUpdUnitaDoc getAroUpdUnitaDoc() { + return this.aroUpdUnitaDoc; + } + + public void setAroUpdUnitaDoc(AroUpdUnitaDoc aroUpdUnitaDoc) { + this.aroUpdUnitaDoc = aroUpdUnitaDoc; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_XML_UPD_UNITA_DOC") + public TiXmlUpdUnitaDoc getTiXmlUpdUnitaDoc() { + return this.tiXmlUpdUnitaDoc; + } + + public void setTiXmlUpdUnitaDoc(TiXmlUpdUnitaDoc tiXmlUpdUnitaDoc) { + this.tiXmlUpdUnitaDoc = tiXmlUpdUnitaDoc; + } + + @Column(name = "AA_INI_SES") + public Integer getAaIniSes() { + return aaIniSes; + } + + public void setAaIniSes(Integer aaIniSes) { + this.aaIniSes = aaIniSes; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecAaRegistroUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecAaRegistroUnitaDoc.java new file mode 100644 index 0000000..85ebb32 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecAaRegistroUnitaDoc.java @@ -0,0 +1,166 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlTransient; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_AA_REGISTRO_UNITA_DOC database table. + */ +@Entity +@Table(name = "DEC_AA_REGISTRO_UNITA_DOC") +public class DecAaRegistroUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idAaRegistroUnitaDoc; + + private BigDecimal aaMaxRegistroUnitaDoc; + + private BigDecimal aaMinRegistroUnitaDoc; + + private String cdFormatoNumero; + + private String dsFormatoNumero; + + private String flUpdFmtNumero; + + private DecRegistroUnitaDoc decRegistroUnitaDoc; + + private List decWarnAaRegistroUds = new ArrayList<>(); + + private List decParteNumeroRegistros = new ArrayList<>(); + + public DecAaRegistroUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_AA_REGISTRO_UNITA_DOC") + @XmlID + @GenericGenerator(name = "SDEC_AA_REGISTRO_UNITA_DOC_ID_AA_REGISTRO_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_AA_REGISTRO_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_AA_REGISTRO_UNITA_DOC_ID_AA_REGISTRO_UNITA_DOC_GENERATOR") + public Long getIdAaRegistroUnitaDoc() { + return this.idAaRegistroUnitaDoc; + } + + public void setIdAaRegistroUnitaDoc(Long idAaRegistroUnitaDoc) { + this.idAaRegistroUnitaDoc = idAaRegistroUnitaDoc; + } + + @Column(name = "AA_MAX_REGISTRO_UNITA_DOC") + public BigDecimal getAaMaxRegistroUnitaDoc() { + return this.aaMaxRegistroUnitaDoc; + } + + public void setAaMaxRegistroUnitaDoc(BigDecimal aaMaxRegistroUnitaDoc) { + this.aaMaxRegistroUnitaDoc = aaMaxRegistroUnitaDoc; + } + + @Column(name = "AA_MIN_REGISTRO_UNITA_DOC") + public BigDecimal getAaMinRegistroUnitaDoc() { + return this.aaMinRegistroUnitaDoc; + } + + public void setAaMinRegistroUnitaDoc(BigDecimal aaMinRegistroUnitaDoc) { + this.aaMinRegistroUnitaDoc = aaMinRegistroUnitaDoc; + } + + @Column(name = "CD_FORMATO_NUMERO") + public String getCdFormatoNumero() { + return this.cdFormatoNumero; + } + + public void setCdFormatoNumero(String cdFormatoNumero) { + this.cdFormatoNumero = cdFormatoNumero; + } + + @Column(name = "DS_FORMATO_NUMERO") + public String getDsFormatoNumero() { + return this.dsFormatoNumero; + } + + public void setDsFormatoNumero(String dsFormatoNumero) { + this.dsFormatoNumero = dsFormatoNumero; + } + + @Column(name = "FL_UPD_FMT_NUMERO", columnDefinition = "char(1)") + public String getFlUpdFmtNumero() { + return this.flUpdFmtNumero; + } + + public void setFlUpdFmtNumero(String flUpdFmtNumero) { + this.flUpdFmtNumero = flUpdFmtNumero; + } + + // bi-directional many-to-one association to DecRegistroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_REGISTRO_UNITA_DOC") + @XmlInverseReference(mappedBy = "decAaRegistroUnitaDocs") + public DecRegistroUnitaDoc getDecRegistroUnitaDoc() { + return this.decRegistroUnitaDoc; + } + + public void setDecRegistroUnitaDoc(DecRegistroUnitaDoc decRegistroUnitaDoc) { + this.decRegistroUnitaDoc = decRegistroUnitaDoc; + } + + // bi-directional many-to-one association to DecWarnAaRegistroUd + @OneToMany(mappedBy = "decAaRegistroUnitaDoc", cascade = CascadeType.REMOVE) + @XmlTransient + public List getDecWarnAaRegistroUds() { + return this.decWarnAaRegistroUds; + } + + public void setDecWarnAaRegistroUds(List decWarnAaRegistroUds) { + this.decWarnAaRegistroUds = decWarnAaRegistroUds; + } + + // bi-directional many-to-one association to DecParteNumeroRegistro + @OneToMany(mappedBy = "decAaRegistroUnitaDoc", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + public List getDecParteNumeroRegistros() { + return this.decParteNumeroRegistros; + } + + public void setDecParteNumeroRegistros(List decParteNumeroRegistros) { + this.decParteNumeroRegistros = decParteNumeroRegistros; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecAaTipoFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecAaTipoFascicolo.java new file mode 100644 index 0000000..bd9d1cb --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecAaTipoFascicolo.java @@ -0,0 +1,165 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlTransient; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_AA_TIPO_FASCICOLO database table. + */ +@Entity +@Table(name = "DEC_AA_TIPO_FASCICOLO") +public class DecAaTipoFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idAaTipoFascicolo; + + private BigDecimal aaFinTipoFascicolo; + + private BigDecimal aaIniTipoFascicolo; + + private String flUpdFmtNumero; + + private BigDecimal niCharPadParteClassif; + + private DecTipoFascicolo decTipoFascicolo; + + private List decParteNumeroFascicolos = new ArrayList<>(); + + private List decUsoModelloXsdFascs = new ArrayList<>(); + + private List decWarnAaTipoFascicolos = new ArrayList<>(); + + public DecAaTipoFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_AA_TIPO_FASCICOLO") + @GenericGenerator(name = "SDEC_AA_TIPO_FASCICOLO_ID_AA_TIPO_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_AA_TIPO_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_AA_TIPO_FASCICOLO_ID_AA_TIPO_FASCICOLO_GENERATOR") + public Long getIdAaTipoFascicolo() { + return this.idAaTipoFascicolo; + } + + public void setIdAaTipoFascicolo(Long idAaTipoFascicolo) { + this.idAaTipoFascicolo = idAaTipoFascicolo; + } + + @Column(name = "AA_FIN_TIPO_FASCICOLO") + public BigDecimal getAaFinTipoFascicolo() { + return this.aaFinTipoFascicolo; + } + + public void setAaFinTipoFascicolo(BigDecimal aaFinTipoFascicolo) { + this.aaFinTipoFascicolo = aaFinTipoFascicolo; + } + + @Column(name = "AA_INI_TIPO_FASCICOLO") + public BigDecimal getAaIniTipoFascicolo() { + return this.aaIniTipoFascicolo; + } + + public void setAaIniTipoFascicolo(BigDecimal aaIniTipoFascicolo) { + this.aaIniTipoFascicolo = aaIniTipoFascicolo; + } + + @Column(name = "FL_UPD_FMT_NUMERO", columnDefinition = "char(1)") + public String getFlUpdFmtNumero() { + return this.flUpdFmtNumero; + } + + public void setFlUpdFmtNumero(String flUpdFmtNumero) { + this.flUpdFmtNumero = flUpdFmtNumero; + } + + @Column(name = "NI_CHAR_PAD_PARTE_CLASSIF") + public BigDecimal getNiCharPadParteClassif() { + return this.niCharPadParteClassif; + } + + public void setNiCharPadParteClassif(BigDecimal niCharPadParteClassif) { + this.niCharPadParteClassif = niCharPadParteClassif; + } + + // bi-directional many-to-one association to DecTipoFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_FASCICOLO") + @XmlTransient + public DecTipoFascicolo getDecTipoFascicolo() { + return this.decTipoFascicolo; + } + + public void setDecTipoFascicolo(DecTipoFascicolo decTipoFascicolo) { + this.decTipoFascicolo = decTipoFascicolo; + } + + // bi-directional many-to-one association to DecParteNumeroFascicolo + @OneToMany(mappedBy = "decAaTipoFascicolo", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + public List getDecParteNumeroFascicolos() { + return this.decParteNumeroFascicolos; + } + + public void setDecParteNumeroFascicolos(List decParteNumeroFascicolos) { + this.decParteNumeroFascicolos = decParteNumeroFascicolos; + } + + // bi-directional one-to-many association to DecUsoModelloXsdFasc + @OneToMany(mappedBy = "decAaTipoFascicolo", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + @XmlTransient + public List getDecUsoModelloXsdFascs() { + return this.decUsoModelloXsdFascs; + } + + public void setDecUsoModelloXsdFascs(List decUsoModelloXsdFascs) { + this.decUsoModelloXsdFascs = decUsoModelloXsdFascs; + } + + // bi-directional many-to-one association to DecWarnAaTipoFascicolo + @OneToMany(mappedBy = "decAaTipoFascicolo", cascade = CascadeType.REMOVE) + @XmlTransient + public List getDecWarnAaTipoFascicolos() { + return this.decWarnAaTipoFascicolos; + } + + public void setDecWarnAaTipoFascicolos(List decWarnAaTipoFascicolos) { + this.decWarnAaTipoFascicolos = decWarnAaTipoFascicolos; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecAttribDatiSpec.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecAttribDatiSpec.java new file mode 100644 index 0000000..ef602cb --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecAttribDatiSpec.java @@ -0,0 +1,233 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlTransient; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_ATTRIB_DATI_SPEC database table. + */ +@Entity +@Table(name = "DEC_ATTRIB_DATI_SPEC") +public class DecAttribDatiSpec implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idAttribDatiSpec; + + private String dsAttribDatiSpec; + + private String nmAttribDatiSpec; + + private String nmSistemaMigraz; + + private String tiEntitaSacer; + + private String tiUsoAttrib; + + private String tiAttribDatiSpec; + + private List aroValoreAttribDatiSpecs = new ArrayList<>(); + + private DecTipoCompDoc decTipoCompDoc; + + private DecTipoDoc decTipoDoc; + + private DecTipoUnitaDoc decTipoUnitaDoc; + + private OrgStrut orgStrut; + + private List decXsdAttribDatiSpecs = new ArrayList<>(); + + private List orgCampoValSubStruts = new ArrayList<>(); + + public DecAttribDatiSpec() {/* Hibernate */ + } + + @Id + @Column(name = "ID_ATTRIB_DATI_SPEC") + @XmlID + @GenericGenerator(name = "SDEC_ATTRIB_DATI_SPEC_ID_ATTRIB_DATI_SPEC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_ATTRIB_DATI_SPEC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_ATTRIB_DATI_SPEC_ID_ATTRIB_DATI_SPEC_GENERATOR") + public Long getIdAttribDatiSpec() { + return this.idAttribDatiSpec; + } + + public void setIdAttribDatiSpec(Long idAttribDatiSpec) { + this.idAttribDatiSpec = idAttribDatiSpec; + } + + @Column(name = "DS_ATTRIB_DATI_SPEC") + public String getDsAttribDatiSpec() { + return this.dsAttribDatiSpec; + } + + public void setDsAttribDatiSpec(String dsAttribDatiSpec) { + this.dsAttribDatiSpec = dsAttribDatiSpec; + } + + @Column(name = "NM_ATTRIB_DATI_SPEC") + public String getNmAttribDatiSpec() { + return this.nmAttribDatiSpec; + } + + public void setNmAttribDatiSpec(String nmAttribDatiSpec) { + this.nmAttribDatiSpec = nmAttribDatiSpec; + } + + @Column(name = "NM_SISTEMA_MIGRAZ") + public String getNmSistemaMigraz() { + return this.nmSistemaMigraz; + } + + public void setNmSistemaMigraz(String nmSistemaMigraz) { + this.nmSistemaMigraz = nmSistemaMigraz; + } + + @Column(name = "TI_ENTITA_SACER") + public String getTiEntitaSacer() { + return this.tiEntitaSacer; + } + + public void setTiEntitaSacer(String tiEntitaSacer) { + this.tiEntitaSacer = tiEntitaSacer; + } + + @Column(name = "TI_USO_ATTRIB") + public String getTiUsoAttrib() { + return this.tiUsoAttrib; + } + + public void setTiUsoAttrib(String tiUsoAttrib) { + this.tiUsoAttrib = tiUsoAttrib; + } + + @Column(name = "TI_ATTRIB_DATI_SPEC") + public String getTiAttribDatiSpec() { + return tiAttribDatiSpec; + } + + public void setTiAttribDatiSpec(String tiAttribDatiSpec) { + this.tiAttribDatiSpec = tiAttribDatiSpec; + } + + // bi-directional many-to-one association to AroValoreAttribDatiSpec + @OneToMany(mappedBy = "decAttribDatiSpec") + @XmlTransient + public List getAroValoreAttribDatiSpecs() { + return this.aroValoreAttribDatiSpecs; + } + + public void setAroValoreAttribDatiSpecs(List aroValoreAttribDatiSpecs) { + this.aroValoreAttribDatiSpecs = aroValoreAttribDatiSpecs; + } + + // bi-directional many-to-one association to DecTipoCompDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_COMP_DOC") + @XmlInverseReference(mappedBy = "decAttribDatiSpecs") + public DecTipoCompDoc getDecTipoCompDoc() { + return this.decTipoCompDoc; + } + + public void setDecTipoCompDoc(DecTipoCompDoc decTipoCompDoc) { + this.decTipoCompDoc = decTipoCompDoc; + } + + // bi-directional many-to-one association to DecTipoDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_DOC") + @XmlInverseReference(mappedBy = "decAttribDatiSpecs") + public DecTipoDoc getDecTipoDoc() { + return this.decTipoDoc; + } + + public void setDecTipoDoc(DecTipoDoc decTipoDoc) { + this.decTipoDoc = decTipoDoc; + } + + // bi-directional many-to-one association to DecTipoUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_UNITA_DOC") + @XmlInverseReference(mappedBy = "decAttribDatiSpecs") + public DecTipoUnitaDoc getDecTipoUnitaDoc() { + return this.decTipoUnitaDoc; + } + + public void setDecTipoUnitaDoc(DecTipoUnitaDoc decTipoUnitaDoc) { + this.decTipoUnitaDoc = decTipoUnitaDoc; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + @XmlInverseReference(mappedBy = "decAttribDatiSpecs") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to DecXsdAttribDatiSpec + @OneToMany(mappedBy = "decAttribDatiSpec", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + public List getDecXsdAttribDatiSpecs() { + return this.decXsdAttribDatiSpecs; + } + + public void setDecXsdAttribDatiSpecs(List decXsdAttribDatiSpecs) { + this.decXsdAttribDatiSpecs = decXsdAttribDatiSpecs; + } + + // bi-directional many-to-one association to OrgCampoValSubStrut + @OneToMany(mappedBy = "decAttribDatiSpec", cascade = CascadeType.PERSIST) + @XmlIDREF + public List getOrgCampoValSubStruts() { + return this.orgCampoValSubStruts; + } + + public void setOrgCampoValSubStruts(List orgCampoValSubStruts) { + this.orgCampoValSubStruts = orgCampoValSubStruts; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecBackend.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecBackend.java new file mode 100644 index 0000000..e7bcfb2 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecBackend.java @@ -0,0 +1,134 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "DEC_BACKEND") +public class DecBackend implements Serializable { + + private static final long serialVersionUID = 37568565656845L; + + private Long idDecBackend; + private String nmBackend; + private String nmTipoBackend; + private String dlBackendUri; + private String dsDescrizioneBackend; + private List fileSesObjectStorageKos; + private List aroCompObjectStorages; + private List decConfigObjectStorages; + private List firReports; + + public DecBackend() { + super(); + } + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "ID_DEC_BACKEND") + public Long getIdDecBackend() { + return idDecBackend; + } + + public void setIdDecBackend(Long idDecBackend) { + this.idDecBackend = idDecBackend; + } + + @Column(name = "NM_BACKEND") + public String getNmBackend() { + return nmBackend; + } + + public void setNmBackend(String nmBackend) { + this.nmBackend = nmBackend; + } + + @Column(name = "NM_TIPO_BACKEND") + public String getNmTipoBackend() { + return nmTipoBackend; + } + + public void setNmTipoBackend(String nmTipoBackend) { + this.nmTipoBackend = nmTipoBackend; + } + + @Column(name = "DL_BACKEND_URI") + public String getDlBackendUri() { + return dlBackendUri; + } + + public void setDlBackendUri(String dlBackendUri) { + this.dlBackendUri = dlBackendUri; + } + + @Column(name = "DS_DESCRIZIONE_BACKEND") + public String getDsDescrizioneBackend() { + return dsDescrizioneBackend; + } + + public void setDsDescrizioneBackend(String dsDescrizioneBackend) { + this.dsDescrizioneBackend = dsDescrizioneBackend; + } + + @OneToMany(mappedBy = "decBackend") + public List getFileSesObjectStorages() { + return fileSesObjectStorageKos; + } + + public void setFileSesObjectStorages(List fileSesObjectStorageKos) { + this.fileSesObjectStorageKos = fileSesObjectStorageKos; + } + + @OneToMany(mappedBy = "decBackend") + public List getAroCompObjectStorages() { + return aroCompObjectStorages; + } + + public void setAroCompObjectStorages(List aroCompObjectStorages) { + this.aroCompObjectStorages = aroCompObjectStorages; + } + + @OneToMany(mappedBy = "decBackend") + public List getDecConfigObjectStorages() { + return decConfigObjectStorages; + } + + public void setDecConfigObjectStorages(List decConfigObjectStorages) { + this.decConfigObjectStorages = decConfigObjectStorages; + } + + @OneToMany(mappedBy = "decBackend") + public List getFirReports() { + return firReports; + } + + public void setFirReports(List firReports) { + this.firReports = firReports; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecConfigObjectStorage.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecConfigObjectStorage.java new file mode 100644 index 0000000..71c5f70 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecConfigObjectStorage.java @@ -0,0 +1,127 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "DEC_CONFIG_OBJECT_STORAGE") +public class DecConfigObjectStorage implements Serializable { + + private static final long serialVersionUID = 33456789043235L; + + private Long idDecConfigObjectStorage; + private DecBackend decBackend; + private String nmConfigObjectStorage; + private String dsValoreConfigObjectStorage; + private String tiUsoConfigObjectStorage; + private String dsDescrizioneConfigObjectStorage; + + public DecConfigObjectStorage() { + super(); + } + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "ID_DEC_CONFIG_OBJECT_STORAGE") + public Long getIdDecConfigObjectStorage() { + return idDecConfigObjectStorage; + } + + public void setIdDecConfigObjectStorage(Long idDecConfigObjectStorage) { + this.idDecConfigObjectStorage = idDecConfigObjectStorage; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DEC_BACKEND") + public DecBackend getDecBackend() { + return decBackend; + } + + public void setDecBackend(DecBackend decBackend) { + this.decBackend = decBackend; + } + + /** + * Attualmente questa colonna accetta solamente questi valori: + *

    + *
  • BUCKET
  • + *
  • ACCESS_KEY_ID_SYS_PROP
  • + *
  • SECRET_KEY_SYS_PROP
  • + *
+ * + * @return a cosa si riferiesce questa configurazione dell'OS + */ + @Column(name = "NM_CONFIG_OBJECT_STORAGE") + public String getNmConfigObjectStorage() { + return nmConfigObjectStorage; + } + + public void setNmConfigObjectStorage(String nmConfigObjectStorage) { + this.nmConfigObjectStorage = nmConfigObjectStorage; + } + + @Column(name = "DS_VALORE_CONFIG_OBJECT_STORAGE") + public String getDsValoreConfigObjectStorage() { + return dsValoreConfigObjectStorage; + } + + public void setDsValoreConfigObjectStorage(String dsValoreConfigObjectStorage) { + this.dsValoreConfigObjectStorage = dsValoreConfigObjectStorage; + } + + /** + * Attualmente questa colonna accetta solamente questi valori: + *
    + *
  • STAGING
  • + *
  • COMPONENTI
  • + *
  • SIP
  • + *
  • AIP
  • + *
+ * + * @return di fatto il nome del bucket + */ + @Column(name = "TI_USO_CONFIG_OBJECT_STORAGE") + public String getTiUsoConfigObjectStorage() { + return tiUsoConfigObjectStorage; + } + + public void setTiUsoConfigObjectStorage(String tiUsoConfigObjectStorage) { + this.tiUsoConfigObjectStorage = tiUsoConfigObjectStorage; + } + + @Column(name = "DS_DESCRIZIONE_CONFIG_OBJECT_STORAGE") + public String getDsDescrizioneConfigObjectStorage() { + return dsDescrizioneConfigObjectStorage; + } + + public void setDsDescrizioneConfigObjectStorage(String dsDescrizioneConfigObjectStorage) { + this.dsDescrizioneConfigObjectStorage = dsDescrizioneConfigObjectStorage; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecControlloWs.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecControlloWs.java new file mode 100644 index 0000000..04a1831 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecControlloWs.java @@ -0,0 +1,114 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.*; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_CONTROLLO_WS database table. + */ +@Entity +@Table(name = "DEC_CONTROLLO_WS") +@NamedQuery(name = "DecControlloWs.findByCdFamigliaControllo", query = "SELECT d FROM DecControlloWs d WHERE d.cdFamigliaControllo = :cdFamigliaControllo") +@NamedQuery(name = "DecControlloWs.findByCdControlloWs", query = "SELECT d FROM DecControlloWs d WHERE d.cdControlloWs = :cdControlloWs") +public class DecControlloWs implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idControlloWs; + + private String cdCategoriaControllo; + + private String cdControlloWs; + + private String cdFamigliaControllo; + + private String dsControlloWs; + + private BigDecimal niOrdControllo; + + public DecControlloWs() {/* Hibernate */ + } + + @Id + @Column(name = "ID_CONTROLLO_WS") + @GenericGenerator(name = "SDEC_CONTROLLO_WS_ID_CONTROLLO_WS_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_CONTROLLO_WS"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_CONTROLLO_WS_ID_CONTROLLO_WS_GENERATOR") + public Long getIdControlloWs() { + return this.idControlloWs; + } + + public void setIdControlloWs(Long idControlloWs) { + this.idControlloWs = idControlloWs; + } + + @Column(name = "CD_CATEGORIA_CONTROLLO") + public String getCdCategoriaControllo() { + return this.cdCategoriaControllo; + } + + public void setCdCategoriaControllo(String cdCategoriaControllo) { + this.cdCategoriaControllo = cdCategoriaControllo; + } + + @Column(name = "CD_CONTROLLO_WS") + public String getCdControlloWs() { + return this.cdControlloWs; + } + + public void setCdControlloWs(String cdControlloWs) { + this.cdControlloWs = cdControlloWs; + } + + @Column(name = "CD_FAMIGLIA_CONTROLLO") + public String getCdFamigliaControllo() { + return this.cdFamigliaControllo; + } + + public void setCdFamigliaControllo(String cdFamigliaControllo) { + this.cdFamigliaControllo = cdFamigliaControllo; + } + + @Column(name = "DS_CONTROLLO_WS") + public String getDsControlloWs() { + return this.dsControlloWs; + } + + public void setDsControlloWs(String dsControlloWs) { + this.dsControlloWs = dsControlloWs; + } + + @Column(name = "NI_ORD_CONTROLLO") + public BigDecimal getNiOrdControllo() { + return this.niOrdControllo; + } + + public void setNiOrdControllo(BigDecimal niOrdControllo) { + this.niOrdControllo = niOrdControllo; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecErrSacer.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecErrSacer.java new file mode 100644 index 0000000..f1e2f8b --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecErrSacer.java @@ -0,0 +1,110 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * @author fioravanti_f + */ +@Entity +@Table(name = "DEC_ERR_SACER") +public class DecErrSacer implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idErrSacer; + + private String cdErr; + + private String dsErr; + + private String dsErrFiltro; + + private String tiErrSacer; + + public DecErrSacer() {/* Hibernate */ + } + + @Id + @Column(name = "ID_ERR_SACER") + @GenericGenerator(name = "SDEC_ERR_SACER_ID_ERR_SACER_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_ERR_SACER"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_ERR_SACER_ID_ERR_SACER_GENERATOR") + public Long getIdErrSacer() { + return idErrSacer; + } + + public void setIdErrSacer(Long idErrSacer) { + this.idErrSacer = idErrSacer; + } + + @Column(name = "CD_ERR") + public String getCdErr() { + return cdErr; + } + + public void setCdErr(String cdErr) { + this.cdErr = cdErr; + } + + @Column(name = "DS_ERR") + public String getDsErr() { + return dsErr; + } + + public void setDsErr(String dsErr) { + this.dsErr = dsErr; + } + + @Column(name = "DS_ERR_FILTRO") + public String getDsErrFiltro() { + return dsErrFiltro; + } + + public void setDsErrFiltro(String dsErrFiltro) { + this.dsErrFiltro = dsErrFiltro; + } + + @Column(name = "TI_ERR_SACER") + public String getTiErrSacer() { + return tiErrSacer; + } + + public void setTiErrSacer(String tiErrSacer) { + this.tiErrSacer = tiErrSacer; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecEstensioneFile.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecEstensioneFile.java new file mode 100644 index 0000000..a219bc7 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecEstensioneFile.java @@ -0,0 +1,92 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Cacheable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_ESTENSIONE_FILE database table. + */ +@Entity +@Cacheable(true) +@Table(name = "DEC_ESTENSIONE_FILE") +public class DecEstensioneFile implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idEstensioneFile; + + private String cdEstensioneFile; + + private DecFormatoFileStandard decFormatoFileStandard; + + public DecEstensioneFile() {/* Hibernate */ + } + + @Id + @Column(name = "ID_ESTENSIONE_FILE") + @GenericGenerator(name = "SDEC_ESTENSIONE_FILE_ID_ESTENSIONE_FILE_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_ESTENSIONE_FILE"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_ESTENSIONE_FILE_ID_ESTENSIONE_FILE_GENERATOR") + public Long getIdEstensioneFile() { + return this.idEstensioneFile; + } + + public void setIdEstensioneFile(Long idEstensioneFile) { + this.idEstensioneFile = idEstensioneFile; + } + + @Column(name = "CD_ESTENSIONE_FILE") + public String getCdEstensioneFile() { + return this.cdEstensioneFile; + } + + public void setCdEstensioneFile(String cdEstensioneFile) { + this.cdEstensioneFile = cdEstensioneFile; + } + + // bi-directional many-to-one association to DecFormatoFileStandard + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FORMATO_FILE_STANDARD") + @XmlInverseReference(mappedBy = "decEstensioneFiles") + public DecFormatoFileStandard getDecFormatoFileStandard() { + return this.decFormatoFileStandard; + } + + public void setDecFormatoFileStandard(DecFormatoFileStandard decFormatoFileStandard) { + this.decFormatoFileStandard = decFormatoFileStandard; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileAmmesso.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileAmmesso.java new file mode 100644 index 0000000..34f7c1a --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileAmmesso.java @@ -0,0 +1,97 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Cacheable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlID; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_FORMATO_FILE_AMMESSO database table. + */ +@Entity +@Cacheable(true) +@Table(name = "DEC_FORMATO_FILE_AMMESSO") +public class DecFormatoFileAmmesso implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idFormatoFileAmmesso; + + private DecFormatoFileDoc decFormatoFileDoc; + + private DecTipoCompDoc decTipoCompDoc; + + public DecFormatoFileAmmesso() {/* Hibernate */ + } + + @Id + @Column(name = "ID_FORMATO_FILE_AMMESSO") + @XmlID + @GenericGenerator(name = "SDEC_FORMATO_FILE_AMMESSO_ID_FORMATO_FILE_AMMESSO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_FORMATO_FILE_AMMESSO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_FORMATO_FILE_AMMESSO_ID_FORMATO_FILE_AMMESSO_GENERATOR") + public Long getIdFormatoFileAmmesso() { + return this.idFormatoFileAmmesso; + } + + public void setIdFormatoFileAmmesso(Long idFormatoFileAmmesso) { + this.idFormatoFileAmmesso = idFormatoFileAmmesso; + } + + // bi-directional many-to-one association to DecFormatoFileDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FORMATO_FILE_DOC") + @XmlInverseReference(mappedBy = "decFormatoFileAmmessos") + public DecFormatoFileDoc getDecFormatoFileDoc() { + return this.decFormatoFileDoc; + } + + public void setDecFormatoFileDoc(DecFormatoFileDoc decFormatoFileDoc) { + this.decFormatoFileDoc = decFormatoFileDoc; + } + + // bi-directional many-to-one association to DecTipoCompDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_COMP_DOC") + @XmlInverseReference(mappedBy = "decFormatoFileAmmessos") + public DecTipoCompDoc getDecTipoCompDoc() { + return this.decTipoCompDoc; + } + + public void setDecTipoCompDoc(DecTipoCompDoc decTipoCompDoc) { + this.decTipoCompDoc = decTipoCompDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileBusta.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileBusta.java new file mode 100644 index 0000000..f423cc3 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileBusta.java @@ -0,0 +1,92 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Cacheable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_FORMATO_FILE_BUSTA database table. + */ +@Entity +@Cacheable(true) +@Table(name = "DEC_FORMATO_FILE_BUSTA") +public class DecFormatoFileBusta implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idFormatoFileBusta; + + private String tiFormatoFirmaMarca; + + private DecFormatoFileStandard decFormatoFileStandard; + + public DecFormatoFileBusta() {/* Hibernate */ + } + + @Id + @Column(name = "ID_FORMATO_FILE_BUSTA") + @GenericGenerator(name = "SDEC_FORMATO_FILE_BUSTA_ID_FORMATO_FILE_BUSTA_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_FORMATO_FILE_BUSTA"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_FORMATO_FILE_BUSTA_ID_FORMATO_FILE_BUSTA_GENERATOR") + public Long getIdFormatoFileBusta() { + return this.idFormatoFileBusta; + } + + public void setIdFormatoFileBusta(Long idFormatoFileBusta) { + this.idFormatoFileBusta = idFormatoFileBusta; + } + + @Column(name = "TI_FORMATO_FIRMA_MARCA") + public String getTiFormatoFirmaMarca() { + return this.tiFormatoFirmaMarca; + } + + public void setTiFormatoFirmaMarca(String tiFormatoFirmaMarca) { + this.tiFormatoFirmaMarca = tiFormatoFirmaMarca; + } + + // bi-directional many-to-one association to DecFormatoFileStandard + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FORMATO_FILE_STANDARD") + @XmlInverseReference(mappedBy = "decFormatoFileBustas") + public DecFormatoFileStandard getDecFormatoFileStandard() { + return this.decFormatoFileStandard; + } + + public void setDecFormatoFileStandard(DecFormatoFileStandard decFormatoFileStandard) { + this.decFormatoFileStandard = decFormatoFileStandard; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileDoc.java new file mode 100644 index 0000000..19cd3c7 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileDoc.java @@ -0,0 +1,211 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Cacheable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlTransient; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_FORMATO_FILE_DOC database table. + */ +@Entity +@Cacheable(true) +@Table(name = "DEC_FORMATO_FILE_DOC") +public class DecFormatoFileDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idFormatoFileDoc; + + private String cdVersione; + + private String dsFormatoFileDoc; + + private Date dtIstituz; + + private Date dtSoppres; + + private String nmFormatoFileDoc; + + private List aroCompDocs = new ArrayList<>(); + + private List decFormatoFileAmmessos = new ArrayList<>(); + + private OrgStrut orgStrut; + + private List decUsoFormatoFileStandards = new ArrayList<>(); + + private List decTipoRapprCompConts = new ArrayList<>(); + + private List decTipoRapprCompConvs = new ArrayList<>(); + + public DecFormatoFileDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_FORMATO_FILE_DOC") + @GenericGenerator(name = "SDEC_FORMATO_FILE_DOC_ID_FORMATO_FILE_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_FORMATO_FILE_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_FORMATO_FILE_DOC_ID_FORMATO_FILE_DOC_GENERATOR") + public Long getIdFormatoFileDoc() { + return this.idFormatoFileDoc; + } + + public void setIdFormatoFileDoc(Long idFormatoFileDoc) { + this.idFormatoFileDoc = idFormatoFileDoc; + } + + @Column(name = "CD_VERSIONE") + public String getCdVersione() { + return this.cdVersione; + } + + public void setCdVersione(String cdVersione) { + this.cdVersione = cdVersione; + } + + @Column(name = "DS_FORMATO_FILE_DOC") + public String getDsFormatoFileDoc() { + return this.dsFormatoFileDoc; + } + + public void setDsFormatoFileDoc(String dsFormatoFileDoc) { + this.dsFormatoFileDoc = dsFormatoFileDoc; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + @Column(name = "NM_FORMATO_FILE_DOC") + public String getNmFormatoFileDoc() { + return this.nmFormatoFileDoc; + } + + public void setNmFormatoFileDoc(String nmFormatoFileDoc) { + this.nmFormatoFileDoc = nmFormatoFileDoc; + } + + // bi-directional many-to-one association to AroCompDoc + @OneToMany(mappedBy = "decFormatoFileDoc") + @XmlTransient + public List getAroCompDocs() { + return this.aroCompDocs; + } + + public void setAroCompDocs(List aroCompDocs) { + this.aroCompDocs = aroCompDocs; + } + + // bi-directional many-to-one association to DecFormatoFileAmmesso + @OneToMany(mappedBy = "decFormatoFileDoc", cascade = CascadeType.PERSIST) + @XmlIDREF + public List getDecFormatoFileAmmessos() { + return this.decFormatoFileAmmessos; + } + + public void setDecFormatoFileAmmessos(List decFormatoFileAmmessos) { + this.decFormatoFileAmmessos = decFormatoFileAmmessos; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + @XmlInverseReference(mappedBy = "decFormatoFileDocs") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to DecUsoFormatoFileStandard + @OneToMany(mappedBy = "decFormatoFileDoc", cascade = CascadeType.PERSIST) + public List getDecUsoFormatoFileStandards() { + return this.decUsoFormatoFileStandards; + } + + public void setDecUsoFormatoFileStandards(List decUsoFormatoFileStandards) { + this.decUsoFormatoFileStandards = decUsoFormatoFileStandards; + } + + // bi-directional many-to-one association to DecTipoRapprComp + @OneToMany(mappedBy = "decFormatoFileDocCont", cascade = CascadeType.PERSIST) + @XmlIDREF + public List getDecTipoRapprCompConts() { + return this.decTipoRapprCompConts; + } + + public void setDecTipoRapprCompConts(List decTipoRapprCompConts) { + this.decTipoRapprCompConts = decTipoRapprCompConts; + } + + // bi-directional many-to-one association to DecTipoRapprComp + @OneToMany(mappedBy = "decFormatoFileDocConv", cascade = CascadeType.PERSIST) + @XmlIDREF + public List getDecTipoRapprCompConvs() { + return this.decTipoRapprCompConvs; + } + + public void setDecTipoRapprCompConvs(List decTipoRapprCompConvs) { + this.decTipoRapprCompConvs = decTipoRapprCompConvs; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileStandard.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileStandard.java new file mode 100644 index 0000000..144c9cb --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecFormatoFileStandard.java @@ -0,0 +1,223 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.Cacheable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlTransient; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_FORMATO_FILE_STANDARD database table. + */ +@Entity +@Cacheable(true) +@Table(name = "DEC_FORMATO_FILE_STANDARD") +public class DecFormatoFileStandard implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idFormatoFileStandard; + + private String cdVersione; + + private String dsCopyright; + + private String dsFormatoFileStandard; + + private String flFormatoConcat; + + private String nmFormatoFileStandard; + + private String nmMimetypeFile; + + private String tiEsitoContrFormato; + + private List aroCompDocs = new ArrayList<>(); + + private List decEstensioneFiles = new ArrayList<>(); + + private List decFormatoFileBustas = new ArrayList<>(); + + private List decUsoFormatoFileStandards = new ArrayList<>(); + + private List aroBustaCrittogs = new ArrayList<>(); + + private List decTipoRapprComps = new ArrayList<>(); + + public DecFormatoFileStandard() {/* Hibernate */ + } + + @Id + @Column(name = "ID_FORMATO_FILE_STANDARD") + @GenericGenerator(name = "SDEC_FORMATO_FILE_STANDARD_ID_FORMATO_FILE_STANDARD_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_FORMATO_FILE_STANDARD"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_FORMATO_FILE_STANDARD_ID_FORMATO_FILE_STANDARD_GENERATOR") + public Long getIdFormatoFileStandard() { + return this.idFormatoFileStandard; + } + + public void setIdFormatoFileStandard(Long idFormatoFileStandard) { + this.idFormatoFileStandard = idFormatoFileStandard; + } + + @Column(name = "CD_VERSIONE") + public String getCdVersione() { + return this.cdVersione; + } + + public void setCdVersione(String cdVersione) { + this.cdVersione = cdVersione; + } + + @Column(name = "DS_COPYRIGHT") + public String getDsCopyright() { + return this.dsCopyright; + } + + public void setDsCopyright(String dsCopyright) { + this.dsCopyright = dsCopyright; + } + + @Column(name = "DS_FORMATO_FILE_STANDARD") + public String getDsFormatoFileStandard() { + return this.dsFormatoFileStandard; + } + + public void setDsFormatoFileStandard(String dsFormatoFileStandard) { + this.dsFormatoFileStandard = dsFormatoFileStandard; + } + + @Column(name = "FL_FORMATO_CONCAT", columnDefinition = "char(1)") + public String getFlFormatoConcat() { + return this.flFormatoConcat; + } + + public void setFlFormatoConcat(String flFormatoConcat) { + this.flFormatoConcat = flFormatoConcat; + } + + @Column(name = "NM_FORMATO_FILE_STANDARD") + public String getNmFormatoFileStandard() { + return this.nmFormatoFileStandard; + } + + public void setNmFormatoFileStandard(String nmFormatoFileStandard) { + this.nmFormatoFileStandard = nmFormatoFileStandard; + } + + @Column(name = "NM_MIMETYPE_FILE") + public String getNmMimetypeFile() { + return this.nmMimetypeFile; + } + + public void setNmMimetypeFile(String nmMimetypeFile) { + this.nmMimetypeFile = nmMimetypeFile; + } + + @Column(name = "TI_ESITO_CONTR_FORMATO") + public String getTiEsitoContrFormato() { + return this.tiEsitoContrFormato; + } + + public void setTiEsitoContrFormato(String tiEsitoContrFormato) { + this.tiEsitoContrFormato = tiEsitoContrFormato; + } + + // bi-directional many-to-one association to AroCompDoc + @OneToMany(mappedBy = "decFormatoFileStandard") + @XmlTransient + public List getAroCompDocs() { + return this.aroCompDocs; + } + + public void setAroCompDocs(List aroCompDocs) { + this.aroCompDocs = aroCompDocs; + } + + // bi-directional many-to-one association to DecEstensioneFile + @OneToMany(mappedBy = "decFormatoFileStandard") + public List getDecEstensioneFiles() { + return this.decEstensioneFiles; + } + + public void setDecEstensioneFiles(List decEstensioneFiles) { + this.decEstensioneFiles = decEstensioneFiles; + } + + // bi-directional many-to-one association to DecFormatoFileBusta + @OneToMany(mappedBy = "decFormatoFileStandard") + public List getDecFormatoFileBustas() { + return this.decFormatoFileBustas; + } + + public void setDecFormatoFileBustas(List decFormatoFileBustas) { + this.decFormatoFileBustas = decFormatoFileBustas; + } + + // bi-directional many-to-one association to DecUsoFormatoFileStandard + @OneToMany(mappedBy = "decFormatoFileStandard", cascade = { CascadeType.ALL }) + @XmlInverseReference(mappedBy = "decFormatoFileStandard") + public List getDecUsoFormatoFileStandards() { + return this.decUsoFormatoFileStandards; + } + + public void setDecUsoFormatoFileStandards(List decUsoFormatoFileStandards) { + this.decUsoFormatoFileStandards = decUsoFormatoFileStandards; + } + + // bi-directional many-to-one association to AroBustaCrittog + @OneToMany(mappedBy = "decFormatoFileStandard") + @XmlTransient + public List getAroBustaCrittogs() { + return this.aroBustaCrittogs; + } + + public void setAroBustaCrittogs(List aroBustaCrittogs) { + this.aroBustaCrittogs = aroBustaCrittogs; + } + + // bi-directional many-to-one association to DecTipoRapprComp + @OneToMany(mappedBy = "decFormatoFileStandard", cascade = CascadeType.PERSIST) + @XmlIDREF + public List getDecTipoRapprComps() { + return this.decTipoRapprComps; + } + + public void setDecTipoRapprComps(List decTipoRapprComps) { + this.decTipoRapprComps = decTipoRapprComps; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecLivelloTitol.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecLivelloTitol.java new file mode 100644 index 0000000..78c0e78 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecLivelloTitol.java @@ -0,0 +1,136 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_LIVELLO_TITOL database table. + */ +@Entity +@Table(name = "DEC_LIVELLO_TITOL") +public class DecLivelloTitol implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idLivelloTitol; + + private String cdSepLivello; + + private BigDecimal niLivello; + + private String nmLivelloTitol; + + private String tiFmtVoceTitol; + + private DecTitol decTitol; + private List decVoceTitols = new ArrayList<>(); + + public DecLivelloTitol() {/* Hibernate */ + } + + @Id + @Column(name = "ID_LIVELLO_TITOL") + @GenericGenerator(name = "SDEC_LIVELLO_TITOL_ID_LIVELLO_TITOL_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_LIVELLO_TITOL"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_LIVELLO_TITOL_ID_LIVELLO_TITOL_GENERATOR") + public Long getIdLivelloTitol() { + return this.idLivelloTitol; + } + + public void setIdLivelloTitol(Long idLivelloTitol) { + this.idLivelloTitol = idLivelloTitol; + } + + @Column(name = "CD_SEP_LIVELLO", columnDefinition = "char") + public String getCdSepLivello() { + return this.cdSepLivello; + } + + public void setCdSepLivello(String cdSepLivello) { + this.cdSepLivello = cdSepLivello; + } + + @Column(name = "NI_LIVELLO") + public BigDecimal getNiLivello() { + return this.niLivello; + } + + public void setNiLivello(BigDecimal niLivello) { + this.niLivello = niLivello; + } + + @Column(name = "NM_LIVELLO_TITOL") + public String getNmLivelloTitol() { + return this.nmLivelloTitol; + } + + public void setNmLivelloTitol(String nmLivelloTitol) { + this.nmLivelloTitol = nmLivelloTitol; + } + + @Column(name = "TI_FMT_VOCE_TITOL") + public String getTiFmtVoceTitol() { + return this.tiFmtVoceTitol; + } + + public void setTiFmtVoceTitol(String tiFmtVoceTitol) { + this.tiFmtVoceTitol = tiFmtVoceTitol; + } + + // bi-directional many-to-one association to DecTitol + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TITOL") + public DecTitol getDecTitol() { + return this.decTitol; + } + + public void setDecTitol(DecTitol decTitol) { + this.decTitol = decTitol; + } + + // bi-directional many-to-one association to DecVoceTitol + @OneToMany(mappedBy = "decLivelloTitol") + public List getDecVoceTitols() { + return this.decVoceTitols; + } + + public void setDecVoceTitols(List decVoceTitols) { + this.decVoceTitols = decVoceTitols; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecModelloXsdFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecModelloXsdFascicolo.java new file mode 100644 index 0000000..bcfb24b --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecModelloXsdFascicolo.java @@ -0,0 +1,212 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.persistence.*; +import it.eng.parer.entity.constraint.DecModelloXsdFascicolo.TiModelloXsd; +import it.eng.parer.entity.constraint.DecModelloXsdFascicolo.TiUsoModelloXsd; + +import java.util.ArrayList; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlTransient; +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.id.enhanced.SequenceStyleGenerator; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; + +/** + * The persistent class for the DEC_MODELLO_XSD_FASCICOLO database table. + */ +@Entity +@Table(name = "DEC_MODELLO_XSD_FASCICOLO") +public class DecModelloXsdFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idModelloXsdFascicolo; + + private String blXsd; + + private String cdXsd; + + private String dsXsd; + + private Date dtIstituz; + + private Date dtSoppres; + + private String flDefault; + private TiModelloXsd tiModelloXsd; + private TiUsoModelloXsd tiUsoModelloXsd; + private AplSistemaMigraz aplSistemaMigraz; + + private OrgAmbiente orgAmbiente; + + private List decUsoModelloXsdFascs = new ArrayList<>(); + + private List fasXmlFascicolos = new ArrayList<>(); + + public DecModelloXsdFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_MODELLO_XSD_FASCICOLO") + @XmlID + @GenericGenerator(name = "SDEC_MODELLO_XSD_FASCICOLO_ID_MODELLO_XSD_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_MODELLO_XSD_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_MODELLO_XSD_FASCICOLO_ID_MODELLO_XSD_FASCICOLO_GENERATOR") + public Long getIdModelloXsdFascicolo() { + return this.idModelloXsdFascicolo; + } + + public void setIdModelloXsdFascicolo(Long idModelloXsdFascicolo) { + this.idModelloXsdFascicolo = idModelloXsdFascicolo; + } + + @XmlTransient + @Lob + @Column(name = "BL_XSD") + public String getBlXsd() { + return this.blXsd; + } + + public void setBlXsd(String blXsd) { + this.blXsd = blXsd; + } + + @Column(name = "CD_XSD") + public String getCdXsd() { + return this.cdXsd; + } + + public void setCdXsd(String cdXsd) { + this.cdXsd = cdXsd; + } + + @XmlTransient + @Column(name = "DS_XSD") + public String getDsXsd() { + return this.dsXsd; + } + + public void setDsXsd(String dsXsd) { + this.dsXsd = dsXsd; + } + + @XmlTransient + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @XmlTransient + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + @XmlTransient + @Column(name = "FL_DEFAULT", columnDefinition = "char(1)") + public String getFlDefault() { + return this.flDefault; + } + + public void setFlDefault(String flDefault) { + this.flDefault = flDefault; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_MODELLO_XSD") + public TiModelloXsd getTiModelloXsd() { + return this.tiModelloXsd; + } + + public void setTiModelloXsd(TiModelloXsd tiModelloXsd) { + this.tiModelloXsd = tiModelloXsd; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_USO_MODELLO_XSD") + public TiUsoModelloXsd getTiUsoModelloXsd() { + return this.tiUsoModelloXsd; + } + + public void setTiUsoModelloXsd(TiUsoModelloXsd tiUsoModelloXsd) { + this.tiUsoModelloXsd = tiUsoModelloXsd; + } + + @XmlTransient + // bi-directional many-to-one association to AplSistemaMigraz + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SISTEMA_MIGRAZ") + public AplSistemaMigraz getAplSistemaMigraz() { + return this.aplSistemaMigraz; + } + + public void setAplSistemaMigraz(AplSistemaMigraz aplSistemaMigraz) { + this.aplSistemaMigraz = aplSistemaMigraz; + } + + @XmlTransient + // bi-directional many-to-one association to OrgAmbiente + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_AMBIENTE") + public OrgAmbiente getOrgAmbiente() { + return this.orgAmbiente; + } + + public void setOrgAmbiente(OrgAmbiente orgAmbiente) { + this.orgAmbiente = orgAmbiente; + } + + @XmlInverseReference(mappedBy = "decModelloXsdFascicolo") + // bi-directional many-to-one association to DecUsoModelloXsdFasc + @OneToMany(mappedBy = "decModelloXsdFascicolo") + public List getDecUsoModelloXsdFascs() { + return this.decUsoModelloXsdFascs; + } + + public void setDecUsoModelloXsdFascs(List decUsoModelloXsdFascs) { + this.decUsoModelloXsdFascs = decUsoModelloXsdFascs; + } + + @XmlTransient + // bi-directional many-to-one association to FasXmlFascicolo + @OneToMany(mappedBy = "decModelloXsdFascicolo") + public List getFasXmlFascicolos() { + return fasXmlFascicolos; + } + + public void setFasXmlFascicolos(List fasXmlFascicolos) { + this.fasXmlFascicolos = fasXmlFascicolos; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecModelloXsdUd.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecModelloXsdUd.java new file mode 100644 index 0000000..170eaa5 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecModelloXsdUd.java @@ -0,0 +1,218 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.DecModelloXsdUd.TiModelloXsdUd; + +/** + * The persistent class for the DEC_MODELLO_XSD_UD database table. + * + */ +@Entity +@Table(name = "DEC_MODELLO_XSD_UD") +public class DecModelloXsdUd implements Serializable { + + private static final long serialVersionUID = 1L; + private Long idModelloXsdUd; + private AplSistemaMigraz aplSistemaMigraz; + private OrgAmbiente orgAmbiente; + private String tiUsoModelloXsd; + private TiModelloXsdUd tiModelloXsd; + private String dsXsd; + private String cdXsd; + private String blXsd; + private Date dtIstituz; + private Date dtSoppres; + private String flDefault; + private List decUsoModelloXsdUniDocs = new ArrayList<>(); + private List decUsoModelloXsdDocs = new ArrayList<>(); + private List decUsoModelloXsdCompDocs = new ArrayList<>(); + + public DecModelloXsdUd() { + // hibernate + } + + @Id + @GenericGenerator(name = "DEC_MODELLO_XSD_UD_IDMODELLOXSDUD_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_MODELLO_XSD_UD"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "DEC_MODELLO_XSD_UD_IDMODELLOXSDUD_GENERATOR") + @Column(name = "ID_MODELLO_XSD_UD") + public Long getIdModelloXsdUd() { + return this.idModelloXsdUd; + } + + public void setIdModelloXsdUd(Long idModelloXsdUd) { + this.idModelloXsdUd = idModelloXsdUd; + } + + // bi-directional many-to-one association to AplSistemaMigraz + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SISTEMA_MIGRAZ") + public AplSistemaMigraz getAplSistemaMigraz() { + return this.aplSistemaMigraz; + } + + public void setAplSistemaMigraz(AplSistemaMigraz aplSistemaMigraz) { + this.aplSistemaMigraz = aplSistemaMigraz; + } + + // bi-directional many-to-one association to OrgAmbiente + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_AMBIENTE") + public OrgAmbiente getOrgAmbiente() { + return this.orgAmbiente; + } + + public void setOrgAmbiente(OrgAmbiente orgAmbiente) { + this.orgAmbiente = orgAmbiente; + } + + @Column(name = "TI_USO_MODELLO_XSD") + public String getTiUsoModelloXsd() { + return this.tiUsoModelloXsd; + } + + public void setTiUsoModelloXsd(String tiUsoModelloXsd) { + this.tiUsoModelloXsd = tiUsoModelloXsd; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_MODELLO_XSD") + public TiModelloXsdUd getTiModelloXsd() { + return this.tiModelloXsd; + } + + public void setTiModelloXsd(TiModelloXsdUd tiModelloXsd) { + this.tiModelloXsd = tiModelloXsd; + } + + @Column(name = "DS_XSD") + public String getDsXsd() { + return this.dsXsd; + } + + public void setDsXsd(String dsXsd) { + this.dsXsd = dsXsd; + } + + @Column(name = "CD_XSD") + public String getCdXsd() { + return this.cdXsd; + } + + public void setCdXsd(String cdXsd) { + this.cdXsd = cdXsd; + } + + @Lob + @Column(name = "BL_XSD") + public String getBlXsd() { + return this.blXsd; + } + + public void setBlXsd(String blXsd) { + this.blXsd = blXsd; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + @Column(name = "FL_DEFAULT", columnDefinition = "CHAR") + public String getFlDefault() { + return this.flDefault; + } + + public void setFlDefault(String flDefault) { + this.flDefault = flDefault; + } + + // bi-directional many-to-one association to DecTipoRapprAmmesso + @OneToMany(mappedBy = "decModelloXsdUd", cascade = CascadeType.PERSIST) + public List getDecUsoModelloXsdUniDocs() { + return this.decUsoModelloXsdUniDocs; + } + + public void setDecUsoModelloXsdUniDocs(List decUsoModelloXsdUniDocs) { + this.decUsoModelloXsdUniDocs = decUsoModelloXsdUniDocs; + } + + // bi-directional many-to-one association to DecTipoRapprAmmesso + @OneToMany(mappedBy = "decModelloXsdUd", cascade = CascadeType.PERSIST) + public List getDecUsoModelloXsdDocs() { + return this.decUsoModelloXsdDocs; + } + + public void setDecUsoModelloXsdDocs(List decUsoModelloXsdDocs) { + this.decUsoModelloXsdDocs = decUsoModelloXsdDocs; + } + + // bi-directional many-to-one association to DecTipoRapprAmmesso + @OneToMany(mappedBy = "decModelloXsdUd", cascade = CascadeType.PERSIST) + public List getDecUsoModelloXsdCompDocs() { + return this.decUsoModelloXsdCompDocs; + } + + public void setDecUsoModelloXsdCompDocs(List decUsoModelloXsdCompDocs) { + this.decUsoModelloXsdCompDocs = decUsoModelloXsdCompDocs; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecParteNumeroFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecParteNumeroFascicolo.java new file mode 100644 index 0000000..f1c5c74 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecParteNumeroFascicolo.java @@ -0,0 +1,189 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlTransient; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_PARTE_NUMERO_FASCICOLO database table. + */ +@Entity +@Table(name = "DEC_PARTE_NUMERO_FASCICOLO") +public class DecParteNumeroFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idParteNumeroFascicolo; + + private String dlValoriParte; + + private String dsParteNumero; + + private BigDecimal niMaxCharParte; + + private BigDecimal niMinCharParte; + + private BigDecimal niParteNumero; + + private String nmParteNumero; + + private String tiCharParte; + + private String tiCharSep; + + private String tiPadParte; + + private String tiParte; + + private DecAaTipoFascicolo decAaTipoFascicolo; + + public DecParteNumeroFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_PARTE_NUMERO_FASCICOLO") + @GenericGenerator(name = "SDEC_PARTE_NUMERO_FASCICOLO_ID_PARTE_NUMERO_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_PARTE_NUMERO_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_PARTE_NUMERO_FASCICOLO_ID_PARTE_NUMERO_FASCICOLO_GENERATOR") + public Long getIdParteNumeroFascicolo() { + return this.idParteNumeroFascicolo; + } + + public void setIdParteNumeroFascicolo(Long idParteNumeroFascicolo) { + this.idParteNumeroFascicolo = idParteNumeroFascicolo; + } + + @Column(name = "DL_VALORI_PARTE") + public String getDlValoriParte() { + return this.dlValoriParte; + } + + public void setDlValoriParte(String dlValoriParte) { + this.dlValoriParte = dlValoriParte; + } + + @Column(name = "DS_PARTE_NUMERO") + public String getDsParteNumero() { + return this.dsParteNumero; + } + + public void setDsParteNumero(String dsParteNumero) { + this.dsParteNumero = dsParteNumero; + } + + @Column(name = "NI_MAX_CHAR_PARTE") + public BigDecimal getNiMaxCharParte() { + return this.niMaxCharParte; + } + + public void setNiMaxCharParte(BigDecimal niMaxCharParte) { + this.niMaxCharParte = niMaxCharParte; + } + + @Column(name = "NI_MIN_CHAR_PARTE") + public BigDecimal getNiMinCharParte() { + return this.niMinCharParte; + } + + public void setNiMinCharParte(BigDecimal niMinCharParte) { + this.niMinCharParte = niMinCharParte; + } + + @Column(name = "NI_PARTE_NUMERO") + public BigDecimal getNiParteNumero() { + return this.niParteNumero; + } + + public void setNiParteNumero(BigDecimal niParteNumero) { + this.niParteNumero = niParteNumero; + } + + @Column(name = "NM_PARTE_NUMERO") + public String getNmParteNumero() { + return this.nmParteNumero; + } + + public void setNmParteNumero(String nmParteNumero) { + this.nmParteNumero = nmParteNumero; + } + + @Column(name = "TI_CHAR_PARTE") + public String getTiCharParte() { + return this.tiCharParte; + } + + public void setTiCharParte(String tiCharParte) { + this.tiCharParte = tiCharParte; + } + + @Column(name = "TI_CHAR_SEP", columnDefinition = "char") + public String getTiCharSep() { + return this.tiCharSep; + } + + public void setTiCharSep(String tiCharSep) { + this.tiCharSep = tiCharSep; + } + + @Column(name = "TI_PAD_PARTE") + public String getTiPadParte() { + return this.tiPadParte; + } + + public void setTiPadParte(String tiPadParte) { + this.tiPadParte = tiPadParte; + } + + @Column(name = "TI_PARTE") + public String getTiParte() { + return this.tiParte; + } + + public void setTiParte(String tiParte) { + this.tiParte = tiParte; + } + + // bi-directional many-to-one association to DecAaTipoFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_AA_TIPO_FASCICOLO") + @XmlTransient + public DecAaTipoFascicolo getDecAaTipoFascicolo() { + return this.decAaTipoFascicolo; + } + + public void setDecAaTipoFascicolo(DecAaTipoFascicolo decAaTipoFascicolo) { + this.decAaTipoFascicolo = decAaTipoFascicolo; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecParteNumeroRegistro.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecParteNumeroRegistro.java new file mode 100644 index 0000000..9751937 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecParteNumeroRegistro.java @@ -0,0 +1,189 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_PARTE_NUMERO_REGISTRO database table. + */ +@Entity +@Table(name = "DEC_PARTE_NUMERO_REGISTRO") +public class DecParteNumeroRegistro implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idParteNumeroRegistro; + + private String dlValoriParte; + + private String dsParteNumeroRegistro; + + private BigDecimal niMaxCharParte; + + private BigDecimal niMinCharParte; + + private BigDecimal niParteNumeroRegistro; + + private String nmParteNumeroRegistro; + + private String tiCharParte; + + private String tiCharSep; + + private String tiPadSxParte; + + private String tiParte; + + private DecAaRegistroUnitaDoc decAaRegistroUnitaDoc; + + public DecParteNumeroRegistro() {/* Hibernate */ + } + + @Id + @Column(name = "ID_PARTE_NUMERO_REGISTRO") + @GenericGenerator(name = "SDEC_PARTE_NUMERO_REGISTRO_ID_PARTE_NUMERO_REGISTRO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_PARTE_NUMERO_REGISTRO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_PARTE_NUMERO_REGISTRO_ID_PARTE_NUMERO_REGISTRO_GENERATOR") + public Long getIdParteNumeroRegistro() { + return this.idParteNumeroRegistro; + } + + public void setIdParteNumeroRegistro(Long idParteNumeroRegistro) { + this.idParteNumeroRegistro = idParteNumeroRegistro; + } + + @Column(name = "DL_VALORI_PARTE") + public String getDlValoriParte() { + return this.dlValoriParte; + } + + public void setDlValoriParte(String dlValoriParte) { + this.dlValoriParte = dlValoriParte; + } + + @Column(name = "DS_PARTE_NUMERO_REGISTRO") + public String getDsParteNumeroRegistro() { + return this.dsParteNumeroRegistro; + } + + public void setDsParteNumeroRegistro(String dsParteNumeroRegistro) { + this.dsParteNumeroRegistro = dsParteNumeroRegistro; + } + + @Column(name = "NI_MAX_CHAR_PARTE") + public BigDecimal getNiMaxCharParte() { + return this.niMaxCharParte; + } + + public void setNiMaxCharParte(BigDecimal niMaxCharParte) { + this.niMaxCharParte = niMaxCharParte; + } + + @Column(name = "NI_MIN_CHAR_PARTE") + public BigDecimal getNiMinCharParte() { + return this.niMinCharParte; + } + + public void setNiMinCharParte(BigDecimal niMinCharParte) { + this.niMinCharParte = niMinCharParte; + } + + @Column(name = "NI_PARTE_NUMERO_REGISTRO") + public BigDecimal getNiParteNumeroRegistro() { + return this.niParteNumeroRegistro; + } + + public void setNiParteNumeroRegistro(BigDecimal niParteNumeroRegistro) { + this.niParteNumeroRegistro = niParteNumeroRegistro; + } + + @Column(name = "NM_PARTE_NUMERO_REGISTRO") + public String getNmParteNumeroRegistro() { + return this.nmParteNumeroRegistro; + } + + public void setNmParteNumeroRegistro(String nmParteNumeroRegistro) { + this.nmParteNumeroRegistro = nmParteNumeroRegistro; + } + + @Column(name = "TI_CHAR_PARTE") + public String getTiCharParte() { + return this.tiCharParte; + } + + public void setTiCharParte(String tiCharParte) { + this.tiCharParte = tiCharParte; + } + + @Column(name = "TI_CHAR_SEP", columnDefinition = "char") + public String getTiCharSep() { + return this.tiCharSep; + } + + public void setTiCharSep(String tiCharSep) { + this.tiCharSep = tiCharSep; + } + + @Column(name = "TI_PAD_SX_PARTE") + public String getTiPadSxParte() { + return this.tiPadSxParte; + } + + public void setTiPadSxParte(String tiPadSxParte) { + this.tiPadSxParte = tiPadSxParte; + } + + @Column(name = "TI_PARTE") + public String getTiParte() { + return tiParte; + } + + public void setTiParte(String tiParte) { + this.tiParte = tiParte; + } + + // bi-directional many-to-one association to DecAaRegistroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_AA_REGISTRO_UNITA_DOC") + @XmlInverseReference(mappedBy = "decParteNumeroRegistros") + public DecAaRegistroUnitaDoc getDecAaRegistroUnitaDoc() { + return this.decAaRegistroUnitaDoc; + } + + public void setDecAaRegistroUnitaDoc(DecAaRegistroUnitaDoc decAaRegistroUnitaDoc) { + this.decAaRegistroUnitaDoc = decAaRegistroUnitaDoc; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecRegistroUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecRegistroUnitaDoc.java new file mode 100644 index 0000000..d2ba9d5 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecRegistroUnitaDoc.java @@ -0,0 +1,297 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Cacheable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlTransient; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_REGISTRO_UNITA_DOC database table. + */ +@Entity +@Cacheable(true) +@Table(name = "DEC_REGISTRO_UNITA_DOC") +public class DecRegistroUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idRegistroUnitaDoc; + + private String cdRegistroNormaliz; + + private String cdRegistroUnitaDoc; + + private String cdSerieDaCreare; + + private String dsRegistroUnitaDoc; + + private String dsSerieDaCreare; + + private String dsTipoSerieDaCreare; + + private Date dtIstituz; + + private Date dtSoppres; + + private String flCreaSerie; + + private String flCreaTipoSerieStandard; + + private String flRegistroFisc; + + private String flTipoSerieMult; + + private BigDecimal niAnniConserv; + + private String nmTipoSerieDaCreare; + + private List aroUnitaDocs = new ArrayList<>(); + + private List decAaRegistroUnitaDocs = new ArrayList<>(); + + private OrgStrut orgStrut; + + private List decTipoUnitaDocAmmessos = new ArrayList<>(); + + private List monAaUnitaDocRegistros = new ArrayList<>(); + + public DecRegistroUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_REGISTRO_UNITA_DOC") + @XmlID + @GenericGenerator(name = "SDEC_REGISTRO_UNITA_DOC_ID_REGISTRO_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_REGISTRO_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_REGISTRO_UNITA_DOC_ID_REGISTRO_UNITA_DOC_GENERATOR") + public Long getIdRegistroUnitaDoc() { + return this.idRegistroUnitaDoc; + } + + public void setIdRegistroUnitaDoc(Long idRegistroUnitaDoc) { + this.idRegistroUnitaDoc = idRegistroUnitaDoc; + } + + @Column(name = "CD_REGISTRO_UNITA_DOC") + public String getCdRegistroUnitaDoc() { + return this.cdRegistroUnitaDoc; + } + + public void setCdRegistroUnitaDoc(String cdRegistroUnitaDoc) { + this.cdRegistroUnitaDoc = cdRegistroUnitaDoc; + } + + @Column(name = "CD_REGISTRO_NORMALIZ") + public String getCdRegistroNormaliz() { + return this.cdRegistroNormaliz; + } + + public void setCdRegistroNormaliz(String cdRegistroNormaliz) { + this.cdRegistroNormaliz = cdRegistroNormaliz; + } + + @Column(name = "CD_SERIE_DA_CREARE") + public String getCdSerieDaCreare() { + return this.cdSerieDaCreare; + } + + public void setCdSerieDaCreare(String cdSerieDaCreare) { + this.cdSerieDaCreare = cdSerieDaCreare; + } + + @Column(name = "DS_REGISTRO_UNITA_DOC") + public String getDsRegistroUnitaDoc() { + return this.dsRegistroUnitaDoc; + } + + public void setDsRegistroUnitaDoc(String dsRegistroUnitaDoc) { + this.dsRegistroUnitaDoc = dsRegistroUnitaDoc; + } + + @Column(name = "DS_SERIE_DA_CREARE") + public String getDsSerieDaCreare() { + return this.dsSerieDaCreare; + } + + public void setDsSerieDaCreare(String dsSerieDaCreare) { + this.dsSerieDaCreare = dsSerieDaCreare; + } + + @Column(name = "DS_TIPO_SERIE_DA_CREARE") + public String getDsTipoSerieDaCreare() { + return this.dsTipoSerieDaCreare; + } + + public void setDsTipoSerieDaCreare(String dsTipoSerieDaCreare) { + this.dsTipoSerieDaCreare = dsTipoSerieDaCreare; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + @Column(name = "FL_CREA_SERIE", columnDefinition = "char(1)") + public String getFlCreaSerie() { + return this.flCreaSerie; + } + + public void setFlCreaSerie(String flCreaSerie) { + this.flCreaSerie = flCreaSerie; + } + + @Column(name = "FL_CREA_TIPO_SERIE_STANDARD", columnDefinition = "char(1)") + public String getFlCreaTipoSerieStandard() { + return this.flCreaTipoSerieStandard; + } + + public void setFlCreaTipoSerieStandard(String flCreaTipoSerieStandard) { + this.flCreaTipoSerieStandard = flCreaTipoSerieStandard; + } + + @Column(name = "FL_REGISTRO_FISC", columnDefinition = "char(1)") + public String getFlRegistroFisc() { + return this.flRegistroFisc; + } + + public void setFlRegistroFisc(String flRegistroFisc) { + this.flRegistroFisc = flRegistroFisc; + } + + @Column(name = "FL_TIPO_SERIE_MULT", columnDefinition = "char(1)") + public String getFlTipoSerieMult() { + return this.flTipoSerieMult; + } + + public void setFlTipoSerieMult(String flTipoSerieMult) { + this.flTipoSerieMult = flTipoSerieMult; + } + + @Column(name = "NI_ANNI_CONSERV") + public BigDecimal getNiAnniConserv() { + return this.niAnniConserv; + } + + public void setNiAnniConserv(BigDecimal niAnniConserv) { + this.niAnniConserv = niAnniConserv; + } + + @Column(name = "NM_TIPO_SERIE_DA_CREARE") + public String getNmTipoSerieDaCreare() { + return this.nmTipoSerieDaCreare; + } + + public void setNmTipoSerieDaCreare(String nmTipoSerieDaCreare) { + this.nmTipoSerieDaCreare = nmTipoSerieDaCreare; + } + + // bi-directional many-to-one association to AroUnitaDoc + @OneToMany(mappedBy = "decRegistroUnitaDoc") + @XmlTransient + public List getAroUnitaDocs() { + return this.aroUnitaDocs; + } + + public void setAroUnitaDocs(List aroUnitaDocs) { + this.aroUnitaDocs = aroUnitaDocs; + } + + // bi-directional many-to-one association to DecAaRegistroUnitaDoc + @OneToMany(mappedBy = "decRegistroUnitaDoc", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + public List getDecAaRegistroUnitaDocs() { + return this.decAaRegistroUnitaDocs; + } + + public void setDecAaRegistroUnitaDocs(List decAaRegistroUnitaDocs) { + this.decAaRegistroUnitaDocs = decAaRegistroUnitaDocs; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + @XmlInverseReference(mappedBy = "decRegistroUnitaDocs") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to DecTipoUnitaDocAmmesso + @OneToMany(mappedBy = "decRegistroUnitaDoc", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + public List getDecTipoUnitaDocAmmessos() { + return this.decTipoUnitaDocAmmessos; + } + + public void setDecTipoUnitaDocAmmessos(List decTipoUnitaDocAmmessos) { + this.decTipoUnitaDocAmmessos = decTipoUnitaDocAmmessos; + } + + // bi-directional many-to-one association to MonAaUnitaDocRegistro + @OneToMany(mappedBy = "decRegistroUnitaDoc") + @XmlTransient + public List getMonAaUnitaDocRegistros() { + return this.monAaUnitaDocRegistros; + } + + public void setMonAaUnitaDocRegistros(List monAaUnitaDocRegistros) { + this.monAaUnitaDocRegistros = monAaUnitaDocRegistros; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecReportServizioVerificaCompDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecReportServizioVerificaCompDoc.java new file mode 100644 index 0000000..e0912cf --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecReportServizioVerificaCompDoc.java @@ -0,0 +1,108 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +import it.eng.parer.entity.constraint.DecReportServizioVerificaCompDoc.TiFormatoServizioVerificaCompDoc; +import it.eng.parer.entity.constraint.DecReportServizioVerificaCompDoc.TiReportServizioVerificaCompDoc; + +/** + * The persistent class for the DEC_REPORT_SERVIZIO_VERIFICA_COMP_DOC database table. + * + */ +@Entity +@Table(name = "DEC_REPORT_SERVIZIO_VERIFICA_COMP_DOC") +public class DecReportServizioVerificaCompDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idReportServizioVerificaCompDoc; + private DecServizioVerificaCompDoc decServizioVerificaCompDoc; + private String blXslt; + private TiReportServizioVerificaCompDoc tiReport; + private TiFormatoServizioVerificaCompDoc tiFormato; + + public DecReportServizioVerificaCompDoc() {/* Hibernate */ + } + + @Id + @SequenceGenerator(name = "DEC_REPORT_SERVIZIO_VERIFICA_COMP_DOC_ID_REPORT_SERVIZIO_VERIFICA_COMP_DOC_GENERATOR", sequenceName = "SDEC_REPORT_SERVIZIO_VERIFICA_COMP_DOC", allocationSize = 1) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "DEC_REPORT_SERVIZIO_VERIFICA_COMP_DOC_ID_REPORT_SERVIZIO_VERIFICA_COMP_DOC_GENERATOR") + @Column(name = "ID_REPORT_SERVIZIO_VERIFICA_COMP_DOC") + public Long getIdReportServizioVerificaCompDoc() { + return this.idReportServizioVerificaCompDoc; + } + + public void setIdReportServizioVerificaCompDoc(Long idReportServizioVerificaCompDoc) { + this.idReportServizioVerificaCompDoc = idReportServizioVerificaCompDoc; + } + + @Lob + @Column(name = "BL_XSLT") + public String getBlXsltReport() { + return this.blXslt; + } + + public void setBlXsltReport(String blXslt) { + this.blXslt = blXslt; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_REPORT") + public TiReportServizioVerificaCompDoc getTiReport() { + return this.tiReport; + } + + public void setTiReport(TiReportServizioVerificaCompDoc tiReport) { + this.tiReport = tiReport; + } + + @ManyToOne + @JoinColumn(name = "ID_SERVIZIO_VERIFICA_COMP_DOC") + public DecServizioVerificaCompDoc getDecServizioVerificaCompDoc() { + return this.decServizioVerificaCompDoc; + } + + public void setDecServizioVerificaCompDoc(DecServizioVerificaCompDoc decServizioVerificaCompDoc) { + this.decServizioVerificaCompDoc = decServizioVerificaCompDoc; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_FORMATO") + public TiFormatoServizioVerificaCompDoc getTiFormato() { + return tiFormato; + } + + public void setTiFormato(TiFormatoServizioVerificaCompDoc tiFormato) { + this.tiFormato = tiFormato; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecServizioVerificaCompDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecServizioVerificaCompDoc.java new file mode 100644 index 0000000..ea50f15 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecServizioVerificaCompDoc.java @@ -0,0 +1,106 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +import it.eng.parer.entity.constraint.DecServizioVerificaCompDoc.CdServizioVerificaCompDoc; + +/** + * The persistent class for the DEC_SERVIZIO_VERIFICA_COMP_DOC database table. + * + */ +@Entity +@Table(name = "DEC_SERVIZIO_VERIFICA_COMP_DOC") +public class DecServizioVerificaCompDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idServizioVerificaCompDoc; + private CdServizioVerificaCompDoc cdServizio; + private String nmVersione; + private String dsServizioVerificaCompDoc; + private List decReportServizioCompDocs = new ArrayList<>(); + + public DecServizioVerificaCompDoc() { + // hibernate + } + + @Id + @SequenceGenerator(name = "DEC_SERVIZIO_VERIFICA_COMP_DOC_ID_SERVIZIO_VERIFICA_COMP_DOC_GENERATOR", sequenceName = "SDEC_SERVIZIO_VERIFICA_COMP_DOC", allocationSize = 1) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "DEC_SERVIZIO_VERIFICA_COMP_DOC_ID_SERVIZIO_VERIFICA_COMP_DOC_GENERATOR") + @Column(name = "ID_SERVIZIO_VERIFICA_COMP_DOC") + public Long getIdServizioVerificaCompDoc() { + return this.idServizioVerificaCompDoc; + } + + public void setIdServizioVerificaCompDoc(Long idServizioVerificaCompDoc) { + this.idServizioVerificaCompDoc = idServizioVerificaCompDoc; + } + + @Enumerated(EnumType.STRING) + @Column(name = "CD_SERVIZIO") + public CdServizioVerificaCompDoc getCdServizio() { + return cdServizio; + } + + public void setCdServizio(CdServizioVerificaCompDoc cdServizio) { + this.cdServizio = cdServizio; + } + + @Column(name = "NM_VERSIONE") + public String getNmVersione() { + return nmVersione; + } + + public void setNmVersione(String nmVersione) { + this.nmVersione = nmVersione; + } + + @Column(name = "DS_SERVIZIO_VERIFICA_COMP_DOC") + public String getDsServizioVerificaCompDoc() { + return dsServizioVerificaCompDoc; + } + + public void setDsServizioVerificaCompDoc(String dsServizioVerificaCompDoc) { + this.dsServizioVerificaCompDoc = dsServizioVerificaCompDoc; + } + + // bi-directional many-to-one association to DecReportServizioVerificaCompDoc + @OneToMany(mappedBy = "decServizioVerificaCompDoc") + public List getDecReportServizioVerificaCompDocs() { + return decReportServizioCompDocs; + } + + public void setDecReportServizioVerificaCompDocs(List decReportServizioCompDocs) { + this.decReportServizioCompDocs = decReportServizioCompDocs; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoCompDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoCompDoc.java new file mode 100644 index 0000000..b483576 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoCompDoc.java @@ -0,0 +1,241 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Cacheable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlTransient; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_TIPO_COMP_DOC database table. + */ +@Entity +@Cacheable(true) +@Table(name = "DEC_TIPO_COMP_DOC") +public class DecTipoCompDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idTipoCompDoc; + + private String dsTipoCompDoc; + + private String flGestiti; + + private String flIdonei; + + private String flDeprecati; + + private Date dtIstituz; + + private Date dtSoppres; + + private String nmTipoCompDoc; + + private String tiUsoCompDoc; + + private List aroCompDocs = new ArrayList<>(); + + private List decAttribDatiSpecs = new ArrayList<>(); + + private List decFormatoFileAmmessos = new ArrayList<>(); + + private DecTipoStrutDoc decTipoStrutDoc; + + private List decXsdDatiSpecs = new ArrayList<>(); + private List decUsoModelloXsdCompDocs = new ArrayList<>(); + + public DecTipoCompDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_TIPO_COMP_DOC") + @GenericGenerator(name = "SDEC_TIPO_COMP_DOC_ID_TIPO_COMP_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_TIPO_COMP_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_TIPO_COMP_DOC_ID_TIPO_COMP_DOC_GENERATOR") + public Long getIdTipoCompDoc() { + return this.idTipoCompDoc; + } + + public void setIdTipoCompDoc(Long idTipoCompDoc) { + this.idTipoCompDoc = idTipoCompDoc; + } + + @Column(name = "DS_TIPO_COMP_DOC") + public String getDsTipoCompDoc() { + return this.dsTipoCompDoc; + } + + public void setDsTipoCompDoc(String dsTipoCompDoc) { + this.dsTipoCompDoc = dsTipoCompDoc; + } + + @Column(name = "FL_GESTITI", columnDefinition = "char(1)") + public String getFlGestiti() { + return this.flGestiti; + } + + public void setFlGestiti(String flGestiti) { + this.flGestiti = flGestiti; + } + + @Column(name = "FL_IDONEI", columnDefinition = "char(1)") + public String getFlIdonei() { + return this.flIdonei; + } + + public void setFlIdonei(String flIdonei) { + this.flIdonei = flIdonei; + } + + @Column(name = "FL_DEPRECATI", columnDefinition = "char(1)") + public String getFlDeprecati() { + return this.flDeprecati; + } + + public void setFlDeprecati(String flDeprecati) { + this.flDeprecati = flDeprecati; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + @Column(name = "NM_TIPO_COMP_DOC") + public String getNmTipoCompDoc() { + return this.nmTipoCompDoc; + } + + public void setNmTipoCompDoc(String nmTipoCompDoc) { + this.nmTipoCompDoc = nmTipoCompDoc; + } + + @Column(name = "TI_USO_COMP_DOC") + public String getTiUsoCompDoc() { + return this.tiUsoCompDoc; + } + + public void setTiUsoCompDoc(String tiUsoCompDoc) { + this.tiUsoCompDoc = tiUsoCompDoc; + } + + // bi-directional many-to-one association to AroCompDoc + @OneToMany(mappedBy = "decTipoCompDoc") + @XmlTransient + public List getAroCompDocs() { + return this.aroCompDocs; + } + + public void setAroCompDocs(List aroCompDocs) { + this.aroCompDocs = aroCompDocs; + } + + // bi-directional many-to-one association to DecFormatoFileAmmesso + @OneToMany(mappedBy = "decTipoCompDoc", cascade = CascadeType.PERSIST) + public List getDecFormatoFileAmmessos() { + return this.decFormatoFileAmmessos; + } + + public void setDecFormatoFileAmmessos(List decFormatoFileAmmessos) { + this.decFormatoFileAmmessos = decFormatoFileAmmessos; + } + + // bi-directional many-to-one association to DecTipoStrutDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_STRUT_DOC") + @XmlInverseReference(mappedBy = "decTipoCompDocs") + public DecTipoStrutDoc getDecTipoStrutDoc() { + return this.decTipoStrutDoc; + } + + public void setDecTipoStrutDoc(DecTipoStrutDoc decTipoStrutDoc) { + this.decTipoStrutDoc = decTipoStrutDoc; + } + + // bi-directional many-to-one association to DecAttribDatiSpec + @OneToMany(mappedBy = "decTipoCompDoc", cascade = CascadeType.PERSIST) + @XmlIDREF + public List getDecAttribDatiSpecs() { + return this.decAttribDatiSpecs; + } + + public void setDecAttribDatiSpecs(List decAttribDatiSpecs) { + this.decAttribDatiSpecs = decAttribDatiSpecs; + } + + // bi-directional many-to-one association to DecXsdDatiSpec + @OneToMany(mappedBy = "decTipoCompDoc", cascade = CascadeType.PERSIST) + @XmlIDREF + public List getDecXsdDatiSpecs() { + return this.decXsdDatiSpecs; + } + + public void setDecXsdDatiSpecs(List decXsdDatiSpecs) { + this.decXsdDatiSpecs = decXsdDatiSpecs; + } + + // bi-directional many-to-one association to DecTipoRapprAmmesso + @OneToMany(mappedBy = "decTipoCompDoc", cascade = CascadeType.PERSIST) + public List getDecUsoModelloXsdCompDocs() { + return this.decUsoModelloXsdCompDocs; + } + + public void setDecUsoModelloXsdCompDocs(List decUsoModelloXsdCompDocs) { + this.decUsoModelloXsdCompDocs = decUsoModelloXsdCompDocs; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoDoc.java new file mode 100644 index 0000000..e4ffd64 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoDoc.java @@ -0,0 +1,259 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Cacheable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlTransient; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_TIPO_DOC database table. + */ +@Entity +@Cacheable(true) +@Table(name = "DEC_TIPO_DOC") +public class DecTipoDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idTipoDoc; + + private String dlNoteTipoDoc; + + private String dsPeriodicitaVers; + + private String dsTipoDoc; + + private Date dtIstituz; + + private Date dtSoppres; + + private String flTipoDocPrincipale; + + private String nmTipoDoc; + + private List aroDocs = new ArrayList<>(); + + private List decAttribDatiSpecs = new ArrayList<>(); + + private OrgStrut orgStrut; + private List vrsSesUpdUnitaDocKos; + private List vrsUpdUnitaDocKos; + + private List decXsdDatiSpecs = new ArrayList<>(); + + private List orgRegolaValSubStruts = new ArrayList<>(); + + private List decUsoModelloXsdDocs = new ArrayList<>(); + + public DecTipoDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_TIPO_DOC") + @XmlID + @GenericGenerator(name = "SDEC_TIPO_DOC_ID_TIPO_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_TIPO_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_TIPO_DOC_ID_TIPO_DOC_GENERATOR") + public Long getIdTipoDoc() { + return this.idTipoDoc; + } + + public void setIdTipoDoc(Long idTipoDoc) { + this.idTipoDoc = idTipoDoc; + } + + @Column(name = "DL_NOTE_TIPO_DOC") + public String getDlNoteTipoDoc() { + return this.dlNoteTipoDoc; + } + + public void setDlNoteTipoDoc(String dlNoteTipoDoc) { + this.dlNoteTipoDoc = dlNoteTipoDoc; + } + + @Column(name = "DS_PERIODICITA_VERS") + public String getDsPeriodicitaVers() { + return this.dsPeriodicitaVers; + } + + public void setDsPeriodicitaVers(String dsPeriodicitaVers) { + this.dsPeriodicitaVers = dsPeriodicitaVers; + } + + @Column(name = "DS_TIPO_DOC") + public String getDsTipoDoc() { + return this.dsTipoDoc; + } + + public void setDsTipoDoc(String dsTipoDoc) { + this.dsTipoDoc = dsTipoDoc; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + @Column(name = "FL_TIPO_DOC_PRINCIPALE", columnDefinition = "char(1)") + public String getFlTipoDocPrincipale() { + return this.flTipoDocPrincipale; + } + + public void setFlTipoDocPrincipale(String flTipoDocPrincipale) { + this.flTipoDocPrincipale = flTipoDocPrincipale; + } + + @Column(name = "NM_TIPO_DOC") + public String getNmTipoDoc() { + return this.nmTipoDoc; + } + + public void setNmTipoDoc(String nmTipoDoc) { + this.nmTipoDoc = nmTipoDoc; + } + + // bi-directional many-to-one association to AroDoc + @OneToMany(mappedBy = "decTipoDoc") + @XmlTransient + public List getAroDocs() { + return this.aroDocs; + } + + public void setAroDocs(List aroDocs) { + this.aroDocs = aroDocs; + } + + // bi-directional many-to-one association to DecAttribDatiSpec + @OneToMany(mappedBy = "decTipoDoc", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + @XmlIDREF + public List getDecAttribDatiSpecs() { + return this.decAttribDatiSpecs; + } + + public void setDecAttribDatiSpecs(List decAttribDatiSpecs) { + this.decAttribDatiSpecs = decAttribDatiSpecs; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + @XmlInverseReference(mappedBy = "decTipoDocs") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to DecXsdDatiSpec + @OneToMany(mappedBy = "decTipoDoc", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + @XmlIDREF + public List getDecXsdDatiSpecs() { + return this.decXsdDatiSpecs; + } + + public void setDecXsdDatiSpecs(List decXsdDatiSpecs) { + this.decXsdDatiSpecs = decXsdDatiSpecs; + } + + // bi-directional many-to-one association to OrgRegolaValSubStrut + @OneToMany(mappedBy = "decTipoDoc", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + @XmlIDREF + public List getOrgRegolaValSubStruts() { + return this.orgRegolaValSubStruts; + } + + public void setOrgRegolaValSubStruts(List orgRegolaValSubStruts) { + this.orgRegolaValSubStruts = orgRegolaValSubStruts; + } + + // bi-directional many-to-one association to DecTipoRapprAmmesso + @OneToMany(mappedBy = "decTipoDoc", cascade = CascadeType.PERSIST) + public List getDecUsoModelloXsdDocs() { + return this.decUsoModelloXsdDocs; + } + + public void setDecUsoModelloXsdDocs(List decUsoModelloXsdDocs) { + this.decUsoModelloXsdDocs = decUsoModelloXsdDocs; + } + + // bi-directional many-to-one association to VrsSesUpdUnitaDocKo + @OneToMany(mappedBy = "decTipoDocPrinc") + @XmlTransient + public List getVrsSesUpdUnitaDocKos() { + return this.vrsSesUpdUnitaDocKos; + } + + public void setVrsSesUpdUnitaDocKos(List vrsSesUpdUnitaDocKos) { + this.vrsSesUpdUnitaDocKos = vrsSesUpdUnitaDocKos; + } + + // bi-directional many-to-one association to VrsUpdUnitaDocKo + @OneToMany(mappedBy = "decTipoDocPrincLast") + @XmlTransient + public List getVrsUpdUnitaDocKos() { + return this.vrsUpdUnitaDocKos; + } + + public void setVrsUpdUnitaDocKos(List vrsUpdUnitaDocKos) { + this.vrsUpdUnitaDocKos = vrsUpdUnitaDocKos; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoFascicolo.java new file mode 100644 index 0000000..38373b6 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoFascicolo.java @@ -0,0 +1,156 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.xml.bind.annotation.XmlTransient; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_TIPO_FASCICOLO database table. + */ +@Entity +@Table(name = "DEC_TIPO_FASCICOLO") +public class DecTipoFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idTipoFascicolo; + + private String dsTipoFascicolo; + + private Date dtIstituz; + + private Date dtSoppres; + + private String nmTipoFascicolo; + + private List decAaTipoFascicolos = new ArrayList<>(); + + private OrgStrut orgStrut; + + private List fasFascicolos = new ArrayList<>(); + + public DecTipoFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_TIPO_FASCICOLO") + @GenericGenerator(name = "SDEC_TIPO_FASCICOLO_ID_TIPO_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_TIPO_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_TIPO_FASCICOLO_ID_TIPO_FASCICOLO_GENERATOR") + public Long getIdTipoFascicolo() { + return this.idTipoFascicolo; + } + + public void setIdTipoFascicolo(Long idTipoFascicolo) { + this.idTipoFascicolo = idTipoFascicolo; + } + + @Column(name = "DS_TIPO_FASCICOLO") + public String getDsTipoFascicolo() { + return this.dsTipoFascicolo; + } + + public void setDsTipoFascicolo(String dsTipoFascicolo) { + this.dsTipoFascicolo = dsTipoFascicolo; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + @Column(name = "NM_TIPO_FASCICOLO") + public String getNmTipoFascicolo() { + return this.nmTipoFascicolo; + } + + public void setNmTipoFascicolo(String nmTipoFascicolo) { + this.nmTipoFascicolo = nmTipoFascicolo; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + @XmlTransient + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to DecAaTipoFascicolo + @OneToMany(cascade = CascadeType.ALL, mappedBy = "decTipoFascicolo", fetch = FetchType.LAZY) + public List getDecAaTipoFascicolos() { + return this.decAaTipoFascicolos; + } + + public void setDecAaTipoFascicolos(List decAaTipoFascicolos) { + this.decAaTipoFascicolos = decAaTipoFascicolos; + } + + // bi-directional many-to-one association to FasFascicolo + @OneToMany(mappedBy = "decTipoFascicolo") + @XmlTransient + public List getFasFascicolos() { + return this.fasFascicolos; + } + + public void setFasFascicolos(List fasFascicolos) { + this.fasFascicolos = fasFascicolos; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoRapprComp.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoRapprComp.java new file mode 100644 index 0000000..5a01765 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoRapprComp.java @@ -0,0 +1,212 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Cacheable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlTransient; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_TIPO_RAPPR_COMP database table. + */ +@Entity +@Cacheable(true) +@Table(name = "DEC_TIPO_RAPPR_COMP") +public class DecTipoRapprComp implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idTipoRapprComp; + + private String dsTipoRapprComp; + + private Date dtIstituz; + + private Date dtSoppres; + + private String nmTipoRapprComp; + + private List aroCompDocs = new ArrayList<>(); + + private OrgStrut orgStrut; + + private String tiAlgoRappr; + + private String tiOutputRappr; + + private DecFormatoFileDoc decFormatoFileDocCont; + + private DecFormatoFileDoc decFormatoFileDocConv; + + private DecFormatoFileStandard decFormatoFileStandard; + + public DecTipoRapprComp() {/* Hibernate */ + } + + @Id + @Column(name = "ID_TIPO_RAPPR_COMP") + @XmlID + @GenericGenerator(name = "SDEC_TIPO_RAPPR_COMP_ID_TIPO_RAPPR_COMP_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_TIPO_RAPPR_COMP"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_TIPO_RAPPR_COMP_ID_TIPO_RAPPR_COMP_GENERATOR") + public Long getIdTipoRapprComp() { + return this.idTipoRapprComp; + } + + public void setIdTipoRapprComp(Long idTipoRapprComp) { + this.idTipoRapprComp = idTipoRapprComp; + } + + @Column(name = "DS_TIPO_RAPPR_COMP") + public String getDsTipoRapprComp() { + return this.dsTipoRapprComp; + } + + public void setDsTipoRapprComp(String dsTipoRapprComp) { + this.dsTipoRapprComp = dsTipoRapprComp; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + @Column(name = "NM_TIPO_RAPPR_COMP") + public String getNmTipoRapprComp() { + return this.nmTipoRapprComp; + } + + public void setNmTipoRapprComp(String nmTipoRapprComp) { + this.nmTipoRapprComp = nmTipoRapprComp; + } + + // bi-directional many-to-one association to AroCompDoc + @OneToMany(mappedBy = "decTipoRapprComp") + @XmlTransient + public List getAroCompDocs() { + return this.aroCompDocs; + } + + public void setAroCompDocs(List aroCompDocs) { + this.aroCompDocs = aroCompDocs; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + @XmlInverseReference(mappedBy = "decTipoRapprComps") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + @Column(name = "TI_ALGO_RAPPR") + public String getTiAlgoRappr() { + return this.tiAlgoRappr; + } + + public void setTiAlgoRappr(String tiAlgoRappr) { + this.tiAlgoRappr = tiAlgoRappr; + } + + @Column(name = "TI_OUTPUT_RAPPR") + public String getTiOutputRappr() { + return this.tiOutputRappr; + } + + public void setTiOutputRappr(String tiOutputRappr) { + this.tiOutputRappr = tiOutputRappr; + } + + // bi-directional many-to-one association to DecFormatoFileDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FORMATO_CONTENUTO") + @XmlInverseReference(mappedBy = "decTipoRapprCompConts") + public DecFormatoFileDoc getDecFormatoFileDocCont() { + return this.decFormatoFileDocCont; + } + + public void setDecFormatoFileDocCont(DecFormatoFileDoc decFormatoFileDoc) { + this.decFormatoFileDocCont = decFormatoFileDoc; + } + + // bi-directional many-to-one association to DecFormatoFileDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FORMATO_CONVERTIT") + @XmlInverseReference(mappedBy = "decTipoRapprCompConvs") + public DecFormatoFileDoc getDecFormatoFileDocConv() { + return this.decFormatoFileDocConv; + } + + public void setDecFormatoFileDocConv(DecFormatoFileDoc decFormatoFileDoc) { + this.decFormatoFileDocConv = decFormatoFileDoc; + } + + // bi-directional many-to-one association to DecFormatoFileStandard + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FORMATO_OUTPUT_RAPPR") + public // @XmlInverseReference(mappedBy = "decTipoRapprComps") + DecFormatoFileStandard getDecFormatoFileStandard() { + return this.decFormatoFileStandard; + } + + public void setDecFormatoFileStandard(DecFormatoFileStandard decFormatoFileStandard) { + this.decFormatoFileStandard = decFormatoFileStandard; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoStrutDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoStrutDoc.java new file mode 100644 index 0000000..206c605 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoStrutDoc.java @@ -0,0 +1,159 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Cacheable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.xml.bind.annotation.XmlTransient; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_TIPO_STRUT_DOC database table. + */ +@Entity +@Cacheable(true) +@Table(name = "DEC_TIPO_STRUT_DOC") +public class DecTipoStrutDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idTipoStrutDoc; + + private String dsTipoStrutDoc; + + private Date dtIstituz; + + private Date dtSoppres; + + private String nmTipoStrutDoc; + + private List aroStrutDocs = new ArrayList<>(); + + private List decTipoCompDocs = new ArrayList<>(); + + private OrgStrut orgStrut; + + public DecTipoStrutDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_TIPO_STRUT_DOC") + @GenericGenerator(name = "SDEC_TIPO_STRUT_DOC_ID_TIPO_STRUT_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_TIPO_STRUT_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_TIPO_STRUT_DOC_ID_TIPO_STRUT_DOC_GENERATOR") + public Long getIdTipoStrutDoc() { + return this.idTipoStrutDoc; + } + + public void setIdTipoStrutDoc(Long idTipoStrutDoc) { + this.idTipoStrutDoc = idTipoStrutDoc; + } + + @Column(name = "DS_TIPO_STRUT_DOC") + public String getDsTipoStrutDoc() { + return this.dsTipoStrutDoc; + } + + public void setDsTipoStrutDoc(String dsTipoStrutDoc) { + this.dsTipoStrutDoc = dsTipoStrutDoc; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + @Column(name = "NM_TIPO_STRUT_DOC") + public String getNmTipoStrutDoc() { + return this.nmTipoStrutDoc; + } + + public void setNmTipoStrutDoc(String nmTipoStrutDoc) { + this.nmTipoStrutDoc = nmTipoStrutDoc; + } + + // bi-directional many-to-one association to AroStrutDoc + @OneToMany(mappedBy = "decTipoStrutDoc") + @XmlTransient + public List getAroStrutDocs() { + return this.aroStrutDocs; + } + + public void setAroStrutDocs(List aroStrutDocs) { + this.aroStrutDocs = aroStrutDocs; + } + + // bi-directional many-to-one association to DecTipoCompDoc + @OneToMany(mappedBy = "decTipoStrutDoc", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + public List getDecTipoCompDocs() { + return this.decTipoCompDocs; + } + + public void setDecTipoCompDocs(List decTipoCompDocs) { + this.decTipoCompDocs = decTipoCompDocs; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + @XmlInverseReference(mappedBy = "decTipoStrutDocs") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoUnitaDoc.java new file mode 100644 index 0000000..be9f1f5 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoUnitaDoc.java @@ -0,0 +1,329 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Cacheable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.PrePersist; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlTransient; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_TIPO_UNITA_DOC database table. + */ +@Entity +@Cacheable(true) +@Table(name = "DEC_TIPO_UNITA_DOC") +public class DecTipoUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idTipoUnitaDoc; + + private String cdSerie; + + private String cdSerieDaCreare; + + private String dlNoteTipoUd; + + private String dsSerieDaCreare; + + private String dsTipoSerieDaCreare; + + private String dsTipoUnitaDoc; + + private Date dtIstituz; + + private Date dtSoppres; + + private String flCreaTipoSerieStandard; + + private String flVersManuale; + + private String nmTipoSerieDaCreare; + + private String nmTipoUnitaDoc; + + private String tiSaveFile; + + private List aroUnitaDocs = new ArrayList<>(); + + private List decAttribDatiSpecs = new ArrayList<>(); + + private OrgStrut orgStrut; + + private List decTipoUnitaDocAmmessos = new ArrayList<>(); + + private List decXsdDatiSpecs = new ArrayList<>(); + + private List orgRegolaValSubStruts = new ArrayList<>(); + + private List decUsoModelloXsdUniDocs = new ArrayList<>(); + + public DecTipoUnitaDoc() { + // hibernate + } + + @Id + @Column(name = "ID_TIPO_UNITA_DOC") + @XmlID + @GenericGenerator(name = "SDEC_TIPO_UNITA_DOC_ID_TIPO_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_TIPO_UNITA_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_TIPO_UNITA_DOC_ID_TIPO_UNITA_DOC_GENERATOR") + public Long getIdTipoUnitaDoc() { + return this.idTipoUnitaDoc; + } + + public void setIdTipoUnitaDoc(Long idTipoUnitaDoc) { + this.idTipoUnitaDoc = idTipoUnitaDoc; + } + + @Column(name = "CD_SERIE") + public String getCdSerie() { + return this.cdSerie; + } + + public void setCdSerie(String cdSerie) { + this.cdSerie = cdSerie; + } + + @Column(name = "CD_SERIE_DA_CREARE") + public String getCdSerieDaCreare() { + return this.cdSerieDaCreare; + } + + public void setCdSerieDaCreare(String cdSerieDaCreare) { + this.cdSerieDaCreare = cdSerieDaCreare; + } + + @Column(name = "DL_NOTE_TIPO_UD") + public String getDlNoteTipoUd() { + return this.dlNoteTipoUd; + } + + public void setDlNoteTipoUd(String dlNoteTipoUd) { + this.dlNoteTipoUd = dlNoteTipoUd; + } + + @Column(name = "DS_SERIE_DA_CREARE") + public String getDsSerieDaCreare() { + return this.dsSerieDaCreare; + } + + public void setDsSerieDaCreare(String dsSerieDaCreare) { + this.dsSerieDaCreare = dsSerieDaCreare; + } + + @Column(name = "DS_TIPO_SERIE_DA_CREARE") + public String getDsTipoSerieDaCreare() { + return this.dsTipoSerieDaCreare; + } + + public void setDsTipoSerieDaCreare(String dsTipoSerieDaCreare) { + this.dsTipoSerieDaCreare = dsTipoSerieDaCreare; + } + + @Column(name = "DS_TIPO_UNITA_DOC") + public String getDsTipoUnitaDoc() { + return this.dsTipoUnitaDoc; + } + + public void setDsTipoUnitaDoc(String dsTipoUnitaDoc) { + this.dsTipoUnitaDoc = dsTipoUnitaDoc; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + // effettivamente mappato come varchar su DB + @Column(name = "FL_CREA_TIPO_SERIE_STANDARD") + public String getFlCreaTipoSerieStandard() { + return this.flCreaTipoSerieStandard; + } + + public void setFlCreaTipoSerieStandard(String flCreaTipoSerieStandard) { + this.flCreaTipoSerieStandard = flCreaTipoSerieStandard; + } + + @Column(name = "FL_VERS_MANUALE", columnDefinition = "char(1)") + public String getFlVersManuale() { + return this.flVersManuale; + } + + public void setFlVersManuale(String flVersManuale) { + this.flVersManuale = flVersManuale; + } + + @Column(name = "NM_TIPO_SERIE_DA_CREARE") + public String getNmTipoSerieDaCreare() { + return this.nmTipoSerieDaCreare; + } + + public void setNmTipoSerieDaCreare(String nmTipoSerieDaCreare) { + this.nmTipoSerieDaCreare = nmTipoSerieDaCreare; + } + + @Column(name = "NM_TIPO_UNITA_DOC") + public String getNmTipoUnitaDoc() { + return this.nmTipoUnitaDoc; + } + + public void setNmTipoUnitaDoc(String nmTipoUnitaDoc) { + this.nmTipoUnitaDoc = nmTipoUnitaDoc; + } + + @Column(name = "TI_SAVE_FILE") + public String getTiSaveFile() { + return this.tiSaveFile; + } + + public void setTiSaveFile(String tiSaveFile) { + this.tiSaveFile = tiSaveFile; + } + + // bi-directional many-to-one association to AroUnitaDoc + @OneToMany(mappedBy = "decTipoUnitaDoc") + @XmlTransient + public List getAroUnitaDocs() { + return this.aroUnitaDocs; + } + + public void setAroUnitaDocs(List aroUnitaDocs) { + this.aroUnitaDocs = aroUnitaDocs; + } + + // bi-directional many-to-one association to DecAttribDatiSpec + @OneToMany(mappedBy = "decTipoUnitaDoc", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + @XmlIDREF + public List getDecAttribDatiSpecs() { + return this.decAttribDatiSpecs; + } + + public void setDecAttribDatiSpecs(List decAttribDatiSpecs) { + this.decAttribDatiSpecs = decAttribDatiSpecs; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + @XmlInverseReference(mappedBy = "decTipoUnitaDocs") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to DecTipoUnitaDocAmmesso + @OneToMany(mappedBy = "decTipoUnitaDoc", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + @XmlIDREF + public List getDecTipoUnitaDocAmmessos() { + return this.decTipoUnitaDocAmmessos; + } + + public void setDecTipoUnitaDocAmmessos(List decTipoUnitaDocAmmessos) { + this.decTipoUnitaDocAmmessos = decTipoUnitaDocAmmessos; + } + + // bi-directional many-to-one association to DecXsdDatiSpec + @OneToMany(mappedBy = "decTipoUnitaDoc", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + @XmlIDREF + public List getDecXsdDatiSpecs() { + return this.decXsdDatiSpecs; + } + + public void setDecXsdDatiSpecs(List decXsdDatiSpecs) { + this.decXsdDatiSpecs = decXsdDatiSpecs; + } + + // bi-directional many-to-one association to OrgRegolaValSubStrut + @OneToMany(mappedBy = "decTipoUnitaDoc", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + public List getOrgRegolaValSubStruts() { + return this.orgRegolaValSubStruts; + } + + public void setOrgRegolaValSubStruts(List orgRegolaValSubStruts) { + this.orgRegolaValSubStruts = orgRegolaValSubStruts; + } + + // bi-directional many-to-one association to DecTipoRapprAmmesso + @OneToMany(mappedBy = "decTipoUnitaDoc", cascade = CascadeType.PERSIST) + @XmlTransient + public List getDecUsoModelloXsdUniDocs() { + return this.decUsoModelloXsdUniDocs; + } + + public void setDecUsoModelloXsdUniDocs(List decUsoModelloXsdUniDocs) { + this.decUsoModelloXsdUniDocs = decUsoModelloXsdUniDocs; + } + + /** + * Gestione dei default. Risulta la migliore pratica in quanto è indipendente dal db utilizzato e sfrutta diretta + * JPA quindi calabile sotto ogni contesto in termini di ORM + * + * ref. https://stackoverflow.com/a/13432234 + */ + @PrePersist + void preInsert() { + if (this.flVersManuale == null) { + this.flVersManuale = "0"; + } + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoUnitaDocAmmesso.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoUnitaDocAmmesso.java new file mode 100644 index 0000000..60199df --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTipoUnitaDocAmmesso.java @@ -0,0 +1,98 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Cacheable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlIDREF; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_TIPO_UNITA_DOC_AMMESSO database table. + */ +@Entity +@Cacheable(true) +@Table(name = "DEC_TIPO_UNITA_DOC_AMMESSO") +public class DecTipoUnitaDocAmmesso implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idTipoUnitaDocAmmesso; + + private DecRegistroUnitaDoc decRegistroUnitaDoc; + + private DecTipoUnitaDoc decTipoUnitaDoc; + + public DecTipoUnitaDocAmmesso() {/* Hibernate */ + } + + @Id + @Column(name = "ID_TIPO_UNITA_DOC_AMMESSO") + @XmlID + @GenericGenerator(name = "SDEC_TIPO_UNITA_DOC_AMMESSO_ID_TIPO_UNITA_DOC_AMMESSO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_TIPO_UNITA_DOC_AMMESSO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_TIPO_UNITA_DOC_AMMESSO_ID_TIPO_UNITA_DOC_AMMESSO_GENERATOR") + public Long getIdTipoUnitaDocAmmesso() { + return this.idTipoUnitaDocAmmesso; + } + + public void setIdTipoUnitaDocAmmesso(Long idTipoUnitaDocAmmesso) { + this.idTipoUnitaDocAmmesso = idTipoUnitaDocAmmesso; + } + + // bi-directional many-to-one association to DecRegistroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_REGISTRO_UNITA_DOC") + @XmlInverseReference(mappedBy = "decTipoUnitaDocAmmessos") + public DecRegistroUnitaDoc getDecRegistroUnitaDoc() { + return this.decRegistroUnitaDoc; + } + + public void setDecRegistroUnitaDoc(DecRegistroUnitaDoc decRegistroUnitaDoc) { + this.decRegistroUnitaDoc = decRegistroUnitaDoc; + } + + // bi-directional many-to-one association to DecTipoUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_UNITA_DOC") + // @XmlInverseReference(mappedBy = "decTipoUnitaDocAmmessos") + @XmlIDREF + public DecTipoUnitaDoc getDecTipoUnitaDoc() { + return this.decTipoUnitaDoc; + } + + public void setDecTipoUnitaDoc(DecTipoUnitaDoc decTipoUnitaDoc) { + this.decTipoUnitaDoc = decTipoUnitaDoc; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTitol.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTitol.java new file mode 100644 index 0000000..ef5a7a8 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecTitol.java @@ -0,0 +1,188 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_TITOL database table. + */ +@Entity +@Table(name = "DEC_TITOL") +public class DecTitol implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idTitol; + + private String cdSepFascicolo; + + private String dlNote; + + private Date dtIstituz; + + private Date dtSoppres; + + private BigDecimal niLivelli; + + private String nmTitol; + + private String tiStatoTitol; + + private List decLivelloTitols = new ArrayList<>(); + + private OrgStrut orgStrut; + + private List decVoceTitols = new ArrayList<>(); + + public DecTitol() {/* Hibernate */ + } + + @Id + @Column(name = "ID_TITOL") + @GenericGenerator(name = "SDEC_TITOL_ID_TITOL_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_TITOL"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_TITOL_ID_TITOL_GENERATOR") + public Long getIdTitol() { + return this.idTitol; + } + + public void setIdTitol(Long idTitol) { + this.idTitol = idTitol; + } + + @Column(name = "CD_SEP_FASCICOLO", columnDefinition = "char") + public String getCdSepFascicolo() { + return this.cdSepFascicolo; + } + + public void setCdSepFascicolo(String cdSepFascicolo) { + this.cdSepFascicolo = cdSepFascicolo; + } + + @Column(name = "DL_NOTE") + public String getDlNote() { + return this.dlNote; + } + + public void setDlNote(String dlNote) { + this.dlNote = dlNote; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + @Column(name = "NI_LIVELLI") + public BigDecimal getNiLivelli() { + return this.niLivelli; + } + + public void setNiLivelli(BigDecimal niLivelli) { + this.niLivelli = niLivelli; + } + + @Column(name = "NM_TITOL") + public String getNmTitol() { + return this.nmTitol; + } + + public void setNmTitol(String nmTitol) { + this.nmTitol = nmTitol; + } + + @Column(name = "TI_STATO_TITOL") + public String getTiStatoTitol() { + return this.tiStatoTitol; + } + + public void setTiStatoTitol(String tiStatoTitol) { + this.tiStatoTitol = tiStatoTitol; + } + + // bi-directional many-to-one association to DecLivelloTitol + @OneToMany(mappedBy = "decTitol", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + public List getDecLivelloTitols() { + return this.decLivelloTitols; + } + + public void setDecLivelloTitols(List decLivelloTitols) { + this.decLivelloTitols = decLivelloTitols; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to DecVoceTitol + @OneToMany(mappedBy = "decTitol", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + public List getDecVoceTitols() { + return this.decVoceTitols; + } + + public void setDecVoceTitols(List decVoceTitols) { + this.decVoceTitols = decVoceTitols; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoFormatoFileStandard.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoFormatoFileStandard.java new file mode 100644 index 0000000..cee6dc8 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoFormatoFileStandard.java @@ -0,0 +1,106 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Cacheable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_USO_FORMATO_FILE_STANDARD database table. + */ +@Entity +@Cacheable(true) +@Table(name = "DEC_USO_FORMATO_FILE_STANDARD") +public class DecUsoFormatoFileStandard implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUsoFormatoFileAmmesso; + + private BigDecimal niOrdUso; + + private DecFormatoFileDoc decFormatoFileDoc; + + private DecFormatoFileStandard decFormatoFileStandard; + + public DecUsoFormatoFileStandard() {/* Hibernate */ + } + + @Id + @Column(name = "ID_USO_FORMATO_FILE_AMMESSO") + @GenericGenerator(name = "SDEC_USO_FORMATO_FILE_STANDARD_ID_USO_FORMATO_FILE_AMMESSO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_USO_FORMATO_FILE_STANDARD"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_USO_FORMATO_FILE_STANDARD_ID_USO_FORMATO_FILE_AMMESSO_GENERATOR") + public Long getIdUsoFormatoFileAmmesso() { + return this.idUsoFormatoFileAmmesso; + } + + public void setIdUsoFormatoFileAmmesso(Long idUsoFormatoFileAmmesso) { + this.idUsoFormatoFileAmmesso = idUsoFormatoFileAmmesso; + } + + @Column(name = "NI_ORD_USO") + public BigDecimal getNiOrdUso() { + return this.niOrdUso; + } + + public void setNiOrdUso(BigDecimal niOrdUso) { + this.niOrdUso = niOrdUso; + } + + // bi-directional many-to-one association to DecFormatoFileDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FORMATO_FILE_DOC") + @XmlInverseReference(mappedBy = "decUsoFormatoFileStandards") + public DecFormatoFileDoc getDecFormatoFileDoc() { + return this.decFormatoFileDoc; + } + + public void setDecFormatoFileDoc(DecFormatoFileDoc decFormatoFileDoc) { + this.decFormatoFileDoc = decFormatoFileDoc; + } + + // bi-directional many-to-one association to DecFormatoFileStandard + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FORMATO_FILE_STANDARD") + public DecFormatoFileStandard getDecFormatoFileStandard() { + return this.decFormatoFileStandard; + } + + public void setDecFormatoFileStandard(DecFormatoFileStandard decFormatoFileStandard) { + this.decFormatoFileStandard = decFormatoFileStandard; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdCompDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdCompDoc.java new file mode 100644 index 0000000..c84e779 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdCompDoc.java @@ -0,0 +1,123 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_USO_MODELLO_XSD_COMP_DOC database table. + * + */ +@Entity +@Table(name = "DEC_USO_MODELLO_XSD_COMP_DOC") +public class DecUsoModelloXsdCompDoc implements Serializable { + private static final long serialVersionUID = 1L; + private Long idUsoModelloXsdCompDoc; + private String flStandard; + private Date dtIstituz; + private Date dtSoppres; + private DecModelloXsdUd decModelloXsdUd; + private DecTipoCompDoc decTipoCompDoc; + + public DecUsoModelloXsdCompDoc() { + // hibernate + } + + @Id + @GenericGenerator(name = "DEC_USO_MODELLO_XSD_COMP_DOC_IDUSOMODELLOXSDCOMPDOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_USO_MODELLO_XSD_COMP_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "DEC_USO_MODELLO_XSD_COMP_DOC_IDUSOMODELLOXSDCOMPDOC_GENERATOR") + @Column(name = "ID_USO_MODELLO_XSD_COMP_DOC") + public Long getIdUsoModelloXsdCompDoc() { + return this.idUsoModelloXsdCompDoc; + } + + public void setIdUsoModelloXsdCompDoc(Long idUsoModelloXsdCompDoc) { + this.idUsoModelloXsdCompDoc = idUsoModelloXsdCompDoc; + } + + @Column(name = "FL_STANDARD", columnDefinition = "CHAR") + public String getFlStandard() { + return this.flStandard; + } + + public void setFlStandard(String flStandard) { + this.flStandard = flStandard; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + // bi-directional many-to-one association to DecAaTipoFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_MODELLO_XSD_UD") + public DecModelloXsdUd getDecModelloXsdUd() { + return this.decModelloXsdUd; + } + + public void setDecModelloXsdUd(DecModelloXsdUd decModelloXsdUd) { + this.decModelloXsdUd = decModelloXsdUd; + } + + // bi-directional many-to-one association to DecModelloXsdFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_COMP_DOC") + public DecTipoCompDoc getDecTipoCompDoc() { + return this.decTipoCompDoc; + } + + public void setDecTipoCompDoc(DecTipoCompDoc decTipoCompDoc) { + this.decTipoCompDoc = decTipoCompDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdDoc.java new file mode 100644 index 0000000..8f50f3d --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdDoc.java @@ -0,0 +1,125 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_USO_MODELLO_XSD_DOC database table. + * + */ +@Entity +@Table(name = "DEC_USO_MODELLO_XSD_DOC") +public class DecUsoModelloXsdDoc implements Serializable { + private static final long serialVersionUID = 1L; + private Long idUsoModelloXsdDoc; + private String flStandard; + private Date dtIstituz; + private Date dtSoppres; + private DecModelloXsdUd decModelloXsdUd; + private DecTipoDoc decTipoDoc; + + public DecUsoModelloXsdDoc() { + // hibernate + } + + @Id + @GenericGenerator(name = "DEC_USO_MODELLO_XSD_DOC_IDUSOMODELLOXSDDOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_USO_MODELLO_XSD_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "DEC_USO_MODELLO_XSD_DOC_IDUSOMODELLOXSDDOC_GENERATOR") + @Column(name = "ID_USO_MODELLO_XSD_DOC") + public Long getIdUsoModelloXsdDoc() { + return this.idUsoModelloXsdDoc; + } + + public void setIdUsoModelloXsdDoc(Long idUsoModelloXsdDoc) { + this.idUsoModelloXsdDoc = idUsoModelloXsdDoc; + } + + @Column(name = "FL_STANDARD", columnDefinition = "CHAR") + public String getFlStandard() { + return this.flStandard; + } + + public void setFlStandard(String flStandard) { + this.flStandard = flStandard; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + // bi-directional many-to-one association to DecAaTipoFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_MODELLO_XSD_UD") + public DecModelloXsdUd getDecModelloXsdUd() { + return this.decModelloXsdUd; + } + + public void setDecModelloXsdUd(DecModelloXsdUd decModelloXsdUd) { + this.decModelloXsdUd = decModelloXsdUd; + } + + // bi-directional many-to-one association to DecModelloXsdFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_DOC") + @XmlInverseReference(mappedBy = "decUsoModelloXsdDocs") + public DecTipoDoc getDecTipoDoc() { + return this.decTipoDoc; + } + + public void setDecTipoDoc(DecTipoDoc decTipoDoc) { + this.decTipoDoc = decTipoDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdFasc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdFasc.java new file mode 100644 index 0000000..f466845 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdFasc.java @@ -0,0 +1,119 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.*; +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.id.enhanced.SequenceStyleGenerator; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; + +/** + * The persistent class for the DEC_USO_MODELLO_XSD_FASC database table. + */ +@Entity +@Table(name = "DEC_USO_MODELLO_XSD_FASC") +public class DecUsoModelloXsdFasc implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUsoModelloXsdFasc; + + private String flStandard; + + private DecAaTipoFascicolo decAaTipoFascicolo; + + private DecModelloXsdFascicolo decModelloXsdFascicolo; + + private Date dtIstituz; + + private Date dtSoppres; + + public DecUsoModelloXsdFasc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_USO_MODELLO_XSD_FASC") + @GenericGenerator(name = "SDEC_USO_MODELLO_XSD_FASC_ID_USO_MODELLO_XSD_FASC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_USO_MODELLO_XSD_FASC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_USO_MODELLO_XSD_FASC_ID_USO_MODELLO_XSD_FASC_GENERATOR") + public Long getIdUsoModelloXsdFasc() { + return this.idUsoModelloXsdFasc; + } + + public void setIdUsoModelloXsdFasc(Long idUsoModelloXsdFasc) { + this.idUsoModelloXsdFasc = idUsoModelloXsdFasc; + } + + @Column(name = "FL_STANDARD", columnDefinition = "char(1)") + public String getFlStandard() { + return this.flStandard; + } + + public void setFlStandard(String flStandard) { + this.flStandard = flStandard; + } + + // bi-directional many-to-one association to DecAaTipoFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_AA_TIPO_FASCICOLO") + @XmlInverseReference(mappedBy = "decUsoModelloXsdFascs") + public DecAaTipoFascicolo getDecAaTipoFascicolo() { + return this.decAaTipoFascicolo; + } + + public void setDecAaTipoFascicolo(DecAaTipoFascicolo decAaTipoFascicolo) { + this.decAaTipoFascicolo = decAaTipoFascicolo; + } + + // bi-directional many-to-one association to DecModelloXsdFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_MODELLO_XSD_FASCICOLO") + public DecModelloXsdFascicolo getDecModelloXsdFascicolo() { + return this.decModelloXsdFascicolo; + } + + public void setDecModelloXsdFascicolo(DecModelloXsdFascicolo decModelloXsdFascicolo) { + this.decModelloXsdFascicolo = decModelloXsdFascicolo; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdUniDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdUniDoc.java new file mode 100644 index 0000000..2215dcd --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecUsoModelloXsdUniDoc.java @@ -0,0 +1,123 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_USO_MODELLO_XSD_UNI_DOC database table. + * + */ +@Entity +@Table(name = "DEC_USO_MODELLO_XSD_UNI_DOC") +public class DecUsoModelloXsdUniDoc implements Serializable { + private static final long serialVersionUID = 1L; + private Long idUsoModelloXsdUniDoc; + private String flStandard; + private Date dtIstituz; + private Date dtSoppres; + private DecModelloXsdUd decModelloXsdUd; + private DecTipoUnitaDoc decTipoUnitaDoc; + + public DecUsoModelloXsdUniDoc() { + // hibernate + } + + @Id + @GenericGenerator(name = "DEC_USO_MODELLO_XSD_UNI_DOC_IDUSOMODELLOXSDUNIDOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_USO_MODELLO_XSD_UNI_DOC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "DEC_USO_MODELLO_XSD_UNI_DOC_IDUSOMODELLOXSDUNIDOC_GENERATOR") + @Column(name = "ID_USO_MODELLO_XSD_UNI_DOC") + public Long getIdUsoModelloXsdUniDoc() { + return this.idUsoModelloXsdUniDoc; + } + + public void setIdUsoModelloXsdUniDoc(Long idUsoModelloXsdUniDoc) { + this.idUsoModelloXsdUniDoc = idUsoModelloXsdUniDoc; + } + + @Column(name = "FL_STANDARD", columnDefinition = "CHAR") + public String getFlStandard() { + return this.flStandard; + } + + public void setFlStandard(String flStandard) { + this.flStandard = flStandard; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + // bi-directional many-to-one association to DecAaTipoFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_MODELLO_XSD_UD") + public DecModelloXsdUd getDecModelloXsdUd() { + return this.decModelloXsdUd; + } + + public void setDecModelloXsdUd(DecModelloXsdUd decModelloXsdUd) { + this.decModelloXsdUd = decModelloXsdUd; + } + + // bi-directional many-to-one association to DecModelloXsdFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_UNITA_DOC") + public DecTipoUnitaDoc getDecTipoUnitaDoc() { + return this.decTipoUnitaDoc; + } + + public void setDecTipoUnitaDoc(DecTipoUnitaDoc decTipoUnitaDoc) { + this.decTipoUnitaDoc = decTipoUnitaDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecValVoceTitol.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecValVoceTitol.java new file mode 100644 index 0000000..83ecf90 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecValVoceTitol.java @@ -0,0 +1,149 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_VAL_VOCE_TITOL database table. + */ +@Entity +@Table(name = "DEC_VAL_VOCE_TITOL") +public class DecValVoceTitol implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idValVoceTitol; + + private String dlNote; + + private String dsVoceTitol; + + private Date dtFinVal; + + private Date dtIniVal; + + private String flUsoClassif; + + private BigDecimal niAnniConserv; + + private DecVoceTitol decVoceTitol; + + public DecValVoceTitol() {/* Hibernate */ + } + + @Id + @Column(name = "ID_VAL_VOCE_TITOL") + @GenericGenerator(name = "SDEC_VAL_VOCE_TITOL_ID_VAL_VOCE_TITOL_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_VAL_VOCE_TITOL"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_VAL_VOCE_TITOL_ID_VAL_VOCE_TITOL_GENERATOR") + public Long getIdValVoceTitol() { + return this.idValVoceTitol; + } + + public void setIdValVoceTitol(Long idValVoceTitol) { + this.idValVoceTitol = idValVoceTitol; + } + + @Column(name = "DL_NOTE") + public String getDlNote() { + return this.dlNote; + } + + public void setDlNote(String dlNote) { + this.dlNote = dlNote; + } + + @Column(name = "DS_VOCE_TITOL") + public String getDsVoceTitol() { + return this.dsVoceTitol; + } + + public void setDsVoceTitol(String dsVoceTitol) { + this.dsVoceTitol = dsVoceTitol; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_FIN_VAL") + public Date getDtFinVal() { + return this.dtFinVal; + } + + public void setDtFinVal(Date dtFinVal) { + this.dtFinVal = dtFinVal; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_INI_VAL") + public Date getDtIniVal() { + return this.dtIniVal; + } + + public void setDtIniVal(Date dtIniVal) { + this.dtIniVal = dtIniVal; + } + + @Column(name = "FL_USO_CLASSIF", columnDefinition = "char(1)") + public String getFlUsoClassif() { + return this.flUsoClassif; + } + + public void setFlUsoClassif(String flUsoClassif) { + this.flUsoClassif = flUsoClassif; + } + + @Column(name = "NI_ANNI_CONSERV") + public BigDecimal getNiAnniConserv() { + return this.niAnniConserv; + } + + public void setNiAnniConserv(BigDecimal niAnniConserv) { + this.niAnniConserv = niAnniConserv; + } + + // bi-directional many-to-one association to DecVoceTitol + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_VOCE_TITOL") + public DecVoceTitol getDecVoceTitol() { + return this.decVoceTitol; + } + + public void setDecVoceTitol(DecVoceTitol decVoceTitol) { + this.decVoceTitol = decVoceTitol; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecVoceTitol.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecVoceTitol.java new file mode 100644 index 0000000..e214302 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecVoceTitol.java @@ -0,0 +1,211 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_VOCE_TITOL database table. + */ +@Entity +@Table(name = "DEC_VOCE_TITOL") +public class DecVoceTitol implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idVoceTitol; + + private String cdCompositoVoceTitol; + + private String cdVoceTitol; + + private Date dtIstituz; + + private Date dtSoppres; + + private BigDecimal niFascic; + + private BigDecimal niFascicVociFiglie; + + private BigDecimal niOrdVoceTitol; + private List decValVoceTitols = new ArrayList<>(); + private DecLivelloTitol decLivelloTitol; + + private DecTitol decTitol; + + private DecVoceTitol decVoceTitol; + private List decVoceTitols = new ArrayList<>(); + + public DecVoceTitol() {/* Hibernate */ + } + + @Id + @Column(name = "ID_VOCE_TITOL") + @GenericGenerator(name = "SDEC_VOCE_TITOL_ID_VOCE_TITOL_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_VOCE_TITOL"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_VOCE_TITOL_ID_VOCE_TITOL_GENERATOR") + public Long getIdVoceTitol() { + return this.idVoceTitol; + } + + public void setIdVoceTitol(Long idVoceTitol) { + this.idVoceTitol = idVoceTitol; + } + + @Column(name = "CD_COMPOSITO_VOCE_TITOL") + public String getCdCompositoVoceTitol() { + return this.cdCompositoVoceTitol; + } + + public void setCdCompositoVoceTitol(String cdCompositoVoceTitol) { + this.cdCompositoVoceTitol = cdCompositoVoceTitol; + } + + @Column(name = "CD_VOCE_TITOL") + public String getCdVoceTitol() { + return this.cdVoceTitol; + } + + public void setCdVoceTitol(String cdVoceTitol) { + this.cdVoceTitol = cdVoceTitol; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + @Column(name = "NI_FASCIC") + public BigDecimal getNiFascic() { + return this.niFascic; + } + + public void setNiFascic(BigDecimal niFascic) { + this.niFascic = niFascic; + } + + @Column(name = "NI_FASCIC_VOCI_FIGLIE") + public BigDecimal getNiFascicVociFiglie() { + return this.niFascicVociFiglie; + } + + public void setNiFascicVociFiglie(BigDecimal niFascicVociFiglie) { + this.niFascicVociFiglie = niFascicVociFiglie; + } + + @Column(name = "NI_ORD_VOCE_TITOL") + public BigDecimal getNiOrdVoceTitol() { + return this.niOrdVoceTitol; + } + + public void setNiOrdVoceTitol(BigDecimal niOrdVoceTitol) { + this.niOrdVoceTitol = niOrdVoceTitol; + } + + // bi-directional many-to-one association to DecValVoceTitol + @OneToMany(mappedBy = "decVoceTitol", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + public List getDecValVoceTitols() { + return this.decValVoceTitols; + } + + public void setDecValVoceTitols(List decValVoceTitols) { + this.decValVoceTitols = decValVoceTitols; + } + + // bi-directional many-to-one association to DecLivelloTitol + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_LIVELLO_TITOL") + public DecLivelloTitol getDecLivelloTitol() { + return this.decLivelloTitol; + } + + public void setDecLivelloTitol(DecLivelloTitol decLivelloTitol) { + this.decLivelloTitol = decLivelloTitol; + } + + // bi-directional many-to-one association to DecTitol + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TITOL") + public DecTitol getDecTitol() { + return this.decTitol; + } + + public void setDecTitol(DecTitol decTitol) { + this.decTitol = decTitol; + } + + // bi-directional many-to-one association to DecVoceTitol + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_VOCE_TITOL_PADRE") + public DecVoceTitol getDecVoceTitol() { + return this.decVoceTitol; + } + + public void setDecVoceTitol(DecVoceTitol decVoceTitol) { + this.decVoceTitol = decVoceTitol; + } + + // bi-directional many-to-one association to DecVoceTitol + @OneToMany(mappedBy = "decVoceTitol") + public List getDecVoceTitols() { + return this.decVoceTitols; + } + + public void setDecVoceTitols(List decVoceTitols) { + this.decVoceTitols = decVoceTitols; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecWarnAaRegistroUd.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecWarnAaRegistroUd.java new file mode 100644 index 0000000..f247967 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecWarnAaRegistroUd.java @@ -0,0 +1,99 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_WARN_AA_REGISTRO_UD database table. + */ +@Entity +@Table(name = "DEC_WARN_AA_REGISTRO_UD") +public class DecWarnAaRegistroUd implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idWarnAaRegistroUnitaDoc; + + private BigDecimal aaRegistroUnitaDoc; + + private String flWarnAaRegistroUnitaDoc; + + private DecAaRegistroUnitaDoc decAaRegistroUnitaDoc; + + public DecWarnAaRegistroUd() {/* Hibernate */ + } + + @Id + @Column(name = "ID_WARN_AA_REGISTRO_UNITA_DOC") + @GenericGenerator(name = "SDEC_WARN_AA_REGISTRO_UD_ID_WARN_AA_REGISTRO_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_WARN_AA_REGISTRO_UD"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_WARN_AA_REGISTRO_UD_ID_WARN_AA_REGISTRO_UNITA_DOC_GENERATOR") + public Long getIdWarnAaRegistroUnitaDoc() { + return this.idWarnAaRegistroUnitaDoc; + } + + public void setIdWarnAaRegistroUnitaDoc(Long idWarnAaRegistroUnitaDoc) { + this.idWarnAaRegistroUnitaDoc = idWarnAaRegistroUnitaDoc; + } + + @Column(name = "AA_REGISTRO_UNITA_DOC") + public BigDecimal getAaRegistroUnitaDoc() { + return this.aaRegistroUnitaDoc; + } + + public void setAaRegistroUnitaDoc(BigDecimal aaRegistroUnitaDoc) { + this.aaRegistroUnitaDoc = aaRegistroUnitaDoc; + } + + @Column(name = "FL_WARN_AA_REGISTRO_UNITA_DOC", columnDefinition = "char(1)") + public String getFlWarnAaRegistroUnitaDoc() { + return this.flWarnAaRegistroUnitaDoc; + } + + public void setFlWarnAaRegistroUnitaDoc(String flWarnAaRegistroUnitaDoc) { + this.flWarnAaRegistroUnitaDoc = flWarnAaRegistroUnitaDoc; + } + + // bi-directional many-to-one association to DecAaRegistroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_AA_REGISTRO_UNITA_DOC") + public DecAaRegistroUnitaDoc getDecAaRegistroUnitaDoc() { + return this.decAaRegistroUnitaDoc; + } + + public void setDecAaRegistroUnitaDoc(DecAaRegistroUnitaDoc decAaRegistroUnitaDoc) { + this.decAaRegistroUnitaDoc = decAaRegistroUnitaDoc; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecWarnAaTipoFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecWarnAaTipoFascicolo.java new file mode 100644 index 0000000..a002924 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecWarnAaTipoFascicolo.java @@ -0,0 +1,100 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_WARN_AA_TIPO_FASCICOLO database table. + */ +@Entity +@Table(name = "DEC_WARN_AA_TIPO_FASCICOLO") +public class DecWarnAaTipoFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idWarnAaTipoFascicolo; + + private BigDecimal aaTipoFascicolo; + + private String flWarnAaTipoFascicolo; + + private DecAaTipoFascicolo decAaTipoFascicolo; + + public DecWarnAaTipoFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_WARN_AA_TIPO_FASCICOLO") + @GenericGenerator(name = "SDEC_WARN_AA_TIPO_FASCICOLO_ID_WARN_AA_TIPO_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_WARN_AA_TIPO_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_WARN_AA_TIPO_FASCICOLO_ID_WARN_AA_TIPO_FASCICOLO_GENERATOR") + public Long getIdWarnAaTipoFascicolo() { + return this.idWarnAaTipoFascicolo; + } + + public void setIdWarnAaTipoFascicolo(Long idWarnAaTipoFascicolo) { + this.idWarnAaTipoFascicolo = idWarnAaTipoFascicolo; + } + + @Column(name = "AA_TIPO_FASCICOLO") + public BigDecimal getAaTipoFascicolo() { + return this.aaTipoFascicolo; + } + + public void setAaTipoFascicolo(BigDecimal aaTipoFascicolo) { + this.aaTipoFascicolo = aaTipoFascicolo; + } + + @Column(name = "FL_WARN_AA_TIPO_FASCICOLO", columnDefinition = "char(1)") + public String getFlWarnAaTipoFascicolo() { + return this.flWarnAaTipoFascicolo; + } + + public void setFlWarnAaTipoFascicolo(String flWarnAaTipoFascicolo) { + this.flWarnAaTipoFascicolo = flWarnAaTipoFascicolo; + } + + // bi-directional many-to-one association to DecAaTipoFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_AA_TIPO_FASCICOLO") + public DecAaTipoFascicolo getDecAaTipoFascicolo() { + return this.decAaTipoFascicolo; + } + + public void setDecAaTipoFascicolo(DecAaTipoFascicolo decAaTipoFascicolo) { + this.decAaTipoFascicolo = decAaTipoFascicolo; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecXsdAttribDatiSpec.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecXsdAttribDatiSpec.java new file mode 100644 index 0000000..90d7d62 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecXsdAttribDatiSpec.java @@ -0,0 +1,109 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Cacheable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlID; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_XSD_ATTRIB_DATI_SPEC database table. + */ +@Entity +@Cacheable(true) +@Table(name = "DEC_XSD_ATTRIB_DATI_SPEC") +public class DecXsdAttribDatiSpec implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idXsdAttribDatiSpec; + + private BigDecimal niOrdAttrib; + + private DecAttribDatiSpec decAttribDatiSpec; + + private DecXsdDatiSpec decXsdDatiSpec; + + public DecXsdAttribDatiSpec() {/* Hibernate */ + } + + @Id + @Column(name = "ID_XSD_ATTRIB_DATI_SPEC") + @XmlID + @GenericGenerator(name = "SDEC_XSD_ATTRIB_DATI_SPEC_ID_XSD_ATTRIB_DATI_SPEC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_XSD_ATTRIB_DATI_SPEC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_XSD_ATTRIB_DATI_SPEC_ID_XSD_ATTRIB_DATI_SPEC_GENERATOR") + public Long getIdXsdAttribDatiSpec() { + return this.idXsdAttribDatiSpec; + } + + public void setIdXsdAttribDatiSpec(Long idXsdAttribDatiSpec) { + this.idXsdAttribDatiSpec = idXsdAttribDatiSpec; + } + + @Column(name = "NI_ORD_ATTRIB") + public BigDecimal getNiOrdAttrib() { + return this.niOrdAttrib; + } + + public void setNiOrdAttrib(BigDecimal niOrdAttrib) { + this.niOrdAttrib = niOrdAttrib; + } + + // bi-directional many-to-one association to DecAttribDatiSpec + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ATTRIB_DATI_SPEC") + @XmlInverseReference(mappedBy = "decXsdAttribDatiSpecs") + public DecAttribDatiSpec getDecAttribDatiSpec() { + return this.decAttribDatiSpec; + } + + public void setDecAttribDatiSpec(DecAttribDatiSpec decAttribDatiSpec) { + this.decAttribDatiSpec = decAttribDatiSpec; + } + + // bi-directional many-to-one association to DecXsdDatiSpec + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_XSD_DATI_SPEC", nullable = false) + @XmlInverseReference(mappedBy = "decXsdAttribDatiSpecs") + public DecXsdDatiSpec getDecXsdDatiSpec() { + return this.decXsdDatiSpec; + } + + public void setDecXsdDatiSpec(DecXsdDatiSpec decXsdDatiSpec) { + this.decXsdDatiSpec = decXsdDatiSpec; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/DecXsdDatiSpec.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecXsdDatiSpec.java new file mode 100644 index 0000000..c6b4d5d --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/DecXsdDatiSpec.java @@ -0,0 +1,253 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.OrderBy; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlTransient; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the DEC_XSD_DATI_SPEC database table. + */ +@Entity +// @Cacheable(true) +@Table(name = "DEC_XSD_DATI_SPEC") +public class DecXsdDatiSpec implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idXsdDatiSpec; + + private String blXsd; + + private String cdVersioneXsd; + + private Date dtIstituz; + + private Date dtSoppres; + + private String nmSistemaMigraz; + + private String tiEntitaSacer; + + private String tiUsoXsd; + + private String dsVersioneXsd; + + private List aroUsoXsdDatiSpecs = new ArrayList<>(); + + private List decXsdAttribDatiSpecs = new ArrayList<>(); + + private DecTipoCompDoc decTipoCompDoc; + + private DecTipoDoc decTipoDoc; + + private DecTipoUnitaDoc decTipoUnitaDoc; + + private OrgStrut orgStrut; + + public DecXsdDatiSpec() {/* Hibernate */ + } + + @Id + @Column(name = "ID_XSD_DATI_SPEC") + @XmlID + @GenericGenerator(name = "SDEC_XSD_DATI_SPEC_ID_XSD_DATI_SPEC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SDEC_XSD_DATI_SPEC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SDEC_XSD_DATI_SPEC_ID_XSD_DATI_SPEC_GENERATOR") + public Long getIdXsdDatiSpec() { + return this.idXsdDatiSpec; + } + + public void setIdXsdDatiSpec(Long idXsdDatiSpec) { + this.idXsdDatiSpec = idXsdDatiSpec; + } + + @Lob() + @Column(name = "BL_XSD") + public String getBlXsd() { + return this.blXsd; + } + + public void setBlXsd(String blXsd) { + this.blXsd = blXsd; + } + + @Column(name = "CD_VERSIONE_XSD") + public String getCdVersioneXsd() { + return this.cdVersioneXsd; + } + + public void setCdVersioneXsd(String cdVersioneXsd) { + this.cdVersioneXsd = cdVersioneXsd; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Column(name = "DT_SOPPRES") + @Temporal(TemporalType.TIMESTAMP) + public Date getDtSoppres() { + return dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + @Column(name = "NM_SISTEMA_MIGRAZ") + public String getNmSistemaMigraz() { + return this.nmSistemaMigraz; + } + + public void setNmSistemaMigraz(String nmSistemaMigraz) { + this.nmSistemaMigraz = nmSistemaMigraz; + } + + @Column(name = "TI_ENTITA_SACER") + public String getTiEntitaSacer() { + return this.tiEntitaSacer; + } + + public void setTiEntitaSacer(String tiEntitaSacer) { + this.tiEntitaSacer = tiEntitaSacer; + } + + @Column(name = "TI_USO_XSD") + public String getTiUsoXsd() { + return this.tiUsoXsd; + } + + public void setTiUsoXsd(String tiUsoXsd) { + this.tiUsoXsd = tiUsoXsd; + } + + @Column(name = "DS_VERSIONE_XSD") + public String getDsVersioneXsd() { + return dsVersioneXsd; + } + + public void setDsVersioneXsd(String dsVersioneXsd) { + this.dsVersioneXsd = dsVersioneXsd; + } + + // bi-directional many-to-one association to AroUsoXsdDatiSpec + @OneToMany(mappedBy = "decXsdDatiSpec") + @XmlTransient + public List getAroUsoXsdDatiSpecs() { + return this.aroUsoXsdDatiSpecs; + } + + public void setAroUsoXsdDatiSpecs(List aroUsoXsdDatiSpecs) { + this.aroUsoXsdDatiSpecs = aroUsoXsdDatiSpecs; + } + + // bi-directional many-to-one association to DecXsdAttribDatiSpec + @OneToMany(mappedBy = "decXsdDatiSpec", cascade = CascadeType.PERSIST) + @OrderBy("niOrdAttrib ASC") + @XmlIDREF + public List getDecXsdAttribDatiSpecs() { + return this.decXsdAttribDatiSpecs; + } + + public void setDecXsdAttribDatiSpecs(List decXsdAttribDatiSpecs) { + this.decXsdAttribDatiSpecs = decXsdAttribDatiSpecs; + } + + // bi-directional many-to-one association to DecTipoCompDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_COMP_DOC") + @XmlInverseReference(mappedBy = "decXsdDatiSpecs") + public DecTipoCompDoc getDecTipoCompDoc() { + return this.decTipoCompDoc; + } + + public void setDecTipoCompDoc(DecTipoCompDoc decTipoCompDoc) { + this.decTipoCompDoc = decTipoCompDoc; + } + + // bi-directional many-to-one association to DecTipoDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_DOC") + @XmlInverseReference(mappedBy = "decXsdDatiSpecs") + public DecTipoDoc getDecTipoDoc() { + return this.decTipoDoc; + } + + public void setDecTipoDoc(DecTipoDoc decTipoDoc) { + this.decTipoDoc = decTipoDoc; + } + + // bi-directional many-to-one association to DecTipoUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_UNITA_DOC") + @XmlInverseReference(mappedBy = "decXsdDatiSpecs") + public DecTipoUnitaDoc getDecTipoUnitaDoc() { + return this.decTipoUnitaDoc; + } + + public void setDecTipoUnitaDoc(DecTipoUnitaDoc decTipoUnitaDoc) { + this.decTipoUnitaDoc = decTipoUnitaDoc; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + @XmlInverseReference(mappedBy = "decXsdDatiSpecs") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/ElvDocAggDaElabElenco.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/ElvDocAggDaElabElenco.java new file mode 100644 index 0000000..f5c3d6f --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/ElvDocAggDaElabElenco.java @@ -0,0 +1,103 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.AssociationOverride; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.inheritance.oop.ElvUdDocUpdDaElabElenco; + +/** + * The persistent class for the ELV_DOC_AGG_DA_ELAB_ELENCO database table. + */ +@Entity +@Table(name = "ELV_DOC_AGG_DA_ELAB_ELENCO") +@AssociationOverride(name = "udDocUpdObj", joinColumns = @JoinColumn(name = "ID_DOC", insertable = false, updatable = false)) +public class ElvDocAggDaElabElenco extends ElvUdDocUpdDaElabElenco implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idDocAggDaElabElenco; + + private BigDecimal idStrut; + + private String tiStatoDocDaElab; + + private AroDoc aroDoc; + + public ElvDocAggDaElabElenco() {/* Hibernate */ + } + + @Id + @Column(name = "ID_DOC_AGG_DA_ELAB_ELENCO") + @GenericGenerator(name = "SELV_DOC_AGG_DA_ELAB_ELENCO_ID_DOC_AGG_DA_ELAB_ELENCO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SELV_DOC_AGG_DA_ELAB_ELENCO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SELV_DOC_AGG_DA_ELAB_ELENCO_ID_DOC_AGG_DA_ELAB_ELENCO_GENERATOR") + public Long getIdDocAggDaElabElenco() { + return this.idDocAggDaElabElenco; + } + + public void setIdDocAggDaElabElenco(Long idDocAggDaElabElenco) { + this.idDocAggDaElabElenco = idDocAggDaElabElenco; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "TI_STATO_DOC_DA_ELAB") + public String getTiStatoDocDaElab() { + return this.tiStatoDocDaElab; + } + + public void setTiStatoDocDaElab(String tiStatoDocDaElab) { + this.tiStatoDocDaElab = tiStatoDocDaElab; + } + + // bi-directional many-to-one association to AroDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DOC") + public AroDoc getAroDoc() { + return this.aroDoc; + } + + public void setAroDoc(AroDoc aroDoc) { + this.aroDoc = aroDoc; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/ElvFascDaElabElenco.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/ElvFascDaElabElenco.java new file mode 100644 index 0000000..9fc4a66 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/ElvFascDaElabElenco.java @@ -0,0 +1,141 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.ElvFascDaElabElenco.TiStatoFascDaElab; + +/** + * The persistent class for the ELV_FASC_DA_ELAB_ELENCO database table. + */ +@Entity +@Table(name = "ELV_FASC_DA_ELAB_ELENCO") +public class ElvFascDaElabElenco implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idFascDaElabElenco; + + private BigDecimal aaFascicolo; + + private Date tsVersFascicolo; + + private BigDecimal idStrut; + + private TiStatoFascDaElab tiStatoFascDaElab; + + private FasFascicolo fasFascicolo; + + private BigDecimal idTipoFascicolo; + + public ElvFascDaElabElenco() {/* Hibernate */ + } + + @Id + @Column(name = "ID_FASC_DA_ELAB_ELENCO") + @GenericGenerator(name = "SELV_FASC_DA_ELAB_ELENCO_ID_FASC_DA_ELAB_ELENCO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SELV_FASC_DA_ELAB_ELENCO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SELV_FASC_DA_ELAB_ELENCO_ID_FASC_DA_ELAB_ELENCO_GENERATOR") + public Long getIdFascDaElabElenco() { + return this.idFascDaElabElenco; + } + + public void setIdFascDaElabElenco(Long idFascDaElabElenco) { + this.idFascDaElabElenco = idFascDaElabElenco; + } + + @Column(name = "AA_FASCICOLO") + public BigDecimal getAaFascicolo() { + return this.aaFascicolo; + } + + public void setAaFascicolo(BigDecimal aaFascicolo) { + this.aaFascicolo = aaFascicolo; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_VERS_FASCICOLO") + public Date getTsVersFascicolo() { + return this.tsVersFascicolo; + } + + public void setTsVersFascicolo(Date tsVersFascicolo) { + this.tsVersFascicolo = tsVersFascicolo; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_STATO_FASC_DA_ELAB") + public TiStatoFascDaElab getTiStatoFascDaElab() { + return this.tiStatoFascDaElab; + } + + public void setTiStatoFascDaElab(TiStatoFascDaElab tiStatoFascDaElab) { + this.tiStatoFascDaElab = tiStatoFascDaElab; + } + + // bi-directional many-to-one association to FasFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO") + public FasFascicolo getFasFascicolo() { + return this.fasFascicolo; + } + + public void setFasFascicolo(FasFascicolo fasFascicolo) { + this.fasFascicolo = fasFascicolo; + } + + @Column(name = "ID_TIPO_FASCICOLO") + public BigDecimal getIdTipoFascicolo() { + return this.idTipoFascicolo; + } + + public void setIdTipoFascicolo(BigDecimal idTipoFascicolo) { + this.idTipoFascicolo = idTipoFascicolo; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/ElvUdVersDaElabElenco.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/ElvUdVersDaElabElenco.java new file mode 100644 index 0000000..dfdf192 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/ElvUdVersDaElabElenco.java @@ -0,0 +1,103 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.AssociationOverride; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.inheritance.oop.ElvUdDocUpdDaElabElenco; + +/** + * The persistent class for the ELV_UD_VERS_DA_ELAB_ELENCO database table. + */ +@Entity +@Table(name = "ELV_UD_VERS_DA_ELAB_ELENCO") +@AssociationOverride(name = "udDocUpdObj", joinColumns = @JoinColumn(name = "ID_UNITA_DOC", insertable = false, updatable = false)) +public class ElvUdVersDaElabElenco extends ElvUdDocUpdDaElabElenco implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUdVersDaElabElenco; + + private BigDecimal idStrut; + + private String tiStatoUdDaElab; + + private AroUnitaDoc aroUnitaDoc; + + public ElvUdVersDaElabElenco() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UD_VERS_DA_ELAB_ELENCO") + @GenericGenerator(name = "SELV_UD_VERS_DA_ELAB_ELENCO_ID_UD_VERS_DA_ELAB_ELENCO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SELV_UD_VERS_DA_ELAB_ELENCO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SELV_UD_VERS_DA_ELAB_ELENCO_ID_UD_VERS_DA_ELAB_ELENCO_GENERATOR") + public Long getIdUdVersDaElabElenco() { + return this.idUdVersDaElabElenco; + } + + public void setIdUdVersDaElabElenco(Long idUdVersDaElabElenco) { + this.idUdVersDaElabElenco = idUdVersDaElabElenco; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "TI_STATO_UD_DA_ELAB") + public String getTiStatoUdDaElab() { + return this.tiStatoUdDaElab; + } + + public void setTiStatoUdDaElab(String tiStatoUdDaElab) { + this.tiStatoUdDaElab = tiStatoUdDaElab; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC") + public AroUnitaDoc getAroUnitaDoc() { + return this.aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/ElvUpdUdDaElabElenco.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/ElvUpdUdDaElabElenco.java new file mode 100644 index 0000000..7811d7b --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/ElvUpdUdDaElabElenco.java @@ -0,0 +1,160 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.AssociationOverride; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.ElvUpdUdDaElabElenco.ElvUpdUdDaElabTiStatoUpdElencoVers; +import it.eng.parer.entity.inheritance.oop.ElvUdDocUpdDaElabElenco; + +/** + * The persistent class for the ELV_UPD_UD_DA_ELAB_ELENCO database table. + */ +@Entity +@Table(name = "ELV_UPD_UD_DA_ELAB_ELENCO") +@AssociationOverride(name = "udDocUpdObj", joinColumns = @JoinColumn(name = "ID_UPD_UNITA_DOC", insertable = false, updatable = false)) +public class ElvUpdUdDaElabElenco extends ElvUdDocUpdDaElabElenco implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUpdUdDaElabElenco; + + private OrgStrut orgStrut; + + private OrgSubStrut orgSubStrut; + + private AroUpdUnitaDoc aroUpdUnitaDoc; + + private ElvUpdUdDaElabTiStatoUpdElencoVers tiStatoUpdElencoVers; + + private DecRegistroUnitaDoc decRegistroUnitaDoc; + + private DecTipoUnitaDoc decTipoUnitaDoc; + + private DecTipoDoc decTipoDocPrinc; + + public ElvUpdUdDaElabElenco() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UPD_UD_DA_ELAB_ELENCO") + @GenericGenerator(name = "SELV_UPD_UD_DA_ELAB_ELENCO_ID_UPD_UD_DA_ELAB_ELENCO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SELV_UPD_UD_DA_ELAB_ELENCO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SELV_UPD_UD_DA_ELAB_ELENCO_ID_UPD_UD_DA_ELAB_ELENCO_GENERATOR") + public Long getIdUpdUdDaElabElenco() { + return this.idUpdUdDaElabElenco; + } + + public void setIdUpdUdDaElabElenco(Long idUpdUdDaElabElenco) { + this.idUpdUdDaElabElenco = idUpdUdDaElabElenco; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to OrgSubStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SUB_STRUT") + public OrgSubStrut getOrgSubStrut() { + return this.orgSubStrut; + } + + public void setOrgSubStrut(OrgSubStrut orgSubStrut) { + this.orgSubStrut = orgSubStrut; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_UNITA_DOC") + public AroUpdUnitaDoc getAroUpdUnitaDoc() { + return this.aroUpdUnitaDoc; + } + + public void setAroUpdUnitaDoc(AroUpdUnitaDoc aroUpdUnitaDoc) { + this.aroUpdUnitaDoc = aroUpdUnitaDoc; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_STATO_UPD_ELENCO_VERS") + public ElvUpdUdDaElabTiStatoUpdElencoVers getTiStatoUpdElencoVers() { + return this.tiStatoUpdElencoVers; + } + + public void setTiStatoUpdElencoVers(ElvUpdUdDaElabTiStatoUpdElencoVers tiStatoUpdElencoVers) { + this.tiStatoUpdElencoVers = tiStatoUpdElencoVers; + } + + // bi-directional many-to-one association to DecRegistroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_REGISTRO_UNITA_DOC") + public DecRegistroUnitaDoc getDecRegistroUnitaDoc() { + return this.decRegistroUnitaDoc; + } + + public void setDecRegistroUnitaDoc(DecRegistroUnitaDoc decRegistroUnitaDoc) { + this.decRegistroUnitaDoc = decRegistroUnitaDoc; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_UNITA_DOC") + public DecTipoUnitaDoc getDecTipoUnitaDoc() { + return this.decTipoUnitaDoc; + } + + public void setDecTipoUnitaDoc(DecTipoUnitaDoc decTipoUnitaDoc) { + this.decTipoUnitaDoc = decTipoUnitaDoc; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_DOC_PRINC") + public DecTipoDoc getDecTipoDocPrinc() { + return this.decTipoDocPrinc; + } + + public void setDecTipoDocPrinc(DecTipoDoc decTipoDocPrinc) { + this.decTipoDocPrinc = decTipoDocPrinc; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FasAmminPartec.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasAmminPartec.java new file mode 100644 index 0000000..398f02a --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasAmminPartec.java @@ -0,0 +1,109 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the FAS_AMMIN_PARTEC database table. + */ +@Entity +@Table(name = "FAS_AMMIN_PARTEC") +public class FasAmminPartec implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idAmminPartec; + + private String cdAmminPartec; + + private String dsAmminPartec; + + private String tiCodiceAmminPartec; + + private FasFascicolo fasFascicolo; + + public FasAmminPartec() {/* Hibernate */ + } + + @Id + @Column(name = "ID_AMMIN_PARTEC") + @GenericGenerator(name = "SFAS_AMMIN_PARTEC_ID_AMMIN_PARTEC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFAS_AMMIN_PARTEC"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFAS_AMMIN_PARTEC_ID_AMMIN_PARTEC_GENERATOR") + public Long getIdAmminPartec() { + return this.idAmminPartec; + } + + public void setIdAmminPartec(Long idAmminPartec) { + this.idAmminPartec = idAmminPartec; + } + + @Column(name = "CD_AMMIN_PARTEC") + public String getCdAmminPartec() { + return this.cdAmminPartec; + } + + public void setCdAmminPartec(String cdAmminPartec) { + this.cdAmminPartec = cdAmminPartec; + } + + @Column(name = "DS_AMMIN_PARTEC") + public String getDsAmminPartec() { + return this.dsAmminPartec; + } + + public void setDsAmminPartec(String dsAmminPartec) { + this.dsAmminPartec = dsAmminPartec; + } + + @Column(name = "TI_CODICE_AMMIN_PARTEC") + public String getTiCodiceAmminPartec() { + return this.tiCodiceAmminPartec; + } + + public void setTiCodiceAmminPartec(String tiCodiceAmminPartec) { + this.tiCodiceAmminPartec = tiCodiceAmminPartec; + } + + // bi-directional many-to-one association to FasFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO") + public FasFascicolo getFasFascicolo() { + return this.fasFascicolo; + } + + public void setFasFascicolo(FasFascicolo fasFascicolo) { + this.fasFascicolo = fasFascicolo; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FasFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasFascicolo.java new file mode 100644 index 0000000..21e9aab --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasFascicolo.java @@ -0,0 +1,780 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.PrePersist; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.FasFascicolo.TiConservazione; +import it.eng.parer.entity.constraint.FasFascicolo.TiStatoConservazione; +import it.eng.parer.entity.constraint.FasFascicolo.TiStatoFascElencoVers; + +/** + * The persistent class for the FAS_FASCICOLO database table. + */ +@Entity +@Table(name = "FAS_FASCICOLO") +public class FasFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idFascicolo; + + private BigDecimal aaFascicolo; + + private BigDecimal aaFascicoloPadre; + + private String cdIndIpClient; + + private String cdIndServer; + + private String cdIndiceClassif; + + private String cdAmminTitol; + + private String cdKeyFascicolo; + + private String cdKeyFascicoloPadre; + + private String cdKeyOrd; + + private String cdLivelloRiserv; + + private String cdProcAmmin; + + private String dsAmminTitol; + + private String dsIndiceClassif; + + private String dsNota; + + private String dsOggettoFascicolo; + + private String dsOggettoFascicoloPadre; + + private String dsProcAmmin; + + private String dsProcAmminMateriaArgStrut; + + private Date dtAnnull; + + private Date dtApeFascicolo; + + private Date dtChiuFascicolo; + + private String flForzaContrClassif; + + private String flForzaContrColleg; + + private String flForzaContrNumero; + + private String flSesFascicoloKo; + + private String flUpdAnnulUnitaDoc; + + private String flUpdModifUnitaDoc; + + private String cdKeyNormalizFascicolo; + + private BigDecimal niAaConservazione; + + private BigDecimal niSottoFascicoli; + + private BigDecimal niUnitaDoc; + + private String ntAnnul; + + private TiConservazione tiConservazione; + + private TiStatoConservazione tiStatoConservazione; + + private TiStatoFascElencoVers tiStatoFascElencoVers; + + private String tiCodiceAmminTitol; + + private Date tsFineSes; + + private Date tsIniSes; + + private List elvFascDaElabElencos = new ArrayList<>(); + + private List fasAmminPartecs = new ArrayList<>(); + + private AplSistemaMigraz aplSistemaMigraz; + + private AroUnitaDoc aroUnitaDocLast; + + private AroUnitaDoc aroUnitaDocFirst; + + private DecTipoFascicolo decTipoFascicolo; + + private DecVoceTitol decVoceTitol; + + private FasFascicolo fasFascicoloPadre; + + private List fasFascicolos = new ArrayList<>(); + + private List fasStatoConservFascicoloElencos = new ArrayList<>(); + + private List fasStatoFascicoloElencos = new ArrayList<>(); + + private IamUser iamUser; + + private OrgStrut orgStrut; + + private List fasLinkFascicolos1 = new ArrayList<>(); + + private List fasRespFascicolos = new ArrayList<>(); + + private List fasUniOrgRespFascicolos = new ArrayList<>(); + + private List fasSogFascicolos = new ArrayList<>(); + + private List fasUnitaDocFascicolos = new ArrayList<>(); + + private List fasWarnFascicolos = new ArrayList<>(); + + private List fasXmlFascicolos = new ArrayList<>(); + + private List fasXmlVersFascicolos = new ArrayList<>(); + + public FasFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_FASCICOLO") + @GenericGenerator(name = "SFAS_FASCICOLO_ID_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFAS_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFAS_FASCICOLO_ID_FASCICOLO_GENERATOR") + public Long getIdFascicolo() { + return this.idFascicolo; + } + + public void setIdFascicolo(Long idFascicolo) { + this.idFascicolo = idFascicolo; + } + + @Column(name = "AA_FASCICOLO") + public BigDecimal getAaFascicolo() { + return this.aaFascicolo; + } + + public void setAaFascicolo(BigDecimal aaFascicolo) { + this.aaFascicolo = aaFascicolo; + } + + @Column(name = "AA_FASCICOLO_PADRE") + public BigDecimal getAaFascicoloPadre() { + return this.aaFascicoloPadre; + } + + public void setAaFascicoloPadre(BigDecimal aaFascicoloPadre) { + this.aaFascicoloPadre = aaFascicoloPadre; + } + + @Column(name = "CD_IND_IP_CLIENT") + public String getCdIndIpClient() { + return this.cdIndIpClient; + } + + public void setCdIndIpClient(String cdIndIpClient) { + this.cdIndIpClient = cdIndIpClient; + } + + @Column(name = "CD_IND_SERVER") + public String getCdIndServer() { + return this.cdIndServer; + } + + public void setCdIndServer(String cdIndServer) { + this.cdIndServer = cdIndServer; + } + + @Column(name = "CD_INDICE_CLASSIF") + public String getCdIndiceClassif() { + return this.cdIndiceClassif; + } + + public void setCdIndiceClassif(String cdIndiceClassif) { + this.cdIndiceClassif = cdIndiceClassif; + } + + @Column(name = "CD_AMMIN_TITOL") + public String getCdAmminTitol() { + return this.cdAmminTitol; + } + + public void setCdAmminTitol(String cdAmminTitol) { + this.cdAmminTitol = cdAmminTitol; + } + + @Column(name = "CD_KEY_FASCICOLO") + public String getCdKeyFascicolo() { + return this.cdKeyFascicolo; + } + + public void setCdKeyFascicolo(String cdKeyFascicolo) { + this.cdKeyFascicolo = cdKeyFascicolo; + } + + @Column(name = "CD_KEY_FASCICOLO_PADRE") + public String getCdKeyFascicoloPadre() { + return this.cdKeyFascicoloPadre; + } + + public void setCdKeyFascicoloPadre(String cdKeyFascicoloPadre) { + this.cdKeyFascicoloPadre = cdKeyFascicoloPadre; + } + + @Column(name = "CD_KEY_ORD") + public String getCdKeyOrd() { + return this.cdKeyOrd; + } + + public void setCdKeyOrd(String cdKeyOrd) { + this.cdKeyOrd = cdKeyOrd; + } + + @Column(name = "CD_LIVELLO_RISERV") + public String getCdLivelloRiserv() { + return this.cdLivelloRiserv; + } + + public void setCdLivelloRiserv(String cdLivelloRiserv) { + this.cdLivelloRiserv = cdLivelloRiserv; + } + + @Column(name = "CD_PROC_AMMIN") + public String getCdProcAmmin() { + return this.cdProcAmmin; + } + + public void setCdProcAmmin(String cdProcAmmin) { + this.cdProcAmmin = cdProcAmmin; + } + + @Column(name = "DS_AMMIN_TITOL") + public String getDsAmminTitol() { + return this.dsAmminTitol; + } + + public void setDsAmminTitol(String dsAmminTitol) { + this.dsAmminTitol = dsAmminTitol; + } + + @Column(name = "DS_INDICE_CLASSIF") + public String getDsIndiceClassif() { + return this.dsIndiceClassif; + } + + public void setDsIndiceClassif(String dsIndiceClassif) { + this.dsIndiceClassif = dsIndiceClassif; + } + + @Column(name = "DS_NOTA") + public String getDsNota() { + return this.dsNota; + } + + public void setDsNota(String dsNota) { + this.dsNota = dsNota; + } + + @Column(name = "DS_OGGETTO_FASCICOLO") + public String getDsOggettoFascicolo() { + return this.dsOggettoFascicolo; + } + + public void setDsOggettoFascicolo(String dsOggettoFascicolo) { + this.dsOggettoFascicolo = dsOggettoFascicolo; + } + + @Column(name = "DS_OGGETTO_FASCICOLO_PADRE") + public String getDsOggettoFascicoloPadre() { + return this.dsOggettoFascicoloPadre; + } + + public void setDsOggettoFascicoloPadre(String dsOggettoFascicoloPadre) { + this.dsOggettoFascicoloPadre = dsOggettoFascicoloPadre; + } + + @Column(name = "DS_PROC_AMMIN") + public String getDsProcAmmin() { + return this.dsProcAmmin; + } + + public void setDsProcAmmin(String dsProcAmmin) { + this.dsProcAmmin = dsProcAmmin; + } + + @Column(name = "DS_PROC_AMMIN_MATERIA_ARG_STRUT") + public String getDsProcAmminMateriaArgStrut() { + return this.dsProcAmminMateriaArgStrut; + } + + public void setDsProcAmminMateriaArgStrut(String dsProcAmminMateriaArgStrut) { + this.dsProcAmminMateriaArgStrut = dsProcAmminMateriaArgStrut; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ANNULL") + public Date getDtAnnull() { + return this.dtAnnull; + } + + public void setDtAnnull(Date dtAnnull) { + this.dtAnnull = dtAnnull; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_APE_FASCICOLO") + public Date getDtApeFascicolo() { + return this.dtApeFascicolo; + } + + public void setDtApeFascicolo(Date dtApeFascicolo) { + this.dtApeFascicolo = dtApeFascicolo; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_CHIU_FASCICOLO") + public Date getDtChiuFascicolo() { + return this.dtChiuFascicolo; + } + + public void setDtChiuFascicolo(Date dtChiuFascicolo) { + this.dtChiuFascicolo = dtChiuFascicolo; + } + + @Column(name = "FL_FORZA_CONTR_CLASSIF", columnDefinition = "char(1)") + public String getFlForzaContrClassif() { + return this.flForzaContrClassif; + } + + public void setFlForzaContrClassif(String flForzaContrClassif) { + this.flForzaContrClassif = flForzaContrClassif; + } + + @Column(name = "FL_FORZA_CONTR_COLLEG", columnDefinition = "char(1)") + public String getFlForzaContrColleg() { + return this.flForzaContrColleg; + } + + public void setFlForzaContrColleg(String flForzaContrColleg) { + this.flForzaContrColleg = flForzaContrColleg; + } + + @Column(name = "FL_FORZA_CONTR_NUMERO", columnDefinition = "char(1)") + public String getFlForzaContrNumero() { + return this.flForzaContrNumero; + } + + public void setFlForzaContrNumero(String flForzaContrNumero) { + this.flForzaContrNumero = flForzaContrNumero; + } + + @Column(name = "FL_SES_FASCICOLO_KO", columnDefinition = "char(1)") + public String getFlSesFascicoloKo() { + return this.flSesFascicoloKo; + } + + public void setFlSesFascicoloKo(String flSesFascicoloKo) { + this.flSesFascicoloKo = flSesFascicoloKo; + } + + @Column(name = "FL_UPD_ANNUL_UNITA_DOC", columnDefinition = "char(1)") + public String getFlUpdAnnulUnitaDoc() { + return this.flUpdAnnulUnitaDoc; + } + + public void setFlUpdAnnulUnitaDoc(String flUpdAnnulUnitaDoc) { + this.flUpdAnnulUnitaDoc = flUpdAnnulUnitaDoc; + } + + @Column(name = "FL_UPD_MODIF_UNITA_DOC", columnDefinition = "char(1)") + public String getFlUpdModifUnitaDoc() { + return this.flUpdModifUnitaDoc; + } + + public void setFlUpdModifUnitaDoc(String flUpdModifUnitaDoc) { + this.flUpdModifUnitaDoc = flUpdModifUnitaDoc; + } + + @Column(name = "NI_AA_CONSERVAZIONE") + public BigDecimal getNiAaConservazione() { + return this.niAaConservazione; + } + + public void setNiAaConservazione(BigDecimal niAaConservazione) { + this.niAaConservazione = niAaConservazione; + } + + @Column(name = "NI_SOTTO_FASCICOLI") + public BigDecimal getNiSottoFascicoli() { + return this.niSottoFascicoli; + } + + public void setNiSottoFascicoli(BigDecimal niSottoFascicoli) { + this.niSottoFascicoli = niSottoFascicoli; + } + + @Column(name = "NI_UNITA_DOC") + public BigDecimal getNiUnitaDoc() { + return this.niUnitaDoc; + } + + public void setNiUnitaDoc(BigDecimal niUnitaDoc) { + this.niUnitaDoc = niUnitaDoc; + } + + @Column(name = "NT_ANNUL") + public String getNtAnnul() { + return this.ntAnnul; + } + + public void setNtAnnul(String ntAnnul) { + this.ntAnnul = ntAnnul; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_CONSERVAZIONE") + public TiConservazione getTiConservazione() { + return this.tiConservazione; + } + + public void setTiConservazione(TiConservazione tiConservazione) { + this.tiConservazione = tiConservazione; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_STATO_CONSERVAZIONE") + public TiStatoConservazione getTiStatoConservazione() { + return this.tiStatoConservazione; + } + + public void setTiStatoConservazione(TiStatoConservazione tiStatoConservazione) { + this.tiStatoConservazione = tiStatoConservazione; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_STATO_FASC_ELENCO_VERS") + public TiStatoFascElencoVers getTiStatoFascElencoVers() { + return this.tiStatoFascElencoVers; + } + + public void setTiStatoFascElencoVers(TiStatoFascElencoVers tiStatoFascElencoVers) { + this.tiStatoFascElencoVers = tiStatoFascElencoVers; + } + + @Column(name = "TI_CODICE_AMMIN_TITOL") + public String getTiCodiceAmminTitol() { + return this.tiCodiceAmminTitol; + } + + public void setTiCodiceAmminTitol(String tiCodiceAmminTitol) { + this.tiCodiceAmminTitol = tiCodiceAmminTitol; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_FINE_SES") + public Date getTsFineSes() { + return this.tsFineSes; + } + + public void setTsFineSes(Date tsFineSes) { + this.tsFineSes = tsFineSes; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_INI_SES") + public Date getTsIniSes() { + return this.tsIniSes; + } + + public void setTsIniSes(Date tsIniSes) { + this.tsIniSes = tsIniSes; + } + + // bi-directional many-to-one association to FasUnitaDocFascicolo + @OneToMany(mappedBy = "fasFascicolo") + public List getFasAmminPartecs() { + return fasAmminPartecs; + } + + public void setFasAmminPartecs(List fasAmminPartecs) { + this.fasAmminPartecs = fasAmminPartecs; + } + + // bi-directional many-to-one association to FasUnitaDocFascicolo + @OneToMany(mappedBy = "fasFascicolo") + public List getElvFascDaElabElencos() { + return elvFascDaElabElencos; + } + + public void setElvFascDaElabElencos(List elvFascDaElabElencos) { + this.elvFascDaElabElencos = elvFascDaElabElencos; + } + + // bi-directional many-to-one association to AplSistemaMigraz + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SISTEMA_MIGRAZ") + public AplSistemaMigraz getAplSistemaMigraz() { + return this.aplSistemaMigraz; + } + + public void setAplSistemaMigraz(AplSistemaMigraz aplSistemaMigraz) { + this.aplSistemaMigraz = aplSistemaMigraz; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC_LAST") + public AroUnitaDoc getAroUnitaDocLast() { + return this.aroUnitaDocLast; + } + + public void setAroUnitaDocLast(AroUnitaDoc aroUnitaDocLast) { + this.aroUnitaDocLast = aroUnitaDocLast; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC_FIRST") + public AroUnitaDoc getAroUnitaDocFirst() { + return this.aroUnitaDocFirst; + } + + public void setAroUnitaDocFirst(AroUnitaDoc aroUnitaDocFirst) { + this.aroUnitaDocFirst = aroUnitaDocFirst; + } + + // bi-directional many-to-one association to DecTipoFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_FASCICOLO") + public DecTipoFascicolo getDecTipoFascicolo() { + return this.decTipoFascicolo; + } + + public void setDecTipoFascicolo(DecTipoFascicolo decTipoFascicolo) { + this.decTipoFascicolo = decTipoFascicolo; + } + + // bi-directional many-to-one association to DecVoceTitol + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_VOCE_TITOL") + public DecVoceTitol getDecVoceTitol() { + return this.decVoceTitol; + } + + public void setDecVoceTitol(DecVoceTitol decVoceTitol) { + this.decVoceTitol = decVoceTitol; + } + + // bi-directional many-to-one association to FasFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO_PADRE") + public FasFascicolo getFasFascicoloPadre() { + return this.fasFascicoloPadre; + } + + public void setFasFascicoloPadre(FasFascicolo fasFascicoloPadre) { + this.fasFascicoloPadre = fasFascicoloPadre; + } + + // bi-directional many-to-one association to FasFascicolo + @OneToMany(mappedBy = "fasFascicoloPadre") + public List getFasFascicolos() { + return this.fasFascicolos; + } + + public void setFasFascicolos(List fasFascicolos) { + this.fasFascicolos = fasFascicolos; + } + + // bi-directional many-to-one association to FasStatoConservFascicoloElenco + @OneToMany(mappedBy = "fasFascicolo", cascade = CascadeType.PERSIST) + public List getFasStatoConservFascicoloElencos() { + return this.fasStatoConservFascicoloElencos; + } + + public void setFasStatoConservFascicoloElencos(List fasStatoConservFascicoloElencos) { + this.fasStatoConservFascicoloElencos = fasStatoConservFascicoloElencos; + } + + // bi-directional many-to-one association to FasStatoFascicoloElenco + @OneToMany(mappedBy = "fasFascicolo", cascade = CascadeType.PERSIST) + public List getFasStatoFascicoloElencos() { + return this.fasStatoFascicoloElencos; + } + + public void setFasStatoFascicoloElencos(List fasStatoFascicoloElencos) { + this.fasStatoFascicoloElencos = fasStatoFascicoloElencos; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USER_IAM_VERS") + public IamUser getIamUser() { + return this.iamUser; + } + + public void setIamUser(IamUser iamUser) { + this.iamUser = iamUser; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + @Column(name = "CD_KEY_NORMALIZ_FASCICOLO") + public String getCdKeyNormalizFascicolo() { + return this.cdKeyNormalizFascicolo; + } + + public void setCdKeyNormalizFascicolo(String cdKeyNormalizFascicolo) { + this.cdKeyNormalizFascicolo = cdKeyNormalizFascicolo; + } + + // bi-directional many-to-one association to FasUnitaDocFascicolo + @OneToMany(mappedBy = "fasFascicolo") + public List getFasLinkFascicolos1() { + return fasLinkFascicolos1; + } + + public void setFasLinkFascicolos1(List fasLinkFascicolos1) { + this.fasLinkFascicolos1 = fasLinkFascicolos1; + } + + // bi-directional many-to-one association to FasUnitaDocFascicolo + @OneToMany(mappedBy = "fasFascicolo") + public List getFasRespFascicolos() { + return fasRespFascicolos; + } + + public void setFasRespFascicolos(List fasRespFascicolos) { + this.fasRespFascicolos = fasRespFascicolos; + } + + // bi-directional many-to-one association to FasUnitaDocFascicolo + @OneToMany(mappedBy = "fasFascicolo") + public List getFasUniOrgRespFascicolos() { + return fasUniOrgRespFascicolos; + } + + public void setFasUniOrgRespFascicolos(List fasUniOrgRespFascicolos) { + this.fasUniOrgRespFascicolos = fasUniOrgRespFascicolos; + } + + // bi-directional many-to-one association to FasUnitaDocFascicolo + @OneToMany(mappedBy = "fasFascicolo") + public List getFasSogFascicolos() { + return fasSogFascicolos; + } + + public void setFasSogFascicolos(List fasSogFascicolos) { + this.fasSogFascicolos = fasSogFascicolos; + } + + // bi-directional many-to-one association to FasUnitaDocFascicolo + @OneToMany(mappedBy = "fasFascicolo") + public List getFasUnitaDocFascicolos() { + return fasUnitaDocFascicolos; + } + + public void setFasUnitaDocFascicolos(List fasUnitaDocFascicolos) { + this.fasUnitaDocFascicolos = fasUnitaDocFascicolos; + } + + // bi-directional many-to-one association to FasWarnFascicolo + @OneToMany(mappedBy = "fasFascicolo") + public List getFasWarnFascicolos() { + return fasWarnFascicolos; + } + + public void setFasWarnFascicolos(List fasWarnFascicolos) { + this.fasWarnFascicolos = fasWarnFascicolos; + } + + // bi-directional many-to-one association to FasXmlFascicolo + @OneToMany(mappedBy = "fasFascicolo") + public List getFasXmlFascicolos() { + return fasXmlFascicolos; + } + + public void setFasXmlFascicolos(List fasXmlFascicolos) { + this.fasXmlFascicolos = fasXmlFascicolos; + } + + // bi-directional many-to-one association to FasXmlVersFascicolo + @OneToMany(mappedBy = "fasFascicolo") + public List getFasXmlVersFascicolos() { + return fasXmlVersFascicolos; + } + + public void setFasXmlVersFascicolos(List fasXmlVersFascicolos) { + this.fasXmlVersFascicolos = fasXmlVersFascicolos; + } + + /** + * Gestione dei default. Risulta la migliore pratica in quanto è indipendente dal db utilizzato e sfrutta diretta + * JPA quindi calabile sotto ogni contesto in termini di ORM + * + * ref. https://stackoverflow.com/a/13432234 + */ + @PrePersist + void preInsert() { + if (this.flUpdModifUnitaDoc == null) { + this.flUpdModifUnitaDoc = "0"; + } + if (this.flUpdAnnulUnitaDoc == null) { + this.flUpdAnnulUnitaDoc = "0"; + } + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FasLinkFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasLinkFascicolo.java new file mode 100644 index 0000000..5074642 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasLinkFascicolo.java @@ -0,0 +1,129 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Transient; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the FAS_LINK_FASCICOLO database table. + */ +@Entity +@Table(name = "FAS_LINK_FASCICOLO") +public class FasLinkFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idLinkFascicolo; + + private BigDecimal aaFascicoloLink; + + private String cdKeyFascicoloLink; + + private String dsLink; + + private FasFascicolo fasFascicolo; + + private FasFascicolo fasFascicoloLink; + + public FasLinkFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_LINK_FASCICOLO") + @GenericGenerator(name = "SFAS_LINK_FASCICOLO_ID_LINK_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFAS_LINK_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFAS_LINK_FASCICOLO_ID_LINK_FASCICOLO_GENERATOR") + public Long getIdLinkFascicolo() { + return this.idLinkFascicolo; + } + + public void setIdLinkFascicolo(Long idLinkFascicolo) { + this.idLinkFascicolo = idLinkFascicolo; + } + + @Column(name = "AA_FASCICOLO_LINK") + public BigDecimal getAaFascicoloLink() { + return this.aaFascicoloLink; + } + + public void setAaFascicoloLink(BigDecimal aaFascicoloLink) { + this.aaFascicoloLink = aaFascicoloLink; + } + + @Column(name = "CD_KEY_FASCICOLO_LINK") + public String getCdKeyFascicoloLink() { + return this.cdKeyFascicoloLink; + } + + public void setCdKeyFascicoloLink(String cdKeyFascicoloLink) { + this.cdKeyFascicoloLink = cdKeyFascicoloLink; + } + + @Column(name = "DS_LINK") + public String getDsLink() { + return this.dsLink; + } + + public void setDsLink(String dsLink) { + this.dsLink = dsLink; + } + + // bi-directional many-to-one association to FasFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO_LINK") + public FasFascicolo getFasFascicoloLink() { + return this.fasFascicoloLink; + } + + public void setFasFascicoloLink(FasFascicolo fasFascicoloLink) { + this.fasFascicoloLink = fasFascicoloLink; + } + + // bi-directional many-to-one association to FasFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO") + public FasFascicolo getFasFascicolo() { + return this.fasFascicolo; + } + + public void setFasFascicolo(FasFascicolo fasFascicolo) { + this.fasFascicolo = fasFascicolo; + } + + @Transient + public boolean hasLink() { + return this.fasFascicoloLink != null; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FasRespFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasRespFascicolo.java new file mode 100644 index 0000000..d67dae4 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasRespFascicolo.java @@ -0,0 +1,147 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.FasRespFascicolo.TiOggResp; + +/** + * The persistent class for the FAS_RESP_FASCICOLO database table. + */ +@Entity +@Table(name = "FAS_RESP_FASCICOLO") +public class FasRespFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idRespFascicolo; + + private String cdResp; + + private String nmCognResp; + + private String nmNomeResp; + + private String tiCdResp; + + private TiOggResp tiOggResp; + + private String tiResp; + + private FasFascicolo fasFascicolo; + + public FasRespFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_RESP_FASCICOLO") + @GenericGenerator(name = "SFAS_RESP_FASCICOLO_ID_RESP_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFAS_RESP_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFAS_RESP_FASCICOLO_ID_RESP_FASCICOLO_GENERATOR") + public Long getIdRespFascicolo() { + return this.idRespFascicolo; + } + + public void setIdRespFascicolo(Long idRespFascicolo) { + this.idRespFascicolo = idRespFascicolo; + } + + @Column(name = "CD_RESP") + public String getCdResp() { + return this.cdResp; + } + + public void setCdResp(String cdResp) { + this.cdResp = cdResp; + } + + @Column(name = "NM_COGN_RESP") + public String getNmCognResp() { + return this.nmCognResp; + } + + public void setNmCognResp(String nmCognResp) { + this.nmCognResp = nmCognResp; + } + + @Column(name = "NM_NOME_RESP") + public String getNmNomeResp() { + return this.nmNomeResp; + } + + public void setNmNomeResp(String nmNomeResp) { + this.nmNomeResp = nmNomeResp; + } + + @Column(name = "TI_CD_RESP") + public String getTiCdResp() { + return this.tiCdResp; + } + + public void setTiCdResp(String tiCdResp) { + this.tiCdResp = tiCdResp; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_OGG_RESP") + public TiOggResp getTiOggResp() { + return this.tiOggResp; + } + + public void setTiOggResp(TiOggResp tiOggResp) { + this.tiOggResp = tiOggResp; + } + + @Column(name = "TI_RESP") + public String getTiResp() { + return this.tiResp; + } + + public void setTiResp(String tiResp) { + this.tiResp = tiResp; + } + + // bi-directional many-to-one association to FasFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO") + public FasFascicolo getFasFascicolo() { + return this.fasFascicolo; + } + + public void setFasFascicolo(FasFascicolo fasFascicolo) { + this.fasFascicolo = fasFascicolo; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FasSogFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasSogFascicolo.java new file mode 100644 index 0000000..129cf1b --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasSogFascicolo.java @@ -0,0 +1,142 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the FAS_SOG_FASCICOLO database table. + */ +@Entity +@Table(name = "FAS_SOG_FASCICOLO") +public class FasSogFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idSogFascicolo; + + private String cdSog; + + private String dsDenomSog; + + private String nmCognSog; + + private String nmNomeSog; + + private String tiCdSog; + + private String tiRapp; + + private FasFascicolo fasFascicolo; + + public FasSogFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_SOG_FASCICOLO") + @GenericGenerator(name = "SFAS_SOG_FASCICOLO_ID_SOG_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFAS_SOG_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFAS_SOG_FASCICOLO_ID_SOG_FASCICOLO_GENERATOR") + public Long getIdSogFascicolo() { + return this.idSogFascicolo; + } + + public void setIdSogFascicolo(Long idSogFascicolo) { + this.idSogFascicolo = idSogFascicolo; + } + + @Column(name = "CD_SOG") + public String getCdSog() { + return this.cdSog; + } + + public void setCdSog(String cdSog) { + this.cdSog = cdSog; + } + + @Column(name = "DS_DENOM_SOG") + public String getDsDenomSog() { + return this.dsDenomSog; + } + + public void setDsDenomSog(String dsDenomSog) { + this.dsDenomSog = dsDenomSog; + } + + @Column(name = "NM_COGN_SOG") + public String getNmCognSog() { + return this.nmCognSog; + } + + public void setNmCognSog(String nmCognSog) { + this.nmCognSog = nmCognSog; + } + + @Column(name = "NM_NOME_SOG") + public String getNmNomeSog() { + return this.nmNomeSog; + } + + public void setNmNomeSog(String nmNomeSog) { + this.nmNomeSog = nmNomeSog; + } + + @Column(name = "TI_CD_SOG") + public String getTiCdSog() { + return this.tiCdSog; + } + + public void setTiCdSog(String tiCdSog) { + this.tiCdSog = tiCdSog; + } + + @Column(name = "TI_RAPP") + public String getTiRapp() { + return this.tiRapp; + } + + public void setTiRapp(String tiRapp) { + this.tiRapp = tiRapp; + } + + // bi-directional many-to-one association to FasFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO") + public FasFascicolo getFasFascicolo() { + return this.fasFascicolo; + } + + public void setFasFascicolo(FasFascicolo fasFascicolo) { + this.fasFascicolo = fasFascicolo; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FasStatoConservFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasStatoConservFascicolo.java new file mode 100644 index 0000000..ffe21bf --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasStatoConservFascicolo.java @@ -0,0 +1,121 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.FasStatoConservFascicolo.TiStatoConservazione; + +/** + * The persistent class for the FAS_STATO_CONSERV_FASCICOLO database table. + */ +@Entity +@Table(name = "FAS_STATO_CONSERV_FASCICOLO") +public class FasStatoConservFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idStatoConservFascicolo; + + private FasFascicolo fasFascicolo; + + private IamUser iamUser; + + private TiStatoConservazione tiStatoConservazione; + + private Date tsStato; + + public FasStatoConservFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_STATO_CONSERV_FASCICOLO") + @GenericGenerator(name = "SFAS_STATO_CONSERV_FASCICOLO_ID_STATO_CONSERV_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFAS_STATO_CONSERV_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFAS_STATO_CONSERV_FASCICOLO_ID_STATO_CONSERV_FASCICOLO_GENERATOR") + public Long getIdStatoConservFascicolo() { + return this.idStatoConservFascicolo; + } + + public void setIdStatoConservFascicolo(Long idStatoConservFascicolo) { + this.idStatoConservFascicolo = idStatoConservFascicolo; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO") + public FasFascicolo getFasFascicolo() { + return this.fasFascicolo; + } + + public void setFasFascicolo(FasFascicolo fasFascicolo) { + this.fasFascicolo = fasFascicolo; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USER_IAM") + public IamUser getIamUser() { + return this.iamUser; + } + + public void setIamUser(IamUser iamUser) { + this.iamUser = iamUser; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_STATO_CONSERVAZIONE") + public TiStatoConservazione getTiStatoConservazione() { + return this.tiStatoConservazione; + } + + public void setTiStatoConservazione(TiStatoConservazione tiStatoConservazione) { + this.tiStatoConservazione = tiStatoConservazione; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_STATO") + public Date getTsStato() { + return this.tsStato; + } + + public void setTsStato(Date tsStato) { + this.tsStato = tsStato; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FasStatoFascicoloElenco.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasStatoFascicoloElenco.java new file mode 100644 index 0000000..a4fb530 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasStatoFascicoloElenco.java @@ -0,0 +1,120 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.FasStatoFascicoloElenco.TiStatoFascElenco; + +/** + * The persistent class for the FAS_STATO_FASCICOLO_ELENCO database table. + */ +@Entity +@Table(name = "FAS_STATO_FASCICOLO_ELENCO") +public class FasStatoFascicoloElenco implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idStatoFascicoloElenco; + + private IamUser iamUser; + + private TiStatoFascElenco tiStatoFascElencoVers; + + private Date tsStato; + + private FasFascicolo fasFascicolo; + + public FasStatoFascicoloElenco() {/* Hibernate */ + } + + @Id + @Column(name = "ID_STATO_FASCICOLO_ELENCO") + @GenericGenerator(name = "SFAS_STATO_FASCICOLO_ELENCO_ID_STATO_FASCICOLO_ELENCO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFAS_STATO_FASCICOLO_ELENCO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFAS_STATO_FASCICOLO_ELENCO_ID_STATO_FASCICOLO_ELENCO_GENERATOR") + public Long getIdStatoFascicoloElenco() { + return this.idStatoFascicoloElenco; + } + + public void setIdStatoFascicoloElenco(Long idStatoFascicoloElenco) { + this.idStatoFascicoloElenco = idStatoFascicoloElenco; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_STATO_FASC_ELENCO_VERS") + public TiStatoFascElenco getTiStatoFascElencoVers() { + return this.tiStatoFascElencoVers; + } + + public void setTiStatoFascElencoVers(TiStatoFascElenco tiStatoFascElencoVers) { + this.tiStatoFascElencoVers = tiStatoFascElencoVers; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USER_IAM") + public IamUser getIamUser() { + return this.iamUser; + } + + public void setIamUser(IamUser iamUser) { + this.iamUser = iamUser; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_STATO") + public Date getTsStato() { + return this.tsStato; + } + + public void setTsStato(Date tsStato) { + this.tsStato = tsStato; + } + + // bi-directional many-to-one association to FasFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO") + public FasFascicolo getFasFascicolo() { + return this.fasFascicolo; + } + + public void setFasFascicolo(FasFascicolo fasFascicolo) { + this.fasFascicolo = fasFascicolo; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FasUniOrgRespFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasUniOrgRespFascicolo.java new file mode 100644 index 0000000..e254079 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasUniOrgRespFascicolo.java @@ -0,0 +1,87 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the FAS_UNI_ORG_RESP_FASCICOLO database table. + */ +@Entity +@Table(name = "FAS_UNI_ORG_RESP_FASCICOLO") +public class FasUniOrgRespFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUniOrgRespFascicolo; + + private String cdUniOrgResp; + + private FasFascicolo fasFascicolo; + + public FasUniOrgRespFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UNI_ORG_RESP_FASCICOLO") + @GenericGenerator(name = "SFAS_UNI_ORG_RESP_FASCICOLO_ID_UNI_ORG_RESP_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFAS_UNI_ORG_RESP_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFAS_UNI_ORG_RESP_FASCICOLO_ID_UNI_ORG_RESP_FASCICOLO_GENERATOR") + public Long getIdUniOrgRespFascicolo() { + return this.idUniOrgRespFascicolo; + } + + public void setIdUniOrgRespFascicolo(Long idUniOrgRespFascicolo) { + this.idUniOrgRespFascicolo = idUniOrgRespFascicolo; + } + + @Column(name = "CD_UNI_ORG_RESP") + public String getCdUniOrgResp() { + return this.cdUniOrgResp; + } + + public void setCdUniOrgResp(String cdUniOrgResp) { + this.cdUniOrgResp = cdUniOrgResp; + } + + // bi-directional many-to-one association to FasFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO") + public FasFascicolo getFasFascicolo() { + return this.fasFascicolo; + } + + public void setFasFascicolo(FasFascicolo fasFascicolo) { + this.fasFascicolo = fasFascicolo; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FasUnitaDocFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasUnitaDocFascicolo.java new file mode 100644 index 0000000..6e737c6 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasUnitaDocFascicolo.java @@ -0,0 +1,90 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the FAS_UNITA_DOC_FASCICOLO database table. + */ +@Entity +@Table(name = "FAS_UNITA_DOC_FASCICOLO") +public class FasUnitaDocFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUnitaDocFascicolo; + + private AroUnitaDoc aroUnitaDoc; + + private FasFascicolo fasFascicolo; + + public FasUnitaDocFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UNITA_DOC_FASCICOLO") + @GenericGenerator(name = "SFAS_UNITA_DOC_FASCICOLO_ID_UNITA_DOC_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFAS_UNITA_DOC_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFAS_UNITA_DOC_FASCICOLO_ID_UNITA_DOC_FASCICOLO_GENERATOR") + public Long getIdUnitaDocFascicolo() { + return this.idUnitaDocFascicolo; + } + + public void setIdUnitaDocFascicolo(Long idUnitaDocFascicolo) { + this.idUnitaDocFascicolo = idUnitaDocFascicolo; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC") + public AroUnitaDoc getAroUnitaDoc() { + return this.aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } + + // bi-directional many-to-one association to FasFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO") + public FasFascicolo getFasFascicolo() { + return this.fasFascicolo; + } + + public void setFasFascicolo(FasFascicolo fasFascicolo) { + this.fasFascicolo = fasFascicolo; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FasWarnFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasWarnFascicolo.java new file mode 100644 index 0000000..72de460 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasWarnFascicolo.java @@ -0,0 +1,113 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the FAS_WARN_FASCICOLO database table. + */ +@Entity +@Table(name = "FAS_WARN_FASCICOLO") +public class FasWarnFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idWarnFascicolo; + + private String dsWarn; + + private BigDecimal pgWarn; + + private DecErrSacer decErrSacer; + + private FasFascicolo fasFascicolo; + + public FasWarnFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_WARN_FASCICOLO") + @GenericGenerator(name = "SFAS_WARN_FASCICOLO_ID_WARN_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFAS_WARN_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFAS_WARN_FASCICOLO_ID_WARN_FASCICOLO_GENERATOR") + public Long getIdWarnFascicolo() { + return this.idWarnFascicolo; + } + + public void setIdWarnFascicolo(Long idWarnFascicolo) { + this.idWarnFascicolo = idWarnFascicolo; + } + + @Column(name = "DS_WARN") + public String getDsWarn() { + return this.dsWarn; + } + + public void setDsWarn(String dsWarn) { + this.dsWarn = dsWarn; + } + + @Column(name = "PG_WARN") + public BigDecimal getPgWarn() { + return this.pgWarn; + } + + public void setPgWarn(BigDecimal pgWarn) { + this.pgWarn = pgWarn; + } + + // bi-directional many-to-one association to DecErrSacer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ERR_SACER") + public DecErrSacer getDecErrSacer() { + return this.decErrSacer; + } + + public void setDecErrSacer(DecErrSacer decErrSacer) { + this.decErrSacer = decErrSacer; + } + + // bi-directional many-to-one association to FasFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO") + public FasFascicolo getFasFascicolo() { + return this.fasFascicolo; + } + + public void setFasFascicolo(FasFascicolo fasFascicolo) { + this.fasFascicolo = fasFascicolo; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FasXmlFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasXmlFascicolo.java new file mode 100644 index 0000000..3753f0a --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasXmlFascicolo.java @@ -0,0 +1,148 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.FasXmlFascicolo.TiModXsdFasXmlFascicolo; + +/** + * The persistent class for the FAS_XML_FASCICOLO database table. + */ +@Entity +@Table(name = "FAS_XML_FASCICOLO") +public class FasXmlFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idXmlFascicolo; + + private String blXml; + + private Date dtVersFascicolo; + + private BigDecimal idStrut; + + private TiModXsdFasXmlFascicolo tiModelloXsd; + + private DecModelloXsdFascicolo decModelloXsdFascicolo; + + private FasFascicolo fasFascicolo; + + private String flCanonicalized; + + public FasXmlFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_XML_FASCICOLO") + @GenericGenerator(name = "SFAS_XML_FASCICOLO_ID_XML_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFAS_XML_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFAS_XML_FASCICOLO_ID_XML_FASCICOLO_GENERATOR") + public Long getIdXmlFascicolo() { + return this.idXmlFascicolo; + } + + public void setIdXmlFascicolo(Long idXmlFascicolo) { + this.idXmlFascicolo = idXmlFascicolo; + } + + @Lob + @Column(name = "BL_XML") + public String getBlXml() { + return this.blXml; + } + + public void setBlXml(String blXml) { + this.blXml = blXml; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_VERS_FASCICOLO") + public Date getDtVersFascicolo() { + return this.dtVersFascicolo; + } + + public void setDtVersFascicolo(Date dtVersFascicolo) { + this.dtVersFascicolo = dtVersFascicolo; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_MODELLO_XSD") + public TiModXsdFasXmlFascicolo getTiModelloXsd() { + return this.tiModelloXsd; + } + + public void setTiModelloXsd(TiModXsdFasXmlFascicolo tiModelloXsd) { + this.tiModelloXsd = tiModelloXsd; + } + + // bi-directional many-to-one association to DecModelloXsdFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_MODELLO_XSD_FASCICOLO") + public DecModelloXsdFascicolo getDecModelloXsdFascicolo() { + return this.decModelloXsdFascicolo; + } + + public void setDecModelloXsdFascicolo(DecModelloXsdFascicolo decModelloXsdFascicolo) { + this.decModelloXsdFascicolo = decModelloXsdFascicolo; + } + + // bi-directional many-to-one association to FasFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO") + public FasFascicolo getFasFascicolo() { + return this.fasFascicolo; + } + + public void setFasFascicolo(FasFascicolo fasFascicolo) { + this.fasFascicolo = fasFascicolo; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FasXmlVersFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasXmlVersFascicolo.java new file mode 100644 index 0000000..051e034 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FasXmlVersFascicolo.java @@ -0,0 +1,205 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the FAS_XML_VERS_FASCICOLO database table. + */ +@Entity +@Table(name = "FAS_XML_VERS_FASCICOLO") +public class FasXmlVersFascicolo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idXmlVersFascicolo; + + private String blXmlVers; + + private String cdEncodingHashXmlVers; + + private String cdVersioneXml; + + private String dsAlgoHashXmlVers; + + private String dsHashXmlVers; + + private String dsUrnXmlVers; + + private String dsUrnNormalizXmlVers; + + private Date dtVersFascicolo; + + private BigDecimal idStrut; + + private String tiXmlVers; + + private String flCanonicalized; + + private FasFascicolo fasFascicolo; + + public FasXmlVersFascicolo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_XML_VERS_FASCICOLO") + @GenericGenerator(name = "SFAS_XML_VERS_FASCICOLO_ID_XML_VERS_FASCICOLO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFAS_XML_VERS_FASCICOLO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFAS_XML_VERS_FASCICOLO_ID_XML_VERS_FASCICOLO_GENERATOR") + public Long getIdXmlVersFascicolo() { + return this.idXmlVersFascicolo; + } + + public void setIdXmlVersFascicolo(Long idXmlVersFascicolo) { + this.idXmlVersFascicolo = idXmlVersFascicolo; + } + + @Lob + @Column(name = "BL_XML_VERS") + public String getBlXmlVers() { + return this.blXmlVers; + } + + public void setBlXmlVers(String blXmlVers) { + this.blXmlVers = blXmlVers; + } + + @Column(name = "CD_ENCODING_HASH_XML_VERS") + public String getCdEncodingHashXmlVers() { + return this.cdEncodingHashXmlVers; + } + + public void setCdEncodingHashXmlVers(String cdEncodingHashXmlVers) { + this.cdEncodingHashXmlVers = cdEncodingHashXmlVers; + } + + @Column(name = "CD_VERSIONE_XML") + public String getCdVersioneXml() { + return this.cdVersioneXml; + } + + public void setCdVersioneXml(String cdVersioneXml) { + this.cdVersioneXml = cdVersioneXml; + } + + @Column(name = "DS_ALGO_HASH_XML_VERS") + public String getDsAlgoHashXmlVers() { + return this.dsAlgoHashXmlVers; + } + + public void setDsAlgoHashXmlVers(String dsAlgoHashXmlVers) { + this.dsAlgoHashXmlVers = dsAlgoHashXmlVers; + } + + @Column(name = "DS_HASH_XML_VERS") + public String getDsHashXmlVers() { + return this.dsHashXmlVers; + } + + public void setDsHashXmlVers(String dsHashXmlVers) { + this.dsHashXmlVers = dsHashXmlVers; + } + + @Column(name = "DS_URN_XML_VERS") + public String getDsUrnXmlVers() { + return this.dsUrnXmlVers; + } + + public void setDsUrnXmlVers(String dsUrnXmlVers) { + this.dsUrnXmlVers = dsUrnXmlVers; + } + + @Column(name = "DS_URN_NORMALIZ_XML_VERS") + public String getDsUrnNormalizXmlVers() { + return this.dsUrnNormalizXmlVers; + } + + public void setDsUrnNormalizXmlVers(String dsUrnNormalizXmlVers) { + this.dsUrnNormalizXmlVers = dsUrnNormalizXmlVers; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_VERS_FASCICOLO") + public Date getDtVersFascicolo() { + return this.dtVersFascicolo; + } + + public void setDtVersFascicolo(Date dtVersFascicolo) { + this.dtVersFascicolo = dtVersFascicolo; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "TI_XML_VERS") + public String getTiXmlVers() { + return this.tiXmlVers; + } + + public void setTiXmlVers(String tiXmlVers) { + this.tiXmlVers = tiXmlVers; + } + + // bi-directional many-to-one association to FasFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO") + public FasFascicolo getFasFascicolo() { + return this.fasFascicolo; + } + + public void setFasFascicolo(FasFascicolo fasFascicolo) { + this.fasFascicolo = fasFascicolo; + } + + @Column(name = "FL_CANONICALIZED", columnDefinition = "CHAR") + public String getFlCanonicalized() { + return this.flCanonicalized; + } + + public void setFlCanonicalized(String flCanonicalized) { + this.flCanonicalized = flCanonicalized; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FirCertifCa.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirCertifCa.java new file mode 100644 index 0000000..4e37b9c --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirCertifCa.java @@ -0,0 +1,236 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.TimeZone; + +import javax.persistence.Cacheable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.converter.NeverendingDateConverter; + +/** + * The persistent class for the FIR_CERTIF_CA database table. + * + */ +@Entity +@Cacheable(true) +@Table(name = "FIR_CERTIF_CA") +public class FirCertifCa implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idCertifCa; + + private List firUrlDistribCrls = new ArrayList<>(); + + private List firUrlDistribOcsps = new ArrayList<>(); + + private Date dtFinValCertifCa; + + private Date dtIniValCertifCa; + + private BigDecimal niSerialCertifCa; + + private List firCertifFirmatarios = new ArrayList<>(); + + private List firCrls = new ArrayList<>(); + + private List firCertifOcsps = new ArrayList<>(); + + private FirFilePerFirma firFilePerFirma; + + private String dsSubjectKeyId; + + private String dlDnIssuerCertifCa; + private String dlDnSubjectCertifCa; + + public FirCertifCa() {/* Hibernate */ + } + + @Id + @Column(name = "ID_CERTIF_CA") + @GenericGenerator(name = "SFIR_CERTIF_CA_ID_CERTIF_CA_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFIR_CERTIF_CA"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFIR_CERTIF_CA_ID_CERTIF_CA_GENERATOR") + public Long getIdCertifCa() { + return this.idCertifCa; + } + + public void setIdCertifCa(Long idCertifCa) { + this.idCertifCa = idCertifCa; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_FIN_VAL_CERTIF_CA") + public Date getDtFinValCertifCa() { + return this.dtFinValCertifCa; + } + + public void setDtFinValCertifCa(Date dtFinValCertifCa) { + this.dtFinValCertifCa = dtFinValCertifCa; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_INI_VAL_CERTIF_CA") + public Date getDtIniValCertifCa() { + return this.dtIniValCertifCa; + } + + public void setDtIniValCertifCa(Date dtIniValCertifCa) { + this.dtIniValCertifCa = dtIniValCertifCa; + } + + @Column(name = "NI_SERIAL_CERTIF_CA") + public BigDecimal getNiSerialCertifCa() { + return this.niSerialCertifCa; + } + + public void setNiSerialCertifCa(BigDecimal niSerialCertifCa) { + this.niSerialCertifCa = niSerialCertifCa; + } + + @Column(name = "DS_SUBJECT_KEY_ID") + public String getDsSubjectKeyId() { + return dsSubjectKeyId; + } + + public void setDsSubjectKeyId(String dsSubjectKeyId) { + this.dsSubjectKeyId = dsSubjectKeyId; + } + + @Column(name = "DL_DN_ISSUER_CERTIF_CA") + public String getDlDnIssuerCertifCa() { + return dlDnIssuerCertifCa; + } + + public void setDlDnIssuerCertifCa(String dlDnIssuerCertifCa) { + this.dlDnIssuerCertifCa = dlDnIssuerCertifCa; + } + + @Column(name = "DL_DN_SUBJECT_CERTIF_CA") + public String getDlDnSubjectCertifCa() { + return dlDnSubjectCertifCa; + } + + public void setDlDnSubjectCertifCa(String dlDnSubjectCertifCa) { + this.dlDnSubjectCertifCa = dlDnSubjectCertifCa; + } + + // bi-directional many-to-one association to FirCertifFirmatario + @OneToMany(mappedBy = "firCertifCa", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getFirCertifFirmatarios() { + return this.firCertifFirmatarios; + } + + public void setFirCertifFirmatarios(List firCertifFirmatarios) { + this.firCertifFirmatarios = firCertifFirmatarios; + } + + // bi-directional many-to-one association to FirCrl + @OneToMany(mappedBy = "firCertifCa", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getFirCrls() { + return this.firCrls; + } + + public void setFirCrls(List firCrls) { + this.firCrls = firCrls; + } + + // bi-directional many-to-one association to FirCrl + @OneToMany(mappedBy = "firCertifCa", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getFirCertifOcsps() { + return this.firCertifOcsps; + } + + public void setFirCertifOcsps(List firCertifOcsps) { + this.firCertifOcsps = firCertifOcsps; + } + + // bi-directional one-to-one association to FirFilePerFirma + @OneToOne(mappedBy = "firCertifCa", cascade = { CascadeType.PERSIST, CascadeType.MERGE, + CascadeType.REFRESH }, fetch = FetchType.LAZY) + public FirFilePerFirma getFirFilePerFirma() { + return this.firFilePerFirma; + } + + public void setFirFilePerFirma(FirFilePerFirma firFilePerFirma) { + this.firFilePerFirma = firFilePerFirma; + } + + // bi-directional many-to-one association to FirUrlDistribCrl + @OneToMany(mappedBy = "firCertifCa", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getFirUrlDistribCrls() { + return this.firUrlDistribCrls; + } + + public void setFirUrlDistribCrls(List firUrlDistribCrls) { + this.firUrlDistribCrls = firUrlDistribCrls; + } + + // bi-directional many-to-one association to FirUrlDistribCrl + @OneToMany(mappedBy = "firCertifCa", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getFirUrlDistribOcsps() { + return this.firUrlDistribOcsps; + } + + public void setFirUrlDistribOcsps(List firUrlDistribOcsps) { + this.firUrlDistribOcsps = firUrlDistribOcsps; + } + + /** + * Secondo specifica RFC5280 https://tools.ietf.org/html/rfc5280#section-5.1.2.5 le date sarebbero normalemente + * espresse in UTC/GMT Il sistema però persistente con il TZ locale (ossia GMT+01), esiste un caso "particolare" di + * timestamp : 9999/31/12 23:59:59 UTC che per un hard limit di ORACLE DB non può essere persisto (la sua + * conversione in GMT+01 lo trasforma in 10000/01/01 00:59:59 GMT+01) che non può essere persistito e/o letto + */ + @PrePersist + void preInsert() { + this.dtFinValCertifCa = NeverendingDateConverter.verifyOverZoneId(this.dtFinValCertifCa, + TimeZone.getTimeZone("UTC").toZoneId()); + } + + @PreUpdate + void preUpdate() { + this.dtFinValCertifCa = NeverendingDateConverter.verifyOverZoneId(this.dtFinValCertifCa, + TimeZone.getTimeZone("UTC").toZoneId()); + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FirCertifFirmatario.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirCertifFirmatario.java new file mode 100644 index 0000000..6aed6f8 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirCertifFirmatario.java @@ -0,0 +1,133 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Cacheable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the FIR_CERTIF_FIRMATARIO database table. + */ +@Entity +@Cacheable(true) +@Table(name = "FIR_CERTIF_FIRMATARIO") +public class FirCertifFirmatario implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idCertifFirmatario; + + private Date dtFinValCertifFirmatario; + + private Date dtIniValCertifFirmatario; + + private BigDecimal niSerialCertifFirmatario; + + private FirCertifCa firCertifCa; + + private FirFilePerFirma firFilePerFirma; + + public FirCertifFirmatario() {/* Hibernate */ + } + + @Id + @Column(name = "ID_CERTIF_FIRMATARIO") + @GenericGenerator(name = "SFIR_CERTIF_FIRMATARIO_ID_CERTIF_FIRMATARIO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFIR_CERTIF_FIRMATARIO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFIR_CERTIF_FIRMATARIO_ID_CERTIF_FIRMATARIO_GENERATOR") + public Long getIdCertifFirmatario() { + return this.idCertifFirmatario; + } + + public void setIdCertifFirmatario(Long idCertifFirmatario) { + this.idCertifFirmatario = idCertifFirmatario; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_FIN_VAL_CERTIF_FIRMATARIO") + public Date getDtFinValCertifFirmatario() { + return this.dtFinValCertifFirmatario; + } + + public void setDtFinValCertifFirmatario(Date dtFinValCertifFirmatario) { + this.dtFinValCertifFirmatario = dtFinValCertifFirmatario; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_INI_VAL_CERTIF_FIRMATARIO") + public Date getDtIniValCertifFirmatario() { + return this.dtIniValCertifFirmatario; + } + + public void setDtIniValCertifFirmatario(Date dtIniValCertifFirmatario) { + this.dtIniValCertifFirmatario = dtIniValCertifFirmatario; + } + + @Column(name = "NI_SERIAL_CERTIF_FIRMATARIO") + public BigDecimal getNiSerialCertifFirmatario() { + return this.niSerialCertifFirmatario; + } + + public void setNiSerialCertifFirmatario(BigDecimal niSerialCertifFirmatario) { + this.niSerialCertifFirmatario = niSerialCertifFirmatario; + } + + // bi-directional many-to-one association to FirCertifCa + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CERTIF_CA") + public FirCertifCa getFirCertifCa() { + return this.firCertifCa; + } + + public void setFirCertifCa(FirCertifCa firCertifCa) { + this.firCertifCa = firCertifCa; + } + + // bi-directional one-to-one association to FirFilePerFirma + @OneToOne(mappedBy = "firCertifFirmatario", cascade = { CascadeType.PERSIST, CascadeType.MERGE, + CascadeType.REFRESH }, fetch = FetchType.LAZY) + public FirFilePerFirma getFirFilePerFirma() { + return this.firFilePerFirma; + } + + public void setFirFilePerFirma(FirFilePerFirma firFilePerFirma) { + this.firFilePerFirma = firFilePerFirma; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FirCertifOcsp.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirCertifOcsp.java new file mode 100644 index 0000000..3862cf8 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirCertifOcsp.java @@ -0,0 +1,148 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Cacheable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * The persistent class for the FIR_CERTIF_OCSP database table. + * + */ +@Entity +@Cacheable(true) +@Table(name = "FIR_CERTIF_OCSP") +public class FirCertifOcsp implements Serializable { + private static final long serialVersionUID = 1L; + private Long idCertifOcsp; + private Date dtFinValCertifOcsp; + private Date dtIniValCertifOcsp; + private BigDecimal niSerialCertifOcsp; + private String dlDnSubjectCertifOcsp; + + private FirCertifCa firCertifCa; + private FirFilePerFirma firFilePerFirma; + private List firOcsps = new ArrayList<>(); + + public FirCertifOcsp() { + // hibernate + } + + @Id + @SequenceGenerator(name = "FIR_CERTIF_OCSP_IDCERTIFFIRMATARIO_GENERATOR", sequenceName = "SFIR_CERTIF_OCSP", allocationSize = 1) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "FIR_CERTIF_OCSP_IDCERTIFFIRMATARIO_GENERATOR") + @Column(name = "ID_CERTIF_OCSP") + public Long getIdCertifOcsp() { + return this.idCertifOcsp; + } + + public void setIdCertifOcsp(Long idCertifOcsp) { + this.idCertifOcsp = idCertifOcsp; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_FIN_VAL_CERTIF_OCSP") + public Date getDtFinValCertifOcsp() { + return this.dtFinValCertifOcsp; + } + + public void setDtFinValCertifOcsp(Date dtFinValCertifOcsp) { + this.dtFinValCertifOcsp = dtFinValCertifOcsp; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_INI_VAL_CERTIF_OCSP") + public Date getDtIniValCertifOcsp() { + return this.dtIniValCertifOcsp; + } + + public void setDtIniValCertifOcsp(Date dtIniValCertifOcsp) { + this.dtIniValCertifOcsp = dtIniValCertifOcsp; + } + + @Column(name = "NI_SERIAL_CERTIF_OCSP") + public BigDecimal getNiSerialCertifOcsp() { + return this.niSerialCertifOcsp; + } + + public void setNiSerialCertifOcsp(BigDecimal niSerialCertifOcsp) { + this.niSerialCertifOcsp = niSerialCertifOcsp; + } + + // bi-directional many-to-one association to FirCertifCa + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CERTIF_CA") + public FirCertifCa getFirCertifCa() { + return this.firCertifCa; + } + + public void setFirCertifCa(FirCertifCa firCertifCa) { + this.firCertifCa = firCertifCa; + } + + @Column(name = "DL_DN_SUBJECT_CERTIF_OCSP") + public String getDlDnSubjectCertifOcsp() { + return dlDnSubjectCertifOcsp; + } + + public void setDlDnSubjectCertifOcsp(String dlDnSubjectCertifOcsp) { + this.dlDnSubjectCertifOcsp = dlDnSubjectCertifOcsp; + } + + // bi-directional one-to-one association to FirFilePerFirma + @OneToOne(mappedBy = "firCertifOcsp", cascade = { CascadeType.PERSIST, CascadeType.MERGE, + CascadeType.REFRESH }, fetch = FetchType.LAZY) + public FirFilePerFirma getFirFilePerFirma() { + return this.firFilePerFirma; + } + + public void setFirFilePerFirma(FirFilePerFirma firFilePerFirma) { + this.firFilePerFirma = firFilePerFirma; + } + + // bi-directional many-to-one association to FirCrl + @OneToMany(mappedBy = "firCertifOcsp", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getFirOcsps() { + return this.firOcsps; + } + + public void setFirOcsps(List firOcsps) { + this.firOcsps = firOcsps; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FirCrl.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirCrl.java new file mode 100644 index 0000000..3399309 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirCrl.java @@ -0,0 +1,156 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.TimeZone; + +import javax.persistence.Cacheable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.converter.NeverendingDateConverter; + +/** + * The persistent class for the FIR_CRL database table. + */ +@Entity +@Cacheable(true) +@Table(name = "FIR_CRL") +public class FirCrl implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idCrl; + + private Date dtIniCrl; + + private Date dtScadCrl; + + private BigDecimal niSerialCrl; + + private FirCertifCa firCertifCa; + + private FirFilePerFirma firFilePerFirma; + + public FirCrl() {/* Hibernate */ + } + + @Id + @Column(name = "ID_CRL") + @GenericGenerator(name = "SFIR_CRL_ID_CRL_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFIR_CRL"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFIR_CRL_ID_CRL_GENERATOR") + public Long getIdCrl() { + return this.idCrl; + } + + public void setIdCrl(Long idCrl) { + this.idCrl = idCrl; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_INI_CRL") + public Date getDtIniCrl() { + return this.dtIniCrl; + } + + public void setDtIniCrl(Date dtIniCrl) { + this.dtIniCrl = dtIniCrl; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SCAD_CRL") + public Date getDtScadCrl() { + return this.dtScadCrl; + } + + public void setDtScadCrl(Date dtScadCrl) { + this.dtScadCrl = dtScadCrl; + } + + @Column(name = "NI_SERIAL_CRL") + public BigDecimal getNiSerialCrl() { + return this.niSerialCrl; + } + + public void setNiSerialCrl(BigDecimal niSerialCrl) { + this.niSerialCrl = niSerialCrl; + } + + // bi-directional many-to-one association to FirCertifCa + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CERTIF_CA") + public FirCertifCa getFirCertifCa() { + return this.firCertifCa; + } + + public void setFirCertifCa(FirCertifCa firCertifCa) { + this.firCertifCa = firCertifCa; + } + + // bi-directional one-to-one association to FirFilePerFirma + @OneToOne(mappedBy = "firCrl", cascade = { CascadeType.PERSIST, CascadeType.MERGE, + CascadeType.REFRESH }, fetch = FetchType.LAZY) + public FirFilePerFirma getFirFilePerFirma() { + return this.firFilePerFirma; + } + + public void setFirFilePerFirma(FirFilePerFirma firFilePerFirma) { + this.firFilePerFirma = firFilePerFirma; + } + + /** + * Secondo specifica RFC5280 https://tools.ietf.org/html/rfc5280#section-5.1.2.5 le date sarebbero normalemente + * espresse in UTC/GMT Il sistema però persistente con il TZ locale (ossia GMT+01), esiste un caso "particolare" di + * timestamp : 9999/31/12 23:59:59 UTC che per un hard limit di ORACLE DB non può essere persisto (la sua + * conversione in GMT+01 lo trasforma in 10000/01/01 00:59:59 GMT+01) che non può essere persistito e/o letto + */ + @PrePersist + void preInsert() { + this.dtScadCrl = NeverendingDateConverter.verifyOverZoneId(this.dtScadCrl, + TimeZone.getTimeZone("UTC").toZoneId()); + } + + @PreUpdate + void preUpdate() { + this.dtScadCrl = NeverendingDateConverter.verifyOverZoneId(this.dtScadCrl, + TimeZone.getTimeZone("UTC").toZoneId()); + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FirFilePerFirma.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirFilePerFirma.java new file mode 100644 index 0000000..00d6512 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirFilePerFirma.java @@ -0,0 +1,164 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the FIR_FILE_PER_FIRMA database table. + */ +@Entity +@Table(name = "FIR_FILE_PER_FIRMA") +public class FirFilePerFirma implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idFilePerFirma; + + private byte[] blFilePerFirma; + + private String nmFileDownload; + + private String tiFilePerFirma; + + private FirCertifCa firCertifCa; + + private FirCertifFirmatario firCertifFirmatario; + + private FirCertifOcsp firCertifOcsp; + + private FirCrl firCrl; + + private FirOcsp firOcsp; + + public FirFilePerFirma() {/* Hibernate */ + } + + @Id + @Column(name = "ID_FILE_PER_FIRMA") + @GenericGenerator(name = "SFIR_FILE_PER_FIRMA_ID_FILE_PER_FIRMA_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFIR_FILE_PER_FIRMA"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFIR_FILE_PER_FIRMA_ID_FILE_PER_FIRMA_GENERATOR") + public Long getIdFilePerFirma() { + return this.idFilePerFirma; + } + + public void setIdFilePerFirma(Long idFilePerFirma) { + this.idFilePerFirma = idFilePerFirma; + } + + @Lob() + @Column(name = "BL_FILE_PER_FIRMA") + public byte[] getBlFilePerFirma() { + return this.blFilePerFirma; + } + + public void setBlFilePerFirma(byte[] blFilePerFirma) { + this.blFilePerFirma = blFilePerFirma; + } + + @Column(name = "NM_FILE_DOWNLOAD") + public String getNmFileDownload() { + return this.nmFileDownload; + } + + public void setNmFileDownload(String nmFileDownload) { + this.nmFileDownload = nmFileDownload; + } + + @Column(name = "TI_FILE_PER_FIRMA") + public String getTiFilePerFirma() { + return this.tiFilePerFirma; + } + + public void setTiFilePerFirma(String tiFilePerFirma) { + this.tiFilePerFirma = tiFilePerFirma; + } + + // bi-directional one-to-one association to FirCertifCa + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CERTIF_CA") + public FirCertifCa getFirCertifCa() { + return this.firCertifCa; + } + + public void setFirCertifCa(FirCertifCa firCertifCa) { + this.firCertifCa = firCertifCa; + } + + // bi-directional one-to-one association to FirCertifFirmatario + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CERTIF_FIRMATARIO") + public FirCertifFirmatario getFirCertifFirmatario() { + return this.firCertifFirmatario; + } + + public void setFirCertifFirmatario(FirCertifFirmatario firCertifFirmatario) { + this.firCertifFirmatario = firCertifFirmatario; + } + + // bi-directional one-to-one association to FirCertifFirmatario + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CERTIF_OCSP") + public FirCertifOcsp getFirCertifOcsp() { + return this.firCertifOcsp; + } + + public void setFirCertifOcsp(FirCertifOcsp firCertifOcsp) { + this.firCertifOcsp = firCertifOcsp; + } + + // bi-directional one-to-one association to FirCrl + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CRL") + public FirCrl getFirCrl() { + return this.firCrl; + } + + public void setFirCrl(FirCrl firCrl) { + this.firCrl = firCrl; + } + + // bi-directional one-to-one association to FirCrl + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_OCSP") + public FirOcsp getFirOcsp() { + return this.firOcsp; + } + + public void setFirOcsp(FirOcsp firOcsp) { + this.firOcsp = firOcsp; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FirOcsp.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirOcsp.java new file mode 100644 index 0000000..b5410ef --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirOcsp.java @@ -0,0 +1,117 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Cacheable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +/** + * The persistent class for the FIR_OCSP database table. + * + */ +@Entity +@Cacheable(true) +@Table(name = "FIR_OCSP") +public class FirOcsp implements Serializable { + private static final long serialVersionUID = 1L; + private Long idOcsp; + private String dsCertifIssuername; + private String dsCertifSerialBase64; + private String dsCertifSkiBase64; + + private FirCertifOcsp firCertifOcsp; + private FirFilePerFirma firFilePerFirma; + + public FirOcsp() {/* Hibernate */ + } + + @Id + @SequenceGenerator(name = "FIR_OCSP_IDOCSP_GENERATOR", sequenceName = "SFIR_OCSP", allocationSize = 1) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "FIR_OCSP_IDOCSP_GENERATOR") + @Column(name = "ID_OCSP") + public Long getIdOcsp() { + return this.idOcsp; + } + + public void setIdOcsp(Long idOcsp) { + this.idOcsp = idOcsp; + } + + @Column(name = "DS_CERTIF_ISSUERNAME") + public String getDsCertifIssuername() { + return this.dsCertifIssuername; + } + + public void setDsCertifIssuername(String dsCertifIssuername) { + this.dsCertifIssuername = dsCertifIssuername; + } + + @Column(name = "DS_CERTIF_SERIAL_BASE64") + public String getDsCertifSerialBase64() { + return this.dsCertifSerialBase64; + } + + public void setDsCertifSerialBase64(String dsCertifSerialBase64) { + this.dsCertifSerialBase64 = dsCertifSerialBase64; + } + + @Column(name = "DS_CERTIF_SKI_BASE64") + public String getDsCertifSkiBase64() { + return this.dsCertifSkiBase64; + } + + public void setDsCertifSkiBase64(String dsCertifSkiBase64) { + this.dsCertifSkiBase64 = dsCertifSkiBase64; + } + + // bi-directional many-to-one association to FirCertifCa + @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CERTIF_OCSP") + public FirCertifOcsp getFirCertifOcsp() { + return this.firCertifOcsp; + } + + public void setFirCertifOcsp(FirCertifOcsp firCertifOcsp) { + this.firCertifOcsp = firCertifOcsp; + } + + // bi-directional one-to-one association to FirFilePerFirma + @OneToOne(mappedBy = "firOcsp", cascade = { CascadeType.PERSIST, CascadeType.MERGE, + CascadeType.REFRESH }, fetch = FetchType.LAZY) + public FirFilePerFirma getFirFilePerFirma() { + return this.firFilePerFirma; + } + + public void setFirFilePerFirma(FirFilePerFirma firFilePerFirma) { + this.firFilePerFirma = firFilePerFirma; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FirReport.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirReport.java new file mode 100644 index 0000000..8d67a5f --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirReport.java @@ -0,0 +1,141 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the FIR_REPORT database table. + */ +@Entity +@Table(name = "FIR_REPORT") +public class FirReport implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idFirReport; + + private AroCompDoc aroCompDoc; + + private List firUrnReports = new ArrayList<>(); + + private byte[] blContenutoReport; + + private String cdKeyFile; + + private String nmBucket; + + private DecBackend decBackend; + + public FirReport() { + // hibernate + } + + @Id + @Column(name = "ID_FIR_REPORT") + @GenericGenerator(name = "SFIR_REPORT_ID_FIR_REPORT_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFIR_REPORT"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFIR_REPORT_ID_FIR_REPORT_GENERATOR") + public Long getIdFirReport() { + return this.idFirReport; + } + + public void setIdFirReport(Long idFirReport) { + this.idFirReport = idFirReport; + } + + @Lob() + @Column(name = "BL_CONTENUTO_REPORT") + public byte[] getBlContenutoReport() { + return blContenutoReport; + } + + public void setBlContenutoReport(byte[] blContenutoReport) { + this.blContenutoReport = blContenutoReport; + } + + @Column(name = "CD_KEY_FILE") + public String getCdKeyFile() { + return this.cdKeyFile; + } + + public void setCdKeyFile(String cdKeyFile) { + this.cdKeyFile = cdKeyFile; + } + + @Column(name = "NM_BUCKET") + public String getNmBucket() { + return this.nmBucket; + } + + public void setNmBucket(String nmBucket) { + this.nmBucket = nmBucket; + } + + // bi-directional many-to-one association to AroCompDoc + @ManyToOne + @JoinColumn(name = "ID_COMP_DOC") + public AroCompDoc getAroCompDoc() { + return this.aroCompDoc; + } + + public void setAroCompDoc(AroCompDoc aroCompDoc) { + this.aroCompDoc = aroCompDoc; + } + + // bi-directional many-to-one association to DecReportServizioVerificaCompDoc + @OneToMany(mappedBy = "firReport", cascade = { CascadeType.PERSIST, CascadeType.DETACH, CascadeType.MERGE, + CascadeType.REFRESH }, fetch = FetchType.LAZY) + public List getFirUrnReports() { + return firUrnReports; + } + + public void setFirUrnReports(List firUrnReports) { + this.firUrnReports = firUrnReports; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DEC_BACKEND") + public DecBackend getDecBackend() { + return decBackend; + } + + public void setDecBackend(DecBackend decBackend) { + this.decBackend = decBackend; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FirUrlDistribCrl.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirUrlDistribCrl.java new file mode 100644 index 0000000..b6e2c1e --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirUrlDistribCrl.java @@ -0,0 +1,100 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the FIR_URL_DISTRIB_CRL database table. + */ +@Entity +@Table(name = "FIR_URL_DISTRIB_CRL") +public class FirUrlDistribCrl implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUrlDistribCrl; + + private String dlUrlDistribCrl; + + private BigDecimal niOrdUrlDistribCrl; + + private FirCertifCa firCertifCa; + + public FirUrlDistribCrl() {/* Hibernate */ + } + + @Id + @Column(name = "ID_URL_DISTRIB_CRL") + @GenericGenerator(name = "SFIR_URL_DISTRIB_CRL_ID_URL_DISTRIB_CRL_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SFIR_URL_DISTRIB_CRL"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SFIR_URL_DISTRIB_CRL_ID_URL_DISTRIB_CRL_GENERATOR") + public Long getIdUrlDistribCrl() { + return this.idUrlDistribCrl; + } + + public void setIdUrlDistribCrl(Long idUrlDistribCrl) { + this.idUrlDistribCrl = idUrlDistribCrl; + } + + @Column(name = "DL_URL_DISTRIB_CRL") + public String getDlUrlDistribCrl() { + return this.dlUrlDistribCrl; + } + + public void setDlUrlDistribCrl(String dlUrlDistribCrl) { + this.dlUrlDistribCrl = dlUrlDistribCrl; + } + + @Column(name = "NI_ORD_URL_DISTRIB_CRL") + public BigDecimal getNiOrdUrlDistribCrl() { + return this.niOrdUrlDistribCrl; + } + + public void setNiOrdUrlDistribCrl(BigDecimal niOrdUrlDistribCrl) { + this.niOrdUrlDistribCrl = niOrdUrlDistribCrl; + } + + // bi-directional many-to-one association to FirCertifCa + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CERTIF_CA") + public FirCertifCa getFirCertifCa() { + return this.firCertifCa; + } + + public void setFirCertifCa(FirCertifCa firCertifCa) { + this.firCertifCa = firCertifCa; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FirUrlDistribOcsp.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirUrlDistribOcsp.java new file mode 100644 index 0000000..a6e53e4 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirUrlDistribOcsp.java @@ -0,0 +1,91 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +/** + * The persistent class for the FIR_URL_DISTRIB_CRL database table. + * + */ +@Entity +@Table(name = "FIR_URL_DISTRIB_OCSP") +public class FirUrlDistribOcsp implements Serializable { + private static final long serialVersionUID = 1L; + private Long idUrlDistribOcsp; + private String dlUrlDistribOcsp; + private BigDecimal niOrdUrlDistribOcsp; + private FirCertifCa firCertifCa; + + public FirUrlDistribOcsp() {/* Hibernate */ + } + + @Id + @SequenceGenerator(name = "FIR_URL_DISTRIB_OCSP_IDURLDISTRIBOCSP_GENERATOR", sequenceName = "SFIR_URL_DISTRIB_OCSP", allocationSize = 1) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "FIR_URL_DISTRIB_OCSP_IDURLDISTRIBOCSP_GENERATOR") + @Column(name = "ID_URL_DISTRIB_OCSP") + public Long getIdUrlDistribOcsp() { + return this.idUrlDistribOcsp; + } + + public void setIdUrlDistribOcsp(Long idUrlDistribOcsp) { + this.idUrlDistribOcsp = idUrlDistribOcsp; + } + + @Column(name = "DL_URL_DISTRIB_OCSP") + public String getDlUrlDistribOcsp() { + return this.dlUrlDistribOcsp; + } + + public void setDlUrlDistribOcsp(String dlUrlDistribOcsp) { + this.dlUrlDistribOcsp = dlUrlDistribOcsp; + } + + @Column(name = "NI_ORD_URL_DISTRIB_OCSP") + public BigDecimal getNiOrdUrlDistribOcsp() { + return this.niOrdUrlDistribOcsp; + } + + public void setNiOrdUrlDistribOcsp(BigDecimal niOrdUrlDistribOcsp) { + this.niOrdUrlDistribOcsp = niOrdUrlDistribOcsp; + } + + // bi-directional many-to-one association to FirCertifCa + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CERTIF_CA") + public FirCertifCa getFirCertifCa() { + return this.firCertifCa; + } + + public void setFirCertifCa(FirCertifCa firCertifCa) { + this.firCertifCa = firCertifCa; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/FirUrnReport.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirUrnReport.java new file mode 100644 index 0000000..52bdadc --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/FirUrnReport.java @@ -0,0 +1,95 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +import it.eng.parer.entity.constraint.FiUrnReport.TiUrnReport; + +/** + * The persistent class for the ELV_URN_ELENCO_VERS database table. + * + */ +@Entity +@Table(name = "FIR_URN_REPORT") +public class FirUrnReport implements Serializable { + private static final long serialVersionUID = 1L; + private Long idUrnReport; + private String dsUrn; + private TiUrnReport tiUrn; + private FirReport firReport; + + public FirUrnReport() {/* Hibernate */ + } + + @Id + @SequenceGenerator(name = "FIR_URN_REPORT_IDURNREPORT_GENERATOR", sequenceName = "SFIR_URN_REPORT", allocationSize = 1) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "FIR_URN_REPORT_IDURNREPORT_GENERATOR") + @Column(name = "ID_URN_REPORT") + public Long getIdUrnReport() { + return this.idUrnReport; + } + + public void setIdUrnReport(Long idUrnReport) { + this.idUrnReport = idUrnReport; + } + + @Column(name = "DS_URN") + public String getDsUrn() { + return this.dsUrn; + } + + public void setDsUrn(String dsUrn) { + this.dsUrn = dsUrn; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_URN") + public TiUrnReport getTiUrn() { + return this.tiUrn; + } + + public void setTiUrn(TiUrnReport tiUrn) { + this.tiUrn = tiUrn; + } + + // bi-directional many-to-one association to FirReport + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_REPORT") + public FirReport getFirReport() { + return this.firReport; + } + + public void setFirReport(FirReport firReport) { + this.firReport = firReport; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/IamAbilOrganiz.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/IamAbilOrganiz.java new file mode 100644 index 0000000..7fcbd82 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/IamAbilOrganiz.java @@ -0,0 +1,129 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the IAM_ABIL_ORGANIZ database table. + */ +@Entity +@Table(name = "IAM_ABIL_ORGANIZ") +public class IamAbilOrganiz implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idAbilOrganiz; + + private String flOrganizDefault; + + private BigDecimal idOrganizApplic; + + private IamUser iamUser; + + private List iamAbilTipoDatos = new ArrayList<>(); + + private List iamAutorServs = new ArrayList<>(); + + public IamAbilOrganiz() {/* Hibernate */ + } + + @Id + @Column(name = "ID_ABIL_ORGANIZ") + @GenericGenerator(name = "SIAM_ABIL_ORGANIZ_ID_ABIL_ORGANIZ_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SIAM_ABIL_ORGANIZ"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SIAM_ABIL_ORGANIZ_ID_ABIL_ORGANIZ_GENERATOR") + public Long getIdAbilOrganiz() { + return this.idAbilOrganiz; + } + + public void setIdAbilOrganiz(Long idAbilOrganiz) { + this.idAbilOrganiz = idAbilOrganiz; + } + + @Column(name = "FL_ORGANIZ_DEFAULT", columnDefinition = "char(1)") + public String getFlOrganizDefault() { + return this.flOrganizDefault; + } + + public void setFlOrganizDefault(String flOrganizDefault) { + this.flOrganizDefault = flOrganizDefault; + } + + @Column(name = "ID_ORGANIZ_APPLIC") + public BigDecimal getIdOrganizApplic() { + return this.idOrganizApplic; + } + + public void setIdOrganizApplic(BigDecimal idOrganizApplic) { + this.idOrganizApplic = idOrganizApplic; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USER_IAM") + public IamUser getIamUser() { + return this.iamUser; + } + + public void setIamUser(IamUser iamUser) { + this.iamUser = iamUser; + } + + // bi-directional many-to-one association to IamAbilTipoDato + @OneToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH, + CascadeType.REMOVE }, mappedBy = "iamAbilOrganiz") + public List getIamAbilTipoDatos() { + return this.iamAbilTipoDatos; + } + + public void setIamAbilTipoDatos(List iamAbilTipoDatos) { + this.iamAbilTipoDatos = iamAbilTipoDatos; + } + + // bi-directional many-to-one association to IamAutorServ + @OneToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH, + CascadeType.REMOVE }, mappedBy = "iamAbilOrganiz") + public List getIamAutorServs() { + return this.iamAutorServs; + } + + public void setIamAutorServs(List iamAutorServs) { + this.iamAutorServs = iamAutorServs; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/IamAbilTipoDato.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/IamAbilTipoDato.java new file mode 100644 index 0000000..322dacb --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/IamAbilTipoDato.java @@ -0,0 +1,100 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the IAM_ABIL_TIPO_DATO database table. + */ +@Entity +@Table(name = "IAM_ABIL_TIPO_DATO") +public class IamAbilTipoDato implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idAbilTipoDato; + + private BigDecimal idTipoDatoApplic; + + private String nmClasseTipoDato; + + private IamAbilOrganiz iamAbilOrganiz; + + public IamAbilTipoDato() {/* Hibernate */ + } + + @Id + @Column(name = "ID_ABIL_TIPO_DATO") + @GenericGenerator(name = "SIAM_ABIL_TIPO_DATO_ID_ABIL_TIPO_DATO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SIAM_ABIL_TIPO_DATO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SIAM_ABIL_TIPO_DATO_ID_ABIL_TIPO_DATO_GENERATOR") + public Long getIdAbilTipoDato() { + return this.idAbilTipoDato; + } + + public void setIdAbilTipoDato(Long idAbilTipoDato) { + this.idAbilTipoDato = idAbilTipoDato; + } + + @Column(name = "ID_TIPO_DATO_APPLIC") + public BigDecimal getIdTipoDatoApplic() { + return this.idTipoDatoApplic; + } + + public void setIdTipoDatoApplic(BigDecimal idTipoDatoApplic) { + this.idTipoDatoApplic = idTipoDatoApplic; + } + + @Column(name = "NM_CLASSE_TIPO_DATO") + public String getNmClasseTipoDato() { + return this.nmClasseTipoDato; + } + + public void setNmClasseTipoDato(String nmClasseTipoDato) { + this.nmClasseTipoDato = nmClasseTipoDato; + } + + // bi-directional many-to-one association to IamAbilOrganiz + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ABIL_ORGANIZ") + public IamAbilOrganiz getIamAbilOrganiz() { + return this.iamAbilOrganiz; + } + + public void setIamAbilOrganiz(IamAbilOrganiz iamAbilOrganiz) { + this.iamAbilOrganiz = iamAbilOrganiz; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/IamAutorServ.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/IamAutorServ.java new file mode 100644 index 0000000..b40151c --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/IamAutorServ.java @@ -0,0 +1,88 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the IAM_AUTOR_SERV database table. + */ +@Entity +@Table(name = "IAM_AUTOR_SERV") +public class IamAutorServ implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idAutorServ; + + private String nmServizioWeb; + + private IamAbilOrganiz iamAbilOrganiz; + + public IamAutorServ() {/* Hibernate */ + } + + @Id + @Column(name = "ID_AUTOR_SERV") + @GenericGenerator(name = "SIAM_AUTOR_SERV_ID_AUTOR_SERV_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SIAM_AUTOR_SERV"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SIAM_AUTOR_SERV_ID_AUTOR_SERV_GENERATOR") + public Long getIdAutorServ() { + return this.idAutorServ; + } + + public void setIdAutorServ(Long idAutorServ) { + this.idAutorServ = idAutorServ; + } + + @Column(name = "NM_SERVIZIO_WEB") + public String getNmServizioWeb() { + return this.nmServizioWeb; + } + + public void setNmServizioWeb(String nmServizioWeb) { + this.nmServizioWeb = nmServizioWeb; + } + + // bi-directional many-to-one association to IamAbilOrganiz + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ABIL_ORGANIZ") + public IamAbilOrganiz getIamAbilOrganiz() { + return this.iamAbilOrganiz; + } + + public void setIamAbilOrganiz(IamAbilOrganiz iamAbilOrganiz) { + this.iamAbilOrganiz = iamAbilOrganiz; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/IamIndIpUser.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/IamIndIpUser.java new file mode 100644 index 0000000..bf279cf --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/IamIndIpUser.java @@ -0,0 +1,78 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * The persistent class for the IAM_IND_IP_USER database table. + */ +@Entity +@Table(name = "IAM_IND_IP_USER") +@NamedQuery(name = "IamIndIpUser.deleteByIdUser", query = "DELETE FROM IamIndIpUser i where i.iamUser = :iamUser") +public class IamIndIpUser implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idIndIpUser; + + private String cdIndIpUser; + + private IamUser iamUser; + + public IamIndIpUser() {/* Hibernate */ + } + + @Id + @Column(name = "ID_IND_IP_USER") + @GenericGenerator(name = "SIAM_IND_IP_USER_ID_IND_IP_USER_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SIAM_IND_IP_USER"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SIAM_IND_IP_USER_ID_IND_IP_USER_GENERATOR") + public Long getIdIndIpUser() { + return this.idIndIpUser; + } + + public void setIdIndIpUser(Long idIndIpUser) { + this.idIndIpUser = idIndIpUser; + } + + @Column(name = "CD_IND_IP_USER") + public String getCdIndIpUser() { + return this.cdIndIpUser; + } + + public void setCdIndIpUser(String cdIndIpUser) { + this.cdIndIpUser = cdIndIpUser; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USER_IAM") + public IamUser getIamUser() { + return this.iamUser; + } + + public void setIamUser(IamUser iamUser) { + this.iamUser = iamUser; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/IamUser.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/IamUser.java new file mode 100644 index 0000000..f4a2d65 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/IamUser.java @@ -0,0 +1,233 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * The persistent class for the IAM_USER database table. + * + */ +@Entity +@Table(name = "IAM_USER") +public class IamUser implements Serializable { + + private static final long serialVersionUID = 1L; + private Long idUserIam; + private String cdFisc; + private String cdPsw; + private String cdSalt; + private String dsEmail; + private Date dtRegPsw; + private Date dtScadPsw; + private String flAttivo; + private String flContrIp; + private String flUserAdmin; + private String nmCognomeUser; + private String nmNomeUser; + private String nmUserid; + private String tipoUser; + private String tipoAuth; + private List aroUnitaDocs = new ArrayList<>(); + private List iamAbilOrganizs = new ArrayList<>(); + private List vrsSessioneVers = new ArrayList<>(); + + public IamUser() {/* Hibernate */ + } + + @Id + @Column(name = "ID_USER_IAM") + public Long getIdUserIam() { + return this.idUserIam; + } + + public void setIdUserIam(Long idUserIam) { + this.idUserIam = idUserIam; + } + + @Column(name = "CD_FISC") + public String getCdFisc() { + return this.cdFisc; + } + + public void setCdFisc(String cdFisc) { + this.cdFisc = cdFisc; + } + + @Column(name = "CD_PSW") + public String getCdPsw() { + return this.cdPsw; + } + + public void setCdPsw(String cdPsw) { + this.cdPsw = cdPsw; + } + + @Column(name = "CD_SALT") + public String getCdSalt() { + return this.cdSalt; + } + + public void setCdSalt(String cdSalt) { + this.cdSalt = cdSalt; + } + + @Column(name = "DS_EMAIL") + public String getDsEmail() { + return this.dsEmail; + } + + public void setDsEmail(String dsEmail) { + this.dsEmail = dsEmail; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_REG_PSW") + public Date getDtRegPsw() { + return this.dtRegPsw; + } + + public void setDtRegPsw(Date dtRegPsw) { + this.dtRegPsw = dtRegPsw; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SCAD_PSW") + public Date getDtScadPsw() { + return this.dtScadPsw; + } + + public void setDtScadPsw(Date dtScadPsw) { + this.dtScadPsw = dtScadPsw; + } + + @Column(name = "FL_ATTIVO", columnDefinition = "char(1)") + public String getFlAttivo() { + return this.flAttivo; + } + + public void setFlAttivo(String flAttivo) { + this.flAttivo = flAttivo; + } + + @Column(name = "FL_CONTR_IP", columnDefinition = "char(1)") + public String getFlContrIp() { + return this.flContrIp; + } + + public void setFlContrIp(String flContrIp) { + this.flContrIp = flContrIp; + } + + @Column(name = "FL_USER_ADMIN", columnDefinition = "char(1)") + public String getFlUserAdmin() { + return this.flUserAdmin; + } + + public void setFlUserAdmin(String flUserAdmin) { + this.flUserAdmin = flUserAdmin; + } + + @Column(name = "NM_COGNOME_USER") + public String getNmCognomeUser() { + return this.nmCognomeUser; + } + + public void setNmCognomeUser(String nmCognomeUser) { + this.nmCognomeUser = nmCognomeUser; + } + + @Column(name = "NM_NOME_USER") + public String getNmNomeUser() { + return this.nmNomeUser; + } + + public void setNmNomeUser(String nmNomeUser) { + this.nmNomeUser = nmNomeUser; + } + + @Column(name = "NM_USERID") + public String getNmUserid() { + return this.nmUserid; + } + + public void setNmUserid(String nmUserid) { + this.nmUserid = nmUserid; + } + + @Column(name = "TIPO_USER") + public String getTipoUser() { + return this.tipoUser; + } + + public void setTipoUser(String tipoUser) { + this.tipoUser = tipoUser; + } + + @Column(name = "TIPO_AUTH") + public String getTipoAuth() { + return this.tipoAuth; + } + + public void setTipoAuth(String tipoAuth) { + this.tipoAuth = tipoAuth; + } + + // bi-directional many-to-one association to IamAbilOrganiz + @OneToMany(mappedBy = "iamUser", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) + public List getIamAbilOrganizs() { + return this.iamAbilOrganizs; + } + + public void setIamAbilOrganizs(List iamAbilOrganizs) { + this.iamAbilOrganizs = iamAbilOrganizs; + } + + // bi-directional many-to-one association to AroUnitaDoc + @OneToMany(mappedBy = "iamUser") + public List getAroUnitaDocs() { + return this.aroUnitaDocs; + } + + public void setAroUnitaDocs(List aroUnitaDocs) { + this.aroUnitaDocs = aroUnitaDocs; + } + + // bi-directional many-to-one association to VrsSessioneVers + @OneToMany(mappedBy = "iamUser") + public List getVrsSessioneVers() { + return this.vrsSessioneVers; + } + + public void setVrsSessioneVers(List vrsSessioneVers) { + this.vrsSessioneVers = vrsSessioneVers; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/LogLockElab.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/LogLockElab.java new file mode 100644 index 0000000..d7abc4b --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/LogLockElab.java @@ -0,0 +1,110 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the LOG_LOCK_ELAB database table. + */ +@Entity +@Table(name = "LOG_LOCK_ELAB") +public class LogLockElab implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idLockElab; + + private String flElabAttiva; + + private String nmElab; + + private String tiLockElab; + + private OrgStrut orgStrut; + + public LogLockElab() {/* Hibernate */ + } + + @Id + @Column(name = "ID_LOCK_ELAB") + @GenericGenerator(name = "SLOG_LOCK_ELAB_ID_LOCK_ELAB_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SLOG_LOCK_ELAB"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SLOG_LOCK_ELAB_ID_LOCK_ELAB_GENERATOR") + public Long getIdLockElab() { + return this.idLockElab; + } + + public void setIdLockElab(Long idLockElab) { + this.idLockElab = idLockElab; + } + + @Column(name = "FL_ELAB_ATTIVA", columnDefinition = "char(1)") + public String getFlElabAttiva() { + return this.flElabAttiva; + } + + public void setFlElabAttiva(String flElabAttiva) { + this.flElabAttiva = flElabAttiva; + } + + @Column(name = "NM_ELAB") + public String getNmElab() { + return this.nmElab; + } + + public void setNmElab(String nmElab) { + this.nmElab = nmElab; + } + + @Column(name = "TI_LOCK_ELAB") + public String getTiLockElab() { + return this.tiLockElab; + } + + public void setTiLockElab(String tiLockElab) { + this.tiLockElab = tiLockElab; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/MonAaUnitaDocRegistro.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/MonAaUnitaDocRegistro.java new file mode 100644 index 0000000..fd92f84 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/MonAaUnitaDocRegistro.java @@ -0,0 +1,88 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the MON_AA_UNITA_DOC_REGISTRO database table. + */ +@Entity +@Table(name = "MON_AA_UNITA_DOC_REGISTRO") +public class MonAaUnitaDocRegistro implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idAaUnitaDocRegistro; + + private BigDecimal aaUnitaDocRegistro; + + private DecRegistroUnitaDoc decRegistroUnitaDoc; + + public MonAaUnitaDocRegistro() {/* Hibernate */ + } + + @Id + @Column(name = "ID_AA_UNITA_DOC_REGISTRO") + @GenericGenerator(name = "SMON_AA_UNITA_DOC_REGISTRO_ID_AA_UNITA_DOC_REGISTRO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SMON_AA_UNITA_DOC_REGISTRO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SMON_AA_UNITA_DOC_REGISTRO_ID_AA_UNITA_DOC_REGISTRO_GENERATOR") + public Long getIdAaUnitaDocRegistro() { + return this.idAaUnitaDocRegistro; + } + + public void setIdAaUnitaDocRegistro(Long idAaUnitaDocRegistro) { + this.idAaUnitaDocRegistro = idAaUnitaDocRegistro; + } + + @Column(name = "AA_UNITA_DOC_REGISTRO") + public BigDecimal getAaUnitaDocRegistro() { + return this.aaUnitaDocRegistro; + } + + public void setAaUnitaDocRegistro(BigDecimal aaUnitaDocRegistro) { + this.aaUnitaDocRegistro = aaUnitaDocRegistro; + } + + // bi-directional many-to-one association to DecRegistroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_REGISTRO_UNITA_DOC") + public DecRegistroUnitaDoc getDecRegistroUnitaDoc() { + return this.decRegistroUnitaDoc; + } + + public void setDecRegistroUnitaDoc(DecRegistroUnitaDoc decRegistroUnitaDoc) { + this.decRegistroUnitaDoc = decRegistroUnitaDoc; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/MonContaFascicoliKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/MonContaFascicoliKo.java new file mode 100644 index 0000000..2e0450c --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/MonContaFascicoliKo.java @@ -0,0 +1,138 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the MON_CONTA_FASCICOLI_KO database table. + */ +@Entity +@Table(name = "MON_CONTA_FASCICOLI_KO") +public class MonContaFascicoliKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idContaFascicoliKo; + + private BigDecimal aaFascicolo; + + private Date dtRifConta; + + private BigDecimal niFascicoliKo; + + private String tiStatoFascicoloKo; + + private DecTipoFascicolo decTipoFascicolo; + + private OrgStrut orgStrut; + + public MonContaFascicoliKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_CONTA_FASCICOLI_KO") + @GenericGenerator(name = "SMON_CONTA_FASCICOLI_KO_ID_CONTA_FASCICOLI_KO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SMON_CONTA_FASCICOLI_KO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SMON_CONTA_FASCICOLI_KO_ID_CONTA_FASCICOLI_KO_GENERATOR") + public Long getIdContaFascicoliKo() { + return this.idContaFascicoliKo; + } + + public void setIdContaFascicoliKo(Long idContaFascicoliKo) { + this.idContaFascicoliKo = idContaFascicoliKo; + } + + @Column(name = "AA_FASCICOLO") + public BigDecimal getAaFascicolo() { + return this.aaFascicolo; + } + + public void setAaFascicolo(BigDecimal aaFascicolo) { + this.aaFascicolo = aaFascicolo; + } + + @Temporal(TemporalType.DATE) + @Column(name = "DT_RIF_CONTA") + public Date getDtRifConta() { + return this.dtRifConta; + } + + public void setDtRifConta(Date dtRifConta) { + this.dtRifConta = dtRifConta; + } + + @Column(name = "NI_FASCICOLI_KO") + public BigDecimal getNiFascicoliKo() { + return this.niFascicoliKo; + } + + public void setNiFascicoliKo(BigDecimal niFascicoliKo) { + this.niFascicoliKo = niFascicoliKo; + } + + @Column(name = "TI_STATO_FASCICOLO_KO") + public String getTiStatoFascicoloKo() { + return this.tiStatoFascicoloKo; + } + + public void setTiStatoFascicoloKo(String tiStatoFascicoloKo) { + this.tiStatoFascicoloKo = tiStatoFascicoloKo; + } + + // bi-directional many-to-one association to DecTipoFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_FASCICOLO") + public DecTipoFascicolo getDecTipoFascicolo() { + return this.decTipoFascicolo; + } + + public void setDecTipoFascicolo(DecTipoFascicolo decTipoFascicolo) { + this.decTipoFascicolo = decTipoFascicolo; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/MonContaSesUpdUd.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/MonContaSesUpdUd.java new file mode 100644 index 0000000..9799109 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/MonContaSesUpdUd.java @@ -0,0 +1,119 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.MonContaSesUpdUd.TiStatoUdpUdMonContaSesUpdUd; + +/** + * The persistent class for the MON_CONTA_SES_UPD_UD database table. + */ +@Entity +@Table(name = "MON_CONTA_SES_UPD_UD") +public class MonContaSesUpdUd implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idContaSesUpdUd; + + private Date dtRifConta; + + private BigDecimal niSesUpdUd; + + private MonKeyTotalUd monKeyTotalUd; + + private TiStatoUdpUdMonContaSesUpdUd tiStatoUdpUd; + + public MonContaSesUpdUd() {/* Hibernate */ + } + + @Id + @Column(name = "ID_CONTA_SES_UPD_UD") + @GenericGenerator(name = "SMON_CONTA_SES_UPD_UD_ID_CONTA_SES_UPD_UD_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SMON_CONTA_SES_UPD_UD"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SMON_CONTA_SES_UPD_UD_ID_CONTA_SES_UPD_UD_GENERATOR") + public Long getIdContaSesUpdUd() { + return this.idContaSesUpdUd; + } + + public void setIdContaSesUpdUd(Long idContaSesUpdUd) { + this.idContaSesUpdUd = idContaSesUpdUd; + } + + @Temporal(TemporalType.DATE) + @Column(name = "DT_RIF_CONTA") + public Date getDtRifConta() { + return this.dtRifConta; + } + + public void setDtRifConta(Date dtRifConta) { + this.dtRifConta = dtRifConta; + } + + @Column(name = "NI_SES_UPD_UD") + public BigDecimal getNiSesUpdUd() { + return this.niSesUpdUd; + } + + public void setNiSesUpdUd(BigDecimal niSesUpdUd) { + this.niSesUpdUd = niSesUpdUd; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_KEY_TOTAL_UD") + public MonKeyTotalUd getMonKeyTotalUd() { + return this.monKeyTotalUd; + } + + public void setMonKeyTotalUd(MonKeyTotalUd monKeyTotalUd) { + this.monKeyTotalUd = monKeyTotalUd; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_STATO_UDP_UD") + public TiStatoUdpUdMonContaSesUpdUd getTiStatoUdpUd() { + return this.tiStatoUdpUd; + } + + public void setTiStatoUdpUd(TiStatoUdpUdMonContaSesUpdUd tiStatoUdpUd) { + this.tiStatoUdpUd = tiStatoUdpUd; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/MonContaSesUpdUdKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/MonContaSesUpdUdKo.java new file mode 100644 index 0000000..ce549d4 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/MonContaSesUpdUdKo.java @@ -0,0 +1,120 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.MonContaSesUpdUdKo.TiStatoUdpUdKoMonContaSesUpdUdKo; + +/** + * The persistent class for the MON_CONTA_SES_UPD_UD_KO database table. + */ +@Entity +@Table(name = "MON_CONTA_SES_UPD_UD_KO") +public class MonContaSesUpdUdKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idContaSesUpdUdKo; + + private Date dtRifConta; + + private BigDecimal niSesUpdUdKo; + + private TiStatoUdpUdKoMonContaSesUpdUdKo tiStatoUdpUdKo; + + private MonKeyTotalUdKo monKeyTotalUdKo; + + public MonContaSesUpdUdKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_CONTA_SES_UPD_UD_KO") + @GenericGenerator(name = "SMON_CONTA_SES_UPD_UD_KO_ID_CONTA_SES_UPD_UD_KO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SMON_CONTA_SES_UPD_UD_KO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SMON_CONTA_SES_UPD_UD_KO_ID_CONTA_SES_UPD_UD_KO_GENERATOR") + public Long getIdContaSesUpdUdKo() { + return this.idContaSesUpdUdKo; + } + + public void setIdContaSesUpdUdKo(Long idContaSesUpdUdKo) { + this.idContaSesUpdUdKo = idContaSesUpdUdKo; + } + + @Temporal(TemporalType.DATE) + @Column(name = "DT_RIF_CONTA") + public Date getDtRifConta() { + return this.dtRifConta; + } + + public void setDtRifConta(Date dtRifConta) { + this.dtRifConta = dtRifConta; + } + + @Column(name = "NI_SES_UPD_UD_KO") + public BigDecimal getNiSesUpdUdKo() { + return this.niSesUpdUdKo; + } + + public void setNiSesUpdUdKo(BigDecimal niSesUpdUdKo) { + this.niSesUpdUdKo = niSesUpdUdKo; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_STATO_UDP_UD_KO") + public TiStatoUdpUdKoMonContaSesUpdUdKo getTiStatoUdpUdKo() { + return this.tiStatoUdpUdKo; + } + + public void setTiStatoUdpUdKo(TiStatoUdpUdKoMonContaSesUpdUdKo tiStatoUdpUdKo) { + this.tiStatoUdpUdKo = tiStatoUdpUdKo; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_KEY_TOTAL_UD_KO") + public MonKeyTotalUdKo getMonKeyTotalUdKo() { + return this.monKeyTotalUdKo; + } + + public void setMonKeyTotalUdKo(MonKeyTotalUdKo monKeyTotalUdKo) { + this.monKeyTotalUdKo = monKeyTotalUdKo; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/MonKeyTotalUd.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/MonKeyTotalUd.java new file mode 100644 index 0000000..a87363b --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/MonKeyTotalUd.java @@ -0,0 +1,171 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the MON_KEY_TOTAL_UD database table. + */ +@Entity +@Table(name = "MON_KEY_TOTAL_UD") +public class MonKeyTotalUd implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idKeyTotalUd; + + private BigDecimal aaKeyUnitaDoc; + + private Date dtLastUpdUd; + + private OrgStrut orgStrut; + + private OrgSubStrut orgSubStrut; + + private DecTipoDoc decTipoDocPrinc; + + private DecTipoUnitaDoc decTipoUnitaDoc; + + private DecRegistroUnitaDoc decRegistroUnitaDoc; + + private List monContaSesUpdUds = new ArrayList<>(); + + public MonKeyTotalUd() {/* Hibernate */ + } + + @Id + @Column(name = "ID_KEY_TOTAL_UD") + @GenericGenerator(name = "SMON_KEY_TOTAL_UD_ID_KEY_TOTAL_UD_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SMON_KEY_TOTAL_UD"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SMON_KEY_TOTAL_UD_ID_KEY_TOTAL_UD_GENERATOR") + public Long getIdKeyTotalUd() { + return this.idKeyTotalUd; + } + + public void setIdKeyTotalUd(Long idKeyTotalUd) { + this.idKeyTotalUd = idKeyTotalUd; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return this.aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + @Temporal(TemporalType.DATE) + @Column(name = "DT_LAST_UPD_UD") + public Date getDtLastUpdUd() { + return this.dtLastUpdUd; + } + + public void setDtLastUpdUd(Date dtLastUpdUd) { + this.dtLastUpdUd = dtLastUpdUd; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to OrgSubStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SUB_STRUT") + public OrgSubStrut getOrgSubStrut() { + return this.orgSubStrut; + } + + public void setOrgSubStrut(OrgSubStrut orgSubStrut) { + this.orgSubStrut = orgSubStrut; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_DOC_PRINC") + public DecTipoDoc getDecTipoDocPrinc() { + return this.decTipoDocPrinc; + } + + public void setDecTipoDocPrinc(DecTipoDoc decTipoDocPrinc) { + this.decTipoDocPrinc = decTipoDocPrinc; + } + + // bi-directional many-to-one association to DecRegistroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_REGISTRO_UNITA_DOC") + public DecRegistroUnitaDoc getDecRegistroUnitaDoc() { + return this.decRegistroUnitaDoc; + } + + public void setDecRegistroUnitaDoc(DecRegistroUnitaDoc decRegistroUnitaDoc) { + this.decRegistroUnitaDoc = decRegistroUnitaDoc; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_UNITA_DOC") + public DecTipoUnitaDoc getDecTipoUnitaDoc() { + return this.decTipoUnitaDoc; + } + + public void setDecTipoUnitaDoc(DecTipoUnitaDoc decTipoUnitaDoc) { + this.decTipoUnitaDoc = decTipoUnitaDoc; + } + + // bi-directional many-to-one association to MonContaSesUpdUd + @OneToMany(mappedBy = "monKeyTotalUd") + public List getMonContaSesUpdUds() { + return this.monContaSesUpdUds; + } + + public void setMonContaSesUpdUds(List monContaSesUpdUds) { + this.monContaSesUpdUds = monContaSesUpdUds; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/MonKeyTotalUdKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/MonKeyTotalUdKo.java new file mode 100644 index 0000000..88012a0 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/MonKeyTotalUdKo.java @@ -0,0 +1,158 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the MON_KEY_TOTAL_UD_KO database table. + */ +@Entity +@Table(name = "MON_KEY_TOTAL_UD_KO") +public class MonKeyTotalUdKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idKeyTotalUdKo; + + private BigDecimal aaKeyUnitaDoc; + + private Date dtLastUpdUdKo; + + private OrgStrut orgStrut; + + private DecTipoDoc decTipoDocPrinc; + + private DecTipoUnitaDoc decTipoUnitaDoc; + + private DecRegistroUnitaDoc decRegistroUnitaDoc; + + private List monContaSesUpdUdKos = new ArrayList<>(); + + public MonKeyTotalUdKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_KEY_TOTAL_UD_KO") + @GenericGenerator(name = "SMON_KEY_TOTAL_UD_KO_ID_KEY_TOTAL_UD_KO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SMON_KEY_TOTAL_UD_KO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SMON_KEY_TOTAL_UD_KO_ID_KEY_TOTAL_UD_KO_GENERATOR") + public Long getIdKeyTotalUdKo() { + return this.idKeyTotalUdKo; + } + + public void setIdKeyTotalUdKo(Long idKeyTotalUdKo) { + this.idKeyTotalUdKo = idKeyTotalUdKo; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return this.aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + @Temporal(TemporalType.DATE) + @Column(name = "DT_LAST_UPD_UD_KO") + public Date getDtLastUpdUdKo() { + return this.dtLastUpdUdKo; + } + + public void setDtLastUpdUdKo(Date dtLastUpdUdKo) { + this.dtLastUpdUdKo = dtLastUpdUdKo; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_DOC_PRINC") + public DecTipoDoc getDecTipoDocPrinc() { + return this.decTipoDocPrinc; + } + + public void setDecTipoDocPrinc(DecTipoDoc decTipoDocPrinc) { + this.decTipoDocPrinc = decTipoDocPrinc; + } + + // bi-directional many-to-one association to DecRegistroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_REGISTRO_UNITA_DOC") + public DecRegistroUnitaDoc getDecRegistroUnitaDoc() { + return this.decRegistroUnitaDoc; + } + + public void setDecRegistroUnitaDoc(DecRegistroUnitaDoc decRegistroUnitaDoc) { + this.decRegistroUnitaDoc = decRegistroUnitaDoc; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_UNITA_DOC") + public DecTipoUnitaDoc getDecTipoUnitaDoc() { + return this.decTipoUnitaDoc; + } + + public void setDecTipoUnitaDoc(DecTipoUnitaDoc decTipoUnitaDoc) { + this.decTipoUnitaDoc = decTipoUnitaDoc; + } + + // bi-directional many-to-one association to MonContaSesUpdUdKo + @OneToMany(mappedBy = "monKeyTotalUdKo") + public List getMonContaSesUpdUdKos() { + return this.monContaSesUpdUdKos; + } + + public void setMonContaSesUpdUdKos(List monContaSesUpdUdKos) { + this.monContaSesUpdUdKos = monContaSesUpdUdKos; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgAmbiente.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgAmbiente.java new file mode 100644 index 0000000..11d9014 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgAmbiente.java @@ -0,0 +1,161 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Cacheable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ORG_AMBIENTE database table. + */ +@Entity +@Cacheable(true) +@Table(name = "ORG_AMBIENTE") +public class OrgAmbiente implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idAmbiente; + + private String dsAmbiente; + + private String nmAmbiente; + + private String dsNote; + + private Date dtFinVal; + + private Date dtIniVal; + + private BigDecimal idEnteConserv; + + private BigDecimal idEnteGestore; + + private List orgEntes = new ArrayList<>(); + + public OrgAmbiente() {/* Hibernate */ + } + + @Id + @Column(name = "ID_AMBIENTE") + @GenericGenerator(name = "SORG_AMBIENTE_ID_AMBIENTE_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SORG_AMBIENTE"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SORG_AMBIENTE_ID_AMBIENTE_GENERATOR") + public Long getIdAmbiente() { + return this.idAmbiente; + } + + public void setIdAmbiente(Long idAmbiente) { + this.idAmbiente = idAmbiente; + } + + @Column(name = "DS_AMBIENTE") + public String getDsAmbiente() { + return this.dsAmbiente; + } + + public void setDsAmbiente(String dsAmbiente) { + this.dsAmbiente = dsAmbiente; + } + + @Column(name = "NM_AMBIENTE") + public String getNmAmbiente() { + return this.nmAmbiente; + } + + public void setNmAmbiente(String nmAmbiente) { + this.nmAmbiente = nmAmbiente; + } + + // bi-directional many-to-one association to OrgEnte + @OneToMany(mappedBy = "orgAmbiente") + public List getOrgEntes() { + return this.orgEntes; + } + + public void setOrgEntes(List orgEntes) { + this.orgEntes = orgEntes; + } + + @Column(name = "DS_NOTE") + public String getDsNote() { + return this.dsNote; + } + + public void setDsNote(String dsNote) { + this.dsNote = dsNote; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_FIN_VAL") + public Date getDtFinVal() { + return this.dtFinVal; + } + + public void setDtFinVal(Date dtFinVal) { + this.dtFinVal = dtFinVal; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_INI_VAL") + public Date getDtIniVal() { + return this.dtIniVal; + } + + public void setDtIniVal(Date dtIniVal) { + this.dtIniVal = dtIniVal; + } + + @Column(name = "ID_ENTE_CONSERV") + public java.math.BigDecimal getIdEnteConserv() { + return this.idEnteConserv; + } + + public void setIdEnteConserv(java.math.BigDecimal idEnteConserv) { + this.idEnteConserv = idEnteConserv; + } + + @Column(name = "ID_ENTE_GESTORE") + public java.math.BigDecimal getIdEnteGestore() { + return this.idEnteGestore; + } + + public void setIdEnteGestore(java.math.BigDecimal idEnteGestore) { + this.idEnteGestore = idEnteGestore; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgCampoValSubStrut.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgCampoValSubStrut.java new file mode 100644 index 0000000..8a98862 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgCampoValSubStrut.java @@ -0,0 +1,131 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlID; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ORG_CAMPO_VAL_SUB_STRUT database table. + */ +@Entity +@Table(name = "ORG_CAMPO_VAL_SUB_STRUT") +public class OrgCampoValSubStrut implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idCampoValSubStrut; + + private String nmCampo; + + private String tiCampo; + + private DecAttribDatiSpec decAttribDatiSpec; + + private OrgRegolaValSubStrut orgRegolaValSubStrut; + + private OrgSubStrut orgSubStrut; + + public OrgCampoValSubStrut() {/* Hibernate */ + } + + @Id + @Column(name = "ID_CAMPO_VAL_SUB_STRUT") + @XmlID + @GenericGenerator(name = "SORG_CAMPO_VAL_SUB_STRUT_ID_CAMPO_VAL_SUB_STRUT_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SORG_CAMPO_VAL_SUB_STRUT"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SORG_CAMPO_VAL_SUB_STRUT_ID_CAMPO_VAL_SUB_STRUT_GENERATOR") + public Long getIdCampoValSubStrut() { + return this.idCampoValSubStrut; + } + + public void setIdCampoValSubStrut(Long idCampoValSubStrut) { + this.idCampoValSubStrut = idCampoValSubStrut; + } + + @Column(name = "NM_CAMPO") + public String getNmCampo() { + return this.nmCampo; + } + + public void setNmCampo(String nmCampo) { + this.nmCampo = nmCampo; + } + + @Column(name = "TI_CAMPO") + public String getTiCampo() { + return this.tiCampo; + } + + public void setTiCampo(String tiCampo) { + this.tiCampo = tiCampo; + } + + // bi-directional many-to-one association to DecAttribDatiSpec + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ATTRIB_DATI_SPEC") + @XmlInverseReference(mappedBy = "orgCampoValSubStruts") + public DecAttribDatiSpec getDecAttribDatiSpec() { + return this.decAttribDatiSpec; + } + + public void setDecAttribDatiSpec(DecAttribDatiSpec decAttribDatiSpec) { + this.decAttribDatiSpec = decAttribDatiSpec; + } + + // bi-directional many-to-one association to OrgRegolaValSubStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_REGOLA_VAL_SUB_STRUT") + @XmlInverseReference(mappedBy = "orgCampoValSubStruts") + public OrgRegolaValSubStrut getOrgRegolaValSubStrut() { + return this.orgRegolaValSubStrut; + } + + public void setOrgRegolaValSubStrut(OrgRegolaValSubStrut orgRegolaValSubStrut) { + this.orgRegolaValSubStrut = orgRegolaValSubStrut; + } + + // bi-directional many-to-one association to OrgSubStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SUB_STRUT") + @XmlInverseReference(mappedBy = "orgCampoValSubStruts") + public OrgSubStrut getOrgSubStrut() { + return this.orgSubStrut; + } + + public void setOrgSubStrut(OrgSubStrut orgSubStrut) { + this.orgSubStrut = orgSubStrut; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgEnte.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgEnte.java new file mode 100644 index 0000000..ee439d1 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgEnte.java @@ -0,0 +1,210 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Cacheable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.PrePersist; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.xml.bind.annotation.XmlTransient; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ORG_ENTE database table. + */ +@Entity +@Cacheable(true) +@Table(name = "ORG_ENTE") +public class OrgEnte implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idEnte; + + private String dsEnte; + + private String nmEnte; + + private String cdEnteNormaliz; + + private OrgAmbiente orgAmbiente; + + private List orgStruts = new ArrayList<>(); + + private String tipoDefTemplateEnte; + + private Date dtFinValAppartAmbiente; + + private Date dtIniValAppartAmbiente; + + private Date dtFineVal; + + private Date dtIniVal; + + private String flCessato; + + public OrgEnte() { + // hibernate + } + + @Id + @Column(name = "ID_ENTE") + @GenericGenerator(name = "SORG_ENTE_ID_ENTE_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SORG_ENTE"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SORG_ENTE_ID_ENTE_GENERATOR") + public Long getIdEnte() { + return this.idEnte; + } + + public void setIdEnte(Long idEnte) { + this.idEnte = idEnte; + } + + @Column(name = "DS_ENTE") + public String getDsEnte() { + return this.dsEnte; + } + + public void setDsEnte(String dsEnte) { + this.dsEnte = dsEnte; + } + + @Column(name = "NM_ENTE") + public String getNmEnte() { + return this.nmEnte; + } + + public void setNmEnte(String nmEnte) { + this.nmEnte = nmEnte; + } + + @Column(name = "CD_ENTE_NORMALIZ") + public String getCdEnteNormaliz() { + return this.cdEnteNormaliz; + } + + public void setCdEnteNormaliz(String cdEnteNormaliz) { + this.cdEnteNormaliz = cdEnteNormaliz; + } + + // bi-directional many-to-one association to OrgAmbiente + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_AMBIENTE") + public OrgAmbiente getOrgAmbiente() { + return this.orgAmbiente; + } + + public void setOrgAmbiente(OrgAmbiente orgAmbiente) { + this.orgAmbiente = orgAmbiente; + } + + // bi-directional many-to-one association to OrgStrut + @OneToMany(mappedBy = "orgEnte") + @XmlTransient + public List getOrgStruts() { + return this.orgStruts; + } + + public void setOrgStruts(List orgStruts) { + this.orgStruts = orgStruts; + } + + @Column(name = "TIPO_DEF_TEMPLATE_ENTE") + public String getTipoDefTemplateEnte() { + return this.tipoDefTemplateEnte; + } + + public void setTipoDefTemplateEnte(String tipoDefTemplateEnte) { + this.tipoDefTemplateEnte = tipoDefTemplateEnte; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_FIN_VAL_APPART_AMBIENTE") + public Date getDtFinValAppartAmbiente() { + return this.dtFinValAppartAmbiente; + } + + public void setDtFinValAppartAmbiente(Date dtFinValAppartAmbiente) { + this.dtFinValAppartAmbiente = dtFinValAppartAmbiente; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_INI_VAL_APPART_AMBIENTE") + public Date getDtIniValAppartAmbiente() { + return this.dtIniValAppartAmbiente; + } + + public void setDtIniValAppartAmbiente(Date dtIniValAppartAmbiente) { + this.dtIniValAppartAmbiente = dtIniValAppartAmbiente; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_FINE_VAL") + public Date getDtFineVal() { + return this.dtFineVal; + } + + public void setDtFineVal(Date dtFineVal) { + this.dtFineVal = dtFineVal; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_INI_VAL") + public Date getDtIniVal() { + return this.dtIniVal; + } + + public void setDtIniVal(Date dtIniVal) { + this.dtIniVal = dtIniVal; + } + + @Column(name = "FL_CESSATO", columnDefinition = "char") + public String getFlCessato() { + return this.flCessato; + } + + public void setFlCessato(String flCessato) { + this.flCessato = flCessato; + } + + @PrePersist + void preInsert() { + if (this.flCessato == null) { + this.flCessato = "0"; + } + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgPartition.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgPartition.java new file mode 100644 index 0000000..f0a3f6c --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgPartition.java @@ -0,0 +1,121 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ORG_PARTITION database table. + */ +@Entity +@Table(name = "ORG_PARTITION") +public class OrgPartition implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idPartition; + + private String cdPartition; + + private String tiPartition; + + private List orgPartitionStruts = new ArrayList<>(); + + private List orgValSubPartitions = new ArrayList<>(); + + private List orgPartitionSubStruts = new ArrayList<>(); + + public OrgPartition() {/* Hibernate */ + } + + @Id + @Column(name = "ID_PARTITION") + @GenericGenerator(name = "SORG_PARTITION_ID_PARTITION_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SORG_PARTITION"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SORG_PARTITION_ID_PARTITION_GENERATOR") + public Long getIdPartition() { + return this.idPartition; + } + + public void setIdPartition(Long idPartition) { + this.idPartition = idPartition; + } + + @Column(name = "CD_PARTITION") + public String getCdPartition() { + return this.cdPartition; + } + + public void setCdPartition(String cdPartition) { + this.cdPartition = cdPartition; + } + + @Column(name = "TI_PARTITION") + public String getTiPartition() { + return this.tiPartition; + } + + public void setTiPartition(String tiPartition) { + this.tiPartition = tiPartition; + } + + // bi-directional many-to-one association to OrgPartitionStrut + @OneToMany(mappedBy = "orgPartition") + public List getOrgPartitionStruts() { + return this.orgPartitionStruts; + } + + public void setOrgPartitionStruts(List orgPartitionStruts) { + this.orgPartitionStruts = orgPartitionStruts; + } + + // bi-directional many-to-one association to OrgValSubPartition + @OneToMany(mappedBy = "orgPartition") + public List getOrgValSubPartitions() { + return this.orgValSubPartitions; + } + + public void setOrgValSubPartitions(List orgValSubPartitions) { + this.orgValSubPartitions = orgValSubPartitions; + } + + // bi-directional many-to-one association to OrgPartitionSubStrut + @OneToMany(mappedBy = "orgPartition") + public List getOrgPartitionSubStruts() { + return this.orgPartitionSubStruts; + } + + public void setOrgPartitionSubStruts(List orgPartitionSubStruts) { + this.orgPartitionSubStruts = orgPartitionSubStruts; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgPartitionStrut.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgPartitionStrut.java new file mode 100644 index 0000000..1251b75 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgPartitionStrut.java @@ -0,0 +1,101 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ORG_PARTITION_STRUT database table. + */ +@Entity +@Table(name = "ORG_PARTITION_STRUT") +public class OrgPartitionStrut implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idPartitionStrut; + + private String tiPartition; + + private OrgPartition orgPartition; + + private OrgStrut orgStrut; + + public OrgPartitionStrut() {/* Hibernate */ + } + + @Id + @Column(name = "ID_PARTITION_STRUT") + @GenericGenerator(name = "SORG_PARTITION_STRUT_ID_PARTITION_STRUT_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SORG_PARTITION_STRUT"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SORG_PARTITION_STRUT_ID_PARTITION_STRUT_GENERATOR") + public Long getIdPartitionStrut() { + return this.idPartitionStrut; + } + + public void setIdPartitionStrut(Long idPartitionStrut) { + this.idPartitionStrut = idPartitionStrut; + } + + @Column(name = "TI_PARTITION") + public String getTiPartition() { + return this.tiPartition; + } + + public void setTiPartition(String tiPartition) { + this.tiPartition = tiPartition; + } + + // bi-directional many-to-one association to OrgPartition + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_PARTITION") + public OrgPartition getOrgPartition() { + return this.orgPartition; + } + + public void setOrgPartition(OrgPartition orgPartition) { + this.orgPartition = orgPartition; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgPartitionSubStrut.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgPartitionSubStrut.java new file mode 100644 index 0000000..cbc9fe8 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgPartitionSubStrut.java @@ -0,0 +1,101 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ORG_PARTITION_SUB_STRUT database table. + */ +@Entity +@Table(name = "ORG_PARTITION_SUB_STRUT") +public class OrgPartitionSubStrut implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idPartitionSubStrut; + + private String tiPartition; + + private OrgPartition orgPartition; + + private OrgSubStrut orgSubStrut; + + public OrgPartitionSubStrut() {/* Hibernate */ + } + + @Id + @Column(name = "ID_PARTITION_SUB_STRUT") + @GenericGenerator(name = "SORG_PARTITION_SUB_STRUT_ID_PARTITION_SUB_STRUT_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SORG_PARTITION_SUB_STRUT"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SORG_PARTITION_SUB_STRUT_ID_PARTITION_SUB_STRUT_GENERATOR") + public Long getIdPartitionSubStrut() { + return this.idPartitionSubStrut; + } + + public void setIdPartitionSubStrut(Long idPartitionSubStrut) { + this.idPartitionSubStrut = idPartitionSubStrut; + } + + @Column(name = "TI_PARTITION") + public String getTiPartition() { + return this.tiPartition; + } + + public void setTiPartition(String tiPartition) { + this.tiPartition = tiPartition; + } + + // bi-directional many-to-one association to OrgPartition + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_PARTITION") + public OrgPartition getOrgPartition() { + return this.orgPartition; + } + + public void setOrgPartition(OrgPartition orgPartition) { + this.orgPartition = orgPartition; + } + + // bi-directional many-to-one association to OrgSubStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SUB_STRUT") + public OrgSubStrut getOrgSubStrut() { + return this.orgSubStrut; + } + + public void setOrgSubStrut(OrgSubStrut orgSubStrut) { + this.orgSubStrut = orgSubStrut; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgRegolaValSubStrut.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgRegolaValSubStrut.java new file mode 100644 index 0000000..64450b6 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgRegolaValSubStrut.java @@ -0,0 +1,137 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.xml.bind.annotation.XmlID; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ORG_REGOLA_VAL_SUB_STRUT database table. + */ +@Entity +@Table(name = "ORG_REGOLA_VAL_SUB_STRUT") +public class OrgRegolaValSubStrut implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idRegolaValSubStrut; + + private Date dtIstituz; + + private Date dtSoppres; + + private List orgCampoValSubStruts = new ArrayList<>(); + + private DecTipoDoc decTipoDoc; + + private DecTipoUnitaDoc decTipoUnitaDoc; + + public OrgRegolaValSubStrut() {/* Hibernate */ + } + + @Id + @Column(name = "ID_REGOLA_VAL_SUB_STRUT") + @XmlID + @GenericGenerator(name = "SORG_REGOLA_VAL_SUB_STRUT_ID_REGOLA_VAL_SUB_STRUT_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SORG_REGOLA_VAL_SUB_STRUT"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SORG_REGOLA_VAL_SUB_STRUT_ID_REGOLA_VAL_SUB_STRUT_GENERATOR") + public Long getIdRegolaValSubStrut() { + return this.idRegolaValSubStrut; + } + + public void setIdRegolaValSubStrut(Long idRegolaValSubStrut) { + this.idRegolaValSubStrut = idRegolaValSubStrut; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_ISTITUZ") + public Date getDtIstituz() { + return this.dtIstituz; + } + + public void setDtIstituz(Date dtIstituz) { + this.dtIstituz = dtIstituz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SOPPRES") + public Date getDtSoppres() { + return this.dtSoppres; + } + + public void setDtSoppres(Date dtSoppres) { + this.dtSoppres = dtSoppres; + } + + // bi-directional many-to-one association to OrgCampoValSubStrut + @OneToMany(mappedBy = "orgRegolaValSubStrut", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + public List getOrgCampoValSubStruts() { + return this.orgCampoValSubStruts; + } + + public void setOrgCampoValSubStruts(List orgCampoValSubStruts) { + this.orgCampoValSubStruts = orgCampoValSubStruts; + } + + // bi-directional many-to-one association to DecTipoDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_DOC") + @XmlInverseReference(mappedBy = "orgRegolaValSubStruts") + public DecTipoDoc getDecTipoDoc() { + return this.decTipoDoc; + } + + public void setDecTipoDoc(DecTipoDoc decTipoDoc) { + this.decTipoDoc = decTipoDoc; + } + + // bi-directional many-to-one association to DecTipoUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_UNITA_DOC") + @XmlInverseReference(mappedBy = "orgRegolaValSubStruts") + public DecTipoUnitaDoc getDecTipoUnitaDoc() { + return this.decTipoUnitaDoc; + } + + public void setDecTipoUnitaDoc(DecTipoUnitaDoc decTipoUnitaDoc) { + this.decTipoUnitaDoc = decTipoUnitaDoc; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgStrut.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgStrut.java new file mode 100644 index 0000000..90045fd --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgStrut.java @@ -0,0 +1,482 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Cacheable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.PrePersist; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ORG_STRUT database table. + */ +@Entity +@XmlRootElement +@Cacheable(true) +@Table(name = "ORG_STRUT") +public class OrgStrut implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idStrut; + + private String cdIpa; + + private String dlNoteStrut; + + private String dsStrut; + + private String cdStrutNormaliz; + + private Date dtIniVal; + + private Date dtFineVal; + + private Date dtIniValStrut; + + private Date dtFineValStrut; + + private String flTemplate; + + private BigDecimal idEnteConvenz; + + private String nmStrut; + + private List aroUnitaDocs = new ArrayList<>(); + + private List decAttribDatiSpecs = new ArrayList<>(); + + private List decFormatoFileDocs = new ArrayList<>(); + + private List decRegistroUnitaDocs = new ArrayList<>(); + + private List decTipoDocs = new ArrayList<>(); + + private List decTipoRapprComps = new ArrayList<>(); + + private List decTipoStrutDocs = new ArrayList<>(); + + private List decTipoUnitaDocs = new ArrayList<>(); + + private List decTitols = new ArrayList<>(); + + private List decXsdDatiSpecs = new ArrayList<>(); + + private List logLockElabs = new ArrayList<>(); + + private List orgPartitionStruts = new ArrayList<>(); + + private OrgEnte orgEnte; + + private List decTipoFascicolos = new ArrayList<>(); + + private List orgSubStruts = new ArrayList<>(); + + private List vrsDocNonVers = new ArrayList<>(); + + private List vrsSessioneVers = new ArrayList<>(); + + private List vrsUnitaDocNonVers = new ArrayList<>(); + + private String flCessato; + + private String flArchivioRestituito; + + public OrgStrut() {/* Hibernate */ + } + + @Id + @Column(name = "ID_STRUT") + @GenericGenerator(name = "SORG_STRUT_ID_STRUT_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SORG_STRUT"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SORG_STRUT_ID_STRUT_GENERATOR") + public Long getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(Long idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "CD_IPA") + public String getCdIpa() { + return cdIpa; + } + + public void setCdIpa(String cdIpa) { + this.cdIpa = cdIpa; + } + + @Column(name = "DL_NOTE_STRUT") + public String getDlNoteStrut() { + return this.dlNoteStrut; + } + + public void setDlNoteStrut(String dlNoteStrut) { + this.dlNoteStrut = dlNoteStrut; + } + + @Column(name = "DS_STRUT") + public String getDsStrut() { + return this.dsStrut; + } + + public void setDsStrut(String dsStrut) { + this.dsStrut = dsStrut; + } + + @Column(name = "CD_STRUT_NORMALIZ") + public String getCdStrutNormaliz() { + return this.cdStrutNormaliz; + } + + public void setCdStrutNormaliz(String cdStrutNormaliz) { + this.cdStrutNormaliz = cdStrutNormaliz; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_INI_VAL") + public Date getDtIniVal() { + return dtIniVal; + } + + public void setDtIniVal(Date dtIniVal) { + this.dtIniVal = dtIniVal; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_FINE_VAL") + public Date getDtFineVal() { + return dtFineVal; + } + + public void setDtFineVal(Date dtFineVal) { + this.dtFineVal = dtFineVal; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_INI_VAL_STRUT") + public Date getDtIniValStrut() { + return dtIniValStrut; + } + + public void setDtIniValStrut(Date dtIniValStrut) { + this.dtIniValStrut = dtIniValStrut; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_FINE_VAL_STRUT") + public Date getDtFineValStrut() { + return dtFineValStrut; + } + + public void setDtFineValStrut(Date dtFineValStrut) { + this.dtFineValStrut = dtFineValStrut; + } + + @Column(name = "FL_TEMPLATE", columnDefinition = "char(1)") + public String getFlTemplate() { + return this.flTemplate; + } + + public void setFlTemplate(String flTemplate) { + this.flTemplate = flTemplate; + } + + @Column(name = "ID_ENTE_CONVENZ") + public BigDecimal getIdEnteConvenz() { + return idEnteConvenz; + } + + public void setIdEnteConvenz(BigDecimal idEnteConvenz) { + this.idEnteConvenz = idEnteConvenz; + } + + @Column(name = "NM_STRUT") + public String getNmStrut() { + return this.nmStrut; + } + + public void setNmStrut(String nmStrut) { + this.nmStrut = nmStrut; + } + + @Column(name = "FL_CESSATO", columnDefinition = "char") + public String getFlCessato() { + return this.flCessato; + } + + public void setFlCessato(String flCessato) { + this.flCessato = flCessato; + } + + @Column(name = "FL_ARCHIVIO_RESTITUITO", columnDefinition = "char") + public String getFlArchivioRestituito() { + return this.flArchivioRestituito; + } + + public void setFlArchivioRestituito(String flArchivioRestituito) { + this.flArchivioRestituito = flArchivioRestituito; + } + + // bi-directional many-to-one association to AroUnitaDoc + @OneToMany(mappedBy = "orgStrut", fetch = FetchType.LAZY) + @XmlTransient + public List getAroUnitaDocs() { + return this.aroUnitaDocs; + } + + public void setAroUnitaDocs(List aroUnitaDocs) { + this.aroUnitaDocs = aroUnitaDocs; + } + + // bi-directional many-to-one association to DecAttribDatiSpec + @OneToMany(mappedBy = "orgStrut", cascade = CascadeType.PERSIST) + public List getDecAttribDatiSpecs() { + return this.decAttribDatiSpecs; + } + + public void setDecAttribDatiSpecs(List decAttribDatiSpecs) { + this.decAttribDatiSpecs = decAttribDatiSpecs; + } + + // bi-directional many-to-one association to DecFormatoFileDoc + @OneToMany(mappedBy = "orgStrut", cascade = { CascadeType.PERSIST, CascadeType.DETACH }) + public List getDecFormatoFileDocs() { + return this.decFormatoFileDocs; + } + + public void setDecFormatoFileDocs(List decFormatoFileDocs) { + this.decFormatoFileDocs = decFormatoFileDocs; + } + + // bi-directional many-to-one association to DecRegistroUnitaDoc + @OneToMany(mappedBy = "orgStrut", cascade = { CascadeType.PERSIST, CascadeType.DETACH }) + public List getDecRegistroUnitaDocs() { + return this.decRegistroUnitaDocs; + } + + public void setDecRegistroUnitaDocs(List decRegistroUnitaDocs) { + this.decRegistroUnitaDocs = decRegistroUnitaDocs; + } + + // bi-directional many-to-one association to DecTipoDoc + @OneToMany(mappedBy = "orgStrut", cascade = CascadeType.PERSIST) + public List getDecTipoDocs() { + return this.decTipoDocs; + } + + public void setDecTipoDocs(List decTipoDocs) { + this.decTipoDocs = decTipoDocs; + } + + // bi-directional many-to-one association to DecTipoRapprComp + @OneToMany(mappedBy = "orgStrut", cascade = CascadeType.PERSIST) + public List getDecTipoRapprComps() { + return this.decTipoRapprComps; + } + + public void setDecTipoRapprComps(List decTipoRapprComps) { + this.decTipoRapprComps = decTipoRapprComps; + } + + // bi-directional many-to-one association to DecTipoStrutDoc + @OneToMany(mappedBy = "orgStrut", cascade = CascadeType.PERSIST) + public List getDecTipoStrutDocs() { + return this.decTipoStrutDocs; + } + + public void setDecTipoStrutDocs(List decTipoStrutDocs) { + this.decTipoStrutDocs = decTipoStrutDocs; + } + + // bi-directional many-to-one association to DecTipoUnitaDoc + @OneToMany(mappedBy = "orgStrut", cascade = CascadeType.PERSIST) + public List getDecTipoUnitaDocs() { + return this.decTipoUnitaDocs; + } + + public void setDecTipoUnitaDocs(List decTipoUnitaDocs) { + this.decTipoUnitaDocs = decTipoUnitaDocs; + } + + // bi-directional many-to-one association to DecTitol + @OneToMany(mappedBy = "orgStrut", cascade = { CascadeType.PERSIST, CascadeType.REMOVE }) + @XmlTransient + public List getDecTitols() { + return this.decTitols; + } + + public void setDecTitols(List decTitols) { + this.decTitols = decTitols; + } + + // bi-directional many-to-one association to DecXsdDatiSpec + @OneToMany(mappedBy = "orgStrut", cascade = CascadeType.PERSIST) + public List getDecXsdDatiSpecs() { + return this.decXsdDatiSpecs; + } + + public void setDecXsdDatiSpecs(List decXsdDatiSpecs) { + this.decXsdDatiSpecs = decXsdDatiSpecs; + } + + // bi-directional many-to-one association to LogLockElab + @OneToMany(mappedBy = "orgStrut") + @XmlTransient + public List getLogLockElabs() { + return this.logLockElabs; + } + + public void setLogLockElabs(List logLockElabs) { + this.logLockElabs = logLockElabs; + } + + // bi-directional many-to-one association to OrgPartitionStrut + @OneToMany(mappedBy = "orgStrut", cascade = CascadeType.REMOVE) + @XmlTransient + public List getOrgPartitionStruts() { + return this.orgPartitionStruts; + } + + public void setOrgPartitionStruts(List orgPartitionStruts) { + this.orgPartitionStruts = orgPartitionStruts; + } + + // bi-directional many-to-one association to OrgEnte + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ENTE") + @XmlTransient + public OrgEnte getOrgEnte() { + return this.orgEnte; + } + + public void setOrgEnte(OrgEnte orgEnte) { + this.orgEnte = orgEnte; + } + + // bi-directional many-to-one association to DecTipoFascicolo + @OneToMany(mappedBy = "orgStrut", cascade = CascadeType.PERSIST) + public List getDecTipoFascicolos() { + return this.decTipoFascicolos; + } + + public void setDecTipoFascicolos(List decTipoFascicolos) { + this.decTipoFascicolos = decTipoFascicolos; + } + + // bi-directional many-to-one association to OrgSubStrut + @OneToMany(mappedBy = "orgStrut", cascade = CascadeType.PERSIST) + public List getOrgSubStruts() { + return this.orgSubStruts; + } + + public void setOrgSubStruts(List orgSubStruts) { + this.orgSubStruts = orgSubStruts; + } + + // bi-directional many-to-one association to VrsDocNonVer + @OneToMany(mappedBy = "orgStrut") + @XmlTransient + public List getVrsDocNonVers() { + return this.vrsDocNonVers; + } + + public void setVrsDocNonVers(List vrsDocNonVers) { + this.vrsDocNonVers = vrsDocNonVers; + } + + // bi-directional many-to-one association to VrsSessioneVers + @OneToMany(mappedBy = "orgStrut") + @XmlTransient + public List getVrsSessioneVers() { + return this.vrsSessioneVers; + } + + public void setVrsSessioneVers(List vrsSessioneVers) { + this.vrsSessioneVers = vrsSessioneVers; + } + + // bi-directional many-to-one association to VrsUnitaDocNonVer + @OneToMany(mappedBy = "orgStrut") + @XmlTransient + public List getVrsUnitaDocNonVers() { + return this.vrsUnitaDocNonVers; + } + + public void setVrsUnitaDocNonVers(List vrsUnitaDocNonVers) { + this.vrsUnitaDocNonVers = vrsUnitaDocNonVers; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 43 * hash + (int) (this.idStrut ^ (this.idStrut >>> 32)); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final OrgStrut other = (OrgStrut) obj; + + return this.idStrut == other.idStrut; + } + + @PrePersist + void preInsert() { + if (this.flCessato == null) { + this.flCessato = "0"; + } + if (this.flArchivioRestituito == null) { + this.flArchivioRestituito = "0"; + } + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgSubStrut.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgSubStrut.java new file mode 100644 index 0000000..f3b69e6 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgSubStrut.java @@ -0,0 +1,145 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlTransient; + +import org.eclipse.persistence.oxm.annotations.XmlInverseReference; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ORG_SUB_STRUT database table. + */ +@Entity +@Table(name = "ORG_SUB_STRUT") +public class OrgSubStrut implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idSubStrut; + + private String dsSubStrut; + + private String nmSubStrut; + + private List orgCampoValSubStruts = new ArrayList<>(); + + private List orgPartitionSubStruts = new ArrayList<>(); + + private OrgStrut orgStrut; + + private List aroUnitaDocs = new ArrayList<>(); + + public OrgSubStrut() {/* Hibernate */ + } + + @Id + @Column(name = "ID_SUB_STRUT") + @GenericGenerator(name = "SORG_SUB_STRUT_ID_SUB_STRUT_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SORG_SUB_STRUT"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SORG_SUB_STRUT_ID_SUB_STRUT_GENERATOR") + public Long getIdSubStrut() { + return this.idSubStrut; + } + + public void setIdSubStrut(Long idSubStrut) { + this.idSubStrut = idSubStrut; + } + + @Column(name = "DS_SUB_STRUT") + public String getDsSubStrut() { + return this.dsSubStrut; + } + + public void setDsSubStrut(String dsSubStrut) { + this.dsSubStrut = dsSubStrut; + } + + @Column(name = "NM_SUB_STRUT") + public String getNmSubStrut() { + return this.nmSubStrut; + } + + public void setNmSubStrut(String nmSubStrut) { + this.nmSubStrut = nmSubStrut; + } + + // bi-directional many-to-one association to OrgCampoValSubStrut + @OneToMany(mappedBy = "orgSubStrut") + @XmlIDREF + public List getOrgCampoValSubStruts() { + return this.orgCampoValSubStruts; + } + + public void setOrgCampoValSubStruts(List orgCampoValSubStruts) { + this.orgCampoValSubStruts = orgCampoValSubStruts; + } + + // bi-directional many-to-one association to OrgPartitionSubStrut + @OneToMany(mappedBy = "orgSubStrut", cascade = CascadeType.REMOVE) + @XmlTransient + public List getOrgPartitionSubStruts() { + return this.orgPartitionSubStruts; + } + + public void setOrgPartitionSubStruts(List orgPartitionSubStruts) { + this.orgPartitionSubStruts = orgPartitionSubStruts; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + @XmlInverseReference(mappedBy = "orgSubStruts") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to AroUnitaDoc + @OneToMany(mappedBy = "orgSubStrut") + @XmlTransient + public List getAroUnitaDocs() { + return this.aroUnitaDocs; + } + + public void setAroUnitaDocs(List aroUnitaDocs) { + this.aroUnitaDocs = aroUnitaDocs; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgValSubPartition.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgValSubPartition.java new file mode 100644 index 0000000..3ec8626 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/OrgValSubPartition.java @@ -0,0 +1,88 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the ORG_VAL_SUB_PARTITION database table. + */ +@Entity +@Table(name = "ORG_VAL_SUB_PARTITION") +public class OrgValSubPartition implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idValSubPartition; + + private String cdValSubPartition; + + private OrgPartition orgPartition; + + public OrgValSubPartition() {/* Hibernate */ + } + + @Id + @Column(name = "ID_VAL_SUB_PARTITION") + @GenericGenerator(name = "SORG_VAL_SUB_PARTITION_ID_VAL_SUB_PARTITION_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SORG_VAL_SUB_PARTITION"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SORG_VAL_SUB_PARTITION_ID_VAL_SUB_PARTITION_GENERATOR") + public Long getIdValSubPartition() { + return this.idValSubPartition; + } + + public void setIdValSubPartition(Long idValSubPartition) { + this.idValSubPartition = idValSubPartition; + } + + @Column(name = "CD_VAL_SUB_PARTITION") + public String getCdValSubPartition() { + return this.cdValSubPartition; + } + + public void setCdValSubPartition(String cdValSubPartition) { + this.cdValSubPartition = cdValSubPartition; + } + + // bi-directional many-to-one association to OrgPartition + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_PARTITION") + public OrgPartition getOrgPartition() { + return this.orgPartition; + } + + public void setOrgPartition(OrgPartition orgPartition) { + this.orgPartition = orgPartition; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/SerVerSerie.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/SerVerSerie.java new file mode 100644 index 0000000..be83edc --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/SerVerSerie.java @@ -0,0 +1,273 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.PrePersist; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the SER_VER_SERIE database table. + */ +@Entity +@Table(name = "SER_VER_SERIE") +public class SerVerSerie implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idVerSerie; + + private String cdVerSerie; + + private String dsListaAnniSelSerie; + + private Date dtCreazioneUnitaDocA; + + private Date dtCreazioneUnitaDocDa; + + private Date dtFineSelSerie; + + private Date dtInizioSelSerie; + + private Date dtRegUnitaDocA; + + private Date dtRegUnitaDocDa; + + private String flUpdAnnulUnitaDoc; + + private BigDecimal idStatoVerSerieCor; + + private BigDecimal niPeriodoSelSerie; + + private BigDecimal pgVerSerie; + + private String tiPeriodoSelSerie; + + private SerVerSerie serVerSerie; + + private List serVerSeries = new ArrayList<>(); + + private String flUpdModifUnitaDoc; + + public SerVerSerie() {/* Hibernate */ + } + + @Id + @Column(name = "ID_VER_SERIE") + @GenericGenerator(name = "SSER_VER_SERIE_ID_VER_SERIE_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SSER_VER_SERIE"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SSER_VER_SERIE_ID_VER_SERIE_GENERATOR") + public Long getIdVerSerie() { + return this.idVerSerie; + } + + public void setIdVerSerie(Long idVerSerie) { + this.idVerSerie = idVerSerie; + } + + @Column(name = "CD_VER_SERIE") + public String getCdVerSerie() { + return this.cdVerSerie; + } + + public void setCdVerSerie(String cdVerSerie) { + this.cdVerSerie = cdVerSerie; + } + + @Column(name = "DS_LISTA_ANNI_SEL_SERIE") + public String getDsListaAnniSelSerie() { + return this.dsListaAnniSelSerie; + } + + public void setDsListaAnniSelSerie(String dsListaAnniSelSerie) { + this.dsListaAnniSelSerie = dsListaAnniSelSerie; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_CREAZIONE_UNITA_DOC_A") + public Date getDtCreazioneUnitaDocA() { + return this.dtCreazioneUnitaDocA; + } + + public void setDtCreazioneUnitaDocA(Date dtCreazioneUnitaDocA) { + this.dtCreazioneUnitaDocA = dtCreazioneUnitaDocA; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_CREAZIONE_UNITA_DOC_DA") + public Date getDtCreazioneUnitaDocDa() { + return this.dtCreazioneUnitaDocDa; + } + + public void setDtCreazioneUnitaDocDa(Date dtCreazioneUnitaDocDa) { + this.dtCreazioneUnitaDocDa = dtCreazioneUnitaDocDa; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_FINE_SEL_SERIE") + public Date getDtFineSelSerie() { + return this.dtFineSelSerie; + } + + public void setDtFineSelSerie(Date dtFineSelSerie) { + this.dtFineSelSerie = dtFineSelSerie; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_INIZIO_SEL_SERIE") + public Date getDtInizioSelSerie() { + return this.dtInizioSelSerie; + } + + public void setDtInizioSelSerie(Date dtInizioSelSerie) { + this.dtInizioSelSerie = dtInizioSelSerie; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_REG_UNITA_DOC_A") + public Date getDtRegUnitaDocA() { + return this.dtRegUnitaDocA; + } + + public void setDtRegUnitaDocA(Date dtRegUnitaDocA) { + this.dtRegUnitaDocA = dtRegUnitaDocA; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_REG_UNITA_DOC_DA") + public Date getDtRegUnitaDocDa() { + return this.dtRegUnitaDocDa; + } + + public void setDtRegUnitaDocDa(Date dtRegUnitaDocDa) { + this.dtRegUnitaDocDa = dtRegUnitaDocDa; + } + + @Column(name = "FL_UPD_ANNUL_UNITA_DOC", columnDefinition = "char(1)") + public String getFlUpdAnnulUnitaDoc() { + return this.flUpdAnnulUnitaDoc; + } + + public void setFlUpdAnnulUnitaDoc(String flUpdAnnulUnitaDoc) { + this.flUpdAnnulUnitaDoc = flUpdAnnulUnitaDoc; + } + + @Column(name = "ID_STATO_VER_SERIE_COR") + public BigDecimal getIdStatoVerSerieCor() { + return this.idStatoVerSerieCor; + } + + public void setIdStatoVerSerieCor(BigDecimal idStatoVerSerieCor) { + this.idStatoVerSerieCor = idStatoVerSerieCor; + } + + @Column(name = "NI_PERIODO_SEL_SERIE") + public BigDecimal getNiPeriodoSelSerie() { + return this.niPeriodoSelSerie; + } + + public void setNiPeriodoSelSerie(BigDecimal niPeriodoSelSerie) { + this.niPeriodoSelSerie = niPeriodoSelSerie; + } + + @Column(name = "PG_VER_SERIE") + public BigDecimal getPgVerSerie() { + return this.pgVerSerie; + } + + public void setPgVerSerie(BigDecimal pgVerSerie) { + this.pgVerSerie = pgVerSerie; + } + + @Column(name = "TI_PERIODO_SEL_SERIE") + public String getTiPeriodoSelSerie() { + return this.tiPeriodoSelSerie; + } + + public void setTiPeriodoSelSerie(String tiPeriodoSelSerie) { + this.tiPeriodoSelSerie = tiPeriodoSelSerie; + } + + // bi-directional many-to-one association to SerVerSerie + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_VER_SERIE_PADRE") + public SerVerSerie getSerVerSerie() { + return this.serVerSerie; + } + + public void setSerVerSerie(SerVerSerie serVerSerie) { + this.serVerSerie = serVerSerie; + } + + // bi-directional many-to-one association to SerVerSerie + @OneToMany(mappedBy = "serVerSerie", cascade = CascadeType.PERSIST) + public List getSerVerSeries() { + return this.serVerSeries; + } + + public void setSerVerSeries(List serVerSeries) { + this.serVerSeries = serVerSeries; + } + + @Column(name = "FL_UPD_MODIF_UNITA_DOC", columnDefinition = "char(1)") + public String getFlUpdModifUnitaDoc() { + return this.flUpdModifUnitaDoc; + } + + public void setFlUpdModifUnitaDoc(String flUpdModifUnitaDoc) { + this.flUpdModifUnitaDoc = flUpdModifUnitaDoc; + } + + /** + * Gestione dei default. Risulta la migliore pratica in quanto è indipendente dal db utilizzato e sfrutta diretta + * JPA quindi calabile sotto ogni contesto in termini di ORM + * + * ref. https://stackoverflow.com/a/13432234 + */ + @PrePersist + void preInsert() { + if (this.flUpdModifUnitaDoc == null) { + this.flUpdModifUnitaDoc = "0"; + } + if (this.flUpdAnnulUnitaDoc == null) { + this.flUpdAnnulUnitaDoc = "0"; + } + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDatiSessioneVers.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDatiSessioneVers.java new file mode 100644 index 0000000..d779271 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDatiSessioneVers.java @@ -0,0 +1,160 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_DATI_SESSIONE_VERS database table. + */ +@Entity +@Table(name = "VRS_DATI_SESSIONE_VERS") +public class VrsDatiSessioneVers implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idDatiSessioneVers; + + private String cdKeyAlleg; + + private BigDecimal idStrut; + + private BigDecimal niFile; + + private BigDecimal pgDatiSessioneVers; + + private String tiDatiSessioneVers; + + private VrsSessioneVers vrsSessioneVers; + + private List vrsErrSessioneVers = new ArrayList<>(); + + private List vrsXmlDatiSessioneVers = new ArrayList<>(); + + public VrsDatiSessioneVers() {/* Hibernate */ + } + + @Id + @Column(name = "ID_DATI_SESSIONE_VERS") + @GenericGenerator(name = "SVRS_DATI_SESSIONE_VERS_ID_DATI_SESSIONE_VERS_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_DATI_SESSIONE_VERS"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_DATI_SESSIONE_VERS_ID_DATI_SESSIONE_VERS_GENERATOR") + public Long getIdDatiSessioneVers() { + return this.idDatiSessioneVers; + } + + public void setIdDatiSessioneVers(Long idDatiSessioneVers) { + this.idDatiSessioneVers = idDatiSessioneVers; + } + + @Column(name = "CD_KEY_ALLEG") + public String getCdKeyAlleg() { + return this.cdKeyAlleg; + } + + public void setCdKeyAlleg(String cdKeyAlleg) { + this.cdKeyAlleg = cdKeyAlleg; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "NI_FILE") + public BigDecimal getNiFile() { + return this.niFile; + } + + public void setNiFile(BigDecimal niFile) { + this.niFile = niFile; + } + + @Column(name = "PG_DATI_SESSIONE_VERS") + public BigDecimal getPgDatiSessioneVers() { + return this.pgDatiSessioneVers; + } + + public void setPgDatiSessioneVers(BigDecimal pgDatiSessioneVers) { + this.pgDatiSessioneVers = pgDatiSessioneVers; + } + + @Column(name = "TI_DATI_SESSIONE_VERS") + public String getTiDatiSessioneVers() { + return this.tiDatiSessioneVers; + } + + public void setTiDatiSessioneVers(String tiDatiSessioneVers) { + this.tiDatiSessioneVers = tiDatiSessioneVers; + } + + // bi-directional many-to-one association to VrsSessioneVers + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SESSIONE_VERS") + public VrsSessioneVers getVrsSessioneVers() { + return this.vrsSessioneVers; + } + + public void setVrsSessioneVers(VrsSessioneVers vrsSessioneVers) { + this.vrsSessioneVers = vrsSessioneVers; + } + + // bi-directional many-to-one association to VrsErrSessioneVers + @OneToMany(mappedBy = "vrsDatiSessioneVers") + public List getVrsErrSessioneVers() { + return this.vrsErrSessioneVers; + } + + public void setVrsErrSessioneVers(List vrsErrSessioneVers) { + this.vrsErrSessioneVers = vrsErrSessioneVers; + } + + // bi-directional many-to-one association to VrsXmlDatiSessioneVers + @OneToMany(mappedBy = "vrsDatiSessioneVers") + public List getVrsXmlDatiSessioneVers() { + return this.vrsXmlDatiSessioneVers; + } + + public void setVrsXmlDatiSessioneVers(List vrsXmlDatiSessioneVers) { + this.vrsXmlDatiSessioneVers = vrsXmlDatiSessioneVers; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDatiSessioneVersKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDatiSessioneVersKo.java new file mode 100644 index 0000000..933718d --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDatiSessioneVersKo.java @@ -0,0 +1,166 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.util.ArrayList; +import java.io.Serializable; +import javax.persistence.*; +import java.math.BigDecimal; +import java.util.List; + +/** + * The persistent class for the VRS_DATI_SESSIONE_VERS_KO database table. + */ +@Entity +@Table(name = "VRS_DATI_SESSIONE_VERS_KO") +public class VrsDatiSessioneVersKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idDatiSessioneVersKo; + + private String cdKeyAlleg; + + private BigDecimal idStrut; + + private BigDecimal niFile; + + private BigDecimal pgDatiSessioneVers; + + private String tiDatiSessioneVers; + + private VrsSessioneVersKo vrsSessioneVersKo; + + private List vrsErrSessioneVersKos = new ArrayList<>(); + + private List vrsFileSessioneKos = new ArrayList<>(); + + private List vrsXmlDatiSessioneVersKos = new ArrayList<>(); + + private List xmlDatiSesObjectStorageKos = new ArrayList<>(); + + public VrsDatiSessioneVersKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_DATI_SESSIONE_VERS_KO") + @GeneratedValue(strategy = GenerationType.IDENTITY) + public Long getIdDatiSessioneVersKo() { + return this.idDatiSessioneVersKo; + } + + public void setIdDatiSessioneVersKo(Long idDatiSessioneVersKo) { + this.idDatiSessioneVersKo = idDatiSessioneVersKo; + } + + @Column(name = "CD_KEY_ALLEG") + public String getCdKeyAlleg() { + return this.cdKeyAlleg; + } + + public void setCdKeyAlleg(String cdKeyAlleg) { + this.cdKeyAlleg = cdKeyAlleg; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "NI_FILE") + public BigDecimal getNiFile() { + return this.niFile; + } + + public void setNiFile(BigDecimal niFile) { + this.niFile = niFile; + } + + @Column(name = "PG_DATI_SESSIONE_VERS") + public BigDecimal getPgDatiSessioneVers() { + return this.pgDatiSessioneVers; + } + + public void setPgDatiSessioneVers(BigDecimal pgDatiSessioneVers) { + this.pgDatiSessioneVers = pgDatiSessioneVers; + } + + @Column(name = "TI_DATI_SESSIONE_VERS") + public String getTiDatiSessioneVers() { + return this.tiDatiSessioneVers; + } + + public void setTiDatiSessioneVers(String tiDatiSessioneVers) { + this.tiDatiSessioneVers = tiDatiSessioneVers; + } + + // bi-directional many-to-one association to VrsSessioneVersKo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SESSIONE_VERS_KO") + public VrsSessioneVersKo getVrsSessioneVersKo() { + return this.vrsSessioneVersKo; + } + + public void setVrsSessioneVersKo(VrsSessioneVersKo vrsSessioneVersKo) { + this.vrsSessioneVersKo = vrsSessioneVersKo; + } + + // bi-directional many-to-one association to VrsErrSessioneVersKo + @OneToMany(mappedBy = "vrsDatiSessioneVersKo") + public List getVrsErrSessioneVersKos() { + return this.vrsErrSessioneVersKos; + } + + public void setVrsErrSessioneVersKos(List vrsErrSessioneVersKos) { + this.vrsErrSessioneVersKos = vrsErrSessioneVersKos; + } + + // bi-directional many-to-one association to VrsFileSessioneKo + @OneToMany(mappedBy = "vrsDatiSessioneVersKo") + public List getVrsFileSessioneKos() { + return this.vrsFileSessioneKos; + } + + public void setVrsFileSessioneKos(List vrsFileSessioneKos) { + this.vrsFileSessioneKos = vrsFileSessioneKos; + } + + // bi-directional many-to-one association to VrsXmlDatiSessioneVersKo + @OneToMany(mappedBy = "vrsDatiSessioneVersKo") + public List getVrsXmlDatiSessioneVersKos() { + return this.vrsXmlDatiSessioneVersKos; + } + + public void setVrsXmlDatiSessioneVersKos(List vrsXmlDatiSessioneVersKos) { + this.vrsXmlDatiSessioneVersKos = vrsXmlDatiSessioneVersKos; + } + + @OneToMany(mappedBy = "datiSessioneVersKo") + public List getXmlDatiSesObjectStorageKos() { + return xmlDatiSesObjectStorageKos; + } + + public void setXmlDatiSesObjectStorageKos(List xmlDatiSesObjectStorageKos) { + this.xmlDatiSesObjectStorageKos = xmlDatiSesObjectStorageKos; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDocNonVer.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDocNonVer.java new file mode 100644 index 0000000..2d7789b --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDocNonVer.java @@ -0,0 +1,171 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_DOC_NON_VERS database table. + */ +@Entity +@Table(name = "VRS_DOC_NON_VERS") +public class VrsDocNonVer implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idDocNonVers; + + private BigDecimal aaKeyUnitaDoc; + + private String cdErrPrinc; + + private String cdKeyDocVers; + + private String cdKeyUnitaDoc; + + private String cdRegistroKeyUnitaDoc; + + private String dsErrPrinc; + + private Date dtFirstSesErr; + + private Date dtLastSesErr; + + private OrgStrut orgStrut; + + public VrsDocNonVer() {/* Hibernate */ + } + + @Id + @Column(name = "ID_DOC_NON_VERS") + @GenericGenerator(name = "SVRS_DOC_NON_VERS_ID_DOC_NON_VERS_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_DOC_NON_VERS"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_DOC_NON_VERS_ID_DOC_NON_VERS_GENERATOR") + public Long getIdDocNonVers() { + return this.idDocNonVers; + } + + public void setIdDocNonVers(Long idDocNonVers) { + this.idDocNonVers = idDocNonVers; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return this.aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + @Column(name = "CD_ERR_PRINC") + public String getCdErrPrinc() { + return this.cdErrPrinc; + } + + public void setCdErrPrinc(String cdErrPrinc) { + this.cdErrPrinc = cdErrPrinc; + } + + @Column(name = "CD_KEY_DOC_VERS") + public String getCdKeyDocVers() { + return this.cdKeyDocVers; + } + + public void setCdKeyDocVers(String cdKeyDocVers) { + this.cdKeyDocVers = cdKeyDocVers; + } + + @Column(name = "CD_KEY_UNITA_DOC") + public String getCdKeyUnitaDoc() { + return this.cdKeyUnitaDoc; + } + + public void setCdKeyUnitaDoc(String cdKeyUnitaDoc) { + this.cdKeyUnitaDoc = cdKeyUnitaDoc; + } + + @Column(name = "CD_REGISTRO_KEY_UNITA_DOC") + public String getCdRegistroKeyUnitaDoc() { + return this.cdRegistroKeyUnitaDoc; + } + + public void setCdRegistroKeyUnitaDoc(String cdRegistroKeyUnitaDoc) { + this.cdRegistroKeyUnitaDoc = cdRegistroKeyUnitaDoc; + } + + @Column(name = "DS_ERR_PRINC") + public String getDsErrPrinc() { + return this.dsErrPrinc; + } + + public void setDsErrPrinc(String dsErrPrinc) { + this.dsErrPrinc = dsErrPrinc; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_FIRST_SES_ERR") + public Date getDtFirstSesErr() { + return this.dtFirstSesErr; + } + + public void setDtFirstSesErr(Date dtFirstSesErr) { + this.dtFirstSesErr = dtFirstSesErr; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_LAST_SES_ERR") + public Date getDtLastSesErr() { + return this.dtLastSesErr; + } + + public void setDtLastSesErr(Date dtLastSesErr) { + this.dtLastSesErr = dtLastSesErr; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDtVers.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDtVers.java new file mode 100644 index 0000000..a79dc6e --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsDtVers.java @@ -0,0 +1,236 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_DT_VERS database table. + */ +@Entity +@Table(name = "VRS_DT_VERS") +public class VrsDtVers implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idDtVers; + + private String dlPathDtVers; + + private Date dtCreazioneDtVers; + + private Date dtLastArkDtVers; + + private Date dtLastArkDtVersSecondario; + + private Date dtStatoDtVers; + + // MAC#27629 + /* + * NB. Data mantenuta intenzionalmente con LocalDate per mantenerla compatibile con il TPI NON TOCCARE + */ + private LocalDate dtVers; + // end MAC#27629 + + private String flArk; + + private String flArkSecondario; + + private String flFileNoArk; + + private String flFileNoArkSecondario; + + private String flMigraz; + + private String flPresenzaSecondario; + + private String tiStatoDtVers; + + private List vrsPathDtVers = new ArrayList<>(); + + public VrsDtVers() {/* Hibernate */ + } + + @Id + @Column(name = "ID_DT_VERS") + @GenericGenerator(name = "SVRS_DT_VERS_ID_DT_VERS_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_DT_VERS"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_DT_VERS_ID_DT_VERS_GENERATOR") + public Long getIdDtVers() { + return this.idDtVers; + } + + public void setIdDtVers(Long idDtVers) { + this.idDtVers = idDtVers; + } + + @Column(name = "DL_PATH_DT_VERS") + public String getDlPathDtVers() { + return this.dlPathDtVers; + } + + public void setDlPathDtVers(String dlPathDtVers) { + this.dlPathDtVers = dlPathDtVers; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_CREAZIONE_DT_VERS") + public Date getDtCreazioneDtVers() { + return this.dtCreazioneDtVers; + } + + public void setDtCreazioneDtVers(Date dtCreazioneDtVers) { + this.dtCreazioneDtVers = dtCreazioneDtVers; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_LAST_ARK_DT_VERS") + public Date getDtLastArkDtVers() { + return this.dtLastArkDtVers; + } + + public void setDtLastArkDtVers(Date dtLastArkDtVers) { + this.dtLastArkDtVers = dtLastArkDtVers; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_LAST_ARK_DT_VERS_SECONDARIO") + public Date getDtLastArkDtVersSecondario() { + return this.dtLastArkDtVersSecondario; + } + + public void setDtLastArkDtVersSecondario(Date dtLastArkDtVersSecondario) { + this.dtLastArkDtVersSecondario = dtLastArkDtVersSecondario; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_STATO_DT_VERS") + public Date getDtStatoDtVers() { + return this.dtStatoDtVers; + } + + public void setDtStatoDtVers(Date dtStatoDtVers) { + this.dtStatoDtVers = dtStatoDtVers; + } + + // MAC#27629 + /* + * NB. Data mantenuta intenzionalmente con LocalDate per mantenerla compatibile con il TPI NON TOCCARE + */ + @Column(name = "DT_VERS") + public LocalDate getDtVers() { + return this.dtVers; + } + + public void setDtVers(LocalDate dtVers) { + this.dtVers = dtVers; + } + // end MAC#27629 + + @Column(name = "FL_ARK", columnDefinition = "char(1)") + public String getFlArk() { + return this.flArk; + } + + public void setFlArk(String flArk) { + this.flArk = flArk; + } + + @Column(name = "FL_ARK_SECONDARIO", columnDefinition = "char(1)") + public String getFlArkSecondario() { + return this.flArkSecondario; + } + + public void setFlArkSecondario(String flArkSecondario) { + this.flArkSecondario = flArkSecondario; + } + + @Column(name = "FL_FILE_NO_ARK", columnDefinition = "char(1)") + public String getFlFileNoArk() { + return this.flFileNoArk; + } + + public void setFlFileNoArk(String flFileNoArk) { + this.flFileNoArk = flFileNoArk; + } + + @Column(name = "FL_FILE_NO_ARK_SECONDARIO", columnDefinition = "char(1)") + public String getFlFileNoArkSecondario() { + return this.flFileNoArkSecondario; + } + + public void setFlFileNoArkSecondario(String flFileNoArkSecondario) { + this.flFileNoArkSecondario = flFileNoArkSecondario; + } + + @Column(name = "FL_MIGRAZ", columnDefinition = "char(1)") + public String getFlMigraz() { + return this.flMigraz; + } + + public void setFlMigraz(String flMigraz) { + this.flMigraz = flMigraz; + } + + @Column(name = "FL_PRESENZA_SECONDARIO", columnDefinition = "char(1)") + public String getFlPresenzaSecondario() { + return this.flPresenzaSecondario; + } + + public void setFlPresenzaSecondario(String flPresenzaSecondario) { + this.flPresenzaSecondario = flPresenzaSecondario; + } + + @Column(name = "TI_STATO_DT_VERS") + public String getTiStatoDtVers() { + return this.tiStatoDtVers; + } + + public void setTiStatoDtVers(String tiStatoDtVers) { + this.tiStatoDtVers = tiStatoDtVers; + } + + // bi-directional many-to-one association to VrsPathDtVer + @OneToMany(mappedBy = "vrsDtVers") + public List getVrsPathDtVers() { + return this.vrsPathDtVers; + } + + public void setVrsPathDtVers(List vrsPathDtVers) { + this.vrsPathDtVers = vrsPathDtVers; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSesFascicoloKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSesFascicoloKo.java new file mode 100644 index 0000000..bc21161 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSesFascicoloKo.java @@ -0,0 +1,135 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_ERR_SES_FASCICOLO_KO database table. + */ +@Entity +@Table(name = "VRS_ERR_SES_FASCICOLO_KO") +public class VrsErrSesFascicoloKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idErrSesFascicoloKo; + + private String dsErr; + + private String flErrPrinc; + + private BigDecimal pgErr; + + private String tiErr; + + private DecErrSacer decErrSacer; + + private VrsSesFascicoloKo vrsSesFascicoloKo; + + public VrsErrSesFascicoloKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_ERR_SES_FASCICOLO_KO") + @GenericGenerator(name = "SVRS_ERR_SES_FASCICOLO_KO_ID_ERR_SES_FASCICOLO_KO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_ERR_SES_FASCICOLO_KO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_ERR_SES_FASCICOLO_KO_ID_ERR_SES_FASCICOLO_KO_GENERATOR") + public Long getIdErrSesFascicoloKo() { + return this.idErrSesFascicoloKo; + } + + public void setIdErrSesFascicoloKo(Long idErrSesFascicoloKo) { + this.idErrSesFascicoloKo = idErrSesFascicoloKo; + } + + @Column(name = "DS_ERR") + public String getDsErr() { + return this.dsErr; + } + + public void setDsErr(String dsErr) { + this.dsErr = dsErr; + } + + @Column(name = "FL_ERR_PRINC", columnDefinition = "char(1)") + public String getFlErrPrinc() { + return this.flErrPrinc; + } + + public void setFlErrPrinc(String flErrPrinc) { + this.flErrPrinc = flErrPrinc; + } + + @Column(name = "PG_ERR") + public BigDecimal getPgErr() { + return this.pgErr; + } + + public void setPgErr(BigDecimal pgErr) { + this.pgErr = pgErr; + } + + @Column(name = "TI_ERR") + public String getTiErr() { + return this.tiErr; + } + + public void setTiErr(String tiErr) { + this.tiErr = tiErr; + } + + // bi-directional many-to-one association to DecErrSacer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ERR_SACER") + public DecErrSacer getDecErrSacer() { + return this.decErrSacer; + } + + public void setDecErrSacer(DecErrSacer decErrSacer) { + this.decErrSacer = decErrSacer; + } + + // bi-directional many-to-one association to VrsSesFascicoloKo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SES_FASCICOLO_KO") + public VrsSesFascicoloKo getVrsSesFascicoloKo() { + return this.vrsSesFascicoloKo; + } + + public void setVrsSesFascicoloKo(VrsSesFascicoloKo vrsSesFascicoloKo) { + this.vrsSesFascicoloKo = vrsSesFascicoloKo; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSesUpdUnitaDocErr.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSesUpdUnitaDocErr.java new file mode 100644 index 0000000..8fbc3c2 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSesUpdUnitaDocErr.java @@ -0,0 +1,153 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.VrsErrSesUpdUnitaDocErr.TiErrVrsErrSesUpdUnitaDocErr; + +/** + * The persistent class for the VRS_ERR_SES_UPD_UNITA_DOC_ERR database table. + */ +@Entity +@Table(name = "VRS_ERR_SES_UPD_UNITA_DOC_ERR") +public class VrsErrSesUpdUnitaDocErr implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idErrSesUpdUnitaDocErr; + + private String dsErr; + + private String flErrPrinc; + + private DecControlloWs decControlloWs; + + private DecErrSacer decErrSacer; + + private VrsSesUpdUnitaDocErr vrsSesUpdUnitaDocErr; + + private BigDecimal pgErr; + + private TiErrVrsErrSesUpdUnitaDocErr tiErr; + + public VrsErrSesUpdUnitaDocErr() {/* Hibernate */ + } + + @Id + @Column(name = "ID_ERR_SES_UPD_UNITA_DOC_ERR") + @GenericGenerator(name = "SVRS_ERR_SES_UPD_UNITA_DOC_ERR_ID_ERR_SES_UPD_UNITA_DOC_ERR_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_ERR_SES_UPD_UNITA_DOC_ERR"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_ERR_SES_UPD_UNITA_DOC_ERR_ID_ERR_SES_UPD_UNITA_DOC_ERR_GENERATOR") + public Long getIdErrSesUpdUnitaDocErr() { + return this.idErrSesUpdUnitaDocErr; + } + + public void setIdErrSesUpdUnitaDocErr(Long idErrSesUpdUnitaDocErr) { + this.idErrSesUpdUnitaDocErr = idErrSesUpdUnitaDocErr; + } + + @Column(name = "DS_ERR") + public String getDsErr() { + return this.dsErr; + } + + public void setDsErr(String dsErr) { + this.dsErr = dsErr; + } + + @Column(name = "FL_ERR_PRINC", columnDefinition = "char(1)") + public String getFlErrPrinc() { + return this.flErrPrinc; + } + + public void setFlErrPrinc(String flErrPrinc) { + this.flErrPrinc = flErrPrinc; + } + + // bi-directional many-to-one association to DecErrSacer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CONTROLLO_WS") + public DecControlloWs getDecControlloWs() { + return this.decControlloWs; + } + + public void setDecControlloWs(DecControlloWs decControlloWs) { + this.decControlloWs = decControlloWs; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ERR_SACER") + public DecErrSacer getDecErrSacer() { + return this.decErrSacer; + } + + public void setDecErrSacer(DecErrSacer decErrSacer) { + this.decErrSacer = decErrSacer; + } + + // bi-directional many-to-one association to DecErrSacer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SES_UPD_UNITA_DOC_ERR") + public VrsSesUpdUnitaDocErr getVrsSesUpdUnitaDocErr() { + return this.vrsSesUpdUnitaDocErr; + } + + public void setVrsSesUpdUnitaDocErr(VrsSesUpdUnitaDocErr vrsSesUpdUnitaDocErr) { + this.vrsSesUpdUnitaDocErr = vrsSesUpdUnitaDocErr; + } + + @Column(name = "PG_ERR") + public BigDecimal getPgErr() { + return this.pgErr; + } + + public void setPgErr(BigDecimal pgErr) { + this.pgErr = pgErr; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_ERR") + public TiErrVrsErrSesUpdUnitaDocErr getTiErr() { + return this.tiErr; + } + + public void setTiErr(TiErrVrsErrSesUpdUnitaDocErr tiErr) { + this.tiErr = tiErr; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSesUpdUnitaDocKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSesUpdUnitaDocKo.java new file mode 100644 index 0000000..069d5e5 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSesUpdUnitaDocKo.java @@ -0,0 +1,176 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.VrsErrUpdUnitaDocKo.TiErrVrsErrUpdUnitaDocKo; + +/** + * The persistent class for the VRS_ERR_SES_UPD_UNITA_DOC_KO database table. + */ +@Entity +@Table(name = "VRS_ERR_SES_UPD_UNITA_DOC_KO") +public class VrsErrSesUpdUnitaDocKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idErrSesUpdUnitaDocKo; + + private String dsErr; + + private String flErrPrinc; + + private DecControlloWs decControlloWs; + + private DecErrSacer decErrSacer; + + private VrsSesUpdUnitaDocKo vrsSesUpdUnitaDocKo; + + private BigDecimal pgErr; + + private TiErrVrsErrUpdUnitaDocKo tiErr; + + private OrgStrut orgStrut; + + private Integer aaKeyUnitaDoc; + + public VrsErrSesUpdUnitaDocKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_ERR_SES_UPD_UNITA_DOC_KO") + @GenericGenerator(name = "SVRS_ERR_SES_UPD_UNITA_DOC_KO_ID_ERR_SES_UPD_UNITA_DOC_KO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_ERR_SES_UPD_UNITA_DOC_KO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_ERR_SES_UPD_UNITA_DOC_KO_ID_ERR_SES_UPD_UNITA_DOC_KO_GENERATOR") + public Long getIdErrSesUpdUnitaDocKo() { + return this.idErrSesUpdUnitaDocKo; + } + + public void setIdErrSesUpdUnitaDocKo(Long idErrSesUpdUnitaDocKo) { + this.idErrSesUpdUnitaDocKo = idErrSesUpdUnitaDocKo; + } + + @Column(name = "DS_ERR") + public String getDsErr() { + return this.dsErr; + } + + public void setDsErr(String dsErr) { + this.dsErr = dsErr; + } + + @Column(name = "FL_ERR_PRINC", columnDefinition = "char(1)") + public String getFlErrPrinc() { + return this.flErrPrinc; + } + + public void setFlErrPrinc(String flErrPrinc) { + this.flErrPrinc = flErrPrinc; + } + + // bi-directional many-to-one association to DecErrSacer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CONTROLLO_WS") + public DecControlloWs getDecControlloWs() { + return this.decControlloWs; + } + + public void setDecControlloWs(DecControlloWs decControlloWs) { + this.decControlloWs = decControlloWs; + } + + // bi-directional many-to-one association to DecErrSacer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ERR_SACER") + public DecErrSacer getDecErrSacer() { + return this.decErrSacer; + } + + public void setDecErrSacer(DecErrSacer decErrSacer) { + this.decErrSacer = decErrSacer; + } + + // bi-directional many-to-one association to DecTipoUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SES_UPD_UNITA_DOC_KO") + public VrsSesUpdUnitaDocKo getVrsSesUpdUnitaDocKo() { + return this.vrsSesUpdUnitaDocKo; + } + + public void setVrsSesUpdUnitaDocKo(VrsSesUpdUnitaDocKo vrsSesUpdUnitaDocKo) { + this.vrsSesUpdUnitaDocKo = vrsSesUpdUnitaDocKo; + } + + @Column(name = "PG_ERR") + public BigDecimal getPgErr() { + return this.pgErr; + } + + public void setPgErr(BigDecimal pgErr) { + this.pgErr = pgErr; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_ERR") + public TiErrVrsErrUpdUnitaDocKo getTiErr() { + return this.tiErr; + } + + public void setTiErr(TiErrVrsErrUpdUnitaDocKo tiErr) { + this.tiErr = tiErr; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public Integer getAaKeyUnitaDoc() { + return aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(Integer aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSessioneVers.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSessioneVers.java new file mode 100644 index 0000000..653c295 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSessioneVers.java @@ -0,0 +1,143 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_ERR_SESSIONE_VERS database table. + */ +@Entity +@Table(name = "VRS_ERR_SESSIONE_VERS") +public class VrsErrSessioneVers implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idErrSessioneVers; + + private String cdErr; + + private String dsErr; + + private String flErrPrinc; + + private BigDecimal idStrut; + + private BigDecimal pgErrSessioneVers; + + private String tiErr; + + private VrsDatiSessioneVers vrsDatiSessioneVers; + + public VrsErrSessioneVers() {/* Hibernate */ + } + + @Id + @Column(name = "ID_ERR_SESSIONE_VERS") + @GenericGenerator(name = "SVRS_ERR_SESSIONE_VERS_ID_ERR_SESSIONE_VERS_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_ERR_SESSIONE_VERS"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_ERR_SESSIONE_VERS_ID_ERR_SESSIONE_VERS_GENERATOR") + public Long getIdErrSessioneVers() { + return this.idErrSessioneVers; + } + + public void setIdErrSessioneVers(Long idErrSessioneVers) { + this.idErrSessioneVers = idErrSessioneVers; + } + + @Column(name = "CD_ERR") + public String getCdErr() { + return this.cdErr; + } + + public void setCdErr(String cdErr) { + this.cdErr = cdErr; + } + + @Column(name = "DS_ERR") + public String getDsErr() { + return this.dsErr; + } + + public void setDsErr(String dsErr) { + this.dsErr = dsErr; + } + + @Column(name = "FL_ERR_PRINC", columnDefinition = "char(1)") + public String getFlErrPrinc() { + return this.flErrPrinc; + } + + public void setFlErrPrinc(String flErrPrinc) { + this.flErrPrinc = flErrPrinc; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "PG_ERR_SESSIONE_VERS") + public BigDecimal getPgErrSessioneVers() { + return this.pgErrSessioneVers; + } + + public void setPgErrSessioneVers(BigDecimal pgErrSessioneVers) { + this.pgErrSessioneVers = pgErrSessioneVers; + } + + @Column(name = "TI_ERR") + public String getTiErr() { + return this.tiErr; + } + + public void setTiErr(String tiErr) { + this.tiErr = tiErr; + } + + // bi-directional many-to-one association to VrsDatiSessioneVers + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DATI_SESSIONE_VERS") + public VrsDatiSessioneVers getVrsDatiSessioneVers() { + return this.vrsDatiSessioneVers; + } + + public void setVrsDatiSessioneVers(VrsDatiSessioneVers vrsDatiSessioneVers) { + this.vrsDatiSessioneVers = vrsDatiSessioneVers; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSessioneVersKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSessioneVersKo.java new file mode 100644 index 0000000..b52b8e7 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsErrSessioneVersKo.java @@ -0,0 +1,131 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import it.eng.sequences.hibernate.NonMonotonicSequenceGenerator; +import java.io.Serializable; +import javax.persistence.*; +import java.math.BigDecimal; +import org.hibernate.id.enhanced.SequenceStyleGenerator; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; + +/** + * The persistent class for the VRS_ERR_SESSIONE_VERS_KO database table. + */ +@Entity +@Table(name = "VRS_ERR_SESSIONE_VERS_KO") +public class VrsErrSessioneVersKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idErrSessioneVersKo; + + private String cdErr; + + private String dsErr; + + private String flErrPrinc; + + private BigDecimal idStrut; + + private BigDecimal pgErrSessioneVers; + + private String tiErr; + + private VrsDatiSessioneVersKo vrsDatiSessioneVersKo; + + public VrsErrSessioneVersKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_ERR_SESSIONE_VERS_KO") + @GeneratedValue(strategy = GenerationType.IDENTITY) + public Long getIdErrSessioneVersKo() { + return this.idErrSessioneVersKo; + } + + public void setIdErrSessioneVersKo(Long idErrSessioneVersKo) { + this.idErrSessioneVersKo = idErrSessioneVersKo; + } + + @Column(name = "CD_ERR") + public String getCdErr() { + return this.cdErr; + } + + public void setCdErr(String cdErr) { + this.cdErr = cdErr; + } + + @Column(name = "DS_ERR") + public String getDsErr() { + return this.dsErr; + } + + public void setDsErr(String dsErr) { + this.dsErr = dsErr; + } + + @Column(name = "FL_ERR_PRINC", columnDefinition = "char(1)") + public String getFlErrPrinc() { + return this.flErrPrinc; + } + + public void setFlErrPrinc(String flErrPrinc) { + this.flErrPrinc = flErrPrinc; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "PG_ERR_SESSIONE_VERS") + public BigDecimal getPgErrSessioneVers() { + return this.pgErrSessioneVers; + } + + public void setPgErrSessioneVers(BigDecimal pgErrSessioneVers) { + this.pgErrSessioneVers = pgErrSessioneVers; + } + + @Column(name = "TI_ERR") + public String getTiErr() { + return this.tiErr; + } + + public void setTiErr(String tiErr) { + this.tiErr = tiErr; + } + + // bi-directional many-to-one association to VrsDatiSessioneVersKo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DATI_SESSIONE_VERS_KO") + public VrsDatiSessioneVersKo getVrsDatiSessioneVersKo() { + return this.vrsDatiSessioneVersKo; + } + + public void setVrsDatiSessioneVersKo(VrsDatiSessioneVersKo vrsDatiSessioneVersKo) { + this.vrsDatiSessioneVersKo = vrsDatiSessioneVersKo; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsFascicoloKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsFascicoloKo.java new file mode 100644 index 0000000..f3775bf --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsFascicoloKo.java @@ -0,0 +1,211 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_FASCICOLO_KO database table. + */ +@Entity +@Table(name = "VRS_FASCICOLO_KO") +public class VrsFascicoloKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idFascicoloKo; + + private BigDecimal aaFascicolo; + + private String cdKeyFascicolo; + + private String dsErrPrinc; + + private BigDecimal idSesFascicoloKoFirst; + + private BigDecimal idSesFascicoloKoLast; + + private String tiStatoFascicoloKo; + + private Date tsIniFirstSes; + + private Date tsIniLastSes; + + private DecErrSacer decErrSacer; + + private DecTipoFascicolo decTipoFascicolo; + + private OrgStrut orgStrut; + + private List vrsSesFascicoloKos = new ArrayList<>(); + + public VrsFascicoloKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_FASCICOLO_KO") + @GenericGenerator(name = "SVRS_FASCICOLO_KO_ID_FASCICOLO_KO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_FASCICOLO_KO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_FASCICOLO_KO_ID_FASCICOLO_KO_GENERATOR") + public Long getIdFascicoloKo() { + return this.idFascicoloKo; + } + + public void setIdFascicoloKo(Long idFascicoloKo) { + this.idFascicoloKo = idFascicoloKo; + } + + @Column(name = "AA_FASCICOLO") + public BigDecimal getAaFascicolo() { + return this.aaFascicolo; + } + + public void setAaFascicolo(BigDecimal aaFascicolo) { + this.aaFascicolo = aaFascicolo; + } + + @Column(name = "CD_KEY_FASCICOLO") + public String getCdKeyFascicolo() { + return this.cdKeyFascicolo; + } + + public void setCdKeyFascicolo(String cdKeyFascicolo) { + this.cdKeyFascicolo = cdKeyFascicolo; + } + + @Column(name = "DS_ERR_PRINC") + public String getDsErrPrinc() { + return this.dsErrPrinc; + } + + public void setDsErrPrinc(String dsErrPrinc) { + this.dsErrPrinc = dsErrPrinc; + } + + @Column(name = "ID_SES_FASCICOLO_KO_FIRST") + public BigDecimal getIdSesFascicoloKoFirst() { + return this.idSesFascicoloKoFirst; + } + + public void setIdSesFascicoloKoFirst(BigDecimal idSesFascicoloKoFirst) { + this.idSesFascicoloKoFirst = idSesFascicoloKoFirst; + } + + @Column(name = "ID_SES_FASCICOLO_KO_LAST") + public BigDecimal getIdSesFascicoloKoLast() { + return this.idSesFascicoloKoLast; + } + + public void setIdSesFascicoloKoLast(BigDecimal idSesFascicoloKoLast) { + this.idSesFascicoloKoLast = idSesFascicoloKoLast; + } + + @Column(name = "TI_STATO_FASCICOLO_KO") + public String getTiStatoFascicoloKo() { + return this.tiStatoFascicoloKo; + } + + public void setTiStatoFascicoloKo(String tiStatoFascicoloKo) { + this.tiStatoFascicoloKo = tiStatoFascicoloKo; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_INI_FIRST_SES") + public Date getTsIniFirstSes() { + return this.tsIniFirstSes; + } + + public void setTsIniFirstSes(Date tsIniFirstSes) { + this.tsIniFirstSes = tsIniFirstSes; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_INI_LAST_SES") + public Date getTsIniLastSes() { + return this.tsIniLastSes; + } + + public void setTsIniLastSes(Date tsIniLastSes) { + this.tsIniLastSes = tsIniLastSes; + } + + // bi-directional many-to-one association to DecErrSacer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ERR_SACER_PRINC") + public DecErrSacer getDecErrSacer() { + return this.decErrSacer; + } + + public void setDecErrSacer(DecErrSacer decErrSacer) { + this.decErrSacer = decErrSacer; + } + + // bi-directional many-to-one association to DecTipoFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_FASCICOLO_LAST") + public DecTipoFascicolo getDecTipoFascicolo() { + return this.decTipoFascicolo; + } + + public void setDecTipoFascicolo(DecTipoFascicolo decTipoFascicolo) { + this.decTipoFascicolo = decTipoFascicolo; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to VrsSesFascicoloKo + @OneToMany(mappedBy = "vrsFascicoloKo") + public List getVrsSesFascicoloKos() { + return this.vrsSesFascicoloKos; + } + + public void setVrsSesFascicoloKos(List vrsSesFascicoloKos) { + this.vrsSesFascicoloKos = vrsSesFascicoloKos; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsFileSesObjectStorageKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsFileSesObjectStorageKo.java new file mode 100644 index 0000000..a97075e --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsFileSesObjectStorageKo.java @@ -0,0 +1,107 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +@Entity +@Table(name = "VRS_FILE_SES_OBJECT_STORAGE_KO") +public class VrsFileSesObjectStorageKo implements Serializable { + + public VrsFileSesObjectStorageKo() { + super(); + } + + private Long idVrsFileSesObjectStorageKo; + private DecBackend decBackend; + private VrsFileSessioneKo fileSessioneKo; + private String nmTenant; + private String nmBucket; + private String nmKeyFile; + private BigDecimal idStrut; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "ID_VRS_FILE_SES_OBJECT_STORAGE_KO") + public Long getIdVrsFileSesObjectStorageKo() { + return idVrsFileSesObjectStorageKo; + } + + public void setIdVrsFileSesObjectStorageKo(Long idVrsFileSesObjectStorageKo) { + this.idVrsFileSesObjectStorageKo = idVrsFileSesObjectStorageKo; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DEC_BACKEND") + public DecBackend getDecBackend() { + return decBackend; + } + + public void setDecBackend(DecBackend decBackend) { + this.decBackend = decBackend; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FILE_SESSIONE_KO") + public VrsFileSessioneKo getFileSessioneKo() { + return fileSessioneKo; + } + + public void setFileSessioneKo(VrsFileSessioneKo fileSessioneKo) { + this.fileSessioneKo = fileSessioneKo; + } + + @Column(name = "NM_TENANT") + public String getNmTenant() { + return nmTenant; + } + + public void setNmTenant(String nmTenant) { + this.nmTenant = nmTenant; + } + + @Column(name = "NM_BUCKET") + public String getNmBucket() { + return nmBucket; + } + + public void setNmBucket(String nmBucket) { + this.nmBucket = nmBucket; + } + + @Column(name = "CD_KEY_FILE") + public String getNmKeyFile() { + return nmKeyFile; + } + + public void setNmKeyFile(String nmKeyFile) { + this.nmKeyFile = nmKeyFile; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsFileSessioneKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsFileSessioneKo.java new file mode 100644 index 0000000..c38b4f8 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsFileSessioneKo.java @@ -0,0 +1,119 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import javax.persistence.*; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * The persistent class for the VRS_FILE_SESSIONE_KO database table. + */ +@Entity +@Table(name = "VRS_FILE_SESSIONE_KO") +public class VrsFileSessioneKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idFileSessioneKo; + + private BigDecimal idStrut; + + private String nmFileSessione; + + private BigDecimal pgFileSessione; + + private String tiStatoFileSessione; + + private VrsDatiSessioneVersKo vrsDatiSessioneVersKo; + + private List fileSesObjectStorageKos = new ArrayList<>(); + + public VrsFileSessioneKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_FILE_SESSIONE_KO") + @GeneratedValue(strategy = GenerationType.IDENTITY) + public Long getIdFileSessioneKo() { + return this.idFileSessioneKo; + } + + public void setIdFileSessioneKo(Long idFileSessioneKo) { + this.idFileSessioneKo = idFileSessioneKo; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "NM_FILE_SESSIONE") + public String getNmFileSessione() { + return this.nmFileSessione; + } + + public void setNmFileSessione(String nmFileSessione) { + this.nmFileSessione = nmFileSessione; + } + + @Column(name = "PG_FILE_SESSIONE") + public BigDecimal getPgFileSessione() { + return this.pgFileSessione; + } + + public void setPgFileSessione(BigDecimal pgFileSessione) { + this.pgFileSessione = pgFileSessione; + } + + @Column(name = "TI_STATO_FILE_SESSIONE") + public String getTiStatoFileSessione() { + return this.tiStatoFileSessione; + } + + public void setTiStatoFileSessione(String tiStatoFileSessione) { + this.tiStatoFileSessione = tiStatoFileSessione; + } + + // bi-directional many-to-one association to VrsDatiSessioneVersKo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DATI_SESSIONE_VERS_KO") + public VrsDatiSessioneVersKo getVrsDatiSessioneVersKo() { + return this.vrsDatiSessioneVersKo; + } + + public void setVrsDatiSessioneVersKo(VrsDatiSessioneVersKo vrsDatiSessioneVersKo) { + this.vrsDatiSessioneVersKo = vrsDatiSessioneVersKo; + } + + @OneToMany(mappedBy = "fileSessioneKo") + public List getFileSesObjectStorageKos() { + return fileSesObjectStorageKos; + } + + public void setFileSesObjectStorageKos(List fileSesObjectStorageKos) { + this.fileSesObjectStorageKos = fileSesObjectStorageKos; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsPathDtVers.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsPathDtVers.java new file mode 100644 index 0000000..f76b4a8 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsPathDtVers.java @@ -0,0 +1,206 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_PATH_DT_VERS database table. + */ +@Entity +@Table(name = "VRS_PATH_DT_VERS") +public class VrsPathDtVers implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idPathDtVers; + + private String dlPath; + + private Date dtLastArkPath; + + private Date dtLastArkPathSecondario; + + private String flCancFileMigraz; + + private String flPathArk; + + private String flPathArkSecondario; + + private String flPathFileNoArk; + + private String flPathFileNoArkSecondario; + + private BigDecimal niFilePath; + + private BigDecimal niFilePathArk; + + private BigDecimal niFilePathArkSecondario; + + private VrsDtVers vrsDtVers; + + public VrsPathDtVers() {/* Hibernate */ + } + + @Id + @Column(name = "ID_PATH_DT_VERS") + @GenericGenerator(name = "SVRS_PATH_DT_VERS_ID_PATH_DT_VERS_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_PATH_DT_VERS"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_PATH_DT_VERS_ID_PATH_DT_VERS_GENERATOR") + public Long getIdPathDtVers() { + return this.idPathDtVers; + } + + public void setIdPathDtVers(Long idPathDtVers) { + this.idPathDtVers = idPathDtVers; + } + + @Column(name = "DL_PATH") + public String getDlPath() { + return this.dlPath; + } + + public void setDlPath(String dlPath) { + this.dlPath = dlPath; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_LAST_ARK_PATH") + public Date getDtLastArkPath() { + return this.dtLastArkPath; + } + + public void setDtLastArkPath(Date dtLastArkPath) { + this.dtLastArkPath = dtLastArkPath; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_LAST_ARK_PATH_SECONDARIO") + public Date getDtLastArkPathSecondario() { + return this.dtLastArkPathSecondario; + } + + public void setDtLastArkPathSecondario(Date dtLastArkPathSecondario) { + this.dtLastArkPathSecondario = dtLastArkPathSecondario; + } + + @Column(name = "FL_CANC_FILE_MIGRAZ", columnDefinition = "char(1)") + public String getFlCancFileMigraz() { + return this.flCancFileMigraz; + } + + public void setFlCancFileMigraz(String flCancFileMigraz) { + this.flCancFileMigraz = flCancFileMigraz; + } + + @Column(name = "FL_PATH_ARK", columnDefinition = "char(1)") + public String getFlPathArk() { + return this.flPathArk; + } + + public void setFlPathArk(String flPathArk) { + this.flPathArk = flPathArk; + } + + @Column(name = "FL_PATH_ARK_SECONDARIO", columnDefinition = "char(1)") + public String getFlPathArkSecondario() { + return this.flPathArkSecondario; + } + + public void setFlPathArkSecondario(String flPathArkSecondario) { + this.flPathArkSecondario = flPathArkSecondario; + } + + @Column(name = "FL_PATH_FILE_NO_ARK", columnDefinition = "char(1)") + public String getFlPathFileNoArk() { + return this.flPathFileNoArk; + } + + public void setFlPathFileNoArk(String flPathFileNoArk) { + this.flPathFileNoArk = flPathFileNoArk; + } + + @Column(name = "FL_PATH_FILE_NO_ARK_SECONDARIO", columnDefinition = "char(1)") + public String getFlPathFileNoArkSecondario() { + return this.flPathFileNoArkSecondario; + } + + public void setFlPathFileNoArkSecondario(String flPathFileNoArkSecondario) { + this.flPathFileNoArkSecondario = flPathFileNoArkSecondario; + } + + @Column(name = "NI_FILE_PATH") + public BigDecimal getNiFilePath() { + return this.niFilePath; + } + + public void setNiFilePath(BigDecimal niFilePath) { + this.niFilePath = niFilePath; + } + + @Column(name = "NI_FILE_PATH_ARK") + public BigDecimal getNiFilePathArk() { + return this.niFilePathArk; + } + + public void setNiFilePathArk(BigDecimal niFilePathArk) { + this.niFilePathArk = niFilePathArk; + } + + @Column(name = "NI_FILE_PATH_ARK_SECONDARIO") + public BigDecimal getNiFilePathArkSecondario() { + return this.niFilePathArkSecondario; + } + + public void setNiFilePathArkSecondario(BigDecimal niFilePathArkSecondario) { + this.niFilePathArkSecondario = niFilePathArkSecondario; + } + + // bi-directional many-to-one association to VrsDtVer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DT_VERS") + public VrsDtVers getVrsDtVers() { + return this.vrsDtVers; + } + + public void setVrsDtVers(VrsDtVers vrsDtVers) { + this.vrsDtVers = vrsDtVers; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesFascicoloErr.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesFascicoloErr.java new file mode 100644 index 0000000..7693bda --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesFascicoloErr.java @@ -0,0 +1,278 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_SES_FASCICOLO_ERR database table. + */ +@Entity +@Table(name = "VRS_SES_FASCICOLO_ERR") +public class VrsSesFascicoloErr implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idSesFascicoloErr; + + private BigDecimal aaFascicolo; + + private String cdKeyFascicolo; + + private String dsErr; + + private String nmAmbiente; + + private String nmEnte; + + private String nmStrut; + + private String nmTipoFascicolo; + + private String nmUseridWs; + + private String tiStatoSes; + + private Date tsFineSes; + + private Date tsIniSes; + + private String cdVersioneWs; + + private String cdIndIpClient; + + private String cdIndServer; + + private DecErrSacer decErrSacer; + + private DecTipoFascicolo decTipoFascicolo; + + private OrgStrut orgStrut; + + private List vrsXmlSesFascicoloErrs = new ArrayList<>(); + + public VrsSesFascicoloErr() {/* Hibernate */ + } + + @Id + @Column(name = "ID_SES_FASCICOLO_ERR") + @GenericGenerator(name = "SVRS_SES_FASCICOLO_ERR_ID_SES_FASCICOLO_ERR_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_SES_FASCICOLO_ERR"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_SES_FASCICOLO_ERR_ID_SES_FASCICOLO_ERR_GENERATOR") + public Long getIdSesFascicoloErr() { + return this.idSesFascicoloErr; + } + + public void setIdSesFascicoloErr(Long idSesFascicoloErr) { + this.idSesFascicoloErr = idSesFascicoloErr; + } + + @Column(name = "AA_FASCICOLO") + public BigDecimal getAaFascicolo() { + return this.aaFascicolo; + } + + public void setAaFascicolo(BigDecimal aaFascicolo) { + this.aaFascicolo = aaFascicolo; + } + + @Column(name = "CD_KEY_FASCICOLO") + public String getCdKeyFascicolo() { + return this.cdKeyFascicolo; + } + + public void setCdKeyFascicolo(String cdKeyFascicolo) { + this.cdKeyFascicolo = cdKeyFascicolo; + } + + @Column(name = "DS_ERR") + public String getDsErr() { + return this.dsErr; + } + + public void setDsErr(String dsErr) { + this.dsErr = dsErr; + } + + @Column(name = "NM_AMBIENTE") + public String getNmAmbiente() { + return this.nmAmbiente; + } + + public void setNmAmbiente(String nmAmbiente) { + this.nmAmbiente = nmAmbiente; + } + + @Column(name = "NM_ENTE") + public String getNmEnte() { + return this.nmEnte; + } + + public void setNmEnte(String nmEnte) { + this.nmEnte = nmEnte; + } + + @Column(name = "NM_STRUT") + public String getNmStrut() { + return this.nmStrut; + } + + public void setNmStrut(String nmStrut) { + this.nmStrut = nmStrut; + } + + @Column(name = "NM_TIPO_FASCICOLO") + public String getNmTipoFascicolo() { + return this.nmTipoFascicolo; + } + + public void setNmTipoFascicolo(String nmTipoFascicolo) { + this.nmTipoFascicolo = nmTipoFascicolo; + } + + @Column(name = "NM_USERID_WS") + public String getNmUseridWs() { + return this.nmUseridWs; + } + + public void setNmUseridWs(String nmUseridWs) { + this.nmUseridWs = nmUseridWs; + } + + @Column(name = "TI_STATO_SES") + public String getTiStatoSes() { + return this.tiStatoSes; + } + + public void setTiStatoSes(String tiStatoSes) { + this.tiStatoSes = tiStatoSes; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_FINE_SES") + public Date getTsFineSes() { + return this.tsFineSes; + } + + public void setTsFineSes(Date tsFineSes) { + this.tsFineSes = tsFineSes; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_INI_SES") + public Date getTsIniSes() { + return this.tsIniSes; + } + + public void setTsIniSes(Date tsIniSes) { + this.tsIniSes = tsIniSes; + } + + @Column(name = "CD_VERSIONE_WS") + public String getCdVersioneWs() { + return cdVersioneWs; + } + + public void setCdVersioneWs(String cdVersioneWs) { + this.cdVersioneWs = cdVersioneWs; + } + + @Column(name = "CD_IND_IP_CLIENT") + public String getCdIndIpClient() { + return cdIndIpClient; + } + + public void setCdIndIpClient(String cdIndIpClient) { + this.cdIndIpClient = cdIndIpClient; + } + + @Column(name = "CD_IND_SERVER") + public String getCdIndServer() { + return cdIndServer; + } + + public void setCdIndServer(String cdIndServer) { + this.cdIndServer = cdIndServer; + } + + // bi-directional many-to-one association to DecErrSacer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ERR_SACER") + public DecErrSacer getDecErrSacer() { + return this.decErrSacer; + } + + public void setDecErrSacer(DecErrSacer decErrSacer) { + this.decErrSacer = decErrSacer; + } + + // bi-directional many-to-one association to DecTipoFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_FASCICOLO") + public DecTipoFascicolo getDecTipoFascicolo() { + return this.decTipoFascicolo; + } + + public void setDecTipoFascicolo(DecTipoFascicolo decTipoFascicolo) { + this.decTipoFascicolo = decTipoFascicolo; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to VrsXmlSesFascicoloErr + @OneToMany(mappedBy = "vrsSesFascicoloErr") + public List getVrsXmlSesFascicoloErrs() { + return this.vrsXmlSesFascicoloErrs; + } + + public void setVrsXmlSesFascicoloErrs(List vrsXmlSesFascicoloErrs) { + this.vrsXmlSesFascicoloErrs = vrsXmlSesFascicoloErrs; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesFascicoloKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesFascicoloKo.java new file mode 100644 index 0000000..c5baf01 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesFascicoloKo.java @@ -0,0 +1,262 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_SES_FASCICOLO_KO database table. + */ +@Entity +@Table(name = "VRS_SES_FASCICOLO_KO") +public class VrsSesFascicoloKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idSesFascicoloKo; + + private BigDecimal aaFascicolo; + + private String cdVersioneWs; + + private String dsErrPrinc; + + private String tiStatoSes; + + private Date tsFineSes; + + private Date tsIniSes; + + private String cdIndIpClient; + + private String cdIndServer; + + private List vrsErrSesFascicoloKos = new ArrayList<>(); + + private DecErrSacer decErrSacer; + + private DecTipoFascicolo decTipoFascicolo; + + private FasFascicolo fasFascicolo; + + private IamUser iamUser; + + private VrsFascicoloKo vrsFascicoloKo; + + private OrgStrut orgStrut; + + private List vrsXmlSesFascicoloKos = new ArrayList<>(); + + public VrsSesFascicoloKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_SES_FASCICOLO_KO") + @GenericGenerator(name = "SVRS_SES_FASCICOLO_KO_ID_SES_FASCICOLO_KO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_SES_FASCICOLO_KO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_SES_FASCICOLO_KO_ID_SES_FASCICOLO_KO_GENERATOR") + public Long getIdSesFascicoloKo() { + return this.idSesFascicoloKo; + } + + public void setIdSesFascicoloKo(Long idSesFascicoloKo) { + this.idSesFascicoloKo = idSesFascicoloKo; + } + + @Column(name = "AA_FASCICOLO") + public BigDecimal getAaFascicolo() { + return this.aaFascicolo; + } + + public void setAaFascicolo(BigDecimal aaFascicolo) { + this.aaFascicolo = aaFascicolo; + } + + @Column(name = "CD_VERSIONE_WS") + public String getCdVersioneWs() { + return this.cdVersioneWs; + } + + public void setCdVersioneWs(String cdVersioneWs) { + this.cdVersioneWs = cdVersioneWs; + } + + @Column(name = "DS_ERR_PRINC") + public String getDsErrPrinc() { + return this.dsErrPrinc; + } + + public void setDsErrPrinc(String dsErrPrinc) { + this.dsErrPrinc = dsErrPrinc; + } + + @Column(name = "TI_STATO_SES") + public String getTiStatoSes() { + return this.tiStatoSes; + } + + public void setTiStatoSes(String tiStatoSes) { + this.tiStatoSes = tiStatoSes; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_FINE_SES") + public Date getTsFineSes() { + return this.tsFineSes; + } + + public void setTsFineSes(Date tsFineSes) { + this.tsFineSes = tsFineSes; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_INI_SES") + public Date getTsIniSes() { + return this.tsIniSes; + } + + public void setTsIniSes(Date tsIniSes) { + this.tsIniSes = tsIniSes; + } + + @Column(name = "CD_IND_IP_CLIENT") + public String getCdIndIpClient() { + return cdIndIpClient; + } + + public void setCdIndIpClient(String cdIndIpClient) { + this.cdIndIpClient = cdIndIpClient; + } + + @Column(name = "CD_IND_SERVER") + public String getCdIndServer() { + return cdIndServer; + } + + public void setCdIndServer(String cdIndServer) { + this.cdIndServer = cdIndServer; + } + + // bi-directional many-to-one association to VrsErrSesFascicoloKo + @OneToMany(mappedBy = "vrsSesFascicoloKo") + public List getVrsErrSesFascicoloKos() { + return this.vrsErrSesFascicoloKos; + } + + public void setVrsErrSesFascicoloKos(List vrsErrSesFascicoloKos) { + this.vrsErrSesFascicoloKos = vrsErrSesFascicoloKos; + } + + // bi-directional many-to-one association to DecErrSacer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ERR_SACER_PRINC") + public DecErrSacer getDecErrSacer() { + return this.decErrSacer; + } + + public void setDecErrSacer(DecErrSacer decErrSacer) { + this.decErrSacer = decErrSacer; + } + + // bi-directional many-to-one association to DecTipoFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_FASCICOLO") + public DecTipoFascicolo getDecTipoFascicolo() { + return this.decTipoFascicolo; + } + + public void setDecTipoFascicolo(DecTipoFascicolo decTipoFascicolo) { + this.decTipoFascicolo = decTipoFascicolo; + } + + // bi-directional many-to-one association to FasFascicolo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO") + public FasFascicolo getFasFascicolo() { + return this.fasFascicolo; + } + + public void setFasFascicolo(FasFascicolo fasFascicolo) { + this.fasFascicolo = fasFascicolo; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USER_IAM") + public IamUser getIamUser() { + return this.iamUser; + } + + public void setIamUser(IamUser iamUser) { + this.iamUser = iamUser; + } + + // bi-directional many-to-one association to VrsFascicoloKo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_FASCICOLO_KO") + public VrsFascicoloKo getVrsFascicoloKo() { + return this.vrsFascicoloKo; + } + + public void setVrsFascicoloKo(VrsFascicoloKo vrsFascicoloKo) { + this.vrsFascicoloKo = vrsFascicoloKo; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to VrsXmlSesFascicoloKo + @OneToMany(mappedBy = "vrsSesFascicoloKo") + public List getVrsXmlSesFascicoloKos() { + return this.vrsXmlSesFascicoloKos; + } + + public void setVrsXmlSesFascicoloKos(List vrsXmlSesFascicoloKos) { + this.vrsXmlSesFascicoloKos = vrsXmlSesFascicoloKos; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesUpdUnitaDocErr.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesUpdUnitaDocErr.java new file mode 100644 index 0000000..184f640 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesUpdUnitaDocErr.java @@ -0,0 +1,334 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.VrsSesUpdUnitaDocErr.TiStatoSesVrsSesUpdUnitaDocErr; + +/** + * The persistent class for the VRS_SES_UPD_UNITA_DOC_ERR database table. + */ +@Entity +@Table(name = "VRS_SES_UPD_UNITA_DOC_ERR") +public class VrsSesUpdUnitaDocErr implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idSesUpdUnitaDocErr; + + private BigDecimal aaKeyUnitaDoc; + + private String cdKeyUnitaDoc; + + private String cdRegistroKeyUnitaDoc; + + private String cdVersioneWs; + + private String dsErrPrinc; + + private DecControlloWs decControlloWsPrinc; + + private DecErrSacer decErrSacerPrinc; + + private DecRegistroUnitaDoc decRegistroUnitaDoc; + + private OrgStrut orgStrut; + + private DecTipoDoc decTipoDocPrinc; + + private DecTipoUnitaDoc decTipoUnitaDoc; + + private String nmAmbiente; + + private String nmEnte; + + private String nmStrut; + + private String nmTipoDocPrinc; + + private String nmTipoUnitaDoc; + + private String nmUseridWs; + + private TiStatoSesVrsSesUpdUnitaDocErr tiStatoSes; + + private Date tsFineSes; + + private Date tsIniSes; + + private List vrsErrSesUpdUnitaDocErrs = new ArrayList<>(); + + private List vrsXmlSesUpdUnitaDocErrs = new ArrayList<>(); + + public VrsSesUpdUnitaDocErr() {/* Hibernate */ + } + + @Id + @Column(name = "ID_SES_UPD_UNITA_DOC_ERR") + @GenericGenerator(name = "SVRS_SES_UPD_UNITA_DOC_ERR_ID_SES_UPD_UNITA_DOC_ERR_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_SES_UPD_UNITA_DOC_ERR"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_SES_UPD_UNITA_DOC_ERR_ID_SES_UPD_UNITA_DOC_ERR_GENERATOR") + public Long getIdSesUpdUnitaDocErr() { + return this.idSesUpdUnitaDocErr; + } + + public void setIdSesUpdUnitaDocErr(Long idSesUpdUnitaDocErr) { + this.idSesUpdUnitaDocErr = idSesUpdUnitaDocErr; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return this.aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + @Column(name = "CD_KEY_UNITA_DOC") + public String getCdKeyUnitaDoc() { + return this.cdKeyUnitaDoc; + } + + public void setCdKeyUnitaDoc(String cdKeyUnitaDoc) { + this.cdKeyUnitaDoc = cdKeyUnitaDoc; + } + + @Column(name = "CD_REGISTRO_KEY_UNITA_DOC") + public String getCdRegistroKeyUnitaDoc() { + return this.cdRegistroKeyUnitaDoc; + } + + public void setCdRegistroKeyUnitaDoc(String cdRegistroKeyUnitaDoc) { + this.cdRegistroKeyUnitaDoc = cdRegistroKeyUnitaDoc; + } + + @Column(name = "CD_VERSIONE_WS") + public String getCdVersioneWs() { + return this.cdVersioneWs; + } + + public void setCdVersioneWs(String cdVersioneWs) { + this.cdVersioneWs = cdVersioneWs; + } + + @Column(name = "DS_ERR_PRINC") + public String getDsErrPrinc() { + return this.dsErrPrinc; + } + + public void setDsErrPrinc(String dsErrPrinc) { + this.dsErrPrinc = dsErrPrinc; + } + + // bi-directional many-to-one association to DecErrSacer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CONTROLLO_WS_PRINC") + public DecControlloWs getDecControlloWsPrinc() { + return this.decControlloWsPrinc; + } + + public void setDecControlloWsPrinc(DecControlloWs decControlloWsPrinc) { + this.decControlloWsPrinc = decControlloWsPrinc; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ERR_SACER_PRINC") + public DecErrSacer getDecErrSacerPrinc() { + return this.decErrSacerPrinc; + } + + public void setDecErrSacerPrinc(DecErrSacer decErrSacerPrinc) { + this.decErrSacerPrinc = decErrSacerPrinc; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_REGISTRO_UNITA_DOC") + public DecRegistroUnitaDoc getDecRegistroUnitaDoc() { + return this.decRegistroUnitaDoc; + } + + public void setDecRegistroUnitaDoc(DecRegistroUnitaDoc decRegistroUnitaDoc) { + this.decRegistroUnitaDoc = decRegistroUnitaDoc; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_DOC_PRINC") + public DecTipoDoc getDecTipoDocPrinc() { + return this.decTipoDocPrinc; + } + + public void setDecTipoDocPrinc(DecTipoDoc decTipoDocPrinc) { + this.decTipoDocPrinc = decTipoDocPrinc; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_UNITA_DOC") + public DecTipoUnitaDoc getDecTipoUnitaDoc() { + return this.decTipoUnitaDoc; + } + + public void setDecTipoUnitaDoc(DecTipoUnitaDoc decTipoUnitaDoc) { + this.decTipoUnitaDoc = decTipoUnitaDoc; + } + + @Column(name = "NM_AMBIENTE") + public String getNmAmbiente() { + return this.nmAmbiente; + } + + public void setNmAmbiente(String nmAmbiente) { + this.nmAmbiente = nmAmbiente; + } + + @Column(name = "NM_ENTE") + public String getNmEnte() { + return this.nmEnte; + } + + public void setNmEnte(String nmEnte) { + this.nmEnte = nmEnte; + } + + @Column(name = "NM_STRUT") + public String getNmStrut() { + return this.nmStrut; + } + + public void setNmStrut(String nmStrut) { + this.nmStrut = nmStrut; + } + + @Column(name = "NM_TIPO_DOC_PRINC") + public String getNmTipoDocPrinc() { + return this.nmTipoDocPrinc; + } + + public void setNmTipoDocPrinc(String nmTipoDocPrinc) { + this.nmTipoDocPrinc = nmTipoDocPrinc; + } + + @Column(name = "NM_TIPO_UNITA_DOC") + public String getNmTipoUnitaDoc() { + return this.nmTipoUnitaDoc; + } + + public void setNmTipoUnitaDoc(String nmTipoUnitaDoc) { + this.nmTipoUnitaDoc = nmTipoUnitaDoc; + } + + @Column(name = "NM_USERID_WS") + public String getNmUseridWs() { + return this.nmUseridWs; + } + + public void setNmUseridWs(String nmUseridWs) { + this.nmUseridWs = nmUseridWs; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_STATO_SES") + public TiStatoSesVrsSesUpdUnitaDocErr getTiStatoSes() { + return this.tiStatoSes; + } + + public void setTiStatoSes(TiStatoSesVrsSesUpdUnitaDocErr tiStatoSes) { + this.tiStatoSes = tiStatoSes; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_FINE_SES") + public Date getTsFineSes() { + return this.tsFineSes; + } + + public void setTsFineSes(Date tsFineSes) { + this.tsFineSes = tsFineSes; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_INI_SES") + public Date getTsIniSes() { + return this.tsIniSes; + } + + public void setTsIniSes(Date tsIniSes) { + this.tsIniSes = tsIniSes; + } + + // bi-directional many-to-one association to VrsSesFascicoloKo + @OneToMany(mappedBy = "vrsSesUpdUnitaDocErr") + public List getVrsErrSesUpdUnitaDocErrs() { + return this.vrsErrSesUpdUnitaDocErrs; + } + + public void setVrsErrSesUpdUnitaDocErrs(List vrsErrSesUpdUnitaDocErrs) { + this.vrsErrSesUpdUnitaDocErrs = vrsErrSesUpdUnitaDocErrs; + } + + // bi-directional many-to-one association to VrsSesFascicoloKo + @OneToMany(mappedBy = "vrsSesUpdUnitaDocErr") + public List getVrsXmlSesUpdUnitaDocErrs() { + return this.vrsXmlSesUpdUnitaDocErrs; + } + + public void setVrsXmlSesUpdUnitaDocErrs(List vrsXmlSesUpdUnitaDocErrs) { + this.vrsXmlSesUpdUnitaDocErrs = vrsXmlSesUpdUnitaDocErrs; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesUpdUnitaDocKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesUpdUnitaDocKo.java new file mode 100644 index 0000000..d7ebfb7 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSesUpdUnitaDocKo.java @@ -0,0 +1,284 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.VrsSesUpdUnitaDocKo.TiStatoSesUpdKo; + +/** + * The persistent class for the VRS_SES_UPD_UNITA_DOC_KO database table. + */ +@Entity +@Table(name = "VRS_SES_UPD_UNITA_DOC_KO") +public class VrsSesUpdUnitaDocKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idSesUpdUnitaDocKo; + + private BigDecimal aaKeyUnitaDoc; + + private String cdVersioneWs; + + private String dsErrPrinc; + + private DecControlloWs decControlloWsPrinc; + + private DecErrSacer decErrSacerPrinc; + + private DecRegistroUnitaDoc decRegistroUnitaDoc; + + private OrgStrut orgStrut; + + private DecTipoDoc decTipoDocPrinc; + + private DecTipoUnitaDoc decTipoUnitaDoc; + + private VrsUpdUnitaDocKo vrsUpdUnitaDocKo; + + private AroUpdUnitaDoc aroUpdUnitaDoc; + + private IamUser iamUser; + + private TiStatoSesUpdKo tiStatoSesUpdKo; + + private Date tsFineSes; + + private Date tsIniSes; + + private List vrsErrSesUpdUnitaDocKos = new ArrayList<>(); + + private List vrsXmlSesUpdUnitaDocKos = new ArrayList<>(); + + public VrsSesUpdUnitaDocKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_SES_UPD_UNITA_DOC_KO") + @GenericGenerator(name = "SVRS_SES_UPD_UNITA_DOC_KO_ID_SES_UPD_UNITA_DOC_KO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_SES_UPD_UNITA_DOC_KO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_SES_UPD_UNITA_DOC_KO_ID_SES_UPD_UNITA_DOC_KO_GENERATOR") + public Long getIdSesUpdUnitaDocKo() { + return this.idSesUpdUnitaDocKo; + } + + public void setIdSesUpdUnitaDocKo(Long idSesUpdUnitaDocKo) { + this.idSesUpdUnitaDocKo = idSesUpdUnitaDocKo; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return this.aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + @Column(name = "CD_VERSIONE_WS") + public String getCdVersioneWs() { + return this.cdVersioneWs; + } + + public void setCdVersioneWs(String cdVersioneWs) { + this.cdVersioneWs = cdVersioneWs; + } + + @Column(name = "DS_ERR_PRINC") + public String getDsErrPrinc() { + return this.dsErrPrinc; + } + + public void setDsErrPrinc(String dsErrPrinc) { + this.dsErrPrinc = dsErrPrinc; + } + + // bi-directional many-to-one association to DecErrSacer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CONTROLLO_WS_PRINC") + public DecControlloWs getDecControlloWsPrinc() { + return this.decControlloWsPrinc; + } + + public void setDecControlloWsPrinc(DecControlloWs decControlloWsPrinc) { + this.decControlloWsPrinc = decControlloWsPrinc; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ERR_SACER_PRINC") + public DecErrSacer getDecErrSacerPrinc() { + return this.decErrSacerPrinc; + } + + public void setDecErrSacerPrinc(DecErrSacer decErrSacerPrinc) { + this.decErrSacerPrinc = decErrSacerPrinc; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_REGISTRO_UNITA_DOC") + public DecRegistroUnitaDoc getDecRegistroUnitaDoc() { + return this.decRegistroUnitaDoc; + } + + public void setDecRegistroUnitaDoc(DecRegistroUnitaDoc decRegistroUnitaDoc) { + this.decRegistroUnitaDoc = decRegistroUnitaDoc; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_DOC_PRINC") + public DecTipoDoc getDecTipoDocPrinc() { + return this.decTipoDocPrinc; + } + + public void setDecTipoDocPrinc(DecTipoDoc decTipoDocPrinc) { + this.decTipoDocPrinc = decTipoDocPrinc; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_UNITA_DOC") + public DecTipoUnitaDoc getDecTipoUnitaDoc() { + return this.decTipoUnitaDoc; + } + + public void setDecTipoUnitaDoc(DecTipoUnitaDoc decTipoUnitaDoc) { + this.decTipoUnitaDoc = decTipoUnitaDoc; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_UNITA_DOC_KO") + public VrsUpdUnitaDocKo getVrsUpdUnitaDocKo() { + return this.vrsUpdUnitaDocKo; + } + + public void setVrsUpdUnitaDocKo(VrsUpdUnitaDocKo vrsUpdUnitaDocKo) { + this.vrsUpdUnitaDocKo = vrsUpdUnitaDocKo; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UPD_UNITA_DOC") + public AroUpdUnitaDoc getAroUpdUnitaDoc() { + return this.aroUpdUnitaDoc; + } + + public void setAroUpdUnitaDoc(AroUpdUnitaDoc aroUpdUnitaDoc) { + this.aroUpdUnitaDoc = aroUpdUnitaDoc; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USER_IAM") + public IamUser getIamUser() { + return this.iamUser; + } + + public void setIamUser(IamUser iamUser) { + this.iamUser = iamUser; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_STATO_SES_UPD_KO") + public TiStatoSesUpdKo getTiStatoSesUpdKo() { + return this.tiStatoSesUpdKo; + } + + public void setTiStatoSesUpdKo(TiStatoSesUpdKo tiStatoSesUpdKo) { + this.tiStatoSesUpdKo = tiStatoSesUpdKo; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_FINE_SES") + public Date getTsFineSes() { + return this.tsFineSes; + } + + public void setTsFineSes(Date tsFineSes) { + this.tsFineSes = tsFineSes; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_INI_SES") + public Date getTsIniSes() { + return this.tsIniSes; + } + + public void setTsIniSes(Date tsIniSes) { + this.tsIniSes = tsIniSes; + } + + // bi-directional many-to-one association to VrsSesFascicoloKo + @OneToMany(mappedBy = "vrsSesUpdUnitaDocKo") + public List getVrsErrSesUpdUnitaDocKos() { + return this.vrsErrSesUpdUnitaDocKos; + } + + public void setVrsErrSesUpdUnitaDocKos(List vrsErrSesUpdUnitaDocKos) { + this.vrsErrSesUpdUnitaDocKos = vrsErrSesUpdUnitaDocKos; + } + + // bi-directional many-to-one association to VrsSesFascicoloKo + @OneToMany(mappedBy = "vrsSesUpdUnitaDocKo") + public List getVrsXmlSesUpdUnitaDocKos() { + return this.vrsXmlSesUpdUnitaDocKos; + } + + public void setVrsXmlSesUpdUnitaDocKos(List vrsXmlSesUpdUnitaDocKos) { + this.vrsXmlSesUpdUnitaDocKos = vrsXmlSesUpdUnitaDocKos; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSessioneVers.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSessioneVers.java new file mode 100644 index 0000000..df86add --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSessioneVers.java @@ -0,0 +1,403 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_SESSIONE_VERS database table. + */ +@Entity +@Table(name = "VRS_SESSIONE_VERS") +public class VrsSessioneVers implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idSessioneVers; + + private BigDecimal aaKeyUnitaDoc; + + private String cdErrPrinc; + + private String cdKeyDocVers; + + private String cdKeyUnitaDoc; + + private String cdRegistroKeyUnitaDoc; + + private String cdVersioneWs; + + private String dsErrPrinc; + + private Date dtApertura; + + private Date dtChiusura; + + private Date tsApertura; + + private Date tsChiusura; + + private String flSessioneErrNonRisolub; + + private String flSessioneErrVerif; + + private BigDecimal niFileErr; + + private String nmAmbiente; + + private String nmEnte; + + private String nmStrut; + + private String nmUserid; + + private String nmUseridWs; + + private String nmUtente; + + private String tiSessioneVers; + + private String tiStatoSessioneVers; + + private String cdIndIpClient; + + private String cdIndServer; + + private List vrsDatiSessioneVers = new ArrayList<>(); + + private AroDoc aroDoc; + + private AroUnitaDoc aroUnitaDoc; + + private OrgStrut orgStrut; + + private IamUser iamUser; + + public VrsSessioneVers() {/* Hibernate */ + } + + @Id + @Column(name = "ID_SESSIONE_VERS") + @GenericGenerator(name = "SVRS_SESSIONE_VERS_ID_SESSIONE_VERS_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_SESSIONE_VERS"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_SESSIONE_VERS_ID_SESSIONE_VERS_GENERATOR") + public Long getIdSessioneVers() { + return this.idSessioneVers; + } + + public void setIdSessioneVers(Long idSessioneVers) { + this.idSessioneVers = idSessioneVers; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return this.aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + @Column(name = "CD_ERR_PRINC") + public String getCdErrPrinc() { + return this.cdErrPrinc; + } + + public void setCdErrPrinc(String cdErrPrinc) { + this.cdErrPrinc = cdErrPrinc; + } + + @Column(name = "CD_KEY_DOC_VERS") + public String getCdKeyDocVers() { + return this.cdKeyDocVers; + } + + public void setCdKeyDocVers(String cdKeyDocVers) { + this.cdKeyDocVers = cdKeyDocVers; + } + + @Column(name = "CD_KEY_UNITA_DOC") + public String getCdKeyUnitaDoc() { + return this.cdKeyUnitaDoc; + } + + public void setCdKeyUnitaDoc(String cdKeyUnitaDoc) { + this.cdKeyUnitaDoc = cdKeyUnitaDoc; + } + + @Column(name = "CD_REGISTRO_KEY_UNITA_DOC") + public String getCdRegistroKeyUnitaDoc() { + return this.cdRegistroKeyUnitaDoc; + } + + public void setCdRegistroKeyUnitaDoc(String cdRegistroKeyUnitaDoc) { + this.cdRegistroKeyUnitaDoc = cdRegistroKeyUnitaDoc; + } + + @Column(name = "CD_VERSIONE_WS") + public String getCdVersioneWs() { + return this.cdVersioneWs; + } + + public void setCdVersioneWs(String cdVersioneWs) { + this.cdVersioneWs = cdVersioneWs; + } + + @Column(name = "DS_ERR_PRINC") + public String getDsErrPrinc() { + return this.dsErrPrinc; + } + + public void setDsErrPrinc(String dsErrPrinc) { + this.dsErrPrinc = dsErrPrinc; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_APERTURA") + public Date getDtApertura() { + return this.dtApertura; + } + + public void setDtApertura(Date dtApertura) { + this.dtApertura = dtApertura; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_CHIUSURA") + public Date getDtChiusura() { + return this.dtChiusura; + } + + public void setDtChiusura(Date dtChiusura) { + this.dtChiusura = dtChiusura; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_APERTURA") + public Date getTsApertura() { + return tsApertura; + } + + public void setTsApertura(Date tsApertura) { + this.tsApertura = tsApertura; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_CHIUSURA") + public Date getTsChiusura() { + return tsChiusura; + } + + public void setTsChiusura(Date tsChiusura) { + this.tsChiusura = tsChiusura; + } + + @Column(name = "FL_SESSIONE_ERR_NON_RISOLUB", columnDefinition = "char(1)") + public String getFlSessioneErrNonRisolub() { + return this.flSessioneErrNonRisolub; + } + + public void setFlSessioneErrNonRisolub(String flSessioneErrNonRisolub) { + this.flSessioneErrNonRisolub = flSessioneErrNonRisolub; + } + + @Column(name = "FL_SESSIONE_ERR_VERIF", columnDefinition = "char(1)") + public String getFlSessioneErrVerif() { + return this.flSessioneErrVerif; + } + + public void setFlSessioneErrVerif(String flSessioneErrVerif) { + this.flSessioneErrVerif = flSessioneErrVerif; + } + + @Column(name = "NI_FILE_ERR") + public BigDecimal getNiFileErr() { + return this.niFileErr; + } + + public void setNiFileErr(BigDecimal niFileErr) { + this.niFileErr = niFileErr; + } + + @Column(name = "NM_AMBIENTE") + public String getNmAmbiente() { + return this.nmAmbiente; + } + + public void setNmAmbiente(String nmAmbiente) { + this.nmAmbiente = nmAmbiente; + } + + @Column(name = "NM_ENTE") + public String getNmEnte() { + return this.nmEnte; + } + + public void setNmEnte(String nmEnte) { + this.nmEnte = nmEnte; + } + + @Column(name = "NM_STRUT") + public String getNmStrut() { + return this.nmStrut; + } + + public void setNmStrut(String nmStrut) { + this.nmStrut = nmStrut; + } + + @Column(name = "NM_USERID") + public String getNmUserid() { + return this.nmUserid; + } + + public void setNmUserid(String nmUserid) { + this.nmUserid = nmUserid; + } + + @Column(name = "NM_USERID_WS") + public String getNmUseridWs() { + return this.nmUseridWs; + } + + public void setNmUseridWs(String nmUseridWs) { + this.nmUseridWs = nmUseridWs; + } + + @Column(name = "TI_SESSIONE_VERS") + public String getTiSessioneVers() { + return this.tiSessioneVers; + } + + public void setTiSessioneVers(String tiSessioneVers) { + this.tiSessioneVers = tiSessioneVers; + } + + @Column(name = "TI_STATO_SESSIONE_VERS") + public String getTiStatoSessioneVers() { + return this.tiStatoSessioneVers; + } + + public void setTiStatoSessioneVers(String tiStatoSessioneVers) { + this.tiStatoSessioneVers = tiStatoSessioneVers; + } + + @Column(name = "CD_IND_IP_CLIENT") + public String getCdIndIpClient() { + return cdIndIpClient; + } + + public void setCdIndIpClient(String cdIndIpClient) { + this.cdIndIpClient = cdIndIpClient; + } + + @Column(name = "CD_IND_SERVER") + public String getCdIndServer() { + return cdIndServer; + } + + public void setCdIndServer(String cdIndServer) { + this.cdIndServer = cdIndServer; + } + + // bi-directional many-to-one association to VrsDatiSessioneVers + @OneToMany(mappedBy = "vrsSessioneVers") + public List getVrsDatiSessioneVers() { + return this.vrsDatiSessioneVers; + } + + public void setVrsDatiSessioneVers(List vrsDatiSessioneVers) { + this.vrsDatiSessioneVers = vrsDatiSessioneVers; + } + + // bi-directional many-to-one association to AroDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DOC") + public AroDoc getAroDoc() { + return this.aroDoc; + } + + public void setAroDoc(AroDoc aroDoc) { + this.aroDoc = aroDoc; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC") + public AroUnitaDoc getAroUnitaDoc() { + return this.aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USER") + public IamUser getIamUser() { + return this.iamUser; + } + + public void setIamUser(IamUser iamUser) { + this.iamUser = iamUser; + } + + @Column(name = "NM_UTENTE") + public String getNmUtente() { + return this.nmUtente; + } + + public void setNmUtente(String nmUtente) { + this.nmUtente = nmUtente; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSessioneVersKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSessioneVersKo.java new file mode 100644 index 0000000..da522a4 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsSessioneVersKo.java @@ -0,0 +1,384 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.util.ArrayList; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import javax.persistence.*; + +/** + * The persistent class for the VRS_SESSIONE_VERS_KO database table. + */ +@Entity +@Table(name = "VRS_SESSIONE_VERS_KO") +public class VrsSessioneVersKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idSessioneVersKo; + + private BigDecimal aaKeyUnitaDoc; + + private String cdErrPrinc; + + private String cdKeyDocVers; + + private String cdKeyUnitaDoc; + + private String cdRegistroKeyUnitaDoc; + + private String cdVersioneWs; + + private String dsErrPrinc; + + private Date dtApertura; + + private Date dtChiusura; + + private Date tsApertura; + + private Date tsChiusura; + + private String flSessioneErrNonRisolub; + + private String flSessioneErrVerif; + + private BigDecimal niFileErr; + + private String nmAmbiente; + + private String nmEnte; + + private String nmStrut; + + private String nmUserid; + + private String nmUseridWs; + + private String nmUtente; + + private String tiSessioneVers; + + private String tiStatoSessioneVers; + + private String cdIndIpClient; + + private String cdIndServer; + + private List vrsDatiSessioneVersKos = new ArrayList<>(); + + private AroDoc aroDoc; + + private AroUnitaDoc aroUnitaDoc; + + private OrgStrut orgStrut; + + private IamUser iamUser; + + public VrsSessioneVersKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_SESSIONE_VERS_KO") + @GeneratedValue(strategy = GenerationType.IDENTITY) + public Long getIdSessioneVersKo() { + return this.idSessioneVersKo; + } + + public void setIdSessioneVersKo(Long idSessioneVersKo) { + this.idSessioneVersKo = idSessioneVersKo; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return this.aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + @Column(name = "CD_ERR_PRINC") + public String getCdErrPrinc() { + return this.cdErrPrinc; + } + + public void setCdErrPrinc(String cdErrPrinc) { + this.cdErrPrinc = cdErrPrinc; + } + + @Column(name = "CD_KEY_DOC_VERS") + public String getCdKeyDocVers() { + return this.cdKeyDocVers; + } + + public void setCdKeyDocVers(String cdKeyDocVers) { + this.cdKeyDocVers = cdKeyDocVers; + } + + @Column(name = "CD_KEY_UNITA_DOC") + public String getCdKeyUnitaDoc() { + return this.cdKeyUnitaDoc; + } + + public void setCdKeyUnitaDoc(String cdKeyUnitaDoc) { + this.cdKeyUnitaDoc = cdKeyUnitaDoc; + } + + @Column(name = "CD_REGISTRO_KEY_UNITA_DOC") + public String getCdRegistroKeyUnitaDoc() { + return this.cdRegistroKeyUnitaDoc; + } + + public void setCdRegistroKeyUnitaDoc(String cdRegistroKeyUnitaDoc) { + this.cdRegistroKeyUnitaDoc = cdRegistroKeyUnitaDoc; + } + + @Column(name = "CD_VERSIONE_WS") + public String getCdVersioneWs() { + return this.cdVersioneWs; + } + + public void setCdVersioneWs(String cdVersioneWs) { + this.cdVersioneWs = cdVersioneWs; + } + + @Column(name = "DS_ERR_PRINC") + public String getDsErrPrinc() { + return this.dsErrPrinc; + } + + public void setDsErrPrinc(String dsErrPrinc) { + this.dsErrPrinc = dsErrPrinc; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_APERTURA") + public Date getDtApertura() { + return this.dtApertura; + } + + public void setDtApertura(Date dtApertura) { + this.dtApertura = dtApertura; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_CHIUSURA") + public Date getDtChiusura() { + return this.dtChiusura; + } + + public void setDtChiusura(Date dtChiusura) { + this.dtChiusura = dtChiusura; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_APERTURA") + public Date getTsApertura() { + return tsApertura; + } + + public void setTsApertura(Date tsApertura) { + this.tsApertura = tsApertura; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_CHIUSURA") + public Date getTsChiusura() { + return tsChiusura; + } + + public void setTsChiusura(Date tsChiusura) { + this.tsChiusura = tsChiusura; + } + + @Column(name = "FL_SESSIONE_ERR_NON_RISOLUB", columnDefinition = "char(1)") + public String getFlSessioneErrNonRisolub() { + return this.flSessioneErrNonRisolub; + } + + public void setFlSessioneErrNonRisolub(String flSessioneErrNonRisolub) { + this.flSessioneErrNonRisolub = flSessioneErrNonRisolub; + } + + @Column(name = "FL_SESSIONE_ERR_VERIF", columnDefinition = "char(1)") + public String getFlSessioneErrVerif() { + return this.flSessioneErrVerif; + } + + public void setFlSessioneErrVerif(String flSessioneErrVerif) { + this.flSessioneErrVerif = flSessioneErrVerif; + } + + @Column(name = "NI_FILE_ERR") + public BigDecimal getNiFileErr() { + return this.niFileErr; + } + + public void setNiFileErr(BigDecimal niFileErr) { + this.niFileErr = niFileErr; + } + + @Column(name = "NM_AMBIENTE") + public String getNmAmbiente() { + return this.nmAmbiente; + } + + public void setNmAmbiente(String nmAmbiente) { + this.nmAmbiente = nmAmbiente; + } + + @Column(name = "NM_ENTE") + public String getNmEnte() { + return this.nmEnte; + } + + public void setNmEnte(String nmEnte) { + this.nmEnte = nmEnte; + } + + @Column(name = "NM_STRUT") + public String getNmStrut() { + return this.nmStrut; + } + + public void setNmStrut(String nmStrut) { + this.nmStrut = nmStrut; + } + + @Column(name = "NM_USERID") + public String getNmUserid() { + return this.nmUserid; + } + + public void setNmUserid(String nmUserid) { + this.nmUserid = nmUserid; + } + + @Column(name = "NM_USERID_WS") + public String getNmUseridWs() { + return this.nmUseridWs; + } + + public void setNmUseridWs(String nmUseridWs) { + this.nmUseridWs = nmUseridWs; + } + + @Column(name = "TI_SESSIONE_VERS") + public String getTiSessioneVers() { + return this.tiSessioneVers; + } + + public void setTiSessioneVers(String tiSessioneVers) { + this.tiSessioneVers = tiSessioneVers; + } + + @Column(name = "TI_STATO_SESSIONE_VERS") + public String getTiStatoSessioneVers() { + return this.tiStatoSessioneVers; + } + + public void setTiStatoSessioneVers(String tiStatoSessioneVers) { + this.tiStatoSessioneVers = tiStatoSessioneVers; + } + + @Column(name = "CD_IND_IP_CLIENT") + public String getCdIndIpClient() { + return cdIndIpClient; + } + + public void setCdIndIpClient(String cdIndIpClient) { + this.cdIndIpClient = cdIndIpClient; + } + + @Column(name = "CD_IND_SERVER") + public String getCdIndServer() { + return cdIndServer; + } + + public void setCdIndServer(String cdIndServer) { + this.cdIndServer = cdIndServer; + } + + // bi-directional many-to-one association to VrsDatiSessioneVersKo + @OneToMany(mappedBy = "vrsSessioneVersKo") + public List getVrsDatiSessioneVersKos() { + return this.vrsDatiSessioneVersKos; + } + + public void setVrsDatiSessioneVersKos(List vrsDatiSessioneVersKos) { + this.vrsDatiSessioneVersKos = vrsDatiSessioneVersKos; + } + + // bi-directional many-to-one association to AroDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DOC") + public AroDoc getAroDoc() { + return this.aroDoc; + } + + public void setAroDoc(AroDoc aroDoc) { + this.aroDoc = aroDoc; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC") + public AroUnitaDoc getAroUnitaDoc() { + return this.aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to IamUser + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USER") + public IamUser getIamUser() { + return this.iamUser; + } + + public void setIamUser(IamUser iamUser) { + this.iamUser = iamUser; + } + + @Column(name = "NM_UTENTE") + public String getNmUtente() { + return this.nmUtente; + } + + public void setNmUtente(String nmUtente) { + this.nmUtente = nmUtente; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUnitaDocNonVer.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUnitaDocNonVer.java new file mode 100644 index 0000000..0a7a555 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUnitaDocNonVer.java @@ -0,0 +1,160 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_UNITA_DOC_NON_VERS database table. + */ +@Entity +@Table(name = "VRS_UNITA_DOC_NON_VERS") +public class VrsUnitaDocNonVer implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUnitaDocNonVers; + + private BigDecimal aaKeyUnitaDoc; + + private String cdErrPrinc; + + private String cdKeyUnitaDoc; + + private String cdRegistroKeyUnitaDoc; + + private String dsErrPrinc; + + private Date dtFirstSesErr; + + private Date dtLastSesErr; + + private OrgStrut orgStrut; + + public VrsUnitaDocNonVer() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UNITA_DOC_NON_VERS") + @GenericGenerator(name = "SVRS_UNITA_DOC_NON_VERS_ID_UNITA_DOC_NON_VERS_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_UNITA_DOC_NON_VERS"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_UNITA_DOC_NON_VERS_ID_UNITA_DOC_NON_VERS_GENERATOR") + public Long getIdUnitaDocNonVers() { + return this.idUnitaDocNonVers; + } + + public void setIdUnitaDocNonVers(Long idUnitaDocNonVers) { + this.idUnitaDocNonVers = idUnitaDocNonVers; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return this.aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + @Column(name = "CD_ERR_PRINC") + public String getCdErrPrinc() { + return this.cdErrPrinc; + } + + public void setCdErrPrinc(String cdErrPrinc) { + this.cdErrPrinc = cdErrPrinc; + } + + @Column(name = "CD_KEY_UNITA_DOC") + public String getCdKeyUnitaDoc() { + return this.cdKeyUnitaDoc; + } + + public void setCdKeyUnitaDoc(String cdKeyUnitaDoc) { + this.cdKeyUnitaDoc = cdKeyUnitaDoc; + } + + @Column(name = "CD_REGISTRO_KEY_UNITA_DOC") + public String getCdRegistroKeyUnitaDoc() { + return this.cdRegistroKeyUnitaDoc; + } + + public void setCdRegistroKeyUnitaDoc(String cdRegistroKeyUnitaDoc) { + this.cdRegistroKeyUnitaDoc = cdRegistroKeyUnitaDoc; + } + + @Column(name = "DS_ERR_PRINC") + public String getDsErrPrinc() { + return this.dsErrPrinc; + } + + public void setDsErrPrinc(String dsErrPrinc) { + this.dsErrPrinc = dsErrPrinc; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_FIRST_SES_ERR") + public Date getDtFirstSesErr() { + return this.dtFirstSesErr; + } + + public void setDtFirstSesErr(Date dtFirstSesErr) { + this.dtFirstSesErr = dtFirstSesErr; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_LAST_SES_ERR") + public Date getDtLastSesErr() { + return this.dtLastSesErr; + } + + public void setDtLastSesErr(Date dtLastSesErr) { + this.dtLastSesErr = dtLastSesErr; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUpdUnitaDocKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUpdUnitaDocKo.java new file mode 100644 index 0000000..81c01da --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUpdUnitaDocKo.java @@ -0,0 +1,268 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.VrsUpdUnitaDocKo.TiStatoUdpUdKo; + +/** + * The persistent class for the VRS_UPD_UNITA_DOC_KO database table. + */ +@Entity +@Table(name = "VRS_UPD_UNITA_DOC_KO") +public class VrsUpdUnitaDocKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUpdUnitaDocKo; + + private BigDecimal aaKeyUnitaDoc; + + private String cdKeyUnitaDoc; + + private String cdRegistroKeyUnitaDoc; + + private String dsErrPrinc; + + private DecControlloWs decControlloWsPrinc; + + private DecErrSacer decErrSacerPrinc; + + private DecRegistroUnitaDoc decRegistroUnitaDocLast; + + private VrsSesUpdUnitaDocKo vrsSesUpdUnitaDocKoFirst; + + private VrsSesUpdUnitaDocKo vrsSesUpdUnitaDocKoLast; + + private OrgStrut orgStrut; + + private DecTipoDoc decTipoDocPrincLast; + + private DecTipoUnitaDoc decTipoUnitaDocLast; + + private TiStatoUdpUdKo tiStatoUdpUdKo; + + private Date tsIniFirstSes; + + private Date tsIniLastSes; + + private List vrsSesUpdUnitaDocKos = new ArrayList<>(); + + public VrsUpdUnitaDocKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UPD_UNITA_DOC_KO") + @GenericGenerator(name = "SVRS_UPD_UNITA_DOC_KO_ID_UPD_UNITA_DOC_KO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_UPD_UNITA_DOC_KO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_UPD_UNITA_DOC_KO_ID_UPD_UNITA_DOC_KO_GENERATOR") + public Long getIdUpdUnitaDocKo() { + return this.idUpdUnitaDocKo; + } + + public void setIdUpdUnitaDocKo(Long idUpdUnitaDocKo) { + this.idUpdUnitaDocKo = idUpdUnitaDocKo; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return this.aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + @Column(name = "CD_KEY_UNITA_DOC") + public String getCdKeyUnitaDoc() { + return this.cdKeyUnitaDoc; + } + + public void setCdKeyUnitaDoc(String cdKeyUnitaDoc) { + this.cdKeyUnitaDoc = cdKeyUnitaDoc; + } + + @Column(name = "CD_REGISTRO_KEY_UNITA_DOC") + public String getCdRegistroKeyUnitaDoc() { + return this.cdRegistroKeyUnitaDoc; + } + + public void setCdRegistroKeyUnitaDoc(String cdRegistroKeyUnitaDoc) { + this.cdRegistroKeyUnitaDoc = cdRegistroKeyUnitaDoc; + } + + @Column(name = "DS_ERR_PRINC") + public String getDsErrPrinc() { + return this.dsErrPrinc; + } + + public void setDsErrPrinc(String dsErrPrinc) { + this.dsErrPrinc = dsErrPrinc; + } + + // bi-directional many-to-one association to DecErrSacer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_CONTROLLO_WS_PRINC") + public DecControlloWs getDecControlloWsPrinc() { + return this.decControlloWsPrinc; + } + + public void setDecControlloWsPrinc(DecControlloWs decControlloWsPrinc) { + this.decControlloWsPrinc = decControlloWsPrinc; + } + + // bi-directional many-to-one association to DecErrSacer + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_ERR_SACER_PRINC") + public DecErrSacer getDecErrSacerPrinc() { + return this.decErrSacerPrinc; + } + + public void setDecErrSacerPrinc(DecErrSacer decErrSacerPrinc) { + this.decErrSacerPrinc = decErrSacerPrinc; + } + + // bi-directional many-to-one association to DecRegistroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_REGISTRO_UNITA_DOC_LAST") + public DecRegistroUnitaDoc getDecRegistroUnitaDocLast() { + return this.decRegistroUnitaDocLast; + } + + public void setDecRegistroUnitaDocLast(DecRegistroUnitaDoc decRegistroUnitaDocLast) { + this.decRegistroUnitaDocLast = decRegistroUnitaDocLast; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SES_UPD_UD_KO_FIRST") + public VrsSesUpdUnitaDocKo getVrsSesUpdUnitaDocKoFirst() { + return this.vrsSesUpdUnitaDocKoFirst; + } + + public void setVrsSesUpdUnitaDocKoFirst(VrsSesUpdUnitaDocKo vrsSesUpdUnitaDocKoFirst) { + this.vrsSesUpdUnitaDocKoFirst = vrsSesUpdUnitaDocKoFirst; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SES_UPD_UD_KO_LAST") + public VrsSesUpdUnitaDocKo getVrsSesUpdUnitaDocKoLast() { + return this.vrsSesUpdUnitaDocKoLast; + } + + public void setVrsSesUpdUnitaDocKoLast(VrsSesUpdUnitaDocKo vrsSesUpdUnitaDocKoLast) { + this.vrsSesUpdUnitaDocKoLast = vrsSesUpdUnitaDocKoLast; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + // bi-directional many-to-one association to DecTipoDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_DOC_PRINC_LAST") + public DecTipoDoc getDecTipoDocPrincLast() { + return this.decTipoDocPrincLast; + } + + public void setDecTipoDocPrincLast(DecTipoDoc decTipoDocPrincLast) { + this.decTipoDocPrincLast = decTipoDocPrincLast; + } + + // bi-directional many-to-one association to DecTipoUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_TIPO_UNITA_DOC_LAST") + public DecTipoUnitaDoc getDecTipoUnitaDocLast() { + return this.decTipoUnitaDocLast; + } + + public void setDecTipoUnitaDocLast(DecTipoUnitaDoc decTipoUnitaDocLast) { + this.decTipoUnitaDocLast = decTipoUnitaDocLast; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_STATO_UDP_UD_KO") + public TiStatoUdpUdKo getTiStatoUdpUdKo() { + return this.tiStatoUdpUdKo; + } + + public void setTiStatoUdpUdKo(TiStatoUdpUdKo tiStatoUdpUdKo) { + this.tiStatoUdpUdKo = tiStatoUdpUdKo; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_INI_FIRST_SES") + public Date getTsIniFirstSes() { + return this.tsIniFirstSes; + } + + public void setTsIniFirstSes(Date tsIniFirstSes) { + this.tsIniFirstSes = tsIniFirstSes; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_INI_LAST_SES") + public Date getTsIniLastSes() { + return this.tsIniLastSes; + } + + public void setTsIniLastSes(Date tsIniLastSes) { + this.tsIniLastSes = tsIniLastSes; + } + + // bi-directional many-to-one association to VrsSesFascicoloKo + @OneToMany(mappedBy = "vrsUpdUnitaDocKo") + public List getVrsSesUpdUnitaDocKos() { + return this.vrsSesUpdUnitaDocKos; + } + + public void setVrsSesUpdUnitaDocKos(List vrsSesUpdUnitaDocKos) { + this.vrsSesUpdUnitaDocKos = vrsSesUpdUnitaDocKos; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUrnXmlSessioneVers.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUrnXmlSessioneVers.java new file mode 100644 index 0000000..9683d3d --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUrnXmlSessioneVers.java @@ -0,0 +1,104 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.VrsUrnXmlSessioneVers.TiUrnXmlSessioneVers; + +/** + * The persistent class for the VRS_URN_XML_SESSIONE_VERS database table. + */ +@Entity +@Table(name = "VRS_URN_XML_SESSIONE_VERS") +public class VrsUrnXmlSessioneVers implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUrnXmlSessionVers; + + private String dsUrn; + + private TiUrnXmlSessioneVers tiUrn; + + private VrsXmlDatiSessioneVers vrsXmlDatiSessioneVers; + + public VrsUrnXmlSessioneVers() {/* Hibernate */ + } + + @Id + @Column(name = "ID_URN_XML_SESSIONE_VERS") + @GenericGenerator(name = "SVRS_URN_XML_SESSIONE_VERS_ID_URN_XML_SESSIONE_VERS_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_URN_XML_SESSIONE_VERS"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_URN_XML_SESSIONE_VERS_ID_URN_XML_SESSIONE_VERS_GENERATOR") + public Long getIdUrnXmlSessionVers() { + return this.idUrnXmlSessionVers; + } + + public void setIdUrnXmlSessionVers(Long idUrnXmlSessionVers) { + this.idUrnXmlSessionVers = idUrnXmlSessionVers; + } + + @Column(name = "DS_URN") + public String getDsUrn() { + return this.dsUrn; + } + + public void setDsUrn(String dsUrn) { + this.dsUrn = dsUrn; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_URN") + public TiUrnXmlSessioneVers getTiUrn() { + return this.tiUrn; + } + + public void setTiUrn(TiUrnXmlSessioneVers tiUrnXmlSessioneVers) { + this.tiUrn = tiUrnXmlSessioneVers; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_XML_DATI_SESSIONE_VERS") + public VrsXmlDatiSessioneVers getVrsXmlDatiSessioneVers() { + return this.vrsXmlDatiSessioneVers; + } + + public void setVrsXmlDatiSessioneVers(VrsXmlDatiSessioneVers vrsXmlDatiSessioneVers) { + this.vrsXmlDatiSessioneVers = vrsXmlDatiSessioneVers; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUrnXmlSessioneVersKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUrnXmlSessioneVersKo.java new file mode 100644 index 0000000..1a287bc --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsUrnXmlSessioneVersKo.java @@ -0,0 +1,113 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import it.eng.parer.entity.constraint.VrsUrnXmlSessioneVers.TiUrnXmlSessioneVers; +import org.hibernate.id.enhanced.SequenceStyleGenerator; +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; + +/** + * The persistent class for the VRS_URN_XML_SESSIONE_VERS database table. + */ +@Entity +@Table(name = "VRS_URN_XML_SESSIONE_VERS_KO") +public class VrsUrnXmlSessioneVersKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUrnXmlSessionVersKo; + + private String dsUrn; + + private TiUrnXmlSessioneVers tiUrn; + + private VrsXmlDatiSessioneVersKo vrsXmlDatiSessioneVersKo; + + private BigDecimal idStrut; + + public VrsUrnXmlSessioneVersKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_URN_XML_SESSIONE_VERS_KO") + @GenericGenerator(name = "SVRS_URN_XML_SESSIONE_VERS_ID_URN_XML_SESSIONE_VERS_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_URN_XML_SESSIONE_VERS"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_URN_XML_SESSIONE_VERS_ID_URN_XML_SESSIONE_VERS_GENERATOR") + public Long getIdUrnXmlSessionVersKo() { + return this.idUrnXmlSessionVersKo; + } + + public void setIdUrnXmlSessionVersKo(Long idUrnXmlSessionVersKo) { + this.idUrnXmlSessionVersKo = idUrnXmlSessionVersKo; + } + + @Column(name = "DS_URN") + public String getDsUrn() { + return this.dsUrn; + } + + public void setDsUrn(String dsUrn) { + this.dsUrn = dsUrn; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_URN") + public TiUrnXmlSessioneVers getTiUrn() { + return this.tiUrn; + } + + public void setTiUrn(TiUrnXmlSessioneVers tiUrnXmlSessioneVers) { + this.tiUrn = tiUrnXmlSessioneVers; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_XML_DATI_SESSIONE_VERS_KO") + public VrsXmlDatiSessioneVersKo getVrsXmlDatiSessioneVersKo() { + return this.vrsXmlDatiSessioneVersKo; + } + + public void setVrsXmlDatiSessioneVersKo(VrsXmlDatiSessioneVersKo vrsXmlDatiSessioneVersKo) { + this.vrsXmlDatiSessioneVersKo = vrsXmlDatiSessioneVersKo; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlDatiSesObjectStorageKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlDatiSesObjectStorageKo.java new file mode 100644 index 0000000..c04d0a3 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlDatiSesObjectStorageKo.java @@ -0,0 +1,107 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +@Entity +@Table(name = "VRS_XML_DATI_SES_OBJECT_STORAGE_KO") +public class VrsXmlDatiSesObjectStorageKo implements Serializable { + private static final long serialVersionUID = 1L; + + public VrsXmlDatiSesObjectStorageKo() { + super(); + } + + private Long idXmlDatiSesObjectStorageKo; + private DecBackend decBackend; + private VrsDatiSessioneVersKo datiSessioneVersKo; + private String nmTenant; + private String nmBucket; + private String nmKeyFile; + private BigDecimal idStrut; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "ID_XML_DATI_SES_OBJECT_STORAGE_KO") + public Long getIdXmlDatiSesObjectStorageKo() { + return idXmlDatiSesObjectStorageKo; + } + + public void setIdXmlDatiSesObjectStorageKo(Long idXmlDatiSesObjectStorageKo) { + this.idXmlDatiSesObjectStorageKo = idXmlDatiSesObjectStorageKo; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DEC_BACKEND") + public DecBackend getDecBackend() { + return decBackend; + } + + public void setDecBackend(DecBackend decBackend) { + this.decBackend = decBackend; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DATI_SESSIONE_VERS_KO") + public VrsDatiSessioneVersKo getDatiSessioneVersKo() { + return datiSessioneVersKo; + } + + public void setDatiSessioneVersKo(VrsDatiSessioneVersKo datiSessioneVersKo) { + this.datiSessioneVersKo = datiSessioneVersKo; + } + + @Column(name = "NM_TENANT") + public String getNmTenant() { + return nmTenant; + } + + public void setNmTenant(String nmTenant) { + this.nmTenant = nmTenant; + } + + @Column(name = "NM_BUCKET") + public String getNmBucket() { + return nmBucket; + } + + public void setNmBucket(String nmBucket) { + this.nmBucket = nmBucket; + } + + @Column(name = "CD_KEY_FILE") + public String getNmKeyFile() { + return nmKeyFile; + } + + public void setNmKeyFile(String nmKeyFile) { + this.nmKeyFile = nmKeyFile; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlDatiSessioneVers.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlDatiSessioneVers.java new file mode 100644 index 0000000..9b81835 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlDatiSessioneVers.java @@ -0,0 +1,191 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_XML_DATI_SESSIONE_VERS database table. + */ +@Entity +@Table(name = "VRS_XML_DATI_SESSIONE_VERS") +public class VrsXmlDatiSessioneVers implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idXmlDatiSessioneVers; + + private String blXml; + + private String cdEncodingHashXmlVers; + + private String cdVersioneXml; + + private String dsAlgoHashXmlVers; + + private String dsHashXmlVers; + + private String dsUrnXmlVers; + + private BigDecimal idStrut; + + private String tiXmlDati; + private String flCanonicalized; + private VrsDatiSessioneVers vrsDatiSessioneVers; + private List vrsUrnXmlSessioneVers = new ArrayList<>(); + + public VrsXmlDatiSessioneVers() { + // hibernate + } + + @Id + @Column(name = "ID_XML_DATI_SESSIONE_VERS") + @GenericGenerator(name = "SVRS_XML_DATI_SESSIONE_VERS_ID_XML_DATI_SESSIONE_VERS_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_XML_DATI_SESSIONE_VERS"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_XML_DATI_SESSIONE_VERS_ID_XML_DATI_SESSIONE_VERS_GENERATOR") + public Long getIdXmlDatiSessioneVers() { + return this.idXmlDatiSessioneVers; + } + + public void setIdXmlDatiSessioneVers(Long idXmlDatiSessioneVers) { + this.idXmlDatiSessioneVers = idXmlDatiSessioneVers; + } + + @Lob() + @Column(name = "BL_XML") + public String getBlXml() { + return this.blXml; + } + + public void setBlXml(String blXml) { + this.blXml = blXml; + } + + @Column(name = "CD_ENCODING_HASH_XML_VERS") + public String getCdEncodingHashXmlVers() { + return this.cdEncodingHashXmlVers; + } + + public void setCdEncodingHashXmlVers(String cdEncodingHashXmlVers) { + this.cdEncodingHashXmlVers = cdEncodingHashXmlVers; + } + + @Column(name = "CD_VERSIONE_XML") + public String getCdVersioneXml() { + return this.cdVersioneXml; + } + + public void setCdVersioneXml(String cdVersioneXml) { + this.cdVersioneXml = cdVersioneXml; + } + + @Column(name = "DS_ALGO_HASH_XML_VERS") + public String getDsAlgoHashXmlVers() { + return this.dsAlgoHashXmlVers; + } + + public void setDsAlgoHashXmlVers(String dsAlgoHashXmlVers) { + this.dsAlgoHashXmlVers = dsAlgoHashXmlVers; + } + + @Column(name = "DS_HASH_XML_VERS") + public String getDsHashXmlVers() { + return this.dsHashXmlVers; + } + + public void setDsHashXmlVers(String dsHashXmlVers) { + this.dsHashXmlVers = dsHashXmlVers; + } + + @Column(name = "DS_URN_XML_VERS") + public String getDsUrnXmlVers() { + return this.dsUrnXmlVers; + } + + public void setDsUrnXmlVers(String dsUrnXmlVers) { + this.dsUrnXmlVers = dsUrnXmlVers; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "TI_XML_DATI") + public String getTiXmlDati() { + return this.tiXmlDati; + } + + public void setTiXmlDati(String tiXmlDati) { + this.tiXmlDati = tiXmlDati; + } + + // bi-directional many-to-one association to VrsDatiSessioneVers + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DATI_SESSIONE_VERS") + public VrsDatiSessioneVers getVrsDatiSessioneVers() { + return this.vrsDatiSessioneVers; + } + + public void setVrsDatiSessioneVers(VrsDatiSessioneVers vrsDatiSessioneVers) { + this.vrsDatiSessioneVers = vrsDatiSessioneVers; + } + + @Column(name = "FL_CANONICALIZED", columnDefinition = "CHAR") + public String getFlCanonicalized() { + return this.flCanonicalized; + } + + public void setFlCanonicalized(String flCanonicalized) { + this.flCanonicalized = flCanonicalized; + } + + // bi-directional many-to-one association to VrsXmlDatiSessioneVers + @OneToMany(mappedBy = "vrsXmlDatiSessioneVers") + public List getVrsUrnXmlSessioneVers() { + return this.vrsUrnXmlSessioneVers; + } + + public void setVrsUrnXmlSessioneVers(List vrsUrnXmlSessioneVers) { + this.vrsUrnXmlSessioneVers = vrsUrnXmlSessioneVers; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlDatiSessioneVersKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlDatiSessioneVersKo.java new file mode 100644 index 0000000..59e0bf5 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlDatiSessioneVersKo.java @@ -0,0 +1,174 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import javax.persistence.*; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * The persistent class for the VRS_XML_DATI_SESSIONE_VERS_KO database table. + */ +@Entity +@Table(name = "VRS_XML_DATI_SESSIONE_VERS_KO") +public class VrsXmlDatiSessioneVersKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idXmlDatiSessioneVersKo; + + private String blXml; + + private String cdEncodingHashXmlVers; + + private String cdVersioneXml; + + private String dsAlgoHashXmlVers; + + private String dsHashXmlVers; + + private String dsUrnXmlVers; + + private BigDecimal idStrut; + + private String tiXmlDati; + private String flCanonicalized; + private VrsDatiSessioneVersKo vrsDatiSessioneVersKo; + private List vrsUrnXmlSessioneVerKos = new ArrayList<>(); + + public VrsXmlDatiSessioneVersKo() { + // hibernate + } + + @Id + @Column(name = "ID_XML_DATI_SESSIONE_VERS_KO") + @GeneratedValue(strategy = GenerationType.IDENTITY) + public Long getIdXmlDatiSessioneVersKo() { + return this.idXmlDatiSessioneVersKo; + } + + public void setIdXmlDatiSessioneVersKo(Long idXmlDatiSessioneVersKo) { + this.idXmlDatiSessioneVersKo = idXmlDatiSessioneVersKo; + } + + @Lob() + @Column(name = "BL_XML") + public String getBlXml() { + return this.blXml; + } + + public void setBlXml(String blXml) { + this.blXml = blXml; + } + + @Column(name = "CD_ENCODING_HASH_XML_VERS") + public String getCdEncodingHashXmlVers() { + return this.cdEncodingHashXmlVers; + } + + public void setCdEncodingHashXmlVers(String cdEncodingHashXmlVers) { + this.cdEncodingHashXmlVers = cdEncodingHashXmlVers; + } + + @Column(name = "CD_VERSIONE_XML") + public String getCdVersioneXml() { + return this.cdVersioneXml; + } + + public void setCdVersioneXml(String cdVersioneXml) { + this.cdVersioneXml = cdVersioneXml; + } + + @Column(name = "DS_ALGO_HASH_XML_VERS") + public String getDsAlgoHashXmlVers() { + return this.dsAlgoHashXmlVers; + } + + public void setDsAlgoHashXmlVers(String dsAlgoHashXmlVers) { + this.dsAlgoHashXmlVers = dsAlgoHashXmlVers; + } + + @Column(name = "DS_HASH_XML_VERS") + public String getDsHashXmlVers() { + return this.dsHashXmlVers; + } + + public void setDsHashXmlVers(String dsHashXmlVers) { + this.dsHashXmlVers = dsHashXmlVers; + } + + @Column(name = "DS_URN_XML_VERS") + public String getDsUrnXmlVers() { + return this.dsUrnXmlVers; + } + + public void setDsUrnXmlVers(String dsUrnXmlVers) { + this.dsUrnXmlVers = dsUrnXmlVers; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "TI_XML_DATI") + public String getTiXmlDati() { + return this.tiXmlDati; + } + + public void setTiXmlDati(String tiXmlDati) { + this.tiXmlDati = tiXmlDati; + } + + // bi-directional many-to-one association to VrsDatiSessioneVersKo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DATI_SESSIONE_VERS_KO") + public VrsDatiSessioneVersKo getVrsDatiSessioneVersKo() { + return this.vrsDatiSessioneVersKo; + } + + public void setVrsDatiSessioneVersKo(VrsDatiSessioneVersKo vrsDatiSessioneVersKo) { + this.vrsDatiSessioneVersKo = vrsDatiSessioneVersKo; + } + + @Column(name = "FL_CANONICALIZED", columnDefinition = "CHAR") + public String getFlCanonicalized() { + return this.flCanonicalized; + } + + public void setFlCanonicalized(String flCanonicalized) { + this.flCanonicalized = flCanonicalized; + } + + // bi-directional many-to-one association to VrsXmlDatiSessioneVers + @OneToMany(mappedBy = "vrsXmlDatiSessioneVersKo") + public List getVrsUrnXmlSessioneVersKo() { + return this.vrsUrnXmlSessioneVerKos; + } + + // + public void setVrsUrnXmlSessioneVersKo(List vrsUrnXmlSessioneVerKos) { + this.vrsUrnXmlSessioneVerKos = vrsUrnXmlSessioneVerKos; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlModelloSessioneVers.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlModelloSessioneVers.java new file mode 100644 index 0000000..7afe91d --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlModelloSessioneVers.java @@ -0,0 +1,145 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_XML_MODELLO_SESSIONE_VERS database table. + * + */ +@Entity +@Table(name = "VRS_XML_MODELLO_SESSIONE_VERS") +public class VrsXmlModelloSessioneVers implements Serializable { + private static final long serialVersionUID = 1L; + private Long idXmlModelloSessioneVers; + private String blXml; + private BigDecimal idStrut; + private String flCanonicalized; + private VrsDatiSessioneVers vrsDatiSessioneVers; + private DecUsoModelloXsdUniDoc decUsoModelloXsdUniDoc; + private DecUsoModelloXsdDoc decUsoModelloXsdDoc; + private DecUsoModelloXsdCompDoc decUsoModelloXsdCompDoc; + + public VrsXmlModelloSessioneVers() { + // hibernate + } + + @Id + @GenericGenerator(name = "VRS_XML_MODELLO_SESSIONE_VERS_IDXMLMODELLOSESSIONEVERS_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_XML_MODELLO_SESSIONE_VERS"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "VRS_XML_MODELLO_SESSIONE_VERS_IDXMLMODELLOSESSIONEVERS_GENERATOR") + @Column(name = "ID_XML_MODELLO_SESSIONE_VERS") + public Long getIdXmlModelloSessioneVers() { + return this.idXmlModelloSessioneVers; + } + + public void setIdXmlModelloSessioneVers(Long idXmlModelloSessioneVers) { + this.idXmlModelloSessioneVers = idXmlModelloSessioneVers; + } + + @Lob() + @Column(name = "BL_XML") + public String getBlXml() { + return this.blXml; + } + + public void setBlXml(String blXml) { + this.blXml = blXml; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + // bi-directional many-to-one association to VrsDatiSessioneVers + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DATI_SESSIONE_VERS") + public VrsDatiSessioneVers getVrsDatiSessioneVers() { + return this.vrsDatiSessioneVers; + } + + public void setVrsDatiSessioneVers(VrsDatiSessioneVers vrsDatiSessioneVers) { + this.vrsDatiSessioneVers = vrsDatiSessioneVers; + } + + // bi-directional many-to-one association to DecUsoModelloXsdUniDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USO_MODELLO_XSD_UNI_DOC") + public DecUsoModelloXsdUniDoc getDecUsoModelloXsdUniDoc() { + return this.decUsoModelloXsdUniDoc; + } + + public void setDecUsoModelloXsdUniDoc(DecUsoModelloXsdUniDoc decUsoModelloXsdUniDoc) { + this.decUsoModelloXsdUniDoc = decUsoModelloXsdUniDoc; + } + + @Column(name = "FL_CANONICALIZED", columnDefinition = "CHARx") + public String getFlCanonicalized() { + return this.flCanonicalized; + } + + public void setFlCanonicalized(String flCanonicalized) { + this.flCanonicalized = flCanonicalized; + } + + // bi-directional many-to-one association to DecUsoModelloXsdDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USO_MODELLO_XSD_DOC") + public DecUsoModelloXsdDoc getDecUsoModelloXsdDoc() { + return this.decUsoModelloXsdDoc; + } + + public void setDecUsoModelloXsdDoc(DecUsoModelloXsdDoc decUsoModelloXsdDoc) { + this.decUsoModelloXsdDoc = decUsoModelloXsdDoc; + } + + // bi-directional many-to-one association to DecUsoModelloXsdCompDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_USO_MODELLO_XSD_COMP_DOC") + public DecUsoModelloXsdCompDoc getDecUsoModelloXsdCompDoc() { + return this.decUsoModelloXsdCompDoc; + } + + public void setDecUsoModelloXsdCompDoc(DecUsoModelloXsdCompDoc decUsoModelloXsdCompDoc) { + this.decUsoModelloXsdCompDoc = decUsoModelloXsdCompDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesFascicoloErr.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesFascicoloErr.java new file mode 100644 index 0000000..6b5b688 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesFascicoloErr.java @@ -0,0 +1,106 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_XML_SES_FASCICOLO_ERR database table. + */ +@Entity +@Table(name = "VRS_XML_SES_FASCICOLO_ERR") +public class VrsXmlSesFascicoloErr implements Serializable { + + private static final long serialVersionUID = 1L; + private Long idXmlSesFascicoloErr; + private String blXml; + private String cdVersioneXml; + private String tiXml; + private VrsSesFascicoloErr vrsSesFascicoloErr; + + public VrsXmlSesFascicoloErr() {/* Hibernate */ + } + + @Id + @Column(name = "ID_XML_SES_FASCICOLO_ERR") + @GenericGenerator(name = "SVRS_XML_SES_FASCICOLO_ERR_ID_XML_SES_FASCICOLO_ERR_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_XML_SES_FASCICOLO_ERR"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_XML_SES_FASCICOLO_ERR_ID_XML_SES_FASCICOLO_ERR_GENERATOR") + public Long getIdXmlSesFascicoloErr() { + return this.idXmlSesFascicoloErr; + } + + public void setIdXmlSesFascicoloErr(Long idXmlSesFascicoloErr) { + this.idXmlSesFascicoloErr = idXmlSesFascicoloErr; + } + + @Lob + @Column(name = "BL_XML") + public String getBlXml() { + return this.blXml; + } + + public void setBlXml(String blXml) { + this.blXml = blXml; + } + + @Column(name = "CD_VERSIONE_XML") + public String getCdVersioneXml() { + return this.cdVersioneXml; + } + + public void setCdVersioneXml(String cdVersioneXml) { + this.cdVersioneXml = cdVersioneXml; + } + + @Column(name = "TI_XML") + public String getTiXml() { + return this.tiXml; + } + + public void setTiXml(String tiXml) { + this.tiXml = tiXml; + } + + // bi-directional many-to-one association to VrsSesFascicoloErr + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SES_FASCICOLO_ERR") + public VrsSesFascicoloErr getVrsSesFascicoloErr() { + return this.vrsSesFascicoloErr; + } + + public void setVrsSesFascicoloErr(VrsSesFascicoloErr vrsSesFascicoloErr) { + this.vrsSesFascicoloErr = vrsSesFascicoloErr; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesFascicoloKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesFascicoloKo.java new file mode 100644 index 0000000..a985b32 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesFascicoloKo.java @@ -0,0 +1,133 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDate; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +/** + * The persistent class for the VRS_XML_SES_FASCICOLO_KO database table. + */ +@Entity +@Table(name = "VRS_XML_SES_FASCICOLO_KO") +public class VrsXmlSesFascicoloKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idXmlSesFascicoloKo; + + private String blXml; + private String cdVersioneXml; + private LocalDate dtRegXmlSesKo; + + private BigDecimal idStrut; + + private String tiXml; + + private VrsSesFascicoloKo vrsSesFascicoloKo; + + public VrsXmlSesFascicoloKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_XML_SES_FASCICOLO_KO") + @GenericGenerator(name = "SVRS_XML_SES_FASCICOLO_KO_ID_XML_SES_FASCICOLO_KO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_XML_SES_FASCICOLO_KO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_XML_SES_FASCICOLO_KO_ID_XML_SES_FASCICOLO_KO_GENERATOR") + public Long getIdXmlSesFascicoloKo() { + return this.idXmlSesFascicoloKo; + } + + public void setIdXmlSesFascicoloKo(Long idXmlSesFascicoloKo) { + this.idXmlSesFascicoloKo = idXmlSesFascicoloKo; + } + + @Lob + @Column(name = "BL_XML") + public String getBlXml() { + return this.blXml; + } + + public void setBlXml(String blXml) { + this.blXml = blXml; + } + + @Column(name = "CD_VERSIONE_XML") + public String getCdVersioneXml() { + return this.cdVersioneXml; + } + + public void setCdVersioneXml(String cdVersioneXml) { + this.cdVersioneXml = cdVersioneXml; + } + + @Column(name = "DT_REG_XML_SES_KO") + public LocalDate getDtRegXmlSesKo() { + return this.dtRegXmlSesKo; + } + + public void setDtRegXmlSesKo(LocalDate dtRegXmlSesKo) { + this.dtRegXmlSesKo = dtRegXmlSesKo; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "TI_XML") + public String getTiXml() { + return this.tiXml; + } + + public void setTiXml(String tiXml) { + this.tiXml = tiXml; + } + + // bi-directional many-to-one association to VrsSesFascicoloKo + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SES_FASCICOLO_KO") + public VrsSesFascicoloKo getVrsSesFascicoloKo() { + return this.vrsSesFascicoloKo; + } + + public void setVrsSesFascicoloKo(VrsSesFascicoloKo vrsSesFascicoloKo) { + this.vrsSesFascicoloKo = vrsSesFascicoloKo; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUdErrObjectStorage.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUdErrObjectStorage.java new file mode 100644 index 0000000..95112a3 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUdErrObjectStorage.java @@ -0,0 +1,116 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "VRS_XML_SES_UPD_UD_ERR_OBJECT_STORAGE") +public class VrsXmlSesUpdUdErrObjectStorage implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idXmlSesUpdUdErrObjectStorage; + private VrsSesUpdUnitaDocErr vrsSesUpdUnitaDocErr; + private DecBackend decBackend; + private String nmTenant; + private String nmBucket; + private String cdKeyFile; + private BigDecimal idStrut; + + public VrsXmlSesUpdUdErrObjectStorage() { + // hibernate constructor + } + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "ID_XML_SES_UPD_UD_ERR_OBJECT_STORAGE") + public Long getIdXmlSesUpdUdErrObjectStorage() { + return idXmlSesUpdUdErrObjectStorage; + } + + public void setIdXmlSesUpdUdErrObjectStorage(Long idXmlSesUpdUdErrObjectStorage) { + this.idXmlSesUpdUdErrObjectStorage = idXmlSesUpdUdErrObjectStorage; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SES_UPD_UNITA_DOC_ERR") + public VrsSesUpdUnitaDocErr getVrsSesUpdUnitaDocErr() { + return vrsSesUpdUnitaDocErr; + } + + public void setVrsSesUpdUnitaDocErr(VrsSesUpdUnitaDocErr vrsSesUpdUnitaDocErr) { + this.vrsSesUpdUnitaDocErr = vrsSesUpdUnitaDocErr; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DEC_BACKEND") + public DecBackend getDecBackend() { + return decBackend; + } + + public void setDecBackend(DecBackend decBackend) { + this.decBackend = decBackend; + } + + @Column(name = "NM_TENANT") + public String getNmTenant() { + return nmTenant; + } + + public void setNmTenant(String nmTenant) { + this.nmTenant = nmTenant; + } + + @Column(name = "NM_BUCKET") + public String getNmBucket() { + return nmBucket; + } + + public void setNmBucket(String nmBucket) { + this.nmBucket = nmBucket; + } + + @Column(name = "CD_KEY_FILE") + public String getCdKeyFile() { + return cdKeyFile; + } + + public void setCdKeyFile(String cdKeyFile) { + this.cdKeyFile = cdKeyFile; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUdKoObjectStorage.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUdKoObjectStorage.java new file mode 100644 index 0000000..634092e --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUdKoObjectStorage.java @@ -0,0 +1,116 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "VRS_XML_SES_UPD_UD_KO_OBJECT_STORAGE") +public class VrsXmlSesUpdUdKoObjectStorage implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idXmlSesUpdUdKoObjectStorage; + private VrsSesUpdUnitaDocKo vrsSesUpdUnitaDocKo; + private DecBackend decBackend; + private String nmTenant; + private String nmBucket; + private String cdKeyFile; + private BigDecimal idStrut; + + public VrsXmlSesUpdUdKoObjectStorage() { + // hibernate constructor + } + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "ID_XML_SES_UPD_UD_KO_OBJECT_STORAGE") + public Long getIdXmlSesUpdUdKoObjectStorage() { + return idXmlSesUpdUdKoObjectStorage; + } + + public void setIdXmlSesUpdUdKoObjectStorage(Long idXmlSesUpdUdKoObjectStorage) { + this.idXmlSesUpdUdKoObjectStorage = idXmlSesUpdUdKoObjectStorage; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SES_UPD_UNITA_DOC_KO") + public VrsSesUpdUnitaDocKo getVrsSesUpdUnitaDocKo() { + return vrsSesUpdUnitaDocKo; + } + + public void setVrsSesUpdUnitaDocKo(VrsSesUpdUnitaDocKo vrsSesUpdUnitaDocKo) { + this.vrsSesUpdUnitaDocKo = vrsSesUpdUnitaDocKo; + } + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DEC_BACKEND") + public DecBackend getDecBackend() { + return decBackend; + } + + public void setDecBackend(DecBackend decBackend) { + this.decBackend = decBackend; + } + + @Column(name = "NM_TENANT") + public String getNmTenant() { + return nmTenant; + } + + public void setNmTenant(String nmTenant) { + this.nmTenant = nmTenant; + } + + @Column(name = "NM_BUCKET") + public String getNmBucket() { + return nmBucket; + } + + public void setNmBucket(String nmBucket) { + this.nmBucket = nmBucket; + } + + @Column(name = "CD_KEY_FILE") + public String getCdKeyFile() { + return cdKeyFile; + } + + public void setCdKeyFile(String cdKeyFile) { + this.cdKeyFile = cdKeyFile; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUnitaDocErr.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUnitaDocErr.java new file mode 100644 index 0000000..c89573c --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUnitaDocErr.java @@ -0,0 +1,117 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.VrsXmlSesUpdUnitaDocErr.TiXmlVrsXmlSesUpdUnitaDocErr; + +/** + * The persistent class for the VRS_XML_SES_UPD_UNITA_DOC_ERR database table. + */ +@Entity +@Table(name = "VRS_XML_SES_UPD_UNITA_DOC_ERR") +public class VrsXmlSesUpdUnitaDocErr implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idXmlSesUpdUnitaDocErr; + + private String blXml; + + private String cdVersioneXml; + + private VrsSesUpdUnitaDocErr vrsSesUpdUnitaDocErr; + + private TiXmlVrsXmlSesUpdUnitaDocErr tiXml; + + public VrsXmlSesUpdUnitaDocErr() {/* Hibernate */ + } + + @Id + @Column(name = "ID_XML_SES_UPD_UNITA_DOC_ERR") + @GenericGenerator(name = "SVRS_XML_SES_UPD_UNITA_DOC_ERR_ID_XML_SES_UPD_UNITA_DOC_ERR_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_XML_SES_UPD_UNITA_DOC_ERR"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_XML_SES_UPD_UNITA_DOC_ERR_ID_XML_SES_UPD_UNITA_DOC_ERR_GENERATOR") + public Long getIdXmlSesUpdUnitaDocErr() { + return this.idXmlSesUpdUnitaDocErr; + } + + public void setIdXmlSesUpdUnitaDocErr(Long idXmlSesUpdUnitaDocErr) { + this.idXmlSesUpdUnitaDocErr = idXmlSesUpdUnitaDocErr; + } + + @Lob + @Column(name = "BL_XML") + public String getBlXml() { + return this.blXml; + } + + public void setBlXml(String blXml) { + this.blXml = blXml; + } + + @Column(name = "CD_VERSIONE_XML") + public String getCdVersioneXml() { + return this.cdVersioneXml; + } + + public void setCdVersioneXml(String cdVersioneXml) { + this.cdVersioneXml = cdVersioneXml; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SES_UPD_UD_ERR") + public VrsSesUpdUnitaDocErr getVrsSesUpdUnitaDocErr() { + return this.vrsSesUpdUnitaDocErr; + } + + public void setVrsSesUpdUnitaDocErr(VrsSesUpdUnitaDocErr vrsSesUpdUnitaDocErr) { + this.vrsSesUpdUnitaDocErr = vrsSesUpdUnitaDocErr; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_XML") + public TiXmlVrsXmlSesUpdUnitaDocErr getTiXml() { + return this.tiXml; + } + + public void setTiXml(TiXmlVrsXmlSesUpdUnitaDocErr tiXml) { + this.tiXml = tiXml; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUnitaDocKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUnitaDocKo.java new file mode 100644 index 0000000..375b27d --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/VrsXmlSesUpdUnitaDocKo.java @@ -0,0 +1,153 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity; + +import java.io.Serializable; +import java.time.LocalDate; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.Parameter; +import org.hibernate.id.enhanced.SequenceStyleGenerator; + +import it.eng.parer.entity.constraint.VrsXmlSesUpdUnitaDocKo.TiXmlVrsXmlSesUpdUnitaDocKo; + +/** + * The persistent class for the VRS_XML_SES_UPD_UNITA_DOC_KO database table. + */ +@Entity +@Table(name = "VRS_XML_SES_UPD_UNITA_DOC_KO") +public class VrsXmlSesUpdUnitaDocKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idXmlSesUpdUnitaDocKo; + + private String blXml; + + private String cdVersioneXml; + + private LocalDate dtRegXml; + + private VrsSesUpdUnitaDocKo vrsSesUpdUnitaDocKo; + + private OrgStrut orgStrut; + + private TiXmlVrsXmlSesUpdUnitaDocKo tiXml; + + private Integer aaRegXml; + + public VrsXmlSesUpdUnitaDocKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_XML_SES_UPD_UNITA_DOC_KO") + @GenericGenerator(name = "SVRS_XML_SES_UPD_UNITA_DOC_KO_ID_XML_SES_UPD_UNITA_DOC_KO_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { + @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SVRS_XML_SES_UPD_UNITA_DOC_KO"), + @Parameter(name = SequenceStyleGenerator.INCREMENT_PARAM, value = "1") }) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SVRS_XML_SES_UPD_UNITA_DOC_KO_ID_XML_SES_UPD_UNITA_DOC_KO_GENERATOR") + public Long getIdXmlSesUpdUnitaDocKo() { + return this.idXmlSesUpdUnitaDocKo; + } + + public void setIdXmlSesUpdUnitaDocKo(Long idXmlSesUpdUnitaDocKo) { + this.idXmlSesUpdUnitaDocKo = idXmlSesUpdUnitaDocKo; + } + + @Lob + @Column(name = "BL_XML") + public String getBlXml() { + return this.blXml; + } + + public void setBlXml(String blXml) { + this.blXml = blXml; + } + + @Column(name = "CD_VERSIONE_XML") + public String getCdVersioneXml() { + return this.cdVersioneXml; + } + + public void setCdVersioneXml(String cdVersioneXml) { + this.cdVersioneXml = cdVersioneXml; + } + + @Column(name = "DT_REG_XML") + public LocalDate getDtRegXml() { + return this.dtRegXml; + } + + public void setDtRegXml(LocalDate dtRegXml) { + this.dtRegXml = dtRegXml; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SES_UPD_UD_KO") + public VrsSesUpdUnitaDocKo getVrsSesUpdUnitaDocKo() { + return this.vrsSesUpdUnitaDocKo; + } + + public void setVrsSesUpdUnitaDocKo(VrsSesUpdUnitaDocKo vrsSesUpdUnitaDocKo) { + this.vrsSesUpdUnitaDocKo = vrsSesUpdUnitaDocKo; + } + + // bi-directional many-to-one association to OrgStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_STRUT") + public OrgStrut getOrgStrut() { + return this.orgStrut; + } + + public void setOrgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + } + + @Enumerated(EnumType.STRING) + @Column(name = "TI_XML") + public TiXmlVrsXmlSesUpdUnitaDocKo getTiXml() { + return this.tiXml; + } + + public void setTiXml(TiXmlVrsXmlSesUpdUnitaDocKo tiXml) { + this.tiXml = tiXml; + } + + @Column(name = "AA_REG_XML") + public Integer getAaRegXml() { + return aaRegXml; + } + + public void setAaRegXml(Integer aaRegXml) { + this.aaRegXml = aaRegXml; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsDatiSessioneVersBuilder.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsDatiSessioneVersBuilder.java new file mode 100644 index 0000000..0a32822 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsDatiSessioneVersBuilder.java @@ -0,0 +1,142 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.builder; + +import it.eng.parer.entity.*; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Optional; + +public final class VrsDatiSessioneVersBuilder { + private String cdKeyAlleg; + private BigDecimal idStrut; + private BigDecimal niFile; + private BigDecimal pgDatiSessioneVers; + private String tiDatiSessioneVers; + private Optional vrsSessioneVers; + private Optional vrsSessioneVersKo; + private List vrsErrSessioneVers; + private List vrsErrSessioneVersKo; + private List vrsFileSessioneKo; + private List vrsXmlDatiSessioneVersKo; + private List vrsXmlDatiSessioneVers; + private List xmlDatiSesObjectStorageKos; + + private VrsDatiSessioneVersBuilder() { + } + + public static VrsDatiSessioneVersBuilder builder() { + return new VrsDatiSessioneVersBuilder(); + } + + public VrsDatiSessioneVersBuilder cdKeyAlleg(String cdKeyAlleg) { + this.cdKeyAlleg = cdKeyAlleg; + return this; + } + + public VrsDatiSessioneVersBuilder idStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + return this; + } + + public VrsDatiSessioneVersBuilder niFile(BigDecimal niFile) { + this.niFile = niFile; + return this; + } + + public VrsDatiSessioneVersBuilder pgDatiSessioneVers(BigDecimal pgDatiSessioneVers) { + this.pgDatiSessioneVers = pgDatiSessioneVers; + return this; + } + + public VrsDatiSessioneVersBuilder tiDatiSessioneVers(String tiDatiSessioneVers) { + this.tiDatiSessioneVers = tiDatiSessioneVers; + return this; + } + + public VrsDatiSessioneVersBuilder vrsSessioneVers(Optional vrsSessioneVers) { + this.vrsSessioneVers = vrsSessioneVers; + return this; + } + + public VrsDatiSessioneVersBuilder vrsSessioneVersKo(Optional vrsSessioneVersKo) { + this.vrsSessioneVersKo = vrsSessioneVersKo; + return this; + } + + public VrsDatiSessioneVersBuilder vrsErrSessioneVers(List vrsErrSessioneVers) { + this.vrsErrSessioneVers = vrsErrSessioneVers; + return this; + } + + public VrsDatiSessioneVersBuilder vrsErrSessioneVersKo(List vrsErrSessioneVersKo) { + this.vrsErrSessioneVersKo = vrsErrSessioneVersKo; + return this; + } + + public VrsDatiSessioneVersBuilder vrsFileSessioneKo(List vrsFileSessioneKo) { + this.vrsFileSessioneKo = vrsFileSessioneKo; + return this; + } + + public VrsDatiSessioneVersBuilder vrsXmlDatiSessioneVers(List vrsXmlDatiSessioneVers) { + this.vrsXmlDatiSessioneVers = vrsXmlDatiSessioneVers; + return this; + } + + public VrsDatiSessioneVersBuilder vrsXmlDatiSessioneVersKo( + List vrsXmlDatiSessioneVersKo) { + this.vrsXmlDatiSessioneVersKo = vrsXmlDatiSessioneVersKo; + return this; + } + + public VrsDatiSessioneVersBuilder xmlDatiSesObjectStorageKos( + List xmlDatiSesObjectStorageKos) { + this.xmlDatiSesObjectStorageKos = xmlDatiSesObjectStorageKos; + return this; + } + + public VrsDatiSessioneVers buildVrsDatiSessioneVers() { + VrsDatiSessioneVers vrsDatiSessioneVers = new VrsDatiSessioneVers(); + vrsDatiSessioneVers.setCdKeyAlleg(cdKeyAlleg); + vrsDatiSessioneVers.setIdStrut(idStrut); + vrsDatiSessioneVers.setNiFile(niFile); + vrsDatiSessioneVers.setPgDatiSessioneVers(pgDatiSessioneVers); + vrsDatiSessioneVers.setTiDatiSessioneVers(tiDatiSessioneVers); + vrsDatiSessioneVers.setVrsSessioneVers(vrsSessioneVers.get()); + vrsDatiSessioneVers.setVrsErrSessioneVers(vrsErrSessioneVers); + vrsDatiSessioneVers.setVrsXmlDatiSessioneVers(vrsXmlDatiSessioneVers); + return vrsDatiSessioneVers; + } + + public VrsDatiSessioneVersKo buildVrsDatiSessioneVersKo() { + VrsDatiSessioneVersKo vrsDatiSessioneVers = new VrsDatiSessioneVersKo(); + vrsDatiSessioneVers.setCdKeyAlleg(cdKeyAlleg); + vrsDatiSessioneVers.setIdStrut(idStrut); + vrsDatiSessioneVers.setNiFile(niFile); + vrsDatiSessioneVers.setPgDatiSessioneVers(pgDatiSessioneVers); + vrsDatiSessioneVers.setTiDatiSessioneVers(tiDatiSessioneVers); + vrsDatiSessioneVers.setVrsSessioneVersKo(vrsSessioneVersKo.get()); + vrsDatiSessioneVers.setVrsErrSessioneVersKos(vrsErrSessioneVersKo); + vrsDatiSessioneVers.setVrsFileSessioneKos(vrsFileSessioneKo); + vrsDatiSessioneVers.setVrsXmlDatiSessioneVersKos(vrsXmlDatiSessioneVersKo); + vrsDatiSessioneVers.setXmlDatiSesObjectStorageKos(xmlDatiSesObjectStorageKos); + return vrsDatiSessioneVers; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsErrSessioneVersBuilder.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsErrSessioneVersBuilder.java new file mode 100644 index 0000000..30c4385 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsErrSessioneVersBuilder.java @@ -0,0 +1,107 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.builder; + +import it.eng.parer.entity.VrsDatiSessioneVers; +import it.eng.parer.entity.VrsDatiSessioneVersKo; +import it.eng.parer.entity.VrsErrSessioneVers; +import it.eng.parer.entity.VrsErrSessioneVersKo; + +import java.math.BigDecimal; + +public final class VrsErrSessioneVersBuilder { + private String cdErr; + private String dsErr; + private String flErrPrinc; + private BigDecimal idStrut; + private BigDecimal pgErrSessioneVers; + private String tiErr; + private VrsDatiSessioneVersKo vrsDatiSessioneVersKo; + private VrsDatiSessioneVers vrsDatiSessioneVers; + + private VrsErrSessioneVersBuilder() { + } + + public static VrsErrSessioneVersBuilder builder() { + return new VrsErrSessioneVersBuilder(); + } + + public VrsErrSessioneVersBuilder cdErr(String cdErr) { + this.cdErr = cdErr; + return this; + } + + public VrsErrSessioneVersBuilder dsErr(String dsErr) { + this.dsErr = dsErr; + return this; + } + + public VrsErrSessioneVersBuilder flErrPrinc(String flErrPrinc) { + this.flErrPrinc = flErrPrinc; + return this; + } + + public VrsErrSessioneVersBuilder idStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + return this; + } + + public VrsErrSessioneVersBuilder pgErrSessioneVers(BigDecimal pgErrSessioneVers) { + this.pgErrSessioneVers = pgErrSessioneVers; + return this; + } + + public VrsErrSessioneVersBuilder tiErr(String tiErr) { + this.tiErr = tiErr; + return this; + } + + public VrsErrSessioneVersBuilder vrsDatiSessioneVersKo(VrsDatiSessioneVersKo vrsDatiSessioneVersKo) { + this.vrsDatiSessioneVersKo = vrsDatiSessioneVersKo; + return this; + } + + public VrsErrSessioneVersBuilder vrsDatiSessioneVers(VrsDatiSessioneVers vrsDatiSessioneVers) { + this.vrsDatiSessioneVers = vrsDatiSessioneVers; + return this; + } + + public VrsErrSessioneVersKo buildVrsErrSessioneVersKo() { + VrsErrSessioneVersKo vrsErrSessioneVers = new VrsErrSessioneVersKo(); + vrsErrSessioneVers.setCdErr(cdErr); + vrsErrSessioneVers.setDsErr(dsErr); + vrsErrSessioneVers.setFlErrPrinc(flErrPrinc); + vrsErrSessioneVers.setIdStrut(idStrut); + vrsErrSessioneVers.setPgErrSessioneVers(pgErrSessioneVers); + vrsErrSessioneVers.setTiErr(tiErr); + vrsErrSessioneVers.setVrsDatiSessioneVersKo(vrsDatiSessioneVersKo); + return vrsErrSessioneVers; + } + + public VrsErrSessioneVers buildVrsErrSessioneVers() { + VrsErrSessioneVers vrsErrSessioneVers = new VrsErrSessioneVers(); + vrsErrSessioneVers.setCdErr(cdErr); + vrsErrSessioneVers.setDsErr(dsErr); + vrsErrSessioneVers.setFlErrPrinc(flErrPrinc); + vrsErrSessioneVers.setIdStrut(idStrut); + vrsErrSessioneVers.setPgErrSessioneVers(pgErrSessioneVers); + vrsErrSessioneVers.setTiErr(tiErr); + vrsErrSessioneVers.setVrsDatiSessioneVers(vrsDatiSessioneVers); + return vrsErrSessioneVers; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsFileSesObjectStorageBuilder.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsFileSesObjectStorageBuilder.java new file mode 100644 index 0000000..7ec89fa --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsFileSesObjectStorageBuilder.java @@ -0,0 +1,79 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.builder; + +import it.eng.parer.entity.*; + +import java.math.BigDecimal; + +public final class VrsFileSesObjectStorageBuilder { + private DecBackend decBackend; + private VrsFileSessioneKo fileSessioneKo; + private String nmTenant; + private String nmBucket; + private String nmKeyFile; + private BigDecimal idStrut; + + private VrsFileSesObjectStorageBuilder() { + } + + public static VrsFileSesObjectStorageBuilder builder() { + return new VrsFileSesObjectStorageBuilder(); + } + + public VrsFileSesObjectStorageBuilder decBackend(DecBackend decBackend) { + this.decBackend = decBackend; + return this; + } + + public VrsFileSesObjectStorageBuilder fileSessioneKo(VrsFileSessioneKo fileSessioneKo) { + this.fileSessioneKo = fileSessioneKo; + return this; + } + + public VrsFileSesObjectStorageBuilder nmTenant(String nmTenant) { + this.nmTenant = nmTenant; + return this; + } + + public VrsFileSesObjectStorageBuilder nmBucket(String nmBucket) { + this.nmBucket = nmBucket; + return this; + } + + public VrsFileSesObjectStorageBuilder nmKeyFile(String nmKeyFile) { + this.nmKeyFile = nmKeyFile; + return this; + } + + public VrsFileSesObjectStorageBuilder idStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + return this; + } + + public VrsFileSesObjectStorageKo buildVrsFileSesObjectStorageKo() { + VrsFileSesObjectStorageKo vrsFileSesObjectStorageKo = new VrsFileSesObjectStorageKo(); + vrsFileSesObjectStorageKo.setDecBackend(decBackend); + vrsFileSesObjectStorageKo.setFileSessioneKo(fileSessioneKo); + vrsFileSesObjectStorageKo.setNmTenant(nmTenant); + vrsFileSesObjectStorageKo.setNmBucket(nmBucket); + vrsFileSesObjectStorageKo.setNmKeyFile(nmKeyFile); + vrsFileSesObjectStorageKo.setIdStrut(idStrut); + return vrsFileSesObjectStorageKo; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsFileSessioneBuilder.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsFileSessioneBuilder.java new file mode 100644 index 0000000..e0c19a8 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsFileSessioneBuilder.java @@ -0,0 +1,73 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.builder; + +import it.eng.parer.entity.VrsDatiSessioneVersKo; +import it.eng.parer.entity.VrsFileSessioneKo; + +import java.math.BigDecimal; + +public final class VrsFileSessioneBuilder { + private BigDecimal idStrut; + private String nmFileSessione; + private BigDecimal pgFileSessione; + private String tiStatoFileSessione; + private VrsDatiSessioneVersKo vrsDatiSessioneVersKo; + + private VrsFileSessioneBuilder() { + } + + public static VrsFileSessioneBuilder builder() { + return new VrsFileSessioneBuilder(); + } + + public VrsFileSessioneBuilder idStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + return this; + } + + public VrsFileSessioneBuilder nmFileSessione(String nmFileSessione) { + this.nmFileSessione = nmFileSessione; + return this; + } + + public VrsFileSessioneBuilder pgFileSessione(BigDecimal pgFileSessione) { + this.pgFileSessione = pgFileSessione; + return this; + } + + public VrsFileSessioneBuilder tiStatoFileSessione(String tiStatoFileSessione) { + this.tiStatoFileSessione = tiStatoFileSessione; + return this; + } + + public VrsFileSessioneBuilder vrsDatiSessioneVersKo(VrsDatiSessioneVersKo vrsDatiSessioneVersKo) { + this.vrsDatiSessioneVersKo = vrsDatiSessioneVersKo; + return this; + } + + public VrsFileSessioneKo buildVrsFileSessioneKo() { + VrsFileSessioneKo vrsFileSessione = new VrsFileSessioneKo(); + vrsFileSessione.setIdStrut(idStrut); + vrsFileSessione.setNmFileSessione(nmFileSessione); + vrsFileSessione.setPgFileSessione(pgFileSessione); + vrsFileSessione.setTiStatoFileSessione(tiStatoFileSessione); + vrsFileSessione.setVrsDatiSessioneVersKo(vrsDatiSessioneVersKo); + return vrsFileSessione; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsSessioneVersBuilder.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsSessioneVersBuilder.java new file mode 100644 index 0000000..efdbb29 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsSessioneVersBuilder.java @@ -0,0 +1,276 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.builder; + +import it.eng.parer.entity.*; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +public final class VrsSessioneVersBuilder { + private BigDecimal aaKeyUnitaDoc; + private String cdErrPrinc; + private String cdKeyDocVers; + private String cdKeyUnitaDoc; + private String cdRegistroKeyUnitaDoc; + private String cdVersioneWs; + private String dsErrPrinc; + private Date dtApertura; + private Date dtChiusura; + private Date tsApertura; + private Date tsChiusura; + private String flSessioneErrNonRisolub; + private String flSessioneErrVerif; + private BigDecimal niFileErr; + private String nmAmbiente; + private String nmEnte; + private String nmStrut; + private String nmUserid; + private String nmUseridWs; + private String nmUtente; + private String tiSessioneVers; + private String cdIndIpClient; + private String cdIndServer; + private List vrsDatiSessioneVers; + private List vrsDatiSessioneVersKo; + private AroDoc aroDoc; + private AroUnitaDoc aroUnitaDoc; + private OrgStrut orgStrut; + private IamUser iamUser; + + private VrsSessioneVersBuilder() { + } + + public static VrsSessioneVersBuilder builder() { + return new VrsSessioneVersBuilder(); + } + + public VrsSessioneVersBuilder aaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + return this; + } + + public VrsSessioneVersBuilder cdErrPrinc(String cdErrPrinc) { + this.cdErrPrinc = cdErrPrinc; + return this; + } + + public VrsSessioneVersBuilder cdKeyDocVers(String cdKeyDocVers) { + this.cdKeyDocVers = cdKeyDocVers; + return this; + } + + public VrsSessioneVersBuilder cdKeyUnitaDoc(String cdKeyUnitaDoc) { + this.cdKeyUnitaDoc = cdKeyUnitaDoc; + return this; + } + + public VrsSessioneVersBuilder cdRegistroKeyUnitaDoc(String cdRegistroKeyUnitaDoc) { + this.cdRegistroKeyUnitaDoc = cdRegistroKeyUnitaDoc; + return this; + } + + public VrsSessioneVersBuilder cdVersioneWs(String cdVersioneWs) { + this.cdVersioneWs = cdVersioneWs; + return this; + } + + public VrsSessioneVersBuilder dsErrPrinc(String dsErrPrinc) { + this.dsErrPrinc = dsErrPrinc; + return this; + } + + public VrsSessioneVersBuilder dtApertura(Date dtApertura) { + this.dtApertura = dtApertura; + return this; + } + + public VrsSessioneVersBuilder dtChiusura(Date dtChiusura) { + this.dtChiusura = dtChiusura; + return this; + } + + public VrsSessioneVersBuilder tsApertura(Date tsApertura) { + this.tsApertura = tsApertura; + return this; + } + + public VrsSessioneVersBuilder tsChiusura(Date tsChiusura) { + this.tsChiusura = tsChiusura; + return this; + } + + public VrsSessioneVersBuilder flSessioneErrNonRisolub(String flSessioneErrNonRisolub) { + this.flSessioneErrNonRisolub = flSessioneErrNonRisolub; + return this; + } + + public VrsSessioneVersBuilder flSessioneErrVerif(String flSessioneErrVerif) { + this.flSessioneErrVerif = flSessioneErrVerif; + return this; + } + + public VrsSessioneVersBuilder niFileErr(BigDecimal niFileErr) { + this.niFileErr = niFileErr; + return this; + } + + public VrsSessioneVersBuilder nmAmbiente(String nmAmbiente) { + this.nmAmbiente = nmAmbiente; + return this; + } + + public VrsSessioneVersBuilder nmEnte(String nmEnte) { + this.nmEnte = nmEnte; + return this; + } + + public VrsSessioneVersBuilder nmStrut(String nmStrut) { + this.nmStrut = nmStrut; + return this; + } + + public VrsSessioneVersBuilder nmUserid(String nmUserid) { + this.nmUserid = nmUserid; + return this; + } + + public VrsSessioneVersBuilder nmUseridWs(String nmUseridWs) { + this.nmUseridWs = nmUseridWs; + return this; + } + + public VrsSessioneVersBuilder nmUtente(String nmUtente) { + this.nmUtente = nmUtente; + return this; + } + + public VrsSessioneVersBuilder tiSessioneVers(String tiSessioneVers) { + this.tiSessioneVers = tiSessioneVers; + return this; + } + + public VrsSessioneVersBuilder cdIndIpClient(String cdIndIpClient) { + this.cdIndIpClient = cdIndIpClient; + return this; + } + + public VrsSessioneVersBuilder cdIndServer(String cdIndServer) { + this.cdIndServer = cdIndServer; + return this; + } + + public VrsSessioneVersBuilder vrsDatiSessioneVers(List vrsDatiSessioneVers) { + this.vrsDatiSessioneVers = vrsDatiSessioneVers; + return this; + } + + public VrsSessioneVersBuilder vrsDatiSessioneVersKo(List vrsDatiSessioneVersKo) { + this.vrsDatiSessioneVersKo = vrsDatiSessioneVersKo; + return this; + } + + public VrsSessioneVersBuilder aroDoc(AroDoc aroDoc) { + this.aroDoc = aroDoc; + return this; + } + + public VrsSessioneVersBuilder aroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + return this; + } + + public VrsSessioneVersBuilder orgStrut(OrgStrut orgStrut) { + this.orgStrut = orgStrut; + return this; + } + + public VrsSessioneVersBuilder iamUser(IamUser iamUser) { + this.iamUser = iamUser; + return this; + } + + public VrsSessioneVers buildVrsSessioneVers() { + VrsSessioneVers vrsSessioneVers = new VrsSessioneVers(); + vrsSessioneVers.setAaKeyUnitaDoc(aaKeyUnitaDoc); + vrsSessioneVers.setCdErrPrinc(cdErrPrinc); + vrsSessioneVers.setCdKeyDocVers(cdKeyDocVers); + vrsSessioneVers.setCdKeyUnitaDoc(cdKeyUnitaDoc); + vrsSessioneVers.setCdRegistroKeyUnitaDoc(cdRegistroKeyUnitaDoc); + vrsSessioneVers.setCdVersioneWs(cdVersioneWs); + vrsSessioneVers.setDsErrPrinc(dsErrPrinc); + vrsSessioneVers.setDtApertura(dtApertura); + vrsSessioneVers.setDtChiusura(dtChiusura); + vrsSessioneVers.setTsApertura(tsApertura); + vrsSessioneVers.setTsChiusura(tsChiusura); + vrsSessioneVers.setFlSessioneErrNonRisolub(flSessioneErrNonRisolub); + vrsSessioneVers.setFlSessioneErrVerif(flSessioneErrVerif); + vrsSessioneVers.setNiFileErr(niFileErr); + vrsSessioneVers.setNmAmbiente(nmAmbiente); + vrsSessioneVers.setNmEnte(nmEnte); + vrsSessioneVers.setNmStrut(nmStrut); + vrsSessioneVers.setNmUserid(nmUserid); + vrsSessioneVers.setNmUseridWs(nmUseridWs); + vrsSessioneVers.setNmUtente(nmUtente); + vrsSessioneVers.setTiSessioneVers(tiSessioneVers); + vrsSessioneVers.setTiStatoSessioneVers("CHIUSA_OK"); + vrsSessioneVers.setCdIndIpClient(cdIndIpClient); + vrsSessioneVers.setCdIndServer(cdIndServer); + vrsSessioneVers.setVrsDatiSessioneVers(vrsDatiSessioneVers); + vrsSessioneVers.setAroDoc(aroDoc); + vrsSessioneVers.setAroUnitaDoc(aroUnitaDoc); + vrsSessioneVers.setOrgStrut(orgStrut); + vrsSessioneVers.setIamUser(iamUser); + return vrsSessioneVers; + } + + public VrsSessioneVersKo buildVrsSessioneVersKo() { + VrsSessioneVersKo vrsSessioneVers = new VrsSessioneVersKo(); + vrsSessioneVers.setAaKeyUnitaDoc(aaKeyUnitaDoc); + vrsSessioneVers.setCdErrPrinc(cdErrPrinc); + vrsSessioneVers.setCdKeyDocVers(cdKeyDocVers); + vrsSessioneVers.setCdKeyUnitaDoc(cdKeyUnitaDoc); + vrsSessioneVers.setCdRegistroKeyUnitaDoc(cdRegistroKeyUnitaDoc); + vrsSessioneVers.setCdVersioneWs(cdVersioneWs); + vrsSessioneVers.setDsErrPrinc(dsErrPrinc); + vrsSessioneVers.setDtApertura(dtApertura); + vrsSessioneVers.setDtChiusura(dtChiusura); + vrsSessioneVers.setTsApertura(tsApertura); + vrsSessioneVers.setTsChiusura(tsChiusura); + vrsSessioneVers.setFlSessioneErrNonRisolub(flSessioneErrNonRisolub); + vrsSessioneVers.setFlSessioneErrVerif(flSessioneErrVerif); + vrsSessioneVers.setNiFileErr(niFileErr); + vrsSessioneVers.setNmAmbiente(nmAmbiente); + vrsSessioneVers.setNmEnte(nmEnte); + vrsSessioneVers.setNmStrut(nmStrut); + vrsSessioneVers.setNmUserid(nmUserid); + vrsSessioneVers.setNmUseridWs(nmUseridWs); + vrsSessioneVers.setNmUtente(nmUtente); + vrsSessioneVers.setTiSessioneVers(tiSessioneVers); + vrsSessioneVers.setTiStatoSessioneVers("CHIUSA_ERR"); + vrsSessioneVers.setCdIndIpClient(cdIndIpClient); + vrsSessioneVers.setCdIndServer(cdIndServer); + vrsSessioneVers.setVrsDatiSessioneVersKos(vrsDatiSessioneVersKo); + vrsSessioneVers.setAroDoc(aroDoc); + vrsSessioneVers.setAroUnitaDoc(aroUnitaDoc); + vrsSessioneVers.setOrgStrut(orgStrut); + vrsSessioneVers.setIamUser(iamUser); + return vrsSessioneVers; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsUrnXmlSessioneVersBuilder.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsUrnXmlSessioneVersBuilder.java new file mode 100644 index 0000000..1f652e8 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsUrnXmlSessioneVersBuilder.java @@ -0,0 +1,86 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.builder; + +import it.eng.parer.entity.VrsUrnXmlSessioneVers; +import it.eng.parer.entity.VrsUrnXmlSessioneVersKo; +import it.eng.parer.entity.VrsXmlDatiSessioneVers; +import it.eng.parer.entity.VrsXmlDatiSessioneVersKo; +import it.eng.parer.entity.constraint.VrsUrnXmlSessioneVers.TiUrnXmlSessioneVers; + +import java.math.BigDecimal; +import java.util.Optional; + +public final class VrsUrnXmlSessioneVersBuilder { + private String dsUrn; + private TiUrnXmlSessioneVers tiUrn; + private Optional vrsXmlDatiSessioneVers; + private Optional vrsXmlDatiSessioneVersKo; + private BigDecimal idStrut; + + private VrsUrnXmlSessioneVersBuilder() { + } + + public static VrsUrnXmlSessioneVersBuilder builder() { + return new VrsUrnXmlSessioneVersBuilder(); + } + + public VrsUrnXmlSessioneVersBuilder dsUrn(String dsUrn) { + this.dsUrn = dsUrn; + return this; + } + + public VrsUrnXmlSessioneVersBuilder tiUrn(TiUrnXmlSessioneVers tiUrn) { + this.tiUrn = tiUrn; + return this; + } + + public VrsUrnXmlSessioneVersBuilder vrsXmlDatiSessioneVers( + Optional vrsXmlDatiSessioneVers) { + this.vrsXmlDatiSessioneVers = vrsXmlDatiSessioneVers; + return this; + } + + public VrsUrnXmlSessioneVersBuilder vrsXmlDatiSessioneVersKo( + Optional vrsXmlDatiSessioneVersKo) { + this.vrsXmlDatiSessioneVersKo = vrsXmlDatiSessioneVersKo; + return this; + } + + public VrsUrnXmlSessioneVersBuilder idStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + return this; + } + + public VrsUrnXmlSessioneVers buildVrsUrnXmlSessioneVers() { + VrsUrnXmlSessioneVers vrsUrnXmlSessioneVers = new VrsUrnXmlSessioneVers(); + vrsUrnXmlSessioneVers.setDsUrn(dsUrn); + vrsUrnXmlSessioneVers.setTiUrn(tiUrn); + vrsUrnXmlSessioneVers.setVrsXmlDatiSessioneVers(vrsXmlDatiSessioneVers.get()); + return vrsUrnXmlSessioneVers; + } + + public VrsUrnXmlSessioneVersKo buildVrsUrnXmlSessioneVersKo() { + VrsUrnXmlSessioneVersKo vrsUrnXmlSessioneVers = new VrsUrnXmlSessioneVersKo(); + vrsUrnXmlSessioneVers.setDsUrn(dsUrn); + vrsUrnXmlSessioneVers.setTiUrn(tiUrn); + vrsUrnXmlSessioneVers.setIdStrut(idStrut); + vrsUrnXmlSessioneVers.setVrsXmlDatiSessioneVersKo(vrsXmlDatiSessioneVersKo.get()); + return vrsUrnXmlSessioneVers; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsXmlDatiSesObjectStorageBuilder.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsXmlDatiSesObjectStorageBuilder.java new file mode 100644 index 0000000..a2e90c7 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsXmlDatiSesObjectStorageBuilder.java @@ -0,0 +1,79 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.builder; + +import it.eng.parer.entity.*; + +import java.math.BigDecimal; + +public final class VrsXmlDatiSesObjectStorageBuilder { + private DecBackend decBackend; + private VrsDatiSessioneVersKo datiSessioneVersKo; + private String nmTenant; + private String nmBucket; + private String nmKeyFile; + private BigDecimal idStrut; + + private VrsXmlDatiSesObjectStorageBuilder() { + } + + public static VrsXmlDatiSesObjectStorageBuilder builder() { + return new VrsXmlDatiSesObjectStorageBuilder(); + } + + public VrsXmlDatiSesObjectStorageBuilder decBackend(DecBackend decBackend) { + this.decBackend = decBackend; + return this; + } + + public VrsXmlDatiSesObjectStorageBuilder datiSessioneVersKo(VrsDatiSessioneVersKo datiSessioneVersKo) { + this.datiSessioneVersKo = datiSessioneVersKo; + return this; + } + + public VrsXmlDatiSesObjectStorageBuilder nmTenant(String nmTenant) { + this.nmTenant = nmTenant; + return this; + } + + public VrsXmlDatiSesObjectStorageBuilder nmBucket(String nmBucket) { + this.nmBucket = nmBucket; + return this; + } + + public VrsXmlDatiSesObjectStorageBuilder nmKeyFile(String nmKeyFile) { + this.nmKeyFile = nmKeyFile; + return this; + } + + public VrsXmlDatiSesObjectStorageBuilder idStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + return this; + } + + public VrsXmlDatiSesObjectStorageKo buildVrsXmlDatiSesObjectStorageKo() { + VrsXmlDatiSesObjectStorageKo vrsXmlDatiSesObjectStorage = new VrsXmlDatiSesObjectStorageKo(); + vrsXmlDatiSesObjectStorage.setDecBackend(decBackend); + vrsXmlDatiSesObjectStorage.setDatiSessioneVersKo(datiSessioneVersKo); + vrsXmlDatiSesObjectStorage.setNmTenant(nmTenant); + vrsXmlDatiSesObjectStorage.setNmBucket(nmBucket); + vrsXmlDatiSesObjectStorage.setNmKeyFile(nmKeyFile); + vrsXmlDatiSesObjectStorage.setIdStrut(idStrut); + return vrsXmlDatiSesObjectStorage; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsXmlDatiSessioneVersBuilder.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsXmlDatiSessioneVersBuilder.java new file mode 100644 index 0000000..97ac96c --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/builder/VrsXmlDatiSessioneVersBuilder.java @@ -0,0 +1,149 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.builder; + +import it.eng.parer.entity.*; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Optional; + +public final class VrsXmlDatiSessioneVersBuilder { + private String blXml; + private String cdEncodingHashXmlVers; + private String cdVersioneXml; + private String dsAlgoHashXmlVers; + private String dsHashXmlVers; + private String dsUrnXmlVers; + private BigDecimal idStrut; + private String tiXmlDati; + private String flCanonicalized; + private Optional vrsDatiSessioneVers; + private Optional vrsDatiSessioneVersKo; + private List vrsUrnXmlSessioneVers; + private List vrsUrnXmlSessioneVersKo; + + private VrsXmlDatiSessioneVersBuilder() { + } + + public static VrsXmlDatiSessioneVersBuilder builder() { + return new VrsXmlDatiSessioneVersBuilder(); + } + + public VrsXmlDatiSessioneVersBuilder blXml(String blXml) { + this.blXml = blXml; + return this; + } + + public VrsXmlDatiSessioneVersBuilder cdEncodingHashXmlVers(String cdEncodingHashXmlVers) { + this.cdEncodingHashXmlVers = cdEncodingHashXmlVers; + return this; + } + + public VrsXmlDatiSessioneVersBuilder cdVersioneXml(String cdVersioneXml) { + this.cdVersioneXml = cdVersioneXml; + return this; + } + + public VrsXmlDatiSessioneVersBuilder dsAlgoHashXmlVers(String dsAlgoHashXmlVers) { + this.dsAlgoHashXmlVers = dsAlgoHashXmlVers; + return this; + } + + public VrsXmlDatiSessioneVersBuilder dsHashXmlVers(String dsHashXmlVers) { + this.dsHashXmlVers = dsHashXmlVers; + return this; + } + + public VrsXmlDatiSessioneVersBuilder dsUrnXmlVers(String dsUrnXmlVers) { + this.dsUrnXmlVers = dsUrnXmlVers; + return this; + } + + public VrsXmlDatiSessioneVersBuilder idStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + return this; + } + + public VrsXmlDatiSessioneVersBuilder tiXmlDati(String tiXmlDati) { + this.tiXmlDati = tiXmlDati; + return this; + } + + public VrsXmlDatiSessioneVersBuilder flCanonicalized(String flCanonicalized) { + this.flCanonicalized = flCanonicalized; + return this; + } + + public VrsXmlDatiSessioneVersBuilder vrsDatiSessioneVers(Optional vrsDatiSessioneVers) { + this.vrsDatiSessioneVers = vrsDatiSessioneVers; + return this; + } + + public VrsXmlDatiSessioneVersBuilder vrsDatiSessioneVersKo(Optional vrsDatiSessioneVersKo) { + this.vrsDatiSessioneVersKo = vrsDatiSessioneVersKo; + return this; + } + + public VrsXmlDatiSessioneVersBuilder vrsUrnXmlSessioneVers(List vrsUrnXmlSessioneVers) { + this.vrsUrnXmlSessioneVers = vrsUrnXmlSessioneVers; + return this; + } + + public VrsXmlDatiSessioneVersBuilder vrsUrnXmlSessioneVersKo( + List vrsUrnXmlSessioneVersKo) { + this.vrsUrnXmlSessioneVersKo = vrsUrnXmlSessioneVersKo; + return this; + } + + public String getDsUrnXmlVers() { + return dsUrnXmlVers; + } + + public VrsXmlDatiSessioneVers buildVrsXmlDatiSessioneVers() { + VrsXmlDatiSessioneVers vrsXmlDatiSessioneVers = new VrsXmlDatiSessioneVers(); + vrsXmlDatiSessioneVers.setBlXml(blXml); + vrsXmlDatiSessioneVers.setCdEncodingHashXmlVers(cdEncodingHashXmlVers); + vrsXmlDatiSessioneVers.setCdVersioneXml(cdVersioneXml); + vrsXmlDatiSessioneVers.setDsAlgoHashXmlVers(dsAlgoHashXmlVers); + vrsXmlDatiSessioneVers.setDsHashXmlVers(dsHashXmlVers); + vrsXmlDatiSessioneVers.setDsUrnXmlVers(dsUrnXmlVers); + vrsXmlDatiSessioneVers.setIdStrut(idStrut); + vrsXmlDatiSessioneVers.setTiXmlDati(tiXmlDati); + vrsXmlDatiSessioneVers.setFlCanonicalized(flCanonicalized); + vrsXmlDatiSessioneVers.setVrsDatiSessioneVers(vrsDatiSessioneVers.get()); + vrsXmlDatiSessioneVers.setVrsUrnXmlSessioneVers(vrsUrnXmlSessioneVers); + return vrsXmlDatiSessioneVers; + } + + public VrsXmlDatiSessioneVersKo buildVrsXmlDatiSessioneVersKo() { + VrsXmlDatiSessioneVersKo vrsXmlDatiSessioneVers = new VrsXmlDatiSessioneVersKo(); + vrsXmlDatiSessioneVers.setBlXml(blXml); + vrsXmlDatiSessioneVers.setCdEncodingHashXmlVers(cdEncodingHashXmlVers); + vrsXmlDatiSessioneVers.setCdVersioneXml(cdVersioneXml); + vrsXmlDatiSessioneVers.setDsAlgoHashXmlVers(dsAlgoHashXmlVers); + vrsXmlDatiSessioneVers.setDsHashXmlVers(dsHashXmlVers); + vrsXmlDatiSessioneVers.setDsUrnXmlVers(dsUrnXmlVers); + vrsXmlDatiSessioneVers.setIdStrut(idStrut); + vrsXmlDatiSessioneVers.setTiXmlDati(tiXmlDati); + vrsXmlDatiSessioneVers.setFlCanonicalized(flCanonicalized); + vrsXmlDatiSessioneVers.setVrsDatiSessioneVersKo(vrsDatiSessioneVersKo.get()); + vrsXmlDatiSessioneVers.setVrsUrnXmlSessioneVersKo(vrsUrnXmlSessioneVersKo); + return vrsXmlDatiSessioneVers; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AplValoreParamApplic.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AplValoreParamApplic.java new file mode 100644 index 0000000..fd519c4 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AplValoreParamApplic.java @@ -0,0 +1,33 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * + * @author gilioli_p + */ +public final class AplValoreParamApplic { + + private AplValoreParamApplic() { + } + + public enum TiAppart { + AMBIENTE, APPLIC, STRUT, PERIODO_TIPO_FASC, TIPO_UNITA_DOC + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroCompUrnCalc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroCompUrnCalc.java new file mode 100644 index 0000000..308ff9d --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroCompUrnCalc.java @@ -0,0 +1,33 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * + * @author Iacolucci_M + */ +public final class AroCompUrnCalc { + + private AroCompUrnCalc() { + } + + public enum TiUrn { + ORIGINALE, NORMALIZZATO, INIZIALE + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroUpdDatiSpecUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroUpdDatiSpecUnitaDoc.java new file mode 100644 index 0000000..59bb74c --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroUpdDatiSpecUnitaDoc.java @@ -0,0 +1,47 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * ARO_UPD_DATI_SPEC_UNITA_DOC's constraint + * + * @author sinatti_s + */ +public final class AroUpdDatiSpecUnitaDoc { + + private AroUpdDatiSpecUnitaDoc() { + } + + /** + * Uso vers. XSD + * + * ti_uso_xsd IN ('MIGRAZ', 'VERS') + */ + public enum TiUsoXsdAroUpdDatiSpecUnitaDoc { + MIGRAZ, VERS + } + + /** + * Tipo entita SACER + * + * ti_entita_sacer IN ('UPD_COMP', 'UPD_DOC', 'UPD_UNI_DOC') + */ + public enum TiEntitaAroUpdDatiSpecUnitaDoc { + UPD_COMP, UPD_DOC, UPD_UNI_DOC + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroUpdUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroUpdUnitaDoc.java new file mode 100644 index 0000000..da0f823 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroUpdUnitaDoc.java @@ -0,0 +1,47 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * ARO_UPD_UNITA_DOC's constraint + * + * @author sinatti_s + */ +public final class AroUpdUnitaDoc { + + private AroUpdUnitaDoc() { + } + + /** + * Stato UD in conservazione + * + * " ti_stato_udp_elenco_vers IN ('IN_ATTESA_SCHED', 'IN_ELENCO_APERTO', 'IN_ELENCO_CHIUSO', 'IN_ELENCO_COMPLETATO', + * 'IN_ELENCO_CON_INDICI_AIP_GENERATI', 'IN_ELENCO_DA_CHIUDERE', 'IN_ELENCO_VALIDATO', + * 'IN_ELENCO_IN_CODA_INDICE_AIP', 'NON_SELEZ_SCHED', 'IN_ELENCO_CON_ELENCO_INDICI_AIP_CREATO', + * 'IN_ELENCO_CON_ELENCO_INDICI_AIP_ERR_MARCA', 'IN_ELENCO_CON_ELENCO_INDICI_AIP_FIRMATO', + * 'IN_ELENCO_CON_FIRME_VERIFICATE_DT_VERS', 'IN_CODA_JMS_VERIFICA_FIRME_DT_VERS', + * 'IN_CODA_JMS_INDICE_AIP_DA_ELAB')" + */ + public enum AroUpdUDTiStatoUpdElencoVers { + IN_ATTESA_SCHED, IN_ELENCO_APERTO, IN_ELENCO_CHIUSO, IN_ELENCO_COMPLETATO, IN_ELENCO_CON_INDICI_AIP_GENERATI, + IN_ELENCO_DA_CHIUDERE, IN_ELENCO_VALIDATO, IN_ELENCO_IN_CODA_INDICE_AIP, NON_SELEZ_SCHED, + IN_ELENCO_CON_ELENCO_INDICI_AIP_CREATO, IN_ELENCO_CON_ELENCO_INDICI_AIP_ERR_MARCA, + IN_ELENCO_CON_ELENCO_INDICI_AIP_FIRMATO, IN_ELENCO_CON_FIRME_VERIFICATE_DT_VERS, + IN_CODA_JMS_VERIFICA_FIRME_DT_VERS, IN_CODA_JMS_INDICE_AIP_DA_ELAB + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroVersIniDatiSpec.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroVersIniDatiSpec.java new file mode 100644 index 0000000..0eb41bc --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroVersIniDatiSpec.java @@ -0,0 +1,47 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * ARO_VERS_INI_DATI_SPEC's constraint + * + * @author sinatti_s + */ +public final class AroVersIniDatiSpec { + + private AroVersIniDatiSpec() { + } + + /** + * Uso vers. XSD + * + * ti_uso_xsd IN ('MIGRAZ', 'VERS') + */ + public enum TiUsoXsdAroVersIniDatiSpec { + MIGRAZ, VERS + } + + /** + * Tipo entita SACER + * + * ti_entita_sacer IN ('COMP', 'DOC', 'UNI_DOC') + */ + public enum TiEntitaSacerAroVersIniDatiSpec { + COMP, DOC, UNI_DOC + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroXmlUpdUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroXmlUpdUnitaDoc.java new file mode 100644 index 0000000..abd043e --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/AroXmlUpdUnitaDoc.java @@ -0,0 +1,39 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * ARO_XML_UPD_UNITA_DOC's constraint + * + * @author sinatti_s + */ +public final class AroXmlUpdUnitaDoc { + + private AroXmlUpdUnitaDoc() { + } + + /** + * Tipo XML UD + * + * ti_xml_upd_unita_doc IN ('RICHIESTA', 'RISPOSTA') + */ + public enum TiXmlUpdUnitaDoc { + RICHIESTA, RISPOSTA + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecModelloXsdFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecModelloXsdFascicolo.java new file mode 100644 index 0000000..df1b8dc --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecModelloXsdFascicolo.java @@ -0,0 +1,44 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * DecModelloXsdFascicolo's constraint + * + */ +public final class DecModelloXsdFascicolo { + + private DecModelloXsdFascicolo() { + } + + /** + * Tipo modello Xsd fascicolo + */ + public enum TiModelloXsd { + FASCICOLO, PROFILO_GENERALE_FASCICOLO, PROFILO_ARCHIVISTICO_FASCICOLO, PROFILO_SPECIFICO_FASCICOLO, + AIP_SELF_DESCRIPTION_MORE_INFO, AIP_UNISYNCRO, PROFILO_NORMATIVO_FASCICOLO + } + + /** + * Tipo uso modello Xsd fascicolo + */ + public enum TiUsoModelloXsd { + MIGRAZ, VERS + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecModelloXsdUd.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecModelloXsdUd.java new file mode 100644 index 0000000..25399bf --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecModelloXsdUd.java @@ -0,0 +1,29 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +public final class DecModelloXsdUd { + + private DecModelloXsdUd() { + } + + public enum TiModelloXsdUd { + PROFILO_NORMATIVO_UNITA_DOC + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecReportServizioVerificaCompDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecReportServizioVerificaCompDoc.java new file mode 100644 index 0000000..57b50a9 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecReportServizioVerificaCompDoc.java @@ -0,0 +1,33 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +public final class DecReportServizioVerificaCompDoc { + + private DecReportServizioVerificaCompDoc() { + } + + public enum TiReportServizioVerificaCompDoc { + CRYPTO, SIMPLE, DETAILED, DIAG_DATA, ORIG + } + + public enum TiFormatoServizioVerificaCompDoc { + XML, HTML, PDF + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecServizioVerificaCompDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecServizioVerificaCompDoc.java new file mode 100644 index 0000000..2f59043 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/DecServizioVerificaCompDoc.java @@ -0,0 +1,29 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +public final class DecServizioVerificaCompDoc { + + private DecServizioVerificaCompDoc() { + } + + public enum CdServizioVerificaCompDoc { + EIDAS, CRYPTO + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/ElvFascDaElabElenco.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/ElvFascDaElabElenco.java new file mode 100644 index 0000000..87030d6 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/ElvFascDaElabElenco.java @@ -0,0 +1,36 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * ElvFascDaElabElenco constraint + * + * @author sinatti_s + */ +public final class ElvFascDaElabElenco { + + private ElvFascDaElabElenco() { + } + + /** + * Tipo stato da elaborare ti_stato_fasc_da_elab IN ('IN_ATTESA_SCHED', 'NON_SELEZ_SCHED') + */ + public enum TiStatoFascDaElab { + IN_ATTESA_SCHED, NON_SELEZ_SCHED + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/ElvStatoElencoVer.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/ElvStatoElencoVer.java new file mode 100644 index 0000000..ab1a06c --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/ElvStatoElencoVer.java @@ -0,0 +1,37 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * ElvStatoElencoVers constraint + * + * @author DiLorenzo_F + */ +public final class ElvStatoElencoVer { + + private ElvStatoElencoVer() { + } + + public enum TiStatoElenco { + APERTO, CHIUSO, COMPLETATO, DA_CHIUDERE, ELENCO_INDICI_AIP_CREATO, ELENCO_INDICI_AIP_ERR_MARCA, + ELENCO_INDICI_AIP_FIRMATO, ELENCO_INDICI_AIP_FIRMA_IN_CORSO, FIRMA_IN_CORSO, FIRME_VERIFICATE_DT_VERS, + INDICI_AIP_GENERATI, IN_CODA_INDICE_AIP, IN_CODA_JMS_INDICE_AIP_DA_ELAB, IN_CODA_JMS_VERIFICA_FIRME_DT_VERS, + VALIDATO + + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/ElvUpdUdDaElabElenco.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/ElvUpdUdDaElabElenco.java new file mode 100644 index 0000000..17134b4 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/ElvUpdUdDaElabElenco.java @@ -0,0 +1,39 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * ELV_UD_VERS_DA_ELAB_ELENCO's constraint + * + * @author sinatti_s + */ +public final class ElvUpdUdDaElabElenco { + + private ElvUpdUdDaElabElenco() { + } + + /** + * Stato elenco + * + * ti_stato_upd_elenco_vers IN ('IN_ATTESA_SCHED', 'NON_SELEZ_SCHED') + */ + public enum ElvUpdUdDaElabTiStatoUpdElencoVers { + IN_ATTESA_SCHED, NON_SELEZ_SCHED + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasFascicolo.java new file mode 100644 index 0000000..405fc6b --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasFascicolo.java @@ -0,0 +1,74 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * FasFascicolo's constraint + * + * @author Moretti_Lu + */ +public final class FasFascicolo { + + private FasFascicolo() { + } + + /** + * Tipo di conservazione + */ + public enum TiConservazione { + IN_ARCHIVIO, MIGRAZIONE, VERSAMENTO_ANTICIPATO + } + + /** + * Stato di conservazione + */ + public enum TiStatoConservazione { + PRESA_IN_CARICO, AIP_IN_AGGIORNAMENTO, AIP_GENERATO, ANNULLATO, IN_ARCHIVIO, VERSAMENTO_IN_ARCHIVIO + } + + /** + * Stato di conservazione con stato <> ANNULLATO + */ + public enum TiStatoConservazioneNonAnnullato { + PRESA_IN_CARICO, AIP_IN_AGGIORNAMENTO, AIP_GENERATO, IN_ARCHIVIO, VERSAMENTO_IN_ARCHIVIO + } + + // /** + // * Stato dei fascicoli in conservazione + // */ + // public enum TiStatoFascElencoVers { + // IN_ATTESA_SCHED, + // IN_ELENCO_APERTO, + // IN_ELENCO_CHIUSO, + // IN_ELENCO_CON_INDICI_AIP_GENERATI, + // IN_ELENCO_DA_CHIUDERE, + // IN_ELENCO_FIRMATO, + // IN_ELENCO_IN_CODA_INDICE_AIP, + // NON_SELEZ_SCHED + // } + + /** + * Stato dei fascicoli in conservazione + */ + public enum TiStatoFascElencoVers { + IN_ATTESA_SCHED, IN_ELENCO_APERTO, IN_ELENCO_CHIUSO, IN_ELENCO_COMPLETATO, IN_ELENCO_CON_AIP_CREATO, + IN_ELENCO_CON_ELENCO_INDICI_AIP_CREATO, IN_ELENCO_DA_CHIUDERE, IN_ELENCO_FIRMATO, + IN_ELENCO_IN_CODA_CREAZIONE_AIP, NON_SELEZ_SCHED + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasRespFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasRespFascicolo.java new file mode 100644 index 0000000..bbdb59c --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasRespFascicolo.java @@ -0,0 +1,36 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * FasRespFascicolo's constraint + * + * @author Moretti_Lu + */ +public final class FasRespFascicolo { + + private FasRespFascicolo() { + } + + /** + * Tipo oggetto responsabile + */ + public enum TiOggResp { + FASCICOLO, PROC_AMMIN + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasStatoConservFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasStatoConservFascicolo.java new file mode 100644 index 0000000..2841167 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasStatoConservFascicolo.java @@ -0,0 +1,34 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * FasStatoConservFascicolo constraint + * + * @author sinatti_s + * + */ +public final class FasStatoConservFascicolo { + + private FasStatoConservFascicolo() { + } + + public enum TiStatoConservazione { + AIP_GENERATO, AIP_IN_AGGIORNAMENTO, ANNULLATO, IN_ARCHIVIO, PRESA_IN_CARICO, VERSAMENTO_IN_ARCHIVIO + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasStatoFascicoloElenco.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasStatoFascicoloElenco.java new file mode 100644 index 0000000..9cc91fd --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasStatoFascicoloElenco.java @@ -0,0 +1,36 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * FasStatoFascicoloElenco constraint + * + * @author sinatti_s + * + */ +public final class FasStatoFascicoloElenco { + + private FasStatoFascicoloElenco() { + } + + public enum TiStatoFascElenco { + IN_ATTESA_SCHED, IN_ELENCO_APERTO, IN_ELENCO_CHIUSO, IN_ELENCO_COMPLETATO, IN_ELENCO_CON_AIP_CREATO, + IN_ELENCO_CON_ELENCO_INDICI_AIP_CREATO, IN_ELENCO_DA_CHIUDERE, IN_ELENCO_FIRMATO, + IN_ELENCO_IN_CODA_CREAZIONE_AIP, NON_SELEZ_SCHED + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasXmlFascicolo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasXmlFascicolo.java new file mode 100644 index 0000000..3d6e54c --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FasXmlFascicolo.java @@ -0,0 +1,41 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * VRS_UPD_UNITA_DOC_KO's constraint + * + * @author sinatti_s + */ +public final class FasXmlFascicolo { + + private FasXmlFascicolo() { + } + + /** + * Tipi modelli + * + * ti_modello_xsd IN ('PROFILO_GENERALE_FASCICOLO', 'PROFILO_ARCHIVISTICO_FASCICOLO', + * 'PROFILO_SPECIFICO_FASCICOLO','PROFILO_NORMATIVO_FASCICOLO') + */ + public enum TiModXsdFasXmlFascicolo { + PROFILO_GENERALE_FASCICOLO, PROFILO_ARCHIVISTICO_FASCICOLO, PROFILO_SPECIFICO_FASCICOLO, + PROFILO_NORMATIVO_FASCICOLO + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FiUrnReport.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FiUrnReport.java new file mode 100644 index 0000000..9daaf66 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/FiUrnReport.java @@ -0,0 +1,29 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +public final class FiUrnReport { + + private FiUrnReport() { + } + + public enum TiUrnReport { + NORMALIZZATO, ORIGINALE + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/MonContaSesUpdUd.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/MonContaSesUpdUd.java new file mode 100644 index 0000000..c561cc1 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/MonContaSesUpdUd.java @@ -0,0 +1,43 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package it.eng.parer.entity.constraint; + +/** + * + * @author gilioli_p + */ +public final class MonContaSesUpdUd { + + private MonContaSesUpdUd() { + } + + /** + * Stato Update + * + * ti_stato_udp_ud_ IN ('IN_ATTESA_SCHED', 'NON_SELEZ_SCHED', 'TOTALE') + */ + public enum TiStatoUdpUdMonContaSesUpdUd { + IN_ATTESA_SCHED, NON_SELEZ_SCHED, TOTALE + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/MonContaSesUpdUdKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/MonContaSesUpdUdKo.java new file mode 100644 index 0000000..d83d6c9 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/MonContaSesUpdUdKo.java @@ -0,0 +1,39 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * MON_CONTA_SES_UPD_UD_KO's constraint + * + * @author sinatti_s + */ +public final class MonContaSesUpdUdKo { + + private MonContaSesUpdUdKo() { + } + + /** + * Stato Update KO + * + * ti_stato_udp_ud_ko IN ('NON_RISOLUBILE', 'NON_VERIFICATO', 'RISOLTO', 'VERIFICATO') + */ + public enum TiStatoUdpUdKoMonContaSesUpdUdKo { + NON_RISOLUBILE, NON_VERIFICATO, RISOLTO, VERIFICATO + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/SIOrgEnteSiam.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/SIOrgEnteSiam.java new file mode 100644 index 0000000..b100fa8 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/SIOrgEnteSiam.java @@ -0,0 +1,51 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * + * @author Gilioli_P + */ +public class SIOrgEnteSiam { + + private SIOrgEnteSiam() { + } + + public static String[] tiCdEnteConvenz = { "Altro", "IPA Ente/AOO", "IPA Ente", "ISTAT" }; + + /** + * Tipo ente siam ti_ente_siam IN ('CONVENZIONATO', 'NON_CONVENZIONATO') + */ + public enum TiEnteSiam { + CONVENZIONATO, NON_CONVENZIONATO + } + + /** + * Tipo ente convenzionato ti_ente_convenz IN ('AMMINISTRATORE', 'CONSERVATORE', 'GESTORE', 'PRODUTTORE') + */ + public enum TiEnteConvenz { + AMMINISTRATORE, CONSERVATORE, GESTORE, PRODUTTORE + } + + /** + * Tipo ente non convenzionato ti_ente_non_convenz IN ('FORNITORE_ESTERNO', 'ORGANO_VIGILANZA', 'VERSATORE_ESTERNO') + */ + public enum TiEnteNonConvenz { + FORNITORE_ESTERNO, ORGANO_VIGILANZA, VERSATORE_ESTERNO + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/SerUrnFileVerSerie.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/SerUrnFileVerSerie.java new file mode 100644 index 0000000..a2f8510 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/SerUrnFileVerSerie.java @@ -0,0 +1,33 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * + * @author DiLorenzo_F + */ +public final class SerUrnFileVerSerie { + + private SerUrnFileVerSerie() { + } + + public enum TiUrnFileVerSerie { + ORIGINALE, NORMALIZZATO, INIZIALE + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsErrSesUpdUnitaDocErr.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsErrSesUpdUnitaDocErr.java new file mode 100644 index 0000000..92a485c --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsErrSesUpdUnitaDocErr.java @@ -0,0 +1,39 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * VRS_ERR_UPD_UNITA_DOC_KO's constraint + * + * @author sinatti_s + */ +public final class VrsErrSesUpdUnitaDocErr { + + private VrsErrSesUpdUnitaDocErr() { + } + + /** + * Tipo errore + * + * ti_err IN ('FATALE', 'WARNING') + */ + public enum TiErrVrsErrSesUpdUnitaDocErr { + FATALE, WARNING + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsErrUpdUnitaDocKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsErrUpdUnitaDocKo.java new file mode 100644 index 0000000..a64d77f --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsErrUpdUnitaDocKo.java @@ -0,0 +1,39 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * VRS_ERR_UPD_UNITA_DOC_KO's constraint + * + * @author sinatti_s + */ +public final class VrsErrUpdUnitaDocKo { + + private VrsErrUpdUnitaDocKo() { + } + + /** + * Tipo errore + * + * ti_err IN ('FATALE', 'WARNING') + */ + public enum TiErrVrsErrUpdUnitaDocKo { + FATALE, WARNING + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsSesUpdUnitaDocErr.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsSesUpdUnitaDocErr.java new file mode 100644 index 0000000..fcb4225 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsSesUpdUnitaDocErr.java @@ -0,0 +1,36 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * VRS_SES_UPD_UNITA_DOC_KO constraint + * + * @author sinatti_s + */ +public final class VrsSesUpdUnitaDocErr { + + private VrsSesUpdUnitaDocErr() { + } + + /** + * Stato sessione ti_stato_ses IN ('NON_RISOLUBILE', 'NON_VERIFICATA', 'VERIFICATA') + */ + public enum TiStatoSesVrsSesUpdUnitaDocErr { + NON_RISOLUBILE, NON_VERIFICATA, VERIFICATA + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsSesUpdUnitaDocKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsSesUpdUnitaDocKo.java new file mode 100644 index 0000000..639dca5 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsSesUpdUnitaDocKo.java @@ -0,0 +1,36 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * VRS_SES_UPD_UNITA_DOC_KO constraint + * + * @author sinatti_s + */ +public final class VrsSesUpdUnitaDocKo { + + private VrsSesUpdUnitaDocKo() { + } + + /** + * Stato sessione ti_stato_ses_upd_ko IN ('NON_RISOLUBILE', 'NON_VERIFICATO', 'RISOLTO', 'VERIFICATO') + */ + public enum TiStatoSesUpdKo { + NON_RISOLUBILE, NON_VERIFICATO, RISOLTO, VERIFICATO + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsUpdUnitaDocKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsUpdUnitaDocKo.java new file mode 100644 index 0000000..c3bb99f --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsUpdUnitaDocKo.java @@ -0,0 +1,39 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * VRS_UPD_UNITA_DOC_KO's constraint + * + * @author sinatti_s + */ +public final class VrsUpdUnitaDocKo { + + private VrsUpdUnitaDocKo() { + } + + /** + * Stato Ko + * + * ti_stato_udp_ud_ko IN ('NON_RISOLUBILE', 'NON_VERIFICATO', 'VERIFICATO') + */ + public enum TiStatoUdpUdKo { + NON_RISOLUBILE, NON_VERIFICATO, VERIFICATO + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsUrnXmlSessioneVers.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsUrnXmlSessioneVers.java new file mode 100644 index 0000000..ab6e1f8 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsUrnXmlSessioneVers.java @@ -0,0 +1,33 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * + * @author sinatti_s + */ +public final class VrsUrnXmlSessioneVers { + + private VrsUrnXmlSessioneVers() { + } + + public enum TiUrnXmlSessioneVers { + ORIGINALE, NORMALIZZATO, INIZIALE + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsXmlSesUpdUnitaDocErr.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsXmlSesUpdUnitaDocErr.java new file mode 100644 index 0000000..f9588b5 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsXmlSesUpdUnitaDocErr.java @@ -0,0 +1,39 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * VRS_XML_SES_UPD_UNITA_DOC_ERR's constraint + * + * @author sinatti_s + */ +public final class VrsXmlSesUpdUnitaDocErr { + + private VrsXmlSesUpdUnitaDocErr() { + } + + /** + * Tipo XML + * + * ti_xml IN ('RICHIESTA', 'RISPOSTA') + */ + public enum TiXmlVrsXmlSesUpdUnitaDocErr { + RICHIESTA, RISPOSTA + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsXmlSesUpdUnitaDocKo.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsXmlSesUpdUnitaDocKo.java new file mode 100644 index 0000000..12973f6 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/constraint/VrsXmlSesUpdUnitaDocKo.java @@ -0,0 +1,39 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.constraint; + +/** + * VRS_XML_SES_UPD_UNITA_DOC_KO's constraint + * + * @author sinatti_s + */ +public final class VrsXmlSesUpdUnitaDocKo { + + private VrsXmlSesUpdUnitaDocKo() { + } + + /** + * Tipo XML + * + * ti_xml IN ('RICHIESTA', 'RISPOSTA') + */ + public enum TiXmlVrsXmlSesUpdUnitaDocKo { + RICHIESTA, RISPOSTA + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/converter/NeverendingDateConverter.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/converter/NeverendingDateConverter.java new file mode 100644 index 0000000..77f7b81 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/converter/NeverendingDateConverter.java @@ -0,0 +1,96 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.converter; + +import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.Month; +import java.time.ZoneId; +import java.util.Date; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class NeverendingDateConverter { + + private static final Logger LOG = LoggerFactory.getLogger(NeverendingDateConverter.class); + + /* + * MAX DATE supported by Oracle DB + * + * https://www.techonthenet.com/oracle/datatypes.php + */ + public static final LocalDateTime NEVERENDING = LocalDateTime.of(9999, Month.DECEMBER, 31, 23, 59, 59); + + /** + * Verifica se una certa data (ZoneId di sistema) convertita con lo zoneIdToCheck se oltre la data massima permessa + * NEVERENDING altrimenti restituisce NEVERENDING + * + * @param dateToCheck + * data da verificare + * @param zoneIdToCheck + * id Locale + * + * @return date + */ + public static Date verifyOverZoneId(Date dateToCheck, ZoneId zoneIdToCheck) { + // equals OR after + Date dateToCheckOverZid = convert(dateToCheck, zoneIdToCheck); + if (dateToCheckOverZid.equals(asDate(NEVERENDING)) || dateToCheckOverZid.after(asDate(NEVERENDING))) { + LOG.warn("Data: " + dateToCheck + " oltre il limite massimo consentito " + NEVERENDING); + return asDate(NEVERENDING); + } + return dateToCheck; + } + + /** + * Come sopra ma con il default ZoneId + * + * @param dateToCheck + * da verificare + * + * @return date da verificare + */ + public static Date verifyOverZoneId(Date dateToCheck) { + return verifyOverZoneId(dateToCheck, ZoneId.systemDefault()); + } + + private static Date convert(Date dateToCheck, ZoneId zid) { + return asDate(asLocalDateTime(dateToCheck, zid)); + } + + private static Date asDate(LocalDateTime localDateTime) { + return asDate(localDateTime, ZoneId.systemDefault()); + } + + private static Date asDate(LocalDateTime localDateTime, ZoneId zid) { + return Date.from(localDateTime.atZone(zid).toInstant()); + } + + private static LocalDate asLocalDate(Date date) { + return Instant.ofEpochMilli(date.getTime()).atZone(ZoneId.systemDefault()).toLocalDate(); + } + + private static LocalDateTime asLocalDateTime(Date date) { + return asLocalDateTime(date, ZoneId.systemDefault()); + } + + private static LocalDateTime asLocalDateTime(Date date, ZoneId zid) { + return Instant.ofEpochMilli(date.getTime()).atZone(zid).toLocalDateTime(); + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/inheritance/oop/AroXmlObjectStorage.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/inheritance/oop/AroXmlObjectStorage.java new file mode 100644 index 0000000..76e94a1 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/inheritance/oop/AroXmlObjectStorage.java @@ -0,0 +1,81 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.inheritance.oop; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.FetchType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.MappedSuperclass; + +import it.eng.parer.entity.DecBackend; + +@MappedSuperclass +public class AroXmlObjectStorage implements Serializable { + + private static final long serialVersionUID = 1L; + + public AroXmlObjectStorage() { + super(); + } + + private DecBackend decBackend; + private String nmTenant; + private String nmBucket; + private String cdKeyFile; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_DEC_BACKEND") + public DecBackend getDecBackend() { + return decBackend; + } + + public void setDecBackend(DecBackend decBackend) { + this.decBackend = decBackend; + } + + @Column(name = "NM_TENANT") + public String getNmTenant() { + return nmTenant; + } + + public void setNmTenant(String nmTenant) { + this.nmTenant = nmTenant; + } + + @Column(name = "NM_BUCKET") + public String getNmBucket() { + return nmBucket; + } + + public void setNmBucket(String nmBucket) { + this.nmBucket = nmBucket; + } + + @Column(name = "CD_KEY_FILE") + public String getCdKeyFile() { + return cdKeyFile; + } + + public void setCdKeyFile(String cdKeyFile) { + this.cdKeyFile = cdKeyFile; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/entity/inheritance/oop/ElvUdDocUpdDaElabElenco.java b/sacerws-jpa/src/main/java/it/eng/parer/entity/inheritance/oop/ElvUdDocUpdDaElabElenco.java new file mode 100644 index 0000000..6702d97 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/entity/inheritance/oop/ElvUdDocUpdDaElabElenco.java @@ -0,0 +1,67 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.entity.inheritance.oop; + +import java.io.Serializable; +import javax.persistence.*; +import java.math.BigDecimal; +import java.util.Date; + +@MappedSuperclass +public abstract class ElvUdDocUpdDaElabElenco implements Serializable { + + private static final long serialVersionUID = 1L; + + private T udDocUpdObj; + + private BigDecimal aaKeyUnitaDoc; + + private Date dtCreazione; + + public ElvUdDocUpdDaElabElenco() {/* Hibernate */ + } + + // bi-directional many-to-one association to T + @ManyToOne(fetch = FetchType.LAZY) + public T getUdDocUpdObj() { + return this.udDocUpdObj; + } + + public void setUdDocUpdObj(T udDocUpdObj) { + this.udDocUpdObj = udDocUpdObj; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return this.aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_CREAZIONE") + public Date getDtCreazione() { + return this.dtCreazione; + } + + public void setDtCreazione(Date dtCreazione) { + this.dtCreazione = dtCreazione; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/granted_entity/UsrUser.java b/sacerws-jpa/src/main/java/it/eng/parer/granted_entity/UsrUser.java new file mode 100644 index 0000000..0497dca --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/granted_entity/UsrUser.java @@ -0,0 +1,228 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.granted_entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import it.eng.parer.entity.AplSistemaVersante; + +/** + * The persistent class for the USR_USER database table. + */ +@Entity +@Table(name = "USR_USER", schema = "SACER_IAM") +public class UsrUser implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUserIam; + + private String cdFisc; + + private String cdPsw; + + private String cdSalt; + + private String dsEmail; + + private Date dtRegPsw; + + private Date dtScadPsw; + + private String flAttivo; + + private String flContrIp; + + private String flUserAdmin; + + private String nmCognomeUser; + + private String nmNomeUser; + + private String nmUserid; + + private String tipoUser; + + private AplSistemaVersante aplSistemaVersante; + + private BigDecimal idStatoUserCor; + + public UsrUser() {/* Hibernate */ + } + + @Id + @Column(name = "ID_USER_IAM") + public Long getIdUserIam() { + return this.idUserIam; + } + + public void setIdUserIam(Long idUserIam) { + this.idUserIam = idUserIam; + } + + @Column(name = "CD_FISC") + public String getCdFisc() { + return this.cdFisc; + } + + public void setCdFisc(String cdFisc) { + this.cdFisc = cdFisc; + } + + @Column(name = "CD_PSW") + public String getCdPsw() { + return this.cdPsw; + } + + public void setCdPsw(String cdPsw) { + this.cdPsw = cdPsw; + } + + @Column(name = "CD_SALT") + public String getCdSalt() { + return this.cdSalt; + } + + public void setCdSalt(String cdSalt) { + this.cdSalt = cdSalt; + } + + @Column(name = "DS_EMAIL") + public String getDsEmail() { + return this.dsEmail; + } + + public void setDsEmail(String dsEmail) { + this.dsEmail = dsEmail; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_REG_PSW") + public Date getDtRegPsw() { + return this.dtRegPsw; + } + + public void setDtRegPsw(Date dtRegPsw) { + this.dtRegPsw = dtRegPsw; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_SCAD_PSW") + public Date getDtScadPsw() { + return this.dtScadPsw; + } + + public void setDtScadPsw(Date dtScadPsw) { + this.dtScadPsw = dtScadPsw; + } + + @Column(name = "FL_ATTIVO", columnDefinition = "char(1)") + public String getFlAttivo() { + return this.flAttivo; + } + + public void setFlAttivo(String flAttivo) { + this.flAttivo = flAttivo; + } + + @Column(name = "FL_CONTR_IP", columnDefinition = "char(1)") + public String getFlContrIp() { + return this.flContrIp; + } + + public void setFlContrIp(String flContrIp) { + this.flContrIp = flContrIp; + } + + @Column(name = "FL_USER_ADMIN", columnDefinition = "char(1)") + public String getFlUserAdmin() { + return this.flUserAdmin; + } + + public void setFlUserAdmin(String flUserAdmin) { + this.flUserAdmin = flUserAdmin; + } + + @Column(name = "NM_COGNOME_USER") + public String getNmCognomeUser() { + return this.nmCognomeUser; + } + + public void setNmCognomeUser(String nmCognomeUser) { + this.nmCognomeUser = nmCognomeUser; + } + + @Column(name = "NM_NOME_USER") + public String getNmNomeUser() { + return this.nmNomeUser; + } + + public void setNmNomeUser(String nmNomeUser) { + this.nmNomeUser = nmNomeUser; + } + + @Column(name = "NM_USERID") + public String getNmUserid() { + return this.nmUserid; + } + + public void setNmUserid(String nmUserid) { + this.nmUserid = nmUserid; + } + + @Column(name = "TIPO_USER") + public String getTipoUser() { + return this.tipoUser; + } + + public void setTipoUser(String tipoUser) { + this.tipoUser = tipoUser; + } + + // bi-directional many-to-one association to AplSistemaVersante + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SISTEMA_VERSANTE") + public AplSistemaVersante getAplSistemaVersante() { + return this.aplSistemaVersante; + } + + public void setAplSistemaVersante(AplSistemaVersante aplSistemaVersante) { + this.aplSistemaVersante = aplSistemaVersante; + } + + @Column(name = "ID_STATO_USER_COR") + public BigDecimal getIdStatoUserCor() { + return this.idStatoUserCor; + } + + public void setIdStatoUserCor(BigDecimal idStatoUserCor) { + this.idStatoUserCor = idStatoUserCor; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByAatifasc.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByAatifasc.java new file mode 100644 index 0000000..d9a49ea --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByAatifasc.java @@ -0,0 +1,168 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * The persistent class for the APL_V_GETVAL_PARAM_BY_AATIFASC database table. + * + */ +@Entity +@Table(name = "APL_V_GETVAL_PARAM_BY_AATIFASC") +public class AplVGetvalParamByAatifasc implements Serializable { + + private static final long serialVersionUID = 1L; + private BigDecimal aaIniTipoFascicolo; + private String dsValoreParamApplic; + private BigDecimal idAaTipoFascicolo; + private BigDecimal idEnte; + private BigDecimal idParamApplic; + private BigDecimal idStrut; + private BigDecimal idTipoFascicolo; + private BigDecimal idValoreParamApplic; + private String nmEnte; + private String nmParamApplic; + private String nmStrut; + private String nmTipoFascicolo; + private String tiAppart; + + public AplVGetvalParamByAatifasc() {/* Hibernate */ + } + + @Column(name = "AA_INI_TIPO_FASCICOLO") + public BigDecimal getAaIniTipoFascicolo() { + return this.aaIniTipoFascicolo; + } + + public void setAaIniTipoFascicolo(BigDecimal aaIniTipoFascicolo) { + this.aaIniTipoFascicolo = aaIniTipoFascicolo; + } + + @Column(name = "DS_VALORE_PARAM_APPLIC") + public String getDsValoreParamApplic() { + return this.dsValoreParamApplic; + } + + public void setDsValoreParamApplic(String dsValoreParamApplic) { + this.dsValoreParamApplic = dsValoreParamApplic; + } + + @Column(name = "ID_AA_TIPO_FASCICOLO") + public BigDecimal getIdAaTipoFascicolo() { + return this.idAaTipoFascicolo; + } + + public void setIdAaTipoFascicolo(BigDecimal idAaTipoFascicolo) { + this.idAaTipoFascicolo = idAaTipoFascicolo; + } + + @Column(name = "ID_ENTE") + public BigDecimal getIdEnte() { + return this.idEnte; + } + + public void setIdEnte(BigDecimal idEnte) { + this.idEnte = idEnte; + } + + @Column(name = "ID_PARAM_APPLIC") + public BigDecimal getIdParamApplic() { + return this.idParamApplic; + } + + public void setIdParamApplic(BigDecimal idParamApplic) { + this.idParamApplic = idParamApplic; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "ID_TIPO_FASCICOLO") + public BigDecimal getIdTipoFascicolo() { + return this.idTipoFascicolo; + } + + public void setIdTipoFascicolo(BigDecimal idTipoFascicolo) { + this.idTipoFascicolo = idTipoFascicolo; + } + + @Id + @Column(name = "ID_VALORE_PARAM_APPLIC") + public BigDecimal getIdValoreParamApplic() { + return this.idValoreParamApplic; + } + + public void setIdValoreParamApplic(BigDecimal idValoreParamApplic) { + this.idValoreParamApplic = idValoreParamApplic; + } + + @Column(name = "NM_ENTE") + public String getNmEnte() { + return this.nmEnte; + } + + public void setNmEnte(String nmEnte) { + this.nmEnte = nmEnte; + } + + @Column(name = "NM_PARAM_APPLIC") + public String getNmParamApplic() { + return this.nmParamApplic; + } + + public void setNmParamApplic(String nmParamApplic) { + this.nmParamApplic = nmParamApplic; + } + + @Column(name = "NM_STRUT") + public String getNmStrut() { + return this.nmStrut; + } + + public void setNmStrut(String nmStrut) { + this.nmStrut = nmStrut; + } + + @Column(name = "NM_TIPO_FASCICOLO") + public String getNmTipoFascicolo() { + return this.nmTipoFascicolo; + } + + public void setNmTipoFascicolo(String nmTipoFascicolo) { + this.nmTipoFascicolo = nmTipoFascicolo; + } + + @Column(name = "TI_APPART") + public String getTiAppart() { + return this.tiAppart; + } + + public void setTiAppart(String tiAppart) { + this.tiAppart = tiAppart; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByAmb.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByAmb.java new file mode 100644 index 0000000..f6466b1 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByAmb.java @@ -0,0 +1,108 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * The persistent class for the APL_V_GETVAL_PARAM_BY_AMB database table. + * + */ +@Entity +@Table(name = "APL_V_GETVAL_PARAM_BY_AMB") +public class AplVGetvalParamByAmb implements Serializable { + + private static final long serialVersionUID = 1L; + private String dsValoreParamApplic; + private BigDecimal idAmbiente; + private BigDecimal idParamApplic; + private BigDecimal idValoreParamApplic; + private String nmAmbiente; + private String nmParamApplic; + private String tiAppart; + + public AplVGetvalParamByAmb() {/* Hibernate */ + } + + @Column(name = "DS_VALORE_PARAM_APPLIC") + public String getDsValoreParamApplic() { + return this.dsValoreParamApplic; + } + + public void setDsValoreParamApplic(String dsValoreParamApplic) { + this.dsValoreParamApplic = dsValoreParamApplic; + } + + @Column(name = "ID_AMBIENTE") + public BigDecimal getIdAmbiente() { + return this.idAmbiente; + } + + public void setIdAmbiente(BigDecimal idAmbiente) { + this.idAmbiente = idAmbiente; + } + + @Column(name = "ID_PARAM_APPLIC") + public BigDecimal getIdParamApplic() { + return this.idParamApplic; + } + + public void setIdParamApplic(BigDecimal idParamApplic) { + this.idParamApplic = idParamApplic; + } + + @Id + @Column(name = "ID_VALORE_PARAM_APPLIC") + public BigDecimal getIdValoreParamApplic() { + return this.idValoreParamApplic; + } + + public void setIdValoreParamApplic(BigDecimal idValoreParamApplic) { + this.idValoreParamApplic = idValoreParamApplic; + } + + @Column(name = "NM_AMBIENTE") + public String getNmAmbiente() { + return this.nmAmbiente; + } + + public void setNmAmbiente(String nmAmbiente) { + this.nmAmbiente = nmAmbiente; + } + + @Column(name = "NM_PARAM_APPLIC") + public String getNmParamApplic() { + return this.nmParamApplic; + } + + public void setNmParamApplic(String nmParamApplic) { + this.nmParamApplic = nmParamApplic; + } + + @Column(name = "TI_APPART") + public String getTiAppart() { + return this.tiAppart; + } + + public void setTiAppart(String tiAppart) { + this.tiAppart = tiAppart; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByApl.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByApl.java new file mode 100644 index 0000000..8991ecb --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByApl.java @@ -0,0 +1,79 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * The persistent class for the APL_V_GETVAL_PARAM_BY_APL database table. + * + */ +@Entity +@Table(name = "APL_V_GETVAL_PARAM_BY_APL") +@NamedQuery(name = "AplVGetvalParamByApl.findAll", query = "SELECT a FROM AplVGetvalParamByApl a") +public class AplVGetvalParamByApl implements Serializable { + + private static final long serialVersionUID = 1L; + private String dsValoreParamApplic; + private BigDecimal idParamApplic; + private BigDecimal idValoreParamApplic; + private String nmParamApplic; + + public AplVGetvalParamByApl() {/* Hibernate */ + } + + @Column(name = "DS_VALORE_PARAM_APPLIC") + public String getDsValoreParamApplic() { + return this.dsValoreParamApplic; + } + + public void setDsValoreParamApplic(String dsValoreParamApplic) { + this.dsValoreParamApplic = dsValoreParamApplic; + } + + @Column(name = "ID_PARAM_APPLIC") + public BigDecimal getIdParamApplic() { + return this.idParamApplic; + } + + public void setIdParamApplic(BigDecimal idParamApplic) { + this.idParamApplic = idParamApplic; + } + + @Id + @Column(name = "ID_VALORE_PARAM_APPLIC") + public BigDecimal getIdValoreParamApplic() { + return this.idValoreParamApplic; + } + + public void setIdValoreParamApplic(BigDecimal idValoreParamApplic) { + this.idValoreParamApplic = idValoreParamApplic; + } + + @Column(name = "NM_PARAM_APPLIC") + public String getNmParamApplic() { + return this.nmParamApplic; + } + + public void setNmParamApplic(String nmParamApplic) { + this.nmParamApplic = nmParamApplic; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByStrut.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByStrut.java new file mode 100644 index 0000000..814a322 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByStrut.java @@ -0,0 +1,132 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * The persistent class for the APL_V_GETVAL_PARAM_BY_STRUT database table. + * + */ +@Entity +@Table(name = "APL_V_GETVAL_PARAM_BY_STRUT") +public class AplVGetvalParamByStrut implements Serializable { + + private static final long serialVersionUID = 1L; + private String dsValoreParamApplic; + private BigDecimal idEnte; + private BigDecimal idParamApplic; + private BigDecimal idStrut; + private BigDecimal idValoreParamApplic; + private String nmEnte; + private String nmParamApplic; + private String nmStrut; + private String tiAppart; + + public AplVGetvalParamByStrut() {/* Hibernate */ + } + + @Column(name = "DS_VALORE_PARAM_APPLIC") + public String getDsValoreParamApplic() { + return this.dsValoreParamApplic; + } + + public void setDsValoreParamApplic(String dsValoreParamApplic) { + this.dsValoreParamApplic = dsValoreParamApplic; + } + + @Column(name = "ID_ENTE") + public BigDecimal getIdEnte() { + return this.idEnte; + } + + public void setIdEnte(BigDecimal idEnte) { + this.idEnte = idEnte; + } + + @Column(name = "ID_PARAM_APPLIC") + public BigDecimal getIdParamApplic() { + return this.idParamApplic; + } + + public void setIdParamApplic(BigDecimal idParamApplic) { + this.idParamApplic = idParamApplic; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Id + @Column(name = "ID_VALORE_PARAM_APPLIC") + public BigDecimal getIdValoreParamApplic() { + return this.idValoreParamApplic; + } + + public void setIdValoreParamApplic(BigDecimal idValoreParamApplic) { + this.idValoreParamApplic = idValoreParamApplic; + } + + @Column(name = "NM_ENTE") + public String getNmEnte() { + return this.nmEnte; + } + + public void setNmEnte(String nmEnte) { + this.nmEnte = nmEnte; + } + + @Column(name = "NM_PARAM_APPLIC") + public String getNmParamApplic() { + return this.nmParamApplic; + } + + public void setNmParamApplic(String nmParamApplic) { + this.nmParamApplic = nmParamApplic; + } + + @Column(name = "NM_STRUT") + public String getNmStrut() { + return this.nmStrut; + } + + public void setNmStrut(String nmStrut) { + this.nmStrut = nmStrut; + } + + @Column(name = "TI_APPART") + public String getTiAppart() { + return this.tiAppart; + } + + public void setTiAppart(String tiAppart) { + this.tiAppart = tiAppart; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByTiud.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByTiud.java new file mode 100644 index 0000000..517af7f --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AplVGetvalParamByTiud.java @@ -0,0 +1,152 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * The persistent class for the APL_V_GETVAL_PARAM_BY_TIUD database table. + * + */ +@Entity +@Table(name = "APL_V_GETVAL_PARAM_BY_TIUD") +public class AplVGetvalParamByTiud implements Serializable { + + private static final long serialVersionUID = 1L; + private String dsValoreParamApplic; + private BigDecimal idEnte; + private BigDecimal idParamApplic; + private BigDecimal idStrut; + private BigDecimal idTipoUnitaDoc; + private BigDecimal idValoreParamApplic; + private String nmEnte; + private String nmParamApplic; + private String nmStrut; + private String nmTipoUnitaDoc; + private String tiAppart; + + public AplVGetvalParamByTiud() {/* Hibernate */ + } + + @Column(name = "DS_VALORE_PARAM_APPLIC") + public String getDsValoreParamApplic() { + return this.dsValoreParamApplic; + } + + public void setDsValoreParamApplic(String dsValoreParamApplic) { + this.dsValoreParamApplic = dsValoreParamApplic; + } + + @Column(name = "ID_ENTE") + public BigDecimal getIdEnte() { + return this.idEnte; + } + + public void setIdEnte(BigDecimal idEnte) { + this.idEnte = idEnte; + } + + @Column(name = "ID_PARAM_APPLIC") + public BigDecimal getIdParamApplic() { + return this.idParamApplic; + } + + public void setIdParamApplic(BigDecimal idParamApplic) { + this.idParamApplic = idParamApplic; + } + + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "ID_TIPO_UNITA_DOC") + public BigDecimal getIdTipoUnitaDoc() { + return this.idTipoUnitaDoc; + } + + public void setIdTipoUnitaDoc(BigDecimal idTipoUnitaDoc) { + this.idTipoUnitaDoc = idTipoUnitaDoc; + } + + @Id + @Column(name = "ID_VALORE_PARAM_APPLIC") + public BigDecimal getIdValoreParamApplic() { + return this.idValoreParamApplic; + } + + public void setIdValoreParamApplic(BigDecimal idValoreParamApplic) { + this.idValoreParamApplic = idValoreParamApplic; + } + + @Column(name = "NM_ENTE") + public String getNmEnte() { + return this.nmEnte; + } + + public void setNmEnte(String nmEnte) { + this.nmEnte = nmEnte; + } + + @Column(name = "NM_PARAM_APPLIC") + public String getNmParamApplic() { + return this.nmParamApplic; + } + + public void setNmParamApplic(String nmParamApplic) { + this.nmParamApplic = nmParamApplic; + } + + @Column(name = "NM_STRUT") + public String getNmStrut() { + return this.nmStrut; + } + + public void setNmStrut(String nmStrut) { + this.nmStrut = nmStrut; + } + + @Column(name = "NM_TIPO_UNITA_DOC") + public String getNmTipoUnitaDoc() { + return this.nmTipoUnitaDoc; + } + + public void setNmTipoUnitaDoc(String nmTipoUnitaDoc) { + this.nmTipoUnitaDoc = nmTipoUnitaDoc; + } + + @Column(name = "TI_APPART") + public String getTiAppart() { + return this.tiAppart; + } + + public void setTiAppart(String tiAppart) { + this.tiAppart = tiAppart; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AroVDtVersMaxByUnitaDoc.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AroVDtVersMaxByUnitaDoc.java new file mode 100644 index 0000000..34e0ce3 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/AroVDtVersMaxByUnitaDoc.java @@ -0,0 +1,71 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * The persistent class for the ARO_V_DT_VERS_MAX_BY_UNITA_DOC database table. + * + */ +@Entity +@Table(name = "ARO_V_DT_VERS_MAX_BY_UNITA_DOC") +public class AroVDtVersMaxByUnitaDoc implements Serializable { + + private static final long serialVersionUID = 1L; + private BigDecimal idUnitaDoc; + private Date dtVersMax; + + public AroVDtVersMaxByUnitaDoc(BigDecimal idUnitaDoc, Date dtVersMax) { + this.idUnitaDoc = idUnitaDoc; + this.dtVersMax = dtVersMax; + } + + public AroVDtVersMaxByUnitaDoc() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UNITA_DOC") + public BigDecimal getIdUnitaDoc() { + return this.idUnitaDoc; + } + + public void setIdUnitaDoc(BigDecimal idUnitaDoc) { + this.idUnitaDoc = idUnitaDoc; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_VERS_MAX") + public Date getDtVersMax() { + return this.dtVersMax; + } + + public void setDtVersMax(Date dtVersMax) { + this.dtVersMax = dtVersMax; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/FasVLisFascByUpdUd.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/FasVLisFascByUpdUd.java new file mode 100644 index 0000000..17fbd95 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/FasVLisFascByUpdUd.java @@ -0,0 +1,49 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; + +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.Table; + +/** + * The persistent class for the FAS_V_LIS_FASC_BY_UPD_UD database table. + * + */ +@Entity +@Table(name = "FAS_V_LIS_FASC_BY_UPD_UD") +public class FasVLisFascByUpdUd implements Serializable { + + private static final long serialVersionUID = 1L; + private FasVLisFascByUpdUdId fasVLisFascByUpdUdId; + + @EmbeddedId + public FasVLisFascByUpdUdId getFasVLisFascByUpdUdId() { + return fasVLisFascByUpdUdId; + } + + public void setFasVLisFascByUpdUdId(FasVLisFascByUpdUdId fasVLisFascByUpdUdId) { + this.fasVLisFascByUpdUdId = fasVLisFascByUpdUdId; + } + + public FasVLisFascByUpdUd() {/* Hibernate */ + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/FasVLisFascByUpdUdId.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/FasVLisFascByUpdUdId.java new file mode 100644 index 0000000..ca6e575 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/FasVLisFascByUpdUdId.java @@ -0,0 +1,81 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Objects; + +import javax.persistence.Column; +import javax.persistence.Embeddable; + +@Embeddable() +public class FasVLisFascByUpdUdId implements Serializable { + + private BigDecimal idUnitaDoc; + + @Column(name = "ID_UNITA_DOC") + public BigDecimal getIdUnitaDoc() { + return idUnitaDoc; + } + + public void setIdUnitaDoc(BigDecimal idUnitaDoc) { + this.idUnitaDoc = idUnitaDoc; + } + + private BigDecimal idFascicolo; + + @Column(name = "ID_FASCICOLO") + public BigDecimal getIdFascicolo() { + return idFascicolo; + } + + public void setIdFascicolo(BigDecimal idFascicolo) { + this.idFascicolo = idFascicolo; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 89 * hash + Objects.hashCode(this.idUnitaDoc); + hash = 89 * hash + Objects.hashCode(this.idFascicolo); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final FasVLisFascByUpdUdId other = (FasVLisFascByUpdUdId) obj; + if (!Objects.equals(this.idUnitaDoc, other.idUnitaDoc)) { + return false; + } + if (!Objects.equals(this.idFascicolo, other.idFascicolo)) { + return false; + } + return true; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/LogVVisLastSched.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/LogVVisLastSched.java new file mode 100644 index 0000000..d61e0dd --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/LogVVisLastSched.java @@ -0,0 +1,86 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * The persistent class for the LOG_V_VIS_LAST_SCHED database table. + * + */ +@Entity +@Table(name = "LOG_V_VIS_LAST_SCHED") +public class LogVVisLastSched implements Serializable { + + private static final long serialVersionUID = 1L; + private Date dtRegLogJobIni; + private String flJobAttivo; + private BigDecimal idLogJob; + private String nmJob; + + public LogVVisLastSched() {/* Hibernate */ + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "DT_REG_LOG_JOB_INI") + public Date getDtRegLogJobIni() { + return this.dtRegLogJobIni; + } + + public void setDtRegLogJobIni(Date dtRegLogJobIni) { + this.dtRegLogJobIni = dtRegLogJobIni; + } + + @Column(name = "FL_JOB_ATTIVO", columnDefinition = "char(1)") + public String getFlJobAttivo() { + return this.flJobAttivo; + } + + public void setFlJobAttivo(String flJobAttivo) { + this.flJobAttivo = flJobAttivo; + } + + @Id + @Column(name = "ID_LOG_JOB") + public BigDecimal getIdLogJob() { + return this.idLogJob; + } + + public void setIdLogJob(BigDecimal idLogJob) { + this.idLogJob = idLogJob; + } + + @Column(name = "NM_JOB") + public String getNmJob() { + return this.nmJob; + } + + public void setNmJob(String nmJob) { + this.nmJob = nmJob; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionFascByAa.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionFascByAa.java new file mode 100644 index 0000000..2c62737 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionFascByAa.java @@ -0,0 +1,272 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * The persistent class for the ORG_V_CHK_PARTITION_FASC_BY_AA database table. + * + */ +@Entity +@Table(name = "ORG_V_CHK_PARTITION_FASC_BY_AA") +public class OrgVChkPartitionFascByAa implements Serializable { + + private static final long serialVersionUID = 1L; + private String cdPartitionFasc; + private String cdPartitionFascko; + private String cdPartitionFileelevrsfasc; + private String cdPartitionSesfascko; + private String cdPartitionXmlfasc; + private String cdPartitionXmlsesfascko; + private String cdPartitionXmlversfasc; + private String flPartFascAnnoOk; + private String flPartFascOk; + private String flPartFasckoAnnoOk; + private String flPartFasckoOk; + private String flPartFileelevrsfascDataOk; + private String flPartFileelevrsfascOk; + private String flPartSesfasckoAnnoOk; + private String flPartSesfasckoOk; + private String flPartXmlfascDataOk; + private String flPartXmlfascOk; + private String flPartXmlsesfasckoDataOk; + private String flPartXmlsesfasckoOk; + private String flPartXmlversfascDataOk; + private String flPartXmlversfascOk; + private BigDecimal idStrut; + private BigDecimal anno; + + public OrgVChkPartitionFascByAa() {/* Hibernate */ + } + + @Column(name = "CD_PARTITION_FASC") + public String getCdPartitionFasc() { + return this.cdPartitionFasc; + } + + public void setCdPartitionFasc(String cdPartitionFasc) { + this.cdPartitionFasc = cdPartitionFasc; + } + + @Column(name = "CD_PARTITION_FASCKO") + public String getCdPartitionFascko() { + return this.cdPartitionFascko; + } + + public void setCdPartitionFascko(String cdPartitionFascko) { + this.cdPartitionFascko = cdPartitionFascko; + } + + @Column(name = "CD_PARTITION_FILEELEVRSFASC") + public String getCdPartitionFileelevrsfasc() { + return this.cdPartitionFileelevrsfasc; + } + + public void setCdPartitionFileelevrsfasc(String cdPartitionFileelevrsfasc) { + this.cdPartitionFileelevrsfasc = cdPartitionFileelevrsfasc; + } + + @Column(name = "CD_PARTITION_SESFASCKO") + public String getCdPartitionSesfascko() { + return this.cdPartitionSesfascko; + } + + public void setCdPartitionSesfascko(String cdPartitionSesfascko) { + this.cdPartitionSesfascko = cdPartitionSesfascko; + } + + @Column(name = "CD_PARTITION_XMLFASC") + public String getCdPartitionXmlfasc() { + return this.cdPartitionXmlfasc; + } + + public void setCdPartitionXmlfasc(String cdPartitionXmlfasc) { + this.cdPartitionXmlfasc = cdPartitionXmlfasc; + } + + @Column(name = "CD_PARTITION_XMLSESFASCKO") + public String getCdPartitionXmlsesfascko() { + return this.cdPartitionXmlsesfascko; + } + + public void setCdPartitionXmlsesfascko(String cdPartitionXmlsesfascko) { + this.cdPartitionXmlsesfascko = cdPartitionXmlsesfascko; + } + + @Column(name = "CD_PARTITION_XMLVERSFASC") + public String getCdPartitionXmlversfasc() { + return this.cdPartitionXmlversfasc; + } + + public void setCdPartitionXmlversfasc(String cdPartitionXmlversfasc) { + this.cdPartitionXmlversfasc = cdPartitionXmlversfasc; + } + + @Column(name = "FL_PART_FASC_ANNO_OK", columnDefinition = "char(1)") + public String getFlPartFascAnnoOk() { + return this.flPartFascAnnoOk; + } + + public void setFlPartFascAnnoOk(String flPartFascAnnoOk) { + this.flPartFascAnnoOk = flPartFascAnnoOk; + } + + @Column(name = "FL_PART_FASC_OK", columnDefinition = "char(1)") + public String getFlPartFascOk() { + return this.flPartFascOk; + } + + public void setFlPartFascOk(String flPartFascOk) { + this.flPartFascOk = flPartFascOk; + } + + @Column(name = "FL_PART_FASCKO_ANNO_OK", columnDefinition = "char(1)") + public String getFlPartFasckoAnnoOk() { + return this.flPartFasckoAnnoOk; + } + + public void setFlPartFasckoAnnoOk(String flPartFasckoAnnoOk) { + this.flPartFasckoAnnoOk = flPartFasckoAnnoOk; + } + + @Column(name = "FL_PART_FASCKO_OK", columnDefinition = "char(1)") + public String getFlPartFasckoOk() { + return this.flPartFasckoOk; + } + + public void setFlPartFasckoOk(String flPartFasckoOk) { + this.flPartFasckoOk = flPartFasckoOk; + } + + @Column(name = "FL_PART_FILEELEVRSFASC_DATA_OK", columnDefinition = "char(1)") + public String getFlPartFileelevrsfascDataOk() { + return this.flPartFileelevrsfascDataOk; + } + + public void setFlPartFileelevrsfascDataOk(String flPartFileelevrsfascDataOk) { + this.flPartFileelevrsfascDataOk = flPartFileelevrsfascDataOk; + } + + @Column(name = "FL_PART_FILEELEVRSFASC_OK", columnDefinition = "char(1)") + public String getFlPartFileelevrsfascOk() { + return this.flPartFileelevrsfascOk; + } + + public void setFlPartFileelevrsfascOk(String flPartFileelevrsfascOk) { + this.flPartFileelevrsfascOk = flPartFileelevrsfascOk; + } + + @Column(name = "FL_PART_SESFASCKO_ANNO_OK", columnDefinition = "char(1)") + public String getFlPartSesfasckoAnnoOk() { + return this.flPartSesfasckoAnnoOk; + } + + public void setFlPartSesfasckoAnnoOk(String flPartSesfasckoAnnoOk) { + this.flPartSesfasckoAnnoOk = flPartSesfasckoAnnoOk; + } + + @Column(name = "FL_PART_SESFASCKO_OK", columnDefinition = "char(1)") + public String getFlPartSesfasckoOk() { + return this.flPartSesfasckoOk; + } + + public void setFlPartSesfasckoOk(String flPartSesfasckoOk) { + this.flPartSesfasckoOk = flPartSesfasckoOk; + } + + @Column(name = "FL_PART_XMLFASC_DATA_OK", columnDefinition = "char(1)") + public String getFlPartXmlfascDataOk() { + return this.flPartXmlfascDataOk; + } + + public void setFlPartXmlfascDataOk(String flPartXmlfascDataOk) { + this.flPartXmlfascDataOk = flPartXmlfascDataOk; + } + + @Column(name = "FL_PART_XMLFASC_OK", columnDefinition = "char(1)") + public String getFlPartXmlfascOk() { + return this.flPartXmlfascOk; + } + + public void setFlPartXmlfascOk(String flPartXmlfascOk) { + this.flPartXmlfascOk = flPartXmlfascOk; + } + + @Column(name = "FL_PART_XMLSESFASCKO_DATA_OK", columnDefinition = "char(1)") + public String getFlPartXmlsesfasckoDataOk() { + return this.flPartXmlsesfasckoDataOk; + } + + public void setFlPartXmlsesfasckoDataOk(String flPartXmlsesfasckoDataOk) { + this.flPartXmlsesfasckoDataOk = flPartXmlsesfasckoDataOk; + } + + @Column(name = "FL_PART_XMLSESFASCKO_OK", columnDefinition = "char(1)") + public String getFlPartXmlsesfasckoOk() { + return this.flPartXmlsesfasckoOk; + } + + public void setFlPartXmlsesfasckoOk(String flPartXmlsesfasckoOk) { + this.flPartXmlsesfasckoOk = flPartXmlsesfasckoOk; + } + + @Column(name = "FL_PART_XMLVERSFASC_DATA_OK", columnDefinition = "char(1)") + public String getFlPartXmlversfascDataOk() { + return this.flPartXmlversfascDataOk; + } + + public void setFlPartXmlversfascDataOk(String flPartXmlversfascDataOk) { + this.flPartXmlversfascDataOk = flPartXmlversfascDataOk; + } + + @Column(name = "FL_PART_XMLVERSFASC_OK", columnDefinition = "char(1)") + public String getFlPartXmlversfascOk() { + return this.flPartXmlversfascOk; + } + + public void setFlPartXmlversfascOk(String flPartXmlversfascOk) { + this.flPartXmlversfascOk = flPartXmlversfascOk; + } + + @Id + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + + @Column(name = "ANNO") + public BigDecimal getAnno() { + return anno; + } + + public void setAnno(BigDecimal anno) { + this.anno = anno; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionFascErr.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionFascErr.java new file mode 100644 index 0000000..30d29a5 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionFascErr.java @@ -0,0 +1,62 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * The persistent class for the ORG_V_CHK_PARTITION_FASC_ERR database table. + * + */ +@Entity +@Table(name = "ORG_V_CHK_PARTITION_FASC_ERR") +public class OrgVChkPartitionFascErr implements Serializable { + + private static final long serialVersionUID = 1L; + private String cdPartitionSesfascerr; + + private String flPartSesfascerrOk; + + public OrgVChkPartitionFascErr() {/* Hibernate */ + } + + @Column(name = "CD_PARTITION_SESFASCERR") + public String getCdPartitionSesfascerr() { + return cdPartitionSesfascerr; + } + + public void setCdPartitionSesfascerr(String cdPartitionSesfascerr) { + this.cdPartitionSesfascerr = cdPartitionSesfascerr; + } + + @Id + @Column(name = "FL_PART_SESFASCERR_OK", columnDefinition = "char(1)") + public String getFlPartSesfascerrOk() { + return flPartSesfascerrOk; + } + + public void setFlPartSesfascerrOk(String flPartSesfascerrOk) { + this.flPartSesfascerrOk = flPartSesfascerrOk; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionUpdByAa.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionUpdByAa.java new file mode 100644 index 0000000..e8dbe4d --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionUpdByAa.java @@ -0,0 +1,241 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * The persistent class for the ORG_V_CHK_PARTITION_UPD_BY_AA database table. + * + */ +@Entity +@Table(name = "ORG_V_CHK_PARTITION_UPD_BY_AA") +public class OrgVChkPartitionUpdByAa implements Serializable { + private static final long serialVersionUID = 1L; + private BigDecimal anno; + private String cdPartitionSesupdko; + private String cdPartitionUpddatispec; + private String cdPartitionUpdko; + private String cdPartitionVersinidatispec; + private String cdPartitionXmlsesupdko; + private String cdPartitionXmlupd; + private String flPartSesupdkoAaOk; + private String flPartSesupdkoOk; + private String flPartUpddatispecAaOk; + private String flPartUpddatispecOk; + private String flPartUpdkoAaOk; + private String flPartUpdkoOk; + private String flPartVersinidatispecAaOk; + private String flPartVersinidatispecOk; + private String flPartXmlsesupdkoOk; + private String flPartXmlsesupdkpAaOk; + private String flPartXmlupdAaOk; + private String flPartXmlupdOk; + private BigDecimal idStrut; + + public OrgVChkPartitionUpdByAa() {/* Hibernate */ + } + + @Column(name = "ANNO") + public BigDecimal getAnno() { + return this.anno; + } + + public void setAnno(BigDecimal anno) { + this.anno = anno; + } + + @Column(name = "CD_PARTITION_SESUPDKO") + public String getCdPartitionSesupdko() { + return this.cdPartitionSesupdko; + } + + public void setCdPartitionSesupdko(String cdPartitionSesupdko) { + this.cdPartitionSesupdko = cdPartitionSesupdko; + } + + @Column(name = "CD_PARTITION_UPDDATISPEC") + public String getCdPartitionUpddatispec() { + return this.cdPartitionUpddatispec; + } + + public void setCdPartitionUpddatispec(String cdPartitionUpddatispec) { + this.cdPartitionUpddatispec = cdPartitionUpddatispec; + } + + @Column(name = "CD_PARTITION_UPDKO") + public String getCdPartitionUpdko() { + return this.cdPartitionUpdko; + } + + public void setCdPartitionUpdko(String cdPartitionUpdko) { + this.cdPartitionUpdko = cdPartitionUpdko; + } + + @Column(name = "CD_PARTITION_VERSINIDATISPEC") + public String getCdPartitionVersinidatispec() { + return this.cdPartitionVersinidatispec; + } + + public void setCdPartitionVersinidatispec(String cdPartitionVersinidatispec) { + this.cdPartitionVersinidatispec = cdPartitionVersinidatispec; + } + + @Column(name = "CD_PARTITION_XMLSESUPDKO") + public String getCdPartitionXmlsesupdko() { + return this.cdPartitionXmlsesupdko; + } + + public void setCdPartitionXmlsesupdko(String cdPartitionXmlsesupdko) { + this.cdPartitionXmlsesupdko = cdPartitionXmlsesupdko; + } + + @Column(name = "CD_PARTITION_XMLUPD") + public String getCdPartitionXmlupd() { + return this.cdPartitionXmlupd; + } + + public void setCdPartitionXmlupd(String cdPartitionXmlupd) { + this.cdPartitionXmlupd = cdPartitionXmlupd; + } + + @Column(name = "FL_PART_SESUPDKO_AA_OK", columnDefinition = "char(1)") + public String getFlPartSesupdkoAaOk() { + return this.flPartSesupdkoAaOk; + } + + public void setFlPartSesupdkoAaOk(String flPartSesupdkoAaOk) { + this.flPartSesupdkoAaOk = flPartSesupdkoAaOk; + } + + @Column(name = "FL_PART_SESUPDKO_OK", columnDefinition = "char(1)") + public String getFlPartSesupdkoOk() { + return this.flPartSesupdkoOk; + } + + public void setFlPartSesupdkoOk(String flPartSesupdkoOk) { + this.flPartSesupdkoOk = flPartSesupdkoOk; + } + + @Column(name = "FL_PART_UPDDATISPEC_AA_OK", columnDefinition = "char(1)") + public String getFlPartUpddatispecAaOk() { + return this.flPartUpddatispecAaOk; + } + + public void setFlPartUpddatispecAaOk(String flPartUpddatispecAaOk) { + this.flPartUpddatispecAaOk = flPartUpddatispecAaOk; + } + + @Column(name = "FL_PART_UPDDATISPEC_OK", columnDefinition = "char(1)") + public String getFlPartUpddatispecOk() { + return this.flPartUpddatispecOk; + } + + public void setFlPartUpddatispecOk(String flPartUpddatispecOk) { + this.flPartUpddatispecOk = flPartUpddatispecOk; + } + + @Column(name = "FL_PART_UPDKO_AA_OK", columnDefinition = "char(1)") + public String getFlPartUpdkoAaOk() { + return this.flPartUpdkoAaOk; + } + + public void setFlPartUpdkoAaOk(String flPartUpdkoAaOk) { + this.flPartUpdkoAaOk = flPartUpdkoAaOk; + } + + @Column(name = "FL_PART_UPDKO_OK", columnDefinition = "char(1)") + public String getFlPartUpdkoOk() { + return this.flPartUpdkoOk; + } + + public void setFlPartUpdkoOk(String flPartUpdkoOk) { + this.flPartUpdkoOk = flPartUpdkoOk; + } + + @Column(name = "FL_PART_VERSINIDATISPEC_AA_OK", columnDefinition = "char(1)") + public String getFlPartVersinidatispecAaOk() { + return this.flPartVersinidatispecAaOk; + } + + public void setFlPartVersinidatispecAaOk(String flPartVersinidatispecAaOk) { + this.flPartVersinidatispecAaOk = flPartVersinidatispecAaOk; + } + + @Column(name = "FL_PART_VERSINIDATISPEC_OK", columnDefinition = "char(1)") + public String getFlPartVersinidatispecOk() { + return this.flPartVersinidatispecOk; + } + + public void setFlPartVersinidatispecOk(String flPartVersinidatispecOk) { + this.flPartVersinidatispecOk = flPartVersinidatispecOk; + } + + @Column(name = "FL_PART_XMLSESUPDKO_OK", columnDefinition = "char(1)") + public String getFlPartXmlsesupdkoOk() { + return this.flPartXmlsesupdkoOk; + } + + public void setFlPartXmlsesupdkoOk(String flPartXmlsesupdkoOk) { + this.flPartXmlsesupdkoOk = flPartXmlsesupdkoOk; + } + + @Column(name = "FL_PART_XMLSESUPDKP_AA_OK", columnDefinition = "char(1)") + public String getFlPartXmlsesupdkpAaOk() { + return this.flPartXmlsesupdkpAaOk; + } + + public void setFlPartXmlsesupdkpAaOk(String flPartXmlsesupdkpAaOk) { + this.flPartXmlsesupdkpAaOk = flPartXmlsesupdkpAaOk; + } + + @Column(name = "FL_PART_XMLUPD_AA_OK", columnDefinition = "char(1)") + public String getFlPartXmlupdAaOk() { + return this.flPartXmlupdAaOk; + } + + public void setFlPartXmlupdAaOk(String flPartXmlupdAaOk) { + this.flPartXmlupdAaOk = flPartXmlupdAaOk; + } + + @Column(name = "FL_PART_XMLUPD_OK", columnDefinition = "char(1)") + public String getFlPartXmlupdOk() { + return this.flPartXmlupdOk; + } + + public void setFlPartXmlupdOk(String flPartXmlupdOk) { + this.flPartXmlupdOk = flPartXmlupdOk; + } + + @Id + @Column(name = "ID_STRUT") + public BigDecimal getIdStrut() { + return this.idStrut; + } + + public void setIdStrut(BigDecimal idStrut) { + this.idStrut = idStrut; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionUpdErr.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionUpdErr.java new file mode 100644 index 0000000..c6b8b9b --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVChkPartitionUpdErr.java @@ -0,0 +1,60 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * The persistent class for the ORG_V_CHK_PARTITION_UPD_ERR database table. + * + */ +@Entity +@Table(name = "ORG_V_CHK_PARTITION_UPD_ERR") +public class OrgVChkPartitionUpdErr implements Serializable { + private static final long serialVersionUID = 1L; + private String cdPartitionSesupderr; + private String flPartSesupderrOk; + + public OrgVChkPartitionUpdErr() {/* Hibernate */ + } + + @Column(name = "CD_PARTITION_SESUPDERR") + public String getCdPartitionSesupderr() { + return this.cdPartitionSesupderr; + } + + public void setCdPartitionSesupderr(String cdPartitionSesupderr) { + this.cdPartitionSesupderr = cdPartitionSesupderr; + } + + @Id + @Column(name = "FL_PART_SESUPDERR_OK", columnDefinition = "char(1)") + public String getFlPartSesupderrOk() { + return this.flPartSesupderrOk; + } + + public void setFlPartSesupderrOk(String flPartSesupderrOk) { + this.flPartSesupderrOk = flPartSesupderrOk; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVValSubPartition.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVValSubPartition.java new file mode 100644 index 0000000..b8db49b --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/OrgVValSubPartition.java @@ -0,0 +1,90 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package it.eng.parer.view_entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * The persistent class for the ORG_V_VAL_SUB_PARTITION database table. + * + */ +@Entity +@Table(name = "ORG_V_VAL_SUB_PARTITION") +public class OrgVValSubPartition implements Serializable { + private static final long serialVersionUID = 1L; + private Date cdValSubPartition; + private BigDecimal idPartition; + private BigDecimal idSubPartition; + private Long idValSubPartition; + + public OrgVValSubPartition() {/* Hibernate */ + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "CD_VAL_SUB_PARTITION") + public Date getCdValSubPartition() { + return this.cdValSubPartition; + } + + public void setCdValSubPartition(Date cdValSubPartition) { + this.cdValSubPartition = cdValSubPartition; + } + + @Column(name = "ID_PARTITION") + public BigDecimal getIdPartition() { + return this.idPartition; + } + + public void setIdPartition(BigDecimal idPartition) { + this.idPartition = idPartition; + } + + @Column(name = "ID_SUB_PARTITION") + public BigDecimal getIdSubPartition() { + return this.idSubPartition; + } + + public void setIdSubPartition(BigDecimal idSubPartition) { + this.idSubPartition = idSubPartition; + } + + @Id + @Column(name = "ID_VAL_SUB_PARTITION") + public Long getIdValSubPartition() { + return this.idValSubPartition; + } + + public void setIdValSubPartition(Long idValSubPartition) { + this.idValSubPartition = idValSubPartition; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/SerVLisVerserByUpdUd.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/SerVLisVerserByUpdUd.java new file mode 100644 index 0000000..7617dcd --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/SerVLisVerserByUpdUd.java @@ -0,0 +1,48 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; + +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.Table; + +/** + * The persistent class for the SER_V_LIS_VERSER_BY_UPD_UD database table. + */ +@Entity +@Table(name = "SER_V_LIS_VERSER_BY_UPD_UD") +public class SerVLisVerserByUpdUd implements Serializable { + + private static final long serialVersionUID = 1L; + + public SerVLisVerserByUpdUd() {/* Hibernate */ + } + + private SerVLisVerserByUpdUdId serVLisVerserByUpdUdId; + + @EmbeddedId() + public SerVLisVerserByUpdUdId getSerVLisVerserByUpdUdId() { + return serVLisVerserByUpdUdId; + } + + public void setSerVLisVerserByUpdUdId(SerVLisVerserByUpdUdId serVLisVerserByUpdUdId) { + this.serVLisVerserByUpdUdId = serVLisVerserByUpdUdId; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/SerVLisVerserByUpdUdId.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/SerVLisVerserByUpdUdId.java new file mode 100644 index 0000000..1f8bdd7 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/SerVLisVerserByUpdUdId.java @@ -0,0 +1,77 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Objects; + +import javax.persistence.Column; +import javax.persistence.Embeddable; + +@Embeddable() +public class SerVLisVerserByUpdUdId implements Serializable { + + @Override + public int hashCode() { + int hash = 7; + hash = 97 * hash + Objects.hashCode(this.idUnitaDoc); + hash = 97 * hash + Objects.hashCode(this.idVerSerie); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final SerVLisVerserByUpdUdId other = (SerVLisVerserByUpdUdId) obj; + if (!Objects.equals(this.idUnitaDoc, other.idUnitaDoc)) { + return false; + } + return Objects.equals(this.idVerSerie, other.idVerSerie); + } + + private BigDecimal idUnitaDoc; + + @Column(name = "ID_UNITA_DOC") + public BigDecimal getIdUnitaDoc() { + return idUnitaDoc; + } + + public void setIdUnitaDoc(BigDecimal idUnitaDoc) { + this.idUnitaDoc = idUnitaDoc; + } + + private BigDecimal idVerSerie; + + @Column(name = "ID_VER_SERIE") + public BigDecimal getIdVerSerie() { + return idVerSerie; + } + + public void setIdVerSerie(BigDecimal idVerSerie) { + this.idVerSerie = idVerSerie; + } +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVLisXmlDocUrnDaCalc.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVLisXmlDocUrnDaCalc.java new file mode 100644 index 0000000..d586c60 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVLisXmlDocUrnDaCalc.java @@ -0,0 +1,192 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * The persistent class for the VRS_V_LIS_XML_UD_URN_DA_CALC database table. + * + */ +@Entity +@Table(name = "VRS_V_LIS_XML_DOC_URN_DA_CALC") +public class VrsVLisXmlDocUrnDaCalc implements Serializable { + + private static final long serialVersionUID = 1L; + private BigDecimal idUnitaDoc; + private BigDecimal idXmlDatiSessioneVers; + private BigDecimal niOrdDoc; + private BigDecimal idDoc; + private String tiXmlDati; + private String nmStrut; + private String nmEnte; + private String dsUrnXmlVers; + private String cdStrutNormaliz; + private String cdRegistroNormaliz; + private String cdRegistroKeyUnitaDoc; + private String cdKeyUnitaDocNormaliz; + private String cdKeyUnitaDoc; + private String cdEnteNormaliz; + private BigDecimal aaKeyUnitaDoc; + + public VrsVLisXmlDocUrnDaCalc() {/* Hibernate */ + } + + @Column(name = "ID_UNITA_DOC") + public BigDecimal getIdUnitaDoc() { + return this.idUnitaDoc; + } + + public void setIdUnitaDoc(BigDecimal idUnitaDoc) { + this.idUnitaDoc = idUnitaDoc; + } + + @Id + @Column(name = "ID_XML_DATI_SESSIONE_VERS") + public BigDecimal getIdXmlDatiSessioneVers() { + return idXmlDatiSessioneVers; + } + + public void setIdXmlDatiSessioneVers(BigDecimal idXmlDatiSessioneVers) { + this.idXmlDatiSessioneVers = idXmlDatiSessioneVers; + } + + @Column(name = "TI_XML_DATI") + public String getTiXmlDati() { + return tiXmlDati; + } + + public void setTiXmlDati(String tiXmlDati) { + this.tiXmlDati = tiXmlDati; + } + + @Column(name = "NM_STRUT") + public String getNmStrut() { + return nmStrut; + } + + public void setNmStrut(String nmStrut) { + this.nmStrut = nmStrut; + } + + @Column(name = "NM_ENTE") + public String getNmEnte() { + return nmEnte; + } + + public void setNmEnte(String nmEnte) { + this.nmEnte = nmEnte; + } + + @Column(name = "DS_URN_XML_VERS") + public String getDsUrnXmlVers() { + return dsUrnXmlVers; + } + + public void setDsUrnXmlVers(String dsUrnXmlVers) { + this.dsUrnXmlVers = dsUrnXmlVers; + } + + @Column(name = "CD_STRUT_NORMALIZ") + public String getCdStrutNormaliz() { + return cdStrutNormaliz; + } + + public void setCdStrutNormaliz(String cdStrutNormaliz) { + this.cdStrutNormaliz = cdStrutNormaliz; + } + + @Column(name = "CD_REGISTRO_NORMALIZ") + public String getCdRegistroNormaliz() { + return cdRegistroNormaliz; + } + + public void setCdRegistroNormaliz(String cdRegistroNormaliz) { + this.cdRegistroNormaliz = cdRegistroNormaliz; + } + + @Column(name = "CD_REGISTRO_KEY_UNITA_DOC") + public String getCdRegistroKeyUnitaDoc() { + return cdRegistroKeyUnitaDoc; + } + + public void setCdRegistroKeyUnitaDoc(String cdRegistroKeyUnitaDoc) { + this.cdRegistroKeyUnitaDoc = cdRegistroKeyUnitaDoc; + } + + @Column(name = "CD_KEY_UNITA_DOC_NORMALIZ") + public String getCdKeyUnitaDocNormaliz() { + return cdKeyUnitaDocNormaliz; + } + + public void setCdKeyUnitaDocNormaliz(String cdKeyUnitaDocNormaliz) { + this.cdKeyUnitaDocNormaliz = cdKeyUnitaDocNormaliz; + } + + @Column(name = "CD_KEY_UNITA_DOC") + public String getCdKeyUnitaDoc() { + return cdKeyUnitaDoc; + } + + public void setCdKeyUnitaDoc(String cdKeyUnitaDoc) { + this.cdKeyUnitaDoc = cdKeyUnitaDoc; + } + + @Column(name = "CD_ENTE_NORMALIZ") + public String getCdEnteNormaliz() { + return cdEnteNormaliz; + } + + public void setCdEnteNormaliz(String cdEnteNormaliz) { + this.cdEnteNormaliz = cdEnteNormaliz; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + @Column(name = "NI_ORD_DOC") + public BigDecimal getNiOrdDoc() { + return niOrdDoc; + } + + public void setNiOrdDoc(BigDecimal niOrdDoc) { + this.niOrdDoc = niOrdDoc; + } + + @Column(name = "ID_DOC") + public BigDecimal getIdDoc() { + return idDoc; + } + + public void setIdDoc(BigDecimal idDoc) { + this.idDoc = idDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVLisXmlUdUrnDaCalc.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVLisXmlUdUrnDaCalc.java new file mode 100644 index 0000000..c2095d9 --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVLisXmlUdUrnDaCalc.java @@ -0,0 +1,172 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * The persistent class for the VRS_V_LIS_XML_UD_URN_DA_CALC database table. + * + */ +@Entity +@Table(name = "VRS_V_LIS_XML_UD_URN_DA_CALC") +public class VrsVLisXmlUdUrnDaCalc implements Serializable { + + private static final long serialVersionUID = 1L; + private BigDecimal idUnitaDoc; + private BigDecimal idXmlDatiSessioneVers; + private String tiXmlDati; + private String nmStrut; + private String nmEnte; + private String dsUrnXmlVers; + private String cdStrutNormaliz; + private String cdRegistroNormaliz; + private String cdRegistroKeyUnitaDoc; + private String cdKeyUnitaDocNormaliz; + private String cdKeyUnitaDoc; + private String cdEnteNormaliz; + private BigDecimal aaKeyUnitaDoc; + + public VrsVLisXmlUdUrnDaCalc() {/* Hibernate */ + } + + @Column(name = "ID_UNITA_DOC") + public BigDecimal getIdUnitaDoc() { + return this.idUnitaDoc; + } + + public void setIdUnitaDoc(BigDecimal idUnitaDoc) { + this.idUnitaDoc = idUnitaDoc; + } + + @Id + @Column(name = "ID_XML_DATI_SESSIONE_VERS") + public BigDecimal getIdXmlDatiSessioneVers() { + return idXmlDatiSessioneVers; + } + + public void setIdXmlDatiSessioneVers(BigDecimal idXmlDatiSessioneVers) { + this.idXmlDatiSessioneVers = idXmlDatiSessioneVers; + } + + @Column(name = "TI_XML_DATI") + public String getTiXmlDati() { + return tiXmlDati; + } + + public void setTiXmlDati(String tiXmlDati) { + this.tiXmlDati = tiXmlDati; + } + + @Column(name = "NM_STRUT") + public String getNmStrut() { + return nmStrut; + } + + public void setNmStrut(String nmStrut) { + this.nmStrut = nmStrut; + } + + @Column(name = "NM_ENTE") + public String getNmEnte() { + return nmEnte; + } + + public void setNmEnte(String nmEnte) { + this.nmEnte = nmEnte; + } + + @Column(name = "DS_URN_XML_VERS") + public String getDsUrnXmlVers() { + return dsUrnXmlVers; + } + + public void setDsUrnXmlVers(String dsUrnXmlVers) { + this.dsUrnXmlVers = dsUrnXmlVers; + } + + @Column(name = "CD_STRUT_NORMALIZ") + public String getCdStrutNormaliz() { + return cdStrutNormaliz; + } + + public void setCdStrutNormaliz(String cdStrutNormaliz) { + this.cdStrutNormaliz = cdStrutNormaliz; + } + + @Column(name = "CD_REGISTRO_NORMALIZ") + public String getCdRegistroNormaliz() { + return cdRegistroNormaliz; + } + + public void setCdRegistroNormaliz(String cdRegistroNormaliz) { + this.cdRegistroNormaliz = cdRegistroNormaliz; + } + + @Column(name = "CD_REGISTRO_KEY_UNITA_DOC") + public String getCdRegistroKeyUnitaDoc() { + return cdRegistroKeyUnitaDoc; + } + + public void setCdRegistroKeyUnitaDoc(String cdRegistroKeyUnitaDoc) { + this.cdRegistroKeyUnitaDoc = cdRegistroKeyUnitaDoc; + } + + @Column(name = "CD_KEY_UNITA_DOC_NORMALIZ") + public String getCdKeyUnitaDocNormaliz() { + return cdKeyUnitaDocNormaliz; + } + + public void setCdKeyUnitaDocNormaliz(String cdKeyUnitaDocNormaliz) { + this.cdKeyUnitaDocNormaliz = cdKeyUnitaDocNormaliz; + } + + @Column(name = "CD_KEY_UNITA_DOC") + public String getCdKeyUnitaDoc() { + return cdKeyUnitaDoc; + } + + public void setCdKeyUnitaDoc(String cdKeyUnitaDoc) { + this.cdKeyUnitaDoc = cdKeyUnitaDoc; + } + + @Column(name = "CD_ENTE_NORMALIZ") + public String getCdEnteNormaliz() { + return cdEnteNormaliz; + } + + public void setCdEnteNormaliz(String cdEnteNormaliz) { + this.cdEnteNormaliz = cdEnteNormaliz; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVLisXmlUpdUrnDaCalc.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVLisXmlUpdUrnDaCalc.java new file mode 100644 index 0000000..5ed8a3a --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVLisXmlUpdUrnDaCalc.java @@ -0,0 +1,182 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * The persistent class for the VRS_V_LIS_XML_UPD_URN_DA_CALC database table. + * + */ +@Entity +@Table(name = "VRS_V_LIS_XML_UPD_URN_DA_CALC") +public class VrsVLisXmlUpdUrnDaCalc implements Serializable { + + private static final long serialVersionUID = 1L; + private BigDecimal idUpdUnitaDoc; + private BigDecimal idUnitaDoc; + private BigDecimal idXmlUpdUnitaDoc; + private String tiXmlUpdUnitaDoc; + private String nmStrut; + private String nmEnte; + private String cdStrutNormaliz; + private String cdRegistroNormaliz; + private String cdRegistroKeyUnitaDoc; + private String cdKeyUnitaDocNormaliz; + private String cdKeyUnitaDoc; + private String cdEnteNormaliz; + private BigDecimal aaKeyUnitaDoc; + private BigDecimal pgUpdUnitaDoc; + + public VrsVLisXmlUpdUrnDaCalc() {/* Hibernate */ + } + + @Column(name = "ID_UNITA_DOC") + public BigDecimal getIdUnitaDoc() { + return this.idUnitaDoc; + } + + public void setIdUnitaDoc(BigDecimal idUnitaDoc) { + this.idUnitaDoc = idUnitaDoc; + } + + @Column(name = "ID_UPD_UNITA_DOC") + public BigDecimal getIdUpdUnitaDoc() { + return this.idUpdUnitaDoc; + } + + public void setIdUpdUnitaDoc(BigDecimal idUpdUnitaDoc) { + this.idUpdUnitaDoc = idUpdUnitaDoc; + } + + @Column(name = "TI_XML_UPD_UNITA_DOC") + public String getTiXmlUpdUnitaDoc() { + return tiXmlUpdUnitaDoc; + } + + public void setTiXmlUpdUnitaDoc(String tiXmlUpdUnitaDoc) { + this.tiXmlUpdUnitaDoc = tiXmlUpdUnitaDoc; + } + + @Column(name = "NM_STRUT") + public String getNmStrut() { + return nmStrut; + } + + public void setNmStrut(String nmStrut) { + this.nmStrut = nmStrut; + } + + @Column(name = "NM_ENTE") + public String getNmEnte() { + return nmEnte; + } + + public void setNmEnte(String nmEnte) { + this.nmEnte = nmEnte; + } + + @Column(name = "CD_STRUT_NORMALIZ") + public String getCdStrutNormaliz() { + return cdStrutNormaliz; + } + + public void setCdStrutNormaliz(String cdStrutNormaliz) { + this.cdStrutNormaliz = cdStrutNormaliz; + } + + @Column(name = "CD_REGISTRO_NORMALIZ") + public String getCdRegistroNormaliz() { + return cdRegistroNormaliz; + } + + public void setCdRegistroNormaliz(String cdRegistroNormaliz) { + this.cdRegistroNormaliz = cdRegistroNormaliz; + } + + @Column(name = "CD_REGISTRO_KEY_UNITA_DOC") + public String getCdRegistroKeyUnitaDoc() { + return cdRegistroKeyUnitaDoc; + } + + public void setCdRegistroKeyUnitaDoc(String cdRegistroKeyUnitaDoc) { + this.cdRegistroKeyUnitaDoc = cdRegistroKeyUnitaDoc; + } + + @Column(name = "CD_KEY_UNITA_DOC_NORMALIZ") + public String getCdKeyUnitaDocNormaliz() { + return cdKeyUnitaDocNormaliz; + } + + public void setCdKeyUnitaDocNormaliz(String cdKeyUnitaDocNormaliz) { + this.cdKeyUnitaDocNormaliz = cdKeyUnitaDocNormaliz; + } + + @Column(name = "CD_KEY_UNITA_DOC") + public String getCdKeyUnitaDoc() { + return cdKeyUnitaDoc; + } + + public void setCdKeyUnitaDoc(String cdKeyUnitaDoc) { + this.cdKeyUnitaDoc = cdKeyUnitaDoc; + } + + @Column(name = "CD_ENTE_NORMALIZ") + public String getCdEnteNormaliz() { + return cdEnteNormaliz; + } + + public void setCdEnteNormaliz(String cdEnteNormaliz) { + this.cdEnteNormaliz = cdEnteNormaliz; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + @Id + @Column(name = "ID_XML_UPD_UNITA_DOC") + public BigDecimal getIdXmlUpdUnitaDoc() { + return idXmlUpdUnitaDoc; + } + + public void setIdXmlUpdUnitaDoc(BigDecimal idXmlUpdUnitaDoc) { + this.idXmlUpdUnitaDoc = idXmlUpdUnitaDoc; + } + + @Column(name = "PG_UPD_UNITA_DOC") + public BigDecimal getPgUpdUnitaDoc() { + return pgUpdUnitaDoc; + } + + public void setPgUpdUnitaDoc(BigDecimal pgUpdUnitaDoc) { + this.pgUpdUnitaDoc = pgUpdUnitaDoc; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVModifUpdUdKo.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVModifUpdUdKo.java new file mode 100644 index 0000000..0b96c0a --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVModifUpdUdKo.java @@ -0,0 +1,168 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * The persistent class for the VRS_V_MODIF_UPD_UD_KO database table. + * + */ +@Entity +@Table(name = "VRS_V_MODIF_UPD_UD_KO") +public class VrsVModifUpdUdKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idUpdUnitaDocKo; + private BigDecimal idSesUpdUdKoLast; + private BigDecimal idSesUpdUdKoFirst; + private BigDecimal idTipoUnitaDocLast; + private BigDecimal idErrSacerPrinc; + private BigDecimal idControlloWsPrinc; + private BigDecimal idTipoDocPrincLast; + private BigDecimal idRegistroUnitaDocLast; + private Date tsIniFirstSes; + private Date tsIniLastSes; + private String dsErrPrinc; + private String tiStatoUpdUdKo; + + public VrsVModifUpdUdKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_UPD_UNITA_DOC_KO") + public Long getIdUpdUnitaDocKo() { + return this.idUpdUnitaDocKo; + } + + public void setIdUpdUnitaDocKo(Long idUpdUnitaDocKo) { + this.idUpdUnitaDocKo = idUpdUnitaDocKo; + } + + @Column(name = "ID_SES_UPD_UD_KO_LAST") + public BigDecimal getIdSesUpdUdKoLast() { + return this.idSesUpdUdKoLast; + } + + public void setIdSesUpdUdKoLast(BigDecimal idSesUpdUdKoLast) { + this.idSesUpdUdKoLast = idSesUpdUdKoLast; + } + + @Column(name = "ID_SES_UPD_UD_KO_FIRST") + public BigDecimal getIdSesUpdUdKoFirst() { + return this.idSesUpdUdKoFirst; + } + + public void setIdSesUpdUdKoFirst(BigDecimal idSesUpdUdKoFirst) { + this.idSesUpdUdKoFirst = idSesUpdUdKoFirst; + } + + @Column(name = "ID_TIPO_UNITA_DOC_LAST") + public BigDecimal getIdTipoUnitaDocLast() { + return this.idTipoUnitaDocLast; + } + + public void setIdTipoUnitaDocLast(BigDecimal idTipoUnitaDocLast) { + this.idTipoUnitaDocLast = idTipoUnitaDocLast; + } + + @Column(name = "ID_ERR_SACER_PRINC") + public BigDecimal getIdErrSacerPrinc() { + return this.idErrSacerPrinc; + } + + public void setIdErrSacerPrinc(BigDecimal idErrSacerPrinc) { + this.idErrSacerPrinc = idErrSacerPrinc; + } + + @Column(name = "ID_CONTROLLO_WS_PRINC") + public BigDecimal getIdControlloWsPrinc() { + return this.idControlloWsPrinc; + } + + public void setIdControlloWsPrinc(BigDecimal idControlloWsPrinc) { + this.idControlloWsPrinc = idControlloWsPrinc; + } + + @Column(name = "ID_TIPO_DOC_PRINC_LAST") + public BigDecimal getIdTipoDocPrincLast() { + return this.idTipoDocPrincLast; + } + + public void setIdTipoDocPrincLast(BigDecimal idTipoDocPrincLast) { + this.idTipoDocPrincLast = idTipoDocPrincLast; + } + + @Column(name = "ID_REGISTRO_UNITA_DOC_LAST") + public BigDecimal getIdRegistroUnitaDocLast() { + return this.idRegistroUnitaDocLast; + } + + public void setIdRegistroUnitaDocLast(BigDecimal idRegistroUnitaDocLast) { + this.idRegistroUnitaDocLast = idRegistroUnitaDocLast; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_INI_FIRST_SES") + public Date getTsIniFirstSes() { + return tsIniFirstSes; + } + + public void setTsIniFirstSes(Date tsIniFirstSes) { + this.tsIniFirstSes = tsIniFirstSes; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_INI_LAST_SES") + public Date getTsIniLastSes() { + return tsIniLastSes; + } + + public void setTsIniLastSes(Date tsIniLastSes) { + this.tsIniLastSes = tsIniLastSes; + } + + @Column(name = "DS_ERR_PRINC") + public String getDsErrPrinc() { + return dsErrPrinc; + } + + public void setDsErrPrinc(String dsErrPrinc) { + this.dsErrPrinc = dsErrPrinc; + } + + @Column(name = "TI_STATO_UPD_UD_KO") + public String getTiStatoUpdUdKo() { + return tiStatoUpdUdKo; + } + + public void setTiStatoUpdUdKo(String tiStatoUpdUdKo) { + this.tiStatoUpdUdKo = tiStatoUpdUdKo; + } + +} diff --git a/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVUpdFascicoloKo.java b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVUpdFascicoloKo.java new file mode 100644 index 0000000..2cc870c --- /dev/null +++ b/sacerws-jpa/src/main/java/it/eng/parer/view_entity/VrsVUpdFascicoloKo.java @@ -0,0 +1,137 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.view_entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * The persistent class for the VRS_V_UPD_FASCICOLO_KO database table. + * + */ +@Entity +@Table(name = "VRS_V_UPD_FASCICOLO_KO") +public class VrsVUpdFascicoloKo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long idFascicoloKo; + private Date tsIniFirstSes; + private Date tsIniLastSes; + private BigDecimal idErrSacerPrinc; + private String dsErrPrinc; + private BigDecimal idTipoFascicoloLast; + private String tiStatoFascicoloKo; + private BigDecimal idSesFascicoloKoFirst; + private BigDecimal idSesFascicoloKoLast; + + public VrsVUpdFascicoloKo() {/* Hibernate */ + } + + @Id + @Column(name = "ID_FASCICOLO_KO") + public Long getIdFascicoloKo() { + return idFascicoloKo; + } + + public void setIdFascicoloKo(Long idFascicoloKo) { + this.idFascicoloKo = idFascicoloKo; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_INI_FIRST_SES") + public Date getTsIniFirstSes() { + return tsIniFirstSes; + } + + public void setTsIniFirstSes(Date tsIniFirstSes) { + this.tsIniFirstSes = tsIniFirstSes; + } + + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "TS_INI_LAST_SES") + public Date getTsIniLastSes() { + return tsIniLastSes; + } + + public void setTsIniLastSes(Date tsIniLastSes) { + this.tsIniLastSes = tsIniLastSes; + } + + @Column(name = "ID_ERR_SACER_PRINC") + public BigDecimal getIdErrSacerPrinc() { + return idErrSacerPrinc; + } + + public void setIdErrSacerPrinc(BigDecimal idErrSacerPrinc) { + this.idErrSacerPrinc = idErrSacerPrinc; + } + + @Column(name = "DS_ERR_PRINC") + public String getDsErrPrinc() { + return dsErrPrinc; + } + + public void setDsErrPrinc(String dsErrPrinc) { + this.dsErrPrinc = dsErrPrinc; + } + + @Column(name = "ID_TIPO_FASCICOLO_LAST") + public BigDecimal getIdTipoFascicoloLast() { + return idTipoFascicoloLast; + } + + public void setIdTipoFascicoloLast(BigDecimal idTipoFascicoloLast) { + this.idTipoFascicoloLast = idTipoFascicoloLast; + } + + @Column(name = "TI_STATO_FASCICOLO_KO") + public String getTiStatoFascicoloKo() { + return tiStatoFascicoloKo; + } + + public void setTiStatoFascicoloKo(String tiStatoFascicoloKo) { + this.tiStatoFascicoloKo = tiStatoFascicoloKo; + } + + @Column(name = "ID_SES_FASCICOLO_KO_FIRST") + public BigDecimal getIdSesFascicoloKoFirst() { + return idSesFascicoloKoFirst; + } + + public void setIdSesFascicoloKoFirst(BigDecimal idSesFascicoloKoFirst) { + this.idSesFascicoloKoFirst = idSesFascicoloKoFirst; + } + + @Column(name = "ID_SES_FASCICOLO_KO_LAST") + public BigDecimal getIdSesFascicoloKoLast() { + return idSesFascicoloKoLast; + } + + public void setIdSesFascicoloKoLast(BigDecimal idSesFascicoloKoLast) { + this.idSesFascicoloKoLast = idSesFascicoloKoLast; + } +} diff --git a/sacerws-jpa/src/main/resources/META-INF/persistence.xml b/sacerws-jpa/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..ba6437b --- /dev/null +++ b/sacerws-jpa/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,55 @@ + + + + org.hibernate.ejb.HibernatePersistence + jboss/datasources/SacerVersDs + META-INF/xmldbNativeQueries/xmlQueries.xml + + it.eng.parer.sacerlog.entity.LogOggettoEvento + it.eng.parer.sacerlog.entity.LogFotoOggettoEvento + it.eng.parer.sacerlog.entity.LogEvento + it.eng.parer.sacerlog.entity.LogDeltaFoto + it.eng.parer.sacerlog.entity.LogChiaveAccessoEvento + it.eng.parer.sacerlog.entity.LogAgenteEvento + it.eng.parer.sacerlog.entity.LogEventoByScript + it.eng.parer.sacerlog.entity.LogEventoLoginUser + + it.eng.parer.sacerlog.viewEntity.AplVParamApplic + it.eng.parer.sacerlog.viewEntity.LogVLogAgente + it.eng.parer.sacerlog.viewEntity.AplVLogChiaveTiOgg + it.eng.parer.sacerlog.viewEntity.AplVLogFotoTiEvnOgg + it.eng.parer.sacerlog.viewEntity.AplVLogTiEvn + it.eng.parer.sacerlog.viewEntity.AplVLogTiEvnConOrigine + it.eng.parer.sacerlog.viewEntity.AplVLogTiOgg + it.eng.parer.sacerlog.viewEntity.AplVLogTrigTiEvnOgg + it.eng.parer.sacerlog.viewEntity.AplVLogInit + it.eng.parer.sacerlog.viewEntity.LogVDeltaAsserzioni + it.eng.parer.sacerlog.viewEntity.LogVLisEventoOggetto + it.eng.parer.sacerlog.viewEntity.LogVVisEventoOggetto + it.eng.parer.sacerlog.viewEntity.LogVLisAsserzioniDati + it.eng.parer.sacerlog.viewEntity.LogVVisOggetto + it.eng.parer.sacerlog.viewEntity.LogVLisEventoByScript + it.eng.parer.sacerlog.viewEntity.LogVRicEventi + it.eng.parer.sacerlog.viewEntity.LogVRicEventiOrganiz + it.eng.parer.sacerlog.viewEntity.LogVVisEventoPrincTx + it.eng.parer.sacerlog.viewEntity.LogVUsrAbilOrganiz + + false + NONE + + + + + + + + + + + + + + + + + diff --git a/sacerws-jpa/src/main/resources/it/eng/parer/entity/jaxb.properties b/sacerws-jpa/src/main/resources/it/eng/parer/entity/jaxb.properties new file mode 100644 index 0000000..7332286 --- /dev/null +++ b/sacerws-jpa/src/main/resources/it/eng/parer/entity/jaxb.properties @@ -0,0 +1,3 @@ +# To change this template, choose Tools | Templates +# and open the template in the editor. +javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory diff --git a/sacerws-web/pom.xml b/sacerws-web/pom.xml index d8f7826..dd220b7 100644 --- a/sacerws-web/pom.xml +++ b/sacerws-web/pom.xml @@ -4,9 +4,9 @@ sacerws it.eng.parer - 3.3.0-SNAPSHOT + 5.2.1-SNAPSHOT - it.eng.parer + sacerws-web war sacerws-web @@ -19,7 +19,7 @@ org.jboss.spec - jboss-javaee-6.0 + jboss-jakartaee-8.0 pom provided @@ -104,8 +104,6 @@ org.apache.maven.plugins maven-war-plugin - - false true diff --git a/sacerws-web/src/main/java/it/eng/parer/restWS/AggAllegatiSyncSrvlt.java b/sacerws-web/src/main/java/it/eng/parer/restWS/AggAllegatiSyncSrvlt.java index dcd7cbc..540572d 100644 --- a/sacerws-web/src/main/java/it/eng/parer/restWS/AggAllegatiSyncSrvlt.java +++ b/sacerws-web/src/main/java/it/eng/parer/restWS/AggAllegatiSyncSrvlt.java @@ -1,72 +1,101 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.restWS; -import it.eng.parer.restWS.util.RequestPrsr; -import it.eng.parer.restWS.util.Response405; -import it.eng.parer.restWS.util.SrvltHandlingException; -import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; -import it.eng.parer.ws.ejb.XmlVersCache; -import it.eng.parer.ws.utils.AvanzamentoWs; -import it.eng.parer.ws.utils.MessaggiWSBundle; -import it.eng.parer.ws.versamento.dto.FileBinario; -import it.eng.parer.ws.versamento.dto.RispostaWSAggAll; -import it.eng.parer.ws.versamento.dto.SyncFakeSessn; -import it.eng.parer.ws.versamento.dto.VersamentoExtAggAll; -import it.eng.parer.ws.versamento.dto.WSDescVersamentoAggAll; -import it.eng.parer.ws.versamento.ejb.AggiuntaAllSync; -import it.eng.parer.ws.xml.versResp.EsitoVersAggAllegati; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.AGG_ALLEGATI_MAX_FILE_SIZE; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.AGG_ALLEGATI_MAX_REQUEST_SIZE; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.AGG_ALLEGATI_SAVE_LOG_SESSION; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.WS_INSTANCE_NAME; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.WS_STAGING_UPLOAD_DIR; + import java.io.File; import java.io.IOException; import java.io.OutputStreamWriter; +import java.nio.charset.StandardCharsets; import java.time.ZonedDateTime; import java.util.Iterator; import java.util.List; -import java.util.Properties; -import javax.naming.InitialContext; -import javax.naming.NamingException; + +import javax.ejb.EJB; +import javax.servlet.ServletConfig; import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; +import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.xml.bind.MarshalException; +import javax.xml.bind.Marshaller; + +import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.disk.DiskFileItem; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.xml.bind.Marshaller; -import javax.xml.bind.ValidationException; + +import it.eng.parer.restWS.util.RequestPrsr; +import it.eng.parer.restWS.util.Response405; +import it.eng.parer.restWS.util.SrvltHandlingException; +import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; +import it.eng.parer.ws.ejb.XmlVersCache; +import it.eng.parer.ws.utils.AvanzamentoWs; +import it.eng.parer.ws.utils.MessaggiWSBundle; +import it.eng.parer.ws.versamento.dto.FileBinario; +import it.eng.parer.ws.versamento.dto.RispostaWSAggAll; +import it.eng.parer.ws.versamento.dto.SyncFakeSessn; +import it.eng.parer.ws.versamento.dto.VersamentoExtAggAll; +import it.eng.parer.ws.versamento.dto.WSDescVersamentoAggAll; +import it.eng.parer.ws.versamento.ejb.AggiuntaAllSync; +import it.eng.parer.ws.xml.versResp.EsitoVersAggAllegati; +import it.eng.spagoCore.configuration.ConfigSingleton; /** * Servlet implementation class VersamentoSyncSrvlt */ +@WebServlet(urlPatterns = { "/AggiuntaAllegatiSync" }, asyncSupported = true) public class AggAllegatiSyncSrvlt extends HttpServlet { private static final long serialVersionUID = 1L; private static final Logger log = LoggerFactory.getLogger(AggAllegatiSyncSrvlt.class); - private final String uploadDir; - private final boolean salvaLogSessione; - private final long maxRequestSize; - private final long maxFileSize; - private final String instanceName; + private String uploadDir; + private boolean salvaLogSessione; + private long maxRequestSize; + private long maxFileSize; + private String instanceName; - /** - * @see HttpServlet#HttpServlet() - * - * @throws IOException - * errore generico di tipo IO - */ - public AggAllegatiSyncSrvlt() throws IOException { - super(); - Properties props = new Properties(); - props.load(this.getClass().getClassLoader().getResourceAsStream("/Sacer.properties")); - uploadDir = props.getProperty("aggAllegati.upload.directory"); - salvaLogSessione = props.getProperty("aggAllegati.saveLogSession").equals("1") ? true : false; - maxRequestSize = Long.parseLong(props.getProperty("aggAllegati.maxRequestSize")); - maxFileSize = Long.parseLong(props.getProperty("aggAllegati.maxFileSize")); - - instanceName = props.getProperty("ws.instanceName"); + @EJB(mappedName = "java:app/sacerws-ejb/AggiuntaAllSync") + private AggiuntaAllSync versamentoSync; + + @EJB(mappedName = "java:app/sacerws-ejb/XmlVersCache") + private XmlVersCache xmlVersCache; + + @EJB + private RequestPrsr myRequestPrsr; + + @Override + public void init(ServletConfig config) throws ServletException { + super.init(config); + // custom + uploadDir = ConfigSingleton.getInstance().getStringValue(WS_STAGING_UPLOAD_DIR.name()); + salvaLogSessione = ConfigSingleton.getInstance().getBooleanValue(AGG_ALLEGATI_SAVE_LOG_SESSION.name()); + maxRequestSize = ConfigSingleton.getInstance().getLongValue(AGG_ALLEGATI_MAX_REQUEST_SIZE.name()); + maxFileSize = ConfigSingleton.getInstance().getLongValue(AGG_ALLEGATI_MAX_FILE_SIZE.name()); + instanceName = ConfigSingleton.getInstance().getStringValue(WS_INSTANCE_NAME.name()); } @Override @@ -80,38 +109,20 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - AggiuntaAllSync versamentoSync; - XmlVersCache xmlVersCache; - RispostaWSAggAll rispostaWs; - VersamentoExtAggAll myVersamentoExt; + EsitoVersAggAllegati myEsito = new EsitoVersAggAllegati(); SyncFakeSessn sessioneFinta = new SyncFakeSessn(); - Iterator tmpIterator = null; + Iterator tmpIterator = null; DiskFileItem tmpFileItem = null; - List fileItems = null; - AvanzamentoWs tmpAvanzamento; - RequestPrsr myRequestPrsr = new RequestPrsr(); - RequestPrsr.ReqPrsrConfig tmpPrsrConfig = new RequestPrsr().new ReqPrsrConfig(); + List fileItems = null; - rispostaWs = new RispostaWSAggAll(); - myVersamentoExt = new VersamentoExtAggAll(); + RispostaWSAggAll rispostaWs = new RispostaWSAggAll(); + VersamentoExtAggAll myVersamentoExt = new VersamentoExtAggAll(); myVersamentoExt.setDescrizione(new WSDescVersamentoAggAll()); - tmpAvanzamento = AvanzamentoWs.nuovoAvanzamentoWS(instanceName, AvanzamentoWs.Funzioni.AggiuntaDocumentiSync); + AvanzamentoWs tmpAvanzamento = AvanzamentoWs.nuovoAvanzamentoWS(instanceName, + AvanzamentoWs.Funzioni.AggiuntaDocumentiSync); tmpAvanzamento.logAvanzamento(); - // Recupera l'ejb, se possibile - altrimenti segnala errore - try { - versamentoSync = (AggiuntaAllSync) new InitialContext().lookup("java:app/sacerws-ejb/AggiuntaAllSync"); - } catch (NamingException ex) { - throw new ServletException("Impossibile recuperare l'ejb AggiuntaAllSync ", ex); - } - - try { - xmlVersCache = (XmlVersCache) new InitialContext().lookup("java:app/sacerws-ejb/XmlVersCache"); - } catch (NamingException ex) { - throw new ServletException("Impossibile recuperare l'ejb XmlVersCache ", ex); - } - tmpAvanzamento.setFase("EJB recuperato").logAvanzamento(); versamentoSync.init(rispostaWs, tmpAvanzamento, myVersamentoExt, myEsito); @@ -119,7 +130,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) sessioneFinta.setSalvaSessione(salvaLogSessione); sessioneFinta.setTmApertura(ZonedDateTime.now()); - // + sessioneFinta.setIpChiamante(myRequestPrsr.leggiIpVersante(request)); if (rispostaWs.getSeverity() == SeverityEnum.OK) { @@ -147,7 +158,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.TrasferimentoPayloadIn) .setFase("pronto a ricevere").logAvanzamento(); - // + RequestPrsr.ReqPrsrConfig tmpPrsrConfig = RequestPrsr.createConfig(); tmpPrsrConfig.setLeggiFile(true); tmpPrsrConfig.setLeggindiceMM(false); tmpPrsrConfig.setAvanzamentoWs(tmpAvanzamento); @@ -164,6 +175,15 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.VerificaStrutturaChiamataWs) .setFase("completata").logAvanzamento(); + // Se il backend di staging configurato è l'object storage qui avviene l'upload + if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { + tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.CopiaBackendStaging) + .setFase("inizio verifica/copia backend staging").logAvanzamento(); + versamentoSync.uploadComponentiStaging(sessioneFinta); + + tmpAvanzamento.setFase("fine verifica/copia backend staging").logAvanzamento(); + } + /* * ******************************************************************************** fine della * verifica della struttura/signature del web service. Verifica dei dati effettivamente versati @@ -273,32 +293,15 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) response.reset(); response.setStatus(HttpServletResponse.SC_OK); response.setContentType("application/xml; charset=\"utf-8\""); - ServletOutputStream out = response.getOutputStream(); - OutputStreamWriter tmpStreamWriter = new OutputStreamWriter(out, "UTF-8"); + try (OutputStreamWriter tmpStreamWriter = new OutputStreamWriter(response.getOutputStream(), + StandardCharsets.UTF_8);) { - try { Marshaller tmpMarshaller = xmlVersCache.getVersRespCtxforEsitoVersamentoAggAllegati().createMarshaller(); tmpMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); tmpMarshaller.marshal(myEsito, tmpStreamWriter); - } catch (MarshalException e) { - log.error("Eccezione nella servlet versamento sync", e); - } catch (ValidationException e) { - log.error("Eccezione nella servlet versamento sync", e); + } catch (Exception e) { log.error("Eccezione nella servlet versamento sync", e); - } finally { - try { - tmpStreamWriter.flush(); - tmpStreamWriter.close(); - } catch (Exception ei) { - log.error("Eccezione nella servlet versamento sync", ei); - } - try { - out.flush(); - out.close(); - } catch (Exception ei) { - log.error("Eccezione nella servlet versamento sync", ei); - } } tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.Fine).setFase("").logAvanzamento(); diff --git a/sacerws-web/src/main/java/it/eng/parer/restWS/AppInfosSrvlt.java b/sacerws-web/src/main/java/it/eng/parer/restWS/AppInfosSrvlt.java new file mode 100644 index 0000000..09f35d4 --- /dev/null +++ b/sacerws-web/src/main/java/it/eng/parer/restWS/AppInfosSrvlt.java @@ -0,0 +1,176 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + +package it.eng.parer.restWS; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Properties; +import java.util.stream.Collectors; + +import javax.ejb.EJB; +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import it.eng.parer.ws.dto.RispostaControlli; +import it.eng.parer.ws.ejb.ControlliWS; +import it.eng.parer.ws.utils.Costanti; + +@WebServlet(urlPatterns = { "/admin/infos" }, asyncSupported = true) +public class AppInfosSrvlt extends HttpServlet { + + private static final long serialVersionUID = 1L; + private static final Logger log = LoggerFactory.getLogger(AppInfosSrvlt.class); + + // constant + private static final String ROOT_GIT = "git"; + private static final String ROOT_ENV = "env"; + private static final String ROOT_SYSPROPS = "sysprops"; + // + private static final String SYS_CONFIG_ROOT_TO_SKIP = "admin-appinfos.roottoskip"; + private static final String SYS_CONFIG_PROP_TO_SKIP = "admin-appinfos.proptoskip"; + + private Properties gitproperties = null; + + @EJB + private ControlliWS myControlliWs; + + @Override + public void init(ServletConfig config) throws ServletException { + super.init(config); + // custom + try (InputStream input = getClass().getResourceAsStream("/git.properties")) { + gitproperties = new Properties(); + // load a properties file + gitproperties.load(input); + } catch (IOException e) { + log.error("Errore init", e); + } + } + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + if (!isUserAuthenticated(req.getHeader("authorization"), getIpAddrFromReq(req))) { + resp.setStatus(HttpServletResponse.SC_FORBIDDEN); + } else { + // json mapper + ObjectMapper mapper = new ObjectMapper(); + // final result + final Map> infos = Collections.synchronizedMap(new LinkedHashMap<>()); + // props or root to skip + final String rootToSkip = StringUtils.defaultString(System.getProperty(SYS_CONFIG_ROOT_TO_SKIP), + StringUtils.EMPTY); + final String propToSkip = StringUtils.defaultString(System.getProperty(SYS_CONFIG_PROP_TO_SKIP), + StringUtils.EMPTY); + // infos + // git + Map git = gitproperties.entrySet().stream() + .filter(p -> !String.valueOf(p.getKey()).matches(propToSkip)) + .collect(Collectors.toMap(e -> String.valueOf(e.getKey()), e -> String.valueOf(e.getValue()), + (prev, next) -> next, HashMap::new)); + // filter + if (!ROOT_GIT.matches(rootToSkip)) { + infos.put(ROOT_GIT, git); + } + // env + Map env = System.getenv().entrySet().stream().filter(p -> !p.getKey().matches(propToSkip)) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + // filter + if (!ROOT_ENV.matches(rootToSkip)) { + infos.put(ROOT_ENV, env); + } + // sys props + Map sysprops = System.getProperties().entrySet().stream() + .filter(p -> !String.valueOf(p.getKey()).matches(propToSkip)) + .collect(Collectors.toMap(e -> String.valueOf(e.getKey()), e -> String.valueOf(e.getValue()), + (prev, next) -> next, HashMap::new)); + // filter + if (!ROOT_SYSPROPS.matches(rootToSkip)) { + infos.put(ROOT_SYSPROPS, sysprops); + } + + // fixed + resp.setStatus(HttpServletResponse.SC_OK); + try { + resp.setContentType("application/json; charset=\"utf-8\""); + resp.getWriter().println(mapper.writeValueAsString(infos)); + } catch (IOException e) { + resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + log.error("Errore generico", e); + } + } + } + + /* + * Basic Auth con credenziali da anagrafica. Nota: si ri-utilizza per semplificare il processo di gestione, il + * servizio di monitoraggio che è comunque da considerasi ad utilizzo esclusivo interno / amministrativo. + */ + private boolean isUserAuthenticated(String authString, String ipAddr) { + if (StringUtils.isBlank(authString)) + return false; + String decodedAuth = ""; + // Header is in the format "Basic 5tyc0uiDat4" + // We need to extract data before decoding it back to original string + String[] authParts = authString.split("\\s+"); + String authInfo = authParts[1]; + // Decode the data back to original string + byte[] bytes = null; + bytes = new Base64().decode(authInfo); + decodedAuth = new String(bytes); + + final String AUTH_SPLITTERATOR = ":"; + final String loginName = decodedAuth.split(AUTH_SPLITTERATOR)[0]; + final String pwd = decodedAuth.split(AUTH_SPLITTERATOR)[1]; + + // check credentials + RispostaControlli rs = myControlliWs.checkCredenziali(loginName, pwd, ipAddr, + Costanti.TipiWSPerControlli.VERSAMENTO_RECUPERO); + + return rs.isrBoolean(); + } + + private String getIpAddrFromReq(HttpServletRequest request) { + String ipVers = request.getHeader("RERFwFor"); + // cerco l'header custom della RER + if (ipVers == null || ipVers.isEmpty()) { + ipVers = request.getHeader("X-FORWARDED-FOR"); + // se non c'e`, uso l'header standard + } + if (ipVers == null || ipVers.isEmpty()) { + ipVers = request.getRemoteAddr(); + // se non c'e` perche' la macchina e' esposta direttamente, + // leggo l'IP fisico del chiamante + } + log.info("Request, indirizzo di provenienza - IP: {}", ipVers); + return ipVers; + } +} diff --git a/sacerws-web/src/main/java/it/eng/parer/restWS/UpdVersamentoSrvlt.java b/sacerws-web/src/main/java/it/eng/parer/restWS/UpdVersamentoSrvlt.java index f998715..442a0ae 100644 --- a/sacerws-web/src/main/java/it/eng/parer/restWS/UpdVersamentoSrvlt.java +++ b/sacerws-web/src/main/java/it/eng/parer/restWS/UpdVersamentoSrvlt.java @@ -1,23 +1,43 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.restWS; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.WS_INSTANCE_NAME; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.WS_STAGING_UPLOAD_DIR; + import java.io.File; import java.io.IOException; import java.io.OutputStreamWriter; +import java.nio.charset.StandardCharsets; +import java.time.ZonedDateTime; import java.util.Iterator; import java.util.List; -import java.util.Properties; -import javax.naming.InitialContext; -import javax.naming.NamingException; +import javax.ejb.EJB; +import javax.servlet.ServletConfig; import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; +import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; +import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.disk.DiskFileItem; import org.apache.commons.fileupload.disk.DiskFileItemFactory; @@ -43,35 +63,36 @@ import it.eng.parer.ws.versamentoUpd.ejb.AggiornamentoVersamentoSync; import it.eng.parer.ws.versamentoUpd.ext.UpdVersamentoExt; import it.eng.parer.ws.versamentoUpd.utils.WSDescUpdVers; -import java.time.ZonedDateTime; +import it.eng.spagoCore.configuration.ConfigSingleton; /** * * @author sinatti_s */ +@WebServlet(urlPatterns = { "/AggiornamentoUnitaDocumentariaSync" }, asyncSupported = true) public class UpdVersamentoSrvlt extends HttpServlet { private static final long serialVersionUID = 1L; private static final Logger log = LoggerFactory.getLogger(UpdVersamentoSrvlt.class); - private final String uploadDir; - private final String instanceName; - private final boolean salvaLogSessione; + private String uploadDir; + private String instanceName; - public UpdVersamentoSrvlt() throws IOException { - super(); - Properties props = new Properties(); - props.load(this.getClass().getClassLoader().getResourceAsStream("/Sacer.properties")); - /* - * TODO: per il momento, dato che questo servizio fa riferimento ai versamenti (ne aggiorna i metadati), a rigor - * di logica dovrebbe utilizzare gli stessi parametri, a meno che non si decide di utilizzarne altri o di farne - * ad-hoc - */ + @EJB(mappedName = "java:app/sacerws-ejb/AggiornamentoVersamentoSync") + private AggiornamentoVersamentoSync aggVersamentoSync; - uploadDir = props.getProperty("recuperoSync.upload.directory"); - salvaLogSessione = props.getProperty("recuperoSync.saveLogSession").equals("1") ? true : false; + @EJB(mappedName = "java:app/sacerws-ejb/XmlUpdVersCache") + private XmlUpdVersCache xmlUpdVersCache; - instanceName = props.getProperty("ws.instanceName"); + // @EJB(mappedName = "java:app/sacerws-ejb/RequestPrsr") + @EJB + private RequestPrsr myRequestPrsr; + @Override + public void init(ServletConfig config) throws ServletException { + super.init(config); + // custom + uploadDir = ConfigSingleton.getInstance().getStringValue(WS_STAGING_UPLOAD_DIR.name()); + instanceName = ConfigSingleton.getInstance().getStringValue(WS_INSTANCE_NAME.name()); } @Override @@ -95,17 +116,13 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - AggiornamentoVersamentoSync aggVersamentoSync; - XmlUpdVersCache xmlUpdVersCache; RispostaWSUpdVers rispostaWs; UpdVersamentoExt myVersamentoExt; SyncFakeSessn sessioneFinta = new SyncFakeSessn(); - Iterator tmpIterator = null; + Iterator tmpIterator = null; DiskFileItem tmpFileItem = null; - List fileItems = null; + List fileItems = null; AvanzamentoWs tmpAvanzamento; - RequestPrsr myRequestPrsr = new RequestPrsr(); - RequestPrsr.ReqPrsrConfig tmpPrsrConfig = new RequestPrsr().new ReqPrsrConfig(); rispostaWs = new RispostaWSUpdVers(); myVersamentoExt = new UpdVersamentoExt(); @@ -115,20 +132,6 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) rispostaWs.setStatoSessioneVersamento(IRispostaWS.StatiSessioneVersEnum.ASSENTE); - // Recupera l'ejb, se possibile - altrimenti segnala errore - try { - aggVersamentoSync = (AggiornamentoVersamentoSync) new InitialContext() - .lookup("java:app/sacerws-ejb/AggiornamentoVersamentoSync"); - } catch (NamingException ex) { - throw new ServletException("Impossibile recuperare l'ejb AggiornamentoVersamentoSync ", ex); - } - - try { - xmlUpdVersCache = (XmlUpdVersCache) new InitialContext().lookup("java:app/sacerws-ejb/XmlUpdVersCache"); - } catch (NamingException ex) { - throw new ServletException("Impossibile recuperare l'ejb XmlUpdVersCache ", ex); - } - tmpAvanzamento.setFase("EJB recuperato").logAvanzamento(); aggVersamentoSync.init(rispostaWs, tmpAvanzamento, myVersamentoExt); @@ -153,7 +156,8 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) try { tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.TrasferimentoPayloadIn) .setFase("pronto a ricevere").logAvanzamento(); - // + + RequestPrsr.ReqPrsrConfig tmpPrsrConfig = RequestPrsr.createConfig(); tmpPrsrConfig.setLeggiFile(false); tmpPrsrConfig.setLeggindiceMM(false); tmpPrsrConfig.setAvanzamentoWs(tmpAvanzamento); @@ -319,28 +323,16 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) response.reset(); response.setStatus(HttpServletResponse.SC_OK); response.setContentType("application/xml; charset=\"utf-8\""); - ServletOutputStream out = response.getOutputStream(); - OutputStreamWriter tmpStreamWriter = new OutputStreamWriter(out, "UTF-8"); - try { - JAXBContext tmpcontesto = xmlUpdVersCache.getVersRespCtxforEsitoAggiornamentoVersamento(); - Marshaller tmpMarshaller = tmpcontesto.createMarshaller(); + try (OutputStreamWriter tmpStreamWriter = new OutputStreamWriter(response.getOutputStream(), + StandardCharsets.UTF_8);) { + + Marshaller tmpMarshaller = xmlUpdVersCache.getVersRespCtxforEsitoAggiornamentoVersamento() + .createMarshaller(); tmpMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); tmpMarshaller.marshal(myEsito.produciEsitoAggiornamento(), tmpStreamWriter); - } catch (JAXBException e) { + + } catch (Exception e) { log.error("Eccezione nella servlet aggiornamento versamento sync", e); - } finally { - try { - tmpStreamWriter.flush(); - tmpStreamWriter.close(); - } catch (Exception ei) { - log.error("Eccezione nella servlet aggiornamento versamento sync", ei); - } - try { - out.flush(); - out.close(); - } catch (Exception ei) { - log.error("Eccezione nella servlet aggiornamento versamento sync", ei); - } } tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.Fine).setFase("").logAvanzamento(); diff --git a/sacerws-web/src/main/java/it/eng/parer/restWS/VersamentoFascicoloSrvlt.java b/sacerws-web/src/main/java/it/eng/parer/restWS/VersamentoFascicoloSrvlt.java index 668b4d7..1a74271 100644 --- a/sacerws-web/src/main/java/it/eng/parer/restWS/VersamentoFascicoloSrvlt.java +++ b/sacerws-web/src/main/java/it/eng/parer/restWS/VersamentoFascicoloSrvlt.java @@ -1,5 +1,50 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.restWS; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.WS_INSTANCE_NAME; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.WS_STAGING_UPLOAD_DIR; + +import java.io.File; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.nio.charset.StandardCharsets; +import java.time.ZonedDateTime; +import java.util.Iterator; +import java.util.List; + +import javax.ejb.EJB; +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.xml.bind.Marshaller; + +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.FileUploadException; +import org.apache.commons.fileupload.disk.DiskFileItem; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; +import org.apache.commons.fileupload.servlet.ServletFileUpload; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import it.eng.parer.restWS.util.RequestPrsr; import it.eng.parer.restWS.util.Response405; import it.eng.parer.restWS.util.SrvltHandlingException; @@ -18,47 +63,36 @@ import it.eng.parer.ws.versamento.dto.SyncFakeSessn; import it.eng.parer.ws.xml.versfascicoloresp.ECEsitoPosNegType; import it.eng.parer.ws.xml.versfascicoloresp.ECEsitoXSDType; -import java.io.File; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.time.ZonedDateTime; -import java.util.Iterator; -import java.util.List; -import java.util.Properties; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import org.apache.commons.fileupload.FileUploadException; -import org.apache.commons.fileupload.disk.DiskFileItem; -import org.apache.commons.fileupload.disk.DiskFileItemFactory; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import it.eng.spagoCore.configuration.ConfigSingleton; /** * * @author fioravanti_f */ +@WebServlet(urlPatterns = { "/VersamentoFascicoloSync" }, asyncSupported = true) public class VersamentoFascicoloSrvlt extends HttpServlet { private static final long serialVersionUID = 1L; private static final Logger log = LoggerFactory.getLogger(VersamentoFascicoloSrvlt.class); - private final String uploadDir; - private final String instanceName; - - public VersamentoFascicoloSrvlt() throws IOException { - super(); - Properties props = new Properties(); - props.load(this.getClass().getClassLoader().getResourceAsStream("/Sacer.properties")); - uploadDir = props.getProperty("recuperoSync.upload.directory"); - instanceName = props.getProperty("ws.instanceName"); + private String uploadDir; + private String instanceName; + + @EJB(mappedName = "java:app/sacerws-ejb/VersFascicoloSync") + private VersFascicoloSync versFascicoloSync; + + @EJB(mappedName = "java:app/sacerws-ejb/XmlFascCache") + private XmlFascCache xmlFascCache; + + // @EJB(mappedName = "java:app/sacerws-ejb/RequestPrsr") + @EJB + private RequestPrsr myRequestPrsr; + + @Override + public void init(ServletConfig config) throws ServletException { + super.init(config); + // custom + uploadDir = ConfigSingleton.getInstance().getStringValue(WS_STAGING_UPLOAD_DIR.name()); + instanceName = ConfigSingleton.getInstance().getStringValue(WS_INSTANCE_NAME.name()); } @Override @@ -82,17 +116,13 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - VersFascicoloSync versFascicoloSync; - XmlFascCache xmlFascCache; RispostaWSFascicolo rispostaWs; VersFascicoloExt myVersamentoExt; SyncFakeSessn sessioneFinta = new SyncFakeSessn(); - Iterator tmpIterator = null; + Iterator tmpIterator = null; DiskFileItem tmpFileItem = null; - List fileItems = null; + List fileItems = null; AvanzamentoWs tmpAvanzamento; - RequestPrsr myRequestPrsr = new RequestPrsr(); - RequestPrsr.ReqPrsrConfig tmpPrsrConfig = new RequestPrsr().new ReqPrsrConfig(); rispostaWs = new RispostaWSFascicolo(); myVersamentoExt = new VersFascicoloExt(); @@ -104,22 +134,6 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) // (mi serve almeno l'user id definito nella chiamata del ws) rispostaWs.setStatoSessioneVersamento(IRispostaWS.StatiSessioneVersEnum.ASSENTE); - // Recupera l'ejb, se possibile - altrimenti segnala errore - try { - versFascicoloSync = (VersFascicoloSync) new InitialContext() - .lookup("java:app/sacerws-ejb/VersFascicoloSync"); - } catch (NamingException ex) { - log.error("Errore nel recupero dell'EJB VersamentoSync ", ex); - throw new ServletException("Impossibile recuperare l'ejb VersFascicoloSync ", ex); - } - - try { - xmlFascCache = (XmlFascCache) new InitialContext().lookup("java:app/sacerws-ejb/XmlFascCache"); - } catch (NamingException ex) { - log.error("Errore nel recupero dell'EJB XmlContextCache ", ex); - throw new ServletException("Impossibile recuperare l'ejb XmlFascCache ", ex); - } - tmpAvanzamento.setFase("EJB recuperato").logAvanzamento(); versFascicoloSync.init(rispostaWs, tmpAvanzamento, myVersamentoExt); @@ -144,7 +158,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) try { tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.TrasferimentoPayloadIn) .setFase("pronto a ricevere").logAvanzamento(); - // + RequestPrsr.ReqPrsrConfig tmpPrsrConfig = RequestPrsr.createConfig(); tmpPrsrConfig.setLeggiFile(false); tmpPrsrConfig.setLeggindiceMM(false); tmpPrsrConfig.setAvanzamentoWs(tmpAvanzamento); @@ -251,28 +265,15 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) response.reset(); response.setStatus(HttpServletResponse.SC_OK); response.setContentType("application/xml; charset=\"utf-8\""); - ServletOutputStream out = response.getOutputStream(); - OutputStreamWriter tmpStreamWriter = new OutputStreamWriter(out, "UTF-8"); - try { - JAXBContext tmpcontesto = xmlFascCache.getVersRespFascicoloCtx(); - Marshaller tmpMarshaller = tmpcontesto.createMarshaller(); + try (OutputStreamWriter tmpStreamWriter = new OutputStreamWriter(response.getOutputStream(), + StandardCharsets.UTF_8);) { + + Marshaller tmpMarshaller = xmlFascCache.getVersRespFascicoloCtx().createMarshaller(); tmpMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); tmpMarshaller.marshal(myEsito.produciEsitoFascicolo(), tmpStreamWriter); - } catch (JAXBException e) { + + } catch (Exception e) { log.error("Eccezione nella servlet versamento fascicolo sync", e); - } finally { - try { - tmpStreamWriter.flush(); - tmpStreamWriter.close(); - } catch (Exception ei) { - log.error("Eccezione nella servlet versamento fascicolo sync", ei); - } - try { - out.flush(); - out.close(); - } catch (Exception ei) { - log.error("Eccezione nella servlet versamento fascicolo sync", ei); - } } tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.Fine).setFase("").logAvanzamento(); diff --git a/sacerws-web/src/main/java/it/eng/parer/restWS/VersamentoMultiMSyncSrvlt.java b/sacerws-web/src/main/java/it/eng/parer/restWS/VersamentoMultiMSyncSrvlt.java index 6a48e09..4f20654 100644 --- a/sacerws-web/src/main/java/it/eng/parer/restWS/VersamentoMultiMSyncSrvlt.java +++ b/sacerws-web/src/main/java/it/eng/parer/restWS/VersamentoMultiMSyncSrvlt.java @@ -1,23 +1,46 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.restWS; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.WS_INSTANCE_NAME; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.WS_STAGING_UPLOAD_DIR; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.VERSAMENTO_SYNC_SAVE_LOG_SESSION; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.VERSAMENTO_SYNC_MAX_REQUEST_SIZE; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.VERSAMENTO_SYNC_MAX_FILE_SIZE; + import java.io.File; import java.io.IOException; import java.io.OutputStreamWriter; +import java.nio.charset.StandardCharsets; +import java.time.ZonedDateTime; import java.util.Iterator; import java.util.List; -import java.util.Properties; -import javax.naming.InitialContext; -import javax.naming.NamingException; +import javax.ejb.EJB; +import javax.servlet.ServletConfig; import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; +import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.xml.bind.MarshalException; import javax.xml.bind.Marshaller; -import javax.xml.bind.ValidationException; +import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.disk.DiskFileItem; import org.apache.commons.fileupload.disk.DiskFileItemFactory; @@ -38,37 +61,41 @@ import it.eng.parer.ws.versamentoMM.dto.WSDescVersamentoMM; import it.eng.parer.ws.versamentoMM.ejb.VersamentoSyncMM; import it.eng.parer.ws.xml.versResp.EsitoVersamento; -import java.time.ZonedDateTime; +import it.eng.spagoCore.configuration.ConfigSingleton; /** * Servlet implementation class VersamentoMultiMSyncSrvlt */ +@WebServlet(urlPatterns = { "/VersamentoMultiMedia" }, asyncSupported = true) public class VersamentoMultiMSyncSrvlt extends HttpServlet { private static final long serialVersionUID = 1L; private static final Logger log = LoggerFactory.getLogger(VersamentoMultiMSyncSrvlt.class); - private final String uploadDir; - private final boolean salvaLogSessione; - private final long maxRequestSize; - private final long maxFileSize; - private final String instanceName; + private String uploadDir; + private boolean salvaLogSessione; + private long maxRequestSize; + private long maxFileSize; + private String instanceName; - /** - * @see HttpServlet#HttpServlet() - * - * @throws IOException - * errore generico di tipo IO - */ - public VersamentoMultiMSyncSrvlt() throws IOException { - super(); - Properties props = new Properties(); - props.load(this.getClass().getClassLoader().getResourceAsStream("/Sacer.properties")); - uploadDir = props.getProperty("versamentoSync.upload.directory"); - salvaLogSessione = props.getProperty("versamentoSync.saveLogSession").equals("1") ? true : false; - maxRequestSize = Long.parseLong(props.getProperty("versamentoSync.maxRequestSize")); - maxFileSize = Long.parseLong(props.getProperty("versamentoSync.maxFileSize")); - - instanceName = props.getProperty("ws.instanceName"); + @EJB(mappedName = "java:app/sacerws-ejb/VersamentoSyncMM") + private VersamentoSyncMM versamentoSync; + + @EJB(mappedName = "java:app/sacerws-ejb/XmlVersCache") + private XmlVersCache xmlVersCache; + + // @EJB(mappedName = "java:app/sacerws-ejb/RequestPrsr") + @EJB + private RequestPrsr myRequestPrsr; + + @Override + public void init(ServletConfig config) throws ServletException { + super.init(config); + // custom + uploadDir = ConfigSingleton.getInstance().getStringValue(WS_STAGING_UPLOAD_DIR.name()); + salvaLogSessione = ConfigSingleton.getInstance().getBooleanValue(VERSAMENTO_SYNC_SAVE_LOG_SESSION.name()); + maxRequestSize = ConfigSingleton.getInstance().getLongValue(VERSAMENTO_SYNC_MAX_REQUEST_SIZE.name()); + maxFileSize = ConfigSingleton.getInstance().getLongValue(VERSAMENTO_SYNC_MAX_FILE_SIZE.name()); + instanceName = ConfigSingleton.getInstance().getStringValue(WS_INSTANCE_NAME.name()); } @Override @@ -87,18 +114,14 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - VersamentoSyncMM versamentoSync; - XmlVersCache xmlVersCache; RispostaWS rispostaWs; VersamentoMMExt myVersamentoMMExt; EsitoVersamento myEsito = new EsitoVersamento(); SyncFakeSessn sessioneFinta = new SyncFakeSessn(); - Iterator tmpIterator = null; + Iterator tmpIterator = null; DiskFileItem tmpFileItem = null; - List fileItems = null; + List fileItems = null; AvanzamentoWs tmpAvanzamento; - RequestPrsr myRequestPrsr = new RequestPrsr(); - RequestPrsr.ReqPrsrConfig tmpPrsrConfig = new RequestPrsr().new ReqPrsrConfig(); rispostaWs = new RispostaWS(); myVersamentoMMExt = new VersamentoMMExt(); @@ -106,19 +129,6 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) tmpAvanzamento = AvanzamentoWs.nuovoAvanzamentoWS(instanceName, AvanzamentoWs.Funzioni.VersamentoSync); tmpAvanzamento.logAvanzamento(); - // Recupera l'ejb, se possibile - altrimenti segnala errore - try { - versamentoSync = (VersamentoSyncMM) new InitialContext().lookup("java:app/sacerws-ejb/VersamentoSyncMM"); - } catch (NamingException ex) { - throw new ServletException("Impossibile recuperare l'ejb VersamentoSyncMM ", ex); - } - - try { - xmlVersCache = (XmlVersCache) new InitialContext().lookup("java:app/sacerws-ejb/XmlVersCache"); - } catch (NamingException ex) { - throw new ServletException("Impossibile recuperare l'ejb XmlVersCache ", ex); - } - tmpAvanzamento.setFase("EJB recuperato").logAvanzamento(); versamentoSync.init(rispostaWs, tmpAvanzamento, myVersamentoMMExt, myEsito); @@ -155,7 +165,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.TrasferimentoPayloadIn) .setFase("pronto a ricevere").logAvanzamento(); - // + RequestPrsr.ReqPrsrConfig tmpPrsrConfig = RequestPrsr.createConfig(); tmpPrsrConfig.setLeggiFile(false); tmpPrsrConfig.setLeggindiceMM(true); tmpPrsrConfig.setAvanzamentoWs(tmpAvanzamento); @@ -173,9 +183,9 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) .setFase("completata").logAvanzamento(); /* - * ******************************************************************************** fine della + * ***************************************************************************** *** fine della * verifica della struttura/signature del web service. Verifica dei dati effettivamente versati - * ******************************************************************************** + * ***************************************************************************** *** */ // testa se la versione è corretta if (rispostaWs.getSeverity() == SeverityEnum.OK) { @@ -206,7 +216,8 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) versamentoSync.parseXML(sessioneFinta, rispostaWs, myVersamentoMMExt); } - // verifica che tutti i componenti di tipo FILE dichiarati nell'XML abbiano avuto un corrispondente + // verifica che tutti i componenti di tipo FILE dichiarati nell'XML abbiano + // avuto un corrispondente // payload binario myEsito = rispostaWs.getIstanzaEsito(); if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { @@ -217,7 +228,18 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) uploadDir); } - // verifica che tutti i componenti di tipo FILE superino i controlli crittografici + // Se il backend di staging configurato è l'object storage qui avviene l'upload + // Nota: questo a fronte dei componenti da versare (vedi #versamentoSync.verificaCoerenzaComponenti) + if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { + tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.CopiaBackendStaging) + .setFase("inizio verifica/copia backend staging").logAvanzamento(); + versamentoSync.uploadComponentiStaging(sessioneFinta); + + tmpAvanzamento.setFase("fine verifica/copia backend staging").logAvanzamento(); + } + + // verifica che tutti i componenti di tipo FILE superino i controlli + // crittografici if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.VerificaFirmeComponenti) .setFase("inizio").logAvanzamento(); @@ -285,32 +307,15 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) response.reset(); response.setStatus(HttpServletResponse.SC_OK); response.setContentType("application/xml; charset=\"utf-8\""); - ServletOutputStream out = response.getOutputStream(); - OutputStreamWriter tmpStreamWriter = new OutputStreamWriter(out, "UTF-8"); + try (OutputStreamWriter tmpStreamWriter = new OutputStreamWriter(response.getOutputStream(), + StandardCharsets.UTF_8);) { - try { Marshaller tmpMarshaller = xmlVersCache.getVersRespCtxforEsitoVersamento().createMarshaller(); tmpMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); tmpMarshaller.marshal(myEsito, tmpStreamWriter); - } catch (MarshalException e) { - log.error("Eccezione nella servlet versamentoMM sync", e); - } catch (ValidationException e) { - log.error("Eccezione nella servlet versamentoMM sync", e); + } catch (Exception e) { log.error("Eccezione nella servlet versamentoMM sync", e); - } finally { - try { - tmpStreamWriter.flush(); - tmpStreamWriter.close(); - } catch (Exception ei) { - log.error("Eccezione nella servlet versamentoMM sync", ei); - } - try { - out.flush(); - out.close(); - } catch (Exception ei) { - log.error("Eccezione nella servlet versamentoMM sync", ei); - } } tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.Fine).setFase("").logAvanzamento(); diff --git a/sacerws-web/src/main/java/it/eng/parer/restWS/VersamentoSyncSrvlt.java b/sacerws-web/src/main/java/it/eng/parer/restWS/VersamentoSyncSrvlt.java index 352d31d..8a5ec5c 100644 --- a/sacerws-web/src/main/java/it/eng/parer/restWS/VersamentoSyncSrvlt.java +++ b/sacerws-web/src/main/java/it/eng/parer/restWS/VersamentoSyncSrvlt.java @@ -1,73 +1,103 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + package it.eng.parer.restWS; -import it.eng.parer.restWS.util.RequestPrsr; -import it.eng.parer.restWS.util.Response405; -import it.eng.parer.restWS.util.SrvltHandlingException; import static it.eng.parer.util.DateUtilsConverter.format; -import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; -import it.eng.parer.ws.ejb.XmlVersCache; -import it.eng.parer.ws.utils.AvanzamentoWs; -import it.eng.parer.ws.utils.MessaggiWSBundle; -import it.eng.parer.ws.versamento.dto.FileBinario; -import it.eng.parer.ws.versamento.dto.RispostaWS; -import it.eng.parer.ws.versamento.dto.SyncFakeSessn; -import it.eng.parer.ws.versamento.dto.VersamentoExt; -import it.eng.parer.ws.versamento.dto.WSDescVersamento; -import it.eng.parer.ws.versamento.ejb.VersamentoSync; -import it.eng.parer.ws.xml.versResp.EsitoVersamento; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.VERSAMENTO_SYNC_MAX_FILE_SIZE; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.VERSAMENTO_SYNC_MAX_REQUEST_SIZE; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.VERSAMENTO_SYNC_SAVE_LOG_SESSION; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.WS_INSTANCE_NAME; +import static it.eng.spagoCore.configuration.ConfigProperties.StandardProperty.WS_STAGING_UPLOAD_DIR; + import java.io.File; import java.io.IOException; import java.io.OutputStreamWriter; +import java.nio.charset.StandardCharsets; import java.time.ZonedDateTime; import java.util.Iterator; import java.util.List; -import java.util.Properties; -import javax.naming.InitialContext; -import javax.naming.NamingException; + +import javax.ejb.EJB; +import javax.servlet.ServletConfig; import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; +import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.xml.bind.MarshalException; +import javax.xml.bind.Marshaller; + +import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.disk.DiskFileItem; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.xml.bind.Marshaller; -import javax.xml.bind.ValidationException; + +import it.eng.parer.restWS.util.RequestPrsr; +import it.eng.parer.restWS.util.Response405; +import it.eng.parer.restWS.util.SrvltHandlingException; +import it.eng.parer.ws.dto.IRispostaWS; +import it.eng.parer.ws.dto.IRispostaWS.SeverityEnum; +import it.eng.parer.ws.ejb.XmlVersCache; +import it.eng.parer.ws.utils.AvanzamentoWs; +import it.eng.parer.ws.utils.MessaggiWSBundle; +import it.eng.parer.ws.versamento.dto.FileBinario; +import it.eng.parer.ws.versamento.dto.RispostaWS; +import it.eng.parer.ws.versamento.dto.SyncFakeSessn; +import it.eng.parer.ws.versamento.dto.VersamentoExt; +import it.eng.parer.ws.versamento.dto.WSDescVersamento; +import it.eng.parer.ws.versamento.ejb.VersamentoSync; +import it.eng.parer.ws.xml.versResp.EsitoVersamento; +import it.eng.spagoCore.configuration.ConfigSingleton; /** * Servlet implementation class VersamentoSyncSrvlt */ +@WebServlet(urlPatterns = { "/VersamentoSync" }, asyncSupported = true) public class VersamentoSyncSrvlt extends HttpServlet { private static final long serialVersionUID = 1L; private static final Logger log = LoggerFactory.getLogger(VersamentoSyncSrvlt.class); - private final String uploadDir; - private final boolean salvaLogSessione; - private final long maxRequestSize; - private final long maxFileSize; - private final String instanceName; + private String uploadDir; + private boolean salvaLogSessione; + private long maxRequestSize; + private long maxFileSize; + private String instanceName; - /** - * @see HttpServlet#HttpServlet() - * - * @throws IOException - * errore generico - */ - public VersamentoSyncSrvlt() throws IOException { - super(); - Properties props = new Properties(); - props.load(this.getClass().getClassLoader().getResourceAsStream("/Sacer.properties")); - uploadDir = props.getProperty("versamentoSync.upload.directory"); - salvaLogSessione = props.getProperty("versamentoSync.saveLogSession").equals("1") ? true : false; - maxRequestSize = Long.parseLong(props.getProperty("versamentoSync.maxRequestSize")); - maxFileSize = Long.parseLong(props.getProperty("versamentoSync.maxFileSize")); - - instanceName = props.getProperty("ws.instanceName"); + @EJB(mappedName = "java:app/sacerws-ejb/VersamentoSync") + private VersamentoSync versamentoSync; + + @EJB(mappedName = "java:app/sacerws-ejb/XmlVersCache") + private XmlVersCache xmlVersCache; + + @EJB + private RequestPrsr myRequestPrsr; + + @Override + public void init(ServletConfig config) throws ServletException { + super.init(config); + // custom + uploadDir = ConfigSingleton.getInstance().getStringValue(WS_STAGING_UPLOAD_DIR.name()); + salvaLogSessione = ConfigSingleton.getInstance().getBooleanValue(VERSAMENTO_SYNC_SAVE_LOG_SESSION.name()); + maxRequestSize = ConfigSingleton.getInstance().getLongValue(VERSAMENTO_SYNC_MAX_REQUEST_SIZE.name()); + maxFileSize = ConfigSingleton.getInstance().getLongValue(VERSAMENTO_SYNC_MAX_FILE_SIZE.name()); + instanceName = ConfigSingleton.getInstance().getStringValue(WS_INSTANCE_NAME.name()); } @Override @@ -86,18 +116,14 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - VersamentoSync versamentoSync; - XmlVersCache xmlVersCache; RispostaWS rispostaWs; VersamentoExt myVersamentoExt; EsitoVersamento myEsito = new EsitoVersamento(); SyncFakeSessn sessioneFinta = new SyncFakeSessn(); - Iterator tmpIterator = null; + Iterator tmpIterator = null; DiskFileItem tmpFileItem = null; - List fileItems = null; + List fileItems = null; AvanzamentoWs tmpAvanzamento; - RequestPrsr myRequestPrsr = new RequestPrsr(); - RequestPrsr.ReqPrsrConfig tmpPrsrConfig = new RequestPrsr().new ReqPrsrConfig(); rispostaWs = new RispostaWS(); myVersamentoExt = new VersamentoExt(); @@ -105,21 +131,6 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) tmpAvanzamento = AvanzamentoWs.nuovoAvanzamentoWS(instanceName, AvanzamentoWs.Funzioni.VersamentoSync); tmpAvanzamento.logAvanzamento(); - // Recupera l'ejb, se possibile - altrimenti segnala errore - try { - versamentoSync = (VersamentoSync) new InitialContext().lookup("java:app/sacerws-ejb/VersamentoSync"); - } catch (NamingException ex) { - log.error("Errore nel recupero dell'EJB VersamentoSync ", ex); - throw new ServletException("Impossibile recuperare l'ejb VersamentoSync ", ex); - } - - try { - xmlVersCache = (XmlVersCache) new InitialContext().lookup("java:app/sacerws-ejb/XmlVersCache"); - } catch (NamingException ex) { - log.error("Errore nel recupero dell'EJB XmlContextCache ", ex); - throw new ServletException("Impossibile recuperare l'ejb XmlVersCache ", ex); - } - tmpAvanzamento.setFase("EJB recuperato").logAvanzamento(); versamentoSync.init(rispostaWs, tmpAvanzamento, myVersamentoExt, myEsito); @@ -155,7 +166,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.TrasferimentoPayloadIn) .setFase("pronto a ricevere").logAvanzamento(); - // + RequestPrsr.ReqPrsrConfig tmpPrsrConfig = RequestPrsr.createConfig(); tmpPrsrConfig.setLeggiFile(true); tmpPrsrConfig.setLeggindiceMM(false); tmpPrsrConfig.setAvanzamentoWs(tmpAvanzamento); @@ -168,14 +179,23 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) if (rispostaWs.getSeverity() != SeverityEnum.OK) { rispostaWs.setEsitoWsError(rispostaWs.getErrorCode(), rispostaWs.getErrorMessage()); } - + // ---> i file sono caricati in locale!! tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.VerificaStrutturaChiamataWs) .setFase("completata").logAvanzamento(); + // Se il backend di staging configurato è l'object storage qui avviene l'upload + if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { + tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.CopiaBackendStaging) + .setFase("inizio verifica/copia backend staging").logAvanzamento(); + versamentoSync.uploadComponentiStaging(sessioneFinta); + + tmpAvanzamento.setFase("fine verifica/copia backend staging").logAvanzamento(); + } + /* - * ******************************************************************************** fine della + * ***************************************************************************** *** fine della * verifica della struttura/signature del web service. Verifica dei dati effettivamente versati - * ******************************************************************************** + * ***************************************************************************** *** */ // testa se la versione è corretta if (rispostaWs.getSeverity() == SeverityEnum.OK) { @@ -212,7 +232,8 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) } } - // verifica che tutti i componenti di tipo FILE dichiarati nell'XML abbiano avuto un corrispondente + // verifica che tutti i componenti di tipo FILE dichiarati nell'XML abbiano + // avuto un corrispondente // payload binario myEsito = rispostaWs.getIstanzaEsito(); if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { @@ -221,7 +242,10 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) versamentoSync.verificaCoerenzaComponenti(rispostaWs, myVersamentoExt); } - // verifica che tutti i componenti di tipo FILE superino i controlli crittografici + /// ---------------> qui i file devono essere in staging + // la verifica firme deve essere asyncronous + // verifica che tutti i componenti di tipo FILE superino i controlli + // crittografici if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.VerificaFirmeComponenti) .setFase("inizio").logAvanzamento(); @@ -237,20 +261,13 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) * per lo meno la sessione di versamento con gli errori. Da notare che entrambi i salvataggi possono * essere disattivati, l'uno tramite una property e l'altro tramite un tag dell'XML di versamento. */ - if (rispostaWs.getErrorType() != RispostaWS.ErrorTypeEnum.WS_SIGNATURE) { + if (rispostaWs.getErrorType() != IRispostaWS.ErrorTypeEnum.WS_SIGNATURE) { versamentoSync.salvaTutto(sessioneFinta, rispostaWs, myVersamentoExt); } // prepara risposta myEsito = rispostaWs.getIstanzaEsito(); - // MEV#27048 - // TODO: da spostare nel salvaTutto e da rimuovere - // if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { - // versamentoSync.gestisciUdInAttesaSched(rispostaWs, myVersamentoExt); - // } - // end MEV#27048 - } catch (FileUploadException e1) { rispostaWs.setSeverity(SeverityEnum.ERROR); rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, @@ -291,32 +308,13 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) response.reset(); response.setStatus(HttpServletResponse.SC_OK); response.setContentType("application/xml; charset=\"utf-8\""); - ServletOutputStream out = response.getOutputStream(); - OutputStreamWriter tmpStreamWriter = new OutputStreamWriter(out, "UTF-8"); - - try { + try (OutputStreamWriter tmpStreamWriter = new OutputStreamWriter(response.getOutputStream(), + StandardCharsets.UTF_8);) { Marshaller tmpMarshaller = xmlVersCache.getVersRespCtxforEsitoVersamento().createMarshaller(); tmpMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); tmpMarshaller.marshal(myEsito, tmpStreamWriter); - } catch (MarshalException e) { - log.error("Eccezione nella servlet versamento sync", e); - } catch (ValidationException e) { - log.error("Eccezione nella servlet versamento sync", e); } catch (Exception e) { log.error("Eccezione nella servlet versamento sync", e); - } finally { - try { - tmpStreamWriter.flush(); - tmpStreamWriter.close(); - } catch (Exception ei) { - log.error("Eccezione nella servlet versamento sync", ei); - } - try { - out.flush(); - out.close(); - } catch (Exception ei) { - log.error("Eccezione nella servlet versamento sync", ei); - } } tmpAvanzamento.setCheckPoint(AvanzamentoWs.CheckPoints.Fine).setFase("").logAvanzamento(); diff --git a/sacerws-web/src/main/java/it/eng/parer/restWS/util/AbsRequestPrsr.java b/sacerws-web/src/main/java/it/eng/parer/restWS/util/AbsRequestPrsr.java deleted file mode 100644 index 33019be..0000000 --- a/sacerws-web/src/main/java/it/eng/parer/restWS/util/AbsRequestPrsr.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package it.eng.parer.restWS.util; - -import javax.servlet.http.HttpServletRequest; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author fioravanti_f - */ -public abstract class AbsRequestPrsr { - private static final Logger log = LoggerFactory.getLogger(AbsRequestPrsr.class); - - /** - * lettura dell'indirizzo IP del chiamante. Si presuppone che il load balancer o il reverse proxy impostino la - * variabile RERFwFor tra gli header HTTP della request. Questo è un tag custom messo a punto dalla RER per - * compensare ai possibili rischi legati all'uso dell'header X-FORWARDED-FOR di uso più comune. Da notare che - * qualora l'header RERFwFor non fosse valorizzato, il codice ripiegherà cercando X-FORWARDED-FOR tra gli header - * HTTP della request. Questo è l'unico sistema per recepire l'IP nel caso in cui l'application server non sia - * esposto direttamente. NOTA: è ovvio che l'application server è esposto direttamente solo sui PC di sviluppo. - * - * @param request - * standard {@link HttpServletRequest} - * - * @return ip client letto ottenuto da request - */ - public String leggiIpVersante(HttpServletRequest request) { - String ipVers = request.getHeader("RERFwFor"); - // cerco l'header custom della RER - if (ipVers == null || ipVers.isEmpty()) { - ipVers = request.getHeader("X-FORWARDED-FOR"); - // se non c'e`, uso l'header standard - } - if (ipVers == null || ipVers.isEmpty()) { - ipVers = request.getRemoteAddr(); - // se non c'e` perche' la macchina e' esposta direttamente, - // leggo l'IP fisico del chiamante - } - log.info("Request, indirizzo di provenienza - IP: {}", ipVers); - return ipVers; - } - -} diff --git a/sacerws-web/src/main/java/it/eng/parer/restWS/util/RequestPrsr.java b/sacerws-web/src/main/java/it/eng/parer/restWS/util/RequestPrsr.java index f2ef7d1..9232048 100644 --- a/sacerws-web/src/main/java/it/eng/parer/restWS/util/RequestPrsr.java +++ b/sacerws-web/src/main/java/it/eng/parer/restWS/util/RequestPrsr.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -11,7 +28,12 @@ import it.eng.parer.ws.versamento.dto.SyncFakeSessn; import java.util.Iterator; import java.util.List; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; import javax.servlet.http.HttpServletRequest; +import java.nio.file.Files; +import java.io.File; +import java.io.IOException; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.disk.DiskFileItem; @@ -24,12 +46,14 @@ * * @author Fioravanti_F */ -public class RequestPrsr extends AbsRequestPrsr { +// @Stateless(mappedName = "RequestPrsr") +@Stateless +@LocalBean +public class RequestPrsr { - private static final long serialVersionUID = 1L; private static final Logger log = LoggerFactory.getLogger(RequestPrsr.class); - public class ReqPrsrConfig { + public static class ReqPrsrConfig { private boolean leggiFile; private boolean leggindiceMM; @@ -38,6 +62,10 @@ public class ReqPrsrConfig { private HttpServletRequest request; ServletFileUpload uploadHandler; + private ReqPrsrConfig() { + super(); + } + public boolean isLeggiFile() { return leggiFile; } @@ -87,6 +115,10 @@ public void setUploadHandler(ServletFileUpload uploadHandler) { } } + public static ReqPrsrConfig createConfig() { + return new ReqPrsrConfig(); + } + /** * Nota bene: è fondamentale che questo metodo renda la collection di FileItem, e che il chiamante ne tenga una * copia: la deallocazione del DiskFileItem a causa della GC e la conseguente chiamata del metodo finalize() @@ -94,21 +126,21 @@ public void setUploadHandler(ServletFileUpload uploadHandler) { * effetto di avere un File handler che non punta a nulla; il fenomeno è difficile da replicare ma estremamente * insidioso. Si manifesta con errori apparentemente casuali in cui le procedure di lettura del file (verifica firma * e persistenza) vanno in eccezione per mancanza di file. (File not found exception) - * + * * @param rispostaWs * interfaccia con definizione della risposta {@link IRispostaWS} * @param configurazione * dto configurazione {@link ReqPrsrConfig} - * + * * @return lista parti multipart/form-data di tipo {@link FileItem} - * + * * @throws FileUploadException * errore generico */ public List parse(IRispostaWS rispostaWs, ReqPrsrConfig configurazione) throws FileUploadException { - Iterator tmpIterator = null; + Iterator tmpIterator = null; DiskFileItem tmpFileItem = null; - List fileItems = null; + List fileItems = null; FileBinario tmpFileBinario; // lettura configurazione; @@ -135,7 +167,6 @@ public List parse(IRispostaWS rispostaWs, ReqPrsrConfig configurazione tmpFileItem = (DiskFileItem) tmpIterator.next(); if (tmpFileItem.isFormField()) { if (tmpFileItem.getFieldName().equals("VERSIONE")) { - // log.info("VERSIONE " + tmpFileItem.getString()); sessioneFinta.setVersioneWS(tmpFileItem.getString()); } else { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); @@ -157,7 +188,7 @@ public List parse(IRispostaWS rispostaWs, ReqPrsrConfig configurazione tmpFileItem = (DiskFileItem) tmpIterator.next(); if (tmpFileItem.isFormField()) { if (tmpFileItem.getFieldName().equals("LOGINNAME")) { - log.info("LOGINNAME " + tmpFileItem.getString()); + log.info("LOGINNAME {}", tmpFileItem.getString()); sessioneFinta.setLoginName(tmpFileItem.getString()); tmpAvanzamento.setVrsUser(tmpFileItem.getString()).logAvanzamento(); } else { @@ -181,7 +212,6 @@ public List parse(IRispostaWS rispostaWs, ReqPrsrConfig configurazione tmpFileItem = (DiskFileItem) tmpIterator.next(); if (tmpFileItem.isFormField()) { if (tmpFileItem.getFieldName().equals("PASSWORD")) { - // log.info("PASSWORD " + tmpFileItem.getString()); sessioneFinta.setPassword(tmpFileItem.getString()); } else { rispostaWs.setSeverity(IRispostaWS.SeverityEnum.ERROR); @@ -205,7 +235,6 @@ public List parse(IRispostaWS rispostaWs, ReqPrsrConfig configurazione tmpFileItem = (DiskFileItem) tmpIterator.next(); if (tmpFileItem.isFormField()) { if (tmpFileItem.getFieldName().equals("XMLINDICE")) { - // log.info("XMLINDICE trovato"); // sessioneFinta.setDatiPackInfoSipXml(tmpFileItem.getString()); // @@ -231,7 +260,6 @@ public List parse(IRispostaWS rispostaWs, ReqPrsrConfig configurazione tmpFileItem = (DiskFileItem) tmpIterator.next(); if (tmpFileItem.isFormField()) { if (tmpFileItem.getFieldName().equals("XMLSIP")) { - // log.info("XMLSIP trovato"); sessioneFinta.setDatiIndiceSipXml(tmpFileItem.getString()); sessioneFinta.setDatiDaSalvareIndiceSip(tmpFileItem.getString()); } else { @@ -261,14 +289,11 @@ public List parse(IRispostaWS rispostaWs, ReqPrsrConfig configurazione tmpFileBinario = new FileBinario(); tmpFileBinario.setId(tmpFileItem.getFieldName()); tmpFileBinario.setFileName(fileName); + tmpFileBinario.setDimensione(sizeInBytes); if (tmpFileItem.isInMemory()) { - tmpFileBinario.setInMemoria(true); - tmpFileBinario.setDati(tmpFileItem.get()); - tmpFileBinario.setDimensione(sizeInBytes); + tmpFileBinario.setFileSuDisco(createFile(tmpFileItem.get())); } else { - tmpFileBinario.setInMemoria(false); tmpFileBinario.setFileSuDisco(tmpFileItem.getStoreLocation()); - tmpFileBinario.setDimensione(sizeInBytes); } sessioneFinta.getFileBinari().add(tmpFileBinario); } @@ -283,4 +308,45 @@ public List parse(IRispostaWS rispostaWs, ReqPrsrConfig configurazione } return fileItems; } + + private static File createFile(byte[] content) throws FileUploadException { + try { + File createTempFile = File.createTempFile("service", ".inmemory"); + Files.write(createTempFile.toPath(), content); + return createTempFile; + + } catch (IOException ex) { + throw new FileUploadException("Impossibile creare un file a partire dai dati in memoria", ex); + } + } + + /** + * lettura dell'indirizzo IP del chiamante. Si presuppone che il load balancer o il reverse proxy impostino la + * variabile RERFwFor tra gli header HTTP della request. Questo è un tag custom messo a punto dalla RER per + * compensare ai possibili rischi legati all'uso dell'header X-FORWARDED-FOR di uso più comune. Da notare che + * qualora l'header RERFwFor non fosse valorizzato, il codice ripiegherà cercando X-FORWARDED-FOR tra gli header + * HTTP della request. Questo è l'unico sistema per recepire l'IP nel caso in cui l'application server non sia + * esposto direttamente. NOTA: è ovvio che l'application server è esposto direttamente solo sui PC di sviluppo. + * + * @param request + * standard {@link HttpServletRequest} + * + * @return ip client letto ottenuto da request + */ + public String leggiIpVersante(HttpServletRequest request) { + String ipVers = request.getHeader("RERFwFor"); + // cerco l'header custom della RER + if (ipVers == null || ipVers.isEmpty()) { + ipVers = request.getHeader("X-FORWARDED-FOR"); + // se non c'e`, uso l'header standard + } + if (ipVers == null || ipVers.isEmpty()) { + ipVers = request.getRemoteAddr(); + // se non c'e` perche' la macchina e' esposta direttamente, + // leggo l'IP fisico del chiamante + } + log.info("Request, indirizzo di provenienza - IP: {}", ipVers); + return ipVers; + } + } diff --git a/sacerws-web/src/main/java/it/eng/parer/restWS/util/Response405.java b/sacerws-web/src/main/java/it/eng/parer/restWS/util/Response405.java index 3a21734..9fb7d16 100644 --- a/sacerws-web/src/main/java/it/eng/parer/restWS/util/Response405.java +++ b/sacerws-web/src/main/java/it/eng/parer/restWS/util/Response405.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-web/src/main/java/it/eng/parer/restWS/util/SrvltHandlingException.java b/sacerws-web/src/main/java/it/eng/parer/restWS/util/SrvltHandlingException.java index b6f6bd8..3869d95 100644 --- a/sacerws-web/src/main/java/it/eng/parer/restWS/util/SrvltHandlingException.java +++ b/sacerws-web/src/main/java/it/eng/parer/restWS/util/SrvltHandlingException.java @@ -1,3 +1,20 @@ +/* + * Engineering Ingegneria Informatica S.p.A. + * + * Copyright (C) 2023 Regione Emilia-Romagna + *

+ * This program is free software: you can redistribute it and/or modify it under the terms of + * the GNU Affero General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Affero General Public License for more details. + *

+ * You should have received a copy of the GNU Affero General Public License along with this program. + * If not, see . + */ + /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates diff --git a/sacerws-web/src/main/resources/Sacer.properties b/sacerws-web/src/main/resources/Sacer.properties deleted file mode 100644 index e1efd87..0000000 --- a/sacerws-web/src/main/resources/Sacer.properties +++ /dev/null @@ -1,328 +0,0 @@ -#Configurazione dello schedulatore dei job -################################ - -#job creazione elenchi -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione ogni 20 minuti -job.sched.elenchi.autoStart=1 -job.sched.elenchi.hour=* -job.sched.elenchi.minute=0,20,40 -job.sched.elenchi.dayOfMonth=* -job.sched.elenchi.month=* -job.sched.elenchi.dayOfWeek=* - -#job creazione indici -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione ogni mezz'ora -job.sched.indici.autoStart=1 -job.sched.indici.hour=* -job.sched.indici.minute=0,30 -job.sched.indici.dayOfMonth=* -job.sched.indici.month=* -job.sched.indici.dayOfWeek=* - -#job verifica firme -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione ogni mezz'ora -job.sched.firme.autoStart=1 -job.sched.firme.hour=* -job.sched.firme.minute=15,45 -job.sched.firme.dayOfMonth=* -job.sched.firme.month=* -job.sched.firme.dayOfWeek=* - -#job scarico CRL -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione ai minuti 20, 50 di ogni ora tranne che nelle 2 ore a cavallo della mezzanotte -job.sched.crl.autoStart=1 -job.sched.crl.hour=1-22 -job.sched.crl.minute=20,50 -job.sched.crl.dayOfMonth=* -job.sched.crl.month=* -job.sched.crl.dayOfWeek=* - -#job allineamento CA -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione alla mezzanotte e cinque di ogni giorno -job.sched.ca.autoStart=1 -job.sched.ca.hour=0 -job.sched.ca.minute=5 -job.sched.ca.dayOfMonth=* -job.sched.ca.month=* -job.sched.ca.dayOfWeek=* - -#job calcola contenuto sacer -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione alla mezzanotte e 35 di ogni giorno -job.sched.ccs.autoStart=1 -job.sched.ccs.hour=0 -job.sched.ccs.minute=35 -job.sched.ccs.dayOfMonth=* -job.sched.ccs.month=* -job.sched.ccs.dayOfWeek=* - -#job allineamento organizzazioni -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione ogni 5 minuti -job.sched.ao.autoStart=1 -job.sched.ao.hour=* -job.sched.ao.minute=0,5,10,15,20,25,30,35,40,45,50,55 -job.sched.ao.dayOfMonth=* -job.sched.ao.month=* -job.sched.ao.dayOfWeek=* - -## Job per il TPI - -#job aggiorna stato archiviazione -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione ogni ora, al decimo minuto -job.sched.upArk.autoStart=0 -job.sched.upArk.hour=* -job.sched.upArk.minute=10 -job.sched.upArk.dayOfMonth=* -job.sched.upArk.month=* -job.sched.upArk.dayOfWeek=* - -#job elabora sessioni recupero -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione ogni 20 minuti -job.sched.recArk.autoStart=0 -job.sched.recArk.hour=* -job.sched.recArk.minute=0,20,40 -job.sched.recArk.dayOfMonth=* -job.sched.recArk.month=* -job.sched.recArk.dayOfWeek=* - -#job registra schedulazioni job tpi -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione ogni ora, al 20esimo minuto -job.sched.schedJobTpi.autoStart=0 -job.sched.schedJobTpi.hour=* -job.sched.schedJobTpi.minute=20 -job.sched.schedJobTpi.dayOfMonth=* -job.sched.schedJobTpi.month=* -job.sched.schedJobTpi.dayOfWeek=* - -#job migrazione cartella versamento -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione alle ore 00:30 di ogni giorno -job.sched.migrCarVers.autoStart=0 -job.sched.migrCarVers.hour=0 -job.sched.migrCarVers.minute=30 -job.sched.migrCarVers.dayOfMonth=* -job.sched.migrCarVers.month=* -job.sched.migrCarVers.dayOfWeek=* - -#job cancella file migrati -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione alle ore 12:00 di ogni giorno -job.sched.cancFileMigr.autoStart=0 -job.sched.cancFileMigr.hour=12 -job.sched.cancFileMigr.minute=0 -job.sched.cancFileMigr.dayOfMonth=* -job.sched.cancFileMigr.month=* -job.sched.cancFileMigr.dayOfWeek=* - -#job creazione indici AIP -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione ogni 20 minuti -job.sched.indiciAip.autoStart=1 -job.sched.indiciAip.hour=* -job.sched.indiciAip.minute=0,20,40 -job.sched.indiciAip.dayOfMonth=* -job.sched.indiciAip.month=* -job.sched.indiciAip.dayOfWeek=* - -#job verifica massiva versamenti falliti -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione alle ore 06:00 di ogni giorno -job.sched.verificaMassVersFall.autoStart=1 -job.sched.verificaMassVersFall.hour=6 -job.sched.verificaMassVersFall.minute=0 -job.sched.verificaMassVersFall.dayOfMonth=* -job.sched.verificaMassVersFall.month=* -job.sched.verificaMassVersFall.dayOfWeek=* - -#job duplicazione criteri raggruppamento automatici -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione una volta all'anno, alle ore 00:01 -job.sched.duplicaCritRaggrAut.autoStart=1 -job.sched.duplicaCritRaggrAut.hour=0 -job.sched.duplicaCritRaggrAut.minute=1 -job.sched.duplicaCritRaggrAut.dayOfMonth=1 -job.sched.duplicaCritRaggrAut.month=1 -job.sched.duplicaCritRaggrAut.dayOfWeek=* - -#job verifica compatibilita registri -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione ogni ora al minuto 15 -job.sched.verificaPeriodoReg.autoStart=0 -job.sched.verificaPeriodoReg.hour=* -job.sched.verificaPeriodoReg.minute=15,45 -job.sched.verificaPeriodoReg.dayOfMonth=* -job.sched.verificaPeriodoReg.month=* -job.sched.verificaPeriodoReg.dayOfWeek=* - -#job creazione automatica serie -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione alle ore 00:15 di ogni giorno -job.sched.creaAutomSerie.autoStart=0 -job.sched.creaAutomSerie.hour=0 -job.sched.creaAutomSerie.minute=15 -job.sched.creaAutomSerie.dayOfMonth=* -job.sched.creaAutomSerie.month=* -job.sched.creaAutomSerie.dayOfWeek=* - -#job creazione indici AIP Serie Ud -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione ogni ora -job.sched.indiciAipSerieUd.autoStart=0 -job.sched.indiciAipSerieUd.hour=* -job.sched.indiciAipSerieUd.minute=0 -job.sched.indiciAipSerieUd.dayOfMonth=* -job.sched.indiciAipSerieUd.month=* -job.sched.indiciAipSerieUd.dayOfWeek=* - -#job generazione automatica del contenuto EFFETTIVO Serie UD -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione alle ore 06:15 di ogni giorno -job.sched.generaAutomContenEff.autoStart=0 -job.sched.generaAutomContenEff.hour=6 -job.sched.generaAutomContenEff.minute=15 -job.sched.generaAutomContenEff.dayOfMonth=* -job.sched.generaAutomContenEff.month=* -job.sched.generaAutomContenEff.dayOfWeek=* - -#job controllo automatico del contenuto EFFETTIVO Serie UD -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione alle ore 12:15 di ogni giorno -job.sched.controlloAutomContenEff.autoStart=0 -job.sched.controlloAutomContenEff.hour=12 -job.sched.controlloAutomContenEff.minute=15 -job.sched.controlloAutomContenEff.dayOfMonth=* -job.sched.controlloAutomContenEff.month=* -job.sched.controlloAutomContenEff.dayOfWeek=* - -#job annullamento versamenti unit\u00e0 documentarie -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione ogni ora dalle 09:00 alle 20:00 -job.sched.annulVers.autoStart=1 -job.sched.annulVers.hour=9-20 -job.sched.annulVers.minute=0 -job.sched.annulVers.dayOfMonth=* -job.sched.annulVers.month=* -job.sched.annulVers.dayOfWeek=* - -#job calcolo struttura asincrono -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione ogni ore 00:10 di ogni giorno -job.sched.calcoloStruttura.autoStart=0 -job.sched.calcoloStruttura.hour=0 -job.sched.calcoloStruttura.minute=10 -job.sched.calcoloStruttura.dayOfMonth=* -job.sched.calcoloStruttura.month=* -job.sched.calcoloStruttura.dayOfWeek=* - -#job allineamento log -# ---------------------------------------------------- -#il settaggio attuale corrisponde ad un'esecuzione ogni 1 minuti -job.sched.allineamentolog.autoStart=1 -job.sched.allineamentolog.hour=1,13 -job.sched.allineamentolog.minute=0 -job.sched.allineamentolog.dayOfMonth=* -job.sched.allineamentolog.month=* -job.sched.allineamentolog.dayOfWeek=* - -# Configurazione del Web service REST -################################ - -#Configurazione variabili globali dei WS -# ---------------------------------------------------- -#nome dell'istanza dell'applicazione, usato nei log -#relativi alle performance e nella generazione degli -#ID sessione nel versamento asincrono -#Questo nome deve essere univoco per ogni istanza. -ws.instanceName=minefield - -#Configurazione WS di versamento sincrono -# ---------------------------------------------------- -# path in cui memorizzare i file che verrano caricati dall'esterno. -# nota: in caso di installazioni di pi\u00f9 istanze sulla stessa macchina \u00e8 meglio che ogni istanza -# punti ad un path diverso per evitare collisioni sui nomi dei file temporanei -versamentoSync.upload.directory=/tmp -# flag che indica se salvare o meno il log della sessione (1 si - 0 no) -versamentoSync.saveLogSession=1 -# dimensione in byte della massima dimensione complessiva per una request -# 1000000000 = 1 gigabyte -versamentoSync.maxRequestSize=1000000000 -# dimensione in byte della massima dimensione di un file caricabile -# 1000000000 = 1 gigabyte -versamentoSync.maxFileSize=1000000000 - -#Configurazione WS di aggiunta documenti sincrono -# ------------------------------------------------------------- -# path in cui memorizzare i file che verrano caricati dall'esterno. -# nota: in caso di installazioni di pi\u00f9 istanze sulla stessa macchina \u00e8 meglio che ogni istanza -# punti ad un path diverso per evitare collisioni sui nomi dei file temporanei -aggAllegati.upload.directory=/tmp -# flag che indica se salvare o meno il log della sessione (1 si - 0 no) -aggAllegati.saveLogSession=1 -# dimensione in byte della massima dimensione complessiva per una request -# 1000000000 = 1 gigabyte -aggAllegati.maxRequestSize=1000000000 -# dimensione in byte della massima dimensione di un file caricabile -# 1000000000 = 1 gigabyte -aggAllegati.maxFileSize=1000000000 - -#Configurazione WS di upload definizione applicazione -# ------------------------------------------------------------- -# path in cui memorizzare i file che verrano caricati dall'esterno. -# nota: in caso di installazioni di pi\u00f9 istanze sulla stessa macchina \u00e8 meglio che ogni istanza -# punti ad un path diverso per evitare collisioni sui nomi dei file temporanei -profilerApp.upload.directory=/tmp -# flag che indica se salvare o meno il log della sessione (1 si - 0 no) -# profilerApp.saveLogSession=1 -# dimensione in byte della massima dimensione complessiva per una request -# 1000000000 = 1 gigabyte -profilerApp.maxRequestSize=1000000000 -# dimensione in byte della massima dimensione di un file caricabile -# 200000000 = 200 megabyte -profilerApp.maxFileSize=10000000 -profilerApp.charset=UTF-8 - -#Configurazione WS di recupero sincrono -# ---------------------------------------------------- -# path in cui memorizzare i file che verrano caricati dall'esterno. -# nota: in caso di installazioni di pi\u00f9 istanze sulla stessa macchina \u00e8 meglio che ogni istanza -# punti ad un path diverso per evitare collisioni sui nomi dei file temporanei -recuperoSync.upload.directory=/tmp -# flag che indica se salvare o meno il log della sessione (1 si - 0 no) -#NOTA BENE: questo flag non serve a nulla. L'idea di salvare la sessione per i recuperi non ha molto senso -#a meno di non volerla usare come un auditing di sicurezza, per il quale un log file \u00e8 probabilmente pi\u00f9 indicato. -recuperoSync.saveLogSession=0 -# dimensione in byte della massima dimensione complessiva per una response, -# oltre la quale il ws non rende dati, che dovranno essere scaricati in modo diverso -# 20000000 = 20 megabyte -recuperoSync.maxResponseSize=20000000 -# dimensione in byte della massima dimensione di un file scaricabile -# 20000000 = 20 megabyte -recuperoSync.maxFileSize=20000000 -# flag che indica se salvare o meno il log della sessione (1 si - 0 no) -recuperoSync.saveLogSession=1 - - -#Configurazione WS di upload file Xsd per i tipi documenti -# ------------------------------------------------------------- -# path in cui memorizzare i file Xsd che verrano caricati dall'esterno. -# nota: in caso di installazioni di pi\u00f9 istanze sulla stessa macchina \u00e8 meglio che ogni istanza -# punti ad un path diverso per evitare collisioni sui nomi dei file temporanei -loadXsdApp.upload.directory=/tmp -# flag che indica se salvare o meno il log della sessione (1 si - 0 no) -# loadXsdApp.saveLogSession=1 -# dimensione in byte della massima dimensione complessiva per una request -# 1000000000 = 1 gigabyte -loadXsdApp.maxRequestSize=1000000000 -# dimensione in byte della massima dimensione di un file caricabile -# 200000000 = 200 megabyte -loadXsdApp.maxFileSize=10000000 -loadXsdApp.charset=UTF-8 diff --git a/sacerws-web/src/main/resources/ws_handler.xml b/sacerws-web/src/main/resources/ws_handler.xml deleted file mode 100644 index fdc2684..0000000 --- a/sacerws-web/src/main/resources/ws_handler.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - VerificaFirmeSyncHandler - it.eng.parer.firma.crypto.verifica.VerificaFirmeSyncHandler - - - diff --git a/sacerws-web/src/main/webapp/WEB-INF/web.xml b/sacerws-web/src/main/webapp/WEB-INF/web.xml index 60f1fb7..aeeb262 100644 --- a/sacerws-web/src/main/webapp/WEB-INF/web.xml +++ b/sacerws-web/src/main/webapp/WEB-INF/web.xml @@ -6,82 +6,40 @@ - UUID Logger filter - it.eng.spagoCore.util.UUIDLoggerFilter - - - UUID Logger filter - /VersamentoFascicoloSync - /VersamentoSync - /AggiuntaAllegatiSync - /VersamentoMultiMedia - /AggiornamentoUnitaDocumentariaSync - - - - - - - VersamentoFascicoloSync - VersamentoFascicoloSync - it.eng.parer.restWS.VersamentoFascicoloSrvlt - - - VersamentoFascicoloSync + UUID Logger filter + it.eng.spagoCore.util.UUIDLoggerFilter + + + UUID Logger filter /VersamentoFascicoloSync - - - - - VersamentoSync - VersamentoSync - it.eng.parer.restWS.VersamentoSyncSrvlt - - - VersamentoSync /VersamentoSync - - - AggiuntaAllegatiSync - AggiuntaAllegatiSync - it.eng.parer.restWS.AggAllegatiSyncSrvlt - - - AggiuntaAllegatiSync /AggiuntaAllegatiSync - - - VersamentoMultiMedia - it.eng.parer.restWS.VersamentoMultiMSyncSrvlt - - - VersamentoMultiMedia /VersamentoMultiMedia - - - AggiornamentoUnitaDocumentariaSync - AggiornamentoUnitaDocumentariaSync - it.eng.parer.restWS.UpdVersamentoSrvlt - - - AggiornamentoUnitaDocumentariaSync /AggiornamentoUnitaDocumentariaSync - - + + + + + ConfigServlet + it.eng.spagoCore.configuration.ConfigServlet + 0 + + + 60 - - true - true - - COOKIE + + true + true + + COOKIE - + 500 /genericError.jsp - + \ No newline at end of file diff --git a/sacerws-web/src/main/webapp/lab.jsp b/sacerws-web/src/main/webapp/lab.jsp index 4d75959..60cdd8a 100644 --- a/sacerws-web/src/main/webapp/lab.jsp +++ b/sacerws-web/src/main/webapp/lab.jsp @@ -250,28 +250,6 @@ - - - - - - - - diff --git a/src/docs/JBoss6_configurazione_generale.md b/src/docs/JBoss6_configurazione_generale.md deleted file mode 100644 index ec595fc..0000000 --- a/src/docs/JBoss6_configurazione_generale.md +++ /dev/null @@ -1,709 +0,0 @@ ---- -title: "Configurazione di JBoss EAP 6.4" ---- - -# Configurazione Application Server JBoss 6.4 EAP - -## Versioni - -| Versione | Modifiche | Data -| -------- | ---------- | ---------- -1.0 | Prima emissione | 23/02/2017 -1.1 | Correzioni ed aggiunte da parte di Lorenzo Dalrio | 05/04/2017 -1.2 | Aggiunta configurazione timer su db | 26/04/2017 -1.3 | Aggiunta sezione per disattivazione Load Balancing | 19/05/2017 -1.4 | Aggiunte informazioni sui logging profile e cancellazione della parte relativa al datasource per i timer | 01/09/2017 -1.5 | Aggiunte sezioni per dettagliare la configurazione delle code JMS e altre configurazioni per gli ambienti server | 01/09/2017 -1.6 | Rese generiche sezioni con configurazioni specifiche per ambienti | 06/09/2017 -1.7 | Versione finale, disattivata la registrazione delle modifiche | 06/07/2017 -1.8 | Aggiunta sezione sulle configurazioni del subsystem webservice | 12/09/2017 -1.9 | Aggiunta nuova proprietà di sistema ed aggiornamento delle configurazioni del modulo dell’idp | 25/09/2017 -2.0 | Modificati riferimenti a nexus, corretto refuso su SacerPool | -2.1 | Inserite informazioni per installazioni senza IDP ParER | 08/08/2018 -2.2 | Inserite configurazioni per code JMS utilizzate da Sacer (MEV#15295) | 06/09/2018 -2.3 | Modificata numerazione paragrafi; aggiunti chiarimenti per configurazioni code JMS | 24/09/2018 -2.4 | Aggiunte [regole di rewrite](#regole-di-rewrite) per SacerWS 24 | 02/10/2018 -2.5 | Aggiunte configurazioni JMS-Bridge per micro-servizi ed aggiornamento eclispelink integration. Necessario modulo Artemis | 08/10/2018 -2.6 | Inserite configurazioni per i bean pool dei due consumer per la gestione della migrazione su ObjectStorage | 12/11/2018 -2.7 | Rivisti i limiti dei pool per la coda indice aip ([Bean pool per gli MDB](#bean-pool-per-gli-mdb)); Aggiunte le versioni ([Versioni di riferimento](#versioni-di-riferimento)) dei componenti di Jboss; Aggiunta configurazione collegamento SSL al bridge JMS([Configurazione JMS per migrazione blob su object storage](#Configurazione-JMS-per-migrazione-blob-su-object-storage)) | 29/11/2018 -2.8 | Aggiunta proprietà di sistema per censire i jks ed altre proprietà collegate alla gestione della federazione( [Proprietà di sistema](#proprietà-di-sistema)) | 07/02/2019 -2.9 | Modifica valori security domain associato alla release di saceriam 3.13.0 ([Configurazione del security domain](#Configurazione-del-security-domain)) | 07/05/2019 -2.10 | Modificato per maggiore chiarezza il paragrafo [Configurazione JMS per migrazione blob su object storage](#Configurazione-JMS-per-migrazione-blob-su-object-storage); inserite le proprietà fed-metadata-url e Idp-identity-id tra le proprietà di sistema (omesse per errore) | 19/09/2019 -2.11 | Aggiunta nuovo data-source per il versamenti falliti [Configurazione datasource non XA](#Configurazione-datasource-non-XA). Aggiunta nuove proprietà di sistema per le credenziali aws di Xformer (reportistica) e Ping (strumenti urbanistici) [Proprietà di sistema](#proprietà-di-sistema).| 08/10/2019 -3.0 | Passaggio alla versione markdown con documentazione separata per aspetti specifici delle singole applicazioni.| 02/04/2021 - -Il presente documento definisce le configurazioni da apportare all'application server JBoss EAP 6.4 necessarie alla corretta esecuzione degli applicativi sviluppati da ParER (Polo Archivistico Regione Emilia-Romagna). -JBoss è configurabile in modalità "standalone" oppure "domain" a seconda che sia, rispettivamente, eseguito in un singolo nodo oppure in un cluster di più nodi. In ParER gli ambienti di snapshot, test, pre-produzione e produzione sono configurati in modalità "domain" (vedi 5). -In questo documento la cartella radice di JBoss verrà indicata spesso con ${JBOSS_HOME}. Tutti i percorsi su filesystem (a meno che non sia indicato esplicitamente) sono relativi a questa cartella. - -## JDK - -La JDK di riferimento utilizzata dalle applicazioni descritte in questo documento è la Open JDK versione 8. -Se dovesse rivelarsi necessario utilizzare la versione di Java fornita da Oracle è necessario assicurarsi che siano correttamente installate le Java Cryptography Extension (JCE) Unlimited Strength. -In ogni caso consigliamo fortemente di utilizzare la OpenJDK. - -## Aggiunta amministratore application server - -Per poter effettuare operazioni amministrative all'interno dell'installazione di JBoss può essere utile creare almeno un utente afferente al ruolo **ManagementRealm**. In ambiente standalone tale operazione può essere effettuata tramite lo script **bin/add-user.sh** (o .bat per windows). -Si può in alternativa decidere di installare e getire direttamente con l'utente root di S.O. - -Ecco un esempio dell'esecuzione dello script in cui l'utenza inserita è **admin.jboss.eap** e password **secretpassword**. - -```bash -$ ./opt/jboss-eap-6.4.0/bin/add-user.sh - -What type of user do you wish to add? - a) Management User (mgmt-users.properties) - b) Application User (application-users.properties) -(a): - -Enter the details of the new user to add. -Using realm 'ManagementRealm' as discovered from the existing property files. -Username : admin.jboss.eap -Password requirements are listed below. To modify these restrictions edit the add-user.properties configuration file. - - The password must not be one of the following restricted values {root, admin, administrator} - - The password must contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s) - - The password must be different from the username -Password : -Re-enter Password : -What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]: -About to add user 'admin.jboss.eap' for realm 'ManagementRealm' -Is this correct yes/no? yes -Added user 'admin.jboss.eap' to file '/opt/jboss-eap-6.4.0/standalone/configuration/mgmt-users.properties' -Added user 'admin.jboss.eap' to file '/opt/jboss-eap-6.4.0/domain/configuration/mgmt-users.properties' -Added user 'admin.jboss.eap' with groups to file '/opt/jboss-eap-6.4.0/standalone/configuration/mgmt-groups.properties' -Added user 'admin.jboss.eap' with groups to file '/opt/jboss-eap-6.4.0/domain/configuration/mgmt-groups.properties' -Is this new user going to be used for one AS process to connect to another AS process? -e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls. -yes/no? y -To represent the user add the following to the server-identities definition -``` - -## Configurazione Standalone - -La versione "standalone" di JBoss si declina in 4 modalità a seconda dei moduli precaricati: - - - **standalone.xml**: supporta Java EE Web profile più alcune estensioni come servizi web RESTFul e invocazioni remote a EJB3. É il profilo predefinito; - - **standalone-full.xml**: Supporta Java EE Full-Profile e tutte le funzionalità lato server senza il clustering. Questo profilo supporta anche le code JMS; - - **standalone-ha.xml**: profilo predefinito + clustering; - - **standalone-full-ha.xml**: Java EE Full-Profile + clustering. - -Il modello di riferimento per l'ambiente di sviluppo locale è **full**. Se l'ambiente non necessita dell'uso delle code è sufficiente il modello predefinito. -Per impostare la configurazione full bisogna sostituire il file `standalone/configuration/standalone.xml` con il contenuto del file `standalone/configuration/standalone-full.xml`. - -## Configurazione domain - -In Parer, gli ambienti server di snapshot, test, pre-produzione e produzione **sono stati configurati in modalità domain**. Il profilo usato per tutti gli ambienti server è **full-ha**. -La modalità domain permette la gestione centralizzata della configurazione, dei deploy e delle operazioni di start e stop dei server JBoss. -Maggiori dettagli sulla modalità domain possono essere trovati al seguenti link. - -https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/About_Managed_Domains.html - -Dove non espressamente indicato tutte le configurazioni presenti in questo documento possono essere applicate indipendentemente dall'utilizzo in domain o standalone di JBoss. - -Per poter effettuare i deploy in modalità rollling update si è deciso di dividere il cluster in due (parer-prod-A e parer-prod-B). Se la modalità rollling update non è di interesse, la configurazione dei due cluster può anche non essere attuata. - -## Configurazione JDBC - -### Driver Oracle - -Il DBMS di riferimento è oracle alla versione 19c e la versioni del driver Oracle JDBC è la 8, l'installazione è spiegata nella [Administration_and_Configuration_Guide](https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/sect-Example_datasources.html#Example_Oracle_datasource). - -Creare un nuovo modulo nella cartella - -`${JBOSS_HOME}/modules/system/layers/base/com/oracle/**ojdbc8**/main` - -e copiarci il file **ojdbc8.jar**. Il nome in grassetto è convenzionale. -Nella cartella, inoltre, bisogna creare il file **module.xml** con il seguente contenuto: - -```xml - - - - - - - - - - -``` -### Driver Eclipselink - -Gli applicativi del ParER al momento dipendono da Eclipselink come ORM. Siccome il provider ORM di JBoss EAP è hibernate è necessario aggiungere all'application server il modulo di Eclipselink ed un modulo di integrazione (per esempio per la funzionalità di autodiscovery delle classi). -La creazione dei moduli è semplificata dal progetto disponibile all'url seguente: -https://github.com/lsnidero/as7-eclipselink-integration -Procedura di compilazione ed installazione: - -```bash -$ git clone https://github.com/lsnidero/as7-eclipselink-integration.git -$ cd as7-eclipselink-integration/ -$ mvn -Declipselink.version=2.3.2 -DskipTests=true clean install -``` - -Nella cartella **target** del progetto viene creata la cartella **as7module**. Il contenuto di tale cartella deve essere copiato in `${JBOSS_HOME}/modules/system/layers/base`. -Questa operazione copierà i due nuovi moduli rispettivamente nelle cartella - - ${JBOSS_HOME}/modules/system/layers/base/id/au/ringerc/as7/eclipselinkintegration/main - - ${JBOSS_HOME}/modules/system/layers/base/org/eclipse/persistence/main - -Il contenuto dei file "module.xml" è il seguente: - -```xml - - - - - - - - - - - - - - - - -``` - -per Eclipselink - -```xml - - - - - - - - - - - - - - - - - - - - - -``` - -A questo punto è necessario configurare le seguenti variabili d'ambiente: - -Chiave | Valore ---- | --- -eclipselink.archive.factory | id.au.ringerc.as7.eclipselinkintegration.JBossArchiveFactoryImpl -eclipselink.logging.logger | id.au.ringerc.as7.eclipselinkintegration.JBossLogger -eclipselink.target-server | JBoss - -Per effettuare tale operazione è necessario avviare l'applicazione server (`${JBOSS_HOME}/bin/standalone.sh`) , effettuare l'accesso su http://localhost:9990/ con le credenziale configurate al [paragrafo di aggiunta dell'amministratore](#aggiunta-amministratore-application-server) e selezionare il pannello **Configuration**. -In basso a sinistra selezionare **System Properties** ed aggiungere le proprietà di cui sopra. -Nella configurazione in *domain* è possibile impostare le proprietà sia a livello globale sia a livello di singolo nodo. - -### Configurazione data source / connection pool - -Prima di aggiungere i datasource dalla console di amministrazione è necessario aggiungere i driver jdbc a JBoss. -Il modulo contenente il jar di Oracle è stato aggiunto al paragrafo [Driver Oracle](#driver-oracle). Per renderlo disponibile ai datasource è necessario eseguire l'installazione dal command line di jboss; non è possibile eseguire tale operazione dalla console di amministrazione web. -Eseguire, da `${JBOSS_HOME}/bin` il comando **jboss-cli.sh**. La procedura da eseguire **a server acceso** è la seguente: - -```bash -/subsystem=datasources/jdbc-driver=ojdbc8/:add(driver-module-name=com.oracle.ojdbc8,driver-name=ojdbc8,driver-datasource-class-name=oracle.jdbc.OracleDriver,driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource,jdbc-compliant=true) -``` -Per la configurazione si rimanda alla documentazione specifica degli applicativi. - -## Configurazione del connettore jca XADisk - -Nel file **XADisk.rar** fornito sono già stati configurati i due parametri relativi alla -directory di lavoro e al nome istanza. -Questi valori sono configurati come segue: - -- **xaDiskHome** "../xaDiskHome" (N.B: la cartella deve essere raggiungibile e scrivibile -dall'utente che esegue l'application server).Bisogna accertarsi che la home xadisk non finisca nelle cartelle sincronizzate dall'application server (nel caso di installazione domain); -- **instanceId** "xaDisk1" . - -La configurazione, dalla console web, viene effettuata nel modo seguente: - -`Configuration > Subsystem > Resource Adapters` - -`Add` - -Nel sottoriquadro *Attributes* - -Chiave | Valore ------- | ------ -Name | XADisk.rar -Archive | XADisk.rar -Module | - -TX | XATransaction - -Nel sottoriquadro *Properties* - -Chiave | Valore ---- | ------ -instanceId | xaDisk1 -synchronizeDirectoryChanges | true -xaDiskHome | ./xaDiskHome -enableRemoteInvocations | false - -Sulla tabella dove compare la riga **XADisk.rar** alla colonna **Name** premere sul link **View** della colonna Option: - -Aggiungere il seguente "connection definition": - -Chiave | Valore ---- | ------ -Name | xaDiskPool -JNDI | java:/jca/xadiskLocal -Connection Class | org. xadisk. connector. outbound. XADiskManagedConnectionFactory - -e le seguenti proprietà - -Chiave | Valore ---- | ------ -instanceId | xaDisk1 - -Modificare la scheda pool definiendo **Min Pool Size** = 1 e **Max Pool Size** = 5. -Eseguire ed abilitare (Enable attivo) il deploy del file **XADisk.rar** tramite la console di amministrazione sotto Deployments > add. -Name e Runtime Name devono essere **XADisk.rar**. - -## Configurazione Servizio JMS - -Di tutte le applicazioni dell'ecosistema del ParER solo Sacerping e Sacer utilizzano il servizio di code JMS, quindi è necessario applicare la configurazione del servizio JMS descritta nei paragrafi successivi solo se si intende usare almeno una di queste due applicazioni. - -Per configurare il servizio di code JMS selezionare, tramite la console amministrativa - -`Configuration > Messaging > Destinations` - -### Configurazione del bilanciamento delle code - -Il bilanciamento delle code permette di aumentare le perfomance del sistema distribuendo il carico tra i nodi JBoss. -La formazione del cluster hornetq avviene sfruttando indirizzi di multicast dedicati ed è gestita dal subsystem jgroups. - -#### Configurazione del subsystem messaging - -Di seguito si riporta la configurazione del subsystem messaging di JBoss. Sono state evidenziate le sezioni modificate rispetto alle impostazioni di default. - -```xml - - - true -``` - Modificato rispetto al default -```xml - CLUSTER_USER - CLUSTER_PASSWORD - 2000 - ASYNCIO -``` -```xml - 2 - - - - - - - - - - - - - - - - - - - -``` - Modificato rispetto al default -```xml - tcp - hq-cluster -``` -```xml - 5000 - - netty - - - - - - -``` - Modificato rispetto al default -```xml - tcp - hq-cluster -``` -```xml - 10000 - - - - -``` - Modificato rispetto al default -```xml - -``` -```xml -

jms
- netty - 1 - - - - - - - - - - - - - - - - - jms.queue.DLQ - jms.queue.ExpiryQueue - 0 - 10485760 - 2097152 - PAGE - 10 - 1000 - - - - - - - - - - - - - - - - - - - - true - true - 1000 - 1.0 - -1 - -``` - Modificato rispetto al default -```xml - - XA_GENERIC - - - - - - - -``` -```xml - - - - - - - - - -``` - Modificato rispetto al default -```xml - - - - - - - - - -``` -```xml - - - - - - - - - - - - -``` -Per configurare la pooled connection factory **sacer-hornetq-ra** dalla cli di JBoss digitare i seguenti comandi dopo essersi collegati all'ambiente da configurare: - -```bash -/profile={my-profile}/subsystem=messaging/hornetq-server=default/pooled-connection-factory=sacer-hornetq-ra:add(connector={"in-vm" => undefined},entries=["java:/SacerJmsXA"],transaction="xa") -``` - -Per configurare la connection factory **ConnectionFactoryXA** dalla cli di JBoss utilizzata dal bridge JMS i comandi della cli sono i seguenti: - -```bash -/profile={my-profile}/subsystem=messaging/hornetq-server=default/connection-factory=InVmConnectionFactoryXA:add(connector={"in-vm" => undefined}, factory-type=XA_GENERIC,entries=["java:/ConnectionFactoryXA"]) -``` - -La connection factory **ConnectionFactoryXA** è utilizzata dalla versione di SACER (5.5.0) che implementa il dialogo con i micro-servizi descritta nel paragrafo successivo. -Sostituire `{my-profile}` con il profilo adeguato. - -#### Configurazione del subsystem jgroups - -Occorre modificare lo stack utilizzato da jgroups per la comunicazione tra i nodi del cluster. -Di default viene utilizzato lo stack udp, la configurazione scelta per il ParER invece utilizza tcp. -Il comando CLI per modificare lo stack di default è il seguente: - -```bash -/profile=parer/subsystem=jgroups:write-attribute(name=default-stack,value=tcp) -``` - -#### System properties - -Per il corretto funzionamento del cluster e la formazione dello stesso è fondamentale definire due system properties che controllano gli indirizzi di multicast utilizzati da hornetq e da jgroups. -Le system properties sono - -``` -jboss.messaging.group.address -jboss.default.multicast.address -``` - -Gli indirizzi scelti devono essere unici per ogni cluster. -Si riporta un esempio di comando CLI per configurare le system properties a livello di server-group - -```bash -/server-group=parer-prod-A/system-property=jboss.messaging.group.address:add(value=231.8.8.8) -/server-group=parer-prod-A/system-property=jboss.default.multicast.address:add(value=230.0.0.5) -``` - -L'indirizzo di multicast scelto deve essere univoco all'interno della rete. - -### Disattivazione del bilanciamento delle code - -Il meccanismo di Load Balancing del cluster può essere spento settando a 0 l'attributo max-hops della cluster-connection definita: - -```bash -/profile=parer/subsystem=messaging/hornetq-server=default/cluster-connection=parer-prod-cluster:write-attribute(name=max-hops,value=0) -``` - -Per riattivare il Load Balancing l'attributo max-hops va settato a 1: -```bash -/profile=parer/subsystem=messaging/hornetq-server=default/cluster-connection=parer-prod-cluster:write-attribute(name=max-hops,value=1) -``` - -### Configurazione Risorse JMS e Nomi JNDI - -La modalità **full** predefinita di JBoss prevede le code **ExpiryQueue** e **DLQ**. -Sono utilizzate per memorizzare i messaggi contenenti eccezioni e di default un messaggio prima di essere inserito nella coda **DLQ** (Dead Letter Queue) deve essere re-inviato 10 volte. - -## Utilizzo di Xadisk e NFS - -Non è necessario montare le folder con il parametro “sync”: xadisk forza il fushing delle folder commit time tramite fsync. -Discorso diverso per le cache di lookup: è necessario impostare il parametro `lookupcache=positive` per non mantenere la cache di entry non presenti sul server. -In caso di migrazione da glassfish queste configurazioni sono già state effettuate come nel caso delle transazioni [XA](#configurazione-del-transaction-service), in quanto facenti parte di configurazioni specifiche di NFS e non dell'application server. - -## Configurazione dei webservices - -Il subsystem webservices necessita della modifica di 3 parametri che regolano la riscrittura del tag soap:address quando viene generato dinamicamente il wsdl. -Nello specifico, vanno modificati come segue gli attributi **wsdl-port**, **wsdl-secure-port** e **wsdl-host**. -Questi i comandi CLI da utilizzare: -```bash -/profile=parer/subsystem=webservices:write-attribute(name=wsdl-secure-port,value=443) -/profile=parer/subsystem=webservices:write-attribute(name=wsdl-port,value=80) -/profile=parer/subsystem=webservices:write-attribute(name=wsdl-host,value=jbossws.undefined.host) -``` - -## Configurazioni aggiuntive - -Per il corretto funzionamento delle applicazioni è stato necessario aggiungere la seguente proprietà di sistema: - -Chiave | Valore ---- | --- -org.apache.tomcat.util.http.Parameters.MAX_COUNT | 10.000 - -Tale proprietà fa sì che si possano passare più di 512 parametri (valore predefinito) tramite una richiesta GET o POST. - -### Proprietà di sistema - -#### Generali - -Chiave | Valore di esempio | Descrizione ---- | --- | --- -fed-metadata-url | `` | Indirizzo dal quale scaricare il file federation metadata -Idp-identity-id | `` | Identificativo univoco dell’IDP all’interno della Federazione - -#### Specifiche per applicazione - -La documentazione specifica di ogni applicazione riporta eventuali system properties da configurare per il suo corretto funzionamento. - -## Logging profiles - -Per standardizzare la scrittura dei log per le applicazioni rilasciate vengono utilizzati i logging-profile forniti da JBoss. -Le configurazioni possono essere applicate e modificate "a caldo" e dipendono dal nome del profilo associato al server-group. -Si rimanda alla documentazione dell'applicazione per il logging-profile specifico. - -### Custom JDBC handler - -Per consentire una migliore gestione dei log delle query fatte tramite Hibernate è stato implementato il modulo custom **jboss-module-application-logger**. - -Per installare il modulo bisogna scaricare il progetto - -https://gitlab.ente.regione.emr.it/parer/tools/jboss-module-application-logger - -e lanciare un - -```bash -mvn clean compile -``` -si ottiene un file *jboss-application-logger-x.y.z.zip* che va scompattato nella cartella *${JBOSS_HOME}/module*. - -Vanno infine configurati due logger a cui le singole applicazioni andranno ad aggiungere i propri handler - -```xml - - - - - - - - - - - -``` - -```bash -/subsystem=logging/logger=org.hibernate:add(use-parent-handlers=false,level=INFO) - -/subsystem=logging/logger=jboss.jdbc.spy:add(use-parent-handlers=false,level=DEBUG) - -/subsystem=logging/logger=jboss.jdbc.spy:write-attribute(name=filter-spec,value=match("Statement|prepareStatement")) -``` - -## Configurazione del listener HTTPS - -Si riporta di seguito un esempio di configurazione del connettore https con le componenti native. - -```xml - - - -``` -## JBoss tuning - -In questa sezione verranno presentate tutte le modifiche alla configurazione predefinita dell'application server atte a migliorare le performance delle applicazioni. -Al momento questa sezione è *"work in progress"*. - -### Installazione delle componenti native - -Le componenti native di JBoss permettono di ottenere le migliori performances dai subsystems **web**e **messaging** abilitando funzionalità specifiche come ASYNCIO per hornetq e la modalità APR per i connettori http/https. -Scaricare lo zip con le componenti native per JBoss al seguente link: - -https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?downloadType=distributions&product=appplatform&version=6.4 - -Il pacchetto per RHEL 7 è *Red Hat JBoss Enterprise Application Platform 6.4.0 Native Components for RHEL 7 x86_64*. -Il pacchetto va scompattato nella directory contenente l’installazione di JBoss. Le istruzioni di installazione sono disponibili al seguente link: - -https://access.redhat.com/solutions/222023 - -### Validazione del datasource - -Vedi tabella 6.9 di https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/sect-Datasource_Configuration.html . - -La configurazione di base dei datasource in RER viene fatta con il seguente comando CLI: - -```bash -data-source --profile=PROFILE add --name=DS_NAME --jndi-name=DS_JNDI --connection-url=DS_URL --user-name=DS_USER --password=DS_PASSWD --driver-name=ojdbc8 --exception-sorter-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter --stale-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker --statistics-enabled=true --use-ccm=true --use-fast-fail=true --valid-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker --validate-on-match=true --flush-strategy=FailingConnectionOnly --background-validation=false --enabled=true -``` -### Parametri JVM - -I parametri di base utilizzati in RER sono i seguenti: - -```bash --XX:+UseLargePages --server --XX:+DoEscapeAnalysis --XX:+UseCompressedOops --XX:+UseConcMarkSweepGC --XX:+CMSClassUnloadingEnabled --XX:+UseParNewGC --XX:+ExplicitGCInvokesConcurrent --XX:CMSInitiatingOccupancyFraction=80 --XX:CMSIncrementalSafetyFactor=20 --XX:+UseCMSInitiatingOccupancyOnly --verbose:gc --XX:+PrintGCDetails --XX:+PrintGCTimeStamps --XX:+UseGCLogFileRotation --XX:NumberOfGCLogFiles=5 --XX:GCLogFileSize=3M --XX:-TraceClassUnloading --Xloggc:/opt/jboss-eap/gclogs/parer-prod_gc.log -``` -### Modificare i livelli di logging - -Per modificare i livelli di logging andare, dalla console di amministrazione, su -`Configuration > Core > Logging`. -Nel riquadro "handler" è possibile aggiungere console o file handler specifici per le esigenze. -Nel riquadro "log categories" è possibile associare categorie specifiche di log da assegnare agli handler. - -## Ulteriori configurazioni - -Fare riferimento ai documenti presenti su https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/. - -## Versioni di riferimento - -Questa tabella riassume le versioni dei componenti utilizzati per la configurazione di JBoss EAP. -Nome | Numero di versione | Descrizione ---- | --- | --- -Jboss EAP | JBoss AS release: 7.5.20.Final-redhat-1 "Janus" JBoss AS product: EAP 6.4.20.GA | Versione completa dell’application server e livello di patchset. -Eclipselink | 2.3.2 | Motore ORM utilizzato come modulo JBoss -Eclipselink integration | 1.1.2 | Modulo di integrazione di Eclipselink su JBoss -XaDisk | 1.2.2.5 | Transazioni XA su filesystem -Oracle Jdbc | 8 per Oracle 19 | Driver per accedere al DB oracle -Modulo ActiveMQ Artemis | 1.5.5 | Modulo utilizzato per implementare il bridge JMS -idp-jaas-rdbms | 0.0.6 | Modulo utilizzato per la personalizzazione delle azioni associate al login - -\newpage - -## Riferimenti {#biblio} -Descrizione | Link ---- | --- -Getting Started Guide | https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Getting_Started_Guide/index.html -Installation Guide | https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Installation_Guide/index.html -Guida di amministrazione e configurazione | https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/index.html -Guida di sviluppo | https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Development_Guide/index.html -API di riferimento | https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/API_Documentation/index.html - -**Strumenti di terze parti** -Strumento | Descrizione | Dove recuperarlo -Driver jdbc di oracle | Driver per accedere al dbms oracle | http://www.oracle.com/technetwork/database/features/jdbc/default-2280470.html -Modulo di autenticazione e log DB | Estensione del security manager per l'identity provider | https://rersvn.ente.regione.emr.it/projects/parer-idp-rdbmslogin -XaDisk | Strumento per transazioni 2PC su dbms e filesystem | https://nexus.ente.regione.emr.it/repository/thirdparty/net/java/xadisk/xadisk/1.2.2.5/ -Eclipselink e sua integrazione | Motore orm ed integrazione a JBoss | https://nexus.ente.regione.emr.it/repository/jboss/org/eclipse/persistence/eclipselink/2.3.2/ - https://github.com/lsnidero/as7-eclipselink-integration \ No newline at end of file diff --git a/src/docs/JBoss6_configurazione_sacerws.md b/src/docs/JBoss6_configurazione_sacerws.md deleted file mode 100644 index bb04f24..0000000 --- a/src/docs/JBoss6_configurazione_sacerws.md +++ /dev/null @@ -1,198 +0,0 @@ ---- -title: "Configurazione SacerWS" ---- -# Configurazione Jboss EAP 6.4 - -## Versioni - -| Vers. Doc | Vers. SacerWS | Modifiche | -| -------- | ---------- | ---------- | -| 1.0.0 | 2.3.4 | Versione iniziale del documento | - -## Datasource XA - -Per configurare il datasource dell'applicativo dalla console web di amministrazione bisogna andare su - -`Configuration > Connector > datasources` - -Scegliere **XA DATASOURCES** e premere - -`Add` - -Si apre un wizard in 3 passaggi -1. Aggiungere gli attributi del datasource: Nome=**SacerPool** e JNDI=**java:/jdbc/SacerDs** -2. Selezionare il driver **ojdbc8** (predisposto durante la configurazione generale di Jboss) e impostare **oracle.jdbc.xa.client.OracleXADataSource** come XA Data Source Class; -3. Impostare gli attributi della connessione, ad esempio *URL* - -### Configurazione del transaction service - -Lo schema dell'applicazione ha bisogno delle seguenti grant su Oracle. - -```sql -GRANT SELECT ON sys.dba_pending_transactions TO SACER; -GRANT SELECT ON sys.pending_trans$ TO SACER; -GRANT SELECT ON sys.dba_2pc_pending TO SACER; -GRANT EXECUTE ON sys.dbms_xa TO SACER; -``` - -La procedura è descritta nella documentazione standard di JBoss EAP 6.4 - -https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/sect-XA_Datasources.html#Create_an_XA_Datasource_with_the_Management_Interfaces - -## Configurazione Servizio JMS - -Per la configurazione del subsystem si rimanda alla documentazione generale di JBoss EAP 6.4 del ParER. -Una volta fatto è necessario impostare le risorse JMS. - -### Configurazione Risorse JMS e Nomi JNDI - -#### Configurazione tramite interfaccia web - -`Configuration > Messaging > Destinations` - -Andare in `View` sul **default** quindi - -`Queues/Topics > Queue` - -Cliccare su - -`Add` - -e aggiungere la seguente destinazione - -Name | JNDI ---- | --- -ElenchiDaElabInAttesaSchedQueue | java:/jms/queue/ElenchiDaElabInAttesaSchedQueue | - -#### Configurazione tramite CLI - -```bash -jms-queue --profile={my-profile} add --queue-address=ElenchiDaElabInAttesaSchedQueue --entries=[java:/jms/queue/ElenchiDaElabInAttesaSchedQueue] -``` - -Sostiture {my-profile} con la keyword adeguata. - -### Bean pool per gli MDB - -#### Configurazione tramite interfaccia web - -`Configuration > Container > EJB 3 > BEAN POOLS` - -Aggiungere il seguente Bean Pool - -Name | Max Pool Size | Timeout | Timeout unit | ---- | --- | --- | --- | -coda-elenchi-da-elab-in-attesa-sched-pool | 5 | 5 | MINUTES | - -#### Configurazione tramite CLI - -```bash -/profile={my-profile}/subsystem=ejb3/strict-max-bean-instance-pool=coda-elenchi-da-elab-in-attesa-sched-pool:add(max-pool-size=3, timeout=5, timeout-unit="MINUTES") -``` - -Sostiture {my-profile} con la keyword adeguata. - - -## Logging profile - -```xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -``` - -Chiave | Valore di esempio | Descrizione ---- | --- | --- -reportvf.aws.accessKeyId | | Access Key id delle credenziali S3 per l’accesso all’object storage per i report di verifica firma. -reportvf.aws.secretKey | | Secret Key delle credenziali S3 per l’accesso all’object storage per i report di verifica firma. - - -## Regole di Rewrite - -Tutte le risorse esposte dal contesto */sacerws* **NON** devono essere accessibili ad eccezione di: - - https://parer.regione.emilia-romagna.it/sacerws/VersamentoFascicoloSync ; - - https://parer.regione.emilia-romagna.it/sacerws/VersamentoSync ; - - https://parer.regione.emilia-romagna.it/sacerws/AggiuntaAllegatiSync ; - - https://parer.regione.emilia-romagna.it/sacerws/VersamentoMultiMedia . diff --git a/src/docs/JBoss7_configurazione_generale.md b/src/docs/JBoss7_configurazione_generale.md new file mode 100644 index 0000000..fefddd9 --- /dev/null +++ b/src/docs/JBoss7_configurazione_generale.md @@ -0,0 +1,975 @@ +--- +title: "Configurazione di JBoss EAP 7.4" +--- +# Configurazione JBoss EAP 7.4 + +## Introduzione + +Il presente documento definisce le configurazioni da apportare all'application server JBoss EAP 7.4 necessarie alla corretta esecuzione degli applicativi sviluppati da ParER (Polo Archivistico Regione Emilia-Romagna). + +In questo documento la cartella radice di JBoss verrà indicata spesso con *${JBOSS_HOME}*. Tutti i percorsi su filesystem (a meno che non sia indicato esplicitamente) sono relativi a questa cartella. + +In ogni caso per maggiori dettagli si rimanda alla [Configuration guide](#riferimenti). + + +## Versioni + +| Versione | Modifiche | +| -------- | ---------- | +| 1.0.0 | Versione iniziale del documento | +| 1.0.1 | Aggiunte delle system properties | +| 1.0.2 | Aggiornamento JBoss EAP 7.4 e ojdbc 11| + +## JDK + +La JDK di riferimento utilizzata dalle applicazioni descritte in questo documento è la OpenJDK versione 11. + +## Aggiunta amministratore application server + +Per poter effettuare operazioni amministrative all'interno dell'installazione di JBoss può essere utile creare almeno un utente afferente al ruolo ManagementRealm. In ambiente standalone tale operazione può essere effettuata tramite lo script `bin/add-user.sh` (o .bat per windows). +Si può in alternativa decidere di installare e gestire direttamente con l'utente root di S.O. + +Ecco un esempio dell'esecuzione dello script in cui l'utenza inserita è `admin.jboss.eap` e password `secretpassword`. + +```bash +$ ./opt/jboss-eap-7.4.0/bin/add-user.sh +What type of user do you wish to add? +a) Management User (mgmt-users.properties) +b) Application User (application-users.properties) +(a): + Enter the details of the new user to add. + Using realm 'ManagementRealm' as discovered from the existing property +files. + Username : admin.jboss.eap + Password requirements are listed below. To modify these restrictions + edit the adduser.properties configuration file. + -- The password must not be one of the following restricted values + {root, admin, administrator} + -- The password must contain at least 8 characters, 1 alphabetic + character(s), 1 digit(s), 1 non-alphanumeric symbol(s) + -- The password must be different from the username + Password : + Re-enter Password : + What groups do you want this user to belong to? + (Please enter a comma separated list, or leave blank for none)[ ]: + About to add user 'admin.jboss.eap' for realm 'ManagementRealm' + Is this correct yes/no? yes + Added user 'admin.jboss.eap' to file + '/opt/jboss-eap-7.4.0/standalone/configuration/mgmtusers.properties' + Added user 'admin.jboss.eap' to file + '/opt/jboss-eap-7.4.0/domain/configuration/mgmtusers.properties' + Added user 'admin.jboss.eap' with groups to file + '/opt/jboss-eap-7.4.0/standalone/configuration/mgmt-groups.properties' + Added user 'admin.jboss.eap' with groups to file + '/opt/jboss-eap-7.4.0/domain/configuration/mgmt-groups.properties' + Is this new user going to be used for one AS process to connect to + another AS process? + e.g. for a slave host controller connecting to the master or for a + Remoting connection for server to server EJB calls. + yes/no? y + To represent the user add the following to the server-identities + definition +``` + +## Applicazione delle patch + +È opportuno applicare tutte le patch disponibili al momento dell'installazione, si trovano le cumulative patch (CP) sul [sito RedHat](https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform&downloadType=distributions). + +Per le istruzioni operative si rimanda al capitolo 2 della [Patching guide](#riferimenti). + +## Configurazione Standalone + +La versione standalone di JBoss offre 4 profili pre-configurati: + + - **standalone.xml**: supporta Java EE Web profile più alcune estensioni come servizi web +RESTFul e invocazioni remote a EJB3. É il profilo predefinito; + - **standalone-full.xml**: Supporta Java EE Full-Profile e tutte le funzionalità lato server senza il +clustering. Questo profilo supporta anche le code JMS; + - **standalone-ha.xml**: profilo predefinito + clustering; + - **standalone-full-ha.xml**: Java EE Full-Profile + clustering. + + Ci sono due modi per attivare uno dei profili: + + - **Specificare a linea di comando il file da usare** + ```bash +${JBOSS_HOME}/bin/standalone.sh --server-config= + ``` + + - **Sovrascrivere il file standalone.xml** + Se non diversamente specificato viene utilizzato il file *standalone.xml*, pertanto sovrascrivendolo si attiva il profilo desiderato, anche se si tratta di una gestione che potrebbe creare confusione sui contenuti dei file. + +### Ambiente di Sviluppo locale + + Il profilo da usare per l'ambiente di sviluppo locale è **full** se si utilizzano le code, altrimenti è sufficiente quello standard. + +### Ambienti Snapshot, Test, Pre-produzione e Produzione + + In ParER, gli ambienti server di snapshot, test, pre-produzione e produzione vanno configurati sempre in modalità standalone ma con il profilo **full-ha**. + +## Configurazione JDBC + +### Driver Oracle + +Il DBMS di riferimento è Oracle alla versione 19c e la versione del driver Oracle JDBC è la 11. +L'installazione del driver è spiegata dettagliatamente al paragrafo 12.2 della [Configuration guide](#riferimenti). + +#### Installazione + +Una volta scaricato l'ojdbc11.jar va installato tramite la Command Line Interface (CLI) di JBoss (${JBOSS_HOME}/bin/jboss-cli.sh) a server acceso: + +```bash +module add --name=com.oracle.ojdbc11 --resources=ojdbc11.jar --dependencies=javax.api,javax.transaction.api +``` + +#### Registrazione + +Per rendere disponibile il driver ai datasource è necessario eseguire l'installazione dalla CLI di JBoss; non è +possibile eseguire tale operazione dalla console di amministrazione web. + +Seguire i seguenti passaggi **a server acceso**: + +```bash +/subsystem=datasources/jdbc-driver=ojdbc11:add(driver-name=ojdbc11, driver-module-name=com.oracle.ojdbc11, driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource,driver-class-name=oracle.jdbc.OracleDriver) +``` + +### Configurazione datasource / connection pool + +Per configurare i datasource dell'applicativo dalla console di amministrazione bisogna andare su + +*Configuration > Subsystem > Datasources & Drivers > Datasources* + +#### Configurazione datasource non XA + +Cliccando su **(+)** si avvia la procedura guidata per la configurazione del datasource che, nel nostro caso, sono tutti **Oracle**. +Per le configurazioni specifiche si rimanda alla documentazione delle singole applicazioni. + +#### Configurazione datasource XA + +In ambiente ParER solo Sacer e SacerPing usano dei *datasource XA*. +La configurazione è leggermente differente rispetto a quella di un datasource non XA perché, +oltre al driver **ojdbc11**, ha anche le XA properties. +Le configurazioni specifiche sono disponibili nella documentazione dell'applicazione. + +### Configurazione del transaction service + +Per i datasource di tipo XA l'owner dello schema ha bisogno delle seguenti grant su Oracle verso l'utenza +del database dell'applicazione che usa il datasource XA: + +```sql +GRANT SELECT ON sys.dba_pending_transactions TO ; +GRANT SELECT ON sys.pending_trans$ TO ; +GRANT SELECT ON sys.dba_2pc_pending TO ; +GRANT EXECUTE ON sys.dbms_xa TO ; +``` + +In caso di errata assegnazione delle grant l'errore applicativo visualizzato sarà: + +```java +WARN [com.arjuna.ats.jta.logging.loggerI18N] +[com.arjuna.ats.internal.jta.recovery.xarecovery1] +Local XARecoveryModule.xaRecovery got XA exception +javax.transaction.xa.XAException, XAException.XAER_RMERR +``` +La procedura è descritta al paragrafo 12.8.2 della [Configuration guide](#riferimenti). +## Configurazione code JMS + +Il sotto-sistema che si occupa di gestire le code JMS è ActiveMQ/Artemis integrato su JBoss EAP 7. +La configurazione effettuata è di tipo cluster gestita tramite il multicast tra i nodi. +A livello di standalone.xml la configurazione è simile alla seguente: + +```xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +## Configurazione IDP + +La seguente configurazione deve essere applicata solo se si intende installare e configurare l'IDP fornito da ParER. + +## Configurazione del security domain + +La gestione del security domain è effettuata direttamente dall'application server ed il comportamento +custom del ParER è definito in un modulo JBoss che deriva dal progetto [JAAS RDBMS](https://github.com/tauceti2/jaas-rdbms). + +Creare la cartella *${JBOSS_HOME}/modules/system/layers/base/com/tagish/auth/main*. +All'interno mettere il file *module.xml* e il relativo jar, personalizzato per il ParER, ottenibile dalla compilazione del progetto [IDP rdbmslogin](https://gitlab.ente.regione.emr.it/parer/idp-rdbmslogin). + +Nel module.xml è molto importante impostare il nome del modulo ojdbc11 precedentemente configurato: + +```xml + + + + + + + + + + + +``` + +Per aggiungere il modulo su JBoss EAP 7.4 da console web è sufficiente andare in *Configuration > Subsystem > Security (Legacy) * + +Cliccare su **(+)** nella colonna *Security domain* e inserire: + +Name | Cache type +--- | --- +ShibUserPassAuth | default + +A questo punto selezionare ShibUserPassAuth, andare su View e nel riquadro *Authentication* premere **Add** ed inserire: + +Name | Code | Flag +--- | --- | --- +tagish | com.tagish.auth.DBLogin | required + +Dopodiché cliccare su **Edit** e aggiungere i seguenti valori dal **Module Options**: + +```properties +userTable=USR_USER +userColumn=NM_USERID +passColumn=CD_PSW +saltColumn=CD_SALT +activeColumn=FL_ATTIVO +expirationColumn=DT_SCAD_PSW +useJndiLookup=true +jndiName=java:jboss/datasources/SiamDs +logTable=SACER_LOG.LOG_LOGIN_FALLITO +logTableCols=NM_APPLIC,NM_USERID,CD_IND_SERVER,TIPO_FALLIMENTO, + CD_IND_IP_CLIENT,DS_FALLIMENTO,DT_FALLIMENTO,ID_LOGIN_FALLITO +logTableValues=:nmApplic,:nmUser,:cdIndServer,:tipoFallimento, + :cdIndIpClient,:dsFallimento,:tsFallimento, + SACER_LOG.SLOG_LOGIN_FALLITO.nextval +serverNameSystemProperty=jboss.node.name +qryParamUserName=nmUser +qryParamDate=tsLogin +``` + +Poiché da interfaccia non è possibile inserire valori con spazi, bisogna aprire il file standalone.xml e aggiungere questi valori +all'elemento `` + +```xml + + + + + +``` + +Il file nel complesso dovrebbe risultare così: +```xml + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +I parametri appena elencati dipendono dalla versione del modulo *idp-jaas-rdbms*, ad oggi l'ultima versione è la **0.0.11**. + +## Configurazione del connettore jca XADisk + +*Configuration > Subsystem > Resource Adapters* + +**(+)** + +Chiave | Valore +------ | ------ +Archive | XADisk.rar +Module | - +Name | XADisk.rar + +Poi cliccando su **View** si entra nel dettaglio ed è possibile definire: + +*Configuration -> Attributes* + +Chiave | Valore +--- | ------ +TX | XATransaction +Config Properties | instanceId=xaDisk1 synchronizeDirectoryChanges=true xaDiskHome=/opt/jboss-eap/parer_snap/xaDiskHome enableRemoteInvocations=false + +**Connection Definitions** + +Cliccare su **Add** + +Chiave | Valore +--- | ------ +Name | xaDiskPool +Class name | org. xadisk. connector. outbound. XADiskManagedConnectionFactory + +Quindi cliccando su **Edit** modificare + +Chiave | Valore +--- | ------ +Config Properties | instanceId=xaDisk1 +JNDI Name | java:/jca/xadiskLocal + +Infine nel tab **Pool** impostare: + +Chiave | Valore +--- | ------ +Min Pool Size | 1 +Max Pool Size | 5 + +Tornare nella pagina principale della console web e andare in **Deployments** e cliccare su **(+) > Upload Deployment** e caricare +il file **XADisk.rar**, name e Runtime Name devono essere **XADisk.rar**. +Assicurarsi che il deployment sia "enabled and active". + +Si può configurare allo stesso modo tramite CLI +```bash +/subsystem=resource-adapters/resource-adapter=XADisk.rar:add(archive=XADisk.rar,transaction-support=XATransaction) +/subsystem=resource-adapters/resource-adapter=XADisk.rar/config-properties=instanceId:add(value=xaDisk1) +/subsystem=resource-adapters/resource-adapter=XADisk.rar/config-properties=synchronizeDirectoryChanges:add(value=true) +/subsystem=resource-adapters/resource-adapter=XADisk.rar/config-properties=xaDiskHome:add(value="/opt/jboss-eap/parer_snap/xaDiskHome") +/subsystem=resource-adapters/resource-adapter=XADisk.rar/config-properties=enableRemoteInvocations:add(value=false) +/subsystem=resource-adapters/resource-adapter=XADisk.rar/connection-definitions=xaDiskPool:add(class-name=org.xadisk.connector.outbound.XADiskManagedConnectionFactory,jndi-name=java:/jca/xadiskLocal,min-pool-size=1,max-pool-size=5) +/subsystem=resource-adapters/resource-adapter=XADisk.rar/connection-definitions=xaDiskPool/config-properties=instanceId:add(value=xaDisk1) +``` + +## Utilizzo di XADisk e NFS + +Non è necessario montare le folder con il parametro "sync" perché XADisk forza il fushing delle folder commit +time tramite fsync. +Nel caso delle cache di lookup è invece necessario impostare il parametro *lookupcache=positive* +per non mantenere la cache di entry non presenti sul server. + +## Configurazione dei webservices + +Il subsystem webservices necessita della modifica di 3 parametri che regolano la riscrittura del tag +*soap:address* quando viene generato dinamicamente il wsdl. +Nello specifico, vanno modificati come segue gli attributi **wsdl-port**, **wsdl-secure-port** +e **wsdl-host**: + +```bash +/subsystem=webservices:write-attribute(name=modify-wsdl-address,value=true) +/subsystem=webservices:write-attribute(name=wsdl-port,value=80) +/subsystem=webservices:write-attribute(name=wsdl-secure-port,value=443) +/subsystem=webservices:write-attribute(name=wsdl-host,value=jbossws.undefined.host) +``` + +## Proprietà di sistema + +Per il corretto funzionamento delle applicazioni è necessario aggiungere la seguente proprietà di sistema: + +Chiave | Valore +--- | --- +org.apache.tomcat.util.http.Parameters.MAX_COUNT | 10.000 +discovery-service-enabled | false +abilita-livello-1-spid | false +object-storage-enabled | true +xformer-sp-identity-id | https://${base-url}/xformer +user.country | IT +user.language | it +fed-metadata-url | https://${base-url}/saceriam/federationMetadata + +```bash +/system-property=org.apache.tomcat.util.http.Parameters.MAX_COUNT:add(value=10000) +/system-property=discovery-service-enabled:add(value="false") +/system-property=abilita-livello-1-spid:add(value="false") +/system-property=object-storage-enabled:add(value="true") +/system-property=xformer-sp-identity-id:add(value="https://${base-url}/xformer") +/system-property=user.country:add(value="IT") +/system-property=user.language:add(value="it") +/system-property=fed-metadata-url:add(value="https://${base-url}/saceriam/federationMetadata") +``` +## Logging profiles + +Per standardizzare la scrittura dei log per le applicazioni rilasciate vengono utilizzati i logging-profile +forniti da JBoss. +Le configurazioni possono essere applicate e modificate "a caldo" e dipendono dal nome del profilo +associato al server-group. +Ogni applicazione dispone di un logging-profile specifico con stesso formato di tracciamento ma +diverse regole. + +Esempio di configurazione tramite CLI di un logging profile: +```bash +batch + +echo "Logging-Profile: XFORMER (Snap)" +/subsystem=logging/logging-profile=XFORMER:add + +echo "Log su file" +/subsystem=logging/logging-profile=XFORMER + /periodic-rotating-filehandler= xformer_handler + :add(file={"path"=>"xformer.log", + "relative-to"=> "jboss.server.log.dir"}, suffix=".yyyy-MM-dd" + ,append="true" ) + +/subsystem=logging/logging-profile=XFORMER + /periodic-rotating-filehandler=xformer_handler + :write-attribute(name="level", value="DEBUG") +/subsystem=logging/logging-profile=XFORMER + /periodic-rotating-filehandler=xformer_handler + :write-attribute(name="formatter", + value="%d{yyyy-MM-dd HH:mm:ss,SSS}%-5p [%c] (%t) %s%E%n") + +echo "Logger specifici" +/subsystem=logging/logging-profile=XFORMER + /logger=org.springframework:add +/subsystem=logging/logging-profile=XFORMER + /logger=org.springframework + :write-attribute(name="use-parent-handlers", value="true") +/subsystem=logging/logging-profile=XFORMER + /logger=org.springframework + :write-attribute(name="level", value="ERROR") +/subsystem=logging/logging-profile=XFORMER + /logger=org.opensaml:add +/subsystem=logging/logging-profile=XFORMER + /logger=org.opensaml + :write-attribute(name="use-parent-handlers", value="true") +/subsystem=logging/logging-profile=XFORMER + /logger=org.opensaml:write-attribute(name="level", value="ERROR") +/subsystem=logging/logging-profile=XFORMER + /logger=org.exolab.castor.xml.-NamespacesStack:add +/subsystem=logging/logging-profile=XFORMER + /logger=org.exolab.castor.xml.-NamespacesStack + :write-attribute(name="use-parent-handlers", value="true") +/subsystem=logging/logging-profile=XFORMER + /logger=org.exolab.castor.xml.-NamespacesStack + :write-attribute(name="level", value="OFF") +/subsystem=logging/logging-profile=XFORMER + /logger=org.exolab.castor.xml.EndElementProcessor:add +/subsystem=logging/logging-profile=XFORMER + /logger=org.exolab.castor.xml.EndElementProcessor + :write-attribute(name="use-parent-handlers", value="true") +/subsystem=logging/logging-profile=XFORMER + /logger=org.exolab.castor.xml.EndElementProcessor + :write-attribute(name="level", value="ERROR") +/subsystem=logging/logging-profile=XFORMER + /logger=it.eng.xformer:add +/subsystem=logging/logging-profile=XFORMER + /logger=it.eng.xformer + :write-attribute(name="use-parent-handlers", value="true") +/subsystem=logging/logging-profile=XFORMER + /logger=it.eng.xformer + :write-attribute(name="level", value="DEBUG") +/subsystem=logging/logging-profile=XFORMER + /rootlogger=ROOT:add(handlers=[xformer_handler]) +/subsystem=logging/logging-profile=XFORMER + /root-logger=ROOT:write-attribute(name ="level",value="INFO") + +run-batch +``` + +Di seguito il contenuto XML prodotto dalla configurazione precedente: + +```xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +### Custom JDBC handler + +Per consentire una migliore gestione dei log delle query fatte tramite Hibernate è stato implementato il modulo custom **jboss-module-application-logger**. + +Per installare il modulo bisogna scaricare il progetto + +https://gitlab.ente.regione.emr.it/parer/tools/jboss-module-application-logger + +e lanciare un + +```bash +mvn clean compile +``` +si ottiene un file *jboss-application-logger-x.y.z.zip* che va scompattato nella cartella *${JBOSS_HOME}/module*. + +Vanno infine configurati due logger a cui le singole applicazioni andranno ad aggiungere i propri handler + +```xml + + + + + + + + + + + +``` + +```bash +/subsystem=logging/logger=org.hibernate:add(use-parent-handlers=false,level=INFO) + +/subsystem=logging/logger=jboss.jdbc.spy:add(use-parent-handlers=false,level=DEBUG) + +/subsystem=logging/logger=jboss.jdbc.spy:write-attribute(name=filter-spec,value=match("Statement|prepareStatement")) +``` + +### Modificare i livelli di logging + +Per modificare i livelli di logging andare, dalla console di amministrazione, su +*Configuration > Core > Logging*. + +Nel riquadro *handler* è possibile aggiungere console o file handler specifici. +Nel riquadro *log categories* è possibile associare categorie specifiche di log da assegnare agli +handler. + + +## Configurazione del listener HTTPS + +Vengono utilizzati i subsystem elytron e undertow e in RER la connessione è possibile solo utilizzando un certificato client. +Inoltre, per questioni di sicurezza, si utilizza solo TLSv1.2 + +Tramite CLI questa configurazione si ottiene come di seguito + +```bash +/subsystem=elytron/key-store=RERcerts_KS:add(type=JKS,credential-reference={clear-text=xxx},path=/etc/pki/RER/jboss_cert_auth.jks) +/subsystem=elytron/key-manager=RERcerts_KM:add(key-store=RERcerts_KS,credential-reference={clear-text=xxx},algorithm=SunX509) +/subsystem=elytron/trust-manager=RERcerts_TM:add(key-store=RERcerts_KS) +/subsystem=elytron/key-store=wildcard_ente_regione_emr_it_KS:add(path=/etc/pki/RER/ente.regione.emr.it.jks,type=JKS,credential-reference={clear-text=xxx}) +/subsystem=elytron/key-manager=wildcard_ente_regione_emr_it_KM:add(key-store=wildcard_ente_regione_emr_it_KS,algorithm=SunX509,credential-reference={clear-text=xxx}) +/subsystem=elytron/server-ssl-context=wildcard_ente_regione_emr_it_SSC:add(key-manager=wildcard_ente_regione_emr_it_KM,protocols=["TLSv1.2"]) +/subsystem=elytron/server-ssl-context=wildcard_ente_regione_emr_it_SSC:write-attribute(name=trust-manager,value=RERcerts_TM) +/subsystem=elytron/server-ssl-context=wildcard_ente_regione_emr_it_SSC:write-attribute(name=need-client-auth,value=true) +batch +/subsystem=undertow/server=default-server/https-listener=https:undefine-attribute(name=security-realm) +/subsystem=undertow/server=default-server/https-listener=https:write-attribute(name=ssl-context,value=wildcard_ente_regione_emr_it_SSC) +run-batch +``` + +Per creare il jks con password (/etc/pki/RER/jboss_cert_auth.jks), come utente root: + +```bash + openssl x509 -outform der -in /etc/pki/RER/reram.pem -out /etc/pki/RER/reram.der +openssl x509 -outform der -in /etc/pki/RER/lblrer.pem -out /etc/pki/RER/lblrer.der +/usr/lib/jvm/java-1.8.0-openjdk/bin/keytool -import -alias lbl_ca -keystore /etc/pki/RER/jboss_cert_auth.jks -file /etc/pki/RER/lblrer.der +/usr/lib/jvm/java-1.8.0-openjdk/bin/keytool -import -alias reram -keystore /etc/pki/RER/jboss_cert_auth.jks -file /etc/pki/RER/reram.der +chown root:rercerts /etc/pki/RER/jboss_cert_auth.jks +usermod -a -G rercerts jboss +``` +## Validazione del datasource + +La configurazione di base dei datasource in RER viene fatta con il seguente comando CLI: + +```bash +data-source --profile=PROFILE add --name=DS_NAME --jndi-name=DS_JNDI + --connection-url=DS_URL --user-name=DS_USER --password=DS_PASSWD + --driver-name=ojdbc11 + --exception-sorter-classname + =org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter + --stale-connection-checker-class-name + =org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker + --statistics-enabled=true --use-ccm=true --use-fast-fail=true + --valid-connection-checker-class-name + =org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker + --validate-on-match=true --flush-strategy=FailingConnectionOnly + --backgroundvalidation=false --enabled=true +``` + +Il tema è trattato al paragrafo 12.3.2 della [Configuration guide](#biblio), in particolare nella sezione "Datasource Parameters". + +## URI encoding + +Bisogna impostare come default UTF-8 per l'encoding degli URI. + +```bash +/subsystem=undertow/servlet-container=default:write-attribute(name="default-encoding", value="utf-8") +``` + + +## Configurazione security header + +Con particolare attenzione ad aspetti legati alla sicurezza, si elenanco gli headers utilizzati come default e relativi valori: + +| Header | System property | Default | Nota | +|---|---|---|---| +| [Content-Security-Policy](https://www.w3.org/TR/CSP1/)| http.sec.header.content-security-policy | default-src ''self''; script-src ''self'' ''unsafe-inline'' ''unsafe-eval'' ''report-sample'' *; style-src ''self'' ''report-sample'' ''unsafe-inline'' *; img-src ''self'' data: *; | vedere esempio sotto | +| [X-Content-Type-Options](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options) | - | nosniff | | +| [Referrer-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy) | - | strict-origin-when-cross-origin | | +| [Permissions-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Permissions_Policy) | http.sec.header.permissions-policy | ccross-origin-isolated=\*,vertical-scroll=\* | vedere esempio sotto | + +**Nota:** alcuni dei valori sono impostabili attraverso opportuna system property, se definite su application server, andranno a sostituire il valore di default impostato, come da esempio: + +```bash +# Content-Security-Policy +/system-property=http.sec.header.content-security-policy:add(value="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' 'report-sample' *.regione.emilia-romagna.it *.ente.regione.emr.it; style-src 'self' 'report-sample' 'unsafe-inline' *.regione.emilia-romagna.it *.ente.regione.emr.it; img-src 'self' data: *.regione.emilia-romagna.it *.ente.regione.emr.it") + +# Permissions-Policy +/system-property=http.sec.header.permissions-policy:add(value="accelerometer=*, ambient-light-sensor=*, autoplay=*, battery=*, camera=*, cross-origin-isolated=*, display-capture=*, document-domain=*, encrypted-media=*, execution-while-not-rendered=*, execution-while-out-of-viewport=*, fullscreen=*, geolocation=*, gyroscope=*, keyboard-map=*, magnetometer=*, microphone=*, midi=*, navigation-override=*, payment=*, picture-in-picture=*, publickey-credentials-get=*, screen-wake-lock=*, sync-xhr=*, usb=*, web-share=*, xr-spatial-tracking=*, clipboard-read=*, clipboard-write=*, gamepad=*, speaker-selection=*, conversion-measurement=*, focus-without-user-activation=*, hid=*, idle-detection=*, interest-cohort=*, serial=*, sync-script=*, trust-token-redemption=*, window-placement=*, vertical-scroll=*") + +``` +nell'esempio sopra verranno quindi sostituiti ai default, i valori indicati. + +## Parametri di sistema e della JVM + +I parametri di base utilizzati in RER per l'ambiente di test sono i seguenti: + +```bash +JAVA_HOME=/usr/lib/jvm/jre-11-openjdk +JBOSS_HOME=/var/lib/jboss-eap +JBOSS_MODULEPATH=$JBOSS_HOME/modules:/opt/jboss-eap/modules +PUB_ADDR= +MGMT_ADDR=127.0.0.1 +MULTICAST_ADDR=230.2.1.1 +MESSAGING_PASS= +OFFSET=1 +FLAVOUR=standalone-full-ha.xml +JAVA_OPTS="\ +-server \ +-Xms8192m \ +-Xmx8192m \ +-Djava.net.preferIPv4Stack=true \ +-Djboss.modules.system.pkgs=org.jboss.byteman \ +-Djava.awt.headless=true \ +-Djavax.net.ssl.trustStore=/etc/pki/java/cacerts \ +-XX:+DoEscapeAnalysis \ +-XX:+UseCompressedOops \ +-XX:+CMSClassUnloadingEnabled \ +-XX:+ExplicitGCInvokesConcurrent \ +-XX:CMSInitiatingOccupancyFraction=80 \ +-XX:CMSIncrementalSafetyFactor=20 \ +-XX:+UseCMSInitiatingOccupancyOnly \ +-verbose:gc \ +-Xlog:class+unload=off \ +-Xlog:gc*:/opt/jboss-eap/parer_test/log/gc.log \ +-Duser.country=IT \ +-Duser.language=it \ +-agentlib:jdwp=transport=dt_socket,address=*:12201,server=y,suspend=n \ +" +``` + +## Configurazione customizzazioni interfaccia / altro + +Le applicazioni PARER si presentano prive di loghi e/o elementi caratteristici che ne definiscono una "brandizzazione", per tale motivo sono state inserite le opportune configurazioni e dinamiche configurative che permettono una gestione esterna di alcune risorse (e di altre possibili configurazioni), che attraverso le system properties di JBoss vengono utilizzate dai singoli cotensti appliativi. +Di seguito si riportano le possibili configurazioni supportate. + + +| Nome parametro| Descrizione| Valore predefinito | +|------------------------|--------------------------------------------------------------------|--------------------| +| *disableSecurity* | Permette di disabilitare i controlli di sicurezza tra le varie pagine. | **false** | +| *enableLazySort* | Abilita la possibilità di ordinare le colonne delle liste. | **true** | +| *debugAuthorization* | Debug sulle informazioni relative all'autorizzazione degli utenti.| **false** | +| *logoApp_absolutePath* | Percorso assoluto del logo dell'applicazione. Se configurato sovrascrive l'utilizzo del percorso relativo. | | +| *logoApp_relativePath* | Percorso relativo del logo dell'applicazione. | **/img/logos/logo_app.png** | +| *logoApp_alt* | Nome alternativo del logo dell'applicazione (se non viene trovata l'immagine). | | +| *logoApp_url* | Pagina web associata al logo dell'applicazione. | | +| *logoApp_title* | Title per il logo dell'applicazione. | | +| *logo1_absolutePath* | Percorso assoluto del "logo 1". Se configurato sovrascrive l'utilizzo del percorso relativo. | | +| *logo1_relativePath* | Percorso relativo del "logo 1". | **/img/logos/logo1.png** | +| *logo1_alt* | Nome alternativo del "logo 1" (se non viene trovata l'immagine). | | +| *logo1_url* | Pagina web associata al "logo 1". | | +| *logo1_title* | Title per il "logo 1". | | +| *logo2_absolutePath* | Percorso assoluto del "logo 2". Se configurato sovrascrive l'utilizzo del percorso relativo. | | +| *logo2_relativePath* | Percorso relativo del "logo 2". | **/img/logs/logo2.png** | +| *logo2_alt* | Nome alternativo del "logo 2" (se non viene trovata l'immagine). | | +| *logo2_url* | Pagina web associata al "logo 2". | | +| *logo2_title* | Title per il "logo 2". | | +| *logo3_absolutePath* | Percorso assoluto del "logo 3". Se configurato sovrascrive l'utilizzo del percorso relativo. | | +| *logo3_relativePath* | Percorso relativo del "logo 3". | **/img/logos/logo3.png** | +| *logo3_alt* | Nome alternativo del "logo 3" (se non viene trovata l'immagine). | | +| *logo3_url* | Pagina web associata al "logo 3". | | +| *logo3_title* | Title per il "logo 3". | | +| *favicon_absolutePath* | Percorso assoluto della favicon. Se configurato sovrascrive l'utilizzo del percorso relativo. | | +| *favicon_relativePath* | Percorso relativo della favicon. | **/img/logos/favicon.ico** | +| *cssover_absolutePath* | Percorso assoluto dell'overlay sui css. Se configurato sovrascrive l'utilizzo del percorso relativo. | | +| *cssover_relativePath* | Percorso relativo dell'overlay sui css. | **/css/slForms-over.css** | +| *titolo_applicativo* | Titolo (title html) dell'applicazione. | **Titolo Applicazione** | +| *ambiente_deploy* | Ambiente su cui viene effettuato il deploy dell'applicazione | | +| *enableHelpOnline* | Abilita l'help online. | **false** | + + +Oltre alle risorse statiche con le quali è possibile, per ambiente, customizzare l'aspetto grafico delle singoli applicazioni, vengono introdotti alcuni parametri che riguardano le configurazioni legate ad alcuni WS Rest esposti dalle stesse, attraverso tali parametri è quindi possibile "personalizzare" alcuni valori da essi utilizzati. +Si riporta nella seguente tabelle di quali parametri è possibile modificare il valore (con "null" si intende nessun valore impostato di default): + +| Nome parametro| Descrizione| Valore predefinito | +|------------------------|--------------------------------------------------------------------|--------------------| +| *ws.instanceName* | Nome istanza. | **minefield** | +| *ws.upload.directory* | Directory su cui si effettua l'upload dei file raw presenti sulla chiamata multipart/form-data. | **/tmp** | +| *versamentoSync.saveLogSession* | Versamento sicrono unità documentaria: abilitazione dei log di sessione. | **true** | +| *versamentoSync.maxRequestSize* | Versamento sicrono unità documentaria: dimensione massima della richiesta multipart/form-data in byte. | **1000000000** (1 Gbyte) | +| *versamentoSync.maxFileSize* | Versamento sicrono unità documentaria: dimensione massima del singolo file presente su richiesta multipart/form-data in byte. | **1000000000** (1 Gbyte) | +| *aggAllegati.saveLogSession* | Aggiunta documento: abilitazione dei log di sessione. | **false** | +| *aggAllegati.maxRequestSize* | Aggiunta documento: dimensione massima della richiesta multipart/form-data in byte. | **1000000000** (1 Gbyte) | +| *aggAllegati.maxFileSize* | Aggiunta documento: dimensione massima del singolo file presente su richiesta multipart/form-data in byte. | **1000000000** (1 Gbyte) | +| *profilerApp.upload.directory* | Applicazione profile: directory su cui si effettua l'upload dei file raw presenti sulla chiamata multipart/form-data. | **/tmp** | +| *profilerApp.maxRequestSize* | Applicazione profile:dimensione massima della richiesta multipart/form-data in byte. | **1000000000** (1 Gbyte) | +| *profilerApp.maxFileSize* | Applicazione profile: dimensione massima del singolo file presente su richiesta multipart/form-data in byte.| **10000000** (10 Mbyte) | +| *profilerApp.charset* | Applicazione profile: charset di riferimento. | **UTF-8** | +| *recuperoSync.saveLogSession* | Servizi di recupero: abilitazione dei log di sessione. | **false** | +| *recuperoSync.maxResponseSize* | Servizi di recupero: dimensione massima della risposta restituida dal servizio in byte. | **20000000** (20 Mbyte) | +| *recuperoSync.maxFileSize* | Servizi di recupero: dimensione massima del singolo file presente su richiesta multipart/form-data in byte. | **20000000** (20 Mbyte) | +| *loadXsdApp.upload.directory* | Caricamento modello XSD: directory su cui si effettua l'upload dei file. | **/tmp** | +| *loadXsdApp.maxRequestSize* | Caricamento modello XSD: dimensiome massima della richiesta. | **1000000000** (1 Gbyte) | +| *loadXsdApp.maxFileSize* | Caricamento modello XSD: dimensiome massima del file xsd caricato. | **10000000** (1 Mbyte) | +| *loadXsdApp.charset* | Caricamento modello XSD: charset di riferimento. | **UTF-8** | +| *moduloInformazioni.upload.maxFileSize* | Modulo Informazioni: dimensiome massima del file caricato. | **10000000** (1 Mbyte) | +| *helpOnline.upload.maxFileSize* | Help Online: dimensiome massima del file caricato. | **10000000** (1 Mbyte) | +| *variazioneAccordo.upload.maxFileSize* | Variazione Accordo: dimensiome massima del file caricato. | **10000000** (1 Mbyte) | +| *disciplinareTecnico.upload.maxFileSize* | Disciplinare Tecnico: dimensiome massima del file caricato. | **10000000** (1 Mbyte) | +| *importVersatore.upload.maxFileSize* | Import Versatore: dimensiome massima del file caricato. | **10000000** (1 Mbyte) | +| *parameters.csv.maxFileSize* | Parametri CSV: dimensiome massima del file caricato. | **10000000** (1 Mbyte) | +| *serverName.property* | Property di sistema per identificare il nome del server/nodo (e.s. su Jboss identificato con il valore jboss.node.name). | jboss.node.name | +| *uri.versamentoSync* | URI API versamento sincrono unità documentaria. | | + + +Nota: alcune delle property sopra elencate sono il frutto di un censimento "globale" che non trovo però sempre applicazione, alcune di essere sono infatti da ritenersi non più utilizzate (vedi ~~non utilizzata~~). + +La logica con cui vengono letti e configurati i parametri d'inizializzazione è la seguente: + +1. il parametro è presente sul web.xml; +2. è presente un parametro dal nome ```applicazione-nome_parametro``` sulle proprietà di sistema; +3. è presente un parametro dal nome ```nome_parametro``` sulle proprietà di sistema; +4. viene utilizzato un valore predefinito per il parametro. + +Nel caso in cui si ricada in uno dei casi sopracitati, tutti gli altri non vengono valutati. + +Le risorse con un percorso assoluto non vengono referenziate sull'HTML delle pagine come risorse esterne ma vengono **incluse** nell'applicazione a **deploy time**. +In particolare: + + * il logo dell'applicazione (*logoApp_absolutePath*) sarà disponibile all'applicazione al percorso `/img/external/logo_app.png` + * il logo in alto a destra (*logo1_absolutePath*) sarà disponibile all'applicazione al percorso `/img/external/logo1.png` + * il logo in basso a sinistra (*logo2_absolutePath*) sarà disponibile all'applicazione al percorso `/img/external/logo2.png` + * il logo in basso a destra (*logo3_absolutePath*) sarà disponibile all'applicazione al percorso `/img/external/logo3.png` + * la favicon (*favicon_absolutePath*) sarà disponibile all'applicazione al percorso `/img/external/favicon.ico` + * la sovrascrittura stili CSS (*cssover_absolutePath*) sarà disponibile all'applicazione al percorso `/css/external/slForms-over.css` + +Tali risorse devono essere espresse come URL e possono referenziare indirizzi remoti oppure file. Ecco un esempio: + * logo1_absolutePath: `https://parer.pages.ente.regione.emr.it/risorse-statiche/parer-svil/sacer/img/logo_sacer_small.png` + * logo1_absolutePath: `file:///opt/jbosseap/images/logo_sacer_small.png` + +Siccome le risorse vengono caricate all'interno dell'applicazione non è necessario che siano esposte esternamente. Questo significa che anche per ambienti esposti su internet i loghi possono essere registrati su percorsi interni alle rete dell'application server. + +Disposizione dei loghi all'interno della pagina: + +``` +,--------------------------------------. +|logo applicazione | | logo 1 | +|------------------' '--------| +| | +| | +| | +| | +|-------, ,--------| +|logo 2 | | logo 3 | +`--------------------------------------' +``` +Infine un esempio di script cli con cui inserire le system properties sopra citate: + +```bash +# Common +/system-property=logoApp_title:add(value="Applicazione - Polo Archivistico Regionale dell'Emilia-Romagna") +/system-property=logoApp_alt:add(value="Polo Archivistico Regionale dell'Emilia-Romagna") +/system-property=logo1_title:add(value="ParER - Polo Archivistico Regionale dell'Emilia-Romagna") +/system-property=logo1_alt:add(value="Logo") +/system-property=logo1_url:add(value="https://poloarchivistico.regione.emilia-romagna.it/") +/system-property=logo1_absolutePath:add(value="file:////LogoParer.png") + +/system-property=logo2_title:add(value="Regione Emilia-Romagna") +/system-property=logo2_alt:add(value="Regione Emilia-Romagna") +/system-property=logo2_url:add(value="https://www.regione.emilia-romagna.it") +/system-property=logo2_absolutePath:add(value="file:////LogoER.png") + +/system-property=logo3_absolutePath:add(value="file:////LogoIbc.png") + +/system-property=favicon_absolutePath:add(value="file:////favicon.ico") + + +# Per applicazione + +/system-property=sacer-titolo_applicativo:add(value="SACER") +/system-property=sacer-logoApp_alt:add(value="SACER") +/system-property=sacer-logo1_alt:add(value="SACER") +/system-property=sacer-logoApp_absolutePath:add(value="file:////logo_sacer_small.png") +/system-property=sacer-cssover_absolutePath:add(value="file:////slForms-over.css") + + +/system-property=sacerping-titolo_applicativo:add(value="PING") +/system-property=sacerping-logoApp_alt:add(value="PING") +/system-property=sacerping-logo1_alt:add(value="PING") +/system-property=sacerping-logoApp_absolutePath:add(value="file:////logo_sacer_small.png") +/system-property=sacerping-cssover_absolutePath:add(value="file:////slForms-over.css") + + +/system-property=saceriam-titolo_applicativo:add(value="SIAM") +/system-property=saceriam-logoApp_alt:add(value="SIAM") +/system-property=saceriam-logo1_alt:add(value="SIAM") +/system-property=saceriam-logoApp_absolutePath:add(value="file:////logo_sacer_small.png") +/system-property=saceriam-cssover_absolutePath:add(value="file:////slForms-over.css") + + +/system-property=verso-titolo_applicativo:add(value="VERSO") +/system-property=verso-logoApp_alt:add(value="VERSO") +/system-property=verso-logo1_alt:add(value="VERSO") +/system-property=verso-logoApp_absolutePath:add(value="file:////Logo-SACER-VERSO_Beta.png") +/system-property=verso-uri.versamentoSync:add(value="https://parer.regione.emilia-romagna.it/sacerws/VersamentoSync") + + +/system-property=sacerdips-titolo_applicativo:add(value="DIPS") +/system-property=sacerdips-logoApp_alt:add(value="DIPS") +/system-property=sacerdips-logo1_alt:add(value="DIPS") +/system-property=sacerdips-logoApp_absolutePath:add(value="file:////logo_sacer_small.png") +/system-property=sacerdips-cssover_absolutePath:add(value="file:////slForms-over.css") + +``` + +## Versioni di riferimento + +Qui di seguito una tabella riassuntiva delle versioni dei componenti utilizzati per la configurazione di +JBoss EAP. + +Nome | Versione | Nativo JBoss EAP 7.4 | Descrizione +--- | --- | --- | --- +JBoss EAP | 7.4.7.GA | |Versione completa dell'EAP +Hibernate | 5.4.x | sì | Motore ORM utilizzato come modulo JBoss +Modulo ActiveMQ Artemis | 2.9.x | sì | Implementazione code JMS +XADisk | 1.2.2.5 | no | Transazioni XA su filesystem +Oracle Jdbc | 11 per Oracle 19c | no |Driver per accedere al DB Oracle +idp-jaasrdbms | 0.0.6 | no |Modulo utilizzato per la personalizzazione delle azioni associate al login + +\newpage + +## Riferimenti + +**[Configuration guide]** - https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html-single/configuration_guide/index + +[Configuration guide]: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html-single/configuration_guide/index + +**[Patching and Upgrading guide]** - https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html-single/patching_and_upgrading_guide/index + +[Patching and Upgrading guide]: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html-single/patching_and_upgrading_guide/index + +**[Documentazione RedHat]** - https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/ + +[Documentazione RedHat]: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/ diff --git a/src/docs/JBoss7_configurazione_sacerws.md b/src/docs/JBoss7_configurazione_sacerws.md new file mode 100644 index 0000000..f7a9ffd --- /dev/null +++ b/src/docs/JBoss7_configurazione_sacerws.md @@ -0,0 +1,330 @@ +--- +title: "Configurazione SacerWS" +--- +# Configurazione Jboss EAP 7.3 + +## Versioni + +| Vers. Doc | Vers. SacerWS | Modifiche | +| -------- | ---------- | ---------- | +| 1.0.0 | | Versione iniziale del documento | + +## Datasource XA + +### Console web + +`Configuration > Connector > datasources` + +Scegliere **XA DATASOURCES** e premere + +`Add` + +Si apre un wizard in 3 passaggi +1. Aggiungere gli attributi del datasource: Nome=**SacerVersPool** e JNDI=**java:jboss/datasources/SacerVersDs** +2. Selezionare il driver **ojdbc8** (predisposto durante la configurazione generale di Jboss) e impostare **oracle.jdbc.xa.client.OracleXADataSource** come XA Data Source Class; +3. Impostare gli attributi della connessione, ad esempio *URL* + +#### JBoss CLI + +```bash +xa-data-source add --name=SacerVersPool --jndi-name=java:jboss/datasources/SacerVersDs --xa-datasource-properties={"URL"=>"jdbc:oracle:thin:@parer-vora-b03.ente.regione.emr.it:1521/PARER19S.ente.regione.emr.it"} --user-name=SACER --password=exit --driver-name=ojdbc8 --max-pool-size=64 --spy=true --exception-sorter-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter --stale-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker --valid-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker --statistics-enabled=true --use-ccm=true --use-fast-fail=true --validate-on-match=true --flush-strategy=FailingConnectionOnly --background-validation=false --min-pool-size=8 --enabled=true --allow-multiple-users=false --connectable=false --set-tx-query-timeout=false --share-prepared-statements=false --track-statements=NOWARN +``` + +### Transaction service + +Lo schema dell'applicazione ha bisogno delle seguenti grant su Oracle. + +```sql +GRANT SELECT ON sys.dba_pending_transactions TO SACER; +GRANT SELECT ON sys.pending_trans$ TO SACER; +GRANT SELECT ON sys.dba_2pc_pending TO SACER; +GRANT EXECUTE ON sys.dbms_xa TO SACER; +``` + +La procedura è descritta nella documentazione standard di JBoss EAP 7.3 + +https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.3/html/configuration_guide/datasource_management#vendor_specific_xa_recovery + +## Configurazione Servizio JMS + +Per la configurazione del subsystem si rimanda alla documentazione generale di JBoss EAP 6.4 del ParER. +Una volta fatto è necessario impostare le risorse JMS. + +### Configurazione Risorse JMS e Nomi JNDI + +#### Console web + +Configuration > Messaging > Destinations` + +Andare in `View` sul **default** quindi + +`Queues/Topics > Queue` + +Cliccare su + +`Add` + +e aggiungere le seguenti destinazioni + +Name | JNDI +--- | --- +ElenchiDaElabQueue | java:/jms/queue/ElenchiDaElabQueue | + +#### JBoss CLI + +```bash +jms-queue add --queue-address=ElenchiDaElabQueue --entries=[java:/jms/queue/ElenchiDaElabQueue] +``` + +### Bean pool per gli MDB + +#### Console web + +Configuration > Container > EJB 3 > BEAN POOLS` + +Aggiungere i seguenti Bean Pools + +Name | Max Pool Size | Timeout | Timeout unit | +--- | --- | --- | --- | +coda-elenchi-da-elab-pool | 3 | 5 | MINUTES | + +#### JBoss CLI + +```bash +/subsystem=ejb3/strict-max-bean-instance-pool=coda-elenchi-da-elab-pool:add(max-pool-size=5, timeout=5, timeout-unit="MINUTES") +``` + + + +## Logging profile + +### JDBC custom handler +Assicurarsi di aver installato il modulo ApplicationLogCustomHandler (Vedi documentazione di configurazione di Jboss EAP 7.3). + +Configurare un custom handler nel subsystem **jboss:domain:logging:1.5**. + +```xml + + + + + + + + + + + + + + +``` + +I comandi CLI + +```bash +/subsystem=logging/custom-handler=sacerws_jdbc_handler:add(class=it.eng.tools.jboss.module.logger.ApplicationLogCustomHandler,module=it.eng.tools.jboss.module.logger,level=INFO) +/subsystem=logging/custom-handler=sacerws_jdbc_handler:write-attribute(name=named-formatter,value=PATTERN) +/subsystem=logging/custom-handler=sacerws_jdbc_handler:write-attribute(name=properties,value={fileName=>"sacerws_jdbc.log", deployment=>"sacerws"}) +``` + +Associare l'handler ai logger **jboss.jdbc.spy** e **org.hibernate**, sempre nel subsystem **jboss:domain:logging:1.5**. + +```xml + + + + + + + + + + + + + + + + + +``` + +I comandi CLI + +```bash +/subsystem=logging/logger=org.hibernate:add-handler(name=sacerws_jdbc_handler) +/subsystem=logging/logger=jboss.jdbc.spy:add-handler(name=sacerws_jdbc_handler) +``` + +### Profilo di SacerWS + +#### JBoss CLI + +```bash +/subsystem=logging/logging-profile=SACERWS:add() +/subsystem=logging/logging-profile=SACERWS/periodic-rotating-file-handler=sacerws_handler:add(level=INFO,formatter="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n",file={path="sacerws.log",relative-to="jboss.server.log.dir"},suffix=".yyyy-MM-dd",append=true) +/subsystem=logging/logging-profile=SACERWS/size-rotating-file-handler=sacerws_tx_connection_handler:add(level=DEBUG,formatter="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n",file={path="sacerws_conn_handler.log",relative-to="jboss.server.log.dir"},append=true,max-backup-index=1,rotate-size="256m") +/subsystem=logging/logging-profile=SACERWS/logger=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener:add(level=DEBUG,handlers=[sacerws_tx_connection_handler],use-parent-handlers=false) +/subsystem=logging/logging-profile=SACERWS/root-logger=ROOT:add(level=INFO,handlers=[sacerws_handler]) +/subsystem=logging/logging-profile=SACERWS/logger=org.springframework:add(level=ERROR,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=org.opensaml:add(level=ERROR,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=es.mityc:add(level=INFO,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=it.eng.crypto:add(level=INFO,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=it.eng.parer.crypto:add(level=INFO,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=it.eng.parer.volume:add(level=INFO,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=it.eng.parer.ws:add(level=INFO,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=it.eng.parer.restWS:add(level=INFO,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=it.eng.parer.admin:add(level=INFO,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=it.eng.parer.web:add(level=INFO,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=it.eng.spagoLite:add(level=INFO,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=it.eng.parer.ws.utils.AvanzamentoWs:add(level=OFF,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=org.exolab.castor.xml.NamespacesStack:add(level=OFF,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=org.exolab.castor.xml.EndElementProcessor:add(level=ERROR,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=org.hibernate:add(level=ERROR,use-parent-handlers=true) +/subsystem=logging/logging-profile=SACERWS/logger=jboss.jdbc.spy:add(level=ERROR,use-parent-handlers=true) +``` + +```xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +## System properties + +### Console web + +`Configuration > System properties` + +Impostare le seguenti properties + +Chiave | Valore di esempio | Descrizione +--- | --- | --- +reportvf.aws.accessKeyId | | Access Key id delle credenziali S3 per l’accesso all’object storage per i report di verifica firma. +reportvf.aws.secretKey | | Secret Key delle credenziali S3 per l’accesso all’object storage per i report di verifica firma. + +### jboss cli + +```bash +/system-property=reportvf.aws.accessKeyId:add(value="") +/system-property=reportvf.aws.secretKey:add(value="") +``` + +## Regole di Rewrite + +Tutte le risorse esposte dal contesto */sacerws* **NON** devono essere accessibili ad eccezione di: + - https://parer.regione.emilia-romagna.it/sacerws/VersamentoFascicoloSync ; + - https://parer.regione.emilia-romagna.it/sacerws/VersamentoSync ; + - https://parer.regione.emilia-romagna.it/sacerws/AggiuntaAllegatiSync ; + - https://parer.regione.emilia-romagna.it/sacerws/VersamentoMultiMedia . + +## Object storage: configurazione AWS Access Key ID e Secret Access Key + +Sono attivabili da applicazione, meccanismi di accesso a file depositati su object storage, nello specifico è possibile configuare alcune system properties che permettono all'applicazione di recuperare in modalità chiave/valore le credenziali di accesso necessarie per l'interazione con l'object storage secondo lo standard AWS S3 (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) +La chiave da impostare dipende dalla configurazione presente su database, vedere nello specifico la tabella **DEC_CONFIG_OBJECT_STORAGE**, nella quale potranno essere configurate le chiavi presenti tra le system properties, se ne riporta di seguito un esempio: + +```bash +batch + +/system-property=sip-w.aws.accessKeyId:add(value="$accessKeyId") +/system-property=sip-w.aws.secretKey:add(value="$secretKey") + +run-batch + +``` + +nel caso specifico dello script sopra riportato, le chiavi interessate sono : **sip-w.aws.accessKeyId** e **sip-w.aws.secretKey**; rispettivamente configurate sulla tabella citata in precedenza. + +Esempio di configuazione su database + + +| ID_DEC_CONFIG_OBJECT_STORAGE | ID_DEC_BACKEND | DS_VALORE_CONFIG_OBJECT_STORAGE | TI_USO_CONFIG_OBJECT_STORAGE | NM_CONFIG_OBJECT_STORAGE | DS_DESCRIZIONE_CONFIG_OBJECT_STORAGE | +|---|---|---|---|---|---| +| 1 | 2 | ACCESS_KEY_ID_SYS_PROP | sip-w.aws.accessKeyId | WRITE_SIP | Nome della system property utilizzata per l'access key id per il bucket dei sip in sola scrittura | +| 2 | 2 | SECRET_KEY_SYS_PROP | sip-w.aws.secretKey | WRITE_SIP | Nome della system property utilizzata per la secret key per il bucket dei sip in sola scrittura | + +Nota: la FK (chiave esterna) legata al valore presente su colonna ID_DEC_BACKEND, dipende dalla configurazione presente su DEC_BACKEND. +