EsitoAutenticazionePortaDelegata.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.autenticazione.pd;

  21. import org.openspcoop2.core.id.IDServizioApplicativo;
  22. import org.openspcoop2.pdd.core.autenticazione.EsitoAutenticazione;
  23. import org.openspcoop2.protocol.sdk.constants.ErroreIntegrazione;
  24. import org.openspcoop2.protocol.sdk.constants.IntegrationFunctionError;

  25. /**
  26.  * Esito di un processo di autenticazione.
  27.  *
  28.  * @author Andrea Poli (apoli@link.it)
  29.  * @author $Author$
  30.  * @version $Rev$, $Date$
  31.  */
  32. public class EsitoAutenticazionePortaDelegata extends EsitoAutenticazione {

  33.    
  34.     /**
  35.      *
  36.      */
  37.     private static final long serialVersionUID = 1L;
  38.    
  39.    
  40.     /** IDServizioApplicativo */
  41.     private IDServizioApplicativo idServizioApplicativo;
  42.    
  43.     public IDServizioApplicativo getIdServizioApplicativo() {
  44.         return this.idServizioApplicativo;
  45.     }

  46.     public void setIdServizioApplicativo(IDServizioApplicativo idServizioApplicativo) {
  47.         this.idServizioApplicativo = idServizioApplicativo;
  48.     }

  49.    
  50.     /** IntegrationFunctionError */
  51.     private IntegrationFunctionError integrationFunctionError;
  52.    
  53.     public IntegrationFunctionError getIntegrationFunctionError() {
  54.         return this.integrationFunctionError;
  55.     }

  56.        

  57.     /** codice di errore */
  58.     private ErroreIntegrazione erroreIntegrazione;

  59.     public ErroreIntegrazione getErroreIntegrazione() {
  60.         return this.erroreIntegrazione;
  61.     }

  62.     public void setErroreIntegrazione(IntegrationFunctionError integrationFunctionError, ErroreIntegrazione erroreIntegrazione) {
  63.         this.integrationFunctionError = integrationFunctionError;
  64.         this.erroreIntegrazione = erroreIntegrazione;
  65.     }


  66.     @Override
  67.     public String getHeader(){
  68.         StringBuilder bf = new StringBuilder(super.getHeader());
  69.         if(this.idServizioApplicativo!=null){
  70.             bf.append(" IDServizioApplicativo");
  71.             if(this.idServizioApplicativo.getIdSoggettoProprietario()!=null){
  72.                 bf.append(" IDSoggetto(");
  73.                 bf.append(this.idServizioApplicativo.getIdSoggettoProprietario().toString());
  74.                 bf.append(")");
  75.             }
  76.             bf.append(":");
  77.             bf.append(this.idServizioApplicativo.getNome());
  78.         }
  79.         if(this.erroreIntegrazione!=null){
  80.             bf.append(" ErroreIntegrazione(");
  81.             bf.append(this.erroreIntegrazione.getCodiceErrore().name());
  82.             bf.append("):");
  83.             bf.append(this.erroreIntegrazione.getDescrizioneRawValue());
  84.         }
  85.         return bf.toString();
  86.     }
  87. }