public class Presence
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Presence.PresenceListener
An interface allowing a listener to be notified of arrival of presence messages
|
| Modifier and Type | Method and Description |
|---|---|
void |
enter(java.lang.Object data,
CompletionListener listener)
Enter this client into this channel.
|
void |
enterClient(java.lang.String clientId)
Enter a specified client into this channel.
|
void |
enterClient(java.lang.String clientId,
java.lang.Object data)
Enter a specified client into this channel.
|
void |
enterClient(java.lang.String clientId,
java.lang.Object data,
CompletionListener listener)
Enter a specified client into this channel.
|
PresenceMessage[] |
get()
Get the presence state for this Channel.
|
PresenceMessage[] |
get(boolean wait)
Get the presence state for this Channel, optionally waiting for sync to complete.
|
PresenceMessage[] |
get(java.lang.String clientId,
boolean wait)
Get the presence state for a given clientId
|
PaginatedResult<PresenceMessage> |
history(Param[] params)
Obtain recent history for this channel using the REST API.
|
void |
leave(CompletionListener listener)
Leave this client from this channel.
|
void |
leave(java.lang.Object data,
CompletionListener listener)
Leave this client from this channel.
|
void |
leaveClient(java.lang.String clientId)
Leave a given client from this channel.
|
void |
leaveClient(java.lang.String clientId,
java.lang.Object data)
Leave a given client from this channel.
|
void |
leaveClient(java.lang.String clientId,
java.lang.Object data,
CompletionListener listener)
Leave a given client from this channel.
|
void |
subscribe(java.util.EnumSet<PresenceMessage.Action> actions,
Presence.PresenceListener listener)
Subscribe to presence events with specific actions on the associated Channel.
|
void |
subscribe(Presence.PresenceListener listener)
Subscribe to presence events on the associated Channel.
|
void |
subscribe(PresenceMessage.Action action,
Presence.PresenceListener listener)
Subscribe to presence events with a specific action on the associated Channel.
|
void |
unsubscribe()
Unsubscribe all subscribed presence lisceners for this channel.
|
void |
unsubscribe(java.util.EnumSet<PresenceMessage.Action> actions,
Presence.PresenceListener listener)
Unsubscribe a previously subscribed presence listener for this channel from specific actions.
|
void |
unsubscribe(Presence.PresenceListener listener)
Unsubscribe a previously subscribed presence listener for this channel.
|
void |
unsubscribe(PresenceMessage.Action action,
Presence.PresenceListener listener)
Unsubscribe a previously subscribed presence listener for this channel from specific action.
|
void |
update(java.lang.Object data,
CompletionListener listener)
Update the presence data for this client.
|
void |
updateClient(java.lang.String clientId)
Update the presence data for a specified client into this channel.
|
void |
updateClient(java.lang.String clientId,
java.lang.Object data)
Update the presence data for a specified client into this channel.
|
void |
updateClient(java.lang.String clientId,
java.lang.Object data,
CompletionListener listener)
Update the presence data for a specified client into this channel.
|
void |
updatePresence(PresenceMessage msg,
CompletionListener listener)
Update the presence for this channel with a given PresenceMessage update.
|
public PresenceMessage[] get()
AblyExceptionpublic PresenceMessage[] get(boolean wait) throws java.lang.InterruptedException
AblyExceptionjava.lang.InterruptedExceptionpublic PresenceMessage[] get(java.lang.String clientId, boolean wait) throws java.lang.InterruptedException
wait - java.lang.InterruptedExceptionpublic void subscribe(Presence.PresenceListener listener) throws AblyException
listener: - the listener to me notified on arrival of presence messages.AblyExceptionpublic void unsubscribe(Presence.PresenceListener listener)
listener: - the previously subscribed listener.public void subscribe(PresenceMessage.Action action, Presence.PresenceListener listener) throws AblyException
action - to be observedlistener - AblyExceptionpublic void unsubscribe(PresenceMessage.Action action, Presence.PresenceListener listener)
action - listener - public void subscribe(java.util.EnumSet<PresenceMessage.Action> actions, Presence.PresenceListener listener) throws AblyException
actions - to be observedlistener - AblyExceptionpublic void unsubscribe(java.util.EnumSet<PresenceMessage.Action> actions, Presence.PresenceListener listener)
actions - listener - public void unsubscribe()
public void enter(java.lang.Object data,
CompletionListener listener)
throws AblyException
data: - optional data (eg a status message) for this member.
See io.ably.types.Data for the supported data types.listener: - a listener to be notified on completion of the operation.AblyExceptionpublic void update(java.lang.Object data,
CompletionListener listener)
throws AblyException
data: - optional data (eg a status message) for this member.
See io.ably.types.Data for the supported data types.listener: - a listener to be notified on completion of the operation.AblyExceptionpublic void leave(java.lang.Object data,
CompletionListener listener)
throws AblyException
data: - optional data (eg a status message) for this member.
See io.ably.types.Data for the supported data types.listener: - a listener to be notified on completion of the operation.AblyExceptionpublic void leave(CompletionListener listener) throws AblyException
listener: - a listener to be notified on completion of the operation.AblyExceptionpublic void enterClient(java.lang.String clientId)
throws AblyException
clientId: - the id of the client.AblyExceptionpublic void enterClient(java.lang.String clientId,
java.lang.Object data)
throws AblyException
clientId: - the id of the client.data: - optional data (eg a status message) for this member.AblyExceptionpublic void enterClient(java.lang.String clientId,
java.lang.Object data,
CompletionListener listener)
throws AblyException
clientId: - the id of the client.data: - optional data (eg a status message) for this member.listener: - a listener to be notified on completion of the operation.AblyExceptionpublic void updateClient(java.lang.String clientId)
throws AblyException
clientId: - the id of the client.AblyExceptionpublic void updateClient(java.lang.String clientId,
java.lang.Object data)
throws AblyException
clientId: - the id of the client.data: - optional data (eg a status message) for this member.AblyExceptionpublic void updateClient(java.lang.String clientId,
java.lang.Object data,
CompletionListener listener)
throws AblyException
clientId: - the id of the client.data: - optional data (eg a status message) for this member.listener: - a listener to be notified on completion of the operation.AblyExceptionpublic void leaveClient(java.lang.String clientId)
throws AblyException
clientId: - the id of the client.AblyExceptionpublic void leaveClient(java.lang.String clientId,
java.lang.Object data)
throws AblyException
clientId: - the id of the client.data: - optional data (eg a status message) for this member.AblyExceptionpublic void leaveClient(java.lang.String clientId,
java.lang.Object data,
CompletionListener listener)
throws AblyException
clientId: - the id of the client.data: - optional data (eg a status message) for this member.listener: - a listener to be notified on completion of the operation.AblyExceptionpublic void updatePresence(PresenceMessage msg, CompletionListener listener) throws AblyException
msg: - the presence messagelistener: - a listener to be notified on completion of the operation.AblyExceptionpublic PaginatedResult<PresenceMessage> history(Param[] params) throws AblyException
params: - the request params. See the Ably REST API
documentation for more details.AblyException