-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
public class AblyRealtime extends AblyRest
A client that extends the functionality of the AblyRest and provides additional realtime-specific features. This class implements AutoCloseable so you can use it in try-with-resources constructs and have the JDK close it for you.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceAblyRealtime.ChannelsA collection of Channels associated with this Ably Realtime instance.
-
Field Summary
Fields Modifier and Type Field Description public final Connectionconnectionpublic final AblyRealtime.Channelschannels
-
Constructor Summary
Constructors Constructor Description AblyRealtime(String key)Constructs a Realtime client object using an Ably API key or token string. AblyRealtime(ClientOptions options)Constructs a RealtimeClient object using an Ably ClientOptions object.
-
Method Summary
Modifier and Type Method Description voidconnect()Calls connect and causes the connection to open,entering the connecting state. voidclose()Calls close and causes the connection to close, entering the closing state. -
Methods inherited from class io.ably.lib.rest.AblyRest
device, setAndroidContext -
Methods inherited from class io.ably.lib.rest.AblyBase
publishBatch, publishBatch, publishBatchAsync, publishBatchAsync, request, requestAsync, stats, statsAsync, time, timeAsync -
Methods inherited from class java.lang.AutoCloseable
close -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
AblyRealtime
AblyRealtime(String key)
Constructs a Realtime client object using an Ably API key or token string.- Parameters:
key- The Ably API key or token string used to validate the client.
-
AblyRealtime
AblyRealtime(ClientOptions options)
Constructs a RealtimeClient object using an Ably ClientOptions object.- Parameters:
options- A ClientOptions object.
-
-
Method Detail
-
connect
void connect()
Calls connect and causes the connection to open,entering the connecting state. Explicitly calling connect() is unnecessaryunless the autoConnect property is disabled.
Spec: RTN11
-
close
void close()
-
-
-
-