ConfigurazioneCore.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.web.ctrlstat.servlet.config;

  21. import java.sql.Connection;
  22. import java.util.ArrayList;
  23. import java.util.Collections;
  24. import java.util.EnumMap;
  25. import java.util.HashMap;
  26. import java.util.List;
  27. import java.util.Map;
  28. import java.util.Properties;

  29. import org.apache.commons.lang.StringUtils;
  30. import org.openspcoop2.core.allarmi.Allarme;
  31. import org.openspcoop2.core.allarmi.AllarmeParametro;
  32. import org.openspcoop2.core.allarmi.constants.RuoloPorta;
  33. import org.openspcoop2.core.allarmi.constants.TipoAllarme;
  34. import org.openspcoop2.core.commons.ErrorsHandlerCostant;
  35. import org.openspcoop2.core.commons.Filtri;
  36. import org.openspcoop2.core.commons.ISearch;
  37. import org.openspcoop2.core.commons.Liste;
  38. import org.openspcoop2.core.config.AccessoConfigurazione;
  39. import org.openspcoop2.core.config.AccessoDatiAutorizzazione;
  40. import org.openspcoop2.core.config.AccessoRegistro;
  41. import org.openspcoop2.core.config.AccessoRegistroRegistro;
  42. import org.openspcoop2.core.config.CanaleConfigurazione;
  43. import org.openspcoop2.core.config.CanaleConfigurazioneNodo;
  44. import org.openspcoop2.core.config.Configurazione;
  45. import org.openspcoop2.core.config.ConfigurazioneUrlInvocazione;
  46. import org.openspcoop2.core.config.ConfigurazioneUrlInvocazioneRegola;
  47. import org.openspcoop2.core.config.GenericProperties;
  48. import org.openspcoop2.core.config.GestioneErrore;
  49. import org.openspcoop2.core.config.PortaApplicativa;
  50. import org.openspcoop2.core.config.PortaDelegata;
  51. import org.openspcoop2.core.config.Property;
  52. import org.openspcoop2.core.config.Proprieta;
  53. import org.openspcoop2.core.config.RegistroPlugin;
  54. import org.openspcoop2.core.config.RegistroPluginArchivio;
  55. import org.openspcoop2.core.config.RegistroPlugins;
  56. import org.openspcoop2.core.config.ResponseCachingConfigurazioneRegola;
  57. import org.openspcoop2.core.config.RoutingTable;
  58. import org.openspcoop2.core.config.RoutingTableDestinazione;
  59. import org.openspcoop2.core.config.SystemProperties;
  60. import org.openspcoop2.core.config.constants.CostantiConfigurazione;
  61. import org.openspcoop2.core.config.constants.FaseMessageHandler;
  62. import org.openspcoop2.core.config.constants.FaseServiceHandler;
  63. import org.openspcoop2.core.config.constants.PluginSorgenteArchivio;
  64. import org.openspcoop2.core.config.constants.RuoloContesto;
  65. import org.openspcoop2.core.config.driver.DriverConfigurazioneException;
  66. import org.openspcoop2.core.config.driver.DriverConfigurazioneNotFound;
  67. import org.openspcoop2.core.constants.CostantiDB;
  68. import org.openspcoop2.core.constants.TipoPdD;
  69. import org.openspcoop2.core.controllo_traffico.AttivazionePolicy;
  70. import org.openspcoop2.core.controllo_traffico.AttivazionePolicyFiltro;
  71. import org.openspcoop2.core.controllo_traffico.AttivazionePolicyRaggruppamento;
  72. import org.openspcoop2.core.controllo_traffico.ConfigurazioneGenerale;
  73. import org.openspcoop2.core.controllo_traffico.ConfigurazionePolicy;
  74. import org.openspcoop2.core.controllo_traffico.IdPolicy;
  75. import org.openspcoop2.core.controllo_traffico.beans.InfoPolicy;
  76. import org.openspcoop2.core.controllo_traffico.constants.RuoloPolicy;
  77. import org.openspcoop2.core.controllo_traffico.constants.TipoRisorsaPolicyAttiva;
  78. import org.openspcoop2.core.id.IDGenericProperties;
  79. import org.openspcoop2.core.id.IDServizio;
  80. import org.openspcoop2.core.id.IDServizioApplicativo;
  81. import org.openspcoop2.core.id.IDSoggetto;
  82. import org.openspcoop2.core.mvc.properties.utils.DBPropertiesUtils;
  83. import org.openspcoop2.core.registry.beans.AccordoServizioParteComuneSintetico;
  84. import org.openspcoop2.generic_project.exception.NotFoundException;
  85. import org.openspcoop2.message.constants.ServiceBinding;
  86. import org.openspcoop2.monitor.engine.alarm.AlarmContext;
  87. import org.openspcoop2.monitor.engine.alarm.wrapper.ConfigurazioneAllarmeBean;
  88. import org.openspcoop2.monitor.engine.alarm.wrapper.ConfigurazioneAllarmeHistoryBean;
  89. import org.openspcoop2.core.plugins.IdPlugin;
  90. import org.openspcoop2.core.plugins.Plugin;
  91. import org.openspcoop2.core.plugins.constants.TipoPlugin;
  92. import org.openspcoop2.core.plugins.utils.handlers.ConfigurazioneHandlerBean;
  93. import org.openspcoop2.monitor.engine.dynamic.DynamicFactory;
  94. import org.openspcoop2.monitor.engine.dynamic.IDynamicLoader;
  95. import org.openspcoop2.monitor.sdk.condition.Context;
  96. import org.openspcoop2.monitor.sdk.constants.ParameterType;
  97. import org.openspcoop2.monitor.sdk.parameters.Parameter;
  98. import org.openspcoop2.monitor.sdk.plugins.FiltersConfiguration;
  99. import org.openspcoop2.monitor.sdk.plugins.GroupByConfiguration;
  100. import org.openspcoop2.monitor.sdk.plugins.IAlarmProcessing;
  101. import org.openspcoop2.pdd.config.UrlInvocazioneAPI;
  102. import org.openspcoop2.pdd.core.autorizzazione.canali.CanaliUtils;
  103. import org.openspcoop2.pdd.core.controllo_traffico.policy.config.PolicyConfiguration;
  104. import org.openspcoop2.protocol.engine.ProtocolFactoryManager;
  105. import org.openspcoop2.protocol.engine.utils.DBOggettiInUsoUtils;
  106. import org.openspcoop2.protocol.sdk.IProtocolFactory;
  107. import org.openspcoop2.protocol.sdk.ProtocolException;
  108. import org.openspcoop2.web.ctrlstat.core.ControlStationCore;
  109. import org.openspcoop2.web.ctrlstat.core.ConsoleSearch;
  110. import org.openspcoop2.web.ctrlstat.driver.DriverControlStationDB;
  111. import org.openspcoop2.web.ctrlstat.driver.DriverControlStationException;
  112. import org.openspcoop2.web.ctrlstat.driver.DriverControlStationNotFound;
  113. import org.openspcoop2.web.lib.audit.AuditException;
  114. import org.openspcoop2.web.lib.audit.DriverAudit;
  115. import org.openspcoop2.web.lib.audit.dao.Filtro;
  116. import org.openspcoop2.web.lib.mvc.Costanti;
  117. import org.openspcoop2.web.lib.mvc.dynamic.DynamicComponentUtils;
  118. import org.openspcoop2.web.lib.mvc.dynamic.components.BaseComponent;

  119. /**
  120.  * ConfigurazioneCore
  121.  *
  122.  * @author Poli Andrea (apoli@link.it)
  123.  * @author $Author$
  124.  * @version $Rev$, $Date$
  125.  */
  126. public class ConfigurazioneCore extends ControlStationCore {


  127.     public ConfigurazioneCore() throws Exception {
  128.         super();
  129.     }
  130.     public ConfigurazioneCore(ControlStationCore core) throws Exception {
  131.         super(core);
  132.     }
  133.    
  134.    
  135.     public List<RoutingTableDestinazione> routingList(ISearch ricerca) throws DriverConfigurazioneException {
  136.         Connection con = null;
  137.         String nomeMetodo = "routingList";
  138.         DriverControlStationDB driver = null;

  139.         try {
  140.             // prendo una connessione
  141.             con = ControlStationCore.dbM.getConnection();
  142.             // istanzio il driver
  143.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  144.             return driver.getDriverConfigurazioneDB().routingList(ricerca);
  145.         } catch (Exception e) {
  146.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  147.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  148.         } finally {
  149.             ControlStationCore.dbM.releaseConnection(con);
  150.         }
  151.     }

  152.    
  153.     public List<AccessoRegistroRegistro> registriList(ISearch ricerca) throws DriverConfigurazioneException {
  154.         Connection con = null;
  155.         String nomeMetodo = "registriList";
  156.         DriverControlStationDB driver = null;

  157.         try {
  158.             // prendo una connessione
  159.             con = ControlStationCore.dbM.getConnection();
  160.             // istanzio il driver
  161.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  162.             return driver.getDriverConfigurazioneDB().registriList(ricerca);
  163.         } catch (Exception e) {
  164.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  165.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  166.         } finally {
  167.             ControlStationCore.dbM.releaseConnection(con);
  168.         }
  169.     }
  170.    
  171.    
  172.     public List<ResponseCachingConfigurazioneRegola> responseCachingConfigurazioneRegolaList(ISearch ricerca) throws DriverConfigurazioneException {
  173.         Connection con = null;
  174.         String nomeMetodo = "responseCachingConfigurazioneRegolaList";
  175.         DriverControlStationDB driver = null;

  176.         try {
  177.             // prendo una connessione
  178.             con = ControlStationCore.dbM.getConnection();
  179.             // istanzio il driver
  180.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  181.             return driver.getDriverConfigurazioneDB().responseCachingConfigurazioneRegolaList(ricerca);
  182.         } catch (Exception e) {
  183.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  184.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  185.         } finally {
  186.             ControlStationCore.dbM.releaseConnection(con);
  187.         }
  188.     }
  189.    
  190.     public List<ConfigurazioneUrlInvocazioneRegola> proxyPassConfigurazioneRegolaList(ISearch ricerca) throws DriverConfigurazioneException {
  191.         Connection con = null;
  192.         String nomeMetodo = "responseCachingConfigurazioneRegolaList";
  193.         DriverControlStationDB driver = null;

  194.         try {
  195.             // prendo una connessione
  196.             con = ControlStationCore.dbM.getConnection();
  197.             // istanzio il driver
  198.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  199.             return driver.getDriverConfigurazioneDB().proxyPassConfigurazioneRegolaList(ricerca);
  200.         } catch (Exception e) {
  201.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  202.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  203.         } finally {
  204.             ControlStationCore.dbM.releaseConnection(con);
  205.         }
  206.     }
  207.    
  208.     public boolean existsResponseCachingConfigurazioneRegola(Integer statusMin, Integer statusMax, boolean fault) throws DriverConfigurazioneException{
  209.         Connection con = null;
  210.         String nomeMetodo = "existsResponseCachingConfigurazioneRegola";
  211.         DriverControlStationDB driver = null;

  212.         try {
  213.             // prendo una connessione
  214.             con = ControlStationCore.dbM.getConnection();
  215.             // istanzio il driver
  216.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  217.             return driver.getDriverConfigurazioneDB().existsResponseCachingConfigurazioneRegola(statusMin,statusMax,fault);
  218.         } catch (Exception e) {
  219.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  220.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  221.         } finally {
  222.             ControlStationCore.dbM.releaseConnection(con);
  223.         }
  224.     }
  225.    
  226.     public boolean existsProxyPassConfigurazioneRegola(String nome) throws DriverConfigurazioneException{
  227.         Connection con = null;
  228.         String nomeMetodo = "existsProxyPassConfigurazioneRegola";
  229.         DriverControlStationDB driver = null;

  230.         try {
  231.             // prendo una connessione
  232.             con = ControlStationCore.dbM.getConnection();
  233.             // istanzio il driver
  234.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  235.             return driver.getDriverConfigurazioneDB().existsProxyPassConfigurazioneRegola(nome);
  236.         } catch (Exception e) {
  237.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  238.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  239.         } finally {
  240.             ControlStationCore.dbM.releaseConnection(con);
  241.         }
  242.     }
  243.    
  244.     public List<RegistroPlugin> pluginsArchiviList(ISearch ricerca) throws DriverConfigurazioneException {
  245.         Connection con = null;
  246.         String nomeMetodo = "pluginsArchiviList";
  247.         DriverControlStationDB driver = null;

  248.         try {
  249.             // prendo una connessione
  250.             con = ControlStationCore.dbM.getConnection();
  251.             // istanzio il driver
  252.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  253.             return driver.getDriverConfigurazioneDB().pluginsArchiviList(ricerca);
  254.         } catch (Exception e) {
  255.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  256.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  257.         } finally {
  258.             ControlStationCore.dbM.releaseConnection(con);
  259.         }
  260.     }
  261.    
  262.     public int numeroPluginsArchiviList() throws DriverConfigurazioneException {
  263.         Connection con = null;
  264.         String nomeMetodo = "numeroPluginsArchiviList";
  265.         DriverControlStationDB driver = null;

  266.         try {
  267.             // prendo una connessione
  268.             con = ControlStationCore.dbM.getConnection();
  269.             // istanzio il driver
  270.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  271.             ConsoleSearch searchForCount = new ConsoleSearch(true,1);
  272.             driver.getDriverConfigurazioneDB().pluginsArchiviList(searchForCount);
  273.             return searchForCount.getNumEntries(Liste.CONFIGURAZIONE_PLUGINS_ARCHIVI);
  274.         } catch (Exception e) {
  275.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  276.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  277.         } finally {
  278.             ControlStationCore.dbM.releaseConnection(con);
  279.         }
  280.     }
  281.    
  282.     public RegistroPlugin getRegistroPlugin(String nome) throws DriverConfigurazioneException {
  283.         Connection con = null;
  284.         String nomeMetodo = "getRegistroPlugin";
  285.         DriverControlStationDB driver = null;

  286.         try {
  287.             // prendo una connessione
  288.             con = ControlStationCore.dbM.getConnection();
  289.             // istanzio il driver
  290.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  291.             return driver.getDriverConfigurazioneDB().getRegistroPlugin(nome);
  292.         } catch (Exception e) {
  293.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  294.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  295.         } finally {
  296.             ControlStationCore.dbM.releaseConnection(con);
  297.         }
  298.     }
  299.    
  300.     public RegistroPlugin getDatiRegistroPlugin(String nome) throws DriverConfigurazioneException {
  301.         Connection con = null;
  302.         String nomeMetodo = "getDatiRegistroPlugin";
  303.         DriverControlStationDB driver = null;

  304.         try {
  305.             // prendo una connessione
  306.             con = ControlStationCore.dbM.getConnection();
  307.             // istanzio il driver
  308.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  309.             return driver.getDriverConfigurazioneDB().getDatiRegistroPlugin(nome);
  310.         } catch (Exception e) {
  311.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  312.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  313.         } finally {
  314.             ControlStationCore.dbM.releaseConnection(con);
  315.         }
  316.     }
  317.    
  318.     public RegistroPluginArchivio getRegistroPluginArchivio(String nomePlugin, String nome) throws DriverConfigurazioneException {
  319.         Connection con = null;
  320.         String nomeMetodo = "getRegistroPluginArchivio";
  321.         DriverControlStationDB driver = null;

  322.         try {
  323.             // prendo una connessione
  324.             con = ControlStationCore.dbM.getConnection();
  325.             // istanzio il driver
  326.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  327.             return driver.getDriverConfigurazioneDB().getRegistroPluginArchivio(nomePlugin, nome);
  328.         } catch (Exception e) {
  329.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  330.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  331.         } finally {
  332.             ControlStationCore.dbM.releaseConnection(con);
  333.         }
  334.     }
  335.    
  336.     public boolean existsRegistroPluginArchivio(String nomePlugin, String nome) throws DriverConfigurazioneException {
  337.         Connection con = null;
  338.         String nomeMetodo = "existsRegistroPluginArchivio";
  339.         DriverControlStationDB driver = null;

  340.         try {
  341.             // prendo una connessione
  342.             con = ControlStationCore.dbM.getConnection();
  343.             // istanzio il driver
  344.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  345.             return driver.getDriverConfigurazioneDB().existsRegistroPluginArchivio(nomePlugin, nome);
  346.         } catch (Exception e) {
  347.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  348.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  349.         } finally {
  350.             ControlStationCore.dbM.releaseConnection(con);
  351.         }
  352.     }
  353.    
  354.     public boolean existsRegistroPluginArchivio(String nomePlugin, PluginSorgenteArchivio tipoSorgente, String sorgente) throws DriverConfigurazioneException {
  355.         Connection con = null;
  356.         String nomeMetodo = "existsRegistroPluginArchivio";
  357.         DriverControlStationDB driver = null;

  358.         try {
  359.             // prendo una connessione
  360.             con = ControlStationCore.dbM.getConnection();
  361.             // istanzio il driver
  362.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  363.             return driver.getDriverConfigurazioneDB().existsRegistroPluginArchivio(nomePlugin, tipoSorgente, sorgente);
  364.         } catch (Exception e) {
  365.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  366.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  367.         } finally {
  368.             ControlStationCore.dbM.releaseConnection(con);
  369.         }
  370.     }
  371.    
  372.     public RegistroPlugin getRegistroPluginFromPosizione(int posizione) throws DriverConfigurazioneException {
  373.         Connection con = null;
  374.         String nomeMetodo = "getRegistroPluginFromPosizione";
  375.         DriverControlStationDB driver = null;

  376.         try {
  377.             // prendo una connessione
  378.             con = ControlStationCore.dbM.getConnection();
  379.             // istanzio il driver
  380.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  381.             return driver.getDriverConfigurazioneDB().getRegistroPluginFromPosizione(posizione);
  382.         } catch (Exception e) {
  383.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  384.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  385.         } finally {
  386.             ControlStationCore.dbM.releaseConnection(con);
  387.         }
  388.     }
  389.    
  390.     public RegistroPlugin getDatiRegistroPluginFromPosizione(int posizione) throws DriverConfigurazioneException {
  391.         Connection con = null;
  392.         String nomeMetodo = "getDatiRegistroPluginFromPosizione";
  393.         DriverControlStationDB driver = null;

  394.         try {
  395.             // prendo una connessione
  396.             con = ControlStationCore.dbM.getConnection();
  397.             // istanzio il driver
  398.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  399.             return driver.getDriverConfigurazioneDB().getDatiRegistroPluginFromPosizione(posizione);
  400.         } catch (Exception e) {
  401.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  402.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  403.         } finally {
  404.             ControlStationCore.dbM.releaseConnection(con);
  405.         }
  406.     }
  407.    
  408.     public boolean existsRegistroPlugin(String nome) throws DriverConfigurazioneException {
  409.         Connection con = null;
  410.         String nomeMetodo = "existsRegistroPlugin";
  411.         DriverControlStationDB driver = null;

  412.         try {
  413.             // prendo una connessione
  414.             con = ControlStationCore.dbM.getConnection();
  415.             // istanzio il driver
  416.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  417.             return driver.getDriverConfigurazioneDB().existsRegistroPlugin(nome);
  418.         } catch (Exception e) {
  419.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  420.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  421.         } finally {
  422.             ControlStationCore.dbM.releaseConnection(con);
  423.         }
  424.     }
  425.    
  426.     public int getMaxPosizioneRegistroPlugin() throws DriverConfigurazioneException {
  427.         Connection con = null;
  428.         String nomeMetodo = "getMaxPosizioneRegistroPlugin";
  429.         DriverControlStationDB driver = null;

  430.         try {
  431.             // prendo una connessione
  432.             con = ControlStationCore.dbM.getConnection();
  433.             // istanzio il driver
  434.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  435.             return driver.getDriverConfigurazioneDB().getMaxPosizioneRegistroPlugin();
  436.         } catch (Exception e) {
  437.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  438.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  439.         } finally {
  440.             ControlStationCore.dbM.releaseConnection(con);
  441.         }
  442.     }
  443.    
  444.     public int getNumeroArchiviJarRegistroPlugin(String nome) throws DriverConfigurazioneException {
  445.         Connection con = null;
  446.         String nomeMetodo = "getNumeroArchiviJarRegistroPlugin";
  447.         DriverControlStationDB driver = null;

  448.         try {
  449.             // prendo una connessione
  450.             con = ControlStationCore.dbM.getConnection();
  451.             // istanzio il driver
  452.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  453.             return driver.getDriverConfigurazioneDB().getNumeroArchiviJarRegistroPlugin(nome);
  454.         } catch (Exception e) {
  455.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  456.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  457.         } finally {
  458.             ControlStationCore.dbM.releaseConnection(con);
  459.         }
  460.     }
  461.    
  462.     public List<RegistroPluginArchivio> pluginsArchiviJarList(String nome, ISearch ricerca) throws DriverConfigurazioneException {
  463.         Connection con = null;
  464.         String nomeMetodo = "pluginsArchiviJarList";
  465.         DriverControlStationDB driver = null;

  466.         try {
  467.             // prendo una connessione
  468.             con = ControlStationCore.dbM.getConnection();
  469.             // istanzio il driver
  470.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  471.             return driver.getDriverConfigurazioneDB().pluginsArchiviJarList(nome, ricerca);
  472.         } catch (Exception e) {
  473.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  474.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  475.         } finally {
  476.             ControlStationCore.dbM.releaseConnection(con);
  477.         }
  478.     }
  479.    
  480.     public List<Plugin> pluginsClassiList(ISearch ricerca) throws DriverConfigurazioneException {
  481.         Connection con = null;
  482.         String nomeMetodo = "pluginsClassiList";
  483.         DriverControlStationDB driver = null;

  484.         try {
  485.             // prendo una connessione
  486.             con = ControlStationCore.dbM.getConnection();
  487.             // istanzio il driver
  488.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  489.             return driver.pluginsClassiList(ricerca);
  490.         } catch (Exception e) {
  491.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  492.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  493.         } finally {
  494.             ControlStationCore.dbM.releaseConnection(con);
  495.         }
  496.     }
  497.    
  498.     public List<Plugin> pluginsAllarmiList(String applicabilita, boolean soloAbilitati) throws DriverConfigurazioneException {
  499.         Connection con = null;
  500.         String nomeMetodo = "pluginsClassiList";
  501.         DriverControlStationDB driver = null;

  502.         try {
  503.             ISearch ricercaPlugin = new ConsoleSearch(true);
  504.             ricercaPlugin.addFilter( Liste.CONFIGURAZIONE_PLUGINS_CLASSI, Filtri.FILTRO_TIPO_PLUGIN_CLASSI, TipoPlugin.ALLARME.toString());
  505.             ricercaPlugin.addFilter(Liste.CONFIGURAZIONE_PLUGINS_CLASSI,  Filtri.FILTRO_APPLICABILITA_NOME, applicabilita);
  506.             if(soloAbilitati) {
  507.                 ricercaPlugin.addFilter(Liste.CONFIGURAZIONE_PLUGINS_CLASSI, Filtri.FILTRO_STATO, Filtri.FILTRO_STATO_VALORE_ABILITATO);
  508.             }
  509.             // prendo una connessione
  510.             con = ControlStationCore.dbM.getConnection();
  511.             // istanzio il driver
  512.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  513.             List<Plugin> pluginsClassiList = new ArrayList<>();
  514.             List<Plugin> p = driver.pluginsClassiList(ricercaPlugin);
  515.            
  516.             Map<String, Plugin> plugins = new HashMap<>();
  517.             List<String> keys = new ArrayList<>();
  518.             if(p!=null && !p.isEmpty()){
  519.                 for (Plugin plugin : p) {
  520.                     String key = plugin.getLabel() + "_" + plugin.getClassName();
  521.                     keys.add(key); // possono esistere più plugin con lo stesso label
  522.                     plugins.put(key, plugin);
  523.                 }  
  524.                
  525.                 // ordino
  526.                 Collections.sort(keys);
  527.                
  528.                 for (String key : keys) {
  529.                     pluginsClassiList.add(plugins.get(key));
  530.                 }
  531.             }
  532.            
  533.             return pluginsClassiList;
  534.         } catch (Exception e) {
  535.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  536.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  537.         } finally {
  538.             ControlStationCore.dbM.releaseConnection(con);
  539.         }
  540.     }
  541.    
  542.    
  543.     public RegistroPlugins getRegistroPlugins() throws DriverConfigurazioneException {
  544.         Connection con = null;
  545.         String nomeMetodo = "getRegistroPlugins";
  546.         DriverControlStationDB driver = null;

  547.         try {
  548.             // prendo una connessione
  549.             con = ControlStationCore.dbM.getConnection();
  550.             // istanzio il driver
  551.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  552.             return driver.getDriverConfigurazioneDB().getRegistroPlugins();
  553.         } catch (Exception e) {
  554.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  555.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  556.         } finally {
  557.             ControlStationCore.dbM.releaseConnection(con);
  558.         }
  559.     }
  560.    
  561.     public int numeroPluginsClassiList() throws DriverConfigurazioneException {
  562.         Connection con = null;
  563.         String nomeMetodo = "numeroPluginsClassiList";
  564.         DriverControlStationDB driver = null;

  565.         try {
  566.             // prendo una connessione
  567.             con = ControlStationCore.dbM.getConnection();
  568.             // istanzio il driver
  569.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  570.             return driver.numeroPluginsClassiList();
  571.         } catch (Exception e) {
  572.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  573.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  574.         } finally {
  575.             ControlStationCore.dbM.releaseConnection(con);
  576.         }
  577.     }
  578.    
  579.     public boolean existsPlugin(TipoPlugin tipoPlugin, String tipo, String label, String className) throws DriverConfigurazioneException {
  580.         Connection con = null;
  581.         String nomeMetodo = "existsPlugin";
  582.         DriverControlStationDB driver = null;

  583.         try {
  584.             // prendo una connessione
  585.             con = ControlStationCore.dbM.getConnection();
  586.             // istanzio il driver
  587.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  588.             return driver.existsPlugin(tipoPlugin, tipo,label, className);
  589.         } catch (Exception e) {
  590.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  591.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  592.         } finally {
  593.             ControlStationCore.dbM.releaseConnection(con);
  594.         }
  595.     }
  596.    
  597.     public boolean existsPluginConTipo(TipoPlugin tipoPlugin, String tipo) throws DriverConfigurazioneException {
  598.         Connection con = null;
  599.         String nomeMetodo = "existsPluginConTipo";
  600.         DriverControlStationDB driver = null;

  601.         try {
  602.             // prendo una connessione
  603.             con = ControlStationCore.dbM.getConnection();
  604.             // istanzio il driver
  605.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  606.             return driver.existsPluginConTipo(tipoPlugin, tipo);
  607.         } catch (Exception e) {
  608.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  609.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  610.         } finally {
  611.             ControlStationCore.dbM.releaseConnection(con);
  612.         }
  613.     }
  614.    
  615.     public boolean existsPluginConLabel(TipoPlugin tipoPlugin, String label) throws DriverConfigurazioneException {
  616.         Connection con = null;
  617.         String nomeMetodo = "existsPluginConLabel";
  618.         DriverControlStationDB driver = null;

  619.         try {
  620.             // prendo una connessione
  621.             con = ControlStationCore.dbM.getConnection();
  622.             // istanzio il driver
  623.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  624.             return driver.existsPluginConLabel(tipoPlugin, label);
  625.         } catch (Exception e) {
  626.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  627.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  628.         } finally {
  629.             ControlStationCore.dbM.releaseConnection(con);
  630.         }
  631.     }
  632.    
  633.     public boolean existsPluginConClassName(TipoPlugin tipoPlugin, String className) throws DriverConfigurazioneException {
  634.         Connection con = null;
  635.         String nomeMetodo = "existsPluginConClassName";
  636.         DriverControlStationDB driver = null;

  637.         try {
  638.             // prendo una connessione
  639.             con = ControlStationCore.dbM.getConnection();
  640.             // istanzio il driver
  641.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  642.             return driver.existsPluginConClassName(tipoPlugin, className);
  643.         } catch (Exception e) {
  644.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  645.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  646.         } finally {
  647.             ControlStationCore.dbM.releaseConnection(con);
  648.         }
  649.     }
  650.    
  651.     public Plugin getPlugin(long idPlugin) throws DriverConfigurazioneException {
  652.         Connection con = null;
  653.         String nomeMetodo = "getPlugin";
  654.         DriverControlStationDB driver = null;

  655.         try {
  656.             // prendo una connessione
  657.             con = ControlStationCore.dbM.getConnection();
  658.             // istanzio il driver
  659.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  660.             return driver.getPlugin(idPlugin);  
  661.         } catch (Exception e) {
  662.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  663.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  664.         } finally {
  665.             ControlStationCore.dbM.releaseConnection(con);
  666.         }
  667.     }
  668.    
  669.     public Plugin getPlugin(TipoPlugin tipoPlugin, String tipo, boolean throwNotFound) throws DriverConfigurazioneException {
  670.         Connection con = null;
  671.         String nomeMetodo = "getPlugin";
  672.         DriverControlStationDB driver = null;

  673.         try {
  674.             // prendo una connessione
  675.             con = ControlStationCore.dbM.getConnection();
  676.             // istanzio il driver
  677.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  678.             return driver.getPlugin(tipoPlugin,tipo, throwNotFound);  
  679.         } catch (Exception e) {
  680.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  681.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  682.         } finally {
  683.             ControlStationCore.dbM.releaseConnection(con);
  684.         }
  685.     }
  686.    
  687.     public boolean isPluginInUso(String className, String label, String tipoPlugin, String tipo, Map<ErrorsHandlerCostant, List<String>> whereIsInUso, boolean normalizeObjectIds) throws DriverConfigurazioneException {
  688.         Connection con = null;
  689.         String nomeMetodo = "isPluginInUso";
  690.         DriverControlStationDB driver = null;

  691.         try {
  692.             // prendo una connessione
  693.             con = ControlStationCore.dbM.getConnection();
  694.             // istanzio il driver
  695.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  696.             return driver.isPluginInUso(className, label, tipoPlugin, tipo, whereIsInUso, normalizeObjectIds);

  697.         } catch (Exception e) {
  698.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  699.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  700.         } finally {
  701.             ControlStationCore.dbM.releaseConnection(con);
  702.         }

  703.     }
  704.    
  705.     public int numeroHandlersRichiesta(String tipologia, TipoPdD ruoloPorta, Long idPorta) throws DriverConfigurazioneException {
  706.         Connection con = null;
  707.         String nomeMetodo = "numeroHandlersRichiestaList";
  708.         DriverControlStationDB driver = null;

  709.         try {
  710.             // prendo una connessione
  711.             con = ControlStationCore.dbM.getConnection();
  712.             // istanzio il driver
  713.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  714.             return driver.numeroHandlersRichiestaList(getTipologiaFromFaseMessageHandler(tipologia, true), ruoloPorta, idPorta);
  715.         } catch (Exception e) {
  716.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  717.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  718.         } finally {
  719.             ControlStationCore.dbM.releaseConnection(con);
  720.         }
  721.     }
  722.    
  723.     public int numeroHandlersRisposta(String tipologia, TipoPdD ruoloPorta, Long idPorta) throws DriverConfigurazioneException {
  724.         Connection con = null;
  725.         String nomeMetodo = "numeroHandlersRispostaList";
  726.         DriverControlStationDB driver = null;

  727.         try {
  728.             // prendo una connessione
  729.             con = ControlStationCore.dbM.getConnection();
  730.             // istanzio il driver
  731.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  732.             return driver.numeroHandlersRispostaList(getTipologiaFromFaseMessageHandler(tipologia, false), ruoloPorta, idPorta);
  733.         } catch (Exception e) {
  734.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  735.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  736.         } finally {
  737.             ControlStationCore.dbM.releaseConnection(con);
  738.         }
  739.     }
  740.    
  741.     public int numeroHandlersServizio(String tipologia) throws DriverConfigurazioneException {
  742.         Connection con = null;
  743.         String nomeMetodo = "numeroHandlersServizioList";
  744.         DriverControlStationDB driver = null;

  745.         try {
  746.             // prendo una connessione
  747.             con = ControlStationCore.dbM.getConnection();
  748.             // istanzio il driver
  749.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  750.             return driver.numeroHandlersServizioList(getTipologiaFromFaseServiceHandler(tipologia), null, null);
  751.         } catch (Exception e) {
  752.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  753.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  754.         } finally {
  755.             ControlStationCore.dbM.releaseConnection(con);
  756.         }
  757.     }
  758.    
  759.     public List<ConfigurazioneHandlerBean> handlersRichiestaList(ISearch ricerca, String tipologia, TipoPdD ruoloPorta, Long idPorta) throws DriverConfigurazioneException {
  760.         Connection con = null;
  761.         String nomeMetodo = "handlersRichiestaList";
  762.         DriverControlStationDB driver = null;

  763.         try {
  764.             // prendo una connessione
  765.             con = ControlStationCore.dbM.getConnection();
  766.             // istanzio il driver
  767.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  768.             return driver.handlersRichiestaList(ricerca, getTipologiaFromFaseMessageHandler(tipologia, true), ruoloPorta, idPorta);
  769.         } catch (Exception e) {
  770.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  771.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  772.         } finally {
  773.             ControlStationCore.dbM.releaseConnection(con);
  774.         }
  775.     }
  776.    
  777.     public List<ConfigurazioneHandlerBean> handlersRispostaList(ISearch ricerca, String tipologia, TipoPdD ruoloPorta, Long idPorta) throws DriverConfigurazioneException {
  778.         Connection con = null;
  779.         String nomeMetodo = "handlersRispostaList";
  780.         DriverControlStationDB driver = null;

  781.         try {
  782.             // prendo una connessione
  783.             con = ControlStationCore.dbM.getConnection();
  784.             // istanzio il driver
  785.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  786.             return driver.handlersRispostaList(ricerca, getTipologiaFromFaseMessageHandler(tipologia, false), ruoloPorta, idPorta);
  787.         } catch (Exception e) {
  788.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  789.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  790.         } finally {
  791.             ControlStationCore.dbM.releaseConnection(con);
  792.         }
  793.     }
  794.    
  795.     public List<ConfigurazioneHandlerBean> handlersServizioList(ISearch ricerca, String tipologia) throws DriverConfigurazioneException {
  796.         Connection con = null;
  797.         String nomeMetodo = "handlersServizioList";
  798.         DriverControlStationDB driver = null;

  799.         try {
  800.             // prendo una connessione
  801.             con = ControlStationCore.dbM.getConnection();
  802.             // istanzio il driver
  803.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  804.             return driver.handlersServizioList(ricerca, getTipologiaFromFaseServiceHandler(tipologia), null, null);
  805.         } catch (Exception e) {
  806.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  807.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  808.         } finally {
  809.             ControlStationCore.dbM.releaseConnection(con);
  810.         }
  811.     }
  812.    
  813.     public int getMaxPosizioneHandlersRichiesta(String tipologia, TipoPdD ruoloPorta, Long idPorta) throws DriverConfigurazioneException {
  814.         Connection con = null;
  815.         String nomeMetodo = "getMaxPosizioneHandlersRichiesta";
  816.         DriverControlStationDB driver = null;

  817.         try {
  818.             // prendo una connessione
  819.             con = ControlStationCore.dbM.getConnection();
  820.             // istanzio il driver
  821.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  822.             return driver.getMaxPosizioneHandlersRichiesta(getTipologiaFromFaseMessageHandler(tipologia, true), ruoloPorta, idPorta);
  823.         } catch (Exception e) {
  824.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  825.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  826.         } finally {
  827.             ControlStationCore.dbM.releaseConnection(con);
  828.         }
  829.     }
  830.    
  831.     public int getMaxPosizioneHandlersRisposta(String tipologia, TipoPdD ruoloPorta, Long idPorta) throws DriverConfigurazioneException {
  832.         Connection con = null;
  833.         String nomeMetodo = "getMaxPosizioneHandlersRisposta";
  834.         DriverControlStationDB driver = null;

  835.         try {
  836.             // prendo una connessione
  837.             con = ControlStationCore.dbM.getConnection();
  838.             // istanzio il driver
  839.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  840.             return driver.getMaxPosizioneHandlersRisposta(getTipologiaFromFaseMessageHandler(tipologia, false), ruoloPorta, idPorta);
  841.         } catch (Exception e) {
  842.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  843.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  844.         } finally {
  845.             ControlStationCore.dbM.releaseConnection(con);
  846.         }
  847.     }
  848.    
  849.     public int getMaxPosizioneHandlersServizio(String tipologia) throws DriverConfigurazioneException {
  850.         Connection con = null;
  851.         String nomeMetodo = "getMaxPosizioneHandlersServizio";
  852.         DriverControlStationDB driver = null;

  853.         try {
  854.             // prendo una connessione
  855.             con = ControlStationCore.dbM.getConnection();
  856.             // istanzio il driver
  857.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  858.             return driver.getMaxPosizioneHandlersServizio(getTipologiaFromFaseServiceHandler(tipologia), null, null);
  859.         } catch (Exception e) {
  860.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  861.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  862.         } finally {
  863.             ControlStationCore.dbM.releaseConnection(con);
  864.         }
  865.     }
  866.    
  867.     public boolean existsHandlerRichiesta(String tipologia, TipoPdD ruoloPorta, Long idPorta, String tipo) throws DriverConfigurazioneException {
  868.         Connection con = null;
  869.         String nomeMetodo = "existsHandlerRichiesta";
  870.         DriverControlStationDB driver = null;

  871.         try {
  872.             // prendo una connessione
  873.             con = ControlStationCore.dbM.getConnection();
  874.             // istanzio il driver
  875.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  876.             return driver.existsHandlerRichiesta(getTipologiaFromFaseMessageHandler(tipologia, true), ruoloPorta, idPorta, tipo);
  877.         } catch (Exception e) {
  878.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  879.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  880.         } finally {
  881.             ControlStationCore.dbM.releaseConnection(con);
  882.         }
  883.     }
  884.    
  885.     public boolean existsHandlerRisposta(String tipologia, TipoPdD ruoloPorta, Long idPorta, String tipo) throws DriverConfigurazioneException {
  886.         Connection con = null;
  887.         String nomeMetodo = "existsHandlerRisposta";
  888.         DriverControlStationDB driver = null;

  889.         try {
  890.             // prendo una connessione
  891.             con = ControlStationCore.dbM.getConnection();
  892.             // istanzio il driver
  893.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  894.             return driver.existsHandlerRisposta(getTipologiaFromFaseMessageHandler(tipologia, false), ruoloPorta, idPorta, tipo);
  895.         } catch (Exception e) {
  896.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  897.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  898.         } finally {
  899.             ControlStationCore.dbM.releaseConnection(con);
  900.         }
  901.     }
  902.    
  903.     public boolean existsHandlerServizio(String tipologia, String tipo) throws DriverConfigurazioneException {
  904.         Connection con = null;
  905.         String nomeMetodo = "existsHandlerServizio";
  906.         DriverControlStationDB driver = null;

  907.         try {
  908.             // prendo una connessione
  909.             con = ControlStationCore.dbM.getConnection();
  910.             // istanzio il driver
  911.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  912.             return driver.existsHandlerServizio(getTipologiaFromFaseServiceHandler(tipologia), null, null, tipo);
  913.         } catch (Exception e) {
  914.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  915.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  916.         } finally {
  917.             ControlStationCore.dbM.releaseConnection(con);
  918.         }
  919.     }
  920.    
  921.     public ConfigurazioneHandlerBean getHandlerRichiesta(String tipologia, TipoPdD ruoloPorta, Long idPorta, Long idHandler) throws DriverConfigurazioneException {
  922.         Connection con = null;
  923.         String nomeMetodo = "getHandlerRichiesta";
  924.         DriverControlStationDB driver = null;

  925.         try {
  926.             // prendo una connessione
  927.             con = ControlStationCore.dbM.getConnection();
  928.             // istanzio il driver
  929.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  930.             return driver.getHandlerRichiesta(getTipologiaFromFaseMessageHandler(tipologia, true), ruoloPorta, idPorta, idHandler);
  931.         } catch (Exception e) {
  932.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  933.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  934.         } finally {
  935.             ControlStationCore.dbM.releaseConnection(con);
  936.         }
  937.     }
  938.    
  939.     public ConfigurazioneHandlerBean getHandlerRisposta(String tipologia, TipoPdD ruoloPorta, Long idPorta, Long idHandler) throws DriverConfigurazioneException {
  940.         Connection con = null;
  941.         String nomeMetodo = "getHandlerRisposta";
  942.         DriverControlStationDB driver = null;

  943.         try {
  944.             // prendo una connessione
  945.             con = ControlStationCore.dbM.getConnection();
  946.             // istanzio il driver
  947.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  948.             return driver.getHandlerRisposta(getTipologiaFromFaseMessageHandler(tipologia, false), ruoloPorta, idPorta, idHandler);
  949.         } catch (Exception e) {
  950.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  951.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  952.         } finally {
  953.             ControlStationCore.dbM.releaseConnection(con);
  954.         }
  955.     }
  956.    
  957.     public ConfigurazioneHandlerBean getHandlerServizio(String tipologia, Long idHandler) throws DriverConfigurazioneException {
  958.         Connection con = null;
  959.         String nomeMetodo = "getHandlerServizio";
  960.         DriverControlStationDB driver = null;

  961.         try {
  962.             // prendo una connessione
  963.             con = ControlStationCore.dbM.getConnection();
  964.             // istanzio il driver
  965.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  966.             return driver.getHandlerServizio(getTipologiaFromFaseServiceHandler(tipologia), null, null, idHandler);
  967.         } catch (Exception e) {
  968.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  969.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  970.         } finally {
  971.             ControlStationCore.dbM.releaseConnection(con);
  972.         }
  973.     }
  974.    
  975.     private String getTipologiaFromFaseMessageHandler(String fase, boolean request) {
  976.         if(fase != null) {
  977.             return getTipologiaFromFaseMessageHandler(FaseMessageHandler.toEnumConstant(fase), request);
  978.         }
  979.         return null;
  980.     }
  981.     private String getTipologiaFromFaseMessageHandler(FaseMessageHandler fase, boolean request) {
  982.         if(fase != null) {
  983.             String suffix = request ? CostantiDB.HANDLER_REQUEST_SUFFIX : CostantiDB.HANDLER_RESPONSE_SUFFIX;
  984.             switch (fase) {
  985.             case IN:
  986.                 return CostantiDB.HANDLER_IN+suffix;
  987.             case IN_PROTOCOL_INFO:
  988.                 return CostantiDB.HANDLER_IN_PROTOCOL+suffix;
  989.             case OUT:
  990.                 return CostantiDB.HANDLER_OUT+suffix;
  991.             case POST_OUT:
  992.                 return CostantiDB.HANDLER_POST_OUT+suffix;
  993.             case PRE_IN:
  994.                 return CostantiDB.HANDLER_PRE_IN+suffix;
  995.             }
  996.         }
  997.        
  998.         return null;
  999.     }
  1000.    
  1001.     private String getTipologiaFromFaseServiceHandler(String fase) {
  1002.         if(fase != null) {
  1003.             return getTipologiaFromFaseServiceHandler(FaseServiceHandler.toEnumConstant(fase));
  1004.         }
  1005.         return null;
  1006.     }
  1007.     private String getTipologiaFromFaseServiceHandler(FaseServiceHandler fase) {
  1008.         if(fase != null) {
  1009.             switch (fase) {
  1010.             case EXIT:
  1011.                 return CostantiDB.HANDLER_EXIT;
  1012.             case INIT:
  1013.                 return CostantiDB.HANDLER_INIT;
  1014.             case INTEGRATION_MANAGER_REQUEST:
  1015.                 return CostantiDB.HANDLER_INTEGRATION_MANAGER_REQUEST;
  1016.             case INTEGRATION_MANAGER_RESPONSE:
  1017.                 return CostantiDB.HANDLER_INTEGRATION_MANAGER_RESPONSE;
  1018.             }
  1019.         }
  1020.        
  1021.         return null;
  1022.     }
  1023.        
  1024.     /**
  1025.      * Restituisce la gestione dell'errore di default definita nella Porta di
  1026.      * Dominio per il componente di cooperazione
  1027.      *
  1028.      * @return La gestione dell'errore
  1029.      *
  1030.      */
  1031.     public GestioneErrore getGestioneErroreComponenteCooperazione() throws DriverConfigurazioneException, DriverConfigurazioneNotFound {
  1032.         return this.getGestioneErrore(true);
  1033.     }

  1034.     /**
  1035.      * Restituisce la gestione dell'errore di default definita nella Porta di
  1036.      * Dominio per il componente di integrazione
  1037.      *
  1038.      * @return La gestione dell'errore
  1039.      *
  1040.      */
  1041.     public GestioneErrore getGestioneErroreComponenteIntegrazione() throws DriverConfigurazioneException, DriverConfigurazioneNotFound {
  1042.         return this.getGestioneErrore(false);
  1043.     }

  1044.     private GestioneErrore getGestioneErrore(boolean cooperazione) throws DriverConfigurazioneException, DriverConfigurazioneNotFound {
  1045.         Connection con = null;
  1046.         String nomeMetodo = "getGestioneErrore";
  1047.         DriverControlStationDB driver = null;

  1048.         try {
  1049.             // prendo una connessione
  1050.             con = ControlStationCore.dbM.getConnection();
  1051.             // istanzio il driver
  1052.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1053.             if (cooperazione)
  1054.                 return driver.getDriverConfigurazioneDB().getGestioneErroreComponenteCooperazione();
  1055.             else
  1056.                 return driver.getDriverConfigurazioneDB().getGestioneErroreComponenteIntegrazione();

  1057.         } catch (DriverConfigurazioneNotFound de) {
  1058.             ControlStationCore.logError(getPrefixError(nomeMetodo,  de),de);
  1059.             throw de;
  1060.         } catch (Exception e) {
  1061.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1062.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1063.         } finally {
  1064.             ControlStationCore.dbM.releaseConnection(con);
  1065.         }

  1066.     }
  1067.    
  1068.     public AccessoRegistro getAccessoRegistro() throws DriverConfigurazioneNotFound, DriverConfigurazioneException {
  1069.         Connection con = null;
  1070.         String nomeMetodo = "getAccessoRegistro";
  1071.         DriverControlStationDB driver = null;

  1072.         try {
  1073.             // prendo una connessione
  1074.             con = ControlStationCore.dbM.getConnection();
  1075.             // istanzio il driver
  1076.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1077.             return driver.getDriverConfigurazioneDB().getAccessoRegistro();

  1078.         } catch (DriverConfigurazioneNotFound de) {
  1079.             ControlStationCore.logError(getPrefixError(nomeMetodo,  de),de);
  1080.             throw de;
  1081.         } catch (Exception e) {
  1082.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1083.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1084.         } finally {
  1085.             ControlStationCore.dbM.releaseConnection(con);
  1086.         }

  1087.     }
  1088.    
  1089.     public AccessoConfigurazione getAccessoConfigurazione() throws DriverConfigurazioneNotFound, DriverConfigurazioneException {
  1090.         Connection con = null;
  1091.         String nomeMetodo = "getAccessoConfigurazione";
  1092.         DriverControlStationDB driver = null;

  1093.         try {
  1094.             // prendo una connessione
  1095.             con = ControlStationCore.dbM.getConnection();
  1096.             // istanzio il driver
  1097.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1098.             return driver.getDriverConfigurazioneDB().getAccessoConfigurazione();

  1099.         } catch (DriverConfigurazioneNotFound de) {
  1100.             ControlStationCore.logError(getPrefixError(nomeMetodo,  de),de);
  1101.             throw de;
  1102.         } catch (Exception e) {
  1103.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1104.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1105.         } finally {
  1106.             ControlStationCore.dbM.releaseConnection(con);
  1107.         }

  1108.     }
  1109.    
  1110.     public AccessoDatiAutorizzazione getAccessoDatiAutorizzazione() throws DriverConfigurazioneNotFound, DriverConfigurazioneException {
  1111.         Connection con = null;
  1112.         String nomeMetodo = "getAccessoDatiAutorizzazione";
  1113.         DriverControlStationDB driver = null;

  1114.         try {
  1115.             // prendo una connessione
  1116.             con = ControlStationCore.dbM.getConnection();
  1117.             // istanzio il driver
  1118.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1119.             return driver.getDriverConfigurazioneDB().getAccessoDatiAutorizzazione();

  1120.         } catch (DriverConfigurazioneNotFound de) {
  1121.             ControlStationCore.logError(getPrefixError(nomeMetodo,  de),de);
  1122.             throw de;
  1123.         } catch (Exception e) {
  1124.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1125.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1126.         } finally {
  1127.             ControlStationCore.dbM.releaseConnection(con);
  1128.         }

  1129.     }
  1130.    
  1131.     public SystemProperties getSystemPropertiesPdD() throws DriverConfigurazioneNotFound, DriverConfigurazioneException {
  1132.         Connection con = null;
  1133.         String nomeMetodo = "getSystemPropertiesPdD";
  1134.         DriverControlStationDB driver = null;

  1135.         try {
  1136.             // prendo una connessione
  1137.             con = ControlStationCore.dbM.getConnection();
  1138.             // istanzio il driver
  1139.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1140.             return driver.getDriverConfigurazioneDB().getSystemPropertiesPdD();

  1141.         } catch (DriverConfigurazioneNotFound de) {
  1142.             return new SystemProperties();
  1143.         } catch (Exception e) {
  1144.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1145.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1146.         } finally {
  1147.             ControlStationCore.dbM.releaseConnection(con);
  1148.         }

  1149.     }
  1150.    
  1151.     public List<Property> systemPropertyList(ISearch ricerca) throws DriverConfigurazioneException {
  1152.         Connection con = null;
  1153.         String nomeMetodo = "systemPropertyList";
  1154.         DriverControlStationDB driver = null;

  1155.         try {
  1156.             // prendo una connessione
  1157.             con = ControlStationCore.dbM.getConnection();
  1158.             // istanzio il driver
  1159.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1160.             return driver.getDriverConfigurazioneDB().systemPropertyList(ricerca);

  1161.         }
  1162.         catch (Exception e) {
  1163.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1164.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1165.         } finally {
  1166.             ControlStationCore.dbM.releaseConnection(con);
  1167.         }
  1168.     }
  1169.    
  1170.     public RoutingTable getRoutingTable() throws DriverConfigurazioneException {
  1171.         Connection con = null;
  1172.         String nomeMetodo = "getRoutingTable";
  1173.         DriverControlStationDB driver = null;

  1174.         try {
  1175.             // prendo una connessione
  1176.             con = ControlStationCore.dbM.getConnection();
  1177.             // istanzio il driver
  1178.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1179.             return driver.getDriverConfigurazioneDB().getRoutingTable();
  1180.         } catch (Exception e) {
  1181.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1182.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1183.         } finally {
  1184.             ControlStationCore.dbM.releaseConnection(con);
  1185.         }

  1186.     }
  1187.    
  1188.    
  1189.     public List<Filtro> filtriList(ISearch ricerca) throws AuditException {
  1190.         Connection con = null;
  1191.         String nomeMetodo = "filtriList";
  1192.         DriverAudit driver = null;

  1193.         try {
  1194.             // prendo una connessione
  1195.             con = ControlStationCore.dbM.getConnection();
  1196.             // istanzio il driver
  1197.             driver = new DriverAudit(con, this.tipoDB);
  1198.             return driver.filtriList(ricerca, Liste.FILTRI);
  1199.         } catch (Exception e) {
  1200.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1201.             throw new AuditException(getPrefixError(nomeMetodo,  e),e);
  1202.         } finally {
  1203.             ControlStationCore.dbM.releaseConnection(con);
  1204.         }
  1205.     }

  1206.     public Filtro getFiltro(long idFiltro) throws AuditException {
  1207.         Connection con = null;
  1208.         String nomeMetodo = "getFiltro";
  1209.         DriverAudit driver = null;

  1210.         try {
  1211.             // prendo una connessione
  1212.             con = ControlStationCore.dbM.getConnection();
  1213.             // istanzio il driver
  1214.             driver = new DriverAudit(con, this.tipoDB);
  1215.             return driver.getFiltro(idFiltro);
  1216.         } catch (Exception e) {
  1217.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1218.             throw new AuditException(getPrefixError(nomeMetodo,  e),e);
  1219.         } finally {
  1220.             ControlStationCore.dbM.releaseConnection(con);
  1221.         }
  1222.     }
  1223.    
  1224.    
  1225.     public UrlInvocazioneAPI getConfigurazioneUrlInvocazione(String protocollo,
  1226.             RuoloContesto ruolo, ServiceBinding serviceBinding, String interfaceName, IDSoggetto soggettoOperativo,
  1227.             AccordoServizioParteComuneSintetico aspc, String canalePorta, boolean analizeProxyPassRules) throws DriverConfigurazioneException, DriverConfigurazioneNotFound, ProtocolException  {
  1228.        
  1229.         IProtocolFactory<?>protocolFactory = ProtocolFactoryManager.getInstance().getProtocolFactoryByName(protocollo);
  1230.        
  1231.         Configurazione config = this.getConfigurazioneGenerale();
  1232.        
  1233.         ConfigurazioneUrlInvocazione configurazioneUrlInvocazione = null;
  1234.         if(config!=null && config.getUrlInvocazione()!=null) {
  1235.             configurazioneUrlInvocazione = config.getUrlInvocazione();
  1236.         }
  1237.        
  1238.         List<String> tags = new ArrayList<>();
  1239.         if(aspc!=null && aspc.getGruppo()!=null && !aspc.getGruppo().isEmpty()) {
  1240.             for (int i = 0; i < aspc.getGruppo().size(); i++) {
  1241.                 tags.add(aspc.getGruppo().get(i).getNome());
  1242.             }
  1243.         }
  1244.        
  1245.         String canaleApi = null;
  1246.         if(aspc!=null) {
  1247.             canaleApi = aspc.getCanale();
  1248.         }
  1249.         String canale = CanaliUtils.getCanale(config!=null ? config.getGestioneCanali() : null, canaleApi, canalePorta);
  1250.        
  1251.         return UrlInvocazioneAPI.getConfigurazioneUrlInvocazione(configurazioneUrlInvocazione, protocolFactory, ruolo, serviceBinding, interfaceName, soggettoOperativo,
  1252.                 tags, canale, analizeProxyPassRules);

  1253.     }
  1254.    
  1255.    
  1256.     /**
  1257.      * Accesso alla configurazione di controllo del traffico
  1258.      *
  1259.      * @return configurazione controllo del traffico della Pdd
  1260.      * @throws DriverControlStationNotFound
  1261.      * @throws DriverControlStationException
  1262.      */
  1263.     public ConfigurazioneGenerale getConfigurazioneControlloTraffico() throws DriverControlStationNotFound, DriverControlStationException {
  1264.         Connection con = null;
  1265.         String nomeMetodo = "getConfigurazioneControlloTraffico";
  1266.         DriverControlStationDB driver = null;

  1267.         try {
  1268.             // prendo una connessione
  1269.             con = ControlStationCore.dbM.getConnection();
  1270.             // istanzio il driver
  1271.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1272.            
  1273.             return driver.getConfigurazioneControlloTraffico();
  1274.            
  1275.         } catch (DriverControlStationNotFound de) {
  1276.             ControlStationCore.logError(getPrefixError(nomeMetodo,  de),de);
  1277.             throw de;
  1278.         } catch (Exception e) {
  1279.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1280.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1281.         } finally {
  1282.             ControlStationCore.dbM.releaseConnection(con);
  1283.         }

  1284.     }
  1285.    
  1286.     public PolicyConfiguration getConfigurazioneControlloTrafficoRateLimitingProperties() throws DriverControlStationNotFound, DriverControlStationException {
  1287.         Connection con = null;
  1288.         String nomeMetodo = "getConfigurazioneControlloTrafficoRateLimitingProperties";
  1289.         DriverControlStationDB driver = null;

  1290.         try {
  1291.             // prendo una connessione
  1292.             con = ControlStationCore.dbM.getConnection();
  1293.             // istanzio il driver
  1294.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1295.            
  1296.             List<Proprieta> l = driver.getProprietaRateLimiting();
  1297.             return new PolicyConfiguration(l, this.getControlloTrafficoPolicyRateLimitingTipiGestori(), false);
  1298.            
  1299.         } catch (DriverControlStationNotFound de) {
  1300.             ControlStationCore.logError(getPrefixError(nomeMetodo,  de),de);
  1301.             throw de;
  1302.         } catch (Exception e) {
  1303.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1304.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1305.         } finally {
  1306.             ControlStationCore.dbM.releaseConnection(con);
  1307.         }

  1308.     }
  1309.    
  1310.     public long countConfigurazionePolicy(ConsoleSearch ricerca)  throws DriverControlStationException {
  1311.         String nomeMetodo = "countConfigurazionePolicy";
  1312.         Connection con = null;
  1313.         DriverControlStationDB driver = null;
  1314.         try {
  1315.             // prendo una connessione
  1316.             con = ControlStationCore.dbM.getConnection();
  1317.            
  1318.             // istanzio il driver
  1319.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1320.            
  1321.             return driver.countConfigurazioneControlloTrafficoConfigurazionePolicy(ricerca);
  1322.         } catch (Exception e) {
  1323.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1324.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1325.         }finally{
  1326.             ControlStationCore.dbM.releaseConnection(con);
  1327.         }
  1328.     }
  1329.    
  1330.     public long countAttivazionePolicy(ConsoleSearch ricerca, RuoloPolicy ruoloPorta, String nomePorta)  throws DriverControlStationException{
  1331.         String nomeMetodo = "countAttivazionePolicy";
  1332.         Connection con = null;
  1333.         DriverControlStationDB driver = null;
  1334.         try {
  1335.             // prendo una connessione
  1336.             con = ControlStationCore.dbM.getConnection();
  1337.            
  1338.             // istanzio il driver
  1339.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1340.            
  1341.             return driver.countConfigurazioneControlloTrafficoAttivazionePolicy(ricerca, ruoloPorta, nomePorta);
  1342.         } catch (Exception e) {
  1343.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1344.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1345.         }finally{
  1346.             ControlStationCore.dbM.releaseConnection(con);
  1347.         }
  1348.     }
  1349.    
  1350.     public List<ConfigurazionePolicy> configurazionePolicyList(ConsoleSearch ricerca)  throws DriverControlStationException{
  1351.         String nomeMetodo = "configurazionePolicyList";
  1352.         Connection con = null;
  1353.         DriverControlStationDB driver = null;
  1354.         try {
  1355.             // prendo una connessione
  1356.             con = ControlStationCore.dbM.getConnection();
  1357.            
  1358.             // istanzio il driver
  1359.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1360.            
  1361.             return driver.configurazioneControlloTrafficoConfigurazionePolicyList(ricerca);
  1362.         } catch (Exception e) {
  1363.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1364.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1365.         }finally{
  1366.             ControlStationCore.dbM.releaseConnection(con);
  1367.         }
  1368.     }
  1369.    
  1370.     public List<ConfigurazionePolicy> configurazioneControlloTrafficoConfigurazionePolicyListConApplicabilitaAllarme(String idAllarme) throws DriverControlStationException{
  1371.         String nomeMetodo = "configurazioneControlloTrafficoConfigurazionePolicyListConApplicabilitaAllarme";
  1372.         Connection con = null;
  1373.         DriverControlStationDB driver = null;
  1374.         try {
  1375.             // prendo una connessione
  1376.             con = ControlStationCore.dbM.getConnection();
  1377.            
  1378.             // istanzio il driver
  1379.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1380.            
  1381.             return driver.configurazioneControlloTrafficoConfigurazionePolicyList_conApplicabilitaAllarme(idAllarme);
  1382.         } catch (Exception e) {
  1383.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1384.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1385.         }finally{
  1386.             ControlStationCore.dbM.releaseConnection(con);
  1387.         }
  1388.     }
  1389.    
  1390.     public List<TipoRisorsaPolicyAttiva> attivazionePolicyTipoRisorsaList(ConsoleSearch ricerca, RuoloPolicy ruoloPorta, String nomePorta)  throws DriverControlStationException{
  1391.         String nomeMetodo = "attivazionePolicyTipoRisorsaList";
  1392.         Connection con = null;
  1393.         DriverControlStationDB driver = null;
  1394.         try {
  1395.             // prendo una connessione
  1396.             con = ControlStationCore.dbM.getConnection();
  1397.            
  1398.             // istanzio il driver
  1399.             driver = new DriverControlStationDB(con, null, this.tipoDB);    
  1400.            
  1401.             return driver.configurazioneControlloTrafficoAttivazionePolicyTipoRisorsaList(ricerca, ruoloPorta, nomePorta);
  1402.         } catch (Exception e) {
  1403.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1404.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1405.         }finally{
  1406.             ControlStationCore.dbM.releaseConnection(con);
  1407.         }
  1408.     }
  1409.    
  1410.     public void updatePosizioneAttivazionePolicy(InfoPolicy infoPolicy, AttivazionePolicy policy,
  1411.             RuoloPolicy ruoloPorta, String nomePorta) throws DriverControlStationException{
  1412.         String nomeMetodo = "updatePosizioneAttivazionePolicy";
  1413.         Connection con = null;
  1414.         DriverControlStationDB driver = null;
  1415.         try {
  1416.             // prendo una connessione
  1417.             con = ControlStationCore.dbM.getConnection();
  1418.            
  1419.             // istanzio il driver
  1420.             driver = new DriverControlStationDB(con, null, this.tipoDB);    
  1421.            
  1422.             driver.updatePosizioneAttivazionePolicy(infoPolicy, policy,
  1423.                     ruoloPorta, nomePorta);
  1424.         } catch (Exception e) {
  1425.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1426.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1427.         }finally{
  1428.             ControlStationCore.dbM.releaseConnection(con);
  1429.         }
  1430.     }
  1431.    
  1432.     public List<AttivazionePolicy> attivazionePolicyList(ConsoleSearch ricerca, RuoloPolicy ruoloPorta, String nomePorta)  throws DriverControlStationException{
  1433.         String nomeMetodo = "attivazionePolicyList";
  1434.         Connection con = null;
  1435.         DriverControlStationDB driver = null;
  1436.         try {
  1437.             // prendo una connessione
  1438.             con = ControlStationCore.dbM.getConnection();
  1439.            
  1440.             // istanzio il driver
  1441.             driver = new DriverControlStationDB(con, null, this.tipoDB);    
  1442.            
  1443.             return driver.configurazioneControlloTrafficoAttivazionePolicyList(ricerca, ruoloPorta, nomePorta);
  1444.         } catch (Exception e) {
  1445.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1446.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1447.         }finally{
  1448.             ControlStationCore.dbM.releaseConnection(con);
  1449.         }
  1450.     }

  1451.     public List<AttivazionePolicy> attivazionePolicyListByFilter(ConsoleSearch ricerca, RuoloPolicy ruoloPorta, String nomePorta,
  1452.             IDSoggetto filtroSoggettoFruitore, IDServizioApplicativo filtroApplicativoFruitore,String filtroRuoloFruitore,
  1453.             IDSoggetto filtroSoggettoErogatore, String filtroRuoloErogatore,
  1454.             IDServizio filtroServizioAzione, String filtroRuolo)  throws DriverControlStationException{
  1455.         String nomeMetodo = "attivazionePolicyListByFilter";
  1456.         Connection con = null;
  1457.         DriverControlStationDB driver = null;
  1458.         try {
  1459.             // prendo una connessione
  1460.             con = ControlStationCore.dbM.getConnection();
  1461.            
  1462.             // istanzio il driver
  1463.             driver = new DriverControlStationDB(con, null, this.tipoDB);    
  1464.            
  1465.             return driver.configurazioneControlloTrafficoAttivazionePolicyListByFilter(ricerca, ruoloPorta, nomePorta,
  1466.                     filtroSoggettoFruitore, filtroApplicativoFruitore, filtroRuoloFruitore,
  1467.                     filtroSoggettoErogatore, filtroRuoloErogatore,
  1468.                     filtroServizioAzione, filtroRuolo);
  1469.         } catch (Exception e) {
  1470.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1471.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1472.         }finally{
  1473.             ControlStationCore.dbM.releaseConnection(con);
  1474.         }
  1475.     }
  1476.    
  1477.     public AttivazionePolicy getAttivazionePolicy(String alias, RuoloPolicy ruoloPorta, String nomePorta)  throws DriverControlStationException, DriverControlStationNotFound{
  1478.         String nomeMetodo = "getAttivazionePolicy(alias,ruoloPorta,nomePorta)";
  1479.         Connection con = null;
  1480.         DriverControlStationDB driver = null;
  1481.         try {
  1482.             // prendo una connessione
  1483.             con = ControlStationCore.dbM.getConnection();
  1484.            
  1485.             // istanzio il driver
  1486.             driver = new DriverControlStationDB(con, null, this.tipoDB);    
  1487.            
  1488.             return driver.getAttivazionePolicy(alias, ruoloPorta, nomePorta);
  1489.         } catch(NotFoundException notFound) {
  1490.             throw new DriverControlStationNotFound(notFound.getMessage(),notFound);
  1491.         } catch (Exception e) {
  1492.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1493.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1494.         }finally{
  1495.             ControlStationCore.dbM.releaseConnection(con);
  1496.         }
  1497.     }
  1498.    
  1499.     public boolean usedInConfigurazioneControlloTrafficoAttivazionePolicy(RuoloPolicy ruoloPorta, String nomePorta, String azione)  throws DriverControlStationException{
  1500.         String nomeMetodo = "usedInConfigurazioneControlloTrafficoAttivazionePolicy";
  1501.         Connection con = null;
  1502.         DriverControlStationDB driver = null;
  1503.         try {
  1504.             // prendo una connessione
  1505.             con = ControlStationCore.dbM.getConnection();
  1506.            
  1507.             // istanzio il driver
  1508.             driver = new DriverControlStationDB(con, null, this.tipoDB);    
  1509.            
  1510.             return driver.usedInConfigurazioneControlloTrafficoAttivazionePolicy(ruoloPorta, nomePorta, azione);
  1511.         } catch (Exception e) {
  1512.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1513.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1514.         }finally{
  1515.             ControlStationCore.dbM.releaseConnection(con);
  1516.         }
  1517.     }
  1518.    
  1519.     public List<InfoPolicy> infoPolicyList(Boolean builtIn)  throws DriverControlStationException{
  1520.         String nomeMetodo = "infoPolicyList";
  1521.         Connection con = null;
  1522.         DriverControlStationDB driver = null;
  1523.         try {
  1524.             // prendo una connessione
  1525.             con = ControlStationCore.dbM.getConnection();
  1526.            
  1527.             // istanzio il driver
  1528.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1529.            
  1530.             return driver.getInfoPolicyList(builtIn, null);
  1531.         } catch (Exception e) {
  1532.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1533.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1534.         }finally{
  1535.             ControlStationCore.dbM.releaseConnection(con);
  1536.         }
  1537.     }
  1538.    
  1539.     public InfoPolicy getInfoPolicy(String idPolicyParam)  throws DriverControlStationException{
  1540.         String nomeMetodo = "getInfoPolicy";
  1541.         Connection con = null;
  1542.         DriverControlStationDB driver = null;
  1543.         try {
  1544.             // prendo una connessione
  1545.             con = ControlStationCore.dbM.getConnection();
  1546.            
  1547.             // istanzio il driver
  1548.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1549.            
  1550.             List<InfoPolicy> lst = driver.getInfoPolicyList(null, idPolicyParam);
  1551.             return (lst != null && !lst.isEmpty()) ? lst.get(0) : null;
  1552.         } catch (Exception e) {
  1553.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1554.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1555.         }finally{
  1556.             ControlStationCore.dbM.releaseConnection(con);
  1557.         }
  1558.     }
  1559.    
  1560.     public List<AttivazionePolicy> findInUseAttivazioni(String idPolicy) throws DriverControlStationException{
  1561.         return findInUseAttivazioni(idPolicy, false);
  1562.     }
  1563.    
  1564.     public List<AttivazionePolicy> findInUseAttivazioni(String idPolicy, boolean escludiDisabilitate) throws DriverControlStationException{
  1565.         String nomeMetodo = "findInUseAttivazioni";
  1566.         Connection con = null;
  1567.         DriverControlStationDB driver = null;
  1568.         try {
  1569.             // prendo una connessione
  1570.             con = ControlStationCore.dbM.getConnection();
  1571.            
  1572.             // istanzio il driver
  1573.             driver = new DriverControlStationDB(con, null, this.tipoDB);    
  1574.            
  1575.             return driver.findInUseAttivazioni(idPolicy, escludiDisabilitate);
  1576.         } catch (Exception e) {
  1577.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1578.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1579.         }finally{
  1580.             ControlStationCore.dbM.releaseConnection(con);
  1581.         }
  1582.     }
  1583.    
  1584.     public long countInUseAttivazioni(String idPolicy) throws DriverControlStationException{
  1585.         return countInUseAttivazioni(idPolicy, false);
  1586.     }
  1587.    
  1588.     public long countInUseAttivazioni(String idPolicy, boolean escludiDisabilitate) throws DriverControlStationException{
  1589.         String nomeMetodo = "countInUseAttivazioni";
  1590.         Connection con = null;
  1591.         DriverControlStationDB driver = null;
  1592.         try {
  1593.             // prendo una connessione
  1594.             con = ControlStationCore.dbM.getConnection();
  1595.            
  1596.             // istanzio il driver
  1597.             driver = new DriverControlStationDB(con, null, this.tipoDB);    
  1598.            
  1599.             return driver.countInUseAttivazioni(idPolicy, escludiDisabilitate);
  1600.         } catch (Exception e) {
  1601.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1602.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1603.         }finally{
  1604.             ControlStationCore.dbM.releaseConnection(con);
  1605.         }
  1606.     }
  1607.    
  1608.    
  1609.     public ConfigurazionePolicy getConfigurazionePolicy(long id) throws DriverControlStationNotFound, DriverControlStationException{
  1610.         String nomeMetodo = "getConfigurazionePolicy";
  1611.         Connection con = null;
  1612.         DriverControlStationDB driver = null;
  1613.         try {
  1614.             // prendo una connessione
  1615.             con = ControlStationCore.dbM.getConnection();
  1616.            
  1617.             // istanzio il driver
  1618.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1619.            
  1620.             return driver.getConfigurazionePolicy(id);
  1621.         } catch (DriverControlStationNotFound e) {
  1622.             ControlStationCore.logDebug(getPrefixMethod(nomeMetodo)+"Configurazione ["+id+"] policy non presente");
  1623.             throw e;
  1624.         } catch (Exception e) {
  1625.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1626.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1627.         }finally{
  1628.             ControlStationCore.dbM.releaseConnection(con);
  1629.         }
  1630.     }
  1631.    
  1632.     public ConfigurazionePolicy getConfigurazionePolicy(String nomePolicy)  throws DriverControlStationNotFound, DriverControlStationException{
  1633.         String nomeMetodo = "getConfigurazionePolicy";
  1634.         Connection con = null;
  1635.         DriverControlStationDB driver = null;
  1636.         try {
  1637.             // prendo una connessione
  1638.             con = ControlStationCore.dbM.getConnection();
  1639.            
  1640.             // istanzio il driver
  1641.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1642.            
  1643.             return driver.getConfigurazionePolicy(nomePolicy);
  1644.         } catch (DriverControlStationNotFound e) {
  1645.             ControlStationCore.logDebug(getPrefixMethod(nomeMetodo)+"Configurazione ["+nomePolicy+"] policy non presente");
  1646.             throw e;
  1647.         } catch (Exception e) {
  1648.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1649.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1650.         }finally{
  1651.             ControlStationCore.dbM.releaseConnection(con);
  1652.         }
  1653.     }
  1654.    
  1655.     public AttivazionePolicy getAttivazionePolicy(long id)  throws DriverControlStationNotFound, DriverControlStationException{
  1656.         String nomeMetodo = "getAttivazionePolicy";
  1657.         Connection con = null;
  1658.         DriverControlStationDB driver = null;
  1659.         try {
  1660.             // prendo una connessione
  1661.             con = ControlStationCore.dbM.getConnection();
  1662.            
  1663.             // istanzio il driver
  1664.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1665.            
  1666.             return driver.getAttivazionePolicy(id);
  1667.         } catch (DriverControlStationNotFound e) {
  1668.             ControlStationCore.logDebug(getPrefixMethod(nomeMetodo)+"AttivazionePolicy ["+id+"] non presente");
  1669.             throw e;
  1670.         } catch (Exception e) {
  1671.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1672.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1673.         }finally{
  1674.             ControlStationCore.dbM.releaseConnection(con);
  1675.         }
  1676.     }
  1677.    
  1678.     public AttivazionePolicy getAttivazionePolicy(String nomePolicy)  throws DriverControlStationNotFound, DriverControlStationException{
  1679.         String nomeMetodo = "getAttivazionePolicy";
  1680.         Connection con = null;
  1681.         DriverControlStationDB driver = null;
  1682.         try {
  1683.             // prendo una connessione
  1684.             con = ControlStationCore.dbM.getConnection();
  1685.            
  1686.             // istanzio il driver
  1687.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1688.            
  1689.             return driver.getAttivazionePolicy(nomePolicy);
  1690.         } catch (DriverControlStationNotFound e) {
  1691.             ControlStationCore.logDebug("[ControlStationCore::" + nomeMetodo + "] Configurazione ["+nomePolicy+"] non presente");
  1692.             throw e;
  1693.         } catch (Exception e) {
  1694.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1695.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1696.         }finally{
  1697.             ControlStationCore.dbM.releaseConnection(con);
  1698.         }
  1699.     }
  1700.    
  1701.     public String getNextPolicyInstanceSerialId(String policyId) throws DriverControlStationException{
  1702.         String nomeMetodo = "getNextPolicyInstanceSerialId";
  1703.         Connection con = null;
  1704.         DriverControlStationDB driver = null;
  1705.         try {
  1706.             // prendo una connessione
  1707.             con = ControlStationCore.dbM.getConnection();
  1708.            
  1709.             // istanzio il driver
  1710.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1711.            
  1712.             return driver.getNextPolicyInstanceSerialId(policyId);
  1713.         } catch (Exception e) {
  1714.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1715.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1716.         }finally{
  1717.             ControlStationCore.dbM.releaseConnection(con);
  1718.         }
  1719.     }
  1720.    
  1721.     public AttivazionePolicy getPolicy(String policyId, AttivazionePolicyFiltro filtro, AttivazionePolicyRaggruppamento groupBy,
  1722.             RuoloPolicy ruoloPorta, String nomePorta) throws DriverControlStationNotFound, DriverControlStationException{
  1723.         String nomeMetodo = "getGlobalPolicy";
  1724.         Connection con = null;
  1725.         DriverControlStationDB driver = null;
  1726.         try {
  1727.             // prendo una connessione
  1728.             con = ControlStationCore.dbM.getConnection();
  1729.            
  1730.             // istanzio il driver
  1731.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1732.            
  1733.             return driver.getPolicy(policyId, filtro, groupBy, ruoloPorta, nomePorta);
  1734.         } catch (DriverControlStationNotFound e) {
  1735.             throw e;
  1736.         } catch (Exception e) {
  1737.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1738.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1739.         }finally{
  1740.             ControlStationCore.dbM.releaseConnection(con);
  1741.         }
  1742.     }
  1743.    
  1744.     public AttivazionePolicy getPolicyByAlias(String alias,
  1745.             RuoloPolicy ruoloPorta, String nomePorta) throws DriverControlStationNotFound, DriverControlStationException{
  1746.         String nomeMetodo = "getGlobalPolicyByAlias";
  1747.         Connection con = null;
  1748.         DriverControlStationDB driver = null;
  1749.         try {
  1750.             // prendo una connessione
  1751.             con = ControlStationCore.dbM.getConnection();
  1752.            
  1753.             // istanzio il driver
  1754.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1755.            
  1756.             return driver.getPolicyByAlias(alias, ruoloPorta, nomePorta);
  1757.         } catch (DriverControlStationNotFound e) {
  1758.             throw e;
  1759.         } catch (Exception e) {
  1760.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1761.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1762.         }finally{
  1763.             ControlStationCore.dbM.releaseConnection(con);
  1764.         }
  1765.     }
  1766.    
  1767.     public List<AttivazionePolicy> getPolicyByServizioApplicativo(IDServizioApplicativo idServizioApplicativo) throws DriverControlStationNotFound, DriverControlStationException{
  1768.         String nomeMetodo = "getPolicyByServizioApplicativo";
  1769.         Connection con = null;
  1770.         DriverControlStationDB driver = null;
  1771.         try {
  1772.             // prendo una connessione
  1773.             con = ControlStationCore.dbM.getConnection();
  1774.            
  1775.             // istanzio il driver
  1776.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1777.            
  1778.             return driver.getPolicyByServizioApplicativo(idServizioApplicativo);
  1779.         } catch (DriverControlStationNotFound e) {
  1780.             throw e;
  1781.         } catch (Exception e) {
  1782.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1783.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1784.         }finally{
  1785.             ControlStationCore.dbM.releaseConnection(con);
  1786.         }
  1787.     }
  1788.    
  1789.    
  1790.     public List<IDSoggetto> getSoggettiErogatori(String protocolloSelezionato,List<String> protocolliSupportati) throws DriverControlStationException{
  1791.         String nomeMetodo = "getSoggettiErogatori";
  1792.         Connection con = null;
  1793.         DriverControlStationDB driver = null;
  1794.         try {
  1795.             // prendo una connessione
  1796.             con = ControlStationCore.dbM.getConnection();
  1797.            
  1798.             // istanzio il driver
  1799.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1800.        
  1801.             return driver.getSoggettiErogatori(protocolloSelezionato,protocolliSupportati);
  1802.         } catch (Exception e) {
  1803.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1804.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1805.         }finally{
  1806.             ControlStationCore.dbM.releaseConnection(con);
  1807.         }
  1808.     }
  1809.     public List<IDServizio> getServizi(String protocolloSelezionato,List<String> protocolliSupportati,
  1810.             String tipoErogatore, String nomeErogatore, String tag) throws DriverControlStationException{
  1811.         String nomeMetodo = "getServizi";
  1812.         Connection con = null;
  1813.         DriverControlStationDB driver = null;
  1814.         try {
  1815.             // prendo una connessione
  1816.             con = ControlStationCore.dbM.getConnection();
  1817.            
  1818.             // istanzio il driver
  1819.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1820.            
  1821.             return driver.getServizi(protocolloSelezionato,protocolliSupportati, tipoErogatore, nomeErogatore, tag);
  1822.         } catch (Exception e) {
  1823.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1824.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1825.         }finally{
  1826.             ControlStationCore.dbM.releaseConnection(con);
  1827.         }
  1828.     }
  1829.     public List<IDServizio> getServizi(String protocolloSelezionato,List<String> protocolliSupportati,
  1830.             String tipoServizio, String nomeServizio, Integer versioneServizio, String tag) throws DriverControlStationException{
  1831.         String nomeMetodo = "getServizi";
  1832.         Connection con = null;
  1833.         DriverControlStationDB driver = null;
  1834.         try {
  1835.             // prendo una connessione
  1836.             con = ControlStationCore.dbM.getConnection();
  1837.            
  1838.             // istanzio il driver
  1839.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1840.            
  1841.             return driver.getServizi(protocolloSelezionato,protocolliSupportati, tipoServizio, nomeServizio, versioneServizio, tag);
  1842.         } catch (Exception e) {
  1843.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1844.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1845.         }finally{
  1846.             ControlStationCore.dbM.releaseConnection(con);
  1847.         }
  1848.     }
  1849.     public List<String> getAzioni(String protocolloSelezionato,List<String> protocolliSupportati,
  1850.             String tipoErogatore, String nomeErogatore, String tipoServizio, String nomeServizio, Integer versioneServizio) throws DriverControlStationException{
  1851.         String nomeMetodo = "getAzioni";
  1852.         Connection con = null;
  1853.         DriverControlStationDB driver = null;
  1854.         try {
  1855.             // prendo una connessione
  1856.             con = ControlStationCore.dbM.getConnection();
  1857.            
  1858.             // istanzio il driver
  1859.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1860.        
  1861.             return driver.getAzioni(protocolloSelezionato,protocolliSupportati,
  1862.                     tipoErogatore, nomeErogatore, tipoServizio, nomeServizio, versioneServizio);
  1863.         } catch (Exception e) {
  1864.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1865.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1866.         }finally{
  1867.             ControlStationCore.dbM.releaseConnection(con);
  1868.         }
  1869.     }
  1870.     public List<IDServizioApplicativo> getServiziApplicativiErogatori(String protocolloSelezionato,List<String> protocolliSupportati,
  1871.             String tipoErogatore, String nomeErogatore, String tipoServizio, String nomeServizio, Integer versioneServizio,
  1872.             String azione) throws DriverControlStationException {
  1873.         String nomeMetodo = "getServiziApplicativiErogatori";
  1874.         Connection con = null;
  1875.         DriverControlStationDB driver = null;
  1876.         try {
  1877.             // prendo una connessione
  1878.             con = ControlStationCore.dbM.getConnection();
  1879.            
  1880.             // istanzio il driver
  1881.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1882.        
  1883.             return driver.getServiziApplicativiErogatori(protocolloSelezionato,protocolliSupportati,
  1884.                     tipoErogatore, nomeErogatore, tipoServizio, nomeServizio, versioneServizio,
  1885.                     azione);
  1886.         } catch (Exception e) {
  1887.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1888.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1889.         }finally{
  1890.             ControlStationCore.dbM.releaseConnection(con);
  1891.         }
  1892.     }
  1893.     public List<IDSoggetto> getSoggetti(String protocolloSelezionato,List<String> protocolliSupportati) throws DriverControlStationException{
  1894.         String nomeMetodo = "getSoggetti";
  1895.         Connection con = null;
  1896.         DriverControlStationDB driver = null;
  1897.         try {
  1898.             // prendo una connessione
  1899.             con = ControlStationCore.dbM.getConnection();
  1900.            
  1901.             // istanzio il driver
  1902.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1903.        
  1904.             return driver.getSoggetti(protocolloSelezionato,protocolliSupportati);
  1905.         } catch (Exception e) {
  1906.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1907.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1908.         }finally{
  1909.             ControlStationCore.dbM.releaseConnection(con);
  1910.         }
  1911.     }
  1912.     public List<IDSoggetto> getSoggettiFruitori(String protocolloSelezionato,List<String> protocolliSupportati,
  1913.             String tipoErogatore, String nomeErogatore, String tipoServizio, String nomeServizio, Integer versioneServizio) throws DriverControlStationException{
  1914.         String nomeMetodo = "getSoggettiFruitori";
  1915.         Connection con = null;
  1916.         DriverControlStationDB driver = null;
  1917.         try {
  1918.             // prendo una connessione
  1919.             con = ControlStationCore.dbM.getConnection();
  1920.            
  1921.             // istanzio il driver
  1922.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1923.        
  1924.             return driver.getSoggettiFruitori(protocolloSelezionato,protocolliSupportati,
  1925.                     tipoErogatore, nomeErogatore, tipoServizio, nomeServizio, versioneServizio);
  1926.         } catch (Exception e) {
  1927.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1928.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1929.         }finally{
  1930.             ControlStationCore.dbM.releaseConnection(con);
  1931.         }
  1932.     }
  1933.     public List<IDServizioApplicativo> getServiziApplicativiFruitore(String protocolloSelezionato,List<String> protocolliSupportati,
  1934.             String tipoFruitore, String nomeFruitore,  
  1935.             String tipoErogatore, String nomeErogatore, String tipoServizio, String nomeServizio, Integer versioneServizio,
  1936.             String azione) throws DriverControlStationException{
  1937.         String nomeMetodo = "getServiziApplicativiFruitore(protocollo,protocolli,fruitore,erogatore,servizio,azione)";
  1938.         Connection con = null;
  1939.         DriverControlStationDB driver = null;
  1940.         try {
  1941.             // prendo una connessione
  1942.             con = ControlStationCore.dbM.getConnection();
  1943.            
  1944.             // istanzio il driver
  1945.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1946.            
  1947.             return driver.getServiziApplicativiFruitore(protocolloSelezionato,protocolliSupportati,
  1948.                     tipoFruitore, nomeFruitore,
  1949.                     tipoErogatore, nomeErogatore, tipoServizio, nomeServizio, versioneServizio,
  1950.                     azione);
  1951.         } catch (Exception e) {
  1952.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1953.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1954.         }finally{
  1955.             ControlStationCore.dbM.releaseConnection(con);
  1956.         }
  1957.     }
  1958.     public List<IDServizioApplicativo> getServiziApplicativiFruitore(String protocolloSelezionato,List<String> protocolliSupportati,
  1959.             String tipoFruitore, String nomeFruitore) throws DriverControlStationException{
  1960.         String nomeMetodo = "getServiziApplicativiFruitore";
  1961.         Connection con = null;
  1962.         DriverControlStationDB driver = null;
  1963.         try {
  1964.             // prendo una connessione
  1965.             con = ControlStationCore.dbM.getConnection();
  1966.            
  1967.             // istanzio il driver
  1968.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1969.            
  1970.             return driver.getServiziApplicativiFruitore(protocolloSelezionato,protocolliSupportati,
  1971.                     tipoFruitore, nomeFruitore);
  1972.         } catch (Exception e) {
  1973.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1974.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1975.         }finally{
  1976.             ControlStationCore.dbM.releaseConnection(con);
  1977.         }
  1978.     }
  1979.     public List<IDServizioApplicativo> getServiziApplicativi(String protocolloSelezionato,List<String> protocolliSupportati,
  1980.             String tipoProprietario, String nomeProprietario) throws DriverControlStationException{
  1981.         String nomeMetodo = "getServiziApplicativiFruitore";
  1982.         Connection con = null;
  1983.         DriverControlStationDB driver = null;
  1984.         try {
  1985.             // prendo una connessione
  1986.             con = ControlStationCore.dbM.getConnection();
  1987.            
  1988.             // istanzio il driver
  1989.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1990.            
  1991.             return driver.getServiziApplicativi(protocolloSelezionato,protocolliSupportati,
  1992.                     tipoProprietario, nomeProprietario);
  1993.         } catch (Exception e) {
  1994.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1995.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  1996.         }finally{
  1997.             ControlStationCore.dbM.releaseConnection(con);
  1998.         }
  1999.     }
  2000.    
  2001.     public Map<String, Properties> readGestorePolicyTokenPropertiesConfiguration(long idGenericProperties) throws DriverConfigurazioneException {
  2002.         Connection con = null;
  2003.         String nomeMetodo = "readGestorePolicyTokenPropertiesConfiguration";
  2004.         try {
  2005.             // prendo una connessione
  2006.             con = ControlStationCore.dbM.getConnection();
  2007.             Map<String, String> readProperties = DBPropertiesUtils.readProperties(con, this.tipoDB, CostantiDB.CONFIG_GENERIC_PROPERTY, CostantiDB.CONFIG_GENERIC_PROPERTY_COLUMN_NOME,
  2008.                     CostantiDB.CONFIG_GENERIC_PROPERTY_COLUMN_VALORE, CostantiDB.CONFIG_GENERIC_PROPERTY_COLUMN_ENC_VALUE, CostantiDB.CONFIG_GENERIC_PROPERTY_COLUMN_ID_PROPS, idGenericProperties,
  2009.                     this.getDriverBYOKUtilities().getDriverBYOKManagerNode(false, true));
  2010.             return DBPropertiesUtils.toMultiMap(readProperties);
  2011.         } catch (Exception e) {
  2012.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2013.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2014.         } finally {
  2015.             ControlStationCore.dbM.releaseConnection(con);
  2016.         }  
  2017.     }
  2018.     public List<GenericProperties> gestorePolicyTokenList(Integer idLista, String tipologia, ISearch ricerca) throws DriverConfigurazioneException {
  2019.         List<String> tipologiaList = new ArrayList<>();
  2020.         tipologiaList.add(tipologia);
  2021.         return gestorePolicyTokenList(idLista, tipologiaList, ricerca);
  2022.     }
  2023.     public List<GenericProperties> gestorePolicyTokenList(Integer idLista, List<String> tipologia, ISearch ricerca) throws DriverConfigurazioneException {
  2024.         Connection con = null;
  2025.         String nomeMetodo = "gestorePolicyTokenList";
  2026.         DriverControlStationDB driver = null;

  2027.         try {
  2028.             // prendo una connessione
  2029.             con = ControlStationCore.dbM.getConnection();
  2030.             // istanzio il driver
  2031.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2032.             return driver.getDriverConfigurazioneDB().getGenericProperties(tipologia, idLista, ricerca,false);
  2033.         } catch (Exception e) {
  2034.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2035.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2036.         } finally {
  2037.             ControlStationCore.dbM.releaseConnection(con);
  2038.         }
  2039.     }
  2040.     public GenericProperties getGenericProperties(long idGenericProperties) throws DriverConfigurazioneException,DriverConfigurazioneNotFound{
  2041.         Connection con = null;
  2042.         String nomeMetodo = "getGenericProperties";
  2043.         DriverControlStationDB driver = null;

  2044.         try {
  2045.             // prendo una connessione
  2046.             con = ControlStationCore.dbM.getConnection();
  2047.             // istanzio il driver
  2048.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2049.             return driver.getDriverConfigurazioneDB().getGenericProperties(idGenericProperties);
  2050.         }catch (DriverConfigurazioneNotFound e) {
  2051.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2052.             throw e;
  2053.         }catch (Exception e) {
  2054.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2055.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2056.         } finally {
  2057.             ControlStationCore.dbM.releaseConnection(con);
  2058.         }
  2059.     }
  2060.    
  2061.     public GenericProperties getGenericProperties(String nome, String tipologia, boolean logNotFoundError) throws DriverConfigurazioneException,DriverConfigurazioneNotFound{
  2062.         Connection con = null;
  2063.         String nomeMetodo = "getGenericProperties";
  2064.         DriverControlStationDB driver = null;

  2065.         try {
  2066.             // prendo una connessione
  2067.             con = ControlStationCore.dbM.getConnection();
  2068.             // istanzio il driver
  2069.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2070.             return driver.getDriverConfigurazioneDB().getGenericProperties(tipologia,nome);
  2071.         } catch (DriverConfigurazioneNotFound e) {
  2072.             if(logNotFoundError) {
  2073.                 ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2074.             }
  2075.             else {
  2076.                 ControlStationCore.logDebug(getPrefixError(nomeMetodo,  e), e);
  2077.             }
  2078.             throw e;
  2079.         } catch (Exception e) {
  2080.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2081.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2082.         } finally {
  2083.             ControlStationCore.dbM.releaseConnection(con);
  2084.         }
  2085.     }
  2086.     public List<PortaApplicativa> listaPorteApplicativeUtilizzateDaPolicyGestioneToken(String nome) throws DriverConfigurazioneException{
  2087.         Connection con = null;
  2088.         String nomeMetodo = "listaPorteApplicativeUtilizzateDaPolicyGestioneToken";
  2089.         DriverControlStationDB driver = null;

  2090.         try {
  2091.             // prendo una connessione
  2092.             con = ControlStationCore.dbM.getConnection();
  2093.             // istanzio il driver
  2094.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2095.             return driver.getDriverConfigurazioneDB().getPorteApplicativeByPolicyGestioneToken(nome);
  2096.         } catch (Exception e) {
  2097.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2098.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2099.         } finally {
  2100.             ControlStationCore.dbM.releaseConnection(con);
  2101.         }
  2102.     }
  2103.     public List<PortaDelegata> listaPorteDelegateUtilizzateDaPolicyGestioneToken(String nome) throws DriverConfigurazioneException{
  2104.         Connection con = null;
  2105.         String nomeMetodo = "listaPorteDelegateUtilizzateDaPolicyGestioneToken";
  2106.         DriverControlStationDB driver = null;

  2107.         try {
  2108.             // prendo una connessione
  2109.             con = ControlStationCore.dbM.getConnection();
  2110.             // istanzio il driver
  2111.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2112.             return driver.getDriverConfigurazioneDB().getPorteDelegateByPolicyGestioneToken(nome);
  2113.         } catch (Exception e) {
  2114.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2115.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2116.         } finally {
  2117.             ControlStationCore.dbM.releaseConnection(con);
  2118.         }
  2119.     }
  2120.     public boolean isPolicyNegoziazioneTokenUsedInConnettore(String nome) throws DriverConfigurazioneException{
  2121.         Connection con = null;
  2122.         String nomeMetodo = "listaPorteDelegateUtilizzateDaPolicyGestioneToken";
  2123.         DriverControlStationDB driver = null;

  2124.         try {
  2125.             // prendo una connessione
  2126.             con = ControlStationCore.dbM.getConnection();
  2127.             // istanzio il driver
  2128.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2129.             return driver.getDriverConfigurazioneDB().isPolicyNegoziazioneTokenUsedInConnettore(nome);
  2130.         } catch (Exception e) {
  2131.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2132.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2133.         } finally {
  2134.             ControlStationCore.dbM.releaseConnection(con);
  2135.         }
  2136.     }
  2137.     public List<CanaleConfigurazione> canaleConfigurazioneList(ISearch ricerca) throws DriverConfigurazioneException {
  2138.         Connection con = null;
  2139.         String nomeMetodo = "canaleConfigurazioneList";
  2140.         DriverControlStationDB driver = null;

  2141.         try {
  2142.             // prendo una connessione
  2143.             con = ControlStationCore.dbM.getConnection();
  2144.             // istanzio il driver
  2145.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2146.             return driver.getDriverConfigurazioneDB().canaleConfigurazioneList(ricerca);
  2147.         } catch (Exception e) {
  2148.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2149.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2150.         } finally {
  2151.             ControlStationCore.dbM.releaseConnection(con);
  2152.         }
  2153.     }
  2154.     public boolean existsCanale(String nome) throws DriverConfigurazioneException{
  2155.         Connection con = null;
  2156.         String nomeMetodo = "existsCanale";
  2157.         DriverControlStationDB driver = null;

  2158.         try {
  2159.             // prendo una connessione
  2160.             con = ControlStationCore.dbM.getConnection();
  2161.             // istanzio il driver
  2162.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2163.             return driver.getDriverConfigurazioneDB().existsCanale(nome);
  2164.         } catch (Exception e) {
  2165.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2166.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2167.         } finally {
  2168.             ControlStationCore.dbM.releaseConnection(con);
  2169.         }
  2170.     }
  2171.    
  2172.     public List<CanaleConfigurazioneNodo> canaleNodoConfigurazioneList(ISearch ricerca) throws DriverConfigurazioneException{
  2173.         Connection con = null;
  2174.         String nomeMetodo = "canaleNodoConfigurazioneList";
  2175.         DriverControlStationDB driver = null;

  2176.         try {
  2177.             // prendo una connessione
  2178.             con = ControlStationCore.dbM.getConnection();
  2179.             // istanzio il driver
  2180.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2181.             return driver.getDriverConfigurazioneDB().canaleNodoConfigurazioneList(ricerca);
  2182.         } catch (Exception e) {
  2183.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2184.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2185.         } finally {
  2186.             ControlStationCore.dbM.releaseConnection(con);
  2187.         }
  2188.     }
  2189.    
  2190.     public boolean existsCanaleNodo(String nome) throws DriverConfigurazioneException{
  2191.         Connection con = null;
  2192.         String nomeMetodo = "existsCanaleNodo";
  2193.         DriverControlStationDB driver = null;

  2194.         try {
  2195.             // prendo una connessione
  2196.             con = ControlStationCore.dbM.getConnection();
  2197.             // istanzio il driver
  2198.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2199.             return driver.getDriverConfigurazioneDB().existsCanaleNodo(nome);
  2200.         } catch (Exception e) {
  2201.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2202.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2203.         } finally {
  2204.             ControlStationCore.dbM.releaseConnection(con);
  2205.         }
  2206.     }
  2207.    
  2208.     public boolean isCanaleInUso(CanaleConfigurazione canale, Map<ErrorsHandlerCostant, List<String>> whereIsInUso, boolean normalizeObjectIds) throws DriverConfigurazioneException {
  2209.         Connection con = null;
  2210.         String nomeMetodo = "isCanaleInUso";
  2211.        
  2212.         try {
  2213.             // prendo una connessione
  2214.             con = ControlStationCore.dbM.getConnection();
  2215.    
  2216.             return DBOggettiInUsoUtils.isCanaleInUso(con, this.tipoDB, canale, whereIsInUso, normalizeObjectIds);
  2217.    
  2218.         } catch (Exception e) {
  2219.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2220.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2221.         } finally {
  2222.             ControlStationCore.dbM.releaseConnection(con);
  2223.         }
  2224.     }
  2225.    
  2226.     public boolean isCanaleInUsoRegistro(CanaleConfigurazione canale, Map<ErrorsHandlerCostant, List<String>> whereIsInUso, boolean normalizeObjectIds) throws DriverConfigurazioneException {
  2227.         Connection con = null;
  2228.         String nomeMetodo = "isCanaleInUsoRegistro";
  2229.        
  2230.         try {
  2231.             // prendo una connessione
  2232.             con = ControlStationCore.dbM.getConnection();
  2233.    
  2234.             return DBOggettiInUsoUtils.isCanaleInUsoRegistro(con, this.tipoDB, canale, whereIsInUso, normalizeObjectIds);
  2235.    
  2236.         } catch (Exception e) {
  2237.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2238.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2239.         } finally {
  2240.             ControlStationCore.dbM.releaseConnection(con);
  2241.         }
  2242.     }
  2243.    
  2244.     public String getDettagliCanaleInUso(CanaleConfigurazione canale) throws DriverConfigurazioneException {
  2245.         EnumMap<ErrorsHandlerCostant, List<String>> whereIsInUso = new EnumMap<>(ErrorsHandlerCostant.class);
  2246.         boolean normalizeObjectIds = true;
  2247.         boolean canaleInUso  = this.isCanaleInUso(canale, whereIsInUso, normalizeObjectIds);
  2248.        
  2249.         StringBuilder inUsoMessage = new StringBuilder();
  2250.         if(canaleInUso) {
  2251.             String s = DBOggettiInUsoUtils.toString(canale, whereIsInUso, false, "\n");
  2252.             if(s!=null && s.startsWith("\n") && s.length()>1) {
  2253.                 s = s.substring(1);
  2254.             }
  2255.             inUsoMessage.append(s);
  2256.             inUsoMessage.append("\n");
  2257.         } else {
  2258.             inUsoMessage.append(ConfigurazioneCostanti.LABEL_CANALE_IN_USO_BODY_HEADER_NESSUN_RISULTATO);
  2259.         }
  2260.        
  2261.         return inUsoMessage.toString();
  2262.     }
  2263.    
  2264.     public boolean isGenericPropertiesInUso(IDGenericProperties idGP, Map<ErrorsHandlerCostant, List<String>> whereIsInUso, boolean normalizeObjectIds) throws DriverConfigurazioneException {
  2265.         String nomeMetodo = "isGenericPropertiesInUso";
  2266.         Connection con = null;
  2267.        
  2268.         try {
  2269.             // prendo una connessione
  2270.             con = ControlStationCore.dbM.getConnection();
  2271.    
  2272.             return DBOggettiInUsoUtils.isGenericPropertiesInUso(con, this.tipoDB, idGP, whereIsInUso, normalizeObjectIds);
  2273.    
  2274.         } catch (Exception e) {
  2275.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2276.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2277.         } finally {
  2278.             ControlStationCore.dbM.releaseConnection(con);
  2279.         }
  2280.     }
  2281.    
  2282.     public String getDettagliTokenPolicyInUso(IDGenericProperties idGP) throws DriverConfigurazioneException {
  2283.         EnumMap<ErrorsHandlerCostant, List<String>> whereIsInUso = new EnumMap<>(ErrorsHandlerCostant.class);
  2284.         boolean normalizeObjectIds = true;
  2285.         boolean tokenPolicyInUso  = this.isGenericPropertiesInUso(idGP, whereIsInUso, normalizeObjectIds);
  2286.        
  2287.         StringBuilder inUsoMessage = new StringBuilder();
  2288.         if(tokenPolicyInUso) {
  2289.             String s = DBOggettiInUsoUtils.toString(idGP, whereIsInUso, false, "\n");
  2290.             if(s!=null && s.startsWith("\n") && s.length()>1) {
  2291.                 s = s.substring(1);
  2292.             }
  2293.             inUsoMessage.append(s);
  2294.             inUsoMessage.append("\n");
  2295.         } else {
  2296.             if(idGP!=null && CostantiConfigurazione.GENERIC_PROPERTIES_ATTRIBUTE_AUTHORITY.equals(idGP.getTipologia())) {
  2297.                 inUsoMessage.append(ConfigurazioneCostanti.LABEL_ATTRIBUTE_AUTHORITY_IN_USO_BODY_HEADER_NESSUN_RISULTATO);
  2298.             }
  2299.             else {
  2300.                 inUsoMessage.append(ConfigurazioneCostanti.LABEL_TOKEN_POLICY_IN_USO_BODY_HEADER_NESSUN_RISULTATO);
  2301.             }
  2302.         }
  2303.        
  2304.         return inUsoMessage.toString();
  2305.     }
  2306.    
  2307.     public boolean isRateLimitingPolicyInUso(IdPolicy idRP, Map<ErrorsHandlerCostant, List<String>> whereIsInUso, boolean normalizeObjectIds) throws DriverConfigurazioneException {
  2308.         String nomeMetodo = "isRateLimitingPolicyInUso";
  2309.         Connection con = null;
  2310.        
  2311.         try {
  2312.             // prendo una connessione
  2313.             con = ControlStationCore.dbM.getConnection();
  2314.    
  2315.             return DBOggettiInUsoUtils.isRateLimitingPolicyInUso(con, this.tipoDB, idRP, whereIsInUso, normalizeObjectIds);
  2316.    
  2317.         } catch (Exception e) {
  2318.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2319.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2320.         } finally {
  2321.             ControlStationCore.dbM.releaseConnection(con);
  2322.         }
  2323.     }
  2324.    
  2325.     public String getDettagliRateLimitingPolicyInUso(IdPolicy idRP) throws DriverConfigurazioneException {
  2326.         EnumMap<ErrorsHandlerCostant, List<String>> whereIsInUso = new EnumMap<>(ErrorsHandlerCostant.class);
  2327.         boolean normalizeObjectIds = true;
  2328.         boolean rateLimitingPolicyInUso  = this.isRateLimitingPolicyInUso(idRP, whereIsInUso, normalizeObjectIds);
  2329.        
  2330.         StringBuilder inUsoMessage = new StringBuilder();
  2331.         if(rateLimitingPolicyInUso) {
  2332.             String s = DBOggettiInUsoUtils.toString(idRP, whereIsInUso, false, "\n");
  2333.             if(s!=null && s.startsWith("\n") && s.length()>1) {
  2334.                 s = s.substring(1);
  2335.             }
  2336.             inUsoMessage.append(s);
  2337.             inUsoMessage.append("\n");
  2338.         } else {
  2339.             inUsoMessage.append(ConfigurazioneCostanti.LABEL_RATE_LIMITING_POLICY_IN_USO_BODY_HEADER_NESSUN_RISULTATO);
  2340.         }
  2341.        
  2342.         return inUsoMessage.toString();
  2343.     }
  2344.    
  2345.     public boolean isPluginClasseInUso(IdPlugin idPlugin, Map<ErrorsHandlerCostant, List<String>> whereIsInUso, boolean normalizeObjectIds) throws DriverConfigurazioneException {
  2346.         String nomeMetodo = "isPluginClasseInUso";
  2347.         Connection con = null;
  2348.        
  2349.         try {
  2350.             // prendo una connessione
  2351.             con = ControlStationCore.dbM.getConnection();
  2352.    
  2353.             return DBOggettiInUsoUtils.isPluginInUso(con, this.tipoDB, idPlugin.getClassName(), idPlugin.getLabel(), idPlugin.getTipoPlugin(), idPlugin.getTipo(),
  2354.                     whereIsInUso, normalizeObjectIds);

  2355.         } catch (Exception e) {
  2356.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2357.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  2358.         } finally {
  2359.             ControlStationCore.dbM.releaseConnection(con);
  2360.         }
  2361.     }
  2362.    
  2363.     public String getDettagliPluginClasseInUso(IdPlugin idPlugin) throws DriverConfigurazioneException {
  2364.         EnumMap<ErrorsHandlerCostant, List<String>> whereIsInUso = new EnumMap<>(ErrorsHandlerCostant.class);
  2365.         boolean normalizeObjectIds = true;
  2366.         boolean pluginClasseInUso  = this.isPluginClasseInUso(idPlugin, whereIsInUso, normalizeObjectIds);
  2367.        
  2368.         StringBuilder inUsoMessage = new StringBuilder();
  2369.         if(pluginClasseInUso) {
  2370.             String s = DBOggettiInUsoUtils.toString(idPlugin.getClassName(), idPlugin.getLabel(), idPlugin.getTipoPlugin(), idPlugin.getTipo(), whereIsInUso, false, "\n");
  2371.             if(s!=null && s.startsWith("\n") && s.length()>1) {
  2372.                 s = s.substring(1);
  2373.             }
  2374.             inUsoMessage.append(s);
  2375.             inUsoMessage.append("\n");
  2376.         } else {
  2377.             inUsoMessage.append(ConfigurazioneCostanti.LABEL_PLUGIN_CLASSE_IN_USO_BODY_HEADER_NESSUN_RISULTATO);
  2378.         }
  2379.        
  2380.         return inUsoMessage.toString();
  2381.     }

  2382.     public List<ConfigurazioneAllarmeBean> allarmiList(ConsoleSearch ricerca, RuoloPorta ruoloPorta, String nomePorta) throws DriverControlStationException{
  2383.         String nomeMetodo = "allarmiList";
  2384.         Connection con = null;
  2385.         DriverControlStationDB driver = null;
  2386.         try {
  2387.             // prendo una connessione
  2388.             con = ControlStationCore.dbM.getConnection();
  2389.            
  2390.             // istanzio il driver
  2391.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2392.            
  2393.             return driver.allarmiList(ricerca, ruoloPorta, nomePorta);
  2394.         } catch (Exception e) {
  2395.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2396.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2397.         }finally{
  2398.             ControlStationCore.dbM.releaseConnection(con);
  2399.         }
  2400.     }
  2401.    
  2402.     public List<Allarme> allarmiSenzaPluginList(ConsoleSearch ricerca, RuoloPorta ruoloPorta, String nomePorta) throws DriverControlStationException{
  2403.         String nomeMetodo = "allarmiSenzaPluginList";
  2404.         Connection con = null;
  2405.         DriverControlStationDB driver = null;
  2406.         try {
  2407.             // prendo una connessione
  2408.             con = ControlStationCore.dbM.getConnection();
  2409.            
  2410.             // istanzio il driver
  2411.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2412.            
  2413.             return driver.allarmiSenzaPluginList(ricerca, ruoloPorta, nomePorta);
  2414.         } catch (Exception e) {
  2415.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2416.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2417.         }finally{
  2418.             ControlStationCore.dbM.releaseConnection(con);
  2419.         }
  2420.     }
  2421.    
  2422.     public boolean existsAllarmi(TipoAllarme tipoAllarme) throws DriverControlStationException{
  2423.         String nomeMetodo = "existsAllarmi";
  2424.         Connection con = null;
  2425.         DriverControlStationDB driver = null;
  2426.         try {
  2427.             // prendo una connessione
  2428.             con = ControlStationCore.dbM.getConnection();
  2429.            
  2430.             // istanzio il driver
  2431.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2432.            
  2433.             return driver.existsAllarmi(tipoAllarme);
  2434.         } catch (Exception e) {
  2435.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2436.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2437.         }finally{
  2438.             ControlStationCore.dbM.releaseConnection(con);
  2439.         }
  2440.     }
  2441.    
  2442.     public long countAllarmi(TipoAllarme tipoAllarme) throws DriverControlStationException{
  2443.         String nomeMetodo = "countAllarmi";
  2444.         Connection con = null;
  2445.         DriverControlStationDB driver = null;
  2446.         try {
  2447.             // prendo una connessione
  2448.             con = ControlStationCore.dbM.getConnection();
  2449.            
  2450.             // istanzio il driver
  2451.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2452.            
  2453.             return driver.countAllarmi(tipoAllarme);
  2454.         } catch (Exception e) {
  2455.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2456.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2457.         }finally{
  2458.             ControlStationCore.dbM.releaseConnection(con);
  2459.         }
  2460.     }
  2461.    
  2462.     public boolean existsAllarme(String nome) throws DriverControlStationException{
  2463.         Connection con = null;
  2464.         String nomeMetodo = "existsAllarme";
  2465.         DriverControlStationDB driver = null;

  2466.         try {
  2467.             // prendo una connessione
  2468.             con = ControlStationCore.dbM.getConnection();
  2469.             // istanzio il driver
  2470.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2471.             return driver.existsAllarme(nome);
  2472.         } catch (Exception e) {
  2473.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2474.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2475.         } finally {
  2476.             ControlStationCore.dbM.releaseConnection(con);
  2477.         }
  2478.     }
  2479.    
  2480.     public Allarme getAllarmeSenzaPlugin(Long id) throws DriverControlStationException{
  2481.         String nomeMetodo = "getAllarmeSenzaPlugin";
  2482.         Connection con = null;
  2483.         DriverControlStationDB driver = null;
  2484.         try {
  2485.             // prendo una connessione
  2486.             con = ControlStationCore.dbM.getConnection();
  2487.            
  2488.             // istanzio il driver
  2489.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2490.            
  2491.             return driver.getAllarmeSenzaPlugin(id);
  2492.         } catch (Exception e) {
  2493.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2494.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2495.         }finally{
  2496.             ControlStationCore.dbM.releaseConnection(con);
  2497.         }
  2498.     }
  2499.    
  2500.     public Allarme getAllarmeSenzaPlugin(String nome) throws DriverControlStationException{
  2501.         String nomeMetodo = "getAllarmeSenzaPluginByNome";
  2502.         Connection con = null;
  2503.         DriverControlStationDB driver = null;
  2504.         try {
  2505.             // prendo una connessione
  2506.             con = ControlStationCore.dbM.getConnection();
  2507.            
  2508.             // istanzio il driver
  2509.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2510.            
  2511.             return driver.getAllarmeSenzaPlugin(nome);
  2512.         } catch (Exception e) {
  2513.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2514.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2515.         }finally{
  2516.             ControlStationCore.dbM.releaseConnection(con);
  2517.         }
  2518.     }
  2519.    
  2520.     public ConfigurazioneAllarmeBean getAllarme(Long id) throws DriverControlStationException{
  2521.         String nomeMetodo = "getAllarme";
  2522.         Connection con = null;
  2523.         DriverControlStationDB driver = null;
  2524.         try {
  2525.             // prendo una connessione
  2526.             con = ControlStationCore.dbM.getConnection();
  2527.            
  2528.             // istanzio il driver
  2529.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2530.            
  2531.             return driver.getAllarme(id);
  2532.         } catch (Exception e) {
  2533.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2534.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2535.         }finally{
  2536.             ControlStationCore.dbM.releaseConnection(con);
  2537.         }
  2538.     }
  2539.    
  2540.     public ConfigurazioneAllarmeBean getAllarme(String nome) throws DriverControlStationException{
  2541.         String nomeMetodo = "getAllarmeByNome";
  2542.         Connection con = null;
  2543.         DriverControlStationDB driver = null;
  2544.         try {
  2545.             // prendo una connessione
  2546.             con = ControlStationCore.dbM.getConnection();
  2547.            
  2548.             // istanzio il driver
  2549.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2550.            
  2551.             return driver.getAllarme(nome);
  2552.         } catch (Exception e) {
  2553.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2554.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2555.         }finally{
  2556.             ControlStationCore.dbM.releaseConnection(con);
  2557.         }
  2558.     }
  2559.    
  2560.     public ConfigurazioneAllarmeBean getAllarme(Allarme allarme) throws DriverControlStationException{
  2561.         String nomeMetodo = "convertAllarme";
  2562.         Connection con = null;
  2563.         DriverControlStationDB driver = null;
  2564.         try {
  2565.             // prendo una connessione
  2566.             con = ControlStationCore.dbM.getConnection();
  2567.            
  2568.             // istanzio il driver
  2569.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2570.            
  2571.             return driver.getAllarme(allarme);
  2572.         } catch (Exception e) {
  2573.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2574.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2575.         }finally{
  2576.             ControlStationCore.dbM.releaseConnection(con);
  2577.         }
  2578.     }
  2579.    
  2580.     public boolean isUsableFilter(ConfigurazioneAllarmeBean configurazioneAllarme, Context context) throws DriverControlStationException{
  2581.         return this.isUsableEngine(configurazioneAllarme, context, true);
  2582.     }
  2583.    
  2584.     public boolean isUsableGroupBy(ConfigurazioneAllarmeBean configurazioneAllarme, Context context) throws DriverControlStationException{
  2585.         return this.isUsableEngine(configurazioneAllarme, context, false);
  2586.     }
  2587.    
  2588.     private boolean isUsableEngine(ConfigurazioneAllarmeBean configurazioneAllarme, Context context, boolean filter) throws DriverControlStationException{
  2589.         String nomeMetodo = "isUsableEngine";
  2590.         Connection con = null;
  2591.         DriverControlStationDB driver = null;
  2592.         try {
  2593.             // prendo una connessione
  2594.             con = ControlStationCore.dbM.getConnection();
  2595.            
  2596.             // istanzio il driver
  2597.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2598.            
  2599.             Plugin plugin = driver.getPlugin(TipoPlugin.ALLARME, configurazioneAllarme.getPlugin().getTipo(), true);
  2600.            
  2601.             IDynamicLoader bl = DynamicFactory.getInstance().newDynamicLoader(TipoPlugin.ALLARME, configurazioneAllarme.getPlugin().getTipo(), plugin.getClassName(), ControlStationCore.log);
  2602.             IAlarmProcessing alarmProcessing = (IAlarmProcessing) bl.newInstance();
  2603.             return filter ? alarmProcessing.isUsableFilter(context) : alarmProcessing.isUsableGroupBy(context);
  2604.         } catch (Exception e) {
  2605.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2606.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2607.         }finally{
  2608.             ControlStationCore.dbM.releaseConnection(con);
  2609.         }
  2610.     }
  2611.    
  2612.     public FiltersConfiguration getFiltersConfiguration(ConfigurazioneAllarmeBean configurazioneAllarme, Context context) throws DriverControlStationException{
  2613.         return (FiltersConfiguration) this.getFilterGroupByConfigEngine(configurazioneAllarme, context, true);
  2614.     }
  2615.    
  2616.     public GroupByConfiguration getGroupByConfiguration(ConfigurazioneAllarmeBean configurazioneAllarme, Context context) throws DriverControlStationException{
  2617.         return (GroupByConfiguration) this.getFilterGroupByConfigEngine(configurazioneAllarme, context, false);
  2618.     }
  2619.    
  2620.     public Object getFilterGroupByConfigEngine(ConfigurazioneAllarmeBean configurazioneAllarme, Context context, boolean filter) throws DriverControlStationException{
  2621.         String nomeMetodo = "getFilterGroupByConfigEngine";
  2622.         Connection con = null;
  2623.         DriverControlStationDB driver = null;
  2624.         try {
  2625.             // prendo una connessione
  2626.             con = ControlStationCore.dbM.getConnection();
  2627.            
  2628.             // istanzio il driver
  2629.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2630.            
  2631.             Plugin plugin = driver.getPlugin(TipoPlugin.ALLARME, configurazioneAllarme.getPlugin().getTipo(), true);
  2632.            
  2633.             IDynamicLoader bl = DynamicFactory.getInstance().newDynamicLoader(TipoPlugin.ALLARME, configurazioneAllarme.getPlugin().getTipo(), plugin.getClassName(), ControlStationCore.log);
  2634.             IAlarmProcessing alarmProcessing = (IAlarmProcessing) bl.newInstance();
  2635.            
  2636.             if(filter) {
  2637.                 if(alarmProcessing.isUsableFilter(context)) {
  2638.                     return alarmProcessing.getFiltersConfiguration(context);
  2639.                 }
  2640.             }
  2641.             else {
  2642.                 if(alarmProcessing.isUsableGroupBy(context)) {
  2643.                     return alarmProcessing.getGroupByConfiguration(context);
  2644.                 }
  2645.             }
  2646.             return null;
  2647.         } catch (Exception e) {
  2648.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2649.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2650.         }finally{
  2651.             ControlStationCore.dbM.releaseConnection(con);
  2652.         }
  2653.     }
  2654.    
  2655.     public String getParameterSectionTitle(ConfigurazioneAllarmeBean configurazioneAllarme, boolean groupByAllarme) throws DriverControlStationException{
  2656.         String nomeMetodo = "getParameterSectionTitle";
  2657.         Connection con = null;
  2658.         DriverControlStationDB driver = null;
  2659.         try {
  2660.             // prendo una connessione
  2661.             con = ControlStationCore.dbM.getConnection();
  2662.            
  2663.             // istanzio il driver
  2664.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2665.            
  2666.             Plugin plugin = driver.getPlugin(TipoPlugin.ALLARME, configurazioneAllarme.getPlugin().getTipo(), true);
  2667.            
  2668.             IDynamicLoader bl = DynamicFactory.getInstance().newDynamicLoader(TipoPlugin.ALLARME, configurazioneAllarme.getPlugin().getTipo(), plugin.getClassName(), ControlStationCore.log);
  2669.             IAlarmProcessing alarmProcessing = (IAlarmProcessing) bl.newInstance();
  2670.             String s = alarmProcessing.getParameterSectionTitle();
  2671.             if(s==null || StringUtils.isEmpty(s)) {
  2672.                 if(groupByAllarme) {
  2673.                     s = ConfigurazioneCostanti.LABEL_CONFIGURAZIONE_ALLARMI_VALORI_DI_SOGLIA;
  2674.                 }
  2675.                 else {
  2676.                     s = ConfigurazioneCostanti.LABEL_CONFIGURAZIONE_ALLARMI_PARAMETRI;
  2677.                 }
  2678.             }
  2679.             return s;
  2680.         } catch (Exception e) {
  2681.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2682.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2683.         }finally{
  2684.             ControlStationCore.dbM.releaseConnection(con);
  2685.         }
  2686.     }
  2687.    
  2688.     public List<Parameter<?>> instanceParameters(ConfigurazioneAllarmeBean configurazioneAllarme, Context context) throws Exception{
  2689.         String nomeMetodo = "instanceParameters";
  2690.         Connection con = null;
  2691.         DriverControlStationDB driver = null;
  2692.         try {
  2693.             // prendo una connessione
  2694.             con = ControlStationCore.dbM.getConnection();
  2695.            
  2696.             // istanzio il driver
  2697.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2698.            
  2699.             Plugin plugin = driver.getPlugin(TipoPlugin.ALLARME, configurazioneAllarme.getPlugin().getTipo(), true);
  2700.            
  2701.             List<Parameter<?>> res = null;
  2702.            
  2703.             IDynamicLoader bl = DynamicFactory.getInstance().newDynamicLoader(TipoPlugin.ALLARME, plugin.getTipo(), plugin.getClassName(), ControlStationCore.log);
  2704.             List<Parameter<?>> sdkParameters = bl.getParameters(context);
  2705.            
  2706.             if(sdkParameters!=null && !sdkParameters.isEmpty()){
  2707.                
  2708.                 res = new ArrayList<>();
  2709.                
  2710.                 for (Parameter<?> sdkParameter : sdkParameters) {
  2711.                     Parameter<?> par = DynamicComponentUtils.createDynamicComponentParameter(sdkParameter, bl);
  2712.                    
  2713.                     res.add(par);
  2714.                 }
  2715.             }
  2716.            
  2717.             if(res!=null && !res.isEmpty()) {
  2718.                 ((AlarmContext)context).setParameters(res);
  2719.                 for (Parameter<?> par : res) {
  2720.                     ((BaseComponent<?>)par).setContext(context);        
  2721.                 }
  2722.             }

  2723.             return res;
  2724.         } catch (Exception e) {
  2725.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2726.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2727.         }finally{
  2728.             ControlStationCore.dbM.releaseConnection(con);
  2729.         }
  2730.     }
  2731.    
  2732.     public List<Parameter<?>> getParameters(ConfigurazioneAllarmeBean configurazioneAllarme, Context context) throws Exception{
  2733.         List<Parameter<?>> parameters = this.instanceParameters(configurazioneAllarme, context);
  2734.         if(parameters!=null && !parameters.isEmpty()){
  2735.             for (AllarmeParametro parDB : configurazioneAllarme.getAllarmeParametroList()) {
  2736.                 for (Parameter<?> par : parameters) {
  2737.                     if(parDB.getIdParametro().equals(par.getId())){
  2738.                        
  2739.                         String value = parDB.getValore();
  2740.                        
  2741.                         if(ParameterType.CHECK_BOX.equals(par.getType())){
  2742.                             if(Costanti.CHECK_BOX_ENABLED.equals(value) || Costanti.CHECK_BOX_ENABLED_ABILITATO.equals(value) || Costanti.CHECK_BOX_ENABLED_TRUE.equals(value)) {
  2743.                                 value = Costanti.CHECK_BOX_ENABLED_TRUE;
  2744.                             }
  2745.                             else {
  2746.                                 value = Costanti.CHECK_BOX_DISABLED_FALSE;
  2747.                             }
  2748.                         }
  2749.                         par.setValueAsString(value);
  2750.                        
  2751.                         par.setValueAsString(value);
  2752.                         break;
  2753.                     }
  2754.                 }
  2755.             }
  2756.         }
  2757.        
  2758.         return parameters;
  2759.     }
  2760.     public List<ConfigurazioneAllarmeHistoryBean> allarmiHistoryList(ConsoleSearch ricerca, Long idAllarme) throws DriverControlStationException {
  2761.         String nomeMetodo = "allarmiHistoryList";
  2762.         Connection con = null;
  2763.         DriverControlStationDB driver = null;
  2764.         try {
  2765.             // prendo una connessione
  2766.             con = ControlStationCore.dbM.getConnection();
  2767.            
  2768.             // istanzio il driver
  2769.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2770.            
  2771.             return driver.allarmiHistoryList(ricerca, idAllarme);
  2772.         } catch (Exception e) {
  2773.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2774.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2775.         }finally{
  2776.             ControlStationCore.dbM.releaseConnection(con);
  2777.         }
  2778.     }
  2779.     public String getNextAlarmInstanceSerialId(String tipoPlugin) throws DriverControlStationException{
  2780.         String nomeMetodo = "getNextAlarmInstanceSerialId";
  2781.         Connection con = null;
  2782.         DriverControlStationDB driver = null;
  2783.         try {
  2784.             // prendo una connessione
  2785.             con = ControlStationCore.dbM.getConnection();
  2786.            
  2787.             // istanzio il driver
  2788.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  2789.            
  2790.             return driver.getNextAlarmInstanceSerialId(tipoPlugin);
  2791.         } catch (Exception e) {
  2792.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2793.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2794.         }finally{
  2795.             ControlStationCore.dbM.releaseConnection(con);
  2796.         }
  2797.     }
  2798.    
  2799.     public List<ConfigurazioneAllarmeBean> allarmiListByFilter(ConsoleSearch ricerca, RuoloPorta ruoloPorta, String nomePorta,
  2800.             IDSoggetto filtroSoggettoFruitore, IDServizioApplicativo filtroApplicativoFruitore,String filtroRuoloFruitore,
  2801.             IDSoggetto filtroSoggettoErogatore, String filtroRuoloErogatore,
  2802.             IDServizio filtroServizioAzione, String filtroRuolo)  throws DriverControlStationException{
  2803.         String nomeMetodo = "allarmiListByFilter";
  2804.         Connection con = null;
  2805.         DriverControlStationDB driver = null;
  2806.         try {
  2807.             // prendo una connessione
  2808.             con = ControlStationCore.dbM.getConnection();
  2809.            
  2810.             // istanzio il driver
  2811.             driver = new DriverControlStationDB(con, null, this.tipoDB);    
  2812.            
  2813.             return driver.configurazioneAllarmiListByFilter(ricerca, ruoloPorta, nomePorta,
  2814.                     filtroSoggettoFruitore, filtroApplicativoFruitore, filtroRuoloFruitore,
  2815.                     filtroSoggettoErogatore, filtroRuoloErogatore,
  2816.                     filtroServizioAzione, filtroRuolo);
  2817.         } catch (Exception e) {
  2818.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2819.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2820.         }finally{
  2821.             ControlStationCore.dbM.releaseConnection(con);
  2822.         }
  2823.     }
  2824.    
  2825.     public List<Allarme> allarmiForPolicyRateLimiting(String activeIdPolicy, RuoloPorta ruoloPorta, String nomePorta)  throws DriverControlStationException{
  2826.         String nomeMetodo = "allarmiForPolicyRateLimiting";
  2827.         Connection con = null;
  2828.         DriverControlStationDB driver = null;
  2829.         try {
  2830.             // prendo una connessione
  2831.             con = ControlStationCore.dbM.getConnection();
  2832.            
  2833.             // istanzio il driver
  2834.             driver = new DriverControlStationDB(con, null, this.tipoDB);    
  2835.            
  2836.             return driver.allarmiForPolicyRateLimiting(activeIdPolicy, ruoloPorta, nomePorta);
  2837.         } catch (Exception e) {
  2838.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  2839.             throw new DriverControlStationException(getPrefixError(nomeMetodo,  e),e);
  2840.         }finally{
  2841.             ControlStationCore.dbM.releaseConnection(con);
  2842.         }
  2843.     }
  2844. }