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

ca.bitcoco.jsk.operation.log.LogMessage Maven / Gradle / Ivy

There is a newer version: 0.4.4
Show newest version
package ca.bitcoco.jsk.operation.log;


import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;

import java.util.HashMap;
import java.util.Map;

public class LogMessage {

    private String serviceName;
    private String operationName;
    private String loggerName;
    private String pod;
    private String region;
    private String cluster;
    private Map payload;
    private String traceId;
    private String env;
    private String version;
    private String chatVersion;


    public LogMessage() {
        serviceName = "N/A";
        pod = "N/A";
        region = "N/A";
        cluster = "N/A";
        env = "N/A";
        version = "N/A";
        chatVersion = "N/A";
        operationName = "N/A";
        loggerName = "N/A";
        traceId = "N/A";
        payload = new HashMap<>();
    }

    public String getEnv() {
        return env;
    }

    public void setEnv(String env) {
        this.env = env;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getChatVersion() {
        return chatVersion;
    }

    public void setChatVersion(String chatVersion) {
        this.chatVersion = chatVersion;
    }

    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    public String getCluster() {
        return cluster;
    }

    public void setCluster(String cluster) {
        this.cluster = cluster;
    }

    public String getServiceName() {
        return serviceName;
    }

    public String getLoggerName() {
        return loggerName;
    }

    public String getPod() {
        return pod;
    }

    public void setPod(String pod) {
        this.pod = pod;
    }

    public void setLoggerName(String loggerName) {
        this.loggerName = loggerName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public String getOperationName() {
        return operationName;
    }

    public void setOperationName(String operationName) {
        this.operationName = operationName;
    }

    public String getTraceId() {
        return traceId;
    }

    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }

    public void setPayload(Map message) {
        this.payload = message;
    }

    public Map getPayload() {
        return payload;
    }

    @Override
    public String toString() {
        ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
        String json = null;
        try {
            json = ow.writeValueAsString(this);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }
        return json;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy