Class ClientOptions

  • Direct Known Subclasses:
    DebugOptions

    public class ClientOptions
    extends Auth.AuthOptions
    Options: Ably library options for REST and Realtime APIs
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int asyncHttpThreadpoolSize
      Allows the caller to specify a non-default size for the asyncHttp threadpool
      boolean autoConnect
      If false, suppresses the automatic initiation of a connection when the library is instanced.
      int channelRetryTimeout
      Channel reattach timeout Spec: RTL13b
      java.lang.String clientId
      The id of the client represented by this instance.
      Auth.TokenParams defaultTokenParams
      When a TokenParams object is provided, it will override the client library defaults described in TokenParams Spec: TO3j11
      boolean echoMessages
      If false, suppresses messages originating from this connection being echoed back on the same connection.
      java.lang.String environment
      For development environments only; allows a non-default Ably environment to be used such as 'sandbox'.
      java.lang.String[] fallbackHosts
      Spec: TO3k6,RSC15a,RSC15b,RTN17b list of custom fallback hosts.
      boolean fallbackHostsUseDefault
      Spec: TO3k7 Set to use default fallbackHosts even when overriding environment or restHost/realtimeHost
      long fallbackRetryTimeout
      Spec: TO3l10
      java.util.Map<java.lang.String,​java.lang.String> headers
      FIXME: unused
      int httpMaxRetryCount
      Max number of fallback hosts to use as a fallback when an HTTP request to the primary host is unreachable or indicates that it is unserviceable
      int httpOpenTimeout
      Spec: TO313
      int httpRequestTimeout
      Spec: TO314
      boolean idempotentRestPublishing
      Spec: TO3n
      Log.LogHandler logHandler
      Log handler: allows the client to intercept log messages and handle them in a client-specific way.
      int logLevel
      Log level; controls the level of verbosity of log messages from the library.
      int port
      For development environments only; allows a non-default Ably port to be specified.
      ProxyOptions proxy
      Proxy settings
      boolean pushFullWait
      Whether to tell Ably to wait for push REST requests to fully wait for all their effects before responding.
      boolean queueMessages
      If false, suppresses the default queueing of messages when connection states that anticipate imminent connection (connecting and disconnected).
      java.lang.String realtimeHost
      For development environments only; allows a non-default Ably host to be specified for websocket connections.
      long realtimeRequestTimeout
      Spec: DF1b
      java.lang.String recover
      A connection recovery string, specified by a client when initialising the library with the intention of inheriting the state of an earlier connection.
      java.lang.String restHost
      For development environments only; allows a non-default Ably host to be specified.
      boolean tls
      Encrypted transport: if true, TLS will be used for all connections (whether REST/HTTP or Realtime WebSocket or Comet connections).
      int tlsPort
      For development environments only; allows a non-default Ably TLS port to be specified.
      Param[] transportParams
      Additional parameters to be sent in the querystring when initiating a realtime connection
      boolean useBinaryProtocol
      If false, forces the library to use the JSON encoding for REST and Realtime operations, instead of the default binary msgpack encoding.
    • Constructor Summary

      Constructors 
      Constructor Description
      ClientOptions()
      Default constructor
      ClientOptions​(java.lang.String key)
      Construct an options with a single key string.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • clientId

        public java.lang.String clientId
        The id of the client represented by this instance. The clientId is relevant to presence operations, where the clientId is the principal identifier of the client in presence update messages. The clientId is also relevant to authentication; a token issued for a specific client may be used to authenticate the bearer of that token to the service.
      • logLevel

        public int logLevel
        Log level; controls the level of verbosity of log messages from the library.
      • logHandler

        public Log.LogHandler logHandler
        Log handler: allows the client to intercept log messages and handle them in a client-specific way.
      • tls

        public boolean tls
        Encrypted transport: if true, TLS will be used for all connections (whether REST/HTTP or Realtime WebSocket or Comet connections).
      • headers

        public java.util.Map<java.lang.String,​java.lang.String> headers
        FIXME: unused
      • restHost

        public java.lang.String restHost
        For development environments only; allows a non-default Ably host to be specified.
      • realtimeHost

        public java.lang.String realtimeHost
        For development environments only; allows a non-default Ably host to be specified for websocket connections.
      • port

        public int port
        For development environments only; allows a non-default Ably port to be specified.
      • tlsPort

        public int tlsPort
        For development environments only; allows a non-default Ably TLS port to be specified.
      • autoConnect

        public boolean autoConnect
        If false, suppresses the automatic initiation of a connection when the library is instanced.
      • useBinaryProtocol

        public boolean useBinaryProtocol
        If false, forces the library to use the JSON encoding for REST and Realtime operations, instead of the default binary msgpack encoding.
      • queueMessages

        public boolean queueMessages
        If false, suppresses the default queueing of messages when connection states that anticipate imminent connection (connecting and disconnected). Instead, publish and presence state changes will fail immediately if not in the connected state.
      • echoMessages

        public boolean echoMessages
        If false, suppresses messages originating from this connection being echoed back on the same connection.
      • recover

        public java.lang.String recover
        A connection recovery string, specified by a client when initialising the library with the intention of inheriting the state of an earlier connection. See the Ably Realtime API documentation for further information on connection state recovery.
      • environment

        public java.lang.String environment
        For development environments only; allows a non-default Ably environment to be used such as 'sandbox'. Spec: TO3k1
      • idempotentRestPublishing

        public boolean idempotentRestPublishing
        Spec: TO3n
      • httpOpenTimeout

        public int httpOpenTimeout
        Spec: TO313
      • httpRequestTimeout

        public int httpRequestTimeout
        Spec: TO314
      • httpMaxRetryCount

        public int httpMaxRetryCount
        Max number of fallback hosts to use as a fallback when an HTTP request to the primary host is unreachable or indicates that it is unserviceable
      • realtimeRequestTimeout

        public long realtimeRequestTimeout
        Spec: DF1b
      • fallbackHosts

        public java.lang.String[] fallbackHosts
        Spec: TO3k6,RSC15a,RSC15b,RTN17b list of custom fallback hosts.
      • fallbackHostsUseDefault

        public boolean fallbackHostsUseDefault
        Spec: TO3k7 Set to use default fallbackHosts even when overriding environment or restHost/realtimeHost
      • fallbackRetryTimeout

        public long fallbackRetryTimeout
        Spec: TO3l10
      • defaultTokenParams

        public Auth.TokenParams defaultTokenParams
        When a TokenParams object is provided, it will override the client library defaults described in TokenParams Spec: TO3j11
      • channelRetryTimeout

        public int channelRetryTimeout
        Channel reattach timeout Spec: RTL13b
      • transportParams

        public Param[] transportParams
        Additional parameters to be sent in the querystring when initiating a realtime connection
      • asyncHttpThreadpoolSize

        public int asyncHttpThreadpoolSize
        Allows the caller to specify a non-default size for the asyncHttp threadpool
      • pushFullWait

        public boolean pushFullWait
        Whether to tell Ably to wait for push REST requests to fully wait for all their effects before responding.
    • Constructor Detail

      • ClientOptions

        public ClientOptions()
        Default constructor
      • ClientOptions

        public ClientOptions​(java.lang.String key)
                      throws AblyException
        Construct an options with a single key string. The key string is obtained from the application dashboard.
        Parameters:
        key - : the key string
        Throws:
        AblyException - if the key is not in a valid format