Interface CachedModeledFramework<T>
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable,ModeledFramework<T>
public interface CachedModeledFramework<T> extends ModeledFramework<T>, java.io.Closeable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ModeledCache<T>cache()Return the cache instanceCachedModeledFramework<T>child(java.lang.Object 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.AsyncStage<java.util.List<ZNode<T>>>childrenAsZNodes()Same asModeledFramework.childrenAsZNodes()but always reads from cache - i.e.voidclose()Close/stop the internally created cacheAsyncStage<java.util.List<T>>list()Return the instances of the base path of this cached frameworkorg.apache.curator.framework.listen.Listenable<ModeledCacheListener<T>>listenable()Return the listener container so that you can add/remove listenersAsyncStage<T>readThrough()Same asModeledFramework.read()except that if the cache does not have a value for this path a direct query is made.AsyncStage<T>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>>readThroughAsZNode()Same asModeledFramework.readAsZNode()except that if the cache does not have a value for this path a direct query is made.voidstart()Start the internally created cacheCachedModeledFramework<T>withPath(ZPath path)Return 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 Detail
-
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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
listenable
org.apache.curator.framework.listen.Listenable<ModeledCacheListener<T>> listenable()
Return the listener container so that you can add/remove listeners- Returns:
- listener container
-
childrenAsZNodes
AsyncStage<java.util.List<ZNode<T>>> childrenAsZNodes()
Same asModeledFramework.childrenAsZNodes()but always reads from cache - i.e. no additional queries to ZooKeeper are made- Specified by:
childrenAsZNodesin interfaceModeledFramework<T>- Returns:
- AsyncStage stage
- See Also:
AsyncStage
-
child
CachedModeledFramework<T> child(java.lang.Object 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:
childin interfaceModeledFramework<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:
withPathin 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:
AsyncStage
-
readThrough
AsyncStage<T> 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.- Parameters:
storingStatIn- the stat for the new ZNode is stored here- Returns:
- AsyncStage
- See Also:
AsyncStage
-
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:
AsyncStage
-
list
AsyncStage<java.util.List<T>> list()
Return the instances of the base path of this cached framework- Returns:
- listing of all models in the base path
-
-