ITracciaSerializer.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.List;

  22. import org.openspcoop2.message.constants.ServiceBinding;
  23. import org.openspcoop2.protocol.sdk.Busta;
  24. import org.openspcoop2.protocol.sdk.IComponentFactory;
  25. import org.openspcoop2.protocol.sdk.ProtocolException;
  26. import org.openspcoop2.protocol.sdk.XMLRootElement;
  27. import org.openspcoop2.protocol.sdk.constants.TipoSerializzazione;
  28. import org.w3c.dom.Element;

  29. /**
  30.  * La Porta di Dominio tiene traccia dei metadati di
  31.  * cooperazione dei messaggi scambiati con le altre porte.
  32.  * Il formato di tali tracce viene gestito da questa classe.
  33.  *
  34.  * @author Lorenzo Nardi (nardi@link.it)
  35. * @author $Author$
  36. * @version $Rev$, $Date$
  37.  * */
  38. public interface ITracciaSerializer extends IComponentFactory {
  39.        
  40.     /**
  41.      * Costruisce un Element contenente una traccia come definito da specifica
  42.      *
  43.      * @param traccia Contiene i valori della traccia
  44.      * @return Element contenente la traccia.
  45.      */
  46.     public Element toElement(Traccia traccia) throws ProtocolException;
  47.    
  48.     /**
  49.      * Costruisce una traccia come definito da specifica
  50.      *
  51.      * @param traccia Contiene i valori della traccia
  52.      * @param tipoSerializzazione Tipologia di serializzazione
  53.      * @return Traccia serializzato nel tipo indicato nel parametro
  54.      */
  55.     public String toString(Traccia traccia, TipoSerializzazione tipoSerializzazione) throws ProtocolException;
  56.    
  57.     /**
  58.      * Costruisce una traccia come definito da specifica
  59.      *
  60.      * @param traccia Contiene i valori della traccia
  61.      * @param tipoSerializzazione Tipologia di serializzazione
  62.      * @return Traccia serializzato nel tipo indicato nel parametro
  63.      */
  64.     public byte[] toByteArray(Traccia traccia, TipoSerializzazione tipoSerializzazione) throws ProtocolException;
  65.    
  66.     /**
  67.      * Indicazione sul xml contenitore delle tracce
  68.      *
  69.      * @return Indicazione sul xml contenitore delle tracce
  70.      * @throws ProtocolException
  71.      */
  72.     public XMLRootElement getXMLRootElement() throws ProtocolException;
  73.    
  74.     public List<TracciaExtInfoDefinition> getExtInfoDefinition();
  75.     public List<TracciaExtInfo> extractExtInfo(Busta busta, ServiceBinding tipoApi);
  76.     public default boolean isSupportedExtInfo() {
  77.         return false;
  78.     }
  79.     public void setPrettyDocument(boolean v);
  80.     public boolean isPrettyDocument();
  81.     public void setOmitXmlDeclaration(boolean v);
  82.     public boolean isOmitXmlDeclaration();
  83.    
  84. }