Interface TopicNotifications.NotificationRegistration

All Superinterfaces:
Registration
Enclosing interface:
TopicNotifications

public static interface TopicNotifications.NotificationRegistration extends Registration
The NotificationRegistration represents the registration state of the associated listener on the server.

The NotificationRegistration also provides operations to control which topic paths the listener will receive notifications for.

  • Method Details

    • select

      CompletableFuture<?> select(TopicSelector selector)
      Request to receive notifications for all topics matched by the provided topic selector.
      Parameters:
      selector - the selector to register
      Returns:
      a CompletableFuture that completes when a response is received from the server.

      If 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:

    • select

      CompletableFuture<?> select(String selector)
      Request to receive notifications for all topics matched by the provided selector.

      This is equivalent to calling select(TopicSelector) with a selector parsed using TopicSelectors.parse(String).

      Parameters:
      selector - the selector to register
      Returns:
      a CompletableFuture that completes when a response is received from the server.

      If 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:

    • deselect

      CompletableFuture<?> deselect(TopicSelector selector)
      Request to stop receiving notifications for all topics matched by the given selector.
      Parameters:
      selector - the selector to register
      Returns:
      a CompletableFuture that completes when a response is received from the server.

      If 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:

    • deselect

      CompletableFuture<?> deselect(String selector)
      Request to stop receiving notifications for all topics matched by the given selector.

      This is equivalent to calling deselect(TopicSelector) with a selector parsed using TopicSelectors.parse(String).

      Parameters:
      selector - the selector to register
      Returns:
      a CompletableFuture that completes when a response is received from the server.

      If 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: