Interface CuratorCacheListener

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface CuratorCacheListener
Listener for CuratorCache events. The main functional interface is general purpose but you can build event specific listeners, etc. using the builder. Note: all listeners are wrapped in CuratorFramework.runSafe(Runnable) when called.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    An enumerated type that describes a change
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a builder allowing type specific, and special purpose listeners.
    void
    Called when a data is created, changed or deleted.
    default void
    When the cache is started, the initial nodes are tracked and when they are finished loading into the cache this method is called.
  • Method Details

    • event

      void event(CuratorCacheListener.Type type, ChildData oldData, ChildData data)
      Called when a data is created, changed or deleted.
      Parameters:
      type - the type of event
      oldData - the old data or null
      data - the new data or null
    • initialized

      default void initialized()
      When the cache is started, the initial nodes are tracked and when they are finished loading into the cache this method is called.
    • builder

      static CuratorCacheListenerBuilder builder()
      Returns a builder allowing type specific, and special purpose listeners.
      Returns:
      builder