FiltroRicercaServiziApplicativi.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.config.driver;

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

  25. import org.openspcoop2.core.id.IDRuolo;

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

  35. public class FiltroRicercaServiziApplicativi extends FiltroRicercaBase implements Serializable{

  36.    
  37.     /**
  38.      *
  39.      */
  40.     private static final long serialVersionUID = 1L;
  41.    
  42.     /** TipoSoggetto */
  43.     private String tipoSoggetto;
  44.    
  45.     /** NomeSoggetto */
  46.     private String nomeSoggetto;
  47.    
  48.     /** Ruolo */
  49.     private IDRuolo idRuolo;
  50.    
  51.     /** Tipo */
  52.     private String tipo;

  53.     /** ProtocolProperty */
  54.     private List<FiltroRicercaProtocolPropertyConfig> protocolProperties = new ArrayList<FiltroRicercaProtocolPropertyConfig>();

  55.     public List<FiltroRicercaProtocolPropertyConfig> getProtocolProperties() {
  56.         return this.protocolProperties;
  57.     }

  58.     public void setProtocolProperties(
  59.             List<FiltroRicercaProtocolPropertyConfig> list) {
  60.         this.protocolProperties = list;
  61.     }

  62.     public void addProtocolProperty(FiltroRicercaProtocolPropertyConfig filtro){
  63.         this.protocolProperties.add(filtro);
  64.     }
  65.    
  66.     /** Proprieta */
  67.     private Map<String, String> proprieta;
  68.     public Map<String, String> getProprieta() {
  69.         return this.proprieta;
  70.     }
  71.     public void setProprieta(Map<String, String> proprieta) {
  72.         this.proprieta = proprieta;
  73.     }
  74.    
  75.     @Override
  76.     public String toString(){
  77.         StringBuilder bf = new StringBuilder();
  78.         bf.append(super.toString(false));
  79.         if(this.tipoSoggetto!=null)
  80.             bf.append(" [tipoSoggetto:"+this.tipoSoggetto+"]");
  81.         if(this.nomeSoggetto!=null)
  82.             bf.append(" [nomeSoggetto:"+this.nomeSoggetto+"]");
  83.         if(this.idRuolo!=null)
  84.             bf.append(" [ruolo:"+this.idRuolo+"]");
  85.         if(this.protocolProperties!=null && this.protocolProperties.size()>0){
  86.             bf.append(" [protocol-properties:"+this.protocolProperties.size()+"]");
  87.             for (int i = 0; i < this.protocolProperties.size(); i++) {
  88.                 bf.append(" [protocol-properties["+i+"]:");
  89.                 this.protocolProperties.get(i).addDetails(bf);
  90.                 bf.append("]");
  91.             }
  92.         }
  93.         if(this.proprieta!=null && !this.proprieta.isEmpty()) {
  94.             bf.append(" [proprieta:"+this.proprieta.size()+"]");
  95.             for (String key : this.proprieta.keySet()) {
  96.                 bf.append(" [proprieta["+key+"]:");
  97.                 bf.append(this.proprieta.get(key)!=null ? this.proprieta.get(key):"");
  98.                 bf.append("]");
  99.             }
  100.         }
  101.         if(bf.length()=="Filtro:".length())
  102.             bf.append(" nessun filtro presente");
  103.         return bf.toString();
  104.     }
  105.    
  106.     public String getTipoSoggetto() {
  107.         return this.tipoSoggetto;
  108.     }


  109.     public void setTipoSoggetto(String tipoSoggetto) {
  110.         this.tipoSoggetto = tipoSoggetto;
  111.     }


  112.     public String getNomeSoggetto() {
  113.         return this.nomeSoggetto;
  114.     }


  115.     public void setNomeSoggetto(String nomeSoggetto) {
  116.         this.nomeSoggetto = nomeSoggetto;
  117.     }
  118.    
  119.     public IDRuolo getIdRuolo() {
  120.         return this.idRuolo;
  121.     }

  122.     public void setIdRuolo(IDRuolo idRuolo) {
  123.         this.idRuolo = idRuolo;
  124.     }

  125.     public String getTipo() {
  126.         return this.tipo;
  127.     }

  128.     public void setTipo(String tipo) {
  129.         this.tipo = tipo;
  130.     }

  131. }