BaseDevice Class 
	- java.lang. Object 
- com.microsoft. azure. sdk. iot. service. BaseDevice 
 
- com.
public class BaseDevice
The BaseDevice class implementing constructors and serialization functionality.
Field Summary
| Modifier and Type | Field and Description | 
|---|---|
| protected final java.lang.String | OFFSET_TIME_DEFAULT | 
| protected final java.lang.String | UTC_TIME_DEFAULT | 
| protected long | cloudToDeviceMessageCount Number of messages received by the device | 
| protected
									Device | connectionState Status of the device: {"connected" | "disconnected"} | 
| protected java.lang.String | connectionStateUpdatedTime Datetime of last time the connection state was updated. | 
| protected java.lang.String | deviceId Device name A case-sensitive string (up to 128 char long) of ASCII 7-bit alphanumeric chars + {'-', ':', '.', '+', '%', '_', '#', '*', '?', '!', '(', ')', ',', '=', '@', ';', '$', '''}. | 
| protected java.lang.String | eTag A string representing a weak ETAG version of this JSON description. | 
| protected java.lang.String | generationId Device generation Id | 
| protected java.lang.String | lastActivityTime Datetime of last time the device authenticated, received, or sent a message. | 
Constructor Summary
| Modifier | Constructor | Description | 
|---|---|---|
| protected | BaseDevice(String deviceId, AuthenticationType authenticationType) | Create an Base | 
| protected | BaseDevice(String deviceId, SymmetricKey symmetricKey) | Create an Base | 
Method Summary
| Modifier and Type | Method and Description | 
|---|---|
| Authentication | getAuthenticationType() Getter for the authentication type of this device | 
| long | getCloudToDeviceMessageCount() Getter for cloud to device message count | 
| Device | getConnectionState() Getter for connection state | 
| java.lang.String | getConnectionStateUpdatedTime() Getter for connection state updated time | 
| java.lang.String | getDeviceId() Getter for device name | 
| java.lang.String | geteTag() Getter for e | 
| java.lang.String | getGenerationId() Getter for Generation | 
| java.lang.String | getLastActivityTime() Getter for last activity time | 
| java.lang.String | getPrimaryKey() Getter for Primary | 
| java.lang.String | getPrimaryThumbprint() Getter for primary thumbprint part of the whole thumbprint | 
| java.lang.String | getSecondaryKey() Getter for Secondary | 
| java.lang.String | getSecondaryThumbprint() Getter for secondary thumbprint part of the whole thumbprint | 
| Symmetric | getSymmetricKey() Getter for Symmetric | 
| void | setForceUpdate(Boolean forceUpdate) Deprecated 
										This method currently only validates force Setter for force update boolean | 
| void | setSymmetricKey(SymmetricKey symmetricKey) Setter for Symmetric | 
| void | setThumbprint(String primaryThumbprint, String secondaryThumbprint) Deprecated 
										as of service-client version 1.15.1, please use setThumbprintFinal(String primaryThumbprint, String secondaryThumbprint)
									 Setter for X509 thumbprint | 
| final void | setThumbprintFinal(String primaryThumbprint, String secondaryThumbprint) Setter for X509 thumbprint | 
Methods inherited from java.lang.Object
Field Details
OFFSET_TIME_DEFAULT
protected final String OFFSET_TIME_DEFAULT
UTC_TIME_DEFAULT
protected final String UTC_TIME_DEFAULT
cloudToDeviceMessageCount
protected long cloudToDeviceMessageCount
Number of messages received by the device
connectionState
protected DeviceConnectionState connectionState
Status of the device: {"connected" | "disconnected"}
connectionStateUpdatedTime
protected String connectionStateUpdatedTime
Datetime of last time the connection state was updated.
deviceId
protected String deviceId
Device name A case-sensitive string (up to 128 char long) of ASCII 7-bit alphanumeric chars + {'-', ':', '.', '+', '%', '_', '#', '*', '?', '!', '(', ')', ',', '=', '@', ';', '$', '''}.
eTag
protected String eTag
A string representing a weak ETAG version of this JSON description. This is a hash.
generationId
protected String generationId
Device generation Id
lastActivityTime
protected String lastActivityTime
Datetime of last time the device authenticated, received, or sent a message.
Constructor Details
BaseDevice
protected BaseDevice(String deviceId, AuthenticationType authenticationType)
Create an BaseDevice instance using the given device name with the given authenticationType
Parameters:
- The type of authentication used by this device.
BaseDevice
protected BaseDevice(String deviceId, SymmetricKey symmetricKey)
Create an BaseDevice instance using the given device name
Parameters:
- Device key. If parameter is null, then the key will be auto generated.
Throws:
Method Details
getAuthenticationType
public AuthenticationType getAuthenticationType()
Getter for the authentication type of this device
Returns:
getCloudToDeviceMessageCount
public long getCloudToDeviceMessageCount()
Getter for cloud to device message count
Returns:
getConnectionState
public DeviceConnectionState getConnectionState()
Getter for connection state
Returns:
getConnectionStateUpdatedTime
public String getConnectionStateUpdatedTime()
Getter for connection state updated time
Returns:
getDeviceId
public String getDeviceId()
Getter for device name
Returns:
geteTag
public String geteTag()
Getter for eTag
Returns:
getGenerationId
public String getGenerationId()
Getter for GenerationId
Returns:
getLastActivityTime
public String getLastActivityTime()
Getter for last activity time
Returns:
getPrimaryKey
public String getPrimaryKey()
Getter for PrimaryKey part of the SymmetricKey
Returns:
getPrimaryThumbprint
public String getPrimaryThumbprint()
Getter for primary thumbprint part of the whole thumbprint
Returns:
getSecondaryKey
public String getSecondaryKey()
Getter for SecondaryKey part of the SymmetricKey
Returns:
getSecondaryThumbprint
public String getSecondaryThumbprint()
Getter for secondary thumbprint part of the whole thumbprint
Returns:
getSymmetricKey
public SymmetricKey getSymmetricKey()
Getter for SymmetricKey object
Returns:
setForceUpdate
public void setForceUpdate(Boolean forceUpdate)
Deprecated
Setter for force update boolean
Parameters:
- Boolean controlling if the update should be forced or not
Throws:
setSymmetricKey
public void setSymmetricKey(SymmetricKey symmetricKey)
Setter for SymmetricKey object
Parameters:
Throws:
setThumbprint
public void setThumbprint(String primaryThumbprint, String secondaryThumbprint)
Deprecated
Setter for X509 thumbprint
Parameters:
setThumbprintFinal
public final void setThumbprintFinal(String primaryThumbprint, String secondaryThumbprint)
Setter for X509 thumbprint
Parameters: