OpenSPCoopStateful.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.state;

  21. import org.openspcoop2.protocol.sdk.state.StateMap;
  22. import org.openspcoop2.protocol.sdk.state.StatefulMessage;
  23. import org.openspcoop2.utils.UtilsException;


  24. /**
  25.  * Oggetto che rappresenta lo stato di una richiesta/risposta all'interno della PdD
  26.  *
  27.  * @author Poli Andrea (apoli@link.it)
  28.  * @author Fabio Tronci (tronci@link.it)
  29.  * @author $Author$
  30.  * @version $Rev$, $Date$
  31.  */
  32. public class OpenSPCoopStateful extends OpenSPCoopState {
  33.    
  34.    
  35.    
  36.     /* ---------- Costruttori  ----------*/
  37.     public OpenSPCoopStateful(){
  38.         this.useConnection = true;
  39.     }
  40.    
  41.    
  42.    
  43.    
  44.    
  45.     /* ----------- Init resource ------------*/

  46.     @Override
  47.     public void updateStatoRichiesta() throws UtilsException{
  48.        
  49.         StateMap pstmt = null;
  50.         if(this.richiestaStato!=null && this.richiestaStato.getPreparedStatement()!=null)
  51.             pstmt = this.richiestaStato.getPreparedStatement();
  52.         this.richiestaStato = new StatefulMessage(this.connectionDB,this.logger);
  53.         if(pstmt!=null){
  54.             this.richiestaStato.addPreparedStatement(pstmt.getPreparedStatement());
  55.         }
  56.     }
  57.     @Override
  58.     public void updateStatoRisposta() throws UtilsException{
  59.        
  60.         StateMap pstmt = null;
  61.         if(this.rispostaStato!=null && this.rispostaStato.getPreparedStatement()!=null)
  62.             pstmt = this.rispostaStato.getPreparedStatement();
  63.         this.rispostaStato = new StatefulMessage(this.connectionDB,this.logger);
  64.         if(pstmt!=null){
  65.             this.rispostaStato.addPreparedStatement(pstmt.getPreparedStatement());
  66.         }
  67.     }
  68.    

  69.    
  70. }