Package org.eclipse.hono.util
Interface TelemetryExecutionContext
-
- All Superinterfaces:
ExecutionContext
- All Known Implementing Classes:
MapBasedTelemetryExecutionContext
public interface TelemetryExecutionContext extends ExecutionContext
A container for information relevant for processing a message sent by a device which contains telemetry data or an event.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Device
getAuthenticatedDevice()
Gets the verified identity of the device that the message has been received from which is processed in this context.default Map<String,Object>
getDownstreamMessageProperties()
Gets the properties that need to be included in the message being sent downstream.String
getOrigAddress()
Gets the transport protocol specific address of the message.QoS
getRequestedQos()
Gets the QoS level as set in the request by the device.Optional<Duration>
getTimeToLive()
Gets the time-to-live set by the device for an event.default boolean
isDeviceAuthenticated()
Determines if the message that is processed in this context has been received from a device whose identity has been verified.-
Methods inherited from interface org.eclipse.hono.util.ExecutionContext
get, get, getTracingContext, getTracingSpan, put
-
-
-
-
Method Detail
-
getAuthenticatedDevice
Device getAuthenticatedDevice()
Gets the verified identity of the device that the message has been received from which is processed in this context.- Returns:
- The device or
null
if the device has not been authenticated.
-
isDeviceAuthenticated
default boolean isDeviceAuthenticated()
Determines if the message that is processed in this context has been received from a device whose identity has been verified.- Returns:
true
if the device has been authenticated orfalse
otherwise.
-
getRequestedQos
QoS getRequestedQos()
Gets the QoS level as set in the request by the device.- Returns:
- The QoS level requested by the device or
null
if the level could not be determined.
-
getTimeToLive
Optional<Duration> getTimeToLive()
Gets the time-to-live set by the device for an event.- Returns:
- An optional containing the time-to-live duration or an empty optional if the device did not specify a ttl or if the message is not an event.
-
getOrigAddress
String getOrigAddress()
Gets the transport protocol specific address of the message.- Returns:
- The address.
-
getDownstreamMessageProperties
default Map<String,Object> getDownstreamMessageProperties()
Gets the properties that need to be included in the message being sent downstream.This default implementation puts the following properties to the returned map:
- the value returned by
getOrigAddress()
under key "orig_address", if notnull
- the value returned by
getTimeToLive()
under key "ttl", if notnull
- Returns:
- The properties.
- the value returned by
-
-