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

org.bdware.doip.cluster.DoipMessageCarrier Maven / Gradle / Ivy

The newest version!
package org.bdware.doip.cluster;

import com.google.gson.JsonObject;
import org.bdware.doip.codec.doipMessage.DoipMessage;

import java.util.Iterator;
import java.util.Map;

public class DoipMessageCarrier  implements io.opentracing.propagation.TextMap {
    private final DoipMessage msg;

    public DoipMessageCarrier(DoipMessage msg) {
        if (msg.header.parameters.attributes == null) {
            msg.header.parameters.attributes = new JsonObject();
        }
        this.msg = msg;
    }

    @Override
    public Iterator> iterator() {
        throw new UnsupportedOperationException("carrier is write-only");
    }

    @Override
    public void put(String key, String value) {
        msg.header.parameters.attributes.addProperty(key, value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy