Class ConnectionService
java.lang.Object
com.symphony.bdk.core.service.connection.ConnectionService
- All Implemented Interfaces:
OboConnectionService
,OboService<OboConnectionService>
@API(status=STABLE)
public class ConnectionService
extends Object
implements OboConnectionService, OboService<OboConnectionService>
Service class for managing connection status.
This service is used for retrieving the connection status if the calling user with a specified user or with many other internal or external users in the pod, and perform some actions related to the connection status like:
- Send a connection request to an user
- Accept a connection request from an user
- Reject a connection request from an user
- Remove a connection with an user
-
Constructor Summary
ConstructorDescriptionConnectionService
(ConnectionApi connectionApi, AuthSession authSession, RetryWithRecoveryBuilder<?> retryBuilder) ConnectionService
(ConnectionApi connectionApi, RetryWithRecoveryBuilder<?> retryBuilder) -
Method Summary
Modifier and TypeMethodDescriptionacceptConnection
(Long userId) Accept the connection request from a requesting user.createConnection
(Long userId) Sends a connection request to another user.getConnection
(Long userId) Get connection status, i.e.listConnections
(ConnectionStatus status, List<Long> userIdList) List all current connection statuses with external or specified users.obo
(AuthSession oboSession) Returns a new service instance with OBO-enabled endpoints from a given OBO session.rejectConnection
(Long userId) Reject the connection request from a requesting user.void
removeConnection
(Long userId) Removes a connection with a 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
-
ConnectionService
public ConnectionService(ConnectionApi connectionApi, AuthSession authSession, RetryWithRecoveryBuilder<?> retryBuilder) -
ConnectionService
-
-
Method Details
-
obo
Returns a new service instance with OBO-enabled endpoints from a given OBO session.- Specified by:
obo
in interfaceOboService<OboConnectionService>
- Parameters:
oboSession
- the OBO session- Returns:
- the instance of the service class with OBO-enabled endpoints
-
getConnection
Get connection status, i.e. check if the calling user is connected to the specified user.getConnection(Long)
- Specified by:
getConnection
in interfaceOboConnectionService
- Parameters:
userId
- The id of the user with whom the caller want to check.- Returns:
- Connection status with the specified user.
- See Also:
-
listConnections
public List<UserConnection> listConnections(@Nullable ConnectionStatus status, @Nullable List<Long> userIdList) List all current connection statuses with external or specified users.listConnections(ConnectionStatus, List)
- Specified by:
listConnections
in interfaceOboConnectionService
- Parameters:
status
- Filter the connection list based on the connection status. The connection status can only be pending_incoming, pending_outgoing, accepted, rejected, or all. If you do not specify a status, all connections will be returned.userIdList
- List of user ids which are used to restrict the list of results. This can be used to return connections with internal users; although, by default, this endpoint does not list implicit connections with internal users.- Returns:
- List of connection statuses with the specified users and status.
- See Also:
-
createConnection
Sends a connection request to another user.createConnection(Long)
- Specified by:
createConnection
in interfaceOboConnectionService
- Parameters:
userId
- The id of the user with whom the caller want to connect.- Returns:
- Connection status with the specified user.
- See Also:
-
acceptConnection
Accept the connection request from a requesting user.acceptConnection(Long)
- Specified by:
acceptConnection
in interfaceOboConnectionService
- Parameters:
userId
- The id of the user who requested to connect with the caller.- Returns:
- Connection status with the requesting user.
- See Also:
-
rejectConnection
Reject the connection request from a requesting user.rejectConnection(Long)
- Specified by:
rejectConnection
in interfaceOboConnectionService
- Parameters:
userId
- The id of the user who requested to connect with the caller.- Returns:
- Connection status with the requesting user.
- See Also:
-
removeConnection
Removes a connection with a user.removeConnection(Long)
- Specified by:
removeConnection
in interfaceOboConnectionService
- Parameters:
userId
- The id of the user with whom we want to remove the connection.- See Also:
-