ModIProperties.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */

  20. package org.openspcoop2.protocol.modipa.config;

  21. import java.util.ArrayList;
  22. import java.util.HashMap;
  23. import java.util.List;
  24. import java.util.Map;
  25. import java.util.Properties;
  26. import java.util.stream.Collectors;

  27. import org.apache.commons.lang.StringUtils;
  28. import org.openspcoop2.core.id.IDSoggetto;
  29. import org.openspcoop2.pdd.config.PDNDResolver;
  30. import org.openspcoop2.pdd.core.keystore.KeystoreException;
  31. import org.openspcoop2.pdd.core.keystore.RemoteStoreConfigPropertiesUtils;
  32. import org.openspcoop2.pdd.core.token.Costanti;
  33. import org.openspcoop2.pdd.core.token.parser.Claims;
  34. import org.openspcoop2.protocol.basic.BasicStaticInstanceConfig;
  35. import org.openspcoop2.protocol.modipa.constants.ModICostanti;
  36. import org.openspcoop2.protocol.modipa.utils.ModISecurityConfig;
  37. import org.openspcoop2.protocol.sdk.ProtocolException;
  38. import org.openspcoop2.utils.BooleanNullable;
  39. import org.openspcoop2.utils.LoggerWrapperFactory;
  40. import org.openspcoop2.utils.UtilsException;
  41. import org.openspcoop2.utils.certificate.KeystoreParams;
  42. import org.openspcoop2.utils.certificate.hsm.HSMUtils;
  43. import org.openspcoop2.utils.certificate.remote.RemoteKeyType;
  44. import org.openspcoop2.utils.certificate.remote.RemoteStoreConfig;
  45. import org.openspcoop2.utils.digest.DigestEncoding;
  46. import org.openspcoop2.utils.resources.Loader;
  47. import org.openspcoop2.utils.transport.http.HttpRequestMethod;
  48. import org.slf4j.Logger;

  49. /**
  50.  * Classe che gestisce il file di properties 'modipa.properties' del protocollo ModI
  51.  *
  52.  * @author Poli Andrea (apoli@link.it)
  53.  * @author $Author$
  54.  * @version $Rev$, $Date$
  55.  */
  56. public class ModIProperties {

  57.     /** Logger utilizzato per errori eventuali. */
  58.     private Logger log = null;


  59.     /** Copia Statica */
  60.     private static ModIProperties modipaProperties = null;

  61.     /* ********  F I E L D S  P R I V A T I  ******** */

  62.     /** Reader delle proprieta' impostate nel file 'modipa.properties' */
  63.     private ModIInstanceProperties reader;





  64.     /* ********  C O S T R U T T O R E  ******** */

  65.     /**
  66.      * Viene chiamato in causa per istanziare il properties reader
  67.      *
  68.      *
  69.      */
  70.     private ModIProperties(String confDir,Logger log) throws ProtocolException{

  71.         if(log != null)
  72.             this.log = log;
  73.         else
  74.             this.log = LoggerWrapperFactory.getLogger("ModIProperties");

  75.         /* ---- Lettura del cammino del file di configurazione ---- */

  76.         if(confDir!=null) {
  77.             // nop
  78.         }
  79.        
  80.         Properties propertiesReader = new Properties();
  81.         try (java.io.InputStream properties = ModIProperties.class.getResourceAsStream("/modipa.properties");){  
  82.             if(properties==null){
  83.                 throw new ProtocolException("File '/modipa.properties' not found");
  84.             }
  85.             propertiesReader.load(properties);
  86.         }catch(Exception e) {
  87.             this.logError("Riscontrato errore durante la lettura del file 'modipa.properties': "+e.getMessage());
  88.             throw new ProtocolException("ModIProperties initialize error: "+e.getMessage(),e);
  89.         }
  90.         try{
  91.             this.reader = new ModIInstanceProperties(propertiesReader, this.log);
  92.         }catch(Exception e){
  93.             throw new ProtocolException(e.getMessage(),e);
  94.         }

  95.     }

  96.     /**
  97.      * Il Metodo si occupa di inizializzare il propertiesReader
  98.      *
  99.      *
  100.      */
  101.     public static synchronized void initialize(String confDir,Logger log) throws ProtocolException{

  102.         if(ModIProperties.modipaProperties==null)
  103.             ModIProperties.modipaProperties = new ModIProperties(confDir,log);  

  104.     }

  105.     /**
  106.      * Ritorna l'istanza di questa classe
  107.      *
  108.      * @return Istanza di ModIProperties
  109.      * @throws Exception
  110.      *
  111.      */
  112.     public static ModIProperties getInstance() throws ProtocolException{

  113.         if(ModIProperties.modipaProperties==null) {
  114.             // spotbugs warning 'SING_SINGLETON_GETTER_NOT_SYNCHRONIZED': l'istanza viene creata allo startup
  115.             synchronized (ModIProperties.class) {
  116.                 throw new ProtocolException("ModIProperties not initialized (use init method in factory)");
  117.             }
  118.         }

  119.         return ModIProperties.modipaProperties;
  120.     }

  121.     private void logDebug(String msg) {
  122.         this.log.debug(msg);
  123.     }
  124.     private void logWarn(String msg) {
  125.         this.log.warn(msg);
  126.     }
  127.     private void logError(String msg, Exception e) {
  128.         this.log.error(msg,e);
  129.     }
  130.     private void logError(String msg) {
  131.         this.log.error(msg);
  132.     }
  133.     private String getPrefixProprieta(String propertyName) {
  134.         return "Proprietà '"+propertyName+"'";
  135.     }
  136.     private String getPrefixValoreIndicatoProprieta(String value, String name) {
  137.         return "Valore '"+value+"' indicato nella proprietà '"+name+"'";
  138.     }
  139.     private String getSuffixSuperioreMassimoConsentitoControlloDisabilitato(long maxLongValue) {
  140.         return " superiore al massimo consentito '"+maxLongValue+"'; il controllo viene disabilitato";
  141.     }
  142.     private String getMessaggioVerificaDisabilitata(String name) {
  143.         return "Verifica gestita tramite la proprietà '"+name+"' disabilitata.";
  144.     }
  145.     private String getMessaggioErroreProprietaNonImpostata(String propertyName, Boolean defaultValue) {
  146.         return getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue.toString());
  147.     }
  148.     private String getMessaggioErroreProprietaNonImpostata(String propertyName, Integer defaultValue) {
  149.         return getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue.toString());
  150.     }
  151.     private String getMessaggioErroreProprietaNonImpostata(String propertyName, String defaultValue) {
  152.         return getPrefixProprieta(propertyName)+" non impostata, viene utilizzato il default="+defaultValue;
  153.     }
  154.     private String getMessaggioErroreProprietaNonImpostata(String pName, Exception e) {
  155.         return getPrefixProprieta(pName)+" non impostata, errore:"+e.getMessage();
  156.     }
  157.     private String getMessaggioErroreProprietaNonCorretta(String pName, Exception e) {
  158.         return getPrefixProprieta(pName)+" non corretta, errore:"+e.getMessage();
  159.     }
  160.        
  161.     private String getSuffixErrore(Exception e) {
  162.         return ", errore:"+e.getMessage();
  163.     }

  164.     private ProtocolException newProtocolExceptionPropertyNonDefinita() {
  165.         return new ProtocolException("non definita");
  166.     }
  167.    
  168.     private static final String INVALID_VALUE = "Invalid value";
  169.    

  170.     public void validaConfigurazione(Loader loader) throws ProtocolException  {
  171.         try{  

  172.             if(loader!=null) {
  173.                 // nop
  174.             }
  175.            
  176.             generateIDasUUID();
  177.            
  178.             /* **** TRUST STORE **** */
  179.            
  180.             String trustStoreType = getSicurezzaMessaggioCertificatiTrustStoreTipo();
  181.             if(trustStoreType!=null) {
  182.                 if(!HSMUtils.isKeystoreHSM(trustStoreType)) {
  183.                     getSicurezzaMessaggioCertificatiTrustStorePath();
  184.                     getSicurezzaMessaggioCertificatiTrustStorePassword();
  185.                 }
  186.                 getSicurezzaMessaggioCertificatiTrustStoreCrls();
  187.                 getSicurezzaMessaggioCertificatiTrustStoreOcspPolicy();
  188.             }
  189.            
  190.             String sslTrustStoreType = getSicurezzaMessaggioSslTrustStoreTipo();
  191.             if(sslTrustStoreType!=null) {
  192.                 if(!HSMUtils.isKeystoreHSM(sslTrustStoreType)) {
  193.                     getSicurezzaMessaggioSslTrustStorePath();
  194.                     getSicurezzaMessaggioSslTrustStorePassword();
  195.                 }
  196.                 getSicurezzaMessaggioSslTrustStoreCrls();
  197.                 getSicurezzaMessaggioSslTrustStoreOcspPolicy();
  198.             }
  199.            
  200.             getRemoteStoreConfig();
  201.            
  202.             getValidazioneTokenOAuthClaimsRequired();
  203.             getValidazioneTokenPDNDClaimsRequired();
  204.            
  205.             /* **** KEY STORE **** */
  206.            
  207.             String keystoreType = getSicurezzaMessaggioCertificatiKeyStoreTipo();
  208.             if(keystoreType!=null) {
  209.                 if(!HSMUtils.isKeystoreHSM(keystoreType)) {
  210.                     getSicurezzaMessaggioCertificatiKeyStorePath();
  211.                     getSicurezzaMessaggioCertificatiKeyStorePassword();
  212.                 }
  213.                 getSicurezzaMessaggioCertificatiKeyAlias();
  214.                 if(!HSMUtils.isKeystoreHSM(keystoreType) || HSMUtils.isHsmConfigurableKeyPassword()) {
  215.                     getSicurezzaMessaggioCertificatiKeyPassword();
  216.                 }
  217.                 getSicurezzaMessaggioCertificatiKeyClientId();
  218.                 getSicurezzaMessaggioCertificatiKeyKid();
  219.             }
  220.            
  221.             /* **** CORNICE SICUREZZA **** */
  222.            
  223.             if(isSicurezzaMessaggioCorniceSicurezzaEnabled()!=null && isSicurezzaMessaggioCorniceSicurezzaEnabled().booleanValue()) {
  224.                 getSicurezzaMessaggioCorniceSicurezzaRestCodiceEnte();
  225.                 getSicurezzaMessaggioCorniceSicurezzaRestUser();
  226.                 getSicurezzaMessaggioCorniceSicurezzaRestIpuser();  
  227.                 getSicurezzaMessaggioCorniceSicurezzaSoapCodiceEnte();
  228.                 getSicurezzaMessaggioCorniceSicurezzaSoapUser();
  229.                 getSicurezzaMessaggioCorniceSicurezzaSoapIpuser();  
  230.                 getSicurezzaMessaggioCorniceSicurezzaDynamicCodiceEnte();
  231.                 getSicurezzaMessaggioCorniceSicurezzaDynamicUser();
  232.                 getSicurezzaMessaggioCorniceSicurezzaDynamicIpuser();  
  233.             }
  234.            
  235.             /* **** AUDIT **** */
  236.            
  237.             getAuditConfig();
  238.             getSecurityTokenHeaderModIAudit();
  239.             isSecurityTokenAuditX509AddKid();
  240.             isSecurityTokenAuditApiSoapX509RiferimentoX5c();
  241.             isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate();
  242.             isSecurityTokenAuditApiSoapX509RiferimentoX5u();
  243.             isSecurityTokenAuditApiSoapX509RiferimentoX5t();
  244.             isSecurityTokenAuditProcessArrayModeEnabled();
  245.             isSecurityTokenAuditAddPurposeId();
  246.             isSecurityTokenAuditExpectedPurposeId();
  247.             isSecurityTokenAuditCompareAuthorizationPurposeId();
  248.             getSecurityTokenAuditDnonceSize();
  249.             getSecurityTokenAuditDigestAlgorithm();
  250.                    
  251.            
  252.             /* **** TRACCE **** */
  253.            
  254.             this.isGenerazioneTracce();
  255.             this.isGenerazioneTracceRegistraToken();
  256.             this.isGenerazioneTracceRegistraCustomClaims();
  257.             this.getGenerazioneTracceRegistraCustomClaimsBlackList();
  258.            
  259.             /* **** Versionamento **** */
  260.            
  261.             this.isModIVersioneBozza();
  262.            
  263.             /* **** REST **** */
  264.            
  265.             getRestSecurityTokenHeaderModI();
  266.             isSecurityTokenX509AddKid();
  267.             isSecurityTokenIntegrity01AddPurposeId();
  268.             isSecurityTokenIntegrity02AddPurposeId();
  269.             if(isRestSecurityTokenClaimsIssuerEnabled()) {
  270.                 getRestSecurityTokenClaimsIssuerHeaderValue();
  271.             }
  272.             if(isRestSecurityTokenClaimsSubjectEnabled()) {
  273.                 getRestSecurityTokenClaimsSubjectHeaderValue();
  274.             }
  275.             getRestSecurityTokenClaimsClientIdHeader();
  276.             getRestSecurityTokenClaimSignedHeaders();
  277.             getRestSecurityTokenClaimRequestDigest();
  278.             getRestSecurityTokenSignedHeaders();
  279.             getRestSecurityTokenClaimsIatTimeCheckMilliseconds();
  280.             getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMilliseconds();
  281.             isRestSecurityTokenClaimsExpTimeCheck();
  282.             getRestSecurityTokenClaimsExpTimeCheckToleranceMilliseconds();
  283.             getRestSecurityTokenClaimsNbfTimeCheckToleranceMilliseconds();
  284.             getRestSecurityTokenDigestDefaultEncoding();
  285.             isRestSecurityTokenDigestEncodingChoice();
  286.             getRestSecurityTokenDigestEncodingAccepted();
  287.             isRestSecurityTokenRequestDigestClean();
  288.             isRestSecurityTokenResponseDigestClean();
  289.             isRestSecurityTokenResponseDigestHEADuseServerHeader();
  290.             isRestSecurityTokenFaultProcessEnabled();
  291.             isRestSecurityTokenAudienceProcessArrayModeEnabled();
  292.             getRestResponseSecurityTokenAudienceDefault(null);
  293.             getRestCorrelationIdHeader();
  294.             getRestReplyToHeader();
  295.             getRestLocationHeader();
  296.             isRestProfiliInterazioneCheckCompatibility();
  297.            
  298.             // .. Bloccante ..
  299.             getRestBloccanteHttpStatus();
  300.             getRestBloccanteHttpMethod();
  301.            
  302.             // .. PUSH ..
  303.             isRestSecurityTokenPushReplyToUpdateOrCreateInFruizione();
  304.             isRestSecurityTokenPushReplyToUpdateInErogazione();
  305.             isRestSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists();
  306.             getRestNonBloccantePushRequestHttpStatus();
  307.             getRestNonBloccantePushRequestHttpMethod();
  308.             getRestNonBloccantePushResponseHttpStatus();
  309.             getRestNonBloccantePushResponseHttpMethod();
  310.            
  311.             // .. PULL ..
  312.             getRestNonBloccantePullRequestHttpStatus();
  313.             getRestNonBloccantePullRequestHttpMethod();
  314.             getRestNonBloccantePullRequestStateNotReadyHttpStatus();
  315.             getRestNonBloccantePullRequestStateOkHttpStatus();
  316.             getRestNonBloccantePullRequestStateHttpMethod();
  317.             getRestNonBloccantePullResponseHttpStatus();
  318.             getRestNonBloccantePullResponseHttpMethod();
  319.            
  320.             /* **** SOAP **** */
  321.            
  322.             isSoapSecurityTokenMustUnderstand();
  323.             getSoapSecurityTokenActor();
  324.             getSoapSecurityTokenTimestampCreatedTimeCheckMilliseconds();
  325.             getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMilliseconds();
  326.             isSoapSecurityTokenTimestampExpiresTimeCheck();
  327.             getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMilliseconds();
  328.             isSoapSecurityTokenFaultProcessEnabled();
  329.            
  330.             isSoapWSAddressingMustUnderstand();
  331.             getSoapWSAddressingActor();
  332.            
  333.             getSoapCorrelationIdName();
  334.             getSoapCorrelationIdNamespace();
  335.             getSoapCorrelationIdPrefix();
  336.             useSoapBodyCorrelationIdNamespace();
  337.             isSoapCorrelationIdMustUnderstand();
  338.             getSoapCorrelationIdActor();
  339.            
  340.             getSoapReplyToName();
  341.             getSoapReplyToNamespace();
  342.             getSoapReplyToPrefix();
  343.             useSoapBodyReplyToNamespace();
  344.             isSoapReplyToMustUnderstand();
  345.             getSoapReplyToActor();
  346.            
  347.             getSoapRequestDigestName();
  348.             getSoapRequestDigestNamespace();
  349.             getSoapRequestDigestPrefix();
  350.             useSoapBodyRequestDigestNamespace();
  351.             isSoapRequestDigestMustUnderstand();
  352.             getSoapRequestDigestActor();
  353.            
  354.             getSoapResponseSecurityTokenAudienceDefault(null);
  355.            
  356.             isSoapSecurityTokenWsaToSoapAction();
  357.             isSoapSecurityTokenWsaToOperation();
  358.             isSoapSecurityTokenWsaToDisabled();
  359.            
  360.             // .. PUSH ..
  361.             isSoapSecurityTokenPushReplyToUpdateOrCreateInFruizione();
  362.             isSoapSecurityTokenPushReplyToUpdateInErogazione();
  363.             isSoapSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists();
  364.            
  365.             /* **** CONFIGURAZIONE **** */
  366.            
  367.             isReadByPathBufferEnabled();
  368.             isValidazioneBufferEnabled();
  369.             isRiferimentoIDRichiestaPortaDelegataRequired();
  370.             isRiferimentoIDRichiestaPortaApplicativaRequired();
  371.             isTokenOAuthUseJtiIntegrityAsMessageId();
  372.            
  373.             /* **** SOAP FAULT (Generati dagli attori esterni) **** */
  374.            
  375.             this.isAggiungiDetailErroreApplicativoSoapFaultApplicativo();
  376.             this.isAggiungiDetailErroreApplicativoSoapFaultPdD();
  377.             this.isGenerazioneDetailsSOAPFaultProtocolValidazione();
  378.             this.isGenerazioneDetailsSOAPFaultProtocolProcessamento();
  379.             this.isGenerazioneDetailsSOAPFaultProtocolWithStackTrace();
  380.             this.isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche();
  381.            
  382.              /* **** SOAP FAULT (Integrazione, Porta Delegata) **** */
  383.            
  384.             this.isGenerazioneDetailsSOAPFaultIntegrationServerError();
  385.             this.isGenerazioneDetailsSOAPFaultIntegrationClientError();
  386.             this.isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace();
  387.             this.isGenerazioneDetailsSOAPFaultIntegrazionConInformazioniGeneriche();
  388.            
  389.             /* **** SOAP FAULT (Protocollo, Porta Applicativa) **** */
  390.            
  391.             this.isPortaApplicativaBustaErrorePersonalizzaElementiFault();
  392.             this.isPortaApplicativaBustaErroreAggiungiErroreApplicativo();
  393.            
  394.             /* **** Static instance config **** */
  395.            
  396.             this.useConfigStaticInstance();
  397.             this.useErroreApplicativoStaticInstance();
  398.             this.useEsitoStaticInstance();
  399.             this.getStaticInstanceConfig();
  400.            
  401.             /* **** Signal Hub **** */
  402.             if(isSignalHubEnabled()) {
  403.                 this.getSignalHubAlgorithms();
  404.                 this.getSignalHubDefaultAlgorithm();
  405.                 this.getSignalHubSeedSize();
  406.                 this.getSignalHubDefaultSeedSize();
  407.                 this.isSignalHubSeedLifetimeUnlimited();
  408.                 this.getSignalHubDeSeedSeedLifetimeDaysDefault();
  409.                 this.getSignalHubApiName();
  410.                 this.getSignalHubApiVersion();
  411.                 this.getSignalHubConfig();
  412.                 this.getSignalHubSeedSize();
  413.                 this.getSignalHubDigestHistroy();
  414.             }
  415.         }catch(java.lang.Exception e) {
  416.             String msg = "Riscontrato errore durante la validazione della proprieta' del protocollo modipa, "+e.getMessage();
  417.             this.logError(msg,e);
  418.             throw new ProtocolException(msg,e);
  419.         }
  420.     }


  421.     /**
  422.      * Esempio di read property
  423.      *  
  424.      * @return Valore della property
  425.      *
  426.      */
  427.     private Boolean generateIDasUUID = null;
  428.     public Boolean generateIDasUUID(){
  429.         if(this.generateIDasUUID==null){
  430.            
  431.             Boolean defaultValue = true;
  432.             String propertyName = "org.openspcoop2.protocol.modipa.id.uuid";
  433.            
  434.             try{  
  435.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  436.                 if (value != null){
  437.                     value = value.trim();
  438.                     this.generateIDasUUID = Boolean.parseBoolean(value);
  439.                 }else{
  440.                     this.logWarn(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  441.                     this.generateIDasUUID = defaultValue;
  442.                 }

  443.             }catch(java.lang.Exception e) {
  444.                 this.logWarn(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  445.                 this.generateIDasUUID = defaultValue;
  446.             }
  447.         }

  448.         return this.generateIDasUUID;
  449.     }
  450.    
  451.    
  452.    
  453.    
  454.    
  455.    
  456.    
  457.     /* **** TRUST STORE **** */
  458.        
  459.     // riferito in org.openspcoop2.protocol.utils.ModIUtils
  460.     // non modificare il nome
  461.     public KeystoreParams getSicurezzaMessaggioCertificatiTrustStore() throws ProtocolException {
  462.         KeystoreParams params = null;
  463.         String trustStoreType = getSicurezzaMessaggioCertificatiTrustStoreTipo();
  464.         if(trustStoreType!=null) {
  465.             params = new KeystoreParams();
  466.             params.setType(trustStoreType);
  467.             params.setPath(getSicurezzaMessaggioCertificatiTrustStorePath());
  468.             params.setPassword(getSicurezzaMessaggioCertificatiTrustStorePassword());
  469.             params.setCrls(getSicurezzaMessaggioCertificatiTrustStoreCrls());
  470.             params.setOcspPolicy(getSicurezzaMessaggioCertificatiTrustStoreOcspPolicy());
  471.         }
  472.         return params;
  473.     }
  474.    
  475.     private String sicurezzaMessaggioCertificatiTrustStoreTipo= null;
  476.     private Boolean sicurezzaMessaggioCertificatiTrustStoreTipoReaded= null;
  477.     public String getSicurezzaMessaggioCertificatiTrustStoreTipo() {
  478.         if(this.sicurezzaMessaggioCertificatiTrustStoreTipoReaded==null){
  479.             try{  
  480.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.trustStore.tipo");
  481.                
  482.                 if (value != null){
  483.                     value = value.trim();
  484.                     this.sicurezzaMessaggioCertificatiTrustStoreTipo = value;
  485.                 }
  486.                
  487.                 this.sicurezzaMessaggioCertificatiTrustStoreTipoReaded = true;
  488.                
  489.             }catch(java.lang.Exception e) {
  490.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.trustStore.tipo' non impostata, errore:"+e.getMessage());
  491.                 this.sicurezzaMessaggioCertificatiTrustStoreTipoReaded = true;
  492.             }
  493.         }
  494.        
  495.         return this.sicurezzaMessaggioCertificatiTrustStoreTipo;
  496.     }  
  497.    
  498.     private String sicurezzaMessaggioCertificatiTrustStorePath= null;
  499.     public String getSicurezzaMessaggioCertificatiTrustStorePath() throws ProtocolException{
  500.         if(this.sicurezzaMessaggioCertificatiTrustStorePath==null){
  501.             try{  
  502.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.trustStore.path");
  503.                
  504.                 if (value != null){
  505.                     value = value.trim();
  506.                     this.sicurezzaMessaggioCertificatiTrustStorePath = value;
  507.                 }
  508.                 else {
  509.                     throw newProtocolExceptionPropertyNonDefinita();
  510.                 }
  511.                
  512.             }catch(java.lang.Exception e) {
  513.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.trustStore.path' non impostata, errore:"+e.getMessage());
  514.                 throw new ProtocolException(e.getMessage(),e);
  515.             }
  516.         }
  517.        
  518.         return this.sicurezzaMessaggioCertificatiTrustStorePath;
  519.     }
  520.    
  521.     private String sicurezzaMessaggioCertificatiTrustStorePassword= null;
  522.     public String getSicurezzaMessaggioCertificatiTrustStorePassword() throws ProtocolException{
  523.         if(this.sicurezzaMessaggioCertificatiTrustStorePassword==null){
  524.             try{  
  525.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.trustStore.password");
  526.                
  527.                 if (value != null){
  528.                     value = value.trim();
  529.                     this.sicurezzaMessaggioCertificatiTrustStorePassword = value;
  530.                 }
  531.                 else {
  532.                     throw newProtocolExceptionPropertyNonDefinita();
  533.                 }
  534.                
  535.             }catch(java.lang.Exception e) {
  536.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.trustStore.password' non impostata, errore:"+e.getMessage());
  537.                 throw new ProtocolException(e.getMessage(),e);
  538.             }
  539.         }
  540.        
  541.         return this.sicurezzaMessaggioCertificatiTrustStorePassword;
  542.     }  
  543.    
  544.     private Boolean sicurezzaMessaggioCertificatiTrustStoreCrlsReaded= null;
  545.     private String sicurezzaMessaggioCertificatiTrustStoreCrls= null;
  546.     public String getSicurezzaMessaggioCertificatiTrustStoreCrls() throws ProtocolException{
  547.         if(this.sicurezzaMessaggioCertificatiTrustStoreCrlsReaded==null){
  548.             String pName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.trustStore.crls";
  549.             try{  
  550.                 String value = this.reader.getValueConvertEnvProperties(pName);
  551.                
  552.                 if (value != null){
  553.                     value = value.trim();
  554.                     this.sicurezzaMessaggioCertificatiTrustStoreCrls = value;
  555.                 }
  556.                
  557.                 this.sicurezzaMessaggioCertificatiTrustStoreCrlsReaded = true;
  558.                
  559.             }catch(java.lang.Exception e) {
  560.                 this.logError(getMessaggioErroreProprietaNonImpostata(pName, e));
  561.                 throw new ProtocolException(e.getMessage(),e);
  562.             }
  563.         }
  564.        
  565.         return this.sicurezzaMessaggioCertificatiTrustStoreCrls;
  566.     }  
  567.    
  568.     private Boolean sicurezzaMessaggioCertificatiTrustStoreOcspPolicyReaded= null;
  569.     private String sicurezzaMessaggioCertificatiTrustStoreOcspPolicy= null;
  570.     public String getSicurezzaMessaggioCertificatiTrustStoreOcspPolicy() throws ProtocolException{
  571.         if(this.sicurezzaMessaggioCertificatiTrustStoreOcspPolicyReaded==null){
  572.             String pName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.trustStore.ocspPolicy";
  573.             try{  
  574.                 String value = this.reader.getValueConvertEnvProperties(pName);
  575.                
  576.                 if (value != null){
  577.                     value = value.trim();
  578.                     this.sicurezzaMessaggioCertificatiTrustStoreOcspPolicy = value;
  579.                 }
  580.                
  581.                 this.sicurezzaMessaggioCertificatiTrustStoreOcspPolicyReaded = true;
  582.                
  583.             }catch(java.lang.Exception e) {
  584.                 this.logError(getMessaggioErroreProprietaNonImpostata(pName, e));
  585.                 throw new ProtocolException(e.getMessage(),e);
  586.             }
  587.         }
  588.        
  589.         return this.sicurezzaMessaggioCertificatiTrustStoreOcspPolicy;
  590.     }  
  591.    
  592.    
  593.    
  594.     // riferito in org.openspcoop2.protocol.utils.ModIUtils
  595.     // non modificare il nome
  596.     public KeystoreParams getSicurezzaMessaggioSslTrustStore() throws ProtocolException {
  597.         KeystoreParams params = null;
  598.         String sslTrustStoreType = getSicurezzaMessaggioSslTrustStoreTipo();
  599.         if(sslTrustStoreType!=null) {
  600.             params = new KeystoreParams();
  601.             params.setType(sslTrustStoreType);
  602.             params.setPath(getSicurezzaMessaggioSslTrustStorePath());
  603.             params.setPassword(getSicurezzaMessaggioSslTrustStorePassword());
  604.             params.setCrls(getSicurezzaMessaggioSslTrustStoreCrls());
  605.             params.setOcspPolicy(getSicurezzaMessaggioSslTrustStoreOcspPolicy());
  606.         }
  607.         return params;
  608.     }
  609.        
  610.     private String sicurezzaMessaggioSslTrustStoreTipo= null;
  611.     private Boolean sicurezzaMessaggioSslTrustStoreTipoReaded= null;
  612.     public String getSicurezzaMessaggioSslTrustStoreTipo() {
  613.         if(this.sicurezzaMessaggioSslTrustStoreTipoReaded==null){
  614.             try{  
  615.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.ssl.trustStore.tipo");
  616.                
  617.                 if (value != null){
  618.                     value = value.trim();
  619.                     this.sicurezzaMessaggioSslTrustStoreTipo = value;
  620.                 }
  621.                
  622.                 this.sicurezzaMessaggioSslTrustStoreTipoReaded = true;
  623.                
  624.             }catch(java.lang.Exception e) {
  625.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.ssl.trustStore.tipo' non impostata, errore:"+e.getMessage());
  626.                 this.sicurezzaMessaggioSslTrustStoreTipoReaded = true;
  627.             }
  628.         }
  629.        
  630.         return this.sicurezzaMessaggioSslTrustStoreTipo;
  631.     }  
  632.    
  633.     private String sicurezzaMessaggioSslTrustStorePath= null;
  634.     public String getSicurezzaMessaggioSslTrustStorePath() throws ProtocolException{
  635.         if(this.sicurezzaMessaggioSslTrustStorePath==null){
  636.             try{  
  637.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.ssl.trustStore.path");
  638.                
  639.                 if (value != null){
  640.                     value = value.trim();
  641.                     this.sicurezzaMessaggioSslTrustStorePath = value;
  642.                 }
  643.                 else {
  644.                     throw newProtocolExceptionPropertyNonDefinita();
  645.                 }
  646.                
  647.             }catch(java.lang.Exception e) {
  648.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.ssl.trustStore.path' non impostata, errore:"+e.getMessage());
  649.                 throw new ProtocolException(e.getMessage(),e);
  650.             }
  651.         }
  652.        
  653.         return this.sicurezzaMessaggioSslTrustStorePath;
  654.     }
  655.    
  656.     private String sicurezzaMessaggioSslTrustStorePassword= null;
  657.     public String getSicurezzaMessaggioSslTrustStorePassword() throws ProtocolException{
  658.         if(this.sicurezzaMessaggioSslTrustStorePassword==null){
  659.             try{  
  660.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.ssl.trustStore.password");
  661.                
  662.                 if (value != null){
  663.                     value = value.trim();
  664.                     this.sicurezzaMessaggioSslTrustStorePassword = value;
  665.                 }
  666.                 else {
  667.                     throw newProtocolExceptionPropertyNonDefinita();
  668.                 }
  669.                
  670.             }catch(java.lang.Exception e) {
  671.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.ssl.trustStore.password' non impostata, errore:"+e.getMessage());
  672.                 throw new ProtocolException(e.getMessage(),e);
  673.             }
  674.         }
  675.        
  676.         return this.sicurezzaMessaggioSslTrustStorePassword;
  677.     }  
  678.    
  679.     private Boolean sicurezzaMessaggioSslTrustStoreCrlsReaded= null;
  680.     private String sicurezzaMessaggioSslTrustStoreCrls= null;
  681.     public String getSicurezzaMessaggioSslTrustStoreCrls() throws ProtocolException{
  682.         if(this.sicurezzaMessaggioSslTrustStoreCrlsReaded==null){
  683.             String pName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.ssl.trustStore.crls";
  684.             try{  
  685.                 String value = this.reader.getValueConvertEnvProperties(pName);
  686.                
  687.                 if (value != null){
  688.                     value = value.trim();
  689.                     this.sicurezzaMessaggioSslTrustStoreCrls = value;
  690.                 }
  691.                
  692.                 this.sicurezzaMessaggioSslTrustStoreCrlsReaded = true;
  693.                
  694.             }catch(java.lang.Exception e) {
  695.                 this.logError(getMessaggioErroreProprietaNonImpostata(pName, e));
  696.                 throw new ProtocolException(e.getMessage(),e);
  697.             }
  698.         }
  699.        
  700.         return this.sicurezzaMessaggioSslTrustStoreCrls;
  701.     }
  702.    
  703.    
  704.     private Boolean sicurezzaMessaggioSslTrustStoreOcspPolicyReaded= null;
  705.     private String sicurezzaMessaggioSslTrustStoreOcspPolicy= null;
  706.     public String getSicurezzaMessaggioSslTrustStoreOcspPolicy() throws ProtocolException{
  707.         if(this.sicurezzaMessaggioSslTrustStoreOcspPolicyReaded==null){
  708.             String pName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.ssl.trustStore.ocspPolicy";
  709.             try{  
  710.                 String value = this.reader.getValueConvertEnvProperties(pName);
  711.                
  712.                 if (value != null){
  713.                     value = value.trim();
  714.                     this.sicurezzaMessaggioSslTrustStoreOcspPolicy = value;
  715.                 }
  716.                
  717.                 this.sicurezzaMessaggioSslTrustStoreOcspPolicyReaded = true;
  718.                
  719.             }catch(java.lang.Exception e) {
  720.                 this.logError(getMessaggioErroreProprietaNonImpostata(pName, e));
  721.                 throw new ProtocolException(e.getMessage(),e);
  722.             }
  723.         }
  724.        
  725.         return this.sicurezzaMessaggioSslTrustStoreOcspPolicy;
  726.     }
  727.    
  728.    
  729.    
  730.    
  731.    
  732.    
  733.    
  734.    
  735.     /* **** REMOTE TRUST STORE **** */
  736.    
  737.     private List<RemoteStoreConfig> remoteStoreConfig = null;
  738.     private Map<String,RemoteKeyType> remoteStoreKeyTypeMap = null;
  739.     private Map<String,RemoteKeyType> getRemoteStoreKeyTypeMap() throws ProtocolException{
  740.         if(this.remoteStoreKeyTypeMap==null){
  741.             getRemoteStoreConfig();
  742.         }
  743.         return this.remoteStoreKeyTypeMap;
  744.     }
  745.     // riferito in org.openspcoop2.protocol.utils.ModIUtils
  746.     // non modificare il nome
  747.     public List<RemoteStoreConfig> getRemoteStoreConfig() throws ProtocolException{
  748.         if(this.remoteStoreConfig==null){
  749.             String pName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.remoteStores";
  750.             try{  
  751.                 String value = this.reader.getValueConvertEnvProperties(pName);
  752.                
  753.                 if (value != null){
  754.                     value = value.trim();
  755.                    
  756.                     this.remoteStoreConfig= new ArrayList<>();
  757.                     this.remoteStoreKeyTypeMap=new HashMap<>();
  758.                    
  759.                     readRemoteStores(value);
  760.                    
  761.                 }

  762.             }catch(java.lang.Exception e) {
  763.                 this.logError(getMessaggioErroreProprietaNonCorretta(pName, e));
  764.                 throw new ProtocolException(e.getMessage(),e);
  765.             }
  766.         }
  767.        
  768.         return this.remoteStoreConfig;
  769.     }
  770.     private void readRemoteStores(String value) throws UtilsException, ProtocolException, KeystoreException {
  771.         String [] tmp = value.split(",");
  772.         if(tmp!=null && tmp.length>0) {
  773.             for (String rsc : tmp) {
  774.                 rsc = rsc.trim();
  775.                
  776.                 String debugPrefix = "Configurazione per remoteStore '"+rsc+"'";
  777.                
  778.                 String propertyPrefix = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.remoteStore."+rsc+".";
  779.                 Properties p = this.reader.readPropertiesConvertEnvProperties(propertyPrefix);
  780.                 if(p==null || p.isEmpty()) {
  781.                     throw new ProtocolException(debugPrefix+" non trovata");
  782.                 }
  783.                 RemoteStoreConfig config = RemoteStoreConfigPropertiesUtils.read(p, null);
  784.                 forceBaseUrlPDNDEndsWithKeys(rsc, config);
  785.                 this.remoteStoreConfig.add(config);
  786.                
  787.                 readKeyType(p, debugPrefix, config);
  788.             }
  789.         }
  790.     }
  791.     private void forceBaseUrlPDNDEndsWithKeys(String rsc, RemoteStoreConfig config) {
  792.         if(isForceBaseUrlPDNDEndsWithKeys(rsc)) {
  793.             String baseUrl = config.getBaseUrl();
  794.             config.setBaseUrl(normalizeBaseUrlApiPDNDKeys(baseUrl));
  795.            
  796.             if(config.getMultiTenantBaseUrl()!=null && !config.getMultiTenantBaseUrl().isEmpty()) {
  797.                 Map<String, String> multiTenantBaseUrlNormalized = new HashMap<>();
  798.                 for (Map.Entry<String,String> entry : config.getMultiTenantBaseUrl().entrySet()) {
  799.                     String baseUrlTenant = entry.getValue();
  800.                     multiTenantBaseUrlNormalized.put(entry.getKey(), normalizeBaseUrlApiPDNDKeys(baseUrlTenant));
  801.                 }
  802.                 config.setMultiTenantBaseUrl(multiTenantBaseUrlNormalized);
  803.             }
  804.         }
  805.     }
  806.     private String normalizeBaseUrlApiPDNDKeys(String baseUrl) {
  807.         if(!baseUrl.endsWith("/keys")) {
  808.             if(!baseUrl.endsWith("/")) {
  809.                 baseUrl+="/";
  810.             }
  811.             baseUrl+="keys";
  812.         }
  813.         return baseUrl;
  814.     }
  815.     private boolean isForceBaseUrlPDNDEndsWithKeys(String rsc) {
  816.         String propertyPrefix = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.remoteStore."+rsc+"."+
  817.                 RemoteStoreConfigPropertiesUtils.PROPERTY_STORE_URL+".forceEndsWithKeys";
  818.         try{  
  819.             boolean force = true;
  820.             String value = this.reader.getValueConvertEnvProperties(propertyPrefix);
  821.             if (value != null){
  822.                 value = value.trim();
  823.                 force = "false".equals(value);
  824.             }
  825.             return force;          
  826.         }catch(java.lang.Exception e) {
  827.             this.logWarn("Proprietà '"+propertyPrefix+"' non impostata; viene forzato il suffisso /keys");
  828.             return true;
  829.         }
  830.     }
  831.    
  832.     private void readKeyType(Properties p, String debugPrefix, RemoteStoreConfig config) throws ProtocolException {
  833.         String keyType = p.getProperty("keyType");
  834.         if(keyType!=null) {
  835.             keyType = keyType.trim();
  836.         }
  837.         if(keyType==null || StringUtils.isEmpty(keyType)) {
  838.             throw new ProtocolException(debugPrefix+" non completa; key type non indicato");
  839.         }
  840.         try {
  841.             RemoteKeyType rkt = RemoteKeyType.toEnumFromName(keyType);
  842.             if(rkt==null) {
  843.                 throw new ProtocolException("Non valido");
  844.             }
  845.             this.remoteStoreKeyTypeMap.put(config.getStoreName(), rkt);
  846.         }catch(Exception e) {
  847.             throw new ProtocolException(debugPrefix+" non completa; key type indicato '"+keyType+"' non valido",e);
  848.         }
  849.     }
  850.    
  851.     public boolean isRemoteStore(String name) throws ProtocolException {
  852.         return PDNDResolver.isRemoteStore(name, getRemoteStoreConfig());
  853.     }
  854.     public RemoteStoreConfig getRemoteStoreConfig(String name, IDSoggetto idDominio) throws ProtocolException {
  855.         return PDNDResolver.getRemoteStoreConfig(name, idDominio, getRemoteStoreConfig());
  856.     }
  857.     public RemoteStoreConfig getRemoteStoreConfigByTokenPolicy(String name, IDSoggetto idDominio) throws ProtocolException {
  858.         return PDNDResolver.getRemoteStoreConfigByTokenPolicy(name, idDominio, getRemoteStoreConfig());
  859.     }
  860.     // riferito in org.openspcoop2.protocol.utils.ModIUtils
  861.     // non modificare il nome
  862.     public RemoteKeyType getRemoteKeyType(String name) throws ProtocolException {
  863.         return getRemoteStoreKeyTypeMap().get(name);
  864.     }
  865.    
  866.    
  867.    
  868.     /* **** TOKEN OAUTH **** */
  869.    
  870.     private List<String> validazioneTokenOAuthClaimsRequired= null;
  871.     private List<String> getValidazioneTokenOAuthClaimsRequired() throws ProtocolException{
  872.         if(this.validazioneTokenOAuthClaimsRequired==null){
  873.             String propertyName = "org.openspcoop2.protocol.modipa.token.oauth.claims.required";
  874.             try{  
  875.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  876.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  877.                     this.validazioneTokenOAuthClaimsRequired = ModISecurityConfig.convertToList(value);
  878.                 }
  879.                 else {
  880.                     this.validazioneTokenOAuthClaimsRequired = new ArrayList<>();
  881.                 }
  882.             }catch(java.lang.Exception e) {
  883.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  884.                 throw new ProtocolException(e.getMessage(),e);
  885.             }
  886.         }
  887.        
  888.         return this.validazioneTokenOAuthClaimsRequired;
  889.     }
  890.     private Map<String,List<String>> validazioneTokenOAuthClaimsRequiredSoggetto = new HashMap<>();
  891.     public List<String> getValidazioneTokenOAuthClaimsRequired(String soggetto) throws ProtocolException{
  892.         if(!this.validazioneTokenOAuthClaimsRequiredSoggetto.containsKey(soggetto)){
  893.             String propertyName = "org.openspcoop2.protocol.modipa."+soggetto+".token.oauth.claims.required";
  894.             try{  
  895.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  896.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  897.                     this.validazioneTokenOAuthClaimsRequiredSoggetto.put(soggetto, ModISecurityConfig.convertToList(value));
  898.                 }
  899.                 else {
  900.                     this.validazioneTokenOAuthClaimsRequiredSoggetto.put(soggetto, getValidazioneTokenOAuthClaimsRequired());
  901.                 }
  902.             }catch(java.lang.Exception e) {
  903.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  904.                 throw new ProtocolException(e.getMessage(),e);
  905.             }
  906.         }
  907.        
  908.         return this.validazioneTokenOAuthClaimsRequiredSoggetto.get(soggetto);
  909.     }
  910.    
  911.    
  912.     private List<String> validazioneTokenPDNDClaimsRequired= null;
  913.     private List<String> getValidazioneTokenPDNDClaimsRequired() throws ProtocolException{
  914.         if(this.validazioneTokenPDNDClaimsRequired==null){
  915.             String propertyName = "org.openspcoop2.protocol.modipa.token.pdnd.claims.required";
  916.             try{  
  917.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  918.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  919.                     this.validazioneTokenPDNDClaimsRequired = ModISecurityConfig.convertToList(value);
  920.                 }
  921.                 else {
  922.                     this.validazioneTokenOAuthClaimsRequired = new ArrayList<>();
  923.                 }
  924.             }catch(java.lang.Exception e) {
  925.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  926.                 throw new ProtocolException(e.getMessage(),e);
  927.             }
  928.         }
  929.        
  930.         return this.validazioneTokenPDNDClaimsRequired;
  931.     }
  932.     private Map<String,List<String>> validazioneTokenPDNDClaimsRequiredSoggetto = new HashMap<>();
  933.     public List<String> getValidazioneTokenPDNDClaimsRequired(String soggetto) throws ProtocolException{
  934.         if(!this.validazioneTokenPDNDClaimsRequiredSoggetto.containsKey(soggetto)){
  935.             String propertyName = "org.openspcoop2.protocol.modipa."+soggetto+".token.pdnd.claims.required";
  936.             try{  
  937.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  938.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  939.                     this.validazioneTokenPDNDClaimsRequiredSoggetto.put(soggetto, ModISecurityConfig.convertToList(value));
  940.                 }
  941.                 else {
  942.                     this.validazioneTokenPDNDClaimsRequiredSoggetto.put(soggetto, getValidazioneTokenPDNDClaimsRequired());
  943.                 }
  944.             }catch(java.lang.Exception e) {
  945.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  946.                 throw new ProtocolException(e.getMessage(),e);
  947.             }
  948.         }
  949.        
  950.         return this.validazioneTokenPDNDClaimsRequiredSoggetto.get(soggetto);
  951.     }
  952.    
  953.    
  954.    
  955.     /* **** KEY STORE **** */
  956.        
  957.     // riferito in org.openspcoop2.protocol.utils.ModIUtils
  958.     // non modificare il nome
  959.     public KeystoreParams getSicurezzaMessaggioCertificatiKeyStore() throws ProtocolException {
  960.         KeystoreParams params = null;
  961.         String keystoreType = getSicurezzaMessaggioCertificatiKeyStoreTipo();
  962.         if(keystoreType!=null) {
  963.             params = new KeystoreParams();
  964.             params.setType(keystoreType);
  965.             params.setPath(getSicurezzaMessaggioCertificatiKeyStorePath());
  966.             params.setPassword(getSicurezzaMessaggioCertificatiKeyPassword());
  967.             params.setKeyAlias(getSicurezzaMessaggioCertificatiKeyAlias());
  968.             params.setKeyPassword(getSicurezzaMessaggioCertificatiKeyPassword());
  969.         }
  970.         return params;
  971.     }
  972.    
  973.     private String sicurezzaMessaggioCertificatiKeyStoreTipo= null;
  974.     private Boolean sicurezzaMessaggioCertificatiKeyStoreTipoReaded= null;
  975.     public String getSicurezzaMessaggioCertificatiKeyStoreTipo() {
  976.         if(this.sicurezzaMessaggioCertificatiKeyStoreTipoReaded==null){
  977.             try{  
  978.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.keyStore.tipo");
  979.                
  980.                 if (value != null){
  981.                     value = value.trim();
  982.                     this.sicurezzaMessaggioCertificatiKeyStoreTipo = value;
  983.                 }
  984.                
  985.                 this.sicurezzaMessaggioCertificatiKeyStoreTipoReaded = true;
  986.                                
  987.             }catch(java.lang.Exception e) {
  988.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.keyStore.tipo' non impostata, errore:"+e.getMessage());
  989.                 this.sicurezzaMessaggioCertificatiKeyStoreTipoReaded = true;
  990.             }
  991.         }
  992.        
  993.         return this.sicurezzaMessaggioCertificatiKeyStoreTipo;
  994.     }  
  995.    
  996.     private String sicurezzaMessaggioCertificatiKeyStorePath= null;
  997.     public String getSicurezzaMessaggioCertificatiKeyStorePath() throws ProtocolException{
  998.         if(this.sicurezzaMessaggioCertificatiKeyStorePath==null){
  999.             try{  
  1000.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.keyStore.path");
  1001.                
  1002.                 if (value != null){
  1003.                     value = value.trim();
  1004.                     this.sicurezzaMessaggioCertificatiKeyStorePath = value;
  1005.                 }
  1006.                 else {
  1007.                     throw newProtocolExceptionPropertyNonDefinita();
  1008.                 }
  1009.                
  1010.             }catch(java.lang.Exception e) {
  1011.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.keyStore.path' non impostata, errore:"+e.getMessage());
  1012.                 throw new ProtocolException(e.getMessage(),e);
  1013.             }
  1014.         }
  1015.        
  1016.         return this.sicurezzaMessaggioCertificatiKeyStorePath;
  1017.     }
  1018.    
  1019.     private String sicurezzaMessaggioCertificatiKeyStorePassword= null;
  1020.     public String getSicurezzaMessaggioCertificatiKeyStorePassword() throws ProtocolException{
  1021.         if(this.sicurezzaMessaggioCertificatiKeyStorePassword==null){
  1022.             try{  
  1023.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.keyStore.password");
  1024.                
  1025.                 if (value != null){
  1026.                     value = value.trim();
  1027.                     this.sicurezzaMessaggioCertificatiKeyStorePassword = value;
  1028.                 }
  1029.                 else {
  1030.                     throw newProtocolExceptionPropertyNonDefinita();
  1031.                 }
  1032.                
  1033.             }catch(java.lang.Exception e) {
  1034.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.keyStore.password' non impostata, errore:"+e.getMessage());
  1035.                 throw new ProtocolException(e.getMessage(),e);
  1036.             }
  1037.         }
  1038.        
  1039.         return this.sicurezzaMessaggioCertificatiKeyStorePassword;
  1040.     }  
  1041.    
  1042.     private String sicurezzaMessaggioCertificatiKeyAlias= null;
  1043.     public String getSicurezzaMessaggioCertificatiKeyAlias() throws ProtocolException{
  1044.         if(this.sicurezzaMessaggioCertificatiKeyAlias==null){
  1045.             try{  
  1046.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.key.alias");
  1047.                
  1048.                 if (value != null){
  1049.                     value = value.trim();
  1050.                     this.sicurezzaMessaggioCertificatiKeyAlias = value;
  1051.                 }
  1052.                 else {
  1053.                     throw newProtocolExceptionPropertyNonDefinita();
  1054.                 }
  1055.                
  1056.             }catch(java.lang.Exception e) {
  1057.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.key.alias' non impostata, errore:"+e.getMessage());
  1058.                 throw new ProtocolException(e.getMessage(),e);
  1059.             }
  1060.         }
  1061.        
  1062.         return this.sicurezzaMessaggioCertificatiKeyAlias;
  1063.     }  
  1064.    
  1065.     private String sicurezzaMessaggioCertificatiKeyPassword= null;
  1066.     public String getSicurezzaMessaggioCertificatiKeyPassword() throws ProtocolException{
  1067.         if(this.sicurezzaMessaggioCertificatiKeyPassword==null){
  1068.             try{  
  1069.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.key.password");
  1070.                
  1071.                 if (value != null){
  1072.                     value = value.trim();
  1073.                     this.sicurezzaMessaggioCertificatiKeyPassword = value;
  1074.                 }
  1075.                 else {
  1076.                     throw newProtocolExceptionPropertyNonDefinita();
  1077.                 }
  1078.                
  1079.             }catch(java.lang.Exception e) {
  1080.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.key.password' non impostata, errore:"+e.getMessage());
  1081.                 throw new ProtocolException(e.getMessage(),e);
  1082.             }
  1083.         }
  1084.        
  1085.         return this.sicurezzaMessaggioCertificatiKeyPassword;
  1086.     }  
  1087.    
  1088.     private Boolean sicurezzaMessaggioCertificatiKeyClientIdRead = null;
  1089.     private String sicurezzaMessaggioCertificatiKeyClientId= null;
  1090.     public String getSicurezzaMessaggioCertificatiKeyClientId() throws ProtocolException{
  1091.         if(this.sicurezzaMessaggioCertificatiKeyClientIdRead==null){
  1092.             String pName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.key.clientId";
  1093.             try{  
  1094.                 String value = this.reader.getValueConvertEnvProperties(pName);
  1095.                
  1096.                 if (value != null){
  1097.                     value = value.trim();
  1098.                     if(StringUtils.isNotEmpty(value)) {
  1099.                         this.sicurezzaMessaggioCertificatiKeyClientId = value;
  1100.                     }
  1101.                 }

  1102.                 this.sicurezzaMessaggioCertificatiKeyClientIdRead = true;
  1103.                
  1104.             }catch(java.lang.Exception e) {
  1105.                 this.logError(getPrefixProprieta(pName)+"non impostata, errore:"+e.getMessage());
  1106.                 throw new ProtocolException(e.getMessage(),e);
  1107.             }
  1108.         }
  1109.        
  1110.         return this.sicurezzaMessaggioCertificatiKeyClientId;
  1111.     }
  1112.    
  1113.     private Boolean sicurezzaMessaggioCertificatiKeyKidRead = null;
  1114.     private String sicurezzaMessaggioCertificatiKeyKid= null;
  1115.     public String getSicurezzaMessaggioCertificatiKeyKid() throws ProtocolException{
  1116.         if(this.sicurezzaMessaggioCertificatiKeyKidRead==null){
  1117.             String pName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.key.kid";
  1118.             try{  
  1119.                 String value = this.reader.getValueConvertEnvProperties(pName);
  1120.                
  1121.                 if (value != null){
  1122.                     value = value.trim();
  1123.                     if(StringUtils.isNotEmpty(value)) {
  1124.                         this.sicurezzaMessaggioCertificatiKeyKid = value;
  1125.                     }
  1126.                 }

  1127.                 this.sicurezzaMessaggioCertificatiKeyKidRead = true;
  1128.                
  1129.             }catch(java.lang.Exception e) {
  1130.                 this.logError(getPrefixProprieta(pName)+"non impostata, errore:"+e.getMessage());
  1131.                 throw new ProtocolException(e.getMessage(),e);
  1132.             }
  1133.         }
  1134.        
  1135.         return this.sicurezzaMessaggioCertificatiKeyKid;
  1136.     }
  1137.    
  1138.    
  1139.    
  1140.    
  1141.     /* **** CORNICE SICUREZZA **** */
  1142.    
  1143.     private Boolean isSicurezzaMessaggioCorniceSicurezzaEnabled = null;
  1144.     public Boolean isSicurezzaMessaggioCorniceSicurezzaEnabled(){
  1145.         if(this.isSicurezzaMessaggioCorniceSicurezzaEnabled==null){
  1146.            
  1147.             Boolean defaultValue = false;
  1148.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza";
  1149.            
  1150.             try{  
  1151.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1152.                 if (value != null){
  1153.                     value = value.trim();
  1154.                     this.isSicurezzaMessaggioCorniceSicurezzaEnabled = Boolean.parseBoolean(value);
  1155.                 }else{
  1156.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1157.                     this.isSicurezzaMessaggioCorniceSicurezzaEnabled = defaultValue;
  1158.                 }

  1159.             }catch(java.lang.Exception e) {
  1160.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1161.                 this.isSicurezzaMessaggioCorniceSicurezzaEnabled = defaultValue;
  1162.             }
  1163.         }

  1164.         return this.isSicurezzaMessaggioCorniceSicurezzaEnabled;
  1165.     }
  1166.    
  1167.     private String sicurezzaMessaggioCorniceSicurezzaRestCodiceEnte= null;
  1168.     public String getSicurezzaMessaggioCorniceSicurezzaRestCodiceEnte() throws ProtocolException{
  1169.         if(this.sicurezzaMessaggioCorniceSicurezzaRestCodiceEnte==null){
  1170.            
  1171.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.rest.codice_ente";
  1172.             try{  
  1173.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1174.                
  1175.                 if (value != null){
  1176.                     value = value.trim();
  1177.                     this.sicurezzaMessaggioCorniceSicurezzaRestCodiceEnte = value;
  1178.                 }
  1179.                 else {
  1180.                     throw newProtocolExceptionPropertyNonDefinita();
  1181.                 }
  1182.                
  1183.             }catch(java.lang.Exception e) {
  1184.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1185.                 throw new ProtocolException(e.getMessage(),e);
  1186.             }
  1187.         }
  1188.        
  1189.         return this.sicurezzaMessaggioCorniceSicurezzaRestCodiceEnte;
  1190.     }
  1191.    
  1192.     private String sicurezzaMessaggioCorniceSicurezzaRestUser= null;
  1193.     public String getSicurezzaMessaggioCorniceSicurezzaRestUser() throws ProtocolException{
  1194.         if(this.sicurezzaMessaggioCorniceSicurezzaRestUser==null){
  1195.            
  1196.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.rest.user";
  1197.             try{  
  1198.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1199.                
  1200.                 if (value != null){
  1201.                     value = value.trim();
  1202.                     this.sicurezzaMessaggioCorniceSicurezzaRestUser = value;
  1203.                 }
  1204.                 else {
  1205.                     throw newProtocolExceptionPropertyNonDefinita();
  1206.                 }
  1207.                
  1208.             }catch(java.lang.Exception e) {
  1209.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1210.                 throw new ProtocolException(e.getMessage(),e);
  1211.             }
  1212.         }
  1213.        
  1214.         return this.sicurezzaMessaggioCorniceSicurezzaRestUser;
  1215.     }
  1216.    
  1217.     private String sicurezzaMessaggioCorniceSicurezzaRestIpuser= null;
  1218.     public String getSicurezzaMessaggioCorniceSicurezzaRestIpuser() throws ProtocolException{
  1219.         if(this.sicurezzaMessaggioCorniceSicurezzaRestIpuser==null){
  1220.            
  1221.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.rest.ipuser";
  1222.             try{  
  1223.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1224.                
  1225.                 if (value != null){
  1226.                     value = value.trim();
  1227.                     this.sicurezzaMessaggioCorniceSicurezzaRestIpuser = value;
  1228.                 }
  1229.                 else {
  1230.                     throw newProtocolExceptionPropertyNonDefinita();
  1231.                 }
  1232.                
  1233.             }catch(java.lang.Exception e) {
  1234.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1235.                 throw new ProtocolException(e.getMessage(),e);
  1236.             }
  1237.         }
  1238.        
  1239.         return this.sicurezzaMessaggioCorniceSicurezzaRestIpuser;
  1240.     }
  1241.    
  1242.     private String sicurezzaMessaggioCorniceSicurezzaSoapCodiceEnte= null;
  1243.     private Boolean sicurezzaMessaggioCorniceSicurezzaSoapCodiceEnteReaded= null;
  1244.     public String getSicurezzaMessaggioCorniceSicurezzaSoapCodiceEnte() throws ProtocolException{
  1245.         if(this.sicurezzaMessaggioCorniceSicurezzaSoapCodiceEnteReaded==null){
  1246.            
  1247.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.soap.codice_ente";
  1248.             try{  
  1249.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1250.                
  1251.                 if (value != null){
  1252.                     value = value.trim();
  1253.                     this.sicurezzaMessaggioCorniceSicurezzaSoapCodiceEnte = value;
  1254.                 }
  1255.                 // In soap il codice utente viene inserito anche in saml2:Subject
  1256. /**             else {
  1257. //                  throw newProtocolExceptionPropertyNonDefinita();
  1258. //              }*/
  1259.                
  1260.             }catch(java.lang.Exception e) {
  1261.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1262.                 throw new ProtocolException(e.getMessage(),e);
  1263.             }
  1264.            
  1265.             this.sicurezzaMessaggioCorniceSicurezzaSoapCodiceEnteReaded = true;
  1266.         }
  1267.        
  1268.         return this.sicurezzaMessaggioCorniceSicurezzaSoapCodiceEnte;
  1269.     }
  1270.    
  1271.     private String sicurezzaMessaggioCorniceSicurezzaSoapUser= null;
  1272.     public String getSicurezzaMessaggioCorniceSicurezzaSoapUser() throws ProtocolException{
  1273.         if(this.sicurezzaMessaggioCorniceSicurezzaSoapUser==null){
  1274.            
  1275.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.soap.user";
  1276.             try{  
  1277.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1278.                
  1279.                 if (value != null){
  1280.                     value = value.trim();
  1281.                     this.sicurezzaMessaggioCorniceSicurezzaSoapUser = value;
  1282.                 }
  1283.                 else {
  1284.                     throw newProtocolExceptionPropertyNonDefinita();
  1285.                 }
  1286.                
  1287.             }catch(java.lang.Exception e) {
  1288.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1289.                 throw new ProtocolException(e.getMessage(),e);
  1290.             }
  1291.         }
  1292.        
  1293.         return this.sicurezzaMessaggioCorniceSicurezzaSoapUser;
  1294.     }
  1295.    
  1296.     private String sicurezzaMessaggioCorniceSicurezzaSoapIpuser= null;
  1297.     public String getSicurezzaMessaggioCorniceSicurezzaSoapIpuser() throws ProtocolException{
  1298.         if(this.sicurezzaMessaggioCorniceSicurezzaSoapIpuser==null){
  1299.            
  1300.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.soap.ipuser";
  1301.             try{  
  1302.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1303.                
  1304.                 if (value != null){
  1305.                     value = value.trim();
  1306.                     this.sicurezzaMessaggioCorniceSicurezzaSoapIpuser = value;
  1307.                 }
  1308.                 else {
  1309.                     throw newProtocolExceptionPropertyNonDefinita();
  1310.                 }
  1311.                
  1312.             }catch(java.lang.Exception e) {
  1313.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1314.                 throw new ProtocolException(e.getMessage(),e);
  1315.             }
  1316.         }
  1317.        
  1318.         return this.sicurezzaMessaggioCorniceSicurezzaSoapIpuser;
  1319.     }
  1320.    
  1321.     private List<String> sicurezzaMessaggioCorniceSicurezzaDynamicCodiceEnte= null;
  1322.     public List<String> getSicurezzaMessaggioCorniceSicurezzaDynamicCodiceEnte() throws ProtocolException{
  1323.         if(this.sicurezzaMessaggioCorniceSicurezzaDynamicCodiceEnte==null){
  1324.            
  1325.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.codice_ente";
  1326.             try{  
  1327.                 /**String value = this.reader.getValue_convertEnvProperties(propertyName);*/
  1328.                 String value = this.reader.getValue(propertyName); // contiene ${} da non risolvere
  1329.                 this.sicurezzaMessaggioCorniceSicurezzaDynamicCodiceEnte = ModISecurityConfig.convertToList(value);
  1330.             }catch(java.lang.Exception e) {
  1331.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1332.                 throw new ProtocolException(e.getMessage(),e);
  1333.             }
  1334.         }
  1335.        
  1336.         return this.sicurezzaMessaggioCorniceSicurezzaDynamicCodiceEnte;
  1337.     }
  1338.    
  1339.     private List<String> sicurezzaMessaggioCorniceSicurezzaDynamicUser= null;
  1340.     public List<String> getSicurezzaMessaggioCorniceSicurezzaDynamicUser() throws ProtocolException{
  1341.         if(this.sicurezzaMessaggioCorniceSicurezzaDynamicUser==null){
  1342.            
  1343.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.user";
  1344.             try{  
  1345.                 /**String value = this.reader.getValue_convertEnvProperties(propertyName);*/
  1346.                 String value = this.reader.getValue(propertyName); // contiene ${} da non risolvere
  1347.                 this.sicurezzaMessaggioCorniceSicurezzaDynamicUser = ModISecurityConfig.convertToList(value);
  1348.             }catch(java.lang.Exception e) {
  1349.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1350.                 throw new ProtocolException(e.getMessage(),e);
  1351.             }
  1352.         }
  1353.        
  1354.         return this.sicurezzaMessaggioCorniceSicurezzaDynamicUser;
  1355.     }
  1356.    
  1357.     private List<String> sicurezzaMessaggioCorniceSicurezzaDynamicIpuser= null;
  1358.     public List<String> getSicurezzaMessaggioCorniceSicurezzaDynamicIpuser() throws ProtocolException{
  1359.         if(this.sicurezzaMessaggioCorniceSicurezzaDynamicIpuser==null){
  1360.            
  1361.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.ipuser";
  1362.             try{  
  1363.                 /**String value = this.reader.getValue_convertEnvProperties(propertyName);*/
  1364.                 String value = this.reader.getValue(propertyName); // contiene ${} da non risolvere
  1365.                 this.sicurezzaMessaggioCorniceSicurezzaDynamicIpuser = ModISecurityConfig.convertToList(value);
  1366.             }catch(java.lang.Exception e) {
  1367.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1368.                 throw new ProtocolException(e.getMessage(),e);
  1369.             }
  1370.         }
  1371.        
  1372.         return this.sicurezzaMessaggioCorniceSicurezzaDynamicIpuser;
  1373.     }
  1374.    
  1375.    
  1376.    
  1377.    
  1378.    
  1379.     private List<ModIAuditConfig> auditConfig = null;
  1380.     public List<ModIAuditConfig> getAuditConfig() throws ProtocolException{
  1381.         if(this.auditConfig==null){
  1382.             String pName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.pattern";
  1383.             try{  
  1384.                 String value = this.reader.getValueConvertEnvProperties(pName);
  1385.                
  1386.                 if (value != null){
  1387.                     value = value.trim();
  1388.                    
  1389.                     this.auditConfig= new ArrayList<>();
  1390.                    
  1391.                     readAuditConf(value);
  1392.                    
  1393.                 }

  1394.             }catch(java.lang.Exception e) {
  1395.                 this.logError(getMessaggioErroreProprietaNonCorretta(pName, e));
  1396.                 throw new ProtocolException(e.getMessage(),e);
  1397.             }
  1398.         }
  1399.        
  1400.         return this.auditConfig;
  1401.     }
  1402.     private void readAuditConf(String value) throws UtilsException, ProtocolException {
  1403.         String [] tmp = value.split(",");
  1404.         if(tmp!=null && tmp.length>0) {
  1405.             for (String auditConf : tmp) {
  1406.                 auditConf = auditConf.trim();
  1407.                
  1408.                 String debugPrefix = "Pattern audit '"+auditConf+"'";
  1409.                
  1410.                 String propertyPrefix = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.pattern."+auditConf;
  1411.                 Properties p = this.reader.readProperties(propertyPrefix+"."); // non devo convertire le properties poiche' possoono contenere ${ che useremo per la risoluzione dinamica
  1412.                 if(p==null || p.isEmpty()) {
  1413.                     throw new ProtocolException(debugPrefix+" non trovata");
  1414.                 }
  1415.                 ModIAuditConfig config = new ModIAuditConfig(propertyPrefix, propertyPrefix, p);
  1416.                 this.auditConfig.add(config);
  1417.             }
  1418.         }
  1419.     }
  1420.    
  1421.     private String getSecurityTokenHeaderAudit= null;
  1422.     public String getSecurityTokenHeaderModIAudit() throws ProtocolException{
  1423.         if(this.getSecurityTokenHeaderAudit==null){
  1424.             String name = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.securityToken.header";
  1425.             try{  
  1426.                 String value = this.reader.getValueConvertEnvProperties(name);
  1427.                
  1428.                 if (value != null){
  1429.                     value = value.trim();
  1430.                     this.getSecurityTokenHeaderAudit = value;
  1431.                 }
  1432.                 else {
  1433.                     throw newProtocolExceptionPropertyNonDefinita();
  1434.                 }
  1435.                
  1436.             }catch(java.lang.Exception e) {
  1437.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  1438.                 this.logError(msgErrore);
  1439.                 throw new ProtocolException(msgErrore,e);
  1440.             }
  1441.         }
  1442.        
  1443.         return this.getSecurityTokenHeaderAudit;
  1444.     }
  1445.    
  1446.     private Boolean isSecurityTokenAuditX509AddKid = null;
  1447.     public boolean isSecurityTokenAuditX509AddKid(){
  1448.         if(this.isSecurityTokenAuditX509AddKid==null){
  1449.            
  1450.             boolean defaultValue = false;
  1451.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.x509.kid";
  1452.            
  1453.             try{  
  1454.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1455.                 if (value != null){
  1456.                     value = value.trim();
  1457.                     this.isSecurityTokenAuditX509AddKid = Boolean.parseBoolean(value);
  1458.                 }else{
  1459.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1460.                     this.isSecurityTokenAuditX509AddKid = defaultValue;
  1461.                 }

  1462.             }catch(java.lang.Exception e) {
  1463.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1464.                 this.isSecurityTokenAuditX509AddKid = defaultValue;
  1465.             }
  1466.         }

  1467.         return this.isSecurityTokenAuditX509AddKid;
  1468.     }
  1469.    
  1470.     private Boolean isSecurityTokenAuditApiSoapX509RiferimentoX5c = null;
  1471.     public boolean isSecurityTokenAuditApiSoapX509RiferimentoX5c(){
  1472.         if(this.isSecurityTokenAuditApiSoapX509RiferimentoX5c==null){
  1473.            
  1474.             boolean defaultValue = true;
  1475.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.soap.x509.x5c";
  1476.            
  1477.             try{  
  1478.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1479.                 if (value != null){
  1480.                     value = value.trim();
  1481.                     this.isSecurityTokenAuditApiSoapX509RiferimentoX5c = Boolean.parseBoolean(value);
  1482.                 }else{
  1483.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1484.                     this.isSecurityTokenAuditApiSoapX509RiferimentoX5c = defaultValue;
  1485.                 }

  1486.             }catch(java.lang.Exception e) {
  1487.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1488.                 this.isSecurityTokenAuditApiSoapX509RiferimentoX5c = defaultValue;
  1489.             }
  1490.         }

  1491.         return this.isSecurityTokenAuditApiSoapX509RiferimentoX5c;
  1492.     }
  1493.    
  1494.     private Boolean isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate = null;
  1495.     public boolean isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate(){
  1496.         if(this.isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate==null){
  1497.            
  1498.             boolean defaultValue = true;
  1499.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.soap.x509.x5c.singleCertificate";
  1500.            
  1501.             try{  
  1502.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1503.                 if (value != null){
  1504.                     value = value.trim();
  1505.                     this.isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate = Boolean.parseBoolean(value);
  1506.                 }else{
  1507.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1508.                     this.isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate = defaultValue;
  1509.                 }

  1510.             }catch(java.lang.Exception e) {
  1511.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1512.                 this.isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate = defaultValue;
  1513.             }
  1514.         }

  1515.         return this.isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate;
  1516.     }
  1517.    
  1518.     private Boolean isSecurityTokenAuditApiSoapX509RiferimentoX5u = null;
  1519.     public boolean isSecurityTokenAuditApiSoapX509RiferimentoX5u(){
  1520.         if(this.isSecurityTokenAuditApiSoapX509RiferimentoX5u==null){
  1521.            
  1522.             boolean defaultValue = false;
  1523.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.soap.x509.x5u";
  1524.            
  1525.             try{  
  1526.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1527.                 if (value != null){
  1528.                     value = value.trim();
  1529.                     this.isSecurityTokenAuditApiSoapX509RiferimentoX5u = Boolean.parseBoolean(value);
  1530.                 }else{
  1531.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1532.                     this.isSecurityTokenAuditApiSoapX509RiferimentoX5u = defaultValue;
  1533.                 }

  1534.             }catch(java.lang.Exception e) {
  1535.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1536.                 this.isSecurityTokenAuditApiSoapX509RiferimentoX5u = defaultValue;
  1537.             }
  1538.         }

  1539.         return this.isSecurityTokenAuditApiSoapX509RiferimentoX5u;
  1540.     }
  1541.    
  1542.     private Boolean isSecurityTokenAuditApiSoapX509RiferimentoX5t = null;
  1543.     public boolean isSecurityTokenAuditApiSoapX509RiferimentoX5t(){
  1544.         if(this.isSecurityTokenAuditApiSoapX509RiferimentoX5t==null){
  1545.            
  1546.             boolean defaultValue = false;
  1547.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.soap.x509.x5t";
  1548.            
  1549.             try{  
  1550.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1551.                 if (value != null){
  1552.                     value = value.trim();
  1553.                     this.isSecurityTokenAuditApiSoapX509RiferimentoX5t = Boolean.parseBoolean(value);
  1554.                 }else{
  1555.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1556.                     this.isSecurityTokenAuditApiSoapX509RiferimentoX5t = defaultValue;
  1557.                 }

  1558.             }catch(java.lang.Exception e) {
  1559.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1560.                 this.isSecurityTokenAuditApiSoapX509RiferimentoX5t = defaultValue;
  1561.             }
  1562.         }

  1563.         return this.isSecurityTokenAuditApiSoapX509RiferimentoX5t;
  1564.     }
  1565.    
  1566.     private Boolean getSecurityTokenAuditProcessArrayModeReaded= null;
  1567.     private Boolean getSecurityTokenAuditProcessArrayModeEnabled= null;
  1568.     public boolean isSecurityTokenAuditProcessArrayModeEnabled() throws ProtocolException{
  1569.         if(this.getSecurityTokenAuditProcessArrayModeReaded==null){
  1570.             String name = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.audience.processArrayMode";
  1571.             try{  
  1572.                 String value = this.reader.getValueConvertEnvProperties(name);
  1573.                
  1574.                 if (value != null){
  1575.                     value = value.trim();
  1576.                     this.getSecurityTokenAuditProcessArrayModeEnabled = Boolean.valueOf(value);
  1577.                 }
  1578.                 else {
  1579.                     throw newProtocolExceptionPropertyNonDefinita();
  1580.                 }
  1581.                
  1582.             }catch(java.lang.Exception e) {
  1583.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  1584.                 this.logError(msgErrore);
  1585.                 throw new ProtocolException(msgErrore,e);
  1586.             }
  1587.            
  1588.             this.getSecurityTokenAuditProcessArrayModeReaded = true;
  1589.         }
  1590.        
  1591.         return this.getSecurityTokenAuditProcessArrayModeEnabled;
  1592.     }
  1593.    
  1594.     private Boolean isSecurityTokenAuditAddPurposeId = null;
  1595.     public boolean isSecurityTokenAuditAddPurposeId(){
  1596.         if(this.isSecurityTokenAuditAddPurposeId==null){
  1597.            
  1598.             boolean defaultValue = true;
  1599.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.addPurposeId";
  1600.            
  1601.             try{  
  1602.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1603.                 if (value != null){
  1604.                     value = value.trim();
  1605.                     this.isSecurityTokenAuditAddPurposeId = Boolean.parseBoolean(value);
  1606.                 }else{
  1607.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1608.                     this.isSecurityTokenAuditAddPurposeId = defaultValue;
  1609.                 }

  1610.             }catch(java.lang.Exception e) {
  1611.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1612.                 this.isSecurityTokenAuditAddPurposeId = defaultValue;
  1613.             }
  1614.         }

  1615.         return this.isSecurityTokenAuditAddPurposeId;
  1616.     }
  1617.    
  1618.     private Boolean isSecurityTokenAuditExpectedPurposeId = null;
  1619.     public boolean isSecurityTokenAuditExpectedPurposeId(){
  1620.         if(this.isSecurityTokenAuditExpectedPurposeId==null){
  1621.            
  1622.             boolean defaultValue = true;
  1623.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.expectedPurposeId";
  1624.            
  1625.             try{  
  1626.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1627.                 if (value != null){
  1628.                     value = value.trim();
  1629.                     this.isSecurityTokenAuditExpectedPurposeId = Boolean.parseBoolean(value);
  1630.                 }else{
  1631.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1632.                     this.isSecurityTokenAuditExpectedPurposeId = defaultValue;
  1633.                 }

  1634.             }catch(java.lang.Exception e) {
  1635.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1636.                 this.isSecurityTokenAuditExpectedPurposeId = defaultValue;
  1637.             }
  1638.         }

  1639.         return this.isSecurityTokenAuditExpectedPurposeId;
  1640.     }
  1641.    
  1642.     private Boolean isSecurityTokenAuditCompareAuthorizationPurposeId = null;
  1643.     public boolean isSecurityTokenAuditCompareAuthorizationPurposeId(){
  1644.         if(this.isSecurityTokenAuditCompareAuthorizationPurposeId==null){
  1645.            
  1646.             boolean defaultValue = true;
  1647.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.compareAuthorizationPurposeId";
  1648.            
  1649.             try{  
  1650.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1651.                 if (value != null){
  1652.                     value = value.trim();
  1653.                     this.isSecurityTokenAuditCompareAuthorizationPurposeId = Boolean.parseBoolean(value);
  1654.                 }else{
  1655.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1656.                     this.isSecurityTokenAuditCompareAuthorizationPurposeId = defaultValue;
  1657.                 }

  1658.             }catch(java.lang.Exception e) {
  1659.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1660.                 this.isSecurityTokenAuditCompareAuthorizationPurposeId = defaultValue;
  1661.             }
  1662.         }

  1663.         return this.isSecurityTokenAuditCompareAuthorizationPurposeId;
  1664.     }
  1665.    
  1666.     private Integer getSecurityTokenAuditDnonceSize = null;
  1667.     public int getSecurityTokenAuditDnonceSize(){
  1668.         if(this.getSecurityTokenAuditDnonceSize==null){
  1669.            
  1670.             int defaultValue = 13;
  1671.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.dnonce.size";
  1672.            
  1673.             try{  
  1674.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1675.                 if (value != null){
  1676.                     value = value.trim();
  1677.                     this.getSecurityTokenAuditDnonceSize = Integer.valueOf(value);
  1678.                 }else{
  1679.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1680.                     this.getSecurityTokenAuditDnonceSize = defaultValue;
  1681.                 }

  1682.             }catch(java.lang.Exception e) {
  1683.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1684.                 this.getSecurityTokenAuditDnonceSize = defaultValue;
  1685.             }
  1686.         }

  1687.         return this.getSecurityTokenAuditDnonceSize;
  1688.     }
  1689.    
  1690.     private String getSecurityTokenAuditDigestAlgorithm = null;
  1691.     public String getSecurityTokenAuditDigestAlgorithm(){
  1692.         if(this.getSecurityTokenAuditDigestAlgorithm==null){
  1693.            
  1694.             String defaultValue = Costanti.PDND_DIGEST_ALG_DEFAULT_VALUE;
  1695.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.digest.algo";
  1696.            
  1697.             try{  
  1698.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1699.                 if (value != null){
  1700.                     value = value.trim();
  1701.                     this.getSecurityTokenAuditDigestAlgorithm = value;
  1702.                 }else{
  1703.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1704.                     this.getSecurityTokenAuditDigestAlgorithm = defaultValue;
  1705.                 }

  1706.             }catch(java.lang.Exception e) {
  1707.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1708.                 this.getSecurityTokenAuditDigestAlgorithm = defaultValue;
  1709.             }
  1710.         }

  1711.         return this.getSecurityTokenAuditDigestAlgorithm;
  1712.     }
  1713.    
  1714.    
  1715.    
  1716.    
  1717.    
  1718.    
  1719.     /* **** TRACCE **** */
  1720.    
  1721.     private Boolean isGenerazioneTracce = null;
  1722.     public Boolean isGenerazioneTracce(){
  1723.         if(this.isGenerazioneTracce==null){
  1724.            
  1725.             Boolean defaultValue = false;
  1726.             String propertyName = "org.openspcoop2.protocol.modipa.generazioneTracce.enabled";
  1727.            
  1728.             try{  
  1729.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1730.                 if (value != null){
  1731.                     value = value.trim();
  1732.                     this.isGenerazioneTracce = Boolean.parseBoolean(value);
  1733.                 }else{
  1734.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1735.                     this.isGenerazioneTracce = defaultValue;
  1736.                 }

  1737.             }catch(java.lang.Exception e) {
  1738.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1739.                 this.isGenerazioneTracce = defaultValue;
  1740.             }
  1741.         }

  1742.         return this.isGenerazioneTracce;
  1743.     }
  1744.    
  1745.     private Boolean isGenerazioneTracceRegistraToken = null;
  1746.     public Boolean isGenerazioneTracceRegistraToken(){
  1747.         if(this.isGenerazioneTracceRegistraToken==null){
  1748.            
  1749.             Boolean defaultValue = false;
  1750.             String propertyName = "org.openspcoop2.protocol.modipa.generazioneTracce.registrazioneToken.enabled";
  1751.            
  1752.             try{  
  1753.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1754.                 if (value != null){
  1755.                     value = value.trim();
  1756.                     this.isGenerazioneTracceRegistraToken = Boolean.parseBoolean(value);
  1757.                 }else{
  1758.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1759.                     this.isGenerazioneTracceRegistraToken = defaultValue;
  1760.                 }

  1761.             }catch(java.lang.Exception e) {
  1762.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1763.                 this.isGenerazioneTracceRegistraToken = defaultValue;
  1764.             }
  1765.         }

  1766.         return this.isGenerazioneTracceRegistraToken;
  1767.     }
  1768.    
  1769.     private Boolean isGenerazioneTracceRegistraCustomClaims = null;
  1770.     public boolean isGenerazioneTracceRegistraCustomClaims(){
  1771.         if(this.isGenerazioneTracceRegistraCustomClaims==null){
  1772.            
  1773.             Boolean defaultValue = false;
  1774.             String propertyName = "org.openspcoop2.protocol.modipa.generazioneTracce.registrazioneCustomClaims.enabled";
  1775.            
  1776.             try{  
  1777.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1778.                 if (value != null){
  1779.                     value = value.trim();
  1780.                     this.isGenerazioneTracceRegistraCustomClaims = Boolean.parseBoolean(value);
  1781.                 }else{
  1782.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1783.                     this.isGenerazioneTracceRegistraCustomClaims = defaultValue;
  1784.                 }

  1785.             }catch(java.lang.Exception e) {
  1786.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1787.                 this.isGenerazioneTracceRegistraCustomClaims = defaultValue;
  1788.             }
  1789.         }

  1790.         return this.isGenerazioneTracceRegistraCustomClaims;
  1791.     }
  1792.    
  1793.     private List<String> getGenerazioneTracceRegistraCustomClaimsBlackList= null;
  1794.     public List<String> getGenerazioneTracceRegistraCustomClaimsBlackList() throws ProtocolException{
  1795.         if(this.getGenerazioneTracceRegistraCustomClaimsBlackList==null){
  1796.            
  1797.             String propertyName = "org.openspcoop2.protocol.modipa.generazioneTracce.registrazioneCustomClaims.blackList";
  1798.             try{  
  1799.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1800.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  1801.                     this.getGenerazioneTracceRegistraCustomClaimsBlackList = ModISecurityConfig.convertToList(value);
  1802.                 }
  1803.             }catch(java.lang.Exception e) {
  1804.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1805.                 throw new ProtocolException(e.getMessage(),e);
  1806.             }
  1807.         }
  1808.        
  1809.         return this.getGenerazioneTracceRegistraCustomClaimsBlackList;
  1810.     }
  1811.    
  1812.    
  1813.    
  1814.    
  1815.     /* **** Nomenclatura **** */
  1816.    
  1817.     private Boolean isModIVersioneBozza = null;
  1818.     public Boolean isModIVersioneBozza(){
  1819.         if(this.isModIVersioneBozza==null){
  1820.            
  1821.             Boolean defaultValue = false;
  1822.             String propertyName = "org.openspcoop2.protocol.modipa.usaVersioneBozza";
  1823.            
  1824.             try{  
  1825.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1826.                 if (value != null){
  1827.                     value = value.trim();
  1828.                     this.isModIVersioneBozza = Boolean.parseBoolean(value);
  1829.                 }else{
  1830.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1831.                     this.isModIVersioneBozza = defaultValue;
  1832.                 }

  1833.             }catch(java.lang.Exception e) {
  1834.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1835.                 this.isModIVersioneBozza = defaultValue;
  1836.             }
  1837.         }

  1838.         return this.isModIVersioneBozza;
  1839.     }
  1840.    
  1841.    
  1842.    
  1843.    
  1844.     /* **** REST **** */
  1845.    
  1846.     private String getRestSecurityTokenHeader= null;
  1847.     // riferito in org.openspcoop2.protocol.utils.ModIUtils
  1848.     // non modificare il nome
  1849.     public String getRestSecurityTokenHeaderModI() throws ProtocolException{
  1850.         if(this.getRestSecurityTokenHeader==null){
  1851.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.header";
  1852.             try{  
  1853.                 String value = this.reader.getValueConvertEnvProperties(name);
  1854.                
  1855.                 if (value != null){
  1856.                     value = value.trim();
  1857.                     this.getRestSecurityTokenHeader = value;
  1858.                 }
  1859.                 else {
  1860.                     throw newProtocolExceptionPropertyNonDefinita();
  1861.                 }
  1862.                
  1863.             }catch(java.lang.Exception e) {
  1864.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  1865.                 this.logError(msgErrore);
  1866.                 throw new ProtocolException(msgErrore,e);
  1867.             }
  1868.         }
  1869.        
  1870.         return this.getRestSecurityTokenHeader;
  1871.     }
  1872.    
  1873.     private Boolean isSecurityTokenX509AddKid = null;
  1874.     public boolean isSecurityTokenX509AddKid(){
  1875.         if(this.isSecurityTokenX509AddKid==null){
  1876.            
  1877.             boolean defaultValue = false;
  1878.             String propertyName = "org.openspcoop2.protocol.modipa.rest.securityToken.x509.kid";
  1879.            
  1880.             try{  
  1881.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1882.                 if (value != null){
  1883.                     value = value.trim();
  1884.                     this.isSecurityTokenX509AddKid = Boolean.parseBoolean(value);
  1885.                 }else{
  1886.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1887.                     this.isSecurityTokenX509AddKid = defaultValue;
  1888.                 }

  1889.             }catch(java.lang.Exception e) {
  1890.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1891.                 this.isSecurityTokenX509AddKid = defaultValue;
  1892.             }
  1893.         }

  1894.         return this.isSecurityTokenX509AddKid;
  1895.     }
  1896.    
  1897.     private Boolean isSecurityTokenIntegrity01AddPurposeId = null;
  1898.     public boolean isSecurityTokenIntegrity01AddPurposeId(){
  1899.         if(this.isSecurityTokenIntegrity01AddPurposeId==null){
  1900.            
  1901.             boolean defaultValue = false;
  1902.             String propertyName = "org.openspcoop2.protocol.modipa.rest.securityToken.integrity_01.addPurposeId";
  1903.            
  1904.             try{  
  1905.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1906.                 if (value != null){
  1907.                     value = value.trim();
  1908.                     this.isSecurityTokenIntegrity01AddPurposeId = Boolean.parseBoolean(value);
  1909.                 }else{
  1910.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1911.                     this.isSecurityTokenIntegrity01AddPurposeId = defaultValue;
  1912.                 }

  1913.             }catch(java.lang.Exception e) {
  1914.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1915.                 this.isSecurityTokenIntegrity01AddPurposeId = defaultValue;
  1916.             }
  1917.         }

  1918.         return this.isSecurityTokenIntegrity01AddPurposeId;
  1919.     }
  1920.    
  1921.     private Boolean isSecurityTokenIntegrity02AddPurposeId = null;
  1922.     public boolean isSecurityTokenIntegrity02AddPurposeId(){
  1923.         if(this.isSecurityTokenIntegrity02AddPurposeId==null){
  1924.            
  1925.             boolean defaultValue = false;
  1926.             String propertyName = "org.openspcoop2.protocol.modipa.rest.securityToken.integrity_02.addPurposeId";
  1927.            
  1928.             try{  
  1929.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1930.                 if (value != null){
  1931.                     value = value.trim();
  1932.                     this.isSecurityTokenIntegrity02AddPurposeId = Boolean.parseBoolean(value);
  1933.                 }else{
  1934.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1935.                     this.isSecurityTokenIntegrity02AddPurposeId = defaultValue;
  1936.                 }

  1937.             }catch(java.lang.Exception e) {
  1938.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1939.                 this.isSecurityTokenIntegrity02AddPurposeId = defaultValue;
  1940.             }
  1941.         }

  1942.         return this.isSecurityTokenIntegrity02AddPurposeId;
  1943.     }
  1944.    
  1945.     private Boolean getRestSecurityTokenClaimsIssuerEnabledReaded= null;
  1946.     private Boolean getRestSecurityTokenClaimsIssuerEnabled= null;
  1947.     public boolean isRestSecurityTokenClaimsIssuerEnabled() throws ProtocolException{
  1948.         if(this.getRestSecurityTokenClaimsIssuerEnabledReaded==null){
  1949.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.iss.enabled";
  1950.             try{  
  1951.                 String value = this.reader.getValueConvertEnvProperties(name);
  1952.                
  1953.                 if (value != null){
  1954.                     value = value.trim();
  1955.                     this.getRestSecurityTokenClaimsIssuerEnabled = Boolean.valueOf(value);
  1956.                 }
  1957.                 else {
  1958.                     throw newProtocolExceptionPropertyNonDefinita();
  1959.                 }
  1960.                
  1961.             }catch(java.lang.Exception e) {
  1962.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  1963.                 this.logError(msgErrore);
  1964.                 throw new ProtocolException(msgErrore,e);
  1965.             }
  1966.            
  1967.             this.getRestSecurityTokenClaimsIssuerEnabledReaded = true;
  1968.         }
  1969.        
  1970.         return this.getRestSecurityTokenClaimsIssuerEnabled;
  1971.     }
  1972.     private Boolean getRestSecurityTokenClaimsIssuerHeaderValueReaded= null;
  1973.     private String getRestSecurityTokenClaimsIssuerHeaderValue= null;
  1974.     public String getRestSecurityTokenClaimsIssuerHeaderValue() throws ProtocolException{
  1975.         if(this.getRestSecurityTokenClaimsIssuerHeaderValueReaded==null){
  1976.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.iss";
  1977.             try{  
  1978.                 String value = this.reader.getValueConvertEnvProperties(name);
  1979.                
  1980.                 if (value != null){
  1981.                     value = value.trim();
  1982.                     this.getRestSecurityTokenClaimsIssuerHeaderValue = value;
  1983.                 }
  1984.                
  1985.             }catch(java.lang.Exception e) {
  1986.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  1987.                 this.logError(msgErrore);
  1988.                 throw new ProtocolException(msgErrore,e);
  1989.             }
  1990.            
  1991.             this.getRestSecurityTokenClaimsIssuerHeaderValueReaded = true;
  1992.         }
  1993.        
  1994.         return this.getRestSecurityTokenClaimsIssuerHeaderValue;
  1995.     }
  1996.    
  1997.     private Boolean getRestSecurityTokenClaimsSubjectEnabledReaded= null;
  1998.     private Boolean getRestSecurityTokenClaimsSubjectEnabled= null;
  1999.     public boolean isRestSecurityTokenClaimsSubjectEnabled() throws ProtocolException{
  2000.         if(this.getRestSecurityTokenClaimsSubjectEnabledReaded==null){
  2001.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.sub.enabled";
  2002.             try{  
  2003.                 String value = this.reader.getValueConvertEnvProperties(name);
  2004.                
  2005.                 if (value != null){
  2006.                     value = value.trim();
  2007.                     this.getRestSecurityTokenClaimsSubjectEnabled = Boolean.valueOf(value);
  2008.                 }
  2009.                 else {
  2010.                     throw newProtocolExceptionPropertyNonDefinita();
  2011.                 }
  2012.                
  2013.             }catch(java.lang.Exception e) {
  2014.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2015.                 this.logError(msgErrore);
  2016.                 throw new ProtocolException(msgErrore,e);
  2017.             }
  2018.            
  2019.             this.getRestSecurityTokenClaimsSubjectEnabledReaded = true;
  2020.         }
  2021.        
  2022.         return this.getRestSecurityTokenClaimsSubjectEnabled;
  2023.     }
  2024.     private Boolean getRestSecurityTokenClaimsSubjectHeaderValueReaded= null;
  2025.     private String getRestSecurityTokenClaimsSubjectHeaderValue= null;
  2026.     public String getRestSecurityTokenClaimsSubjectHeaderValue() throws ProtocolException{
  2027.         if(this.getRestSecurityTokenClaimsSubjectHeaderValueReaded==null){
  2028.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.sub";
  2029.             try{  
  2030.                 String value = this.reader.getValueConvertEnvProperties(name);
  2031.                
  2032.                 if (value != null){
  2033.                     value = value.trim();
  2034.                     this.getRestSecurityTokenClaimsSubjectHeaderValue = value;
  2035.                 }
  2036.                
  2037.             }catch(java.lang.Exception e) {
  2038.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2039.                 this.logError(msgErrore);
  2040.                 throw new ProtocolException(msgErrore,e);
  2041.             }
  2042.            
  2043.             this.getRestSecurityTokenClaimsSubjectHeaderValueReaded = true;
  2044.         }
  2045.        
  2046.         return this.getRestSecurityTokenClaimsSubjectHeaderValue;
  2047.     }
  2048.    
  2049.     private String getRestSecurityTokenClaimsClientIdHeader= null;
  2050.     public String getRestSecurityTokenClaimsClientIdHeader() throws ProtocolException{
  2051.         if(this.getRestSecurityTokenClaimsClientIdHeader==null){
  2052.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.client_id";
  2053.             try{  
  2054.                 String value = this.reader.getValueConvertEnvProperties(name);
  2055.                
  2056.                 if (value != null){
  2057.                     value = value.trim();
  2058.                     this.getRestSecurityTokenClaimsClientIdHeader = value;
  2059.                 }
  2060.                 else {
  2061.                     throw newProtocolExceptionPropertyNonDefinita();
  2062.                 }
  2063.                
  2064.             }catch(java.lang.Exception e) {
  2065.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2066.                 this.logError(msgErrore);
  2067.                 throw new ProtocolException(msgErrore,e);
  2068.             }
  2069.         }
  2070.        
  2071.         return this.getRestSecurityTokenClaimsClientIdHeader;
  2072.     }
  2073.    
  2074.     private String getRestSecurityTokenClaimSignedHeaders= null;
  2075.     public String getRestSecurityTokenClaimSignedHeaders() throws ProtocolException{
  2076.         if(this.getRestSecurityTokenClaimSignedHeaders==null){
  2077.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.signedHeaders";
  2078.             try{  
  2079.                 String value = this.reader.getValueConvertEnvProperties(name);
  2080.                
  2081.                 if (value != null){
  2082.                     value = value.trim();
  2083.                     this.getRestSecurityTokenClaimSignedHeaders = value;
  2084.                 }
  2085.                 else {
  2086.                     throw newProtocolExceptionPropertyNonDefinita();
  2087.                 }
  2088.                
  2089.             }catch(java.lang.Exception e) {
  2090.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2091.                 this.logError(msgErrore);
  2092.                 throw new ProtocolException(msgErrore,e);
  2093.             }
  2094.         }
  2095.        
  2096.         return this.getRestSecurityTokenClaimSignedHeaders;
  2097.     }
  2098.    
  2099.    
  2100.     private String getRestSecurityTokenClaimRequestDigest= null;
  2101.     public String getRestSecurityTokenClaimRequestDigest() throws ProtocolException{
  2102.         if(this.getRestSecurityTokenClaimRequestDigest==null){
  2103.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.requestDigest";
  2104.             try{  
  2105.                 String value = this.reader.getValueConvertEnvProperties(name);
  2106.                
  2107.                 if (value != null){
  2108.                     value = value.trim();
  2109.                     this.getRestSecurityTokenClaimRequestDigest = value;
  2110.                 }
  2111.                 else {
  2112.                     throw newProtocolExceptionPropertyNonDefinita();
  2113.                 }
  2114.                
  2115.             }catch(java.lang.Exception e) {
  2116.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2117.                 this.logError(msgErrore);
  2118.                 throw new ProtocolException(msgErrore,e);
  2119.             }
  2120.         }
  2121.        
  2122.         return this.getRestSecurityTokenClaimRequestDigest;
  2123.     }
  2124.    
  2125.    
  2126.     private String [] getRestSecurityTokenSignedHeaders = null;
  2127.     public String [] getRestSecurityTokenSignedHeaders() throws ProtocolException{
  2128.         if(this.getRestSecurityTokenSignedHeaders==null){
  2129.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.signedHeaders";
  2130.             try{  
  2131.                 String value = this.reader.getValueConvertEnvProperties(name);
  2132.                
  2133.                 if (value != null){
  2134.                     value = value.trim();
  2135.                     String [] tmp = value.split(",");
  2136.                     this.getRestSecurityTokenSignedHeaders = new String[tmp.length];
  2137.                     for (int i = 0; i < tmp.length; i++) {
  2138.                         this.getRestSecurityTokenSignedHeaders[i] = tmp[i].trim();
  2139.                     }
  2140.                 }
  2141.                 else {
  2142.                     throw newProtocolExceptionPropertyNonDefinita();
  2143.                 }
  2144.                
  2145.             }catch(java.lang.Exception e) {
  2146.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2147.                 this.logError(msgErrore);
  2148.                 throw new ProtocolException(msgErrore,e);
  2149.             }
  2150.         }
  2151.        
  2152.         return this.getRestSecurityTokenSignedHeaders;
  2153.     }
  2154.     public String  getRestSecurityTokenSignedHeadersAsString() {
  2155.         StringBuilder bf = new StringBuilder();
  2156.         for (String hdr : this.getRestSecurityTokenSignedHeaders) {
  2157.             if(bf.length()>0) {
  2158.                 bf.append(",");
  2159.             }
  2160.             bf.append(hdr);
  2161.         }
  2162.         return bf.toString();
  2163.     }
  2164.    
  2165.     private Boolean getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMillisecondsReaded = null;
  2166.     private Long getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMilliseconds = null;
  2167.     public Long getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMilliseconds() throws ProtocolException{

  2168.         if(this.getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMillisecondsReaded==null){
  2169.            
  2170.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.iat.future.toleranceMilliseconds";
  2171.             try{  
  2172.                 String value = this.reader.getValueConvertEnvProperties(name);

  2173.                 if (value != null){
  2174.                     value = value.trim();
  2175.                     long tmp = Long.parseLong(value);
  2176.                     if(tmp>0) {
  2177.                         long maxLongValue = Long.MAX_VALUE;
  2178.                         if(tmp>maxLongValue) {
  2179.                             this.logWarn(getPrefixValoreIndicatoProprieta(value,name)+getSuffixSuperioreMassimoConsentitoControlloDisabilitato(maxLongValue));
  2180.                         }
  2181.                         else {
  2182.                             this.getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMilliseconds = tmp;
  2183.                         }
  2184.                     }
  2185.                     else {
  2186.                         this.logWarn(getMessaggioVerificaDisabilitata(name));
  2187.                     }
  2188.                 }
  2189.             }catch(java.lang.Exception e) {
  2190.                 this.logError(getMessaggioErroreProprietaNonImpostata(name, e),e);
  2191.                 throw new ProtocolException(e.getMessage(),e);
  2192.             }
  2193.            
  2194.             this.getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMillisecondsReaded = true;
  2195.         }

  2196.         return this.getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMilliseconds;
  2197.     }
  2198.    
  2199.     private Boolean getRestSecurityTokenClaimsIatTimeCheckMillisecondsReaded = null;
  2200.     private Long getRestSecurityTokenClaimsIatTimeCheckMilliseconds = null;
  2201.     public Long getRestSecurityTokenClaimsIatTimeCheckMilliseconds() throws ProtocolException{

  2202.         if(this.getRestSecurityTokenClaimsIatTimeCheckMillisecondsReaded==null){
  2203.            
  2204.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.iat.minutes";
  2205.             try{  
  2206.                 String value = this.reader.getValueConvertEnvProperties(name);

  2207.                 if (value != null){
  2208.                     value = value.trim();
  2209.                     long tmp = Long.parseLong(value); // minuti
  2210.                     if(tmp>0) {
  2211.                         long maxLongValue = ((Long.MAX_VALUE)/60000l);
  2212.                         if(tmp>maxLongValue) {
  2213.                             this.logWarn(getPrefixValoreIndicatoProprieta(value,name)+getSuffixSuperioreMassimoConsentitoControlloDisabilitato(maxLongValue));
  2214.                         }
  2215.                         else {
  2216.                             this.getRestSecurityTokenClaimsIatTimeCheckMilliseconds = tmp * 60 * 1000;
  2217.                         }
  2218.                     }
  2219.                     else {
  2220.                         this.logWarn(getMessaggioVerificaDisabilitata(name));
  2221.                     }
  2222.                 }
  2223.             }catch(java.lang.Exception e) {
  2224.                 this.logError(getMessaggioErroreProprietaNonImpostata(name, e),e);
  2225.                 throw new ProtocolException(e.getMessage(),e);
  2226.             }
  2227.            
  2228.             this.getRestSecurityTokenClaimsIatTimeCheckMillisecondsReaded = true;
  2229.         }

  2230.         return this.getRestSecurityTokenClaimsIatTimeCheckMilliseconds;
  2231.     }
  2232.    
  2233.     private Boolean isRestSecurityTokenClaimsExpTimeCheck= null;
  2234.     public boolean isRestSecurityTokenClaimsExpTimeCheck() throws ProtocolException{
  2235.         if(this.isRestSecurityTokenClaimsExpTimeCheck==null){
  2236.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.exp.checkEnabled";
  2237.             try{  
  2238.                 String value = this.reader.getValueConvertEnvProperties(name);
  2239.                
  2240.                 if (value != null){
  2241.                     value = value.trim();
  2242.                     this.isRestSecurityTokenClaimsExpTimeCheck = Boolean.valueOf(value);
  2243.                 }
  2244.                 else {
  2245.                     throw newProtocolExceptionPropertyNonDefinita();
  2246.                 }
  2247.                
  2248.             }catch(java.lang.Exception e) {
  2249.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2250.                 this.logError(msgErrore);
  2251.                 throw new ProtocolException(msgErrore,e);
  2252.             }
  2253.            
  2254.         }
  2255.        
  2256.         return this.isRestSecurityTokenClaimsExpTimeCheck;
  2257.     }  
  2258.    
  2259.     private Boolean getRestSecurityTokenClaimsExpTimeCheckToleranceMillisecondsReaded = null;
  2260.     private Long getRestSecurityTokenClaimsExpTimeCheckToleranceMilliseconds = null;
  2261.     public Long getRestSecurityTokenClaimsExpTimeCheckToleranceMilliseconds() throws ProtocolException{

  2262.         if(this.getRestSecurityTokenClaimsExpTimeCheckToleranceMillisecondsReaded==null){
  2263.            
  2264.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.exp.toleranceMilliseconds";
  2265.             try{  
  2266.                 String value = this.reader.getValueConvertEnvProperties(name);

  2267.                 if (value != null){
  2268.                     value = value.trim();
  2269.                     long tmp = Long.parseLong(value); // già in millisecondi
  2270.                     if(tmp>0) {
  2271.                         long maxLongValue = Long.MAX_VALUE;
  2272.                         if(tmp>maxLongValue) {
  2273.                             this.logWarn(getPrefixValoreIndicatoProprieta(value,name)+getSuffixSuperioreMassimoConsentitoControlloDisabilitato(maxLongValue));
  2274.                         }
  2275.                         else {
  2276.                             this.getRestSecurityTokenClaimsExpTimeCheckToleranceMilliseconds = tmp;
  2277.                         }
  2278.                     }
  2279.                     else {
  2280.                         this.logWarn(getMessaggioVerificaDisabilitata(name));
  2281.                     }
  2282.                 }
  2283.             }catch(java.lang.Exception e) {
  2284.                 this.logError(getMessaggioErroreProprietaNonImpostata(name, e),e);
  2285.                 throw new ProtocolException(e.getMessage(),e);
  2286.             }
  2287.            
  2288.             this.getRestSecurityTokenClaimsExpTimeCheckToleranceMillisecondsReaded = true;
  2289.         }

  2290.         return this.getRestSecurityTokenClaimsExpTimeCheckToleranceMilliseconds;
  2291.     }
  2292.    
  2293.     private Boolean getRestSecurityTokenClaimsNbfTimeCheckToleranceMillisecondsReaded = null;
  2294.     private Long getRestSecurityTokenClaimsNbfTimeCheckToleranceMilliseconds = null;
  2295.     public Long getRestSecurityTokenClaimsNbfTimeCheckToleranceMilliseconds() throws ProtocolException{

  2296.         if(this.getRestSecurityTokenClaimsNbfTimeCheckToleranceMillisecondsReaded==null){
  2297.            
  2298.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.nbf.toleranceMilliseconds";
  2299.             try{  
  2300.                 String value = this.reader.getValueConvertEnvProperties(name);

  2301.                 if (value != null){
  2302.                     value = value.trim();
  2303.                     long tmp = Long.parseLong(value); // già in millisecondi
  2304.                     if(tmp>0) {
  2305.                         long maxLongValue = Long.MAX_VALUE;
  2306.                         if(tmp>maxLongValue) {
  2307.                             this.logWarn(getPrefixValoreIndicatoProprieta(value,name)+getSuffixSuperioreMassimoConsentitoControlloDisabilitato(maxLongValue));
  2308.                         }
  2309.                         else {
  2310.                             this.getRestSecurityTokenClaimsNbfTimeCheckToleranceMilliseconds = tmp;
  2311.                         }
  2312.                     }
  2313.                     else {
  2314.                         this.logWarn(getMessaggioVerificaDisabilitata(name));
  2315.                     }
  2316.                 }
  2317.             }catch(java.lang.Exception e) {
  2318.                 this.logError(getMessaggioErroreProprietaNonImpostata(name, e),e);
  2319.                 throw new ProtocolException(e.getMessage(),e);
  2320.             }
  2321.            
  2322.             this.getRestSecurityTokenClaimsNbfTimeCheckToleranceMillisecondsReaded = true;
  2323.         }

  2324.         return this.getRestSecurityTokenClaimsNbfTimeCheckToleranceMilliseconds;
  2325.     }

  2326.     private DigestEncoding getRestSecurityTokenDigestDefaultEncoding= null;
  2327.     public DigestEncoding getRestSecurityTokenDigestDefaultEncoding() throws ProtocolException{
  2328.         if(this.getRestSecurityTokenDigestDefaultEncoding==null){
  2329.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.digest.encoding";
  2330.             try{  
  2331.                 String value = this.reader.getValueConvertEnvProperties(name);
  2332.                
  2333.                 if (value != null){
  2334.                     value = value.trim();
  2335.                     this.getRestSecurityTokenDigestDefaultEncoding = DigestEncoding.valueOf(value.toUpperCase());
  2336.                     if(this.getRestSecurityTokenDigestDefaultEncoding==null) {
  2337.                         throw new ProtocolException(INVALID_VALUE);
  2338.                     }
  2339.                 }
  2340.                 else {
  2341.                     throw newProtocolExceptionPropertyNonDefinita();
  2342.                 }
  2343.                
  2344.             }catch(java.lang.Exception e) {
  2345.                 String msgErrore = getPrefixProprieta(name)+" non impostata, errore (valori ammessi: "+DigestEncoding.BASE64.name().toLowerCase()+","+DigestEncoding.HEX.name().toLowerCase()+"):"+e.getMessage();
  2346.                 this.logError(msgErrore);
  2347.                 throw new ProtocolException(msgErrore,e);
  2348.             }
  2349.         }
  2350.        
  2351.         return this.getRestSecurityTokenDigestDefaultEncoding;
  2352.     }
  2353.    
  2354.     private Boolean isRestSecurityTokenDigestEncodingChoice= null;
  2355.     public boolean isRestSecurityTokenDigestEncodingChoice() throws ProtocolException{
  2356.         if(this.isRestSecurityTokenDigestEncodingChoice==null){
  2357.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.digest.encoding.choice";
  2358.             try{  
  2359.                 String value = this.reader.getValueConvertEnvProperties(name);
  2360.                
  2361.                 if (value != null){
  2362.                     value = value.trim();
  2363.                     this.isRestSecurityTokenDigestEncodingChoice = Boolean.valueOf(value);
  2364.                 }
  2365.                 else {
  2366.                     throw newProtocolExceptionPropertyNonDefinita();
  2367.                 }
  2368.                
  2369.             }catch(java.lang.Exception e) {
  2370.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2371.                 this.logError(msgErrore);
  2372.                 throw new ProtocolException(msgErrore,e);
  2373.             }
  2374.         }
  2375.        
  2376.         return this.isRestSecurityTokenDigestEncodingChoice;
  2377.     }
  2378.    
  2379.     private List<DigestEncoding> getRestSecurityTokenDigestEncodingAccepted= null;
  2380.     public List<DigestEncoding> getRestSecurityTokenDigestEncodingAccepted() throws ProtocolException{
  2381.         if(this.getRestSecurityTokenDigestEncodingAccepted==null){
  2382.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.digest.encoding.accepted";
  2383.             try{  
  2384.                 String value = this.reader.getValueConvertEnvProperties(name);
  2385.                
  2386.                 if (value != null){
  2387.                     value = value.trim();
  2388.                    
  2389.                     this.getRestSecurityTokenDigestEncodingAccepted = new ArrayList<>();
  2390.                     if(value.contains(",")) {
  2391.                         readRestSecurityTokenDigestEncodingAcceptedSplitValue(value);
  2392.                     }
  2393.                     else {
  2394.                         DigestEncoding tmp = DigestEncoding.valueOf(value.toUpperCase());
  2395.                         if(tmp==null) {
  2396.                             throw new ProtocolException(INVALID_VALUE);
  2397.                         }
  2398.                         this.getRestSecurityTokenDigestEncodingAccepted.add(tmp);
  2399.                     }
  2400.                 }
  2401.                 else {
  2402.                     throw newProtocolExceptionPropertyNonDefinita();
  2403.                 }
  2404.                
  2405.             }catch(java.lang.Exception e) {
  2406.                 String msgErrore = getPrefixProprieta(name)+" non impostata, errore (valori ammessi: "+DigestEncoding.BASE64.name().toLowerCase()+","+DigestEncoding.HEX.name().toLowerCase()+"):"+e.getMessage();
  2407.                 this.logError(msgErrore);
  2408.                 throw new ProtocolException(msgErrore,e);
  2409.             }
  2410.         }
  2411.        
  2412.         return this.getRestSecurityTokenDigestEncodingAccepted;
  2413.     }
  2414.     private void readRestSecurityTokenDigestEncodingAcceptedSplitValue(String value) throws ProtocolException {
  2415.         String [] split = value.split(",");
  2416.         if(split==null || split.length<=0) {
  2417.             throw new ProtocolException("Empty value");
  2418.         }
  2419.         for (String s : split) {
  2420.             if(s==null) {
  2421.                 throw new ProtocolException("Null value");
  2422.             }
  2423.             else {
  2424.                 s = s.trim();
  2425.             }
  2426.             DigestEncoding tmp = DigestEncoding.valueOf(s.toUpperCase());
  2427.             if(tmp==null) {
  2428.                 throw new ProtocolException(INVALID_VALUE);
  2429.             }
  2430.             this.getRestSecurityTokenDigestEncodingAccepted.add(tmp);
  2431.         }
  2432.     }
  2433.    
  2434.     private Boolean getRestSecurityTokenRequestDigestCleanReaded= null;
  2435.     private Boolean getRestSecurityTokenRequestDigestClean= null;
  2436.     public boolean isRestSecurityTokenRequestDigestClean() throws ProtocolException{
  2437.         if(this.getRestSecurityTokenRequestDigestCleanReaded==null){
  2438.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.request.digest.clean";
  2439.             try{  
  2440.                 String value = this.reader.getValueConvertEnvProperties(name);
  2441.                
  2442.                 if (value != null){
  2443.                     value = value.trim();
  2444.                     this.getRestSecurityTokenRequestDigestClean = Boolean.valueOf(value);
  2445.                 }
  2446.                 else {
  2447.                     throw newProtocolExceptionPropertyNonDefinita();
  2448.                 }
  2449.                
  2450.             }catch(java.lang.Exception e) {
  2451.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2452.                 this.logError(msgErrore);
  2453.                 throw new ProtocolException(msgErrore,e);
  2454.             }
  2455.            
  2456.             this.getRestSecurityTokenRequestDigestCleanReaded = true;
  2457.         }
  2458.        
  2459.         return this.getRestSecurityTokenRequestDigestClean;
  2460.     }
  2461.    
  2462.     private Boolean getRestSecurityTokenResponseDigestCleanReaded= null;
  2463.     private Boolean getRestSecurityTokenResponseDigestClean= null;
  2464.     public boolean isRestSecurityTokenResponseDigestClean() throws ProtocolException{
  2465.         if(this.getRestSecurityTokenResponseDigestCleanReaded==null){
  2466.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.response.digest.clean";
  2467.             try{  
  2468.                 String value = this.reader.getValueConvertEnvProperties(name);
  2469.                
  2470.                 if (value != null){
  2471.                     value = value.trim();
  2472.                     this.getRestSecurityTokenResponseDigestClean = Boolean.valueOf(value);
  2473.                 }
  2474.                 else {
  2475.                     throw newProtocolExceptionPropertyNonDefinita();
  2476.                 }
  2477.                
  2478.             }catch(java.lang.Exception e) {
  2479.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2480.                 this.logError(msgErrore);
  2481.                 throw new ProtocolException(msgErrore,e);
  2482.             }
  2483.            
  2484.             this.getRestSecurityTokenResponseDigestCleanReaded = true;
  2485.         }
  2486.        
  2487.         return this.getRestSecurityTokenResponseDigestClean;
  2488.     }
  2489.    
  2490.     private Boolean getRestSecurityTokenResponseDigestHEADuseServerHeaderReaded= null;
  2491.     private Boolean getRestSecurityTokenResponseDigestHEADuseServerHeader= null;
  2492.     public boolean isRestSecurityTokenResponseDigestHEADuseServerHeader() throws ProtocolException{
  2493.         if(this.getRestSecurityTokenResponseDigestHEADuseServerHeaderReaded==null){
  2494.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.response.digest.HEAD.useServerHeader";
  2495.             try{  
  2496.                 String value = this.reader.getValueConvertEnvProperties(name);
  2497.                
  2498.                 if (value != null){
  2499.                     value = value.trim();
  2500.                     this.getRestSecurityTokenResponseDigestHEADuseServerHeader = Boolean.valueOf(value);
  2501.                 }
  2502.                 else {
  2503.                     throw newProtocolExceptionPropertyNonDefinita();
  2504.                 }
  2505.                
  2506.             }catch(java.lang.Exception e) {
  2507.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2508.                 this.logError(msgErrore);
  2509.                 throw new ProtocolException(msgErrore,e);
  2510.             }
  2511.            
  2512.             this.getRestSecurityTokenResponseDigestHEADuseServerHeaderReaded = true;
  2513.         }
  2514.        
  2515.         return this.getRestSecurityTokenResponseDigestHEADuseServerHeader;
  2516.     }
  2517.    
  2518.     private Boolean getRestSecurityTokenFaultProcessEnabledReaded= null;
  2519.     private Boolean getRestSecurityTokenFaultProcessEnabled= null;
  2520.     public boolean isRestSecurityTokenFaultProcessEnabled() throws ProtocolException{
  2521.         if(this.getRestSecurityTokenFaultProcessEnabledReaded==null){
  2522.             String name = "org.openspcoop2.protocol.modipa.rest.fault.securityToken";
  2523.             try{  
  2524.                 String value = this.reader.getValueConvertEnvProperties(name);
  2525.                
  2526.                 if (value != null){
  2527.                     value = value.trim();
  2528.                     this.getRestSecurityTokenFaultProcessEnabled = Boolean.valueOf(value);
  2529.                 }
  2530.                 else {
  2531.                     throw newProtocolExceptionPropertyNonDefinita();
  2532.                 }
  2533.                
  2534.             }catch(java.lang.Exception e) {
  2535.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2536.                 this.logError(msgErrore);
  2537.                 throw new ProtocolException(msgErrore,e);
  2538.             }
  2539.            
  2540.             this.getRestSecurityTokenFaultProcessEnabledReaded = true;
  2541.         }
  2542.        
  2543.         return this.getRestSecurityTokenFaultProcessEnabled;
  2544.     }
  2545.    
  2546.     private Boolean getRestSecurityTokenAudienceProcessArrayModeReaded= null;
  2547.     private Boolean getRestSecurityTokenAudienceProcessArrayModeEnabled= null;
  2548.     public boolean isRestSecurityTokenAudienceProcessArrayModeEnabled() throws ProtocolException{
  2549.         if(this.getRestSecurityTokenAudienceProcessArrayModeReaded==null){
  2550.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.audience.processArrayMode";
  2551.             try{  
  2552.                 String value = this.reader.getValueConvertEnvProperties(name);
  2553.                
  2554.                 if (value != null){
  2555.                     value = value.trim();
  2556.                     this.getRestSecurityTokenAudienceProcessArrayModeEnabled = Boolean.valueOf(value);
  2557.                 }
  2558.                 else {
  2559.                     throw newProtocolExceptionPropertyNonDefinita();
  2560.                 }
  2561.                
  2562.             }catch(java.lang.Exception e) {
  2563.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2564.                 this.logError(msgErrore);
  2565.                 throw new ProtocolException(msgErrore,e);
  2566.             }
  2567.            
  2568.             this.getRestSecurityTokenAudienceProcessArrayModeReaded = true;
  2569.         }
  2570.        
  2571.         return this.getRestSecurityTokenAudienceProcessArrayModeEnabled;
  2572.     }
  2573.    
  2574.    
  2575.     private Boolean getRestResponseSecurityTokenAudienceDefaultReaded= null;
  2576.     private String getRestResponseSecurityTokenAudienceDefault= null;
  2577.     public String getRestResponseSecurityTokenAudienceDefault(String soggettoMittente) throws ProtocolException{
  2578.         if(this.getRestResponseSecurityTokenAudienceDefaultReaded==null){
  2579.             String name = "org.openspcoop2.protocol.modipa.rest.response.securityToken.audience.default";
  2580.             try{  
  2581.                 String value = this.reader.getValueConvertEnvProperties(name);
  2582.                 if (value != null){
  2583.                     value = value.trim();
  2584.                     this.getRestResponseSecurityTokenAudienceDefault = value;
  2585.                 }
  2586.                
  2587.             }catch(java.lang.Exception e) {
  2588.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2589.                 this.logError(msgErrore);
  2590.                 throw new ProtocolException(msgErrore,e);
  2591.             }
  2592.            
  2593.             this.getRestResponseSecurityTokenAudienceDefaultReaded = true;
  2594.         }
  2595.        
  2596.         if(ModICostanti.CONFIG_MODIPA_SOGGETTO_MITTENTE_KEYWORD.equalsIgnoreCase(this.getRestResponseSecurityTokenAudienceDefault) && soggettoMittente!=null && !StringUtils.isEmpty(soggettoMittente)) {
  2597.             return soggettoMittente;
  2598.         }
  2599.         else {
  2600.             return this.getRestResponseSecurityTokenAudienceDefault;
  2601.         }
  2602.     }  
  2603.    
  2604.     public List<String> getUsedRestSecurityClaims(boolean request, boolean integrita) throws ProtocolException{
  2605.         List<String> l = new ArrayList<>();
  2606.        
  2607.         l.add(Claims.JSON_WEB_TOKEN_RFC_7519_ISSUED_AT);
  2608.         l.add(Claims.JSON_WEB_TOKEN_RFC_7519_NOT_TO_BE_USED_BEFORE);
  2609.         l.add(Claims.JSON_WEB_TOKEN_RFC_7519_EXPIRED);
  2610.         l.add(Claims.JSON_WEB_TOKEN_RFC_7519_JWT_ID);
  2611.        
  2612.         if(request) {
  2613.             l.add(Claims.JSON_WEB_TOKEN_RFC_7519_AUDIENCE); // si configura sulla fruizione
  2614.            
  2615.             String v = getRestSecurityTokenClaimsClientIdHeader();
  2616.             if(v!=null && StringUtils.isNotEmpty(v)) {
  2617.                 l.add(v); // si configura sull'applicativo
  2618.             }
  2619.         }
  2620.        
  2621.         if(!request) {
  2622.             String v = getRestSecurityTokenClaimRequestDigest();
  2623.             if(v!=null && StringUtils.isNotEmpty(v)) {
  2624.                 l.add(v);
  2625.             }
  2626.         }
  2627.        
  2628.         /**
  2629.          ** Possono sempre essere definiti, poiche' utilizzati per sovrascrivere i default
  2630.         boolean addIss = true;
  2631.         boolean addSub = true;
  2632.         if(corniceSicurezza) {
  2633.             v = getSicurezzaMessaggioCorniceSicurezzaRestCodiceEnte();
  2634.             if(v!=null && StringUtils.isNotEmpty(v)) {
  2635.                 if(Claims.INTROSPECTION_RESPONSE_RFC_7662_ISSUER.equals(v)) {
  2636.                     addIss = false;
  2637.                 }
  2638.                 l.add(v);
  2639.             }
  2640.             v = getSicurezzaMessaggioCorniceSicurezzaRestUser();
  2641.             if(v!=null && StringUtils.isNotEmpty(v)) {
  2642.                 if(Claims.INTROSPECTION_RESPONSE_RFC_7662_SUBJECT.equals(v)) {
  2643.                     addSub = false;
  2644.                 }
  2645.                 l.add(v);
  2646.             }
  2647.             v = getSicurezzaMessaggioCorniceSicurezzaRestIpuser();
  2648.             if(v!=null && StringUtils.isNotEmpty(v)) {
  2649.                 l.add(v);
  2650.             }
  2651.         }
  2652.         if(addIss) {
  2653.             l.add(Claims.INTROSPECTION_RESPONSE_RFC_7662_ISSUER);
  2654.         }
  2655.         if(addSub) {
  2656.             l.add(Claims.INTROSPECTION_RESPONSE_RFC_7662_SUBJECT);
  2657.         }*/
  2658.        
  2659.         if(integrita) {
  2660.             String v = getRestSecurityTokenClaimSignedHeaders();
  2661.             if(v!=null && StringUtils.isNotEmpty(v)) {
  2662.                 l.add(v);
  2663.             }
  2664.         }
  2665.        
  2666.         return l;
  2667.     }
  2668.    
  2669.     private String getRestCorrelationIdHeader= null;
  2670.     public String getRestCorrelationIdHeader() throws ProtocolException{
  2671.         if(this.getRestCorrelationIdHeader==null){
  2672.             String name = "org.openspcoop2.protocol.modipa.rest.correlationId.header";
  2673.             try{  
  2674.                 String value = this.reader.getValueConvertEnvProperties(name);
  2675.                
  2676.                 if (value != null){
  2677.                     value = value.trim();
  2678.                     this.getRestCorrelationIdHeader = value;
  2679.                 }
  2680.                 else {
  2681.                     throw newProtocolExceptionPropertyNonDefinita();
  2682.                 }
  2683.                
  2684.             }catch(java.lang.Exception e) {
  2685.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2686.                 this.logError(msgErrore);
  2687.                 throw new ProtocolException(msgErrore,e);
  2688.             }
  2689.         }
  2690.        
  2691.         return this.getRestCorrelationIdHeader;
  2692.     }  
  2693.    
  2694.     private String getRestReplyToHeader= null;
  2695.     public String getRestReplyToHeader() throws ProtocolException{
  2696.         if(this.getRestReplyToHeader==null){
  2697.             String name = "org.openspcoop2.protocol.modipa.rest.replyTo.header";
  2698.             try{  
  2699.                 String value = this.reader.getValueConvertEnvProperties(name);
  2700.                
  2701.                 if (value != null){
  2702.                     value = value.trim();
  2703.                     this.getRestReplyToHeader = value;
  2704.                 }
  2705.                 else {
  2706.                     throw newProtocolExceptionPropertyNonDefinita();
  2707.                 }
  2708.                
  2709.             }catch(java.lang.Exception e) {
  2710.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2711.                 this.logError(msgErrore);
  2712.                 throw new ProtocolException(msgErrore,e);
  2713.             }
  2714.         }
  2715.        
  2716.         return this.getRestReplyToHeader;
  2717.     }
  2718.    
  2719.     private String getRestLocationHeader= null;
  2720.     public String getRestLocationHeader() throws ProtocolException{
  2721.         if(this.getRestLocationHeader==null){
  2722.             String name = "org.openspcoop2.protocol.modipa.rest.location.header";
  2723.             try{  
  2724.                 String value = this.reader.getValueConvertEnvProperties(name);
  2725.                
  2726.                 if (value != null){
  2727.                     value = value.trim();
  2728.                     this.getRestLocationHeader = value;
  2729.                 }
  2730.                 else {
  2731.                     throw newProtocolExceptionPropertyNonDefinita();
  2732.                 }
  2733.                
  2734.             }catch(java.lang.Exception e) {
  2735.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2736.                 this.logError(msgErrore);
  2737.                 throw new ProtocolException(msgErrore,e);
  2738.             }
  2739.         }
  2740.        
  2741.         return this.getRestLocationHeader;
  2742.     }
  2743.    
  2744.     private Boolean getRestProfiliInterazioneCheckCompatibilityReaded= null;
  2745.     private Boolean getRestProfiliInterazioneCheckCompatibility= null;
  2746.     public boolean isRestProfiliInterazioneCheckCompatibility() throws ProtocolException{
  2747.         if(this.getRestProfiliInterazioneCheckCompatibilityReaded==null){
  2748.             String name = "org.openspcoop2.protocol.modipa.rest.profiliInterazione.checkCompatibility";
  2749.             try{  
  2750.                 String value = this.reader.getValueConvertEnvProperties(name);
  2751.                
  2752.                 if (value != null){
  2753.                     value = value.trim();
  2754.                     this.getRestProfiliInterazioneCheckCompatibility = Boolean.valueOf(value);
  2755.                 }
  2756.                 else {
  2757.                     throw newProtocolExceptionPropertyNonDefinita();
  2758.                 }
  2759.                
  2760.             }catch(java.lang.Exception e) {
  2761.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2762.                 this.logError(msgErrore);
  2763.                 throw new ProtocolException(msgErrore,e);
  2764.             }
  2765.            
  2766.             this.getRestProfiliInterazioneCheckCompatibilityReaded = true;
  2767.         }
  2768.        
  2769.         return this.getRestProfiliInterazioneCheckCompatibility;
  2770.     }
  2771.    
  2772.     // .. BLOCCANTE ..
  2773.    
  2774.     private Integer [] getRestBloccanteHttpStatus = null;
  2775.     public Integer [] getRestBloccanteHttpStatus() throws ProtocolException{
  2776.         if(this.getRestBloccanteHttpStatus==null){
  2777.             String name = "org.openspcoop2.protocol.modipa.rest.bloccante.httpStatus";
  2778.             try{  
  2779.                 String value = this.reader.getValueConvertEnvProperties(name);
  2780.                
  2781.                 if (value != null){
  2782.                     value = value.trim();
  2783.                     if(ModICostanti.MODIPA_PROFILO_INTERAZIONE_HTTP_CODE_2XX.equalsIgnoreCase(value)) {
  2784.                         this.getRestBloccanteHttpStatus = new Integer[1];
  2785.                         this.getRestBloccanteHttpStatus[0] = ModICostanti.MODIPA_PROFILO_INTERAZIONE_HTTP_CODE_2XX_INT_VALUE;
  2786.                     }
  2787.                     else {
  2788.                         String [] tmp = value.split(",");
  2789.                         this.getRestBloccanteHttpStatus = new Integer[tmp.length];
  2790.                         for (int i = 0; i < tmp.length; i++) {
  2791.                             this.getRestBloccanteHttpStatus[i] = Integer.valueOf(tmp[i].trim());
  2792.                         }
  2793.                     }
  2794.                 }
  2795.                 else {
  2796.                     throw newProtocolExceptionPropertyNonDefinita();
  2797.                 }
  2798.                
  2799.             }catch(java.lang.Exception e) {
  2800.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2801.                 this.logError(msgErrore);
  2802.                 throw new ProtocolException(msgErrore,e);
  2803.             }
  2804.         }
  2805.        
  2806.         return this.getRestBloccanteHttpStatus;
  2807.     }
  2808.    
  2809.     private List<HttpRequestMethod> getRestBloccanteHttpMethod = null;
  2810.     public List<HttpRequestMethod> getRestBloccanteHttpMethod() throws ProtocolException{
  2811.         if(this.getRestBloccanteHttpMethod==null){
  2812.             String name = "org.openspcoop2.protocol.modipa.rest.bloccante.httpMethod";
  2813.             try{
  2814.                 this.getRestBloccanteHttpMethod = new ArrayList<>();
  2815.                 String value = this.reader.getValueConvertEnvProperties(name);
  2816.                
  2817.                 if (value != null){
  2818.                     value = value.trim();
  2819.                     String [] tmp = value.split(",");
  2820.                     for (int i = 0; i < tmp.length; i++) {
  2821.                         this.getRestBloccanteHttpMethod.add(HttpRequestMethod.valueOf(tmp[i].trim().toUpperCase()));
  2822.                     }
  2823.                 }
  2824.                
  2825.             }catch(java.lang.Exception e) {
  2826.                 String msgErrore = getMessaggioErroreProprietaNonCorretta(name, e);
  2827.                 this.logError(msgErrore);
  2828.                 throw new ProtocolException(msgErrore,e);
  2829.             }
  2830.         }
  2831.        
  2832.         return this.getRestBloccanteHttpMethod;
  2833.     }
  2834.    
  2835.    
  2836.     // .. PUSH ..
  2837.    
  2838.     private Boolean getRestSecurityTokenPushReplyToUpdateOrCreate = null;
  2839.     public boolean isRestSecurityTokenPushReplyToUpdateOrCreateInFruizione() throws ProtocolException{
  2840.         if(this.getRestSecurityTokenPushReplyToUpdateOrCreate==null){
  2841.             String name = "org.openspcoop2.protocol.modipa.rest.push.replyTo.header.updateOrCreate";
  2842.             try{  
  2843.                 String value = this.reader.getValueConvertEnvProperties(name);
  2844.                
  2845.                 if (value != null){
  2846.                     value = value.trim();
  2847.                     this.getRestSecurityTokenPushReplyToUpdateOrCreate = Boolean.valueOf(value);
  2848.                 }
  2849.                 else {
  2850.                     throw newProtocolExceptionPropertyNonDefinita();
  2851.                 }
  2852.                
  2853.             }catch(java.lang.Exception e) {
  2854.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2855.                 this.logError(msgErrore);
  2856.                 throw new ProtocolException(msgErrore,e);
  2857.             }
  2858.         }
  2859.        
  2860.         return this.getRestSecurityTokenPushReplyToUpdateOrCreate;
  2861.     }
  2862.    
  2863.     private Boolean getRestSecurityTokenPushReplyToUpdate = null;
  2864.     public boolean isRestSecurityTokenPushReplyToUpdateInErogazione() throws ProtocolException{
  2865.         if(this.getRestSecurityTokenPushReplyToUpdate==null){
  2866.             String name = "org.openspcoop2.protocol.modipa.rest.push.replyTo.header.update";
  2867.             try{  
  2868.                 String value = this.reader.getValueConvertEnvProperties(name);
  2869.                
  2870.                 if (value != null){
  2871.                     value = value.trim();
  2872.                     this.getRestSecurityTokenPushReplyToUpdate = Boolean.valueOf(value);
  2873.                 }
  2874.                 else {
  2875.                     throw newProtocolExceptionPropertyNonDefinita();
  2876.                 }
  2877.                
  2878.             }catch(java.lang.Exception e) {
  2879.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2880.                 this.logError(msgErrore);
  2881.                 throw new ProtocolException(msgErrore,e);
  2882.             }
  2883.         }
  2884.        
  2885.         return this.getRestSecurityTokenPushReplyToUpdate;
  2886.     }
  2887.    
  2888.     private Boolean getRestSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists = null;
  2889.     public boolean isRestSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists() throws ProtocolException{
  2890.         if(this.getRestSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists==null){
  2891.             String name = "org.openspcoop2.protocol.modipa.rest.push.request.correlationId.header.useTransactionIdIfNotExists";
  2892.             try{  
  2893.                 String value = this.reader.getValueConvertEnvProperties(name);
  2894.                
  2895.                 if (value != null){
  2896.                     value = value.trim();
  2897.                     this.getRestSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists = Boolean.valueOf(value);
  2898.                 }
  2899.                 else {
  2900.                     throw newProtocolExceptionPropertyNonDefinita();
  2901.                 }
  2902.                
  2903.             }catch(java.lang.Exception e) {
  2904.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2905.                 this.logError(msgErrore);
  2906.                 throw new ProtocolException(msgErrore,e);
  2907.             }
  2908.         }
  2909.        
  2910.         return this.getRestSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists;
  2911.     }
  2912.    
  2913.     private Integer [] getRestSecurityTokenPushRequestHttpStatus = null;
  2914.     public Integer [] getRestNonBloccantePushRequestHttpStatus() throws ProtocolException{
  2915.         if(this.getRestSecurityTokenPushRequestHttpStatus==null){
  2916.             String name = "org.openspcoop2.protocol.modipa.rest.push.request.httpStatus";
  2917.             try{  
  2918.                 String value = this.reader.getValueConvertEnvProperties(name);
  2919.                
  2920.                 if (value != null){
  2921.                     value = value.trim();
  2922.                     String [] tmp = value.split(",");
  2923.                     this.getRestSecurityTokenPushRequestHttpStatus = new Integer[tmp.length];
  2924.                     for (int i = 0; i < tmp.length; i++) {
  2925.                         this.getRestSecurityTokenPushRequestHttpStatus[i] = Integer.valueOf(tmp[i].trim());
  2926.                     }
  2927.                 }
  2928.                 else {
  2929.                     throw newProtocolExceptionPropertyNonDefinita();
  2930.                 }
  2931.                
  2932.             }catch(java.lang.Exception e) {
  2933.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2934.                 this.logError(msgErrore);
  2935.                 throw new ProtocolException(msgErrore,e);
  2936.             }
  2937.         }
  2938.        
  2939.         return this.getRestSecurityTokenPushRequestHttpStatus;
  2940.     }
  2941.    
  2942.     private List<HttpRequestMethod> getRestNonBloccantePushRequestHttpMethod = null;
  2943.     public List<HttpRequestMethod> getRestNonBloccantePushRequestHttpMethod() throws ProtocolException{
  2944.         if(this.getRestNonBloccantePushRequestHttpMethod==null){
  2945.             String name = "org.openspcoop2.protocol.modipa.rest.push.request.httpMethod";
  2946.             try{
  2947.                 this.getRestNonBloccantePushRequestHttpMethod = new ArrayList<>();
  2948.                 String value = this.reader.getValueConvertEnvProperties(name);
  2949.                
  2950.                 if (value != null){
  2951.                     value = value.trim();
  2952.                     String [] tmp = value.split(",");
  2953.                     for (int i = 0; i < tmp.length; i++) {
  2954.                         this.getRestNonBloccantePushRequestHttpMethod.add(HttpRequestMethod.valueOf(tmp[i].trim().toUpperCase()));
  2955.                     }
  2956.                 }
  2957.                
  2958.             }catch(java.lang.Exception e) {
  2959.                 String msgErrore = getMessaggioErroreProprietaNonCorretta(name, e);
  2960.                 this.logError(msgErrore);
  2961.                 throw new ProtocolException(msgErrore,e);
  2962.             }
  2963.         }
  2964.        
  2965.         return this.getRestNonBloccantePushRequestHttpMethod;
  2966.     }
  2967.    
  2968.     private Integer [] getRestSecurityTokenPushResponseHttpStatus = null;
  2969.     public Integer [] getRestNonBloccantePushResponseHttpStatus() throws ProtocolException{
  2970.         if(this.getRestSecurityTokenPushResponseHttpStatus==null){
  2971.             String name = "org.openspcoop2.protocol.modipa.rest.push.response.httpStatus";
  2972.             try{  
  2973.                 String value = this.reader.getValueConvertEnvProperties(name);
  2974.                
  2975.                 if (value != null){
  2976.                     value = value.trim();
  2977.                     String [] tmp = value.split(",");
  2978.                     this.getRestSecurityTokenPushResponseHttpStatus = new Integer[tmp.length];
  2979.                     for (int i = 0; i < tmp.length; i++) {
  2980.                         this.getRestSecurityTokenPushResponseHttpStatus[i] = Integer.valueOf(tmp[i].trim());
  2981.                     }
  2982.                 }
  2983.                 else {
  2984.                     throw newProtocolExceptionPropertyNonDefinita();
  2985.                 }
  2986.                
  2987.             }catch(java.lang.Exception e) {
  2988.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2989.                 this.logError(msgErrore);
  2990.                 throw new ProtocolException(msgErrore,e);
  2991.             }
  2992.         }
  2993.        
  2994.         return this.getRestSecurityTokenPushResponseHttpStatus;
  2995.     }
  2996.    
  2997.     private List<HttpRequestMethod> getRestNonBloccantePushResponseHttpMethod = null;
  2998.     public List<HttpRequestMethod> getRestNonBloccantePushResponseHttpMethod() throws ProtocolException{
  2999.         if(this.getRestNonBloccantePushResponseHttpMethod==null){
  3000.             String name = "org.openspcoop2.protocol.modipa.rest.push.response.httpMethod";
  3001.             try{
  3002.                 this.getRestNonBloccantePushResponseHttpMethod = new ArrayList<>();
  3003.                 String value = this.reader.getValueConvertEnvProperties(name);
  3004.                
  3005.                 if (value != null){
  3006.                     value = value.trim();
  3007.                     String [] tmp = value.split(",");
  3008.                     for (int i = 0; i < tmp.length; i++) {
  3009.                         this.getRestNonBloccantePushResponseHttpMethod.add(HttpRequestMethod.valueOf(tmp[i].trim().toUpperCase()));
  3010.                     }
  3011.                 }
  3012.                
  3013.             }catch(java.lang.Exception e) {
  3014.                 String msgErrore = getMessaggioErroreProprietaNonCorretta(name, e);
  3015.                 this.logError(msgErrore);
  3016.                 throw new ProtocolException(msgErrore,e);
  3017.             }
  3018.         }
  3019.        
  3020.         return this.getRestNonBloccantePushResponseHttpMethod;
  3021.     }
  3022.    
  3023.     private List<HttpRequestMethod> getRestNonBloccantePushHttpMethod = null;
  3024.     public List<HttpRequestMethod> getRestNonBloccantePushHttpMethod() throws ProtocolException{
  3025.        
  3026.         if(this.getRestNonBloccantePushHttpMethod!=null) {
  3027.             return this.getRestNonBloccantePushHttpMethod;
  3028.         }
  3029.        
  3030.         this.getRestNonBloccantePushHttpMethod = new ArrayList<>();
  3031.        
  3032.         List<HttpRequestMethod> req = getRestNonBloccantePushRequestHttpMethod();
  3033.         if(req!=null && !req.isEmpty()){
  3034.             this.getRestNonBloccantePushHttpMethod.addAll(req);
  3035.         }
  3036.        
  3037.         List<HttpRequestMethod> res = getRestNonBloccantePushResponseHttpMethod();
  3038.         if(res!=null && !res.isEmpty()){
  3039.             for (HttpRequestMethod httpRequestMethod : res) {
  3040.                 if(!this.getRestNonBloccantePushHttpMethod.contains(httpRequestMethod)) {
  3041.                     this.getRestNonBloccantePushHttpMethod.add(httpRequestMethod);
  3042.                 }
  3043.             }
  3044.         }
  3045.        
  3046.         return this.getRestNonBloccantePushHttpMethod;
  3047.     }
  3048.    
  3049.     // .. PULL ..
  3050.    
  3051.     private Integer [] getRestSecurityTokenPullRequestHttpStatus = null;
  3052.     public Integer [] getRestNonBloccantePullRequestHttpStatus() throws ProtocolException{
  3053.         if(this.getRestSecurityTokenPullRequestHttpStatus==null){
  3054.             String name = "org.openspcoop2.protocol.modipa.rest.pull.request.httpStatus";
  3055.             try{  
  3056.                 String value = this.reader.getValueConvertEnvProperties(name);
  3057.                
  3058.                 if (value != null){
  3059.                     value = value.trim();
  3060.                     String [] tmp = value.split(",");
  3061.                     this.getRestSecurityTokenPullRequestHttpStatus = new Integer[tmp.length];
  3062.                     for (int i = 0; i < tmp.length; i++) {
  3063.                         this.getRestSecurityTokenPullRequestHttpStatus[i] = Integer.valueOf(tmp[i].trim());
  3064.                     }
  3065.                 }
  3066.                 else {
  3067.                     throw newProtocolExceptionPropertyNonDefinita();
  3068.                 }
  3069.                
  3070.             }catch(java.lang.Exception e) {
  3071.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3072.                 this.logError(msgErrore);
  3073.                 throw new ProtocolException(msgErrore,e);
  3074.             }
  3075.         }
  3076.        
  3077.         return this.getRestSecurityTokenPullRequestHttpStatus;
  3078.     }
  3079.    
  3080.     private List<HttpRequestMethod> getRestNonBloccantePullRequestHttpMethod = null;
  3081.     public List<HttpRequestMethod> getRestNonBloccantePullRequestHttpMethod() throws ProtocolException{
  3082.         if(this.getRestNonBloccantePullRequestHttpMethod==null){
  3083.             String name = "org.openspcoop2.protocol.modipa.rest.pull.request.httpMethod";
  3084.             try{
  3085.                 this.getRestNonBloccantePullRequestHttpMethod = new ArrayList<>();
  3086.                 String value = this.reader.getValueConvertEnvProperties(name);
  3087.                
  3088.                 if (value != null){
  3089.                     value = value.trim();
  3090.                     String [] tmp = value.split(",");
  3091.                     for (int i = 0; i < tmp.length; i++) {
  3092.                         this.getRestNonBloccantePullRequestHttpMethod.add(HttpRequestMethod.valueOf(tmp[i].trim().toUpperCase()));
  3093.                     }
  3094.                 }
  3095.                
  3096.             }catch(java.lang.Exception e) {
  3097.                 String msgErrore = getMessaggioErroreProprietaNonCorretta(name, e);
  3098.                 this.logError(msgErrore);
  3099.                 throw new ProtocolException(msgErrore,e);
  3100.             }
  3101.         }
  3102.        
  3103.         return this.getRestNonBloccantePullRequestHttpMethod;
  3104.     }
  3105.    
  3106.     private Integer [] getRestSecurityTokenPullRequestStateNotReadyHttpStatus = null;
  3107.     public Integer [] getRestNonBloccantePullRequestStateNotReadyHttpStatus() throws ProtocolException{
  3108.         if(this.getRestSecurityTokenPullRequestStateNotReadyHttpStatus==null){
  3109.             String name = "org.openspcoop2.protocol.modipa.rest.pull.requestState.notReady.httpStatus";
  3110.             try{  
  3111.                 String value = this.reader.getValueConvertEnvProperties(name);
  3112.                
  3113.                 if (value != null){
  3114.                     value = value.trim();
  3115.                     String [] tmp = value.split(",");
  3116.                     this.getRestSecurityTokenPullRequestStateNotReadyHttpStatus = new Integer[tmp.length];
  3117.                     for (int i = 0; i < tmp.length; i++) {
  3118.                         this.getRestSecurityTokenPullRequestStateNotReadyHttpStatus[i] = Integer.valueOf(tmp[i].trim());
  3119.                     }
  3120.                 }
  3121.                 else {
  3122.                     throw newProtocolExceptionPropertyNonDefinita();
  3123.                 }
  3124.                
  3125.             }catch(java.lang.Exception e) {
  3126.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3127.                 this.logError(msgErrore);
  3128.                 throw new ProtocolException(msgErrore,e);
  3129.             }
  3130.         }
  3131.        
  3132.         return this.getRestSecurityTokenPullRequestStateNotReadyHttpStatus;
  3133.     }
  3134.    
  3135.     private Integer [] getRestSecurityTokenPullRequestStateOkHttpStatus = null;
  3136.     public Integer [] getRestNonBloccantePullRequestStateOkHttpStatus() throws ProtocolException{
  3137.         if(this.getRestSecurityTokenPullRequestStateOkHttpStatus==null){
  3138.             String name = "org.openspcoop2.protocol.modipa.rest.pull.requestState.ok.httpStatus";
  3139.             try{  
  3140.                 String value = this.reader.getValueConvertEnvProperties(name);
  3141.                
  3142.                 if (value != null){
  3143.                     value = value.trim();
  3144.                     String [] tmp = value.split(",");
  3145.                     this.getRestSecurityTokenPullRequestStateOkHttpStatus = new Integer[tmp.length];
  3146.                     for (int i = 0; i < tmp.length; i++) {
  3147.                         this.getRestSecurityTokenPullRequestStateOkHttpStatus[i] = Integer.valueOf(tmp[i].trim());
  3148.                     }
  3149.                 }
  3150.                 else {
  3151.                     throw newProtocolExceptionPropertyNonDefinita();
  3152.                 }
  3153.                
  3154.             }catch(java.lang.Exception e) {
  3155.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3156.                 this.logError(msgErrore);
  3157.                 throw new ProtocolException(msgErrore,e);
  3158.             }
  3159.         }
  3160.        
  3161.         return this.getRestSecurityTokenPullRequestStateOkHttpStatus;
  3162.     }
  3163.    
  3164.     private List<HttpRequestMethod> getRestNonBloccantePullRequestStateHttpMethod = null;
  3165.     public List<HttpRequestMethod> getRestNonBloccantePullRequestStateHttpMethod() throws ProtocolException{
  3166.         if(this.getRestNonBloccantePullRequestStateHttpMethod==null){
  3167.             String name = "org.openspcoop2.protocol.modipa.rest.pull.requestState.httpMethod";
  3168.             try{
  3169.                 this.getRestNonBloccantePullRequestStateHttpMethod = new ArrayList<>();
  3170.                 String value = this.reader.getValueConvertEnvProperties(name);
  3171.                
  3172.                 if (value != null){
  3173.                     value = value.trim();
  3174.                     String [] tmp = value.split(",");
  3175.                     for (int i = 0; i < tmp.length; i++) {
  3176.                         this.getRestNonBloccantePullRequestStateHttpMethod.add(HttpRequestMethod.valueOf(tmp[i].trim().toUpperCase()));
  3177.                     }
  3178.                 }
  3179.                
  3180.             }catch(java.lang.Exception e) {
  3181.                 String msgErrore = getMessaggioErroreProprietaNonCorretta(name, e);
  3182.                 this.logError(msgErrore);
  3183.                 throw new ProtocolException(msgErrore,e);
  3184.             }
  3185.         }
  3186.        
  3187.         return this.getRestNonBloccantePullRequestStateHttpMethod;
  3188.     }
  3189.    
  3190.     private Integer [] getRestSecurityTokenPullResponseHttpStatus = null;
  3191.     public Integer [] getRestNonBloccantePullResponseHttpStatus() throws ProtocolException{
  3192.         if(this.getRestSecurityTokenPullResponseHttpStatus==null){
  3193.             String name = "org.openspcoop2.protocol.modipa.rest.pull.response.httpStatus";
  3194.             try{  
  3195.                 String value = this.reader.getValueConvertEnvProperties(name);
  3196.                
  3197.                 if (value != null){
  3198.                     value = value.trim();
  3199.                     String [] tmp = value.split(",");
  3200.                     this.getRestSecurityTokenPullResponseHttpStatus = new Integer[tmp.length];
  3201.                     for (int i = 0; i < tmp.length; i++) {
  3202.                         this.getRestSecurityTokenPullResponseHttpStatus[i] = Integer.valueOf(tmp[i].trim());
  3203.                     }
  3204.                 }
  3205.                 else {
  3206.                     throw newProtocolExceptionPropertyNonDefinita();
  3207.                 }
  3208.                
  3209.             }catch(java.lang.Exception e) {
  3210.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3211.                 this.logError(msgErrore);
  3212.                 throw new ProtocolException(msgErrore,e);
  3213.             }
  3214.         }
  3215.        
  3216.         return this.getRestSecurityTokenPullResponseHttpStatus;
  3217.     }
  3218.    
  3219.     private List<HttpRequestMethod> getRestNonBloccantePullResponseHttpMethod = null;
  3220.     public List<HttpRequestMethod> getRestNonBloccantePullResponseHttpMethod() throws ProtocolException{
  3221.         if(this.getRestNonBloccantePullResponseHttpMethod==null){
  3222.             String name = "org.openspcoop2.protocol.modipa.rest.pull.response.httpMethod";
  3223.             try{
  3224.                 this.getRestNonBloccantePullResponseHttpMethod = new ArrayList<>();
  3225.                 String value = this.reader.getValueConvertEnvProperties(name);
  3226.                
  3227.                 if (value != null){
  3228.                     value = value.trim();
  3229.                     String [] tmp = value.split(",");
  3230.                     for (int i = 0; i < tmp.length; i++) {
  3231.                         this.getRestNonBloccantePullResponseHttpMethod.add(HttpRequestMethod.valueOf(tmp[i].trim().toUpperCase()));
  3232.                     }
  3233.                 }
  3234.                
  3235.             }catch(java.lang.Exception e) {
  3236.                 String msgErrore = getMessaggioErroreProprietaNonCorretta(name, e);
  3237.                 this.logError(msgErrore);
  3238.                 throw new ProtocolException(msgErrore,e);
  3239.             }
  3240.         }
  3241.        
  3242.         return this.getRestNonBloccantePullResponseHttpMethod;
  3243.     }
  3244.    
  3245.     private List<HttpRequestMethod> getRestNonBloccantePullHttpMethod = null;
  3246.     public List<HttpRequestMethod> getRestNonBloccantePullHttpMethod() throws ProtocolException{
  3247.        
  3248.         if(this.getRestNonBloccantePullHttpMethod!=null) {
  3249.             return this.getRestNonBloccantePullHttpMethod;
  3250.         }
  3251.        
  3252.         this.getRestNonBloccantePullHttpMethod = new ArrayList<>();
  3253.        
  3254.         readRestNonBloccantePullHttpMethodRequest();
  3255.        
  3256.         readRestNonBloccantePullHttpMethodResponse();
  3257.        
  3258.         return this.getRestNonBloccantePullHttpMethod;
  3259.     }
  3260.     private void readRestNonBloccantePullHttpMethodRequest() throws ProtocolException {
  3261.         List<HttpRequestMethod> req = getRestNonBloccantePullRequestHttpMethod();
  3262.         if(req!=null && !req.isEmpty()){
  3263.             this.getRestNonBloccantePullHttpMethod.addAll(req);
  3264.         }
  3265.        
  3266.         List<HttpRequestMethod> reqState = getRestNonBloccantePullRequestStateHttpMethod();
  3267.         if(reqState!=null && !reqState.isEmpty()){
  3268.             for (HttpRequestMethod httpRequestMethod : reqState) {
  3269.                 if(!this.getRestNonBloccantePullHttpMethod.contains(httpRequestMethod)) {
  3270.                     this.getRestNonBloccantePullHttpMethod.add(httpRequestMethod);
  3271.                 }
  3272.             }
  3273.         }
  3274.     }
  3275.     private void readRestNonBloccantePullHttpMethodResponse() throws ProtocolException {
  3276.         List<HttpRequestMethod> res = getRestNonBloccantePullResponseHttpMethod();
  3277.         if(res!=null && !res.isEmpty()){
  3278.             for (HttpRequestMethod httpRequestMethod : res) {
  3279.                 if(!this.getRestNonBloccantePullHttpMethod.contains(httpRequestMethod)) {
  3280.                     this.getRestNonBloccantePullHttpMethod.add(httpRequestMethod);
  3281.                 }
  3282.             }
  3283.         }
  3284.     }
  3285.    
  3286.    
  3287.     /* **** SOAP **** */
  3288.    
  3289.     private Boolean getSoapSecurityTokenMustUnderstandReaded= null;
  3290.     private Boolean getSoapSecurityTokenMustUnderstand= null;
  3291.     public boolean isSoapSecurityTokenMustUnderstand() throws ProtocolException{
  3292.         if(this.getSoapSecurityTokenMustUnderstandReaded==null){
  3293.             String name = "org.openspcoop2.protocol.modipa.soap.securityToken.mustUnderstand";
  3294.             try{  
  3295.                 String value = this.reader.getValueConvertEnvProperties(name);
  3296.                
  3297.                 if (value != null){
  3298.                     value = value.trim();
  3299.                     this.getSoapSecurityTokenMustUnderstand = Boolean.valueOf(value);
  3300.                 }
  3301.                 else {
  3302.                     throw newProtocolExceptionPropertyNonDefinita();
  3303.                 }
  3304.                
  3305.             }catch(java.lang.Exception e) {
  3306.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3307.                 this.logError(msgErrore);
  3308.                 throw new ProtocolException(msgErrore,e);
  3309.             }
  3310.            
  3311.             this.getSoapSecurityTokenMustUnderstandReaded = true;
  3312.         }
  3313.        
  3314.         return this.getSoapSecurityTokenMustUnderstand;
  3315.     }  
  3316.    
  3317.     private Boolean getSoapSecurityTokenActorReaded= null;
  3318.     private String getSoapSecurityTokenActor= null;
  3319.     public String getSoapSecurityTokenActor() throws ProtocolException{
  3320.         if(this.getSoapSecurityTokenActorReaded==null){
  3321.             String name = "org.openspcoop2.protocol.modipa.soap.securityToken.actor";
  3322.             try{  
  3323.                 String value = this.reader.getValueConvertEnvProperties(name);
  3324.                
  3325.                 if (value != null){
  3326.                     value = value.trim();
  3327.                     if(!"".equals(value)) {
  3328.                         this.getSoapSecurityTokenActor = value;
  3329.                     }
  3330.                 }
  3331.                
  3332.             }catch(java.lang.Exception e) {
  3333.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3334.                 this.logError(msgErrore);
  3335.                 throw new ProtocolException(msgErrore,e);
  3336.             }
  3337.            
  3338.             this.getSoapSecurityTokenActorReaded = true;
  3339.         }
  3340.        
  3341.         return this.getSoapSecurityTokenActor;
  3342.     }
  3343.    
  3344.     private Boolean getSoapSecurityTokenTimestampCreatedTimeCheckMillisecondsReaded = null;
  3345.     private Long getSoapSecurityTokenTimestampCreatedTimeCheckMilliseconds = null;
  3346.     public Long getSoapSecurityTokenTimestampCreatedTimeCheckMilliseconds() throws ProtocolException{

  3347.         if(this.getSoapSecurityTokenTimestampCreatedTimeCheckMillisecondsReaded==null){
  3348.            
  3349.             String name = "org.openspcoop2.protocol.modipa.soap.securityToken.timestamp.created.minutes";
  3350.             try{  
  3351.                 String value = this.reader.getValueConvertEnvProperties(name);

  3352.                 if (value != null){
  3353.                     value = value.trim();
  3354.                     long tmp = Long.parseLong(value); // minuti
  3355.                     if(tmp>0) {
  3356.                         long maxLongValue = ((Long.MAX_VALUE)/60000l);
  3357.                         if(tmp>maxLongValue) {
  3358.                             this.logWarn(getPrefixValoreIndicatoProprieta(value,name)+getSuffixSuperioreMassimoConsentitoControlloDisabilitato(maxLongValue));
  3359.                         }
  3360.                         else {
  3361.                             this.getSoapSecurityTokenTimestampCreatedTimeCheckMilliseconds = tmp * 60 * 1000;
  3362.                         }
  3363.                     }
  3364.                     else {
  3365.                         this.logWarn(getMessaggioVerificaDisabilitata(name));
  3366.                     }
  3367.                 }
  3368.             }catch(java.lang.Exception e) {
  3369.                 this.logError(getMessaggioErroreProprietaNonImpostata(name, e),e);
  3370.                 throw new ProtocolException(e.getMessage(),e);
  3371.             }
  3372.            
  3373.             this.getSoapSecurityTokenTimestampCreatedTimeCheckMillisecondsReaded = true;
  3374.         }

  3375.         return this.getSoapSecurityTokenTimestampCreatedTimeCheckMilliseconds;
  3376.     }
  3377.    
  3378.     private Boolean getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMillisecondsReaded = null;
  3379.     private Long getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMilliseconds = null;
  3380.     public Long getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMilliseconds() throws ProtocolException{

  3381.         if(this.getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMillisecondsReaded==null){
  3382.            
  3383.             String name = "org.openspcoop2.protocol.modipa.soap.securityToken.timestamp.created.future.toleranceMilliseconds";
  3384.             try{  
  3385.                 String value = this.reader.getValueConvertEnvProperties(name);

  3386.                 if (value != null){
  3387.                     value = value.trim();
  3388.                     long tmp = Long.parseLong(value); // già in millisecondi
  3389.                     if(tmp>0) {
  3390.                         long maxLongValue = Long.MAX_VALUE;
  3391.                         if(tmp>maxLongValue) {
  3392.                             this.logWarn(getPrefixValoreIndicatoProprieta(value,name)+getSuffixSuperioreMassimoConsentitoControlloDisabilitato(maxLongValue));
  3393.                         }
  3394.                         else {
  3395.                             this.getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMilliseconds = tmp;
  3396.                         }
  3397.                     }
  3398.                     else {
  3399.                         this.logWarn(getMessaggioVerificaDisabilitata(name));
  3400.                     }
  3401.                 }
  3402.             }catch(java.lang.Exception e) {
  3403.                 this.logError(getMessaggioErroreProprietaNonImpostata(name, e),e);
  3404.                 throw new ProtocolException(e.getMessage(),e);
  3405.             }
  3406.            
  3407.             this.getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMillisecondsReaded = true;
  3408.         }

  3409.         return this.getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMilliseconds;
  3410.     }
  3411.    
  3412.     private Boolean getSoapSecurityTokenFaultProcessEnabledReaded= null;
  3413.     private Boolean getSoapSecurityTokenFaultProcessEnabled= null;
  3414.     public boolean isSoapSecurityTokenFaultProcessEnabled() throws ProtocolException{
  3415.         if(this.getSoapSecurityTokenFaultProcessEnabledReaded==null){
  3416.             String name = "org.openspcoop2.protocol.modipa.soap.fault.securityToken";
  3417.             try{  
  3418.                 String value = this.reader.getValueConvertEnvProperties(name);
  3419.                
  3420.                 if (value != null){
  3421.                     value = value.trim();
  3422.                     this.getSoapSecurityTokenFaultProcessEnabled = Boolean.valueOf(value);
  3423.                 }
  3424.                 else {
  3425.                     throw newProtocolExceptionPropertyNonDefinita();
  3426.                 }
  3427.                
  3428.             }catch(java.lang.Exception e) {
  3429.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3430.                 this.logError(msgErrore);
  3431.                 throw new ProtocolException(msgErrore,e);
  3432.             }
  3433.            
  3434.             this.getSoapSecurityTokenFaultProcessEnabledReaded = true;
  3435.         }
  3436.        
  3437.         return this.getSoapSecurityTokenFaultProcessEnabled;
  3438.     }
  3439.    
  3440.     private Boolean isSoapSecurityTokenTimestampExpiresTimeCheck= null;
  3441.     public boolean isSoapSecurityTokenTimestampExpiresTimeCheck() throws ProtocolException{
  3442.         if(this.isSoapSecurityTokenTimestampExpiresTimeCheck==null){
  3443.             String name = "org.openspcoop2.protocol.modipa.soap.securityToken.timestamp.expires.checkEnabled";
  3444.             try{  
  3445.                 String value = this.reader.getValueConvertEnvProperties(name);
  3446.                
  3447.                 if (value != null){
  3448.                     value = value.trim();
  3449.                     this.isSoapSecurityTokenTimestampExpiresTimeCheck = Boolean.valueOf(value);
  3450.                 }
  3451.                 else {
  3452.                     throw newProtocolExceptionPropertyNonDefinita();
  3453.                 }
  3454.                
  3455.             }catch(java.lang.Exception e) {
  3456.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3457.                 this.logError(msgErrore);
  3458.                 throw new ProtocolException(msgErrore,e);
  3459.             }
  3460.            
  3461.         }
  3462.        
  3463.         return this.isSoapSecurityTokenTimestampExpiresTimeCheck;
  3464.     }  
  3465.    
  3466.     private Boolean getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMillisecondsReaded = null;
  3467.     private Long getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMilliseconds = null;
  3468.     public Long getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMilliseconds() throws ProtocolException{

  3469.         if(this.getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMillisecondsReaded==null){
  3470.            
  3471.             String name = "org.openspcoop2.protocol.modipa.soap.securityToken.timestamp.expires.toleranceMilliseconds";
  3472.             try{  
  3473.                 String value = this.reader.getValueConvertEnvProperties(name);

  3474.                 if (value != null){
  3475.                     value = value.trim();
  3476.                     long tmp = Long.parseLong(value); // già in millisecondi
  3477.                     if(tmp>0) {
  3478.                         long maxLongValue = Long.MAX_VALUE;
  3479.                         if(tmp>maxLongValue) {
  3480.                             this.logWarn(getPrefixValoreIndicatoProprieta(value,name)+getSuffixSuperioreMassimoConsentitoControlloDisabilitato(maxLongValue));
  3481.                         }
  3482.                         else {
  3483.                             this.getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMilliseconds = tmp;
  3484.                         }
  3485.                     }
  3486.                     else {
  3487.                         this.logWarn(getMessaggioVerificaDisabilitata(name));
  3488.                     }
  3489.                 }
  3490.             }catch(java.lang.Exception e) {
  3491.                 this.logError(getMessaggioErroreProprietaNonImpostata(name, e),e);
  3492.                 throw new ProtocolException(e.getMessage(),e);
  3493.             }
  3494.            
  3495.             this.getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMillisecondsReaded = true;
  3496.         }

  3497.         return this.getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMilliseconds;
  3498.     }
  3499.    
  3500.     private Boolean getSoapWSAddressingMustUnderstandReaded= null;
  3501.     private Boolean getSoapWSAddressingMustUnderstand= null;
  3502.     public boolean isSoapWSAddressingMustUnderstand() throws ProtocolException{
  3503.         if(this.getSoapWSAddressingMustUnderstandReaded==null){
  3504.             String name = "org.openspcoop2.protocol.modipa.soap.wsaddressing.mustUnderstand";
  3505.             try{  
  3506.                 String value = this.reader.getValueConvertEnvProperties(name);
  3507.                
  3508.                 if (value != null){
  3509.                     value = value.trim();
  3510.                     this.getSoapWSAddressingMustUnderstand = Boolean.valueOf(value);
  3511.                 }
  3512.                 else {
  3513.                     throw newProtocolExceptionPropertyNonDefinita();
  3514.                 }
  3515.                
  3516.             }catch(java.lang.Exception e) {
  3517.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3518.                 this.logError(msgErrore);
  3519.                 throw new ProtocolException(msgErrore,e);
  3520.             }
  3521.            
  3522.             this.getSoapWSAddressingMustUnderstandReaded = true;
  3523.         }
  3524.        
  3525.         return this.getSoapWSAddressingMustUnderstand;
  3526.     }  
  3527.    
  3528.     private Boolean getSoapWSAddressingActorReaded= null;
  3529.     private String getSoapWSAddressingActor= null;
  3530.     public String getSoapWSAddressingActor() throws ProtocolException{
  3531.         if(this.getSoapWSAddressingActorReaded==null){
  3532.             String name = "org.openspcoop2.protocol.modipa.soap.wsaddressing.actor";
  3533.             try{  
  3534.                 String value = this.reader.getValueConvertEnvProperties(name);
  3535.                
  3536.                 if (value != null){
  3537.                     value = value.trim();
  3538.                     if(!"".equals(value)) {
  3539.                         this.getSoapWSAddressingActor = value;
  3540.                     }
  3541.                 }
  3542.                
  3543.             }catch(java.lang.Exception e) {
  3544.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3545.                 this.logError(msgErrore);
  3546.                 throw new ProtocolException(msgErrore,e);
  3547.             }
  3548.            
  3549.             this.getSoapWSAddressingActorReaded = true;
  3550.         }
  3551.        
  3552.         return this.getSoapWSAddressingActor;
  3553.     }
  3554.    
  3555.     private Boolean getSoapWSAddressingSchemaValidationReaded= null;
  3556.     private Boolean getSoapWSAddressingSchemaValidation= null;
  3557.     public boolean isSoapWSAddressingSchemaValidation() throws ProtocolException{
  3558.         if(this.getSoapWSAddressingSchemaValidationReaded==null){
  3559.             String name = "org.openspcoop2.protocol.modipa.soap.wsaddressing.schemaValidation";
  3560.             try{  
  3561.                 String value = this.reader.getValueConvertEnvProperties(name);
  3562.                
  3563.                 if (value != null){
  3564.                     value = value.trim();
  3565.                     this.getSoapWSAddressingSchemaValidation = Boolean.valueOf(value);
  3566.                 }
  3567.                 else {
  3568.                     throw newProtocolExceptionPropertyNonDefinita();
  3569.                 }
  3570.                
  3571.             }catch(java.lang.Exception e) {
  3572.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3573.                 this.logError(msgErrore);
  3574.                 throw new ProtocolException(msgErrore,e);
  3575.             }
  3576.            
  3577.             this.getSoapWSAddressingSchemaValidationReaded = true;
  3578.         }
  3579.        
  3580.         return this.getSoapWSAddressingSchemaValidation;
  3581.     }  
  3582.    
  3583.    
  3584.     private String getSoapCorrelationIdName= null;
  3585.     public String getSoapCorrelationIdName() throws ProtocolException{
  3586.         if(this.getSoapCorrelationIdName==null){
  3587.             String name = "org.openspcoop2.protocol.modipa.soap.correlationId.name";
  3588.             try{  
  3589.                 String value = this.reader.getValueConvertEnvProperties(name);
  3590.                
  3591.                 if (value != null){
  3592.                     value = value.trim();
  3593.                     this.getSoapCorrelationIdName = value;
  3594.                 }
  3595.                 else {
  3596.                     throw newProtocolExceptionPropertyNonDefinita();
  3597.                 }
  3598.                
  3599.             }catch(java.lang.Exception e) {
  3600.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3601.                 this.logError(msgErrore);
  3602.                 throw new ProtocolException(msgErrore,e);
  3603.             }
  3604.         }
  3605.        
  3606.         return this.getSoapCorrelationIdName;
  3607.     }
  3608.    
  3609.     private String getSoapCorrelationIdNamespace= null;
  3610.     public String getSoapCorrelationIdNamespace() throws ProtocolException{
  3611.         if(this.getSoapCorrelationIdNamespace==null){
  3612.             String name = "org.openspcoop2.protocol.modipa.soap.correlationId.namespace";
  3613.             try{  
  3614.                 String value = this.reader.getValueConvertEnvProperties(name);
  3615.                
  3616.                 if (value != null){
  3617.                     value = value.trim();
  3618.                     this.getSoapCorrelationIdNamespace = value;
  3619.                 }
  3620.                 else {
  3621.                     throw newProtocolExceptionPropertyNonDefinita();
  3622.                 }
  3623.                
  3624.             }catch(java.lang.Exception e) {
  3625.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3626.                 this.logError(msgErrore);
  3627.                 throw new ProtocolException(msgErrore,e);
  3628.             }
  3629.         }
  3630.        
  3631.         return this.getSoapCorrelationIdNamespace;
  3632.     }
  3633.    
  3634.     public boolean useSoapBodyCorrelationIdNamespace() throws ProtocolException {
  3635.         return ModICostanti.MODIPA_USE_BODY_NAMESPACE.equals(this.getSoapCorrelationIdNamespace());
  3636.     }
  3637.    
  3638.     private String getSoapCorrelationIdPrefix= null;
  3639.     public String getSoapCorrelationIdPrefix() throws ProtocolException{
  3640.         if(this.getSoapCorrelationIdPrefix==null){
  3641.             String name = "org.openspcoop2.protocol.modipa.soap.correlationId.prefix";
  3642.             try{  
  3643.                 String value = this.reader.getValueConvertEnvProperties(name);
  3644.                
  3645.                 if (value != null){
  3646.                     value = value.trim();
  3647.                     this.getSoapCorrelationIdPrefix = value;
  3648.                 }
  3649.                 else {
  3650.                     throw newProtocolExceptionPropertyNonDefinita();
  3651.                 }
  3652.                
  3653.             }catch(java.lang.Exception e) {
  3654.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3655.                 this.logError(msgErrore);
  3656.                 throw new ProtocolException(msgErrore,e);
  3657.             }
  3658.         }
  3659.        
  3660.         return this.getSoapCorrelationIdPrefix;
  3661.     }
  3662.    
  3663.     private Boolean getSoapCorrelationIdMustUnderstandReaded= null;
  3664.     private Boolean getSoapCorrelationIdMustUnderstand= null;
  3665.     public boolean isSoapCorrelationIdMustUnderstand() throws ProtocolException{
  3666.         if(this.getSoapCorrelationIdMustUnderstandReaded==null){
  3667.             String name = "org.openspcoop2.protocol.modipa.soap.correlationId.mustUnderstand";
  3668.             try{  
  3669.                 String value = this.reader.getValueConvertEnvProperties(name);
  3670.                
  3671.                 if (value != null){
  3672.                     value = value.trim();
  3673.                     this.getSoapCorrelationIdMustUnderstand = Boolean.valueOf(value);
  3674.                 }
  3675.                 else {
  3676.                     throw newProtocolExceptionPropertyNonDefinita();
  3677.                 }
  3678.                
  3679.             }catch(java.lang.Exception e) {
  3680.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3681.                 this.logError(msgErrore);
  3682.                 throw new ProtocolException(msgErrore,e);
  3683.             }
  3684.            
  3685.             this.getSoapCorrelationIdMustUnderstandReaded = true;
  3686.         }
  3687.        
  3688.         return this.getSoapCorrelationIdMustUnderstand;
  3689.     }  
  3690.    
  3691.     private Boolean getSoapCorrelationIdActorReaded= null;
  3692.     private String getSoapCorrelationIdActor= null;
  3693.     public String getSoapCorrelationIdActor() throws ProtocolException{
  3694.         if(this.getSoapCorrelationIdActorReaded==null){
  3695.             String name = "org.openspcoop2.protocol.modipa.soap.correlationId.actor";
  3696.             try{  
  3697.                 String value = this.reader.getValueConvertEnvProperties(name);
  3698.                
  3699.                 if (value != null){
  3700.                     value = value.trim();
  3701.                     if(!"".equals(value)) {
  3702.                         this.getSoapCorrelationIdActor = value;
  3703.                     }
  3704.                 }
  3705.                
  3706.             }catch(java.lang.Exception e) {
  3707.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3708.                 this.logError(msgErrore);
  3709.                 throw new ProtocolException(msgErrore,e);
  3710.             }
  3711.            
  3712.             this.getSoapCorrelationIdActorReaded = true;
  3713.         }
  3714.        
  3715.         return this.getSoapCorrelationIdActor;
  3716.     }
  3717.    
  3718.    
  3719.    
  3720.    
  3721.     private String getSoapReplyToName= null;
  3722.     public String getSoapReplyToName() throws ProtocolException{
  3723.         if(this.getSoapReplyToName==null){
  3724.             String name = "org.openspcoop2.protocol.modipa.soap.replyTo.name";
  3725.             try{  
  3726.                 String value = this.reader.getValueConvertEnvProperties(name);
  3727.                
  3728.                 if (value != null){
  3729.                     value = value.trim();
  3730.                     this.getSoapReplyToName = value;
  3731.                 }
  3732.                 else {
  3733.                     throw newProtocolExceptionPropertyNonDefinita();
  3734.                 }
  3735.                
  3736.             }catch(java.lang.Exception e) {
  3737.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3738.                 this.logError(msgErrore);
  3739.                 throw new ProtocolException(msgErrore,e);
  3740.             }
  3741.         }
  3742.        
  3743.         return this.getSoapReplyToName;
  3744.     }
  3745.    
  3746.     private String getSoapReplyToNamespace= null;
  3747.     public String getSoapReplyToNamespace() throws ProtocolException{
  3748.         if(this.getSoapReplyToNamespace==null){
  3749.             String name = "org.openspcoop2.protocol.modipa.soap.replyTo.namespace";
  3750.             try{  
  3751.                 String value = this.reader.getValueConvertEnvProperties(name);
  3752.                
  3753.                 if (value != null){
  3754.                     value = value.trim();
  3755.                     this.getSoapReplyToNamespace = value;
  3756.                 }
  3757.                 else {
  3758.                     throw newProtocolExceptionPropertyNonDefinita();
  3759.                 }
  3760.                
  3761.             }catch(java.lang.Exception e) {
  3762.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3763.                 this.logError(msgErrore);
  3764.                 throw new ProtocolException(msgErrore,e);
  3765.             }
  3766.         }
  3767.        
  3768.         return this.getSoapReplyToNamespace;
  3769.     }
  3770.    
  3771.     public boolean useSoapBodyReplyToNamespace() throws ProtocolException {
  3772.         return ModICostanti.MODIPA_USE_BODY_NAMESPACE.equals(this.getSoapReplyToNamespace());
  3773.     }
  3774.    
  3775.     private String getSoapReplyToPrefix= null;
  3776.     public String getSoapReplyToPrefix() throws ProtocolException{
  3777.         if(this.getSoapReplyToPrefix==null){
  3778.             String name = "org.openspcoop2.protocol.modipa.soap.replyTo.prefix";
  3779.             try{  
  3780.                 String value = this.reader.getValueConvertEnvProperties(name);
  3781.                
  3782.                 if (value != null){
  3783.                     value = value.trim();
  3784.                     this.getSoapReplyToPrefix = value;
  3785.                 }
  3786.                 else {
  3787.                     throw newProtocolExceptionPropertyNonDefinita();
  3788.                 }
  3789.                
  3790.             }catch(java.lang.Exception e) {
  3791.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3792.                 this.logError(msgErrore);
  3793.                 throw new ProtocolException(msgErrore,e);
  3794.             }
  3795.         }
  3796.        
  3797.         return this.getSoapReplyToPrefix;
  3798.     }
  3799.    
  3800.     private Boolean getSoapReplyToMustUnderstandReaded= null;
  3801.     private Boolean getSoapReplyToMustUnderstand= null;
  3802.     public boolean isSoapReplyToMustUnderstand() throws ProtocolException{
  3803.         if(this.getSoapReplyToMustUnderstandReaded==null){
  3804.             String name = "org.openspcoop2.protocol.modipa.soap.replyTo.mustUnderstand";
  3805.             try{  
  3806.                 String value = this.reader.getValueConvertEnvProperties(name);
  3807.                
  3808.                 if (value != null){
  3809.                     value = value.trim();
  3810.                     this.getSoapReplyToMustUnderstand = Boolean.valueOf(value);
  3811.                 }
  3812.                 else {
  3813.                     throw newProtocolExceptionPropertyNonDefinita();
  3814.                 }
  3815.                
  3816.             }catch(java.lang.Exception e) {
  3817.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3818.                 this.logError(msgErrore);
  3819.                 throw new ProtocolException(msgErrore,e);
  3820.             }
  3821.            
  3822.             this.getSoapReplyToMustUnderstandReaded = true;
  3823.         }
  3824.        
  3825.         return this.getSoapReplyToMustUnderstand;
  3826.     }  
  3827.    
  3828.     private Boolean getSoapReplyToActorReaded= null;
  3829.     private String getSoapReplyToActor= null;
  3830.     public String getSoapReplyToActor() throws ProtocolException{
  3831.         if(this.getSoapReplyToActorReaded==null){
  3832.             String name = "org.openspcoop2.protocol.modipa.soap.replyTo.actor";
  3833.             try{  
  3834.                 String value = this.reader.getValueConvertEnvProperties(name);
  3835.                
  3836.                 if (value != null){
  3837.                     value = value.trim();
  3838.                     if(!"".equals(value)) {
  3839.                         this.getSoapReplyToActor = value;
  3840.                     }
  3841.                 }
  3842.                
  3843.             }catch(java.lang.Exception e) {
  3844.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3845.                 this.logError(msgErrore);
  3846.                 throw new ProtocolException(msgErrore,e);
  3847.             }
  3848.            
  3849.             this.getSoapReplyToActorReaded = true;
  3850.         }
  3851.        
  3852.         return this.getSoapReplyToActor;
  3853.     }
  3854.    
  3855.    
  3856.     private String getSoapRequestDigestName= null;
  3857.     public String getSoapRequestDigestName() throws ProtocolException{
  3858.         if(this.getSoapRequestDigestName==null){
  3859.             String name = "org.openspcoop2.protocol.modipa.soap.requestDigest.name";
  3860.             try{  
  3861.                 String value = this.reader.getValueConvertEnvProperties(name);
  3862.                
  3863.                 if (value != null){
  3864.                     value = value.trim();
  3865.                     this.getSoapRequestDigestName = value;
  3866.                 }
  3867.                 else {
  3868.                     throw newProtocolExceptionPropertyNonDefinita();
  3869.                 }
  3870.                
  3871.             }catch(java.lang.Exception e) {
  3872.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3873.                 this.logError(msgErrore);
  3874.                 throw new ProtocolException(msgErrore,e);
  3875.             }
  3876.         }
  3877.        
  3878.         return this.getSoapRequestDigestName;
  3879.     }
  3880.    
  3881.     private String getSoapRequestDigestNamespace= null;
  3882.     public String getSoapRequestDigestNamespace() throws ProtocolException{
  3883.         if(this.getSoapRequestDigestNamespace==null){
  3884.             String name = "org.openspcoop2.protocol.modipa.soap.requestDigest.namespace";
  3885.             try{  
  3886.                 String value = this.reader.getValueConvertEnvProperties(name);
  3887.                
  3888.                 if (value != null){
  3889.                     value = value.trim();
  3890.                     this.getSoapRequestDigestNamespace = value;
  3891.                 }
  3892.                 else {
  3893.                     throw newProtocolExceptionPropertyNonDefinita();
  3894.                 }
  3895.                
  3896.             }catch(java.lang.Exception e) {
  3897.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3898.                 this.logError(msgErrore);
  3899.                 throw new ProtocolException(msgErrore,e);
  3900.             }
  3901.         }
  3902.        
  3903.         return this.getSoapRequestDigestNamespace;
  3904.     }
  3905.    
  3906.     public boolean useSoapBodyRequestDigestNamespace() throws ProtocolException {
  3907.         return ModICostanti.MODIPA_USE_BODY_NAMESPACE.equals(this.getSoapRequestDigestNamespace());
  3908.     }
  3909.    
  3910.     private String getSoapRequestDigestPrefix= null;
  3911.     public String getSoapRequestDigestPrefix() throws ProtocolException{
  3912.         if(this.getSoapRequestDigestPrefix==null){
  3913.             String name = "org.openspcoop2.protocol.modipa.soap.requestDigest.prefix";
  3914.             try{  
  3915.                 String value = this.reader.getValueConvertEnvProperties(name);
  3916.                
  3917.                 if (value != null){
  3918.                     value = value.trim();
  3919.                     this.getSoapRequestDigestPrefix = value;
  3920.                 }
  3921.                 else {
  3922.                     throw newProtocolExceptionPropertyNonDefinita();
  3923.                 }
  3924.                
  3925.             }catch(java.lang.Exception e) {
  3926.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3927.                 this.logError(msgErrore);
  3928.                 throw new ProtocolException(msgErrore,e);
  3929.             }
  3930.         }
  3931.        
  3932.         return this.getSoapRequestDigestPrefix;
  3933.     }
  3934.    
  3935.     private Boolean getSoapRequestDigestMustUnderstandReaded= null;
  3936.     private Boolean getSoapRequestDigestMustUnderstand= null;
  3937.     public boolean isSoapRequestDigestMustUnderstand() throws ProtocolException{
  3938.         if(this.getSoapRequestDigestMustUnderstandReaded==null){
  3939.             String name = "org.openspcoop2.protocol.modipa.soap.requestDigest.mustUnderstand";
  3940.             try{  
  3941.                 String value = this.reader.getValueConvertEnvProperties(name);
  3942.                
  3943.                 if (value != null){
  3944.                     value = value.trim();
  3945.                     this.getSoapRequestDigestMustUnderstand = Boolean.valueOf(value);
  3946.                 }
  3947.                 else {
  3948.                     throw newProtocolExceptionPropertyNonDefinita();
  3949.                 }
  3950.                
  3951.             }catch(java.lang.Exception e) {
  3952.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3953.                 this.logError(msgErrore);
  3954.                 throw new ProtocolException(msgErrore,e);
  3955.             }
  3956.            
  3957.             this.getSoapRequestDigestMustUnderstandReaded = true;
  3958.         }
  3959.        
  3960.         return this.getSoapRequestDigestMustUnderstand;
  3961.     }  
  3962.    
  3963.     private Boolean getSoapRequestDigestActorReaded= null;
  3964.     private String getSoapRequestDigestActor= null;
  3965.     public String getSoapRequestDigestActor() throws ProtocolException{
  3966.         if(this.getSoapRequestDigestActorReaded==null){
  3967.             String name = "org.openspcoop2.protocol.modipa.soap.requestDigest.actor";
  3968.             try{  
  3969.                 String value = this.reader.getValueConvertEnvProperties(name);
  3970.                
  3971.                 if (value != null){
  3972.                     value = value.trim();
  3973.                     if(!"".equals(value)) {
  3974.                         this.getSoapRequestDigestActor = value;
  3975.                     }
  3976.                 }
  3977.                
  3978.             }catch(java.lang.Exception e) {
  3979.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3980.                 this.logError(msgErrore);
  3981.                 throw new ProtocolException(msgErrore,e);
  3982.             }
  3983.            
  3984.             this.getSoapRequestDigestActorReaded = true;
  3985.         }
  3986.        
  3987.         return this.getSoapRequestDigestActor;
  3988.     }
  3989.    
  3990.     private Boolean getSoapSecurityTokenWsaToReaded= null;
  3991.     private String getSoapSecurityTokenWsaTo= null;
  3992.     private String getSoapSecurityTokenWsaTo() throws ProtocolException{
  3993.         if(this.getSoapSecurityTokenWsaToReaded==null){
  3994.             String name = "org.openspcoop2.protocol.modipa.soap.securityToken.wsaTo";
  3995.             try{  
  3996.                 String value = this.reader.getValueConvertEnvProperties(name);
  3997.                 if (value != null){
  3998.                     value = value.trim();
  3999.                     this.getSoapSecurityTokenWsaTo = value;
  4000.                 }
  4001.                 else {
  4002.                     throw newProtocolExceptionPropertyNonDefinita();
  4003.                 }
  4004.                
  4005.             }catch(java.lang.Exception e) {
  4006.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4007.                 this.logError(msgErrore);
  4008.                 throw new ProtocolException(msgErrore,e);
  4009.             }
  4010.            
  4011.             this.getSoapSecurityTokenWsaToReaded = true;
  4012.         }
  4013.        
  4014.         return this.getSoapSecurityTokenWsaTo;
  4015.     }
  4016.     private Boolean getSoapSecurityTokenWsaToSoapAction= null;
  4017.     private Boolean getSoapSecurityTokenWsaToOperation= null;
  4018.     private Boolean getSoapSecurityTokenWsaToNone= null;
  4019.     public boolean isSoapSecurityTokenWsaToSoapAction() throws ProtocolException {
  4020.         if(this.getSoapSecurityTokenWsaToSoapAction==null) {
  4021.             this.getSoapSecurityTokenWsaToSoapAction = ModICostanti.CONFIG_MODIPA_SOAP_SECURITY_TOKEN_WSA_TO_KEYWORD_SOAP_ACTION.equalsIgnoreCase(getSoapSecurityTokenWsaTo());
  4022.         }
  4023.         return this.getSoapSecurityTokenWsaToSoapAction;
  4024.     }
  4025.     public boolean isSoapSecurityTokenWsaToOperation() throws ProtocolException {
  4026.         if(this.getSoapSecurityTokenWsaToOperation==null) {
  4027.             this.getSoapSecurityTokenWsaToOperation = ModICostanti.CONFIG_MODIPA_SOAP_SECURITY_TOKEN_WSA_TO_KEYWORD_OPERATION.equalsIgnoreCase(getSoapSecurityTokenWsaTo());
  4028.         }
  4029.         return this.getSoapSecurityTokenWsaToOperation;
  4030.     }
  4031.     public boolean isSoapSecurityTokenWsaToDisabled() throws ProtocolException {
  4032.         if(this.getSoapSecurityTokenWsaToNone==null) {
  4033.             this.getSoapSecurityTokenWsaToNone = ModICostanti.CONFIG_MODIPA_SOAP_SECURITY_TOKEN_WSA_TO_KEYWORD_NONE.equalsIgnoreCase(getSoapSecurityTokenWsaTo());
  4034.         }
  4035.         return this.getSoapSecurityTokenWsaToNone;
  4036.     }
  4037.    
  4038.     private Boolean getSoapResponseSecurityTokenAudienceDefaultReaded= null;
  4039.     private String getSoapResponseSecurityTokenAudienceDefault= null;
  4040.     public String getSoapResponseSecurityTokenAudienceDefault(String soggettoMittente) throws ProtocolException{
  4041.         if(this.getSoapResponseSecurityTokenAudienceDefaultReaded==null){
  4042.             String name = "org.openspcoop2.protocol.modipa.soap.response.securityToken.audience.default";
  4043.             try{  
  4044.                 String value = this.reader.getValueConvertEnvProperties(name);
  4045.                 if (value != null){
  4046.                     value = value.trim();
  4047.                     this.getSoapResponseSecurityTokenAudienceDefault = value;
  4048.                 }
  4049.                
  4050.             }catch(java.lang.Exception e) {
  4051.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4052.                 this.logError(msgErrore);
  4053.                 throw new ProtocolException(msgErrore,e);
  4054.             }
  4055.            
  4056.             this.getSoapResponseSecurityTokenAudienceDefaultReaded = true;
  4057.         }
  4058.        
  4059.         if(ModICostanti.CONFIG_MODIPA_SOGGETTO_MITTENTE_KEYWORD.equalsIgnoreCase(this.getSoapResponseSecurityTokenAudienceDefault) && soggettoMittente!=null && !StringUtils.isEmpty(soggettoMittente)) {
  4060.             return soggettoMittente;
  4061.         }
  4062.         else {
  4063.             return this.getSoapResponseSecurityTokenAudienceDefault;
  4064.         }
  4065.     }
  4066.    
  4067.     // .. PUSH ..
  4068.    
  4069.     private Boolean getSoapSecurityTokenPushReplyToUpdateOrCreate = null;
  4070.     public boolean isSoapSecurityTokenPushReplyToUpdateOrCreateInFruizione() throws ProtocolException{
  4071.         if(this.getSoapSecurityTokenPushReplyToUpdateOrCreate==null){
  4072.             String name = "org.openspcoop2.protocol.modipa.soap.push.replyTo.header.updateOrCreate";
  4073.             try{  
  4074.                 String value = this.reader.getValueConvertEnvProperties(name);
  4075.                
  4076.                 if (value != null){
  4077.                     value = value.trim();
  4078.                     this.getSoapSecurityTokenPushReplyToUpdateOrCreate = Boolean.valueOf(value);
  4079.                 }
  4080.                 else {
  4081.                     throw newProtocolExceptionPropertyNonDefinita();
  4082.                 }
  4083.                
  4084.             }catch(java.lang.Exception e) {
  4085.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4086.                 this.logError(msgErrore);
  4087.                 throw new ProtocolException(msgErrore,e);
  4088.             }
  4089.         }
  4090.        
  4091.         return this.getSoapSecurityTokenPushReplyToUpdateOrCreate;
  4092.     }
  4093.    
  4094.     private Boolean getSoapSecurityTokenPushReplyToUpdate = null;
  4095.     public boolean isSoapSecurityTokenPushReplyToUpdateInErogazione() throws ProtocolException{
  4096.         if(this.getSoapSecurityTokenPushReplyToUpdate==null){
  4097.             String name = "org.openspcoop2.protocol.modipa.soap.push.replyTo.header.update";
  4098.             try{  
  4099.                 String value = this.reader.getValueConvertEnvProperties(name);
  4100.                
  4101.                 if (value != null){
  4102.                     value = value.trim();
  4103.                     this.getSoapSecurityTokenPushReplyToUpdate = Boolean.valueOf(value);
  4104.                 }
  4105.                 else {
  4106.                     throw newProtocolExceptionPropertyNonDefinita();
  4107.                 }
  4108.                
  4109.             }catch(java.lang.Exception e) {
  4110.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4111.                 this.logError(msgErrore);
  4112.                 throw new ProtocolException(msgErrore,e);
  4113.             }
  4114.         }
  4115.        
  4116.         return this.getSoapSecurityTokenPushReplyToUpdate;
  4117.     }
  4118.    
  4119.     private Boolean getSoapSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists = null;
  4120.     public boolean isSoapSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists() throws ProtocolException{
  4121.         if(this.getSoapSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists==null){
  4122.             String name = "org.openspcoop2.protocol.modipa.soap.push.request.correlationId.header.useTransactionIdIfNotExists";
  4123.             try{  
  4124.                 String value = this.reader.getValueConvertEnvProperties(name);
  4125.                
  4126.                 if (value != null){
  4127.                     value = value.trim();
  4128.                     this.getSoapSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists = Boolean.valueOf(value);
  4129.                 }
  4130.                 else {
  4131.                     throw newProtocolExceptionPropertyNonDefinita();
  4132.                 }
  4133.                
  4134.             }catch(java.lang.Exception e) {
  4135.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4136.                 this.logError(msgErrore);
  4137.                 throw new ProtocolException(msgErrore,e);
  4138.             }
  4139.         }
  4140.        
  4141.         return this.getSoapSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists;
  4142.     }
  4143.    
  4144.     private Boolean getSoapSecurityTokenPullCorrelationIdUseTransactionIdIfNotExists = null;
  4145.     public boolean isSoapSecurityTokenPullCorrelationIdUseTransactionIdIfNotExists() throws ProtocolException{
  4146.         if(this.getSoapSecurityTokenPullCorrelationIdUseTransactionIdIfNotExists==null){
  4147.             String name = "org.openspcoop2.protocol.modipa.soap.pull.request.correlationId.header.useTransactionIdIfNotExists";
  4148.             try{  
  4149.                 String value = this.reader.getValueConvertEnvProperties(name);
  4150.                
  4151.                 if (value != null){
  4152.                     value = value.trim();
  4153.                     this.getSoapSecurityTokenPullCorrelationIdUseTransactionIdIfNotExists = Boolean.valueOf(value);
  4154.                 }
  4155.                 else {
  4156.                     throw newProtocolExceptionPropertyNonDefinita();
  4157.                 }
  4158.                
  4159.             }catch(java.lang.Exception e) {
  4160.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4161.                 this.logError(msgErrore);
  4162.                 throw new ProtocolException(msgErrore,e);
  4163.             }
  4164.         }
  4165.        
  4166.         return this.getSoapSecurityTokenPullCorrelationIdUseTransactionIdIfNotExists;
  4167.     }
  4168.    
  4169.    
  4170.    
  4171.    
  4172.     /* **** CONFIGURAZIONE **** */
  4173.    
  4174.     private Boolean isReadByPathBufferEnabled = null;
  4175.     public Boolean isReadByPathBufferEnabled(){
  4176.         if(this.isReadByPathBufferEnabled==null){
  4177.             String pName = "org.openspcoop2.protocol.modipa.readByPath.buffer";
  4178.             try{  
  4179.                 String value = this.reader.getValueConvertEnvProperties(pName);
  4180.                
  4181.                 if (value != null){
  4182.                     value = value.trim();
  4183.                     this.isReadByPathBufferEnabled = Boolean.parseBoolean(value);
  4184.                 }else{
  4185.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(pName, true));
  4186.                     this.isReadByPathBufferEnabled = true;
  4187.                 }

  4188.             }catch(java.lang.Exception e) {
  4189.                 this.logWarn(getMessaggioErroreProprietaNonImpostata(pName, true)+getSuffixErrore(e));
  4190.                 this.isReadByPathBufferEnabled = true;
  4191.             }
  4192.         }
  4193.        
  4194.         return this.isReadByPathBufferEnabled;
  4195.     }
  4196.    
  4197.     private Boolean isValidazioneBufferEnabled = null;
  4198.     public Boolean isValidazioneBufferEnabled(){
  4199.         if(this.isValidazioneBufferEnabled==null){
  4200.             String pName = "org.openspcoop2.protocol.modipa.validazione.buffer";
  4201.             try{  
  4202.                 String value = this.reader.getValueConvertEnvProperties(pName);
  4203.                
  4204.                 if (value != null){
  4205.                     value = value.trim();
  4206.                     this.isValidazioneBufferEnabled = Boolean.parseBoolean(value);
  4207.                 }else{
  4208.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(pName, true));
  4209.                     this.isValidazioneBufferEnabled = true;
  4210.                 }

  4211.             }catch(java.lang.Exception e) {
  4212.                 this.logWarn(getMessaggioErroreProprietaNonImpostata(pName, true)+getSuffixErrore(e));
  4213.                 this.isValidazioneBufferEnabled = true;
  4214.             }
  4215.         }
  4216.        
  4217.         return this.isValidazioneBufferEnabled;
  4218.     }
  4219.    
  4220.     /**
  4221.      * Restituisce l'indicazione se la funzionalita' 'Riferimento ID Richiesta' richiede che venga fornito obbligatoriamente l'informazione sull'identificativo della richiesta tramite i meccanismi di integrazione
  4222.      *
  4223.      * @return True se la funzionalita' 'Riferimento ID Richiesta' richiede che venga fornito obbligatoriamente l'informazione sull'identificativo della richiesta tramite i meccanismi di integrazione
  4224.      *
  4225.      */
  4226.     private Boolean isRiferimentoIDRichiestaPortaDelegataRequired= null;
  4227.     private Boolean isRiferimentoIDRichiestaPortaDelegataRequiredRead= null;
  4228.     public Boolean isRiferimentoIDRichiestaPortaDelegataRequired(){
  4229.         if(this.isRiferimentoIDRichiestaPortaDelegataRequiredRead==null){
  4230.             try{  
  4231.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.pd.riferimentoIdRichiesta.required");
  4232.                
  4233.                 if (value != null){
  4234.                     value = value.trim();
  4235.                     this.isRiferimentoIDRichiestaPortaDelegataRequired = Boolean.parseBoolean(value);
  4236.                 }else{
  4237.                     this.logDebug(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.pd.riferimentoIdRichiesta.required", true));
  4238.                     this.isRiferimentoIDRichiestaPortaDelegataRequired = true;
  4239.                 }
  4240.                
  4241.                 this.isRiferimentoIDRichiestaPortaDelegataRequiredRead = true;
  4242.                
  4243.             }catch(java.lang.Exception e) {
  4244.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.pd.riferimentoIdRichiesta.required' non impostata, viene utilizzato il default 'true', errore:"+e.getMessage());
  4245.                 this.isRiferimentoIDRichiestaPortaDelegataRequired = true;
  4246.                
  4247.                 this.isRiferimentoIDRichiestaPortaDelegataRequiredRead = true;
  4248.             }
  4249.         }
  4250.        
  4251.         return this.isRiferimentoIDRichiestaPortaDelegataRequired;
  4252.     }
  4253.    
  4254.     private Boolean isRiferimentoIDRichiestaPortaApplicativaRequired= null;
  4255.     private Boolean isRiferimentoIDRichiestaPortaApplicativaRequiredRead= null;
  4256.     public Boolean isRiferimentoIDRichiestaPortaApplicativaRequired(){
  4257.         if(this.isRiferimentoIDRichiestaPortaApplicativaRequiredRead==null){
  4258.             try{  
  4259.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.pa.riferimentoIdRichiesta.required");
  4260.                
  4261.                 if (value != null){
  4262.                     value = value.trim();
  4263.                     this.isRiferimentoIDRichiestaPortaApplicativaRequired = Boolean.parseBoolean(value);
  4264.                 }else{
  4265.                     this.logDebug(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.pa.riferimentoIdRichiesta.required", true));
  4266.                     this.isRiferimentoIDRichiestaPortaApplicativaRequired = true;
  4267.                 }
  4268.                
  4269.                 this.isRiferimentoIDRichiestaPortaApplicativaRequiredRead = true;
  4270.                
  4271.             }catch(java.lang.Exception e) {
  4272.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.pa.riferimentoIdRichiesta.required' non impostata, viene utilizzato il default 'true', errore:"+e.getMessage());
  4273.                 this.isRiferimentoIDRichiestaPortaApplicativaRequired = true;
  4274.                
  4275.                 this.isRiferimentoIDRichiestaPortaApplicativaRequiredRead = true;
  4276.             }
  4277.         }
  4278.        
  4279.         return this.isRiferimentoIDRichiestaPortaApplicativaRequired;
  4280.     }
  4281.    
  4282.     private Boolean isTokenOAuthUseJtiIntegrityAsMessageId= null;
  4283.     private Boolean isTokenOAuthUseJtiIntegrityAsMessageIdRead= null;
  4284.     public Boolean isTokenOAuthUseJtiIntegrityAsMessageId(){
  4285.         if(this.isTokenOAuthUseJtiIntegrityAsMessageIdRead==null){
  4286.             String pName = "org.openspcoop2.protocol.modipa.tokenOAuthIntegrity.useJtiIntegrityAsMessageId";
  4287.             try{  
  4288.                 String value = this.reader.getValueConvertEnvProperties(pName);
  4289.                
  4290.                 if (value != null){
  4291.                     value = value.trim();
  4292.                     this.isTokenOAuthUseJtiIntegrityAsMessageId = Boolean.parseBoolean(value);
  4293.                 }else{
  4294.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(pName, true));
  4295.                     this.isTokenOAuthUseJtiIntegrityAsMessageId = true;
  4296.                 }
  4297.                
  4298.                 this.isTokenOAuthUseJtiIntegrityAsMessageIdRead = true;
  4299.                
  4300.             }catch(java.lang.Exception e) {
  4301.                 this.logWarn("Proprietà '"+pName+"' non impostata, viene utilizzato il default 'true', errore:"+e.getMessage());
  4302.                 this.isTokenOAuthUseJtiIntegrityAsMessageId = true;
  4303.                
  4304.                 this.isTokenOAuthUseJtiIntegrityAsMessageIdRead = true;
  4305.             }
  4306.         }
  4307.        
  4308.         return this.isTokenOAuthUseJtiIntegrityAsMessageId;
  4309.     }
  4310.    
  4311.    

  4312.     /* **** SOAP FAULT (Protocollo, Porta Applicativa) **** */
  4313.    
  4314.     /**
  4315.      * Indicazione se ritornare un soap fault personalizzato nel codice/actor/faultString per i messaggi di errore di protocollo (Porta Applicativa)
  4316.      *  
  4317.      * @return Indicazione se ritornare un soap fault personalizzato nel codice/actor/faultString per i messaggi di errore di protocollo (Porta Applicativa)
  4318.      *
  4319.      */
  4320.     private Boolean isPortaApplicativaBustaErrorePersonalizzaElementiFault= null;
  4321.     private Boolean isPortaApplicativaBustaErrorePersonalizzaElementiFaultRead= null;
  4322.     public Boolean isPortaApplicativaBustaErrorePersonalizzaElementiFault(){
  4323.         if(this.isPortaApplicativaBustaErrorePersonalizzaElementiFaultRead==null){
  4324.             try{  
  4325.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.pa.bustaErrore.personalizzaElementiFault");
  4326.                
  4327.                 if (value != null){
  4328.                     value = value.trim();
  4329.                     this.isPortaApplicativaBustaErrorePersonalizzaElementiFault = Boolean.parseBoolean(value);
  4330.                 }else{
  4331.                     this.logDebug("Proprietà 'org.openspcoop2.protocol.modipa.pa.bustaErrore.personalizzaElementiFault' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultApplicativo.enrichDetails)");
  4332.                     this.isPortaApplicativaBustaErrorePersonalizzaElementiFault = null;
  4333.                 }
  4334.                
  4335.                 this.isPortaApplicativaBustaErrorePersonalizzaElementiFaultRead = true;
  4336.                
  4337.             }catch(java.lang.Exception e) {
  4338.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.pa.bustaErrore.personalizzaElementiFault' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultApplicativo.enrichDetails), errore:"+e.getMessage());
  4339.                 this.isPortaApplicativaBustaErrorePersonalizzaElementiFault = null;
  4340.                
  4341.                 this.isPortaApplicativaBustaErrorePersonalizzaElementiFaultRead = true;
  4342.             }
  4343.         }
  4344.        
  4345.         return this.isPortaApplicativaBustaErrorePersonalizzaElementiFault;
  4346.     }
  4347.    
  4348.    
  4349.     /**
  4350.      * Indicazione se deve essere aggiunto un errore-applicativo nei details di un messaggio di errore di protocollo (Porta Applicativa)
  4351.      *  
  4352.      * @return Indicazione se deve essere aggiunto un errore-applicativo nei details di un messaggio di errore di protocollo (Porta Applicativa)
  4353.      *
  4354.      */
  4355.     private Boolean isPortaApplicativaBustaErroreAggiungiErroreApplicativo= null;
  4356.     private Boolean isPortaApplicativaBustaErroreAggiungiErroreApplicativoRead= null;
  4357.     public Boolean isPortaApplicativaBustaErroreAggiungiErroreApplicativo(){
  4358.         if(this.isPortaApplicativaBustaErroreAggiungiErroreApplicativoRead==null){
  4359.             try{  
  4360.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.pa.bustaErrore.aggiungiErroreApplicativo");
  4361.                
  4362.                 if (value != null){
  4363.                     value = value.trim();
  4364.                     this.isPortaApplicativaBustaErroreAggiungiErroreApplicativo = Boolean.parseBoolean(value);
  4365.                 }else{
  4366.                     this.logDebug("Proprietà 'org.openspcoop2.protocol.modipa.pa.bustaErrore.aggiungiErroreApplicativo' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultApplicativo.enrichDetails)");
  4367.                     this.isPortaApplicativaBustaErroreAggiungiErroreApplicativo = null;
  4368.                 }
  4369.                
  4370.                 this.isPortaApplicativaBustaErroreAggiungiErroreApplicativoRead = true;
  4371.                
  4372.             }catch(java.lang.Exception e) {
  4373.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.pa.bustaErrore.aggiungiErroreApplicativo' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultApplicativo.enrichDetails), errore:"+e.getMessage());
  4374.                 this.isPortaApplicativaBustaErroreAggiungiErroreApplicativo = null;
  4375.                
  4376.                 this.isPortaApplicativaBustaErroreAggiungiErroreApplicativoRead = true;
  4377.             }
  4378.         }
  4379.        
  4380.         return this.isPortaApplicativaBustaErroreAggiungiErroreApplicativo;
  4381.     }
  4382.    
  4383.     /**
  4384.      * Indicazione se generare i details in caso di SOAPFault *_001 (senza buste Errore)
  4385.      *  
  4386.      * @return Indicazione se generare i details in caso di SOAPFault *_001 (senza buste Errore)
  4387.      *
  4388.      */
  4389.     private Boolean isGenerazioneDetailsSOAPFaultProtocolValidazione = null;
  4390.     public boolean isGenerazioneDetailsSOAPFaultProtocolValidazione(){
  4391.         if(this.isGenerazioneDetailsSOAPFaultProtocolValidazione==null){
  4392.             try{  
  4393.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.eccezioneIntestazione");
  4394.                
  4395.                 if (value != null){
  4396.                     value = value.trim();
  4397.                     this.isGenerazioneDetailsSOAPFaultProtocolValidazione = Boolean.parseBoolean(value);
  4398.                 }else{
  4399.                     this.logWarn(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.eccezioneIntestazione", false));
  4400.                     this.isGenerazioneDetailsSOAPFaultProtocolValidazione = false;
  4401.                 }
  4402.                
  4403.             }catch(java.lang.Exception e) {
  4404.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.eccezioneIntestazione' non impostata, viene utilizzato il default=false, errore:"+e.getMessage());
  4405.                 this.isGenerazioneDetailsSOAPFaultProtocolValidazione = false;
  4406.             }
  4407.         }
  4408.        
  4409.         return this.isGenerazioneDetailsSOAPFaultProtocolValidazione;
  4410.     }
  4411.    
  4412.     /**
  4413.      * Indicazione se generare i details in caso di SOAPFault *_300
  4414.      *  
  4415.      * @return Indicazione se generare i details in caso di SOAPFault *_300
  4416.      *
  4417.      */
  4418.     private Boolean isGenerazioneDetailsSOAPFaultProtocolProcessamento = null;
  4419.     public boolean isGenerazioneDetailsSOAPFaultProtocolProcessamento(){
  4420.         if(this.isGenerazioneDetailsSOAPFaultProtocolProcessamento==null){
  4421.             try{  
  4422.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.eccezioneProcessamento");
  4423.                
  4424.                 if (value != null){
  4425.                     value = value.trim();
  4426.                     this.isGenerazioneDetailsSOAPFaultProtocolProcessamento = Boolean.parseBoolean(value);
  4427.                 }else{
  4428.                     this.logWarn(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.eccezioneProcessamento", true));
  4429.                     this.isGenerazioneDetailsSOAPFaultProtocolProcessamento = true;
  4430.                 }
  4431.                
  4432.             }catch(java.lang.Exception e) {
  4433.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.eccezioneProcessamento' non impostata, viene utilizzato il default=true, errore:"+e.getMessage());
  4434.                 this.isGenerazioneDetailsSOAPFaultProtocolProcessamento = true;
  4435.             }
  4436.         }
  4437.        
  4438.         return this.isGenerazioneDetailsSOAPFaultProtocolProcessamento;
  4439.     }
  4440.    
  4441.    
  4442.     /**
  4443.      * Indicazione se generare nei details in caso di SOAPFault *_300 lo stack trace
  4444.      *  
  4445.      * @return Indicazione se generare nei details in caso di SOAPFault *_300 lo stack trace
  4446.      *
  4447.      */
  4448.     private Boolean isGenerazioneDetailsSOAPFaultProtocolWithStackTrace = null;
  4449.     public boolean isGenerazioneDetailsSOAPFaultProtocolWithStackTrace(){
  4450.         if(this.isGenerazioneDetailsSOAPFaultProtocolWithStackTrace==null){
  4451.             try{  
  4452.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.stackTrace");
  4453.                
  4454.                 if (value != null){
  4455.                     value = value.trim();
  4456.                     this.isGenerazioneDetailsSOAPFaultProtocolWithStackTrace = Boolean.parseBoolean(value);
  4457.                 }else{
  4458.                     this.logWarn(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.stackTrace", false));
  4459.                     this.isGenerazioneDetailsSOAPFaultProtocolWithStackTrace = false;
  4460.                 }
  4461.                
  4462.             }catch(java.lang.Exception e) {
  4463.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.stackTrace' non impostata, viene utilizzato il default=false, errore:"+e.getMessage());
  4464.                 this.isGenerazioneDetailsSOAPFaultProtocolWithStackTrace = false;
  4465.             }
  4466.         }
  4467.        
  4468.         return this.isGenerazioneDetailsSOAPFaultProtocolWithStackTrace;
  4469.     }
  4470.    
  4471.     /**
  4472.      * Indicazione se generare nei details in caso di SOAPFault informazioni generiche
  4473.      *  
  4474.      * @return Indicazione se generare nei details in caso di SOAPFault informazioni generiche
  4475.      *
  4476.      */
  4477.     private Boolean isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche = null;
  4478.     public boolean isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche(){
  4479.         if(this.isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche==null){
  4480.             try{  
  4481.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.informazioniGeneriche");
  4482.                
  4483.                 if (value != null){
  4484.                     value = value.trim();
  4485.                     this.isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche = Boolean.parseBoolean(value);
  4486.                 }else{
  4487.                     this.logWarn(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.informazioniGeneriche", true));
  4488.                     this.isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche = true;
  4489.                 }
  4490.                
  4491.             }catch(java.lang.Exception e) {
  4492.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.informazioniGeneriche' non impostata, viene utilizzato il default=true, errore:"+e.getMessage());
  4493.                 this.isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche = true;
  4494.             }
  4495.         }
  4496.        
  4497.         return this.isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche;
  4498.     }
  4499.    
  4500.    
  4501.    
  4502.     /* **** SOAP FAULT (Integrazione, Porta Delegata) **** */
  4503.    
  4504.     /**
  4505.      * Indicazione se generare i details in Casi di errore 5XX
  4506.      *  
  4507.      * @return Indicazione se generare i details in Casi di errore 5XX
  4508.      *
  4509.      */
  4510.     private Boolean isGenerazioneDetailsSOAPFaultIntegrationServerError = null;
  4511.     public boolean isGenerazioneDetailsSOAPFaultIntegrationServerError(){
  4512.         if(this.isGenerazioneDetailsSOAPFaultIntegrationServerError==null){
  4513.             try{  
  4514.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.serverError");
  4515.                
  4516.                 if (value != null){
  4517.                     value = value.trim();
  4518.                     this.isGenerazioneDetailsSOAPFaultIntegrationServerError = Boolean.parseBoolean(value);
  4519.                 }else{
  4520.                     this.logWarn(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.serverError", true));
  4521.                     this.isGenerazioneDetailsSOAPFaultIntegrationServerError = true;
  4522.                 }
  4523.                
  4524.             }catch(java.lang.Exception e) {
  4525.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.serverError' non impostata, viene utilizzato il default=true, errore:"+e.getMessage());
  4526.                 this.isGenerazioneDetailsSOAPFaultIntegrationServerError = true;
  4527.             }
  4528.         }
  4529.        
  4530.         return this.isGenerazioneDetailsSOAPFaultIntegrationServerError;
  4531.     }
  4532.    
  4533.     /**
  4534.      * Indicazione se generare i details in Casi di errore 4XX
  4535.      *  
  4536.      * @return Indicazione se generare i details in Casi di errore 4XX
  4537.      *
  4538.      */
  4539.     private Boolean isGenerazioneDetailsSOAPFaultIntegrationClientError = null;
  4540.     public boolean isGenerazioneDetailsSOAPFaultIntegrationClientError(){
  4541.         if(this.isGenerazioneDetailsSOAPFaultIntegrationClientError==null){
  4542.             try{  
  4543.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.clientError");
  4544.                
  4545.                 if (value != null){
  4546.                     value = value.trim();
  4547.                     this.isGenerazioneDetailsSOAPFaultIntegrationClientError = Boolean.parseBoolean(value);
  4548.                 }else{
  4549.                     this.logWarn(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.clientError", false));
  4550.                     this.isGenerazioneDetailsSOAPFaultIntegrationClientError = false;
  4551.                 }
  4552.                
  4553.             }catch(java.lang.Exception e) {
  4554.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.clientError' non impostata, viene utilizzato il default=false, errore:"+e.getMessage());
  4555.                 this.isGenerazioneDetailsSOAPFaultIntegrationClientError = false;
  4556.             }
  4557.         }
  4558.        
  4559.         return this.isGenerazioneDetailsSOAPFaultIntegrationClientError;
  4560.     }
  4561.    
  4562.     /**
  4563.      * Indicazione se generare nei details lo stack trace all'interno
  4564.      *  
  4565.      * @return Indicazione se generare nei details lo stack trace all'interno
  4566.      *
  4567.      */
  4568.     private Boolean isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace = null;
  4569.     public boolean isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace(){
  4570.         if(this.isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace==null){
  4571.             try{  
  4572.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.stackTrace");
  4573.                
  4574.                 if (value != null){
  4575.                     value = value.trim();
  4576.                     this.isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace = Boolean.parseBoolean(value);
  4577.                 }else{
  4578.                     this.logWarn(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.stackTrace", false));
  4579.                     this.isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace = false;
  4580.                 }
  4581.                
  4582.             }catch(java.lang.Exception e) {
  4583.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.stackTrace' non impostata, viene utilizzato il default=false, errore:"+e.getMessage());
  4584.                 this.isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace = false;
  4585.             }
  4586.         }
  4587.        
  4588.         return this.isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace;
  4589.     }
  4590.    
  4591.     /**
  4592.      * Indicazione se generare nei details informazioni dettagliate o solo di carattere generale
  4593.      *  
  4594.      * @return Indicazione se generare nei details informazioni dettagliate o solo di carattere generale
  4595.      *
  4596.      */
  4597.     private Boolean isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGeneriche= null;
  4598.     private Boolean isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGenericheRead= null;
  4599.     public Boolean isGenerazioneDetailsSOAPFaultIntegrazionConInformazioniGeneriche(){
  4600.         if(this.isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGenericheRead==null){
  4601.             try{  
  4602.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.informazioniGeneriche");
  4603.                
  4604.                 if (value != null){
  4605.                     value = value.trim();
  4606.                     this.isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGeneriche = Boolean.parseBoolean(value);
  4607.                 }else{
  4608.                     this.logDebug("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.informazioniGeneriche' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultAsGenericCode)");
  4609.                     this.isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGeneriche = null;
  4610.                 }
  4611.                
  4612.                 this.isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGenericheRead = true;
  4613.                
  4614.             }catch(java.lang.Exception e) {
  4615.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.informazioniGeneriche' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultAsGenericCode), errore:"+e.getMessage());
  4616.                 this.isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGeneriche = null;
  4617.                
  4618.                 this.isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGenericheRead = true;
  4619.             }
  4620.         }
  4621.        
  4622.         return this.isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGeneriche;
  4623.     }
  4624.    
  4625.    
  4626.    
  4627.    
  4628.     /* **** SOAP FAULT (Generati dagli attori esterni) **** */
  4629.    
  4630.     /**
  4631.      * Indicazione se aggiungere un detail contenente descrizione dell'errore nel SoapFaultApplicativo originale
  4632.      *  
  4633.      * @return Indicazione se aggiungere un detail contenente descrizione dell'errore nel SoapFaultApplicativo originale
  4634.      *
  4635.      */
  4636.     private BooleanNullable isAggiungiDetailErroreApplicativoSoapFaultApplicativo= null;
  4637.     private Boolean isAggiungiDetailErroreApplicativoSoapFaultApplicativoRead= null;
  4638.     public BooleanNullable isAggiungiDetailErroreApplicativoSoapFaultApplicativo(){
  4639.         if(this.isAggiungiDetailErroreApplicativoSoapFaultApplicativoRead==null){
  4640.             try{  
  4641.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.erroreApplicativo.faultApplicativo.enrichDetails");
  4642.                
  4643.                 if (value != null){
  4644.                     value = value.trim();
  4645.                     Boolean b = Boolean.parseBoolean(value);
  4646.                     this.isAggiungiDetailErroreApplicativoSoapFaultApplicativo = b.booleanValue() ? BooleanNullable.TRUE() : BooleanNullable.FALSE();
  4647.                 }else{
  4648.                     this.logDebug("Proprietà 'org.openspcoop2.protocol.modipa.erroreApplicativo.faultApplicativo.enrichDetails' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultApplicativo.enrichDetails)");
  4649.                     this.isAggiungiDetailErroreApplicativoSoapFaultApplicativo = BooleanNullable.NULL();
  4650.                 }
  4651.                
  4652.                 this.isAggiungiDetailErroreApplicativoSoapFaultApplicativoRead = true;
  4653.                
  4654.             }catch(java.lang.Exception e) {
  4655.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.erroreApplicativo.faultApplicativo.enrichDetails' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultApplicativo.enrichDetails), errore:"+e.getMessage());
  4656.                 this.isAggiungiDetailErroreApplicativoSoapFaultApplicativo = BooleanNullable.NULL();
  4657.                
  4658.                 this.isAggiungiDetailErroreApplicativoSoapFaultApplicativoRead = true;
  4659.             }
  4660.         }
  4661.        
  4662.         return this.isAggiungiDetailErroreApplicativoSoapFaultApplicativo;
  4663.     }
  4664.    
  4665.     /**
  4666.      * Indicazione se aggiungere un detail contenente descrizione dell'errore nel SoapFaultPdD originale
  4667.      *  
  4668.      * @return Indicazione se aggiungere un detail contenente descrizione dell'errore nel SoapFaultPdD originale
  4669.      *
  4670.      */
  4671.     private BooleanNullable isAggiungiDetailErroreApplicativoSoapFaultPdD= null;
  4672.     private Boolean isAggiungiDetailErroreApplicativoSoapFaultPdDRead= null;
  4673.     public BooleanNullable isAggiungiDetailErroreApplicativoSoapFaultPdD(){
  4674.         if(this.isAggiungiDetailErroreApplicativoSoapFaultPdDRead==null){
  4675.             try{  
  4676.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.erroreApplicativo.faultPdD.enrichDetails");
  4677.                
  4678.                 if (value != null){
  4679.                     value = value.trim();
  4680.                     Boolean b = Boolean.parseBoolean(value);
  4681.                     this.isAggiungiDetailErroreApplicativoSoapFaultPdD = b.booleanValue() ? BooleanNullable.TRUE() : BooleanNullable.FALSE();
  4682.                 }else{
  4683.                     this.logDebug("Proprietà 'org.openspcoop2.protocol.modipa.erroreApplicativo.faultPdD.enrichDetails' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultPdD.enrichDetails)");
  4684.                     this.isAggiungiDetailErroreApplicativoSoapFaultPdD = BooleanNullable.NULL();
  4685.                 }
  4686.                
  4687.                 this.isAggiungiDetailErroreApplicativoSoapFaultPdDRead = true;
  4688.                
  4689.             }catch(java.lang.Exception e) {
  4690.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.erroreApplicativo.faultPdD.enrichDetails' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultPdD.enrichDetails), errore:"+e.getMessage());
  4691.                 this.isAggiungiDetailErroreApplicativoSoapFaultPdD = BooleanNullable.NULL();
  4692.                
  4693.                 this.isAggiungiDetailErroreApplicativoSoapFaultPdDRead = true;
  4694.             }
  4695.         }
  4696.        
  4697.         return this.isAggiungiDetailErroreApplicativoSoapFaultPdD;
  4698.     }

  4699.    
  4700.     /* **** Static instance config **** */
  4701.    
  4702.     private Boolean useConfigStaticInstance = null;
  4703.     private Boolean useConfigStaticInstance(){
  4704.         if(this.useConfigStaticInstance==null){
  4705.            
  4706.             Boolean defaultValue = true;
  4707.             String propertyName = "org.openspcoop2.protocol.modipa.factory.config.staticInstance";
  4708.            
  4709.             try{  
  4710.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  4711.                 if (value != null){
  4712.                     value = value.trim();
  4713.                     this.useConfigStaticInstance = Boolean.parseBoolean(value);
  4714.                 }else{
  4715.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  4716.                     this.useConfigStaticInstance = defaultValue;
  4717.                 }

  4718.             }catch(java.lang.Exception e) {
  4719.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  4720.                 this.useConfigStaticInstance = defaultValue;
  4721.             }
  4722.         }

  4723.         return this.useConfigStaticInstance;
  4724.     }
  4725.    
  4726.     private Boolean useErroreApplicativoStaticInstance = null;
  4727.     private Boolean useErroreApplicativoStaticInstance(){
  4728.         if(this.useErroreApplicativoStaticInstance==null){
  4729.            
  4730.             Boolean defaultValue = true;
  4731.             String propertyName = "org.openspcoop2.protocol.modipa.factory.erroreApplicativo.staticInstance";
  4732.            
  4733.             try{  
  4734.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  4735.                 if (value != null){
  4736.                     value = value.trim();
  4737.                     this.useErroreApplicativoStaticInstance = Boolean.parseBoolean(value);
  4738.                 }else{
  4739.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  4740.                     this.useErroreApplicativoStaticInstance = defaultValue;
  4741.                 }

  4742.             }catch(java.lang.Exception e) {
  4743.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  4744.                 this.useErroreApplicativoStaticInstance = defaultValue;
  4745.             }
  4746.         }

  4747.         return this.useErroreApplicativoStaticInstance;
  4748.     }
  4749.    
  4750.     private Boolean useEsitoStaticInstance = null;
  4751.     private Boolean useEsitoStaticInstance(){
  4752.         if(this.useEsitoStaticInstance==null){
  4753.            
  4754.             Boolean defaultValue = true;
  4755.             String propertyName = "org.openspcoop2.protocol.modipa.factory.esito.staticInstance";
  4756.            
  4757.             try{  
  4758.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  4759.                 if (value != null){
  4760.                     value = value.trim();
  4761.                     this.useEsitoStaticInstance = Boolean.parseBoolean(value);
  4762.                 }else{
  4763.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  4764.                     this.useEsitoStaticInstance = defaultValue;
  4765.                 }

  4766.             }catch(java.lang.Exception e) {
  4767.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  4768.                 this.useEsitoStaticInstance = defaultValue;
  4769.             }
  4770.         }

  4771.         return this.useEsitoStaticInstance;
  4772.     }
  4773.    
  4774.     private BasicStaticInstanceConfig staticInstanceConfig = null;
  4775.     public BasicStaticInstanceConfig getStaticInstanceConfig(){
  4776.         if(this.staticInstanceConfig==null){
  4777.             this.staticInstanceConfig = new BasicStaticInstanceConfig();
  4778.             if(useConfigStaticInstance()!=null) {
  4779.                 this.staticInstanceConfig.setStaticConfig(useConfigStaticInstance());
  4780.             }
  4781.             if(useErroreApplicativoStaticInstance()!=null) {
  4782.                 this.staticInstanceConfig.setStaticErrorBuilder(useErroreApplicativoStaticInstance());
  4783.             }
  4784.             if(useEsitoStaticInstance()!=null) {
  4785.                 this.staticInstanceConfig.setStaticEsitoBuilder(useEsitoStaticInstance());
  4786.             }
  4787.         }
  4788.         return this.staticInstanceConfig;
  4789.     }
  4790.    
  4791.    
  4792.     /* **** Signal Hub **** */
  4793.    
  4794.     private Boolean signalHubEnabled = null;
  4795.     public boolean isSignalHubEnabled(){
  4796.         if(this.signalHubEnabled==null){
  4797.            
  4798.             Boolean defaultValue =false;
  4799.             String propertyName = "org.openspcoop2.protocol.modipa.signalHub.enabled";
  4800.            
  4801.             try{  
  4802.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  4803.                 if (value != null){
  4804.                     value = value.trim();
  4805.                     this.signalHubEnabled = Boolean.parseBoolean(value);
  4806.                 }else{
  4807.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  4808.                     this.signalHubEnabled = defaultValue;
  4809.                 }

  4810.             }catch(java.lang.Exception e) {
  4811.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  4812.                 this.signalHubEnabled = defaultValue;
  4813.             }
  4814.         }

  4815.         return this.signalHubEnabled;
  4816.     }
  4817.    
  4818.     private List<String> signalHubAlgorithms= null;
  4819.     public List<String> getSignalHubAlgorithms() throws ProtocolException{
  4820.         if(this.signalHubAlgorithms==null){
  4821.            
  4822.             String propertyName = "org.openspcoop2.protocol.modipa.signalHub.algorithms";
  4823.             try{  
  4824.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  4825.                 this.signalHubAlgorithms = ModISecurityConfig.convertToList(value);
  4826.                 if(this.signalHubAlgorithms==null || this.signalHubAlgorithms.isEmpty()) {
  4827.                     throw new ProtocolException("SignalHub algorithms undefined");
  4828.                 }
  4829.             }catch(java.lang.Exception e) {
  4830.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  4831.                 throw new ProtocolException(e.getMessage(),e);
  4832.             }
  4833.         }
  4834.        
  4835.         return this.signalHubAlgorithms;
  4836.     }
  4837.    
  4838.     private String signalHubDefaultAlgorithm= null;
  4839.     public String getSignalHubDefaultAlgorithm() throws ProtocolException{
  4840.         if(this.signalHubDefaultAlgorithm==null){
  4841.             String name = "org.openspcoop2.protocol.modipa.signalHub.algorithms.default";
  4842.             try{  
  4843.                 String value = this.reader.getValueConvertEnvProperties(name);
  4844.                
  4845.                 if (value != null){
  4846.                     value = value.trim();
  4847.                     this.signalHubDefaultAlgorithm = value;
  4848.                 }
  4849.                 else {
  4850.                     throw newProtocolExceptionPropertyNonDefinita();
  4851.                 }
  4852.                
  4853.             }catch(java.lang.Exception e) {
  4854.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4855.                 this.logError(msgErrore);
  4856.                 throw new ProtocolException(msgErrore,e);
  4857.             }
  4858.         }
  4859.        
  4860.         return this.signalHubDefaultAlgorithm;
  4861.     }
  4862.    
  4863.     private List<Integer> signalHubSeedSize= null;
  4864.     public List<Integer> getSignalHubSeedSize() throws ProtocolException{
  4865.         if(this.signalHubSeedSize==null){
  4866.            
  4867.             String propertyName = "org.openspcoop2.protocol.modipa.signalHub.seed.size";
  4868.             try{  
  4869.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  4870.                 this.signalHubSeedSize = ModISecurityConfig.convertToList(value)
  4871.                         .stream()
  4872.                         .map(Integer::parseInt)
  4873.                         .collect(Collectors.toList());
  4874.                 if(this.signalHubSeedSize==null || this.signalHubSeedSize.isEmpty()) {
  4875.                     throw new ProtocolException("SignalHub algorithms undefined");
  4876.                 }
  4877.                 for (Integer s : this.signalHubSeedSize) {
  4878.                     validateSignalHubInteger("Signal Hub - Seed size",s);
  4879.                 }
  4880.             }catch(java.lang.Exception e) {
  4881.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  4882.                 throw new ProtocolException(e.getMessage(),e);
  4883.             }
  4884.         }
  4885.        
  4886.         return this.signalHubSeedSize;
  4887.     }
  4888.    
  4889.     private static void validateSignalHubInteger(String objectTitle, Integer i) throws ProtocolException {
  4890.         try {
  4891.             if(i<=0) {
  4892.                 throw new ProtocolException("must be a positive integer greater than 0");
  4893.             }
  4894.         }catch(Exception e) {
  4895.             throw new ProtocolException(objectTitle+" '"+i+"' invalid; must be a positive integer greater than 0");
  4896.         }
  4897.     }
  4898.    
  4899.     private Integer signalHubDefaultSeedSize= null;
  4900.     public Integer getSignalHubDefaultSeedSize() throws ProtocolException{
  4901.         if(this.signalHubDefaultSeedSize==null){
  4902.             String name = "org.openspcoop2.protocol.modipa.signalHub.seed.size.default";
  4903.             try{  
  4904.                 String value = this.reader.getValueConvertEnvProperties(name);
  4905.                
  4906.                 if (value != null){
  4907.                     Integer valueInt = Integer.parseInt(value.trim());
  4908.                     validateSignalHubInteger("Signal Hub - Default seed size", valueInt);
  4909.                     this.signalHubDefaultSeedSize = valueInt;
  4910.                 }
  4911.                 else {
  4912.                     throw newProtocolExceptionPropertyNonDefinita();
  4913.                 }
  4914.                
  4915.             }catch(java.lang.Exception e) {
  4916.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4917.                 this.logError(msgErrore);
  4918.                 throw new ProtocolException(msgErrore,e);
  4919.             }
  4920.         }
  4921.        
  4922.         return this.signalHubDefaultSeedSize;
  4923.     }
  4924.    
  4925.     private Boolean signalHubSeedLifetimeUnlimited = null;
  4926.     public boolean isSignalHubSeedLifetimeUnlimited(){
  4927.         if(this.signalHubSeedLifetimeUnlimited==null){
  4928.            
  4929.             Boolean defaultValue =false;
  4930.             String propertyName = "org.openspcoop2.protocol.modipa.signalHub.seed.lifetime.unlimited";
  4931.            
  4932.             try{  
  4933.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  4934.                 if (value != null){
  4935.                     value = value.trim();
  4936.                     this.signalHubSeedLifetimeUnlimited = Boolean.parseBoolean(value);
  4937.                 }else{
  4938.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  4939.                     this.signalHubSeedLifetimeUnlimited = defaultValue;
  4940.                 }

  4941.             }catch(java.lang.Exception e) {
  4942.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  4943.                 this.signalHubSeedLifetimeUnlimited = defaultValue;
  4944.             }
  4945.         }

  4946.         return this.signalHubSeedLifetimeUnlimited;
  4947.     }
  4948.    
  4949.     private Integer signalHubDefaultSeedLifetimeDaysDefault= null;
  4950.     public Integer getSignalHubDeSeedSeedLifetimeDaysDefault() throws ProtocolException{
  4951.         if(this.signalHubDefaultSeedLifetimeDaysDefault==null){
  4952.             String name = "org.openspcoop2.protocol.modipa.signalHub.seed.lifetime.days.default";
  4953.             try{  
  4954.                 String value = this.reader.getValueConvertEnvProperties(name);
  4955.                
  4956.                 if (value != null){
  4957.                     Integer valueInt = Integer.parseInt(value.trim());
  4958.                     validateSignalHubInteger("Signal Hub - Default lifetime days", valueInt);
  4959.                     this.signalHubDefaultSeedLifetimeDaysDefault = valueInt;
  4960.                 }
  4961.                 else {
  4962.                     throw newProtocolExceptionPropertyNonDefinita();
  4963.                 }
  4964.                
  4965.             }catch(java.lang.Exception e) {
  4966.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4967.                 this.logError(msgErrore);
  4968.                 throw new ProtocolException(msgErrore,e);
  4969.             }
  4970.         }
  4971.        
  4972.         return this.signalHubDefaultSeedLifetimeDaysDefault;
  4973.     }
  4974.    
  4975.     private String signalHubApiName= null;
  4976.     public String getSignalHubApiName() throws ProtocolException{
  4977.         if(this.signalHubApiName==null){
  4978.             String name = "org.openspcoop2.protocol.modipa.signalHub.api.name";
  4979.             try{  
  4980.                 String value = this.reader.getValueConvertEnvProperties(name);
  4981.                
  4982.                 if (value != null){
  4983.                     value = value.trim();
  4984.                     this.signalHubApiName = value;
  4985.                 }
  4986.                 else {
  4987.                     throw newProtocolExceptionPropertyNonDefinita();
  4988.                 }
  4989.                
  4990.             }catch(java.lang.Exception e) {
  4991.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4992.                 this.logError(msgErrore);
  4993.                 throw new ProtocolException(msgErrore,e);
  4994.             }
  4995.         }
  4996.        
  4997.         return this.signalHubApiName;
  4998.     }
  4999.    
  5000.     private Integer signalHubApiVersion= null;
  5001.     public int getSignalHubApiVersion() throws ProtocolException{
  5002.         if(this.signalHubApiVersion==null){
  5003.             String name = "org.openspcoop2.protocol.modipa.signalHub.api.version";
  5004.             try{  
  5005.                 String value = this.reader.getValueConvertEnvProperties(name);
  5006.                
  5007.                 if (value != null){
  5008.                     Integer valueInt = Integer.parseInt(value.trim());
  5009.                     validateSignalHubInteger("Signal Hub - API Version", valueInt);
  5010.                     this.signalHubApiVersion = valueInt;
  5011.                 }
  5012.                 else {
  5013.                     throw newProtocolExceptionPropertyNonDefinita();
  5014.                 }
  5015.                
  5016.             }catch(java.lang.Exception e) {
  5017.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  5018.                 this.logError(msgErrore);
  5019.                 throw new ProtocolException(msgErrore,e);
  5020.             }
  5021.         }
  5022.        
  5023.         return this.signalHubApiVersion;
  5024.     }
  5025.    
  5026.    
  5027.    
  5028.     private ModISignalHubConfig signalHubConfig = null;
  5029.     public ModISignalHubConfig getSignalHubConfig() throws ProtocolException{
  5030.         if(this.signalHubConfig==null){
  5031.             String propertyPrefix = "org.openspcoop2.protocol.modipa.signalHub";
  5032.             try{
  5033.                 String debugPrefix = "Param signal hub '"+propertyPrefix+"'";
  5034.                 Properties p = this.reader.readProperties(propertyPrefix+"."); // non devo convertire le properties poiche' possoono contenere ${ che useremo per la risoluzione dinamica
  5035.                 if(p==null || p.isEmpty()) {
  5036.                     throw new ProtocolException(debugPrefix+" non trovata");
  5037.                 }
  5038.                 this.signalHubConfig = new ModISignalHubConfig(propertyPrefix, p);
  5039.             }catch(java.lang.Exception e) {
  5040.                 this.logError(getMessaggioErroreProprietaNonCorretta(propertyPrefix, e));
  5041.                 throw new ProtocolException(e.getMessage(),e);
  5042.             }
  5043.         }
  5044.        
  5045.         return this.signalHubConfig;
  5046.     }
  5047.    
  5048.     private String signalHubHashCompose = null;
  5049.     public String getSignalHubHashCompose() throws ProtocolException{
  5050.         if(this.signalHubHashCompose==null){
  5051.             String name = "org.openspcoop2.protocol.modipa.signalHub.hash.composition";
  5052.             try{
  5053.                 String value = this.reader.getValue(name); // non devo convertire le properties poiche' possoono contenere ${ che useremo per la risoluzione dinamica
  5054.                 if(value == null || value.isBlank()) {
  5055.                     throw new ProtocolException(name + " non trovata");
  5056.                 }
  5057.                 this.signalHubHashCompose = value;
  5058.             }catch(java.lang.Exception e) {
  5059.                 this.logError(getMessaggioErroreProprietaNonCorretta(name, e));
  5060.                 throw new ProtocolException(e.getMessage(),e);
  5061.             }
  5062.         }
  5063.        
  5064.         return this.signalHubHashCompose;
  5065.     }
  5066.    
  5067.     private Integer signalHubDigestHistroy = null;
  5068.     public int getSignalHubDigestHistroy() throws ProtocolException{
  5069.         if(this.signalHubDigestHistroy==null){
  5070.             String name = "org.openspcoop2.protocol.modipa.signalHub.seed.history";
  5071.             try{
  5072.                 String rawValue = this.reader.getValue(name); // non devo convertire le properties poiche' possoono contenere ${ che useremo per la risoluzione dinamica
  5073.                 if(rawValue == null || rawValue.isBlank()) {
  5074.                    
  5075.                     throw new ProtocolException(name + " non trovata");
  5076.                 }
  5077.                 Integer value = Integer.valueOf(rawValue);
  5078.                 this.signalHubDigestHistroy = value;
  5079.             }catch(java.lang.Exception e) {
  5080.                 this.logError(getMessaggioErroreProprietaNonCorretta(name, e));
  5081.                 throw new ProtocolException(e.getMessage(),e);
  5082.             }
  5083.         }
  5084.        
  5085.         return this.signalHubDigestHistroy;
  5086.     }
  5087.    
  5088. }