TrasparenteProtocolConfiguration.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.trasparente.config;

  21. import org.openspcoop2.core.constants.TipoPdD;
  22. import org.openspcoop2.message.constants.ServiceBinding;
  23. import org.openspcoop2.protocol.basic.config.BasicConfiguration;
  24. import org.openspcoop2.protocol.sdk.IProtocolFactory;
  25. import org.openspcoop2.protocol.sdk.ProtocolException;
  26. import org.openspcoop2.protocol.sdk.constants.FunzionalitaProtocollo;

  27. /**
  28.  * Classe che implementa, in base al protocollo Trasparente, l'interfaccia {@link org.openspcoop2.protocol.sdk.config.IProtocolConfiguration}
  29.  *
  30.  * @author Poli Andrea (apoli@link.it)
  31.  * @author $Author$
  32.  * @version $Rev$, $Date$
  33.  */
  34. public class TrasparenteProtocolConfiguration extends BasicConfiguration {

  35.     private TrasparenteProperties properties;
  36.    
  37.     public TrasparenteProtocolConfiguration(IProtocolFactory<?> factory) throws ProtocolException {
  38.         super(factory);
  39.         this.properties = TrasparenteProperties.getInstance();
  40.     }
  41.    
  42.     @Override
  43.     public boolean isIntegrationInfoRequired(TipoPdD tipoPdD, ServiceBinding serviceBinding, FunzionalitaProtocollo funzionalitaProtocollo) throws ProtocolException{
  44.        
  45.         if (FunzionalitaProtocollo.RIFERIMENTO_ID_RICHIESTA.equals(funzionalitaProtocollo)){
  46.             if(TipoPdD.DELEGATA.equals(tipoPdD)) {
  47.                 return this.properties.isRiferimentoIDRichiesta_PD_Required();
  48.             }
  49.             else {
  50.                 return this.properties.isRiferimentoIDRichiesta_PA_Required();
  51.             }
  52.         }
  53.         else {
  54.             return super.isIntegrationInfoRequired(tipoPdD, serviceBinding, funzionalitaProtocollo);
  55.         }
  56.        
  57.     }
  58.    
  59.     @Override
  60.     public boolean isAbilitataGenerazioneTracce() {
  61.         if(this.properties.isUtilizzaTestSuiteGenerazioneTracce()) {
  62.             return true;
  63.         }
  64.         return super.isAbilitataGenerazioneTracce();
  65.     }
  66.    
  67.     @Override
  68.     public boolean isDataPresenteInIdentificativoMessaggio() {
  69.         return !this.properties.generateIDasUUID();
  70.     }
  71. }