你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
DeviceClientConfig Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. DeviceClientConfig
- com.
public final class DeviceClientConfig
Configuration settings for an IoT Hub client. Validates all user-defined settings.
Field Summary
Modifier and Type | Field and Description |
---|---|
static final int | DEFAULT_AMQP_OPEN_AUTHENTICATION_SESSION_TIMEOUT_IN_SECONDS |
Constructor Summary
Method Summary
Modifier and Type | Method and Description |
---|---|
Iot |
getAuthenticationProvider() |
Auth |
getAuthenticationType()
Getter for Authentication |
java.lang.String |
getDeviceId()
Getter for the device ID. |
Message |
getDeviceMethodsMessageCallback()
Getter for the device twin message callback. |
java.lang.Object |
getDeviceMethodsMessageContext()
Getter for the context to be passed in to the device twin message callback. |
Message |
getDeviceTelemetryMessageCallback(String inputName)
Getter for the message callback. |
java.lang.Object |
getDeviceTelemetryMessageContext(String inputName)
Getter for the context to be passed in to the message callback. |
Message |
getDeviceTwinMessageCallback()
Getter for the device twin message callback. |
java.lang.Object |
getDeviceTwinMessageContext()
Getter for the context to be passed in to the device twin message callback. |
java.lang.String |
getGatewayHostname()
Getter for the Gateway host name. |
java.lang.String |
getIotHubHostname()
Getter for the IoT Hub hostname. |
java.lang.String |
getIotHubName()
Getter for the IoT Hub name. |
int |
getMessageLockTimeoutSecs()
Getter for the timeout, in seconds, for the lock that the client has on a received message. |
java.lang.String | getModuleId() |
long |
getOperationTimeout()
Getter for the device operation timeout |
Product |
getProductInfo() |
Iot |
getProtocol() |
Proxy |
getProxySettings() |
Retry |
getRetryPolicy()
Getter for Retry |
Iot |
getSasTokenAuthentication()
Getter for Sas |
boolean |
isUseWebsocket()
Getter for Websocket |
void |
setDeviceMethodsMessageCallback(MessageCallback callback, Object context)
Setter for the device method message callback. |
void |
setDeviceTwinMessageCallback(MessageCallback callback, Object context)
Setter for the device twin message callback. |
void |
setMessageCallback(MessageCallback callback, Object context)
Setter for the message callback. |
void | setMessageCallback(String inputName, MessageCallback callback, Object context) |
void | setProxy(ProxySettings proxySettings) |
void |
setRetryPolicy(RetryPolicy retryPolicy)
Setter for Retry |
void |
setUseWebsocket(boolean useWebsocket)
Setter for Websocket |
Methods inherited from java.lang.Object
Field Details
DEFAULT_AMQP_OPEN_AUTHENTICATION_SESSION_TIMEOUT_IN_SECONDS
public static final int DEFAULT_AMQP_OPEN_AUTHENTICATION_SESSION_TIMEOUT_IN_SECONDS
Constructor Details
DeviceClientConfig
protected DeviceClientConfig()
DeviceClientConfig
public DeviceClientConfig(IotHubConnectionString iotHubConnectionString)
Constructor
Parameters:
Throws:
DeviceClientConfig
public DeviceClientConfig(IotHubConnectionString iotHubConnectionString, ClientOptions clientOptions)
Parameters:
DeviceClientConfig
public DeviceClientConfig(IotHubConnectionString iotHubConnectionString, String publicKeyCertificate, boolean isPathForPublic, String privateKey, boolean isPathForPrivate)
Constructor for device configs that use x509 authentication
Parameters:
DeviceClientConfig
public DeviceClientConfig(IotHubConnectionString iotHubConnectionString, SSLContext sslContext)
Parameters:
DeviceClientConfig
public DeviceClientConfig(IotHubAuthenticationProvider authenticationProvider)
Parameters:
Throws:
DeviceClientConfig
public DeviceClientConfig(String hostName, SasTokenProvider sasTokenProvider, ClientOptions clientOptions, String deviceId, String moduleId)
Parameters:
Method Details
getAuthenticationProvider
public IotHubAuthenticationProvider getAuthenticationProvider()
getAuthenticationType
public DeviceClientConfig.AuthType getAuthenticationType()
Getter for AuthenticationType
Returns:
getDeviceId
public String getDeviceId()
Getter for the device ID.
Returns:
getDeviceMethodsMessageCallback
public MessageCallback getDeviceMethodsMessageCallback()
Getter for the device twin message callback.
Returns:
getDeviceMethodsMessageContext
public Object getDeviceMethodsMessageContext()
Getter for the context to be passed in to the device twin message callback.
Returns:
getDeviceTelemetryMessageCallback
public MessageCallback getDeviceTelemetryMessageCallback(String inputName)
Getter for the message callback.
Parameters:
Returns:
getDeviceTelemetryMessageContext
public Object getDeviceTelemetryMessageContext(String inputName)
Getter for the context to be passed in to the message callback.
Parameters:
Returns:
getDeviceTwinMessageCallback
public MessageCallback getDeviceTwinMessageCallback()
Getter for the device twin message callback.
Returns:
getDeviceTwinMessageContext
public Object getDeviceTwinMessageContext()
Getter for the context to be passed in to the device twin message callback.
Returns:
getGatewayHostname
public String getGatewayHostname()
Getter for the Gateway host name.
Returns:
getIotHubHostname
public String getIotHubHostname()
Getter for the IoT Hub hostname.
Returns:
getIotHubName
public String getIotHubName()
Getter for the IoT Hub name.
Returns:
getMessageLockTimeoutSecs
public int getMessageLockTimeoutSecs()
Getter for the timeout, in seconds, for the lock that the client has on a received message.
Returns:
getModuleId
public String getModuleId()
getOperationTimeout
public long getOperationTimeout()
Getter for the device operation timeout
Returns:
getProductInfo
public ProductInfo getProductInfo()
getProtocol
public IotHubClientProtocol getProtocol()
getProxySettings
public ProxySettings getProxySettings()
getRetryPolicy
public RetryPolicy getRetryPolicy()
Getter for RetryPolicy
Returns:
getSasTokenAuthentication
public IotHubSasTokenAuthenticationProvider getSasTokenAuthentication()
Getter for SasTokenAuthentication
Returns:
isUseWebsocket
public boolean isUseWebsocket()
Getter for Websocket
Returns:
setDeviceMethodsMessageCallback
public void setDeviceMethodsMessageCallback(MessageCallback callback, Object context)
Setter for the device method message callback.
Parameters:
setDeviceTwinMessageCallback
public void setDeviceTwinMessageCallback(MessageCallback callback, Object context)
Setter for the device twin message callback.
Parameters:
setMessageCallback
public void setMessageCallback(MessageCallback callback, Object context)
Setter for the message callback. Can be null
.
Parameters:
null
.
setMessageCallback
public void setMessageCallback(String inputName, MessageCallback callback, Object context)
Parameters:
setProxy
public void setProxy(ProxySettings proxySettings)
Parameters:
setRetryPolicy
public void setRetryPolicy(RetryPolicy retryPolicy)
Setter for RetryPolicy
Parameters:
Throws:
setUseWebsocket
public void setUseWebsocket(boolean useWebsocket)
Setter for Websocket
Parameters: