@API(status=STABLE) public class ConnectionService extends java.lang.Object implements OboConnectionService, OboService<OboConnectionService>
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:
Constructor and Description |
---|
ConnectionService(ConnectionApi connectionApi,
AuthSession authSession,
RetryWithRecoveryBuilder<?> retryBuilder) |
ConnectionService(ConnectionApi connectionApi,
RetryWithRecoveryBuilder<?> retryBuilder) |
Modifier and Type | Method and Description |
---|---|
UserConnection |
acceptConnection(java.lang.Long userId)
Accept the connection request from a requesting user.
|
UserConnection |
createConnection(java.lang.Long userId)
Sends a connection request to another user.
|
UserConnection |
getConnection(java.lang.Long userId)
Get connection status, i.e.
|
java.util.List<UserConnection> |
listConnections(ConnectionStatus status,
java.util.List<java.lang.Long> userIdList)
List all current connection statuses with external or specified users.
|
OboConnectionService |
obo(AuthSession oboSession)
Returns a new service instance with OBO-enabled endpoints from a given OBO session.
|
UserConnection |
rejectConnection(java.lang.Long userId)
Reject the connection request from a requesting user.
|
void |
removeConnection(java.lang.Long userId)
Removes a connection with a user.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkAuthSession
public ConnectionService(ConnectionApi connectionApi, AuthSession authSession, RetryWithRecoveryBuilder<?> retryBuilder)
public ConnectionService(ConnectionApi connectionApi, RetryWithRecoveryBuilder<?> retryBuilder)
public OboConnectionService obo(AuthSession oboSession)
obo
in interface OboService<OboConnectionService>
oboSession
- the OBO sessionpublic UserConnection getConnection(@Nonnull java.lang.Long userId)
getConnection(Long)
getConnection
in interface OboConnectionService
userId
- The id of the user with whom the caller want to check.public java.util.List<UserConnection> listConnections(@Nullable ConnectionStatus status, @Nullable java.util.List<java.lang.Long> userIdList)
listConnections(ConnectionStatus, List)
listConnections
in interface OboConnectionService
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.public UserConnection createConnection(@Nonnull java.lang.Long userId)
createConnection(Long)
createConnection
in interface OboConnectionService
userId
- The id of the user with whom the caller want to connect.public UserConnection acceptConnection(@Nonnull java.lang.Long userId)
acceptConnection(Long)
acceptConnection
in interface OboConnectionService
userId
- The id of the user who requested to connect with the caller.public UserConnection rejectConnection(@Nonnull java.lang.Long userId)
rejectConnection(Long)
rejectConnection
in interface OboConnectionService
userId
- The id of the user who requested to connect with the caller.public void removeConnection(@Nonnull java.lang.Long userId)
removeConnection(Long)
removeConnection
in interface OboConnectionService
userId
- The id of the user with whom we want to remove the connection.