ClientConfiguration Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.device.ClientConfiguration

public class ClientConfiguration

Configuration settings for an IoT Hub client. Validates all user-defined settings.

Field Summary

Modifier and Type Field and Description
final int DEFAULT_AMQP_OPEN_AUTHENTICATION_SESSION_TIMEOUT_IN_SECONDS
final int DEFAULT_AMQP_OPEN_DEVICE_SESSIONS_TIMEOUT_IN_SECONDS
final int DEFAULT_KEEP_ALIVE_INTERVAL_IN_SECONDS

Constructor Summary

Constructor Description
ClientConfiguration()

Method Summary

Modifier and Type Method and Description
IotHubAuthenticationProvider getAuthenticationProvider()
ClientConfiguration.AuthType getAuthenticationType()

Getter for AuthenticationType

String getDeviceClientUniqueIdentifier()
String getDeviceId()

Getter for the device ID.

MessageCallback getDeviceTelemetryMessageCallback(String inputName)

Getter for the message callback.

Object getDeviceTelemetryMessageContext(String inputName)

Getter for the context to be passed in to the message callback.

MessageCallback getDeviceTwinMessageCallback()

Getter for the device twin message callback.

Object getDeviceTwinMessageContext()

Getter for the context to be passed in to the device twin message callback.

MessageCallback getDirectMethodsMessageCallback()

Getter for the device twin message callback.

Object getDirectMethodsMessageContext()

Getter for the context to be passed in to the device twin message callback.

String getGatewayHostname()

Getter for the Gateway host name.

String getIotHubHostname()

Getter for the IoT Hub hostname.

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.

String getModuleId()
IotHubSasTokenAuthenticationProvider getSasTokenAuthentication()

Getter for SasTokenAuthentication

boolean isUsingWebsocket()

Getter for Websocket

void setDeviceTwinMessageCallback(MessageCallback callback, Object context)

Setter for the device twin message callback.

void setDirectMethodsMessageCallback(MessageCallback callback, Object context)

Setter for the device method message callback.

Field Details

DEFAULT_AMQP_OPEN_AUTHENTICATION_SESSION_TIMEOUT_IN_SECONDS

public static final int DEFAULT_AMQP_OPEN_AUTHENTICATION_SESSION_TIMEOUT_IN_SECONDS= 20

DEFAULT_AMQP_OPEN_DEVICE_SESSIONS_TIMEOUT_IN_SECONDS

public static final int DEFAULT_AMQP_OPEN_DEVICE_SESSIONS_TIMEOUT_IN_SECONDS= 60

DEFAULT_KEEP_ALIVE_INTERVAL_IN_SECONDS

public static final int DEFAULT_KEEP_ALIVE_INTERVAL_IN_SECONDS= 230

Constructor Details

ClientConfiguration

protected ClientConfiguration()

Method Details

getAuthenticationProvider

public IotHubAuthenticationProvider getAuthenticationProvider()

getAuthenticationType

public AuthType getAuthenticationType()

Getter for AuthenticationType

Returns:

The value of AuthenticationType

getDeviceClientUniqueIdentifier

public String getDeviceClientUniqueIdentifier()

getDeviceId

public String getDeviceId()

Getter for the device ID.

Returns:

the device ID.

getDeviceTelemetryMessageCallback

public MessageCallback getDeviceTelemetryMessageCallback(String inputName)

Getter for the message callback.

Parameters:

inputName - the inputName that the desired callback is tied to, or null for the default callback

Returns:

the message callback.

getDeviceTelemetryMessageContext

public Object getDeviceTelemetryMessageContext(String inputName)

Getter for the context to be passed in to the message callback.

Parameters:

inputName - the inputName that the desired callback context is tied to, or null for the default callback context

Returns:

the message context.

getDeviceTwinMessageCallback

public MessageCallback getDeviceTwinMessageCallback()

Getter for the device twin message callback.

Returns:

the device twin message callback.

getDeviceTwinMessageContext

public Object getDeviceTwinMessageContext()

Getter for the context to be passed in to the device twin message callback.

Returns:

the device twin message context.

getDirectMethodsMessageCallback

public MessageCallback getDirectMethodsMessageCallback()

Getter for the device twin message callback.

Returns:

the device method message callback.

getDirectMethodsMessageContext

public Object getDirectMethodsMessageContext()

Getter for the context to be passed in to the device twin message callback.

Returns:

the device method message context.

getGatewayHostname

public String getGatewayHostname()

Getter for the Gateway host name.

Returns:

the name of the gateway host

getIotHubHostname

public String getIotHubHostname()

Getter for the IoT Hub hostname.

Returns:

the IoT Hub hostname.

getIotHubName

public String getIotHubName()

Getter for the IoT Hub name.

Returns:

the IoT Hub name.

getMessageLockTimeoutSecs

public int getMessageLockTimeoutSecs()

Getter for the timeout, in seconds, for the lock that the client has on a received message.

Returns:

the timeout, in seconds, for a received message lock.

getModuleId

public String getModuleId()

getSasTokenAuthentication

public IotHubSasTokenAuthenticationProvider getSasTokenAuthentication()

Getter for SasTokenAuthentication

Returns:

The value of SasTokenAuthentication, or null if this object isn't using sas token authentication

isUsingWebsocket

public boolean isUsingWebsocket()

Getter for Websocket

Returns:

true if set, false otherwise

setDeviceTwinMessageCallback

public void setDeviceTwinMessageCallback(MessageCallback callback, Object context)

Setter for the device twin message callback.

Parameters:

callback - callback to be invoked for device twin messages.
context - is the context for the callback.

setDirectMethodsMessageCallback

public void setDirectMethodsMessageCallback(MessageCallback callback, Object context)

Setter for the device method message callback.

Parameters:

callback - Callback for device method messages.
context - is the context for the callback.

Applies to