FiltroRicercaTracce.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.sdk.tracciamento;

  21. import java.util.Date;
  22. import java.util.HashMap;
  23. import java.util.Map;

  24. import javax.xml.datatype.XMLGregorianCalendar;

  25. import org.openspcoop2.core.constants.TipoPdD;
  26. import org.openspcoop2.core.id.IDSoggetto;
  27. import org.openspcoop2.protocol.sdk.constants.RuoloMessaggio;

  28. /**
  29.  * FiltroRicercaTracce
  30.  *
  31.  * @author Poli Andrea (apoli@link.it)
  32.  * @author Nardi Lorenzo
  33. * @author $Author$
  34. * @version $Rev$, $Date$
  35.  */
  36. public class FiltroRicercaTracce implements java.io.Serializable {

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

  41.     protected Date maxDate;
  42.     protected Date minDate;

  43.     protected String idTransazione;
  44.    
  45.     protected RuoloMessaggio tipoTraccia;
  46.     protected TipoPdD tipoPdD;
  47.     protected IDSoggetto dominio;

  48.     protected String idBusta; // utilizzabile con tipo traccia
  49.     protected String idBustaRichiesta;
  50.     protected String idBustaRisposta;
  51.     protected String riferimentoMessaggio;
  52.     protected boolean ricercaSoloBusteErrore;
  53.     protected InformazioniProtocollo informazioniProtocollo;

  54.     protected String servizioApplicativoFruitore;
  55.     protected String servizioApplicativoErogatore;

  56.     protected String idCorrelazioneApplicativa;
  57.     protected String idCorrelazioneApplicativaRisposta;
  58.     protected boolean idCorrelazioneApplicativaOrMatch = false;

  59.     protected String protocollo;

  60.     protected Map<String, String> properties;


  61.     public FiltroRicercaTracce() {
  62.         this.properties = new HashMap<>();
  63.     }


  64.     /**
  65.      * Gets the value of the idCorrelazioneApplicativa property.
  66.      *
  67.      * @return
  68.      *     possible object is
  69.      *     {@link String }
  70.      *    
  71.      */
  72.     public String getIdCorrelazioneApplicativa() {
  73.         return this.idCorrelazioneApplicativa;
  74.     }

  75.     /**
  76.      * Sets the value of the idCorrelazioneApplicativa property.
  77.      *
  78.      * @param value
  79.      *     allowed object is
  80.      *     {@link String }
  81.      *    
  82.      */
  83.     public void setIdCorrelazioneApplicativa(String value) {
  84.         this.idCorrelazioneApplicativa = value;
  85.     }

  86.     /**
  87.      * Gets the value of the idBusta property.
  88.      *
  89.      * @return
  90.      *     possible object is
  91.      *     {@link String }
  92.      *    
  93.      */
  94.     public String getIdBusta() {
  95.         return this.idBusta;
  96.     }

  97.     /**
  98.      * Sets the value of the idBusta property.
  99.      *
  100.      * @param value
  101.      *     allowed object is
  102.      *     {@link String }
  103.      *    
  104.      */
  105.     public void setIdBusta(String value) {
  106.         this.idBusta = value;
  107.     }
  108.    
  109.     /**
  110.      * Gets the value of the idBustaRichiesta property.
  111.      *
  112.      * @return
  113.      *     possible object is
  114.      *     {@link String }
  115.      *    
  116.      */
  117.     public String getIdBustaRichiesta() {
  118.         return this.idBustaRichiesta;
  119.     }

  120.     /**
  121.      * Sets the value of the idBustaRichiesta property.
  122.      *
  123.      * @param value
  124.      *     allowed object is
  125.      *     {@link String }
  126.      *    
  127.      */
  128.     public void setIdBustaRichiesta(String value) {
  129.         this.idBustaRichiesta = value;
  130.     }
  131.    
  132.     /**
  133.      * Gets the value of the idBustaRichiesta property.
  134.      *
  135.      * @return
  136.      *     possible object is
  137.      *     {@link String }
  138.      *    
  139.      */
  140.     public String getIdBustaRisposta() {
  141.         return this.idBustaRisposta;
  142.     }

  143.     /**
  144.      * Sets the value of the idBustaRichiesta property.
  145.      *
  146.      * @param value
  147.      *     allowed object is
  148.      *     {@link String }
  149.      *    
  150.      */
  151.     public void setIdBustaRisposta(String value) {
  152.         this.idBustaRisposta = value;
  153.     }


  154.     /**
  155.      * Gets the value of the maxDate property.
  156.      *
  157.      * @return
  158.      *     possible object is
  159.      *     {@link XMLGregorianCalendar }
  160.      *    
  161.      */
  162.     public Date getMaxDate() {
  163.         return this.maxDate;
  164.     }

  165.     /**
  166.      * Sets the value of the maxDate property.
  167.      *
  168.      * @param value
  169.      *     allowed object is
  170.      *     {@link XMLGregorianCalendar }
  171.      *    
  172.      */
  173.     public void setMaxDate(Date value) {
  174.         this.maxDate = value;
  175.     }
  176.     /**
  177.      * Gets the value of the minDate property.
  178.      *
  179.      * @return
  180.      *     possible object is
  181.      *     {@link XMLGregorianCalendar }
  182.      *    
  183.      */
  184.     public Date getMinDate() {
  185.         return this.minDate;
  186.     }
  187.     /**
  188.      * Sets the value of the minDate property.
  189.      *
  190.      * @param value
  191.      *     allowed object is
  192.      *     {@link XMLGregorianCalendar }
  193.      *    
  194.      */
  195.     public void setMinDate(Date value) {
  196.         this.minDate = value;
  197.     }


  198.     /**
  199.      * Gets the value of the property property.
  200.      *
  201.      * <p>
  202.      * This accessor method returns a reference to the live list,
  203.      * not a snapshot. Therefore any modification you make to the
  204.      * returned list will be present inside the JAXB object.
  205.      * This is why there is not a <CODE>set</CODE> method for the property property.
  206.      *
  207.      * <p>
  208.      * For example, to add a new item, do as follows:
  209.      * <pre>
  210.      *    getProperty().add(newItem);
  211.      * </pre>
  212.      *
  213.      *
  214.      * <p>
  215.      * Objects of the following type(s) are allowed in the list
  216.      * {@link String }
  217.      *
  218.      *
  219.      */
  220.     public Map<String, String> getProperty() {
  221.         return this.properties;
  222.     }

  223.     /**
  224.      * Gets the value of the tipoTraccia property.
  225.      *
  226.      * @return
  227.      *     possible object is
  228.      *     {@link String }
  229.      *    
  230.      */
  231.     public RuoloMessaggio getTipoTraccia() {
  232.         return this.tipoTraccia;
  233.     }

  234.     /**
  235.      * Sets the value of the tipoTraccia property.
  236.      *
  237.      * @param value
  238.      *     allowed object is
  239.      *     {@link String }
  240.      *    
  241.      */
  242.     public void setTipoTraccia(RuoloMessaggio value) {
  243.         this.tipoTraccia = value;
  244.     }

  245.     public String getIdCorrelazioneApplicativaRisposta() {
  246.         return this.idCorrelazioneApplicativaRisposta;
  247.     }

  248.     public void setIdCorrelazioneApplicativaRisposta(
  249.             String idCorrelazioneApplicativaRisposta) {
  250.         this.idCorrelazioneApplicativaRisposta = idCorrelazioneApplicativaRisposta;
  251.     }

  252.     public boolean isIdCorrelazioneApplicativaOrMatch() {
  253.         return this.idCorrelazioneApplicativaOrMatch;
  254.     }

  255.     public void setIdCorrelazioneApplicativaOrMatch(
  256.             boolean correlazioneApplicativaOrMatch) {
  257.         this.idCorrelazioneApplicativaOrMatch = correlazioneApplicativaOrMatch;
  258.     }

  259.     public void addProperty(String key,String value){
  260.         this.properties.put(key,value);
  261.     }

  262.     public int sizeProperties(){
  263.         return this.properties.size();
  264.     }

  265.     public String getProperty(String key){
  266.         return this.properties.get(key);
  267.     }

  268.     public String removeProperty(String key){
  269.         return this.properties.remove(key);
  270.     }

  271.     public String[] getPropertiesValues() {
  272.         return this.properties.values().toArray(new String[this.properties.size()]);
  273.     }

  274.     public String[] getPropertiesNames() {
  275.         return this.properties.keySet().toArray(new String[this.properties.size()]);
  276.     }

  277.     public void setProperties(Map<String, String> params) {
  278.         this.properties = params;
  279.     }

  280.     public Map<String, String> getProperties() {
  281.         return this.properties;
  282.     }

  283.     public String getProtocollo() {
  284.         return this.protocollo;
  285.     }

  286.     public void setProtocollo(String protocollo) {
  287.         this.protocollo = protocollo;
  288.     }


  289.     public String getServizioApplicativoFruitore() {
  290.         return this.servizioApplicativoFruitore;
  291.     }

  292.     public void setServizioApplicativoFruitore(String servizioApplicativoFruitore) {
  293.         this.servizioApplicativoFruitore = servizioApplicativoFruitore;
  294.     }

  295.     public String getServizioApplicativoErogatore() {
  296.         return this.servizioApplicativoErogatore;
  297.     }

  298.     public void setServizioApplicativoErogatore(String servizioApplicativoErogatore) {
  299.         this.servizioApplicativoErogatore = servizioApplicativoErogatore;
  300.     }

  301.     public TipoPdD getTipoPdD() {
  302.         return this.tipoPdD;
  303.     }

  304.     public void setTipoPdD(TipoPdD tipoPdD) {
  305.         this.tipoPdD = tipoPdD;
  306.     }

  307.     public IDSoggetto getDominio() {
  308.         return this.dominio;
  309.     }

  310.     public void setDominio(IDSoggetto dominio) {
  311.         this.dominio = dominio;
  312.     }

  313.     public String getRiferimentoMessaggio() {
  314.         return this.riferimentoMessaggio;
  315.     }

  316.     public void setRiferimentoMessaggio(String riferimentoMessaggio) {
  317.         this.riferimentoMessaggio = riferimentoMessaggio;
  318.     }

  319.     public boolean isRicercaSoloBusteErrore() {
  320.         return this.ricercaSoloBusteErrore;
  321.     }

  322.     public void setRicercaSoloBusteErrore(boolean ricercaSoloBusteErrore) {
  323.         this.ricercaSoloBusteErrore = ricercaSoloBusteErrore;
  324.     }

  325.     public InformazioniProtocollo getInformazioniProtocollo() {
  326.         return this.informazioniProtocollo;
  327.     }

  328.     public void setInformazioniProtocollo(
  329.             InformazioniProtocollo informazioniProtocollo) {
  330.         this.informazioniProtocollo = informazioniProtocollo;
  331.     }
  332.    
  333.     public String getIdTransazione() {
  334.         return this.idTransazione;
  335.     }

  336.     public void setIdTransazione(String idTransazione) {
  337.         this.idTransazione = idTransazione;
  338.     }

  339.     @Override
  340.     public String toString(){
  341.         StringBuilder bf = new StringBuilder();
  342.         bf.append("Filtro Ricerca traccia:");
  343.         if(this.idTransazione!=null)
  344.             bf.append(" [id-transazione:"+this.idTransazione+"]");
  345.         if(this.minDate!=null)
  346.             bf.append(" [intervallo-inferiore-data:"+this.minDate+"]");
  347.         if(this.maxDate!=null)
  348.             bf.append(" [intervallo-superiore-data:"+this.maxDate+"]");
  349.         if(this.tipoTraccia!=null)
  350.             bf.append(" [tipo-traccia:"+this.tipoTraccia+"]");
  351.         if(this.tipoPdD!=null)
  352.             bf.append(" [tipo-porta-dominio:"+this.tipoPdD.getTipo()+"]");
  353.         if(this.dominio!=null){
  354.             if(this.dominio.getCodicePorta()!=null){
  355.                 bf.append(" [identificativo-porta.codice-porta:"+this.dominio.getCodicePorta()+"]");
  356.             }
  357.             if(this.dominio.getTipo()!=null){
  358.                 bf.append(" [identificativo-porta.tipo:"+this.dominio.getTipo()+"]");
  359.             }
  360.             if(this.dominio.getNome()!=null){
  361.                 bf.append(" [identificativo-porta.nome:"+this.dominio.getNome()+"]");
  362.             }
  363.         }
  364.         if(this.idBusta!=null)
  365.             bf.append(" [id-busta:"+this.idBusta+"]");
  366.         if(this.idBustaRichiesta!=null)
  367.             bf.append(" [id-busta-richiesta:"+this.idBustaRichiesta+"]");
  368.         if(this.idBustaRisposta!=null)
  369.             bf.append(" [id-busta-risposta:"+this.idBustaRisposta+"]");
  370.         if(this.riferimentoMessaggio!=null)
  371.             bf.append(" [riferimento-messaggio:"+this.riferimentoMessaggio+"]");
  372.         if(this.ricercaSoloBusteErrore)
  373.             bf.append(" [ricerca-solo-buste-errore]");
  374.         if(this.informazioniProtocollo!=null){
  375.             bf.append(this.informazioniProtocollo.toString());
  376.         }
  377.         if(this.servizioApplicativoFruitore!=null)
  378.             bf.append(" [saFruitore:"+this.servizioApplicativoFruitore+"]");
  379.         if(this.servizioApplicativoErogatore!=null)
  380.             bf.append(" [saErogatore:"+this.servizioApplicativoErogatore+"]");
  381.         if(this.idCorrelazioneApplicativa!=null)
  382.             bf.append(" [id-correlazione-applicativa:"+this.idCorrelazioneApplicativa+"]");
  383.         if(this.idCorrelazioneApplicativaRisposta!=null)
  384.             bf.append(" [id-correlazione-applicativa-risposta:"+this.idCorrelazioneApplicativaRisposta+"]");
  385.         if(this.idCorrelazioneApplicativa!=null && this.idCorrelazioneApplicativaRisposta!=null)
  386.             bf.append(" [id-correlazione-applicativa-or-match:"+this.idCorrelazioneApplicativaOrMatch+"]");
  387.         if(this.protocollo!=null){
  388.             bf.append(" [protocollo:"+this.protocollo+"]");
  389.         }
  390.         if(this.properties!=null)
  391.             bf.append(" [properties:"+this.properties.size()+"]");

  392.         if(bf.length()=="Filtro Ricerca traccia:".length())
  393.             bf.append(" nessun filtro presente");
  394.         return bf.toString();
  395.     }

  396. }