public class AblyRealtime extends AblyRest implements java.lang.AutoCloseable
AutoCloseable so you can use it in
try-with-resources constructs and have the JDK close it for you.| Modifier and Type | Class and Description |
|---|---|
static interface |
AblyRealtime.Channels
A collection of Channels associated with this Ably Realtime instance.
|
| Modifier and Type | Field and Description |
|---|---|
AblyRealtime.Channels |
channels |
Connection |
connection
The
Connection object for this instance. |
| Constructor and Description |
|---|
AblyRealtime(ClientOptions options)
Instance the Ably library with the given options.
|
AblyRealtime(java.lang.String key)
Instance the Ably library using a key only.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this instance.
|
void |
connect()
Initiate a connection.
|
protected void |
onAuthError(ErrorInfo errorInfo)
Authentication error occurred
|
protected void |
onAuthUpdated(java.lang.String token,
boolean waitForResponse)
Authentication token has changed.
|
onClientIdSet, publishBatch, publishBatchAsync, request, requestAsync, stats, statsAsync, time, timeAsyncpublic final Connection connection
Connection object for this instance.public final AblyRealtime.Channels channels
public AblyRealtime(java.lang.String key)
throws AblyException
key; - String key (obtained from application dashboard)AblyExceptionpublic AblyRealtime(ClientOptions options) throws AblyException
options: - see ClientOptions for optionsAblyExceptionpublic void connect()
Connection.connect().public void close()
Connection.connect().close in interface java.lang.AutoCloseableprotected void onAuthUpdated(java.lang.String token,
boolean waitForResponse)
throws AblyException
onAuthUpdated in class AblyBasetoken - new tokenwaitForResponse - wait for server response before returning from methodAblyExceptionprotected void onAuthError(ErrorInfo errorInfo)
onAuthError in class AblyBase