CachedRegistryReader.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */

  20. package org.openspcoop2.protocol.registry;

  21. import java.util.List;

  22. import org.openspcoop2.core.id.IDAccordo;
  23. import org.openspcoop2.core.id.IDAccordoAzione;
  24. import org.openspcoop2.core.id.IDAccordoCooperazione;
  25. import org.openspcoop2.core.id.IDFruizione;
  26. import org.openspcoop2.core.id.IDGruppo;
  27. import org.openspcoop2.core.id.IDPortType;
  28. import org.openspcoop2.core.id.IDPortTypeAzione;
  29. import org.openspcoop2.core.id.IDResource;
  30. import org.openspcoop2.core.id.IDRuolo;
  31. import org.openspcoop2.core.id.IDScope;
  32. import org.openspcoop2.core.id.IDServizio;
  33. import org.openspcoop2.core.id.IDSoggetto;
  34. import org.openspcoop2.core.registry.AccordoCooperazione;
  35. import org.openspcoop2.core.registry.AccordoServizioParteComune;
  36. import org.openspcoop2.core.registry.AccordoServizioParteSpecifica;
  37. import org.openspcoop2.core.registry.Azione;
  38. import org.openspcoop2.core.registry.Operation;
  39. import org.openspcoop2.core.registry.PortType;
  40. import org.openspcoop2.core.registry.PortaDominio;
  41. import org.openspcoop2.core.registry.Resource;
  42. import org.openspcoop2.core.registry.Soggetto;
  43. import org.openspcoop2.core.registry.constants.PddTipologia;
  44. import org.openspcoop2.core.registry.driver.DriverRegistroServiziNotFound;
  45. import org.openspcoop2.core.registry.driver.FiltroRicerca;
  46. import org.openspcoop2.core.registry.driver.FiltroRicercaProtocolPropertyRegistry;
  47. import org.openspcoop2.core.registry.driver.IDAccordoFactory;
  48. import org.openspcoop2.protocol.sdk.IProtocolFactory;
  49. import org.openspcoop2.protocol.sdk.constants.InformationApiSource;
  50. import org.openspcoop2.protocol.sdk.registry.ProtocolFiltroRicercaAccordi;
  51. import org.openspcoop2.protocol.sdk.registry.ProtocolFiltroRicercaAccordoAzioni;
  52. import org.openspcoop2.protocol.sdk.registry.ProtocolFiltroRicercaFruizioniServizio;
  53. import org.openspcoop2.protocol.sdk.registry.ProtocolFiltroRicercaGruppi;
  54. import org.openspcoop2.protocol.sdk.registry.ProtocolFiltroRicercaPortType;
  55. import org.openspcoop2.protocol.sdk.registry.ProtocolFiltroRicercaPortTypeAzioni;
  56. import org.openspcoop2.protocol.sdk.registry.ProtocolFiltroRicercaRisorse;
  57. import org.openspcoop2.protocol.sdk.registry.ProtocolFiltroRicercaRuoli;
  58. import org.openspcoop2.protocol.sdk.registry.ProtocolFiltroRicercaScope;
  59. import org.openspcoop2.protocol.sdk.registry.ProtocolFiltroRicercaServizi;
  60. import org.openspcoop2.protocol.sdk.registry.ProtocolFiltroRicercaSoggetti;
  61. import org.openspcoop2.protocol.sdk.registry.IRegistryReader;
  62. import org.openspcoop2.protocol.sdk.registry.RegistryException;
  63. import org.openspcoop2.protocol.sdk.registry.RegistryNotFound;
  64. import org.openspcoop2.protocol.sdk.state.IState;
  65. import org.openspcoop2.protocol.sdk.state.RequestInfo;
  66. import org.openspcoop2.protocol.utils.ProtocolUtils;
  67. import org.openspcoop2.utils.certificate.CertificateInfo;
  68. import org.openspcoop2.utils.crypt.CryptConfig;
  69. import org.slf4j.Logger;

  70. /**
  71.  *  ArchiveRegistryReader
  72.  *
  73.  * @author Poli Andrea (apoli@link.it)
  74.  * @author $Author$
  75.  * @version $Rev$, $Date$
  76.  */
  77. public class CachedRegistryReader implements IRegistryReader {

  78.     @SuppressWarnings("unused")
  79.     private Logger log;
  80.     private RegistroServiziManager registroServiziManager;
  81.     private IProtocolFactory<?> protocolFactory;
  82.     private RequestInfo requestInfo;
  83.     /*public CachedRegistryReader(Logger log,IProtocolFactory<?> protocolFactory) throws Exception{
  84.         this.log = log;
  85.         this.protocolFactory = protocolFactory;
  86.         this.registroServiziManager = RegistroServiziManager.getInstance();
  87.     }*/
  88.     public CachedRegistryReader(Logger log,IProtocolFactory<?> protocolFactory, IState state, RequestInfo requestInfo) throws Exception{
  89.         this.log = log;
  90.         this.protocolFactory = protocolFactory;
  91.         this.registroServiziManager = RegistroServiziManager.getInstance(state);
  92.         this.requestInfo = requestInfo;
  93.     }
  94.     public CachedRegistryReader(Logger log,IProtocolFactory<?> protocolFactory, RegistroServiziManager registroServiziManager, RequestInfo requestInfo) throws Exception{
  95.         this.log = log;
  96.         this.protocolFactory = protocolFactory;
  97.         this.registroServiziManager = registroServiziManager;
  98.         this.requestInfo = requestInfo;
  99.     }

  100.    
  101.     // PDD
  102.    
  103.     @Override
  104.     public boolean existsPortaDominio(String nome){
  105.         try{
  106.             FiltroRicerca filtroDriver = new FiltroRicerca();
  107.             filtroDriver.setNome(nome);
  108.             List<String> l = this.registroServiziManager.getAllIdPorteDominio(filtroDriver, null);
  109.             return l!=null && l.size()>0;
  110.         }catch(Exception e){
  111.             return false;
  112.         }
  113.     }
  114.    
  115.     @Override
  116.     public PortaDominio getPortaDominio(String nome) throws RegistryNotFound,RegistryException{
  117.         try{
  118.             return this.registroServiziManager.getPortaDominio(nome, null, this.requestInfo);
  119.         } catch (DriverRegistroServiziNotFound de) {
  120.             throw new RegistryNotFound(de.getMessage(),de);
  121.         }catch(Exception e){
  122.             throw new RegistryException(e.getMessage(),e);
  123.         }
  124.     }
  125.    
  126.     @Override
  127.     public List<String> findIdPorteDominio(Boolean operativo) throws RegistryNotFound,RegistryException{
  128.         try{
  129.             FiltroRicerca filtroDriver = new FiltroRicerca();
  130.             if(operativo!=null){
  131.                 if(operativo){
  132.                     filtroDriver.setTipo(PddTipologia.OPERATIVO.toString());
  133.                 }
  134.                 else{
  135.                     filtroDriver.setTipo(PddTipologia.ESTERNO.toString());
  136.                 }
  137.             }
  138.             return this.registroServiziManager.getAllIdPorteDominio(filtroDriver, null);
  139.         } catch (DriverRegistroServiziNotFound de) {
  140.             throw new RegistryNotFound(de.getMessage(),de);
  141.         }catch(Exception e){
  142.             throw new RegistryException(e.getMessage(),e);
  143.         }
  144.     }
  145.    
  146.    
  147.    
  148.     // SOGGETTI
  149.    
  150.     @Override
  151.     public boolean existsSoggettoByCodiceIPA(String codiceIPA) {
  152.         throw new RuntimeException("Not Implemented");
  153.     }

  154.     @Override
  155.     public boolean existsSoggetto(IDSoggetto idSoggetto) {
  156.         try{
  157.             org.openspcoop2.core.registry.driver.FiltroRicercaSoggetti filtroDriver = new org.openspcoop2.core.registry.driver.FiltroRicercaSoggetti();
  158.             filtroDriver.setTipo(idSoggetto.getTipo());
  159.             filtroDriver.setNome(idSoggetto.getNome());
  160.             List<IDSoggetto> l = this.registroServiziManager.getAllIdSoggetti(filtroDriver,null);
  161.             return l!=null && l.size()>0;
  162.         }catch(Exception e){
  163.             return false;
  164.         }
  165.     }

  166.     @Override
  167.     public IDSoggetto getIdSoggettoByCodiceIPA(String codiceIPA)
  168.             throws RegistryNotFound,RegistryException {
  169.         throw new RuntimeException("Not Implemented");
  170.     }

  171.     @Override
  172.     public String getCodiceIPA(IDSoggetto idSoggetto) throws RegistryNotFound,RegistryException {
  173.         throw new RuntimeException("Not Implemented");
  174.     }
  175.    
  176.     @Override
  177.     public IDSoggetto getIdSoggettoDefault(String tipoSoggettoDefault) throws RegistryNotFound,RegistryException{
  178.         throw new RuntimeException("Not Implemented");
  179.     }

  180.     @Override
  181.     public String getDominio(IDSoggetto idSoggetto) throws RegistryNotFound,RegistryException{
  182.         try{
  183.             return this.registroServiziManager.getDominio(idSoggetto, null, this.protocolFactory, this.requestInfo);
  184.         } catch (DriverRegistroServiziNotFound de) {
  185.             throw new RegistryNotFound(de.getMessage(),de);
  186.         }catch(Exception e){
  187.             throw new RegistryException(e.getMessage(),e);
  188.         }
  189.     }
  190.    
  191.     @Override
  192.     public Soggetto getSoggetto(IDSoggetto idSoggetto) throws RegistryNotFound,RegistryException {
  193.         try{
  194.             return this.registroServiziManager.getSoggetto(idSoggetto, null, this.requestInfo);
  195.         } catch (DriverRegistroServiziNotFound de) {
  196.             throw new RegistryNotFound(de.getMessage(),de);
  197.         }catch(Exception e){
  198.             throw new RegistryException(e.getMessage(),e);
  199.         }
  200.     }
  201.    
  202.     @Override
  203.     public boolean existsSoggettoByCredenzialiBasic(String username, String password, CryptConfig cryptConfig){
  204.         try{
  205.             return this.registroServiziManager.getIdSoggettoByCredenzialiBasic(username, password, cryptConfig, null)!=null;
  206.         }catch(Exception e){
  207.             return false;
  208.         }
  209.     }
  210.    
  211.     @Override
  212.     public Soggetto getSoggettoByCredenzialiBasic(String username, String password, CryptConfig cryptConfig) throws RegistryNotFound,RegistryException{
  213.         try{
  214.             return this.registroServiziManager.getSoggettoByCredenzialiBasic(username, password, cryptConfig, null);
  215.         } catch (DriverRegistroServiziNotFound de) {
  216.             throw new RegistryNotFound(de.getMessage(),de);
  217.         }catch(Exception e){
  218.             throw new RegistryException(e.getMessage(),e);
  219.         }
  220.     }
  221.    
  222.     @Override
  223.     public boolean existsSoggettoByCredenzialiSsl(String subject, String issuer){
  224.         try{
  225.             return this.registroServiziManager.getIdSoggettoByCredenzialiSsl(subject, issuer, null)!=null;
  226.         }catch(Exception e){
  227.             return false;
  228.         }  
  229.     }
  230.    
  231.     @Override
  232.     public Soggetto getSoggettoByCredenzialiSsl(String subject, String issuer) throws RegistryNotFound,RegistryException{
  233.         try{
  234.             return this.registroServiziManager.getSoggettoByCredenzialiSsl(subject, issuer, null);
  235.         } catch (DriverRegistroServiziNotFound de) {
  236.             throw new RegistryNotFound(de.getMessage(),de);
  237.         }catch(Exception e){
  238.             throw new RegistryException(e.getMessage(),e);
  239.         }
  240.     }
  241.    
  242.     @Override
  243.     public boolean existsSoggettoByCredenzialiSsl(CertificateInfo certificate, boolean strictVerifier){
  244.         try{
  245.             return this.registroServiziManager.getIdSoggettoByCredenzialiSsl(certificate, strictVerifier, null)!=null;
  246.         }catch(Exception e){
  247.             return false;
  248.         }  
  249.     }
  250.    
  251.     @Override
  252.     public Soggetto getSoggettoByCredenzialiSsl(CertificateInfo certificate, boolean strictVerifier) throws RegistryNotFound,RegistryException{
  253.         try{
  254.             return this.registroServiziManager.getSoggettoByCredenzialiSsl(certificate, strictVerifier, null);
  255.         } catch (DriverRegistroServiziNotFound de) {
  256.             throw new RegistryNotFound(de.getMessage(),de);
  257.         }catch(Exception e){
  258.             throw new RegistryException(e.getMessage(),e);
  259.         }
  260.     }
  261.    
  262.     @Override
  263.     public boolean existsSoggettoByCredenzialiPrincipal(String principal){
  264.         try{
  265.             return this.registroServiziManager.getIdSoggettoByCredenzialiPrincipal(principal, null)!=null;
  266.         }catch(Exception e){
  267.             return false;
  268.         }  
  269.     }
  270.    
  271.     @Override
  272.     public Soggetto getSoggettoByCredenzialiPrincipal(String principal) throws RegistryNotFound,RegistryException{
  273.         try{
  274.             return this.registroServiziManager.getSoggettoByCredenzialiPrincipal(principal, null);
  275.         } catch (DriverRegistroServiziNotFound de) {
  276.             throw new RegistryNotFound(de.getMessage(),de);
  277.         }catch(Exception e){
  278.             throw new RegistryException(e.getMessage(),e);
  279.         }
  280.     }
  281.    
  282.     @Override
  283.     public List<IDSoggetto> findIdSoggetti(ProtocolFiltroRicercaSoggetti filtro) throws RegistryNotFound,RegistryException{
  284.         try{
  285.             org.openspcoop2.core.registry.driver.FiltroRicercaSoggetti filtroDriver = new org.openspcoop2.core.registry.driver.FiltroRicercaSoggetti();
  286.             if(filtro.getTipo()!=null){
  287.                 filtroDriver.setTipo(filtro.getTipo());
  288.             }
  289.             if(filtro.getNome()!=null){
  290.                 filtroDriver.setNome(filtro.getNome());
  291.             }
  292.             if(filtro.getNomePdd()!=null){
  293.                 filtroDriver.setNomePdd(filtro.getNomePdd());
  294.             }
  295.             List<FiltroRicercaProtocolPropertyRegistry> listPP = ProtocolUtils.convert(filtro.getProtocolProperties());
  296.             if(listPP!=null && listPP.size()>0){
  297.                 filtroDriver.setProtocolProperties(listPP);
  298.             }
  299.             if(filtro.getProprieta()!=null && !filtro.getProprieta().isEmpty()) {
  300.                 filtroDriver.setProprieta(filtro.getProprieta());
  301.             }
  302.             return this.registroServiziManager.getAllIdSoggetti(filtroDriver,null);
  303.         } catch (DriverRegistroServiziNotFound de) {
  304.             throw new RegistryNotFound(de.getMessage(),de);
  305.         }catch(Exception e){
  306.             throw new RegistryException(e.getMessage(),e);
  307.         }
  308.     }
  309.    
  310.     @Override
  311.     public boolean inUso(IDSoggetto idSoggetto, boolean verificaRuoli) throws RegistryException{
  312.         throw new RuntimeException("Not Implemented");
  313.     }
  314.    
  315.     @Override
  316.     public String getDettagliInUso(IDSoggetto idSoggetto, boolean verificaRuoli) throws RegistryException {
  317.         throw new RuntimeException("Not Implemented");
  318.     }
  319.    
  320.    
  321.    
  322.     // ACCORDI PARTE COMUNE
  323.    
  324.     @Override
  325.     public AccordoServizioParteComune getAccordoServizioParteComune(
  326.             IDAccordo idAccordo) throws RegistryNotFound,RegistryException {
  327.         try{
  328.             return this.registroServiziManager.getAccordoServizioParteComune(idAccordo, null, false, false, this.requestInfo);
  329.         } catch (DriverRegistroServiziNotFound de) {
  330.             throw new RegistryNotFound(de.getMessage(),de);
  331.         }catch(Exception e){
  332.             throw new RegistryException(e.getMessage(),e);
  333.         }
  334.     }

  335.     @Override
  336.     public AccordoServizioParteComune getAccordoServizioParteComune(
  337.             IDAccordo idAccordo, boolean readAllegati,boolean readDatiRegistro) throws RegistryNotFound,RegistryException {
  338.         try{
  339.             return this.registroServiziManager.getAccordoServizioParteComune(idAccordo, null, readAllegati, readDatiRegistro, this.requestInfo);
  340.         } catch (DriverRegistroServiziNotFound de) {
  341.             throw new RegistryNotFound(de.getMessage(),de);
  342.         }catch(Exception e){
  343.             throw new RegistryException(e.getMessage(),e);
  344.         }
  345.     }
  346.    
  347.     @Override
  348.     public List<IDAccordo> findIdAccordiServizioParteComune(ProtocolFiltroRicercaAccordi filtro) throws RegistryNotFound,RegistryException{
  349.         try{
  350.             org.openspcoop2.core.registry.driver.FiltroRicercaAccordi filtroDriver = new org.openspcoop2.core.registry.driver.FiltroRicercaAccordi();
  351.             if(filtro.getNome()!=null){
  352.                 filtroDriver.setNomeAccordo(filtro.getNome());
  353.             }
  354.             if(filtro.getVersione()!=null){
  355.                 filtroDriver.setVersione(filtro.getVersione());
  356.             }
  357.             if(filtro.getSoggetto()!=null){
  358.                 if(filtro.getSoggetto().getTipo()!=null){
  359.                     filtroDriver.setTipoSoggettoReferente(filtro.getSoggetto().getTipo());
  360.                 }
  361.                 if(filtro.getSoggetto().getNome()!=null){
  362.                     filtroDriver.setNomeSoggettoReferente(filtro.getSoggetto().getNome());
  363.                 }
  364.             }
  365.             if(filtro.getServiceBinding()!=null) {
  366.                 filtroDriver.setServiceBinding(filtro.getServiceBinding());
  367.             }
  368.             if(filtro.getIdGruppo()!=null) {
  369.                 filtroDriver.setIdGruppo(filtro.getIdGruppo());
  370.             }
  371.             List<FiltroRicercaProtocolPropertyRegistry> listPP = ProtocolUtils.convert(filtro.getProtocolProperties());
  372.             if(listPP!=null && listPP.size()>0){
  373.                 filtroDriver.setProtocolPropertiesAccordo(listPP);
  374.             }  
  375.             if(filtro.getEscludiServiziComposti()!=null){
  376.                 filtroDriver.setServizioComposto(!filtro.getEscludiServiziComposti());
  377.             }
  378.             if(filtro.getEscludiServiziNonComposti()!=null){
  379.                 filtroDriver.setServizioComposto(filtro.getEscludiServiziNonComposti());
  380.             }

  381.             return this.registroServiziManager.getAllIdAccordiServizioParteComune(filtroDriver, null);
  382.         } catch (DriverRegistroServiziNotFound de) {
  383.             throw new RegistryNotFound(de.getMessage(),de);
  384.         }catch(Exception e){
  385.             throw new RegistryException(e.getMessage(),e);
  386.         }
  387.     }
  388.    
  389.     @Override
  390.     public org.openspcoop2.core.registry.wsdl.AccordoServizioWrapper getAccordoServizioParteComuneSoap(IDServizio idService,InformationApiSource infoWsdlSource,boolean buildSchema, boolean readDatiRegistro) throws RegistryNotFound,RegistryException{
  391.         try{
  392.             return this.registroServiziManager.getWsdlAccordoServizio(idService, infoWsdlSource, buildSchema, readDatiRegistro, this.requestInfo);
  393.         } catch (DriverRegistroServiziNotFound de) {
  394.             throw new RegistryNotFound(de.getMessage(),de);
  395.         }catch(Exception e){
  396.             throw new RegistryException(e.getMessage(),e);
  397.         }
  398.     }
  399.    
  400.     @Override
  401.     public org.openspcoop2.core.registry.rest.AccordoServizioWrapper getAccordoServizioParteComuneRest(IDServizio idService,InformationApiSource infoWsdlSource,boolean buildSchema, boolean processIncludeForOpenApi, boolean readDatiRegistro) throws RegistryNotFound,RegistryException{
  402.         try{
  403.             return this.registroServiziManager.getRestAccordoServizio(idService, infoWsdlSource, buildSchema, processIncludeForOpenApi, readDatiRegistro, this.requestInfo);
  404.         } catch (DriverRegistroServiziNotFound de) {
  405.             throw new RegistryNotFound(de.getMessage(),de);
  406.         }catch(Exception e){
  407.             throw new RegistryException(e.getMessage(),e);
  408.         }
  409.     }
  410.    
  411.     @Override
  412.     public boolean inUso(IDAccordo idAccordo) throws RegistryException{
  413.         throw new RuntimeException("Not Implemented");
  414.     }
  415.    
  416.     @Override
  417.     public String getDettagliInUso(IDAccordo idAccordo) throws RegistryException{
  418.         throw new RuntimeException("Not Implemented");
  419.     }
  420.    
  421.    
  422.    
  423.    
  424.     // ELEMENTI INTERNI ALL'ACCORDO PARTE COMUNE
  425.    
  426.     @Override
  427.     public PortType getPortType(IDPortType id) throws RegistryNotFound,RegistryException{
  428.         try{
  429.             AccordoServizioParteComune as = this.registroServiziManager.getAccordoServizioParteComune(id.getIdAccordo(), null, false, false, this.requestInfo);
  430.             for (PortType pt : as.getPortTypeList()) {
  431.                 if(pt.getNome().equals(id.getNome())){
  432.                     return pt;
  433.                 }
  434.             }
  435.             throw new DriverRegistroServiziNotFound("PortType ["+id.getNome()+"] non trovato nell'accordo ["+IDAccordoFactory.getInstance().getUriFromIDAccordo(id.getIdAccordo())+"]");
  436.         } catch (DriverRegistroServiziNotFound de) {
  437.             throw new RegistryNotFound(de.getMessage(),de);
  438.         }catch(Exception e){
  439.             throw new RegistryException(e.getMessage(),e);
  440.         }
  441.     }
  442.    
  443.     @Override
  444.     public List<IDPortType> findIdPortType(ProtocolFiltroRicercaPortType filtro) throws RegistryNotFound,RegistryException{
  445.         try{
  446.             org.openspcoop2.core.registry.driver.FiltroRicercaPortTypes filtroDriver = new org.openspcoop2.core.registry.driver.FiltroRicercaPortTypes();
  447.            
  448.             // portType
  449.             if(filtro.getNomePortType()!=null){
  450.                 filtroDriver.setNomePortType(filtro.getNomePortType());
  451.             }
  452.             List<FiltroRicercaProtocolPropertyRegistry> listPP_portTypes = ProtocolUtils.convert(filtro.getProtocolPropertiesPortType());
  453.             if(listPP_portTypes!=null && listPP_portTypes.size()>0){
  454.                 filtroDriver.setProtocolPropertiesPortType(listPP_portTypes);
  455.             }  
  456.            
  457.             // accordo
  458.             if(filtro.getNome()!=null){
  459.                 filtroDriver.setNomeAccordo(filtro.getNome());
  460.             }
  461.             if(filtro.getVersione()!=null){
  462.                 filtroDriver.setVersione(filtro.getVersione());
  463.             }
  464.             if(filtro.getSoggetto()!=null){
  465.                 if(filtro.getSoggetto().getTipo()!=null){
  466.                     filtroDriver.setTipoSoggettoReferente(filtro.getSoggetto().getTipo());
  467.                 }
  468.                 if(filtro.getSoggetto().getNome()!=null){
  469.                     filtroDriver.setNomeSoggettoReferente(filtro.getSoggetto().getNome());
  470.                 }
  471.             }
  472.             if(filtro.getServiceBinding()!=null) {
  473.                 filtroDriver.setServiceBinding(filtro.getServiceBinding());
  474.             }
  475.             if(filtro.getIdGruppo()!=null) {
  476.                 filtroDriver.setIdGruppo(filtro.getIdGruppo());
  477.             }
  478.             List<FiltroRicercaProtocolPropertyRegistry> listPP = ProtocolUtils.convert(filtro.getProtocolProperties());
  479.             if(listPP!=null && listPP.size()>0){
  480.                 filtroDriver.setProtocolPropertiesAccordo(listPP);
  481.             }  
  482.             if(filtro.getEscludiServiziComposti()!=null){
  483.                 filtroDriver.setServizioComposto(!filtro.getEscludiServiziComposti());
  484.             }
  485.             if(filtro.getEscludiServiziNonComposti()!=null){
  486.                 filtroDriver.setServizioComposto(filtro.getEscludiServiziNonComposti());
  487.             }

  488.             return this.registroServiziManager.getAllIdPortType(filtroDriver, null);
  489.         } catch (DriverRegistroServiziNotFound de) {
  490.             throw new RegistryNotFound(de.getMessage(),de);
  491.         }catch(Exception e){
  492.             throw new RegistryException(e.getMessage(),e);
  493.         }
  494.     }
  495.    
  496.     @Override
  497.     public boolean inUso(IDPortType id) throws RegistryException{
  498.         throw new RuntimeException("Not Implemented");
  499.     }
  500.    
  501.     @Override
  502.     public String getDettagliInUso(IDPortType id) throws RegistryException{
  503.         throw new RuntimeException("Not Implemented");
  504.     }
  505.        
  506.     @Override
  507.     public Operation getAzionePortType(IDPortTypeAzione id) throws RegistryNotFound,RegistryException{
  508.         PortType portType = this.getPortType(id.getIdPortType());
  509.         for (Operation opCheck : portType.getAzioneList()) {
  510.             if(opCheck.getNome().equals(id.getNome())){
  511.                 return opCheck;
  512.             }
  513.         }

  514.         String uriAccordo = null;
  515.         try{
  516.             uriAccordo = IDAccordoFactory.getInstance().getUriFromIDAccordo(id.getIdPortType().getIdAccordo());
  517.         }catch(Exception e){
  518.             uriAccordo = id.getIdPortType().getIdAccordo().toString();
  519.         }
  520.         throw new RegistryNotFound("Azione ["+id.getNome()+"] non trovata all'interno del PortType ["+id.getIdPortType().getNome()+
  521.                     "] dell'accordo ["+uriAccordo+"]");
  522.     }
  523.    
  524.     @Override
  525.     public List<IDPortTypeAzione> findIdAzionePortType(ProtocolFiltroRicercaPortTypeAzioni filtro) throws RegistryNotFound,RegistryException{
  526.         try{
  527.             org.openspcoop2.core.registry.driver.FiltroRicercaOperations filtroDriver = new org.openspcoop2.core.registry.driver.FiltroRicercaOperations();
  528.            
  529.             // operation
  530.             if(filtro.getNomeAzione()!=null){
  531.                 filtroDriver.setNomeAzione(filtro.getNomeAzione());
  532.             }
  533.             List<FiltroRicercaProtocolPropertyRegistry> listPP_azioni = ProtocolUtils.convert(filtro.getProtocolPropertiesAzione());
  534.             if(listPP_azioni!=null && listPP_azioni.size()>0){
  535.                 filtroDriver.setProtocolPropertiesAzione(listPP_azioni);
  536.             }  
  537.            
  538.             // portType
  539.             if(filtro.getNomePortType()!=null){
  540.                 filtroDriver.setNomePortType(filtro.getNomePortType());
  541.             }
  542.             List<FiltroRicercaProtocolPropertyRegistry> listPP_portTypes = ProtocolUtils.convert(filtro.getProtocolPropertiesPortType());
  543.             if(listPP_portTypes!=null && listPP_portTypes.size()>0){
  544.                 filtroDriver.setProtocolPropertiesPortType(listPP_portTypes);
  545.             }  
  546.            
  547.             // accordo
  548.             if(filtro.getNome()!=null){
  549.                 filtroDriver.setNomeAccordo(filtro.getNome());
  550.             }
  551.             if(filtro.getVersione()!=null){
  552.                 filtroDriver.setVersione(filtro.getVersione());
  553.             }
  554.             if(filtro.getSoggetto()!=null){
  555.                 if(filtro.getSoggetto().getTipo()!=null){
  556.                     filtroDriver.setTipoSoggettoReferente(filtro.getSoggetto().getTipo());
  557.                 }
  558.                 if(filtro.getSoggetto().getNome()!=null){
  559.                     filtroDriver.setNomeSoggettoReferente(filtro.getSoggetto().getNome());
  560.                 }
  561.             }
  562.             if(filtro.getServiceBinding()!=null) {
  563.                 filtroDriver.setServiceBinding(filtro.getServiceBinding());
  564.             }
  565.             if(filtro.getIdGruppo()!=null) {
  566.                 filtroDriver.setIdGruppo(filtro.getIdGruppo());
  567.             }
  568.             List<FiltroRicercaProtocolPropertyRegistry> listPP = ProtocolUtils.convert(filtro.getProtocolProperties());
  569.             if(listPP!=null && listPP.size()>0){
  570.                 filtroDriver.setProtocolPropertiesAccordo(listPP);
  571.             }  
  572.             if(filtro.getEscludiServiziComposti()!=null){
  573.                 filtroDriver.setServizioComposto(!filtro.getEscludiServiziComposti());
  574.             }
  575.             if(filtro.getEscludiServiziNonComposti()!=null){
  576.                 filtroDriver.setServizioComposto(filtro.getEscludiServiziNonComposti());
  577.             }

  578.             return this.registroServiziManager.getAllIdAzionePortType(filtroDriver, null);
  579.         } catch (DriverRegistroServiziNotFound de) {
  580.             throw new RegistryNotFound(de.getMessage(),de);
  581.         }catch(Exception e){
  582.             throw new RegistryException(e.getMessage(),e);
  583.         }
  584.     }
  585.    
  586.     @Override
  587.     public boolean inUso(IDPortTypeAzione id) throws RegistryException{
  588.         throw new RuntimeException("Not Implemented");
  589.     }
  590.     @Override
  591.     public String getDettagliInUso(IDPortTypeAzione id) throws RegistryException{
  592.         throw new RuntimeException("Not Implemented");
  593.     }
  594.    
  595.     @Override
  596.     public Azione getAzioneAccordo(IDAccordoAzione id) throws RegistryNotFound,RegistryException{
  597.         AccordoServizioParteComune as = this.getAccordoServizioParteComune(id.getIdAccordo());
  598.         for (Azione azCheck : as.getAzioneList()) {
  599.             if(azCheck.getNome().equals(id.getNome())){
  600.                 return azCheck;
  601.             }
  602.         }

  603.         String uriAccordo = null;
  604.         try{
  605.             uriAccordo = IDAccordoFactory.getInstance().getUriFromIDAccordo(id.getIdAccordo());
  606.         }catch(Exception e){
  607.             uriAccordo = id.getIdAccordo().toString();
  608.         }
  609.         throw new RegistryNotFound("Azione ["+id.getNome()+"] non trovata all'interno dell'accordo ["+uriAccordo+"]");
  610.     }
  611.    
  612.     @Override
  613.     public List<IDAccordoAzione> findIdAzioneAccordo(ProtocolFiltroRicercaAccordoAzioni filtro) throws RegistryNotFound,RegistryException{
  614.         try{
  615.             org.openspcoop2.core.registry.driver.FiltroRicercaAzioni filtroDriver = new org.openspcoop2.core.registry.driver.FiltroRicercaAzioni();
  616.            
  617.             // azioni
  618.             if(filtro.getNomeAzione()!=null){
  619.                 filtroDriver.setNomeAzione(filtro.getNomeAzione());
  620.             }
  621.             List<FiltroRicercaProtocolPropertyRegistry> listPP_azioni = ProtocolUtils.convert(filtro.getProtocolPropertiesAzione());
  622.             if(listPP_azioni!=null && listPP_azioni.size()>0){
  623.                 filtroDriver.setProtocolPropertiesAzione(listPP_azioni);
  624.             }  
  625.            
  626.             // accordo
  627.             if(filtro.getNome()!=null){
  628.                 filtroDriver.setNomeAccordo(filtro.getNome());
  629.             }
  630.             if(filtro.getVersione()!=null){
  631.                 filtroDriver.setVersione(filtro.getVersione());
  632.             }
  633.             if(filtro.getSoggetto()!=null){
  634.                 if(filtro.getSoggetto().getTipo()!=null){
  635.                     filtroDriver.setTipoSoggettoReferente(filtro.getSoggetto().getTipo());
  636.                 }
  637.                 if(filtro.getSoggetto().getNome()!=null){
  638.                     filtroDriver.setNomeSoggettoReferente(filtro.getSoggetto().getNome());
  639.                 }
  640.             }
  641.             if(filtro.getServiceBinding()!=null) {
  642.                 filtroDriver.setServiceBinding(filtro.getServiceBinding());
  643.             }
  644.             if(filtro.getIdGruppo()!=null) {
  645.                 filtroDriver.setIdGruppo(filtro.getIdGruppo());
  646.             }
  647.             List<FiltroRicercaProtocolPropertyRegistry> listPP = ProtocolUtils.convert(filtro.getProtocolProperties());
  648.             if(listPP!=null && listPP.size()>0){
  649.                 filtroDriver.setProtocolPropertiesAccordo(listPP);
  650.             }  
  651.             if(filtro.getEscludiServiziComposti()!=null){
  652.                 filtroDriver.setServizioComposto(!filtro.getEscludiServiziComposti());
  653.             }
  654.             if(filtro.getEscludiServiziNonComposti()!=null){
  655.                 filtroDriver.setServizioComposto(filtro.getEscludiServiziNonComposti());
  656.             }

  657.             return this.registroServiziManager.getAllIdAzioneAccordo(filtroDriver, null);
  658.         } catch (DriverRegistroServiziNotFound de) {
  659.             throw new RegistryNotFound(de.getMessage(),de);
  660.         }catch(Exception e){
  661.             throw new RegistryException(e.getMessage(),e);
  662.         }
  663.     }
  664.    
  665.     @Override
  666.     public Resource getResourceAccordo(IDResource id) throws RegistryNotFound,RegistryException{
  667.         AccordoServizioParteComune as = this.getAccordoServizioParteComune(id.getIdAccordo());
  668.         for (Resource resourceCheck : as.getResourceList()) {
  669.             if(resourceCheck.getNome().equals(id.getNome())){
  670.                 return resourceCheck;
  671.             }
  672.         }

  673.         String uriAccordo = null;
  674.         try{
  675.             uriAccordo = IDAccordoFactory.getInstance().getUriFromIDAccordo(id.getIdAccordo());
  676.         }catch(Exception e){
  677.             uriAccordo = id.getIdAccordo().toString();
  678.         }
  679.         throw new RegistryNotFound("Risorsa ["+id.getNome()+"] non trovata all'interno dell'accordo ["+uriAccordo+"]");
  680.     }
  681.     @Override
  682.     public List<IDResource> findIdResourceAccordo(ProtocolFiltroRicercaRisorse filtro) throws RegistryNotFound,RegistryException{
  683.         try{
  684.             org.openspcoop2.core.registry.driver.FiltroRicercaResources filtroDriver = new org.openspcoop2.core.registry.driver.FiltroRicercaResources();
  685.            
  686.             // azioni
  687.             if(filtro.getNomeRisorsa()!=null){
  688.                 filtroDriver.setResourceName(filtro.getNomeRisorsa());
  689.             }
  690.             List<FiltroRicercaProtocolPropertyRegistry> listPP_resources = ProtocolUtils.convert(filtro.getProtocolPropertiesRisorsa());
  691.             if(listPP_resources!=null && listPP_resources.size()>0){
  692.                 filtroDriver.setProtocolPropertiesResources(listPP_resources);
  693.             }  
  694.            
  695.             // accordo
  696.             if(filtro.getNome()!=null){
  697.                 filtroDriver.setNomeAccordo(filtro.getNome());
  698.             }
  699.             if(filtro.getVersione()!=null){
  700.                 filtroDriver.setVersione(filtro.getVersione());
  701.             }
  702.             if(filtro.getSoggetto()!=null){
  703.                 if(filtro.getSoggetto().getTipo()!=null){
  704.                     filtroDriver.setTipoSoggettoReferente(filtro.getSoggetto().getTipo());
  705.                 }
  706.                 if(filtro.getSoggetto().getNome()!=null){
  707.                     filtroDriver.setNomeSoggettoReferente(filtro.getSoggetto().getNome());
  708.                 }
  709.             }
  710.             if(filtro.getServiceBinding()!=null) {
  711.                 filtroDriver.setServiceBinding(filtro.getServiceBinding());
  712.             }
  713.             if(filtro.getIdGruppo()!=null) {
  714.                 filtroDriver.setIdGruppo(filtro.getIdGruppo());
  715.             }
  716.             List<FiltroRicercaProtocolPropertyRegistry> listPP = ProtocolUtils.convert(filtro.getProtocolProperties());
  717.             if(listPP!=null && listPP.size()>0){
  718.                 filtroDriver.setProtocolPropertiesAccordo(listPP);
  719.             }  
  720.             if(filtro.getEscludiServiziComposti()!=null){
  721.                 filtroDriver.setServizioComposto(!filtro.getEscludiServiziComposti());
  722.             }
  723.             if(filtro.getEscludiServiziNonComposti()!=null){
  724.                 filtroDriver.setServizioComposto(filtro.getEscludiServiziNonComposti());
  725.             }

  726.             return this.registroServiziManager.getAllIdResource(filtroDriver, null);
  727.         } catch (DriverRegistroServiziNotFound de) {
  728.             throw new RegistryNotFound(de.getMessage(),de);
  729.         }catch(Exception e){
  730.             throw new RegistryException(e.getMessage(),e);
  731.         }
  732.     }
  733.    
  734.     @Override
  735.     public boolean inUso(IDResource id) throws RegistryException{
  736.         throw new RuntimeException("Not Implemented");
  737.     }
  738.     @Override
  739.     public String getDettagliInUso(IDResource id) throws RegistryException{
  740.         throw new RuntimeException("Not Implemented");
  741.     }
  742.    
  743.    
  744.     // ACCORDI PARTE SPECIFICA
  745.    
  746.     @Override
  747.     public AccordoServizioParteSpecifica getAccordoServizioParteSpecifica(
  748.             IDServizio idServizio) throws RegistryNotFound,RegistryException {
  749.         try{
  750.             return this.registroServiziManager.getAccordoServizioParteSpecifica(idServizio, null, false, this.requestInfo);
  751.         } catch (DriverRegistroServiziNotFound de) {
  752.             throw new RegistryNotFound(de.getMessage(),de);
  753.         }catch(Exception e){
  754.             throw new RegistryException(e.getMessage(),e);
  755.         }
  756.     }
  757.    

  758.     @Override
  759.     public AccordoServizioParteSpecifica getAccordoServizioParteSpecifica(
  760.             IDServizio idServizio, boolean readAllegati)
  761.             throws RegistryNotFound,RegistryException {
  762.         try{
  763.             return this.registroServiziManager.getAccordoServizioParteSpecifica(idServizio, null, readAllegati, this.requestInfo);
  764.         } catch (DriverRegistroServiziNotFound de) {
  765.             throw new RegistryNotFound(de.getMessage(),de);
  766.         }catch(Exception e){
  767.             throw new RegistryException(e.getMessage(),e);
  768.         }
  769.     }

  770.     @Override
  771.     public List<IDServizio> findIdAccordiServizioParteSpecifica(ProtocolFiltroRicercaServizi filtro) throws RegistryNotFound,RegistryException{
  772.         try{
  773.             org.openspcoop2.core.registry.driver.FiltroRicercaServizi filtroDriver = new org.openspcoop2.core.registry.driver.FiltroRicercaServizi();
  774.            
  775.             // servizio
  776.             if(filtro.getIdAccordoServizioParteComune()!=null){
  777.                 filtroDriver.setIdAccordoServizioParteComune(filtro.getIdAccordoServizioParteComune());
  778.             }
  779.             if(filtro.getTipoServizio()!=null){
  780.                 filtroDriver.setTipo(filtro.getTipoServizio());
  781.             }
  782.             if(filtro.getNomeServizio()!=null){
  783.                 filtroDriver.setNome(filtro.getNomeServizio());
  784.             }
  785.             if(filtro.getVersioneServizio()!=null){
  786.                 filtroDriver.setVersione(filtro.getVersioneServizio());
  787.             }
  788.             if(filtro.getSoggettoErogatore()!=null){
  789.                 if(filtro.getSoggettoErogatore().getTipo()!=null){
  790.                     filtroDriver.setTipoSoggettoErogatore(filtro.getSoggettoErogatore().getTipo());
  791.                 }
  792.                 if(filtro.getSoggettoErogatore().getNome()!=null){
  793.                     filtroDriver.setNomeSoggettoErogatore(filtro.getSoggettoErogatore().getNome());
  794.                 }
  795.             }
  796.             if(filtro.getPortType()!=null){
  797.                 filtroDriver.setPortType(filtro.getPortType());
  798.             }
  799.             List<FiltroRicercaProtocolPropertyRegistry> listPP = ProtocolUtils.convert(filtro.getProtocolPropertiesServizi());
  800.             if(listPP!=null && listPP.size()>0){
  801.                 filtroDriver.setProtocolProperties(listPP);
  802.             }

  803.             return this.registroServiziManager.getAllIdServizi(filtroDriver, null);
  804.         } catch (DriverRegistroServiziNotFound de) {
  805.             throw new RegistryNotFound(de.getMessage(),de);
  806.         }catch(Exception e){
  807.             throw new RegistryException(e.getMessage(),e);
  808.         }
  809.     }


  810.    
  811.    
  812.     // ELEMENTI INTERNI ALL'ACCORDO PARTE SPECIFICA
  813.    
  814.     @Override
  815.     public List<IDFruizione> findIdFruizioni(ProtocolFiltroRicercaFruizioniServizio filtro) throws RegistryNotFound,RegistryException{
  816.        
  817.         try{
  818.             org.openspcoop2.core.registry.driver.FiltroRicercaFruizioniServizio filtroDriver = new org.openspcoop2.core.registry.driver.FiltroRicercaFruizioniServizio();
  819.            
  820.             if(filtro.getSoggettoFruitore()!=null){
  821.                 if(filtro.getSoggettoFruitore().getTipo()!=null){
  822.                     filtroDriver.setTipoSoggettoFruitore(filtro.getSoggettoFruitore().getTipo());
  823.                 }
  824.                 if(filtro.getSoggettoFruitore().getNome()!=null){
  825.                     filtroDriver.setNomeSoggettoFruitore(filtro.getSoggettoFruitore().getNome());
  826.                 }
  827.             }
  828.             List<FiltroRicercaProtocolPropertyRegistry> listPP_fruitore = ProtocolUtils.convert(filtro.getProtocolPropertiesFruizione());
  829.             if(listPP_fruitore!=null && listPP_fruitore.size()>0){
  830.                 filtroDriver.setProtocolPropertiesFruizione(listPP_fruitore);
  831.             }
  832.            
  833.             // servizio
  834.             if(filtro.getIdAccordoServizioParteComune()!=null){
  835.                 filtroDriver.setIdAccordoServizioParteComune(filtro.getIdAccordoServizioParteComune());
  836.             }
  837.             if(filtro.getTipoServizio()!=null){
  838.                 filtroDriver.setTipo(filtro.getTipoServizio());
  839.             }
  840.             if(filtro.getNomeServizio()!=null){
  841.                 filtroDriver.setNome(filtro.getNomeServizio());
  842.             }
  843.             if(filtro.getVersioneServizio()!=null){
  844.                 filtroDriver.setVersione(filtro.getVersioneServizio());
  845.             }
  846.             if(filtro.getSoggettoErogatore()!=null){
  847.                 if(filtro.getSoggettoErogatore().getTipo()!=null){
  848.                     filtroDriver.setTipoSoggettoErogatore(filtro.getSoggettoErogatore().getTipo());
  849.                 }
  850.                 if(filtro.getSoggettoErogatore().getNome()!=null){
  851.                     filtroDriver.setNomeSoggettoErogatore(filtro.getSoggettoErogatore().getNome());
  852.                 }
  853.             }
  854.             if(filtro.getPortType()!=null){
  855.                 filtroDriver.setPortType(filtro.getPortType());
  856.             }
  857.             List<FiltroRicercaProtocolPropertyRegistry> listPP = ProtocolUtils.convert(filtro.getProtocolPropertiesServizi());
  858.             if(listPP!=null && listPP.size()>0){
  859.                 filtroDriver.setProtocolProperties(listPP);
  860.             }

  861.             return this.registroServiziManager.getAllIdFruizioniServizio(filtroDriver, null);
  862.         } catch (DriverRegistroServiziNotFound de) {
  863.             throw new RegistryNotFound(de.getMessage(),de);
  864.         }catch(Exception e){
  865.             throw new RegistryException(e.getMessage(),e);
  866.         }
  867.        
  868.     }
  869.    
  870.    
  871.    
  872.     // ACCORDI COOPERAZIONE
  873.    
  874.     @Override
  875.     public AccordoCooperazione getAccordoCooperazione(
  876.             IDAccordoCooperazione idAccordo) throws RegistryNotFound,RegistryException {
  877.         try{
  878.             return this.registroServiziManager.getAccordoCooperazione(idAccordo, null, false);
  879.         } catch (DriverRegistroServiziNotFound de) {
  880.             throw new RegistryNotFound(de.getMessage(),de);
  881.         }catch(Exception e){
  882.             throw new RegistryException(e.getMessage(),e);
  883.         }
  884.     }

  885.     @Override
  886.     public AccordoCooperazione getAccordoCooperazione(
  887.             IDAccordoCooperazione idAccordo, boolean readAllegati)
  888.             throws RegistryNotFound,RegistryException {
  889.         try{
  890.             return this.registroServiziManager.getAccordoCooperazione(idAccordo, null, readAllegati);
  891.         } catch (DriverRegistroServiziNotFound de) {
  892.             throw new RegistryNotFound(de.getMessage(),de);
  893.         }catch(Exception e){
  894.             throw new RegistryException(e.getMessage(),e);
  895.         }
  896.     }
  897.    
  898.     @Override
  899.     public List<IDAccordoCooperazione> findIdAccordiCooperazione(ProtocolFiltroRicercaAccordi filtro) throws RegistryNotFound,RegistryException{
  900.         try{
  901.             org.openspcoop2.core.registry.driver.FiltroRicercaAccordi filtroDriver = new org.openspcoop2.core.registry.driver.FiltroRicercaAccordi();
  902.             if(filtro.getNome()!=null){
  903.                 filtroDriver.setNomeAccordo(filtro.getNome());
  904.             }
  905.             if(filtro.getVersione()!=null){
  906.                 filtroDriver.setVersione(filtro.getVersione());
  907.             }
  908.             if(filtro.getSoggetto()!=null){
  909.                 if(filtro.getSoggetto().getTipo()!=null){
  910.                     filtroDriver.setTipoSoggettoReferente(filtro.getSoggetto().getTipo());
  911.                 }
  912.                 if(filtro.getSoggetto().getNome()!=null){
  913.                     filtroDriver.setNomeSoggettoReferente(filtro.getSoggetto().getNome());
  914.                 }
  915.             }
  916.             if(filtro.getServiceBinding()!=null) {
  917.                 filtroDriver.setServiceBinding(filtro.getServiceBinding());
  918.             }
  919.             if(filtro.getIdGruppo()!=null) {
  920.                 filtroDriver.setIdGruppo(filtro.getIdGruppo());
  921.             }
  922.             List<FiltroRicercaProtocolPropertyRegistry> listPP = ProtocolUtils.convert(filtro.getProtocolProperties());
  923.             if(listPP!=null && !listPP.isEmpty()){
  924.                 filtroDriver.setProtocolPropertiesAccordo(listPP);
  925.             }  
  926.             if(filtro.getEscludiServiziComposti()!=null){
  927.                 filtroDriver.setServizioComposto(!filtro.getEscludiServiziComposti());
  928.             }
  929.             if(filtro.getEscludiServiziNonComposti()!=null){
  930.                 filtroDriver.setServizioComposto(filtro.getEscludiServiziNonComposti());
  931.             }

  932.             return this.registroServiziManager.getAllIdAccordiCooperazione(filtroDriver, null);
  933.         } catch (DriverRegistroServiziNotFound de) {
  934.             throw new RegistryNotFound(de.getMessage(),de);
  935.         }catch(Exception e){
  936.             throw new RegistryException(e.getMessage(),e);
  937.         }
  938.     }

  939.    
  940.    

  941.    
  942.     // GRUPPI
  943.     @Override
  944.     public List<IDGruppo> findIdGruppi(ProtocolFiltroRicercaGruppi filtro) throws RegistryNotFound,RegistryException{
  945.         try{
  946.             org.openspcoop2.core.registry.driver.FiltroRicercaGruppi filtroDriver = new org.openspcoop2.core.registry.driver.FiltroRicercaGruppi();
  947.             if(filtro.getMinDate()!=null) {
  948.                 filtroDriver.setMinDate(filtro.getMinDate());
  949.             }
  950.             if(filtro.getMaxDate()!=null) {
  951.                 filtroDriver.setMaxDate(filtro.getMaxDate());
  952.             }
  953.             filtroDriver.setOrdinaDataRegistrazione(filtro.isOrdinaDataRegistrazione());
  954.             if(filtro.getNome()!=null){
  955.                 filtroDriver.setNome(filtro.getNome());
  956.             }
  957.             if(filtro.getTipo()!=null){
  958.                 filtroDriver.setTipo(filtro.getTipo());
  959.             }
  960.             if(filtro.getServiceBinding()!=null) {
  961.                 filtroDriver.setServiceBinding(filtro.getServiceBinding());
  962.             }
  963.             if(filtro.getProtocollo()!=null) {
  964.                 filtroDriver.setProtocollo(filtro.getProtocollo());
  965.             }
  966.             if(filtro.getProtocolli()!=null){
  967.                 filtroDriver.setProtocolli(filtro.getProtocolli());
  968.             }

  969.             return this.registroServiziManager.getAllIdGruppi(filtroDriver, null);
  970.         } catch (DriverRegistroServiziNotFound de) {
  971.             throw new RegistryNotFound(de.getMessage(),de);
  972.         }catch(Exception e){
  973.             throw new RegistryException(e.getMessage(),e);
  974.         }
  975.     }
  976.    
  977.    
  978.    
  979.    
  980.    
  981.     // RUOLI
  982.     @Override
  983.     public List<IDRuolo> findIdRuoli(ProtocolFiltroRicercaRuoli filtro) throws RegistryNotFound,RegistryException{
  984.         try{
  985.             org.openspcoop2.core.registry.driver.FiltroRicercaRuoli filtroDriver = new org.openspcoop2.core.registry.driver.FiltroRicercaRuoli();
  986.             if(filtro.getMinDate()!=null) {
  987.                 filtroDriver.setMinDate(filtro.getMinDate());
  988.             }
  989.             if(filtro.getMaxDate()!=null) {
  990.                 filtroDriver.setMaxDate(filtro.getMaxDate());
  991.             }
  992.             if(filtro.getNome()!=null){
  993.                 filtroDriver.setNome(filtro.getNome());
  994.             }
  995.             if(filtro.getTipo()!=null){
  996.                 filtroDriver.setTipo(filtro.getTipo());
  997.             }
  998.             if(filtro.getTipologia()!=null) {
  999.                 filtroDriver.setTipologia(filtro.getTipologia());
  1000.             }
  1001.             if(filtro.getContesto()!=null) {
  1002.                 filtroDriver.setContesto(filtro.getContesto());
  1003.             }

  1004.             return this.registroServiziManager.getAllIdRuoli(filtroDriver, null);
  1005.         } catch (DriverRegistroServiziNotFound de) {
  1006.             throw new RegistryNotFound(de.getMessage(),de);
  1007.         }catch(Exception e){
  1008.             throw new RegistryException(e.getMessage(),e);
  1009.         }
  1010.     }
  1011.    
  1012.    
  1013.    
  1014.    
  1015.    
  1016.     // SCOPE
  1017.     @Override
  1018.     public List<IDScope> findIdScope(ProtocolFiltroRicercaScope filtro) throws RegistryNotFound,RegistryException{
  1019.         try{
  1020.             org.openspcoop2.core.registry.driver.FiltroRicercaScope filtroDriver = new org.openspcoop2.core.registry.driver.FiltroRicercaScope();
  1021.             if(filtro.getMinDate()!=null) {
  1022.                 filtroDriver.setMinDate(filtro.getMinDate());
  1023.             }
  1024.             if(filtro.getMaxDate()!=null) {
  1025.                 filtroDriver.setMaxDate(filtro.getMaxDate());
  1026.             }
  1027.             if(filtro.getNome()!=null){
  1028.                 filtroDriver.setNome(filtro.getNome());
  1029.             }
  1030.             if(filtro.getTipo()!=null){
  1031.                 filtroDriver.setTipo(filtro.getTipo());
  1032.             }
  1033.             if(filtro.getTipologia()!=null) {
  1034.                 filtroDriver.setTipologia(filtro.getTipologia());
  1035.             }
  1036.             if(filtro.getContesto()!=null) {
  1037.                 filtroDriver.setContesto(filtro.getContesto());
  1038.             }

  1039.             return this.registroServiziManager.getAllIdScope(filtroDriver, null);
  1040.         } catch (DriverRegistroServiziNotFound de) {
  1041.             throw new RegistryNotFound(de.getMessage(),de);
  1042.         }catch(Exception e){
  1043.             throw new RegistryException(e.getMessage(),e);
  1044.         }
  1045.     }
  1046. }