GestoreIntegrazionePDAutenticazione.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;

  21. import org.openspcoop2.message.constants.ServiceBinding;
  22. import org.openspcoop2.pdd.core.AbstractCore;
  23. import org.openspcoop2.pdd.logger.OpenSPCoop2Logger;



  24. /**
  25.  * Classe utilizzata per avere una trasformazione
  26.  *
  27.  * @author Poli Andrea (apoli@link.it)
  28.  * @author $Author$
  29.  * @version $Rev$, $Date$
  30.  */
  31. public class GestoreIntegrazionePDAutenticazione extends AbstractCore implements IGestoreIntegrazionePD{

  32.     private boolean rest = true;
  33.     private boolean soap = true;
  34.    
  35.     protected GestoreIntegrazionePDAutenticazione( boolean rest, boolean soap ){
  36.         this.rest = rest;
  37.         this.soap = soap;
  38.     }
  39.     public GestoreIntegrazionePDAutenticazione(){
  40.     }
  41.    

  42.     // IN - Request

  43.     @Override
  44.     public void readInRequestHeader(HeaderIntegrazione integrazione,
  45.             InRequestPDMessage inRequestPDMessage) throws HeaderIntegrazioneException{
  46.         // nop
  47.     }

  48.     // OUT - Request
  49.    
  50.     @Override
  51.     public void setOutRequestHeader(HeaderIntegrazione integrazione,
  52.             OutRequestPDMessage outRequestPDMessage) throws HeaderIntegrazioneException{
  53.        
  54.         boolean process = false;
  55.         if(outRequestPDMessage!=null && outRequestPDMessage.getMessage()!=null && outRequestPDMessage.getMessage().getServiceBinding()!=null) {
  56.             if(ServiceBinding.REST.equals(outRequestPDMessage.getMessage().getServiceBinding())) {
  57.                 process = this.rest;
  58.             }
  59.             else {
  60.                 process = this.soap;
  61.             }
  62.         }
  63.        
  64.         if(process) {
  65.             UtilitiesAutenticazione utilities = new UtilitiesAutenticazione(integrazione, outRequestPDMessage,
  66.                     this.getPddContext(), OpenSPCoop2Logger.getLoggerOpenSPCoopCore());
  67.             utilities.process();
  68.         }
  69.     }
  70.    
  71.     // IN - Response
  72.    
  73.     @Override
  74.     public void readInResponseHeader(HeaderIntegrazione integrazione,
  75.             InResponsePDMessage inResponsePDMessage) throws HeaderIntegrazioneException{
  76.         // nop
  77.     }
  78.        
  79.     // OUT - Response

  80.     @Override
  81.     public void setOutResponseHeader(HeaderIntegrazione integrazione,
  82.             OutResponsePDMessage outResponsePDMessage) throws HeaderIntegrazioneException{
  83.         // nop
  84.     }
  85. }