EsitoTransazione.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.sdk.builder;

  21. import org.openspcoop2.protocol.sdk.ProtocolException;
  22. import org.openspcoop2.protocol.sdk.constants.CostantiProtocollo;
  23. import org.openspcoop2.protocol.sdk.constants.EsitoTransazioneName;

  24. /**
  25. * EsitoTransazione
  26. *
  27. * @author Andrea Poli (apoli@link.it)
  28.  * @author $Author$
  29.  * @version $Rev$, $Date$
  30. */
  31. public class EsitoTransazione {

  32.     public static EsitoTransazione ESITO_TRANSAZIONE_ERROR = null;
  33.     static{
  34.         ESITO_TRANSAZIONE_ERROR = new EsitoTransazione();
  35.         ESITO_TRANSAZIONE_ERROR.code = 5;
  36.         ESITO_TRANSAZIONE_ERROR.contextType = CostantiProtocollo.ESITO_TRANSACTION_CONTEXT_STANDARD;
  37.         ESITO_TRANSAZIONE_ERROR.name=EsitoTransazioneName.ERRORE_PROCESSAMENTO_PDD_5XX;
  38.     }
  39.    
  40.     private EsitoTransazioneName name;
  41.     private Integer code;
  42.     private String contextType;
  43.        
  44.     private EsitoTransazione(){}
  45.     public EsitoTransazione(EsitoTransazioneName name,Integer code,String contextType) throws ProtocolException{
  46.         if(name==null){
  47.             throw new ProtocolException("Parameter name is null");
  48.         }
  49.         if(code==null){
  50.             throw new ProtocolException("Parameter code is null");
  51.         }
  52.         if(contextType==null){
  53.             throw new ProtocolException("Parameter contextType is null");
  54.         }
  55.         this.name = name;
  56.         this.code = code;
  57.         this.contextType = contextType;
  58.     }
  59.    
  60.     public EsitoTransazioneName getName() {
  61.         return this.name;
  62.     }
  63.     public void setName(EsitoTransazioneName name) {
  64.         this.name = name;
  65.     }
  66.     public Integer getCode() {
  67.         return this.code;
  68.     }
  69.     public void setCode(Integer code) {
  70.         this.code = code;
  71.     }
  72.     public String getContextType() {
  73.         return this.contextType;
  74.     }
  75.     public void setContextType(String contextType) {
  76.         this.contextType = contextType;
  77.     }
  78.    
  79. }