Package org.eclipse.hono.util
Class DeviceConnectionResult
- java.lang.Object
-
- org.eclipse.hono.util.RequestResponseResult<io.vertx.core.json.JsonObject>
-
- org.eclipse.hono.util.DeviceConnectionResult
-
public final class DeviceConnectionResult extends RequestResponseResult<io.vertx.core.json.JsonObject>
A container for the result returned by Hono's device connection API.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DeviceConnectionResult
from(int status)
Creates a new result for a status code.static DeviceConnectionResult
from(int status, io.vertx.core.json.JsonObject payload)
Creates a new result for a status code and a payload.static DeviceConnectionResult
from(int status, io.vertx.core.json.JsonObject payload, CacheDirective cacheDirective)
Creates a new result for a status code and a payload.static DeviceConnectionResult
from(int status, io.vertx.core.json.JsonObject payload, CacheDirective cacheDirective, org.apache.qpid.proton.amqp.messaging.ApplicationProperties applicationProperties)
Creates a new result for a status code and a payload.static DeviceConnectionResult
from(int status, String payload)
Creates a new result for a status code and a payload.-
Methods inherited from class org.eclipse.hono.util.RequestResponseResult
getApplicationProperties, getApplicationProperty, getCacheDirective, getPayload, getStatus, isError, isOk
-
-
-
-
Method Detail
-
from
public static DeviceConnectionResult from(int status)
Creates a new result for a status code.- Parameters:
status
- The status code.- Returns:
- The result.
-
from
public static DeviceConnectionResult from(int status, io.vertx.core.json.JsonObject payload)
Creates a new result for a status code and a payload.- Parameters:
status
- The status code.payload
- The payload to include in the result.- Returns:
- The result.
-
from
public static DeviceConnectionResult from(int status, String payload)
Creates a new result for a status code and a payload.- Parameters:
status
- The status code.payload
- The string representation of the JSON payload to include in the result (may benull
).- Returns:
- The result.
- Throws:
io.vertx.core.json.DecodeException
- if the given payload is not valid JSON.
-
from
public static DeviceConnectionResult from(int status, io.vertx.core.json.JsonObject payload, CacheDirective cacheDirective)
Creates a new result for a status code and a payload.- Parameters:
status
- The status code.payload
- The payload to include in the result.cacheDirective
- Restrictions regarding the caching of the payload.- Returns:
- The result.
-
from
public static DeviceConnectionResult from(int status, io.vertx.core.json.JsonObject payload, CacheDirective cacheDirective, org.apache.qpid.proton.amqp.messaging.ApplicationProperties applicationProperties)
Creates a new result for a status code and a payload.- Parameters:
status
- The status code.payload
- The payload to include in the result.cacheDirective
- Restrictions regarding the caching of the payload.applicationProperties
- Arbitrary properties conveyed in the response message's application-properties.- Returns:
- The result.
-
-