Interface CachedModeledFramework<T>

All Superinterfaces:
AutoCloseable, Closeable, ModeledFramework<T>

public interface CachedModeledFramework<T> extends ModeledFramework<T>, Closeable
  • Method Details

    • cache

      ModeledCache<T> cache()
      Return the cache instance
      Returns:
      cache
    • start

      void start()
      Start the internally created cache
    • close

      void close()
      Close/stop the internally created cache
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • listenable

      Return the listener container so that you can add/remove listeners
      Returns:
      listener container
    • childrenAsZNodes

      AsyncStage<List<ZNode<T>>> childrenAsZNodes()
      Same as ModeledFramework.childrenAsZNodes() but always reads from cache - i.e. no additional queries to ZooKeeper are made
      Specified by:
      childrenAsZNodes in interface ModeledFramework<T>
      Returns:
      AsyncStage stage
      See Also:
    • child

      Return a new Modeled Curator instance with all the same options but applying to the given child node of this Modeled Curator's path. E.g. if this Modeled Curator instance applies to "/a/b", calling modeled.at("c") returns an instance that applies to "/a/b/c".

      The replacement is the toString() value of child or, if it implements NodeName, the value of nodeName().

      Specified by:
      child in interface ModeledFramework<T>
      Parameters:
      child - child node.
      Returns:
      new Modeled Curator instance
    • withPath

      CachedModeledFramework<T> withPath(ZPath path)
      Return a Modeled Curator instance with all the same options but using the given path.
      Specified by:
      withPath in interface ModeledFramework<T>
      Parameters:
      path - new path
      Returns:
      new Modeled Curator instance
    • readThrough

      AsyncStage<T> readThrough()
      Same as ModeledFramework.read() except that if the cache does not have a value for this path a direct query is made.
      Returns:
      AsyncStage
      See Also:
    • readThrough

      AsyncStage<T> readThrough(org.apache.zookeeper.data.Stat storingStatIn)
      Same as ModeledFramework.read(org.apache.zookeeper.data.Stat) except that if the cache does not have a value for this path a direct query is made.
      Parameters:
      storingStatIn - the stat for the new ZNode is stored here
      Returns:
      AsyncStage
      See Also:
    • readThroughAsZNode

      AsyncStage<ZNode<T>> readThroughAsZNode()
      Same as ModeledFramework.readAsZNode() except that if the cache does not have a value for this path a direct query is made.
      Returns:
      AsyncStage
      See Also:
    • list

      AsyncStage<List<T>> list()
      Return the instances of the base path of this cached framework
      Returns:
      listing of all models in the base path