Package org.eclipse.hono.adapter.mqtt
Class MqttConnectContext
- java.lang.Object
-
- org.eclipse.hono.util.MapBasedExecutionContext
-
- org.eclipse.hono.adapter.mqtt.MqttConnectContext
-
- All Implemented Interfaces:
org.eclipse.hono.util.ExecutionContext
public final class MqttConnectContext extends org.eclipse.hono.util.MapBasedExecutionContextContains information required during the processing of an MQTT CONNECT packet.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.vertx.mqtt.MqttEndpointdeviceEndpoint()Gets the MQTT endpoint over which the message has been received.static MqttConnectContextfromConnectPacket(io.vertx.mqtt.MqttEndpoint endpoint, io.opentracing.Span span)Creates a new context for a connection attempt.OptionalIntgetTraceSamplingPriority()Gets the value for the sampling.priority span tag to be used for OpenTracing spans created in connection with this context.voidsetTraceSamplingPriority(OptionalInt traceSamplingPriority)Sets the value for the sampling.priority span tag to be used for OpenTracing spans created in connection with this context.
-
-
-
Method Detail
-
fromConnectPacket
public static MqttConnectContext fromConnectPacket(io.vertx.mqtt.MqttEndpoint endpoint, io.opentracing.Span span)
Creates a new context for a connection attempt.- Parameters:
endpoint- The endpoint representing the client's connection attempt.span- The OpenTracing root span that is used to track the processing of this context.- Returns:
- The context.
- Throws:
NullPointerException- if endpoint or span isnull.
-
deviceEndpoint
public io.vertx.mqtt.MqttEndpoint deviceEndpoint()
Gets the MQTT endpoint over which the message has been received.- Returns:
- The endpoint.
-
getTraceSamplingPriority
public OptionalInt getTraceSamplingPriority()
Gets the value for the sampling.priority span tag to be used for OpenTracing spans created in connection with this context.- Returns:
- An OptionalInt containing the value for the sampling.priority span tag or an empty OptionalInt if no priority should be set.
-
setTraceSamplingPriority
public void setTraceSamplingPriority(OptionalInt traceSamplingPriority)
Sets the value for the sampling.priority span tag to be used for OpenTracing spans created in connection with this context.- Parameters:
traceSamplingPriority- The OptionalInt containing the sampling.priority span tag value or an empty OptionalInt if no priority should be set.- Throws:
NullPointerException- if traceSamplingPriority isnull.
-
-