MigratoryDataPresenceListener::User

Interface to handle user presence events.

Public Functions

Name
String getExternalToken()
Get the external token of the user.
long getSessionId()
Get the session id assigned by the MigratoryData server to the user.
List< String > getSubjects()
Get the list of subscribed subjects by the user.
boolean isOffline()
Determine if the user is offline.
Map< String, Object > getAdditionalInfo()
Get additional attributes of the user presence event as key/value pairs.

Public Functions Documentation

function getExternalToken

String getExternalToken()

Get the external token of the user.

Return: the external token of the user

function getSessionId

long getSessionId()

Get the session id assigned by the MigratoryData server to the user.

Return: the session id of the user

function getSubjects

List< String > getSubjects()

Get the list of subscribed subjects by the user.

Return: the list of subscribed subjects of the user

function isOffline

boolean isOffline()

Determine if the user is offline.

Return: true if the user is offline, and false otherwise

function getAdditionalInfo

Map< String, Object > getAdditionalInfo()

Get additional attributes of the user presence event as key/value pairs.

Return: a map with additional attributes of the user presence update

The following attributes are currently available:

  • address - the Internet address of the user
  • entitlementToken - the entitlement token of the user
  • local - specify whether the received user presence event is triggered by the local server of the cluster, or it has been received from the other server of the cluster as part of the presence replication across the cluster
  • monotonicId - the monotonic incremented id generated on the client-side which is used to preserve the order between connect and disconnect events; if the monotonicId of a presence event is smaller than the current monotonicId of the user maintained by the presence plugin, then it means that the received presence event is an old, delayed presence event, so it can be ignored; if a monotonicId is not attached on the client side, then its default value is -1

Updated on 9 November 2020 at 21:01:04 EET