Interface RetainedMessageStore


  • @DoNotImplement
    public interface RetainedMessageStore
    The retained message store allows the management of retained messages from within extensions.
    Since:
    4.0.0
    • Method Detail

      • getRetainedMessage

        @NotNull java.util.concurrent.CompletableFuture<java.util.Optional<RetainedPublish>> getRetainedMessage​(@NotNull java.lang.String topic)
        Get the retained message for a topic, if it exist.

        CompletableFuture fails with a RateLimitExceededException if the extension service rate limit was exceeded.

        Parameters:
        topic - The topic.
        Returns:
        A CompletableFuture which contains the retained message for the specific topic or null.
        Since:
        4.0.0
      • remove

        @NotNull java.util.concurrent.CompletableFuture<java.lang.Void> remove​(@NotNull java.lang.String topic)
        Removes the retained message for the given topic. If there isn't any retained message on the topic yet, nothing will happen.

        CompletableFuture fails with a RateLimitExceededException if the extension service rate limit was exceeded.

        Parameters:
        topic - The topic from which the retained message should be removed.
        Returns:
        A CompletableFuture which returns after removal.
        Since:
        4.0.0
      • clear

        @NotNull java.util.concurrent.CompletableFuture<java.lang.Void> clear()
        Removes all retained messages from the message store.

        CompletableFuture fails with a RateLimitExceededException if the extension service rate limit was exceeded.

        Returns:
        A CompletableFuture which returns after removal.
        Since:
        4.0.0
      • addOrReplace

        @NotNull java.util.concurrent.CompletableFuture<java.lang.Void> addOrReplace​(@NotNull RetainedPublish retainedPublish)
        This method adds or replaces a retained message.

        CompletableFuture fails with a RateLimitExceededException if the extension service rate limit was exceeded.

        CompletableFuture fails with a DoNotImplementException if the retained publish is implemented by the extension.

        Parameters:
        retainedPublish - Retained publish which should be added or replaced.
        Returns:
        A CompletableFuture which returns after adding or replacing the retained publish.
        Since:
        4.0.0