@API(status=STABLE) public class SignalService extends java.lang.Object implements OboSignalService, OboService<OboSignalService>
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:
Constructor and Description |
---|
SignalService(SignalsApi signalsApi,
AuthSession authSession,
RetryWithRecoveryBuilder<?> retryBuilder) |
SignalService(SignalsApi signalsApi,
RetryWithRecoveryBuilder<?> retryBuilder) |
Modifier and Type | Method and Description |
---|---|
Signal |
createSignal(BaseSignal signal)
Create a new signal.
|
void |
deleteSignal(java.lang.String id)
Delete an existing signal.
|
Signal |
getSignal(java.lang.String id)
Gets details about the specified signal.
|
java.util.stream.Stream<Signal> |
listAllSignals()
Lists paginated stream of signals on behalf of the user with the default chunkSize and totalSize equal 100.
|
java.util.stream.Stream<Signal> |
listAllSignals(StreamPaginationAttribute pagination)
Lists paginated stream of signals on behalf of the user.
|
java.util.stream.Stream<ChannelSubscriber> |
listAllSubscribers(java.lang.String id)
Get the paginated stream of subscribers for a specified signal with the default chunkSize and totalSize equal to 100.
|
java.util.stream.Stream<ChannelSubscriber> |
listAllSubscribers(java.lang.String id,
StreamPaginationAttribute pagination)
Get the paginated stream of subscribers for a specified signal.
|
java.util.List<Signal> |
listSignals()
Lists signals on behalf of the user with default limit equal 50.
|
java.util.List<Signal> |
listSignals(PaginationAttribute pagination)
Lists signals on behalf of the user.
|
java.util.List<ChannelSubscriber> |
listSubscribers(java.lang.String id)
Get the subscribers for a specified signal with default limit equal to 100.
|
java.util.List<ChannelSubscriber> |
listSubscribers(java.lang.String id,
PaginationAttribute pagination)
Get the subscribers for a specified signal.
|
OboSignalService |
obo(AuthSession oboSession)
Returns a new service instance with OBO-enabled endpoints from a given OBO session.
|
ChannelSubscriptionResponse |
subscribeUsersToSignal(java.lang.String id,
java.lang.Boolean pushed,
java.util.List<java.lang.Long> userIds)
Subscribe a list of users to a signal.
|
ChannelSubscriptionResponse |
unsubscribeUsersFromSignal(java.lang.String id,
java.util.List<java.lang.Long> userIds)
Unsubscribe a list of users from a signal.
|
Signal |
updateSignal(java.lang.String id,
BaseSignal signal)
Update an existing signal.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkAuthSession
public SignalService(SignalsApi signalsApi, AuthSession authSession, RetryWithRecoveryBuilder<?> retryBuilder)
public SignalService(SignalsApi signalsApi, RetryWithRecoveryBuilder<?> retryBuilder)
public OboSignalService obo(AuthSession oboSession)
obo
in interface OboService<OboSignalService>
oboSession
- the OBO sessionpublic java.util.List<Signal> listSignals(@Nonnull PaginationAttribute pagination)
listSignals(PaginationAttribute)
listSignals
in interface OboSignalService
pagination
- The skip and limit for pagination.public java.util.List<Signal> listSignals()
listSignals()
listSignals
in interface OboSignalService
@API(status=EXPERIMENTAL) public java.util.stream.Stream<Signal> listAllSignals(@Nonnull StreamPaginationAttribute pagination)
listAllSignals(StreamPaginationAttribute)
listAllSignals
in interface OboSignalService
pagination
- The chunkSize and totalSize for pagination.Stream
containing the signals.@API(status=EXPERIMENTAL) public java.util.stream.Stream<Signal> listAllSignals()
listAllSignals()
listAllSignals
in interface OboSignalService
Stream
containing the signals.public Signal getSignal(@Nonnull java.lang.String id)
getSignal(String)
getSignal
in interface OboSignalService
id
- The id of the signal.public Signal createSignal(@Nonnull BaseSignal signal)
createSignal(BaseSignal)
createSignal
in interface OboSignalService
signal
- A signal object to be created.public Signal updateSignal(@Nonnull java.lang.String id, @Nonnull BaseSignal signal)
updateSignal(String, BaseSignal)
updateSignal
in interface OboSignalService
id
- The id of the signal to be updated.signal
- The signal object to be updated.public void deleteSignal(@Nonnull java.lang.String id)
deleteSignal(String)
deleteSignal
in interface OboSignalService
id
- The id of the signal to be deleted.public ChannelSubscriptionResponse subscribeUsersToSignal(@Nonnull java.lang.String id, @Nullable java.lang.Boolean pushed, @Nullable java.util.List<java.lang.Long> userIds)
subscribeUsersToSignal(String, Boolean, List)
subscribeUsersToSignal
in interface OboSignalService
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 signalpublic ChannelSubscriptionResponse unsubscribeUsersFromSignal(@Nonnull java.lang.String id, @Nullable java.util.List<java.lang.Long> userIds)
unsubscribeUsersFromSignal(String, List)
unsubscribeUsersFromSignal
in interface OboSignalService
id
- The id of the signal to be unsubscribed.userIds
- The list of user ids to unsubscribe from the signal.public java.util.List<ChannelSubscriber> listSubscribers(@Nonnull java.lang.String id, @Nonnull PaginationAttribute pagination)
listSubscribers(String, PaginationAttribute)
listSubscribers
in interface OboSignalService
id
- The id of the specified signal.pagination
- The skip and limit for pagination.public java.util.List<ChannelSubscriber> listSubscribers(@Nonnull java.lang.String id)
listSubscribers(String)
listSubscribers
in interface OboSignalService
id
- The id of the specified signal.@API(status=EXPERIMENTAL) public java.util.stream.Stream<ChannelSubscriber> listAllSubscribers(@Nonnull java.lang.String id, @Nonnull StreamPaginationAttribute pagination)
listAllSubscribers(String, StreamPaginationAttribute)
listAllSubscribers
in interface OboSignalService
id
- The id of the specified signal.pagination
- The chunkSize and totalSize for pagination.Stream
containing the subscribers.@API(status=EXPERIMENTAL) public java.util.stream.Stream<ChannelSubscriber> listAllSubscribers(@Nonnull java.lang.String id)
listAllSubscribers(String)
listAllSubscribers
in interface OboSignalService
id
- The id of the specified signal.Stream
containing the subscribers.