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.     private static final String PREFIX_PROPRIETA = "Proprietà '";
  62.     private static final String SUFFIX_NON_TROVATA = " non trovata";
  63.    
  64.     /* ********  F I E L D S  P R I V A T I  ******** */

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





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

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

  74.         if(log != null)
  75.             this.log = log;
  76.         else
  77.             this.log = LoggerWrapperFactory.getLogger("ModIProperties");

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

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

  98.     }

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

  105.         if(ModIProperties.modipaProperties==null)
  106.             ModIProperties.modipaProperties = new ModIProperties(confDir,log);  

  107.     }

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

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

  122.         return ModIProperties.modipaProperties;
  123.     }

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

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

  173.     public void validaConfigurazione(Loader loader) throws ProtocolException  {
  174.         try{  

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

  431.             this.getStaticInstanceConfig();
  432.            
  433.             /* **** TracingPDND **** */
  434.             isTracingPDNDEnabled();

  435.         }catch(java.lang.Exception e) {
  436.             String msg = "Riscontrato errore durante la validazione della proprieta' del protocollo modipa, "+e.getMessage();
  437.             this.logError(msg,e);
  438.             throw new ProtocolException(msg,e);
  439.         }
  440.     }


  441.     /**
  442.      * Esempio di read property
  443.      *  
  444.      * @return Valore della property
  445.      *
  446.      */
  447.     private Boolean generateIDasUUID = null;
  448.     public Boolean generateIDasUUID(){
  449.         if(this.generateIDasUUID==null){
  450.            
  451.             Boolean defaultValue = true;
  452.             String propertyName = "org.openspcoop2.protocol.modipa.id.uuid";
  453.            
  454.             try{  
  455.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  456.                 if (value != null){
  457.                     value = value.trim();
  458.                     this.generateIDasUUID = Boolean.parseBoolean(value);
  459.                 }else{
  460.                     this.logWarn(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  461.                     this.generateIDasUUID = defaultValue;
  462.                 }

  463.             }catch(java.lang.Exception e) {
  464.                 this.logWarn(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  465.                 this.generateIDasUUID = defaultValue;
  466.             }
  467.         }

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

  782.             }catch(java.lang.Exception e) {
  783.                 this.logError(getMessaggioErroreProprietaNonCorretta(pName, e));
  784.                 throw new ProtocolException(e.getMessage(),e);
  785.             }
  786.         }
  787.        
  788.         return this.remoteStoreConfig;
  789.     }
  790.     private void readRemoteStores(String value) throws UtilsException, ProtocolException, KeystoreException {
  791.         String [] tmp = value.split(",");
  792.         if(tmp!=null && tmp.length>0) {
  793.             for (String rsc : tmp) {
  794.                 rsc = rsc.trim();
  795.                
  796.                 String debugPrefix = "Configurazione per remoteStore '"+rsc+"'";
  797.                
  798.                 String propertyPrefix = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.remoteStore."+rsc+".";
  799.                 Properties p = this.reader.readPropertiesConvertEnvProperties(propertyPrefix);
  800.                 if(p==null || p.isEmpty()) {
  801.                     throw new ProtocolException(debugPrefix+SUFFIX_NON_TROVATA);
  802.                 }
  803.                 RemoteStoreConfig config = RemoteStoreConfigPropertiesUtils.read(p, null);
  804.                 forceBaseUrlPDNDEndsWithKeys(rsc, config);
  805.                 this.remoteStoreConfig.add(config);
  806.                
  807.                 readKeyType(p, debugPrefix, config);
  808.             }
  809.         }
  810.     }
  811.     private void forceBaseUrlPDNDEndsWithKeys(String rsc, RemoteStoreConfig config) {
  812.         if(isForceBaseUrlPDNDEndsWithKeys(rsc)) {
  813.             String baseUrl = config.getBaseUrl();
  814.             config.setBaseUrl(normalizeBaseUrlApiPDNDKeys(baseUrl));
  815.            
  816.             if(config.getMultiTenantBaseUrl()!=null && !config.getMultiTenantBaseUrl().isEmpty()) {
  817.                 Map<String, String> multiTenantBaseUrlNormalized = new HashMap<>();
  818.                 for (Map.Entry<String,String> entry : config.getMultiTenantBaseUrl().entrySet()) {
  819.                     String baseUrlTenant = entry.getValue();
  820.                     multiTenantBaseUrlNormalized.put(entry.getKey(), normalizeBaseUrlApiPDNDKeys(baseUrlTenant));
  821.                 }
  822.                 config.setMultiTenantBaseUrl(multiTenantBaseUrlNormalized);
  823.             }
  824.         }
  825.     }
  826.     private String normalizeBaseUrlApiPDNDKeys(String baseUrl) {
  827.         if(!baseUrl.endsWith("/keys")) {
  828.             if(!baseUrl.endsWith("/")) {
  829.                 baseUrl+="/";
  830.             }
  831.             baseUrl+="keys";
  832.         }
  833.         return baseUrl;
  834.     }
  835.     private boolean isForceBaseUrlPDNDEndsWithKeys(String rsc) {
  836.         String propertyPrefix = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.remoteStore."+rsc+"."+
  837.                 RemoteStoreConfigPropertiesUtils.PROPERTY_STORE_URL+".forceEndsWithKeys";
  838.         try{  
  839.             boolean force = true;
  840.             String value = this.reader.getValueConvertEnvProperties(propertyPrefix);
  841.             if (value != null){
  842.                 value = value.trim();
  843.                 force = "false".equals(value);
  844.             }
  845.             return force;          
  846.         }catch(java.lang.Exception e) {
  847.             this.logWarn(PREFIX_PROPRIETA+propertyPrefix+"' non impostata; viene forzato il suffisso /keys");
  848.             return true;
  849.         }
  850.     }
  851.    
  852.     private void readKeyType(Properties p, String debugPrefix, RemoteStoreConfig config) throws ProtocolException {
  853.         String keyType = p.getProperty("keyType");
  854.         if(keyType!=null) {
  855.             keyType = keyType.trim();
  856.         }
  857.         if(keyType==null || StringUtils.isEmpty(keyType)) {
  858.             throw new ProtocolException(debugPrefix+" non completa; key type non indicato");
  859.         }
  860.         try {
  861.             RemoteKeyType rkt = RemoteKeyType.toEnumFromName(keyType);
  862.             if(rkt==null) {
  863.                 throw new ProtocolException("Non valido");
  864.             }
  865.             this.remoteStoreKeyTypeMap.put(config.getStoreName(), rkt);
  866.         }catch(Exception e) {
  867.             throw new ProtocolException(debugPrefix+" non completa; key type indicato '"+keyType+"' non valido",e);
  868.         }
  869.     }
  870.    
  871.     public boolean isRemoteStore(String name) throws ProtocolException {
  872.         return PDNDResolver.isRemoteStore(name, getRemoteStoreConfig());
  873.     }
  874.     public RemoteStoreConfig getRemoteStoreConfig(String name, IDSoggetto idDominio) throws ProtocolException {
  875.         return PDNDResolver.getRemoteStoreConfig(name, idDominio, getRemoteStoreConfig());
  876.     }
  877.     public RemoteStoreConfig getRemoteStoreConfigByTokenPolicy(String name, IDSoggetto idDominio) throws ProtocolException {
  878.         return PDNDResolver.getRemoteStoreConfigByTokenPolicy(name, idDominio, getRemoteStoreConfig());
  879.     }
  880.     // riferito in org.openspcoop2.protocol.utils.ModIUtils
  881.     // non modificare il nome
  882.     public RemoteKeyType getRemoteKeyType(String name) throws ProtocolException {
  883.         return getRemoteStoreKeyTypeMap().get(name);
  884.     }
  885.    
  886.    
  887.    
  888.     /* **** TOKEN OAUTH **** */
  889.    
  890.     private List<String> validazioneTokenOAuthClaimsRequired= null;
  891.     private List<String> getValidazioneTokenOAuthClaimsRequired() throws ProtocolException{
  892.         if(this.validazioneTokenOAuthClaimsRequired==null){
  893.             String propertyName = "org.openspcoop2.protocol.modipa.token.oauth.claims.required";
  894.             try{  
  895.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  896.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  897.                     this.validazioneTokenOAuthClaimsRequired = ModISecurityConfig.convertToList(value);
  898.                 }
  899.                 else {
  900.                     this.validazioneTokenOAuthClaimsRequired = new ArrayList<>();
  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.validazioneTokenOAuthClaimsRequired;
  909.     }
  910.     private Map<String,List<String>> validazioneTokenOAuthClaimsRequiredSoggetto = new HashMap<>();
  911.     public List<String> getValidazioneTokenOAuthClaimsRequired(String soggetto) throws ProtocolException{
  912.         if(!this.validazioneTokenOAuthClaimsRequiredSoggetto.containsKey(soggetto)){
  913.             String propertyName = "org.openspcoop2.protocol.modipa."+soggetto+".token.oauth.claims.required";
  914.             try{  
  915.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  916.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  917.                     this.validazioneTokenOAuthClaimsRequiredSoggetto.put(soggetto, ModISecurityConfig.convertToList(value));
  918.                 }
  919.                 else {
  920.                     this.validazioneTokenOAuthClaimsRequiredSoggetto.put(soggetto, getValidazioneTokenOAuthClaimsRequired());
  921.                 }
  922.             }catch(java.lang.Exception e) {
  923.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  924.                 throw new ProtocolException(e.getMessage(),e);
  925.             }
  926.         }
  927.        
  928.         return this.validazioneTokenOAuthClaimsRequiredSoggetto.get(soggetto);
  929.     }
  930.    
  931.    
  932.     private List<String> validazioneTokenPDNDClaimsRequired= null;
  933.     private List<String> getValidazioneTokenPDNDClaimsRequired() throws ProtocolException{
  934.         if(this.validazioneTokenPDNDClaimsRequired==null){
  935.             String propertyName = "org.openspcoop2.protocol.modipa.token.pdnd.claims.required";
  936.             try{  
  937.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  938.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  939.                     this.validazioneTokenPDNDClaimsRequired = ModISecurityConfig.convertToList(value);
  940.                 }
  941.                 else {
  942.                     this.validazioneTokenOAuthClaimsRequired = new ArrayList<>();
  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.validazioneTokenPDNDClaimsRequired;
  951.     }
  952.     private Map<String,List<String>> validazioneTokenPDNDClaimsRequiredSoggetto = new HashMap<>();
  953.     public List<String> getValidazioneTokenPDNDClaimsRequired(String soggetto) throws ProtocolException{
  954.         if(!this.validazioneTokenPDNDClaimsRequiredSoggetto.containsKey(soggetto)){
  955.             String propertyName = "org.openspcoop2.protocol.modipa."+soggetto+".token.pdnd.claims.required";
  956.             try{  
  957.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  958.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  959.                     this.validazioneTokenPDNDClaimsRequiredSoggetto.put(soggetto, ModISecurityConfig.convertToList(value));
  960.                 }
  961.                 else {
  962.                     this.validazioneTokenPDNDClaimsRequiredSoggetto.put(soggetto, getValidazioneTokenPDNDClaimsRequired());
  963.                 }
  964.             }catch(java.lang.Exception e) {
  965.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  966.                 throw new ProtocolException(e.getMessage(),e);
  967.             }
  968.         }
  969.        
  970.         return this.validazioneTokenPDNDClaimsRequiredSoggetto.get(soggetto);
  971.     }
  972.    
  973.     private static final String PREFIX_PROPERTY_MODIPA_PDND = "org.openspcoop2.protocol.modipa.pdnd.";
  974.    
  975.     private Boolean isValidazioneTokenPDNDProducerIdCheck= null;
  976.     private boolean isValidazioneTokenPDNDProducerIdCheck() throws ProtocolException{
  977.         if(this.isValidazioneTokenPDNDProducerIdCheck==null){
  978.             String propertyName = "org.openspcoop2.protocol.modipa.pdnd.producerId.check";
  979.             try{  
  980.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  981.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  982.                     this.isValidazioneTokenPDNDProducerIdCheck = Boolean.parseBoolean(value);
  983.                 }
  984.                 else {
  985.                     this.isValidazioneTokenPDNDProducerIdCheck = true;
  986.                 }
  987.             }catch(java.lang.Exception e) {
  988.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  989.                 throw new ProtocolException(e.getMessage(),e);
  990.             }
  991.         }
  992.        
  993.         return this.isValidazioneTokenPDNDProducerIdCheck;
  994.     }
  995.     private Map<String,Boolean> isValidazioneTokenPDNDProducerIdCheckSoggetto = new HashMap<>();
  996.     public boolean isValidazioneTokenPDNDProducerIdCheck(String soggetto) throws ProtocolException{
  997.         if(!this.isValidazioneTokenPDNDProducerIdCheckSoggetto.containsKey(soggetto)){
  998.             String propertyName = PREFIX_PROPERTY_MODIPA_PDND+soggetto+".producerId.check";
  999.             try{  
  1000.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1001.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  1002.                     this.isValidazioneTokenPDNDProducerIdCheckSoggetto.put(soggetto, Boolean.parseBoolean(value));
  1003.                 }
  1004.                 else {
  1005.                     this.isValidazioneTokenPDNDProducerIdCheckSoggetto.put(soggetto, isValidazioneTokenPDNDProducerIdCheck());
  1006.                 }
  1007.             }catch(java.lang.Exception e) {
  1008.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1009.                 throw new ProtocolException(e.getMessage(),e);
  1010.             }
  1011.         }
  1012.        
  1013.         return this.isValidazioneTokenPDNDProducerIdCheckSoggetto.get(soggetto);
  1014.     }
  1015.    
  1016.     private Boolean isPdndProducerIdCheckUnique = null;
  1017.     public boolean isPdndProducerIdCheckUnique(){
  1018.         if(this.isPdndProducerIdCheckUnique==null){
  1019.            
  1020.             Boolean defaultValue =false;
  1021.             String propertyName = "org.openspcoop2.protocol.modipa.pdnd.producerId.console.checkUnique";
  1022.            
  1023.             try{  
  1024.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1025.                 if (value != null){
  1026.                     value = value.trim();
  1027.                     this.isPdndProducerIdCheckUnique = Boolean.parseBoolean(value);
  1028.                 }else{
  1029.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1030.                     this.isPdndProducerIdCheckUnique = defaultValue;
  1031.                 }

  1032.             }catch(java.lang.Exception e) {
  1033.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1034.                 this.isPdndProducerIdCheckUnique = defaultValue;
  1035.             }
  1036.         }

  1037.         return this.isPdndProducerIdCheckUnique;
  1038.     }
  1039.    
  1040.    
  1041.    
  1042.     private Boolean isValidazioneTokenPDNDEServiceIdCheck= null;
  1043.     private boolean isValidazioneTokenPDNDEServiceIdCheck() throws ProtocolException{
  1044.         if(this.isValidazioneTokenPDNDEServiceIdCheck==null){
  1045.             String propertyName = "org.openspcoop2.protocol.modipa.pdnd.eServiceId.check";
  1046.             try{  
  1047.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1048.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  1049.                     this.isValidazioneTokenPDNDEServiceIdCheck = Boolean.parseBoolean(value);
  1050.                 }
  1051.                 else {
  1052.                     this.isValidazioneTokenPDNDEServiceIdCheck = true;
  1053.                 }
  1054.             }catch(java.lang.Exception e) {
  1055.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1056.                 throw new ProtocolException(e.getMessage(),e);
  1057.             }
  1058.         }
  1059.        
  1060.         return this.isValidazioneTokenPDNDEServiceIdCheck;
  1061.     }
  1062.     private Map<String,Boolean> isValidazioneTokenPDNDEServiceIdCheckSoggetto = new HashMap<>();
  1063.     public boolean isValidazioneTokenPDNDEServiceIdCheck(String soggetto) throws ProtocolException{
  1064.         if(!this.isValidazioneTokenPDNDEServiceIdCheckSoggetto.containsKey(soggetto)){
  1065.             String propertyName = PREFIX_PROPERTY_MODIPA_PDND+soggetto+".eServiceId.check";
  1066.             try{  
  1067.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1068.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  1069.                     this.isValidazioneTokenPDNDEServiceIdCheckSoggetto.put(soggetto, Boolean.parseBoolean(value));
  1070.                 }
  1071.                 else {
  1072.                     this.isValidazioneTokenPDNDEServiceIdCheckSoggetto.put(soggetto, isValidazioneTokenPDNDEServiceIdCheck());
  1073.                 }
  1074.             }catch(java.lang.Exception e) {
  1075.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1076.                 throw new ProtocolException(e.getMessage(),e);
  1077.             }
  1078.         }
  1079.        
  1080.         return this.isValidazioneTokenPDNDEServiceIdCheckSoggetto.get(soggetto);
  1081.     }
  1082.    
  1083.     private Boolean isPdndEServiceIdCheckUnique = null;
  1084.     public boolean isPdndEServiceIdCheckUnique(){
  1085.         if(this.isPdndEServiceIdCheckUnique==null){
  1086.            
  1087.             Boolean defaultValue =false;
  1088.             String propertyName = "org.openspcoop2.protocol.modipa.pdnd.eServiceId.console.checkUnique";
  1089.            
  1090.             try{  
  1091.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1092.                 if (value != null){
  1093.                     value = value.trim();
  1094.                     this.isPdndEServiceIdCheckUnique = Boolean.parseBoolean(value);
  1095.                 }else{
  1096.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1097.                     this.isPdndEServiceIdCheckUnique = defaultValue;
  1098.                 }

  1099.             }catch(java.lang.Exception e) {
  1100.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1101.                 this.isPdndEServiceIdCheckUnique = defaultValue;
  1102.             }
  1103.         }

  1104.         return this.isPdndEServiceIdCheckUnique;
  1105.     }
  1106.    
  1107.    
  1108.     private Boolean isValidazioneTokenPDNDDescriptorIdCheck= null;
  1109.     private boolean isValidazioneTokenPDNDDescriptorIdCheck() throws ProtocolException{
  1110.         if(this.isValidazioneTokenPDNDDescriptorIdCheck==null){
  1111.             String propertyName = "org.openspcoop2.protocol.modipa.pdnd.descriptorId.check";
  1112.             try{  
  1113.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1114.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  1115.                     this.isValidazioneTokenPDNDDescriptorIdCheck = Boolean.parseBoolean(value);
  1116.                 }
  1117.                 else {
  1118.                     this.isValidazioneTokenPDNDDescriptorIdCheck = true;
  1119.                 }
  1120.             }catch(java.lang.Exception e) {
  1121.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1122.                 throw new ProtocolException(e.getMessage(),e);
  1123.             }
  1124.         }
  1125.        
  1126.         return this.isValidazioneTokenPDNDDescriptorIdCheck;
  1127.     }
  1128.     private Map<String,Boolean> isValidazioneTokenPDNDDescriptorIdCheckSoggetto = new HashMap<>();
  1129.     public boolean isValidazioneTokenPDNDDescriptorIdCheck(String soggetto) throws ProtocolException{
  1130.         if(!this.isValidazioneTokenPDNDDescriptorIdCheckSoggetto.containsKey(soggetto)){
  1131.             String propertyName = PREFIX_PROPERTY_MODIPA_PDND+soggetto+".eServiceId.check";
  1132.             try{  
  1133.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1134.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  1135.                     this.isValidazioneTokenPDNDDescriptorIdCheckSoggetto.put(soggetto, Boolean.parseBoolean(value));
  1136.                 }
  1137.                 else {
  1138.                     this.isValidazioneTokenPDNDDescriptorIdCheckSoggetto.put(soggetto, isValidazioneTokenPDNDDescriptorIdCheck());
  1139.                 }
  1140.             }catch(java.lang.Exception e) {
  1141.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1142.                 throw new ProtocolException(e.getMessage(),e);
  1143.             }
  1144.         }
  1145.        
  1146.         return this.isValidazioneTokenPDNDDescriptorIdCheckSoggetto.get(soggetto);
  1147.     }
  1148.    
  1149.     private Boolean isPdndDescriptorIdCheckUnique = null;
  1150.     public boolean isPdndDescriptorIdCheckUnique(){
  1151.         if(this.isPdndDescriptorIdCheckUnique==null){
  1152.            
  1153.             Boolean defaultValue =false;
  1154.             String propertyName = "org.openspcoop2.protocol.modipa.pdnd.descriptorId.checkUnique";
  1155.            
  1156.             try{  
  1157.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1158.                 if (value != null){
  1159.                     value = value.trim();
  1160.                     this.isPdndDescriptorIdCheckUnique = Boolean.parseBoolean(value);
  1161.                 }else{
  1162.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1163.                     this.isPdndDescriptorIdCheckUnique = defaultValue;
  1164.                 }

  1165.             }catch(java.lang.Exception e) {
  1166.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1167.                 this.isPdndDescriptorIdCheckUnique = defaultValue;
  1168.             }
  1169.         }

  1170.         return this.isPdndDescriptorIdCheckUnique;
  1171.     }
  1172.    
  1173.    
  1174.    
  1175.     /* **** KEY STORE **** */
  1176.        
  1177.     // riferito in org.openspcoop2.protocol.utils.ModIUtils
  1178.     // non modificare il nome
  1179.     public KeystoreParams getSicurezzaMessaggioCertificatiKeyStore() throws ProtocolException {
  1180.         KeystoreParams params = null;
  1181.         String keystoreType = getSicurezzaMessaggioCertificatiKeyStoreTipo();
  1182.         if(keystoreType!=null) {
  1183.             params = new KeystoreParams();
  1184.             params.setType(keystoreType);
  1185.             params.setPath(getSicurezzaMessaggioCertificatiKeyStorePath());
  1186.             params.setPassword(getSicurezzaMessaggioCertificatiKeyPassword());
  1187.             params.setKeyAlias(getSicurezzaMessaggioCertificatiKeyAlias());
  1188.             params.setKeyPassword(getSicurezzaMessaggioCertificatiKeyPassword());
  1189.         }
  1190.         return params;
  1191.     }
  1192.    
  1193.     private String sicurezzaMessaggioCertificatiKeyStoreTipo= null;
  1194.     private Boolean sicurezzaMessaggioCertificatiKeyStoreTipoReaded= null;
  1195.     public String getSicurezzaMessaggioCertificatiKeyStoreTipo() {
  1196.         if(this.sicurezzaMessaggioCertificatiKeyStoreTipoReaded==null){
  1197.             try{  
  1198.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.keyStore.tipo");
  1199.                
  1200.                 if (value != null){
  1201.                     value = value.trim();
  1202.                     this.sicurezzaMessaggioCertificatiKeyStoreTipo = value;
  1203.                 }
  1204.                
  1205.                 this.sicurezzaMessaggioCertificatiKeyStoreTipoReaded = true;
  1206.                                
  1207.             }catch(java.lang.Exception e) {
  1208.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.keyStore.tipo' non impostata, errore:"+e.getMessage());
  1209.                 this.sicurezzaMessaggioCertificatiKeyStoreTipoReaded = true;
  1210.             }
  1211.         }
  1212.        
  1213.         return this.sicurezzaMessaggioCertificatiKeyStoreTipo;
  1214.     }  
  1215.    
  1216.     private String sicurezzaMessaggioCertificatiKeyStorePath= null;
  1217.     public String getSicurezzaMessaggioCertificatiKeyStorePath() throws ProtocolException{
  1218.         if(this.sicurezzaMessaggioCertificatiKeyStorePath==null){
  1219.             try{  
  1220.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.keyStore.path");
  1221.                
  1222.                 if (value != null){
  1223.                     value = value.trim();
  1224.                     this.sicurezzaMessaggioCertificatiKeyStorePath = value;
  1225.                 }
  1226.                 else {
  1227.                     throw newProtocolExceptionPropertyNonDefinita();
  1228.                 }
  1229.                
  1230.             }catch(java.lang.Exception e) {
  1231.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.keyStore.path' non impostata, errore:"+e.getMessage());
  1232.                 throw new ProtocolException(e.getMessage(),e);
  1233.             }
  1234.         }
  1235.        
  1236.         return this.sicurezzaMessaggioCertificatiKeyStorePath;
  1237.     }
  1238.    
  1239.     private String sicurezzaMessaggioCertificatiKeyStorePassword= null;
  1240.     public String getSicurezzaMessaggioCertificatiKeyStorePassword() throws ProtocolException{
  1241.         if(this.sicurezzaMessaggioCertificatiKeyStorePassword==null){
  1242.             try{  
  1243.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.keyStore.password");
  1244.                
  1245.                 if (value != null){
  1246.                     value = value.trim();
  1247.                     this.sicurezzaMessaggioCertificatiKeyStorePassword = value;
  1248.                 }
  1249.                 else {
  1250.                     throw newProtocolExceptionPropertyNonDefinita();
  1251.                 }
  1252.                
  1253.             }catch(java.lang.Exception e) {
  1254.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.keyStore.password' non impostata, errore:"+e.getMessage());
  1255.                 throw new ProtocolException(e.getMessage(),e);
  1256.             }
  1257.         }
  1258.        
  1259.         return this.sicurezzaMessaggioCertificatiKeyStorePassword;
  1260.     }  
  1261.    
  1262.     private String sicurezzaMessaggioCertificatiKeyAlias= null;
  1263.     public String getSicurezzaMessaggioCertificatiKeyAlias() throws ProtocolException{
  1264.         if(this.sicurezzaMessaggioCertificatiKeyAlias==null){
  1265.             try{  
  1266.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.key.alias");
  1267.                
  1268.                 if (value != null){
  1269.                     value = value.trim();
  1270.                     this.sicurezzaMessaggioCertificatiKeyAlias = value;
  1271.                 }
  1272.                 else {
  1273.                     throw newProtocolExceptionPropertyNonDefinita();
  1274.                 }
  1275.                
  1276.             }catch(java.lang.Exception e) {
  1277.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.key.alias' non impostata, errore:"+e.getMessage());
  1278.                 throw new ProtocolException(e.getMessage(),e);
  1279.             }
  1280.         }
  1281.        
  1282.         return this.sicurezzaMessaggioCertificatiKeyAlias;
  1283.     }  
  1284.    
  1285.     private String sicurezzaMessaggioCertificatiKeyPassword= null;
  1286.     public String getSicurezzaMessaggioCertificatiKeyPassword() throws ProtocolException{
  1287.         if(this.sicurezzaMessaggioCertificatiKeyPassword==null){
  1288.             try{  
  1289.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.key.password");
  1290.                
  1291.                 if (value != null){
  1292.                     value = value.trim();
  1293.                     this.sicurezzaMessaggioCertificatiKeyPassword = value;
  1294.                 }
  1295.                 else {
  1296.                     throw newProtocolExceptionPropertyNonDefinita();
  1297.                 }
  1298.                
  1299.             }catch(java.lang.Exception e) {
  1300.                 this.logError("Proprietà 'org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.key.password' non impostata, errore:"+e.getMessage());
  1301.                 throw new ProtocolException(e.getMessage(),e);
  1302.             }
  1303.         }
  1304.        
  1305.         return this.sicurezzaMessaggioCertificatiKeyPassword;
  1306.     }  
  1307.    
  1308.     private Boolean sicurezzaMessaggioCertificatiKeyClientIdRead = null;
  1309.     private String sicurezzaMessaggioCertificatiKeyClientId= null;
  1310.     public String getSicurezzaMessaggioCertificatiKeyClientId() throws ProtocolException{
  1311.         if(this.sicurezzaMessaggioCertificatiKeyClientIdRead==null){
  1312.             String pName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.key.clientId";
  1313.             try{  
  1314.                 String value = this.reader.getValueConvertEnvProperties(pName);
  1315.                
  1316.                 if (value != null){
  1317.                     value = value.trim();
  1318.                     if(StringUtils.isNotEmpty(value)) {
  1319.                         this.sicurezzaMessaggioCertificatiKeyClientId = value;
  1320.                     }
  1321.                 }

  1322.                 this.sicurezzaMessaggioCertificatiKeyClientIdRead = true;
  1323.                
  1324.             }catch(java.lang.Exception e) {
  1325.                 this.logError(getPrefixProprieta(pName)+"non impostata, errore:"+e.getMessage());
  1326.                 throw new ProtocolException(e.getMessage(),e);
  1327.             }
  1328.         }
  1329.        
  1330.         return this.sicurezzaMessaggioCertificatiKeyClientId;
  1331.     }
  1332.    
  1333.     private Boolean sicurezzaMessaggioCertificatiKeyKidRead = null;
  1334.     private String sicurezzaMessaggioCertificatiKeyKid= null;
  1335.     public String getSicurezzaMessaggioCertificatiKeyKid() throws ProtocolException{
  1336.         if(this.sicurezzaMessaggioCertificatiKeyKidRead==null){
  1337.             String pName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.certificati.key.kid";
  1338.             try{  
  1339.                 String value = this.reader.getValueConvertEnvProperties(pName);
  1340.                
  1341.                 if (value != null){
  1342.                     value = value.trim();
  1343.                     if(StringUtils.isNotEmpty(value)) {
  1344.                         this.sicurezzaMessaggioCertificatiKeyKid = value;
  1345.                     }
  1346.                 }

  1347.                 this.sicurezzaMessaggioCertificatiKeyKidRead = true;
  1348.                
  1349.             }catch(java.lang.Exception e) {
  1350.                 this.logError(getPrefixProprieta(pName)+"non impostata, errore:"+e.getMessage());
  1351.                 throw new ProtocolException(e.getMessage(),e);
  1352.             }
  1353.         }
  1354.        
  1355.         return this.sicurezzaMessaggioCertificatiKeyKid;
  1356.     }
  1357.    
  1358.    
  1359.    
  1360.    
  1361.     /* **** CORNICE SICUREZZA **** */
  1362.    
  1363.     private Boolean isSicurezzaMessaggioCorniceSicurezzaEnabled = null;
  1364.     public Boolean isSicurezzaMessaggioCorniceSicurezzaEnabled(){
  1365.         if(this.isSicurezzaMessaggioCorniceSicurezzaEnabled==null){
  1366.            
  1367.             Boolean defaultValue = false;
  1368.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza";
  1369.            
  1370.             try{  
  1371.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1372.                 if (value != null){
  1373.                     value = value.trim();
  1374.                     this.isSicurezzaMessaggioCorniceSicurezzaEnabled = Boolean.parseBoolean(value);
  1375.                 }else{
  1376.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1377.                     this.isSicurezzaMessaggioCorniceSicurezzaEnabled = defaultValue;
  1378.                 }

  1379.             }catch(java.lang.Exception e) {
  1380.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1381.                 this.isSicurezzaMessaggioCorniceSicurezzaEnabled = defaultValue;
  1382.             }
  1383.         }

  1384.         return this.isSicurezzaMessaggioCorniceSicurezzaEnabled;
  1385.     }
  1386.    
  1387.     private String sicurezzaMessaggioCorniceSicurezzaRestCodiceEnte= null;
  1388.     public String getSicurezzaMessaggioCorniceSicurezzaRestCodiceEnte() throws ProtocolException{
  1389.         if(this.sicurezzaMessaggioCorniceSicurezzaRestCodiceEnte==null){
  1390.            
  1391.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.rest.codice_ente";
  1392.             try{  
  1393.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1394.                
  1395.                 if (value != null){
  1396.                     value = value.trim();
  1397.                     this.sicurezzaMessaggioCorniceSicurezzaRestCodiceEnte = value;
  1398.                 }
  1399.                 else {
  1400.                     throw newProtocolExceptionPropertyNonDefinita();
  1401.                 }
  1402.                
  1403.             }catch(java.lang.Exception e) {
  1404.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1405.                 throw new ProtocolException(e.getMessage(),e);
  1406.             }
  1407.         }
  1408.        
  1409.         return this.sicurezzaMessaggioCorniceSicurezzaRestCodiceEnte;
  1410.     }
  1411.    
  1412.     private String sicurezzaMessaggioCorniceSicurezzaRestUser= null;
  1413.     public String getSicurezzaMessaggioCorniceSicurezzaRestUser() throws ProtocolException{
  1414.         if(this.sicurezzaMessaggioCorniceSicurezzaRestUser==null){
  1415.            
  1416.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.rest.user";
  1417.             try{  
  1418.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1419.                
  1420.                 if (value != null){
  1421.                     value = value.trim();
  1422.                     this.sicurezzaMessaggioCorniceSicurezzaRestUser = value;
  1423.                 }
  1424.                 else {
  1425.                     throw newProtocolExceptionPropertyNonDefinita();
  1426.                 }
  1427.                
  1428.             }catch(java.lang.Exception e) {
  1429.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1430.                 throw new ProtocolException(e.getMessage(),e);
  1431.             }
  1432.         }
  1433.        
  1434.         return this.sicurezzaMessaggioCorniceSicurezzaRestUser;
  1435.     }
  1436.    
  1437.     private String sicurezzaMessaggioCorniceSicurezzaRestIpuser= null;
  1438.     public String getSicurezzaMessaggioCorniceSicurezzaRestIpuser() throws ProtocolException{
  1439.         if(this.sicurezzaMessaggioCorniceSicurezzaRestIpuser==null){
  1440.            
  1441.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.rest.ipuser";
  1442.             try{  
  1443.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1444.                
  1445.                 if (value != null){
  1446.                     value = value.trim();
  1447.                     this.sicurezzaMessaggioCorniceSicurezzaRestIpuser = value;
  1448.                 }
  1449.                 else {
  1450.                     throw newProtocolExceptionPropertyNonDefinita();
  1451.                 }
  1452.                
  1453.             }catch(java.lang.Exception e) {
  1454.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1455.                 throw new ProtocolException(e.getMessage(),e);
  1456.             }
  1457.         }
  1458.        
  1459.         return this.sicurezzaMessaggioCorniceSicurezzaRestIpuser;
  1460.     }
  1461.    
  1462.     private String sicurezzaMessaggioCorniceSicurezzaSoapCodiceEnte= null;
  1463.     private Boolean sicurezzaMessaggioCorniceSicurezzaSoapCodiceEnteReaded= null;
  1464.     public String getSicurezzaMessaggioCorniceSicurezzaSoapCodiceEnte() throws ProtocolException{
  1465.         if(this.sicurezzaMessaggioCorniceSicurezzaSoapCodiceEnteReaded==null){
  1466.            
  1467.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.soap.codice_ente";
  1468.             try{  
  1469.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1470.                
  1471.                 if (value != null){
  1472.                     value = value.trim();
  1473.                     this.sicurezzaMessaggioCorniceSicurezzaSoapCodiceEnte = value;
  1474.                 }
  1475.                 // In soap il codice utente viene inserito anche in saml2:Subject
  1476. /**             else {
  1477. //                  throw newProtocolExceptionPropertyNonDefinita();
  1478. //              }*/
  1479.                
  1480.             }catch(java.lang.Exception e) {
  1481.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1482.                 throw new ProtocolException(e.getMessage(),e);
  1483.             }
  1484.            
  1485.             this.sicurezzaMessaggioCorniceSicurezzaSoapCodiceEnteReaded = true;
  1486.         }
  1487.        
  1488.         return this.sicurezzaMessaggioCorniceSicurezzaSoapCodiceEnte;
  1489.     }
  1490.    
  1491.     private String sicurezzaMessaggioCorniceSicurezzaSoapUser= null;
  1492.     public String getSicurezzaMessaggioCorniceSicurezzaSoapUser() throws ProtocolException{
  1493.         if(this.sicurezzaMessaggioCorniceSicurezzaSoapUser==null){
  1494.            
  1495.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.soap.user";
  1496.             try{  
  1497.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1498.                
  1499.                 if (value != null){
  1500.                     value = value.trim();
  1501.                     this.sicurezzaMessaggioCorniceSicurezzaSoapUser = value;
  1502.                 }
  1503.                 else {
  1504.                     throw newProtocolExceptionPropertyNonDefinita();
  1505.                 }
  1506.                
  1507.             }catch(java.lang.Exception e) {
  1508.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1509.                 throw new ProtocolException(e.getMessage(),e);
  1510.             }
  1511.         }
  1512.        
  1513.         return this.sicurezzaMessaggioCorniceSicurezzaSoapUser;
  1514.     }
  1515.    
  1516.     private String sicurezzaMessaggioCorniceSicurezzaSoapIpuser= null;
  1517.     public String getSicurezzaMessaggioCorniceSicurezzaSoapIpuser() throws ProtocolException{
  1518.         if(this.sicurezzaMessaggioCorniceSicurezzaSoapIpuser==null){
  1519.            
  1520.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.soap.ipuser";
  1521.             try{  
  1522.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  1523.                
  1524.                 if (value != null){
  1525.                     value = value.trim();
  1526.                     this.sicurezzaMessaggioCorniceSicurezzaSoapIpuser = value;
  1527.                 }
  1528.                 else {
  1529.                     throw newProtocolExceptionPropertyNonDefinita();
  1530.                 }
  1531.                
  1532.             }catch(java.lang.Exception e) {
  1533.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1534.                 throw new ProtocolException(e.getMessage(),e);
  1535.             }
  1536.         }
  1537.        
  1538.         return this.sicurezzaMessaggioCorniceSicurezzaSoapIpuser;
  1539.     }
  1540.    
  1541.     private List<String> sicurezzaMessaggioCorniceSicurezzaDynamicCodiceEnte= null;
  1542.     public List<String> getSicurezzaMessaggioCorniceSicurezzaDynamicCodiceEnte() throws ProtocolException{
  1543.         if(this.sicurezzaMessaggioCorniceSicurezzaDynamicCodiceEnte==null){
  1544.            
  1545.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.codice_ente";
  1546.             try{  
  1547.                 /**String value = this.reader.getValue_convertEnvProperties(propertyName);*/
  1548.                 String value = this.reader.getValue(propertyName); // contiene ${} da non risolvere
  1549.                 this.sicurezzaMessaggioCorniceSicurezzaDynamicCodiceEnte = ModISecurityConfig.convertToList(value);
  1550.             }catch(java.lang.Exception e) {
  1551.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1552.                 throw new ProtocolException(e.getMessage(),e);
  1553.             }
  1554.         }
  1555.        
  1556.         return this.sicurezzaMessaggioCorniceSicurezzaDynamicCodiceEnte;
  1557.     }
  1558.    
  1559.     private List<String> sicurezzaMessaggioCorniceSicurezzaDynamicUser= null;
  1560.     public List<String> getSicurezzaMessaggioCorniceSicurezzaDynamicUser() throws ProtocolException{
  1561.         if(this.sicurezzaMessaggioCorniceSicurezzaDynamicUser==null){
  1562.            
  1563.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.user";
  1564.             try{  
  1565.                 /**String value = this.reader.getValue_convertEnvProperties(propertyName);*/
  1566.                 String value = this.reader.getValue(propertyName); // contiene ${} da non risolvere
  1567.                 this.sicurezzaMessaggioCorniceSicurezzaDynamicUser = ModISecurityConfig.convertToList(value);
  1568.             }catch(java.lang.Exception e) {
  1569.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1570.                 throw new ProtocolException(e.getMessage(),e);
  1571.             }
  1572.         }
  1573.        
  1574.         return this.sicurezzaMessaggioCorniceSicurezzaDynamicUser;
  1575.     }
  1576.    
  1577.     private List<String> sicurezzaMessaggioCorniceSicurezzaDynamicIpuser= null;
  1578.     public List<String> getSicurezzaMessaggioCorniceSicurezzaDynamicIpuser() throws ProtocolException{
  1579.         if(this.sicurezzaMessaggioCorniceSicurezzaDynamicIpuser==null){
  1580.            
  1581.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.corniceSicurezza.ipuser";
  1582.             try{  
  1583.                 /**String value = this.reader.getValue_convertEnvProperties(propertyName);*/
  1584.                 String value = this.reader.getValue(propertyName); // contiene ${} da non risolvere
  1585.                 this.sicurezzaMessaggioCorniceSicurezzaDynamicIpuser = ModISecurityConfig.convertToList(value);
  1586.             }catch(java.lang.Exception e) {
  1587.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  1588.                 throw new ProtocolException(e.getMessage(),e);
  1589.             }
  1590.         }
  1591.        
  1592.         return this.sicurezzaMessaggioCorniceSicurezzaDynamicIpuser;
  1593.     }
  1594.    
  1595.    
  1596.    
  1597.    
  1598.    
  1599.     private List<ModIAuditConfig> auditConfig = null;
  1600.     public List<ModIAuditConfig> getAuditConfig() throws ProtocolException{
  1601.         if(this.auditConfig==null){
  1602.             String pName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.pattern";
  1603.             try{  
  1604.                 String value = this.reader.getValueConvertEnvProperties(pName);
  1605.                
  1606.                 if (value != null){
  1607.                     value = value.trim();
  1608.                    
  1609.                     this.auditConfig= new ArrayList<>();
  1610.                    
  1611.                     readAuditConf(value);
  1612.                    
  1613.                 }

  1614.             }catch(java.lang.Exception e) {
  1615.                 this.logError(getMessaggioErroreProprietaNonCorretta(pName, e));
  1616.                 throw new ProtocolException(e.getMessage(),e);
  1617.             }
  1618.         }
  1619.        
  1620.         return this.auditConfig;
  1621.     }
  1622.     private void readAuditConf(String value) throws UtilsException, ProtocolException {
  1623.         String [] tmp = value.split(",");
  1624.         if(tmp!=null && tmp.length>0) {
  1625.             for (String auditConf : tmp) {
  1626.                 auditConf = auditConf.trim();
  1627.                
  1628.                 String debugPrefix = "Pattern audit '"+auditConf+"'";
  1629.                
  1630.                 String propertyPrefix = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.pattern."+auditConf;
  1631.                 Properties p = this.reader.readProperties(propertyPrefix+"."); // non devo convertire le properties poiche' possoono contenere ${ che useremo per la risoluzione dinamica
  1632.                 if(p==null || p.isEmpty()) {
  1633.                     throw new ProtocolException(debugPrefix+SUFFIX_NON_TROVATA);
  1634.                 }
  1635.                 ModIAuditConfig config = new ModIAuditConfig(propertyPrefix, propertyPrefix, p);
  1636.                 this.auditConfig.add(config);
  1637.             }
  1638.         }
  1639.     }
  1640.    
  1641.     private String getSecurityTokenHeaderAudit= null;
  1642.     public String getSecurityTokenHeaderModIAudit() throws ProtocolException{
  1643.         if(this.getSecurityTokenHeaderAudit==null){
  1644.             String name = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.securityToken.header";
  1645.             try{  
  1646.                 String value = this.reader.getValueConvertEnvProperties(name);
  1647.                
  1648.                 if (value != null){
  1649.                     value = value.trim();
  1650.                     this.getSecurityTokenHeaderAudit = value;
  1651.                 }
  1652.                 else {
  1653.                     throw newProtocolExceptionPropertyNonDefinita();
  1654.                 }
  1655.                
  1656.             }catch(java.lang.Exception e) {
  1657.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  1658.                 this.logError(msgErrore);
  1659.                 throw new ProtocolException(msgErrore,e);
  1660.             }
  1661.         }
  1662.        
  1663.         return this.getSecurityTokenHeaderAudit;
  1664.     }
  1665.    
  1666.     private Boolean isSecurityTokenAuditX509AddKid = null;
  1667.     public boolean isSecurityTokenAuditX509AddKid(){
  1668.         if(this.isSecurityTokenAuditX509AddKid==null){
  1669.            
  1670.             boolean defaultValue = false;
  1671.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.x509.kid";
  1672.            
  1673.             try{  
  1674.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

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

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

  1687.         return this.isSecurityTokenAuditX509AddKid;
  1688.     }
  1689.    
  1690.     private Boolean isSecurityTokenAuditApiSoapX509RiferimentoX5c = null;
  1691.     public boolean isSecurityTokenAuditApiSoapX509RiferimentoX5c(){
  1692.         if(this.isSecurityTokenAuditApiSoapX509RiferimentoX5c==null){
  1693.            
  1694.             boolean defaultValue = true;
  1695.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.soap.x509.x5c";
  1696.            
  1697.             try{  
  1698.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

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

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

  1711.         return this.isSecurityTokenAuditApiSoapX509RiferimentoX5c;
  1712.     }
  1713.    
  1714.     private Boolean isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate = null;
  1715.     public boolean isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate(){
  1716.         if(this.isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate==null){
  1717.            
  1718.             boolean defaultValue = true;
  1719.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.soap.x509.x5c.singleCertificate";
  1720.            
  1721.             try{  
  1722.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1723.                 if (value != null){
  1724.                     value = value.trim();
  1725.                     this.isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate = Boolean.parseBoolean(value);
  1726.                 }else{
  1727.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1728.                     this.isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate = defaultValue;
  1729.                 }

  1730.             }catch(java.lang.Exception e) {
  1731.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1732.                 this.isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate = defaultValue;
  1733.             }
  1734.         }

  1735.         return this.isSecurityTokenAuditApiSoapX509RiferimentoX5cSingleCertificate;
  1736.     }
  1737.    
  1738.     private Boolean isSecurityTokenAuditApiSoapX509RiferimentoX5u = null;
  1739.     public boolean isSecurityTokenAuditApiSoapX509RiferimentoX5u(){
  1740.         if(this.isSecurityTokenAuditApiSoapX509RiferimentoX5u==null){
  1741.            
  1742.             boolean defaultValue = false;
  1743.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.soap.x509.x5u";
  1744.            
  1745.             try{  
  1746.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1747.                 if (value != null){
  1748.                     value = value.trim();
  1749.                     this.isSecurityTokenAuditApiSoapX509RiferimentoX5u = Boolean.parseBoolean(value);
  1750.                 }else{
  1751.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1752.                     this.isSecurityTokenAuditApiSoapX509RiferimentoX5u = defaultValue;
  1753.                 }

  1754.             }catch(java.lang.Exception e) {
  1755.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1756.                 this.isSecurityTokenAuditApiSoapX509RiferimentoX5u = defaultValue;
  1757.             }
  1758.         }

  1759.         return this.isSecurityTokenAuditApiSoapX509RiferimentoX5u;
  1760.     }
  1761.    
  1762.     private Boolean isSecurityTokenAuditApiSoapX509RiferimentoX5t = null;
  1763.     public boolean isSecurityTokenAuditApiSoapX509RiferimentoX5t(){
  1764.         if(this.isSecurityTokenAuditApiSoapX509RiferimentoX5t==null){
  1765.            
  1766.             boolean defaultValue = false;
  1767.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.soap.x509.x5t";
  1768.            
  1769.             try{  
  1770.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1771.                 if (value != null){
  1772.                     value = value.trim();
  1773.                     this.isSecurityTokenAuditApiSoapX509RiferimentoX5t = Boolean.parseBoolean(value);
  1774.                 }else{
  1775.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1776.                     this.isSecurityTokenAuditApiSoapX509RiferimentoX5t = defaultValue;
  1777.                 }

  1778.             }catch(java.lang.Exception e) {
  1779.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1780.                 this.isSecurityTokenAuditApiSoapX509RiferimentoX5t = defaultValue;
  1781.             }
  1782.         }

  1783.         return this.isSecurityTokenAuditApiSoapX509RiferimentoX5t;
  1784.     }
  1785.    
  1786.     private Boolean getSecurityTokenAuditProcessArrayModeReaded= null;
  1787.     private Boolean getSecurityTokenAuditProcessArrayModeEnabled= null;
  1788.     public boolean isSecurityTokenAuditProcessArrayModeEnabled() throws ProtocolException{
  1789.         if(this.getSecurityTokenAuditProcessArrayModeReaded==null){
  1790.             String name = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.audience.processArrayMode";
  1791.             try{  
  1792.                 String value = this.reader.getValueConvertEnvProperties(name);
  1793.                
  1794.                 if (value != null){
  1795.                     value = value.trim();
  1796.                     this.getSecurityTokenAuditProcessArrayModeEnabled = Boolean.valueOf(value);
  1797.                 }
  1798.                 else {
  1799.                     throw newProtocolExceptionPropertyNonDefinita();
  1800.                 }
  1801.                
  1802.             }catch(java.lang.Exception e) {
  1803.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  1804.                 this.logError(msgErrore);
  1805.                 throw new ProtocolException(msgErrore,e);
  1806.             }
  1807.            
  1808.             this.getSecurityTokenAuditProcessArrayModeReaded = true;
  1809.         }
  1810.        
  1811.         return this.getSecurityTokenAuditProcessArrayModeEnabled;
  1812.     }
  1813.    
  1814.     private Boolean isSecurityTokenAuditAddPurposeId = null;
  1815.     public boolean isSecurityTokenAuditAddPurposeId(){
  1816.         if(this.isSecurityTokenAuditAddPurposeId==null){
  1817.            
  1818.             boolean defaultValue = true;
  1819.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.addPurposeId";
  1820.            
  1821.             try{  
  1822.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1823.                 if (value != null){
  1824.                     value = value.trim();
  1825.                     this.isSecurityTokenAuditAddPurposeId = Boolean.parseBoolean(value);
  1826.                 }else{
  1827.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1828.                     this.isSecurityTokenAuditAddPurposeId = defaultValue;
  1829.                 }

  1830.             }catch(java.lang.Exception e) {
  1831.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1832.                 this.isSecurityTokenAuditAddPurposeId = defaultValue;
  1833.             }
  1834.         }

  1835.         return this.isSecurityTokenAuditAddPurposeId;
  1836.     }
  1837.    
  1838.     private Boolean isSecurityTokenAuditExpectedPurposeId = null;
  1839.     public boolean isSecurityTokenAuditExpectedPurposeId(){
  1840.         if(this.isSecurityTokenAuditExpectedPurposeId==null){
  1841.            
  1842.             boolean defaultValue = true;
  1843.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.expectedPurposeId";
  1844.            
  1845.             try{  
  1846.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1847.                 if (value != null){
  1848.                     value = value.trim();
  1849.                     this.isSecurityTokenAuditExpectedPurposeId = Boolean.parseBoolean(value);
  1850.                 }else{
  1851.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1852.                     this.isSecurityTokenAuditExpectedPurposeId = defaultValue;
  1853.                 }

  1854.             }catch(java.lang.Exception e) {
  1855.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1856.                 this.isSecurityTokenAuditExpectedPurposeId = defaultValue;
  1857.             }
  1858.         }

  1859.         return this.isSecurityTokenAuditExpectedPurposeId;
  1860.     }
  1861.    
  1862.     private Boolean isSecurityTokenAuditCompareAuthorizationPurposeId = null;
  1863.     public boolean isSecurityTokenAuditCompareAuthorizationPurposeId(){
  1864.         if(this.isSecurityTokenAuditCompareAuthorizationPurposeId==null){
  1865.            
  1866.             boolean defaultValue = true;
  1867.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.compareAuthorizationPurposeId";
  1868.            
  1869.             try{  
  1870.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1871.                 if (value != null){
  1872.                     value = value.trim();
  1873.                     this.isSecurityTokenAuditCompareAuthorizationPurposeId = Boolean.parseBoolean(value);
  1874.                 }else{
  1875.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1876.                     this.isSecurityTokenAuditCompareAuthorizationPurposeId = defaultValue;
  1877.                 }

  1878.             }catch(java.lang.Exception e) {
  1879.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1880.                 this.isSecurityTokenAuditCompareAuthorizationPurposeId = defaultValue;
  1881.             }
  1882.         }

  1883.         return this.isSecurityTokenAuditCompareAuthorizationPurposeId;
  1884.     }
  1885.    
  1886.     private Integer getSecurityTokenAuditDnonceSize = null;
  1887.     public int getSecurityTokenAuditDnonceSize(){
  1888.         if(this.getSecurityTokenAuditDnonceSize==null){
  1889.            
  1890.             int defaultValue = 13;
  1891.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.dnonce.size";
  1892.            
  1893.             try{  
  1894.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1895.                 if (value != null){
  1896.                     value = value.trim();
  1897.                     this.getSecurityTokenAuditDnonceSize = Integer.valueOf(value);
  1898.                 }else{
  1899.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1900.                     this.getSecurityTokenAuditDnonceSize = defaultValue;
  1901.                 }

  1902.             }catch(java.lang.Exception e) {
  1903.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1904.                 this.getSecurityTokenAuditDnonceSize = defaultValue;
  1905.             }
  1906.         }

  1907.         return this.getSecurityTokenAuditDnonceSize;
  1908.     }
  1909.    
  1910.     private String getSecurityTokenAuditDigestAlgorithm = null;
  1911.     public String getSecurityTokenAuditDigestAlgorithm(){
  1912.         if(this.getSecurityTokenAuditDigestAlgorithm==null){
  1913.            
  1914.             String defaultValue = Costanti.PDND_DIGEST_ALG_DEFAULT_VALUE;
  1915.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.digest.algo";
  1916.            
  1917.             try{  
  1918.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1919.                 if (value != null){
  1920.                     value = value.trim();
  1921.                     this.getSecurityTokenAuditDigestAlgorithm = value;
  1922.                 }else{
  1923.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1924.                     this.getSecurityTokenAuditDigestAlgorithm = defaultValue;
  1925.                 }

  1926.             }catch(java.lang.Exception e) {
  1927.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1928.                 this.getSecurityTokenAuditDigestAlgorithm = defaultValue;
  1929.             }
  1930.         }

  1931.         return this.getSecurityTokenAuditDigestAlgorithm;
  1932.     }
  1933.    
  1934.    
  1935.    
  1936.      /* **** CACHE **** */
  1937.    
  1938.     private Boolean isTokenAuthCacheable = null;
  1939.     public Boolean isTokenAuthCacheable(){
  1940.         if(this.isTokenAuthCacheable==null){
  1941.            
  1942.             Boolean defaultValue = true;
  1943.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.auth.cacheable";
  1944.            
  1945.             try{  
  1946.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1947.                 if (value != null){
  1948.                     value = value.trim();
  1949.                     this.isTokenAuthCacheable = Boolean.parseBoolean(value);
  1950.                 }else{
  1951.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1952.                     this.isTokenAuthCacheable = defaultValue;
  1953.                 }

  1954.             }catch(java.lang.Exception e) {
  1955.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1956.                 this.isTokenAuthCacheable = defaultValue;
  1957.             }
  1958.         }

  1959.         return this.isTokenAuthCacheable;
  1960.     }
  1961.    
  1962.     private Boolean isTokenAuditCacheable = null;
  1963.     public Boolean isTokenAuditCacheable(){
  1964.         if(this.isTokenAuditCacheable==null){
  1965.            
  1966.             Boolean defaultValue = true;
  1967.             String propertyName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.audit.cacheable";
  1968.            
  1969.             try{  
  1970.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  1971.                 if (value != null){
  1972.                     value = value.trim();
  1973.                     this.isTokenAuditCacheable = Boolean.parseBoolean(value);
  1974.                 }else{
  1975.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  1976.                     this.isTokenAuditCacheable = defaultValue;
  1977.                 }

  1978.             }catch(java.lang.Exception e) {
  1979.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  1980.                 this.isTokenAuditCacheable = defaultValue;
  1981.             }
  1982.         }

  1983.         return this.isTokenAuditCacheable;
  1984.     }
  1985.    
  1986.     private Integer isGestioneTokenCacheableRefreshTokenBeforeExpirePercent = null;
  1987.     private Boolean isGestioneTokenCacheableRefreshTokenBeforeExpirePercentRead = null;
  1988.     private String isGestioneTokenCacheableRefreshTokenBeforeExpirePercentPName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.cache.refreshTokenBeforeExpire.percent";
  1989.     public Integer getGestioneRetrieveTokenRefreshTokenBeforeExpirePercent(){

  1990.         if(this.isGestioneTokenCacheableRefreshTokenBeforeExpirePercentRead==null){
  1991.             try{  
  1992.                 String value = this.reader.getValueConvertEnvProperties(this.isGestioneTokenCacheableRefreshTokenBeforeExpirePercentPName);

  1993.                 if (value != null){
  1994.                     value = value.trim();
  1995.                     this.isGestioneTokenCacheableRefreshTokenBeforeExpirePercent = Integer.parseInt(value);
  1996.                 }
  1997.                
  1998.                 this.isGestioneTokenCacheableRefreshTokenBeforeExpirePercentRead=true;

  1999.             }catch(java.lang.Exception e) {
  2000.                 this.logError("Proprieta' di openspcoop '"+this.isGestioneTokenCacheableRefreshTokenBeforeExpirePercentPName+"' non impostata, errore:"+e.getMessage(),e);
  2001.                 this.isGestioneTokenCacheableRefreshTokenBeforeExpirePercent = null;
  2002.             }
  2003.         }

  2004.         return this.isGestioneTokenCacheableRefreshTokenBeforeExpirePercent;
  2005.     }
  2006.    
  2007.     private Integer sGestioneTokenCacheableRefreshTokenBeforeExpireSeconds = null;
  2008.     private Boolean sGestioneTokenCacheableRefreshTokenBeforeExpireSecondsRead = null;
  2009.     private String sGestioneTokenCacheableRefreshTokenBeforeExpireSecondsPName = "org.openspcoop2.protocol.modipa.sicurezzaMessaggio.cache.refreshTokenBeforeExpire.seconds";
  2010.     public Integer getGestioneRetrieveTokenRefreshTokenBeforeExpireSeconds(){

  2011.         if(this.sGestioneTokenCacheableRefreshTokenBeforeExpireSecondsRead==null){
  2012.             try{  
  2013.                 String value = this.reader.getValueConvertEnvProperties(this.sGestioneTokenCacheableRefreshTokenBeforeExpireSecondsPName);

  2014.                 if (value != null){
  2015.                     value = value.trim();
  2016.                     this.sGestioneTokenCacheableRefreshTokenBeforeExpireSeconds = Integer.parseInt(value);
  2017.                 }
  2018.                
  2019.                 this.sGestioneTokenCacheableRefreshTokenBeforeExpireSecondsRead=true;

  2020.             }catch(java.lang.Exception e) {
  2021.                 this.logError("Proprieta' di openspcoop '"+this.sGestioneTokenCacheableRefreshTokenBeforeExpireSecondsPName+"' non impostata, errore:"+e.getMessage(),e);
  2022.                 this.sGestioneTokenCacheableRefreshTokenBeforeExpireSeconds = null;
  2023.             }
  2024.         }

  2025.         return this.sGestioneTokenCacheableRefreshTokenBeforeExpireSeconds;
  2026.     }
  2027.    
  2028.    
  2029.    
  2030.     /* **** TRACCE **** */
  2031.    
  2032.     private Boolean isGenerazioneTracce = null;
  2033.     public Boolean isGenerazioneTracce(){
  2034.         if(this.isGenerazioneTracce==null){
  2035.            
  2036.             Boolean defaultValue = false;
  2037.             String propertyName = "org.openspcoop2.protocol.modipa.generazioneTracce.enabled";
  2038.            
  2039.             try{  
  2040.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  2041.                 if (value != null){
  2042.                     value = value.trim();
  2043.                     this.isGenerazioneTracce = Boolean.parseBoolean(value);
  2044.                 }else{
  2045.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  2046.                     this.isGenerazioneTracce = defaultValue;
  2047.                 }

  2048.             }catch(java.lang.Exception e) {
  2049.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  2050.                 this.isGenerazioneTracce = defaultValue;
  2051.             }
  2052.         }

  2053.         return this.isGenerazioneTracce;
  2054.     }
  2055.    
  2056.     private Boolean isGenerazioneTracceRegistraToken = null;
  2057.     public Boolean isGenerazioneTracceRegistraToken(){
  2058.         if(this.isGenerazioneTracceRegistraToken==null){
  2059.            
  2060.             Boolean defaultValue = false;
  2061.             String propertyName = "org.openspcoop2.protocol.modipa.generazioneTracce.registrazioneToken.enabled";
  2062.            
  2063.             try{  
  2064.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  2065.                 if (value != null){
  2066.                     value = value.trim();
  2067.                     this.isGenerazioneTracceRegistraToken = Boolean.parseBoolean(value);
  2068.                 }else{
  2069.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  2070.                     this.isGenerazioneTracceRegistraToken = defaultValue;
  2071.                 }

  2072.             }catch(java.lang.Exception e) {
  2073.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  2074.                 this.isGenerazioneTracceRegistraToken = defaultValue;
  2075.             }
  2076.         }

  2077.         return this.isGenerazioneTracceRegistraToken;
  2078.     }
  2079.    
  2080.     private Boolean isGenerazioneTracceRegistraCustomClaims = null;
  2081.     public boolean isGenerazioneTracceRegistraCustomClaims(){
  2082.         if(this.isGenerazioneTracceRegistraCustomClaims==null){
  2083.            
  2084.             Boolean defaultValue = false;
  2085.             String propertyName = "org.openspcoop2.protocol.modipa.generazioneTracce.registrazioneCustomClaims.enabled";
  2086.            
  2087.             try{  
  2088.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  2089.                 if (value != null){
  2090.                     value = value.trim();
  2091.                     this.isGenerazioneTracceRegistraCustomClaims = Boolean.parseBoolean(value);
  2092.                 }else{
  2093.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  2094.                     this.isGenerazioneTracceRegistraCustomClaims = defaultValue;
  2095.                 }

  2096.             }catch(java.lang.Exception e) {
  2097.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  2098.                 this.isGenerazioneTracceRegistraCustomClaims = defaultValue;
  2099.             }
  2100.         }

  2101.         return this.isGenerazioneTracceRegistraCustomClaims;
  2102.     }
  2103.    
  2104.     private List<String> getGenerazioneTracceRegistraCustomClaimsBlackList= null;
  2105.     public List<String> getGenerazioneTracceRegistraCustomClaimsBlackList() throws ProtocolException{
  2106.         if(this.getGenerazioneTracceRegistraCustomClaimsBlackList==null){
  2107.            
  2108.             String propertyName = "org.openspcoop2.protocol.modipa.generazioneTracce.registrazioneCustomClaims.blackList";
  2109.             try{  
  2110.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  2111.                 if(value!=null && StringUtils.isNotEmpty(value)) {
  2112.                     this.getGenerazioneTracceRegistraCustomClaimsBlackList = ModISecurityConfig.convertToList(value);
  2113.                 }
  2114.             }catch(java.lang.Exception e) {
  2115.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  2116.                 throw new ProtocolException(e.getMessage(),e);
  2117.             }
  2118.         }
  2119.        
  2120.         return this.getGenerazioneTracceRegistraCustomClaimsBlackList;
  2121.     }
  2122.    
  2123.    
  2124.    
  2125.    
  2126.     /* **** Nomenclatura **** */
  2127.    
  2128.     private Boolean isModIVersioneBozza = null;
  2129.     public Boolean isModIVersioneBozza(){
  2130.         if(this.isModIVersioneBozza==null){
  2131.            
  2132.             Boolean defaultValue = false;
  2133.             String propertyName = "org.openspcoop2.protocol.modipa.usaVersioneBozza";
  2134.            
  2135.             try{  
  2136.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  2137.                 if (value != null){
  2138.                     value = value.trim();
  2139.                     this.isModIVersioneBozza = Boolean.parseBoolean(value);
  2140.                 }else{
  2141.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  2142.                     this.isModIVersioneBozza = defaultValue;
  2143.                 }

  2144.             }catch(java.lang.Exception e) {
  2145.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  2146.                 this.isModIVersioneBozza = defaultValue;
  2147.             }
  2148.         }

  2149.         return this.isModIVersioneBozza;
  2150.     }
  2151.    
  2152.    
  2153.    
  2154.    
  2155.     /* **** REST **** */
  2156.    
  2157.     private String getRestSecurityTokenHeader= null;
  2158.     // riferito in org.openspcoop2.protocol.utils.ModIUtils
  2159.     // non modificare il nome
  2160.     public String getRestSecurityTokenHeaderModI() throws ProtocolException{
  2161.         if(this.getRestSecurityTokenHeader==null){
  2162.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.header";
  2163.             try{  
  2164.                 String value = this.reader.getValueConvertEnvProperties(name);
  2165.                
  2166.                 if (value != null){
  2167.                     value = value.trim();
  2168.                     this.getRestSecurityTokenHeader = value;
  2169.                 }
  2170.                 else {
  2171.                     throw newProtocolExceptionPropertyNonDefinita();
  2172.                 }
  2173.                
  2174.             }catch(java.lang.Exception e) {
  2175.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2176.                 this.logError(msgErrore);
  2177.                 throw new ProtocolException(msgErrore,e);
  2178.             }
  2179.         }
  2180.        
  2181.         return this.getRestSecurityTokenHeader;
  2182.     }
  2183.    
  2184.     private Boolean isSecurityTokenX509AddKid = null;
  2185.     public boolean isSecurityTokenX509AddKid(){
  2186.         if(this.isSecurityTokenX509AddKid==null){
  2187.            
  2188.             boolean defaultValue = false;
  2189.             String propertyName = "org.openspcoop2.protocol.modipa.rest.securityToken.x509.kid";
  2190.            
  2191.             try{  
  2192.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  2193.                 if (value != null){
  2194.                     value = value.trim();
  2195.                     this.isSecurityTokenX509AddKid = Boolean.parseBoolean(value);
  2196.                 }else{
  2197.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  2198.                     this.isSecurityTokenX509AddKid = defaultValue;
  2199.                 }

  2200.             }catch(java.lang.Exception e) {
  2201.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  2202.                 this.isSecurityTokenX509AddKid = defaultValue;
  2203.             }
  2204.         }

  2205.         return this.isSecurityTokenX509AddKid;
  2206.     }
  2207.    
  2208.     private Boolean isSecurityTokenIntegrity01AddPurposeId = null;
  2209.     public boolean isSecurityTokenIntegrity01AddPurposeId(){
  2210.         if(this.isSecurityTokenIntegrity01AddPurposeId==null){
  2211.            
  2212.             boolean defaultValue = false;
  2213.             String propertyName = "org.openspcoop2.protocol.modipa.rest.securityToken.integrity_01.addPurposeId";
  2214.            
  2215.             try{  
  2216.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  2217.                 if (value != null){
  2218.                     value = value.trim();
  2219.                     this.isSecurityTokenIntegrity01AddPurposeId = Boolean.parseBoolean(value);
  2220.                 }else{
  2221.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  2222.                     this.isSecurityTokenIntegrity01AddPurposeId = defaultValue;
  2223.                 }

  2224.             }catch(java.lang.Exception e) {
  2225.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  2226.                 this.isSecurityTokenIntegrity01AddPurposeId = defaultValue;
  2227.             }
  2228.         }

  2229.         return this.isSecurityTokenIntegrity01AddPurposeId;
  2230.     }
  2231.    
  2232.     private Boolean isSecurityTokenIntegrity02AddPurposeId = null;
  2233.     public boolean isSecurityTokenIntegrity02AddPurposeId(){
  2234.         if(this.isSecurityTokenIntegrity02AddPurposeId==null){
  2235.            
  2236.             boolean defaultValue = false;
  2237.             String propertyName = "org.openspcoop2.protocol.modipa.rest.securityToken.integrity_02.addPurposeId";
  2238.            
  2239.             try{  
  2240.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  2241.                 if (value != null){
  2242.                     value = value.trim();
  2243.                     this.isSecurityTokenIntegrity02AddPurposeId = Boolean.parseBoolean(value);
  2244.                 }else{
  2245.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  2246.                     this.isSecurityTokenIntegrity02AddPurposeId = defaultValue;
  2247.                 }

  2248.             }catch(java.lang.Exception e) {
  2249.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  2250.                 this.isSecurityTokenIntegrity02AddPurposeId = defaultValue;
  2251.             }
  2252.         }

  2253.         return this.isSecurityTokenIntegrity02AddPurposeId;
  2254.     }
  2255.    
  2256.     private Boolean getRestSecurityTokenClaimsIssuerEnabledReaded= null;
  2257.     private Boolean getRestSecurityTokenClaimsIssuerEnabled= null;
  2258.     public boolean isRestSecurityTokenClaimsIssuerEnabled() throws ProtocolException{
  2259.         if(this.getRestSecurityTokenClaimsIssuerEnabledReaded==null){
  2260.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.iss.enabled";
  2261.             try{  
  2262.                 String value = this.reader.getValueConvertEnvProperties(name);
  2263.                
  2264.                 if (value != null){
  2265.                     value = value.trim();
  2266.                     this.getRestSecurityTokenClaimsIssuerEnabled = Boolean.valueOf(value);
  2267.                 }
  2268.                 else {
  2269.                     throw newProtocolExceptionPropertyNonDefinita();
  2270.                 }
  2271.                
  2272.             }catch(java.lang.Exception e) {
  2273.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2274.                 this.logError(msgErrore);
  2275.                 throw new ProtocolException(msgErrore,e);
  2276.             }
  2277.            
  2278.             this.getRestSecurityTokenClaimsIssuerEnabledReaded = true;
  2279.         }
  2280.        
  2281.         return this.getRestSecurityTokenClaimsIssuerEnabled;
  2282.     }
  2283.     private Boolean getRestSecurityTokenClaimsIssuerHeaderValueReaded= null;
  2284.     private String getRestSecurityTokenClaimsIssuerHeaderValue= null;
  2285.     public String getRestSecurityTokenClaimsIssuerHeaderValue() throws ProtocolException{
  2286.         if(this.getRestSecurityTokenClaimsIssuerHeaderValueReaded==null){
  2287.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.iss";
  2288.             try{  
  2289.                 String value = this.reader.getValueConvertEnvProperties(name);
  2290.                
  2291.                 if (value != null){
  2292.                     value = value.trim();
  2293.                     this.getRestSecurityTokenClaimsIssuerHeaderValue = value;
  2294.                 }
  2295.                
  2296.             }catch(java.lang.Exception e) {
  2297.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2298.                 this.logError(msgErrore);
  2299.                 throw new ProtocolException(msgErrore,e);
  2300.             }
  2301.            
  2302.             this.getRestSecurityTokenClaimsIssuerHeaderValueReaded = true;
  2303.         }
  2304.        
  2305.         return this.getRestSecurityTokenClaimsIssuerHeaderValue;
  2306.     }
  2307.    
  2308.     private Boolean getRestSecurityTokenClaimsSubjectEnabledReaded= null;
  2309.     private Boolean getRestSecurityTokenClaimsSubjectEnabled= null;
  2310.     public boolean isRestSecurityTokenClaimsSubjectEnabled() throws ProtocolException{
  2311.         if(this.getRestSecurityTokenClaimsSubjectEnabledReaded==null){
  2312.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.sub.enabled";
  2313.             try{  
  2314.                 String value = this.reader.getValueConvertEnvProperties(name);
  2315.                
  2316.                 if (value != null){
  2317.                     value = value.trim();
  2318.                     this.getRestSecurityTokenClaimsSubjectEnabled = Boolean.valueOf(value);
  2319.                 }
  2320.                 else {
  2321.                     throw newProtocolExceptionPropertyNonDefinita();
  2322.                 }
  2323.                
  2324.             }catch(java.lang.Exception e) {
  2325.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2326.                 this.logError(msgErrore);
  2327.                 throw new ProtocolException(msgErrore,e);
  2328.             }
  2329.            
  2330.             this.getRestSecurityTokenClaimsSubjectEnabledReaded = true;
  2331.         }
  2332.        
  2333.         return this.getRestSecurityTokenClaimsSubjectEnabled;
  2334.     }
  2335.     private Boolean getRestSecurityTokenClaimsSubjectHeaderValueReaded= null;
  2336.     private String getRestSecurityTokenClaimsSubjectHeaderValue= null;
  2337.     public String getRestSecurityTokenClaimsSubjectHeaderValue() throws ProtocolException{
  2338.         if(this.getRestSecurityTokenClaimsSubjectHeaderValueReaded==null){
  2339.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.sub";
  2340.             try{  
  2341.                 String value = this.reader.getValueConvertEnvProperties(name);
  2342.                
  2343.                 if (value != null){
  2344.                     value = value.trim();
  2345.                     this.getRestSecurityTokenClaimsSubjectHeaderValue = value;
  2346.                 }
  2347.                
  2348.             }catch(java.lang.Exception e) {
  2349.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2350.                 this.logError(msgErrore);
  2351.                 throw new ProtocolException(msgErrore,e);
  2352.             }
  2353.            
  2354.             this.getRestSecurityTokenClaimsSubjectHeaderValueReaded = true;
  2355.         }
  2356.        
  2357.         return this.getRestSecurityTokenClaimsSubjectHeaderValue;
  2358.     }
  2359.    
  2360.     private String getRestSecurityTokenClaimsClientIdHeader= null;
  2361.     public String getRestSecurityTokenClaimsClientIdHeader() throws ProtocolException{
  2362.         if(this.getRestSecurityTokenClaimsClientIdHeader==null){
  2363.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.client_id";
  2364.             try{  
  2365.                 String value = this.reader.getValueConvertEnvProperties(name);
  2366.                
  2367.                 if (value != null){
  2368.                     value = value.trim();
  2369.                     this.getRestSecurityTokenClaimsClientIdHeader = value;
  2370.                 }
  2371.                 else {
  2372.                     throw newProtocolExceptionPropertyNonDefinita();
  2373.                 }
  2374.                
  2375.             }catch(java.lang.Exception e) {
  2376.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2377.                 this.logError(msgErrore);
  2378.                 throw new ProtocolException(msgErrore,e);
  2379.             }
  2380.         }
  2381.        
  2382.         return this.getRestSecurityTokenClaimsClientIdHeader;
  2383.     }
  2384.    
  2385.     private String getRestSecurityTokenClaimSignedHeaders= null;
  2386.     public String getRestSecurityTokenClaimSignedHeaders() throws ProtocolException{
  2387.         if(this.getRestSecurityTokenClaimSignedHeaders==null){
  2388.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.signedHeaders";
  2389.             try{  
  2390.                 String value = this.reader.getValueConvertEnvProperties(name);
  2391.                
  2392.                 if (value != null){
  2393.                     value = value.trim();
  2394.                     this.getRestSecurityTokenClaimSignedHeaders = value;
  2395.                 }
  2396.                 else {
  2397.                     throw newProtocolExceptionPropertyNonDefinita();
  2398.                 }
  2399.                
  2400.             }catch(java.lang.Exception e) {
  2401.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2402.                 this.logError(msgErrore);
  2403.                 throw new ProtocolException(msgErrore,e);
  2404.             }
  2405.         }
  2406.        
  2407.         return this.getRestSecurityTokenClaimSignedHeaders;
  2408.     }
  2409.    
  2410.    
  2411.     private String getRestSecurityTokenClaimRequestDigest= null;
  2412.     public String getRestSecurityTokenClaimRequestDigest() throws ProtocolException{
  2413.         if(this.getRestSecurityTokenClaimRequestDigest==null){
  2414.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.requestDigest";
  2415.             try{  
  2416.                 String value = this.reader.getValueConvertEnvProperties(name);
  2417.                
  2418.                 if (value != null){
  2419.                     value = value.trim();
  2420.                     this.getRestSecurityTokenClaimRequestDigest = value;
  2421.                 }
  2422.                 else {
  2423.                     throw newProtocolExceptionPropertyNonDefinita();
  2424.                 }
  2425.                
  2426.             }catch(java.lang.Exception e) {
  2427.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2428.                 this.logError(msgErrore);
  2429.                 throw new ProtocolException(msgErrore,e);
  2430.             }
  2431.         }
  2432.        
  2433.         return this.getRestSecurityTokenClaimRequestDigest;
  2434.     }
  2435.    
  2436.    
  2437.     private String [] getRestSecurityTokenSignedHeaders = null;
  2438.     public String [] getRestSecurityTokenSignedHeaders() throws ProtocolException{
  2439.         if(this.getRestSecurityTokenSignedHeaders==null){
  2440.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.signedHeaders";
  2441.             try{  
  2442.                 String value = this.reader.getValueConvertEnvProperties(name);
  2443.                
  2444.                 if (value != null){
  2445.                     value = value.trim();
  2446.                     String [] tmp = value.split(",");
  2447.                     this.getRestSecurityTokenSignedHeaders = new String[tmp.length];
  2448.                     for (int i = 0; i < tmp.length; i++) {
  2449.                         this.getRestSecurityTokenSignedHeaders[i] = tmp[i].trim();
  2450.                     }
  2451.                 }
  2452.                 else {
  2453.                     throw newProtocolExceptionPropertyNonDefinita();
  2454.                 }
  2455.                
  2456.             }catch(java.lang.Exception e) {
  2457.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2458.                 this.logError(msgErrore);
  2459.                 throw new ProtocolException(msgErrore,e);
  2460.             }
  2461.         }
  2462.        
  2463.         return this.getRestSecurityTokenSignedHeaders;
  2464.     }
  2465.     public String  getRestSecurityTokenSignedHeadersAsString() {
  2466.         StringBuilder bf = new StringBuilder();
  2467.         for (String hdr : this.getRestSecurityTokenSignedHeaders) {
  2468.             if(bf.length()>0) {
  2469.                 bf.append(",");
  2470.             }
  2471.             bf.append(hdr);
  2472.         }
  2473.         return bf.toString();
  2474.     }
  2475.    
  2476.     private Boolean getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMillisecondsReaded = null;
  2477.     private Long getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMilliseconds = null;
  2478.     public Long getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMilliseconds() throws ProtocolException{

  2479.         if(this.getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMillisecondsReaded==null){
  2480.            
  2481.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.iat.future.toleranceMilliseconds";
  2482.             try{  
  2483.                 String value = this.reader.getValueConvertEnvProperties(name);

  2484.                 if (value != null){
  2485.                     value = value.trim();
  2486.                     long tmp = Long.parseLong(value);
  2487.                     if(tmp>0) {
  2488.                         long maxLongValue = Long.MAX_VALUE;
  2489.                         if(tmp>maxLongValue) {
  2490.                             this.logWarn(getPrefixValoreIndicatoProprieta(value,name)+getSuffixSuperioreMassimoConsentitoControlloDisabilitato(maxLongValue));
  2491.                         }
  2492.                         else {
  2493.                             this.getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMilliseconds = tmp;
  2494.                         }
  2495.                     }
  2496.                     else {
  2497.                         this.logWarn(getMessaggioVerificaDisabilitata(name));
  2498.                     }
  2499.                 }
  2500.             }catch(java.lang.Exception e) {
  2501.                 this.logError(getMessaggioErroreProprietaNonImpostata(name, e),e);
  2502.                 throw new ProtocolException(e.getMessage(),e);
  2503.             }
  2504.            
  2505.             this.getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMillisecondsReaded = true;
  2506.         }

  2507.         return this.getRestSecurityTokenClaimsIatTimeCheckFutureToleranceMilliseconds;
  2508.     }
  2509.    
  2510.     private Boolean getRestSecurityTokenClaimsIatTimeCheckMillisecondsReaded = null;
  2511.     private Long getRestSecurityTokenClaimsIatTimeCheckMilliseconds = null;
  2512.     public Long getRestSecurityTokenClaimsIatTimeCheckMilliseconds() throws ProtocolException{

  2513.         if(this.getRestSecurityTokenClaimsIatTimeCheckMillisecondsReaded==null){
  2514.            
  2515.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.iat.minutes";
  2516.             try{  
  2517.                 String value = this.reader.getValueConvertEnvProperties(name);

  2518.                 if (value != null){
  2519.                     value = value.trim();
  2520.                     long tmp = Long.parseLong(value); // minuti
  2521.                     if(tmp>0) {
  2522.                         long maxLongValue = ((Long.MAX_VALUE)/60000l);
  2523.                         if(tmp>maxLongValue) {
  2524.                             this.logWarn(getPrefixValoreIndicatoProprieta(value,name)+getSuffixSuperioreMassimoConsentitoControlloDisabilitato(maxLongValue));
  2525.                         }
  2526.                         else {
  2527.                             this.getRestSecurityTokenClaimsIatTimeCheckMilliseconds = tmp * 60 * 1000;
  2528.                         }
  2529.                     }
  2530.                     else {
  2531.                         this.logWarn(getMessaggioVerificaDisabilitata(name));
  2532.                     }
  2533.                 }
  2534.             }catch(java.lang.Exception e) {
  2535.                 this.logError(getMessaggioErroreProprietaNonImpostata(name, e),e);
  2536.                 throw new ProtocolException(e.getMessage(),e);
  2537.             }
  2538.            
  2539.             this.getRestSecurityTokenClaimsIatTimeCheckMillisecondsReaded = true;
  2540.         }

  2541.         return this.getRestSecurityTokenClaimsIatTimeCheckMilliseconds;
  2542.     }
  2543.    
  2544.     private Boolean isRestSecurityTokenClaimsExpTimeCheck= null;
  2545.     public boolean isRestSecurityTokenClaimsExpTimeCheck() throws ProtocolException{
  2546.         if(this.isRestSecurityTokenClaimsExpTimeCheck==null){
  2547.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.exp.checkEnabled";
  2548.             try{  
  2549.                 String value = this.reader.getValueConvertEnvProperties(name);
  2550.                
  2551.                 if (value != null){
  2552.                     value = value.trim();
  2553.                     this.isRestSecurityTokenClaimsExpTimeCheck = Boolean.valueOf(value);
  2554.                 }
  2555.                 else {
  2556.                     throw newProtocolExceptionPropertyNonDefinita();
  2557.                 }
  2558.                
  2559.             }catch(java.lang.Exception e) {
  2560.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2561.                 this.logError(msgErrore);
  2562.                 throw new ProtocolException(msgErrore,e);
  2563.             }
  2564.            
  2565.         }
  2566.        
  2567.         return this.isRestSecurityTokenClaimsExpTimeCheck;
  2568.     }  
  2569.    
  2570.     private Boolean getRestSecurityTokenClaimsExpTimeCheckToleranceMillisecondsReaded = null;
  2571.     private Long getRestSecurityTokenClaimsExpTimeCheckToleranceMilliseconds = null;
  2572.     public Long getRestSecurityTokenClaimsExpTimeCheckToleranceMilliseconds() throws ProtocolException{

  2573.         if(this.getRestSecurityTokenClaimsExpTimeCheckToleranceMillisecondsReaded==null){
  2574.            
  2575.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.exp.toleranceMilliseconds";
  2576.             try{  
  2577.                 String value = this.reader.getValueConvertEnvProperties(name);

  2578.                 if (value != null){
  2579.                     value = value.trim();
  2580.                     long tmp = Long.parseLong(value); // già in millisecondi
  2581.                     if(tmp>0) {
  2582.                         long maxLongValue = Long.MAX_VALUE;
  2583.                         if(tmp>maxLongValue) {
  2584.                             this.logWarn(getPrefixValoreIndicatoProprieta(value,name)+getSuffixSuperioreMassimoConsentitoControlloDisabilitato(maxLongValue));
  2585.                         }
  2586.                         else {
  2587.                             this.getRestSecurityTokenClaimsExpTimeCheckToleranceMilliseconds = tmp;
  2588.                         }
  2589.                     }
  2590.                     else {
  2591.                         this.logWarn(getMessaggioVerificaDisabilitata(name));
  2592.                     }
  2593.                 }
  2594.             }catch(java.lang.Exception e) {
  2595.                 this.logError(getMessaggioErroreProprietaNonImpostata(name, e),e);
  2596.                 throw new ProtocolException(e.getMessage(),e);
  2597.             }
  2598.            
  2599.             this.getRestSecurityTokenClaimsExpTimeCheckToleranceMillisecondsReaded = true;
  2600.         }

  2601.         return this.getRestSecurityTokenClaimsExpTimeCheckToleranceMilliseconds;
  2602.     }
  2603.    
  2604.     private Boolean getRestSecurityTokenClaimsNbfTimeCheckToleranceMillisecondsReaded = null;
  2605.     private Long getRestSecurityTokenClaimsNbfTimeCheckToleranceMilliseconds = null;
  2606.     public Long getRestSecurityTokenClaimsNbfTimeCheckToleranceMilliseconds() throws ProtocolException{

  2607.         if(this.getRestSecurityTokenClaimsNbfTimeCheckToleranceMillisecondsReaded==null){
  2608.            
  2609.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.claims.nbf.toleranceMilliseconds";
  2610.             try{  
  2611.                 String value = this.reader.getValueConvertEnvProperties(name);

  2612.                 if (value != null){
  2613.                     value = value.trim();
  2614.                     long tmp = Long.parseLong(value); // già in millisecondi
  2615.                     if(tmp>0) {
  2616.                         long maxLongValue = Long.MAX_VALUE;
  2617.                         if(tmp>maxLongValue) {
  2618.                             this.logWarn(getPrefixValoreIndicatoProprieta(value,name)+getSuffixSuperioreMassimoConsentitoControlloDisabilitato(maxLongValue));
  2619.                         }
  2620.                         else {
  2621.                             this.getRestSecurityTokenClaimsNbfTimeCheckToleranceMilliseconds = tmp;
  2622.                         }
  2623.                     }
  2624.                     else {
  2625.                         this.logWarn(getMessaggioVerificaDisabilitata(name));
  2626.                     }
  2627.                 }
  2628.             }catch(java.lang.Exception e) {
  2629.                 this.logError(getMessaggioErroreProprietaNonImpostata(name, e),e);
  2630.                 throw new ProtocolException(e.getMessage(),e);
  2631.             }
  2632.            
  2633.             this.getRestSecurityTokenClaimsNbfTimeCheckToleranceMillisecondsReaded = true;
  2634.         }

  2635.         return this.getRestSecurityTokenClaimsNbfTimeCheckToleranceMilliseconds;
  2636.     }

  2637.     private DigestEncoding getRestSecurityTokenDigestDefaultEncoding= null;
  2638.     public DigestEncoding getRestSecurityTokenDigestDefaultEncoding() throws ProtocolException{
  2639.         if(this.getRestSecurityTokenDigestDefaultEncoding==null){
  2640.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.digest.encoding";
  2641.             try{  
  2642.                 String value = this.reader.getValueConvertEnvProperties(name);
  2643.                
  2644.                 if (value != null){
  2645.                     value = value.trim();
  2646.                     this.getRestSecurityTokenDigestDefaultEncoding = DigestEncoding.valueOf(value.toUpperCase());
  2647.                     if(this.getRestSecurityTokenDigestDefaultEncoding==null) {
  2648.                         throw new ProtocolException(INVALID_VALUE);
  2649.                     }
  2650.                 }
  2651.                 else {
  2652.                     throw newProtocolExceptionPropertyNonDefinita();
  2653.                 }
  2654.                
  2655.             }catch(java.lang.Exception e) {
  2656.                 String msgErrore = getPrefixProprieta(name)+" non impostata, errore (valori ammessi: "+DigestEncoding.BASE64.name().toLowerCase()+","+DigestEncoding.HEX.name().toLowerCase()+"):"+e.getMessage();
  2657.                 this.logError(msgErrore);
  2658.                 throw new ProtocolException(msgErrore,e);
  2659.             }
  2660.         }
  2661.        
  2662.         return this.getRestSecurityTokenDigestDefaultEncoding;
  2663.     }
  2664.    
  2665.     private Boolean isRestSecurityTokenDigestEncodingChoice= null;
  2666.     public boolean isRestSecurityTokenDigestEncodingChoice() throws ProtocolException{
  2667.         if(this.isRestSecurityTokenDigestEncodingChoice==null){
  2668.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.digest.encoding.choice";
  2669.             try{  
  2670.                 String value = this.reader.getValueConvertEnvProperties(name);
  2671.                
  2672.                 if (value != null){
  2673.                     value = value.trim();
  2674.                     this.isRestSecurityTokenDigestEncodingChoice = Boolean.valueOf(value);
  2675.                 }
  2676.                 else {
  2677.                     throw newProtocolExceptionPropertyNonDefinita();
  2678.                 }
  2679.                
  2680.             }catch(java.lang.Exception e) {
  2681.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2682.                 this.logError(msgErrore);
  2683.                 throw new ProtocolException(msgErrore,e);
  2684.             }
  2685.         }
  2686.        
  2687.         return this.isRestSecurityTokenDigestEncodingChoice;
  2688.     }
  2689.    
  2690.     private List<DigestEncoding> getRestSecurityTokenDigestEncodingAccepted= null;
  2691.     public List<DigestEncoding> getRestSecurityTokenDigestEncodingAccepted() throws ProtocolException{
  2692.         if(this.getRestSecurityTokenDigestEncodingAccepted==null){
  2693.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.digest.encoding.accepted";
  2694.             try{  
  2695.                 String value = this.reader.getValueConvertEnvProperties(name);
  2696.                
  2697.                 if (value != null){
  2698.                     value = value.trim();
  2699.                    
  2700.                     this.getRestSecurityTokenDigestEncodingAccepted = new ArrayList<>();
  2701.                     if(value.contains(",")) {
  2702.                         readRestSecurityTokenDigestEncodingAcceptedSplitValue(value);
  2703.                     }
  2704.                     else {
  2705.                         DigestEncoding tmp = DigestEncoding.valueOf(value.toUpperCase());
  2706.                         if(tmp==null) {
  2707.                             throw new ProtocolException(INVALID_VALUE);
  2708.                         }
  2709.                         this.getRestSecurityTokenDigestEncodingAccepted.add(tmp);
  2710.                     }
  2711.                 }
  2712.                 else {
  2713.                     throw newProtocolExceptionPropertyNonDefinita();
  2714.                 }
  2715.                
  2716.             }catch(java.lang.Exception e) {
  2717.                 String msgErrore = getPrefixProprieta(name)+" non impostata, errore (valori ammessi: "+DigestEncoding.BASE64.name().toLowerCase()+","+DigestEncoding.HEX.name().toLowerCase()+"):"+e.getMessage();
  2718.                 this.logError(msgErrore);
  2719.                 throw new ProtocolException(msgErrore,e);
  2720.             }
  2721.         }
  2722.        
  2723.         return this.getRestSecurityTokenDigestEncodingAccepted;
  2724.     }
  2725.     private void readRestSecurityTokenDigestEncodingAcceptedSplitValue(String value) throws ProtocolException {
  2726.         String [] split = value.split(",");
  2727.         if(split==null || split.length<=0) {
  2728.             throw new ProtocolException("Empty value");
  2729.         }
  2730.         for (String s : split) {
  2731.             if(s==null) {
  2732.                 throw new ProtocolException("Null value");
  2733.             }
  2734.             else {
  2735.                 s = s.trim();
  2736.             }
  2737.             DigestEncoding tmp = DigestEncoding.valueOf(s.toUpperCase());
  2738.             if(tmp==null) {
  2739.                 throw new ProtocolException(INVALID_VALUE);
  2740.             }
  2741.             this.getRestSecurityTokenDigestEncodingAccepted.add(tmp);
  2742.         }
  2743.     }
  2744.    
  2745.     private Boolean getRestSecurityTokenRequestDigestCleanReaded= null;
  2746.     private Boolean getRestSecurityTokenRequestDigestClean= null;
  2747.     public boolean isRestSecurityTokenRequestDigestClean() throws ProtocolException{
  2748.         if(this.getRestSecurityTokenRequestDigestCleanReaded==null){
  2749.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.request.digest.clean";
  2750.             try{  
  2751.                 String value = this.reader.getValueConvertEnvProperties(name);
  2752.                
  2753.                 if (value != null){
  2754.                     value = value.trim();
  2755.                     this.getRestSecurityTokenRequestDigestClean = Boolean.valueOf(value);
  2756.                 }
  2757.                 else {
  2758.                     throw newProtocolExceptionPropertyNonDefinita();
  2759.                 }
  2760.                
  2761.             }catch(java.lang.Exception e) {
  2762.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2763.                 this.logError(msgErrore);
  2764.                 throw new ProtocolException(msgErrore,e);
  2765.             }
  2766.            
  2767.             this.getRestSecurityTokenRequestDigestCleanReaded = true;
  2768.         }
  2769.        
  2770.         return this.getRestSecurityTokenRequestDigestClean;
  2771.     }
  2772.    
  2773.     private Boolean getRestSecurityTokenResponseDigestCleanReaded= null;
  2774.     private Boolean getRestSecurityTokenResponseDigestClean= null;
  2775.     public boolean isRestSecurityTokenResponseDigestClean() throws ProtocolException{
  2776.         if(this.getRestSecurityTokenResponseDigestCleanReaded==null){
  2777.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.response.digest.clean";
  2778.             try{  
  2779.                 String value = this.reader.getValueConvertEnvProperties(name);
  2780.                
  2781.                 if (value != null){
  2782.                     value = value.trim();
  2783.                     this.getRestSecurityTokenResponseDigestClean = Boolean.valueOf(value);
  2784.                 }
  2785.                 else {
  2786.                     throw newProtocolExceptionPropertyNonDefinita();
  2787.                 }
  2788.                
  2789.             }catch(java.lang.Exception e) {
  2790.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2791.                 this.logError(msgErrore);
  2792.                 throw new ProtocolException(msgErrore,e);
  2793.             }
  2794.            
  2795.             this.getRestSecurityTokenResponseDigestCleanReaded = true;
  2796.         }
  2797.        
  2798.         return this.getRestSecurityTokenResponseDigestClean;
  2799.     }
  2800.    
  2801.     private Boolean getRestSecurityTokenResponseDigestHEADuseServerHeaderReaded= null;
  2802.     private Boolean getRestSecurityTokenResponseDigestHEADuseServerHeader= null;
  2803.     public boolean isRestSecurityTokenResponseDigestHEADuseServerHeader() throws ProtocolException{
  2804.         if(this.getRestSecurityTokenResponseDigestHEADuseServerHeaderReaded==null){
  2805.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.response.digest.HEAD.useServerHeader";
  2806.             try{  
  2807.                 String value = this.reader.getValueConvertEnvProperties(name);
  2808.                
  2809.                 if (value != null){
  2810.                     value = value.trim();
  2811.                     this.getRestSecurityTokenResponseDigestHEADuseServerHeader = Boolean.valueOf(value);
  2812.                 }
  2813.                 else {
  2814.                     throw newProtocolExceptionPropertyNonDefinita();
  2815.                 }
  2816.                
  2817.             }catch(java.lang.Exception e) {
  2818.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2819.                 this.logError(msgErrore);
  2820.                 throw new ProtocolException(msgErrore,e);
  2821.             }
  2822.            
  2823.             this.getRestSecurityTokenResponseDigestHEADuseServerHeaderReaded = true;
  2824.         }
  2825.        
  2826.         return this.getRestSecurityTokenResponseDigestHEADuseServerHeader;
  2827.     }
  2828.    
  2829.     private Boolean getRestSecurityTokenFaultProcessEnabledReaded= null;
  2830.     private Boolean getRestSecurityTokenFaultProcessEnabled= null;
  2831.     public boolean isRestSecurityTokenFaultProcessEnabled() throws ProtocolException{
  2832.         if(this.getRestSecurityTokenFaultProcessEnabledReaded==null){
  2833.             String name = "org.openspcoop2.protocol.modipa.rest.fault.securityToken";
  2834.             try{  
  2835.                 String value = this.reader.getValueConvertEnvProperties(name);
  2836.                
  2837.                 if (value != null){
  2838.                     value = value.trim();
  2839.                     this.getRestSecurityTokenFaultProcessEnabled = Boolean.valueOf(value);
  2840.                 }
  2841.                 else {
  2842.                     throw newProtocolExceptionPropertyNonDefinita();
  2843.                 }
  2844.                
  2845.             }catch(java.lang.Exception e) {
  2846.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2847.                 this.logError(msgErrore);
  2848.                 throw new ProtocolException(msgErrore,e);
  2849.             }
  2850.            
  2851.             this.getRestSecurityTokenFaultProcessEnabledReaded = true;
  2852.         }
  2853.        
  2854.         return this.getRestSecurityTokenFaultProcessEnabled;
  2855.     }
  2856.    
  2857.     private Boolean getRestSecurityTokenAudienceProcessArrayModeReaded= null;
  2858.     private Boolean getRestSecurityTokenAudienceProcessArrayModeEnabled= null;
  2859.     public boolean isRestSecurityTokenAudienceProcessArrayModeEnabled() throws ProtocolException{
  2860.         if(this.getRestSecurityTokenAudienceProcessArrayModeReaded==null){
  2861.             String name = "org.openspcoop2.protocol.modipa.rest.securityToken.audience.processArrayMode";
  2862.             try{  
  2863.                 String value = this.reader.getValueConvertEnvProperties(name);
  2864.                
  2865.                 if (value != null){
  2866.                     value = value.trim();
  2867.                     this.getRestSecurityTokenAudienceProcessArrayModeEnabled = Boolean.valueOf(value);
  2868.                 }
  2869.                 else {
  2870.                     throw newProtocolExceptionPropertyNonDefinita();
  2871.                 }
  2872.                
  2873.             }catch(java.lang.Exception e) {
  2874.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2875.                 this.logError(msgErrore);
  2876.                 throw new ProtocolException(msgErrore,e);
  2877.             }
  2878.            
  2879.             this.getRestSecurityTokenAudienceProcessArrayModeReaded = true;
  2880.         }
  2881.        
  2882.         return this.getRestSecurityTokenAudienceProcessArrayModeEnabled;
  2883.     }
  2884.    
  2885.    
  2886.     private Boolean getRestResponseSecurityTokenAudienceDefaultReaded= null;
  2887.     private String getRestResponseSecurityTokenAudienceDefault= null;
  2888.     public String getRestResponseSecurityTokenAudienceDefault(String soggettoMittente) throws ProtocolException{
  2889.         if(this.getRestResponseSecurityTokenAudienceDefaultReaded==null){
  2890.             String name = "org.openspcoop2.protocol.modipa.rest.response.securityToken.audience.default";
  2891.             try{  
  2892.                 String value = this.reader.getValueConvertEnvProperties(name);
  2893.                 if (value != null){
  2894.                     value = value.trim();
  2895.                     this.getRestResponseSecurityTokenAudienceDefault = value;
  2896.                 }
  2897.                
  2898.             }catch(java.lang.Exception e) {
  2899.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2900.                 this.logError(msgErrore);
  2901.                 throw new ProtocolException(msgErrore,e);
  2902.             }
  2903.            
  2904.             this.getRestResponseSecurityTokenAudienceDefaultReaded = true;
  2905.         }
  2906.        
  2907.         if(ModICostanti.CONFIG_MODIPA_SOGGETTO_MITTENTE_KEYWORD.equalsIgnoreCase(this.getRestResponseSecurityTokenAudienceDefault) && soggettoMittente!=null && !StringUtils.isEmpty(soggettoMittente)) {
  2908.             return soggettoMittente;
  2909.         }
  2910.         else {
  2911.             return this.getRestResponseSecurityTokenAudienceDefault;
  2912.         }
  2913.     }  
  2914.    
  2915.     public List<String> getUsedRestSecurityClaims(boolean request, boolean integrita) throws ProtocolException{
  2916.         List<String> l = new ArrayList<>();
  2917.        
  2918.         l.add(Claims.JSON_WEB_TOKEN_RFC_7519_ISSUED_AT);
  2919.         l.add(Claims.JSON_WEB_TOKEN_RFC_7519_NOT_TO_BE_USED_BEFORE);
  2920.         l.add(Claims.JSON_WEB_TOKEN_RFC_7519_EXPIRED);
  2921.         l.add(Claims.JSON_WEB_TOKEN_RFC_7519_JWT_ID);
  2922.        
  2923.         if(request) {
  2924.             l.add(Claims.JSON_WEB_TOKEN_RFC_7519_AUDIENCE); // si configura sulla fruizione
  2925.            
  2926.             String v = getRestSecurityTokenClaimsClientIdHeader();
  2927.             if(v!=null && StringUtils.isNotEmpty(v)) {
  2928.                 l.add(v); // si configura sull'applicativo
  2929.             }
  2930.         }
  2931.        
  2932.         if(!request) {
  2933.             String v = getRestSecurityTokenClaimRequestDigest();
  2934.             if(v!=null && StringUtils.isNotEmpty(v)) {
  2935.                 l.add(v);
  2936.             }
  2937.         }
  2938.        
  2939.         /**
  2940.          ** Possono sempre essere definiti, poiche' utilizzati per sovrascrivere i default
  2941.         boolean addIss = true;
  2942.         boolean addSub = true;
  2943.         if(corniceSicurezza) {
  2944.             v = getSicurezzaMessaggioCorniceSicurezzaRestCodiceEnte();
  2945.             if(v!=null && StringUtils.isNotEmpty(v)) {
  2946.                 if(Claims.INTROSPECTION_RESPONSE_RFC_7662_ISSUER.equals(v)) {
  2947.                     addIss = false;
  2948.                 }
  2949.                 l.add(v);
  2950.             }
  2951.             v = getSicurezzaMessaggioCorniceSicurezzaRestUser();
  2952.             if(v!=null && StringUtils.isNotEmpty(v)) {
  2953.                 if(Claims.INTROSPECTION_RESPONSE_RFC_7662_SUBJECT.equals(v)) {
  2954.                     addSub = false;
  2955.                 }
  2956.                 l.add(v);
  2957.             }
  2958.             v = getSicurezzaMessaggioCorniceSicurezzaRestIpuser();
  2959.             if(v!=null && StringUtils.isNotEmpty(v)) {
  2960.                 l.add(v);
  2961.             }
  2962.         }
  2963.         if(addIss) {
  2964.             l.add(Claims.INTROSPECTION_RESPONSE_RFC_7662_ISSUER);
  2965.         }
  2966.         if(addSub) {
  2967.             l.add(Claims.INTROSPECTION_RESPONSE_RFC_7662_SUBJECT);
  2968.         }*/
  2969.        
  2970.         if(integrita) {
  2971.             String v = getRestSecurityTokenClaimSignedHeaders();
  2972.             if(v!=null && StringUtils.isNotEmpty(v)) {
  2973.                 l.add(v);
  2974.             }
  2975.         }
  2976.        
  2977.         return l;
  2978.     }
  2979.    
  2980.     private String getRestCorrelationIdHeader= null;
  2981.     public String getRestCorrelationIdHeader() throws ProtocolException{
  2982.         if(this.getRestCorrelationIdHeader==null){
  2983.             String name = "org.openspcoop2.protocol.modipa.rest.correlationId.header";
  2984.             try{  
  2985.                 String value = this.reader.getValueConvertEnvProperties(name);
  2986.                
  2987.                 if (value != null){
  2988.                     value = value.trim();
  2989.                     this.getRestCorrelationIdHeader = value;
  2990.                 }
  2991.                 else {
  2992.                     throw newProtocolExceptionPropertyNonDefinita();
  2993.                 }
  2994.                
  2995.             }catch(java.lang.Exception e) {
  2996.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  2997.                 this.logError(msgErrore);
  2998.                 throw new ProtocolException(msgErrore,e);
  2999.             }
  3000.         }
  3001.        
  3002.         return this.getRestCorrelationIdHeader;
  3003.     }  
  3004.    
  3005.     private String getRestReplyToHeader= null;
  3006.     public String getRestReplyToHeader() throws ProtocolException{
  3007.         if(this.getRestReplyToHeader==null){
  3008.             String name = "org.openspcoop2.protocol.modipa.rest.replyTo.header";
  3009.             try{  
  3010.                 String value = this.reader.getValueConvertEnvProperties(name);
  3011.                
  3012.                 if (value != null){
  3013.                     value = value.trim();
  3014.                     this.getRestReplyToHeader = value;
  3015.                 }
  3016.                 else {
  3017.                     throw newProtocolExceptionPropertyNonDefinita();
  3018.                 }
  3019.                
  3020.             }catch(java.lang.Exception e) {
  3021.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3022.                 this.logError(msgErrore);
  3023.                 throw new ProtocolException(msgErrore,e);
  3024.             }
  3025.         }
  3026.        
  3027.         return this.getRestReplyToHeader;
  3028.     }
  3029.    
  3030.     private String getRestLocationHeader= null;
  3031.     public String getRestLocationHeader() throws ProtocolException{
  3032.         if(this.getRestLocationHeader==null){
  3033.             String name = "org.openspcoop2.protocol.modipa.rest.location.header";
  3034.             try{  
  3035.                 String value = this.reader.getValueConvertEnvProperties(name);
  3036.                
  3037.                 if (value != null){
  3038.                     value = value.trim();
  3039.                     this.getRestLocationHeader = value;
  3040.                 }
  3041.                 else {
  3042.                     throw newProtocolExceptionPropertyNonDefinita();
  3043.                 }
  3044.                
  3045.             }catch(java.lang.Exception e) {
  3046.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3047.                 this.logError(msgErrore);
  3048.                 throw new ProtocolException(msgErrore,e);
  3049.             }
  3050.         }
  3051.        
  3052.         return this.getRestLocationHeader;
  3053.     }
  3054.    
  3055.     private Boolean getRestProfiliInterazioneCheckCompatibilityReaded= null;
  3056.     private Boolean getRestProfiliInterazioneCheckCompatibility= null;
  3057.     public boolean isRestProfiliInterazioneCheckCompatibility() throws ProtocolException{
  3058.         if(this.getRestProfiliInterazioneCheckCompatibilityReaded==null){
  3059.             String name = "org.openspcoop2.protocol.modipa.rest.profiliInterazione.checkCompatibility";
  3060.             try{  
  3061.                 String value = this.reader.getValueConvertEnvProperties(name);
  3062.                
  3063.                 if (value != null){
  3064.                     value = value.trim();
  3065.                     this.getRestProfiliInterazioneCheckCompatibility = Boolean.valueOf(value);
  3066.                 }
  3067.                 else {
  3068.                     throw newProtocolExceptionPropertyNonDefinita();
  3069.                 }
  3070.                
  3071.             }catch(java.lang.Exception e) {
  3072.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3073.                 this.logError(msgErrore);
  3074.                 throw new ProtocolException(msgErrore,e);
  3075.             }
  3076.            
  3077.             this.getRestProfiliInterazioneCheckCompatibilityReaded = true;
  3078.         }
  3079.        
  3080.         return this.getRestProfiliInterazioneCheckCompatibility;
  3081.     }
  3082.    
  3083.     // .. BLOCCANTE ..
  3084.    
  3085.     private Integer [] getRestBloccanteHttpStatus = null;
  3086.     public Integer [] getRestBloccanteHttpStatus() throws ProtocolException{
  3087.         if(this.getRestBloccanteHttpStatus==null){
  3088.             String name = "org.openspcoop2.protocol.modipa.rest.bloccante.httpStatus";
  3089.             try{  
  3090.                 String value = this.reader.getValueConvertEnvProperties(name);
  3091.                
  3092.                 if (value != null){
  3093.                     value = value.trim();
  3094.                     if(ModICostanti.MODIPA_PROFILO_INTERAZIONE_HTTP_CODE_2XX.equalsIgnoreCase(value)) {
  3095.                         this.getRestBloccanteHttpStatus = new Integer[1];
  3096.                         this.getRestBloccanteHttpStatus[0] = ModICostanti.MODIPA_PROFILO_INTERAZIONE_HTTP_CODE_2XX_INT_VALUE;
  3097.                     }
  3098.                     else {
  3099.                         String [] tmp = value.split(",");
  3100.                         this.getRestBloccanteHttpStatus = new Integer[tmp.length];
  3101.                         for (int i = 0; i < tmp.length; i++) {
  3102.                             this.getRestBloccanteHttpStatus[i] = Integer.valueOf(tmp[i].trim());
  3103.                         }
  3104.                     }
  3105.                 }
  3106.                 else {
  3107.                     throw newProtocolExceptionPropertyNonDefinita();
  3108.                 }
  3109.                
  3110.             }catch(java.lang.Exception e) {
  3111.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3112.                 this.logError(msgErrore);
  3113.                 throw new ProtocolException(msgErrore,e);
  3114.             }
  3115.         }
  3116.        
  3117.         return this.getRestBloccanteHttpStatus;
  3118.     }
  3119.    
  3120.     private List<HttpRequestMethod> getRestBloccanteHttpMethod = null;
  3121.     public List<HttpRequestMethod> getRestBloccanteHttpMethod() throws ProtocolException{
  3122.         if(this.getRestBloccanteHttpMethod==null){
  3123.             String name = "org.openspcoop2.protocol.modipa.rest.bloccante.httpMethod";
  3124.             try{
  3125.                 this.getRestBloccanteHttpMethod = new ArrayList<>();
  3126.                 String value = this.reader.getValueConvertEnvProperties(name);
  3127.                
  3128.                 if (value != null){
  3129.                     value = value.trim();
  3130.                     String [] tmp = value.split(",");
  3131.                     for (int i = 0; i < tmp.length; i++) {
  3132.                         this.getRestBloccanteHttpMethod.add(HttpRequestMethod.valueOf(tmp[i].trim().toUpperCase()));
  3133.                     }
  3134.                 }
  3135.                
  3136.             }catch(java.lang.Exception e) {
  3137.                 String msgErrore = getMessaggioErroreProprietaNonCorretta(name, e);
  3138.                 this.logError(msgErrore);
  3139.                 throw new ProtocolException(msgErrore,e);
  3140.             }
  3141.         }
  3142.        
  3143.         return this.getRestBloccanteHttpMethod;
  3144.     }
  3145.    
  3146.    
  3147.     // .. PUSH ..
  3148.    
  3149.     private Boolean getRestSecurityTokenPushReplyToUpdateOrCreate = null;
  3150.     public boolean isRestSecurityTokenPushReplyToUpdateOrCreateInFruizione() throws ProtocolException{
  3151.         if(this.getRestSecurityTokenPushReplyToUpdateOrCreate==null){
  3152.             String name = "org.openspcoop2.protocol.modipa.rest.push.replyTo.header.updateOrCreate";
  3153.             try{  
  3154.                 String value = this.reader.getValueConvertEnvProperties(name);
  3155.                
  3156.                 if (value != null){
  3157.                     value = value.trim();
  3158.                     this.getRestSecurityTokenPushReplyToUpdateOrCreate = Boolean.valueOf(value);
  3159.                 }
  3160.                 else {
  3161.                     throw newProtocolExceptionPropertyNonDefinita();
  3162.                 }
  3163.                
  3164.             }catch(java.lang.Exception e) {
  3165.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3166.                 this.logError(msgErrore);
  3167.                 throw new ProtocolException(msgErrore,e);
  3168.             }
  3169.         }
  3170.        
  3171.         return this.getRestSecurityTokenPushReplyToUpdateOrCreate;
  3172.     }
  3173.    
  3174.     private Boolean getRestSecurityTokenPushReplyToUpdate = null;
  3175.     public boolean isRestSecurityTokenPushReplyToUpdateInErogazione() throws ProtocolException{
  3176.         if(this.getRestSecurityTokenPushReplyToUpdate==null){
  3177.             String name = "org.openspcoop2.protocol.modipa.rest.push.replyTo.header.update";
  3178.             try{  
  3179.                 String value = this.reader.getValueConvertEnvProperties(name);
  3180.                
  3181.                 if (value != null){
  3182.                     value = value.trim();
  3183.                     this.getRestSecurityTokenPushReplyToUpdate = Boolean.valueOf(value);
  3184.                 }
  3185.                 else {
  3186.                     throw newProtocolExceptionPropertyNonDefinita();
  3187.                 }
  3188.                
  3189.             }catch(java.lang.Exception e) {
  3190.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3191.                 this.logError(msgErrore);
  3192.                 throw new ProtocolException(msgErrore,e);
  3193.             }
  3194.         }
  3195.        
  3196.         return this.getRestSecurityTokenPushReplyToUpdate;
  3197.     }
  3198.    
  3199.     private Boolean getRestSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists = null;
  3200.     public boolean isRestSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists() throws ProtocolException{
  3201.         if(this.getRestSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists==null){
  3202.             String name = "org.openspcoop2.protocol.modipa.rest.push.request.correlationId.header.useTransactionIdIfNotExists";
  3203.             try{  
  3204.                 String value = this.reader.getValueConvertEnvProperties(name);
  3205.                
  3206.                 if (value != null){
  3207.                     value = value.trim();
  3208.                     this.getRestSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists = Boolean.valueOf(value);
  3209.                 }
  3210.                 else {
  3211.                     throw newProtocolExceptionPropertyNonDefinita();
  3212.                 }
  3213.                
  3214.             }catch(java.lang.Exception e) {
  3215.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3216.                 this.logError(msgErrore);
  3217.                 throw new ProtocolException(msgErrore,e);
  3218.             }
  3219.         }
  3220.        
  3221.         return this.getRestSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists;
  3222.     }
  3223.    
  3224.     private Integer [] getRestSecurityTokenPushRequestHttpStatus = null;
  3225.     public Integer [] getRestNonBloccantePushRequestHttpStatus() throws ProtocolException{
  3226.         if(this.getRestSecurityTokenPushRequestHttpStatus==null){
  3227.             String name = "org.openspcoop2.protocol.modipa.rest.push.request.httpStatus";
  3228.             try{  
  3229.                 String value = this.reader.getValueConvertEnvProperties(name);
  3230.                
  3231.                 if (value != null){
  3232.                     value = value.trim();
  3233.                     String [] tmp = value.split(",");
  3234.                     this.getRestSecurityTokenPushRequestHttpStatus = new Integer[tmp.length];
  3235.                     for (int i = 0; i < tmp.length; i++) {
  3236.                         this.getRestSecurityTokenPushRequestHttpStatus[i] = Integer.valueOf(tmp[i].trim());
  3237.                     }
  3238.                 }
  3239.                 else {
  3240.                     throw newProtocolExceptionPropertyNonDefinita();
  3241.                 }
  3242.                
  3243.             }catch(java.lang.Exception e) {
  3244.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3245.                 this.logError(msgErrore);
  3246.                 throw new ProtocolException(msgErrore,e);
  3247.             }
  3248.         }
  3249.        
  3250.         return this.getRestSecurityTokenPushRequestHttpStatus;
  3251.     }
  3252.    
  3253.     private List<HttpRequestMethod> getRestNonBloccantePushRequestHttpMethod = null;
  3254.     public List<HttpRequestMethod> getRestNonBloccantePushRequestHttpMethod() throws ProtocolException{
  3255.         if(this.getRestNonBloccantePushRequestHttpMethod==null){
  3256.             String name = "org.openspcoop2.protocol.modipa.rest.push.request.httpMethod";
  3257.             try{
  3258.                 this.getRestNonBloccantePushRequestHttpMethod = new ArrayList<>();
  3259.                 String value = this.reader.getValueConvertEnvProperties(name);
  3260.                
  3261.                 if (value != null){
  3262.                     value = value.trim();
  3263.                     String [] tmp = value.split(",");
  3264.                     for (int i = 0; i < tmp.length; i++) {
  3265.                         this.getRestNonBloccantePushRequestHttpMethod.add(HttpRequestMethod.valueOf(tmp[i].trim().toUpperCase()));
  3266.                     }
  3267.                 }
  3268.                
  3269.             }catch(java.lang.Exception e) {
  3270.                 String msgErrore = getMessaggioErroreProprietaNonCorretta(name, e);
  3271.                 this.logError(msgErrore);
  3272.                 throw new ProtocolException(msgErrore,e);
  3273.             }
  3274.         }
  3275.        
  3276.         return this.getRestNonBloccantePushRequestHttpMethod;
  3277.     }
  3278.    
  3279.     private Integer [] getRestSecurityTokenPushResponseHttpStatus = null;
  3280.     public Integer [] getRestNonBloccantePushResponseHttpStatus() throws ProtocolException{
  3281.         if(this.getRestSecurityTokenPushResponseHttpStatus==null){
  3282.             String name = "org.openspcoop2.protocol.modipa.rest.push.response.httpStatus";
  3283.             try{  
  3284.                 String value = this.reader.getValueConvertEnvProperties(name);
  3285.                
  3286.                 if (value != null){
  3287.                     value = value.trim();
  3288.                     String [] tmp = value.split(",");
  3289.                     this.getRestSecurityTokenPushResponseHttpStatus = new Integer[tmp.length];
  3290.                     for (int i = 0; i < tmp.length; i++) {
  3291.                         this.getRestSecurityTokenPushResponseHttpStatus[i] = Integer.valueOf(tmp[i].trim());
  3292.                     }
  3293.                 }
  3294.                 else {
  3295.                     throw newProtocolExceptionPropertyNonDefinita();
  3296.                 }
  3297.                
  3298.             }catch(java.lang.Exception e) {
  3299.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3300.                 this.logError(msgErrore);
  3301.                 throw new ProtocolException(msgErrore,e);
  3302.             }
  3303.         }
  3304.        
  3305.         return this.getRestSecurityTokenPushResponseHttpStatus;
  3306.     }
  3307.    
  3308.     private List<HttpRequestMethod> getRestNonBloccantePushResponseHttpMethod = null;
  3309.     public List<HttpRequestMethod> getRestNonBloccantePushResponseHttpMethod() throws ProtocolException{
  3310.         if(this.getRestNonBloccantePushResponseHttpMethod==null){
  3311.             String name = "org.openspcoop2.protocol.modipa.rest.push.response.httpMethod";
  3312.             try{
  3313.                 this.getRestNonBloccantePushResponseHttpMethod = new ArrayList<>();
  3314.                 String value = this.reader.getValueConvertEnvProperties(name);
  3315.                
  3316.                 if (value != null){
  3317.                     value = value.trim();
  3318.                     String [] tmp = value.split(",");
  3319.                     for (int i = 0; i < tmp.length; i++) {
  3320.                         this.getRestNonBloccantePushResponseHttpMethod.add(HttpRequestMethod.valueOf(tmp[i].trim().toUpperCase()));
  3321.                     }
  3322.                 }
  3323.                
  3324.             }catch(java.lang.Exception e) {
  3325.                 String msgErrore = getMessaggioErroreProprietaNonCorretta(name, e);
  3326.                 this.logError(msgErrore);
  3327.                 throw new ProtocolException(msgErrore,e);
  3328.             }
  3329.         }
  3330.        
  3331.         return this.getRestNonBloccantePushResponseHttpMethod;
  3332.     }
  3333.    
  3334.     private List<HttpRequestMethod> getRestNonBloccantePushHttpMethod = null;
  3335.     public List<HttpRequestMethod> getRestNonBloccantePushHttpMethod() throws ProtocolException{
  3336.        
  3337.         if(this.getRestNonBloccantePushHttpMethod!=null) {
  3338.             return this.getRestNonBloccantePushHttpMethod;
  3339.         }
  3340.        
  3341.         this.getRestNonBloccantePushHttpMethod = new ArrayList<>();
  3342.        
  3343.         List<HttpRequestMethod> req = getRestNonBloccantePushRequestHttpMethod();
  3344.         if(req!=null && !req.isEmpty()){
  3345.             this.getRestNonBloccantePushHttpMethod.addAll(req);
  3346.         }
  3347.        
  3348.         List<HttpRequestMethod> res = getRestNonBloccantePushResponseHttpMethod();
  3349.         if(res!=null && !res.isEmpty()){
  3350.             for (HttpRequestMethod httpRequestMethod : res) {
  3351.                 if(!this.getRestNonBloccantePushHttpMethod.contains(httpRequestMethod)) {
  3352.                     this.getRestNonBloccantePushHttpMethod.add(httpRequestMethod);
  3353.                 }
  3354.             }
  3355.         }
  3356.        
  3357.         return this.getRestNonBloccantePushHttpMethod;
  3358.     }
  3359.    
  3360.     // .. PULL ..
  3361.    
  3362.     private Integer [] getRestSecurityTokenPullRequestHttpStatus = null;
  3363.     public Integer [] getRestNonBloccantePullRequestHttpStatus() throws ProtocolException{
  3364.         if(this.getRestSecurityTokenPullRequestHttpStatus==null){
  3365.             String name = "org.openspcoop2.protocol.modipa.rest.pull.request.httpStatus";
  3366.             try{  
  3367.                 String value = this.reader.getValueConvertEnvProperties(name);
  3368.                
  3369.                 if (value != null){
  3370.                     value = value.trim();
  3371.                     String [] tmp = value.split(",");
  3372.                     this.getRestSecurityTokenPullRequestHttpStatus = new Integer[tmp.length];
  3373.                     for (int i = 0; i < tmp.length; i++) {
  3374.                         this.getRestSecurityTokenPullRequestHttpStatus[i] = Integer.valueOf(tmp[i].trim());
  3375.                     }
  3376.                 }
  3377.                 else {
  3378.                     throw newProtocolExceptionPropertyNonDefinita();
  3379.                 }
  3380.                
  3381.             }catch(java.lang.Exception e) {
  3382.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3383.                 this.logError(msgErrore);
  3384.                 throw new ProtocolException(msgErrore,e);
  3385.             }
  3386.         }
  3387.        
  3388.         return this.getRestSecurityTokenPullRequestHttpStatus;
  3389.     }
  3390.    
  3391.     private List<HttpRequestMethod> getRestNonBloccantePullRequestHttpMethod = null;
  3392.     public List<HttpRequestMethod> getRestNonBloccantePullRequestHttpMethod() throws ProtocolException{
  3393.         if(this.getRestNonBloccantePullRequestHttpMethod==null){
  3394.             String name = "org.openspcoop2.protocol.modipa.rest.pull.request.httpMethod";
  3395.             try{
  3396.                 this.getRestNonBloccantePullRequestHttpMethod = new ArrayList<>();
  3397.                 String value = this.reader.getValueConvertEnvProperties(name);
  3398.                
  3399.                 if (value != null){
  3400.                     value = value.trim();
  3401.                     String [] tmp = value.split(",");
  3402.                     for (int i = 0; i < tmp.length; i++) {
  3403.                         this.getRestNonBloccantePullRequestHttpMethod.add(HttpRequestMethod.valueOf(tmp[i].trim().toUpperCase()));
  3404.                     }
  3405.                 }
  3406.                
  3407.             }catch(java.lang.Exception e) {
  3408.                 String msgErrore = getMessaggioErroreProprietaNonCorretta(name, e);
  3409.                 this.logError(msgErrore);
  3410.                 throw new ProtocolException(msgErrore,e);
  3411.             }
  3412.         }
  3413.        
  3414.         return this.getRestNonBloccantePullRequestHttpMethod;
  3415.     }
  3416.    
  3417.     private Integer [] getRestSecurityTokenPullRequestStateNotReadyHttpStatus = null;
  3418.     public Integer [] getRestNonBloccantePullRequestStateNotReadyHttpStatus() throws ProtocolException{
  3419.         if(this.getRestSecurityTokenPullRequestStateNotReadyHttpStatus==null){
  3420.             String name = "org.openspcoop2.protocol.modipa.rest.pull.requestState.notReady.httpStatus";
  3421.             try{  
  3422.                 String value = this.reader.getValueConvertEnvProperties(name);
  3423.                
  3424.                 if (value != null){
  3425.                     value = value.trim();
  3426.                     String [] tmp = value.split(",");
  3427.                     this.getRestSecurityTokenPullRequestStateNotReadyHttpStatus = new Integer[tmp.length];
  3428.                     for (int i = 0; i < tmp.length; i++) {
  3429.                         this.getRestSecurityTokenPullRequestStateNotReadyHttpStatus[i] = Integer.valueOf(tmp[i].trim());
  3430.                     }
  3431.                 }
  3432.                 else {
  3433.                     throw newProtocolExceptionPropertyNonDefinita();
  3434.                 }
  3435.                
  3436.             }catch(java.lang.Exception e) {
  3437.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3438.                 this.logError(msgErrore);
  3439.                 throw new ProtocolException(msgErrore,e);
  3440.             }
  3441.         }
  3442.        
  3443.         return this.getRestSecurityTokenPullRequestStateNotReadyHttpStatus;
  3444.     }
  3445.    
  3446.     private Integer [] getRestSecurityTokenPullRequestStateOkHttpStatus = null;
  3447.     public Integer [] getRestNonBloccantePullRequestStateOkHttpStatus() throws ProtocolException{
  3448.         if(this.getRestSecurityTokenPullRequestStateOkHttpStatus==null){
  3449.             String name = "org.openspcoop2.protocol.modipa.rest.pull.requestState.ok.httpStatus";
  3450.             try{  
  3451.                 String value = this.reader.getValueConvertEnvProperties(name);
  3452.                
  3453.                 if (value != null){
  3454.                     value = value.trim();
  3455.                     String [] tmp = value.split(",");
  3456.                     this.getRestSecurityTokenPullRequestStateOkHttpStatus = new Integer[tmp.length];
  3457.                     for (int i = 0; i < tmp.length; i++) {
  3458.                         this.getRestSecurityTokenPullRequestStateOkHttpStatus[i] = Integer.valueOf(tmp[i].trim());
  3459.                     }
  3460.                 }
  3461.                 else {
  3462.                     throw newProtocolExceptionPropertyNonDefinita();
  3463.                 }
  3464.                
  3465.             }catch(java.lang.Exception e) {
  3466.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3467.                 this.logError(msgErrore);
  3468.                 throw new ProtocolException(msgErrore,e);
  3469.             }
  3470.         }
  3471.        
  3472.         return this.getRestSecurityTokenPullRequestStateOkHttpStatus;
  3473.     }
  3474.    
  3475.     private List<HttpRequestMethod> getRestNonBloccantePullRequestStateHttpMethod = null;
  3476.     public List<HttpRequestMethod> getRestNonBloccantePullRequestStateHttpMethod() throws ProtocolException{
  3477.         if(this.getRestNonBloccantePullRequestStateHttpMethod==null){
  3478.             String name = "org.openspcoop2.protocol.modipa.rest.pull.requestState.httpMethod";
  3479.             try{
  3480.                 this.getRestNonBloccantePullRequestStateHttpMethod = new ArrayList<>();
  3481.                 String value = this.reader.getValueConvertEnvProperties(name);
  3482.                
  3483.                 if (value != null){
  3484.                     value = value.trim();
  3485.                     String [] tmp = value.split(",");
  3486.                     for (int i = 0; i < tmp.length; i++) {
  3487.                         this.getRestNonBloccantePullRequestStateHttpMethod.add(HttpRequestMethod.valueOf(tmp[i].trim().toUpperCase()));
  3488.                     }
  3489.                 }
  3490.                
  3491.             }catch(java.lang.Exception e) {
  3492.                 String msgErrore = getMessaggioErroreProprietaNonCorretta(name, e);
  3493.                 this.logError(msgErrore);
  3494.                 throw new ProtocolException(msgErrore,e);
  3495.             }
  3496.         }
  3497.        
  3498.         return this.getRestNonBloccantePullRequestStateHttpMethod;
  3499.     }
  3500.    
  3501.     private Integer [] getRestSecurityTokenPullResponseHttpStatus = null;
  3502.     public Integer [] getRestNonBloccantePullResponseHttpStatus() throws ProtocolException{
  3503.         if(this.getRestSecurityTokenPullResponseHttpStatus==null){
  3504.             String name = "org.openspcoop2.protocol.modipa.rest.pull.response.httpStatus";
  3505.             try{  
  3506.                 String value = this.reader.getValueConvertEnvProperties(name);
  3507.                
  3508.                 if (value != null){
  3509.                     value = value.trim();
  3510.                     String [] tmp = value.split(",");
  3511.                     this.getRestSecurityTokenPullResponseHttpStatus = new Integer[tmp.length];
  3512.                     for (int i = 0; i < tmp.length; i++) {
  3513.                         this.getRestSecurityTokenPullResponseHttpStatus[i] = Integer.valueOf(tmp[i].trim());
  3514.                     }
  3515.                 }
  3516.                 else {
  3517.                     throw newProtocolExceptionPropertyNonDefinita();
  3518.                 }
  3519.                
  3520.             }catch(java.lang.Exception e) {
  3521.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3522.                 this.logError(msgErrore);
  3523.                 throw new ProtocolException(msgErrore,e);
  3524.             }
  3525.         }
  3526.        
  3527.         return this.getRestSecurityTokenPullResponseHttpStatus;
  3528.     }
  3529.    
  3530.     private List<HttpRequestMethod> getRestNonBloccantePullResponseHttpMethod = null;
  3531.     public List<HttpRequestMethod> getRestNonBloccantePullResponseHttpMethod() throws ProtocolException{
  3532.         if(this.getRestNonBloccantePullResponseHttpMethod==null){
  3533.             String name = "org.openspcoop2.protocol.modipa.rest.pull.response.httpMethod";
  3534.             try{
  3535.                 this.getRestNonBloccantePullResponseHttpMethod = new ArrayList<>();
  3536.                 String value = this.reader.getValueConvertEnvProperties(name);
  3537.                
  3538.                 if (value != null){
  3539.                     value = value.trim();
  3540.                     String [] tmp = value.split(",");
  3541.                     for (int i = 0; i < tmp.length; i++) {
  3542.                         this.getRestNonBloccantePullResponseHttpMethod.add(HttpRequestMethod.valueOf(tmp[i].trim().toUpperCase()));
  3543.                     }
  3544.                 }
  3545.                
  3546.             }catch(java.lang.Exception e) {
  3547.                 String msgErrore = getMessaggioErroreProprietaNonCorretta(name, e);
  3548.                 this.logError(msgErrore);
  3549.                 throw new ProtocolException(msgErrore,e);
  3550.             }
  3551.         }
  3552.        
  3553.         return this.getRestNonBloccantePullResponseHttpMethod;
  3554.     }
  3555.    
  3556.     private List<HttpRequestMethod> getRestNonBloccantePullHttpMethod = null;
  3557.     public List<HttpRequestMethod> getRestNonBloccantePullHttpMethod() throws ProtocolException{
  3558.        
  3559.         if(this.getRestNonBloccantePullHttpMethod!=null) {
  3560.             return this.getRestNonBloccantePullHttpMethod;
  3561.         }
  3562.        
  3563.         this.getRestNonBloccantePullHttpMethod = new ArrayList<>();
  3564.        
  3565.         readRestNonBloccantePullHttpMethodRequest();
  3566.        
  3567.         readRestNonBloccantePullHttpMethodResponse();
  3568.        
  3569.         return this.getRestNonBloccantePullHttpMethod;
  3570.     }
  3571.     private void readRestNonBloccantePullHttpMethodRequest() throws ProtocolException {
  3572.         List<HttpRequestMethod> req = getRestNonBloccantePullRequestHttpMethod();
  3573.         if(req!=null && !req.isEmpty()){
  3574.             this.getRestNonBloccantePullHttpMethod.addAll(req);
  3575.         }
  3576.        
  3577.         List<HttpRequestMethod> reqState = getRestNonBloccantePullRequestStateHttpMethod();
  3578.         if(reqState!=null && !reqState.isEmpty()){
  3579.             for (HttpRequestMethod httpRequestMethod : reqState) {
  3580.                 if(!this.getRestNonBloccantePullHttpMethod.contains(httpRequestMethod)) {
  3581.                     this.getRestNonBloccantePullHttpMethod.add(httpRequestMethod);
  3582.                 }
  3583.             }
  3584.         }
  3585.     }
  3586.     private void readRestNonBloccantePullHttpMethodResponse() throws ProtocolException {
  3587.         List<HttpRequestMethod> res = getRestNonBloccantePullResponseHttpMethod();
  3588.         if(res!=null && !res.isEmpty()){
  3589.             for (HttpRequestMethod httpRequestMethod : res) {
  3590.                 if(!this.getRestNonBloccantePullHttpMethod.contains(httpRequestMethod)) {
  3591.                     this.getRestNonBloccantePullHttpMethod.add(httpRequestMethod);
  3592.                 }
  3593.             }
  3594.         }
  3595.     }
  3596.    
  3597.    
  3598.     /* **** SOAP **** */
  3599.    
  3600.     private Boolean getSoapSecurityTokenMustUnderstandReaded= null;
  3601.     private Boolean getSoapSecurityTokenMustUnderstand= null;
  3602.     public boolean isSoapSecurityTokenMustUnderstand() throws ProtocolException{
  3603.         if(this.getSoapSecurityTokenMustUnderstandReaded==null){
  3604.             String name = "org.openspcoop2.protocol.modipa.soap.securityToken.mustUnderstand";
  3605.             try{  
  3606.                 String value = this.reader.getValueConvertEnvProperties(name);
  3607.                
  3608.                 if (value != null){
  3609.                     value = value.trim();
  3610.                     this.getSoapSecurityTokenMustUnderstand = Boolean.valueOf(value);
  3611.                 }
  3612.                 else {
  3613.                     throw newProtocolExceptionPropertyNonDefinita();
  3614.                 }
  3615.                
  3616.             }catch(java.lang.Exception e) {
  3617.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3618.                 this.logError(msgErrore);
  3619.                 throw new ProtocolException(msgErrore,e);
  3620.             }
  3621.            
  3622.             this.getSoapSecurityTokenMustUnderstandReaded = true;
  3623.         }
  3624.        
  3625.         return this.getSoapSecurityTokenMustUnderstand;
  3626.     }  
  3627.    
  3628.     private Boolean getSoapSecurityTokenActorReaded= null;
  3629.     private String getSoapSecurityTokenActor= null;
  3630.     public String getSoapSecurityTokenActor() throws ProtocolException{
  3631.         if(this.getSoapSecurityTokenActorReaded==null){
  3632.             String name = "org.openspcoop2.protocol.modipa.soap.securityToken.actor";
  3633.             try{  
  3634.                 String value = this.reader.getValueConvertEnvProperties(name);
  3635.                
  3636.                 if (value != null){
  3637.                     value = value.trim();
  3638.                     if(!"".equals(value)) {
  3639.                         this.getSoapSecurityTokenActor = value;
  3640.                     }
  3641.                 }
  3642.                
  3643.             }catch(java.lang.Exception e) {
  3644.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3645.                 this.logError(msgErrore);
  3646.                 throw new ProtocolException(msgErrore,e);
  3647.             }
  3648.            
  3649.             this.getSoapSecurityTokenActorReaded = true;
  3650.         }
  3651.        
  3652.         return this.getSoapSecurityTokenActor;
  3653.     }
  3654.    
  3655.     private Boolean getSoapSecurityTokenTimestampCreatedTimeCheckMillisecondsReaded = null;
  3656.     private Long getSoapSecurityTokenTimestampCreatedTimeCheckMilliseconds = null;
  3657.     public Long getSoapSecurityTokenTimestampCreatedTimeCheckMilliseconds() throws ProtocolException{

  3658.         if(this.getSoapSecurityTokenTimestampCreatedTimeCheckMillisecondsReaded==null){
  3659.            
  3660.             String name = "org.openspcoop2.protocol.modipa.soap.securityToken.timestamp.created.minutes";
  3661.             try{  
  3662.                 String value = this.reader.getValueConvertEnvProperties(name);

  3663.                 if (value != null){
  3664.                     value = value.trim();
  3665.                     long tmp = Long.parseLong(value); // minuti
  3666.                     if(tmp>0) {
  3667.                         long maxLongValue = ((Long.MAX_VALUE)/60000l);
  3668.                         if(tmp>maxLongValue) {
  3669.                             this.logWarn(getPrefixValoreIndicatoProprieta(value,name)+getSuffixSuperioreMassimoConsentitoControlloDisabilitato(maxLongValue));
  3670.                         }
  3671.                         else {
  3672.                             this.getSoapSecurityTokenTimestampCreatedTimeCheckMilliseconds = tmp * 60 * 1000;
  3673.                         }
  3674.                     }
  3675.                     else {
  3676.                         this.logWarn(getMessaggioVerificaDisabilitata(name));
  3677.                     }
  3678.                 }
  3679.             }catch(java.lang.Exception e) {
  3680.                 this.logError(getMessaggioErroreProprietaNonImpostata(name, e),e);
  3681.                 throw new ProtocolException(e.getMessage(),e);
  3682.             }
  3683.            
  3684.             this.getSoapSecurityTokenTimestampCreatedTimeCheckMillisecondsReaded = true;
  3685.         }

  3686.         return this.getSoapSecurityTokenTimestampCreatedTimeCheckMilliseconds;
  3687.     }
  3688.    
  3689.     private Boolean getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMillisecondsReaded = null;
  3690.     private Long getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMilliseconds = null;
  3691.     public Long getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMilliseconds() throws ProtocolException{

  3692.         if(this.getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMillisecondsReaded==null){
  3693.            
  3694.             String name = "org.openspcoop2.protocol.modipa.soap.securityToken.timestamp.created.future.toleranceMilliseconds";
  3695.             try{  
  3696.                 String value = this.reader.getValueConvertEnvProperties(name);

  3697.                 if (value != null){
  3698.                     value = value.trim();
  3699.                     long tmp = Long.parseLong(value); // già in millisecondi
  3700.                     if(tmp>0) {
  3701.                         long maxLongValue = Long.MAX_VALUE;
  3702.                         if(tmp>maxLongValue) {
  3703.                             this.logWarn(getPrefixValoreIndicatoProprieta(value,name)+getSuffixSuperioreMassimoConsentitoControlloDisabilitato(maxLongValue));
  3704.                         }
  3705.                         else {
  3706.                             this.getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMilliseconds = tmp;
  3707.                         }
  3708.                     }
  3709.                     else {
  3710.                         this.logWarn(getMessaggioVerificaDisabilitata(name));
  3711.                     }
  3712.                 }
  3713.             }catch(java.lang.Exception e) {
  3714.                 this.logError(getMessaggioErroreProprietaNonImpostata(name, e),e);
  3715.                 throw new ProtocolException(e.getMessage(),e);
  3716.             }
  3717.            
  3718.             this.getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMillisecondsReaded = true;
  3719.         }

  3720.         return this.getSoapSecurityTokenTimestampCreatedTimeCheckFutureToleranceMilliseconds;
  3721.     }
  3722.    
  3723.     private Boolean getSoapSecurityTokenFaultProcessEnabledReaded= null;
  3724.     private Boolean getSoapSecurityTokenFaultProcessEnabled= null;
  3725.     public boolean isSoapSecurityTokenFaultProcessEnabled() throws ProtocolException{
  3726.         if(this.getSoapSecurityTokenFaultProcessEnabledReaded==null){
  3727.             String name = "org.openspcoop2.protocol.modipa.soap.fault.securityToken";
  3728.             try{  
  3729.                 String value = this.reader.getValueConvertEnvProperties(name);
  3730.                
  3731.                 if (value != null){
  3732.                     value = value.trim();
  3733.                     this.getSoapSecurityTokenFaultProcessEnabled = Boolean.valueOf(value);
  3734.                 }
  3735.                 else {
  3736.                     throw newProtocolExceptionPropertyNonDefinita();
  3737.                 }
  3738.                
  3739.             }catch(java.lang.Exception e) {
  3740.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3741.                 this.logError(msgErrore);
  3742.                 throw new ProtocolException(msgErrore,e);
  3743.             }
  3744.            
  3745.             this.getSoapSecurityTokenFaultProcessEnabledReaded = true;
  3746.         }
  3747.        
  3748.         return this.getSoapSecurityTokenFaultProcessEnabled;
  3749.     }
  3750.    
  3751.     private Boolean isSoapSecurityTokenTimestampExpiresTimeCheck= null;
  3752.     public boolean isSoapSecurityTokenTimestampExpiresTimeCheck() throws ProtocolException{
  3753.         if(this.isSoapSecurityTokenTimestampExpiresTimeCheck==null){
  3754.             String name = "org.openspcoop2.protocol.modipa.soap.securityToken.timestamp.expires.checkEnabled";
  3755.             try{  
  3756.                 String value = this.reader.getValueConvertEnvProperties(name);
  3757.                
  3758.                 if (value != null){
  3759.                     value = value.trim();
  3760.                     this.isSoapSecurityTokenTimestampExpiresTimeCheck = Boolean.valueOf(value);
  3761.                 }
  3762.                 else {
  3763.                     throw newProtocolExceptionPropertyNonDefinita();
  3764.                 }
  3765.                
  3766.             }catch(java.lang.Exception e) {
  3767.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3768.                 this.logError(msgErrore);
  3769.                 throw new ProtocolException(msgErrore,e);
  3770.             }
  3771.            
  3772.         }
  3773.        
  3774.         return this.isSoapSecurityTokenTimestampExpiresTimeCheck;
  3775.     }  
  3776.    
  3777.     private Boolean getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMillisecondsReaded = null;
  3778.     private Long getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMilliseconds = null;
  3779.     public Long getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMilliseconds() throws ProtocolException{

  3780.         if(this.getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMillisecondsReaded==null){
  3781.            
  3782.             String name = "org.openspcoop2.protocol.modipa.soap.securityToken.timestamp.expires.toleranceMilliseconds";
  3783.             try{  
  3784.                 String value = this.reader.getValueConvertEnvProperties(name);

  3785.                 if (value != null){
  3786.                     value = value.trim();
  3787.                     long tmp = Long.parseLong(value); // già in millisecondi
  3788.                     if(tmp>0) {
  3789.                         long maxLongValue = Long.MAX_VALUE;
  3790.                         if(tmp>maxLongValue) {
  3791.                             this.logWarn(getPrefixValoreIndicatoProprieta(value,name)+getSuffixSuperioreMassimoConsentitoControlloDisabilitato(maxLongValue));
  3792.                         }
  3793.                         else {
  3794.                             this.getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMilliseconds = tmp;
  3795.                         }
  3796.                     }
  3797.                     else {
  3798.                         this.logWarn(getMessaggioVerificaDisabilitata(name));
  3799.                     }
  3800.                 }
  3801.             }catch(java.lang.Exception e) {
  3802.                 this.logError(getMessaggioErroreProprietaNonImpostata(name, e),e);
  3803.                 throw new ProtocolException(e.getMessage(),e);
  3804.             }
  3805.            
  3806.             this.getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMillisecondsReaded = true;
  3807.         }

  3808.         return this.getSoapSecurityTokenTimestampExpiresTimeCheckToleranceMilliseconds;
  3809.     }
  3810.    
  3811.     private Boolean getSoapWSAddressingMustUnderstandReaded= null;
  3812.     private Boolean getSoapWSAddressingMustUnderstand= null;
  3813.     public boolean isSoapWSAddressingMustUnderstand() throws ProtocolException{
  3814.         if(this.getSoapWSAddressingMustUnderstandReaded==null){
  3815.             String name = "org.openspcoop2.protocol.modipa.soap.wsaddressing.mustUnderstand";
  3816.             try{  
  3817.                 String value = this.reader.getValueConvertEnvProperties(name);
  3818.                
  3819.                 if (value != null){
  3820.                     value = value.trim();
  3821.                     this.getSoapWSAddressingMustUnderstand = Boolean.valueOf(value);
  3822.                 }
  3823.                 else {
  3824.                     throw newProtocolExceptionPropertyNonDefinita();
  3825.                 }
  3826.                
  3827.             }catch(java.lang.Exception e) {
  3828.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3829.                 this.logError(msgErrore);
  3830.                 throw new ProtocolException(msgErrore,e);
  3831.             }
  3832.            
  3833.             this.getSoapWSAddressingMustUnderstandReaded = true;
  3834.         }
  3835.        
  3836.         return this.getSoapWSAddressingMustUnderstand;
  3837.     }  
  3838.    
  3839.     private Boolean getSoapWSAddressingActorReaded= null;
  3840.     private String getSoapWSAddressingActor= null;
  3841.     public String getSoapWSAddressingActor() throws ProtocolException{
  3842.         if(this.getSoapWSAddressingActorReaded==null){
  3843.             String name = "org.openspcoop2.protocol.modipa.soap.wsaddressing.actor";
  3844.             try{  
  3845.                 String value = this.reader.getValueConvertEnvProperties(name);
  3846.                
  3847.                 if (value != null){
  3848.                     value = value.trim();
  3849.                     if(!"".equals(value)) {
  3850.                         this.getSoapWSAddressingActor = value;
  3851.                     }
  3852.                 }
  3853.                
  3854.             }catch(java.lang.Exception e) {
  3855.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3856.                 this.logError(msgErrore);
  3857.                 throw new ProtocolException(msgErrore,e);
  3858.             }
  3859.            
  3860.             this.getSoapWSAddressingActorReaded = true;
  3861.         }
  3862.        
  3863.         return this.getSoapWSAddressingActor;
  3864.     }
  3865.    
  3866.     private Boolean getSoapWSAddressingSchemaValidationReaded= null;
  3867.     private Boolean getSoapWSAddressingSchemaValidation= null;
  3868.     public boolean isSoapWSAddressingSchemaValidation() throws ProtocolException{
  3869.         if(this.getSoapWSAddressingSchemaValidationReaded==null){
  3870.             String name = "org.openspcoop2.protocol.modipa.soap.wsaddressing.schemaValidation";
  3871.             try{  
  3872.                 String value = this.reader.getValueConvertEnvProperties(name);
  3873.                
  3874.                 if (value != null){
  3875.                     value = value.trim();
  3876.                     this.getSoapWSAddressingSchemaValidation = Boolean.valueOf(value);
  3877.                 }
  3878.                 else {
  3879.                     throw newProtocolExceptionPropertyNonDefinita();
  3880.                 }
  3881.                
  3882.             }catch(java.lang.Exception e) {
  3883.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3884.                 this.logError(msgErrore);
  3885.                 throw new ProtocolException(msgErrore,e);
  3886.             }
  3887.            
  3888.             this.getSoapWSAddressingSchemaValidationReaded = true;
  3889.         }
  3890.        
  3891.         return this.getSoapWSAddressingSchemaValidation;
  3892.     }  
  3893.    
  3894.    
  3895.     private String getSoapCorrelationIdName= null;
  3896.     public String getSoapCorrelationIdName() throws ProtocolException{
  3897.         if(this.getSoapCorrelationIdName==null){
  3898.             String name = "org.openspcoop2.protocol.modipa.soap.correlationId.name";
  3899.             try{  
  3900.                 String value = this.reader.getValueConvertEnvProperties(name);
  3901.                
  3902.                 if (value != null){
  3903.                     value = value.trim();
  3904.                     this.getSoapCorrelationIdName = value;
  3905.                 }
  3906.                 else {
  3907.                     throw newProtocolExceptionPropertyNonDefinita();
  3908.                 }
  3909.                
  3910.             }catch(java.lang.Exception e) {
  3911.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3912.                 this.logError(msgErrore);
  3913.                 throw new ProtocolException(msgErrore,e);
  3914.             }
  3915.         }
  3916.        
  3917.         return this.getSoapCorrelationIdName;
  3918.     }
  3919.    
  3920.     private String getSoapCorrelationIdNamespace= null;
  3921.     public String getSoapCorrelationIdNamespace() throws ProtocolException{
  3922.         if(this.getSoapCorrelationIdNamespace==null){
  3923.             String name = "org.openspcoop2.protocol.modipa.soap.correlationId.namespace";
  3924.             try{  
  3925.                 String value = this.reader.getValueConvertEnvProperties(name);
  3926.                
  3927.                 if (value != null){
  3928.                     value = value.trim();
  3929.                     this.getSoapCorrelationIdNamespace = value;
  3930.                 }
  3931.                 else {
  3932.                     throw newProtocolExceptionPropertyNonDefinita();
  3933.                 }
  3934.                
  3935.             }catch(java.lang.Exception e) {
  3936.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3937.                 this.logError(msgErrore);
  3938.                 throw new ProtocolException(msgErrore,e);
  3939.             }
  3940.         }
  3941.        
  3942.         return this.getSoapCorrelationIdNamespace;
  3943.     }
  3944.    
  3945.     public boolean useSoapBodyCorrelationIdNamespace() throws ProtocolException {
  3946.         return ModICostanti.MODIPA_USE_BODY_NAMESPACE.equals(this.getSoapCorrelationIdNamespace());
  3947.     }
  3948.    
  3949.     private String getSoapCorrelationIdPrefix= null;
  3950.     public String getSoapCorrelationIdPrefix() throws ProtocolException{
  3951.         if(this.getSoapCorrelationIdPrefix==null){
  3952.             String name = "org.openspcoop2.protocol.modipa.soap.correlationId.prefix";
  3953.             try{  
  3954.                 String value = this.reader.getValueConvertEnvProperties(name);
  3955.                
  3956.                 if (value != null){
  3957.                     value = value.trim();
  3958.                     this.getSoapCorrelationIdPrefix = value;
  3959.                 }
  3960.                 else {
  3961.                     throw newProtocolExceptionPropertyNonDefinita();
  3962.                 }
  3963.                
  3964.             }catch(java.lang.Exception e) {
  3965.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3966.                 this.logError(msgErrore);
  3967.                 throw new ProtocolException(msgErrore,e);
  3968.             }
  3969.         }
  3970.        
  3971.         return this.getSoapCorrelationIdPrefix;
  3972.     }
  3973.    
  3974.     private Boolean getSoapCorrelationIdMustUnderstandReaded= null;
  3975.     private Boolean getSoapCorrelationIdMustUnderstand= null;
  3976.     public boolean isSoapCorrelationIdMustUnderstand() throws ProtocolException{
  3977.         if(this.getSoapCorrelationIdMustUnderstandReaded==null){
  3978.             String name = "org.openspcoop2.protocol.modipa.soap.correlationId.mustUnderstand";
  3979.             try{  
  3980.                 String value = this.reader.getValueConvertEnvProperties(name);
  3981.                
  3982.                 if (value != null){
  3983.                     value = value.trim();
  3984.                     this.getSoapCorrelationIdMustUnderstand = Boolean.valueOf(value);
  3985.                 }
  3986.                 else {
  3987.                     throw newProtocolExceptionPropertyNonDefinita();
  3988.                 }
  3989.                
  3990.             }catch(java.lang.Exception e) {
  3991.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  3992.                 this.logError(msgErrore);
  3993.                 throw new ProtocolException(msgErrore,e);
  3994.             }
  3995.            
  3996.             this.getSoapCorrelationIdMustUnderstandReaded = true;
  3997.         }
  3998.        
  3999.         return this.getSoapCorrelationIdMustUnderstand;
  4000.     }  
  4001.    
  4002.     private Boolean getSoapCorrelationIdActorReaded= null;
  4003.     private String getSoapCorrelationIdActor= null;
  4004.     public String getSoapCorrelationIdActor() throws ProtocolException{
  4005.         if(this.getSoapCorrelationIdActorReaded==null){
  4006.             String name = "org.openspcoop2.protocol.modipa.soap.correlationId.actor";
  4007.             try{  
  4008.                 String value = this.reader.getValueConvertEnvProperties(name);
  4009.                
  4010.                 if (value != null){
  4011.                     value = value.trim();
  4012.                     if(!"".equals(value)) {
  4013.                         this.getSoapCorrelationIdActor = value;
  4014.                     }
  4015.                 }
  4016.                
  4017.             }catch(java.lang.Exception e) {
  4018.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4019.                 this.logError(msgErrore);
  4020.                 throw new ProtocolException(msgErrore,e);
  4021.             }
  4022.            
  4023.             this.getSoapCorrelationIdActorReaded = true;
  4024.         }
  4025.        
  4026.         return this.getSoapCorrelationIdActor;
  4027.     }
  4028.    
  4029.    
  4030.    
  4031.    
  4032.     private String getSoapReplyToName= null;
  4033.     public String getSoapReplyToName() throws ProtocolException{
  4034.         if(this.getSoapReplyToName==null){
  4035.             String name = "org.openspcoop2.protocol.modipa.soap.replyTo.name";
  4036.             try{  
  4037.                 String value = this.reader.getValueConvertEnvProperties(name);
  4038.                
  4039.                 if (value != null){
  4040.                     value = value.trim();
  4041.                     this.getSoapReplyToName = value;
  4042.                 }
  4043.                 else {
  4044.                     throw newProtocolExceptionPropertyNonDefinita();
  4045.                 }
  4046.                
  4047.             }catch(java.lang.Exception e) {
  4048.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4049.                 this.logError(msgErrore);
  4050.                 throw new ProtocolException(msgErrore,e);
  4051.             }
  4052.         }
  4053.        
  4054.         return this.getSoapReplyToName;
  4055.     }
  4056.    
  4057.     private String getSoapReplyToNamespace= null;
  4058.     public String getSoapReplyToNamespace() throws ProtocolException{
  4059.         if(this.getSoapReplyToNamespace==null){
  4060.             String name = "org.openspcoop2.protocol.modipa.soap.replyTo.namespace";
  4061.             try{  
  4062.                 String value = this.reader.getValueConvertEnvProperties(name);
  4063.                
  4064.                 if (value != null){
  4065.                     value = value.trim();
  4066.                     this.getSoapReplyToNamespace = value;
  4067.                 }
  4068.                 else {
  4069.                     throw newProtocolExceptionPropertyNonDefinita();
  4070.                 }
  4071.                
  4072.             }catch(java.lang.Exception e) {
  4073.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4074.                 this.logError(msgErrore);
  4075.                 throw new ProtocolException(msgErrore,e);
  4076.             }
  4077.         }
  4078.        
  4079.         return this.getSoapReplyToNamespace;
  4080.     }
  4081.    
  4082.     public boolean useSoapBodyReplyToNamespace() throws ProtocolException {
  4083.         return ModICostanti.MODIPA_USE_BODY_NAMESPACE.equals(this.getSoapReplyToNamespace());
  4084.     }
  4085.    
  4086.     private String getSoapReplyToPrefix= null;
  4087.     public String getSoapReplyToPrefix() throws ProtocolException{
  4088.         if(this.getSoapReplyToPrefix==null){
  4089.             String name = "org.openspcoop2.protocol.modipa.soap.replyTo.prefix";
  4090.             try{  
  4091.                 String value = this.reader.getValueConvertEnvProperties(name);
  4092.                
  4093.                 if (value != null){
  4094.                     value = value.trim();
  4095.                     this.getSoapReplyToPrefix = value;
  4096.                 }
  4097.                 else {
  4098.                     throw newProtocolExceptionPropertyNonDefinita();
  4099.                 }
  4100.                
  4101.             }catch(java.lang.Exception e) {
  4102.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4103.                 this.logError(msgErrore);
  4104.                 throw new ProtocolException(msgErrore,e);
  4105.             }
  4106.         }
  4107.        
  4108.         return this.getSoapReplyToPrefix;
  4109.     }
  4110.    
  4111.     private Boolean getSoapReplyToMustUnderstandReaded= null;
  4112.     private Boolean getSoapReplyToMustUnderstand= null;
  4113.     public boolean isSoapReplyToMustUnderstand() throws ProtocolException{
  4114.         if(this.getSoapReplyToMustUnderstandReaded==null){
  4115.             String name = "org.openspcoop2.protocol.modipa.soap.replyTo.mustUnderstand";
  4116.             try{  
  4117.                 String value = this.reader.getValueConvertEnvProperties(name);
  4118.                
  4119.                 if (value != null){
  4120.                     value = value.trim();
  4121.                     this.getSoapReplyToMustUnderstand = Boolean.valueOf(value);
  4122.                 }
  4123.                 else {
  4124.                     throw newProtocolExceptionPropertyNonDefinita();
  4125.                 }
  4126.                
  4127.             }catch(java.lang.Exception e) {
  4128.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4129.                 this.logError(msgErrore);
  4130.                 throw new ProtocolException(msgErrore,e);
  4131.             }
  4132.            
  4133.             this.getSoapReplyToMustUnderstandReaded = true;
  4134.         }
  4135.        
  4136.         return this.getSoapReplyToMustUnderstand;
  4137.     }  
  4138.    
  4139.     private Boolean getSoapReplyToActorReaded= null;
  4140.     private String getSoapReplyToActor= null;
  4141.     public String getSoapReplyToActor() throws ProtocolException{
  4142.         if(this.getSoapReplyToActorReaded==null){
  4143.             String name = "org.openspcoop2.protocol.modipa.soap.replyTo.actor";
  4144.             try{  
  4145.                 String value = this.reader.getValueConvertEnvProperties(name);
  4146.                
  4147.                 if (value != null){
  4148.                     value = value.trim();
  4149.                     if(!"".equals(value)) {
  4150.                         this.getSoapReplyToActor = value;
  4151.                     }
  4152.                 }
  4153.                
  4154.             }catch(java.lang.Exception e) {
  4155.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4156.                 this.logError(msgErrore);
  4157.                 throw new ProtocolException(msgErrore,e);
  4158.             }
  4159.            
  4160.             this.getSoapReplyToActorReaded = true;
  4161.         }
  4162.        
  4163.         return this.getSoapReplyToActor;
  4164.     }
  4165.    
  4166.    
  4167.     private String getSoapRequestDigestName= null;
  4168.     public String getSoapRequestDigestName() throws ProtocolException{
  4169.         if(this.getSoapRequestDigestName==null){
  4170.             String name = "org.openspcoop2.protocol.modipa.soap.requestDigest.name";
  4171.             try{  
  4172.                 String value = this.reader.getValueConvertEnvProperties(name);
  4173.                
  4174.                 if (value != null){
  4175.                     value = value.trim();
  4176.                     this.getSoapRequestDigestName = value;
  4177.                 }
  4178.                 else {
  4179.                     throw newProtocolExceptionPropertyNonDefinita();
  4180.                 }
  4181.                
  4182.             }catch(java.lang.Exception e) {
  4183.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4184.                 this.logError(msgErrore);
  4185.                 throw new ProtocolException(msgErrore,e);
  4186.             }
  4187.         }
  4188.        
  4189.         return this.getSoapRequestDigestName;
  4190.     }
  4191.    
  4192.     private String getSoapRequestDigestNamespace= null;
  4193.     public String getSoapRequestDigestNamespace() throws ProtocolException{
  4194.         if(this.getSoapRequestDigestNamespace==null){
  4195.             String name = "org.openspcoop2.protocol.modipa.soap.requestDigest.namespace";
  4196.             try{  
  4197.                 String value = this.reader.getValueConvertEnvProperties(name);
  4198.                
  4199.                 if (value != null){
  4200.                     value = value.trim();
  4201.                     this.getSoapRequestDigestNamespace = value;
  4202.                 }
  4203.                 else {
  4204.                     throw newProtocolExceptionPropertyNonDefinita();
  4205.                 }
  4206.                
  4207.             }catch(java.lang.Exception e) {
  4208.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4209.                 this.logError(msgErrore);
  4210.                 throw new ProtocolException(msgErrore,e);
  4211.             }
  4212.         }
  4213.        
  4214.         return this.getSoapRequestDigestNamespace;
  4215.     }
  4216.    
  4217.     public boolean useSoapBodyRequestDigestNamespace() throws ProtocolException {
  4218.         return ModICostanti.MODIPA_USE_BODY_NAMESPACE.equals(this.getSoapRequestDigestNamespace());
  4219.     }
  4220.    
  4221.     private String getSoapRequestDigestPrefix= null;
  4222.     public String getSoapRequestDigestPrefix() throws ProtocolException{
  4223.         if(this.getSoapRequestDigestPrefix==null){
  4224.             String name = "org.openspcoop2.protocol.modipa.soap.requestDigest.prefix";
  4225.             try{  
  4226.                 String value = this.reader.getValueConvertEnvProperties(name);
  4227.                
  4228.                 if (value != null){
  4229.                     value = value.trim();
  4230.                     this.getSoapRequestDigestPrefix = value;
  4231.                 }
  4232.                 else {
  4233.                     throw newProtocolExceptionPropertyNonDefinita();
  4234.                 }
  4235.                
  4236.             }catch(java.lang.Exception e) {
  4237.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4238.                 this.logError(msgErrore);
  4239.                 throw new ProtocolException(msgErrore,e);
  4240.             }
  4241.         }
  4242.        
  4243.         return this.getSoapRequestDigestPrefix;
  4244.     }
  4245.    
  4246.     private Boolean getSoapRequestDigestMustUnderstandReaded= null;
  4247.     private Boolean getSoapRequestDigestMustUnderstand= null;
  4248.     public boolean isSoapRequestDigestMustUnderstand() throws ProtocolException{
  4249.         if(this.getSoapRequestDigestMustUnderstandReaded==null){
  4250.             String name = "org.openspcoop2.protocol.modipa.soap.requestDigest.mustUnderstand";
  4251.             try{  
  4252.                 String value = this.reader.getValueConvertEnvProperties(name);
  4253.                
  4254.                 if (value != null){
  4255.                     value = value.trim();
  4256.                     this.getSoapRequestDigestMustUnderstand = Boolean.valueOf(value);
  4257.                 }
  4258.                 else {
  4259.                     throw newProtocolExceptionPropertyNonDefinita();
  4260.                 }
  4261.                
  4262.             }catch(java.lang.Exception e) {
  4263.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4264.                 this.logError(msgErrore);
  4265.                 throw new ProtocolException(msgErrore,e);
  4266.             }
  4267.            
  4268.             this.getSoapRequestDigestMustUnderstandReaded = true;
  4269.         }
  4270.        
  4271.         return this.getSoapRequestDigestMustUnderstand;
  4272.     }  
  4273.    
  4274.     private Boolean getSoapRequestDigestActorReaded= null;
  4275.     private String getSoapRequestDigestActor= null;
  4276.     public String getSoapRequestDigestActor() throws ProtocolException{
  4277.         if(this.getSoapRequestDigestActorReaded==null){
  4278.             String name = "org.openspcoop2.protocol.modipa.soap.requestDigest.actor";
  4279.             try{  
  4280.                 String value = this.reader.getValueConvertEnvProperties(name);
  4281.                
  4282.                 if (value != null){
  4283.                     value = value.trim();
  4284.                     if(!"".equals(value)) {
  4285.                         this.getSoapRequestDigestActor = value;
  4286.                     }
  4287.                 }
  4288.                
  4289.             }catch(java.lang.Exception e) {
  4290.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4291.                 this.logError(msgErrore);
  4292.                 throw new ProtocolException(msgErrore,e);
  4293.             }
  4294.            
  4295.             this.getSoapRequestDigestActorReaded = true;
  4296.         }
  4297.        
  4298.         return this.getSoapRequestDigestActor;
  4299.     }
  4300.    
  4301.     private Boolean getSoapSecurityTokenWsaToReaded= null;
  4302.     private String getSoapSecurityTokenWsaTo= null;
  4303.     private String getSoapSecurityTokenWsaTo() throws ProtocolException{
  4304.         if(this.getSoapSecurityTokenWsaToReaded==null){
  4305.             String name = "org.openspcoop2.protocol.modipa.soap.securityToken.wsaTo";
  4306.             try{  
  4307.                 String value = this.reader.getValueConvertEnvProperties(name);
  4308.                 if (value != null){
  4309.                     value = value.trim();
  4310.                     this.getSoapSecurityTokenWsaTo = value;
  4311.                 }
  4312.                 else {
  4313.                     throw newProtocolExceptionPropertyNonDefinita();
  4314.                 }
  4315.                
  4316.             }catch(java.lang.Exception e) {
  4317.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4318.                 this.logError(msgErrore);
  4319.                 throw new ProtocolException(msgErrore,e);
  4320.             }
  4321.            
  4322.             this.getSoapSecurityTokenWsaToReaded = true;
  4323.         }
  4324.        
  4325.         return this.getSoapSecurityTokenWsaTo;
  4326.     }
  4327.     private Boolean getSoapSecurityTokenWsaToSoapAction= null;
  4328.     private Boolean getSoapSecurityTokenWsaToOperation= null;
  4329.     private Boolean getSoapSecurityTokenWsaToNone= null;
  4330.     public boolean isSoapSecurityTokenWsaToSoapAction() throws ProtocolException {
  4331.         if(this.getSoapSecurityTokenWsaToSoapAction==null) {
  4332.             this.getSoapSecurityTokenWsaToSoapAction = ModICostanti.CONFIG_MODIPA_SOAP_SECURITY_TOKEN_WSA_TO_KEYWORD_SOAP_ACTION.equalsIgnoreCase(getSoapSecurityTokenWsaTo());
  4333.         }
  4334.         return this.getSoapSecurityTokenWsaToSoapAction;
  4335.     }
  4336.     public boolean isSoapSecurityTokenWsaToOperation() throws ProtocolException {
  4337.         if(this.getSoapSecurityTokenWsaToOperation==null) {
  4338.             this.getSoapSecurityTokenWsaToOperation = ModICostanti.CONFIG_MODIPA_SOAP_SECURITY_TOKEN_WSA_TO_KEYWORD_OPERATION.equalsIgnoreCase(getSoapSecurityTokenWsaTo());
  4339.         }
  4340.         return this.getSoapSecurityTokenWsaToOperation;
  4341.     }
  4342.     public boolean isSoapSecurityTokenWsaToDisabled() throws ProtocolException {
  4343.         if(this.getSoapSecurityTokenWsaToNone==null) {
  4344.             this.getSoapSecurityTokenWsaToNone = ModICostanti.CONFIG_MODIPA_SOAP_SECURITY_TOKEN_WSA_TO_KEYWORD_NONE.equalsIgnoreCase(getSoapSecurityTokenWsaTo());
  4345.         }
  4346.         return this.getSoapSecurityTokenWsaToNone;
  4347.     }
  4348.    
  4349.     private Boolean getSoapResponseSecurityTokenAudienceDefaultReaded= null;
  4350.     private String getSoapResponseSecurityTokenAudienceDefault= null;
  4351.     public String getSoapResponseSecurityTokenAudienceDefault(String soggettoMittente) throws ProtocolException{
  4352.         if(this.getSoapResponseSecurityTokenAudienceDefaultReaded==null){
  4353.             String name = "org.openspcoop2.protocol.modipa.soap.response.securityToken.audience.default";
  4354.             try{  
  4355.                 String value = this.reader.getValueConvertEnvProperties(name);
  4356.                 if (value != null){
  4357.                     value = value.trim();
  4358.                     this.getSoapResponseSecurityTokenAudienceDefault = value;
  4359.                 }
  4360.                
  4361.             }catch(java.lang.Exception e) {
  4362.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4363.                 this.logError(msgErrore);
  4364.                 throw new ProtocolException(msgErrore,e);
  4365.             }
  4366.            
  4367.             this.getSoapResponseSecurityTokenAudienceDefaultReaded = true;
  4368.         }
  4369.        
  4370.         if(ModICostanti.CONFIG_MODIPA_SOGGETTO_MITTENTE_KEYWORD.equalsIgnoreCase(this.getSoapResponseSecurityTokenAudienceDefault) && soggettoMittente!=null && !StringUtils.isEmpty(soggettoMittente)) {
  4371.             return soggettoMittente;
  4372.         }
  4373.         else {
  4374.             return this.getSoapResponseSecurityTokenAudienceDefault;
  4375.         }
  4376.     }
  4377.    
  4378.     // .. PUSH ..
  4379.    
  4380.     private Boolean getSoapSecurityTokenPushReplyToUpdateOrCreate = null;
  4381.     public boolean isSoapSecurityTokenPushReplyToUpdateOrCreateInFruizione() throws ProtocolException{
  4382.         if(this.getSoapSecurityTokenPushReplyToUpdateOrCreate==null){
  4383.             String name = "org.openspcoop2.protocol.modipa.soap.push.replyTo.header.updateOrCreate";
  4384.             try{  
  4385.                 String value = this.reader.getValueConvertEnvProperties(name);
  4386.                
  4387.                 if (value != null){
  4388.                     value = value.trim();
  4389.                     this.getSoapSecurityTokenPushReplyToUpdateOrCreate = Boolean.valueOf(value);
  4390.                 }
  4391.                 else {
  4392.                     throw newProtocolExceptionPropertyNonDefinita();
  4393.                 }
  4394.                
  4395.             }catch(java.lang.Exception e) {
  4396.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4397.                 this.logError(msgErrore);
  4398.                 throw new ProtocolException(msgErrore,e);
  4399.             }
  4400.         }
  4401.        
  4402.         return this.getSoapSecurityTokenPushReplyToUpdateOrCreate;
  4403.     }
  4404.    
  4405.     private Boolean getSoapSecurityTokenPushReplyToUpdate = null;
  4406.     public boolean isSoapSecurityTokenPushReplyToUpdateInErogazione() throws ProtocolException{
  4407.         if(this.getSoapSecurityTokenPushReplyToUpdate==null){
  4408.             String name = "org.openspcoop2.protocol.modipa.soap.push.replyTo.header.update";
  4409.             try{  
  4410.                 String value = this.reader.getValueConvertEnvProperties(name);
  4411.                
  4412.                 if (value != null){
  4413.                     value = value.trim();
  4414.                     this.getSoapSecurityTokenPushReplyToUpdate = Boolean.valueOf(value);
  4415.                 }
  4416.                 else {
  4417.                     throw newProtocolExceptionPropertyNonDefinita();
  4418.                 }
  4419.                
  4420.             }catch(java.lang.Exception e) {
  4421.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4422.                 this.logError(msgErrore);
  4423.                 throw new ProtocolException(msgErrore,e);
  4424.             }
  4425.         }
  4426.        
  4427.         return this.getSoapSecurityTokenPushReplyToUpdate;
  4428.     }
  4429.    
  4430.     private Boolean getSoapSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists = null;
  4431.     public boolean isSoapSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists() throws ProtocolException{
  4432.         if(this.getSoapSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists==null){
  4433.             String name = "org.openspcoop2.protocol.modipa.soap.push.request.correlationId.header.useTransactionIdIfNotExists";
  4434.             try{  
  4435.                 String value = this.reader.getValueConvertEnvProperties(name);
  4436.                
  4437.                 if (value != null){
  4438.                     value = value.trim();
  4439.                     this.getSoapSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists = Boolean.valueOf(value);
  4440.                 }
  4441.                 else {
  4442.                     throw newProtocolExceptionPropertyNonDefinita();
  4443.                 }
  4444.                
  4445.             }catch(java.lang.Exception e) {
  4446.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4447.                 this.logError(msgErrore);
  4448.                 throw new ProtocolException(msgErrore,e);
  4449.             }
  4450.         }
  4451.        
  4452.         return this.getSoapSecurityTokenPushCorrelationIdUseTransactionIdIfNotExists;
  4453.     }
  4454.    
  4455.     private Boolean getSoapSecurityTokenPullCorrelationIdUseTransactionIdIfNotExists = null;
  4456.     public boolean isSoapSecurityTokenPullCorrelationIdUseTransactionIdIfNotExists() throws ProtocolException{
  4457.         if(this.getSoapSecurityTokenPullCorrelationIdUseTransactionIdIfNotExists==null){
  4458.             String name = "org.openspcoop2.protocol.modipa.soap.pull.request.correlationId.header.useTransactionIdIfNotExists";
  4459.             try{  
  4460.                 String value = this.reader.getValueConvertEnvProperties(name);
  4461.                
  4462.                 if (value != null){
  4463.                     value = value.trim();
  4464.                     this.getSoapSecurityTokenPullCorrelationIdUseTransactionIdIfNotExists = Boolean.valueOf(value);
  4465.                 }
  4466.                 else {
  4467.                     throw newProtocolExceptionPropertyNonDefinita();
  4468.                 }
  4469.                
  4470.             }catch(java.lang.Exception e) {
  4471.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  4472.                 this.logError(msgErrore);
  4473.                 throw new ProtocolException(msgErrore,e);
  4474.             }
  4475.         }
  4476.        
  4477.         return this.getSoapSecurityTokenPullCorrelationIdUseTransactionIdIfNotExists;
  4478.     }
  4479.    
  4480.    
  4481.    
  4482.    
  4483.     /* **** CONFIGURAZIONE **** */
  4484.    
  4485.     private Boolean isReadByPathBufferEnabled = null;
  4486.     public Boolean isReadByPathBufferEnabled(){
  4487.         if(this.isReadByPathBufferEnabled==null){
  4488.             String pName = "org.openspcoop2.protocol.modipa.readByPath.buffer";
  4489.             try{  
  4490.                 String value = this.reader.getValueConvertEnvProperties(pName);
  4491.                
  4492.                 if (value != null){
  4493.                     value = value.trim();
  4494.                     this.isReadByPathBufferEnabled = Boolean.parseBoolean(value);
  4495.                 }else{
  4496.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(pName, true));
  4497.                     this.isReadByPathBufferEnabled = true;
  4498.                 }

  4499.             }catch(java.lang.Exception e) {
  4500.                 this.logWarn(getMessaggioErroreProprietaNonImpostata(pName, true)+getSuffixErrore(e));
  4501.                 this.isReadByPathBufferEnabled = true;
  4502.             }
  4503.         }
  4504.        
  4505.         return this.isReadByPathBufferEnabled;
  4506.     }
  4507.    
  4508.     private Boolean isValidazioneBufferEnabled = null;
  4509.     public Boolean isValidazioneBufferEnabled(){
  4510.         if(this.isValidazioneBufferEnabled==null){
  4511.             String pName = "org.openspcoop2.protocol.modipa.validazione.buffer";
  4512.             try{  
  4513.                 String value = this.reader.getValueConvertEnvProperties(pName);
  4514.                
  4515.                 if (value != null){
  4516.                     value = value.trim();
  4517.                     this.isValidazioneBufferEnabled = Boolean.parseBoolean(value);
  4518.                 }else{
  4519.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(pName, true));
  4520.                     this.isValidazioneBufferEnabled = true;
  4521.                 }

  4522.             }catch(java.lang.Exception e) {
  4523.                 this.logWarn(getMessaggioErroreProprietaNonImpostata(pName, true)+getSuffixErrore(e));
  4524.                 this.isValidazioneBufferEnabled = true;
  4525.             }
  4526.         }
  4527.        
  4528.         return this.isValidazioneBufferEnabled;
  4529.     }
  4530.    
  4531.     /**
  4532.      * 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
  4533.      *
  4534.      * @return True se la funzionalita' 'Riferimento ID Richiesta' richiede che venga fornito obbligatoriamente l'informazione sull'identificativo della richiesta tramite i meccanismi di integrazione
  4535.      *
  4536.      */
  4537.     private Boolean isRiferimentoIDRichiestaPortaDelegataRequired= null;
  4538.     private Boolean isRiferimentoIDRichiestaPortaDelegataRequiredRead= null;
  4539.     public Boolean isRiferimentoIDRichiestaPortaDelegataRequired(){
  4540.         if(this.isRiferimentoIDRichiestaPortaDelegataRequiredRead==null){
  4541.             try{  
  4542.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.pd.riferimentoIdRichiesta.required");
  4543.                
  4544.                 if (value != null){
  4545.                     value = value.trim();
  4546.                     this.isRiferimentoIDRichiestaPortaDelegataRequired = Boolean.parseBoolean(value);
  4547.                 }else{
  4548.                     this.logDebug(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.pd.riferimentoIdRichiesta.required", true));
  4549.                     this.isRiferimentoIDRichiestaPortaDelegataRequired = true;
  4550.                 }
  4551.                
  4552.                 this.isRiferimentoIDRichiestaPortaDelegataRequiredRead = true;
  4553.                
  4554.             }catch(java.lang.Exception e) {
  4555.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.pd.riferimentoIdRichiesta.required' non impostata, viene utilizzato il default 'true', errore:"+e.getMessage());
  4556.                 this.isRiferimentoIDRichiestaPortaDelegataRequired = true;
  4557.                
  4558.                 this.isRiferimentoIDRichiestaPortaDelegataRequiredRead = true;
  4559.             }
  4560.         }
  4561.        
  4562.         return this.isRiferimentoIDRichiestaPortaDelegataRequired;
  4563.     }
  4564.    
  4565.     private Boolean isRiferimentoIDRichiestaPortaApplicativaRequired= null;
  4566.     private Boolean isRiferimentoIDRichiestaPortaApplicativaRequiredRead= null;
  4567.     public Boolean isRiferimentoIDRichiestaPortaApplicativaRequired(){
  4568.         if(this.isRiferimentoIDRichiestaPortaApplicativaRequiredRead==null){
  4569.             try{  
  4570.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.pa.riferimentoIdRichiesta.required");
  4571.                
  4572.                 if (value != null){
  4573.                     value = value.trim();
  4574.                     this.isRiferimentoIDRichiestaPortaApplicativaRequired = Boolean.parseBoolean(value);
  4575.                 }else{
  4576.                     this.logDebug(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.pa.riferimentoIdRichiesta.required", true));
  4577.                     this.isRiferimentoIDRichiestaPortaApplicativaRequired = true;
  4578.                 }
  4579.                
  4580.                 this.isRiferimentoIDRichiestaPortaApplicativaRequiredRead = true;
  4581.                
  4582.             }catch(java.lang.Exception e) {
  4583.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.pa.riferimentoIdRichiesta.required' non impostata, viene utilizzato il default 'true', errore:"+e.getMessage());
  4584.                 this.isRiferimentoIDRichiestaPortaApplicativaRequired = true;
  4585.                
  4586.                 this.isRiferimentoIDRichiestaPortaApplicativaRequiredRead = true;
  4587.             }
  4588.         }
  4589.        
  4590.         return this.isRiferimentoIDRichiestaPortaApplicativaRequired;
  4591.     }
  4592.    
  4593.     private Boolean isTokenOAuthUseJtiIntegrityAsMessageId= null;
  4594.     private Boolean isTokenOAuthUseJtiIntegrityAsMessageIdRead= null;
  4595.     public Boolean isTokenOAuthUseJtiIntegrityAsMessageId(){
  4596.         if(this.isTokenOAuthUseJtiIntegrityAsMessageIdRead==null){
  4597.             String pName = "org.openspcoop2.protocol.modipa.tokenOAuthIntegrity.useJtiIntegrityAsMessageId";
  4598.             try{  
  4599.                 String value = this.reader.getValueConvertEnvProperties(pName);
  4600.                
  4601.                 if (value != null){
  4602.                     value = value.trim();
  4603.                     this.isTokenOAuthUseJtiIntegrityAsMessageId = Boolean.parseBoolean(value);
  4604.                 }else{
  4605.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(pName, true));
  4606.                     this.isTokenOAuthUseJtiIntegrityAsMessageId = true;
  4607.                 }
  4608.                
  4609.                 this.isTokenOAuthUseJtiIntegrityAsMessageIdRead = true;
  4610.                
  4611.             }catch(java.lang.Exception e) {
  4612.                 this.logWarn(PREFIX_PROPRIETA+pName+"' non impostata, viene utilizzato il default 'true', errore:"+e.getMessage());
  4613.                 this.isTokenOAuthUseJtiIntegrityAsMessageId = true;
  4614.                
  4615.                 this.isTokenOAuthUseJtiIntegrityAsMessageIdRead = true;
  4616.             }
  4617.         }
  4618.        
  4619.         return this.isTokenOAuthUseJtiIntegrityAsMessageId;
  4620.     }
  4621.    
  4622.    

  4623.     /* **** SOAP FAULT (Protocollo, Porta Applicativa) **** */
  4624.    
  4625.     /**
  4626.      * Indicazione se ritornare un soap fault personalizzato nel codice/actor/faultString per i messaggi di errore di protocollo (Porta Applicativa)
  4627.      *  
  4628.      * @return Indicazione se ritornare un soap fault personalizzato nel codice/actor/faultString per i messaggi di errore di protocollo (Porta Applicativa)
  4629.      *
  4630.      */
  4631.     private Boolean isPortaApplicativaBustaErrorePersonalizzaElementiFault= null;
  4632.     private Boolean isPortaApplicativaBustaErrorePersonalizzaElementiFaultRead= null;
  4633.     public Boolean isPortaApplicativaBustaErrorePersonalizzaElementiFault(){
  4634.         if(this.isPortaApplicativaBustaErrorePersonalizzaElementiFaultRead==null){
  4635.             try{  
  4636.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.pa.bustaErrore.personalizzaElementiFault");
  4637.                
  4638.                 if (value != null){
  4639.                     value = value.trim();
  4640.                     this.isPortaApplicativaBustaErrorePersonalizzaElementiFault = Boolean.parseBoolean(value);
  4641.                 }else{
  4642.                     this.logDebug("Proprietà 'org.openspcoop2.protocol.modipa.pa.bustaErrore.personalizzaElementiFault' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultApplicativo.enrichDetails)");
  4643.                     this.isPortaApplicativaBustaErrorePersonalizzaElementiFault = null;
  4644.                 }
  4645.                
  4646.                 this.isPortaApplicativaBustaErrorePersonalizzaElementiFaultRead = true;
  4647.                
  4648.             }catch(java.lang.Exception e) {
  4649.                 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());
  4650.                 this.isPortaApplicativaBustaErrorePersonalizzaElementiFault = null;
  4651.                
  4652.                 this.isPortaApplicativaBustaErrorePersonalizzaElementiFaultRead = true;
  4653.             }
  4654.         }
  4655.        
  4656.         return this.isPortaApplicativaBustaErrorePersonalizzaElementiFault;
  4657.     }
  4658.    
  4659.    
  4660.     /**
  4661.      * Indicazione se deve essere aggiunto un errore-applicativo nei details di un messaggio di errore di protocollo (Porta Applicativa)
  4662.      *  
  4663.      * @return Indicazione se deve essere aggiunto un errore-applicativo nei details di un messaggio di errore di protocollo (Porta Applicativa)
  4664.      *
  4665.      */
  4666.     private Boolean isPortaApplicativaBustaErroreAggiungiErroreApplicativo= null;
  4667.     private Boolean isPortaApplicativaBustaErroreAggiungiErroreApplicativoRead= null;
  4668.     public Boolean isPortaApplicativaBustaErroreAggiungiErroreApplicativo(){
  4669.         if(this.isPortaApplicativaBustaErroreAggiungiErroreApplicativoRead==null){
  4670.             try{  
  4671.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.pa.bustaErrore.aggiungiErroreApplicativo");
  4672.                
  4673.                 if (value != null){
  4674.                     value = value.trim();
  4675.                     this.isPortaApplicativaBustaErroreAggiungiErroreApplicativo = Boolean.parseBoolean(value);
  4676.                 }else{
  4677.                     this.logDebug("Proprietà 'org.openspcoop2.protocol.modipa.pa.bustaErrore.aggiungiErroreApplicativo' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultApplicativo.enrichDetails)");
  4678.                     this.isPortaApplicativaBustaErroreAggiungiErroreApplicativo = null;
  4679.                 }
  4680.                
  4681.                 this.isPortaApplicativaBustaErroreAggiungiErroreApplicativoRead = true;
  4682.                
  4683.             }catch(java.lang.Exception e) {
  4684.                 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());
  4685.                 this.isPortaApplicativaBustaErroreAggiungiErroreApplicativo = null;
  4686.                
  4687.                 this.isPortaApplicativaBustaErroreAggiungiErroreApplicativoRead = true;
  4688.             }
  4689.         }
  4690.        
  4691.         return this.isPortaApplicativaBustaErroreAggiungiErroreApplicativo;
  4692.     }
  4693.    
  4694.     /**
  4695.      * Indicazione se generare i details in caso di SOAPFault *_001 (senza buste Errore)
  4696.      *  
  4697.      * @return Indicazione se generare i details in caso di SOAPFault *_001 (senza buste Errore)
  4698.      *
  4699.      */
  4700.     private Boolean isGenerazioneDetailsSOAPFaultProtocolValidazione = null;
  4701.     public boolean isGenerazioneDetailsSOAPFaultProtocolValidazione(){
  4702.         if(this.isGenerazioneDetailsSOAPFaultProtocolValidazione==null){
  4703.             try{  
  4704.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.eccezioneIntestazione");
  4705.                
  4706.                 if (value != null){
  4707.                     value = value.trim();
  4708.                     this.isGenerazioneDetailsSOAPFaultProtocolValidazione = Boolean.parseBoolean(value);
  4709.                 }else{
  4710.                     this.logWarn(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.eccezioneIntestazione", false));
  4711.                     this.isGenerazioneDetailsSOAPFaultProtocolValidazione = false;
  4712.                 }
  4713.                
  4714.             }catch(java.lang.Exception e) {
  4715.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.eccezioneIntestazione' non impostata, viene utilizzato il default=false, errore:"+e.getMessage());
  4716.                 this.isGenerazioneDetailsSOAPFaultProtocolValidazione = false;
  4717.             }
  4718.         }
  4719.        
  4720.         return this.isGenerazioneDetailsSOAPFaultProtocolValidazione;
  4721.     }
  4722.    
  4723.     /**
  4724.      * Indicazione se generare i details in caso di SOAPFault *_300
  4725.      *  
  4726.      * @return Indicazione se generare i details in caso di SOAPFault *_300
  4727.      *
  4728.      */
  4729.     private Boolean isGenerazioneDetailsSOAPFaultProtocolProcessamento = null;
  4730.     public boolean isGenerazioneDetailsSOAPFaultProtocolProcessamento(){
  4731.         if(this.isGenerazioneDetailsSOAPFaultProtocolProcessamento==null){
  4732.             try{  
  4733.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.eccezioneProcessamento");
  4734.                
  4735.                 if (value != null){
  4736.                     value = value.trim();
  4737.                     this.isGenerazioneDetailsSOAPFaultProtocolProcessamento = Boolean.parseBoolean(value);
  4738.                 }else{
  4739.                     this.logWarn(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.eccezioneProcessamento", true));
  4740.                     this.isGenerazioneDetailsSOAPFaultProtocolProcessamento = true;
  4741.                 }
  4742.                
  4743.             }catch(java.lang.Exception e) {
  4744.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.eccezioneProcessamento' non impostata, viene utilizzato il default=true, errore:"+e.getMessage());
  4745.                 this.isGenerazioneDetailsSOAPFaultProtocolProcessamento = true;
  4746.             }
  4747.         }
  4748.        
  4749.         return this.isGenerazioneDetailsSOAPFaultProtocolProcessamento;
  4750.     }
  4751.    
  4752.    
  4753.     /**
  4754.      * Indicazione se generare nei details in caso di SOAPFault *_300 lo stack trace
  4755.      *  
  4756.      * @return Indicazione se generare nei details in caso di SOAPFault *_300 lo stack trace
  4757.      *
  4758.      */
  4759.     private Boolean isGenerazioneDetailsSOAPFaultProtocolWithStackTrace = null;
  4760.     public boolean isGenerazioneDetailsSOAPFaultProtocolWithStackTrace(){
  4761.         if(this.isGenerazioneDetailsSOAPFaultProtocolWithStackTrace==null){
  4762.             try{  
  4763.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.stackTrace");
  4764.                
  4765.                 if (value != null){
  4766.                     value = value.trim();
  4767.                     this.isGenerazioneDetailsSOAPFaultProtocolWithStackTrace = Boolean.parseBoolean(value);
  4768.                 }else{
  4769.                     this.logWarn(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.stackTrace", false));
  4770.                     this.isGenerazioneDetailsSOAPFaultProtocolWithStackTrace = false;
  4771.                 }
  4772.                
  4773.             }catch(java.lang.Exception e) {
  4774.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.stackTrace' non impostata, viene utilizzato il default=false, errore:"+e.getMessage());
  4775.                 this.isGenerazioneDetailsSOAPFaultProtocolWithStackTrace = false;
  4776.             }
  4777.         }
  4778.        
  4779.         return this.isGenerazioneDetailsSOAPFaultProtocolWithStackTrace;
  4780.     }
  4781.    
  4782.     /**
  4783.      * Indicazione se generare nei details in caso di SOAPFault informazioni generiche
  4784.      *  
  4785.      * @return Indicazione se generare nei details in caso di SOAPFault informazioni generiche
  4786.      *
  4787.      */
  4788.     private Boolean isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche = null;
  4789.     public boolean isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche(){
  4790.         if(this.isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche==null){
  4791.             try{  
  4792.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.informazioniGeneriche");
  4793.                
  4794.                 if (value != null){
  4795.                     value = value.trim();
  4796.                     this.isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche = Boolean.parseBoolean(value);
  4797.                 }else{
  4798.                     this.logWarn(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.informazioniGeneriche", true));
  4799.                     this.isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche = true;
  4800.                 }
  4801.                
  4802.             }catch(java.lang.Exception e) {
  4803.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.protocol.informazioniGeneriche' non impostata, viene utilizzato il default=true, errore:"+e.getMessage());
  4804.                 this.isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche = true;
  4805.             }
  4806.         }
  4807.        
  4808.         return this.isGenerazioneDetailsSOAPFaultProtocolConInformazioniGeneriche;
  4809.     }
  4810.    
  4811.    
  4812.    
  4813.     /* **** SOAP FAULT (Integrazione, Porta Delegata) **** */
  4814.    
  4815.     /**
  4816.      * Indicazione se generare i details in Casi di errore 5XX
  4817.      *  
  4818.      * @return Indicazione se generare i details in Casi di errore 5XX
  4819.      *
  4820.      */
  4821.     private Boolean isGenerazioneDetailsSOAPFaultIntegrationServerError = null;
  4822.     public boolean isGenerazioneDetailsSOAPFaultIntegrationServerError(){
  4823.         if(this.isGenerazioneDetailsSOAPFaultIntegrationServerError==null){
  4824.             try{  
  4825.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.serverError");
  4826.                
  4827.                 if (value != null){
  4828.                     value = value.trim();
  4829.                     this.isGenerazioneDetailsSOAPFaultIntegrationServerError = Boolean.parseBoolean(value);
  4830.                 }else{
  4831.                     this.logWarn(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.serverError", true));
  4832.                     this.isGenerazioneDetailsSOAPFaultIntegrationServerError = true;
  4833.                 }
  4834.                
  4835.             }catch(java.lang.Exception e) {
  4836.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.serverError' non impostata, viene utilizzato il default=true, errore:"+e.getMessage());
  4837.                 this.isGenerazioneDetailsSOAPFaultIntegrationServerError = true;
  4838.             }
  4839.         }
  4840.        
  4841.         return this.isGenerazioneDetailsSOAPFaultIntegrationServerError;
  4842.     }
  4843.    
  4844.     /**
  4845.      * Indicazione se generare i details in Casi di errore 4XX
  4846.      *  
  4847.      * @return Indicazione se generare i details in Casi di errore 4XX
  4848.      *
  4849.      */
  4850.     private Boolean isGenerazioneDetailsSOAPFaultIntegrationClientError = null;
  4851.     public boolean isGenerazioneDetailsSOAPFaultIntegrationClientError(){
  4852.         if(this.isGenerazioneDetailsSOAPFaultIntegrationClientError==null){
  4853.             try{  
  4854.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.clientError");
  4855.                
  4856.                 if (value != null){
  4857.                     value = value.trim();
  4858.                     this.isGenerazioneDetailsSOAPFaultIntegrationClientError = Boolean.parseBoolean(value);
  4859.                 }else{
  4860.                     this.logWarn(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.clientError", false));
  4861.                     this.isGenerazioneDetailsSOAPFaultIntegrationClientError = false;
  4862.                 }
  4863.                
  4864.             }catch(java.lang.Exception e) {
  4865.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.clientError' non impostata, viene utilizzato il default=false, errore:"+e.getMessage());
  4866.                 this.isGenerazioneDetailsSOAPFaultIntegrationClientError = false;
  4867.             }
  4868.         }
  4869.        
  4870.         return this.isGenerazioneDetailsSOAPFaultIntegrationClientError;
  4871.     }
  4872.    
  4873.     /**
  4874.      * Indicazione se generare nei details lo stack trace all'interno
  4875.      *  
  4876.      * @return Indicazione se generare nei details lo stack trace all'interno
  4877.      *
  4878.      */
  4879.     private Boolean isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace = null;
  4880.     public boolean isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace(){
  4881.         if(this.isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace==null){
  4882.             try{  
  4883.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.stackTrace");
  4884.                
  4885.                 if (value != null){
  4886.                     value = value.trim();
  4887.                     this.isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace = Boolean.parseBoolean(value);
  4888.                 }else{
  4889.                     this.logWarn(getMessaggioErroreProprietaNonImpostata("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.stackTrace", false));
  4890.                     this.isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace = false;
  4891.                 }
  4892.                
  4893.             }catch(java.lang.Exception e) {
  4894.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.stackTrace' non impostata, viene utilizzato il default=false, errore:"+e.getMessage());
  4895.                 this.isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace = false;
  4896.             }
  4897.         }
  4898.        
  4899.         return this.isGenerazioneDetailsSOAPFaultIntegrationWithStackTrace;
  4900.     }
  4901.    
  4902.     /**
  4903.      * Indicazione se generare nei details informazioni dettagliate o solo di carattere generale
  4904.      *  
  4905.      * @return Indicazione se generare nei details informazioni dettagliate o solo di carattere generale
  4906.      *
  4907.      */
  4908.     private Boolean isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGeneriche= null;
  4909.     private Boolean isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGenericheRead= null;
  4910.     public Boolean isGenerazioneDetailsSOAPFaultIntegrazionConInformazioniGeneriche(){
  4911.         if(this.isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGenericheRead==null){
  4912.             try{  
  4913.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.informazioniGeneriche");
  4914.                
  4915.                 if (value != null){
  4916.                     value = value.trim();
  4917.                     this.isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGeneriche = Boolean.parseBoolean(value);
  4918.                 }else{
  4919.                     this.logDebug("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.informazioniGeneriche' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultAsGenericCode)");
  4920.                     this.isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGeneriche = null;
  4921.                 }
  4922.                
  4923.                 this.isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGenericheRead = true;
  4924.                
  4925.             }catch(java.lang.Exception e) {
  4926.                 this.logWarn("Proprietà 'org.openspcoop2.protocol.modipa.generazioneDetailsSoapFault.integration.informazioniGeneriche' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultAsGenericCode), errore:"+e.getMessage());
  4927.                 this.isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGeneriche = null;
  4928.                
  4929.                 this.isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGenericheRead = true;
  4930.             }
  4931.         }
  4932.        
  4933.         return this.isGenerazioneDetailsSOAPFaultIntegrationConInformazioniGeneriche;
  4934.     }
  4935.    
  4936.    
  4937.    
  4938.    
  4939.     /* **** SOAP FAULT (Generati dagli attori esterni) **** */
  4940.    
  4941.     /**
  4942.      * Indicazione se aggiungere un detail contenente descrizione dell'errore nel SoapFaultApplicativo originale
  4943.      *  
  4944.      * @return Indicazione se aggiungere un detail contenente descrizione dell'errore nel SoapFaultApplicativo originale
  4945.      *
  4946.      */
  4947.     private BooleanNullable isAggiungiDetailErroreApplicativoSoapFaultApplicativo= null;
  4948.     private Boolean isAggiungiDetailErroreApplicativoSoapFaultApplicativoRead= null;
  4949.     public BooleanNullable isAggiungiDetailErroreApplicativoSoapFaultApplicativo(){
  4950.         if(this.isAggiungiDetailErroreApplicativoSoapFaultApplicativoRead==null){
  4951.             try{  
  4952.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.erroreApplicativo.faultApplicativo.enrichDetails");
  4953.                
  4954.                 if (value != null){
  4955.                     value = value.trim();
  4956.                     Boolean b = Boolean.parseBoolean(value);
  4957.                     this.isAggiungiDetailErroreApplicativoSoapFaultApplicativo = b.booleanValue() ? BooleanNullable.TRUE() : BooleanNullable.FALSE();
  4958.                 }else{
  4959.                     this.logDebug("Proprietà 'org.openspcoop2.protocol.modipa.erroreApplicativo.faultApplicativo.enrichDetails' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultApplicativo.enrichDetails)");
  4960.                     this.isAggiungiDetailErroreApplicativoSoapFaultApplicativo = BooleanNullable.NULL();
  4961.                 }
  4962.                
  4963.                 this.isAggiungiDetailErroreApplicativoSoapFaultApplicativoRead = true;
  4964.                
  4965.             }catch(java.lang.Exception e) {
  4966.                 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());
  4967.                 this.isAggiungiDetailErroreApplicativoSoapFaultApplicativo = BooleanNullable.NULL();
  4968.                
  4969.                 this.isAggiungiDetailErroreApplicativoSoapFaultApplicativoRead = true;
  4970.             }
  4971.         }
  4972.        
  4973.         return this.isAggiungiDetailErroreApplicativoSoapFaultApplicativo;
  4974.     }
  4975.    
  4976.     /**
  4977.      * Indicazione se aggiungere un detail contenente descrizione dell'errore nel SoapFaultPdD originale
  4978.      *  
  4979.      * @return Indicazione se aggiungere un detail contenente descrizione dell'errore nel SoapFaultPdD originale
  4980.      *
  4981.      */
  4982.     private BooleanNullable isAggiungiDetailErroreApplicativoSoapFaultPdD= null;
  4983.     private Boolean isAggiungiDetailErroreApplicativoSoapFaultPdDRead= null;
  4984.     public BooleanNullable isAggiungiDetailErroreApplicativoSoapFaultPdD(){
  4985.         if(this.isAggiungiDetailErroreApplicativoSoapFaultPdDRead==null){
  4986.             try{  
  4987.                 String value = this.reader.getValueConvertEnvProperties("org.openspcoop2.protocol.modipa.erroreApplicativo.faultPdD.enrichDetails");
  4988.                
  4989.                 if (value != null){
  4990.                     value = value.trim();
  4991.                     Boolean b = Boolean.parseBoolean(value);
  4992.                     this.isAggiungiDetailErroreApplicativoSoapFaultPdD = b.booleanValue() ? BooleanNullable.TRUE() : BooleanNullable.FALSE();
  4993.                 }else{
  4994.                     this.logDebug("Proprietà 'org.openspcoop2.protocol.modipa.erroreApplicativo.faultPdD.enrichDetails' non impostata, viene utilizzato il default associato al Servizio Applicativo (faultPdD.enrichDetails)");
  4995.                     this.isAggiungiDetailErroreApplicativoSoapFaultPdD = BooleanNullable.NULL();
  4996.                 }
  4997.                
  4998.                 this.isAggiungiDetailErroreApplicativoSoapFaultPdDRead = true;
  4999.                
  5000.             }catch(java.lang.Exception e) {
  5001.                 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());
  5002.                 this.isAggiungiDetailErroreApplicativoSoapFaultPdD = BooleanNullable.NULL();
  5003.                
  5004.                 this.isAggiungiDetailErroreApplicativoSoapFaultPdDRead = true;
  5005.             }
  5006.         }
  5007.        
  5008.         return this.isAggiungiDetailErroreApplicativoSoapFaultPdD;
  5009.     }

  5010.    
  5011.     /* **** Static instance config **** */
  5012.    
  5013.     private Boolean useConfigStaticInstance = null;
  5014.     private Boolean useConfigStaticInstance(){
  5015.         if(this.useConfigStaticInstance==null){
  5016.            
  5017.             Boolean defaultValue = true;
  5018.             String propertyName = "org.openspcoop2.protocol.modipa.factory.config.staticInstance";
  5019.            
  5020.             try{  
  5021.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  5022.                 if (value != null){
  5023.                     value = value.trim();
  5024.                     this.useConfigStaticInstance = Boolean.parseBoolean(value);
  5025.                 }else{
  5026.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  5027.                     this.useConfigStaticInstance = defaultValue;
  5028.                 }

  5029.             }catch(java.lang.Exception e) {
  5030.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  5031.                 this.useConfigStaticInstance = defaultValue;
  5032.             }
  5033.         }

  5034.         return this.useConfigStaticInstance;
  5035.     }
  5036.    
  5037.     private Boolean useErroreApplicativoStaticInstance = null;
  5038.     private Boolean useErroreApplicativoStaticInstance(){
  5039.         if(this.useErroreApplicativoStaticInstance==null){
  5040.            
  5041.             Boolean defaultValue = true;
  5042.             String propertyName = "org.openspcoop2.protocol.modipa.factory.erroreApplicativo.staticInstance";
  5043.            
  5044.             try{  
  5045.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  5046.                 if (value != null){
  5047.                     value = value.trim();
  5048.                     this.useErroreApplicativoStaticInstance = Boolean.parseBoolean(value);
  5049.                 }else{
  5050.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  5051.                     this.useErroreApplicativoStaticInstance = defaultValue;
  5052.                 }

  5053.             }catch(java.lang.Exception e) {
  5054.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  5055.                 this.useErroreApplicativoStaticInstance = defaultValue;
  5056.             }
  5057.         }

  5058.         return this.useErroreApplicativoStaticInstance;
  5059.     }
  5060.    
  5061.     private Boolean useEsitoStaticInstance = null;
  5062.     private Boolean useEsitoStaticInstance(){
  5063.         if(this.useEsitoStaticInstance==null){
  5064.            
  5065.             Boolean defaultValue = true;
  5066.             String propertyName = "org.openspcoop2.protocol.modipa.factory.esito.staticInstance";
  5067.            
  5068.             try{  
  5069.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  5070.                 if (value != null){
  5071.                     value = value.trim();
  5072.                     this.useEsitoStaticInstance = Boolean.parseBoolean(value);
  5073.                 }else{
  5074.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  5075.                     this.useEsitoStaticInstance = defaultValue;
  5076.                 }

  5077.             }catch(java.lang.Exception e) {
  5078.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  5079.                 this.useEsitoStaticInstance = defaultValue;
  5080.             }
  5081.         }

  5082.         return this.useEsitoStaticInstance;
  5083.     }
  5084.    
  5085.     private BasicStaticInstanceConfig staticInstanceConfig = null;
  5086.     public BasicStaticInstanceConfig getStaticInstanceConfig(){
  5087.         if(this.staticInstanceConfig==null){
  5088.             this.staticInstanceConfig = new BasicStaticInstanceConfig();
  5089.             if(useConfigStaticInstance()!=null) {
  5090.                 this.staticInstanceConfig.setStaticConfig(useConfigStaticInstance());
  5091.             }
  5092.             if(useErroreApplicativoStaticInstance()!=null) {
  5093.                 this.staticInstanceConfig.setStaticErrorBuilder(useErroreApplicativoStaticInstance());
  5094.             }
  5095.             if(useEsitoStaticInstance()!=null) {
  5096.                 this.staticInstanceConfig.setStaticEsitoBuilder(useEsitoStaticInstance());
  5097.             }
  5098.         }
  5099.         return this.staticInstanceConfig;
  5100.     }
  5101.    
  5102.    
  5103.    
  5104.    
  5105.     /* **** Signal Hub **** */
  5106.    
  5107.     // riferito in org.openspcoop2.protocol.utils.ModIUtils
  5108.     private Boolean signalHubEnabled = null;
  5109.     public boolean isSignalHubEnabled(){
  5110.         if(this.signalHubEnabled==null){
  5111.            
  5112.             Boolean defaultValue =false;
  5113.             String propertyName = "org.openspcoop2.protocol.modipa.signalHub.enabled";
  5114.            
  5115.             try{  
  5116.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  5117.                 if (value != null){
  5118.                     value = value.trim();
  5119.                     this.signalHubEnabled = Boolean.parseBoolean(value);
  5120.                 }else{
  5121.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  5122.                     this.signalHubEnabled = defaultValue;
  5123.                 }

  5124.             }catch(java.lang.Exception e) {
  5125.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  5126.                 this.signalHubEnabled = defaultValue;
  5127.             }
  5128.         }

  5129.         return this.signalHubEnabled;
  5130.     }
  5131.    
  5132.     private List<String> signalHubAlgorithms= null;
  5133.     public List<String> getSignalHubAlgorithms() throws ProtocolException{
  5134.         if(this.signalHubAlgorithms==null){
  5135.            
  5136.             String propertyName = "org.openspcoop2.protocol.modipa.signalHub.algorithms";
  5137.             try{  
  5138.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  5139.                 this.signalHubAlgorithms = ModISecurityConfig.convertToList(value);
  5140.                 if(this.signalHubAlgorithms==null || this.signalHubAlgorithms.isEmpty()) {
  5141.                     throw new ProtocolException("SignalHub algorithms undefined");
  5142.                 }
  5143.             }catch(java.lang.Exception e) {
  5144.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  5145.                 throw new ProtocolException(e.getMessage(),e);
  5146.             }
  5147.         }
  5148.        
  5149.         return this.signalHubAlgorithms;
  5150.     }
  5151.    
  5152.     private String signalHubDefaultAlgorithm= null;
  5153.     public String getSignalHubDefaultAlgorithm() throws ProtocolException{
  5154.         if(this.signalHubDefaultAlgorithm==null){
  5155.             String name = "org.openspcoop2.protocol.modipa.signalHub.algorithms.default";
  5156.             try{  
  5157.                 String value = this.reader.getValueConvertEnvProperties(name);
  5158.                
  5159.                 if (value != null){
  5160.                     value = value.trim();
  5161.                     this.signalHubDefaultAlgorithm = value;
  5162.                 }
  5163.                 else {
  5164.                     throw newProtocolExceptionPropertyNonDefinita();
  5165.                 }
  5166.                
  5167.             }catch(java.lang.Exception e) {
  5168.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  5169.                 this.logError(msgErrore);
  5170.                 throw new ProtocolException(msgErrore,e);
  5171.             }
  5172.         }
  5173.        
  5174.         return this.signalHubDefaultAlgorithm;
  5175.     }
  5176.    
  5177.     private List<Integer> signalHubSeedSize= null;
  5178.     public List<Integer> getSignalHubSeedSize() throws ProtocolException{
  5179.         if(this.signalHubSeedSize==null){
  5180.            
  5181.             String propertyName = "org.openspcoop2.protocol.modipa.signalHub.seed.size";
  5182.             try{  
  5183.                 String value = this.reader.getValueConvertEnvProperties(propertyName);
  5184.                 this.signalHubSeedSize = ModISecurityConfig.convertToList(value)
  5185.                         .stream()
  5186.                         .map(Integer::parseInt)
  5187.                         .collect(Collectors.toList());
  5188.                 if(this.signalHubSeedSize==null || this.signalHubSeedSize.isEmpty()) {
  5189.                     throw new ProtocolException("SignalHub algorithms undefined");
  5190.                 }
  5191.                 for (Integer s : this.signalHubSeedSize) {
  5192.                     validateSignalHubInteger("Signal Hub - Seed size",s);
  5193.                 }
  5194.             }catch(java.lang.Exception e) {
  5195.                 this.logError(getMessaggioErroreProprietaNonImpostata(propertyName, e));
  5196.                 throw new ProtocolException(e.getMessage(),e);
  5197.             }
  5198.         }
  5199.        
  5200.         return this.signalHubSeedSize;
  5201.     }
  5202.    
  5203.     private static void validateSignalHubInteger(String objectTitle, Integer i) throws ProtocolException {
  5204.         try {
  5205.             if(i<=0) {
  5206.                 throw new ProtocolException("must be a positive integer greater than 0");
  5207.             }
  5208.         }catch(Exception e) {
  5209.             throw new ProtocolException(objectTitle+" '"+i+"' invalid; must be a positive integer greater than 0");
  5210.         }
  5211.     }
  5212.    
  5213.     private Integer signalHubDefaultSeedSize= null;
  5214.     public Integer getSignalHubDefaultSeedSize() throws ProtocolException{
  5215.         if(this.signalHubDefaultSeedSize==null){
  5216.             String name = "org.openspcoop2.protocol.modipa.signalHub.seed.size.default";
  5217.             try{  
  5218.                 String value = this.reader.getValueConvertEnvProperties(name);
  5219.                
  5220.                 if (value != null){
  5221.                     Integer valueInt = Integer.parseInt(value.trim());
  5222.                     validateSignalHubInteger("Signal Hub - Default seed size", valueInt);
  5223.                     this.signalHubDefaultSeedSize = valueInt;
  5224.                 }
  5225.                 else {
  5226.                     throw newProtocolExceptionPropertyNonDefinita();
  5227.                 }
  5228.                
  5229.             }catch(java.lang.Exception e) {
  5230.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  5231.                 this.logError(msgErrore);
  5232.                 throw new ProtocolException(msgErrore,e);
  5233.             }
  5234.         }
  5235.        
  5236.         return this.signalHubDefaultSeedSize;
  5237.     }
  5238.    
  5239.     private Boolean signalHubSeedLifetimeUnlimited = null;
  5240.     public boolean isSignalHubSeedLifetimeUnlimited(){
  5241.         if(this.signalHubSeedLifetimeUnlimited==null){
  5242.            
  5243.             Boolean defaultValue =false;
  5244.             String propertyName = "org.openspcoop2.protocol.modipa.signalHub.seed.lifetime.unlimited";
  5245.            
  5246.             try{  
  5247.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  5248.                 if (value != null){
  5249.                     value = value.trim();
  5250.                     this.signalHubSeedLifetimeUnlimited = Boolean.parseBoolean(value);
  5251.                 }else{
  5252.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  5253.                     this.signalHubSeedLifetimeUnlimited = defaultValue;
  5254.                 }

  5255.             }catch(java.lang.Exception e) {
  5256.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  5257.                 this.signalHubSeedLifetimeUnlimited = defaultValue;
  5258.             }
  5259.         }

  5260.         return this.signalHubSeedLifetimeUnlimited;
  5261.     }
  5262.    
  5263.     private Integer signalHubDefaultSeedLifetimeDaysDefault= null;
  5264.     public Integer getSignalHubDeSeedSeedLifetimeDaysDefault() throws ProtocolException{
  5265.         if(this.signalHubDefaultSeedLifetimeDaysDefault==null){
  5266.             String name = "org.openspcoop2.protocol.modipa.signalHub.seed.lifetime.days.default";
  5267.             try{  
  5268.                 String value = this.reader.getValueConvertEnvProperties(name);
  5269.                
  5270.                 if (value != null){
  5271.                     Integer valueInt = Integer.parseInt(value.trim());
  5272.                     validateSignalHubInteger("Signal Hub - Default lifetime days", valueInt);
  5273.                     this.signalHubDefaultSeedLifetimeDaysDefault = valueInt;
  5274.                 }
  5275.                 else {
  5276.                     throw newProtocolExceptionPropertyNonDefinita();
  5277.                 }
  5278.                
  5279.             }catch(java.lang.Exception e) {
  5280.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  5281.                 this.logError(msgErrore);
  5282.                 throw new ProtocolException(msgErrore,e);
  5283.             }
  5284.         }
  5285.        
  5286.         return this.signalHubDefaultSeedLifetimeDaysDefault;
  5287.     }
  5288.    
  5289.     private String signalHubApiName= null;
  5290.     public String getSignalHubApiName() throws ProtocolException{
  5291.         if(this.signalHubApiName==null){
  5292.             String name = "org.openspcoop2.protocol.modipa.signalHub.api.name";
  5293.             try{  
  5294.                 String value = this.reader.getValueConvertEnvProperties(name);
  5295.                
  5296.                 if (value != null){
  5297.                     value = value.trim();
  5298.                     this.signalHubApiName = value;
  5299.                 }
  5300.                 else {
  5301.                     throw newProtocolExceptionPropertyNonDefinita();
  5302.                 }
  5303.                
  5304.             }catch(java.lang.Exception e) {
  5305.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  5306.                 this.logError(msgErrore);
  5307.                 throw new ProtocolException(msgErrore,e);
  5308.             }
  5309.         }
  5310.        
  5311.         return this.signalHubApiName;
  5312.     }
  5313.    
  5314.     private Integer signalHubApiVersion= null;
  5315.     public int getSignalHubApiVersion() throws ProtocolException{
  5316.         if(this.signalHubApiVersion==null){
  5317.             String name = "org.openspcoop2.protocol.modipa.signalHub.api.version";
  5318.             try{  
  5319.                 String value = this.reader.getValueConvertEnvProperties(name);
  5320.                
  5321.                 if (value != null){
  5322.                     Integer valueInt = Integer.parseInt(value.trim());
  5323.                     validateSignalHubInteger("Signal Hub - API Version", valueInt);
  5324.                     this.signalHubApiVersion = valueInt;
  5325.                 }
  5326.                 else {
  5327.                     throw newProtocolExceptionPropertyNonDefinita();
  5328.                 }
  5329.                
  5330.             }catch(java.lang.Exception e) {
  5331.                 String msgErrore = getMessaggioErroreProprietaNonImpostata(name, e);
  5332.                 this.logError(msgErrore);
  5333.                 throw new ProtocolException(msgErrore,e);
  5334.             }
  5335.         }
  5336.        
  5337.         return this.signalHubApiVersion;
  5338.     }
  5339.    
  5340.    
  5341.    
  5342.     private ModISignalHubConfig signalHubConfig = null;
  5343.     public ModISignalHubConfig getSignalHubConfig() throws ProtocolException{
  5344.         if(this.signalHubConfig==null){
  5345.             String propertyPrefix = "org.openspcoop2.protocol.modipa.signalHub";
  5346.             try{
  5347.                 String debugPrefix = "Param signal hub '"+propertyPrefix+"'";
  5348.                 Properties p = this.reader.readProperties(propertyPrefix+"."); // non devo convertire le properties poiche' possoono contenere ${ che useremo per la risoluzione dinamica
  5349.                 if(p==null || p.isEmpty()) {
  5350.                     throw new ProtocolException(debugPrefix+SUFFIX_NON_TROVATA);
  5351.                 }
  5352.                 this.signalHubConfig = new ModISignalHubConfig(propertyPrefix, p);
  5353.             }catch(java.lang.Exception e) {
  5354.                 this.logError(getMessaggioErroreProprietaNonCorretta(propertyPrefix, e));
  5355.                 throw new ProtocolException(e.getMessage(),e);
  5356.             }
  5357.         }
  5358.        
  5359.         return this.signalHubConfig;
  5360.     }
  5361.    
  5362.     private String signalHubHashCompose = null;
  5363.     public String getSignalHubHashCompose() throws ProtocolException{
  5364.         if(this.signalHubHashCompose==null){
  5365.             String name = "org.openspcoop2.protocol.modipa.signalHub.hash.composition";
  5366.             try{
  5367.                 String value = this.reader.getValue(name); // non devo convertire le properties poiche' possoono contenere ${ che useremo per la risoluzione dinamica
  5368.                 if(value == null || value.isBlank()) {
  5369.                     throw new ProtocolException(name + SUFFIX_NON_TROVATA);
  5370.                 }
  5371.                 this.signalHubHashCompose = value;
  5372.             }catch(java.lang.Exception e) {
  5373.                 this.logError(getMessaggioErroreProprietaNonCorretta(name, e));
  5374.                 throw new ProtocolException(e.getMessage(),e);
  5375.             }
  5376.         }
  5377.        
  5378.         return this.signalHubHashCompose;
  5379.     }
  5380.    
  5381.     private Integer signalHubDigestHistroy = null;
  5382.     public int getSignalHubDigestHistroy() throws ProtocolException{
  5383.         if(this.signalHubDigestHistroy==null){
  5384.             String name = "org.openspcoop2.protocol.modipa.signalHub.seed.history";
  5385.             try{
  5386.                 String rawValue = this.reader.getValue(name); // non devo convertire le properties poiche' possoono contenere ${ che useremo per la risoluzione dinamica
  5387.                 if(rawValue == null || rawValue.isBlank()) {
  5388.                    
  5389.                     throw new ProtocolException(name + SUFFIX_NON_TROVATA);
  5390.                 }
  5391.                 Integer value = Integer.valueOf(rawValue);
  5392.                 this.signalHubDigestHistroy = value;
  5393.             }catch(java.lang.Exception e) {
  5394.                 this.logError(getMessaggioErroreProprietaNonCorretta(name, e));
  5395.                 throw new ProtocolException(e.getMessage(),e);
  5396.             }
  5397.         }
  5398.        
  5399.         return this.signalHubDigestHistroy;
  5400.     }

  5401.    
  5402.    
  5403.    
  5404.    
  5405.     /* **** TracingPDND **** */
  5406.    
  5407.     // riferito in org.openspcoop2.protocol.utils.ModIUtils
  5408.     private Boolean tracingPDNDEnabled = null;
  5409.     public boolean isTracingPDNDEnabled(){
  5410.         if(this.tracingPDNDEnabled==null){
  5411.            
  5412.             Boolean defaultValue =false;
  5413.             String propertyName = "org.openspcoop2.protocol.modipa.tracingPDND.enabled";
  5414.            
  5415.             try{  
  5416.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  5417.                 if (value != null){
  5418.                     value = value.trim();
  5419.                     this.tracingPDNDEnabled = Boolean.parseBoolean(value);
  5420.                 }else{
  5421.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  5422.                     this.tracingPDNDEnabled = defaultValue;
  5423.                 }

  5424.             }catch(java.lang.Exception e) {
  5425.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  5426.                 this.tracingPDNDEnabled = defaultValue;
  5427.             }
  5428.         }

  5429.         return this.tracingPDNDEnabled;
  5430.     }
  5431. }