Sbustamento.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.engine.builder;


  21. import org.openspcoop2.message.OpenSPCoop2Message;
  22. import org.openspcoop2.protocol.engine.Configurazione;
  23. import org.openspcoop2.protocol.sdk.Busta;
  24. import org.openspcoop2.protocol.sdk.Context;
  25. import org.openspcoop2.protocol.sdk.IProtocolFactory;
  26. import org.openspcoop2.protocol.sdk.ProtocolException;
  27. import org.openspcoop2.protocol.sdk.ProtocolMessage;
  28. import org.openspcoop2.protocol.sdk.builder.ProprietaManifestAttachments;
  29. import org.openspcoop2.protocol.sdk.constants.FaseSbustamento;
  30. import org.openspcoop2.protocol.sdk.constants.RuoloMessaggio;
  31. import org.openspcoop2.protocol.sdk.state.IState;
  32. import org.openspcoop2.protocol.sdk.state.RequestInfo;
  33. import org.slf4j.Logger;

  34. /**
  35.  * Classe utilizzata per Sbustare un SOAPEnvelope dell'header del protocollo.
  36.  *
  37.  *
  38.  * @author Poli Andrea (apoli@link.it)
  39.  * @author $Author$
  40.  * @version $Rev$, $Date$
  41.  */

  42. public class Sbustamento  {

  43.     private IProtocolFactory<?> protocolFactory;
  44.     //private Logger log;
  45.     private IState state;

  46.     public Sbustamento(IProtocolFactory<?> protocolFactory,IState state){
  47.         this(Configurazione.getLibraryLog(), protocolFactory, state);
  48.     }
  49.    
  50.     public Sbustamento(Logger log, IProtocolFactory<?> protocolFactory,IState state){
  51.         //if(log==null)
  52.         //  this.log = Configurazione.getLibraryLog();
  53.         //this.log = log;
  54.         this.protocolFactory = protocolFactory;
  55.         this.state = state;
  56.     }
  57.    
  58.     public IProtocolFactory<?> getProtocolFactory(){
  59.         return this.protocolFactory;
  60.     }
  61.    
  62.     /**
  63.      * Effettua lo sbustamento
  64.      *  
  65.      * @param msg Messaggio in cui deve essere estratto un header.
  66.      * @param gestioneManifest Indicazione se deve essere gestito il manifest degli attachments
  67.      *
  68.      */
  69.     public ProtocolMessage sbustamento(OpenSPCoop2Message msg, Context context,
  70.             Busta busta,
  71.             RuoloMessaggio ruoloMessaggio, boolean gestioneManifest,ProprietaManifestAttachments proprietaManifestAttachments,
  72.             FaseSbustamento faseSbustamento, RequestInfo requestInfo) throws ProtocolException{
  73.         if(proprietaManifestAttachments==null){
  74.             proprietaManifestAttachments = new ProprietaManifestAttachments();
  75.         }
  76.         proprietaManifestAttachments.setGestioneManifest(gestioneManifest);
  77.         return this.protocolFactory.createBustaBuilder(this.state).sbustamento( msg, context,
  78.                 busta, ruoloMessaggio, proprietaManifestAttachments,
  79.                 faseSbustamento,requestInfo.getIntegrationServiceBinding(),requestInfo.getBindingConfig());
  80.     }
  81. }