public static interface TopicNotifications.NotificationRegistration extends Registration
The NotificationRegistration also provides operations to control which topic paths the listener will receive notifications for.
Modifier and Type | Method and Description |
---|---|
CompletableFuture<?> |
deselect(String selector)
Request to stop receiving notifications for all topics matched by the
given selector.
|
CompletableFuture<?> |
deselect(TopicSelector selector)
Request to stop receiving notifications for all topics matched by the
given selector.
|
CompletableFuture<?> |
select(String selector)
Request to receive notifications for all topics matched by the
provided selector.
|
CompletableFuture<?> |
select(TopicSelector selector)
Request to receive notifications for all topics matched by the
provided topic selector.
|
close
CompletableFuture<?> select(TopicSelector selector)
selector
- the selector to registerIf the selection completes successfully, the CompletableFuture result will be null. The result type is any rather than Void to provide forward compatibility with future iterations of this API that may provide a non-null result with a more specific result type.
Otherwise, the CompletableFuture will complete exceptionally
with a CompletionException
. Common reasons for
failure, listed by the exception reported as the
cause
, include:
PermissionsException
– if the calling
session does not have SELECT_TOPIC
permission for the
path prefix of the selector expression;
SessionClosedException
– if the session is
closed.
CompletableFuture<?> select(String selector)
This is equivalent to calling select(TopicSelector)
with a
selector parsed using TopicSelectors.parse(String)
.
selector
- the selector to registerIf the selection completes successfully, the CompletableFuture result will be null. The result type is any rather than Void to provide forward compatibility with future iterations of this API that may provide a non-null result with a more specific result type.
Otherwise, the CompletableFuture will complete exceptionally
with a CompletionException
. Common reasons for
failure, listed by the exception reported as the
cause
, include:
PermissionsException
– if the calling
session does not have SELECT_TOPIC
permission for the
path prefix of the selector expression;
SessionClosedException
– if the session is
closed.
CompletableFuture<?> deselect(TopicSelector selector)
selector
- the selector to registerIf the deselection completes successfully, the CompletableFuture result will be null. The result type is any rather than Void to provide forward compatibility with future iterations of this API that may provide a non-null result with a more specific result type.
Otherwise, the CompletableFuture will complete exceptionally
with a CompletionException
. Common reasons for
failure, listed by the exception reported as the
cause
, include:
PermissionsException
– if the calling
session does not have SELECT_TOPIC
permission for the
path prefix of the selector expression;
SessionClosedException
– if the session is
closed.
CompletableFuture<?> deselect(String selector)
This is equivalent to calling deselect(TopicSelector)
with a
selector parsed using TopicSelectors.parse(String)
.
selector
- the selector to registerIf the deselection completes successfully, the CompletableFuture result will be null. The result type is any rather than Void to provide forward compatibility with future iterations of this API that may provide a non-null result with a more specific result type.
Otherwise, the CompletableFuture will complete exceptionally
with a CompletionException
. Common reasons for
failure, listed by the exception reported as the
cause
, include:
PermissionsException
– if the calling
session does not have SELECT_TOPIC
permission for the
path prefix of the selector expression;
SessionClosedException
– if the session is
closed.
Copyright © 2024 DiffusionData Ltd. All Rights Reserved.