public class ChannelBase.Presence
extends java.lang.Object
| Constructor and Description |
|---|
Presence() |
| Modifier and Type | Method and Description |
|---|---|
PaginatedResult<PresenceMessage> |
get(Param[] params)
Retrieves the current members present on the channel and the metadata for each member,
such as their
PresenceMessage.Action and ID. |
void |
getAsync(Param[] params,
Callback<AsyncPaginatedResult<PresenceMessage>> callback)
Asynchronously retrieves the current members present on the channel and the metadata for each member,
such as their
PresenceMessage.Action and ID. |
PaginatedResult<PresenceMessage> |
history(Param[] params)
Retrieves a
PaginatedResult object, containing an array of historical PresenceMessage objects for the channel. |
void |
historyAsync(Param[] params,
Callback<AsyncPaginatedResult<PresenceMessage>> callback)
Asynchronously retrieves a
PaginatedResult object, containing an array of historical PresenceMessage objects for the channel. |
public PaginatedResult<PresenceMessage> get(Param[] params) throws AblyException
PresenceMessage.Action and ID. Returns a PaginatedResult object,
containing an array of PresenceMessage objects.
Spec: RSPa
params - the request params:
limit (RSP3a) - An upper limit on the number of messages returned. The default is 100, and the maximum is 1000.
clientId (RSP3a2) - Filters the list of returned presence members by a specific client using its ID.
connectionId (RSP3a3) - Filters the list of returned presence members by a specific connection using its ID.
PaginatedResult object containing an array of PresenceMessage objects.AblyExceptionpublic void getAsync(Param[] params, Callback<AsyncPaginatedResult<PresenceMessage>> callback)
PresenceMessage.Action and ID. Returns a PaginatedResult object,
containing an array of PresenceMessage objects.
Spec: RSPa
params - the request params:
limit (RSP3a) - An upper limit on the number of messages returned. The default is 100, and the maximum is 1000.
clientId (RSP3a2) - Filters the list of returned presence members by a specific client using its ID.
connectionId (RSP3a3) - Filters the list of returned presence members by a specific connection using its ID.
callback - A Callback returning AsyncPaginatedResult object containing an array of PresenceMessage objects.
This callback is invoked on a background thread.
public PaginatedResult<PresenceMessage> history(Param[] params) throws AblyException
PaginatedResult object, containing an array of historical PresenceMessage objects for the channel.
If the channel is configured to persist messages,
then presence messages can be retrieved from history for up to 72 hours in the past.
If not, presence messages can only be retrieved from history for up to two minutes in the past.
Spec: RSP4a
params - the request params:
start (RSP4b1) - The time from which messages are retrieved, specified as milliseconds since the Unix epoch.
end (RSP4b1) - The time until messages are retrieved, specified as milliseconds since the Unix epoch.
direction (RSP4b2) - The order for which messages are returned in. Valid values are backwards which orders messages from most recent to oldest, or forwards which orders messages from oldest to most recent. The default is backwards. limit (RSP4b3) - An upper limit on the number of messages returned. The default is 100, and the maximum is 1000.
PaginatedResult object containing an array of PresenceMessage objects.AblyExceptionpublic void historyAsync(Param[] params, Callback<AsyncPaginatedResult<PresenceMessage>> callback)
PaginatedResult object, containing an array of historical PresenceMessage objects for the channel.
If the channel is configured to persist messages,
then presence messages can be retrieved from history for up to 72 hours in the past.
If not, presence messages can only be retrieved from history for up to two minutes in the past.
Spec: RSP4a
params - the request params:
start (RSP4b1) - The time from which messages are retrieved, specified as milliseconds since the Unix epoch.
end (RSP4b1) - The time until messages are retrieved, specified as milliseconds since the Unix epoch.
direction (RSP4b2) - The order for which messages are returned in. Valid values are backwards which orders messages from most recent to oldest, or forwards which orders messages from oldest to most recent. The default is backwards. limit (RSP4b3) - An upper limit on the number of messages returned. The default is 100, and the maximum is 1000.
callback - A Callback returning AsyncPaginatedResult object containing an array of PresenceMessage objects.
This callback is invoked on a background thread.
AblyException