Package org.forgerock.am.config
Class Listener
java.lang.Object
org.forgerock.am.config.Listener
Builder responsible for providing fluent-like functions for building up
Action instances which will respond to changes in Service configuration.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA generic listener which will respond to a configuration or schema change event.protected static enumstatic enumRepresents an event provided to a service listener. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.google.common.collect.ArrayListMultimap<Listener.ConfigType,Listener.Action> protected final Map<Listener.ServiceListenerEvent,Collection<Consumer<Realm>>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidlisten()Start the listener.onGlobalChange(Listener.Action action) Adds an action to be invoked when the global configuration changes for the service.onRealmChange(Consumer<Realm> action) Adds an action to be invoked if the requested service changes for a realm.onRealmChange(Consumer<Realm> action, Listener.ServiceListenerEvent... events) Adds an action to be invoked if the requested service changes for a realm.onRealmChange(Listener.Action action) Adds an action to be invoked when the requested service's realm level configuration changes.onSchemaChange(Listener.Action action) Adds an action to be invoked when the requested service's schema changes.
-
Field Details
-
actions
protected final com.google.common.collect.ArrayListMultimap<Listener.ConfigType,Listener.Action> actions -
realmActions
-
-
Constructor Details
-
Listener
public Listener()
-
-
Method Details
-
onGlobalChange
Adds an action to be invoked when the global configuration changes for the service. Applies to all event types.- Parameters:
action- The action to perform when the change happens.- Returns:
- This builder.
-
onRealmChange
Adds an action to be invoked when the requested service's realm level configuration changes. Applies to all event types.- Parameters:
action- The action to perform when the change happens.- Returns:
- This builder.
-
onRealmChange
Adds an action to be invoked if the requested service changes for a realm. Applies to all event types.- Parameters:
action- The consumer to invoke with the realm.- Returns:
- This builder.
-
onRealmChange
Adds an action to be invoked if the requested service changes for a realm. Applies to the specified event types.- Parameters:
action- The consumer to invoke with the realm.events- The events to trigger the consumer for.- Returns:
- This builder.
-
onSchemaChange
Adds an action to be invoked when the requested service's schema changes. Applies to all event types.- Parameters:
action- The action to perform when the change happens.- Returns:
- This builder.
-
listen
public abstract void listen()Start the listener.
-