Partager via


DeviceRegistrationState Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.provisioning.service.configs.DeviceRegistrationState

public class DeviceRegistrationState

Representation of a single Device Provisioning Service device registration state with a JSON deserializer.

Example of JSON format:

{
     "registrationId":"validRegistrationId",
     "createdDateTimeUtc": "2017-09-28T16:29:42.3447817Z",
     "assignedHub":"ContosoIoTHub.azure-devices.net",
     "deviceId":"ContosoDevice-123",
     "status":"assigned"
     "lastUpdatedDateTimeUtc": "2017-09-28T16:29:42.3447817Z",
     "errorCode":200
     "errorMessage":"Succeeded"
     "etag": "\"00000000-0000-0000-0000-00000000000\""
 }

Constructor Summary

Constructor Description
DeviceRegistrationState(String json)

CONSTRUCTOR

Method Summary

Modifier and Type Method and Description
java.lang.String getAssignedHub()

Getter for the assignedHub.

java.util.Date getCreatedDateTimeUtc()

Getter for the createdDateTimeUtc.

java.lang.String getDeviceId()

Getter for the deviceId.

java.lang.Integer getErrorCode()

Getter for the errorCode.

java.lang.String getErrorMessage()

Getter for the errorMessage.

java.lang.String getEtag()

Getter for the etag.

java.util.Date getLastUpdatedDateTimeUtc()

Getter for the lastUpdatedDateTimeUtc.

java.lang.String getRegistrationId()

Getter for the registrationId.

EnrollmentStatus getStatus()

Getter for the status.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

DeviceRegistrationState

public DeviceRegistrationState(String json)

CONSTRUCTOR

This constructor creates an instance of the device registration state filling the class with the information provided in the JSON.

Parameters:

json - the String with the JSON received from the provisioning service.

Method Details

getAssignedHub

public String getAssignedHub()

Getter for the assignedHub.

Returns:

The String with the assignedHub content. It can be null.

getCreatedDateTimeUtc

public Date getCreatedDateTimeUtc()

Getter for the createdDateTimeUtc.

Returns:

The Date with the createdDateTimeUtc content. It can be null.

getDeviceId

public String getDeviceId()

Getter for the deviceId.

Returns:

The String with the deviceID content. It can be null.

getErrorCode

public Integer getErrorCode()

Getter for the errorCode.

Returns:

The Integer with the errorCode content. It can be null.

getErrorMessage

public String getErrorMessage()

Getter for the errorMessage.

Returns:

The String with the errorMessage content. It can be null.

getEtag

public String getEtag()

Getter for the etag.

Returns:

The String with the etag content. It can be null.

getLastUpdatedDateTimeUtc

public Date getLastUpdatedDateTimeUtc()

Getter for the lastUpdatedDateTimeUtc.

Returns:

The Date with the lastUpdatedDateTimeUtc content. It can be null.

getRegistrationId

public String getRegistrationId()

Getter for the registrationId.

Returns:

The String with the registrationID content. It cannot be null or empty.

getStatus

public EnrollmentStatus getStatus()

Getter for the status.

Returns:

The EnrollmentStatus with the status content. It can be null.

Applies to