ClassNameProperties.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.pdd.config;


  21. import java.util.ArrayList;
  22. import java.util.Arrays;
  23. import java.util.Enumeration;
  24. import java.util.List;
  25. import java.util.Properties;

  26. import org.openspcoop2.core.config.constants.CostantiConfigurazione;
  27. import org.openspcoop2.core.constants.TipiConnettore;
  28. import org.openspcoop2.message.OpenSPCoop2MessageFactory;
  29. import org.openspcoop2.pdd.core.autenticazione.pa.IAutenticazionePortaApplicativa;
  30. import org.openspcoop2.pdd.core.autenticazione.pd.IAutenticazionePortaDelegata;
  31. import org.openspcoop2.pdd.core.autorizzazione.container.IAutorizzazioneSecurityContainer;
  32. import org.openspcoop2.pdd.core.autorizzazione.pa.IAutorizzazioneContenutoPortaApplicativa;
  33. import org.openspcoop2.pdd.core.autorizzazione.pa.IAutorizzazionePortaApplicativa;
  34. import org.openspcoop2.pdd.core.autorizzazione.pd.IAutorizzazioneContenutoPortaDelegata;
  35. import org.openspcoop2.pdd.core.autorizzazione.pd.IAutorizzazionePortaDelegata;
  36. import org.openspcoop2.pdd.core.behaviour.IBehaviour;
  37. import org.openspcoop2.pdd.core.connettori.IConnettore;
  38. import org.openspcoop2.pdd.core.controllo_traffico.plugins.IRateLimiting;
  39. import org.openspcoop2.pdd.core.credenziali.IGestoreCredenziali;
  40. import org.openspcoop2.pdd.core.credenziali.IGestoreCredenzialiIM;
  41. import org.openspcoop2.pdd.core.handlers.notifier.INotifierCallback;
  42. import org.openspcoop2.pdd.core.handlers.transazioni.ISalvataggioDiagnosticiManager;
  43. import org.openspcoop2.pdd.core.handlers.transazioni.ISalvataggioTracceManager;
  44. import org.openspcoop2.pdd.core.integrazione.IGestoreIntegrazionePA;
  45. import org.openspcoop2.pdd.core.integrazione.IGestoreIntegrazionePD;
  46. import org.openspcoop2.pdd.core.node.INodeReceiver;
  47. import org.openspcoop2.pdd.core.node.INodeSender;
  48. import org.openspcoop2.pdd.core.threshold.IThreshold;
  49. import org.openspcoop2.pdd.core.token.attribute_authority.IRetrieveAttributeAuthorityResponseParser;
  50. import org.openspcoop2.pdd.core.token.parser.INegoziazioneTokenParser;
  51. import org.openspcoop2.pdd.core.token.parser.ITokenParser;
  52. import org.openspcoop2.pdd.logger.OpenSPCoop2Logger;
  53. import org.openspcoop2.pdd.services.OpenSPCoop2Startup;
  54. import org.openspcoop2.protocol.engine.driver.IFiltroDuplicati;
  55. import org.openspcoop2.protocol.engine.driver.repository.IGestoreRepository;
  56. import org.openspcoop2.protocol.sdk.diagnostica.IDiagnosticProducer;
  57. import org.openspcoop2.protocol.sdk.dump.IDumpProducer;
  58. import org.openspcoop2.protocol.sdk.tracciamento.ITracciaProducer;
  59. import org.openspcoop2.security.message.MessageSecurityContext;
  60. import org.openspcoop2.security.message.MessageSecurityDigestReader;
  61. import org.openspcoop2.utils.LoggerWrapperFactory;
  62. import org.openspcoop2.utils.TipiDatabase;
  63. import org.openspcoop2.utils.UtilsException;
  64. import org.openspcoop2.utils.date.IDate;
  65. import org.openspcoop2.utils.id.IUniqueIdentifierGenerator;
  66. import org.openspcoop2.utils.jdbc.IJDBCAdapter;
  67. import org.openspcoop2.utils.resources.Loader;
  68. import org.openspcoop2.utils.sql.ISQLQueryObject;
  69. import org.slf4j.Logger;


  70. /**
  71.  * Contiene un lettore del file di proprieta' di OpenSPCoop.
  72.  *
  73.  * @author Poli Andrea (apoli@link.it)
  74.  * @author $Author$
  75.  * @version $Rev$, $Date$
  76.  */


  77. public class ClassNameProperties {  

  78.     /** Logger utilizzato per errori eventuali. */
  79.     private Logger log = null;



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

  81.     /** Reader delle proprieta' impostate nel file 'govway.classRegistry.properties' */
  82.     private ClassNameInstanceProperties reader;

  83.     /** Copia Statica */
  84.     private static ClassNameProperties classNameProperties = null;


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

  86.     /**
  87.      * Viene chiamato in causa per istanziare il properties reader
  88.      *
  89.      *
  90.      */
  91.     private ClassNameProperties(boolean logError) throws UtilsException {

  92.         if(OpenSPCoop2Startup.initialize)
  93.             this.log = OpenSPCoop2Logger.getLoggerOpenSPCoopCore();
  94.         else
  95.             this.log = LoggerWrapperFactory.getLogger("govway.startup");
  96.        
  97.         /* ---- Lettura del cammino del file di configurazione ---- */
  98.         Properties propertiesReader = new Properties();
  99.         java.io.InputStream properties = null;
  100.         try{  
  101.             properties = ClassNameProperties.class.getResourceAsStream("/govway.classRegistry.properties");
  102.             if(properties==null){
  103.                 throw new UtilsException("File '/govway.classRegistry.properties' not found");
  104.             }
  105.             propertiesReader.load(properties);
  106.         }catch(Exception e) {
  107.             if(logError) {
  108.                 String msg = "Riscontrato errore durante la lettura del file 'govway.classRegistry.properties': "+e.getMessage();
  109.                 this.log.error(msg,e);
  110.             }
  111.             throw new UtilsException("ClassName initialize error: "+e.getMessage());
  112.         }finally{
  113.             try{
  114.                 if(properties!=null)
  115.                     properties.close();
  116.             }catch(Exception er){
  117.                 // close
  118.             }
  119.         }

  120.         this.reader = new ClassNameInstanceProperties(propertiesReader, this.log);
  121.     }
  122.    
  123.     public void refreshLocalProperties(Properties localProp,String confDir){
  124.        
  125.         this.reader.searchLocalFileImplementation(confDir);
  126.        
  127.         if(localProp!=null){
  128.             this.reader.setLocalObjectImplementation(localProp);
  129.         }
  130.        
  131.     }


  132.     /**
  133.      * Il Metodo si occupa di inizializzare il propertiesReader
  134.      *
  135.      *
  136.      */
  137.     public static boolean initialize(boolean logError){

  138.         try {
  139.             ClassNameProperties.classNameProperties = new ClassNameProperties(logError);    
  140.             return true;
  141.         }
  142.         catch(Exception e) {
  143.             return false;
  144.         }
  145.     }
  146.    
  147.     /**
  148.      * Ritorna l'istanza di questa classe
  149.      *
  150.      * @return Istanza di ClassNameProperties
  151.      *
  152.      */
  153.     public static ClassNameProperties getInstance(){
  154.         if(ClassNameProperties.classNameProperties==null) {
  155.             // spotbugs warning 'SING_SINGLETON_GETTER_NOT_SYNCHRONIZED': l'istanza viene creata allo startup
  156.             synchronized (ClassNameProperties.class) {
  157.                 if(ClassNameProperties.classNameProperties==null) {
  158.                     ClassNameProperties.initialize(false);
  159.                 }
  160.             }
  161.         }
  162.         return ClassNameProperties.classNameProperties;
  163.     }
  164.    
  165.     /**
  166.     public static void updateLocalImplementation(Properties prop){
  167.         ClassNameProperties.classNameProperties.reader.setLocalImplementation(prop);
  168.     }*/

  169.    
  170.    
  171.    
  172.    
  173.    
  174.     public boolean validaConfigurazione(java.lang.ClassLoader loader, String db) {  
  175.         try{  
  176.             TipiDatabase tipiDatabase = TipiDatabase.DEFAULT;
  177.             if(db!=null) {
  178.                 tipiDatabase = TipiDatabase.toEnumConstant(db);
  179.             }
  180.            
  181.             Loader loaderOpenSPCoop = null;
  182.             if(loader!=null){
  183.                 loaderOpenSPCoop = Loader.getInstance(); // gia inizializzato nello startup
  184.             }else{
  185.                 loaderOpenSPCoop = new Loader(loader);
  186.             }
  187.            
  188.             String[] tmp = getConnettore();
  189.             if(tmp!=null && tmp.length>0) {
  190.                 for (String tipo : tmp) {
  191.                     if(CostantiConfigurazione.DISABILITATO.toString().equals(tipo)) {
  192.                         continue;
  193.                     }
  194.                     if(TipiConnettore.JMS.getNome().equals(tipo)) {
  195.                         continue; // sulle installazioni standalone non ci sono i jar jms
  196.                     }
  197.                     String className = this.getConnettore(tipo);
  198.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IConnettore.class) ) return false;
  199.                 }
  200.             }
  201.            
  202.             tmp = getRealmContainerCustom();
  203.             if(tmp!=null && tmp.length>0) {
  204.                 for (String tipo : tmp) {
  205.                     String className = this.getRealmContainerCustom(tipo);
  206.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IAutorizzazioneSecurityContainer.class) ) return false;
  207.                 }
  208.             }
  209.            
  210.             tmp = getAutenticazionePortaDelegata();
  211.             if(tmp!=null && tmp.length>0) {
  212.                 for (String tipo : tmp) {
  213.                     if(CostantiConfigurazione.AUTENTICAZIONE_NONE.equals(tipo)) {
  214.                         continue;
  215.                     }
  216.                     String className = this.getAutenticazionePortaDelegata(tipo);
  217.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IAutenticazionePortaDelegata.class) ) return false;
  218.                 }
  219.             }
  220.            
  221.             tmp = getAutenticazionePortaApplicativa();
  222.             if(tmp!=null && tmp.length>0) {
  223.                 for (String tipo : tmp) {
  224.                     if(CostantiConfigurazione.AUTENTICAZIONE_NONE.equals(tipo)) {
  225.                         continue;
  226.                     }
  227.                     String className = this.getAutenticazionePortaApplicativa(tipo);
  228.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IAutenticazionePortaApplicativa.class) ) return false;
  229.                 }
  230.             }
  231.            
  232.             tmp = getAutorizzazionePortaDelegata();
  233.             if(tmp!=null && tmp.length>0) {
  234.                 for (String tipo : tmp) {
  235.                     if(CostantiConfigurazione.AUTENTICAZIONE_NONE.equals(tipo)) {
  236.                         continue;
  237.                     }
  238.                     String className = this.getAutorizzazionePortaDelegata(tipo);
  239.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IAutorizzazionePortaDelegata.class) ) return false;
  240.                 }
  241.             }
  242.            
  243.             tmp = getAutorizzazionePortaApplicativa();
  244.             if(tmp!=null && tmp.length>0) {
  245.                 for (String tipo : tmp) {
  246.                     if(CostantiConfigurazione.AUTENTICAZIONE_NONE.equals(tipo)) {
  247.                         continue;
  248.                     }
  249.                     String className = this.getAutorizzazionePortaApplicativa(tipo);
  250.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IAutorizzazionePortaApplicativa.class) ) return false;
  251.                 }
  252.             }
  253.            
  254.             tmp = getAutorizzazioneContenutoPortaDelegata();
  255.             if(tmp!=null && tmp.length>0) {
  256.                 for (String tipo : tmp) {
  257.                     if(CostantiConfigurazione.AUTENTICAZIONE_NONE.equals(tipo)) {
  258.                         continue;
  259.                     }
  260.                     String className = this.getAutorizzazioneContenutoPortaDelegata(tipo);
  261.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IAutorizzazioneContenutoPortaDelegata.class) ) return false;
  262.                 }
  263.             }
  264.            
  265.             tmp = getAutorizzazioneContenutoPortaApplicativa();
  266.             if(tmp!=null && tmp.length>0) {
  267.                 for (String tipo : tmp) {
  268.                     if(CostantiConfigurazione.AUTENTICAZIONE_NONE.equals(tipo)) {
  269.                         continue;
  270.                     }
  271.                     String className = this.getAutorizzazioneContenutoPortaApplicativa(tipo);
  272.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IAutorizzazioneContenutoPortaApplicativa.class) ) return false;
  273.                 }
  274.             }
  275.            
  276.             tmp = getIntegrazionePortaDelegata();
  277.             if(tmp!=null && tmp.length>0) {
  278.                 for (String tipo : tmp) {
  279.                     String className = this.getIntegrazionePortaDelegata(tipo);
  280.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IGestoreIntegrazionePD.class) ) return false;
  281.                 }
  282.             }
  283.            
  284.             tmp = getIntegrazionePortaApplicativa();
  285.             if(tmp!=null && tmp.length>0) {
  286.                 for (String tipo : tmp) {
  287.                     String className = this.getIntegrazionePortaApplicativa(tipo);
  288.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IGestoreIntegrazionePA.class) ) return false;
  289.                 }
  290.             }
  291.            
  292.             tmp = getJDBCAdapter();
  293.             if(tmp!=null && tmp.length>0) {
  294.                 for (String tipo : tmp) {
  295.                     String className = this.getJDBCAdapter(tipo);
  296.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IJDBCAdapter.class, tipiDatabase) ) return false;
  297.                 }
  298.             }
  299.            
  300.             tmp = getThreshold();
  301.             if(tmp!=null && tmp.length>0) {
  302.                 for (String tipo : tmp) {
  303.                     String className = this.getThreshold(tipo);
  304.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IThreshold.class) ) return false;
  305.                 }
  306.             }
  307.            
  308.             tmp = getMsgDiagnosticoOpenSPCoopAppender();
  309.             if(tmp!=null && tmp.length>0) {
  310.                 for (String tipo : tmp) {
  311.                     String className = this.getMsgDiagnosticoOpenSPCoopAppender(tipo);
  312.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IDiagnosticProducer.class) ) return false;
  313.                 }
  314.             }
  315.            
  316.             tmp = getTracciamentoOpenSPCoopAppender();
  317.             if(tmp!=null && tmp.length>0) {
  318.                 for (String tipo : tmp) {
  319.                     String className = this.getTracciamentoOpenSPCoopAppender(tipo);
  320.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, ITracciaProducer.class) ) return false;
  321.                 }
  322.             }
  323.            
  324.             tmp = getDumpOpenSPCoopAppender();
  325.             if(tmp!=null && tmp.length>0) {
  326.                 for (String tipo : tmp) {
  327.                     String className = this.getDumpOpenSPCoopAppender(tipo);
  328.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IDumpProducer.class) ) return false;
  329.                 }
  330.             }
  331.            
  332.             tmp = getNodeReceiver();
  333.             if(tmp!=null && tmp.length>0) {
  334.                 for (String tipo : tmp) {
  335.                     if(TipiConnettore.JMS.getNome().equals(tipo)) {
  336.                         continue; // sulle installazioni standalone non ci sono i jar jms
  337.                     }
  338.                     String className = this.getNodeReceiver(tipo);
  339.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, INodeReceiver.class) ) return false;
  340.                 }
  341.             }
  342.            
  343.             tmp = getNodeSender();
  344.             if(tmp!=null && tmp.length>0) {
  345.                 for (String tipo : tmp) {
  346.                     if(TipiConnettore.JMS.getNome().equals(tipo)) {
  347.                         continue; // sulle installazioni standalone non ci sono i jar jms
  348.                     }
  349.                     String className = this.getNodeSender(tipo);
  350.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, INodeSender.class) ) return false;
  351.                 }
  352.             }
  353.            
  354.             tmp = getRepositoryBuste();
  355.             if(tmp!=null && tmp.length>0) {
  356.                 for (String tipo : tmp) {
  357.                     String className = this.getRepositoryBuste(tipo);
  358.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IGestoreRepository.class) ) return false;
  359.                 }
  360.             }
  361.            
  362.             tmp = getSQLQueryObject();
  363.             if(tmp!=null && tmp.length>0) {
  364.                 for (String tipo : tmp) {
  365.                     String className = this.getSQLQueryObject(tipo);
  366.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, ISQLQueryObject.class, tipiDatabase) ) return false;
  367.                 }
  368.             }
  369.            
  370.             tmp = getDateManager();
  371.             if(tmp!=null && tmp.length>0) {
  372.                 for (String tipo : tmp) {
  373.                     String className = this.getDateManager(tipo);
  374.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IDate.class) ) return false;
  375.                 }
  376.             }
  377.            
  378.             tmp = getUniqueIdentifier();
  379.             if(tmp!=null && tmp.length>0) {
  380.                 for (String tipo : tmp) {
  381.                     String className = this.getUniqueIdentifier(tipo);
  382.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IUniqueIdentifierGenerator.class) ) return false;
  383.                 }
  384.             }
  385.            
  386.             tmp = getFiltroDuplicati();
  387.             if(tmp!=null && tmp.length>0) {
  388.                 for (String tipo : tmp) {
  389.                     String className = this.getFiltroDuplicati(tipo);
  390.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IFiltroDuplicati.class) ) return false;
  391.                 }
  392.             }
  393.            
  394.             // HANDLER: gia' verificati in properties openspcoop
  395.            
  396.             tmp = getOpenSPCoop2MessageFactory();
  397.             if(tmp!=null && tmp.length>0) {
  398.                 for (String tipo : tmp) {
  399.                     String className = this.getOpenSPCoop2MessageFactory(tipo);
  400.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, OpenSPCoop2MessageFactory.class) ) return false;
  401.                 }
  402.             }
  403.            
  404.             tmp = getMessageSecurityContext();
  405.             if(tmp!=null && tmp.length>0) {
  406.                 for (String tipo : tmp) {
  407.                     String className = this.getMessageSecurityContext(tipo);
  408.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, MessageSecurityContext.class) ) return false;
  409.                 }
  410.             }
  411.            
  412.             tmp = getMessageSecurityDigestReader();
  413.             if(tmp!=null && tmp.length>0) {
  414.                 for (String tipo : tmp) {
  415.                     String className = this.getMessageSecurityDigestReader(tipo);
  416.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, MessageSecurityDigestReader.class) ) return false;
  417.                 }
  418.             }
  419.            
  420.             tmp = getGestoreCredenziali();
  421.             if(tmp!=null && tmp.length>0) {
  422.                 for (String tipo : tmp) {
  423.                     String className = this.getGestoreCredenziali(tipo);
  424.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IGestoreCredenziali.class) ) return false;
  425.                 }
  426.             }
  427.            
  428.             tmp = getGestoreCredenzialiIM();
  429.             if(tmp!=null && tmp.length>0) {
  430.                 for (String tipo : tmp) {
  431.                     String className = this.getGestoreCredenzialiIM(tipo);
  432.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IGestoreCredenzialiIM.class) ) return false;
  433.                 }
  434.             }
  435.            
  436.             tmp = getNotifierCallback();
  437.             if(tmp!=null && tmp.length>0) {
  438.                 for (String tipo : tmp) {
  439.                     String className = this.getNotifierCallback(tipo);
  440.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, INotifierCallback.class) ) return false;
  441.                 }
  442.             }
  443.            
  444.             tmp = getBehaviour();
  445.             if(tmp!=null && tmp.length>0) {
  446.                 for (String tipo : tmp) {
  447.                     String className = this.getBehaviour(tipo);
  448.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IBehaviour.class) ) return false;
  449.                 }
  450.             }
  451.            
  452.             tmp = getSalvataggioTracceManager();
  453.             if(tmp!=null && tmp.length>0) {
  454.                 for (String tipo : tmp) {
  455.                     String className = this.getSalvataggioTracceManager(tipo);
  456.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, ISalvataggioTracceManager.class) ) return false;
  457.                 }
  458.             }
  459.            
  460.             tmp = getSalvataggioDiagnosticiManager();
  461.             if(tmp!=null && tmp.length>0) {
  462.                 for (String tipo : tmp) {
  463.                     String className = this.getSalvataggioDiagnosticiManager(tipo);
  464.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, ISalvataggioDiagnosticiManager.class) ) return false;
  465.                 }
  466.             }
  467.            
  468.             tmp = getRateLimiting();
  469.             if(tmp!=null && tmp.length>0) {
  470.                 for (String tipo : tmp) {
  471.                     String className = this.getRateLimiting(tipo);
  472.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IRateLimiting.class) ) return false;
  473.                 }
  474.             }
  475.            
  476.             tmp = getTokenValidazione();
  477.             if(tmp!=null && tmp.length>0) {
  478.                 for (String tipo : tmp) {
  479.                     String className = this.getTokenValidazione(tipo);
  480.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, ITokenParser.class) ) return false;
  481.                 }
  482.             }
  483.            
  484.             tmp = getTokenNegoziazione();
  485.             if(tmp!=null && tmp.length>0) {
  486.                 for (String tipo : tmp) {
  487.                     String className = this.getTokenNegoziazione(tipo);
  488.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, INegoziazioneTokenParser.class) ) return false;
  489.                 }
  490.             }
  491.            
  492.             tmp = getAttributeAuthority();
  493.             if(tmp!=null && tmp.length>0) {
  494.                 for (String tipo : tmp) {
  495.                     String className = this.getAttributeAuthority(tipo);
  496.                     if ( !this.validate(loaderOpenSPCoop, className, tipo, IRetrieveAttributeAuthorityResponseParser.class) ) return false;
  497.                 }
  498.             }
  499.            
  500.             return true;
  501.            
  502.         }catch(java.lang.Exception e) {
  503.             this.log.error("Riscontrato errore durante la validazione lettura della proprieta' di openspcoop: "+e.getMessage(),e);
  504.             return false;
  505.         }
  506.     }

  507.     private boolean validate(Loader loaderOpenSPCoop, String className, String tipo, Class<?> classAttesa) {
  508.         return this.validate(loaderOpenSPCoop, className, tipo, classAttesa, null);
  509.     }
  510.     private boolean validate(Loader loaderOpenSPCoop, String className, String tipo, Class<?> classAttesa, TipiDatabase tipiDatabase) {
  511.         try{
  512.             Object o = null;
  513.             if(tipiDatabase==null) {
  514.                 o = loaderOpenSPCoop.newInstance(className);
  515.             }
  516.             else {
  517.                 o = loaderOpenSPCoop.newInstance(className, tipiDatabase);
  518.             }
  519.             o.toString();
  520.            
  521.             if(!classAttesa.isInstance(o)) {
  522.                 throw new UtilsException("Classe '"+className+"' non implementa l'interfaccia '"+classAttesa.getName()+"'");
  523.             }
  524.            
  525.             return true;
  526.            
  527.         }catch(Throwable e){
  528.             this.log.error("Riscontrato errore durante l'istanziazione della classe '"+className+"' associata al tipo '"+tipo+
  529.                     "' riguardante la gestione dell'interfaccia '"+classAttesa.getName()+"': "+e.getMessage(),e);
  530.             return false;
  531.         }
  532.     }




  533.     /* ********  M E T O D I  ******** */

  534.     /**
  535.      * Ritorna la classe di un connector se questo e' stato precedentemente registrata
  536.      *
  537.      *
  538.      */
  539.     public String getConnettore(String nome){
  540.         return this.getValue("org.openspcoop2.connettore.", nome);
  541.     }
  542.     public String[] getConnettore() throws UtilsException{
  543.         return this.getTipiGestiti("org.openspcoop2.connettore.",CostantiConfigurazione.DISABILITATO.toString());
  544.     }
  545.        
  546.     /**
  547.      * Ritorna una classe 'IAutorizzazioneSecurityContainer' se questa e' stata precedentemente registrata
  548.      *
  549.      *
  550.      */
  551.     public String getRealmContainerCustom(String nome){
  552.         return this.getValue("org.openspcoop2.realmContainer.custom.", nome);
  553.     }
  554.     public String[] getRealmContainerCustom() throws UtilsException{
  555.         return this.getTipiGestiti("org.openspcoop2.realmContainer.custom.");
  556.     }
  557.    
  558.     /**
  559.      * Ritorna una classe 'IAutenticazionePortaDelegata' se questa e' stata precedentemente registrata
  560.      *
  561.      *
  562.      */
  563.     public String getAutenticazionePortaDelegata(String nome){
  564.         return this.getValue("org.openspcoop2.autenticazione.pd.", nome);
  565.     }
  566.     public String[] getAutenticazionePortaDelegata() throws UtilsException{
  567.         return this.getTipiGestiti("org.openspcoop2.autenticazione.pd.",CostantiConfigurazione.AUTENTICAZIONE_NONE);
  568.     }

  569.     /**
  570.      * Ritorna una classe 'IAutenticazionePortaApplicativa' se questa e' stata precedentemente registrata
  571.      *
  572.      *
  573.      */
  574.     public String getAutenticazionePortaApplicativa(String nome){
  575.         return this.getValue("org.openspcoop2.autenticazione.pa.", nome);
  576.     }
  577.     public String[] getAutenticazionePortaApplicativa() throws UtilsException{
  578.         return this.getTipiGestiti("org.openspcoop2.autenticazione.pa.",CostantiConfigurazione.AUTENTICAZIONE_NONE);
  579.     }
  580.    
  581.     /**
  582.      * Ritorna una classe 'IAutorizzazionePortaDelegata' se questa e' stata precedentemente registrata
  583.      *
  584.      *
  585.      */
  586.     public String getAutorizzazionePortaDelegata(String nome){
  587.         return this.getValue("org.openspcoop2.autorizzazione.pd.", nome);
  588.     }
  589.     public String[] getAutorizzazionePortaDelegata() throws UtilsException{
  590.         return this.getTipiGestiti("org.openspcoop2.autorizzazione.pd.",CostantiConfigurazione.AUTORIZZAZIONE_NONE);
  591.     }
  592.    
  593.     /**
  594.      * Ritorna una classe 'IAutorizzazionePortaApplicativa' se questa e' stata precedentemente registrata
  595.      *
  596.      *
  597.      */
  598.     public String getAutorizzazionePortaApplicativa(String nome){
  599.         return this.getValue("org.openspcoop2.autorizzazione.pa.", nome);
  600.     }
  601.     public String[] getAutorizzazionePortaApplicativa() throws UtilsException{
  602.         return this.getTipiGestiti("org.openspcoop2.autorizzazione.pa.",CostantiConfigurazione.AUTORIZZAZIONE_NONE);
  603.     }
  604.    
  605.     /**
  606.      * Ritorna una classe 'IAutorizzazioneContenutoPortaDelegata' se questa e' stata precedentemente registrata
  607.      *
  608.      *
  609.      */
  610.     public String getAutorizzazioneContenutoPortaDelegata(String nome){
  611.         return this.getValue("org.openspcoop2.autorizzazioneContenuto.pd.", nome);
  612.     }
  613.     public String[] getAutorizzazioneContenutoPortaDelegata() throws UtilsException{
  614.         return this.getTipiGestiti("org.openspcoop2.autorizzazioneContenuto.pd.",CostantiConfigurazione.AUTORIZZAZIONE_NONE);
  615.     }
  616.    
  617.     /**
  618.      * Ritorna una classe 'IAutorizzazioneContenutoPortaApplicativa' se questa e' stata precedentemente registrata
  619.      *
  620.      *
  621.      */
  622.     public String getAutorizzazioneContenutoPortaApplicativa(String nome){
  623.         return this.getValue("org.openspcoop2.autorizzazioneContenuto.pa.", nome);
  624.     }
  625.     public String[] getAutorizzazioneContenutoPortaApplicativa() throws UtilsException{
  626.         return this.getTipiGestiti("org.openspcoop2.autorizzazioneContenuto.pa.",CostantiConfigurazione.AUTORIZZAZIONE_NONE);
  627.     }
  628.    
  629.     /**
  630.      * Ritorna una classe 'IGestoreIntegrazionePD' se questa e' stata precedentemente registrata
  631.      *
  632.      *
  633.      */
  634.     public String getIntegrazionePortaDelegata(String nome){
  635.         return this.getValue("org.openspcoop2.integrazione.pd.", nome);
  636.     }
  637.     public String[] getIntegrazionePortaDelegata() throws UtilsException{
  638.         return this.getTipiGestiti("org.openspcoop2.integrazione.pd.");
  639.     }
  640.    
  641.     /**
  642.      * Ritorna una classe 'IGestoreIntegrazionePA' se questa e' stata precedentemente registrata
  643.      *
  644.      *
  645.      */
  646.     public String getIntegrazionePortaApplicativa(String nome){
  647.         return this.getValue("org.openspcoop2.integrazione.pa.", nome);
  648.     }
  649.     public String[] getIntegrazionePortaApplicativa() throws UtilsException{
  650.         return this.getTipiGestiti("org.openspcoop2.integrazione.pa.");
  651.     }
  652.    
  653.     /**
  654.      * Ritorna una classe 'IJDBCAdapter' se questa e' stata precedentemente registrata
  655.      *
  656.      *
  657.      */
  658.     public String getJDBCAdapter(String nome){
  659.         return this.getValue("org.openspcoop2.jdbcAdapter.", nome);
  660.     }
  661.     public String[] getJDBCAdapter() throws UtilsException{
  662.         return this.getTipiGestiti("org.openspcoop2.jdbcAdapter.");
  663.     }
  664.    
  665.     /**
  666.      * Ritorna una classe 'IThreshold' se questa e' stata precedentemente registrata
  667.      *
  668.      *
  669.      */
  670.     public String getThreshold(String nome){
  671.         return this.getValue("org.openspcoop2.threshold.", nome);
  672.     }
  673.     public String[] getThreshold() throws UtilsException{
  674.         return this.getTipiGestiti("org.openspcoop2.threshold.");
  675.     }

  676.     /**
  677.      * Ritorna una classe 'IMsgDiagnosticoOpenSPCoopAppender' se questa e' stata precedentemente registrata
  678.      *
  679.      *
  680.      */
  681.     public String getMsgDiagnosticoOpenSPCoopAppender(String nome){
  682.         return this.getValue("org.openspcoop2.msgdiagnosticoAppender.", nome);
  683.     }
  684.     public String[] getMsgDiagnosticoOpenSPCoopAppender() throws UtilsException{
  685.         return this.getTipiGestiti("org.openspcoop2.msgdiagnosticoAppender.");
  686.     }
  687.    
  688.     /**
  689.      * Ritorna una classe 'ITracciamentoOpenSPCoopAppender' se questa e' stata precedentemente registrata
  690.      *
  691.      *
  692.      */
  693.     public String getTracciamentoOpenSPCoopAppender(String nome){
  694.         return this.getValue("org.openspcoop2.tracciamentoAppender.", nome);
  695.     }
  696.     public String[] getTracciamentoOpenSPCoopAppender() throws UtilsException{
  697.         return this.getTipiGestiti("org.openspcoop2.tracciamentoAppender.");
  698.     }
  699.    
  700.     /**
  701.      * Ritorna una classe 'IDumpOpenSPCoopAppender' se questa e' stata precedentemente registrata
  702.      *
  703.      *
  704.      */
  705.     public String getDumpOpenSPCoopAppender(String nome){
  706.         return this.getValue("org.openspcoop2.dumpAppender.", nome);
  707.     }
  708.     public String[] getDumpOpenSPCoopAppender() throws UtilsException{
  709.         return this.getTipiGestiti("org.openspcoop2.dumpAppender.");
  710.     }
  711.        
  712.     /**
  713.      * Ritorna una classe 'INodeReceiver' se questa e' stata precedentemente registrata
  714.      *
  715.      *
  716.      */
  717.     public String getNodeReceiver(String nome){
  718.         return this.getValue("org.openspcoop2.nodeReceiver.", nome);
  719.     }
  720.     public String[] getNodeReceiver() throws UtilsException{
  721.         return this.getTipiGestiti("org.openspcoop2.nodeReceiver.");
  722.     }
  723.    
  724.     /**
  725.      * Ritorna una classe 'INodeSender' se questa e' stata precedentemente registrata
  726.      *
  727.      *
  728.      */
  729.     public String getNodeSender(String nome){
  730.         return this.getValue("org.openspcoop2.nodeSender.", nome);
  731.     }
  732.     public String[] getNodeSender() throws UtilsException{
  733.         return this.getTipiGestiti("org.openspcoop2.nodeSender.");
  734.     }
  735.    
  736.     /**
  737.      * Ritorna una classe 'IGestoreRepositoryBuste' se questa e' stata precedentemente registrata
  738.      *
  739.      *
  740.      */
  741.     public String getRepositoryBuste(String nome){
  742.         return this.getValue("org.openspcoop2.repositoryBuste.", nome);
  743.     }
  744.     public String[] getRepositoryBuste() throws UtilsException{
  745.         return this.getTipiGestiti("org.openspcoop2.repositoryBuste.");
  746.     }
  747.    
  748.     /**
  749.      * Ritorna una classe 'ISQLQueryObject' se questa e' stata precedentemente registrata
  750.      *
  751.      *
  752.      */
  753.     public String getSQLQueryObject(String nome){
  754.         return this.getValue("org.openspcoop2.sqlQueryObject.", nome);
  755.     }
  756.     public String[] getSQLQueryObject() throws UtilsException{
  757.         return this.getTipiGestiti("org.openspcoop2.sqlQueryObject.");
  758.     }
  759.    
  760.     /**
  761.      * Ritorna una classe 'IDate' se questa e' stata precedentemente registrata
  762.      *
  763.      *
  764.      */
  765.     public String getDateManager(String nome){
  766.         return this.getValue("org.openspcoop2.date.", nome);
  767.     }
  768.     public String[] getDateManager() throws UtilsException{
  769.         return this.getTipiGestiti("org.openspcoop2.date.");
  770.     }
  771.    
  772.    
  773.    
  774.     /**
  775.      * Ritorna una classe 'IUniqueIdentifier' se questa e' stata precedentemente registrata
  776.      *
  777.      *
  778.      */
  779.     public String getUniqueIdentifier(String nome){
  780.         return this.getValue("org.openspcoop2.id.", nome);
  781.     }
  782.     public String[] getUniqueIdentifier() throws UtilsException{
  783.         return this.getTipiGestiti("org.openspcoop2.id.");
  784.     }
  785.    
  786.    
  787.    
  788.     /**
  789.      * Ritorna una classe 'IFiltroDuplicati' se questa e' stata precedentemente registrata
  790.      *
  791.      *
  792.      */
  793.     public String getFiltroDuplicati(String nome){
  794.         return this.getValue("org.openspcoop2.protocol.filtroDuplicati.", nome);
  795.     }
  796.     public String[] getFiltroDuplicati() throws UtilsException{
  797.         return this.getTipiGestiti("org.openspcoop2.protocol.filtroDuplicati.");
  798.     }
  799.    
  800.    
  801.    
  802.    
  803.    
  804.     // Handler BuiltIn
  805.    
  806.    
  807.     /**
  808.      * Ritorna una classe 'InitHandlerBuiltIn' se questa e' stata precedentemente registrata
  809.      *
  810.      *
  811.      */
  812.     public String getInitHandlerBuiltIn(String nome){
  813.         return this.getValue("org.openspcoop2.pdd.handler.built-in.init.", nome);
  814.     }
  815.     public String[] getInitHandlerBuiltIn() throws UtilsException{
  816.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.built-in.init.");
  817.     }
  818.    
  819.    
  820.    
  821.     /**
  822.      * Ritorna una classe 'ExitHandlerBuiltIn' se questa e' stata precedentemente registrata
  823.      *
  824.      *
  825.      */
  826.     public String getExitHandlerBuiltIn(String nome){
  827.         return this.getValue("org.openspcoop2.pdd.handler.built-in.exit.", nome);
  828.     }
  829.     public String[] getExitHandlerBuiltIn() throws UtilsException{
  830.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.built-in.exit.");
  831.     }
  832.    
  833.    
  834.    
  835.     /**
  836.      * Ritorna una classe 'PreInRequestHandlerBuiltIn' se questa e' stata precedentemente registrata
  837.      *
  838.      *
  839.      */
  840.     public String getPreInRequestHandlerBuiltIn(String nome){
  841.         return this.getValue("org.openspcoop2.pdd.handler.built-in.pre-in-request.", nome);
  842.     }
  843.     public String[] getPreInRequestHandlerBuiltIn() throws UtilsException{
  844.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.built-in.pre-in-request.");
  845.     }
  846.    
  847.     /**
  848.      * Ritorna una classe 'InRequestHandlerBuiltIn' se questa e' stata precedentemente registrata
  849.      *
  850.      *
  851.      */
  852.     public String getInRequestHandlerBuiltIn(String nome){
  853.         return this.getValue("org.openspcoop2.pdd.handler.built-in.in-request.", nome);
  854.     }
  855.     public String[] getInRequestHandlerBuiltIn() throws UtilsException{
  856.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.built-in.in-request.");
  857.     }
  858.    
  859.     /**
  860.      * Ritorna una classe 'InProtocolRequestHandlerBuiltIn' se questa e' stata precedentemente registrata
  861.      *
  862.      *
  863.      */
  864.     public String getInRequestProtocolHandlerBuiltIn(String nome){
  865.         return this.getValue("org.openspcoop2.pdd.handler.built-in.in-protocol-request.", nome);
  866.     }
  867.     public String[] getInRequestProtocolHandlerBuiltIn() throws UtilsException{
  868.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.built-in.in-protocol-request.");
  869.     }
  870.    
  871.     /**
  872.      * Ritorna una classe 'OutRequestHandlerBuiltIn' se questa e' stata precedentemente registrata
  873.      *
  874.      *
  875.      */
  876.     public String getOutRequestHandlerBuiltIn(String nome){
  877.         return this.getValue("org.openspcoop2.pdd.handler.built-in.out-request.", nome);
  878.     }
  879.     public String[] getOutRequestHandlerBuiltIn() throws UtilsException{
  880.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.built-in.out-request.");
  881.     }
  882.    
  883.     /**
  884.      * Ritorna una classe 'PostOutRequestHandlerBuiltIn' se questa e' stata precedentemente registrata
  885.      *
  886.      *
  887.      */
  888.     public String getPostOutRequestHandlerBuiltIn(String nome){
  889.         return this.getValue("org.openspcoop2.pdd.handler.built-in.post-out-request.", nome);
  890.     }
  891.     public String[] getPostOutRequestHandlerBuiltIn() throws UtilsException{
  892.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.built-in.post-out-request.");
  893.     }
  894.    
  895.     /**
  896.      * Ritorna una classe 'PreInResponseHandlerBuiltIn' se questa e' stata precedentemente registrata
  897.      *
  898.      *
  899.      */
  900.     public String getPreInResponseHandlerBuiltIn(String nome){
  901.         return this.getValue("org.openspcoop2.pdd.handler.built-in.pre-in-response.", nome);
  902.     }
  903.     public String[] getPreInResponseHandlerBuiltIn() throws UtilsException{
  904.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.built-in.pre-in-response.");
  905.     }
  906.    
  907.     /**
  908.      * Ritorna una classe 'InResponseHandlerBuiltIn' se questa e' stata precedentemente registrata
  909.      *
  910.      *
  911.      */
  912.     public String getInResponseHandlerBuiltIn(String nome){
  913.         return this.getValue("org.openspcoop2.pdd.handler.built-in.in-response.", nome);
  914.     }
  915.     public String[] getInResponseHandlerBuiltIn() throws UtilsException{
  916.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.built-in.in-response.");
  917.     }
  918.    
  919.     /**
  920.      * Ritorna una classe 'OutResponseHandlerBuiltIn' se questa e' stata precedentemente registrata
  921.      *
  922.      *
  923.      */
  924.     public String getOutResponseHandlerBuiltIn(String nome){
  925.         return this.getValue("org.openspcoop2.pdd.handler.built-in.out-response.", nome);
  926.     }
  927.     public String[] getOutResponseHandlerBuiltIn() throws UtilsException{
  928.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.built-in.out-response.");
  929.     }
  930.    
  931.     /**
  932.      * Ritorna una classe 'PostOutResponseHandlerBuiltIn' se questa e' stata precedentemente registrata
  933.      *
  934.      *
  935.      */
  936.     public String getPostOutResponseHandlerBuiltIn(String nome){
  937.         return this.getValue("org.openspcoop2.pdd.handler.built-in.post-out-response.", nome);
  938.     }
  939.     public String[] getPostOutResponseHandlerBuiltIn() throws UtilsException{
  940.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.built-in.post-out-response.");
  941.     }
  942.    
  943.     /**
  944.      * Ritorna una classe 'IntegrationManagerRequestHandlerBuiltIn' se questa e' stata precedentemente registrata
  945.      *
  946.      *
  947.      */
  948.     public String getIntegrationManagerRequestHandlerBuiltIn(String nome){
  949.         return this.getValue("org.openspcoop2.pdd.integrationManager.handler.built-in.request.", nome);
  950.     }
  951.     public String[] getIntegrationManagerRequestHandlerBuiltIn() throws UtilsException{
  952.         return this.getTipiGestiti("org.openspcoop2.pdd.integrationManager.handler.built-in.request.");
  953.     }
  954.    
  955.     /**
  956.      * Ritorna una classe 'IntegrationManagerResponseHandlerBuiltIn' se questa e' stata precedentemente registrata
  957.      *
  958.      *
  959.      */
  960.     public String getIntegrationManagerResponseHandlerBuiltIn(String nome){
  961.         return this.getValue("org.openspcoop2.pdd.integrationManager.handler.built-in.response.", nome);
  962.     }
  963.     public String[] getIntegrationManagerResponseHandlerBuiltIn() throws UtilsException{
  964.         return this.getTipiGestiti("org.openspcoop2.pdd.integrationManager.handler.built-in.response.");
  965.     }
  966.    
  967.    
  968.    
  969.    
  970.     // Handler
  971.    
  972.     /**
  973.      * Ritorna una classe 'InitHandler' se questa e' stata precedentemente registrata
  974.      *
  975.      *
  976.      */
  977.     public String getInitHandler(String nome){
  978.         return this.getValue("org.openspcoop2.pdd.handler.init.", nome);
  979.     }
  980.     public String[] getInitHandler() throws UtilsException{
  981.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.init.");
  982.     }
  983.    
  984.    
  985.    
  986.     /**
  987.      * Ritorna una classe 'ExitHandler' se questa e' stata precedentemente registrata
  988.      *
  989.      *
  990.      */
  991.     public String getExitHandler(String nome){
  992.         return this.getValue("org.openspcoop2.pdd.handler.exit.", nome);
  993.     }
  994.     public String[] getExitHandler() throws UtilsException{
  995.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.exit.");
  996.     }
  997.    
  998.    
  999.    
  1000.     /**
  1001.      * Ritorna una classe 'PreInRequestHandler' se questa e' stata precedentemente registrata
  1002.      *
  1003.      *
  1004.      */
  1005.     public String getPreInRequestHandler(String nome){
  1006.         return this.getValue("org.openspcoop2.pdd.handler.pre-in-request.", nome);
  1007.     }
  1008.     public String[] getPreInRequestHandler() throws UtilsException{
  1009.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.pre-in-request.");
  1010.     }
  1011.    
  1012.     /**
  1013.      * Ritorna una classe 'InRequestHandler' se questa e' stata precedentemente registrata
  1014.      *
  1015.      *
  1016.      */
  1017.     public String getInRequestHandler(String nome){
  1018.         return this.getValue("org.openspcoop2.pdd.handler.in-request.", nome);
  1019.     }
  1020.     public String[] getInRequestHandler() throws UtilsException{
  1021.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.in-request.");
  1022.     }
  1023.    
  1024.     /**
  1025.      * Ritorna una classe 'InProtocolRequestHandler' se questa e' stata precedentemente registrata
  1026.      *
  1027.      *
  1028.      */
  1029.     public String getInRequestProtocolHandler(String nome){
  1030.         return this.getValue("org.openspcoop2.pdd.handler.in-protocol-request.", nome);
  1031.     }
  1032.     public String[] getInRequestProtocolHandler() throws UtilsException{
  1033.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.in-protocol-request.");
  1034.     }
  1035.    
  1036.     /**
  1037.      * Ritorna una classe 'OutRequestHandler' se questa e' stata precedentemente registrata
  1038.      *
  1039.      *
  1040.      */
  1041.     public String getOutRequestHandler(String nome){
  1042.         return this.getValue("org.openspcoop2.pdd.handler.out-request.", nome);
  1043.     }
  1044.     public String[] getOutRequestHandler() throws UtilsException{
  1045.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.out-request.");
  1046.     }
  1047.    
  1048.     /**
  1049.      * Ritorna una classe 'PostOutRequestHandler' se questa e' stata precedentemente registrata
  1050.      *
  1051.      *
  1052.      */
  1053.     public String getPostOutRequestHandler(String nome){
  1054.         return this.getValue("org.openspcoop2.pdd.handler.post-out-request.", nome);
  1055.     }
  1056.     public String[] getPostOutRequestHandler() throws UtilsException{
  1057.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.post-out-request.");
  1058.     }
  1059.    
  1060.     /**
  1061.      * Ritorna una classe 'PreInResponseHandler' se questa e' stata precedentemente registrata
  1062.      *
  1063.      *
  1064.      */
  1065.     public String getPreInResponseHandler(String nome){
  1066.         return this.getValue("org.openspcoop2.pdd.handler.pre-in-response.", nome);
  1067.     }
  1068.     public String[] getPreInResponseHandler() throws UtilsException{
  1069.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.pre-in-response.");
  1070.     }
  1071.    
  1072.     /**
  1073.      * Ritorna una classe 'InResponseHandler' se questa e' stata precedentemente registrata
  1074.      *
  1075.      *
  1076.      */
  1077.     public String getInResponseHandler(String nome){
  1078.         return this.getValue("org.openspcoop2.pdd.handler.in-response.", nome);
  1079.     }
  1080.     public String[] getInResponseHandler() throws UtilsException{
  1081.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.in-response.");
  1082.     }
  1083.    
  1084.     /**
  1085.      * Ritorna una classe 'OutResponseHandler' se questa e' stata precedentemente registrata
  1086.      *
  1087.      *
  1088.      */
  1089.     public String getOutResponseHandler(String nome){
  1090.         return this.getValue("org.openspcoop2.pdd.handler.out-response.", nome);
  1091.     }
  1092.     public String[] getOutResponseHandler() throws UtilsException{
  1093.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.out-response.");
  1094.     }
  1095.    
  1096.     /**
  1097.      * Ritorna una classe 'PostOutResponseHandler' se questa e' stata precedentemente registrata
  1098.      *
  1099.      *
  1100.      */
  1101.     public String getPostOutResponseHandler(String nome){
  1102.         return this.getValue("org.openspcoop2.pdd.handler.post-out-response.", nome);
  1103.     }
  1104.     public String[] getPostOutResponseHandler() throws UtilsException{
  1105.         return this.getTipiGestiti("org.openspcoop2.pdd.handler.post-out-response.");
  1106.     }
  1107.    
  1108.     /**
  1109.      * Ritorna una classe 'IntegrationManagerRequestHandler' se questa e' stata precedentemente registrata
  1110.      *
  1111.      *
  1112.      */
  1113.     public String getIntegrationManagerRequestHandler(String nome){
  1114.         return this.getValue("org.openspcoop2.pdd.integrationManager.handler.request.", nome);
  1115.     }
  1116.     public String[] getIntegrationManagerRequestHandler() throws UtilsException{
  1117.         return this.getTipiGestiti("org.openspcoop2.pdd.integrationManager.handler.request.");
  1118.     }
  1119.    
  1120.     /**
  1121.      * Ritorna una classe 'IntegrationManagerResponseHandler' se questa e' stata precedentemente registrata
  1122.      *
  1123.      *
  1124.      */
  1125.     public String getIntegrationManagerResponseHandler(String nome){
  1126.         return this.getValue("org.openspcoop2.pdd.integrationManager.handler.response.", nome);
  1127.     }
  1128.     public String[] getIntegrationManagerResponseHandler() throws UtilsException{
  1129.         return this.getTipiGestiti("org.openspcoop2.pdd.integrationManager.handler.response.");
  1130.     }
  1131.    
  1132.    
  1133.     /**
  1134.      * Ritorna una classe 'OpenSPCoop2MessageFactory' se questa e' stata precedentemente registrata
  1135.      *
  1136.      *
  1137.      */
  1138.     public String getOpenSPCoop2MessageFactory(String nome){
  1139.         if(nome == null) return null;
  1140.         return this.getValue("org.openspcoop2.pdd.messagefactory.", nome);
  1141.     }
  1142.     public String[] getOpenSPCoop2MessageFactory() throws UtilsException{
  1143.         return this.getTipiGestiti("org.openspcoop2.pdd.messagefactory.");
  1144.     }
  1145.    
  1146.    
  1147.     /**
  1148.      * Ritorna una classe 'MessageSecurityContext' se questa e' stata precedentemente registrata
  1149.      *
  1150.      *
  1151.      */
  1152.     public String getMessageSecurityContext(String nome){
  1153.         if(nome == null) return null;
  1154.         return this.getValue("org.openspcoop2.pdd.messageSecurity.context.", nome);
  1155.     }
  1156.     public String[] getMessageSecurityContext() throws UtilsException{
  1157.         return this.getTipiGestiti("org.openspcoop2.pdd.messageSecurity.context.");
  1158.     }
  1159.    
  1160.    
  1161.     /**
  1162.      * Ritorna una classe 'MessageSecurityDigestReader' se questa e' stata precedentemente registrata
  1163.      *
  1164.      *
  1165.      */
  1166.     public String getMessageSecurityDigestReader(String nome){
  1167.         if(nome == null) return null;
  1168.         return this.getValue("org.openspcoop2.pdd.messageSecurity.digestReader.", nome);
  1169.     }
  1170.     public String[] getMessageSecurityDigestReader() throws UtilsException{
  1171.         return this.getTipiGestiti("org.openspcoop2.pdd.messageSecurity.digestReader.");
  1172.     }
  1173.    
  1174.    
  1175.     /**
  1176.      * Ritorna una classe 'IGestoreCredenziali' se questa e' stata precedentemente registrata
  1177.      *
  1178.      *
  1179.      */
  1180.     public String getGestoreCredenziali(String nome){
  1181.         return this.getValue("org.openspcoop2.pdd.gestoreCredenziali.", nome);
  1182.     }
  1183.     public String[] getGestoreCredenziali() throws UtilsException{
  1184.         return this.getTipiGestiti("org.openspcoop2.pdd.gestoreCredenziali.");
  1185.     }
  1186.    
  1187.     /**
  1188.      * Ritorna una classe 'IGestoreCredenzialiIM' se questa e' stata precedentemente registrata
  1189.      *
  1190.      *
  1191.      */
  1192.     public String getGestoreCredenzialiIM(String nome){
  1193.         return this.getValue("org.openspcoop2.integrationManager.gestoreCredenziali.", nome);
  1194.     }
  1195.     public String[] getGestoreCredenzialiIM() throws UtilsException{
  1196.         return this.getTipiGestiti("org.openspcoop2.integrationManager.gestoreCredenziali.");
  1197.     }
  1198.    
  1199.    
  1200.    
  1201.     /**
  1202.      * Ritorna una classe 'NotifierCallback' se questa e' stata precedentemente registrata
  1203.      *
  1204.      *
  1205.      */
  1206.     public String getNotifierCallback(String nome){
  1207.         return this.getValue("org.openspcoop2.notifierCallback.", nome);
  1208.     }
  1209.     public String[] getNotifierCallback() throws UtilsException{
  1210.         return this.getTipiGestiti("org.openspcoop2.notifierCallback.");
  1211.     }
  1212.    
  1213.    
  1214.    
  1215.    
  1216.     /**
  1217.      * Ritorna una classe 'IBehaviour' se questa e' stata precedentemente registrata
  1218.      *
  1219.      *
  1220.      */
  1221.     public String getBehaviour(String nome){
  1222.         return this.getValue("org.openspcoop2.behaviour.", nome);
  1223.     }
  1224.     public String[] getBehaviour() throws UtilsException{
  1225.         return this.getTipiGestiti("org.openspcoop2.behaviour.");
  1226.     }
  1227.    
  1228.    
  1229.    
  1230.     /**
  1231.      * Ritorna una classe 'ISalvataggioTracceManager' se questa e' stata precedentemente registrata
  1232.      *
  1233.      *
  1234.      */
  1235.     public String getSalvataggioTracceManager(String nome){
  1236.         return this.getValue("org.openspcoop2.pdd.transazioni.tracce.salvataggio.", nome);
  1237.     }
  1238.     public String[] getSalvataggioTracceManager() throws UtilsException{
  1239.         return this.getTipiGestiti("org.openspcoop2.pdd.transazioni.tracce.salvataggio.");
  1240.     }
  1241.    
  1242.    
  1243.    
  1244.     /**
  1245.      * Ritorna una classe 'ISalvataggioDiagnosticiManager' se questa e' stata precedentemente registrata
  1246.      *
  1247.      *
  1248.      */
  1249.     public String getSalvataggioDiagnosticiManager(String nome){
  1250.         return this.getValue("org.openspcoop2.pdd.transazioni.diagnostici.salvataggio.", nome);
  1251.     }
  1252.     public String[] getSalvataggioDiagnosticiManager() throws UtilsException{
  1253.         return this.getTipiGestiti("org.openspcoop2.pdd.transazioni.diagnostici.salvataggio.");
  1254.     }
  1255.    
  1256.    
  1257.    
  1258.     /**
  1259.      * Ritorna una classe 'IRateLimiting' se questa e' stata precedentemente registrata
  1260.      *
  1261.      *
  1262.      */
  1263.     public String getRateLimiting(String nome){
  1264.         return this.getValue("org.openspcoop2.pdd.controlloTraffico.rateLimiting.", nome);
  1265.     }
  1266.     public String[] getRateLimiting() throws UtilsException{
  1267.         return this.getTipiGestiti("org.openspcoop2.pdd.controlloTraffico.rateLimiting.");
  1268.     }

  1269.    
  1270.    
  1271.     /**
  1272.      * Ritorna una classe 'IDynamicDiscoveryParser' se questa e' stata precedentemente registrata
  1273.      *
  1274.      *
  1275.      */
  1276.     public String getTokenDynamicDiscovery(String nome){
  1277.         return this.getValue("org.openspcoop2.pdd.token.dynamicDiscovery.", nome);
  1278.     }
  1279.     public String[] getTokenDynamicDiscovery() throws UtilsException{
  1280.         return this.getTipiGestiti("org.openspcoop2.pdd.token.dynamicDiscovery.");
  1281.     }
  1282.    
  1283.    
  1284.    
  1285.    
  1286.     /**
  1287.      * Ritorna una classe 'ITokenParser' se questa e' stata precedentemente registrata
  1288.      *
  1289.      *
  1290.      */
  1291.     public String getTokenValidazione(String nome){
  1292.         return this.getValue("org.openspcoop2.pdd.token.validazione.", nome);
  1293.     }
  1294.     public String[] getTokenValidazione() throws UtilsException{
  1295.         return this.getTipiGestiti("org.openspcoop2.pdd.token.validazione.");
  1296.     }
  1297.    
  1298.    
  1299.    
  1300.     /**
  1301.      * Ritorna una classe 'INegoziazioneTokenParser' se questa e' stata precedentemente registrata
  1302.      *
  1303.      *
  1304.      */
  1305.     public String getTokenNegoziazione(String nome){
  1306.         return this.getValue("org.openspcoop2.pdd.token.negoziazione.", nome);
  1307.     }
  1308.     public String[] getTokenNegoziazione() throws UtilsException{
  1309.         return this.getTipiGestiti("org.openspcoop2.pdd.token.negoziazione.");
  1310.     }
  1311.    
  1312.    
  1313.    
  1314.     /**
  1315.      * Ritorna una classe 'IRetrieveAttributeAuthorityResponseParser' se questa e' stata precedentemente registrata
  1316.      *
  1317.      *
  1318.      */
  1319.     public String getAttributeAuthority(String nome){
  1320.         return this.getValue("org.openspcoop2.pdd.attributeAuthority.", nome);
  1321.     }
  1322.     public String[] getAttributeAuthority() throws UtilsException{
  1323.         return this.getTipiGestiti("org.openspcoop2.pdd.attributeAuthority.");
  1324.     }
  1325.    
  1326.    
  1327.    
  1328.     /**
  1329.      * Ritorna una classe estesa la cui interfaccia dipende da quella indicata nel primo, parametro
  1330.      *
  1331.      *
  1332.      */
  1333.     public String getExtended(String tipologia, String nome){
  1334.         return this.getValue("org.openspcoop2.pdd.extended.", tipologia+"."+nome);
  1335.     }
  1336.     public String[] getExtended(String tipologia) throws UtilsException{
  1337.         return this.getTipiGestiti("org.openspcoop2.pdd.extended."+tipologia+".");
  1338.     }
  1339.    
  1340.    
  1341.    

  1342.     private String getValue(String prop,String nome){
  1343.         try{
  1344.             String value = this.reader.getValue(prop+nome);
  1345.             if(value!=null){
  1346.                 value = value.trim();
  1347.             }
  1348.             else{
  1349.                 // provo con lowerCase
  1350.                 value = this.reader.getValue(prop+(nome.toLowerCase()));
  1351.                 if(value!=null){
  1352.                     value = value.trim();
  1353.                 }
  1354.                 else{
  1355.                     // provo con upperCase
  1356.                     value = this.reader.getValue(prop+(nome.toUpperCase()));
  1357.                     if(value!=null){
  1358.                         value = value.trim();
  1359.                     }
  1360.                 }
  1361.             }
  1362.                
  1363.             return value;
  1364.         }catch(Exception e){
  1365.             this.log.error("Errore durante la lettura della proprieta ["+prop+nome+"]: "+e.getMessage(),e);
  1366.             return null;
  1367.         }
  1368.     }
  1369.     private String[] getTipiGestiti(String prefix,String ... defaults) throws UtilsException {
  1370.         Properties prop = this.reader.readProperties(prefix);
  1371.         Enumeration<?> en = prop.keys();
  1372.         List<String> tipi = new ArrayList<>();
  1373.         if(defaults!=null && defaults.length>0){
  1374.             tipi.addAll(Arrays.asList(defaults));
  1375.         }
  1376.         while(en.hasMoreElements()){
  1377.             Object o = en.nextElement();
  1378.             if(o!=null){
  1379.                 String v = (String)o;
  1380.                 tipi.add(v.trim());
  1381.             }
  1382.         }
  1383.         String[] sNull = null;
  1384.         if(!tipi.isEmpty()){
  1385.             return tipi.toArray(new String[1]);
  1386.         }else{
  1387.             return sNull;
  1388.         }
  1389.     }
  1390. }