FiltroRicercaFruizioniServizio.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.core.registry.driver;

  21. import java.io.Serializable;
  22. import java.util.ArrayList;
  23. import java.util.List;

  24. /**
  25.  * Permette il filtro di ricerca attraverso i driver che implementano l'interfaccia 'get'
  26.  *
  27.  * @author Poli Andrea (apoli@link.it)
  28.  * @author Nardi Lorenzo (nardi@link.it)
  29.  * @author $Author$
  30.  * @version $Rev$, $Date$
  31.  */

  32. public class FiltroRicercaFruizioniServizio extends FiltroRicercaServizi implements Serializable{

  33.     /**
  34.      *
  35.      */
  36.     private static final long serialVersionUID = 1L;

  37.     /** tipo Soggetto Fruitore */
  38.     private String tipoSoggettoFruitore;
  39.     /** nome Soggetto Fruitore */
  40.     private String nomeSoggettoFruitore;

  41.     /** ProtocolProperty */
  42.     private List<FiltroRicercaProtocolPropertyRegistry> protocolPropertiesFruizione = new ArrayList<FiltroRicercaProtocolPropertyRegistry>();

  43.     public List<FiltroRicercaProtocolPropertyRegistry> getProtocolPropertiesFruizione() {
  44.         return this.protocolPropertiesFruizione;
  45.     }

  46.     public void setProtocolPropertiesFruizione(
  47.             List<FiltroRicercaProtocolPropertyRegistry> list) {
  48.         this.protocolPropertiesFruizione = list;
  49.     }

  50.     public void addProtocolPropertyFruizione(FiltroRicercaProtocolPropertyRegistry filtro){
  51.         this.protocolPropertiesFruizione.add(filtro);
  52.     }
  53.    
  54.     @Override
  55.     public String getTipoSoggettoFruitore() {
  56.         return this.tipoSoggettoFruitore;
  57.     }

  58.     @Override
  59.     public void setTipoSoggettoFruitore(String tipoSoggettoFruitore) {
  60.         this.tipoSoggettoFruitore = tipoSoggettoFruitore;
  61.     }

  62.     @Override
  63.     public String getNomeSoggettoFruitore() {
  64.         return this.nomeSoggettoFruitore;
  65.     }

  66.     @Override
  67.     public void setNomeSoggettoFruitore(String nomeSoggettoFruitore) {
  68.         this.nomeSoggettoFruitore = nomeSoggettoFruitore;
  69.     }
  70.    
  71.    
  72.     @Override
  73.     public String toString(){
  74.         StringBuilder bf = new StringBuilder();
  75.         bf.append("Filtro Fruizione: ");
  76.         this.addDetails(bf);
  77.         if(bf.length()=="Filtro Fruizione: ".length())
  78.             bf.append(" nessun filtro presente");
  79.         return bf.toString();
  80.     }
  81.     @Override
  82.     public void addDetails(StringBuilder bf){
  83.         if(this.tipoSoggettoFruitore!=null)
  84.             bf.append(" [tipo-soggetto-fruitore:"+this.tipoSoggettoFruitore+"]");
  85.         if(this.nomeSoggettoFruitore!=null)
  86.             bf.append(" [nome-soggetto-fruitore:"+this.nomeSoggettoFruitore+"]");
  87.         if(this.protocolPropertiesFruizione!=null && this.protocolPropertiesFruizione.size()>0){
  88.             bf.append(" [protocol-properties-fruizione:"+this.protocolPropertiesFruizione.size()+"]");
  89.             for (int i = 0; i < this.protocolPropertiesFruizione.size(); i++) {
  90.                 bf.append(" [protocol-properties-fruizione["+i+"]:"+this.protocolPropertiesFruizione.get(i).toString()+"]");
  91.             }
  92.         }
  93.         super.addDetails(bf);
  94.     }

  95. }