FiltroRicercaAccordi.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.Date;
  24. import java.util.List;

  25. import org.openspcoop2.core.id.IDAccordoCooperazione;
  26. import org.openspcoop2.core.id.IDGruppo;
  27. import org.openspcoop2.core.registry.constants.ServiceBinding;

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

  36. public class FiltroRicercaAccordi implements Serializable{

  37.    
  38.     /**
  39.      *
  40.      */
  41.     private static final long serialVersionUID = 1L;

  42.     /** Intervallo inferiore */
  43.     private Date minDate;
  44.    
  45.     /** Intervallo superiore */
  46.     private Date maxDate;
  47.    
  48.     /** Nome Accordo */
  49.     private String nomeAccordo;
  50.    
  51.     /** Versione */
  52.     private Integer versione;
  53.    
  54.     /** Nome */
  55.     private String nomeSoggettoReferente;
  56.    
  57.     /** Tipo */
  58.     private String tipoSoggettoReferente;

  59.     /** Service Binding */
  60.     private ServiceBinding serviceBinding;
  61.    
  62.     private IDAccordoCooperazione idAccordoCooperazione;
  63.     private Boolean servizioComposto;

  64.     private IDGruppo idGruppo;
  65.    
  66.     private String protocollo;
  67.     private List<String> protocolli;

  68.     private boolean order = false;
  69.    
  70.     public boolean isOrder() {
  71.         return this.order;
  72.     }

  73.     public void setOrder(boolean order) {
  74.         this.order = order;
  75.     }

  76.     public List<String> getProtocolli() {
  77.         return this.protocolli;
  78.     }

  79.     public void setProtocolli(List<String> protocolli) {
  80.         this.protocolli = protocolli;
  81.     }
  82.    
  83.     public String getProtocollo() {
  84.         return this.protocollo;
  85.     }

  86.     public void setProtocollo(String protocollo) {
  87.         this.protocollo = protocollo;
  88.     }
  89.    
  90.     public ServiceBinding getServiceBinding() {
  91.         return this.serviceBinding;
  92.     }
  93.     public void setServiceBinding(ServiceBinding serviceBinding) {
  94.         this.serviceBinding = serviceBinding;
  95.     }
  96.    
  97.     /** ProtocolProperty */
  98.     private List<FiltroRicercaProtocolPropertyRegistry> protocolPropertiesAccordo = new ArrayList<FiltroRicercaProtocolPropertyRegistry>();

  99.     public List<FiltroRicercaProtocolPropertyRegistry> getProtocolPropertiesAccordo() {
  100.         return this.protocolPropertiesAccordo;
  101.     }

  102.     public void setProtocolPropertiesAccordo(
  103.             List<FiltroRicercaProtocolPropertyRegistry> list) {
  104.         this.protocolPropertiesAccordo = list;
  105.     }

  106.     public void addProtocolPropertyAccordo(FiltroRicercaProtocolPropertyRegistry filtro){
  107.         this.protocolPropertiesAccordo.add(filtro);
  108.     }
  109.    
  110.     /**
  111.      * @return the maxDate
  112.      */
  113.     public Date getMaxDate() {
  114.         return this.maxDate;
  115.     }

  116.     /**
  117.      * @param maxDate the maxDate to set
  118.      */
  119.     public void setMaxDate(Date maxDate) {
  120.         this.maxDate = maxDate;
  121.     }

  122.     /**
  123.      * @return the minDate
  124.      */
  125.     public Date getMinDate() {
  126.         return this.minDate;
  127.     }

  128.     /**
  129.      * @param minDate the minDate to set
  130.      */
  131.     public void setMinDate(Date minDate) {
  132.         this.minDate = minDate;
  133.     }


  134.     public String getNomeAccordo() {
  135.         return this.nomeAccordo;
  136.     }

  137.     public void setNomeAccordo(String nomeAccordo) {
  138.         this.nomeAccordo = nomeAccordo;
  139.     }

  140.     public Integer getVersione() {
  141.         return this.versione;
  142.     }

  143.     public void setVersione(Integer versione) {
  144.         this.versione = versione;
  145.     }

  146.     public String getNomeSoggettoReferente() {
  147.         return this.nomeSoggettoReferente;
  148.     }

  149.     public void setNomeSoggettoReferente(String nomeSoggettoReferente) {
  150.         this.nomeSoggettoReferente = nomeSoggettoReferente;
  151.     }

  152.     public String getTipoSoggettoReferente() {
  153.         return this.tipoSoggettoReferente;
  154.     }

  155.     public void setTipoSoggettoReferente(String tipoSoggettoReferente) {
  156.         this.tipoSoggettoReferente = tipoSoggettoReferente;
  157.     }

  158.     public IDAccordoCooperazione getIdAccordoCooperazione() {
  159.         return this.idAccordoCooperazione;
  160.     }

  161.     public void setIdAccordoCooperazione(IDAccordoCooperazione idAccordoCooperazione) {
  162.         this.idAccordoCooperazione = idAccordoCooperazione;
  163.     }
  164.    
  165.     public Boolean isServizioComposto() {
  166.         return this.servizioComposto;
  167.     }

  168.     public void setServizioComposto(Boolean servizioComposto) {
  169.         this.servizioComposto = servizioComposto;
  170.     }
  171.    
  172.     public IDGruppo getIdGruppo() {
  173.         return this.idGruppo;
  174.     }
  175.     public void setIdGruppo(IDGruppo gruppo) {
  176.         this.idGruppo = gruppo;
  177.     }
  178.    
  179.     @Override
  180.     public String toString(){
  181.         StringBuilder bf = new StringBuilder();
  182.         bf.append("Filtro Accordi:");
  183.         this.addDetails(bf);
  184.         if(bf.length()=="Filtro Accordi:".length())
  185.             bf.append(" nessun filtro presente");
  186.         return bf.toString();
  187.     }
  188.     public void addDetails(StringBuilder bf){
  189.         if(this.minDate!=null)
  190.             bf.append(" [intervallo-inferiore-data:"+this.minDate+"]");
  191.         if(this.maxDate!=null)
  192.             bf.append(" [intervallo-superiore-data:"+this.maxDate+"]");
  193.         if(this.nomeAccordo!=null)
  194.             bf.append(" [nome-accordo:"+this.nomeAccordo+"]");
  195.         if(this.tipoSoggettoReferente!=null)
  196.             bf.append(" [tipo-soggetto-referente:"+this.tipoSoggettoReferente+"]");
  197.         if(this.nomeSoggettoReferente!=null)
  198.             bf.append(" [nome-soggetto-referente:"+this.nomeSoggettoReferente+"]");
  199.         if(this.versione!=null)
  200.             bf.append(" [versione:"+this.versione+"]");
  201.         if(this.idAccordoCooperazione!=null)
  202.             bf.append(" [id-accordo-cooperazione:"+this.idAccordoCooperazione+"]");
  203.         if(this.servizioComposto!=null)
  204.             bf.append(" [servizio-composto:"+this.servizioComposto+"]");
  205.         if(this.idGruppo!=null)
  206.             bf.append(" [id-gruppo:"+this.idGruppo+"]");
  207.         if(this.protocollo!=null)
  208.             bf.append(" [protocollo:"+this.protocollo+"]");
  209.         if(this.protocolli!=null && this.protocolli.size()>0) {
  210.             bf.append(" [protocolli:"+this.protocolli+"]");
  211.         }
  212.         bf.append(" [order:"+this.order+"]");
  213.         if(this.protocolPropertiesAccordo!=null && this.protocolPropertiesAccordo.size()>0){
  214.             bf.append(" [protocol-properties-accordo:"+this.protocolPropertiesAccordo.size()+"]");
  215.             for (int i = 0; i < this.protocolPropertiesAccordo.size(); i++) {
  216.                 bf.append(" [protocol-properties-accordo["+i+"]:");
  217.                 this.protocolPropertiesAccordo.get(i).addDetails(bf);
  218.                 bf.append("]");
  219.             }
  220.         }
  221.     }

  222. }