PorteDelegateCore.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.pd;

  21. import java.sql.Connection;
  22. import java.util.ArrayList;
  23. import java.util.List;
  24. import java.util.Map;
  25. import java.util.Properties;

  26. import org.openspcoop2.core.commons.DBUtils;
  27. import org.openspcoop2.core.commons.ISearch;
  28. import org.openspcoop2.core.config.AutorizzazioneRuoli;
  29. import org.openspcoop2.core.config.AutorizzazioneScope;
  30. import org.openspcoop2.core.config.CorrelazioneApplicativaElemento;
  31. import org.openspcoop2.core.config.CorrelazioneApplicativaRispostaElemento;
  32. import org.openspcoop2.core.config.GestioneToken;
  33. import org.openspcoop2.core.config.GestioneTokenAutenticazione;
  34. import org.openspcoop2.core.config.MessageSecurityFlowParameter;
  35. import org.openspcoop2.core.config.MtomProcessorFlowParameter;
  36. import org.openspcoop2.core.config.PortaDelegata;
  37. import org.openspcoop2.core.config.PortaDelegataAutorizzazioneToken;
  38. import org.openspcoop2.core.config.PortaDelegataServizioApplicativo;
  39. import org.openspcoop2.core.config.Proprieta;
  40. import org.openspcoop2.core.config.ProprietaOggetto;
  41. import org.openspcoop2.core.config.ResponseCachingConfigurazioneRegola;
  42. import org.openspcoop2.core.config.Ruolo;
  43. import org.openspcoop2.core.config.Scope;
  44. import org.openspcoop2.core.config.ServizioApplicativo;
  45. import org.openspcoop2.core.config.TrasformazioneRegola;
  46. import org.openspcoop2.core.config.TrasformazioneRegolaApplicabilitaServizioApplicativo;
  47. import org.openspcoop2.core.config.TrasformazioneRegolaParametro;
  48. import org.openspcoop2.core.config.TrasformazioneRegolaRisposta;
  49. import org.openspcoop2.core.config.constants.RuoloTipoMatch;
  50. import org.openspcoop2.core.config.constants.ScopeTipoMatch;
  51. import org.openspcoop2.core.config.constants.StatoFunzionalita;
  52. import org.openspcoop2.core.config.constants.StatoFunzionalitaConWarning;
  53. import org.openspcoop2.core.config.constants.TipoAutenticazionePrincipal;
  54. import org.openspcoop2.core.config.driver.DriverConfigurazioneException;
  55. import org.openspcoop2.core.config.driver.DriverConfigurazioneNotFound;
  56. import org.openspcoop2.core.config.driver.FiltroRicercaPorteDelegate;
  57. import org.openspcoop2.core.constants.CostantiDB;
  58. import org.openspcoop2.core.id.IDPortaDelegata;
  59. import org.openspcoop2.core.id.IDServizio;
  60. import org.openspcoop2.core.id.IDSoggetto;
  61. import org.openspcoop2.core.mapping.DBMappingUtils;
  62. import org.openspcoop2.core.mapping.MappingFruizionePortaDelegata;
  63. import org.openspcoop2.core.mvc.properties.utils.DBPropertiesUtils;
  64. import org.openspcoop2.core.registry.Fruitore;
  65. import org.openspcoop2.core.registry.constants.RuoloTipologia;
  66. import org.openspcoop2.core.registry.driver.IDServizioFactory;
  67. import org.openspcoop2.web.ctrlstat.core.AutorizzazioneUtilities;
  68. import org.openspcoop2.web.ctrlstat.core.ControlStationCore;
  69. import org.openspcoop2.web.ctrlstat.core.ConsoleSearch;
  70. import org.openspcoop2.web.ctrlstat.driver.DriverControlStationDB;
  71. import org.openspcoop2.web.ctrlstat.driver.DriverControlStationException;
  72. import org.openspcoop2.web.ctrlstat.servlet.aps.AccordiServizioParteSpecificaCore;
  73. import org.openspcoop2.web.lib.mvc.BinaryParameter;
  74. import org.openspcoop2.web.lib.mvc.ServletUtils;

  75. /**
  76.  * PorteDelegateCore
  77.  *
  78.  * @author Poli Andrea (apoli@link.it)
  79.  * @author $Author$
  80.  * @version $Rev$, $Date$
  81.  */
  82. public class PorteDelegateCore extends ControlStationCore {

  83.     public PorteDelegateCore() throws DriverControlStationException {
  84.         super();
  85.     }
  86.     public PorteDelegateCore(ControlStationCore core) throws DriverControlStationException {
  87.         super(core);
  88.     }
  89.    

  90.     public void configureControlloAccessiPortaDelegata(PortaDelegata portaDelegata,
  91.             String fruizioneAutenticazione, String fruizioneAutenticazioneOpzionale, TipoAutenticazionePrincipal fruizioneAutenticazionePrincipal, List<String> fruizioneAutenticazioneParametroList,
  92.             String fruizioneAutorizzazione, String fruizioneAutorizzazioneAutenticati, String fruizioneAutorizzazioneRuoli, String fruizioneAutorizzazioneRuoliTipologia, String fruizioneAutorizzazioneRuoliMatch,
  93.             String fruizioneServizioApplicativo, String fruizioneRuolo,
  94.             String autorizzazioneAutenticatiToken,
  95.             String autorizzazioneRuoliToken, String autorizzazioneRuoliTipologiaToken, String autorizzazioneRuoliMatchToken,
  96.             String fruizioneAutorizzazioneTokenOptions,
  97.             String fruizioneAutorizzazioneScope, String fruizioneScope, String fruizioneAutorizzazioneScopeMatch,BinaryParameter allegatoXacmlPolicy,
  98.             String identificazioneAttributiStato, String [] attributeAuthoritySelezionate, String attributeAuthorityAttributi) {
  99.        
  100.         portaDelegata.setAutenticazione(fruizioneAutenticazione);
  101.         if(fruizioneAutenticazioneOpzionale != null){
  102.             if(ServletUtils.isCheckBoxEnabled(fruizioneAutenticazioneOpzionale))
  103.                 portaDelegata.setAutenticazioneOpzionale(org.openspcoop2.core.config.constants.StatoFunzionalita.ABILITATO);
  104.             else
  105.                 portaDelegata.setAutenticazioneOpzionale(org.openspcoop2.core.config.constants.StatoFunzionalita.DISABILITATO);
  106.         } else
  107.             portaDelegata.setAutenticazioneOpzionale(null);
  108.         portaDelegata.getProprietaAutenticazioneList().clear();
  109.         List<Proprieta> proprietaAutenticazione = this.convertToAutenticazioneProprieta(fruizioneAutenticazione, fruizioneAutenticazionePrincipal, fruizioneAutenticazioneParametroList);
  110.         if(proprietaAutenticazione!=null && !proprietaAutenticazione.isEmpty()) {
  111.             portaDelegata.getProprietaAutenticazioneList().addAll(proprietaAutenticazione);
  112.         }
  113.        
  114.         portaDelegata.setAutorizzazione(AutorizzazioneUtilities.convertToTipoAutorizzazioneAsString(fruizioneAutorizzazione,
  115.                 ServletUtils.isCheckBoxEnabled(fruizioneAutorizzazioneAutenticati),
  116.                 ServletUtils.isCheckBoxEnabled(fruizioneAutorizzazioneRuoli),
  117.                 ServletUtils.isCheckBoxEnabled(autorizzazioneAutenticatiToken),
  118.                 ServletUtils.isCheckBoxEnabled(autorizzazioneRuoliToken),
  119.                 ServletUtils.isCheckBoxEnabled(fruizioneAutorizzazioneScope),
  120.                 fruizioneAutorizzazioneTokenOptions,
  121.                 RuoloTipologia.toEnumConstant(fruizioneAutorizzazioneRuoliTipologia)));
  122.        
  123.         if(fruizioneAutorizzazione != null && fruizioneAutorizzazione.equals(AutorizzazioneUtilities.STATO_XACML_POLICY) && allegatoXacmlPolicy.getValue() != null) {
  124.             portaDelegata.setXacmlPolicy(new String(allegatoXacmlPolicy.getValue()));
  125.         } else {
  126.             portaDelegata.setXacmlPolicy(null);
  127.         }
  128.        
  129.         if(fruizioneAutorizzazioneRuoliMatch!=null && !"".equals(fruizioneAutorizzazioneRuoliMatch)){
  130.             RuoloTipoMatch tipoRuoloMatch = RuoloTipoMatch.toEnumConstant(fruizioneAutorizzazioneRuoliMatch);
  131.             if(tipoRuoloMatch!=null){
  132.                 if(portaDelegata.getRuoli()==null){
  133.                     portaDelegata.setRuoli(new AutorizzazioneRuoli());
  134.                 }
  135.                 portaDelegata.getRuoli().setMatch(tipoRuoloMatch);
  136.             }
  137.         }

  138.         // servizioApplicativo
  139.         if(fruizioneServizioApplicativo!=null && !"".equals(fruizioneServizioApplicativo) && !"-".equals(fruizioneServizioApplicativo)){
  140.             PortaDelegataServizioApplicativo sa = new PortaDelegataServizioApplicativo();
  141.             sa.setNome(fruizioneServizioApplicativo);
  142.             portaDelegata.addServizioApplicativo(sa);
  143.         }

  144.         // ruolo
  145.         if(fruizioneRuolo!=null && !"".equals(fruizioneRuolo) && !"-".equals(fruizioneRuolo)){
  146.             if(portaDelegata.getRuoli()==null){
  147.                 portaDelegata.setRuoli(new AutorizzazioneRuoli());
  148.             }
  149.             Ruolo ruolo = new Ruolo();
  150.             ruolo.setNome(fruizioneRuolo);
  151.             portaDelegata.getRuoli().addRuolo(ruolo);
  152.         }
  153.        
  154.         // token applicativi
  155.         if(ServletUtils.isCheckBoxEnabled(autorizzazioneAutenticatiToken)) {
  156.             if(portaDelegata.getAutorizzazioneToken()==null) {
  157.                 portaDelegata.setAutorizzazioneToken(new PortaDelegataAutorizzazioneToken() );
  158.             }
  159.             portaDelegata.getAutorizzazioneToken().setAutorizzazioneApplicativi(StatoFunzionalita.ABILITATO);
  160.         }
  161.         else {
  162.             if(portaDelegata.getAutorizzazioneToken()!=null) {
  163.                 portaDelegata.getAutorizzazioneToken().setAutorizzazioneApplicativi(null);
  164.                 portaDelegata.getAutorizzazioneToken().setServiziApplicativi(null);
  165.             }
  166.         }
  167.        
  168.         // token ruoli
  169.         if(ServletUtils.isCheckBoxEnabled(autorizzazioneRuoliToken)) {
  170.             if(portaDelegata.getAutorizzazioneToken()==null) {
  171.                 portaDelegata.setAutorizzazioneToken(new PortaDelegataAutorizzazioneToken() );
  172.             }
  173.             portaDelegata.getAutorizzazioneToken().setAutorizzazioneRuoli(StatoFunzionalita.ABILITATO);
  174.            
  175.             if(autorizzazioneRuoliTipologiaToken!=null && !"".equals(autorizzazioneRuoliTipologiaToken)){
  176.                 org.openspcoop2.core.config.constants.RuoloTipologia ruoloTipologia = org.openspcoop2.core.config.constants.RuoloTipologia.toEnumConstant(autorizzazioneRuoliTipologiaToken);
  177.                 portaDelegata.getAutorizzazioneToken().setTipologiaRuoli(ruoloTipologia);
  178.             }
  179.             else {
  180.                 portaDelegata.getAutorizzazioneToken().setTipologiaRuoli(null);
  181.             }
  182.            
  183.             if(autorizzazioneRuoliMatchToken!=null && !"".equals(autorizzazioneRuoliMatchToken)){
  184.                 RuoloTipoMatch ruoloTipoMatch = RuoloTipoMatch.toEnumConstant(autorizzazioneRuoliMatchToken);
  185.                 if(ruoloTipoMatch!=null){
  186.                     if(portaDelegata.getAutorizzazioneToken().getRuoli()==null){
  187.                         portaDelegata.getAutorizzazioneToken().setRuoli(new AutorizzazioneRuoli());
  188.                     }
  189.                     portaDelegata.getAutorizzazioneToken().getRuoli().setMatch(ruoloTipoMatch);
  190.                 }
  191.                 else {
  192.                     if(portaDelegata.getAutorizzazioneToken().getRuoli()!=null){
  193.                         portaDelegata.getAutorizzazioneToken().getRuoli().setMatch(null);
  194.                     }
  195.                 }
  196.             }
  197.             else {
  198.                 if(portaDelegata.getAutorizzazioneToken().getRuoli()!=null){
  199.                     portaDelegata.getAutorizzazioneToken().getRuoli().setMatch(null);
  200.                 }
  201.             }
  202.         }
  203.         else {
  204.             if(portaDelegata.getAutorizzazioneToken()!=null) {
  205.                 portaDelegata.getAutorizzazioneToken().setAutorizzazioneRuoli(null);
  206.                 portaDelegata.getAutorizzazioneToken().setTipologiaRuoli(null);
  207.                 portaDelegata.getAutorizzazioneToken().setRuoli(null);
  208.             }
  209.         }
  210.        
  211.         // token options
  212.         // impostato in configureControlloAccessiGestioneToken
  213.        
  214.         // scope
  215.         if(ServletUtils.isCheckBoxEnabled(fruizioneAutorizzazioneScope)) {
  216.             if(portaDelegata.getScope() == null)
  217.                 portaDelegata.setScope(new AutorizzazioneScope());
  218.            
  219.             portaDelegata.getScope().setStato(StatoFunzionalita.ABILITATO);
  220.         }
  221.         else {
  222.             portaDelegata.setScope(null);
  223.         }
  224.         if(fruizioneScope!=null && !"".equals(fruizioneScope) && !"-".equals(fruizioneScope)){
  225.             if(portaDelegata.getScope() == null) {
  226.                 portaDelegata.setScope(new AutorizzazioneScope());
  227.             }
  228.             Scope scope = new Scope();
  229.             scope.setNome(fruizioneScope);
  230.             portaDelegata.getScope().addScope(scope);
  231.         }
  232.         if(fruizioneAutorizzazioneScopeMatch!=null && !"".equals(fruizioneAutorizzazioneScopeMatch)){
  233.             ScopeTipoMatch scopeTipoMatch = ScopeTipoMatch.toEnumConstant(fruizioneAutorizzazioneScopeMatch);
  234.             if(scopeTipoMatch!=null){
  235.                 if(portaDelegata.getScope()==null){
  236.                     portaDelegata.setScope(new AutorizzazioneScope());
  237.                 }
  238.                 portaDelegata.getScope().setMatch(scopeTipoMatch);
  239.             }
  240.         }
  241.        
  242.         // attribute authority
  243.         while (portaDelegata.sizeAttributeAuthorityList()>0) {
  244.             portaDelegata.removeAttributeAuthority(0);
  245.         }
  246.         if(StatoFunzionalita.ABILITATO.getValue().equals(identificazioneAttributiStato) && attributeAuthoritySelezionate!=null && attributeAuthoritySelezionate.length>0) {
  247.             for (String aaName : attributeAuthoritySelezionate) {
  248.                 portaDelegata.addAttributeAuthority(this.buildAttributeAuthority(attributeAuthoritySelezionate.length, aaName, attributeAuthorityAttributi));
  249.             }
  250.         }
  251.     }
  252.    
  253.     public void configureControlloAccessiGestioneToken (PortaDelegata portaDelegata, String gestioneToken,
  254.             String gestioneTokenPolicy, String gestioneTokenOpzionale,  
  255.             String gestioneTokenValidazioneInput, String gestioneTokenIntrospection, String gestioneTokenUserInfo, String gestioneTokenForward,
  256.             String autenticazioneTokenIssuer, String autenticazioneTokenClientId, String autenticazioneTokenSubject, String autenticazioneTokenUsername, String autenticazioneTokenEMail,
  257.             String autorizzazioneTokenOptions) {
  258.         if(portaDelegata.getGestioneToken() == null)
  259.             portaDelegata.setGestioneToken(new GestioneToken());
  260.        
  261.         if(gestioneToken!=null && gestioneToken.equals(StatoFunzionalita.ABILITATO.getValue())) {
  262.             portaDelegata.getGestioneToken().setPolicy(gestioneTokenPolicy);
  263.             if(ServletUtils.isCheckBoxEnabled(gestioneTokenOpzionale)) {
  264.                 portaDelegata.getGestioneToken().setTokenOpzionale(StatoFunzionalita.ABILITATO);
  265.             }
  266.             else {
  267.                 portaDelegata.getGestioneToken().setTokenOpzionale(StatoFunzionalita.DISABILITATO);
  268.             }
  269.             portaDelegata.getGestioneToken().setValidazione(StatoFunzionalitaConWarning.toEnumConstant(gestioneTokenValidazioneInput));
  270.             portaDelegata.getGestioneToken().setIntrospection(StatoFunzionalitaConWarning.toEnumConstant(gestioneTokenIntrospection));
  271.             portaDelegata.getGestioneToken().setUserInfo(StatoFunzionalitaConWarning.toEnumConstant(gestioneTokenUserInfo));
  272.             portaDelegata.getGestioneToken().setForward(StatoFunzionalita.toEnumConstant(gestioneTokenForward));
  273.             portaDelegata.getGestioneToken().setOptions(autorizzazioneTokenOptions);
  274.             if(portaDelegata.getGestioneToken().getAutenticazione()==null) {
  275.                 portaDelegata.getGestioneToken().setAutenticazione(new GestioneTokenAutenticazione());
  276.             }
  277.             portaDelegata.getGestioneToken().getAutenticazione().setIssuer(ServletUtils.isCheckBoxEnabled(autenticazioneTokenIssuer) ? StatoFunzionalita.ABILITATO : StatoFunzionalita.toEnumConstant(autenticazioneTokenIssuer));
  278.             portaDelegata.getGestioneToken().getAutenticazione().setClientId(ServletUtils.isCheckBoxEnabled(autenticazioneTokenClientId) ? StatoFunzionalita.ABILITATO : StatoFunzionalita.toEnumConstant(autenticazioneTokenClientId));
  279.             portaDelegata.getGestioneToken().getAutenticazione().setSubject(ServletUtils.isCheckBoxEnabled(autenticazioneTokenSubject) ? StatoFunzionalita.ABILITATO : StatoFunzionalita.toEnumConstant(autenticazioneTokenSubject));
  280.             portaDelegata.getGestioneToken().getAutenticazione().setUsername(ServletUtils.isCheckBoxEnabled(autenticazioneTokenUsername) ? StatoFunzionalita.ABILITATO : StatoFunzionalita.toEnumConstant(autenticazioneTokenUsername));
  281.             portaDelegata.getGestioneToken().getAutenticazione().setEmail(ServletUtils.isCheckBoxEnabled(autenticazioneTokenEMail) ? StatoFunzionalita.ABILITATO : StatoFunzionalita.toEnumConstant(autenticazioneTokenEMail));
  282.         } else {
  283.             portaDelegata.getGestioneToken().setPolicy(null);
  284.             portaDelegata.getGestioneToken().setTokenOpzionale(StatoFunzionalita.DISABILITATO);
  285.             portaDelegata.getGestioneToken().setValidazione(StatoFunzionalitaConWarning.DISABILITATO);
  286.             portaDelegata.getGestioneToken().setIntrospection(StatoFunzionalitaConWarning.DISABILITATO);
  287.             portaDelegata.getGestioneToken().setUserInfo(StatoFunzionalitaConWarning.DISABILITATO);
  288.             portaDelegata.getGestioneToken().setForward(StatoFunzionalita.DISABILITATO);
  289.             portaDelegata.getGestioneToken().setOptions(null);
  290.             if(portaDelegata.getGestioneToken().getAutenticazione()!=null) {
  291.                 portaDelegata.getGestioneToken().setAutenticazione(null);
  292.             }
  293.         }
  294.     }
  295.    
  296.    
  297.     public List<PortaDelegata> getPorteDelegateWithServizio(Long idServizio) throws DriverConfigurazioneException {
  298.         Connection con = null;
  299.         String nomeMetodo = "getPorteDelegateWithServizio";
  300.         DriverControlStationDB driver = null;

  301.         try {
  302.             // prendo una connessione
  303.             con = ControlStationCore.dbM.getConnection();
  304.             // istanzio il driver
  305.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  306.             return driver.getDriverConfigurazioneDB().getPorteDelegateWithServizio(idServizio);

  307.         } catch (Exception e) {
  308.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  309.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  310.         } finally {
  311.             ControlStationCore.dbM.releaseConnection(con);
  312.         }
  313.     }
  314.    
  315.     public List<PortaDelegata> porteDelegateWithSoggettoErogatoreList(long idSoggettoErogatore) throws DriverConfigurazioneException {
  316.         Connection con = null;
  317.         String nomeMetodo = "porteDelegateWithSoggettoErogatoreList";
  318.         DriverControlStationDB driver = null;

  319.         try {
  320.             // prendo una connessione
  321.             con = ControlStationCore.dbM.getConnection();
  322.             // istanzio il driver
  323.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  324.             return driver.getDriverConfigurazioneDB().porteDelegateWithSoggettoErogatoreList(idSoggettoErogatore);

  325.         } catch (Exception e) {
  326.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  327.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  328.         } finally {
  329.             ControlStationCore.dbM.releaseConnection(con);
  330.         }
  331.     }

  332.     public List<PortaDelegata> porteDelegateWithTipoNomeErogatoreList(String tipoSoggettoErogatore, String nomeSoggettoErogatore) throws DriverConfigurazioneException {
  333.         Connection con = null;
  334.         String nomeMetodo = "porteDelegateWithTipoNomeErogatoreList";
  335.         DriverControlStationDB driver = null;

  336.         try {
  337.             // prendo una connessione
  338.             con = ControlStationCore.dbM.getConnection();
  339.             // istanzio il driver
  340.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  341.             return driver.getDriverConfigurazioneDB().porteDelegateWithTipoNomeErogatoreList(tipoSoggettoErogatore, nomeSoggettoErogatore);

  342.         } catch (Exception e) {
  343.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  344.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  345.         } finally {
  346.             ControlStationCore.dbM.releaseConnection(con);
  347.         }
  348.     }
  349.    
  350.     public List<PortaDelegata> getPorteDelegateWithServizio(Long idServizio, String tiposervizio, String nomeservizio, Integer versioneServizio,
  351.             Long idSoggetto, String tiposoggetto, String nomesoggetto) throws DriverConfigurazioneException {
  352.         Connection con = null;
  353.         String nomeMetodo = "getPorteDelegateWithServizio";
  354.         DriverControlStationDB driver = null;

  355.         try {
  356.             // prendo una connessione
  357.             con = ControlStationCore.dbM.getConnection();
  358.             // istanzio il driver
  359.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  360.             return driver.getDriverConfigurazioneDB().getPorteDelegateWithServizio(idServizio, tiposervizio, nomeservizio, versioneServizio,
  361.                     idSoggetto, tiposoggetto, nomesoggetto);

  362.         } catch (Exception e) {
  363.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  364.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  365.         } finally {
  366.             ControlStationCore.dbM.releaseConnection(con);
  367.         }
  368.     }

  369.     public boolean existsPortaDelegataAzione(String nome) throws DriverConfigurazioneException {
  370.         Connection con = null;
  371.         String nomeMetodo = "existsPortaDelegataAzione";
  372.         DriverControlStationDB driver = null;

  373.         try {
  374.             // prendo una connessione
  375.             con = ControlStationCore.dbM.getConnection();
  376.             // istanzio il driver
  377.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  378.             return driver.getDriverConfigurazioneDB().existsPortaDelegataAzione(nome);

  379.         } catch (Exception e) {
  380.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  381.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  382.         } finally {
  383.             ControlStationCore.dbM.releaseConnection(con);
  384.         }
  385.     }
  386.    
  387.     public boolean existsPortaDelegata(IDPortaDelegata idPD) throws DriverConfigurazioneException {
  388.         Connection con = null;
  389.         String nomeMetodo = "existsPortaDelegata";
  390.         DriverControlStationDB driver = null;

  391.         try {
  392.             // prendo una connessione
  393.             con = ControlStationCore.dbM.getConnection();
  394.             // istanzio il driver
  395.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  396.             return driver.getDriverConfigurazioneDB().existsPortaDelegata(idPD);

  397.         } catch (Exception e) {
  398.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  399.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  400.         } finally {
  401.             ControlStationCore.dbM.releaseConnection(con);
  402.         }
  403.     }
  404.    
  405.     public List<MessageSecurityFlowParameter> porteDelegateMessageSecurityRequestList(long idPortaDelegata, ISearch ricerca) throws DriverConfigurazioneException {
  406.         Connection con = null;
  407.         String nomeMetodo = "porteDelegateMessageSecurityRequestList";
  408.         DriverControlStationDB driver = null;

  409.         try {
  410.             // prendo una connessione
  411.             con = ControlStationCore.dbM.getConnection();
  412.             // istanzio il driver
  413.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  414.             return driver.getDriverConfigurazioneDB().porteDelegateMessageSecurityRequestList(idPortaDelegata, ricerca);

  415.         } catch (Exception e) {
  416.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  417.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  418.         } finally {
  419.             ControlStationCore.dbM.releaseConnection(con);
  420.         }

  421.     }

  422.     public List<MessageSecurityFlowParameter> porteDelegateMessageSecurityResponseList(long idPortaDelegata, ISearch ricerca) throws DriverConfigurazioneException {
  423.         Connection con = null;
  424.         String nomeMetodo = "porteDelegateMessageSecurityResponseList";
  425.         DriverControlStationDB driver = null;

  426.         try {
  427.             // prendo una connessione
  428.             con = ControlStationCore.dbM.getConnection();
  429.             // istanzio il driver
  430.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  431.             return driver.getDriverConfigurazioneDB().porteDelegateMessageSecurityResponseList(idPortaDelegata, ricerca);

  432.         } catch (Exception e) {
  433.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  434.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  435.         } finally {
  436.             ControlStationCore.dbM.releaseConnection(con);
  437.         }

  438.     }
  439.    
  440.     public PortaDelegata getPortaDelegata(IDPortaDelegata idPD) throws DriverConfigurazioneException, DriverConfigurazioneNotFound {
  441.         Connection con = null;
  442.         String nomeMetodo = "getPortaDelegata(id)";
  443.         DriverControlStationDB driver = null;

  444.         try {
  445.             // prendo una connessione
  446.             con = ControlStationCore.dbM.getConnection();
  447.             // istanzio il driver
  448.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  449.             return driver.getDriverConfigurazioneDB().getPortaDelegata(idPD);

  450.         } catch (DriverConfigurazioneNotFound de) {
  451.             ControlStationCore.logDebug("[ControlStationCore::" + nomeMetodo + "] Exception :" + de.getMessage(),de);
  452.             throw de;
  453.         } catch (Exception e) {
  454.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  455.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  456.         } finally {
  457.             ControlStationCore.dbM.releaseConnection(con);
  458.         }

  459.     }
  460.    
  461.     public PortaDelegata getPortaDelegata(long idPortaDelegata) throws DriverConfigurazioneNotFound, DriverConfigurazioneException {
  462.         Connection con = null;
  463.         String nomeMetodo = "getPortaDelegata(long)";
  464.         DriverControlStationDB driver = null;

  465.         try {
  466.             // prendo una connessione
  467.             con = ControlStationCore.dbM.getConnection();
  468.             // istanzio il driver
  469.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  470.             return driver.getDriverConfigurazioneDB().getPortaDelegata(idPortaDelegata);

  471.         } catch (DriverConfigurazioneNotFound de) {
  472.             ControlStationCore.logDebug("[ControlStationCore::" + nomeMetodo + "] Exception :" + de.getMessage(),de);
  473.             throw de;
  474.         } catch (Exception e) {
  475.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  476.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  477.         } finally {
  478.             ControlStationCore.dbM.releaseConnection(con);
  479.         }
  480.     }
  481.    
  482.     public ProprietaOggetto getProprietaOggetto(IDPortaDelegata idPD) throws DriverConfigurazioneException, DriverConfigurazioneNotFound {
  483.         Connection con = null;
  484.         String nomeMetodo = "getProprietaOggetto(id)";
  485.         DriverControlStationDB driver = null;

  486.         try {
  487.             // prendo una connessione
  488.             con = ControlStationCore.dbM.getConnection();
  489.             // istanzio il driver
  490.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  491.             return driver.getDriverConfigurazioneDB().getProprietaOggetto(idPD);

  492.         } catch (DriverConfigurazioneNotFound de) {
  493.             ControlStationCore.logDebug("[ControlStationCore::" + nomeMetodo + "] Exception :" + de.getMessage(),de);
  494.             throw de;
  495.         } catch (Exception e) {
  496.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  497.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  498.         } finally {
  499.             ControlStationCore.dbM.releaseConnection(con);
  500.         }
  501.     }
  502.    
  503.     public void updateProprietaOggetto(IDPortaDelegata idPD, String user) throws DriverConfigurazioneException {
  504.         Connection con = null;
  505.         String nomeMetodo = "updateProprietaOggetto";
  506.         DriverControlStationDB driver = null;

  507.         try {
  508.             // prendo una connessione
  509.             con = ControlStationCore.dbM.getConnection();
  510.             // istanzio il driver
  511.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  512.             driver.getDriverConfigurazioneDB().updateProprietaOggetto(idPD, user);

  513.         }catch (Exception e) {
  514.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  515.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  516.         } finally {
  517.             ControlStationCore.dbM.releaseConnection(con);
  518.         }
  519.     }
  520.    
  521.     public boolean azioneUsataInTrasformazioniPortaDelegata(String nome) throws DriverConfigurazioneException {
  522.         Connection con = null;
  523.         String nomeMetodo = "azioneUsataInTrasformazioniPortaDelegata";
  524.         DriverControlStationDB driver = null;

  525.         try {
  526.             // prendo una connessione
  527.             con = ControlStationCore.dbM.getConnection();
  528.             // istanzio il driver
  529.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  530.             return driver.getDriverConfigurazioneDB().azioneUsataInTrasformazioniPortaDelegata(nome);

  531.         } catch (Exception e) {
  532.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  533.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  534.         } finally {
  535.             ControlStationCore.dbM.releaseConnection(con);
  536.         }
  537.     }
  538.    
  539.     public List<MappingFruizionePortaDelegata> getMappingConGruppiPerAzione(String nomeAzione, List<IDServizio> list) throws DriverConfigurazioneException {
  540.         Connection con = null;
  541.         String nomeMetodo = "getMappingConGruppiPerAzione";
  542.        
  543.         try {
  544.             // prendo una connessione
  545.             con = ControlStationCore.dbM.getConnection();
  546.            
  547.             List<MappingFruizionePortaDelegata> listInUtilizzo = new ArrayList<>();
  548.            
  549.             if(list!=null && !list.isEmpty()) {
  550.                 for (IDServizio idServizio : list) {
  551.                    
  552.                     AccordiServizioParteSpecificaCore aspsCore = new AccordiServizioParteSpecificaCore(this);
  553.                     Long idS = aspsCore.getIdAccordoServizioParteSpecifica(con, idServizio);
  554.                     ConsoleSearch s = new ConsoleSearch(true);
  555.                     List<Fruitore> listFruitori = aspsCore.serviziFruitoriList(con, idS, s);
  556.                     if(listFruitori!=null && !listFruitori.isEmpty()) {
  557.                    
  558.                         for (Fruitore fruitore : listFruitori) {
  559.                             IDSoggetto idSoggettoFruitore = new IDSoggetto(fruitore.getTipo(), fruitore.getNome());
  560.                             List<MappingFruizionePortaDelegata> lPD = DBMappingUtils.mappingFruizionePortaDelegataList(con, this.tipoDB, idSoggettoFruitore, idServizio, false);
  561.                             if(lPD!=null && !lPD.isEmpty()) {
  562.                                 for (MappingFruizionePortaDelegata mapping : lPD) {
  563.                                     fill(nomeAzione, mapping, listInUtilizzo);
  564.                                 }
  565.                             }
  566.                         }
  567.                        
  568.                     }
  569.                 }
  570.             }
  571.                
  572.             return listInUtilizzo;

  573.         } catch (Exception e) {
  574.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  575.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  576.         } finally {
  577.             ControlStationCore.dbM.releaseConnection(con);
  578.         }
  579.     }
  580.     private void fill(String nomeAzione, MappingFruizionePortaDelegata mapping, List<MappingFruizionePortaDelegata> listInUtilizzo) throws DriverConfigurazioneException {
  581.         try {
  582.             PortaDelegata pd = this.getPortaDelegata(mapping.getIdPortaDelegata());
  583.             if(pd!=null && pd.getAzione()!=null && pd.getAzione().getAzioneDelegataList()!=null &&
  584.                     pd.getAzione().getAzioneDelegataList().contains(nomeAzione)) {
  585.                 listInUtilizzo.add(mapping);
  586.             }
  587.         }catch(DriverConfigurazioneNotFound notFound) {
  588.             // ignore
  589.         }
  590.     }
  591.    
  592.     public List<MappingFruizionePortaDelegata> getMapping(List<IDServizio> list, boolean addDefault, boolean addNotDefault) throws DriverConfigurazioneException {
  593.         Connection con = null;
  594.         String nomeMetodo = "getMapping";
  595.        
  596.         try {
  597.             // prendo una connessione
  598.             con = ControlStationCore.dbM.getConnection();
  599.            
  600.             List<MappingFruizionePortaDelegata> listMappingDefault = new ArrayList<>();
  601.            
  602.             if(list!=null && !list.isEmpty()) {
  603.                 for (IDServizio idServizio : list) {
  604.                    
  605.                     AccordiServizioParteSpecificaCore aspsCore = new AccordiServizioParteSpecificaCore(this);
  606.                     Long idS = aspsCore.getIdAccordoServizioParteSpecifica(con, idServizio);
  607.                     ConsoleSearch s = new ConsoleSearch(true);
  608.                     List<Fruitore> listFruitori = aspsCore.serviziFruitoriList(con, idS, s);
  609.                     if(listFruitori!=null && !listFruitori.isEmpty()) {
  610.                    
  611.                         for (Fruitore fruitore : listFruitori) {
  612.                             IDSoggetto idSoggettoFruitore = new IDSoggetto(fruitore.getTipo(), fruitore.getNome());
  613.                             List<MappingFruizionePortaDelegata> lPD = DBMappingUtils.mappingFruizionePortaDelegataList(con, this.tipoDB, idSoggettoFruitore, idServizio, false);
  614.                             if(lPD!=null && !lPD.isEmpty()) {
  615.                                 for (MappingFruizionePortaDelegata mapping : lPD) {
  616.                                     if(mapping.isDefault()) {
  617.                                         if(addDefault) {
  618.                                             listMappingDefault.add(mapping);
  619.                                         }
  620.                                     }
  621.                                     else {
  622.                                         if(addNotDefault) {
  623.                                             listMappingDefault.add(mapping);
  624.                                         }
  625.                                     }
  626.                                 }
  627.                             }
  628.                         }
  629.                        
  630.                     }
  631.                 }
  632.             }
  633.            
  634.             return listMappingDefault;

  635.         } catch (Exception e) {
  636.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  637.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  638.         } finally {
  639.             ControlStationCore.dbM.releaseConnection(con);
  640.         }
  641.     }
  642.    
  643.     public List<IDPortaDelegata> getPortaDelegataAzione(String nome) throws DriverConfigurazioneException, DriverConfigurazioneNotFound {
  644.         Connection con = null;
  645.         String nomeMetodo = "getPortaDelegataAzione";
  646.         DriverControlStationDB driver = null;

  647.         try {
  648.             // prendo una connessione
  649.             con = ControlStationCore.dbM.getConnection();
  650.             // istanzio il driver
  651.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  652.             return driver.getDriverConfigurazioneDB().getPortaDelegataAzione(nome);

  653.         } catch (Exception e) {
  654.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  655.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  656.         } finally {
  657.             ControlStationCore.dbM.releaseConnection(con);
  658.         }
  659.     }

  660.    
  661.     public long getIdPortaDelegata(String nomePorta) throws DriverConfigurazioneException {
  662.         Connection con = null;
  663.         String nomeMetodo = "getPortaDelegata";
  664.    
  665.         try {
  666.             // prendo una connessione
  667.             con = ControlStationCore.dbM.getConnection();
  668.             return DBUtils.getIdPortaDelegata(nomePorta,  con, this.getTipoDatabase());

  669.         }catch (Exception e) {
  670.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  671.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  672.         } finally {
  673.             ControlStationCore.dbM.releaseConnection(con);
  674.         }
  675.     }
  676.    
  677.     public List<IDPortaDelegata> getAllIdPorteDelegate(FiltroRicercaPorteDelegate filtroRicerca) throws DriverConfigurazioneException {
  678.         Connection con = null;
  679.         String nomeMetodo = "getAllIdPorteDelegate";
  680.         DriverControlStationDB driver = null;

  681.         try {
  682.             // prendo una connessione
  683.             con = ControlStationCore.dbM.getConnection();
  684.             // istanzio il driver
  685.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  686.             return driver.getDriverConfigurazioneDB().getAllIdPorteDelegate(filtroRicerca);

  687.         } catch (DriverConfigurazioneNotFound notFound) {
  688.             ControlStationCore.logDebug(getPrefixError(nomeMetodo,  notFound), notFound);
  689.             return new ArrayList<>();
  690.         } catch (Exception e) {
  691.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  692.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  693.         } finally {
  694.             ControlStationCore.dbM.releaseConnection(con);
  695.         }

  696.     }

  697.     public List<PortaDelegata> porteDelegateList(long idSoggetto, ISearch ricerca) throws DriverConfigurazioneException {
  698.         Connection con = null;
  699.         String nomeMetodo = "porteDelegateList";
  700.         DriverControlStationDB driver = null;

  701.         try {
  702.             // prendo una connessione
  703.             con = ControlStationCore.dbM.getConnection();
  704.             // istanzio il driver
  705.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  706.             return driver.getDriverConfigurazioneDB().porteDelegateList(idSoggetto, ricerca);

  707.         } catch (Exception e) {
  708.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  709.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  710.         } finally {
  711.             ControlStationCore.dbM.releaseConnection(con);
  712.         }

  713.     }
  714.    
  715.     public List<PortaDelegata> porteDelegateList(String superUser, ISearch ricerca) throws DriverConfigurazioneException {
  716.         Connection con = null;
  717.         String nomeMetodo = "porteDelegateList";
  718.         DriverControlStationDB driver = null;

  719.         try {
  720.             // prendo una connessione
  721.             con = ControlStationCore.dbM.getConnection();
  722.             // istanzio il driver
  723.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  724.             return driver.getDriverConfigurazioneDB().porteDelegateList(superUser, ricerca);

  725.         } catch (Exception e) {
  726.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  727.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  728.         } finally {
  729.             ControlStationCore.dbM.releaseConnection(con);
  730.         }

  731.     }

  732.     public List<ServizioApplicativo> porteDelegateServizioApplicativoList(long idPortaDelegata, ISearch ricerca) throws DriverConfigurazioneException {
  733.         Connection con = null;
  734.         String nomeMetodo = "porteDelegateServizioApplicativoList";
  735.         DriverControlStationDB driver = null;

  736.         try {
  737.             // prendo una connessione
  738.             con = ControlStationCore.dbM.getConnection();
  739.             // istanzio il driver
  740.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  741.             return driver.getDriverConfigurazioneDB().porteDelegateServizioApplicativoList(idPortaDelegata, ricerca);

  742.         } catch (Exception e) {
  743.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  744.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  745.         } finally {
  746.             ControlStationCore.dbM.releaseConnection(con);
  747.         }

  748.     }
  749.    
  750.     public List<ServizioApplicativo> porteDelegateServizioApplicativoTokenList(long idPortaDelegata, ISearch ricerca) throws DriverConfigurazioneException {
  751.         Connection con = null;
  752.         String nomeMetodo = "porteDelegateServizioApplicativoTokenList";
  753.         DriverControlStationDB driver = null;

  754.         try {
  755.             // prendo una connessione
  756.             con = ControlStationCore.dbM.getConnection();
  757.             // istanzio il driver
  758.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  759.             return driver.getDriverConfigurazioneDB().porteDelegateServizioApplicativoTokenList(idPortaDelegata, ricerca);

  760.         } catch (Exception e) {
  761.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  762.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  763.         } finally {
  764.             ControlStationCore.dbM.releaseConnection(con);
  765.         }

  766.     }
  767.    
  768.     public List<CorrelazioneApplicativaElemento> porteDelegateCorrelazioneApplicativaList(long idPortaDelegata, ISearch ricerca) throws DriverConfigurazioneException {
  769.         Connection con = null;
  770.         String nomeMetodo = "porteDelegateCorrelazioneApplicativaList";
  771.         DriverControlStationDB driver = null;

  772.         try {
  773.             // prendo una connessione
  774.             con = ControlStationCore.dbM.getConnection();
  775.             // istanzio il driver
  776.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  777.             return driver.getDriverConfigurazioneDB().porteDelegateCorrelazioneApplicativaList(idPortaDelegata, ricerca);

  778.         } catch (Exception e) {
  779.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  780.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  781.         } finally {
  782.             ControlStationCore.dbM.releaseConnection(con);
  783.         }

  784.     }
  785.    
  786.     public List<CorrelazioneApplicativaRispostaElemento> porteDelegateCorrelazioneApplicativaRispostaList(long idPortaDelegata, ISearch ricerca) throws DriverConfigurazioneException {
  787.         Connection con = null;
  788.         String nomeMetodo = "porteDelegateCorrelazioneApplicativaRispostaList";
  789.         DriverControlStationDB driver = null;

  790.         try {
  791.             // prendo una connessione
  792.             con = ControlStationCore.dbM.getConnection();
  793.             // istanzio il driver
  794.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  795.             return driver.getDriverConfigurazioneDB().porteDelegateCorrelazioneApplicativaRispostaList(idPortaDelegata, ricerca);

  796.         } catch (Exception e) {
  797.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  798.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e));
  799.         } finally {
  800.             ControlStationCore.dbM.releaseConnection(con);
  801.         }

  802.     }
  803.    
  804.     public List<MtomProcessorFlowParameter> porteDelegateMTOMRequestList(long idPortaDelegata, ISearch ricerca) throws DriverConfigurazioneException {
  805.         Connection con = null;
  806.         String nomeMetodo = "porteDelegateMTOMRequestList";
  807.         DriverControlStationDB driver = null;

  808.         try {
  809.             // prendo una connessione
  810.             con = ControlStationCore.dbM.getConnection();
  811.             // istanzio il driver
  812.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  813.             return driver.getDriverConfigurazioneDB().porteDelegateMTOMRequestList(idPortaDelegata, ricerca);

  814.         } catch (Exception e) {
  815.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  816.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  817.         } finally {
  818.             ControlStationCore.dbM.releaseConnection(con);
  819.         }

  820.     }

  821.     public List<MtomProcessorFlowParameter> porteDelegateMTOMResponseList(long idPortaDelegata, ISearch ricerca) throws DriverConfigurazioneException {
  822.         Connection con = null;
  823.         String nomeMetodo = "porteDelegateMTOMResponseList";
  824.         DriverControlStationDB driver = null;

  825.         try {
  826.             // prendo una connessione
  827.             con = ControlStationCore.dbM.getConnection();
  828.             // istanzio il driver
  829.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  830.             return driver.getDriverConfigurazioneDB().porteDelegateMTOMResponseList(idPortaDelegata, ricerca);

  831.         } catch (Exception e) {
  832.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  833.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  834.         } finally {
  835.             ControlStationCore.dbM.releaseConnection(con);
  836.         }

  837.     }
  838.    
  839.    
  840.    
  841.     public IDPortaDelegata getIDPortaDelegataAssociataDefault(IDServizio idServizio, IDSoggetto fruitore) throws DriverConfigurazioneException {
  842.         Connection con = null;
  843.         String nomeMetodo = "getIDPortaDelegataAssociataDefault";
  844.         DriverControlStationDB driver = null;

  845.         try {
  846.             // prendo una connessione
  847.             con = ControlStationCore.dbM.getConnection();
  848.             // istanzio il driver
  849.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  850.             return driver.getIDPortaDelegataAssociataDefault(idServizio,fruitore);

  851.         } catch (Exception e) {
  852.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  853.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  854.         } finally {
  855.             ControlStationCore.dbM.releaseConnection(con);
  856.         }
  857.     }
  858.    
  859.     public IDPortaDelegata getIDPortaDelegataAssociataAzione(IDServizio idServizio, IDSoggetto fruitore) throws DriverConfigurazioneException {
  860.         Connection con = null;
  861.         String nomeMetodo = "getIDPortaDelegataAssociataAzione";
  862.         DriverControlStationDB driver = null;

  863.         try {
  864.             // prendo una connessione
  865.             con = ControlStationCore.dbM.getConnection();
  866.             // istanzio il driver
  867.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  868.             return driver.getIDPortaDelegataAssociataAzione(idServizio,fruitore);

  869.         } catch (Exception e) {
  870.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  871.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  872.         } finally {
  873.             ControlStationCore.dbM.releaseConnection(con);
  874.         }
  875.     }
  876.    
  877.     public List<IDPortaDelegata> getIDPorteDelegateAssociate(IDServizio idServizio, IDSoggetto fruitore) throws DriverConfigurazioneException {
  878.         Connection con = null;
  879.         String nomeMetodo = "getIDPorteDelegateAssociate";
  880.         DriverControlStationDB driver = null;

  881.         try {
  882.             // prendo una connessione
  883.             con = ControlStationCore.dbM.getConnection();
  884.             // istanzio il driver
  885.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  886.             return driver.getIDPorteDelegateAssociate(idServizio,fruitore);

  887.         } catch (Exception e) {
  888.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  889.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  890.         } finally {
  891.             ControlStationCore.dbM.releaseConnection(con);
  892.         }
  893.     }
  894.    
  895.     public boolean existsMappingFruizionePortaDelegata(MappingFruizionePortaDelegata mapping) throws DriverConfigurazioneException {
  896.         Connection con = null;
  897.         String nomeMetodo = "existsMappingFruizionePortaDelegata";
  898.         DriverControlStationDB driver = null;

  899.         try {
  900.             // prendo una connessione
  901.             con = ControlStationCore.dbM.getConnection();
  902.             // istanzio il driver
  903.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  904.             return driver.existsMappingFruizionePortaDelegata(mapping);

  905.         } catch (Exception e) {
  906.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  907.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  908.         } finally {
  909.             ControlStationCore.dbM.releaseConnection(con);
  910.         }
  911.     }
  912.    
  913.     public List<String> portaDelegataRuoliList(long idPD, ISearch ricerca) throws DriverConfigurazioneException {
  914.         Connection con = null;
  915.         String nomeMetodo = "portaDelegataRuoliList";
  916.         DriverControlStationDB driver = null;

  917.         try {
  918.             // prendo una connessione
  919.             con = ControlStationCore.dbM.getConnection();
  920.             // istanzio il driver
  921.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  922.             return driver.getDriverConfigurazioneDB().portaDelegataRuoliList(idPD, ricerca);

  923.         } catch (Exception e) {
  924.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  925.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  926.         } finally {
  927.             ControlStationCore.dbM.releaseConnection(con);
  928.         }

  929.     }
  930.    
  931.     public List<String> portaDelegataRuoliTokenList(long idPD, ISearch ricerca) throws DriverConfigurazioneException {
  932.         Connection con = null;
  933.         String nomeMetodo = "portaDelegataRuoliTokenList";
  934.         DriverControlStationDB driver = null;

  935.         try {
  936.             // prendo una connessione
  937.             con = ControlStationCore.dbM.getConnection();
  938.             // istanzio il driver
  939.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  940.             return driver.getDriverConfigurazioneDB().portaDelegataRuoliTokenList(idPD, ricerca);

  941.         } catch (Exception e) {
  942.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  943.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  944.         } finally {
  945.             ControlStationCore.dbM.releaseConnection(con);
  946.         }

  947.     }
  948.    
  949.     public List<String> portaDelegataScopeList(long idPD, ISearch ricerca) throws DriverConfigurazioneException {
  950.         Connection con = null;
  951.         String nomeMetodo = "portaDelegataScopeList";
  952.         DriverControlStationDB driver = null;

  953.         try {
  954.             // prendo una connessione
  955.             con = ControlStationCore.dbM.getConnection();
  956.             // istanzio il driver
  957.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  958.             return driver.getDriverConfigurazioneDB().portaDelegataScopeList(idPD, ricerca);

  959.         } catch (Exception e) {
  960.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  961.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  962.         } finally {
  963.             ControlStationCore.dbM.releaseConnection(con);
  964.         }

  965.     }
  966.    
  967.     public void aggiornaDescrizioneMappingFruizionePortaDelegata(MappingFruizionePortaDelegata mapping, String user) throws DriverConfigurazioneException {
  968.         Connection con = null;
  969.         String nomeMetodo = "aggiornaDescrizioneMappingFruizionePortaDelegata";
  970.         try {
  971.             // prendo una connessione
  972.             con = ControlStationCore.dbM.getConnection();
  973.            
  974.             DBMappingUtils.updateMappingFruizione(mapping.getTableId(), mapping.getDescrizione(), con, this.tipoDB);
  975.            
  976.             if(mapping.getIdPortaDelegata()!=null) {
  977.                 this.updateProprietaOggetto(mapping.getIdPortaDelegata(), user);
  978.             }

  979.         } catch (Exception e) {
  980.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  981.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  982.         } finally {
  983.             ControlStationCore.dbM.releaseConnection(con);
  984.         }
  985.     }
  986.    
  987.     public MappingFruizionePortaDelegata getMappingFruizionePortaDelegata(PortaDelegata pd) throws DriverConfigurazioneException {
  988.         Connection con = null;
  989.         String nomeMetodo = "getMappingFruizionePortaDelegata";
  990.         try {
  991.             // prendo una connessione
  992.             con = ControlStationCore.dbM.getConnection();
  993.            
  994.             IDPortaDelegata idPD = new IDPortaDelegata();
  995.             idPD.setNome(pd.getNome());
  996.            
  997.             IDSoggetto idFruitore = new IDSoggetto(pd.getTipoSoggettoProprietario(), pd.getNomeSoggettoProprietario());
  998.            
  999.             IDServizio idServizio = IDServizioFactory.getInstance().getIDServizioFromValues(pd.getServizio().getTipo(), pd.getServizio().getNome(),
  1000.                     pd.getSoggettoErogatore().getTipo(),pd.getSoggettoErogatore().getNome(),
  1001.                     pd.getServizio().getVersione());
  1002.            
  1003.             return DBMappingUtils.getMappingFruizione(idServizio, idFruitore, idPD, con, this.tipoDB);

  1004.         } catch (Exception e) {
  1005.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1006.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1007.         } finally {
  1008.             ControlStationCore.dbM.releaseConnection(con);
  1009.         }
  1010.     }
  1011.     public List<MappingFruizionePortaDelegata> countMappingFruizionePortaDelegata(IDSoggetto idFruitore, IDServizio idServizio) throws DriverConfigurazioneException {
  1012.         Connection con = null;
  1013.         String nomeMetodo = "countMappingFruizionePortaDelegata";
  1014.         try {
  1015.             // prendo una connessione
  1016.             con = ControlStationCore.dbM.getConnection();
  1017.            
  1018.             return DBMappingUtils.mappingFruizionePortaDelegataList(con, this.tipoDB, idFruitore, idServizio, false);

  1019.         } catch (Exception e) {
  1020.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1021.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1022.         } finally {
  1023.             ControlStationCore.dbM.releaseConnection(con);
  1024.         }
  1025.     }
  1026.    
  1027.     private static boolean showGroup = true;
  1028.     public static boolean isShowGroup() {
  1029.         return showGroup;
  1030.     }
  1031.     public static void setShowGroup(boolean showGroup) {
  1032.         PorteDelegateCore.showGroup = showGroup;
  1033.     }
  1034.    
  1035.     public String getLabelRegolaMappingFruizionePortaDelegata(String functionDi, String function, PortaDelegata pd) throws DriverConfigurazioneException {
  1036.         return getLabelRegolaMappingFruizionePortaDelegata(functionDi, function, pd, 50);
  1037.     }
  1038.     public String getLabelRegolaMappingFruizionePortaDelegata(String functionDi, String function, PortaDelegata pd, boolean forceGroupName) throws DriverConfigurazioneException {
  1039.         return getLabelRegolaMappingFruizionePortaDelegata(functionDi, function, pd, 50, forceGroupName);
  1040.     }
  1041.     public String getLabelRegolaMappingFruizionePortaDelegata(String functionDi, String function, PortaDelegata pd, int sizeSubstring) throws DriverConfigurazioneException {
  1042.         return getLabelRegolaMappingFruizionePortaDelegata(functionDi, function, pd, sizeSubstring, false);
  1043.     }
  1044.     public String getLabelRegolaMappingFruizionePortaDelegata(String functionDi, String function, PortaDelegata pd, int sizeSubstring, boolean forceGroupName) throws DriverConfigurazioneException {
  1045.                
  1046.         String prefix = "";
  1047.         if(functionDi!=null) {
  1048.             prefix = functionDi;
  1049.             if(showGroup) {
  1050.                 prefix = convertPrefixConfigDelGruppo(prefix);
  1051.             }
  1052.         }
  1053.        
  1054.         MappingFruizionePortaDelegata mapping = this.getMappingFruizionePortaDelegata(pd);
  1055.         if(mapping.isDefault()) {
  1056.             if(this.countMappingFruizionePortaDelegata(mapping.getIdFruitore(),mapping.getIdServizio()).size()>1 || forceGroupName) {
  1057.                 if(showGroup) {
  1058.                     return prefix+getLabelGroup(mapping.getDescrizione());
  1059.                 }
  1060.                 else {
  1061.                     return prefix+PorteDelegateCostanti.LABEL_PARAMETRO_PORTE_DELEGATE_MAPPING_FRUIZIONE_PD_NOME_DEFAULT;
  1062.                 }
  1063.             }
  1064.             else {
  1065.                 return function!=null ? function : PorteDelegateCostanti.LABEL_PARAMETRO_PORTE_DELEGATE_MAPPING_FRUIZIONE_PD_NOME_DEFAULT;
  1066.             }
  1067.         }
  1068.         else {
  1069.             if(showGroup) {
  1070.                 StringBuilder sb = new StringBuilder(mapping.getDescrizione());
  1071.                 if(sb.length()>sizeSubstring)
  1072.                     return prefix+getLabelGroup(sb.toString().substring(0, (sizeSubstring-3))+"...");
  1073.                 else
  1074.                     return prefix+getLabelGroup(sb.toString());
  1075.             }
  1076.             else {
  1077.                 List<String> listaAzioni = pd.getAzione()!= null ?  pd.getAzione().getAzioneDelegataList() : new ArrayList<>();
  1078.                 if(!listaAzioni.isEmpty()) {
  1079.                     StringBuilder sb = new StringBuilder();
  1080.                     for (String string : listaAzioni) {
  1081.                         if(sb.length() >0)
  1082.                             sb.append(", ");
  1083.                        
  1084.                         sb.append(string);
  1085.                     }
  1086.                     if(sb.length()>sizeSubstring)
  1087.                         return prefix+sb.toString().substring(0, (sizeSubstring-3))+"...";
  1088.                     else
  1089.                         return prefix+sb.toString();
  1090.                 }
  1091.                 else {
  1092.                     return prefix+"???";
  1093.                 }
  1094.             }
  1095.         }
  1096.     }
  1097.     public List<Proprieta> porteDelPropList(long idPortaDelegata, ConsoleSearch ricerca) throws DriverConfigurazioneException {
  1098.         Connection con = null;
  1099.         String nomeMetodo = "porteDelPropList";
  1100.         DriverControlStationDB driver = null;

  1101.         try {
  1102.             // prendo una connessione
  1103.             con = ControlStationCore.dbM.getConnection();
  1104.             // istanzio il driver
  1105.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1106.             return driver.getDriverConfigurazioneDB().porteDelegatePropList(idPortaDelegata, ricerca);

  1107.         } catch (Exception e) {
  1108.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1109.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1110.         } finally {
  1111.             ControlStationCore.dbM.releaseConnection(con);
  1112.         }
  1113.     }
  1114.    
  1115.     public List<String> nomiProprietaPD(String filterSoggettoTipo, String filterSoggettoNome, List<String> tipoServiziProtocollo) throws DriverConfigurazioneException {
  1116.         Connection con = null;
  1117.         String nomeMetodo = "nomiProprietaPD";
  1118.         DriverControlStationDB driver = null;

  1119.         try {
  1120.             // prendo una connessione
  1121.             con = ControlStationCore.dbM.getConnection();
  1122.             // istanzio il driver
  1123.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1124.            
  1125.             return driver.getDriverConfigurazioneDB().nomiProprietaPD(filterSoggettoTipo, filterSoggettoNome, tipoServiziProtocollo);

  1126.         } catch (Exception e) {
  1127.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1128.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1129.         } finally {
  1130.             ControlStationCore.dbM.releaseConnection(con);
  1131.         }
  1132.     }
  1133.    
  1134.     public Map<String, Properties> readMessageSecurityRequestPropertiesConfiguration(long idPortaDelegata) throws DriverConfigurazioneException {
  1135.         Connection con = null;
  1136.         String nomeMetodo = "readMessageSecurityRequestPropertiesConfiguration";
  1137.         try {
  1138.             // prendo una connessione
  1139.             con = ControlStationCore.dbM.getConnection();
  1140.             Map<String, String> readProperties = DBPropertiesUtils.readProperties(con, this.tipoDB, CostantiDB.PORTE_DELEGATE_MESSAGE_SECURITY_REQUEST, CostantiDB.PORTE_DELEGATE_MESSAGE_SECURITY_REQUEST_COLUMN_NOME,
  1141.                     CostantiDB.PORTE_DELEGATE_MESSAGE_SECURITY_REQUEST_COLUMN_VALORE, CostantiDB.PORTE_DELEGATE_MESSAGE_SECURITY_REQUEST_COLUMN_ENC_VALUE,
  1142.                     CostantiDB.PORTE_DELEGATE_MESSAGE_SECURITY_REQUEST_COLUMN_ID_PORTA, idPortaDelegata,
  1143.                     this.getDriverBYOKUtilities().getDriverBYOKManagerNode(false, true));
  1144.             return DBPropertiesUtils.toMultiMap(readProperties);
  1145.         } catch (Exception e) {
  1146.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1147.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1148.         } finally {
  1149.             ControlStationCore.dbM.releaseConnection(con);
  1150.         }  
  1151.     }
  1152.    
  1153.     public Map<String, Properties> readMessageSecurityResponsePropertiesConfiguration(long idPortaDelegata) throws DriverConfigurazioneException {
  1154.         Connection con = null;
  1155.         String nomeMetodo = "readMessageSecurityResponsePropertiesConfiguration";
  1156.         try {
  1157.             // prendo una connessione
  1158.             con = ControlStationCore.dbM.getConnection();
  1159.             Map<String, String> readProperties = DBPropertiesUtils.readProperties(con, this.tipoDB, CostantiDB.PORTE_DELEGATE_MESSAGE_SECURITY_RESPONSE, CostantiDB.PORTE_DELEGATE_MESSAGE_SECURITY_RESPONSE_COLUMN_NOME,
  1160.                     CostantiDB.PORTE_DELEGATE_MESSAGE_SECURITY_RESPONSE_COLUMN_VALORE, CostantiDB.PORTE_DELEGATE_MESSAGE_SECURITY_RESPONSE_COLUMN_ENC_VALUE,
  1161.                     CostantiDB.PORTE_DELEGATE_MESSAGE_SECURITY_RESPONSE_COLUMN_ID_PORTA, idPortaDelegata,
  1162.                     this.getDriverBYOKUtilities().getDriverBYOKManagerNode(false, true));
  1163.             return DBPropertiesUtils.toMultiMap(readProperties);
  1164.         } catch (Exception e) {
  1165.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1166.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1167.         } finally {
  1168.             ControlStationCore.dbM.releaseConnection(con);
  1169.         }  
  1170.     }
  1171.    
  1172.     public List<ResponseCachingConfigurazioneRegola> getResponseCachingConfigurazioneRegolaList(long idPA, ISearch ricerca) throws DriverConfigurazioneException {
  1173.         Connection con = null;
  1174.         String nomeMetodo = "getResponseCachingConfigurazioneRegolaList";
  1175.         DriverControlStationDB driver = null;

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

  1181.             return driver.getDriverConfigurazioneDB().portaDelegataResponseCachingConfigurazioneRegolaList(idPA, ricerca);

  1182.         } catch (Exception e) {
  1183.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1184.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1185.         } finally {
  1186.             ControlStationCore.dbM.releaseConnection(con);
  1187.         }

  1188.     }
  1189.    
  1190.     public boolean existsResponseCachingConfigurazioneRegola(Long idPorta, Integer statusMin, Integer statusMax, boolean fault) throws DriverConfigurazioneException{
  1191.         Connection con = null;
  1192.         String nomeMetodo = "existsResponseCachingConfigurazioneRegola";
  1193.         DriverControlStationDB driver = null;

  1194.         try {
  1195.             // prendo una connessione
  1196.             con = ControlStationCore.dbM.getConnection();
  1197.             // istanzio il driver
  1198.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1199.             return driver.getDriverConfigurazioneDB().existsPortaDelegataResponseCachingConfigurazioneRegola(idPorta, statusMin,statusMax,fault);
  1200.         } catch (Exception e) {
  1201.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1202.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1203.         } finally {
  1204.             ControlStationCore.dbM.releaseConnection(con);
  1205.         }
  1206.     }
  1207.    
  1208.     public List<TrasformazioneRegola> porteDelegateTrasformazioniList(long idPortaDelegata, ISearch ricerca) throws DriverConfigurazioneException {
  1209.         Connection con = null;
  1210.         String nomeMetodo = "porteDelegateTrasformazioniList";
  1211.         DriverControlStationDB driver = null;

  1212.         try {
  1213.             // prendo una connessione
  1214.             con = ControlStationCore.dbM.getConnection();
  1215.             // istanzio il driver
  1216.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1217.             return driver.getDriverConfigurazioneDB().porteDelegateTrasformazioniList(idPortaDelegata, ricerca);

  1218.         } catch (Exception e) {
  1219.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1220.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1221.         } finally {
  1222.             ControlStationCore.dbM.releaseConnection(con);
  1223.         }
  1224.     }
  1225.    
  1226.    
  1227.     public boolean existsTrasformazione(long idPorta, String azioni, String pattern, String contentType, String connettori) throws DriverConfigurazioneException{
  1228.         Connection con = null;
  1229.         String nomeMetodo = "existsTrasformazione";
  1230.         DriverControlStationDB driver = null;

  1231.         try {
  1232.             // prendo una connessione
  1233.             con = ControlStationCore.dbM.getConnection();
  1234.             // istanzio il driver
  1235.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1236.             return driver.getDriverConfigurazioneDB().existsPortaDelegataTrasformazione(idPorta, azioni, pattern, contentType, connettori);
  1237.         } catch (Exception e) {
  1238.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1239.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1240.         } finally {
  1241.             ControlStationCore.dbM.releaseConnection(con);
  1242.         }
  1243.     }
  1244.    
  1245.     public boolean existsTrasformazione(long idPorta, String nome) throws DriverConfigurazioneException{
  1246.         Connection con = null;
  1247.         String nomeMetodo = "existsTrasformazione";
  1248.         DriverControlStationDB driver = null;

  1249.         try {
  1250.             // prendo una connessione
  1251.             con = ControlStationCore.dbM.getConnection();
  1252.             // istanzio il driver
  1253.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1254.             return driver.getDriverConfigurazioneDB().existsPortaDelegataTrasformazione(idPorta, nome);
  1255.         } catch (Exception e) {
  1256.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1257.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1258.         } finally {
  1259.             ControlStationCore.dbM.releaseConnection(con);
  1260.         }
  1261.     }
  1262.    
  1263.     public TrasformazioneRegola getTrasformazione(long idPorta, String azioni, String pattern, String contentType, String connettori,
  1264.             List<TrasformazioneRegolaApplicabilitaServizioApplicativo> applicativi) throws DriverConfigurazioneException{
  1265.         Connection con = null;
  1266.         String nomeMetodo = "getTrasformazione";
  1267.         DriverControlStationDB driver = null;

  1268.         try {
  1269.             // prendo una connessione
  1270.             con = ControlStationCore.dbM.getConnection();
  1271.             // istanzio il driver
  1272.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1273.             return driver.getDriverConfigurazioneDB().getPortaDelegataTrasformazione(idPorta, azioni, pattern, contentType, connettori, applicativi);
  1274.         } catch (Exception e) {
  1275.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1276.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1277.         } finally {
  1278.             ControlStationCore.dbM.releaseConnection(con);
  1279.         }
  1280.     }
  1281.    
  1282.     public TrasformazioneRegola getTrasformazione(long idPorta, String nome) throws DriverConfigurazioneException{
  1283.         Connection con = null;
  1284.         String nomeMetodo = "getTrasformazione";
  1285.         DriverControlStationDB driver = null;

  1286.         try {
  1287.             // prendo una connessione
  1288.             con = ControlStationCore.dbM.getConnection();
  1289.             // istanzio il driver
  1290.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1291.             return driver.getDriverConfigurazioneDB().getPortaDelegataTrasformazione(idPorta, nome);
  1292.         } catch (Exception e) {
  1293.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1294.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1295.         } finally {
  1296.             ControlStationCore.dbM.releaseConnection(con);
  1297.         }
  1298.     }
  1299.    
  1300.     public List<TrasformazioneRegolaRisposta> porteDelegateTrasformazioniRispostaList(long idPortaDelegata, long idTrasformazione, ISearch ricerca) throws DriverConfigurazioneException {
  1301.         Connection con = null;
  1302.         String nomeMetodo = "porteDelegateTrasformazioniRispostaList";
  1303.         DriverControlStationDB driver = null;

  1304.         try {
  1305.             // prendo una connessione
  1306.             con = ControlStationCore.dbM.getConnection();
  1307.             // istanzio il driver
  1308.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1309.             return driver.getDriverConfigurazioneDB().porteDelegateTrasformazioniRispostaList(idPortaDelegata, idTrasformazione, ricerca);

  1310.         } catch (Exception e) {
  1311.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1312.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1313.         } finally {
  1314.             ControlStationCore.dbM.releaseConnection(con);
  1315.         }
  1316.     }
  1317.    
  1318.     public boolean existsTrasformazioneRisposta(long idPorta, long idTrasformazione, Integer statusMin, Integer statusMax, String pattern, String contentType) throws DriverConfigurazioneException{
  1319.         Connection con = null;
  1320.         String nomeMetodo = "existsTrasformazioneRisposta";
  1321.         DriverControlStationDB driver = null;

  1322.         try {
  1323.             // prendo una connessione
  1324.             con = ControlStationCore.dbM.getConnection();
  1325.             // istanzio il driver
  1326.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1327.             return driver.getDriverConfigurazioneDB().existsPortaDelegataTrasformazioneRisposta(idPorta, idTrasformazione, statusMin, statusMax, pattern, contentType);
  1328.         } catch (Exception e) {
  1329.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1330.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1331.         } finally {
  1332.             ControlStationCore.dbM.releaseConnection(con);
  1333.         }
  1334.     }
  1335.    
  1336.     public boolean existsTrasformazioneRisposta(long idPorta, long idTrasformazione, String nome) throws DriverConfigurazioneException{
  1337.         Connection con = null;
  1338.         String nomeMetodo = "existsTrasformazioneRisposta";
  1339.         DriverControlStationDB driver = null;

  1340.         try {
  1341.             // prendo una connessione
  1342.             con = ControlStationCore.dbM.getConnection();
  1343.             // istanzio il driver
  1344.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1345.             return driver.getDriverConfigurazioneDB().existsPortaDelegataTrasformazioneRisposta(idPorta, idTrasformazione, nome);
  1346.         } catch (Exception e) {
  1347.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1348.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1349.         } finally {
  1350.             ControlStationCore.dbM.releaseConnection(con);
  1351.         }
  1352.     }
  1353.    
  1354.     public TrasformazioneRegolaRisposta getTrasformazioneRisposta(long idPorta, long idTrasformazione, Integer statusMin, Integer statusMax, String pattern, String contentType) throws DriverConfigurazioneException{
  1355.         Connection con = null;
  1356.         String nomeMetodo = "getTrasformazioneRisposta";
  1357.         DriverControlStationDB driver = null;

  1358.         try {
  1359.             // prendo una connessione
  1360.             con = ControlStationCore.dbM.getConnection();
  1361.             // istanzio il driver
  1362.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1363.             return driver.getDriverConfigurazioneDB().getPortaDelegataTrasformazioneRisposta(idPorta, idTrasformazione, statusMin, statusMax, pattern, contentType);
  1364.         } catch (Exception e) {
  1365.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1366.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1367.         } finally {
  1368.             ControlStationCore.dbM.releaseConnection(con);
  1369.         }
  1370.     }
  1371.    
  1372.     public TrasformazioneRegolaRisposta getTrasformazioneRisposta(long idPorta, long idTrasformazione, String nome) throws DriverConfigurazioneException{
  1373.         Connection con = null;
  1374.         String nomeMetodo = "getTrasformazioneRisposta";
  1375.         DriverControlStationDB driver = null;

  1376.         try {
  1377.             // prendo una connessione
  1378.             con = ControlStationCore.dbM.getConnection();
  1379.             // istanzio il driver
  1380.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1381.             return driver.getDriverConfigurazioneDB().getPortaDelegataTrasformazioneRisposta(idPorta, idTrasformazione, nome);
  1382.         } catch (Exception e) {
  1383.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1384.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1385.         } finally {
  1386.             ControlStationCore.dbM.releaseConnection(con);
  1387.         }
  1388.     }
  1389.    
  1390.     public List<TrasformazioneRegolaParametro> porteDelegateTrasformazioniRispostaHeaderList(long idPortaDelegata, long idTrasformazione, long idTrasformazioneRisposta,  ISearch ricerca) throws DriverConfigurazioneException {
  1391.         Connection con = null;
  1392.         String nomeMetodo = "porteDelegateTrasformazioniRispostaList";
  1393.         DriverControlStationDB driver = null;

  1394.         try {
  1395.             // prendo una connessione
  1396.             con = ControlStationCore.dbM.getConnection();
  1397.             // istanzio il driver
  1398.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1399.             return driver.getDriverConfigurazioneDB().porteDelegateTrasformazioniRispostaHeaderList(idPortaDelegata, idTrasformazione, idTrasformazioneRisposta, ricerca);

  1400.         } catch (Exception e) {
  1401.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1402.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1403.         } finally {
  1404.             ControlStationCore.dbM.releaseConnection(con);
  1405.         }
  1406.     }
  1407.    
  1408.     public boolean existsTrasformazioneRispostaHeader(long idPorta, long idTrasformazione,  long idTrasformazioneRisposta,  String nome, String tipo, boolean checkTipo) throws DriverConfigurazioneException{
  1409.         Connection con = null;
  1410.         String nomeMetodo = "existsTrasformazioneRispostaHeader";
  1411.         DriverControlStationDB driver = null;

  1412.         try {
  1413.             // prendo una connessione
  1414.             con = ControlStationCore.dbM.getConnection();
  1415.             // istanzio il driver
  1416.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1417.             return driver.getDriverConfigurazioneDB().existsPortaDelegataTrasformazioneRispostaHeader(idPorta, idTrasformazione, idTrasformazioneRisposta, nome, tipo, checkTipo);
  1418.         } catch (Exception e) {
  1419.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1420.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1421.         } finally {
  1422.             ControlStationCore.dbM.releaseConnection(con);
  1423.         }
  1424.     }
  1425.    
  1426.     public TrasformazioneRegolaParametro getTrasformazioneRispostaHeader(long idPorta, long idTrasformazione, long idTrasformazioneRisposta,  String nome, String tipo, boolean checkTipo) throws DriverConfigurazioneException{
  1427.         Connection con = null;
  1428.         String nomeMetodo = "getTrasformazioneRispostaHeader";
  1429.         DriverControlStationDB driver = null;

  1430.         try {
  1431.             // prendo una connessione
  1432.             con = ControlStationCore.dbM.getConnection();
  1433.             // istanzio il driver
  1434.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1435.             return driver.getDriverConfigurazioneDB().getPortaDelegataTrasformazioneRispostaHeader(idPorta, idTrasformazione, idTrasformazioneRisposta, nome, tipo, checkTipo);
  1436.         } catch (Exception e) {
  1437.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1438.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1439.         } finally {
  1440.             ControlStationCore.dbM.releaseConnection(con);
  1441.         }
  1442.     }
  1443.    
  1444.     public List<TrasformazioneRegolaParametro> porteDelegateTrasformazioniRichiestaHeaderList(long idPortaDelegata, long idTrasformazione,  ISearch ricerca) throws DriverConfigurazioneException {
  1445.         Connection con = null;
  1446.         String nomeMetodo = "porteDelegateTrasformazioniRichiestaHeaderList";
  1447.         DriverControlStationDB driver = null;

  1448.         try {
  1449.             // prendo una connessione
  1450.             con = ControlStationCore.dbM.getConnection();
  1451.             // istanzio il driver
  1452.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1453.             return driver.getDriverConfigurazioneDB().porteDelegateTrasformazioniRichiestaHeaderList(idPortaDelegata, idTrasformazione, ricerca);

  1454.         } catch (Exception e) {
  1455.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1456.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1457.         } finally {
  1458.             ControlStationCore.dbM.releaseConnection(con);
  1459.         }
  1460.     }
  1461.    
  1462.     public List<TrasformazioneRegolaParametro> porteDelegateTrasformazioniRichiestaUrlParameterList(long idPortaDelegata, long idTrasformazione,  ISearch ricerca) throws DriverConfigurazioneException {
  1463.         Connection con = null;
  1464.         String nomeMetodo = "porteDelegateTrasformazioniRichiestaUrlParameterList";
  1465.         DriverControlStationDB driver = null;

  1466.         try {
  1467.             // prendo una connessione
  1468.             con = ControlStationCore.dbM.getConnection();
  1469.             // istanzio il driver
  1470.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1471.             return driver.getDriverConfigurazioneDB().porteDelegateTrasformazioniRichiestaUrlParameterList(idPortaDelegata, idTrasformazione, ricerca);

  1472.         } catch (Exception e) {
  1473.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1474.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1475.         } finally {
  1476.             ControlStationCore.dbM.releaseConnection(con);
  1477.         }
  1478.     }
  1479.    
  1480.     public boolean existsTrasformazioneRichiestaHeader(long idPorta, long idTrasformazione, String nome, String tipo, boolean checkTipo) throws DriverConfigurazioneException{
  1481.         Connection con = null;
  1482.         String nomeMetodo = "existsTrasformazioneRichiestaHeader";
  1483.         DriverControlStationDB driver = null;

  1484.         try {
  1485.             // prendo una connessione
  1486.             con = ControlStationCore.dbM.getConnection();
  1487.             // istanzio il driver
  1488.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1489.             return driver.getDriverConfigurazioneDB().existsPortaDelegataTrasformazioneRichiestaHeader(idPorta, idTrasformazione, nome, tipo, checkTipo);
  1490.         } catch (Exception e) {
  1491.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1492.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1493.         } finally {
  1494.             ControlStationCore.dbM.releaseConnection(con);
  1495.         }
  1496.     }
  1497.    
  1498.     public TrasformazioneRegolaParametro getTrasformazioneRichiestaHeader(long idPorta, long idTrasformazione, String nome, String tipo, boolean checkTipo) throws DriverConfigurazioneException{
  1499.         Connection con = null;
  1500.         String nomeMetodo = "getTrasformazioneRichiestaHeader";
  1501.         DriverControlStationDB driver = null;

  1502.         try {
  1503.             // prendo una connessione
  1504.             con = ControlStationCore.dbM.getConnection();
  1505.             // istanzio il driver
  1506.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1507.             return driver.getDriverConfigurazioneDB().getPortaDelegataTrasformazioneRichiestaHeader(idPorta, idTrasformazione, nome, tipo, checkTipo);
  1508.         } catch (Exception e) {
  1509.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1510.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1511.         } finally {
  1512.             ControlStationCore.dbM.releaseConnection(con);
  1513.         }
  1514.     }
  1515.    
  1516.     public boolean existsTrasformazioneRichiestaUrlParameter(long idPorta, long idTrasformazione, String nome, String tipo, boolean checkTipo) throws DriverConfigurazioneException{
  1517.         Connection con = null;
  1518.         String nomeMetodo = "existsTrasformazioneRichiestaUrlParameter";
  1519.         DriverControlStationDB driver = null;

  1520.         try {
  1521.             // prendo una connessione
  1522.             con = ControlStationCore.dbM.getConnection();
  1523.             // istanzio il driver
  1524.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1525.             return driver.getDriverConfigurazioneDB().existsPortaDelegataTrasformazioneRichiestaUrlParameter(idPorta, idTrasformazione, nome, tipo, checkTipo);
  1526.         } catch (Exception e) {
  1527.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1528.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1529.         } finally {
  1530.             ControlStationCore.dbM.releaseConnection(con);
  1531.         }
  1532.     }
  1533.    
  1534.     public TrasformazioneRegolaParametro getTrasformazioneRichiestaUrlParameter(long idPorta, long idTrasformazione, String nome, String tipo, boolean checkTipo) throws DriverConfigurazioneException{
  1535.         Connection con = null;
  1536.         String nomeMetodo = "getTrasformazioneRichiestaUrlParameter";
  1537.         DriverControlStationDB driver = null;

  1538.         try {
  1539.             // prendo una connessione
  1540.             con = ControlStationCore.dbM.getConnection();
  1541.             // istanzio il driver
  1542.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1543.             return driver.getDriverConfigurazioneDB().getPortaDelegataTrasformazioneRichiestaUrlParameter(idPorta, idTrasformazione, nome, tipo, checkTipo);
  1544.         } catch (Exception e) {
  1545.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1546.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1547.         } finally {
  1548.             ControlStationCore.dbM.releaseConnection(con);
  1549.         }
  1550.     }
  1551.    
  1552.     public List<TrasformazioneRegolaApplicabilitaServizioApplicativo> porteDelegateTrasformazioniServiziApplicativiAutorizzatiList(long idPortaApplicativa, long idTrasformazione, ISearch ricerca) throws DriverConfigurazioneException {
  1553.         Connection con = null;
  1554.         String nomeMetodo = "porteDelegateTrasformazioniServiziApplicativiAutorizzatiList";
  1555.         DriverControlStationDB driver = null;

  1556.         try {
  1557.             // prendo una connessione
  1558.             con = ControlStationCore.dbM.getConnection();
  1559.             // istanzio il driver
  1560.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1561.             return driver.getDriverConfigurazioneDB().porteDelegateTrasformazioniServiziApplicativiList(idPortaApplicativa, idTrasformazione, ricerca);

  1562.         } catch (Exception e) {
  1563.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1564.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1565.         } finally {
  1566.             ControlStationCore.dbM.releaseConnection(con);
  1567.         }

  1568.     }
  1569.    
  1570.     public List<Proprieta> porteDelegateAutenticazioneCustomPropList(long idPortaDelegata, ConsoleSearch ricerca) throws DriverConfigurazioneException {
  1571.         Connection con = null;
  1572.         String nomeMetodo = "porteDelegateAutenticazioneCustomPropList";
  1573.         DriverControlStationDB driver = null;

  1574.         try {
  1575.             // prendo una connessione
  1576.             con = ControlStationCore.dbM.getConnection();
  1577.             // istanzio il driver
  1578.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1579.             return driver.getDriverConfigurazioneDB().porteDelegateAutenticazioneCustomPropList(idPortaDelegata, ricerca);

  1580.         } catch (Exception e) {
  1581.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1582.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1583.         } finally {
  1584.             ControlStationCore.dbM.releaseConnection(con);
  1585.         }
  1586.     }
  1587.    
  1588.     public List<Proprieta> porteDelegateAutorizzazioneCustomPropList(long idPortaDelegata, ConsoleSearch ricerca) throws DriverConfigurazioneException {
  1589.         Connection con = null;
  1590.         String nomeMetodo = "porteDelegateAutorizzazioneCustomPropList";
  1591.         DriverControlStationDB driver = null;

  1592.         try {
  1593.             // prendo una connessione
  1594.             con = ControlStationCore.dbM.getConnection();
  1595.             // istanzio il driver
  1596.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1597.             return driver.getDriverConfigurazioneDB().porteDelegateAutorizzazioneCustomPropList(idPortaDelegata, ricerca);

  1598.         } catch (Exception e) {
  1599.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1600.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1601.         } finally {
  1602.             ControlStationCore.dbM.releaseConnection(con);
  1603.         }
  1604.     }
  1605.    
  1606.     public List<Proprieta> porteDelegateAutorizzazioneContenutoCustomPropList(long idPortaDelegata, ConsoleSearch ricerca) throws DriverConfigurazioneException {
  1607.         Connection con = null;
  1608.         String nomeMetodo = "porteDelegateAutorizzazioneContenutoCustomPropList";
  1609.         DriverControlStationDB driver = null;

  1610.         try {
  1611.             // prendo una connessione
  1612.             con = ControlStationCore.dbM.getConnection();
  1613.             // istanzio il driver
  1614.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1615.             return driver.getDriverConfigurazioneDB().porteDelegateAutorizzazioneContenutoCustomPropList(idPortaDelegata, ricerca);

  1616.         } catch (Exception e) {
  1617.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1618.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1619.         } finally {
  1620.             ControlStationCore.dbM.releaseConnection(con);
  1621.         }
  1622.     }
  1623. }