Interface NotificationBroker

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean publish​(Topic topic, org.forgerock.json.JsonValue notification)
      Publish passes the notification onto subscribers of the topic.
      void shutdown()
      Initiates an orderly shutdown in which previously published notifications are delivered, but no new notifications will be accepted.
      Subscription subscribe​(Consumer consumer)
      Creates a new subscription that is initially not bound to any topics.
    • Method Detail

      • publish

        boolean publish​(Topic topic,
                        org.forgerock.json.JsonValue notification)
        Publish passes the notification onto subscribers of the topic. If there are no subscribers to the same topic, the notification is discarded.

        Publishing notifications may fail and this is signalled by returning false.

        Parameters:
        topic - topic
        notification - notification
        Returns:
        attempts to give some indication whether the topic was successfully published. False gives a guarantee that publication definitely failed.
      • subscribe

        Subscription subscribe​(Consumer consumer)
        Creates a new subscription that is initially not bound to any topics.

        The given consumer will be called for each notification that is published to any of the bound topics.

        Parameters:
        consumer - a consumer that will be called once per published notification
        Returns:
        a new subscriber
      • shutdown

        void shutdown()
        Initiates an orderly shutdown in which previously published notifications are delivered, but no new notifications will be accepted. Invocation has no additional effect if already shut down.