Class Listener


  • public abstract class Listener
    extends Object
    Builder responsible for providing fluent-like functions for building up Action instances which will respond to changes in Service configuration.
    • Constructor Detail

      • Listener

        public Listener()
    • Method Detail

      • onGlobalChange

        public Listener onGlobalChange​(Listener.Action action)
        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

        public Listener onRealmChange​(Listener.Action action)
        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

        public Listener onRealmChange​(Consumer<Realm> action)
        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

        public Listener onRealmChange​(Consumer<Realm> action,
                                      Listener.ServiceListenerEvent... events)
        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

        public Listener onSchemaChange​(Listener.Action action)
        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.