Class Connection


public class Connection extends EventEmitter<ConnectionEvent,ConnectionStateListener>
Enables the management of a connection to Ably. Extends an EventEmitter object.

Spec: RTN4a, RTN4e, RTN4g

  • Field Details

    • state

      public ConnectionState state
      The current ConnectionState of the connection.

      Spec: RTN4d

    • reason

      public ErrorInfo reason
      An ErrorInfo object describing the last error received if a connection failure occurs.

      Spec: RTN14a

    • key

      public String key
      A unique private connection key used to recover or resume a connection, assigned by Ably. When recovering a connection explicitly, the recoveryKey is used in the recover client options as it contains both the key and the last message serial. This private connection key can also be used by other REST clients to publish on behalf of this client. See the publishing over REST on behalf of a realtime client docs for more info.

      Spec: RTN9

    • recoveryKey

      @Deprecated public String recoveryKey
      Deprecated.
      use createRecoveryKey method instead.
      The recovery key string can be used by another client to recover this connection's state in the recover client options property. See connection state recover options for more information.

      Spec: RTN16m

    • id

      public String id
      A unique public identifier for this connection, used to identify this member.

      Spec: RTN8

    • connectionManager

      public final ConnectionManager connectionManager
  • Method Details