Class PresenceService
java.lang.Object
com.symphony.bdk.core.service.presence.PresenceService
- All Implemented Interfaces:
OboService<OboPresenceService>
,OboPresenceService
@API(status=STABLE)
public class PresenceService
extends Object
implements OboPresenceService, OboService<OboPresenceService>
Service class for managing user presence information.
This service is used for retrieving information about the presence of the calling user, a specified user or all users in the pod, and perform some actions related to the user presence information like:
- Set Presence to calling user
- Set Presence to a specified user
- Create a presence feed
- Read a created presence feed
- Delete a created presence feed
-
Constructor Summary
ConstructorDescriptionPresenceService
(PresenceApi presenceApi, AuthSession authSession, RetryWithRecoveryBuilder<?> retryBuilder) PresenceService
(PresenceApi presenceApi, RetryWithRecoveryBuilder<?> retryBuilder) -
Method Summary
Modifier and TypeMethodDescriptionCreates a new stream capturing online status changes ("presence feed") for the company (pod) and returns the ID of the new feed.deletePresenceFeed
(String feedId) Delete the specified presence feed that was created.void
externalPresenceInterest
(List<Long> userIds) Register interest in a list of external users to get their presence info.Get the online status (presence info) of the calling user.getUserPresence
(Long userId, Boolean local) Get the presence info of a specified user.listPresences
(Long lastUserId, Integer limit) Get the presence info of all users in a pod.obo
(AuthSession oboSession) Returns a new service instance with OBO-enabled endpoints from a given OBO session.readPresenceFeed
(String feedId) Reads the specified presence feed that was created.setPresence
(PresenceStatus status, Boolean soft) Set the presence info of the calling user.setUserPresence
(Long userId, PresenceStatus status, Boolean soft) Set the presence state of a another user.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.symphony.bdk.core.service.OboService
checkAuthSession
-
Constructor Details
-
PresenceService
public PresenceService(PresenceApi presenceApi, AuthSession authSession, RetryWithRecoveryBuilder<?> retryBuilder) -
PresenceService
-
-
Method Details
-
obo
Returns a new service instance with OBO-enabled endpoints from a given OBO session.- Specified by:
obo
in interfaceOboService<OboPresenceService>
- Parameters:
oboSession
- the OBO session- Returns:
- the instance of the service class with OBO-enabled endpoints
-
getPresence
Get the online status (presence info) of the calling user.getPresence()
- Specified by:
getPresence
in interfaceOboPresenceService
- Returns:
- Presence info of the calling user.
- See Also:
-
listPresences
Get the presence info of all users in a pod.listPresences(Long, Integer)
- Specified by:
listPresences
in interfaceOboPresenceService
- Parameters:
lastUserId
- Last user ID retrieved, used for paging. If provided, results skip users with IDs less than this parameter.limit
- Maximum number of records to return. The maximum supported value is 5000.- Returns:
- List of presence info of all users in a pod.
- See Also:
-
getUserPresence
Get the presence info of a specified user.getUserPresence(Long, Boolean)
- Specified by:
getUserPresence
in interfaceOboPresenceService
- Parameters:
userId
- User Idlocal
- If true then Perform a local query and set the presence to OFFLINE for users who are not local to the calling user’s pod. If false or absent then query the presence of all local and external users who are connected to the calling user.- Returns:
- Presence info of the looked up user.
- See Also:
-
externalPresenceInterest
Register interest in a list of external users to get their presence info.externalPresenceInterest(List)
- Specified by:
externalPresenceInterest
in interfaceOboPresenceService
- Parameters:
userIds
- List of user ids to be registered.- See Also:
-
setPresence
Set the presence info of the calling user.setPresence(PresenceStatus, Boolean)
- Specified by:
setPresence
in interfaceOboPresenceService
- Parameters:
status
- The new presence state for the user. Possible values are AVAILABLE, BUSY, AWAY, ON_THE_PHONE, BE_RIGHT_BACK, IN_A_MEETING, OUT_OF_OFFICE, OFF_WORK.soft
- If true, the user's current status is taken into consideration. If the user is currently OFFLINE, the user's presence will still be OFFLINE, but the new presence will take effect when the user comes online. If the user is currently online, the user's activity state will be applied to the presence if applicable. (e.g. if you are setting their presence to AVAILABLE, but the user is currently idle, their status will be represented as AWAY)- Returns:
- Presence info of the calling user.
- See Also:
-
createPresenceFeed
Creates a new stream capturing online status changes ("presence feed") for the company (pod) and returns the ID of the new feed. The feed will return the presence of users whose presence status has changed since it was last read.createPresenceFeed()
- Specified by:
createPresenceFeed
in interfaceOboPresenceService
- Returns:
- Presence feed Id
- See Also:
-
readPresenceFeed
Reads the specified presence feed that was created. The feed returned includes the user presence statuses that have changed since they were last read.readPresenceFeed(String)
- Specified by:
readPresenceFeed
in interfaceOboPresenceService
- Parameters:
feedId
- The presence feed id to be read.- Returns:
- The list of user presences has changed since the last presence read.
- See Also:
-
deletePresenceFeed
Delete the specified presence feed that was created.deletePresenceFeed(String)
- Specified by:
deletePresenceFeed
in interfaceOboPresenceService
- Parameters:
feedId
- The presence feed id to be deleted.- Returns:
- The id of the deleted presence feed.
-
setUserPresence
public V2Presence setUserPresence(@Nonnull Long userId, @Nonnull PresenceStatus status, @Nullable Boolean soft) Set the presence state of a another user.setUserPresence(Long, PresenceStatus, Boolean)
- Specified by:
setUserPresence
in interfaceOboPresenceService
- Parameters:
userId
- The id of the specified user.status
- Presence state to set. Possible values are AVAILABLE, BUSY, AWAY, ON_THE_PHONE, BE_RIGHT_BACK, IN_A_MEETING, OUT_OF_OFFICE, OFF_WORK.soft
- If true, the user's current status is taken into consideration. If the user is currently OFFLINE, the user's presence will still be OFFLINE, but the new presence will take effect when the user comes online. If the user is currently online, the user's activity state will be applied to the presence if applicable. (e.g. if you are setting their presence to AVAILABLE, but the user is currently idle, their status will be represented as AWAY)- Returns:
- The presence info of the specified user.
-