Transaction.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.transazioni;


  21. import java.util.ArrayList;
  22. import java.util.Date;
  23. import java.util.List;

  24. import org.openspcoop2.core.transazioni.constants.TipoMessaggio;
  25. import org.openspcoop2.core.transazioni.utils.CredenzialiMittente;
  26. import org.openspcoop2.core.transazioni.utils.TempiElaborazione;
  27. import org.openspcoop2.monitor.engine.config.TransactionResource;
  28. import org.openspcoop2.monitor.engine.config.TransactionServiceLibrary;
  29. import org.openspcoop2.pdd.core.token.InformazioniNegoziazioneToken;
  30. import org.openspcoop2.pdd.core.token.InformazioniToken;
  31. import org.openspcoop2.pdd.core.token.attribute_authority.InformazioniAttributi;
  32. import org.openspcoop2.protocol.sdk.diagnostica.MsgDiagnostico;
  33. import org.openspcoop2.protocol.sdk.dump.Messaggio;
  34. import org.openspcoop2.protocol.sdk.state.RequestInfo;
  35. import org.openspcoop2.protocol.sdk.tracciamento.Traccia;
  36. import org.openspcoop2.utils.SemaphoreLock;
  37. import org.openspcoop2.utils.UtilsRuntimeException;
  38. import org.openspcoop2.utils.date.DateUtils;

  39. /**    
  40.  * Transaction
  41.  *
  42.  * @author Poli Andrea (poli@link.it)
  43.  * @author $Author$
  44.  * @version $Rev$, $Date$
  45.  */
  46. public class Transaction {

  47.     private static final String TRANSACION_DELETED = "Transaction eliminata";
  48.    
  49.     private boolean gestioneStateful = false;
  50.     private String id = null;
  51.     private String originator = null;
  52.     public Transaction(String id, String originator, boolean gestioneStateful){
  53.         this.id = id;
  54.         this.originator = originator;
  55.         this.gestioneStateful = gestioneStateful;
  56.     }
  57.     public String getId() {
  58.         return this.id;
  59.     }
  60.    
  61.     /** Indicazione se la transazione e' stata gestita (e quindi non piu' ulteriormente arricchibile) tramite le set e add */
  62.     private org.openspcoop2.utils.Semaphore semaphore = new org.openspcoop2.utils.Semaphore("Transaction_gestioneStateful");
  63.     private Boolean deleted = false;
  64.     public void setDeleted() {
  65.         if(this.gestioneStateful) {
  66.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setDeleted");
  67.             try {
  68.                 this.deleted = true;    
  69.             }finally {
  70.                 this.semaphore.release(lock, "setDeleted");
  71.             }
  72.         }
  73.         else {
  74.             this.deleted = true;
  75.         }
  76.     }
  77.    
  78.     /** RequestInfo */
  79.     private RequestInfo requestInfo;
  80.    
  81.     /** urlInvocazione */
  82.     private String urlInvocazione;
  83.    
  84.     /** traccia richiesta */
  85.     private Traccia tracciaRichiesta;
  86.    
  87.     /** traccia risposta */
  88.     private Traccia tracciaRisposta;
  89.    
  90.     /** Messaggi diagnostici */
  91.     private List<MsgDiagnostico> msgDiagnostici = new ArrayList<>();
  92.    
  93.     /** DumpMessaggi */
  94.     private List<Messaggio> messaggi = new ArrayList<>();
  95.     private List<TipoMessaggio> messaggiBodyOnlyLogFileTrace = new ArrayList<>();
  96.     private List<TipoMessaggio> messaggiHeadersOnlyLogFileTrace = new ArrayList<>();
  97.    
  98.     /** Scenario di cooperazione */
  99.     private String scenarioCooperazione;
  100.    
  101.     /** Codice trasporto richiesta */
  102.     private String codiceTrasportoRichiesta;
  103.    
  104.     /** Location */
  105.     private String location;
  106.    
  107.     /** Tipo di connettore utilizzato */
  108.     private String tipoConnettore;
  109.    
  110.     /** Credenziali */
  111.     private String credenziali;
  112.    
  113.     /** SOAPFault */
  114.     private String faultIntegrazione;
  115.     private String formatoFaultIntegrazione;
  116.     private String faultCooperazione;
  117.     private String formatoFaultCooperazione;
  118.    
  119.     /** CorrelazioneApplicativaRisposta */
  120.     private String correlazioneApplicativaRisposta;
  121.    
  122.     /** ServizioApplicativoErogatore */
  123.     private List<String> serviziApplicativiErogatore = new ArrayList<>();
  124.    
  125.     /** Tempo di accettazione del messaggio iniziale */
  126.     private Date dataAccettazioneRichiesta;
  127.     /** Tempo in ingresso del messaggio iniziale */
  128.     private Date dataIngressoRichiesta;
  129.     /** Tempo in uscita del messaggio iniziale */
  130.     private Date dataUscitaRichiesta;
  131.     /** Tempo in uscita del messaggio quando รจ stata completamente inviata */
  132.     private Date dataRichiestaInoltrata;
  133.     /** Tempo di accettazione del messaggio di risposta */
  134.     private Date dataAccettazioneRisposta;
  135.     /** Tempo in ingresso del messaggio di risposta */
  136.     private Date dataIngressoRisposta;
  137.     /** Tempo in uscita del messaggio di risposta */
  138.     private Date dataUscitaRisposta;

  139.     /** Indicazione se la busta e' duplicata */
  140.     private List<String> idProtocolloDuplicati = new ArrayList<>();
  141.    
  142.     /** Stato */
  143.     private String stato = null;
  144.    
  145.     /** Contenuti della Transazione */
  146.     private List<TransactionResource> risorse = new ArrayList<>();
  147.     private TransactionServiceLibrary transactionServiceLibrary;
  148.    
  149.     /** EventiGestione */
  150.     private List<String> eventiGestione = new ArrayList<>();
  151.    
  152.     /** InformazioniToken */
  153.     private InformazioniToken informazioniToken;
  154.    
  155.     /** InformazioniAttributi */
  156.     private InformazioniAttributi informazioniAttributi;
  157.    
  158.     /** InformazioniNegoziazioneToken */
  159.     private InformazioniNegoziazioneToken informazioniNegoziazioneToken;
  160.    
  161.     /** CredenzialiMittente */
  162.     private CredenzialiMittente credenzialiMittente;
  163.    
  164.     /** TempiElaborazione */
  165.     private TempiElaborazione tempiElaborazione = new TempiElaborazione();
  166.    

  167.     /** GET */
  168.    
  169.     public RequestInfo getRequestInfo() {
  170.         return this.requestInfo;
  171.     }
  172.    
  173.     public String getUrlInvocazione() {
  174.         return this.urlInvocazione;
  175.     }
  176.    
  177.     public Traccia getTracciaRichiesta() {
  178.         return this.tracciaRichiesta;
  179.     }
  180.    
  181.     public Traccia getTracciaRisposta() {
  182.         return this.tracciaRisposta;
  183.     }

  184.     public List<MsgDiagnostico> getMsgDiagnostici() {
  185.         return this.msgDiagnostici;
  186.     }
  187.    
  188.     public int sizeMsgDiagnostici(){
  189.         return this.msgDiagnostici.size();
  190.     }
  191.    
  192.     public MsgDiagnostico getMsgDiagnostico(int index){
  193.         return this.msgDiagnostici.get(index);
  194.     }
  195.    
  196.     public MsgDiagnostico removeMsgDiagnostico(int index) {
  197.         return this.msgDiagnostici.remove(index);
  198.     }
  199.    
  200.     public List<Messaggio> getMessaggi() {
  201.         return this.messaggi;
  202.     }
  203.     public List<TipoMessaggio> getMessaggiBodyOnlyLogFileTrace() {
  204.         return this.messaggiBodyOnlyLogFileTrace;
  205.     }
  206.     public List<TipoMessaggio> getMessaggiHeadersOnlyLogFileTrace() {
  207.         return this.messaggiHeadersOnlyLogFileTrace;
  208.     }
  209.    
  210.     public int sizeMessaggi(){
  211.         return this.messaggi.size();
  212.     }
  213.    
  214.     public Messaggio getMessaggio(int index){
  215.         return this.messaggi.get(index);
  216.     }
  217.    
  218.     public Messaggio removeMessaggio(int index) {
  219.         return this.messaggi.remove(index);
  220.     }
  221.    
  222.     public String getScenarioCooperazione() {
  223.         return this.scenarioCooperazione;
  224.     }
  225.    
  226.     public String getCodiceTrasportoRichiesta() {
  227.         return this.codiceTrasportoRichiesta;
  228.     }
  229.    
  230.     public String getLocation() {
  231.         return this.location;
  232.     }
  233.    
  234.     public String getTipoConnettore() {
  235.         return this.tipoConnettore;
  236.     }
  237.    
  238.     public String getCredenziali() {
  239.         return this.credenziali;
  240.     }
  241.    
  242.     public String getFaultIntegrazione() {
  243.         return this.faultIntegrazione;
  244.     }
  245.     public String getFormatoFaultIntegrazione() {
  246.         return this.formatoFaultIntegrazione;
  247.     }
  248.     public String getFaultCooperazione() {
  249.         return this.faultCooperazione;
  250.     }
  251.     public String getFormatoFaultCooperazione() {
  252.         return this.formatoFaultCooperazione;
  253.     }
  254.    
  255.     public Date getDataAccettazioneRichiesta() {
  256.         return this.dataAccettazioneRichiesta;
  257.     }
  258.    
  259.     public Date getDataIngressoRichiesta() {
  260.         return this.dataIngressoRichiesta;
  261.     }
  262.    
  263.     public Date getDataUscitaRichiesta() {
  264.         return this.dataUscitaRichiesta;
  265.     }
  266.    
  267.     public Date getDataRichiestaInoltrata() {
  268.         return this.dataRichiestaInoltrata;
  269.     }
  270.    
  271.     public Date getDataAccettazioneRisposta() {
  272.         return this.dataAccettazioneRisposta;
  273.     }
  274.    
  275.     public Date getDataIngressoRisposta() {
  276.         return this.dataIngressoRisposta;
  277.     }
  278.    
  279.     public Date getDataUscitaRisposta() {
  280.         return this.dataUscitaRisposta;
  281.     }
  282.    
  283.     public String getCorrelazioneApplicativaRisposta() {
  284.         return this.correlazioneApplicativaRisposta;
  285.     }
  286.    
  287.     public List<String> getServiziApplicativiErogatore() {
  288.         return this.serviziApplicativiErogatore;
  289.     }
  290.    
  291.     public List<String> getEventiGestione() {
  292.         return this.eventiGestione;
  293.     }
  294.    
  295.     public boolean containsEventoGestione(String evento){
  296.         return this.eventiGestione.contains(evento);
  297.     }
  298.    
  299.     public InformazioniToken getInformazioniToken() {
  300.         return this.informazioniToken;
  301.     }
  302.    
  303.     public InformazioniAttributi getInformazioniAttributi() {
  304.         return this.informazioniAttributi;
  305.     }
  306.    
  307.     public InformazioniNegoziazioneToken getInformazioniNegoziazioneToken() {
  308.         return this.informazioniNegoziazioneToken;
  309.     }
  310.    
  311.     public CredenzialiMittente getCredenzialiMittente() {
  312.         return this.credenzialiMittente;
  313.     }
  314.    
  315.     // NOTA: Per adesso la funzionalitร  dei tempi di elaborazione vale solamente in comunicazioni stateless
  316.     public TempiElaborazione getTempiElaborazione() {
  317.         return this.tempiElaborazione;
  318.     }
  319.    
  320.    
  321.     /** SET
  322.      * @throws TransactionDeletedException */
  323.    
  324.     public void setRequestInfo(RequestInfo requestInfo) throws TransactionDeletedException {
  325.         if(this.gestioneStateful){
  326.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setRequestInfo");
  327.             try {
  328.                 if(this.deleted!=null && this.deleted.booleanValue()){
  329.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  330.                 }
  331.                 this.requestInfo = requestInfo;
  332.             }finally {
  333.                 this.semaphore.release(lock, "setRequestInfo");
  334.             }
  335.         }else{
  336.             this.requestInfo = requestInfo;
  337.         }
  338.     }
  339.    
  340.     public void setUrlInvocazione(String urlInvocazione) throws TransactionDeletedException {
  341.         if(this.gestioneStateful){
  342.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setUrlInvocazione");
  343.             try {
  344.                 if(this.deleted!=null && this.deleted.booleanValue()){
  345.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  346.                 }
  347.                 this.urlInvocazione = urlInvocazione;
  348.             }finally {
  349.                 this.semaphore.release(lock, "setUrlInvocazione");
  350.             }
  351.         }else{
  352.             this.urlInvocazione = urlInvocazione;
  353.         }
  354.     }
  355.    
  356.     public void setTracciaRichiesta(Traccia tracciaRichiesta) throws TransactionDeletedException {
  357.         if(this.gestioneStateful){
  358.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setTracciaRichiesta");
  359.             try {
  360.                 if(this.deleted!=null && this.deleted.booleanValue()){
  361.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  362.                 }
  363.                 this.tracciaRichiesta = tracciaRichiesta;
  364.             }finally {
  365.                 this.semaphore.release(lock, "setTracciaRichiesta");
  366.             }
  367.         }else{
  368.             this.tracciaRichiesta = tracciaRichiesta;
  369.         }
  370.     }

  371.     public void setTracciaRisposta(Traccia tracciaRisposta) throws TransactionDeletedException {
  372.         if(this.gestioneStateful){
  373.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setTracciaRisposta");
  374.             try {
  375.                 if(this.deleted!=null && this.deleted.booleanValue()){
  376.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  377.                 }
  378.                 this.tracciaRisposta = tracciaRisposta;
  379.             }finally {
  380.                 this.semaphore.release(lock, "setTracciaRisposta");
  381.             }
  382.         }else{
  383.             this.tracciaRisposta = tracciaRisposta;
  384.         }
  385.     }
  386.    
  387.     public void addMsgDiagnostico(MsgDiagnostico msgDiag) throws TransactionDeletedException {
  388.         if(this.gestioneStateful){
  389.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("addMsgDiagnostico");
  390.             try {
  391.                 if(this.deleted!=null && this.deleted.booleanValue()){
  392.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  393.                 }
  394.                 this.msgDiagnostici.add(msgDiag);
  395.             }finally {
  396.                 this.semaphore.release(lock, "addMsgDiagnostico");
  397.             }
  398.         }else{
  399.             this.msgDiagnostici.add(msgDiag);
  400.         }
  401.     }
  402.    
  403.     public void addMessaggio(Messaggio messaggio, boolean onlyLogFileTraceHeaders,  boolean onlyLogFileTraceBody) throws TransactionDeletedException {
  404.         if(this.gestioneStateful){
  405.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("addMessaggio");
  406.             try {
  407.                 if(this.deleted!=null && this.deleted.booleanValue()){
  408.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  409.                 }
  410.                 this.messaggi.add(messaggio);
  411.                 if(onlyLogFileTraceHeaders) {
  412.                     this.messaggiHeadersOnlyLogFileTrace.add(messaggio.getTipoMessaggio());
  413.                 }
  414.                 if(onlyLogFileTraceBody) {
  415.                     this.messaggiBodyOnlyLogFileTrace.add(messaggio.getTipoMessaggio());
  416.                 }
  417.             }finally {
  418.                 this.semaphore.release(lock, "addMessaggio");
  419.             }
  420.         }else{
  421.             this.messaggi.add(messaggio);
  422.             if(onlyLogFileTraceHeaders) {
  423.                 this.messaggiHeadersOnlyLogFileTrace.add(messaggio.getTipoMessaggio());
  424.             }
  425.             if(onlyLogFileTraceBody) {
  426.                 this.messaggiBodyOnlyLogFileTrace.add(messaggio.getTipoMessaggio());
  427.             }
  428.         }
  429.     }

  430.     public void setScenarioCooperazione(String scenarioCooperazione) throws TransactionDeletedException {
  431.         if(this.gestioneStateful){
  432.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setScenarioCooperazione");
  433.             try {
  434.                 if(this.deleted!=null && this.deleted.booleanValue()){
  435.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  436.                 }
  437.                 this.scenarioCooperazione = scenarioCooperazione;
  438.             }finally {
  439.                 this.semaphore.release(lock, "setScenarioCooperazione");
  440.             }
  441.         }else{
  442.             this.scenarioCooperazione = scenarioCooperazione;
  443.         }
  444.     }
  445.    
  446.     public void setCodiceTrasportoRichiesta(String codiceTrasportoRichiesta) throws TransactionDeletedException {
  447.         if(this.gestioneStateful){
  448.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setCodiceTrasportoRichiesta");
  449.             try {
  450.                 if(this.deleted!=null && this.deleted.booleanValue()){
  451.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  452.                 }
  453.                 this.codiceTrasportoRichiesta = codiceTrasportoRichiesta;
  454.             }finally {
  455.                 this.semaphore.release(lock, "setCodiceTrasportoRichiesta");
  456.             }
  457.         }else{
  458.             this.codiceTrasportoRichiesta = codiceTrasportoRichiesta;
  459.         }
  460.     }
  461.    
  462.     public void setLocation(String location) throws TransactionDeletedException {
  463.         if(this.gestioneStateful){
  464.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setLocation");
  465.             try {
  466.                 if(this.deleted!=null && this.deleted.booleanValue()){
  467.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  468.                 }
  469.                 this.location = location;
  470.             }finally {
  471.                 this.semaphore.release(lock, "setLocation");
  472.             }
  473.         }else{
  474.             this.location = location;
  475.         }
  476.     }
  477.    
  478.     public void setTipoConnettore(String tipoConnettore) throws TransactionDeletedException {
  479.         if(this.gestioneStateful){
  480.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setTipoConnettore");
  481.             try {
  482.                 if(this.deleted!=null && this.deleted.booleanValue()){
  483.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  484.                 }
  485.                 this.tipoConnettore = tipoConnettore;
  486.             }finally {
  487.                 this.semaphore.release(lock, "setTipoConnettore");
  488.             }
  489.         }else{
  490.             this.tipoConnettore = tipoConnettore;
  491.         }
  492.     }
  493.    
  494.     public void setCredenziali(String credenziali) throws TransactionDeletedException {
  495.         if(this.gestioneStateful){
  496.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setCredenziali");
  497.             try {
  498.                 if(this.deleted!=null && this.deleted.booleanValue()){
  499.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  500.                 }
  501.                 this.credenziali = credenziali;
  502.             }finally {
  503.                 this.semaphore.release(lock, "setCredenziali");
  504.             }
  505.         }else{
  506.             this.credenziali = credenziali;
  507.         }
  508.     }

  509.     public void setFaultIntegrazione(String fault) throws TransactionDeletedException {
  510.         if(this.gestioneStateful){
  511.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setFaultIntegrazione");
  512.             try {
  513.                 if(this.deleted!=null && this.deleted.booleanValue()){
  514.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  515.                 }
  516.                 this.faultIntegrazione = fault;
  517.             }finally {
  518.                 this.semaphore.release(lock, "setFaultIntegrazione");
  519.             }
  520.         }else{
  521.             this.faultIntegrazione = fault;
  522.         }
  523.     }
  524.    
  525.     public void setFormatoFaultIntegrazione(String formatoFault) throws TransactionDeletedException {
  526.         if(this.gestioneStateful){
  527.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setFormatoFaultIntegrazione");
  528.             try {
  529.                 if(this.deleted!=null && this.deleted.booleanValue()){
  530.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  531.                 }
  532.                 this.formatoFaultIntegrazione = formatoFault;
  533.             }finally {
  534.                 this.semaphore.release(lock, "setFormatoFaultIntegrazione");
  535.             }
  536.         }else{
  537.             this.formatoFaultIntegrazione = formatoFault;
  538.         }
  539.     }
  540.    
  541.     public void setFaultCooperazione(String fault) throws TransactionDeletedException {
  542.         if(this.gestioneStateful){
  543.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setFaultCooperazione");
  544.             try {
  545.                 if(this.deleted!=null && this.deleted.booleanValue()){
  546.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  547.                 }
  548.                 this.faultCooperazione = fault;
  549.             }finally {
  550.                 this.semaphore.release(lock, "setFaultCooperazione");
  551.             }
  552.         }else{
  553.             this.faultCooperazione = fault;
  554.         }
  555.     }
  556.    
  557.     public void setFormatoFaultCooperazione(String formatoFault) throws TransactionDeletedException {
  558.         if(this.gestioneStateful){
  559.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setFormatoFaultCooperazione");
  560.             try {
  561.                 if(this.deleted!=null && this.deleted.booleanValue()){
  562.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  563.                 }
  564.                 this.formatoFaultCooperazione = formatoFault;
  565.             }finally {
  566.                 this.semaphore.release(lock, "setFormatoFaultCooperazione");
  567.             }
  568.         }else{
  569.             this.formatoFaultCooperazione = formatoFault;
  570.         }
  571.     }

  572.     public void setDataAccettazioneRichiesta(Date dataAccettazioneRichiesta) throws TransactionDeletedException {
  573.         if(this.gestioneStateful){
  574.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setDataAccettazioneRichiesta");
  575.             try {
  576.                 if(this.deleted!=null && this.deleted.booleanValue()){
  577.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  578.                 }
  579.                 this.dataAccettazioneRichiesta = dataAccettazioneRichiesta;
  580.             }finally {
  581.                 this.semaphore.release(lock, "setDataAccettazioneRichiesta");
  582.             }
  583.         }else{
  584.             this.dataAccettazioneRichiesta = dataAccettazioneRichiesta;
  585.         }
  586.     }
  587.    
  588.     public void setDataIngressoRichiesta(Date dataIngressoRichiesta) throws TransactionDeletedException {
  589.         if(this.gestioneStateful){
  590.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setDataIngressoRichiesta");
  591.             try {
  592.                 if(this.deleted!=null && this.deleted.booleanValue()){
  593.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  594.                 }
  595.                 this.dataIngressoRichiesta = dataIngressoRichiesta;
  596.             }finally {
  597.                 this.semaphore.release(lock, "setDataIngressoRichiesta");
  598.             }
  599.         }else{
  600.             this.dataIngressoRichiesta = dataIngressoRichiesta;
  601.         }
  602.     }

  603.     public void setDataUscitaRichiesta(Date dataUscitaRichiesta) throws TransactionDeletedException {
  604.         if(this.gestioneStateful){
  605.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setDataUscitaRichiesta");
  606.             try {
  607.                 if(this.deleted!=null && this.deleted.booleanValue()){
  608.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  609.                 }
  610.                 this.dataUscitaRichiesta = dataUscitaRichiesta;
  611.             }finally {
  612.                 this.semaphore.release(lock, "setDataUscitaRichiesta");
  613.             }
  614.         }else{
  615.             this.dataUscitaRichiesta = dataUscitaRichiesta;
  616.         }
  617.     }
  618.    
  619.     public void setDataRichiestaInoltrata(Date dataRichiestaInoltrata) throws TransactionDeletedException {
  620.         if(this.gestioneStateful){
  621.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setDataRichiestaInoltrata");
  622.             try {
  623.                 if(this.deleted!=null && this.deleted.booleanValue()){
  624.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  625.                 }
  626.                 this.dataRichiestaInoltrata = dataRichiestaInoltrata;
  627.             }finally {
  628.                 this.semaphore.release(lock, "setDataRichiestaInoltrata");
  629.             }
  630.         }else{
  631.             this.dataRichiestaInoltrata = dataRichiestaInoltrata;
  632.         }
  633.     }

  634.     public void setDataAccettazioneRisposta(Date dataAccettazioneRisposta) throws TransactionDeletedException {
  635.         if(this.gestioneStateful){
  636.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setDataAccettazioneRisposta");
  637.             try {
  638.                 if(this.deleted!=null && this.deleted.booleanValue()){
  639.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  640.                 }
  641.                 this.dataAccettazioneRisposta = dataAccettazioneRisposta;
  642.             }finally {
  643.                 this.semaphore.release(lock, "setDataAccettazioneRisposta");
  644.             }
  645.         }else{
  646.             this.dataAccettazioneRisposta = dataAccettazioneRisposta;
  647.         }
  648.     }
  649.    
  650.     public void setDataIngressoRisposta(Date dataIngressoRisposta) throws TransactionDeletedException {
  651.         if(this.gestioneStateful){
  652.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setDataIngressoRisposta");
  653.             try {
  654.                 if(this.deleted!=null && this.deleted.booleanValue()){
  655.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  656.                 }
  657.                 this.dataIngressoRisposta = dataIngressoRisposta;
  658.             }finally {
  659.                 this.semaphore.release(lock, "setDataIngressoRisposta");
  660.             }
  661.         }else{
  662.             this.dataIngressoRisposta = dataIngressoRisposta;
  663.         }
  664.     }

  665.     public void setDataUscitaRisposta(Date dataUscitaRisposta) throws TransactionDeletedException {
  666.         if(this.gestioneStateful){
  667.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setDataUscitaRisposta");
  668.             try {
  669.                 if(this.deleted!=null && this.deleted.booleanValue()){
  670.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  671.                 }
  672.                 this.dataUscitaRisposta = dataUscitaRisposta;
  673.             }finally {
  674.                 this.semaphore.release(lock, "setDataUscitaRisposta");
  675.             }
  676.         }else{
  677.             this.dataUscitaRisposta = dataUscitaRisposta;
  678.         }
  679.     }

  680.     public void setCorrelazioneApplicativaRisposta(
  681.             String correlazioneApplicativaRisposta) throws TransactionDeletedException {
  682.         if(this.gestioneStateful){
  683.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setCorrelazioneApplicativaRisposta");
  684.             try {
  685.                 if(this.deleted!=null && this.deleted.booleanValue()){
  686.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  687.                 }
  688.                 this.correlazioneApplicativaRisposta = correlazioneApplicativaRisposta;
  689.             }finally {
  690.                 this.semaphore.release(lock, "setCorrelazioneApplicativaRisposta");
  691.             }
  692.         }else{
  693.             this.correlazioneApplicativaRisposta = correlazioneApplicativaRisposta;
  694.         }
  695.     }
  696.    
  697.     public void addServizioApplicativoErogatore(String servizioApplicativoErogatore) throws TransactionDeletedException {
  698.         if(this.gestioneStateful){
  699.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("addServizioApplicativoErogatore");
  700.             try {
  701.                 if(this.deleted!=null && this.deleted.booleanValue()){
  702.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  703.                 }
  704.                 this.serviziApplicativiErogatore.add(servizioApplicativoErogatore);
  705.             }finally {
  706.                 this.semaphore.release(lock, "addServizioApplicativoErogatore");
  707.             }
  708.         }else{
  709.             this.serviziApplicativiErogatore.add(servizioApplicativoErogatore);
  710.         }
  711.     }
  712.    
  713.     public void addEventoGestione(String evento) throws TransactionDeletedException {
  714.         if(evento.contains(",")){
  715.             throw new UtilsRuntimeException("EventoGestione ["+evento+"] non deve contenere il carattere ','");
  716.         }
  717.         if(this.gestioneStateful){
  718.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("addEventoGestione");
  719.             try {
  720.                 if(this.deleted!=null && this.deleted.booleanValue()){
  721.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  722.                 }
  723.                 this.eventiGestione.add(evento);
  724.             }finally {
  725.                 this.semaphore.release(lock, "addEventoGestione");
  726.             }
  727.         }else{
  728.             this.eventiGestione.add(evento);
  729.         }
  730.     }
  731.    
  732.     public void setInformazioniToken(InformazioniToken informazioniToken) throws TransactionDeletedException {
  733.         if(this.gestioneStateful){
  734.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setInformazioniToken");
  735.             try {
  736.                 if(this.deleted!=null && this.deleted.booleanValue()){
  737.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  738.                 }
  739.                 this.informazioniToken = informazioniToken;
  740.             }finally {
  741.                 this.semaphore.release(lock, "setInformazioniToken");
  742.             }
  743.         }else{
  744.             this.informazioniToken = informazioniToken;
  745.         }
  746.     }
  747.    
  748.     public void setInformazioniAttributi(InformazioniAttributi informazioniAttributi) throws TransactionDeletedException {
  749.         if(this.gestioneStateful){
  750.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setInformazioniAttributi");
  751.             try {
  752.                 if(this.deleted!=null && this.deleted.booleanValue()){
  753.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  754.                 }
  755.                 this.informazioniAttributi = informazioniAttributi;
  756.             }finally {
  757.                 this.semaphore.release(lock, "setInformazioniAttributi");
  758.             }
  759.         }else{
  760.             this.informazioniAttributi = informazioniAttributi;
  761.         }
  762.     }
  763.    
  764.     public void setInformazioniNegoziazioneToken(InformazioniNegoziazioneToken informazioniNegoziazioneToken) throws TransactionDeletedException {
  765.         if(this.gestioneStateful){
  766.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setInformazioniNegoziazioneToken");
  767.             try {
  768.                 if(this.deleted!=null && this.deleted.booleanValue()){
  769.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  770.                 }
  771.                 this.informazioniNegoziazioneToken = informazioniNegoziazioneToken;
  772.             }finally {
  773.                 this.semaphore.release(lock, "setInformazioniNegoziazioneToken");
  774.             }
  775.         }else{
  776.             this.informazioniNegoziazioneToken = informazioniNegoziazioneToken;
  777.         }
  778.     }
  779.    
  780.     public void setCredenzialiMittente(CredenzialiMittente credenzialiMittente) throws TransactionDeletedException {
  781.         if(this.gestioneStateful){
  782.             SemaphoreLock lock = this.semaphore.acquireThrowRuntime("setCredenzialiMittente");
  783.             try {
  784.                 if(this.deleted!=null && this.deleted.booleanValue()){
  785.                     throw new TransactionDeletedException(TRANSACION_DELETED);
  786.                 }
  787.                 this.credenzialiMittente = credenzialiMittente;
  788.             }finally {
  789.                 this.semaphore.release(lock, "setCredenzialiMittente");
  790.             }
  791.         }else{
  792.             this.credenzialiMittente = credenzialiMittente;
  793.         }
  794.     }
  795.    
  796.     public void addIdProtocolloDuplicato(String idBusta){
  797.         this.idProtocolloDuplicati.add(idBusta);
  798.     }
  799.    
  800.     public boolean containsIdProtocolloDuplicato(String idBusta){
  801.         return this.idProtocolloDuplicati.contains(idBusta);
  802.     }

  803.     public String getStato() {
  804.         return this.stato;
  805.     }

  806.     public void setStato(String stato) {
  807.         this.stato = stato;
  808.     }

  809.     public List<TransactionResource> getRisorse() {
  810.         return this.risorse;
  811.     }

  812.     public void addRisorsa(TransactionResource r){
  813.         this.risorse.add(r);
  814.     }
  815.    
  816.     public TransactionServiceLibrary getTransactionServiceLibrary() {
  817.         return this.transactionServiceLibrary;
  818.     }

  819.     public void setTransactionServiceLibrary(
  820.             TransactionServiceLibrary transactionServiceLibrary) {
  821.         this.transactionServiceLibrary = transactionServiceLibrary;
  822.     }

  823.     @Override
  824.     public String toString() {
  825.         StringBuilder sb = new StringBuilder();
  826.         sb.append("idTransazione: ").append(this.id);
  827.         sb.append("\n").append("originator: ").append(this.originator);
  828.         sb.append("\n").append("gestioneStateful: ").append(this.gestioneStateful);
  829.         sb.append("\n").append("deleted: ").append(this.deleted);
  830.        
  831.         if(this.dataAccettazioneRichiesta!=null) {
  832.             sb.append("\n").append("dataAccettazioneRichiesta: ").append(DateUtils.getSimpleDateFormatMs().format(this.dataAccettazioneRichiesta));
  833.         }
  834.         if(this.dataIngressoRichiesta!=null) {
  835.             sb.append("\n").append("dataIngressoRichiesta: ").append(DateUtils.getSimpleDateFormatMs().format(this.dataIngressoRichiesta));
  836.         }
  837.         if(this.dataUscitaRichiesta!=null) {
  838.             sb.append("\n").append("dataUscitaRichiesta: ").append(DateUtils.getSimpleDateFormatMs().format(this.dataUscitaRichiesta));
  839.         }
  840.         if(this.dataRichiestaInoltrata!=null) {
  841.             sb.append("\n").append("dataRichiestaInoltrata: ").append(DateUtils.getSimpleDateFormatMs().format(this.dataRichiestaInoltrata));
  842.         }
  843.         if(this.dataAccettazioneRisposta!=null) {
  844.             sb.append("\n").append("dataAccettazioneRisposta: ").append(DateUtils.getSimpleDateFormatMs().format(this.dataAccettazioneRisposta));
  845.         }
  846.         if(this.dataIngressoRisposta!=null) {
  847.             sb.append("\n").append("dataIngressoRisposta: ").append(DateUtils.getSimpleDateFormatMs().format(this.dataIngressoRisposta));
  848.         }
  849.         if(this.dataUscitaRisposta!=null) {
  850.             sb.append("\n").append("dataUscitaRisposta: ").append(DateUtils.getSimpleDateFormatMs().format(this.dataUscitaRisposta));
  851.         }
  852.        
  853.         if(this.urlInvocazione!=null) {
  854.             sb.append("\n").append("urlInvocazione: ").append(this.urlInvocazione);
  855.         }
  856.         if(this.requestInfo!=null) {
  857.             sb.append("\n").append(this.requestInfo.toString("requestInfo."));
  858.         }
  859.        
  860.         if(this.tracciaRichiesta!=null) {
  861.             sb.append("\n").append("tracciaRichiesta: presente");
  862.             if(this.tracciaRichiesta.getBusta()!=null) {
  863.                 sb.append("\n").append("tracciaRichiesta.busta.ID: ").append(this.tracciaRichiesta.getBusta().getID());
  864.             }
  865.             if(this.tracciaRichiesta.getBusta().getCollaborazione()!=null) {
  866.                 sb.append("\n").append("tracciaRichiesta.busta.collaborazione: ").append(this.tracciaRichiesta.getBusta().getCollaborazione());
  867.             }
  868.             if(this.tracciaRichiesta.getBusta().getRiferimentoMessaggio()!=null) {
  869.                 sb.append("\n").append("tracciaRichiesta.busta.riferimentoMessaggio: ").append(this.tracciaRichiesta.getBusta().getRiferimentoMessaggio());
  870.             }
  871.             if(this.tracciaRichiesta.getCorrelazioneApplicativa()!=null) {
  872.                 sb.append("\n").append("tracciaRichiesta.correlazioneApplicativa: ").append(this.tracciaRichiesta.getCorrelazioneApplicativa());
  873.             }
  874.             if(this.tracciaRichiesta.getCorrelazioneApplicativaRisposta()!=null) {
  875.                 sb.append("\n").append("tracciaRichiesta.correlazioneApplicativaRisposta: ").append(this.tracciaRichiesta.getCorrelazioneApplicativaRisposta());
  876.             }
  877.             if(this.tracciaRichiesta.getEsitoElaborazioneMessaggioTracciato()!=null) {
  878.                 sb.append("\n").append("tracciaRichiesta.esitoElaborazione: ").append(this.tracciaRichiesta.getEsitoElaborazioneMessaggioTracciato());
  879.             }
  880.         }
  881.         if(this.tracciaRisposta!=null) {
  882.             sb.append("\n").append("tracciaRisposta: presente");
  883.             if(this.tracciaRisposta.getBusta()!=null) {
  884.                 sb.append("\n").append("tracciaRisposta.busta.ID: ").append(this.tracciaRisposta.getBusta().getID());
  885.             }
  886.             if(this.tracciaRisposta.getBusta().getCollaborazione()!=null) {
  887.                 sb.append("\n").append("tracciaRisposta.busta.collaborazione: ").append(this.tracciaRisposta.getBusta().getCollaborazione());
  888.             }
  889.             if(this.tracciaRisposta.getBusta().getRiferimentoMessaggio()!=null) {
  890.                 sb.append("\n").append("tracciaRisposta.busta.riferimentoMessaggio: ").append(this.tracciaRisposta.getBusta().getRiferimentoMessaggio());
  891.             }
  892.             if(this.tracciaRisposta.getCorrelazioneApplicativa()!=null) {
  893.                 sb.append("\n").append("tracciaRisposta.correlazioneApplicativa: ").append(this.tracciaRisposta.getCorrelazioneApplicativa());
  894.             }
  895.             if(this.tracciaRisposta.getCorrelazioneApplicativaRisposta()!=null) {
  896.                 sb.append("\n").append("tracciaRisposta.correlazioneApplicativaRisposta: ").append(this.tracciaRisposta.getCorrelazioneApplicativaRisposta());
  897.             }
  898.             if(this.tracciaRisposta.getEsitoElaborazioneMessaggioTracciato()!=null) {
  899.                 sb.append("\n").append("tracciaRisposta.esitoElaborazione: ").append(this.tracciaRisposta.getEsitoElaborazioneMessaggioTracciato());
  900.             }
  901.         }
  902.        
  903.         if(this.msgDiagnostici!=null && !this.msgDiagnostici.isEmpty()) {
  904.             for (int i = 0; i < this.msgDiagnostici.size(); i++) {
  905.                 MsgDiagnostico msgDiag = this.msgDiagnostici.get(i);
  906.                 StringBuilder sbDiagnostico = new StringBuilder();
  907.                 if(msgDiag.getGdo()!=null) {
  908.                     sbDiagnostico.append("<").append(DateUtils.getSimpleDateFormatMs().format(msgDiag.getGdo())).append("> ");
  909.                 }
  910.                 if(msgDiag.getIdFunzione()!=null) {
  911.                     sbDiagnostico.append("(").append(msgDiag.getIdFunzione()).append(") ");
  912.                 }
  913.                 if(msgDiag.getCodice()!=null) {
  914.                     sbDiagnostico.append("codice:").append(msgDiag.getCodice()).append(" ");
  915.                 }
  916.                 sbDiagnostico.append("severita:").append(msgDiag.getSeverita()).append(" ");
  917.                 sbDiagnostico.append("messaggio: ").append(msgDiag.getMessaggio());
  918.                 sb.append("\n").append("diagnostico[").append(i).append("]: ").append(sbDiagnostico.toString());
  919.             }
  920.         }
  921.        
  922.         if(this.messaggi!=null && !this.messaggi.isEmpty()) {
  923.             sb.append("\n").append("messaggi: ").append(this.messaggi.size());
  924.         }
  925.         if(this.messaggiHeadersOnlyLogFileTrace!=null && !this.messaggiHeadersOnlyLogFileTrace.isEmpty()) {
  926.             sb.append("\n").append("messaggi_headers_onlyLogFileTrace: ").append(this.messaggiHeadersOnlyLogFileTrace.size());
  927.         }
  928.         if(this.messaggiBodyOnlyLogFileTrace!=null && !this.messaggiBodyOnlyLogFileTrace.isEmpty()) {
  929.             sb.append("\n").append("messaggi_body_onlyLogFileTrace: ").append(this.messaggiBodyOnlyLogFileTrace.size());
  930.         }
  931.        
  932.         if(this.scenarioCooperazione!=null) {
  933.             sb.append("\n").append("scenarioCooperazione: ").append(this.scenarioCooperazione);
  934.         }
  935.         if(this.codiceTrasportoRichiesta!=null) {
  936.             sb.append("\n").append("codiceTrasportoRichiesta: ").append(this.codiceTrasportoRichiesta);
  937.         }
  938.         if(this.location!=null) {
  939.             sb.append("\n").append("location: ").append(this.location);
  940.         }
  941.         if(this.tipoConnettore!=null) {
  942.             sb.append("\n").append("tipoConnettore: ").append(this.tipoConnettore);
  943.         }
  944.         if(this.credenziali!=null) {
  945.             sb.append("\n").append("credenziali: ").append(this.credenziali);
  946.         }
  947.                
  948.         if(this.formatoFaultIntegrazione!=null) {
  949.             sb.append("\n").append("formatoFaultIntegrazione: ").append(this.formatoFaultIntegrazione);
  950.         }
  951.         if(this.faultIntegrazione!=null) {
  952.             sb.append("\n").append("faultIntegrazione: ").append(this.faultIntegrazione);
  953.         }
  954.         if(this.formatoFaultCooperazione!=null) {
  955.             sb.append("\n").append("formatoFaultCooperazione: ").append(this.formatoFaultCooperazione);
  956.         }
  957.         if(this.faultCooperazione!=null) {
  958.             sb.append("\n").append("faultCooperazione: ").append(this.faultCooperazione);
  959.         }
  960.        
  961.         if(this.correlazioneApplicativaRisposta!=null) {
  962.             sb.append("\n").append("correlazioneApplicativaRisposta: ").append(this.correlazioneApplicativaRisposta);
  963.         }
  964.        
  965.         if(this.serviziApplicativiErogatore!=null) {
  966.             sb.append("\n").append("serviziApplicativiErogatore: ").append(this.serviziApplicativiErogatore);
  967.         }
  968.        
  969.         if(this.idProtocolloDuplicati!=null && !this.idProtocolloDuplicati.isEmpty()) {
  970.             StringBuilder sbDuplicati = new StringBuilder();
  971.             for (String id : this.idProtocolloDuplicati) {
  972.                 if(sbDuplicati.length()>0) {
  973.                     sbDuplicati.append(", ");
  974.                 }
  975.                 sbDuplicati.append(id);
  976.             }
  977.             sb.append("\n").append("idProtocolloDuplicati: ").append(sbDuplicati.toString());
  978.         }
  979.        
  980.         if(this.stato!=null) {
  981.             sb.append("\n").append("stato: ").append(this.stato);
  982.         }
  983.        
  984.         if(this.risorse!=null && !this.risorse.isEmpty()) {
  985.             sb.append("\n").append("risorse: ").append(this.risorse.size());
  986.         }
  987.        
  988.         if(this.eventiGestione!=null && !this.eventiGestione.isEmpty()) {
  989.             StringBuilder sbEventi = new StringBuilder();
  990.             for (String idEventoGestione : this.eventiGestione) {
  991.                 if(sbEventi.length()>0) {
  992.                     sbEventi.append(", ");
  993.                 }
  994.                 sbEventi.append(idEventoGestione);
  995.             }
  996.             sb.append("\n").append("eventiGestione: ").append(sbEventi.toString());
  997.         }
  998.        

  999.         if(this.informazioniToken!=null) {
  1000.             sb.append("\n").append("informazioniToken: presente");
  1001.             if(this.informazioniToken.getClientId()!=null) {
  1002.                 sb.append("\n").append("informazioniToken.clientId: ").append(this.informazioniToken.getClientId());
  1003.             }
  1004.             if(this.informazioniToken.getUsername()!=null) {
  1005.                 sb.append("\n").append("informazioniToken.username: ").append(this.informazioniToken.getUsername());
  1006.             }
  1007.             if(this.informazioniToken.getSub()!=null) {
  1008.                 sb.append("\n").append("informazioniToken.sub: ").append(this.informazioniToken.getSub());
  1009.             }
  1010.             if(this.informazioniToken.getIss()!=null) {
  1011.                 sb.append("\n").append("informazioniToken.iss: ").append(this.informazioniToken.getIss());
  1012.             }
  1013.         }
  1014.        
  1015.         if(this.informazioniAttributi!=null) {
  1016.             sb.append("\n").append("informazioniAttributi: presente");
  1017.         }
  1018.        
  1019.         if(this.informazioniNegoziazioneToken!=null) {
  1020.             sb.append("\n").append("informazioniNegoziazioneToken: presente");
  1021.         }
  1022.        
  1023.         if(this.credenzialiMittente!=null) {
  1024.             sb.append("\n").append("credenzialiMittente: presente");
  1025.             if(this.credenzialiMittente.getTrasporto()!=null) {
  1026.                 sb.append("\n").append("credenzialiMittente.trasporto (id:"+this.credenzialiMittente.getTrasporto().getId()+
  1027.                         ") (tipo:"+this.credenzialiMittente.getTrasporto().getTipo()+
  1028.                         "): ").append(this.credenzialiMittente.getTrasporto().getCredenziale());
  1029.             }
  1030.             if(this.credenzialiMittente.getTokenIssuer()!=null) {
  1031.                 sb.append("\n").append("credenzialiMittente.issuer (id:"+this.credenzialiMittente.getTokenIssuer().getId()+
  1032.                         ") (tipo:"+this.credenzialiMittente.getTokenIssuer().getTipo()+
  1033.                         "): ").append(this.credenzialiMittente.getTokenIssuer().getCredenziale());
  1034.             }
  1035.             if(this.credenzialiMittente.getTokenSubject()!=null) {
  1036.                 sb.append("\n").append("credenzialiMittente.subject (id:"+this.credenzialiMittente.getTokenSubject().getId()+
  1037.                         ") (tipo:"+this.credenzialiMittente.getTokenSubject().getTipo()+
  1038.                         "): ").append(this.credenzialiMittente.getTokenSubject().getCredenziale());
  1039.             }
  1040.             if(this.credenzialiMittente.getTokenClientId()!=null) {
  1041.                 sb.append("\n").append("credenzialiMittente.clientId (id:"+this.credenzialiMittente.getTokenClientId().getId()+
  1042.                         ") (tipo:"+this.credenzialiMittente.getTokenClientId().getTipo()+
  1043.                         "): ").append(this.credenzialiMittente.getTokenClientId().getCredenziale());
  1044.             }
  1045.             if(this.credenzialiMittente.getTokenUsername()!=null) {
  1046.                 sb.append("\n").append("credenzialiMittente.username (id:"+this.credenzialiMittente.getTokenUsername().getId()+
  1047.                         ") (tipo:"+this.credenzialiMittente.getTokenUsername().getTipo()+
  1048.                         "): ").append(this.credenzialiMittente.getTokenUsername().getCredenziale());
  1049.             }
  1050.             if(this.credenzialiMittente.getTokenEMail()!=null) {
  1051.                 sb.append("\n").append("credenzialiMittente.eMail (id:"+this.credenzialiMittente.getTokenEMail().getId()+
  1052.                         ") (tipo:"+this.credenzialiMittente.getTokenEMail().getTipo()+
  1053.                         "): ").append(this.credenzialiMittente.getTokenEMail().getCredenziale());
  1054.             }
  1055.         }
  1056.        
  1057.         if(this.tempiElaborazione!=null) {
  1058.             sb.append("\n").append("tempiElaborazione: presente");
  1059.         }
  1060.        
  1061.        
  1062.         return sb.toString();
  1063.     }

  1064. }