Share via


IotHubConnectionStatusChangeReason Enum

  • java.lang.Object
    • java.lang.Enum<IotHubConnectionStatusChangeReason>
      • com.microsoft.azure.sdk.iot.device.IotHubConnectionStatusChangeReason

public enum IotHubConnectionStatusChangeReason

Fields

BAD_CREDENTIAL

Incorrect credentials were supplied to the client instance. The supplied credentials need to be fixed before a connection can be established.

This is returned with a connection status of DISCONNECTED.

CLIENT_CLOSE

The client has been closed gracefully.

This is returned with a connection status of DISCONNECTED.

COMMUNICATION_ERROR

This can be returned with either a connection status of DISCONNECTED or DISCONNECTED_RETRYING.

When returned with a connection status of DISCONNECTED_RETRYING, this signifies that the client is trying to recover from a disconnect due to a transient exception. Do NOT close or open the client instance. Once the client successfully reports CONNECTED, operations will be resumed.

When returned with a connection status of DISCONNECTED, this signifies that client is disconnected due to a non-retryable exception. You should inspect the throwable supplied in the IotHubConnectionStatusChangeCallback to determine what action needs to be taken. If you want to perform more operations on the device client, you should close() and then open(boolean withRetry) the client.

CONNECTION_OK

The client is connected, and ready to be used.

This is returned with a connection status of CONNECTED.

EXPIRED_SAS_TOKEN

The SAS token associated with the client has expired, and cannot be renewed. The supplied credentials need to be fixed before a connection can be established.

This is returned with a connection status of DISCONNECTED.

NO_NETWORK

The client was disconnected due to loss of network, the client will attempt for recovery.

This is returned with a connection status of DISCONNECTED_RETRYING.

RETRY_EXPIRED

The client was disconnected due to a transient exception, but the retry policy expired before a connection could be re-established. If you want to perform more operations on the device client, you should close() and then open(boolean withRetry) the client.

This is returned with a connection status of DISCONNECTED.

Applies to