AbstractTransaction.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.utils.logger.beans.context.core;

  21. import java.io.Serializable;
  22. import java.util.ArrayList;
  23. import java.util.List;

  24. import org.openspcoop2.utils.logger.constants.context.Context;
  25. import org.openspcoop2.utils.logger.constants.context.Result;

  26. /**
  27.  * AbstractTransaction
  28.  *
  29.  * @author Poli Andrea (apoli@link.it)
  30.  * @author $Author$
  31.  * @version $Rev$, $Date$
  32.  */
  33. public abstract class AbstractTransaction implements Serializable {

  34.     /**
  35.      *
  36.      */
  37.     private static final long serialVersionUID = 1L;
  38.    
  39.     private String conversionId; // per marcare la transazione appartenente ad uno stato condiviso tra più transazioni
  40.    
  41.     private Result result;
  42.     private Context context; // contesto della transazione
  43.    
  44.     private String domain;
  45.     private Role role;
  46.    
  47.     private Actor from;
  48.     private Actor to;
  49.    
  50.     private Service service;
  51.     private Operation operation;
  52.    
  53.     private String clusterId;
  54.    
  55.     private String protocol; // indicare un protocollo applicativo a cui appartiene il messaggio
  56.    
  57.     private List<String> events = new ArrayList<>(); // eventi a cui appartiene la transazione
  58.        
  59.     public String getConversationId() {
  60.         return this.conversionId;
  61.     }

  62.     public void setConversationId(String conversionId) {
  63.         this.conversionId = conversionId;
  64.     }

  65.     public Result getResult() {
  66.         return this.result;
  67.     }

  68.     public void setResult(Result result) {
  69.         this.result = result;
  70.     }

  71.     public String getDomain() {
  72.         return this.domain;
  73.     }

  74.     public void setDomain(String domain) {
  75.         this.domain = domain;
  76.     }

  77.     public Role getRole() {
  78.         return this.role;
  79.     }

  80.     public void setRole(Role role) {
  81.         this.role = role;
  82.     }

  83.     public Actor getFrom() {
  84.         return this.from;
  85.     }

  86.     public void setFrom(Actor from) {
  87.         this.from = from;
  88.     }

  89.     public Actor getTo() {
  90.         return this.to;
  91.     }

  92.     public void setTo(Actor to) {
  93.         this.to = to;
  94.     }

  95.     public Service getService() {
  96.         return this.service;
  97.     }

  98.     public void setService(Service service) {
  99.         this.service = service;
  100.     }

  101.     public Operation getOperation() {
  102.         return this.operation;
  103.     }

  104.     public void setOperation(Operation operation) {
  105.         this.operation = operation;
  106.     }

  107.     public String getClusterId() {
  108.         return this.clusterId;
  109.     }

  110.     public void setClusterId(String clusterId) {
  111.         this.clusterId = clusterId;
  112.     }
  113.    
  114.     public Context getContext() {
  115.         return this.context;
  116.     }

  117.     public void setContext(Context context) {
  118.         this.context = context;
  119.     }

  120.     public String getProtocol() {
  121.         return this.protocol;
  122.     }

  123.     public void setProtocol(String protocol) {
  124.         this.protocol = protocol;
  125.     }
  126.    
  127.     public List<String> getEvents() {
  128.         return this.events;
  129.     }
  130.    
  131.     public void addEvent(String event){
  132.         this.events.add(event);
  133.     }
  134. }