org.bdware.doip.cluster.DoipMessageCarrier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of doip-audit-tool Show documentation
Show all versions of doip-audit-tool Show documentation
doip audit tool developed by bdware
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);
}
}