Interface CachedModeledFramework<T>
- All Superinterfaces:
AutoCloseable
,Closeable
,ModeledFramework<T>
-
Method Summary
Modifier and TypeMethodDescriptioncache()
Return the cache instanceReturn a new Modeled Curator instance with all the same options but applying to the given child node of this Modeled Curator's path.AsyncStage
<List<ZNode<T>>> Same asModeledFramework.childrenAsZNodes()
but always reads from cache - i.e.void
close()
Close/stop the internally created cacheAsyncStage
<List<T>> list()
Return the instances of the base path of this cached frameworkReturn the listener container so that you can add/remove listenersSame asModeledFramework.read()
except that if the cache does not have a value for this path a direct query is made.readThrough
(org.apache.zookeeper.data.Stat storingStatIn) Same asModeledFramework.read(org.apache.zookeeper.data.Stat)
except that if the cache does not have a value for this path a direct query is made.AsyncStage
<ZNode<T>> Same asModeledFramework.readAsZNode()
except that if the cache does not have a value for this path a direct query is made.void
start()
Start the internally created cacheReturn a Modeled Curator instance with all the same options but using the given path.Methods inherited from interface org.apache.curator.x.async.modeled.ModeledFramework
cached, cached, checkExists, checkExistsOp, checkExistsOp, children, createOp, delete, delete, deleteOp, deleteOp, inTransaction, modelSpec, parent, read, read, readAsZNode, set, set, set, set, unwrap, update, update, updateOp, updateOp, versioned
-
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 interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
listenable
Listenable<ModeledCacheListener<T>> listenable()Return the listener container so that you can add/remove listeners- Returns:
- listener container
-
childrenAsZNodes
AsyncStage<List<ZNode<T>>> childrenAsZNodes()Same asModeledFramework.childrenAsZNodes()
but always reads from cache - i.e. no additional queries to ZooKeeper are made- Specified by:
childrenAsZNodes
in interfaceModeledFramework<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 implementsNodeName
, the value ofnodeName()
.- Specified by:
child
in interfaceModeledFramework<T>
- Parameters:
child
- child node.- Returns:
- new Modeled Curator instance
-
withPath
Return a Modeled Curator instance with all the same options but using the given path.- Specified by:
withPath
in interfaceModeledFramework<T>
- Parameters:
path
- new path- Returns:
- new Modeled Curator instance
-
readThrough
AsyncStage<T> readThrough()Same asModeledFramework.read()
except that if the cache does not have a value for this path a direct query is made.- Returns:
- AsyncStage
- See Also:
-
readThrough
Same asModeledFramework.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 asModeledFramework.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
-