AbstractGestoreIntegrazionePDUrlBasedBC.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.pdd.core.integrazione.backward_compatibility;

  21. import org.slf4j.Logger;
  22. import org.openspcoop2.pdd.core.AbstractCore;
  23. import org.openspcoop2.pdd.core.integrazione.HeaderIntegrazione;
  24. import org.openspcoop2.pdd.core.integrazione.HeaderIntegrazioneException;
  25. import org.openspcoop2.pdd.core.integrazione.IGestoreIntegrazionePD;
  26. import org.openspcoop2.pdd.core.integrazione.InRequestPDMessage;
  27. import org.openspcoop2.pdd.core.integrazione.InResponsePDMessage;
  28. import org.openspcoop2.pdd.core.integrazione.OutRequestPDMessage;
  29. import org.openspcoop2.pdd.core.integrazione.OutResponsePDMessage;
  30. import org.openspcoop2.pdd.logger.OpenSPCoop2Logger;
  31. import org.openspcoop2.utils.LoggerWrapperFactory;



  32. /**
  33.  * Classe utilizzata per la ricezione di informazioni di integrazione
  34.  * dai servizi applicativi verso la porta di dominio.
  35.  *
  36.  * @author Poli Andrea (apoli@link.it)
  37.  * @author $Author$
  38.  * @version $Rev$, $Date$
  39.  */
  40. public abstract class AbstractGestoreIntegrazionePDUrlBasedBC extends AbstractCore implements IGestoreIntegrazionePD{

  41.     /** Utility per l'integrazione */
  42.     UtilitiesIntegrazioneBC utilitiesBC = null;
  43.    
  44.     /** Logger utilizzato per debug. */
  45.     private Logger log = null;
  46.    
  47.     public AbstractGestoreIntegrazionePDUrlBasedBC(boolean openspcoop2){
  48.         this.log = OpenSPCoop2Logger.getLoggerOpenSPCoopCore();
  49.         if(this.log==null){
  50.             this.log = LoggerWrapperFactory.getLogger(AbstractGestoreIntegrazionePDUrlBasedBC.class);
  51.         }
  52.         try{
  53.             this.utilitiesBC = UtilitiesIntegrazioneBC.getInstancePDRequest(this.log, openspcoop2, false);
  54.         }catch(Exception e){
  55.             this.log.error("Errore durante l'inizializzazione delle UtilitiesIntegrazione: "+e.getMessage(),e);
  56.         }
  57.     }
  58.    
  59.    
  60.     // IN - Request
  61.    
  62.     @Override
  63.     public void readInRequestHeader(HeaderIntegrazione integrazione,
  64.             InRequestPDMessage inRequestPDMessage) throws HeaderIntegrazioneException{
  65.        
  66.         try{
  67.             String protocollo = this.getProtocolFactory()!=null ? this.getProtocolFactory().getProtocol() : null;
  68.            
  69.             this.utilitiesBC.readUrlProperties(inRequestPDMessage.getUrlProtocolContext().getParameters(),
  70.                     integrazione,
  71.                     protocollo);    
  72.         }catch(Exception e){
  73.             throw new HeaderIntegrazioneException("GestoreIntegrazionePDUrlBased, "+e.getMessage(),e);
  74.         }
  75.        
  76.     }

  77.     // OUT - Request
  78.    
  79.     @Override
  80.     public void setOutRequestHeader(HeaderIntegrazione integrazione,
  81.             OutRequestPDMessage outRequestPDMessage) throws HeaderIntegrazioneException{
  82.    
  83.         // nop;
  84.        
  85.     }
  86.    
  87.     // IN - Response
  88.    
  89.     @Override
  90.     public void readInResponseHeader(HeaderIntegrazione integrazione,
  91.             InResponsePDMessage inResponsePDMessage) throws HeaderIntegrazioneException{
  92.         // NOP
  93.         // Non esiste un header di integrazione basato sulla url per la risposta
  94.     }
  95.    
  96.     // OUT - Response
  97.    
  98.     @Override
  99.     public void setOutResponseHeader(HeaderIntegrazione integrazione,
  100.             OutResponsePDMessage outResponsePDMessage) throws HeaderIntegrazioneException{
  101.         // NOP
  102.         // Non esiste un header di integrazione basato sulla url per la risposta
  103.     }
  104. }