Package org.eclipse.hono.util
Interface ExecutionContext
-
- All Known Subinterfaces:
TelemetryExecutionContext
- All Known Implementing Classes:
MapBasedExecutionContext
,MapBasedTelemetryExecutionContext
public interface ExecutionContext
A container for information relevant for processing a message sent by a device.Provides means to store arbitrary key/value pairs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
get(String key)
Gets the value for a key.<T> T
get(String key, T defaultValue)
Gets the value for a key.io.opentracing.SpanContext
getTracingContext()
Gets the OpenTracing context that is used to track the processing of this context.io.opentracing.Span
getTracingSpan()
Gets the OpenTracing root span that is used to track the processing of this context.void
put(String key, Object value)
Sets a value for a key.
-
-
-
Method Detail
-
get
<T> T get(String key)
Gets the value for a key.- Type Parameters:
T
- The type of the value.- Parameters:
key
- The key to get the value for.- Returns:
- The value or
null
if the key is unknown.
-
get
<T> T get(String key, T defaultValue)
Gets the value for a key.- Type Parameters:
T
- The type of the value.- Parameters:
key
- The key to get the value for.defaultValue
- The value to return if the key is unknown.- Returns:
- The value.
-
put
void put(String key, Object value)
Sets a value for a key.- Parameters:
key
- The key.value
- The value.
-
getTracingContext
io.opentracing.SpanContext getTracingContext()
Gets the OpenTracing context that is used to track the processing of this context.- Returns:
- The context or
null
if no tracing context is set.
-
getTracingSpan
io.opentracing.Span getTracingSpan()
Gets the OpenTracing root span that is used to track the processing of this context.- Returns:
- The span or
null
if no span is set.
-
-