Class SignalService
java.lang.Object
com.symphony.bdk.core.service.signal.SignalService
- All Implemented Interfaces:
OboService<OboSignalService>
,OboSignalService
@API(status=STABLE)
public class SignalService
extends Object
implements OboSignalService, OboService<OboSignalService>
Service class for managing signal information.
This service is used for listing signals related to the user, get information of a specified signal or perform some actions related to the signal like:
- Create a signal
- Update a signal
- Delete a signal
- Subscribe or unsubscribe a signal
-
Constructor Summary
ConstructorDescriptionSignalService
(SignalsApi signalsApi, AuthSession authSession, RetryWithRecoveryBuilder<?> retryBuilder) SignalService
(SignalsApi signalsApi, RetryWithRecoveryBuilder<?> retryBuilder) -
Method Summary
Modifier and TypeMethodDescriptioncreateSignal
(BaseSignal signal) Create a new signal.void
deleteSignal
(String id) Delete an existing signal.Gets details about the specified signal.Lists paginated stream of signals on behalf of the user with the default chunkSize and totalSize equal 100.listAllSignals
(StreamPaginationAttribute pagination) Lists paginated stream of signals on behalf of the user.Get the paginated stream of subscribers for a specified signal with the default chunkSize and totalSize equal to 100.listAllSubscribers
(String id, StreamPaginationAttribute pagination) Get the paginated stream of subscribers for a specified signal.Lists signals on behalf of the user with default limit equal 50.listSignals
(PaginationAttribute pagination) Lists signals on behalf of the user.Get the subscribers for a specified signal with default limit equal to 100.listSubscribers
(String id, PaginationAttribute pagination) Get the subscribers for a specified signal.obo
(AuthSession oboSession) Returns a new service instance with OBO-enabled endpoints from a given OBO session.subscribeUsersToSignal
(String id, Boolean pushed, List<Long> userIds) Subscribe a list of users to a signal.unsubscribeUsersFromSignal
(String id, List<Long> userIds) Unsubscribe a list of users from a signal.updateSignal
(String id, BaseSignal signal) Update an existing signal.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
-
SignalService
public SignalService(SignalsApi signalsApi, AuthSession authSession, RetryWithRecoveryBuilder<?> retryBuilder) -
SignalService
-
-
Method Details
-
obo
Returns a new service instance with OBO-enabled endpoints from a given OBO session.- Specified by:
obo
in interfaceOboService<OboSignalService>
- Parameters:
oboSession
- the OBO session- Returns:
- the instance of the service class with OBO-enabled endpoints
-
listSignals
Lists signals on behalf of the user.listSignals(PaginationAttribute)
- Specified by:
listSignals
in interfaceOboSignalService
- Parameters:
pagination
- The skip and limit for pagination.- Returns:
- List of signals that the user has created and public signals to which they have subscribed.
- See Also:
-
listSignals
Lists signals on behalf of the user with default limit equal 50.listSignals()
- Specified by:
listSignals
in interfaceOboSignalService
- Returns:
- List of signals that the user has created and public signals to which they have subscribed.
- See Also:
-
listAllSignals
@API(status=EXPERIMENTAL) public Stream<Signal> listAllSignals(@Nonnull StreamPaginationAttribute pagination) Lists paginated stream of signals on behalf of the user.listAllSignals(StreamPaginationAttribute)
- Specified by:
listAllSignals
in interfaceOboSignalService
- Parameters:
pagination
- The chunkSize and totalSize for pagination.- Returns:
- a
Stream
containing the signals. - See Also:
-
listAllSignals
Lists paginated stream of signals on behalf of the user with the default chunkSize and totalSize equal 100.listAllSignals()
- Specified by:
listAllSignals
in interfaceOboSignalService
- Returns:
- a
Stream
containing the signals. - See Also:
-
getSignal
Gets details about the specified signal.getSignal(String)
- Specified by:
getSignal
in interfaceOboSignalService
- Parameters:
id
- The id of the signal.- Returns:
- Details of the specified signal.
- See Also:
-
createSignal
Create a new signal.createSignal(BaseSignal)
- Specified by:
createSignal
in interfaceOboSignalService
- Parameters:
signal
- A signal object to be created.- Returns:
- A new created signal object.
- See Also:
-
updateSignal
Update an existing signal.updateSignal(String, BaseSignal)
- Specified by:
updateSignal
in interfaceOboSignalService
- Parameters:
id
- The id of the signal to be updated.signal
- The signal object to be updated.- Returns:
- The updated signal.
- See Also:
-
deleteSignal
Delete an existing signal.deleteSignal(String)
- Specified by:
deleteSignal
in interfaceOboSignalService
- Parameters:
id
- The id of the signal to be deleted.- See Also:
-
subscribeUsersToSignal
public ChannelSubscriptionResponse subscribeUsersToSignal(@Nonnull String id, @Nullable Boolean pushed, @Nullable List<Long> userIds) Subscribe a list of users to a signal.subscribeUsersToSignal(String, Boolean, List)
- Specified by:
subscribeUsersToSignal
in interfaceOboSignalService
- Parameters:
id
- The id of the signal to be subscribed.pushed
- Prevents the user from unsubscribing from the Signal (only for bulk subscriptions). Requires the canManageSignalSubscription entitlement.userIds
- List of user ids to subscribe to the signal- Returns:
- The subscription information.
- See Also:
-
unsubscribeUsersFromSignal
public ChannelSubscriptionResponse unsubscribeUsersFromSignal(@Nonnull String id, @Nullable List<Long> userIds) Unsubscribe a list of users from a signal.unsubscribeUsersFromSignal(String, List)
- Specified by:
unsubscribeUsersFromSignal
in interfaceOboSignalService
- Parameters:
id
- The id of the signal to be unsubscribed.userIds
- The list of user ids to unsubscribe from the signal.- Returns:
- The unsubscription information.
- See Also:
-
listSubscribers
public List<ChannelSubscriber> listSubscribers(@Nonnull String id, @Nonnull PaginationAttribute pagination) Get the subscribers for a specified signal.listSubscribers(String, PaginationAttribute)
- Specified by:
listSubscribers
in interfaceOboSignalService
- Parameters:
id
- The id of the specified signal.pagination
- The skip and limit for pagination.- Returns:
- List of subscribers of the signal.
- See Also:
-
listSubscribers
Get the subscribers for a specified signal with default limit equal to 100.listSubscribers(String)
- Specified by:
listSubscribers
in interfaceOboSignalService
- Parameters:
id
- The id of the specified signal.- Returns:
- List of subscribers of the signal.
- See Also:
-
listAllSubscribers
@API(status=EXPERIMENTAL) public Stream<ChannelSubscriber> listAllSubscribers(@Nonnull String id, @Nonnull StreamPaginationAttribute pagination) Get the paginated stream of subscribers for a specified signal.listAllSubscribers(String, StreamPaginationAttribute)
- Specified by:
listAllSubscribers
in interfaceOboSignalService
- Parameters:
id
- The id of the specified signal.pagination
- The chunkSize and totalSize for pagination.- Returns:
- a
Stream
containing the subscribers. - See Also:
-
listAllSubscribers
Get the paginated stream of subscribers for a specified signal with the default chunkSize and totalSize equal to 100.listAllSubscribers(String)
- Specified by:
listAllSubscribers
in interfaceOboSignalService
- Parameters:
id
- The id of the specified signal.- Returns:
- a
Stream
containing the subscribers. - See Also:
-