Adds a new event listener for the specified event. The class will ignore duplicate registrations of the same listener to the same event.
The name of the event to add the listener for.
The listener callback to register.
This object, in support of a fluent API.
Deletes all items in the local user's presence state.
Provides the events emitted by this object as an Observable stream.
An Observable stream of all events emitted by this object.
Determines if the local user is available.
True if the local user is available, false otherwise.
Removes a single event listener for a specific event.
The name of the event to remove the listener for.
The listener callback to unregister.
This object, in support of a fluent API.
Adds a new event listener for the specified event. The class will ignore duplicate registrations of the same listener to the same event.
The name of the event to add the listener for.
The listener callback to register.
This object, in support of a fluent API.
Adds a single shot event listener for the specified event. The listener will be called the first time the specified event is fired after the event registration occurs, after which the registration will be removed and no further events will be passed to the listener.
The name of the event to add the listener for.
The listener callback to register.
This object, in support of a fluent API.
Returns the given user's current presence.
a username or DomainUserId
a promise that resolves with the give user's presence
Returns the current presence of all the provided users.
an array of usernames or DomainUserIds
a promise that resolves with the give users' presences
Removes all listeners for all events. This is useful for cleanup before disposing of this particular event emitter.
This object, in support of a fluent API.
Removes a single event listener for a specific event.
The name of the event to remove the listener for.
The listener callback to unregister.
This object, in support of a fluent API.
Removes all listeners bound on the given event.
the name of the event to remove listeners for
This object, in support of a fluent API.
Removes the key-value pair of the provided key on the local user's presence state.
an existing key in the local user's presence state
Removes all the entries in the local user's presence state matching the provided array of keys.
an array of keys
The session that this client is connected with.
Sets the given items on the local user's presence state.
a Map
or object literal whose keys are String
s.
Sets a single key-value pair on the local user's presence state.
the new pair's key
the new pair's value
Returns a Map
representing the local user's presence state.
a Map
of the local user's presence state
Returns a UserPresenceSubscription linked to the provided user. From this object, consumers can get the current presence and listen to changes on the user's presence state or availability.
Make sure to UserPresenceSubscription.unsubscribe when you're done with the returned subscription.
a username or DomainUserId
a promise that resolves with a subscription to the given user's presence changes
Returns an array of UserPresenceSubscriptions corresponding to the provided users. From these objects, consumers can get the current presence and listen to changes on the user's presence state or availability.
Make sure to UserPresenceSubscription.unsubscribe when you're done with the returned subscriptions.
an array of usernames or DomainUserIds
a promise that resolves with an array of subscriptions to the given users' presence changes
A mapping of the events this service could emit to each event's unique name. Use this to refer an event name:
presenceService.on(PresenceService.Events.STATE_SET, function listener(e) {
// ...
})
The PresenceService is the main entry point into Convergence's User Presence subsystem. User Presence tracks the availability and state of Domain Users within the System. Users are generally available or not if they have at least one session that is connected. Each user in the system can set presence state. Presence state is global for each user in that the state is shared across all sessions.
See the developer guide for additional background.
See PresenceServiceEvents for the events that may be emitted on this service.