MessageSecuritySender.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.security.message.engine;

  21. import org.openspcoop2.message.OpenSPCoop2Message;
  22. import org.openspcoop2.protocol.sdk.constants.CodiceErroreCooperazione;
  23. import org.openspcoop2.security.message.MessageSecurityContext;



  24. /**
  25.  * Classe per la gestione della Sicurezza (role:Sender)
  26.  *
  27.  * @author Spadafora Marcello (Ma.Spadafora@finsiel.it)
  28.  * @author $Author$
  29.  * @version $Rev$, $Date$
  30.  */

  31. public abstract class MessageSecuritySender {
  32.    
  33.     //private boolean mtomEnabled; //???
  34.     protected boolean mustUnderstandTrue = false;
  35.     /** Eventuale messaggio di errore avvenuto durante il processo di validazione */
  36.     protected String msgErrore;
  37.     /** Eventuale codice di errore avvenuto durante il processo di validazione  */
  38.     protected CodiceErroreCooperazione codiceErrore;
  39.     /** Contiene il message Context */
  40.     protected MessageSecurityContext messageSecurityContext;

  41.     protected MessageSecuritySender(MessageSecurityContext securityContext) {
  42.         this.messageSecurityContext = securityContext;
  43.     }

  44.    

  45.     /**
  46.      * In caso di avvenuto errore durante il processo di validazione,
  47.      * questo metodo ritorna il motivo dell'errore.
  48.      *
  49.      * @return motivo dell'errore (se avvenuto).
  50.      *
  51.      */
  52.     protected String getMsgErrore(){
  53.         return this.msgErrore;
  54.     }

  55.     /**
  56.      * In caso di avvenuto errore, questo metodo ritorna il codice dell'errore.
  57.      *
  58.      * @return codice dell'errore (se avvenuto).
  59.      *
  60.      */
  61.     protected CodiceErroreCooperazione getCodiceErrore(){
  62.         return this.codiceErrore;
  63.     }
  64.    
  65.     protected abstract boolean process(OpenSPCoop2Message message, org.openspcoop2.utils.Map<Object> ctx);
  66. }