AbstractGestoreIntegrazionePAUrlBasedWithOnlyReadBC.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.IGestoreIntegrazionePA;
  26. import org.openspcoop2.pdd.core.integrazione.InRequestPAMessage;
  27. import org.openspcoop2.pdd.core.integrazione.InResponsePAMessage;
  28. import org.openspcoop2.pdd.core.integrazione.OutRequestPAMessage;
  29. import org.openspcoop2.pdd.core.integrazione.OutResponsePAMessage;
  30. import org.openspcoop2.pdd.logger.OpenSPCoop2Logger;
  31. import org.openspcoop2.utils.LoggerWrapperFactory;




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

  41.     /** Utility per l'integrazione */
  42.     UtilitiesIntegrazioneBC utilities = null;
  43.    
  44.     /** Logger utilizzato per debug. */
  45.     private Logger log = null;
  46.    
  47.     public AbstractGestoreIntegrazionePAUrlBasedWithOnlyReadBC(boolean openspcoop2){
  48.         this.log = OpenSPCoop2Logger.getLoggerOpenSPCoopCore();
  49.         if(this.log==null){
  50.             this.log = LoggerWrapperFactory.getLogger(AbstractGestoreIntegrazionePAUrlBasedWithOnlyReadBC.class);
  51.         }
  52.         try{
  53.             this.utilities = UtilitiesIntegrazioneBC.getInstancePARequest(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.             InRequestPAMessage inRequestPAMessage) throws HeaderIntegrazioneException {
  65.         try{
  66.             String protocollo = this.getProtocolFactory()!=null ? this.getProtocolFactory().getProtocol() : null;
  67.            
  68.             this.utilities.readUrlProperties(inRequestPAMessage.getUrlProtocolContext().getParameters(),
  69.                     integrazione,
  70.                     protocollo);    
  71.         }catch(Exception e){
  72.             throw new HeaderIntegrazioneException("GestoreIntegrazionePAUrlBased, "+e.getMessage(),e);
  73.         }
  74.     }
  75.    
  76.     // OUT - Request
  77.    
  78.     @Override
  79.     public void setOutRequestHeader(HeaderIntegrazione integrazione,
  80.             OutRequestPAMessage outRequestPAMessage) throws HeaderIntegrazioneException{
  81.        
  82.         // nop;
  83.        
  84.     }
  85.    
  86.     // IN - Response
  87.    
  88.     @Override
  89.     public void readInResponseHeader(HeaderIntegrazione integrazione,
  90.             InResponsePAMessage inResponsePAMessage) throws HeaderIntegrazioneException{
  91.         // NOP
  92.         // Non esiste un header di integrazione basato sulla url per la risposta
  93.     }

  94.     // OUT - Response

  95.     @Override
  96.     public void setOutResponseHeader(HeaderIntegrazione integrazione,
  97.             OutResponsePAMessage outResponsePAMessage) throws HeaderIntegrazioneException{
  98.        
  99.         // nop;
  100.        
  101.     }
  102. }