Class ChannelBase.Presence
- java.lang.Object
-
- io.ably.lib.rest.ChannelBase.Presence
-
- Enclosing class:
- ChannelBase
public class ChannelBase.Presence extends java.lang.ObjectEnables the retrieval of the current and historic presence set for a channel.
-
-
Constructor Summary
Constructors Constructor Description Presence()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PaginatedResult<PresenceMessage>get(Param[] params)Retrieves the current members present on the channel and the metadata for each member, such as theirPresenceMessage.Actionand ID.voidgetAsync(Param[] params, Callback<AsyncPaginatedResult<PresenceMessage>> callback)Asynchronously retrieves the current members present on the channel and the metadata for each member, such as theirPresenceMessage.Actionand ID.PaginatedResult<PresenceMessage>history(Param[] params)Retrieves aPaginatedResultobject, containing an array of historicalPresenceMessageobjects for the channel.voidhistoryAsync(Param[] params, Callback<AsyncPaginatedResult<PresenceMessage>> callback)Asynchronously retrieves aPaginatedResultobject, containing an array of historicalPresenceMessageobjects for the channel.
-
-
-
Method Detail
-
get
public PaginatedResult<PresenceMessage> get(Param[] params) throws AblyException
Retrieves the current members present on the channel and the metadata for each member, such as theirPresenceMessage.Actionand ID. Returns aPaginatedResultobject, containing an array ofPresenceMessageobjects.Spec: RSPa
- Parameters:
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.
- Returns:
- A
PaginatedResultobject containing an array ofPresenceMessageobjects. - Throws:
AblyException
-
getAsync
public 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 theirPresenceMessage.Actionand ID. Returns aPaginatedResultobject, containing an array ofPresenceMessageobjects.Spec: RSPa
- Parameters:
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 returningAsyncPaginatedResultobject containing an array ofPresenceMessageobjects.This callback is invoked on a background thread.
-
history
public PaginatedResult<PresenceMessage> history(Param[] params) throws AblyException
Retrieves aPaginatedResultobject, containing an array of historicalPresenceMessageobjects 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
- Parameters:
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.
- Returns:
- A
PaginatedResultobject containing an array ofPresenceMessageobjects. - Throws:
AblyException
-
historyAsync
public void historyAsync(Param[] params, Callback<AsyncPaginatedResult<PresenceMessage>> callback)
Asynchronously retrieves aPaginatedResultobject, containing an array of historicalPresenceMessageobjects 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
- Parameters:
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 returningAsyncPaginatedResultobject containing an array ofPresenceMessageobjects.This callback is invoked on a background thread.
- Throws:
AblyException
-
-