FiltroRicercaOperations.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 FiltroRicercaOperations extends FiltroRicercaPortTypes implements Serializable{

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

  37.     /** Nome */
  38.     private String nomeAzione;

  39.     /** ProtocolProperty */
  40.     private List<FiltroRicercaProtocolPropertyRegistry> protocolPropertiesAzione = new ArrayList<FiltroRicercaProtocolPropertyRegistry>();

  41.     public List<FiltroRicercaProtocolPropertyRegistry> getProtocolPropertiesAzione() {
  42.         return this.protocolPropertiesAzione;
  43.     }

  44.     public void setProtocolPropertiesAzione(
  45.             List<FiltroRicercaProtocolPropertyRegistry> list) {
  46.         this.protocolPropertiesAzione = list;
  47.     }

  48.     public void addProtocolPropertyAzione(FiltroRicercaProtocolPropertyRegistry filtro){
  49.         this.protocolPropertiesAzione.add(filtro);
  50.     }
  51.    
  52.     public String getNomeAzione() {
  53.         return this.nomeAzione;
  54.     }

  55.     public void setNomeAzione(String nome) {
  56.         this.nomeAzione = nome;
  57.     }
  58.    
  59.    
  60.     @Override
  61.     public String toString(){
  62.         StringBuilder bf = new StringBuilder();
  63.         bf.append("Filtro Azione: ");
  64.         this.addDetails(bf);
  65.         if(bf.length()=="Filtro Azione: ".length())
  66.             bf.append(" nessun filtro presente");
  67.         return bf.toString();
  68.     }
  69.     @Override
  70.     public void addDetails(StringBuilder bf){
  71.         if(this.nomeAzione!=null)
  72.             bf.append(" [nome-azione:"+this.nomeAzione+"]");
  73.         if(this.protocolPropertiesAzione!=null && this.protocolPropertiesAzione.size()>0){
  74.             bf.append(" [protocol-properties-azione:"+this.protocolPropertiesAzione.size()+"]");
  75.             for (int i = 0; i < this.protocolPropertiesAzione.size(); i++) {
  76.                 bf.append(" [protocol-properties-azione["+i+"]:"+this.protocolPropertiesAzione.get(i).toString()+"]");
  77.             }
  78.         }
  79.         super.addDetails(bf);
  80.     }

  81. }