All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.mats3.serial.json.MatsTraceStringImpl Maven / Gradle / Ivy

Go to download

Mats^3 MatsSerializer implementation using Jackson to serialize between MatsTraceStringImpl and byte arrays. Employed by the Mats^3 JMS Implementation.

There is a newer version: 0.19.23-2025-01-14
Show newest version
package io.mats3.serial.json;

import io.mats3.serial.MatsTrace;
import io.mats3.serial.impl.MatsTraceFieldImpl;

/**
 * Extension of {@link MatsTraceFieldImpl} which uses String for Z, meant to use JSON to serialize the DTO and STO
 * payloads. Employed by {@link MatsSerializerJson}.
 *
 * @author Endre Stølsvik - 2015 - http://endre.stolsvik.com
 */
public final class MatsTraceStringImpl extends MatsTraceFieldImpl {

    /**
     * Creates a new {@link MatsTrace}. Must add a {@link Call} before sending.
     *
     * @param traceId
     *            the user-defined hopefully-unique id for this call flow.
     * @param flowId
     *            the system-defined pretty-much-(for all purposes)-guaranteed-unique id for this call flow.
     * @param keepMatsTrace
     *            the level of "trace keeping".
     * @param nonPersistent
     *            if the messages in this flow should be non-persistent
     * @param interactive
     *            if the messages in this flow is of "interactive" priority.
     * @param ttlMillis
     *            the number of milliseconds the message should live before being time out. 0 means "forever", and is
     *            the default.
     * @param noAudit
     *            hint to the underlying implementation, or to any monitoring/auditing tooling on the Message Broker,
     *            that it does not make much value in auditing this message flow, typically because it is just a
     *            "getter" of information to show to some user, or a health-check validating that some service is up and
     *            answers in a timely fashion.
     * @return the newly created {@link MatsTrace}.
     */
    @SuppressWarnings("unchecked")
    public static MatsTrace createNew(String traceId, String flowId,
            KeepMatsTrace keepMatsTrace, boolean nonPersistent, boolean interactive, long ttlMillis, boolean noAudit) {
        return new MatsTraceStringImpl(traceId, flowId, keepMatsTrace, nonPersistent, interactive, ttlMillis, noAudit);
    }

    private MatsTraceStringImpl() {
        // Jackson JSON-lib needs a no-args constructor, but it can re-set finals.
        super();
    }

    private MatsTraceStringImpl(String traceId, String flowId, KeepMatsTrace keepMatsTrace, boolean nonPersistent,
            boolean interactive, long ttlMillis, boolean noAudit) {
        super(traceId, flowId, keepMatsTrace, nonPersistent, interactive, ttlMillis, noAudit);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy