public interface Feature
Modifier and Type | Method and Description |
---|---|
java.util.List<DefinitionIdentifier> |
definitionIds()
All feature identifiers.
|
void |
deleteDesiredProperties()
Deletes feature desired properties.
|
void |
deleteDesiredProperty(java.lang.String path)
Deletes a desired property identified by
path . |
void |
deleteProperties()
Deletes feature properties.
|
void |
deleteProperty(java.lang.String path)
Deletes the specified property.
|
java.util.List<Property> |
desiredProperties()
Returns the desired properties of this feature.
|
java.lang.Object |
desiredProperty(java.lang.String propertyPath)
Returns the desired property identified by the
propertyPath parameter. |
java.lang.String |
deviceId()
Returns the Thing identifier this Feature belongs to.
|
void |
exec(java.lang.String operationId,
java.lang.Object args,
AsyncResult result)
Used to build asynchronous programming through Continuation Passing Style.
|
java.lang.String |
id()
Feature id.
|
void |
message(java.lang.String subject,
java.lang.String payload)
Send opaque message.
|
java.util.List<Property> |
properties()
All feature properties.
|
java.lang.Object |
property(java.lang.String propertyPath)
Find a feature property with the given path if such exists or null otherwise.
|
void |
request(java.lang.String subject,
java.lang.String payload,
AsyncResult result)
Send opaque message with response
|
void |
setDesiredProperties(java.util.List<Property<?>> desiredProperties)
Sets desired properties to this feature.
|
void |
setDesiredProperty(Property<?> desiredProperty)
Sets given desired property to this feature.
|
<T> void |
setDesiredProperty(java.lang.String id,
T value)
Sets a desired property with given id and value to this feature.
|
void |
setProperties(java.util.List<Property<?>> properties)
Sets feature properties.
|
void |
setProperty(Property<?> property)
Sets given property to this feature.
|
<T> void |
setProperty(java.lang.String id,
T value)
Sets a property with given id and value to this feature.
|
java.lang.String id()
java.lang.String deviceId()
java.util.List<DefinitionIdentifier> definitionIds()
void exec(java.lang.String operationId, java.lang.Object args, AsyncResult result)
operationId
- args
- result
- This parameter is about to be skipped in groovy scripts, it only indicates
the method is asynchronous. As for every asynchronous method, the script writers
can optionally pass a groovy.lang.Closure
as last argument that could
consume the asynchronous method result or simply be run after the asynchronous completion.
Closure postAction = {result, error -> ...}
void message(java.lang.String subject, java.lang.String payload)
subject
- message subjectpayload
- payloadvoid request(java.lang.String subject, java.lang.String payload, AsyncResult result)
subject
- message subjectpayload
- payloadresult
- This parameter is about to be skipped in groovy scripts, it only indicates
the method is asynchronous. As for every asynchronous method, the script writers
can optionally pass a groovy.lang.Closure
as last argument that could
consume the asynchronous method result or simply be run after the asynchronous completion.
Closure postAction = {result, error -> ...}
java.util.List<Property> properties()
java.lang.Object property(java.lang.String propertyPath)
propertyPath
- a property pathvoid setProperty(Property<?> property)
<T> void setProperty(java.lang.String id, T value)
id
- property id.value
- property value.void deleteProperty(java.lang.String path)
path
- the path of the feature property to deletedvoid setProperties(java.util.List<Property<?>> properties)
properties
- properties to be setvoid deleteProperties()
java.util.List<Property> desiredProperties()
java.lang.Object desiredProperty(java.lang.String propertyPath)
propertyPath
parameter.propertyPath
- the desired property pathpropertyPath
identifiervoid setDesiredProperty(Property<?> desiredProperty)
<T> void setDesiredProperty(java.lang.String id, T value)
id
- desired property id.value
- desired property value.void deleteDesiredProperty(java.lang.String path)
path
.path
- the path of the desired property to deletedvoid setDesiredProperties(java.util.List<Property<?>> desiredProperties)
desiredProperties
- desired properties to be setvoid deleteDesiredProperties()