PorteApplicativeCore.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.pa;

  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.ISearch;
  27. import org.openspcoop2.core.config.AutorizzazioneRuoli;
  28. import org.openspcoop2.core.config.AutorizzazioneScope;
  29. import org.openspcoop2.core.config.CorrelazioneApplicativaElemento;
  30. import org.openspcoop2.core.config.CorrelazioneApplicativaRispostaElemento;
  31. import org.openspcoop2.core.config.GestioneToken;
  32. import org.openspcoop2.core.config.GestioneTokenAutenticazione;
  33. import org.openspcoop2.core.config.MessageSecurityFlowParameter;
  34. import org.openspcoop2.core.config.MtomProcessorFlowParameter;
  35. import org.openspcoop2.core.config.PortaApplicativa;
  36. import org.openspcoop2.core.config.PortaApplicativaAutorizzazioneServizioApplicativo;
  37. import org.openspcoop2.core.config.PortaApplicativaAutorizzazioneSoggetti;
  38. import org.openspcoop2.core.config.PortaApplicativaAutorizzazioneSoggetto;
  39. import org.openspcoop2.core.config.PortaApplicativaAutorizzazioneToken;
  40. import org.openspcoop2.core.config.PortaApplicativaAzione;
  41. import org.openspcoop2.core.config.PortaApplicativaServizioApplicativo;
  42. import org.openspcoop2.core.config.Proprieta;
  43. import org.openspcoop2.core.config.ProprietaOggetto;
  44. import org.openspcoop2.core.config.ResponseCachingConfigurazioneRegola;
  45. import org.openspcoop2.core.config.Ruolo;
  46. import org.openspcoop2.core.config.Scope;
  47. import org.openspcoop2.core.config.ServizioApplicativo;
  48. import org.openspcoop2.core.config.TrasformazioneRegola;
  49. import org.openspcoop2.core.config.TrasformazioneRegolaApplicabilitaServizioApplicativo;
  50. import org.openspcoop2.core.config.TrasformazioneRegolaApplicabilitaSoggetto;
  51. import org.openspcoop2.core.config.TrasformazioneRegolaParametro;
  52. import org.openspcoop2.core.config.TrasformazioneRegolaRisposta;
  53. import org.openspcoop2.core.config.constants.RuoloTipoMatch;
  54. import org.openspcoop2.core.config.constants.ScopeTipoMatch;
  55. import org.openspcoop2.core.config.constants.StatoFunzionalita;
  56. import org.openspcoop2.core.config.constants.StatoFunzionalitaConWarning;
  57. import org.openspcoop2.core.config.constants.TipoAutenticazionePrincipal;
  58. import org.openspcoop2.core.config.driver.DriverConfigurazioneException;
  59. import org.openspcoop2.core.config.driver.DriverConfigurazioneNotFound;
  60. import org.openspcoop2.core.config.driver.FiltroRicercaPorteApplicative;
  61. import org.openspcoop2.core.constants.CostantiDB;
  62. import org.openspcoop2.core.id.IDPortaApplicativa;
  63. import org.openspcoop2.core.id.IDServizio;
  64. import org.openspcoop2.core.id.IDServizioApplicativo;
  65. import org.openspcoop2.core.id.IDSoggetto;
  66. import org.openspcoop2.core.mapping.DBMappingUtils;
  67. import org.openspcoop2.core.mapping.MappingErogazionePortaApplicativa;
  68. import org.openspcoop2.core.mvc.properties.utils.DBPropertiesUtils;
  69. import org.openspcoop2.core.registry.AccordoServizioParteSpecifica;
  70. import org.openspcoop2.core.registry.beans.AccordoServizioParteComuneSintetico;
  71. import org.openspcoop2.core.registry.beans.AzioneSintetica;
  72. import org.openspcoop2.core.registry.beans.OperationSintetica;
  73. import org.openspcoop2.core.registry.beans.PortTypeSintetico;
  74. import org.openspcoop2.core.registry.constants.CostantiRegistroServizi;
  75. import org.openspcoop2.core.registry.constants.RuoloTipologia;
  76. import org.openspcoop2.core.registry.driver.IDServizioFactory;
  77. import org.openspcoop2.web.ctrlstat.core.AutorizzazioneUtilities;
  78. import org.openspcoop2.web.ctrlstat.core.ControlStationCore;
  79. import org.openspcoop2.web.ctrlstat.driver.DriverControlStationDB;
  80. import org.openspcoop2.web.ctrlstat.driver.DriverControlStationException;
  81. import org.openspcoop2.web.lib.mvc.BinaryParameter;
  82. import org.openspcoop2.web.lib.mvc.ServletUtils;

  83. /**
  84.  * PorteApplicativeCore
  85.  *
  86.  * @author Poli Andrea (apoli@link.it)
  87.  * @author $Author$
  88.  * @version $Rev$, $Date$
  89.  */
  90. public class PorteApplicativeCore extends ControlStationCore {

  91.     public PorteApplicativeCore() throws DriverControlStationException {
  92.         super();
  93.     }
  94.     public PorteApplicativeCore(ControlStationCore core) throws DriverControlStationException {
  95.         super(core);
  96.     }
  97.    
  98.     public void configureControlloAccessiPortaApplicativa(PortaApplicativa pa,
  99.             String erogazioneAutenticazione, String erogazioneAutenticazioneOpzionale, TipoAutenticazionePrincipal erogazioneAutenticazionePrincipal, List<String> erogazioneAutenticazioneParametroList,
  100.             String erogazioneAutorizzazione, String erogazioneAutorizzazioneAutenticati, String erogazioneAutorizzazioneRuoli, String erogazioneAutorizzazioneRuoliTipologia, String erogazioneAutorizzazioneRuoliMatch,
  101.             String nomeSA, String erogazioneRuolo, IDSoggetto idErogazioneSoggettoAutenticato,
  102.             String autorizzazioneAutenticatiToken,
  103.             String autorizzazioneRuoliToken, String autorizzazioneRuoliTipologiaToken, String autorizzazioneRuoliMatchToken,
  104.             String erogazioneAutorizzazioneTokenOptions,
  105.             String erogazioneAutorizzazioneScope, String erogazioneScope, String erogazioneAutorizzazioneScopeMatch,BinaryParameter allegatoXacmlPolicy,
  106.             String identificazioneAttributiStato, String [] attributeAuthoritySelezionate, String attributeAuthorityAttributi) {
  107.         pa.setAutenticazione(erogazioneAutenticazione);
  108.         if(erogazioneAutenticazioneOpzionale != null){
  109.             if(ServletUtils.isCheckBoxEnabled(erogazioneAutenticazioneOpzionale))
  110.                 pa.setAutenticazioneOpzionale(StatoFunzionalita.ABILITATO);
  111.             else
  112.                 pa.setAutenticazioneOpzionale(StatoFunzionalita.DISABILITATO);
  113.         } else
  114.             pa.setAutenticazioneOpzionale(null);
  115.         pa.getProprietaAutenticazioneList().clear();
  116.         List<Proprieta> proprietaAutenticazione = this.convertToAutenticazioneProprieta(erogazioneAutenticazione, erogazioneAutenticazionePrincipal, erogazioneAutenticazioneParametroList);
  117.         if(proprietaAutenticazione!=null && !proprietaAutenticazione.isEmpty()) {
  118.             pa.getProprietaAutenticazioneList().addAll(proprietaAutenticazione);
  119.         }
  120.        
  121.         pa.setAutorizzazione(AutorizzazioneUtilities.convertToTipoAutorizzazioneAsString(erogazioneAutorizzazione,
  122.                 ServletUtils.isCheckBoxEnabled(erogazioneAutorizzazioneAutenticati),
  123.                 ServletUtils.isCheckBoxEnabled(erogazioneAutorizzazioneRuoli),
  124.                 ServletUtils.isCheckBoxEnabled(autorizzazioneAutenticatiToken),
  125.                 ServletUtils.isCheckBoxEnabled(autorizzazioneRuoliToken),
  126.                 ServletUtils.isCheckBoxEnabled(erogazioneAutorizzazioneScope),
  127.                 erogazioneAutorizzazioneTokenOptions,
  128.                 RuoloTipologia.toEnumConstant(erogazioneAutorizzazioneRuoliTipologia)));
  129.        
  130.         if(erogazioneAutorizzazione != null && erogazioneAutorizzazione.equals(AutorizzazioneUtilities.STATO_XACML_POLICY) && allegatoXacmlPolicy.getValue() != null) {
  131.             pa.setXacmlPolicy(new String(allegatoXacmlPolicy.getValue()));
  132.         } else {
  133.             pa.setXacmlPolicy(null);
  134.         }
  135.        
  136.         if(erogazioneAutorizzazioneRuoliMatch!=null && !"".equals(erogazioneAutorizzazioneRuoliMatch)){
  137.             RuoloTipoMatch tipoRuoloMatch = RuoloTipoMatch.toEnumConstant(erogazioneAutorizzazioneRuoliMatch);
  138.             if(tipoRuoloMatch!=null){
  139.                 if(pa.getRuoli()==null){
  140.                     pa.setRuoli(new AutorizzazioneRuoli());
  141.                 }
  142.                 pa.getRuoli().setMatch(tipoRuoloMatch);
  143.             }
  144.         }
  145.        
  146.         if(nomeSA!=null && !"".equals(nomeSA) && !"-".equals(nomeSA)){
  147.             PortaApplicativaServizioApplicativo sa = new PortaApplicativaServizioApplicativo();
  148.             sa.setNome(nomeSA);
  149.             pa.addServizioApplicativo(sa);
  150.         }

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

  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.    
  333.     public PortaApplicativa getPortaApplicativa(IDPortaApplicativa idPA) throws DriverConfigurazioneNotFound, DriverConfigurazioneException {
  334.         Connection con = null;
  335.         String nomeMetodo = "getPortaApplicativa";
  336.         DriverControlStationDB driver = null;

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

  342.             return driver.getDriverConfigurazioneDB().getPortaApplicativa(idPA);

  343.         } catch (DriverConfigurazioneNotFound de) {
  344.             ControlStationCore.logDebug(getPrefixError(nomeMetodo,  de),de);
  345.             throw de;
  346.         } catch (Exception e) {
  347.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  348.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  349.         } finally {
  350.             ControlStationCore.dbM.releaseConnection(con);
  351.         }

  352.     }
  353.    
  354.     public ProprietaOggetto getProprietaOggetto(IDPortaApplicativa idPA) throws DriverConfigurazioneNotFound, DriverConfigurazioneException {
  355.         Connection con = null;
  356.         String nomeMetodo = "getProprietaOggetto";
  357.         DriverControlStationDB driver = null;

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

  363.             return driver.getDriverConfigurazioneDB().getProprietaOggetto(idPA);

  364.         } catch (DriverConfigurazioneNotFound de) {
  365.             ControlStationCore.logDebug(getPrefixError(nomeMetodo,  de),de);
  366.             throw de;
  367.         } catch (Exception e) {
  368.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  369.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  370.         } finally {
  371.             ControlStationCore.dbM.releaseConnection(con);
  372.         }
  373.     }
  374.    
  375.     public void updateProprietaOggetto(IDPortaApplicativa idPA, String user) throws DriverConfigurazioneException {
  376.         Connection con = null;
  377.         String nomeMetodo = "updateProprietaOggetto";
  378.         DriverControlStationDB driver = null;

  379.         try {
  380.             // prendo una connessione
  381.             con = ControlStationCore.dbM.getConnection();
  382.             // istanzio il driver
  383.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  384.             driver.getDriverConfigurazioneDB().updateProprietaOggetto(idPA, user);

  385.         } catch (Exception e) {
  386.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  387.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  388.         } finally {
  389.             ControlStationCore.dbM.releaseConnection(con);
  390.         }
  391.     }
  392.    

  393.     public List<PortaApplicativa> porteAppList(long idSoggetto, ISearch ricerca) throws DriverConfigurazioneException {
  394.         Connection con = null;
  395.         String nomeMetodo = "porteAppList";
  396.         DriverControlStationDB driver = null;

  397.         try {
  398.             // prendo una connessione
  399.             con = ControlStationCore.dbM.getConnection();
  400.             // istanzio il driver
  401.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  402.             return driver.getDriverConfigurazioneDB().porteAppList(idSoggetto, ricerca);

  403.         } catch (Exception e) {
  404.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  405.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  406.         } finally {
  407.             ControlStationCore.dbM.releaseConnection(con);
  408.         }

  409.     }
  410.    
  411.     public List<PortaApplicativa> porteAppList(String superUser, ISearch ricerca) throws DriverConfigurazioneException {
  412.         Connection con = null;
  413.         String nomeMetodo = "porteAppList";
  414.         DriverControlStationDB driver = null;

  415.         try {
  416.             // prendo una connessione
  417.             con = ControlStationCore.dbM.getConnection();
  418.             // istanzio il driver
  419.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  420.             return driver.getDriverConfigurazioneDB().porteAppList(superUser, ricerca);

  421.         } catch (Exception e) {
  422.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  423.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  424.         } finally {
  425.             ControlStationCore.dbM.releaseConnection(con);
  426.         }

  427.     }

  428.     public List<PortaApplicativa> getPorteApplicativeBySoggettoVirtuale(IDSoggetto soggettoVirtuale) throws DriverConfigurazioneException {
  429.         Connection con = null;
  430.         String nomeMetodo = "getPorteApplicativeBySoggettoVirtuale";
  431.         DriverControlStationDB driver = null;

  432.         try {
  433.             // prendo una connessione
  434.             con = ControlStationCore.dbM.getConnection();
  435.             // istanzio il driver
  436.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  437.             return driver.getDriverConfigurazioneDB().getPorteApplicativeBySoggettoVirtuale(soggettoVirtuale);

  438.         } catch (Exception e) {
  439.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  440.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e));
  441.         } finally {
  442.             ControlStationCore.dbM.releaseConnection(con);
  443.         }

  444.     }

  445.    

  446.     public List<Proprieta> porteAppPropList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  447.         Connection con = null;
  448.         String nomeMetodo = "porteAppPropList";
  449.         DriverControlStationDB driver = null;

  450.         try {
  451.             // prendo una connessione
  452.             con = ControlStationCore.dbM.getConnection();
  453.             // istanzio il driver
  454.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  455.             return driver.getDriverConfigurazioneDB().porteAppPropList(idPortaApplicativa, ricerca);

  456.         } catch (Exception e) {
  457.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  458.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  459.         } finally {
  460.             ControlStationCore.dbM.releaseConnection(con);
  461.         }

  462.     }
  463.    
  464.     public List<String> nomiProprietaPA(String filterSoggettoTipo, String filterSoggettoNome, List<String> tipoServiziProtocollo) throws DriverConfigurazioneException {
  465.         Connection con = null;
  466.         String nomeMetodo = "nomiProprietaPA";
  467.         DriverControlStationDB driver = null;

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

  473.             return driver.getDriverConfigurazioneDB().nomiProprietaPA(filterSoggettoTipo, filterSoggettoNome, tipoServiziProtocollo);

  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.     public List<ServizioApplicativo> porteAppServizioApplicativoList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  482.         Connection con = null;
  483.         String nomeMetodo = "porteAppServizioApplicativoList";
  484.         DriverControlStationDB driver = null;

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

  490.             return driver.getDriverConfigurazioneDB().porteAppServizioApplicativoList(idPortaApplicativa, ricerca);

  491.         } catch (Exception e) {
  492.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  493.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  494.         } finally {
  495.             ControlStationCore.dbM.releaseConnection(con);
  496.         }

  497.     }
  498.    
  499.     public List<PortaApplicativaAutorizzazioneSoggetto> porteAppSoggettoList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  500.         Connection con = null;
  501.         String nomeMetodo = "porteAppSoggettoList";
  502.         DriverControlStationDB driver = null;

  503.         try {
  504.             // prendo una connessione
  505.             con = ControlStationCore.dbM.getConnection();
  506.             // istanzio il driver
  507.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  508.             return driver.getDriverConfigurazioneDB().porteAppSoggettoList(idPortaApplicativa, ricerca);

  509.         } catch (Exception e) {
  510.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  511.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  512.         } finally {
  513.             ControlStationCore.dbM.releaseConnection(con);
  514.         }

  515.     }
  516.    
  517.     public List<PortaApplicativaAutorizzazioneServizioApplicativo> porteAppServiziApplicativiAutorizzatiList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  518.         Connection con = null;
  519.         String nomeMetodo = "porteAppServiziApplicativiAutorizzatiList";
  520.         DriverControlStationDB driver = null;

  521.         try {
  522.             // prendo una connessione
  523.             con = ControlStationCore.dbM.getConnection();
  524.             // istanzio il driver
  525.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  526.             return driver.getDriverConfigurazioneDB().porteAppServiziApplicativiAutorizzatiList(idPortaApplicativa, ricerca);

  527.         } catch (Exception e) {
  528.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  529.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  530.         } finally {
  531.             ControlStationCore.dbM.releaseConnection(con);
  532.         }

  533.     }

  534.     public List<PortaApplicativaAutorizzazioneServizioApplicativo> porteAppServiziApplicativiAutorizzatiTokenList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  535.         Connection con = null;
  536.         String nomeMetodo = "porteAppServiziApplicativiAutorizzatiTokenList";
  537.         DriverControlStationDB driver = null;

  538.         try {
  539.             // prendo una connessione
  540.             con = ControlStationCore.dbM.getConnection();
  541.             // istanzio il driver
  542.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  543.             return driver.getDriverConfigurazioneDB().porteAppServiziApplicativiAutorizzatiTokenList(idPortaApplicativa, ricerca);

  544.         } catch (Exception e) {
  545.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  546.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  547.         } finally {
  548.             ControlStationCore.dbM.releaseConnection(con);
  549.         }

  550.     }

  551.     public List<MessageSecurityFlowParameter> porteAppMessageSecurityRequestList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  552.         Connection con = null;
  553.         String nomeMetodo = "porteAppMessageSecurityRequestList";
  554.         DriverControlStationDB driver = null;

  555.         try {
  556.             // prendo una connessione
  557.             con = ControlStationCore.dbM.getConnection();
  558.             // istanzio il driver
  559.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  560.             return driver.getDriverConfigurazioneDB().porteAppMessageSecurityRequestList(idPortaApplicativa, ricerca);

  561.         } catch (Exception e) {
  562.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  563.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  564.         } finally {
  565.             ControlStationCore.dbM.releaseConnection(con);
  566.         }

  567.     }

  568.     public List<PortaApplicativa> porteAppWithIdServizio(long idServizio) throws DriverConfigurazioneException {
  569.         Connection con = null;
  570.         String nomeMetodo = "porteAppWithIdServizio";
  571.         DriverControlStationDB driver = null;

  572.         try {
  573.             // prendo una connessione
  574.             con = ControlStationCore.dbM.getConnection();
  575.             // istanzio il driver
  576.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  577.             return driver.getDriverConfigurazioneDB().porteAppWithIdServizio(idServizio);

  578.         } catch (Exception e) {
  579.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  580.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  581.         } finally {
  582.             ControlStationCore.dbM.releaseConnection(con);
  583.         }

  584.     }

  585.     public List<MessageSecurityFlowParameter> porteAppMessageSecurityResponseList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  586.         Connection con = null;
  587.         String nomeMetodo = "porteAppMessageSecurityResponseList";
  588.         DriverControlStationDB driver = null;

  589.         try {
  590.             // prendo una connessione
  591.             con = ControlStationCore.dbM.getConnection();
  592.             // istanzio il driver
  593.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  594.             return driver.getDriverConfigurazioneDB().porteAppMessageSecurityResponseList(idPortaApplicativa, ricerca);

  595.         } catch (Exception e) {
  596.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  597.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  598.         } finally {
  599.             ControlStationCore.dbM.releaseConnection(con);
  600.         }

  601.     }

  602.     public List<CorrelazioneApplicativaElemento> porteApplicativeCorrelazioneApplicativaList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  603.         Connection con = null;
  604.         String nomeMetodo = "porteApplicativeCorrelazioneApplicativaList";
  605.         DriverControlStationDB driver = null;

  606.         try {
  607.             // prendo una connessione
  608.             con = ControlStationCore.dbM.getConnection();
  609.             // istanzio il driver
  610.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  611.             return driver.getDriverConfigurazioneDB().porteApplicativeCorrelazioneApplicativaList(idPortaApplicativa, ricerca);

  612.         } catch (Exception e) {
  613.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  614.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  615.         } finally {
  616.             ControlStationCore.dbM.releaseConnection(con);
  617.         }

  618.     }
  619.    
  620.     public List<CorrelazioneApplicativaRispostaElemento> porteApplicativeCorrelazioneApplicativaRispostaList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  621.         Connection con = null;
  622.         String nomeMetodo = "porteApplicativeCorrelazioneApplicativaRispostaList";
  623.         DriverControlStationDB driver = null;

  624.         try {
  625.             // prendo una connessione
  626.             con = ControlStationCore.dbM.getConnection();
  627.             // istanzio il driver
  628.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  629.             return driver.getDriverConfigurazioneDB().porteApplicativeCorrelazioneApplicativaRispostaList(idPortaApplicativa, ricerca);

  630.         } catch (Exception e) {
  631.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  632.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e));
  633.         } finally {
  634.             ControlStationCore.dbM.releaseConnection(con);
  635.         }

  636.     }
  637.    
  638.     public List<PortaApplicativaAzione> porteAppAzioneList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  639.         Connection con = null;
  640.         String nomeMetodo = "porteAppAzioneList";
  641.         DriverControlStationDB driver = null;

  642.         try {
  643.             // prendo una connessione
  644.             con = ControlStationCore.dbM.getConnection();
  645.             // istanzio il driver
  646.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  647.             return driver.getDriverConfigurazioneDB().porteAppAzioneList(idPortaApplicativa, ricerca);

  648.         } catch (Exception e) {
  649.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  650.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  651.         } finally {
  652.             ControlStationCore.dbM.releaseConnection(con);
  653.         }

  654.     }

  655.    

  656.     public PortaApplicativa getPortaApplicativa(long idPortaApplicativa) throws DriverConfigurazioneNotFound, DriverConfigurazioneException {
  657.         Connection con = null;
  658.         String nomeMetodo = "getPortaApplicativa";
  659.         DriverControlStationDB driver = null;

  660.         try {
  661.             // prendo una connessione
  662.             con = ControlStationCore.dbM.getConnection();
  663.             // istanzio il driver
  664.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  665.             return driver.getDriverConfigurazioneDB().getPortaApplicativa(idPortaApplicativa);

  666.         } catch (DriverConfigurazioneNotFound de) {
  667.             ControlStationCore.logDebug(getPrefixError(nomeMetodo,  de),de);
  668.             throw de;
  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 boolean existsPortaApplicativa(IDPortaApplicativa idPA) throws DriverConfigurazioneException {
  678.         Connection con = null;
  679.         String nomeMetodo = "existsPortaApplicativa";
  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().existsPortaApplicativa(idPA);

  687.         } catch (Exception e) {
  688.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  689.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  690.         } finally {
  691.             ControlStationCore.dbM.releaseConnection(con);
  692.         }
  693.     }

  694.     public boolean existsPortaApplicativa(IDServizio idServizio, boolean ricercaPuntuale) throws DriverConfigurazioneException {
  695.         Connection con = null;
  696.         String nomeMetodo = "existsPortaApplicativa (ricercaPuntuale)";
  697.         DriverControlStationDB driver = null;

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

  703.             List<PortaApplicativa> list = driver.getDriverConfigurazioneDB().getPorteApplicative(idServizio, ricercaPuntuale);
  704.            
  705.             return list!=null && !list.isEmpty();
  706.         } catch(DriverConfigurazioneNotFound nfe) {
  707.             return false;
  708.         } catch (Exception e) {
  709.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  710.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  711.         } finally {
  712.             ControlStationCore.dbM.releaseConnection(con);
  713.         }
  714.     }

  715.     public boolean existsPortaApplicativaVirtuale(IDServizio idServizio, IDSoggetto soggettoVirtuale, boolean ricercaPuntuale) throws DriverConfigurazioneException {
  716.         Connection con = null;
  717.         String nomeMetodo = "existsPortaApplicativa_soggettoVirtuale (ricercaPuntuale)";
  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.             List<PortaApplicativa> list = driver.getDriverConfigurazioneDB().getPorteApplicativeVirtuali(soggettoVirtuale, idServizio, ricercaPuntuale);
  725.            
  726.             return list!=null && !list.isEmpty();

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

  734.     public boolean existsPortaApplicativaAzione(String nome) throws DriverConfigurazioneException {
  735.         Connection con = null;
  736.         String nomeMetodo = "existsPortaApplicativaAzione";
  737.         DriverControlStationDB driver = null;

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

  743.             return driver.getDriverConfigurazioneDB().existsPortaApplicativaAzione(nome);

  744.         } catch (Exception e) {
  745.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  746.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  747.         } finally {
  748.             ControlStationCore.dbM.releaseConnection(con);
  749.         }
  750.     }
  751.    
  752.     public boolean azioneUsataInTrasformazioniPortaApplicativa(String nome) throws DriverConfigurazioneException {
  753.         Connection con = null;
  754.         String nomeMetodo = "azioneUsataInTrasformazioniPortaApplicativa";
  755.         DriverControlStationDB driver = null;

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

  761.             return driver.getDriverConfigurazioneDB().azioneUsataInTrasformazioniPortaApplicativa(nome);

  762.         } catch (Exception e) {
  763.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  764.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  765.         } finally {
  766.             ControlStationCore.dbM.releaseConnection(con);
  767.         }
  768.     }
  769.    
  770.     public List<MappingErogazionePortaApplicativa> getMappingConGruppiPerAzione(String nomeAzione, List<IDServizio> list) throws DriverConfigurazioneException {
  771.         Connection con = null;
  772.         String nomeMetodo = "getMappingConGruppiPerAzione";
  773.        
  774.         try {
  775.             // prendo una connessione
  776.             con = ControlStationCore.dbM.getConnection();
  777.            
  778.             List<MappingErogazionePortaApplicativa> listInUtilizzo = new ArrayList<>();
  779.            
  780.             if(list!=null && !list.isEmpty()) {
  781.                 for (IDServizio idServizio : list) {
  782.                     List<MappingErogazionePortaApplicativa> lPA = DBMappingUtils.mappingErogazionePortaApplicativaList(con, this.tipoDB, idServizio, false);
  783.                     if(lPA!=null && !lPA.isEmpty()) {
  784.                         for (MappingErogazionePortaApplicativa mapping : lPA) {
  785.                             try {
  786.                                 PortaApplicativa pa = this.getPortaApplicativa(mapping.getIdPortaApplicativa());
  787.                                 if(pa!=null && pa.getAzione()!=null && pa.getAzione().getAzioneDelegataList()!=null &&
  788.                                         pa.getAzione().getAzioneDelegataList().contains(nomeAzione)) {
  789.                                     listInUtilizzo.add(mapping);
  790.                                 }
  791.                             }catch(DriverConfigurazioneNotFound notFound) {
  792.                                 // ignore
  793.                             }
  794.                         }
  795.                     }
  796.                 }
  797.             }
  798.            
  799.             return listInUtilizzo;

  800.         } catch (Exception e) {
  801.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  802.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  803.         } finally {
  804.             ControlStationCore.dbM.releaseConnection(con);
  805.         }
  806.     }
  807.    
  808.     public List<MappingErogazionePortaApplicativa> getMapping(List<IDServizio> list, boolean addDefault, boolean addNotDefault) throws DriverConfigurazioneException {
  809.         Connection con = null;
  810.         String nomeMetodo = "getMapping";
  811.        
  812.         try {
  813.             // prendo una connessione
  814.             con = ControlStationCore.dbM.getConnection();
  815.            
  816.             List<MappingErogazionePortaApplicativa> listMappingDefault = new ArrayList<>();
  817.            
  818.             if(list!=null && !list.isEmpty()) {
  819.                 for (IDServizio idServizio : list) {
  820.                     List<MappingErogazionePortaApplicativa> lPA = DBMappingUtils.mappingErogazionePortaApplicativaList(con, this.tipoDB, idServizio, false);
  821.                     if(lPA!=null && !lPA.isEmpty()) {
  822.                         for (MappingErogazionePortaApplicativa mapping : lPA) {
  823.                             if(mapping.isDefault()) {
  824.                                 if(addDefault) {
  825.                                     listMappingDefault.add(mapping);
  826.                                 }
  827.                             }
  828.                             else {
  829.                                 if(addNotDefault) {
  830.                                     listMappingDefault.add(mapping);
  831.                                 }
  832.                             }
  833.                         }
  834.                     }
  835.                 }
  836.             }
  837.            
  838.             return listMappingDefault;

  839.         } catch (Exception e) {
  840.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  841.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  842.         } finally {
  843.             ControlStationCore.dbM.releaseConnection(con);
  844.         }
  845.     }
  846.    
  847.     public List<IDPortaApplicativa> getPortaApplicativaAzione(String nome) throws DriverConfigurazioneException, DriverConfigurazioneNotFound {
  848.         Connection con = null;
  849.         String nomeMetodo = "getPortaApplicativaAzione";
  850.         DriverControlStationDB driver = null;

  851.         try {
  852.             // prendo una connessione
  853.             con = ControlStationCore.dbM.getConnection();
  854.             // istanzio il driver
  855.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  856.             return driver.getDriverConfigurazioneDB().getPortaApplicativaAzione(nome);

  857.         }catch(DriverConfigurazioneNotFound dNotF){
  858.             ControlStationCore.logDebug("[ControlStationCore::" + nomeMetodo + "] Exception :" + dNotF.getMessage(), dNotF);
  859.             throw dNotF;
  860.         } catch (Exception e) {
  861.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  862.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  863.         } finally {
  864.             ControlStationCore.dbM.releaseConnection(con);
  865.         }
  866.     }

  867.     public List<PortaApplicativa> getPorteApplicativaByIdProprietario(long idProprietario) throws DriverConfigurazioneException {
  868.         Connection con = null;
  869.         String nomeMetodo = "getPorteApplicativaByIdProprietario";
  870.         DriverControlStationDB driver = null;

  871.         try {
  872.             // prendo una connessione
  873.             con = ControlStationCore.dbM.getConnection();
  874.             // istanzio il driver
  875.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  876.             return driver.getDriverConfigurazioneDB().getPorteApplicativaByIdProprietario(idProprietario);

  877.         } catch (Exception e) {
  878.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  879.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  880.         } finally {
  881.             ControlStationCore.dbM.releaseConnection(con);
  882.         }
  883.     }

  884.     public List<PortaApplicativa> getPorteApplicativeWithServizio(Long idServizio, String tiposervizio, String nomeservizio, Integer versioneServizio,
  885.             Long idSoggetto, String tiposoggetto, String nomesoggetto) throws DriverConfigurazioneException {
  886.         Connection con = null;
  887.         String nomeMetodo = "getPorteApplicativeWithServizio";
  888.         DriverControlStationDB driver = null;

  889.         try {
  890.             // prendo una connessione
  891.             con = ControlStationCore.dbM.getConnection();
  892.             // istanzio il driver
  893.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  894.             return driver.getDriverConfigurazioneDB().getPorteApplicativeWithServizio(idServizio, tiposervizio, nomeservizio, versioneServizio,
  895.                     idSoggetto, tiposoggetto, nomesoggetto);

  896.         } catch (Exception e) {
  897.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  898.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  899.         } finally {
  900.             ControlStationCore.dbM.releaseConnection(con);
  901.         }
  902.     }

  903.     public PortaApplicativa getPortaApplicativaWithSoggettoAndServizio(String nome, Long idSoggetto, Long idServizio, String tipoServizio, String nomeServizio, Integer versioneServizio) throws DriverConfigurazioneException {
  904.         Connection con = null;
  905.         String nomeMetodo = "getPortaApplicativaWithSoggettoAndServizio";
  906.         DriverControlStationDB driver = null;

  907.         try {
  908.             // prendo una connessione
  909.             con = ControlStationCore.dbM.getConnection();
  910.             // istanzio il driver
  911.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  912.             return driver.getDriverConfigurazioneDB().getPortaApplicativaWithSoggettoAndServizio(nome, idSoggetto, idServizio, tipoServizio, nomeServizio, versioneServizio);

  913.         } catch (Exception e) {
  914.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  915.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  916.         } finally {
  917.             ControlStationCore.dbM.releaseConnection(con);
  918.         }
  919.     }
  920.    
  921.     public List<MtomProcessorFlowParameter> porteApplicativeMTOMRequestList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  922.         Connection con = null;
  923.         String nomeMetodo = "porteApplicativeMTOMRequestList";
  924.         DriverControlStationDB driver = null;

  925.         try {
  926.             // prendo una connessione
  927.             con = ControlStationCore.dbM.getConnection();
  928.             // istanzio il driver
  929.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  930.             return driver.getDriverConfigurazioneDB().porteApplicativeMTOMRequestList(idPortaApplicativa, ricerca);

  931.         } catch (Exception e) {
  932.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  933.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  934.         } finally {
  935.             ControlStationCore.dbM.releaseConnection(con);
  936.         }

  937.     }

  938.     public List<MtomProcessorFlowParameter> porteApplicativeMTOMResponseList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  939.         Connection con = null;
  940.         String nomeMetodo = "porteApplicativeMTOMResponseList";
  941.         DriverControlStationDB driver = null;

  942.         try {
  943.             // prendo una connessione
  944.             con = ControlStationCore.dbM.getConnection();
  945.             // istanzio il driver
  946.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  947.             return driver.getDriverConfigurazioneDB().porteApplicativeMTOMResponseList(idPortaApplicativa, ricerca);

  948.         } catch (Exception e) {
  949.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  950.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  951.         } finally {
  952.             ControlStationCore.dbM.releaseConnection(con);
  953.         }

  954.     }
  955.    
  956.    
  957.     public IDPortaApplicativa getIDPortaApplicativaAssociataDefault(IDServizio idServizio) throws DriverConfigurazioneException {
  958.         Connection con = null;
  959.         String nomeMetodo = "getIDPortaApplicativaAssociataDefault";
  960.         DriverControlStationDB driver = null;

  961.         try {
  962.             // prendo una connessione
  963.             con = ControlStationCore.dbM.getConnection();
  964.             // istanzio il driver
  965.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  966.             return driver.getIDPortaApplicativaAssociataDefault(idServizio);

  967.         } catch (Exception e) {
  968.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  969.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  970.         } finally {
  971.             ControlStationCore.dbM.releaseConnection(con);
  972.         }
  973.     }
  974.     public IDPortaApplicativa getIDPortaApplicativaAssociataAzione(IDServizio idServizio) throws DriverConfigurazioneException {
  975.         Connection con = null;
  976.         String nomeMetodo = "getIDPortaApplicativaAssociataAzione";
  977.         DriverControlStationDB driver = null;

  978.         try {
  979.             // prendo una connessione
  980.             con = ControlStationCore.dbM.getConnection();
  981.             // istanzio il driver
  982.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  983.             return driver.getIDPortaApplicativaAssociataAzione(idServizio);

  984.         } catch (Exception e) {
  985.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  986.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  987.         } finally {
  988.             ControlStationCore.dbM.releaseConnection(con);
  989.         }
  990.     }
  991.     public List<IDPortaApplicativa> getIDPorteApplicativeAssociate(IDServizio idServizio) throws DriverConfigurazioneException {
  992.         Connection con = null;
  993.         String nomeMetodo = "getIDPorteApplicativeAssociate";
  994.         DriverControlStationDB driver = null;

  995.         try {
  996.             // prendo una connessione
  997.             con = ControlStationCore.dbM.getConnection();
  998.             // istanzio il driver
  999.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1000.             return driver.getIDPorteApplicativeAssociate(idServizio);

  1001.         } catch (Exception e) {
  1002.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1003.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1004.         } finally {
  1005.             ControlStationCore.dbM.releaseConnection(con);
  1006.         }
  1007.     }
  1008.     public boolean existsMappingErogazionePortaApplicativa(MappingErogazionePortaApplicativa mapping) throws DriverConfigurazioneException {
  1009.         Connection con = null;
  1010.         String nomeMetodo = "existsMappingErogazionePortaApplicativa";
  1011.         DriverControlStationDB driver = null;

  1012.         try {
  1013.             // prendo una connessione
  1014.             con = ControlStationCore.dbM.getConnection();
  1015.             // istanzio il driver
  1016.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1017.             return driver.existsMappingErogazionePortaApplicativa(mapping);

  1018.         } catch (Exception e) {
  1019.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1020.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1021.         } finally {
  1022.             ControlStationCore.dbM.releaseConnection(con);
  1023.         }
  1024.     }
  1025.    
  1026.     public void aggiornaDescrizioneMappingErogazionePortaApplicativa(MappingErogazionePortaApplicativa mapping, String user) throws DriverConfigurazioneException {
  1027.         Connection con = null;
  1028.         String nomeMetodo = "aggiornaDescrizioneMappingErogazionePortaApplicativa";
  1029.         try {
  1030.             // prendo una connessione
  1031.             con = ControlStationCore.dbM.getConnection();
  1032.            
  1033.             DBMappingUtils.updateMappingErogazione(mapping.getTableId(), mapping.getDescrizione(), con, this.tipoDB);

  1034.             if(mapping.getIdPortaApplicativa()!=null) {
  1035.                 this.updateProprietaOggetto(mapping.getIdPortaApplicativa(), user);
  1036.             }
  1037.            
  1038.         } catch (Exception e) {
  1039.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1040.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1041.         } finally {
  1042.             ControlStationCore.dbM.releaseConnection(con);
  1043.         }
  1044.     }
  1045.    
  1046.     public MappingErogazionePortaApplicativa getMappingErogazionePortaApplicativa(PortaApplicativa pa) throws DriverConfigurazioneException {
  1047.         Connection con = null;
  1048.         String nomeMetodo = "getMappingErogazionePortaApplicativa";
  1049.         try {
  1050.             // prendo una connessione
  1051.             con = ControlStationCore.dbM.getConnection();
  1052.            
  1053.             IDPortaApplicativa idPA = new IDPortaApplicativa();
  1054.             idPA.setNome(pa.getNome());
  1055.            
  1056.             IDServizio idServizio = IDServizioFactory.getInstance().getIDServizioFromValues(pa.getServizio().getTipo(), pa.getServizio().getNome(),
  1057.                     pa.getTipoSoggettoProprietario(), pa.getNomeSoggettoProprietario(),
  1058.                     pa.getServizio().getVersione());
  1059.            
  1060.             return DBMappingUtils.getMappingErogazione(idServizio, idPA, con, this.tipoDB);

  1061.         } catch (Exception e) {
  1062.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1063.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1064.         } finally {
  1065.             ControlStationCore.dbM.releaseConnection(con);
  1066.         }
  1067.     }

  1068.     public List<MappingErogazionePortaApplicativa> countMappingErogazionePortaApplicativa(IDServizio idServizio) throws DriverConfigurazioneException {
  1069.         Connection con = null;
  1070.         String nomeMetodo = "countMappingErogazionePortaApplicativa";
  1071.         try {
  1072.             // prendo una connessione
  1073.             con = ControlStationCore.dbM.getConnection();
  1074.            
  1075.             return DBMappingUtils.mappingErogazionePortaApplicativaList(con, this.tipoDB, idServizio, false);

  1076.         } catch (Exception e) {
  1077.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1078.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1079.         } finally {
  1080.             ControlStationCore.dbM.releaseConnection(con);
  1081.         }
  1082.     }
  1083.    
  1084.     private static boolean showGroup = true;
  1085.     public static boolean isShowGroup() {
  1086.         return showGroup;
  1087.     }
  1088.     public static void setShowGroup(boolean showGroup) {
  1089.         PorteApplicativeCore.showGroup = showGroup;
  1090.     }
  1091.    
  1092.     public String getLabelRegolaMappingErogazionePortaApplicativa(String functionDi, String function, PortaApplicativa pa) throws DriverConfigurazioneException {
  1093.         return getLabelRegolaMappingErogazionePortaApplicativa(functionDi, function, pa, 50, false);
  1094.     }
  1095.     public String getLabelRegolaMappingErogazionePortaApplicativa(String functionDi, String function, PortaApplicativa pa, boolean forceGroupName) throws DriverConfigurazioneException {
  1096.         return getLabelRegolaMappingErogazionePortaApplicativa(functionDi, function, pa, 50, forceGroupName);
  1097.     }
  1098.     public String getLabelRegolaMappingErogazionePortaApplicativa(String functionDi, String function, PortaApplicativa pa, int sizeSubstring) throws DriverConfigurazioneException {
  1099.         return getLabelRegolaMappingErogazionePortaApplicativa(functionDi, function, pa, sizeSubstring, false);
  1100.     }
  1101.     public String getLabelRegolaMappingErogazionePortaApplicativa(String functionDi, String function, PortaApplicativa pa, int sizeSubstring, boolean forceGroupName) throws DriverConfigurazioneException {
  1102.        
  1103.         String prefix = "";
  1104.         if(functionDi!=null) {
  1105.             prefix = functionDi;
  1106.             if(showGroup) {
  1107.                 prefix = convertPrefixConfigDelGruppo(prefix);
  1108.             }
  1109.         }
  1110.        
  1111.         MappingErogazionePortaApplicativa mapping = this.getMappingErogazionePortaApplicativa(pa);
  1112.                
  1113.         if(mapping.isDefault()) {
  1114.             if(this.countMappingErogazionePortaApplicativa(mapping.getIdServizio()).size()>1 || forceGroupName) {
  1115.                 if(showGroup) {
  1116.                     return prefix+getLabelGroup(mapping.getDescrizione());
  1117.                 }
  1118.                 else {
  1119.                     return prefix+PorteApplicativeCostanti.LABEL_PARAMETRO_PORTE_APPLICATIVE_MAPPING_EROGAZIONE_PA_NOME_DEFAULT;
  1120.                 }
  1121.             }
  1122.             else {
  1123.                 return function!=null ? function : PorteApplicativeCostanti.LABEL_PARAMETRO_PORTE_APPLICATIVE_MAPPING_EROGAZIONE_PA_NOME_DEFAULT;
  1124.             }
  1125.         }
  1126.         else {
  1127.             if(showGroup) {
  1128.                 StringBuilder sb = new StringBuilder(mapping.getDescrizione());
  1129.                 if(sb.length()>sizeSubstring)
  1130.                     return prefix+getLabelGroup(sb.toString().substring(0, (sizeSubstring-3))+"...");
  1131.                 else
  1132.                     return prefix+getLabelGroup(sb.toString());
  1133.             }
  1134.             else {
  1135.                 List<String> listaAzioni = pa.getAzione()!= null ?  pa.getAzione().getAzioneDelegataList() : new ArrayList<>();
  1136.                 if(!listaAzioni.isEmpty()) {
  1137.                     StringBuilder sb = new StringBuilder();
  1138.                     for (String string : listaAzioni) {
  1139.                         if(sb.length() >0)
  1140.                             sb.append(", ");
  1141.                        
  1142.                         sb.append(string);
  1143.                     }
  1144.                     if(sb.length()>sizeSubstring)
  1145.                         return prefix+sb.toString().substring(0, (sizeSubstring-3))+"...";
  1146.                     else
  1147.                         return prefix+sb.toString();
  1148.                 }
  1149.                 else {
  1150.                     return prefix+"???";
  1151.                 }
  1152.             }
  1153.         }
  1154.     }
  1155.    
  1156.     public List<IDPortaApplicativa> getAllIdPorteApplicative(FiltroRicercaPorteApplicative filtroRicerca) throws DriverConfigurazioneException {
  1157.         Connection con = null;
  1158.         String nomeMetodo = "getAllIdPorteApplicative";
  1159.         DriverControlStationDB driver = null;

  1160.         try {
  1161.             // prendo una connessione
  1162.             con = ControlStationCore.dbM.getConnection();
  1163.             // istanzio il driver
  1164.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1165.             return driver.getDriverConfigurazioneDB().getAllIdPorteApplicative(filtroRicerca);

  1166.         } catch (DriverConfigurazioneNotFound notFound) {
  1167.             ControlStationCore.logDebug("[ControlStationCore::" + nomeMetodo + "] Exception :" + notFound.getMessage(), notFound);
  1168.             return new ArrayList<>();
  1169.         } catch (Exception e) {
  1170.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1171.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1172.         } finally {
  1173.             ControlStationCore.dbM.releaseConnection(con);
  1174.         }
  1175.     }
  1176.    
  1177.     public List<String> portaApplicativaRuoliList(long idPA, ISearch ricerca) throws DriverConfigurazioneException {
  1178.         Connection con = null;
  1179.         String nomeMetodo = "portaApplicativaRuoliList";
  1180.         DriverControlStationDB driver = null;

  1181.         try {
  1182.             // prendo una connessione
  1183.             con = ControlStationCore.dbM.getConnection();
  1184.             // istanzio il driver
  1185.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1186.             return driver.getDriverConfigurazioneDB().portaApplicativaRuoliList(idPA, ricerca);

  1187.         } catch (Exception e) {
  1188.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1189.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1190.         } finally {
  1191.             ControlStationCore.dbM.releaseConnection(con);
  1192.         }

  1193.     }
  1194.    
  1195.     public List<String> portaApplicativaRuoliTokenList(long idPA, ISearch ricerca) throws DriverConfigurazioneException {
  1196.         Connection con = null;
  1197.         String nomeMetodo = "portaApplicativaRuoliTokenList";
  1198.         DriverControlStationDB driver = null;

  1199.         try {
  1200.             // prendo una connessione
  1201.             con = ControlStationCore.dbM.getConnection();
  1202.             // istanzio il driver
  1203.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1204.             return driver.getDriverConfigurazioneDB().portaApplicativaRuoliTokenList(idPA, ricerca);

  1205.         } catch (Exception e) {
  1206.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1207.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1208.         } finally {
  1209.             ControlStationCore.dbM.releaseConnection(con);
  1210.         }

  1211.     }
  1212.    
  1213.     public List<String> portaApplicativaScopeList(long idPA, ISearch ricerca) throws DriverConfigurazioneException {
  1214.         Connection con = null;
  1215.         String nomeMetodo = "portaApplicativaScopeList";
  1216.         DriverControlStationDB driver = null;

  1217.         try {
  1218.             // prendo una connessione
  1219.             con = ControlStationCore.dbM.getConnection();
  1220.             // istanzio il driver
  1221.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1222.             return driver.getDriverConfigurazioneDB().portaApplicativaScopeList(idPA, ricerca);

  1223.         } catch (Exception e) {
  1224.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1225.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1226.         } finally {
  1227.             ControlStationCore.dbM.releaseConnection(con);
  1228.         }

  1229.     }
  1230.    
  1231.     public Map<String, Properties> readMessageSecurityRequestPropertiesConfiguration(long idPortaDelegata) throws DriverConfigurazioneException {
  1232.         Connection con = null;
  1233.         String nomeMetodo = "readMessageSecurityRequestPropertiesConfiguration";
  1234.         try {
  1235.             // prendo una connessione
  1236.             con = ControlStationCore.dbM.getConnection();
  1237.             Map<String, String> readProperties = DBPropertiesUtils.readProperties(con, this.tipoDB, CostantiDB.PORTE_APPLICATIVE_MESSAGE_SECURITY_REQUEST, CostantiDB.PORTE_APPLICATIVE_MESSAGE_SECURITY_REQUEST_COLUMN_NOME,
  1238.                     CostantiDB.PORTE_APPLICATIVE_MESSAGE_SECURITY_REQUEST_COLUMN_VALORE, CostantiDB.PORTE_APPLICATIVE_MESSAGE_SECURITY_REQUEST_COLUMN_ENC_VALUE,
  1239.                     CostantiDB.PORTE_APPLICATIVE_MESSAGE_SECURITY_REQUEST_COLUMN_ID_PORTA, idPortaDelegata,
  1240.                     this.getDriverBYOKUtilities().getDriverBYOKManagerNode(false, true));
  1241.             return DBPropertiesUtils.toMultiMap(readProperties);
  1242.         } catch (Exception e) {
  1243.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1244.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1245.         } finally {
  1246.             ControlStationCore.dbM.releaseConnection(con);
  1247.         }  
  1248.     }
  1249.    
  1250.     public Map<String, Properties> readMessageSecurityResponsePropertiesConfiguration(long idPortaDelegata) throws DriverConfigurazioneException {
  1251.         Connection con = null;
  1252.         String nomeMetodo = "readMessageSecurityResponsePropertiesConfiguration";
  1253.         try {
  1254.             // prendo una connessione
  1255.             con = ControlStationCore.dbM.getConnection();
  1256.             Map<String, String> readProperties = DBPropertiesUtils.readProperties(con, this.tipoDB, CostantiDB.PORTE_APPLICATIVE_MESSAGE_SECURITY_RESPONSE, CostantiDB.PORTE_APPLICATIVE_MESSAGE_SECURITY_RESPONSE_COLUMN_NOME,
  1257.                     CostantiDB.PORTE_APPLICATIVE_MESSAGE_SECURITY_RESPONSE_COLUMN_VALORE, CostantiDB.PORTE_APPLICATIVE_MESSAGE_SECURITY_RESPONSE_COLUMN_ENC_VALUE,
  1258.                     CostantiDB.PORTE_APPLICATIVE_MESSAGE_SECURITY_RESPONSE_COLUMN_ID_PORTA, idPortaDelegata,
  1259.                     this.getDriverBYOKUtilities().getDriverBYOKManagerNode(false, true));
  1260.             return DBPropertiesUtils.toMultiMap(readProperties);
  1261.         } catch (Exception e) {
  1262.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1263.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1264.         } finally {
  1265.             ControlStationCore.dbM.releaseConnection(con);
  1266.         }  
  1267.     }
  1268.    
  1269.    
  1270.     public List<ResponseCachingConfigurazioneRegola> getResponseCachingConfigurazioneRegolaList(long idPA, ISearch ricerca) throws DriverConfigurazioneException {
  1271.         Connection con = null;
  1272.         String nomeMetodo = "getResponseCachingConfigurazioneRegolaList";
  1273.         DriverControlStationDB driver = null;

  1274.         try {
  1275.             // prendo una connessione
  1276.             con = ControlStationCore.dbM.getConnection();
  1277.             // istanzio il driver
  1278.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1279.             return driver.getDriverConfigurazioneDB().portaApplicativaResponseCachingConfigurazioneRegolaList(idPA, ricerca);

  1280.         } catch (Exception e) {
  1281.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1282.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1283.         } finally {
  1284.             ControlStationCore.dbM.releaseConnection(con);
  1285.         }

  1286.     }
  1287.    
  1288.     public boolean existsResponseCachingConfigurazioneRegola(long idPorta, Integer statusMin, Integer statusMax, boolean fault) throws DriverConfigurazioneException{
  1289.         Connection con = null;
  1290.         String nomeMetodo = "existsResponseCachingConfigurazioneRegola";
  1291.         DriverControlStationDB driver = null;

  1292.         try {
  1293.             // prendo una connessione
  1294.             con = ControlStationCore.dbM.getConnection();
  1295.             // istanzio il driver
  1296.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1297.             return driver.getDriverConfigurazioneDB().existsPortaApplicativaResponseCachingConfigurazioneRegola(idPorta, statusMin,statusMax,fault);
  1298.         } catch (Exception e) {
  1299.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1300.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1301.         } finally {
  1302.             ControlStationCore.dbM.releaseConnection(con);
  1303.         }
  1304.     }
  1305.    
  1306.    
  1307.     public List<TrasformazioneRegola> porteAppTrasformazioniList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  1308.         Connection con = null;
  1309.         String nomeMetodo = "porteAppTrasformazioniList";
  1310.         DriverControlStationDB driver = null;

  1311.         try {
  1312.             // prendo una connessione
  1313.             con = ControlStationCore.dbM.getConnection();
  1314.             // istanzio il driver
  1315.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1316.             return driver.getDriverConfigurazioneDB().porteApplicativeTrasformazioniList(idPortaApplicativa, ricerca);

  1317.         } catch (Exception e) {
  1318.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1319.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1320.         } finally {
  1321.             ControlStationCore.dbM.releaseConnection(con);
  1322.         }
  1323.     }
  1324.    
  1325.    
  1326.     public boolean existsTrasformazione(long idPorta, String azioni, String pattern, String contentType, String connettori) throws DriverConfigurazioneException{
  1327.         Connection con = null;
  1328.         String nomeMetodo = "existsTrasformazione";
  1329.         DriverControlStationDB driver = null;

  1330.         try {
  1331.             // prendo una connessione
  1332.             con = ControlStationCore.dbM.getConnection();
  1333.             // istanzio il driver
  1334.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1335.             return driver.getDriverConfigurazioneDB().existsPortaApplicativaTrasformazione(idPorta, azioni, pattern, contentType, connettori);
  1336.         } catch (Exception e) {
  1337.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1338.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1339.         } finally {
  1340.             ControlStationCore.dbM.releaseConnection(con);
  1341.         }
  1342.     }
  1343.    
  1344.     public boolean existsTrasformazione(long idPorta, String nome) throws DriverConfigurazioneException{
  1345.         Connection con = null;
  1346.         String nomeMetodo = "existsTrasformazione";
  1347.         DriverControlStationDB driver = null;

  1348.         try {
  1349.             // prendo una connessione
  1350.             con = ControlStationCore.dbM.getConnection();
  1351.             // istanzio il driver
  1352.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1353.             return driver.getDriverConfigurazioneDB().existsPortaApplicativaTrasformazione(idPorta, nome);
  1354.         } catch (Exception e) {
  1355.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1356.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1357.         } finally {
  1358.             ControlStationCore.dbM.releaseConnection(con);
  1359.         }
  1360.     }
  1361.    
  1362.     public TrasformazioneRegola getTrasformazione(long idPorta, String azioni, String pattern, String contentType, String connettori,
  1363.             List<TrasformazioneRegolaApplicabilitaSoggetto> soggetti,
  1364.             List<TrasformazioneRegolaApplicabilitaServizioApplicativo> applicativi,
  1365.             boolean interpretaNullList) throws DriverConfigurazioneException{
  1366.         Connection con = null;
  1367.         String nomeMetodo = "getTrasformazione";
  1368.         DriverControlStationDB driver = null;

  1369.         try {
  1370.             // prendo una connessione
  1371.             con = ControlStationCore.dbM.getConnection();
  1372.             // istanzio il driver
  1373.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1374.             return driver.getDriverConfigurazioneDB().getPortaApplicativaTrasformazione(idPorta, azioni, pattern, contentType, connettori, soggetti, applicativi, interpretaNullList);
  1375.         } catch (Exception e) {
  1376.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1377.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1378.         } finally {
  1379.             ControlStationCore.dbM.releaseConnection(con);
  1380.         }
  1381.     }
  1382.    
  1383.     public TrasformazioneRegola getTrasformazione(long idPorta, String nome) throws DriverConfigurazioneException{
  1384.         Connection con = null;
  1385.         String nomeMetodo = "getTrasformazione";
  1386.         DriverControlStationDB driver = null;

  1387.         try {
  1388.             // prendo una connessione
  1389.             con = ControlStationCore.dbM.getConnection();
  1390.             // istanzio il driver
  1391.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1392.             return driver.getDriverConfigurazioneDB().getPortaApplicativaTrasformazione(idPorta, nome);
  1393.         } catch (Exception e) {
  1394.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1395.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1396.         } finally {
  1397.             ControlStationCore.dbM.releaseConnection(con);
  1398.         }
  1399.     }
  1400.    
  1401.     public List<TrasformazioneRegolaRisposta> porteAppTrasformazioniRispostaList(long idPortaApplicativa, long idTrasformazione, ISearch ricerca) throws DriverConfigurazioneException {
  1402.         Connection con = null;
  1403.         String nomeMetodo = "porteAppTrasformazioniRispostaList";
  1404.         DriverControlStationDB driver = null;

  1405.         try {
  1406.             // prendo una connessione
  1407.             con = ControlStationCore.dbM.getConnection();
  1408.             // istanzio il driver
  1409.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1410.             return driver.getDriverConfigurazioneDB().porteApplicativeTrasformazioniRispostaList(idPortaApplicativa, idTrasformazione, ricerca);

  1411.         } catch (Exception e) {
  1412.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1413.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1414.         } finally {
  1415.             ControlStationCore.dbM.releaseConnection(con);
  1416.         }
  1417.     }
  1418.    
  1419.     public boolean existsTrasformazioneRisposta(long idPorta, long idTrasformazione, Integer statusMin, Integer statusMax, String pattern, String contentType) throws DriverConfigurazioneException{
  1420.         Connection con = null;
  1421.         String nomeMetodo = "existsTrasformazioneRisposta";
  1422.         DriverControlStationDB driver = null;

  1423.         try {
  1424.             // prendo una connessione
  1425.             con = ControlStationCore.dbM.getConnection();
  1426.             // istanzio il driver
  1427.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1428.             return driver.getDriverConfigurazioneDB().existsPortaApplicativaTrasformazioneRisposta(idPorta, idTrasformazione, statusMin, statusMax, pattern, contentType);
  1429.         } catch (Exception e) {
  1430.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1431.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1432.         } finally {
  1433.             ControlStationCore.dbM.releaseConnection(con);
  1434.         }
  1435.     }
  1436.    
  1437.     public boolean existsTrasformazioneRisposta(long idPorta, long idTrasformazione, String nome) throws DriverConfigurazioneException{
  1438.         Connection con = null;
  1439.         String nomeMetodo = "existsTrasformazioneRisposta";
  1440.         DriverControlStationDB driver = null;

  1441.         try {
  1442.             // prendo una connessione
  1443.             con = ControlStationCore.dbM.getConnection();
  1444.             // istanzio il driver
  1445.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1446.             return driver.getDriverConfigurazioneDB().existsPortaApplicativaTrasformazioneRisposta(idPorta, idTrasformazione, nome);
  1447.         } catch (Exception e) {
  1448.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1449.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1450.         } finally {
  1451.             ControlStationCore.dbM.releaseConnection(con);
  1452.         }
  1453.     }
  1454.    
  1455.     public TrasformazioneRegolaRisposta getTrasformazioneRisposta(long idPorta, long idTrasformazione, Integer statusMin, Integer statusMax, String pattern, String contentType) throws DriverConfigurazioneException{
  1456.         Connection con = null;
  1457.         String nomeMetodo = "getTrasformazioneRisposta";
  1458.         DriverControlStationDB driver = null;

  1459.         try {
  1460.             // prendo una connessione
  1461.             con = ControlStationCore.dbM.getConnection();
  1462.             // istanzio il driver
  1463.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1464.             return driver.getDriverConfigurazioneDB().getPortaApplicativaTrasformazioneRisposta(idPorta, idTrasformazione, statusMin, statusMax, pattern, contentType);
  1465.         } catch (Exception e) {
  1466.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1467.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1468.         } finally {
  1469.             ControlStationCore.dbM.releaseConnection(con);
  1470.         }
  1471.     }
  1472.    
  1473.     public TrasformazioneRegolaRisposta getTrasformazioneRisposta(long idPorta, long idTrasformazione, String nome) throws DriverConfigurazioneException{
  1474.         Connection con = null;
  1475.         String nomeMetodo = "getTrasformazioneRisposta";
  1476.         DriverControlStationDB driver = null;

  1477.         try {
  1478.             // prendo una connessione
  1479.             con = ControlStationCore.dbM.getConnection();
  1480.             // istanzio il driver
  1481.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1482.             return driver.getDriverConfigurazioneDB().getPortaApplicativaTrasformazioneRisposta(idPorta, idTrasformazione, nome);
  1483.         } catch (Exception e) {
  1484.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1485.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1486.         } finally {
  1487.             ControlStationCore.dbM.releaseConnection(con);
  1488.         }
  1489.     }
  1490.    
  1491.     public List<TrasformazioneRegolaParametro> porteAppTrasformazioniRispostaHeaderList(long idPortaApplicativa, long idTrasformazione, long idTrasformazioneRisposta,  ISearch ricerca) throws DriverConfigurazioneException {
  1492.         Connection con = null;
  1493.         String nomeMetodo = "porteAppTrasformazioniRispostaList";
  1494.         DriverControlStationDB driver = null;

  1495.         try {
  1496.             // prendo una connessione
  1497.             con = ControlStationCore.dbM.getConnection();
  1498.             // istanzio il driver
  1499.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1500.             return driver.getDriverConfigurazioneDB().porteApplicativeTrasformazioniRispostaHeaderList(idPortaApplicativa, idTrasformazione, idTrasformazioneRisposta, ricerca);

  1501.         } catch (Exception e) {
  1502.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1503.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1504.         } finally {
  1505.             ControlStationCore.dbM.releaseConnection(con);
  1506.         }
  1507.     }
  1508.    
  1509.     public boolean existsTrasformazioneRispostaHeader(long idPorta, long idTrasformazione,  long idTrasformazioneRisposta,  String nome, String tipo, boolean checkTipo) throws DriverConfigurazioneException{
  1510.         Connection con = null;
  1511.         String nomeMetodo = "existsTrasformazioneRispostaHeader";
  1512.         DriverControlStationDB driver = null;

  1513.         try {
  1514.             // prendo una connessione
  1515.             con = ControlStationCore.dbM.getConnection();
  1516.             // istanzio il driver
  1517.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1518.             return driver.getDriverConfigurazioneDB().existsPortaApplicativaTrasformazioneRispostaHeader(idPorta, idTrasformazione, idTrasformazioneRisposta, nome, tipo, checkTipo);
  1519.         } catch (Exception e) {
  1520.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1521.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1522.         } finally {
  1523.             ControlStationCore.dbM.releaseConnection(con);
  1524.         }
  1525.     }
  1526.    
  1527.     public TrasformazioneRegolaParametro getTrasformazioneRispostaHeader(long idPorta, long idTrasformazione, long idTrasformazioneRisposta,  String nome, String tipo, boolean checkTipo) throws DriverConfigurazioneException{
  1528.         Connection con = null;
  1529.         String nomeMetodo = "getTrasformazioneRispostaHeader";
  1530.         DriverControlStationDB driver = null;

  1531.         try {
  1532.             // prendo una connessione
  1533.             con = ControlStationCore.dbM.getConnection();
  1534.             // istanzio il driver
  1535.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1536.             return driver.getDriverConfigurazioneDB().getPortaApplicativaTrasformazioneRispostaHeader(idPorta, idTrasformazione, idTrasformazioneRisposta, nome, tipo, checkTipo);
  1537.         } catch (Exception e) {
  1538.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1539.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1540.         } finally {
  1541.             ControlStationCore.dbM.releaseConnection(con);
  1542.         }
  1543.     }
  1544.    
  1545.     public List<TrasformazioneRegolaParametro> porteAppTrasformazioniRichiestaHeaderList(long idPortaApplicativa, long idTrasformazione,  ISearch ricerca) throws DriverConfigurazioneException {
  1546.         Connection con = null;
  1547.         String nomeMetodo = "porteAppTrasformazioniRichiestaHeaderList";
  1548.         DriverControlStationDB driver = null;

  1549.         try {
  1550.             // prendo una connessione
  1551.             con = ControlStationCore.dbM.getConnection();
  1552.             // istanzio il driver
  1553.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1554.             return driver.getDriverConfigurazioneDB().porteApplicativeTrasformazioniRichiestaHeaderList(idPortaApplicativa, idTrasformazione, ricerca);

  1555.         } catch (Exception e) {
  1556.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1557.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1558.         } finally {
  1559.             ControlStationCore.dbM.releaseConnection(con);
  1560.         }
  1561.     }
  1562.    
  1563.     public List<TrasformazioneRegolaParametro> porteAppTrasformazioniRichiestaUrlParameterList(long idPortaApplicativa, long idTrasformazione,  ISearch ricerca) throws DriverConfigurazioneException {
  1564.         Connection con = null;
  1565.         String nomeMetodo = "porteAppTrasformazioniRichiestaUrlParameterList";
  1566.         DriverControlStationDB driver = null;

  1567.         try {
  1568.             // prendo una connessione
  1569.             con = ControlStationCore.dbM.getConnection();
  1570.             // istanzio il driver
  1571.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1572.             return driver.getDriverConfigurazioneDB().porteApplicativeTrasformazioniRichiestaUrlParameterList(idPortaApplicativa, idTrasformazione, ricerca);

  1573.         } catch (Exception e) {
  1574.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1575.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1576.         } finally {
  1577.             ControlStationCore.dbM.releaseConnection(con);
  1578.         }
  1579.     }
  1580.    
  1581.     public boolean existsTrasformazioneRichiestaHeader(long idPorta, long idTrasformazione, String nome, String tipo, boolean checkTipo) throws DriverConfigurazioneException{
  1582.         Connection con = null;
  1583.         String nomeMetodo = "existsTrasformazioneRichiestaHeader";
  1584.         DriverControlStationDB driver = null;

  1585.         try {
  1586.             // prendo una connessione
  1587.             con = ControlStationCore.dbM.getConnection();
  1588.             // istanzio il driver
  1589.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1590.             return driver.getDriverConfigurazioneDB().existsPortaApplicativaTrasformazioneRichiestaHeader(idPorta, idTrasformazione, nome, tipo, checkTipo);
  1591.         } catch (Exception e) {
  1592.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1593.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1594.         } finally {
  1595.             ControlStationCore.dbM.releaseConnection(con);
  1596.         }
  1597.     }
  1598.    
  1599.     public TrasformazioneRegolaParametro getTrasformazioneRichiestaHeader(long idPorta, long idTrasformazione, String nome, String tipo, boolean checkTipo) throws DriverConfigurazioneException{
  1600.         Connection con = null;
  1601.         String nomeMetodo = "getTrasformazioneRichiestaHeader";
  1602.         DriverControlStationDB driver = null;

  1603.         try {
  1604.             // prendo una connessione
  1605.             con = ControlStationCore.dbM.getConnection();
  1606.             // istanzio il driver
  1607.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1608.             return driver.getDriverConfigurazioneDB().getPortaApplicativaTrasformazioneRichiestaHeader(idPorta, idTrasformazione, nome, tipo, checkTipo);
  1609.         } catch (Exception e) {
  1610.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1611.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1612.         } finally {
  1613.             ControlStationCore.dbM.releaseConnection(con);
  1614.         }
  1615.     }
  1616.    
  1617.     public boolean existsTrasformazioneRichiestaUrlParameter(long idPorta, long idTrasformazione, String nome, String tipo, boolean checkTipo) throws DriverConfigurazioneException{
  1618.         Connection con = null;
  1619.         String nomeMetodo = "existsTrasformazioneRichiestaUrlParameter";
  1620.         DriverControlStationDB driver = null;

  1621.         try {
  1622.             // prendo una connessione
  1623.             con = ControlStationCore.dbM.getConnection();
  1624.             // istanzio il driver
  1625.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1626.             return driver.getDriverConfigurazioneDB().existsPortaApplicativaTrasformazioneRichiestaUrlParameter(idPorta, idTrasformazione, nome, tipo, checkTipo);
  1627.         } catch (Exception e) {
  1628.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1629.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1630.         } finally {
  1631.             ControlStationCore.dbM.releaseConnection(con);
  1632.         }
  1633.     }
  1634.    
  1635.     public TrasformazioneRegolaParametro getTrasformazioneRichiestaUrlParameter(long idPorta, long idTrasformazione, String nome, String tipo, boolean checkTipo) throws DriverConfigurazioneException{
  1636.         Connection con = null;
  1637.         String nomeMetodo = "getTrasformazioneRichiestaUrlParameter";
  1638.         DriverControlStationDB driver = null;

  1639.         try {
  1640.             // prendo una connessione
  1641.             con = ControlStationCore.dbM.getConnection();
  1642.             // istanzio il driver
  1643.             driver = new DriverControlStationDB(con, null, this.tipoDB);
  1644.             return driver.getDriverConfigurazioneDB().getPortaApplicativaTrasformazioneRichiestaUrlParameter(idPorta, idTrasformazione, nome, tipo, checkTipo);
  1645.         } catch (Exception e) {
  1646.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1647.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1648.         } finally {
  1649.             ControlStationCore.dbM.releaseConnection(con);
  1650.         }
  1651.     }
  1652.    
  1653.     public List<TrasformazioneRegolaApplicabilitaSoggetto> porteAppTrasformazioniSoggettoList(long idPortaApplicativa, long idTrasformazione, ISearch ricerca) throws DriverConfigurazioneException {
  1654.         Connection con = null;
  1655.         String nomeMetodo = "porteAppTrasformazioniSoggettoList";
  1656.         DriverControlStationDB driver = null;

  1657.         try {
  1658.             // prendo una connessione
  1659.             con = ControlStationCore.dbM.getConnection();
  1660.             // istanzio il driver
  1661.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1662.             return driver.getDriverConfigurazioneDB().porteApplicativeTrasformazioniSoggettiList(idPortaApplicativa, idTrasformazione, ricerca);

  1663.         } catch (Exception e) {
  1664.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1665.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1666.         } finally {
  1667.             ControlStationCore.dbM.releaseConnection(con);
  1668.         }

  1669.     }
  1670.    
  1671.     public List<TrasformazioneRegolaApplicabilitaServizioApplicativo> porteAppTrasformazioniServiziApplicativiAutorizzatiList(long idPortaApplicativa, long idTrasformazione, ISearch ricerca) throws DriverConfigurazioneException {
  1672.         Connection con = null;
  1673.         String nomeMetodo = "porteAppTrasformazioniServiziApplicativiAutorizzatiList";
  1674.         DriverControlStationDB driver = null;

  1675.         try {
  1676.             // prendo una connessione
  1677.             con = ControlStationCore.dbM.getConnection();
  1678.             // istanzio il driver
  1679.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1680.             return driver.getDriverConfigurazioneDB().porteApplicativeTrasformazioniServiziApplicativiList(idPortaApplicativa, idTrasformazione, ricerca);

  1681.         } catch (Exception e) {
  1682.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1683.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1684.         } finally {
  1685.             ControlStationCore.dbM.releaseConnection(con);
  1686.         }

  1687.     }
  1688.    
  1689.     public List<Proprieta> porteApplicativeAutenticazioneCustomPropList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  1690.         Connection con = null;
  1691.         String nomeMetodo = "porteApplicativeAutenticazioneCustomPropList";
  1692.         DriverControlStationDB driver = null;

  1693.         try {
  1694.             // prendo una connessione
  1695.             con = ControlStationCore.dbM.getConnection();
  1696.             // istanzio il driver
  1697.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1698.             return driver.getDriverConfigurazioneDB().porteApplicativeAutenticazioneCustomPropList(idPortaApplicativa, ricerca);

  1699.         } catch (Exception e) {
  1700.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1701.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1702.         } finally {
  1703.             ControlStationCore.dbM.releaseConnection(con);
  1704.         }

  1705.     }
  1706.    
  1707.     public List<Proprieta> porteApplicativeAutorizzazioneCustomPropList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  1708.         Connection con = null;
  1709.         String nomeMetodo = "porteApplicativeAutorizzazioneCustomPropList";
  1710.         DriverControlStationDB driver = null;

  1711.         try {
  1712.             // prendo una connessione
  1713.             con = ControlStationCore.dbM.getConnection();
  1714.             // istanzio il driver
  1715.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1716.             return driver.getDriverConfigurazioneDB().porteApplicativeAutorizzazioneCustomPropList(idPortaApplicativa, ricerca);

  1717.         } catch (Exception e) {
  1718.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1719.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1720.         } finally {
  1721.             ControlStationCore.dbM.releaseConnection(con);
  1722.         }

  1723.     }
  1724.    
  1725.     public List<Proprieta> porteApplicativeAutorizzazioneContenutoCustomPropList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  1726.         Connection con = null;
  1727.         String nomeMetodo = "porteApplicativeAutorizzazioneContenutoCustomPropList";
  1728.         DriverControlStationDB driver = null;

  1729.         try {
  1730.             // prendo una connessione
  1731.             con = ControlStationCore.dbM.getConnection();
  1732.             // istanzio il driver
  1733.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1734.             return driver.getDriverConfigurazioneDB().porteApplicativeAutorizzazioneContenutoCustomPropList(idPortaApplicativa, ricerca);

  1735.         } catch (Exception e) {
  1736.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1737.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1738.         } finally {
  1739.             ControlStationCore.dbM.releaseConnection(con);
  1740.         }

  1741.     }
  1742.    
  1743.     public List<Proprieta> porteApplicativeConnettoriMultipliConfigPropList(long idPortaApplicativa, ISearch ricerca) throws DriverConfigurazioneException {
  1744.         Connection con = null;
  1745.         String nomeMetodo = "porteApplicativeConnettoriMultipliConfigPropList";
  1746.         DriverControlStationDB driver = null;

  1747.         try {
  1748.             // prendo una connessione
  1749.             con = ControlStationCore.dbM.getConnection();
  1750.             // istanzio il driver
  1751.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1752.             return driver.getDriverConfigurazioneDB().porteApplicativeConnettoriMultipliConfigPropList(idPortaApplicativa, ricerca);

  1753.         } catch (Exception e) {
  1754.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1755.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1756.         } finally {
  1757.             ControlStationCore.dbM.releaseConnection(con);
  1758.         }
  1759.     }
  1760.    
  1761.     public List<Proprieta> porteApplicativeConnettoriMultipliPropList(long idPaSa, ISearch ricerca) throws DriverConfigurazioneException {
  1762.         Connection con = null;
  1763.         String nomeMetodo = "porteApplicativeConnettoriMultipliPropList";
  1764.         DriverControlStationDB driver = null;

  1765.         try {
  1766.             // prendo una connessione
  1767.             con = ControlStationCore.dbM.getConnection();
  1768.             // istanzio il driver
  1769.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1770.             return driver.getDriverConfigurazioneDB().porteApplicativeConnettoriMultipliPropList(idPaSa, ricerca);

  1771.         } catch (Exception e) {
  1772.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1773.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1774.         } finally {
  1775.             ControlStationCore.dbM.releaseConnection(con);
  1776.         }
  1777.     }
  1778.    
  1779.     public List<IDPortaApplicativa> porteApplicativeWithApplicativoErogatore(IDServizioApplicativo idSA) throws DriverConfigurazioneException {
  1780.         Connection con = null;
  1781.         String nomeMetodo = "porteApplicativeWithApplicativoErogatore";
  1782.         DriverControlStationDB driver = null;

  1783.         try {
  1784.             // prendo una connessione
  1785.             con = ControlStationCore.dbM.getConnection();
  1786.             // istanzio il driver
  1787.             driver = new DriverControlStationDB(con, null, this.tipoDB);

  1788.             return driver.getDriverConfigurazioneDB().porteApplicativeWithApplicativoErogatore(idSA);

  1789.         } catch (Exception e) {
  1790.             ControlStationCore.logError(getPrefixError(nomeMetodo,  e), e);
  1791.             throw new DriverConfigurazioneException(getPrefixError(nomeMetodo,  e),e);
  1792.         } finally {
  1793.             ControlStationCore.dbM.releaseConnection(con);
  1794.         }
  1795.     }
  1796.    
  1797.     public boolean azioniTutteOneway(AccordoServizioParteSpecifica asps, AccordoServizioParteComuneSintetico as, List<String> azioniDaControllare) {
  1798.         String profiloCollaborazioneAccordo = as.getProfiloCollaborazione().toString();
  1799.         if (profiloCollaborazioneAccordo.equals(CostantiRegistroServizi.ONEWAY.getValue())) {
  1800.             profiloCollaborazioneAccordo = "oneway";
  1801.         } else if (profiloCollaborazioneAccordo.equals(CostantiRegistroServizi.SINCRONO.getValue())) {
  1802.             profiloCollaborazioneAccordo = "sincrono";
  1803.         } else if (profiloCollaborazioneAccordo.equals(CostantiRegistroServizi.ASINCRONO_SIMMETRICO.getValue())) {
  1804.             profiloCollaborazioneAccordo = "asincronoSimmetrico";
  1805.         } else if (profiloCollaborazioneAccordo.equals(CostantiRegistroServizi.ASINCRONO_ASIMMETRICO.getValue())) {
  1806.             profiloCollaborazioneAccordo = "asincronoAsimmetrico";
  1807.         }
  1808.        
  1809.         for (String nomeAzione : azioniDaControllare) {
  1810.             boolean isProfiloOneWay = true;
  1811.             // recupero profilo collaborazione azione se l'azione e'
  1812.             // specificata e il profilo azione e' ridefinito
  1813.             String profiloCollaborazioneAzione = "";
  1814.             if (nomeAzione != null && !nomeAzione.equals("")) {
  1815.                 if(asps.getPortType()!=null){
  1816.                     for (PortTypeSintetico pt : as.getPortType()) {
  1817.                         if(pt.getNome().equals(asps.getPortType())){
  1818.                             for (OperationSintetica op : pt.getAzione()) {
  1819.                                 if(op.getNome().equals(nomeAzione)){
  1820.                                     if(CostantiRegistroServizi.PROFILO_AZIONE_RIDEFINITO.equals(op.getProfAzione())){
  1821.                                         if(op.getProfiloCollaborazione()!=null)
  1822.                                             profiloCollaborazioneAzione = op.getProfiloCollaborazione().toString();
  1823.                                     }
  1824.                                     else{
  1825.                                         if(CostantiRegistroServizi.PROFILO_AZIONE_RIDEFINITO.equals(pt.getProfiloPT()) &&
  1826.                                             pt.getProfiloCollaborazione()!=null) {
  1827.                                             profiloCollaborazioneAzione = pt.getProfiloCollaborazione().toString();
  1828.                                         }
  1829.                                     }
  1830.                                 }
  1831.                             }
  1832.                         }
  1833.                     }
  1834.                 }
  1835.                 else{
  1836.                     for (int i = 0; i < as.getAzione().size(); i++) {
  1837.                         AzioneSintetica tmpAz = as.getAzione().get(i);
  1838.                         if (tmpAz.getProfAzione().equals(CostantiRegistroServizi.PROFILO_AZIONE_RIDEFINITO)) {
  1839.                             if(tmpAz.getProfiloCollaborazione()!=null)
  1840.                                 profiloCollaborazioneAzione = tmpAz.getProfiloCollaborazione().toString();
  1841.                             break;
  1842.                         }
  1843.                     }
  1844.                 }
  1845.             }

  1846.             // Controllo se nomeAzione e' specificato allora e' possibile
  1847.             // che il profilo azione sia ridefinito
  1848.             // quindi devo controllare se e' diverso da oneway
  1849.             if (nomeAzione != null && !nomeAzione.equals("")) {
  1850.                 // se e' diverso da oneway posso avere solo un azione
  1851.                 if ( profiloCollaborazioneAzione != null && !profiloCollaborazioneAzione.equals("") ){
  1852.                     if (!profiloCollaborazioneAzione.equals(CostantiRegistroServizi.ONEWAY.getValue())) {
  1853.                         isProfiloOneWay = false;
  1854.                     }
  1855.                 }
  1856.                 else{
  1857.                     if (!profiloCollaborazioneAccordo.equals(CostantiRegistroServizi.ONEWAY.getValue())) {
  1858.                         isProfiloOneWay = false;
  1859.                     }  
  1860.                 }
  1861.             } else {
  1862.                 // non ho azione (o azione con profilo non ridefinito)
  1863.                 // allora considero il profilo dell'accordo
  1864.                 if (!profiloCollaborazioneAccordo.equals(CostantiRegistroServizi.ONEWAY.getValue())) {
  1865.                     isProfiloOneWay = false;
  1866.                 }
  1867.             }
  1868.            
  1869.             if(!isProfiloOneWay)
  1870.                 return false;
  1871.         }
  1872.        
  1873.        
  1874.         return true;
  1875.     }
  1876. }