EsitoLib.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.mdb;

  21. import java.util.Date;

  22. /**
  23.  *
  24.  * Incapsula l'esito dell'invocazione del metodo OnMessage delle Librerie
  25.  * @author Tronci Fabio (tronci@link.it)
  26.  * @author $Author$
  27.  * @version $Rev$, $Date$
  28.  *
  29.  */
  30. public class EsitoLib {

  31.     public static final int OK = 1;
  32.     public static final int ERRORE_GESTITO = 2;
  33.     public static final int ERRORE_NON_GESTITO = 3;
  34.    
  35.     private Throwable erroreNonGestito = null;
  36.     private String motivazioneErroreNonGestito = null;
  37.    
  38.     private int statoInvocazione = 0;
  39.    
  40.     private boolean esitoInvocazione = false;

  41.     private boolean erroreProcessamentoMessaggioAggiornato = false;
  42.     private Date dataRispedizioneAggiornata;

  43.     public EsitoLib(){
  44.         setEsitoInvocazione(false);
  45.     }
  46.    
  47.    
  48.     public Date getDataRispedizioneAggiornata() {
  49.         return this.dataRispedizioneAggiornata;
  50.     }
  51.    
  52.     public void setDataRispedizioneAggiornata(Date dataRispedizioneAggiornata) {
  53.         this.dataRispedizioneAggiornata = dataRispedizioneAggiornata;
  54.     }
  55.    
  56.     public String getMotivazioneErroreNonGestito() {
  57.         return this.motivazioneErroreNonGestito;
  58.     }

  59.     public Throwable getErroreNonGestito() {
  60.         return this.erroreNonGestito;
  61.     }

  62.     public void setErroreNonGestito(Exception erroreNonGestito) {
  63.         this.erroreNonGestito = erroreNonGestito;
  64.     }
  65.    
  66.     public boolean isErroreProcessamentoMessaggioAggiornato() {
  67.         return this.erroreProcessamentoMessaggioAggiornato;
  68.     }

  69.     public void setErroreProcessamentoMessaggioAggiornato(
  70.             boolean erroreProcessamentoMessaggioAggiornato) {
  71.         this.erroreProcessamentoMessaggioAggiornato = erroreProcessamentoMessaggioAggiornato;
  72.     }
  73.        
  74.     public boolean isEsitoInvocazione() {
  75.         return this.esitoInvocazione;
  76.     }

  77.     public void setEsitoInvocazione(boolean esitoInvocazione) {
  78.         this.esitoInvocazione = esitoInvocazione;
  79.     }

  80.     public int getStatoInvocazione() {
  81.         return this.statoInvocazione;
  82.     }

  83.     public void setStatoInvocazione(int statoInvocazione,String motivazioneErroreNonGestito) {
  84.         this.statoInvocazione = statoInvocazione;
  85.         this.motivazioneErroreNonGestito = motivazioneErroreNonGestito;
  86.     }
  87.     @Deprecated
  88.     public void setStatoInvocazione(int statoInvocazione) {
  89.         this.statoInvocazione = statoInvocazione;
  90.     }
  91.    
  92.     public void setStatoInvocazioneErroreNonGestito(Throwable e) {
  93.         this.statoInvocazione = EsitoLib.ERRORE_NON_GESTITO;
  94.         this.erroreNonGestito = e;
  95.     }
  96.    
  97. }