public final class DeviceClientConfig extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MESSAGE_LOCK_TIMEOUT_SECS
The default value for messageLockTimeoutSecs.
|
static int |
DEFAULT_READ_TIMEOUT_MILLIS
The default value for readTimeoutMillis.
|
protected String |
deviceId |
protected String |
deviceKey |
protected String |
iotHubHostname |
protected String |
iotHubName |
protected MessageCallback |
messageCallback
The callback to be invoked if a message is received.
|
protected Object |
messageContext
The context to be passed in to the message callback.
|
protected String |
pathToCertificate |
protected String |
sharedAccessToken |
| Modifier | Constructor and Description |
|---|---|
protected |
DeviceClientConfig() |
|
DeviceClientConfig(String iotHubHostname,
String deviceId,
String deviceKey,
String sharedAccessToken)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getDeviceId()
Getter for the device ID.
|
String |
getDeviceKey()
Getter for the device key.
|
String |
getIotHubHostname()
Getter for the IoT Hub hostname.
|
String |
getIotHubName()
Getter for the IoT Hub name.
|
MessageCallback |
getMessageCallback()
Getter for the message callback.
|
Object |
getMessageContext()
Getter for the context to be passed in to the message callback.
|
int |
getMessageLockTimeoutSecs()
Getter for the timeout, in seconds, for the lock that the client has on a
received message.
|
String |
getPathToCertificate()
Getter for the path to the certificate.
|
int |
getReadTimeoutMillis()
Getter for the timeout, in milliseconds, after a connection is
established for the server to respond to the request.
|
String |
getSharedAccessToken()
Getter for the shared access signature.
|
long |
getTokenValidSecs()
Getter for the number of seconds a SAS token should be valid for.
|
void |
setMessageCallback(MessageCallback callback,
Object context)
Setter for the message callback.
|
void |
setPathToCert(String pathToCertificate)
Setter for the providing trusted certificate.
|
void |
setTokenValidSecs(long expiryTime)
Setter for the number of seconds a SAS token should be valid for.
|
public static final int DEFAULT_READ_TIMEOUT_MILLIS
public static final int DEFAULT_MESSAGE_LOCK_TIMEOUT_SECS
protected final String iotHubHostname
protected final String iotHubName
protected final String deviceId
protected final String deviceKey
protected final String sharedAccessToken
protected String pathToCertificate
protected MessageCallback messageCallback
protected Object messageContext
public DeviceClientConfig(String iotHubHostname, String deviceId, String deviceKey, String sharedAccessToken) throws URISyntaxException
iotHubHostname - the IoT Hub hostname.deviceId - the device ID.deviceKey - the device key.sharedAccessToken - the shared access token.URISyntaxException - if the IoT Hub hostname does not conform to RFC 3986.IllegalArgumentException - if the IoT Hub hostname does not contain
a valid IoT Hub name as its prefix.protected DeviceClientConfig()
public void setPathToCert(String pathToCertificate)
pathToCertificate - path to the certificate for one way authentication.public void setMessageCallback(MessageCallback callback, Object context)
null.callback - the message callback. Can be null.context - the context to be passed in to the callback.public String getIotHubHostname()
public String getIotHubName()
public String getDeviceId()
public String getDeviceKey()
public String getSharedAccessToken()
public long getTokenValidSecs()
public void setTokenValidSecs(long expiryTime)
public int getReadTimeoutMillis()
public MessageCallback getMessageCallback()
public Object getMessageContext()
public int getMessageLockTimeoutSecs()
public String getPathToCertificate()
Copyright © 2017. All rights reserved.