io.agora.rtc

## Enum Constants.ConnectionChangedReasonType

- java.lang.Object
- - java.lang.Enum<Constants.ConnectionChangedReasonType>
  - - io.agora.rtc.Constants.ConnectionChangedReasonType

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Constants.ConnectionChangedReasonType>
  Enclosing class:
    Constants

      public static enum Constants.ConnectionChangedReasonType
      extends java.lang.Enum<Constants.ConnectionChangedReasonType>

  Reasons causing the change of the connection state.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `CONNECTION_CHANGED_BANNED_BY_SERVER` 3: The connection between the SDK and the server is banned by the server.
    `CONNECTION_CHANGED_CERTIFICATION_VERYFY_FAILURE` 22: The connection is failed due to certification verify failure.
    `CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED` 13: The IP address of the client has changed, possibly because the network type, IP address, or port has been changed.
    `CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED_BY_USER` 18: The local IP Address is changed by user.
    `CONNECTION_CHANGED_CONNECTING` 0: The SDK is connecting to the server.
    `CONNECTION_CHANGED_ECHO_TEST` 17: The change of connection state is caused by echo test.
    `CONNECTION_CHANGED_INCONSISTENT_APPID` 24: The connection is failed due to join channel with an inconsistent appid.
    `CONNECTION_CHANGED_INTERRUPTED` 2: The connection between the SDK and the server is interrupted.
    `CONNECTION_CHANGED_INVALID_APP_ID` 6: The connection fails because the App ID is not valid.
    `CONNECTION_CHANGED_INVALID_CHANNEL_NAME` 7: The connection fails because the channel name is not valid.
    `CONNECTION_CHANGED_INVALID_TOKEN` 8: The connection fails because the token is not valid.
    `CONNECTION_CHANGED_JOIN_FAILED` 4: The SDK fails to join the channel.
    `CONNECTION_CHANGED_JOIN_SUCCESS` 1: The SDK has joined the channel successfully.
    `CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT` 14: Timeout for the keep-alive of the connection between the SDK and the Agora edge server.
    `CONNECTION_CHANGED_LEAVE_CHANNEL` 5: The SDK has left the channel.
    `CONNECTION_CHANGED_LICENSE_VALIDATION_FAILURE` 21: The connection is failed due to license validation failure.
    `CONNECTION_CHANGED_LOST` 16: The connection between the SDK and the server is lost.
    `CONNECTION_CHANGED_REJECTED_BY_SERVER` 10: The connection is rejected by the server.
    `CONNECTION_CHANGED_REJOIN_SUCCESS` 15: The SDK has rejoined the channel successfully.
    `CONNECTION_CHANGED_RENEW_TOKEN` 12: The connection state changed because the token is renewed.
    `CONNECTION_CHANGED_SAME_UID_LOGIN` 19: The connection is failed due to join the same channel on another device with the same uid.
    `CONNECTION_CHANGED_SETTING_PROXY_SERVER` 11: The connection changes to reconnecting because the SDK has set a proxy server.
    `CONNECTION_CHANGED_STREAM_CHANNEL_NOT_AVAILABLE` 23: The connection is failed due to the lack of granting permission to the stream channel.
    `CONNECTION_CHANGED_TOKEN_EXPIRED` 9: The connection fails because the token has expired.
    `CONNECTION_CHANGED_TOO_MANY_BROADCASTERS` 20: The connection is failed due to too many broadcasters in the channel.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `value` Integer value of the connection changed reason type

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Constants.ConnectionChangedReasonType` | `fromInt(int value)` Converts an integer value to its corresponding ConnectionChangedReasonType enum constant.
    `int` | `getValue()` Gets the integer value of the connection changed reason type.
    `static Constants.ConnectionChangedReasonType` | `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
    `static Constants.ConnectionChangedReasonType[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### CONNECTION_CHANGED_CONNECTING

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_CONNECTING

      0: The SDK is connecting to the server.

    - #### CONNECTION_CHANGED_JOIN_SUCCESS

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_JOIN_SUCCESS

      1: The SDK has joined the channel successfully.

    - #### CONNECTION_CHANGED_INTERRUPTED

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_INTERRUPTED

      2: The connection between the SDK and the server is interrupted.

    - #### CONNECTION_CHANGED_BANNED_BY_SERVER

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_BANNED_BY_SERVER

      3: The connection between the SDK and the server is banned by the server. This error occurs when the user is kicked out of the channel by the server.

    - #### CONNECTION_CHANGED_JOIN_FAILED

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_JOIN_FAILED

      4: The SDK fails to join the channel. When the SDK fails to join the channel for more than 20 minutes, this error occurs and the SDK stops reconnecting to the channel.

    - #### CONNECTION_CHANGED_LEAVE_CHANNEL

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_LEAVE_CHANNEL

      5: The SDK has left the channel.

    - #### CONNECTION_CHANGED_INVALID_APP_ID

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_INVALID_APP_ID

      6: The connection fails because the App ID is not valid.

    - #### CONNECTION_CHANGED_INVALID_CHANNEL_NAME

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_INVALID_CHANNEL_NAME

      7: The connection fails because the channel name is not valid. Please rejoin the channel with a valid channel name.

    - #### CONNECTION_CHANGED_INVALID_TOKEN

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_INVALID_TOKEN

      8: The connection fails because the token is not valid. Typical reasons include:
      - The App Certificate for the project is enabled in Agora Console, but you do not use a token when joining the channel. If you enable the App Certificate, you must use a token to join the channel.
      - The `uid` specified when calling `joinChannel` to join the channel is inconsistent with the `uid` passed in when generating the token.

    - #### CONNECTION_CHANGED_TOKEN_EXPIRED

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_TOKEN_EXPIRED

      9: The connection fails because the token has expired.

    - #### CONNECTION_CHANGED_REJECTED_BY_SERVER

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_REJECTED_BY_SERVER

      10: The connection is rejected by the server. Typical reasons include:
      - The user is already in the channel and still calls a method, for example, `joinChannel`, to join the channel. Stop calling this method to clear this error.
      - The user tries to join the channel when conducting a pre-call test. The user needs to call the channel after the call test ends.

    - #### CONNECTION_CHANGED_SETTING_PROXY_SERVER

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_SETTING_PROXY_SERVER

      11: The connection changes to reconnecting because the SDK has set a proxy server.

    - #### CONNECTION_CHANGED_RENEW_TOKEN

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_RENEW_TOKEN

      12: The connection state changed because the token is renewed.

    - #### CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED

      13: The IP address of the client has changed, possibly because the network type, IP address, or port has been changed.

    - #### CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT

      14: Timeout for the keep-alive of the connection between the SDK and the Agora edge server. The connection state changes to CONNECTION_STATE_RECONNECTING.

    - #### CONNECTION_CHANGED_REJOIN_SUCCESS

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_REJOIN_SUCCESS

      15: The SDK has rejoined the channel successfully.

    - #### CONNECTION_CHANGED_LOST

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_LOST

      16: The connection between the SDK and the server is lost.

    - #### CONNECTION_CHANGED_ECHO_TEST

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_ECHO_TEST

      17: The change of connection state is caused by echo test.

    - #### CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED_BY_USER

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED_BY_USER

      18: The local IP Address is changed by user.

    - #### CONNECTION_CHANGED_SAME_UID_LOGIN

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_SAME_UID_LOGIN

      19: The connection is failed due to join the same channel on another device with the same uid.

    - #### CONNECTION_CHANGED_TOO_MANY_BROADCASTERS

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_TOO_MANY_BROADCASTERS

      20: The connection is failed due to too many broadcasters in the channel.

    - #### CONNECTION_CHANGED_LICENSE_VALIDATION_FAILURE

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_LICENSE_VALIDATION_FAILURE

      21: The connection is failed due to license validation failure.

    - #### CONNECTION_CHANGED_CERTIFICATION_VERYFY_FAILURE

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_CERTIFICATION_VERYFY_FAILURE

      22: The connection is failed due to certification verify failure.

    - #### CONNECTION_CHANGED_STREAM_CHANNEL_NOT_AVAILABLE

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_STREAM_CHANNEL_NOT_AVAILABLE

      23: The connection is failed due to the lack of granting permission to the stream channel.

    - #### CONNECTION_CHANGED_INCONSISTENT_APPID

          public static final Constants.ConnectionChangedReasonType CONNECTION_CHANGED_INCONSISTENT_APPID

      24: The connection is failed due to join channel with an inconsistent appid.

  - ### Field Detail

    - #### value

          private final int value

      Integer value of the connection changed reason type

  - ### Method Detail

    - #### values

          public static Constants.ConnectionChangedReasonType[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (Constants.ConnectionChangedReasonType c : Constants.ConnectionChangedReasonType.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static Constants.ConnectionChangedReasonType valueOf(java.lang.String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null

    - #### getValue

          public int getValue()

      Gets the integer value of the connection changed reason type.
      Returns:
        The integer value.

    - #### fromInt

          public static Constants.ConnectionChangedReasonType fromInt(int value)

      Converts an integer value to its corresponding ConnectionChangedReasonType enum constant.
      Parameters:
        `value` - The integer value.
      Returns:
        The corresponding ConnectionChangedReasonType, or null if the value is not found.