EsitoAutenticazionePortaApplicativa.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.pa;

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

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

  35.    
  36.     /**
  37.      *
  38.      */
  39.     private static final long serialVersionUID = 1L;
  40.    
  41.    
  42.     /** IDSoggetto */
  43.     private IDSoggetto idSoggetto;
  44.    
  45.     public IDSoggetto getIdSoggetto() {
  46.         return this.idSoggetto;
  47.     }

  48.     public void setIdSoggetto(IDSoggetto idSoggetto) {
  49.         this.idSoggetto = idSoggetto;
  50.     }
  51.    
  52.     /** IDServizioApplicativo */
  53.     private IDServizioApplicativo idServizioApplicativo;
  54.    
  55.     public IDServizioApplicativo getIdServizioApplicativo() {
  56.         return this.idServizioApplicativo;
  57.     }

  58.     public void setIdServizioApplicativo(IDServizioApplicativo idServizioApplicativo) {
  59.         this.idServizioApplicativo = idServizioApplicativo;
  60.     }

  61.    
  62.     /** IntegrationFunctionError */
  63.     private IntegrationFunctionError integrationFunctionError;
  64.    
  65.     public IntegrationFunctionError getIntegrationFunctionError() {
  66.         return this.integrationFunctionError;
  67.     }

  68.    
  69.     /** codice di errore */
  70.     private ErroreCooperazione erroreCooperazione;

  71.     public ErroreCooperazione getErroreCooperazione() {
  72.         return this.erroreCooperazione;
  73.     }

  74.     public void setErroreCooperazione(IntegrationFunctionError integrationFunctionError, ErroreCooperazione erroreCooperazione) {
  75.         this.integrationFunctionError = integrationFunctionError;
  76.         this.erroreCooperazione = erroreCooperazione;
  77.     }
  78.    
  79.    
  80.     /** codice di errore */
  81.     private ErroreIntegrazione erroreIntegrazione;

  82.     public ErroreIntegrazione getErroreIntegrazione() {
  83.         return this.erroreIntegrazione;
  84.     }

  85.     public void setErroreIntegrazione(IntegrationFunctionError integrationFunctionError, ErroreIntegrazione erroreIntegrazione) {
  86.         this.integrationFunctionError = integrationFunctionError;
  87.         this.erroreIntegrazione = erroreIntegrazione;
  88.     }
  89.    

  90.     @Override
  91.     public String getHeader(){
  92.         StringBuilder bf = new StringBuilder(super.getHeader());
  93.         if(this.idSoggetto!=null){
  94.             bf.append(" IDSoggetto");
  95.             bf.append(this.idSoggetto.toString());
  96.         }
  97.         if(this.idServizioApplicativo!=null){
  98.             bf.append(" IDServizioApplicativo");
  99.             if(this.idServizioApplicativo.getIdSoggettoProprietario()!=null && this.idSoggetto==null){
  100.                 bf.append(" IDSoggetto(");
  101.                 bf.append(this.idServizioApplicativo.getIdSoggettoProprietario().toString());
  102.                 bf.append(")");
  103.             }
  104.             bf.append(":");
  105.             bf.append(this.idServizioApplicativo.getNome());
  106.         }
  107.         if(this.erroreCooperazione!=null){
  108.             bf.append(" ErroreCooperazione(");
  109.             bf.append(this.erroreCooperazione.getCodiceErrore().name());
  110.             bf.append("):");
  111.             bf.append(this.erroreCooperazione.getDescrizioneRawValue());
  112.         }
  113.         if(this.erroreIntegrazione!=null){
  114.             bf.append(" ErroreIntegrazione(");
  115.             bf.append(this.erroreIntegrazione.getCodiceErrore().name());
  116.             bf.append("):");
  117.             bf.append(this.erroreIntegrazione.getDescrizioneRawValue());
  118.         }
  119.         return bf.toString();
  120.     }
  121. }