Package io.ably.lib.types
Class ClientOptions
- java.lang.Object
-
- io.ably.lib.rest.Auth.AuthOptions
-
- io.ably.lib.types.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 intasyncHttpThreadpoolSizeAllows the caller to specify a non-default size for the asyncHttp threadpoolbooleanautoConnectIf false, suppresses the automatic initiation of a connection when the library is instanced.intchannelRetryTimeoutChannel reattach timeout Spec: RTL13bjava.lang.StringclientIdThe id of the client represented by this instance.Auth.TokenParamsdefaultTokenParamsWhen a TokenParams object is provided, it will override the client library defaults described in TokenParams Spec: TO3j11booleanechoMessagesIf false, suppresses messages originating from this connection being echoed back on the same connection.java.lang.StringenvironmentFor development environments only; allows a non-default Ably environment to be used such as 'sandbox'.java.lang.String[]fallbackHostsSpec: TO3k6,RSC15a,RSC15b,RTN17b list of custom fallback hosts.booleanfallbackHostsUseDefaultSpec: TO3k7 Set to use default fallbackHosts even when overriding environment or restHost/realtimeHostlongfallbackRetryTimeoutSpec: TO3l10java.util.Map<java.lang.String,java.lang.String>headersFIXME: unusedinthttpMaxRetryCountMax number of fallback hosts to use as a fallback when an HTTP request to the primary host is unreachable or indicates that it is unserviceableinthttpOpenTimeoutSpec: TO313inthttpRequestTimeoutSpec: TO314booleanidempotentRestPublishingSpec: TO3nLog.LogHandlerlogHandlerLog handler: allows the client to intercept log messages and handle them in a client-specific way.intlogLevelLog level; controls the level of verbosity of log messages from the library.intportFor development environments only; allows a non-default Ably port to be specified.ProxyOptionsproxyProxy settingsbooleanpushFullWaitWhether to tell Ably to wait for push REST requests to fully wait for all their effects before responding.booleanqueueMessagesIf false, suppresses the default queueing of messages when connection states that anticipate imminent connection (connecting and disconnected).java.lang.StringrealtimeHostFor development environments only; allows a non-default Ably host to be specified for websocket connections.longrealtimeRequestTimeoutSpec: DF1bjava.lang.StringrecoverA connection recovery string, specified by a client when initialising the library with the intention of inheriting the state of an earlier connection.java.lang.StringrestHostFor development environments only; allows a non-default Ably host to be specified.booleantlsEncrypted transport: if true, TLS will be used for all connections (whether REST/HTTP or Realtime WebSocket or Comet connections).inttlsPortFor development environments only; allows a non-default Ably TLS port to be specified.Param[]transportParamsAdditional parameters to be sent in the querystring when initiating a realtime connectionbooleanuseBinaryProtocolIf false, forces the library to use the JSON encoding for REST and Realtime operations, instead of the default binary msgpack encoding.-
Fields inherited from class io.ably.lib.rest.Auth.AuthOptions
authCallback, authHeaders, authMethod, authParams, authUrl, key, queryTime, token, tokenDetails, useTokenAuth
-
-
Constructor Summary
Constructors Constructor Description ClientOptions()Default constructorClientOptions(java.lang.String key)Construct an options with a single key string.
-
-
-
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.
-
proxy
public ProxyOptions proxy
Proxy settings
-
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 AblyExceptionConstruct 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
-
-