public class Device extends Entity
Modifier and Type | Class and Description |
---|---|
static class |
Device.Builder<T extends Device.Builder<T>> |
Jsonifiable.JsonMapper
attributes, remote
Modifier | Constructor and Description |
---|---|
protected |
Device(Device.Builder<?> builder) |
Modifier and Type | Method and Description |
---|---|
CompletionStage<Void> |
deleteFeature(String featureId,
String... acknowledgements)
Deletes the feature with the specified
featureId . |
CompletionStage<Void> |
deleteFeatureDesiredProperties(String featureId,
String... acknowledgements)
Deletes feature desired properties.
|
CompletionStage<Void> |
deleteFeatureDesiredProperty(String featureId,
String path,
String... acknowledgements)
Deletes feature desired property.
|
CompletionStage<Void> |
deleteFeatureProperties(String featureId,
String... acknowledgements)
Deletes feature properties.
|
CompletionStage<Void> |
deleteFeatureProperty(String featureId,
String path,
String... acknowledgements)
Deletes feature property.
|
boolean |
equals(Object obj) |
Optional<Feature> |
feature(String featureId)
Returns the feature identified by the
featureId for the device represented by this object. |
CompletionStage<Feature> |
feature(String featureId,
String... fields)
Retrieves the feature identified by the
featureId . |
List<Property<?>> |
featureDesiredProperties(String featureId)
Returns the feature desired properties.
|
Optional<?> |
featureDesiredProperty(String featureId,
String propertyPath)
Returns the feature desired property identified by the
propertyPath parameter. |
List<Property<?>> |
featureProperties(String featureId)
Returns the feature properties.
|
Optional<?> |
featureProperty(String featureId,
String propertyPath)
Returns the feature property identified by the
propertyPath parameter. |
List<Feature> |
features()
Returns the features of this device.
|
List<Feature> |
features(String namespace,
String name)
Returns device features having definition with namespace and name identified by the parameters
namespace and name . |
List<Feature> |
features(String namespace,
String name,
String version)
Returns device features having definition with namespace, name and version
identified by the parameters
namespace , name and version . |
Optional<String> |
gatewayId()
Returns the gateway identifier this device is attached to.
|
int |
hashCode() |
Optional<Boolean> |
isGateway()
Returns if this device is representing a gateway.
|
CompletionStage<Void> |
message(String subject,
byte[] payload)
Sends byte[] message to the device.
|
CompletionStage<Void> |
message(String subject,
String payload)
Sends string message to the device.
|
static Device.Builder<?> |
newBuilder() |
static Device.Builder<?> |
newBuilder(DeviceInventoryRemote remote) |
Optional<String> |
path()
Returns device path.
|
CompletionStage<Policy> |
policy()
Returns the device policy.
|
Optional<String> |
policyId()
Returns device policy identifier.
|
CompletionStage<byte[]> |
request(String subject,
byte[] payload)
Sends byte[] requested to the device.
|
CompletionStage<String> |
request(String subject,
String payload)
Sends string request to the device.
|
CompletionStage<Void> |
setFeature(Feature feature,
String... acknowledgements)
Sets the feature to the entity with the specified identifier.
|
CompletionStage<Void> |
setFeatureDesiredProperties(String featureId,
List<Property<?>> desiredProperties,
String... acknowledgements)
Sets feature desired properties.
|
CompletionStage<Void> |
setFeatureDesiredProperty(String featureId,
Property<?> property,
String... acknowledgements)
Sets the desired property to the feature with the specified featureId.
|
CompletionStage<Void> |
setFeatureProperties(String featureId,
List<Property<?>> properties,
String... acknowledgements)
Sets feature properties.
|
CompletionStage<Void> |
setFeatureProperty(String featureId,
Property<?> property,
String... acknowledgements)
Sets the property to the feature with the specified featureId.
|
String |
toString() |
CompletionStage<Void> |
unregister(UnregisterOptions options,
String... acknowledgements)
Unregisters this device.
|
attribute, attributes, canonize, created, definition, deleteAttribute, deleteAttributes, identifier, modified, revision, setAttribute, setAttributes
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
toJsonString
protected Device(Device.Builder<?> builder)
public static Device.Builder<?> newBuilder()
public static Device.Builder<?> newBuilder(DeviceInventoryRemote remote)
public Optional<String> policyId()
public CompletionStage<Policy> policy()
public List<Feature> features()
public List<Feature> features(String namespace, String name)
namespace
and name
.namespace
- Definition namespacename
- Definition namepublic List<Feature> features(String namespace, String name, String version)
namespace
, name
and version
.namespace
- Definition namespacename
- Definition nameversion
- Definition versionpublic Optional<Feature> feature(String featureId)
featureId
for the device represented by this object.featureId
- the identifier of the FeaturefeatureId
if such exists, otherwise an empty Optionalpublic CompletionStage<Void> setFeature(Feature feature, String... acknowledgements)
feature
- the feature to be setacknowledgements
- requested acknowledgements for this operationCompletionStage
providing the result of the operationpublic CompletionStage<Void> deleteFeature(String featureId, String... acknowledgements)
featureId
.featureId
- the identifier of the feature to be deletedacknowledgements
- requested acknowledgements for this operationCompletionStage
providing the result of the operationpublic Optional<?> featureProperty(String featureId, String propertyPath)
propertyPath
parameter.featureId
- the feature identifierpropertyPath
- the property pathpropertyPath
identifierpublic List<Property<?>> featureProperties(String featureId)
featureId
- the feature identifierpublic CompletionStage<Void> setFeatureProperty(String featureId, Property<?> property, String... acknowledgements)
featureId
- the feature identifierproperty
- the value of the Property
to be set. Id and group of Property
are mandatory.
Id can be path to a nested valueacknowledgements
- requested acknowledgements for this operationCompletionStage
providing the result of the operationpublic CompletionStage<Void> deleteFeatureProperty(String featureId, String path, String... acknowledgements)
featureId
- the identifier of the feature to delete the property frompath
- the path of the feature property to be deletedacknowledgements
- requested acknowledgements for this operationCompletionStage
providing the result of the operationpublic CompletionStage<Void> setFeatureProperties(String featureId, List<Property<?>> properties, String... acknowledgements)
featureId
- the feature identifierproperties
- properties to be setacknowledgements
- requested acknowledgements for this operationCompletionStage
providing the result of the operationpublic CompletionStage<Void> deleteFeatureProperties(String featureId, String... acknowledgements)
featureId
- the feature identifieracknowledgements
- requested acknowledgements for this operationCompletionStage
providing the result of the operationpublic Optional<?> featureDesiredProperty(String featureId, String propertyPath)
propertyPath
parameter.featureId
- the feature identifierpropertyPath
- the desired property pathpropertyPath
identifierpublic List<Property<?>> featureDesiredProperties(String featureId)
featureId
- the feature identifierpublic CompletionStage<Void> setFeatureDesiredProperty(String featureId, Property<?> property, String... acknowledgements)
featureId
- the feature identifierproperty
- the value of the Property
to be set. Id and group of Property
are mandatory.
Id can be path to a nested valueacknowledgements
- requested acknowledgements for this operationCompletionStage
providing the result of the operationpublic CompletionStage<Void> deleteFeatureDesiredProperty(String featureId, String path, String... acknowledgements)
featureId
- the identifier of the feature to delete the desired property frompath
- the path of the feature desired property to deleteacknowledgements
- requested acknowledgements for this operationCompletionStage
providing the result of the operationpublic CompletionStage<Void> setFeatureDesiredProperties(String featureId, List<Property<?>> desiredProperties, String... acknowledgements)
featureId
- the feature identifierdesiredProperties
- desired properties to be setacknowledgements
- requested acknowledgements for this operationCompletionStage
providing the result of the operationpublic CompletionStage<Void> deleteFeatureDesiredProperties(String featureId, String... acknowledgements)
featureId
- the feature identifieracknowledgements
- requested acknowledgements for this operationCompletionStage
providing the result of the operationpublic Optional<String> gatewayId()
public Optional<Boolean> isGateway()
public CompletionStage<Void> unregister(UnregisterOptions options, String... acknowledgements)
options
- settings to be taken into account when unregistering the deviceacknowledgements
- requested acknowledgements for this operationCompletionStage
for handling the operation resultpublic CompletionStage<Void> message(String subject, String payload)
subject
- subject of the messagepayload
- payloadCompletionStage
to track when the message has been sentpublic CompletionStage<Void> message(String subject, byte[] payload)
subject
- subject of the messagepayload
- payloadCompletionStage
to track when the message has been sentpublic CompletionStage<String> request(String subject, String payload)
subject
- subject of the messagepayload
- payloadCompletionStage
to track the responsepublic CompletionStage<byte[]> request(String subject, byte[] payload)
subject
- subject of the messagepayload
- payloadCompletionStage
to track the responsepublic CompletionStage<Feature> feature(String featureId, String... fields)
featureId
.featureId
- the identifier of the Featurefields
- field paths allowing to select a subset of fields on the feature to be retrievedfeatureId
Copyright © 2022 Bosch.IO GmbH. All rights reserved.