TwinState@Deprecated public class TwinParser extends Object
| Modifier and Type | Field and Description |
|---|---|
protected RegisterManagerParser |
manager
Deprecated.
|
protected TwinProperties |
properties
Deprecated.
|
protected TwinTags |
tags
Deprecated.
|
| Constructor and Description |
|---|
TwinParser()
Deprecated.
CONSTRUCTOR
Create a TwinParser instance with default values.
|
TwinParser(TwinChangedCallback onDesiredCallback)
Deprecated.
CONSTRUCTOR
Create a TwinParser instance with default values.
|
TwinParser(TwinChangedCallback onDesiredCallback,
TwinChangedCallback onReportedCallback)
Deprecated.
CONSTRUCTOR
Create a TwinParser instance with default values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
enableMetadata()
Deprecated.
Enable metadata report in the Json.
|
void |
enableTags()
Deprecated.
Enable tags in the Twin collection and in the Json.
|
TwinConnectionState |
getConnectionState()
Deprecated.
Getter for connection state
|
String |
getConnectionStateUpdatedTime()
Deprecated.
Getter for connection state updated date and time
|
Map<String,Object> |
getDesiredPropertyMap()
Deprecated.
Return a map with all `desired` properties in the collection.
|
Integer |
getDesiredPropertyVersion()
Deprecated.
Return the `desired` property version.
|
String |
getDeviceId()
Deprecated.
Getter for device name
|
String |
getETag()
Deprecated.
Getter for ETag
|
String |
getGenerationId()
Deprecated.
Getter for device generation name
|
String |
getLastActivityTime()
Deprecated.
Getter for last activity time
|
Map<String,Object> |
getReportedPropertyMap()
Deprecated.
Return a map with all `reported` properties in the collection.
|
Integer |
getReportedPropertyVersion()
Deprecated.
Return the `reported` property version.
|
TwinStatus |
getStatus()
Deprecated.
Getter for device status
|
String |
getStatusReason()
Deprecated.
Getter for status reason
|
String |
getStatusUpdatedTime()
Deprecated.
Getter for status updated date and time
|
Map<String,Object> |
getTagsMap()
Deprecated.
Return a map with all `tags` in the collection.
|
Integer |
getVersion()
Deprecated.
Getter for Twin version
|
String |
resetDesiredProperty(Map<String,Object> propertyMap)
Deprecated.
Reset the `desired` properties information in the collection, deleting all old properties and add all the new provided ones.
|
String |
resetReportedProperty(Map<String,Object> propertyMap)
Deprecated.
Reset the `reported` properties information in the collection, deleting all old properties and add all the new provided ones.
|
String |
resetTags(Map<String,Object> tagsMap)
Deprecated.
Reset the `tags` information in the collection, deleting all old tags and add all the new provided ones.
|
void |
setDesiredCallback(TwinChangedCallback onDesiredCallback)
Deprecated.
Set the callback function to report changes on the `Desired` collection when `TwinParser`
receives a new json.
|
void |
setDeviceId(String deviceId)
Deprecated.
Setter for device name
|
void |
setETag(String eTag)
Deprecated.
Setter for ETag.
|
void |
setReportedCallback(TwinChangedCallback onReportedCallback)
Deprecated.
Set the callback function to report changes on the `Reported` collection when `TwinParser`
receives a new json.
|
void |
setTagsCallback(TwinChangedCallback onTagsCallback)
Deprecated.
Set the callback function to report changes on the `tags` collection when `TwinParser`
receives a new json.
|
String |
toJson()
Deprecated.
Create a String with a json content that represents all the information in the TwinParser class and innerClasses.
|
com.google.gson.JsonElement |
toJsonElement()
Deprecated.
Create a JsonElement that represents all the information in the TwinParser class and innerClasses.
|
String |
updateDesiredProperty(Map<String,Object> propertyMap)
Deprecated.
Update the `desired` properties information in the collection, and return a string with a json that contains a
sub-collection of added properties, or properties with new value.
|
void |
updateDesiredProperty(String json)
Deprecated.
Update the `desired` properties information in the collection, using the information parsed from the provided json.
|
String |
updateDeviceManager(String deviceId,
TwinStatus status,
String statusReason)
Deprecated.
Update the device manager information in the collection, and return a string with a json that contains a
the new device manager description, including new and old values.
|
String |
updateReportedProperty(Map<String,Object> propertyMap)
Deprecated.
Update the `reported` properties information in the collection, and return a string with a json that contains a
sub-collection of added properties, or properties with new value.
|
void |
updateReportedProperty(String json)
Deprecated.
Update the `reported` properties information in the collection, using the information parsed from the provided json.
|
String |
updateTags(Map<String,Object> tagsMap)
Deprecated.
Update the `tags` information in the collection, and return a string with a json that contains a
sub-collection of added tags, or tags with new value.
|
String |
updateTwin(Map<String,Object> desiredPropertyMap,
Map<String,Object> reportedPropertyMap,
Map<String,Object> tagsMap)
Deprecated.
Update properties and tags information in the collection, and return a string with a json that contains a
sub-collection of added properties, properties with new value, added tags, and tags with new values.
|
void |
updateTwin(String json)
Deprecated.
Update the properties information in the collection, using the information parsed from the provided json.
|
protected TwinTags tags
protected TwinProperties properties
protected RegisterManagerParser manager
public TwinParser()
public TwinParser(TwinChangedCallback onDesiredCallback)
onDesiredCallback - - Callback function to report changes on the `Desired` collection.public TwinParser(TwinChangedCallback onDesiredCallback, TwinChangedCallback onReportedCallback)
onDesiredCallback - - Callback function to report changes on the `Desired` collection.onReportedCallback - - Callback function to report changes on the `Reported` collection.public void setDesiredCallback(TwinChangedCallback onDesiredCallback)
onDesiredCallback - - Callback function to report changes on the `Desired` collection.public void setReportedCallback(TwinChangedCallback onReportedCallback)
onReportedCallback - - Callback function to report changes on the `Reported` collection.public void setTagsCallback(TwinChangedCallback onTagsCallback)
onTagsCallback - - Callback function to report changes on the `Reported` collection.public String toJson()
public com.google.gson.JsonElement toJsonElement()
public void enableTags()
public void enableMetadata()
public String updateTwin(Map<String,Object> desiredPropertyMap, Map<String,Object> reportedPropertyMap, Map<String,Object> tagsMap) throws IllegalArgumentException, IOException
desiredPropertyMap - - Map of `desired` property to change the collection.reportedPropertyMap - - Map of `reported` property to change the collection.tagsMap - - Map of `tags` to change the collection.IllegalArgumentException - This exception is thrown if the properties or tags in the maps do not fits the requirements.IOException - This exception is thrown if tags the is not enabled.public String updateDesiredProperty(Map<String,Object> propertyMap) throws IllegalArgumentException
propertyMap - - Map of `desired` property to change the collection.IllegalArgumentException - This exception is thrown if the properties in the map do not fits the requirements.public String updateReportedProperty(Map<String,Object> propertyMap) throws IllegalArgumentException
propertyMap - - Map of `reported` property to change the collection.IllegalArgumentException - This exception is thrown if the properties in the map do not fits the requirements.public String updateTags(Map<String,Object> tagsMap) throws IllegalArgumentException, IOException
tagsMap - - Map of `tags` to change the collection.IllegalArgumentException - This exception is thrown if the tags in the map do not fits the requirements.IOException - This exception is thrown if tags the is not enabled.public String resetDesiredProperty(Map<String,Object> propertyMap) throws IllegalArgumentException
propertyMap - - Map of `desired` property to change the collection.IllegalArgumentException - This exception is thrown if the properties in the map do not fits the requirements.public String resetReportedProperty(Map<String,Object> propertyMap) throws IllegalArgumentException
propertyMap - - Map of `reported` property to change the collection.IllegalArgumentException - This exception is thrown if the properties in the map do not fits the requirements.public String resetTags(Map<String,Object> tagsMap) throws IllegalArgumentException, IOException
tagsMap - - Map of `tags` to change the collection.IllegalArgumentException - This exception is thrown if the tags in the map do not fits the requirements.IOException - This exception is thrown if tags the is not enabled.public void updateTwin(String json) throws IllegalArgumentException
json - - Json with property to change the collection.IllegalArgumentException - This exception is thrown if the Json is not well formed.public void updateDesiredProperty(String json) throws IllegalArgumentException
json - - Json with `desired` property to change the collection.IllegalArgumentException - This exception is thrown if the Json is not well formed.public void updateReportedProperty(String json) throws IllegalArgumentException
json - - Json with `reported` property to change the collection.IllegalArgumentException - This exception is thrown if the Json is not well formed.public String updateDeviceManager(String deviceId, TwinStatus status, String statusReason) throws IllegalArgumentException
deviceId - - Device namestatus - - Device status("enabled", "disabled")statusReason - - A 128 char long string storing the reason of suspension (for status="disabled").IllegalArgumentException - This exception is thrown if there are any inconsistent in the provided description.public Integer getDesiredPropertyVersion()
public Integer getReportedPropertyVersion()
public Map<String,Object> getDesiredPropertyMap()
public Map<String,Object> getReportedPropertyMap()
public Map<String,Object> getTagsMap() throws IOException
IOException - This exception is thrown if tags the is not enabled.public String getDeviceId()
public void setDeviceId(String deviceId) throws IllegalArgumentException
deviceId - device id
A case-sensitive string (up to 128 char long)
of ASCII 7-bit alphanumeric chars
+ {'-', ':', '.', '+', '%', '_', '#', '*', '?', '!', '(', ')', ',', '=', '@', ';', '$', '''}IllegalArgumentException - if the provided device Id is not valid.public String getGenerationId()
public String getETag()
public Integer getVersion()
nullpublic void setETag(String eTag) throws IllegalArgumentException
eTag - is a string representing a weak ETAG version
of this JSON description. This is a hash.IllegalArgumentException - if the provided eTag Id is not valid.public TwinStatus getStatus()
public String getStatusReason()
public String getStatusUpdatedTime()
public TwinConnectionState getConnectionState()
public String getConnectionStateUpdatedTime()
public String getLastActivityTime()
Copyright © 2019. All rights reserved.