Interface NotificationBroker
-
- All Known Implementing Classes:
CTSNotificationBroker,InMemoryNotificationBroker,NullNotificationBroker
public interface NotificationBrokerDelivers notifications to subscribers of topics.A
NotificationBrokercan be shut down, which will cause it to reject new notifications.- Since:
- 14.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanpublish(Topic topic, org.forgerock.json.JsonValue notification)Publish passes the notification onto subscribers of the topic.voidshutdown()Initiates an orderly shutdown in which previously published notifications are delivered, but no new notifications will be accepted.Subscriptionsubscribe(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- topicnotification- 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.
-
-