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.getSignalHubSoapNamespace();
  425.                 this.getSignalHubApiName();
  426.                 this.getSignalHubApiVersion();
  427.                 this.getSignalHubConfig();
  428.                 this.getSignalHubSeedSize();
  429.                 this.getSignalHubDigestHistroy();
  430.             }
  431.            

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  2636.         return this.getRestSecurityTokenClaimsNbfTimeCheckToleranceMilliseconds;
  2637.     }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  5427.    
  5428.    
  5429.    
  5430.    
  5431.     /* **** TracingPDND **** */
  5432.    
  5433.     // riferito in org.openspcoop2.protocol.utils.ModIUtils
  5434.     private Boolean tracingPDNDEnabled = null;
  5435.     public boolean isTracingPDNDEnabled(){
  5436.         if(this.tracingPDNDEnabled==null){
  5437.            
  5438.             Boolean defaultValue =false;
  5439.             String propertyName = "org.openspcoop2.protocol.modipa.tracingPDND.enabled";
  5440.            
  5441.             try{  
  5442.                 String value = this.reader.getValueConvertEnvProperties(propertyName);

  5443.                 if (value != null){
  5444.                     value = value.trim();
  5445.                     this.tracingPDNDEnabled = Boolean.parseBoolean(value);
  5446.                 }else{
  5447.                     this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue));
  5448.                     this.tracingPDNDEnabled = defaultValue;
  5449.                 }

  5450.             }catch(java.lang.Exception e) {
  5451.                 this.logDebug(getMessaggioErroreProprietaNonImpostata(propertyName, defaultValue)+getSuffixErrore(e));
  5452.                 this.tracingPDNDEnabled = defaultValue;
  5453.             }
  5454.         }

  5455.         return this.tracingPDNDEnabled;
  5456.     }
  5457. }