RequestConfig.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.sdk.state;

  21. import java.io.Serializable;
  22. import java.util.ArrayList;
  23. import java.util.Date;
  24. import java.util.EnumMap;
  25. import java.util.HashMap;
  26. import java.util.List;
  27. import java.util.Map;

  28. import org.openspcoop2.core.config.PortaApplicativa;
  29. import org.openspcoop2.core.config.PortaDelegata;
  30. import org.openspcoop2.core.config.ServizioApplicativo;
  31. import org.openspcoop2.core.config.SystemProperties;
  32. import org.openspcoop2.core.id.IDPortaApplicativa;
  33. import org.openspcoop2.core.id.IDPortaDelegata;
  34. import org.openspcoop2.core.id.IDServizio;
  35. import org.openspcoop2.core.id.IDSoggetto;
  36. import org.openspcoop2.core.mapping.MappingErogazionePortaApplicativa;
  37. import org.openspcoop2.core.mapping.MappingFruizionePortaDelegata;
  38. import org.openspcoop2.core.registry.AccordoServizioParteComune;
  39. import org.openspcoop2.core.registry.AccordoServizioParteSpecifica;
  40. import org.openspcoop2.core.registry.Documento;
  41. import org.openspcoop2.core.registry.PortaDominio;
  42. import org.openspcoop2.core.registry.Ruolo;
  43. import org.openspcoop2.core.registry.Scope;
  44. import org.openspcoop2.core.transazioni.CredenzialeMittente;
  45. import org.openspcoop2.core.transazioni.utils.TipoCredenzialeMittente;
  46. import org.openspcoop2.protocol.sdk.Servizio;
  47. import org.openspcoop2.protocol.sdk.constants.InformationApiSource;
  48. import org.openspcoop2.protocol.sdk.registry.ProtocolFiltroRicercaPorteApplicative;
  49. import org.openspcoop2.protocol.sdk.registry.ProtocolFiltroRicercaPorteDelegate;
  50. import org.openspcoop2.utils.BooleanNullable;
  51. import org.openspcoop2.utils.SemaphoreLock;


  52. /**
  53.  * RequestConfig
  54.  *
  55.  * @author Poli Andrea (apoli@link.it)
  56.  * @author $Author$
  57.  * @version $Rev$, $Date$
  58.  */
  59. public class RequestConfig implements java.io.Serializable {

  60.     /**
  61.      *
  62.      */
  63.     private static final long serialVersionUID = 1L;

  64.     private static boolean useCacheForExternalResource = false;
  65.     private static boolean useCacheForOCSPResponse = false;
  66.     private static boolean useCacheForRemoteStore = false;
  67.    
  68.     public static boolean isUseCacheForExternalResource() {
  69.         return useCacheForExternalResource;
  70.     }
  71.     public static void setUseCacheForExternalResource(boolean useCacheForExternalResource) {
  72.         RequestConfig.useCacheForExternalResource = useCacheForExternalResource;
  73.     }
  74.     public static boolean isUseCacheForOCSPResponse() {
  75.         return useCacheForOCSPResponse;
  76.     }
  77.     public static void setUseCacheForOCSPResponse(boolean useCacheForOCSPResponse) {
  78.         RequestConfig.useCacheForOCSPResponse = useCacheForOCSPResponse;
  79.     }
  80.     public static boolean isUseCacheForRemoteStore() {
  81.         return useCacheForRemoteStore;
  82.     }
  83.     public static void setUseCacheForRemoteStore(boolean useCacheForRemoteStore) {
  84.         RequestConfig.useCacheForRemoteStore = useCacheForRemoteStore;
  85.     }
  86.    
  87.    
  88.     private String key = null;
  89.    
  90.     private boolean cached = false;

  91.     private transient org.openspcoop2.utils.Semaphore semaphore = null; // possono essere alimentati da thread differenti
  92.    
  93.     private IDSoggetto dominioDefault;
  94.    
  95.     private IDServizio idServizio;
  96.     private org.openspcoop2.core.registry.constants.ServiceBinding serviceBinding = null;
  97.     private AccordoServizioParteComune aspc = null;
  98.     private AccordoServizioParteSpecifica asps = null;
  99.     private Map<String, org.openspcoop2.core.registry.wsdl.AccordoServizioWrapper> asWrapperSoap = null;
  100.     private Map<String, org.openspcoop2.core.registry.rest.AccordoServizioWrapper> asWrapperRest = null;
  101.     private Servizio infoServizio;
  102.     private Servizio infoServizioCorrelato;
  103.     private Servizio infoServizioAzioneCorrelata;
  104.     private String servizioVersioneProtocollo;
  105.    
  106.     private transient org.openspcoop2.utils.Semaphore semaphoreAllegatoApi = null; // possono essere alimentati da thread differenti
  107.     private Map<String, Documento> allegatoApi = null;
  108.     private transient org.openspcoop2.utils.Semaphore semaphoreAllegatoServizio = null; // possono essere alimentati da thread differenti
  109.     private Map<String, Documento> allegatoServizio = null;
  110.    
  111.     private org.openspcoop2.core.registry.Soggetto soggettoErogatoreRegistry;
  112.     private org.openspcoop2.core.config.Soggetto soggettoErogatoreConfig;
  113.     private String soggettoErogatoreIdentificativoPorta;
  114.     private Boolean soggettoErogatoreSoggettoVirtuale;
  115.     private String soggettoErogatoreImplementazionePdd;
  116.     private Boolean soggettoErogatorePddReaded;
  117.     private PortaDominio soggettoErogatorePdd;
  118.     private String soggettoErogatoreVersioneProtocollo;
  119.    
  120.     private IDPortaApplicativa idPortaApplicativaDefault;
  121.     private PortaApplicativa portaApplicativaDefault;
  122.     private IDPortaApplicativa idPortaApplicativa;
  123.     private PortaApplicativa portaApplicativa;
  124.     private List<MappingErogazionePortaApplicativa> listMappingErogazionePortaApplicativa;
  125.     private Map<String, ServizioApplicativo> serviziApplicativiErogatore = null;
  126.    
  127.     private transient org.openspcoop2.utils.Semaphore semaphorePorteApplicativeByFiltroRicerca = null; // possono essere alimentati da thread differenti
  128.     private Map<String, List<IDPortaApplicativa>> listPorteApplicativeByFiltroRicerca = null;
  129.    
  130.     private IDSoggetto idFruitore;
  131.     private IDPortaDelegata idPortaDelegataDefault;
  132.     private PortaDelegata portaDelegataDefault;
  133.     private IDPortaDelegata idPortaDelegata;
  134.     private PortaDelegata portaDelegata;
  135.     private List<MappingFruizionePortaDelegata> listMappingFruizionePortaDelegata;
  136.    
  137.     private transient org.openspcoop2.utils.Semaphore semaphorePorteDelegateByFiltroRicerca = null; // possono essere alimentati da thread differenti
  138.     private Map<String, List<IDPortaDelegata>> listPorteDelegateByFiltroRicerca = null;
  139.    
  140.     private org.openspcoop2.core.registry.Soggetto soggettoFruitoreRegistry;
  141.     private org.openspcoop2.core.config.Soggetto soggettoFruitoreConfig;
  142.     private String soggettoFruitoreIdentificativoPorta;
  143.     private Boolean soggettoFruitoreSoggettoVirtuale;
  144.     private String soggettoFruitoreImplementazionePdd;
  145.     private Boolean soggettoFruitorePddReaded;
  146.     private PortaDominio soggettoFruitorePdd;
  147.     private String soggettoFruitoreVersioneProtocollo;
  148.    
  149.     private org.openspcoop2.core.config.Connettore connettoreFrutoreServizio = null;
  150.     private org.openspcoop2.core.config.Connettore connettoreSoggettoErogatore=null;
  151.    
  152.     private Map<String, Ruolo> ruolo = null;
  153.     private Map<String, Scope> scope = null;
  154.    
  155.     private SystemProperties systemProperties;
  156.    
  157.     private Boolean forwardProxyEnabled;
  158.     private Map<String, Serializable> forwardProxy = null;
  159.    
  160.     private transient org.openspcoop2.utils.Semaphore semaphoreCredenziali = null; // possono essere alimentati da thread differenti
  161.     private EnumMap<TipoCredenzialeMittente, Map<String, CredenzialeMittente>> mapCredenziali = null;
  162.    
  163.     private transient org.openspcoop2.utils.Semaphore semaphorePolicy = null; // possono essere alimentati da thread differenti
  164.     private Map<String, Serializable> policyValidazioneToken = null;
  165.     private Map<String, Serializable> policyNegoziazioneToken = null;
  166.     private Map<String, Serializable> attributeAuthority = null;
  167.    
  168.     private transient org.openspcoop2.utils.Semaphore semaphoreStore = null; // possono essere alimentati da thread differenti
  169.     private Map<String, Serializable> merlinTruststore = null;
  170.     private Map<String, Serializable> merlinKeystore = null;
  171.     private Map<String, Serializable> symmetricKeystore = null;
  172.     private Map<String, Serializable> multiKeystore = null;
  173.     private Map<String, Serializable> jwkSetStore = null;
  174.     private Map<String, Serializable> keyPairStore = null;
  175.     private Map<String, Serializable> publicKeyStore = null;
  176.     private Map<String, Serializable> secretKeyStore = null;
  177.     private Map<String, Serializable> remoteStore = null;
  178.     private Map<String, Serializable> remoteStoreClientInfo = null;
  179.     private Map<String, Serializable> httpStore = null;
  180.     private Map<String, Serializable> byokStore = null;
  181.     private Map<String, Serializable> crlCertstore = null;
  182.     private Map<String, Serializable> sslSocketFactory = null;
  183.     private Map<String, Serializable> sslConfigProps = null;
  184.     private Map<String, Serializable> externalResource = null;
  185.     private Map<String, Serializable> ocspResponse = null;
  186.    
  187.     private transient org.openspcoop2.utils.Semaphore semaphoreTemplate = null; // possono essere alimentati da thread differenti
  188.     private Map<String, Serializable> template = null;
  189.    
  190.    
  191.    
  192.     public void copyFrom(RequestConfig source) {

  193.         if(source==null) {
  194.             throw new NullPointerException("Source is null");
  195.         }
  196.        
  197.         if(source.key!=null) {
  198.             this.key = source.key;
  199.         }
  200.        
  201.         this.cached = source.cached;
  202.        
  203.         if(source.dominioDefault!=null) {
  204.             this.dominioDefault = source.dominioDefault.clone();
  205.         }
  206.        
  207.         if(source.idServizio!=null) {
  208.             this.idServizio = source.idServizio.clone();
  209.         }
  210.         if(source.serviceBinding!=null) {
  211.             this.serviceBinding = source.serviceBinding;
  212.         }
  213.         if(source.aspc!=null) {
  214.             this.aspc = source.aspc;
  215.         }
  216.         if(source.asps!=null) {
  217.             this.asps = source.asps;
  218.         }
  219.         if(source.asWrapperSoap!=null) {
  220.             this.asWrapperSoap = source.asWrapperSoap;
  221.         }
  222.         if(source.asWrapperRest!=null) {
  223.             this.asWrapperRest = source.asWrapperRest;
  224.         }
  225.         if(source.infoServizio!=null) {
  226.             this.infoServizio = source.infoServizio;
  227.         }
  228.         if(source.infoServizioCorrelato!=null) {
  229.             this.infoServizioCorrelato = source.infoServizioCorrelato;
  230.         }
  231.         if(source.infoServizioAzioneCorrelata!=null) {
  232.             this.infoServizioAzioneCorrelata = source.infoServizioAzioneCorrelata;
  233.         }
  234.         if(source.servizioVersioneProtocollo!=null) {
  235.             this.servizioVersioneProtocollo = source.servizioVersioneProtocollo;
  236.         }
  237.        
  238.         // Informazioni che vengono impostate dopo aver letto l'azione specifica
  239.         if(source.allegatoApi!=null) {
  240.             this.allegatoApi = source.allegatoApi;
  241.         }  
  242.         if(source.allegatoServizio!=null) {
  243.             this.allegatoServizio = source.allegatoServizio;
  244.         }

  245.         this.copyErogatoreFrom(source);
  246.        
  247.         this.copyFruitoreFrom(source);
  248.        
  249.         this.copyConfigFrom(source);
  250.        
  251.         this.copyCredenzialiFrom(source);
  252.        
  253.         this.copyPolicyFrom(source);
  254.        
  255.         this.copyStoreFrom(source);
  256.        
  257.         this.copyTemplateFrom(source);

  258.     }
  259.     private void copyErogatoreFrom(RequestConfig source) {
  260.        
  261.         if(source.soggettoErogatoreRegistry!=null) {
  262.             this.soggettoErogatoreRegistry = source.soggettoErogatoreRegistry;
  263.         }
  264.         if(source.soggettoErogatoreConfig!=null) {
  265.             this.soggettoErogatoreConfig = source.soggettoErogatoreConfig;
  266.         }
  267.         if(source.soggettoErogatoreIdentificativoPorta!=null) {
  268.             this.soggettoErogatoreIdentificativoPorta = source.soggettoErogatoreIdentificativoPorta;
  269.         }
  270.         if(source.soggettoErogatoreSoggettoVirtuale!=null) {
  271.             this.soggettoErogatoreSoggettoVirtuale = source.soggettoErogatoreSoggettoVirtuale;
  272.         }
  273.         if(source.soggettoErogatoreImplementazionePdd!=null) {
  274.             this.soggettoErogatoreImplementazionePdd = source.soggettoErogatoreImplementazionePdd;
  275.         }
  276.         if(source.soggettoErogatorePddReaded!=null) {
  277.             this.soggettoErogatorePddReaded = source.soggettoErogatorePddReaded;
  278.         }
  279.         if(source.soggettoErogatorePdd!=null) {
  280.             this.soggettoErogatorePdd = source.soggettoErogatorePdd;
  281.         }
  282.         if(source.soggettoErogatoreVersioneProtocollo!=null) {
  283.             this.soggettoErogatoreVersioneProtocollo = source.soggettoErogatoreVersioneProtocollo;
  284.         }

  285.         if(source.idPortaApplicativaDefault!=null) {
  286.             this.idPortaApplicativaDefault = source.idPortaApplicativaDefault.clone();
  287.         }
  288.         if(source.portaApplicativaDefault!=null) {
  289.             this.portaApplicativaDefault = source.portaApplicativaDefault;
  290.         }
  291.         if(source.idPortaApplicativa!=null) {
  292.             this.idPortaApplicativa = source.idPortaApplicativa.clone();
  293.         }
  294.         if(source.portaApplicativa!=null) {
  295.             this.portaApplicativa = source.portaApplicativa;
  296.         }
  297.         if(source.listMappingErogazionePortaApplicativa!=null) {
  298.             this.listMappingErogazionePortaApplicativa = source.listMappingErogazionePortaApplicativa;
  299.         }
  300.         if(source.serviziApplicativiErogatore!=null) {
  301.             this.serviziApplicativiErogatore = source.serviziApplicativiErogatore;
  302.         }
  303.        
  304.         if(source.listPorteApplicativeByFiltroRicerca!=null) {
  305.             this.listPorteApplicativeByFiltroRicerca = source.listPorteApplicativeByFiltroRicerca;
  306.         }
  307.        
  308.     }
  309.     private void copyFruitoreFrom(RequestConfig source) {
  310.        
  311.         if(source.idFruitore!=null) {
  312.             this.idFruitore = source.idFruitore.clone();
  313.         }
  314.         if(source.idPortaDelegataDefault!=null) {
  315.             this.idPortaDelegataDefault = source.idPortaDelegataDefault.clone();
  316.         }
  317.         if(source.portaDelegataDefault!=null) {
  318.             this.portaDelegataDefault = source.portaDelegataDefault;
  319.         }
  320.         if(source.idPortaDelegata!=null) {
  321.             this.idPortaDelegata = source.idPortaDelegata.clone();
  322.         }
  323.         if(source.portaDelegata!=null) {
  324.             this.portaDelegata = source.portaDelegata;
  325.         }
  326.         if(source.listMappingFruizionePortaDelegata!=null) {
  327.             this.listMappingFruizionePortaDelegata = source.listMappingFruizionePortaDelegata;
  328.         }
  329.        
  330.         if(source.listPorteDelegateByFiltroRicerca!=null) {
  331.             this.listPorteDelegateByFiltroRicerca = source.listPorteDelegateByFiltroRicerca;
  332.         }
  333.        
  334.         if(source.soggettoFruitoreRegistry!=null) {
  335.             this.soggettoFruitoreRegistry = source.soggettoFruitoreRegistry;
  336.         }
  337.         if(source.soggettoFruitoreConfig!=null) {
  338.             this.soggettoFruitoreConfig = source.soggettoFruitoreConfig;
  339.         }
  340.         if(source.soggettoFruitoreIdentificativoPorta!=null) {
  341.             this.soggettoFruitoreIdentificativoPorta = source.soggettoFruitoreIdentificativoPorta;
  342.         }
  343.         if(source.soggettoFruitoreSoggettoVirtuale!=null) {
  344.             this.soggettoFruitoreSoggettoVirtuale = source.soggettoFruitoreSoggettoVirtuale;
  345.         }
  346.         if(source.soggettoFruitoreImplementazionePdd!=null) {
  347.             this.soggettoFruitoreImplementazionePdd = source.soggettoFruitoreImplementazionePdd;
  348.         }
  349.         if(source.soggettoFruitorePddReaded!=null) {
  350.             this.soggettoFruitorePddReaded = source.soggettoFruitorePddReaded;
  351.         }
  352.         if(source.soggettoFruitorePdd!=null) {
  353.             this.soggettoFruitorePdd = source.soggettoFruitorePdd;
  354.         }
  355.         if(source.soggettoFruitoreVersioneProtocollo!=null) {
  356.             this.soggettoFruitoreVersioneProtocollo = source.soggettoFruitoreVersioneProtocollo;
  357.         }
  358.     }
  359.     private void copyConfigFrom(RequestConfig source) {
  360.        
  361.         if(source.connettoreFrutoreServizio!=null) {
  362.             this.connettoreFrutoreServizio = source.connettoreFrutoreServizio;
  363.         }
  364.         if(source.connettoreSoggettoErogatore!=null) {
  365.             this.connettoreSoggettoErogatore = source.connettoreSoggettoErogatore;
  366.         }
  367.        
  368.         if(source.ruolo!=null) {
  369.             this.ruolo = source.ruolo;
  370.         }
  371.         if(source.scope!=null) {
  372.             this.scope = source.scope;
  373.         }
  374.        
  375.         if(source.systemProperties!=null) {
  376.             this.systemProperties = source.systemProperties;
  377.         }
  378.        
  379.         if(source.forwardProxyEnabled!=null) {
  380.             this.forwardProxyEnabled = source.forwardProxyEnabled;
  381.         }
  382.         if(source.forwardProxy!=null) {
  383.             this.forwardProxy = source.forwardProxy;
  384.         }
  385.        
  386.     }
  387.     private void copyCredenzialiFrom(RequestConfig source) {        
  388.         if(source.mapCredenziali!=null) {
  389.             this.mapCredenziali = source.mapCredenziali;
  390.         }
  391.     }
  392.     private void copyPolicyFrom(RequestConfig source) {
  393.         if(source.policyValidazioneToken!=null) {
  394.             this.policyValidazioneToken = source.policyValidazioneToken;
  395.         }
  396.         if(source.policyNegoziazioneToken!=null) {
  397.             this.policyNegoziazioneToken = source.policyNegoziazioneToken;
  398.         }
  399.         if(source.attributeAuthority!=null) {
  400.             this.attributeAuthority = source.attributeAuthority;
  401.         }
  402.     }
  403.     private void copyStoreFrom(RequestConfig source) {      
  404.         if(source.merlinTruststore!=null) {
  405.             this.merlinTruststore = source.merlinTruststore;
  406.         }
  407.         if(source.merlinKeystore!=null) {
  408.             this.merlinKeystore = source.merlinKeystore;
  409.         }
  410.         if(source.symmetricKeystore!=null) {
  411.             this.symmetricKeystore = source.symmetricKeystore;
  412.         }
  413.         if(source.multiKeystore!=null) {
  414.             this.multiKeystore = source.multiKeystore;
  415.         }
  416.         if(source.jwkSetStore!=null) {
  417.             this.jwkSetStore = source.jwkSetStore;
  418.         }
  419.         if(source.keyPairStore!=null) {
  420.             this.keyPairStore = source.keyPairStore;
  421.         }
  422.         if(source.publicKeyStore!=null) {
  423.             this.publicKeyStore = source.publicKeyStore;
  424.         }
  425.         if(source.secretKeyStore!=null) {
  426.             this.secretKeyStore = source.secretKeyStore;
  427.         }
  428.         if(source.remoteStore!=null) {
  429.             this.remoteStore = source.remoteStore;
  430.         }
  431.         if(source.remoteStoreClientInfo!=null) {
  432.             this.remoteStoreClientInfo = source.remoteStoreClientInfo;
  433.         }
  434.         if(source.httpStore!=null) {
  435.             this.httpStore = source.httpStore;
  436.         }
  437.         if(source.byokStore!=null) {
  438.             this.byokStore = source.byokStore;
  439.         }
  440.         if(source.crlCertstore!=null) {
  441.             this.crlCertstore = source.crlCertstore;
  442.         }
  443.         if(source.sslSocketFactory!=null) {
  444.             this.sslSocketFactory = source.sslSocketFactory;
  445.         }
  446.         if(source.sslConfigProps!=null) {
  447.             this.sslConfigProps = source.sslConfigProps;
  448.         }
  449.         if(source.externalResource!=null) {
  450.             this.externalResource = source.externalResource;
  451.         }
  452.         if(source.ocspResponse!=null) {
  453.             this.ocspResponse = source.ocspResponse;
  454.         }
  455.     }
  456.     private void copyTemplateFrom(RequestConfig source) {
  457.         if(source.template!=null) {
  458.             this.template = source.template;
  459.         }
  460.     }
  461.    
  462.    
  463.    
  464.    
  465.    
  466.     public String getKey() {
  467.         return this.key;
  468.     }
  469.     public void setKey(String key) {
  470.         this.key = key;
  471.     }
  472.    
  473.     public boolean isCached() {
  474.         return this.cached;
  475.     }
  476.     public void setCached(boolean cached) {
  477.         this.cached = cached;
  478.     }
  479.    
  480.     private synchronized void initSemaphore() {
  481.         if(this.semaphore==null) {
  482.             this.semaphore = new org.openspcoop2.utils.Semaphore("RequestConfig");
  483.         }
  484.     }
  485.    
  486.     public IDSoggetto getDominioDefault() {
  487.         return this.dominioDefault;
  488.     }
  489.     public void setDominioDefault(IDSoggetto dominioDefault) {
  490.         this.dominioDefault = dominioDefault;
  491.     }
  492.    
  493.     public IDServizio getIdServizio() {
  494.         return this.idServizio;
  495.     }
  496.     public void setIdServizio(IDServizio idServizio) {
  497.         this.idServizio = idServizio;
  498.     }
  499.     public AccordoServizioParteComune getAspc() {
  500.         return this.aspc;
  501.     }
  502.     public void setAspc(AccordoServizioParteComune aspc) {
  503.         this.aspc = aspc;
  504.     }
  505.     public AccordoServizioParteSpecifica getAsps() {
  506.         return this.asps;
  507.     }
  508.     public void setAsps(AccordoServizioParteSpecifica asps) {
  509.         this.asps = asps;
  510.     }
  511.     public org.openspcoop2.core.registry.constants.ServiceBinding getServiceBinding() {
  512.         return this.serviceBinding;
  513.     }
  514.     public void setServiceBinding(org.openspcoop2.core.registry.constants.ServiceBinding serviceBinding) {
  515.         this.serviceBinding = serviceBinding;
  516.     }
  517.    
  518.     private static String buildKeyAccordoServizioWrapper(InformationApiSource infoWsdlSource,boolean buildSchemaXSD,boolean processIncludeForOpenApi,boolean readDatiRegistro) {
  519.         if(infoWsdlSource!=null) {
  520.             return infoWsdlSource.name()+"_"+buildSchemaXSD+"_"+processIncludeForOpenApi+"_"+readDatiRegistro;
  521.         }
  522.         else {
  523.             return "NULL_"+buildSchemaXSD+"_"+processIncludeForOpenApi+"_"+readDatiRegistro;
  524.         }
  525.     }
  526.    
  527.     public org.openspcoop2.core.registry.wsdl.AccordoServizioWrapper getAsWrapperSoap(InformationApiSource infoWsdlSource,boolean buildSchemaXSD,boolean readDatiRegistro) {
  528.         if(this.asWrapperSoap==null) {
  529.             return null;
  530.         }
  531.         String keyASWrapper = buildKeyAccordoServizioWrapper(infoWsdlSource, buildSchemaXSD, false, readDatiRegistro);
  532.         return this.asWrapperSoap.get(keyASWrapper);
  533.     }
  534.     public void setAsWrapperSoap(org.openspcoop2.core.registry.wsdl.AccordoServizioWrapper asWrapperSoap, InformationApiSource infoWsdlSource,boolean buildSchemaXSD,boolean readDatiRegistro, String idTransazione) {
  535.         String keyASWrapper = buildKeyAccordoServizioWrapper(infoWsdlSource, buildSchemaXSD, false, readDatiRegistro);
  536.         if(this.semaphore==null) {
  537.             // serializzazione da transient
  538.             initSemaphore();
  539.         }
  540.        
  541.         SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setAsWrapperSoap", idTransazione);
  542.         try {
  543.             if(this.asWrapperSoap==null) {
  544.                 this.asWrapperSoap = new HashMap<>(2);
  545.             }
  546.             this.asWrapperSoap.put(keyASWrapper, asWrapperSoap);
  547.         }finally {
  548.             this.semaphore.release(lock, "setAsWrapperSoap", idTransazione);
  549.         }
  550.     }
  551.     public org.openspcoop2.core.registry.rest.AccordoServizioWrapper getAsWrapperRest(InformationApiSource infoWsdlSource,boolean buildSchemaXSD,boolean processIncludeForOpenApi,boolean readDatiRegistro) {
  552.         if(this.asWrapperRest==null) {
  553.             return null;
  554.         }
  555.         String keyASWrapper = buildKeyAccordoServizioWrapper(infoWsdlSource, buildSchemaXSD, processIncludeForOpenApi, readDatiRegistro);
  556.         return this.asWrapperRest.get(keyASWrapper);
  557.     }
  558.     public void setAsWrapperRest(org.openspcoop2.core.registry.rest.AccordoServizioWrapper asWrapperRest, InformationApiSource infoWsdlSource,boolean buildSchemaXSD,boolean processIncludeForOpenApi,boolean readDatiRegistro, String idTransazione) {
  559.         String keyASWrapper = buildKeyAccordoServizioWrapper(infoWsdlSource, buildSchemaXSD, processIncludeForOpenApi, readDatiRegistro);
  560.         if(this.semaphore==null) {
  561.             // serializzazione da transient
  562.             initSemaphore();
  563.         }
  564.        
  565.         SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setAsWrapperRest", idTransazione);
  566.         try {
  567.             if(this.asWrapperRest==null) {
  568.                 this.asWrapperRest = new HashMap<>(2);
  569.             }
  570.             this.asWrapperRest.put(keyASWrapper, asWrapperRest);
  571.         }finally {
  572.             this.semaphore.release(lock, "setAsWrapperRest", idTransazione);
  573.         }
  574.     }
  575.    
  576.    
  577.     public Servizio getInfoServizio() {
  578.         return this.infoServizio;
  579.     }
  580.     public void setInfoServizio(Servizio infoServizio) {
  581.         this.infoServizio = infoServizio;
  582.     }
  583.     public Servizio getInfoServizioCorrelato() {
  584.         return this.infoServizioCorrelato;
  585.     }
  586.     public void setInfoServizioCorrelato(Servizio infoServizioCorrelato) {
  587.         this.infoServizioCorrelato = infoServizioCorrelato;
  588.     }
  589.     public Servizio getInfoServizioAzioneCorrelata() {
  590.         return this.infoServizioAzioneCorrelata;
  591.     }
  592.     public void setInfoServizioAzioneCorrelata(Servizio infoServizioAzioneCorrelata) {
  593.         this.infoServizioAzioneCorrelata = infoServizioAzioneCorrelata;
  594.     }
  595.     public String getServizioVersioneProtocollo() {
  596.         return this.servizioVersioneProtocollo;
  597.     }
  598.     public void setServizioVersioneProtocollo(String servizioVersioneProtocollo) {
  599.         this.servizioVersioneProtocollo = servizioVersioneProtocollo;
  600.     }
  601.    
  602.     private synchronized void initSemaphoreAllegatoApi() {
  603.         if(this.semaphoreAllegatoApi==null) {
  604.             this.semaphoreAllegatoApi = new org.openspcoop2.utils.Semaphore("RequestConfigAllegatoApi");
  605.         }
  606.     }
  607.     public void addAllegatoApi(String key, Documento documento, String idTransazione) {
  608.         if(this.semaphoreAllegatoApi==null) {
  609.             // serializzazione da transient
  610.             initSemaphoreAllegatoApi();
  611.         }
  612.        
  613.         SemaphoreLock lock = this.semaphoreAllegatoApi.acquireThrowRuntime("addAllegatoApi", idTransazione);
  614.         try {
  615.             if(this.allegatoApi==null) {
  616.                 this.allegatoApi = new HashMap<>(3);
  617.             }
  618.             this.allegatoApi.put(key, documento);
  619.         }finally {
  620.             this.semaphoreAllegatoApi.release(lock, "addAllegatoApi", idTransazione);
  621.         }
  622.     }
  623.     public Documento getAllegatoApi(String key) {
  624.         if(this.allegatoApi==null) {
  625.             return null;
  626.         }
  627.         return this.allegatoApi.get(key);
  628.     }
  629.    
  630.     private synchronized void initSemaphoreAllegatoServizio() {
  631.         if(this.semaphoreAllegatoServizio==null) {
  632.             this.semaphoreAllegatoServizio = new org.openspcoop2.utils.Semaphore("RequestConfigAllegatoServizio");
  633.         }
  634.     }
  635.     public void addAllegatoServizio(String key, Documento documento, String idTransazione) {
  636.         if(this.semaphoreAllegatoServizio==null) {
  637.             // serializzazione da transient
  638.             initSemaphoreAllegatoServizio();
  639.         }
  640.        
  641.         SemaphoreLock lock = this.semaphoreAllegatoServizio.acquireThrowRuntime("addAllegatoServizio", idTransazione);
  642.         try {
  643.             if(this.allegatoServizio==null) {
  644.                 this.allegatoServizio = new HashMap<>(3);
  645.             }
  646.             this.allegatoServizio.put(key, documento);
  647.         }finally {
  648.             this.semaphoreAllegatoServizio.release(lock, "addAllegatoServizio", idTransazione);
  649.         }
  650.     }
  651.     public Documento getAllegatoServizio(String key) {
  652.         if(this.allegatoServizio==null) {
  653.             return null;
  654.         }
  655.         return this.allegatoServizio.get(key);
  656.     }
  657.    
  658.     public IDPortaApplicativa getIdPortaApplicativaDefault() {
  659.         return this.idPortaApplicativaDefault;
  660.     }
  661.     public void setIdPortaApplicativaDefault(IDPortaApplicativa idPortaApplicativaDefault) {
  662.         this.idPortaApplicativaDefault = idPortaApplicativaDefault;
  663.     }
  664.     public IDPortaApplicativa getIdPortaApplicativa() {
  665.         return this.idPortaApplicativa;
  666.     }
  667.     public void setIdPortaApplicativa(IDPortaApplicativa idPortaApplicativa) {
  668.         this.idPortaApplicativa = idPortaApplicativa;
  669.     }
  670.     public PortaApplicativa getPortaApplicativaDefault() {
  671.         return this.portaApplicativaDefault;
  672.     }
  673.     public void setPortaApplicativaDefault(PortaApplicativa portaApplicativaDefault) {
  674.         this.portaApplicativaDefault = portaApplicativaDefault;
  675.     }
  676.     public PortaApplicativa getPortaApplicativa() {
  677.         return this.portaApplicativa;
  678.     }
  679.     public void setPortaApplicativa(PortaApplicativa portaApplicativa) {
  680.         this.portaApplicativa = portaApplicativa;
  681.     }
  682.     public List<MappingErogazionePortaApplicativa> getListMappingErogazionePortaApplicativa() {
  683.         return this.listMappingErogazionePortaApplicativa;
  684.     }
  685.     public void setListMappingErogazionePortaApplicativa(
  686.             List<MappingErogazionePortaApplicativa> listMappingErogazionePortaApplicativa) {
  687.         this.listMappingErogazionePortaApplicativa = listMappingErogazionePortaApplicativa;
  688.     }
  689.     public void addServizioApplicativoErogatore(ServizioApplicativo sa, String idTransazione) {
  690.         if(this.semaphore==null) {
  691.             // serializzazione da transient
  692.             initSemaphore();
  693.         }
  694.        
  695.         SemaphoreLock lock = this.semaphore.acquireThrowRuntime("addServizioApplicativoErogatore", idTransazione);
  696.         try {
  697.             if(this.serviziApplicativiErogatore==null) {
  698.                 this.serviziApplicativiErogatore = new HashMap<>(5);
  699.             }      
  700.             this.serviziApplicativiErogatore.put(sa.getNome(), sa);
  701.         }finally {
  702.             this.semaphore.release(lock, "addServizioApplicativoErogatore", idTransazione);
  703.         }
  704.     }
  705.     public ServizioApplicativo getServizioApplicativoErogatore(String nome) {
  706.         if(this.serviziApplicativiErogatore==null) {
  707.             return null;
  708.         }
  709.         return this.serviziApplicativiErogatore.get(nome);
  710.     }
  711.     public int sizeServiziApplicativiErogatori() {
  712.         if(this.serviziApplicativiErogatore==null) {
  713.             return 0;
  714.         }
  715.         return this.serviziApplicativiErogatore.size();
  716.     }
  717.    
  718.     public List<IDPortaApplicativa> getPorteApplicativeByFiltroRicerca(ProtocolFiltroRicercaPorteApplicative filtro, BooleanNullable nullConditionsList) {
  719.         if(this.listPorteApplicativeByFiltroRicerca==null) {
  720.             nullConditionsList.setValue(null);
  721.             return new ArrayList<>();
  722.         }
  723.         String keyCache = filtro.toString();
  724.         return this.listPorteApplicativeByFiltroRicerca.get(keyCache);
  725.     }
  726.     public Map<String, List<IDPortaApplicativa>> getListPorteApplicativeByFiltroRicerca() {
  727.         return this.listPorteApplicativeByFiltroRicerca;
  728.     }
  729.     private synchronized void initSemaphorePorteApplicativeByFiltroRicerca() {
  730.         if(this.semaphorePorteApplicativeByFiltroRicerca==null) {
  731.             this.semaphorePorteApplicativeByFiltroRicerca = new org.openspcoop2.utils.Semaphore("RequestConfigPorteApplicativeByFiltroRicerca");
  732.         }
  733.     }
  734.     public void addPorteApplicativeByFiltroRicerca(ProtocolFiltroRicercaPorteApplicative filtro, List<IDPortaApplicativa> list, String idTransazione) {
  735.         if(this.semaphorePorteApplicativeByFiltroRicerca==null) {
  736.             // serializzazione da transient
  737.             initSemaphorePorteApplicativeByFiltroRicerca();
  738.         }
  739.        
  740.         SemaphoreLock lock = this.semaphorePorteApplicativeByFiltroRicerca.acquireThrowRuntime("addPorteApplicativeByFiltroRicerca", idTransazione);
  741.         try {
  742.             if(this.listPorteApplicativeByFiltroRicerca==null) {
  743.                 this.listPorteApplicativeByFiltroRicerca=new HashMap<>(3);
  744.             }
  745.             String keyCache = filtro.toString();
  746.             this.listPorteApplicativeByFiltroRicerca.put(keyCache, list);
  747.         }finally {
  748.             this.semaphorePorteApplicativeByFiltroRicerca.release(lock, "addPorteApplicativeByFiltroRicerca", idTransazione);
  749.         }
  750.     }
  751.    
  752.     public IDSoggetto getIdFruitore() {
  753.         return this.idFruitore;
  754.     }
  755.     public void setIdFruitore(IDSoggetto idFruitore) {
  756.         this.idFruitore = idFruitore;
  757.     }
  758.     public IDPortaDelegata getIdPortaDelegataDefault() {
  759.         return this.idPortaDelegataDefault;
  760.     }
  761.     public void setIdPortaDelegataDefault(IDPortaDelegata idPortaDelegataDefault) {
  762.         this.idPortaDelegataDefault = idPortaDelegataDefault;
  763.     }
  764.     public PortaDelegata getPortaDelegataDefault() {
  765.         return this.portaDelegataDefault;
  766.     }
  767.     public void setPortaDelegataDefault(PortaDelegata portaDelegataDefault) {
  768.         this.portaDelegataDefault = portaDelegataDefault;
  769.     }
  770.     public IDPortaDelegata getIdPortaDelegata() {
  771.         return this.idPortaDelegata;
  772.     }
  773.     public void setIdPortaDelegata(IDPortaDelegata idPortaDelegata) {
  774.         this.idPortaDelegata = idPortaDelegata;
  775.     }
  776.     public PortaDelegata getPortaDelegata() {
  777.         return this.portaDelegata;
  778.     }
  779.     public void setPortaDelegata(PortaDelegata portaDelegata) {
  780.         this.portaDelegata = portaDelegata;
  781.     }
  782.     public List<MappingFruizionePortaDelegata> getListMappingFruizionePortaDelegata() {
  783.         return this.listMappingFruizionePortaDelegata;
  784.     }
  785.     public void setListMappingFruizionePortaDelegata(
  786.             List<MappingFruizionePortaDelegata> listMappingFruizionePortaDelegata) {
  787.         this.listMappingFruizionePortaDelegata = listMappingFruizionePortaDelegata;
  788.     }
  789.    
  790.     public List<IDPortaDelegata> getPorteDelegateByFiltroRicerca(ProtocolFiltroRicercaPorteDelegate filtro, BooleanNullable nullConditionsList) {
  791.         if(this.listPorteDelegateByFiltroRicerca==null) {
  792.             nullConditionsList.setValue(null);
  793.             return new ArrayList<>();
  794.         }
  795.         String keyCache = filtro.toString();
  796.         return this.listPorteDelegateByFiltroRicerca.get(keyCache);
  797.     }
  798.     public Map<String, List<IDPortaDelegata>> getListPorteDelegateByFiltroRicerca() {
  799.         return this.listPorteDelegateByFiltroRicerca;
  800.     }
  801.     private synchronized void initSemaphorePorteDelegateByFiltroRicerca() {
  802.         if(this.semaphorePorteDelegateByFiltroRicerca==null) {
  803.             this.semaphorePorteDelegateByFiltroRicerca = new org.openspcoop2.utils.Semaphore("RequestConfigPorteDelegateByFiltroRicerca");
  804.         }
  805.     }
  806.     public void addPorteDelegateByFiltroRicerca(ProtocolFiltroRicercaPorteDelegate filtro, List<IDPortaDelegata> list, String idTransazione) {
  807.         if(this.semaphorePorteDelegateByFiltroRicerca==null) {
  808.             // serializzazione da transient
  809.             initSemaphorePorteDelegateByFiltroRicerca();
  810.         }
  811.        
  812.         SemaphoreLock lock = this.semaphorePorteDelegateByFiltroRicerca.acquireThrowRuntime("addPorteDelegateByFiltroRicerca", idTransazione);
  813.         try {
  814.             if(this.listPorteDelegateByFiltroRicerca==null) {
  815.                 this.listPorteDelegateByFiltroRicerca=new HashMap<>(3);
  816.             }
  817.             String keyCache = filtro.toString();
  818.             this.listPorteDelegateByFiltroRicerca.put(keyCache, list);
  819.         }finally {
  820.             this.semaphorePorteDelegateByFiltroRicerca.release(lock, "addPorteDelegateByFiltroRicerca", idTransazione);
  821.         }
  822.     }
  823.    
  824.    
  825.     public org.openspcoop2.core.registry.Soggetto getSoggettoErogatoreRegistry() {
  826.         return this.soggettoErogatoreRegistry;
  827.     }
  828.     public void setSoggettoErogatoreRegistry(org.openspcoop2.core.registry.Soggetto soggettoErogatoreRegistry) {
  829.         this.soggettoErogatoreRegistry = soggettoErogatoreRegistry;
  830.     }
  831.     public org.openspcoop2.core.config.Soggetto getSoggettoErogatoreConfig() {
  832.         return this.soggettoErogatoreConfig;
  833.     }
  834.     public void setSoggettoErogatoreConfig(org.openspcoop2.core.config.Soggetto soggettoErogatoreConfig) {
  835.         this.soggettoErogatoreConfig = soggettoErogatoreConfig;
  836.     }
  837.     public org.openspcoop2.core.registry.Soggetto getSoggettoFruitoreRegistry() {
  838.         return this.soggettoFruitoreRegistry;
  839.     }
  840.     public void setSoggettoFruitoreRegistry(org.openspcoop2.core.registry.Soggetto soggettoFruitoreRegistry) {
  841.         this.soggettoFruitoreRegistry = soggettoFruitoreRegistry;
  842.     }
  843.     public org.openspcoop2.core.config.Soggetto getSoggettoFruitoreConfig() {
  844.         return this.soggettoFruitoreConfig;
  845.     }
  846.     public void setSoggettoFruitoreConfig(org.openspcoop2.core.config.Soggetto soggettoFruitoreConfig) {
  847.         this.soggettoFruitoreConfig = soggettoFruitoreConfig;
  848.     }
  849.    
  850.     public String getSoggettoErogatoreIdentificativoPorta() {
  851.         return this.soggettoErogatoreIdentificativoPorta;
  852.     }
  853.     public void setSoggettoErogatoreIdentificativoPorta(String soggettoErogatoreIdentificativoPorta) {
  854.         this.soggettoErogatoreIdentificativoPorta = soggettoErogatoreIdentificativoPorta;
  855.     }
  856.     public Boolean getSoggettoErogatoreSoggettoVirtuale() {
  857.         return this.soggettoErogatoreSoggettoVirtuale;
  858.     }
  859.     public void setSoggettoErogatoreSoggettoVirtuale(Boolean soggettoErogatoreSoggettoVirtuale) {
  860.         this.soggettoErogatoreSoggettoVirtuale = soggettoErogatoreSoggettoVirtuale;
  861.     }
  862.     public String getSoggettoFruitoreIdentificativoPorta() {
  863.         return this.soggettoFruitoreIdentificativoPorta;
  864.     }
  865.     public void setSoggettoFruitoreIdentificativoPorta(String soggettoFruitoreIdentificativoPorta) {
  866.         this.soggettoFruitoreIdentificativoPorta = soggettoFruitoreIdentificativoPorta;
  867.     }
  868.     public Boolean getSoggettoFruitoreSoggettoVirtuale() {
  869.         return this.soggettoFruitoreSoggettoVirtuale;
  870.     }
  871.     public void setSoggettoFruitoreSoggettoVirtuale(Boolean soggettoFruitoreSoggettoVirtuale) {
  872.         this.soggettoFruitoreSoggettoVirtuale = soggettoFruitoreSoggettoVirtuale;
  873.     }
  874.    
  875.     public String getSoggettoErogatoreImplementazionePdd() {
  876.         return this.soggettoErogatoreImplementazionePdd;
  877.     }
  878.     public void setSoggettoErogatoreImplementazionePdd(String soggettoErogatoreImplementazionePdd) {
  879.         this.soggettoErogatoreImplementazionePdd = soggettoErogatoreImplementazionePdd;
  880.     }
  881.     public Boolean getSoggettoErogatorePddReaded() {
  882.         return this.soggettoErogatorePddReaded;
  883.     }
  884.     public void setSoggettoErogatorePddReaded(Boolean soggettoErogatorePddReaded) {
  885.         this.soggettoErogatorePddReaded = soggettoErogatorePddReaded;
  886.     }
  887.     public PortaDominio getSoggettoErogatorePdd() {
  888.         return this.soggettoErogatorePdd;
  889.     }
  890.     public void setSoggettoErogatorePdd(PortaDominio soggettoErogatorePdd) {
  891.         this.soggettoErogatorePdd = soggettoErogatorePdd;
  892.     }
  893.     public String getSoggettoFruitoreImplementazionePdd() {
  894.         return this.soggettoFruitoreImplementazionePdd;
  895.     }
  896.     public void setSoggettoFruitoreImplementazionePdd(String soggettoFruitoreImplementazionePdd) {
  897.         this.soggettoFruitoreImplementazionePdd = soggettoFruitoreImplementazionePdd;
  898.     }
  899.     public Boolean getSoggettoFruitorePddReaded() {
  900.         return this.soggettoFruitorePddReaded;
  901.     }
  902.     public void setSoggettoFruitorePddReaded(Boolean soggettoFruitorePddReaded) {
  903.         this.soggettoFruitorePddReaded = soggettoFruitorePddReaded;
  904.     }
  905.     public PortaDominio getSoggettoFruitorePdd() {
  906.         return this.soggettoFruitorePdd;
  907.     }
  908.     public void setSoggettoFruitorePdd(PortaDominio soggettoFruitorePdd) {
  909.         this.soggettoFruitorePdd = soggettoFruitorePdd;
  910.     }
  911.    
  912.     public String getSoggettoErogatoreVersioneProtocollo() {
  913.         return this.soggettoErogatoreVersioneProtocollo;
  914.     }
  915.     public void setSoggettoErogatoreVersioneProtocollo(String soggettoErogatoreVersioneProtocollo) {
  916.         this.soggettoErogatoreVersioneProtocollo = soggettoErogatoreVersioneProtocollo;
  917.     }
  918.     public String getSoggettoFruitoreVersioneProtocollo() {
  919.         return this.soggettoFruitoreVersioneProtocollo;
  920.     }
  921.     public void setSoggettoFruitoreVersioneProtocollo(String soggettoFruitoreVersioneProtocollo) {
  922.         this.soggettoFruitoreVersioneProtocollo = soggettoFruitoreVersioneProtocollo;
  923.     }
  924.    
  925.     public org.openspcoop2.core.config.Connettore getConnettoreFrutoreServizio() {
  926.         return this.connettoreFrutoreServizio;
  927.     }
  928.     public void setConnettoreFrutoreServizio(org.openspcoop2.core.config.Connettore connettoreFrutoreServizio) {
  929.         this.connettoreFrutoreServizio = connettoreFrutoreServizio;
  930.     }
  931.     public org.openspcoop2.core.config.Connettore getConnettoreSoggettoErogatore() {
  932.         return this.connettoreSoggettoErogatore;
  933.     }
  934.     public void setConnettoreSoggettoErogatore(org.openspcoop2.core.config.Connettore connettoreSoggettoErogatore) {
  935.         this.connettoreSoggettoErogatore = connettoreSoggettoErogatore;
  936.     }

  937.     public void addRuolo(String key, Ruolo ruolo, String idTransazione) {
  938.         if(this.semaphore==null) {
  939.             // serializzazione da transient
  940.             initSemaphore();
  941.         }
  942.        
  943.         SemaphoreLock lock = this.semaphore.acquireThrowRuntime("addRuolo", idTransazione);
  944.         try {
  945.             if(this.ruolo==null) {
  946.                 this.ruolo=new HashMap<>(3);
  947.             }
  948.             this.ruolo.put(key, ruolo);
  949.         }finally {
  950.             this.semaphore.release(lock, "addRuolo", idTransazione);
  951.         }
  952.     }
  953.     public Ruolo getRuolo(String key) {
  954.         if(this.ruolo==null) {
  955.             return null;
  956.         }
  957.         return this.ruolo.get(key);
  958.     }
  959.     public List<String> getRuoloKeys(){
  960.         List<String> l = new ArrayList<>();
  961.         if(this.ruolo!=null && !this.ruolo.isEmpty()) {
  962.             l.addAll(this.ruolo.keySet());
  963.         }
  964.         return l;
  965.     }
  966.    
  967.     public void addScope(String key, Scope scope, String idTransazione) {
  968.         if(this.semaphore==null) {
  969.             // serializzazione da transient
  970.             initSemaphore();
  971.         }
  972.        
  973.         SemaphoreLock lock = this.semaphore.acquireThrowRuntime("addScope", idTransazione);
  974.         try {
  975.             if(this.scope==null) {
  976.                 this.scope=new HashMap<>(3);
  977.             }
  978.             this.scope.put(key, scope);
  979.         }finally {
  980.             this.semaphore.release(lock, "addScope", idTransazione);
  981.         }
  982.     }
  983.     public Scope getScope(String key) {
  984.         if(this.scope==null) {
  985.             return null;
  986.         }
  987.         return this.scope.get(key);
  988.     }
  989.     public List<String> getScopeKeys(){
  990.         List<String> l = new ArrayList<>();
  991.         if(this.scope!=null && !this.scope.isEmpty()) {
  992.             l.addAll(this.scope.keySet());
  993.         }
  994.         return l;
  995.     }
  996.    
  997.     public SystemProperties getSystemProperties() {
  998.         return this.systemProperties;
  999.     }
  1000.     public void setSystemProperties(SystemProperties systemProperties) {
  1001.         this.systemProperties = systemProperties;
  1002.     }
  1003.     public Boolean getForwardProxyEnabled() {
  1004.         return this.forwardProxyEnabled;
  1005.     }
  1006.     public void setForwardProxyEnabled(Boolean forwardProxyEnabled) {
  1007.         this.forwardProxyEnabled = forwardProxyEnabled;
  1008.     }
  1009.    
  1010.     public void addForwardProxy(String key, Serializable fp, String idTransazione) {
  1011.         if(this.semaphore==null) {
  1012.             // serializzazione da transient
  1013.             initSemaphore();
  1014.         }
  1015.        
  1016.         SemaphoreLock lock = this.semaphore.acquireThrowRuntime("addForwardProxy", idTransazione);
  1017.         try {
  1018.             if(this.forwardProxy==null) {
  1019.                 this.forwardProxy=new HashMap<>(3);
  1020.             }
  1021.             this.forwardProxy.put(key, fp);
  1022.         }finally {
  1023.             this.semaphore.release(lock, "addForwardProxy", idTransazione);
  1024.         }
  1025.     }
  1026.     public Serializable getForwardProxy(String key) {
  1027.         if(this.forwardProxy==null) {
  1028.             return null;
  1029.         }
  1030.         return this.forwardProxy.get(key);
  1031.     }
  1032.     public List<String> getForwardProxyKeys(){
  1033.         List<String> l = new ArrayList<>();
  1034.         if(this.forwardProxy!=null && !this.forwardProxy.isEmpty()) {
  1035.             l.addAll(this.forwardProxy.keySet());
  1036.         }
  1037.         return l;
  1038.     }
  1039.    
  1040.     public CredenzialeMittente getCredenzialeMittente(TipoCredenzialeMittente tipo, String keyCache) {
  1041.         if(this.mapCredenziali==null) {
  1042.             return null;
  1043.         }
  1044.         Map<String, CredenzialeMittente> map = this.mapCredenziali.get(tipo);
  1045.         if(map!=null) {
  1046.             return map.get(keyCache);
  1047.         }
  1048.         return null;
  1049.     }
  1050.    
  1051.     private synchronized void initSemaphoreCredenziali() {
  1052.         if(this.semaphoreCredenziali==null) {
  1053.             this.semaphoreCredenziali = new org.openspcoop2.utils.Semaphore("RequestConfigCredenzialeMittente");
  1054.         }
  1055.     }
  1056.     public void addCredenzialeMittente(TipoCredenzialeMittente tipo, String keyCache, CredenzialeMittente credenziale, String idTransazione, Date scadenzaEntry) {
  1057.        
  1058.         if(this.semaphoreCredenziali==null) {
  1059.             // serializzazione da transient
  1060.             initSemaphoreCredenziali();
  1061.         }
  1062.        
  1063.         SemaphoreLock lock = this.semaphoreCredenziali.acquireThrowRuntime("addCredenzialeMittente", idTransazione);
  1064.         try {
  1065.             if(this.mapCredenziali==null) {
  1066.                 this.mapCredenziali = new EnumMap<>(TipoCredenzialeMittente.class);
  1067.             }
  1068.             Map<String, CredenzialeMittente> map = this.mapCredenziali.get(tipo);
  1069.             if(map==null) {
  1070.                 map = new HashMap<>();
  1071.                 this.mapCredenziali.put(tipo, map);
  1072.             }
  1073.             if(!map.containsKey(keyCache)) {
  1074.                 map.put(keyCache, credenziale);
  1075.             }
  1076.             else {
  1077.                 CredenzialeMittente c = map.get(keyCache);
  1078.                 if(!c.getOraRegistrazione().after(scadenzaEntry)) { // serve per forzare l'aggiornamento dell'oggetto se "scaduto"
  1079.                     map.remove(keyCache);
  1080.                     map.put(keyCache, credenziale);
  1081.                 }
  1082.             }
  1083.         }finally {
  1084.             this.semaphoreCredenziali.release(lock, "addCredenzialeMittente", idTransazione);
  1085.         }
  1086.     }
  1087.    
  1088.     private synchronized void initSemaphorePolicy() {
  1089.         if(this.semaphorePolicy==null) {
  1090.             this.semaphorePolicy = new org.openspcoop2.utils.Semaphore("RequestConfigPolicy");
  1091.         }
  1092.     }
  1093.    
  1094.     public void addPolicyValidazioneToken(String key, Serializable fp, String idTransazione) {
  1095.         if(this.semaphorePolicy==null) {
  1096.             // serializzazione da transient
  1097.             initSemaphorePolicy();
  1098.         }
  1099.        
  1100.         SemaphoreLock lock = this.semaphorePolicy.acquireThrowRuntime("addPolicyValidazioneToken", idTransazione);
  1101.         try {
  1102.             if(this.policyValidazioneToken==null) {
  1103.                 this.policyValidazioneToken = new HashMap<>(3);
  1104.             }
  1105.             this.policyValidazioneToken.put(key, fp);
  1106.         }finally {
  1107.             this.semaphorePolicy.release(lock, "addPolicyValidazioneToken", idTransazione);
  1108.         }
  1109.     }
  1110.     public Serializable getPolicyValidazioneToken(String key) {
  1111.         if(this.policyValidazioneToken==null) {
  1112.             return null;
  1113.         }
  1114.         return this.policyValidazioneToken.get(key);
  1115.     }
  1116.     public List<String> getPolicyValidazioneTokenKeys(){
  1117.         List<String> l = new ArrayList<>();
  1118.         if(this.policyValidazioneToken!=null && !this.policyValidazioneToken.isEmpty()) {
  1119.             l.addAll(this.policyValidazioneToken.keySet());
  1120.         }
  1121.         return l;
  1122.     }
  1123.    
  1124.     public void addPolicyNegoziazioneToken(String key, Serializable fp, String idTransazione) {
  1125.        
  1126.         if(this.semaphorePolicy==null) {
  1127.             // serializzazione da transient
  1128.             initSemaphorePolicy();
  1129.         }
  1130.        
  1131.         SemaphoreLock lock = this.semaphorePolicy.acquireThrowRuntime("addPolicyNegoziazioneToken", idTransazione);
  1132.         try {
  1133.             if(this.policyNegoziazioneToken==null) {
  1134.                 this.policyNegoziazioneToken = new HashMap<>(3);
  1135.             }
  1136.             this.policyNegoziazioneToken.put(key, fp);
  1137.         }finally {
  1138.             this.semaphorePolicy.release(lock, "addPolicyNegoziazioneToken", idTransazione);
  1139.         }
  1140.     }
  1141.     public Serializable getPolicyNegoziazioneToken(String key) {
  1142.         if(this.policyNegoziazioneToken==null) {
  1143.             return null;
  1144.         }
  1145.         return this.policyNegoziazioneToken.get(key);
  1146.     }
  1147.     public List<String> getPolicyNegoziazioneTokenKeys(){
  1148.         List<String> l = new ArrayList<>();
  1149.         if(this.policyNegoziazioneToken!=null && !this.policyNegoziazioneToken.isEmpty()) {
  1150.             l.addAll(this.policyNegoziazioneToken.keySet());
  1151.         }
  1152.         return l;
  1153.     }
  1154.    
  1155.     public void addAttributeAuthority(String key, Serializable fp, String idTransazione) {
  1156.         if(this.semaphorePolicy==null) {
  1157.             // serializzazione da transient
  1158.             initSemaphorePolicy();
  1159.         }
  1160.        
  1161.         SemaphoreLock lock = this.semaphorePolicy.acquireThrowRuntime("addAttributeAuthority", idTransazione);
  1162.         try {
  1163.             if(this.attributeAuthority==null) {
  1164.                 this.attributeAuthority = new HashMap<>(3);
  1165.             }
  1166.             this.attributeAuthority.put(key, fp);
  1167.         }finally {
  1168.             this.semaphorePolicy.release(lock, "addAttributeAuthority", idTransazione);
  1169.         }
  1170.     }
  1171.     public Serializable getAttributeAuthority(String key) {
  1172.         if(this.attributeAuthority==null) {
  1173.             return null;
  1174.         }
  1175.         return this.attributeAuthority.get(key);
  1176.     }
  1177.     public List<String> getAttributeAuthorityKeys(){
  1178.         List<String> l = new ArrayList<>();
  1179.         if(this.attributeAuthority!=null && !this.attributeAuthority.isEmpty()) {
  1180.             l.addAll(this.attributeAuthority.keySet());
  1181.         }
  1182.         return l;
  1183.     }
  1184.    
  1185.    
  1186.     private synchronized void initSemaphoreStore() {
  1187.         if(this.semaphoreStore==null) {
  1188.             this.semaphoreStore = new org.openspcoop2.utils.Semaphore("RequestConfigStore");
  1189.         }
  1190.     }
  1191.    
  1192.     public void addMerlinTruststore(String key, Serializable merlinTruststore, String idTransazione) {
  1193.        
  1194.         if(this.semaphoreStore==null) {
  1195.             // serializzazione da transient
  1196.             initSemaphoreStore();
  1197.         }
  1198.        
  1199.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addMerlinTruststore", idTransazione);
  1200.         try {
  1201.             if(this.merlinTruststore==null) {
  1202.                 this.merlinTruststore = new HashMap<>(3);
  1203.             }
  1204.             this.merlinTruststore.put(key, merlinTruststore);
  1205.         }finally {
  1206.             this.semaphoreStore.release(lock, "addMerlinTruststore", idTransazione);
  1207.         }
  1208.     }
  1209.     public Serializable getMerlinTruststore(String key) {
  1210.         if(this.merlinTruststore==null) {
  1211.             return null;
  1212.         }
  1213.         return this.merlinTruststore.get(key);
  1214.     }
  1215.    
  1216.     public void addMerlinKeystore(String key, Serializable merlinKeystore, String idTransazione) {
  1217.        
  1218.         if(this.semaphoreStore==null) {
  1219.             // serializzazione da transient
  1220.             initSemaphoreStore();
  1221.         }
  1222.        
  1223.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addMerlinKeystore", idTransazione);
  1224.         try {
  1225.             if(this.merlinKeystore==null) {
  1226.                 this.merlinKeystore = new HashMap<>(3);
  1227.             }
  1228.             this.merlinKeystore.put(key, merlinKeystore);
  1229.         }finally {
  1230.             this.semaphoreStore.release(lock, "addMerlinKeystore", idTransazione);
  1231.         }
  1232.     }
  1233.     public Serializable getMerlinKeystore(String key) {
  1234.         if(this.merlinKeystore==null) {
  1235.             return null;
  1236.         }
  1237.         return this.merlinKeystore.get(key);
  1238.     }
  1239.    
  1240.     public void addSymmetricKeystore(String key, Serializable symmetricKeystore, String idTransazione) {
  1241.          
  1242.        
  1243.         if(this.semaphoreStore==null) {
  1244.             // serializzazione da transient
  1245.             initSemaphoreStore();
  1246.         }
  1247.        
  1248.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addSymmetricKeystore", idTransazione);
  1249.         try {
  1250.             if(this.symmetricKeystore==null) {
  1251.                 this.symmetricKeystore = new HashMap<>(3);
  1252.             }
  1253.             this.symmetricKeystore.put(key, symmetricKeystore);
  1254.         }finally {
  1255.             this.semaphoreStore.release(lock, "addSymmetricKeystore", idTransazione);
  1256.         }
  1257.     }
  1258.     public Serializable getSymmetricKeystore(String key) {
  1259.         if(this.symmetricKeystore==null) {
  1260.             return null;
  1261.         }
  1262.         return this.symmetricKeystore.get(key);
  1263.     }
  1264.    
  1265.     public void addMultiKeystore(String key, Serializable multiKeystore, String idTransazione) {
  1266.          
  1267.        
  1268.         if(this.semaphoreStore==null) {
  1269.             // serializzazione da transient
  1270.             initSemaphoreStore();
  1271.         }
  1272.        
  1273.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addMultiKeystore", idTransazione);
  1274.         try {
  1275.             if(this.multiKeystore==null) {
  1276.                 this.multiKeystore = new HashMap<>(3);
  1277.             }
  1278.             this.multiKeystore.put(key, multiKeystore);
  1279.         }finally {
  1280.             this.semaphoreStore.release(lock, "addMultiKeystore", idTransazione);
  1281.         }
  1282.     }
  1283.     public Serializable getMultiKeystore(String key) {
  1284.         if(this.multiKeystore==null) {
  1285.             return null;
  1286.         }
  1287.         return this.multiKeystore.get(key);
  1288.     }
  1289.    
  1290.     public void addJWKSetStore(String key, Serializable jwkSetStore, String idTransazione) {
  1291.          
  1292.        
  1293.         if(this.semaphoreStore==null) {
  1294.             // serializzazione da transient
  1295.             initSemaphoreStore();
  1296.         }
  1297.        
  1298.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addJWKSetStore", idTransazione);
  1299.         try {
  1300.             if(this.jwkSetStore==null) {
  1301.                 this.jwkSetStore = new HashMap<>(3);
  1302.             }
  1303.             this.jwkSetStore.put(key, jwkSetStore);
  1304.         }finally {
  1305.             this.semaphoreStore.release(lock, "addJWKSetStore", idTransazione);
  1306.         }
  1307.     }
  1308.     public Serializable getJWKSetStore(String key) {
  1309.         if(this.jwkSetStore==null) {
  1310.             return null;
  1311.         }
  1312.         return this.jwkSetStore.get(key);
  1313.     }
  1314.    
  1315.     public void addKeyPairStore(String key, Serializable keyPairStore, String idTransazione) {
  1316.          
  1317.        
  1318.         if(this.semaphoreStore==null) {
  1319.             // serializzazione da transient
  1320.             initSemaphoreStore();
  1321.         }
  1322.        
  1323.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addKeyPairStore", idTransazione);
  1324.         try {
  1325.             if(this.keyPairStore==null) {
  1326.                 this.keyPairStore = new HashMap<>(3);
  1327.             }
  1328.             this.keyPairStore.put(key, keyPairStore);
  1329.         }finally {
  1330.             this.semaphoreStore.release(lock, "addKeyPairStore", idTransazione);
  1331.         }
  1332.     }
  1333.     public Serializable getKeyPairStore(String key) {
  1334.         if(this.keyPairStore==null) {
  1335.             return null;
  1336.         }
  1337.         return this.keyPairStore.get(key);
  1338.     }
  1339.    
  1340.     public void addPublicKeyStore(String key, Serializable publicKeyStore, String idTransazione) {
  1341.          
  1342.        
  1343.         if(this.semaphoreStore==null) {
  1344.             // serializzazione da transient
  1345.             initSemaphoreStore();
  1346.         }
  1347.        
  1348.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addPublicKeyStore", idTransazione);
  1349.         try {
  1350.             if(this.publicKeyStore==null) {
  1351.                 this.publicKeyStore = new HashMap<>(3);
  1352.             }
  1353.             this.publicKeyStore.put(key, publicKeyStore);
  1354.         }finally {
  1355.             this.semaphoreStore.release(lock, "addPublicKeyStore", idTransazione);
  1356.         }
  1357.     }
  1358.     public Serializable getPublicKeyStore(String key) {
  1359.         if(this.publicKeyStore==null) {
  1360.             return null;
  1361.         }
  1362.         return this.publicKeyStore.get(key);
  1363.     }
  1364.    
  1365.     public void addSecretKeyStore(String key, Serializable secretKeyStore, String idTransazione) {
  1366.          
  1367.        
  1368.         if(this.semaphoreStore==null) {
  1369.             // serializzazione da transient
  1370.             initSemaphoreStore();
  1371.         }
  1372.        
  1373.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addSecretKeyStore", idTransazione);
  1374.         try {
  1375.             if(this.secretKeyStore==null) {
  1376.                 this.secretKeyStore = new HashMap<>(3);
  1377.             }
  1378.             this.secretKeyStore.put(key, secretKeyStore);
  1379.         }finally {
  1380.             this.semaphoreStore.release(lock, "addSecretKeyStore", idTransazione);
  1381.         }
  1382.     }
  1383.     public Serializable getSecretKeyStore(String key) {
  1384.         if(this.secretKeyStore==null) {
  1385.             return null;
  1386.         }
  1387.         return this.secretKeyStore.get(key);
  1388.     }
  1389.    
  1390.     public void addRemoteStore(String key, Serializable remoteStore, String idTransazione) {
  1391.          
  1392.         if(!useCacheForRemoteStore) {
  1393.             return;
  1394.         }
  1395.        
  1396.         if(this.semaphoreStore==null) {
  1397.             // serializzazione da transient
  1398.             initSemaphoreStore();
  1399.         }
  1400.        
  1401.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addRemoteStore", idTransazione);
  1402.         try {
  1403.             if(this.remoteStore==null) {
  1404.                 this.remoteStore = new HashMap<>(3);
  1405.             }
  1406.             this.remoteStore.put(key, remoteStore);
  1407.         }finally {
  1408.             this.semaphoreStore.release(lock, "addRemoteStore", idTransazione);
  1409.         }
  1410.     }
  1411.     public Serializable getRemoteStore(String key) {
  1412.         if(this.remoteStore==null) {
  1413.             return null;
  1414.         }
  1415.         return this.remoteStore.get(key);
  1416.     }
  1417.     public void removeRemoteStore(String key) {
  1418.         if(this.remoteStore!=null) {
  1419.             this.remoteStore.remove(key);
  1420.         }
  1421.     }
  1422.    
  1423.     public void addRemoteStoreClientInfo(String key, Serializable remoteStore, String idTransazione) {
  1424.          
  1425.         if(!useCacheForRemoteStore) {
  1426.             return;
  1427.         }
  1428.        
  1429.         if(this.semaphoreStore==null) {
  1430.             // serializzazione da transient
  1431.             initSemaphoreStore();
  1432.         }
  1433.        
  1434.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addRemoteStoreClientInfo", idTransazione);
  1435.         try {
  1436.             if(this.remoteStoreClientInfo==null) {
  1437.                 this.remoteStoreClientInfo = new HashMap<>(3);
  1438.             }
  1439.             this.remoteStoreClientInfo.put(key, remoteStore);
  1440.         }finally {
  1441.             this.semaphoreStore.release(lock, "addRemoteStoreClientInfo", idTransazione);
  1442.         }
  1443.     }
  1444.     public Serializable getRemoteStoreClientInfo(String key) {
  1445.         if(this.remoteStoreClientInfo==null) {
  1446.             return null;
  1447.         }
  1448.         return this.remoteStoreClientInfo.get(key);
  1449.     }
  1450.     public void removeRemoteStoreClientInfo(String key) {
  1451.         if(this.remoteStoreClientInfo!=null) {
  1452.             this.remoteStoreClientInfo.remove(key);
  1453.         }
  1454.     }

  1455.     public void addHttpStore(String key, Serializable httpStore, String idTransazione) {
  1456.          
  1457.        
  1458.         if(this.semaphoreStore==null) {
  1459.             // serializzazione da transient
  1460.             initSemaphoreStore();
  1461.         }
  1462.        
  1463.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addHttpStore", idTransazione);
  1464.         try {
  1465.             if(this.httpStore==null) {
  1466.                 this.httpStore = new HashMap<>(3);
  1467.             }
  1468.             this.httpStore.put(key, httpStore);
  1469.         }finally {
  1470.             this.semaphoreStore.release(lock, "addHttpStore", idTransazione);
  1471.         }
  1472.     }
  1473.     public Serializable getHttpStore(String key) {
  1474.         if(this.httpStore==null) {
  1475.             return null;
  1476.         }
  1477.         return this.httpStore.get(key);
  1478.     }
  1479.    
  1480.     public void addBYOKStore(String key, Serializable byokStore, String idTransazione) {
  1481.          
  1482.        
  1483.         if(this.semaphoreStore==null) {
  1484.             // serializzazione da transient
  1485.             initSemaphoreStore();
  1486.         }
  1487.        
  1488.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addBYOKStore", idTransazione);
  1489.         try {
  1490.             if(this.byokStore==null) {
  1491.                 this.byokStore = new HashMap<>(3);
  1492.             }
  1493.             this.byokStore.put(key, byokStore);
  1494.         }finally {
  1495.             this.semaphoreStore.release(lock, "addBYOKStore", idTransazione);
  1496.         }
  1497.     }
  1498.     public Serializable getBYOKStore(String key) {
  1499.         if(this.byokStore==null) {
  1500.             return null;
  1501.         }
  1502.         return this.byokStore.get(key);
  1503.     }
  1504.    
  1505.     public void addCRLCertstore(String key, Serializable crlCertstore, String idTransazione) {
  1506.          
  1507.        
  1508.         if(this.semaphoreStore==null) {
  1509.             // serializzazione da transient
  1510.             initSemaphoreStore();
  1511.         }
  1512.        
  1513.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addCRLCertstore", idTransazione);
  1514.         try {
  1515.             if(this.crlCertstore==null) {
  1516.                 this.crlCertstore = new HashMap<>(3);
  1517.             }
  1518.             this.crlCertstore.put(key, crlCertstore);
  1519.         }finally {
  1520.             this.semaphoreStore.release(lock, "addCRLCertstore", idTransazione);
  1521.         }
  1522.     }
  1523.     public Serializable getCRLCertstore(String key) {
  1524.         if(this.crlCertstore==null) {
  1525.             return null;
  1526.         }
  1527.         return this.crlCertstore.get(key);
  1528.     }
  1529.    
  1530.     public void addSSLSocketFactory(String key, Serializable sslSocketFactory, String idTransazione) {
  1531.          
  1532.        
  1533.         if(this.semaphoreStore==null) {
  1534.             // serializzazione da transient
  1535.             initSemaphoreStore();
  1536.         }
  1537.        
  1538.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addSSLSocketFactory", idTransazione);
  1539.         try {
  1540.             if(this.sslSocketFactory==null) {
  1541.                 this.sslSocketFactory = new HashMap<>(3);
  1542.             }
  1543.             this.sslSocketFactory.put(key, sslSocketFactory);
  1544.         }finally {
  1545.             this.semaphoreStore.release(lock, "addSSLSocketFactory", idTransazione);
  1546.         }
  1547.     }
  1548.     public Serializable getSSLSocketFactory(String key) {
  1549.         if(this.sslSocketFactory==null) {
  1550.             return null;
  1551.         }
  1552.         return this.sslSocketFactory.get(key);
  1553.     }
  1554.    
  1555.     public void addSSLConfigProps(String key, Serializable resource, String idTransazione) {
  1556.          
  1557.        
  1558.         if(this.semaphoreStore==null) {
  1559.             // serializzazione da transient
  1560.             initSemaphoreStore();
  1561.         }
  1562.        
  1563.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addSSLConfigProps", idTransazione);
  1564.         try {
  1565.             if(this.sslConfigProps==null) {
  1566.                 this.sslConfigProps = new HashMap<>(3);
  1567.             }
  1568.             this.sslConfigProps.put(key, resource);
  1569.         }finally {
  1570.             this.semaphoreStore.release(lock, "addSSLConfigProps", idTransazione);
  1571.         }
  1572.     }
  1573.     public Serializable getSSLConfigProps(String key) {
  1574.         if(this.sslConfigProps==null) {
  1575.             return null;
  1576.         }
  1577.         return this.sslConfigProps.get(key);
  1578.     }
  1579.    
  1580.     public void addExternalResource(String key, Serializable resource, String idTransazione) {
  1581.        
  1582.         if(!useCacheForExternalResource) {
  1583.             return;
  1584.         }
  1585.        
  1586.         if(this.semaphoreStore==null) {
  1587.             // serializzazione da transient
  1588.             initSemaphoreStore();
  1589.         }
  1590.        
  1591.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addExternalResource", idTransazione);
  1592.         try {
  1593.             if(this.externalResource==null) {
  1594.                 this.externalResource = new HashMap<>(3);
  1595.             }
  1596.             this.externalResource.put(key, resource);
  1597.         }finally {
  1598.             this.semaphoreStore.release(lock, "addExternalResource", idTransazione);
  1599.         }
  1600.     }
  1601.     public Serializable getExternalResource(String key) {
  1602.         if(this.externalResource==null) {
  1603.             return null;
  1604.         }
  1605.         return this.externalResource.get(key);
  1606.     }
  1607.    
  1608.     public void addOCSPResponse(String key, Serializable resource, String idTransazione) {
  1609.          
  1610.         if(!useCacheForOCSPResponse) {
  1611.             return;
  1612.         }
  1613.        
  1614.         if(this.semaphoreStore==null) {
  1615.             // serializzazione da transient
  1616.             initSemaphoreStore();
  1617.         }
  1618.        
  1619.         SemaphoreLock lock = this.semaphoreStore.acquireThrowRuntime("addOCSPResponse", idTransazione);
  1620.         try {
  1621.             if(this.ocspResponse==null) {
  1622.                 this.ocspResponse = new HashMap<>(3);
  1623.             }
  1624.             this.ocspResponse.put(key, resource);
  1625.         }finally {
  1626.             this.semaphoreStore.release(lock, "addOCSPResponse", idTransazione);
  1627.         }
  1628.     }
  1629.     public Serializable getOCSPResponse(String key) {
  1630.         if(this.ocspResponse==null) {
  1631.             return null;
  1632.         }
  1633.         return this.ocspResponse.get(key);
  1634.     }

  1635.    
  1636.     private synchronized void initSemaphoreTemplate() {
  1637.         if(this.semaphoreTemplate==null) {
  1638.             this.semaphoreTemplate = new org.openspcoop2.utils.Semaphore("RequestConfigTemplate");
  1639.         }
  1640.     }
  1641.    
  1642.     public void addTemplate(String key, Serializable fp, String idTransazione) {
  1643.         if(this.semaphoreTemplate==null) {
  1644.             // serializzazione da transient
  1645.             initSemaphoreTemplate();
  1646.         }
  1647.        
  1648.         SemaphoreLock lock = this.semaphoreTemplate.acquireThrowRuntime("addTemplate", idTransazione);
  1649.         try {
  1650.             if(this.template==null) {
  1651.                 this.template = new HashMap<>(3);
  1652.             }
  1653.             this.template.put(key, fp);
  1654.         }finally {
  1655.             this.semaphoreTemplate.release(lock, "addTemplate", idTransazione);
  1656.         }
  1657.     }
  1658.     public Serializable getTemplate(String key) {
  1659.         if(this.template==null) {
  1660.             return null;
  1661.         }
  1662.         return this.template.get(key);
  1663.     }

  1664. }