public class ClientOptions extends Auth.AuthOptions
AblyRest or the AblyRealtime.
Extends an Auth.AuthOptions object.
Spec: TO3j
| Modifier and Type | Field and Description |
|---|---|
boolean |
addRequestIds
When true, every REST request to Ably should include a random string in the request_id query string parameter.
|
java.util.Map<java.lang.String,java.lang.String> |
agents
A set of additional entries for the Ably agent header.
|
int |
asyncHttpThreadpoolSize
Allows the caller to specify a non-default size for the asyncHttp threadpool
|
boolean |
autoConnect
When true, the client connects to Ably as soon as it is instantiated.
|
int |
channelRetryTimeout
When a channel becomes
ChannelState.suspended
following a server initiated ChannelState.detached,
after this delay, if the channel is still ChannelState.suspended
and the connection is ConnectionState.connected,
the client library will attempt to re-attach the channel automatically. |
java.lang.String |
clientId
A client ID, used for identifying this client when publishing messages or for presence purposes.
|
Auth.TokenParams |
defaultTokenParams
When a
Auth.TokenParams object is provided, it overrides the client library
defaults when issuing new Ably Tokens or Ably Auth.TokenRequest. |
long |
disconnectedRetryTimeout
When the connection enters the disconnected state, after this timeout,
if the state is still disconnected, the client library will attempt to reconnect automatically.
|
boolean |
echoMessages
If false, prevents messages originating from this connection being echoed back on the same connection.
|
java.lang.String |
environment
Enables a custom environment to be used with the Ably service.
|
java.lang.String[] |
fallbackHosts
An array of fallback hosts to be used in the case of an error necessitating the use of an alternative host.
|
boolean |
fallbackHostsUseDefault
Deprecated.
|
long |
fallbackRetryTimeout
The maximum time before HTTP requests are retried against the default endpoint.
|
java.util.Map<java.lang.String,java.lang.String> |
headers
FIXME: unused
|
int |
httpMaxRetryCount
The maximum 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 |
httpMaxRetryDuration
Denotes elapsed time in which fallback host retries for HTTP requests will be attempted.
|
int |
httpOpenTimeout
Timeout for opening a connection to Ably to initiate an HTTP request.
|
int |
httpRequestTimeout
Timeout for a client performing a complete HTTP request to Ably, including the connection phase.
|
boolean |
idempotentRestPublishing
When true, enables idempotent publishing by assigning a unique message ID client-side,
allowing the Ably servers to discard automatic publish retries following a failure such as a network fault.
|
Storage |
localStorage
Custom Local Device storage.
|
Log.LogHandler |
logHandler
Controls the log output of the library.
|
int |
logLevel
Controls the verbosity of the logs output from the library.
|
int |
port
Enables 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, this disables the default behavior whereby the library queues messages
on a connection in the disconnected or connecting states.
|
java.lang.String |
realtimeHost
Enables a non-default Ably host to be specified for realtime connections.
|
long |
realtimeRequestTimeout
Timeout for the wait of acknowledgement for operations performed via a realtime connection,
before the client library considers a request failed and triggers a failure condition.
|
java.lang.String |
recover
Enables a connection to inherit the state of a previous connection that may have existed under a
different instance of the Realtime library.
|
java.lang.String |
restHost
Enables a non-default Ably host to be specified.
|
long |
suspendedRetryTimeout
This is a timeout when the connection enters the suspendedState.
|
boolean |
tls
When false, the client will use an insecure connection.
|
int |
tlsPort
Enables a non-default Ably TLS port to be specified.
|
Param[] |
transportParams
A set of key-value pairs that can be used to pass in arbitrary connection parameters,
such as heartbeatInterval
or remainPresentFor.
|
boolean |
useBinaryProtocol
When true, the more efficient MsgPack binary encoding is used.
|
authCallback, authHeaders, authMethod, authParams, authUrl, key, queryTime, token, tokenDetails, useTokenAuth| Constructor and Description |
|---|
ClientOptions()
Creates a ClientOptions instance used to configure Rest and Realtime clients
|
ClientOptions(java.lang.String key)
Creates a ClientOptions instance used to configure Rest and Realtime clients
|
public java.lang.String clientId
Spec: RSC17, RSA4, RSA15, TO3a
public int logLevel
Spec: TO3b
public Log.LogHandler logHandler
Spec: TO3c
public boolean tls
Spec: RSC18, TO3d
public java.util.Map<java.lang.String,java.lang.String> headers
public java.lang.String restHost
Spec: RSC12, TO3k2
public java.lang.String realtimeHost
Spec: RTC1d, TO3k3
public int port
Spec: TO3k4
public int tlsPort
Spec: TO3k5
public boolean autoConnect
Connection.connect() method. The default is true.
Spec: RTC1b, TO3e
public boolean useBinaryProtocol
Spec: TO3f
public boolean queueMessages
Spec: RTP16b, TO3g
public boolean echoMessages
Spec: RTC1a, TO3h
public java.lang.String recover
Spec: RTC1c, TO3i
public ProxyOptions proxy
public java.lang.String environment
Spec: RSC15b, TO3k1
public boolean idempotentRestPublishing
Spec: RSL1k1, RTL6a1, TO3n
public int httpOpenTimeout
Spec: TO3l3
public int httpRequestTimeout
Spec: TO3l4
public int httpMaxRetryDuration
public int httpMaxRetryCount
Spec: TO3l5
public long realtimeRequestTimeout
Spec: TO3l11
public long disconnectedRetryTimeout
Spec: TO3l1
public java.lang.String[] fallbackHosts
Spec: RSC15b, RSC15a, TO3k6
public long suspendedRetryTimeout
Spec: RTN14d, TO3l2
@Deprecated public boolean fallbackHostsUseDefault
Spec: RSC15b, RSC15a, TO3k6
public long fallbackRetryTimeout
Spec: TO3l10
public Auth.TokenParams defaultTokenParams
Auth.TokenParams object is provided, it overrides the client library
defaults when issuing new Ably Tokens or Ably Auth.TokenRequest.
Spec: TO3j11
public int channelRetryTimeout
ChannelState.suspended
following a server initiated ChannelState.detached,
after this delay, if the channel is still ChannelState.suspended
and the connection is ConnectionState.connected,
the client library will attempt to re-attach the channel automatically.
The default is 15 seconds.
Spec: RTL13b, TO3l7
public Param[] transportParams
Spec: RTC1f
public int asyncHttpThreadpoolSize
public boolean pushFullWait
public Storage localStorage
public boolean addRequestIds
ErrorInfo returned to the user.
The default is false.
Spec: TO3p
public java.util.Map<java.lang.String,java.lang.String> agents
Spec: RSC7d6
public ClientOptions()
public ClientOptions(java.lang.String key)
throws AblyException
key - the key obtained from the application dashboard.AblyException - if the key is not in a valid format