Class ModeledFrameworkImpl<T>
- All Implemented Interfaces:
- ModeledFramework<T>
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T> ModeledFrameworkImpl<T> build(AsyncCuratorFramework client, ModelSpec<T> model, WatchMode watchMode, UnaryOperator<org.apache.zookeeper.WatchedEvent> watcherFilter, UnhandledErrorListener unhandledErrorListener, UnaryOperator<CuratorEvent> resultFilter, Set<ModeledOptions> modeledOptions) cached()Use an internally created cache as a front for this modeled instance.cached(ExecutorService executor) Same asModeledFramework.cached()but allows for providing an executor serviceAsyncStage<org.apache.zookeeper.data.Stat> Check to see if the ZNode at this instance's path existsCheck exists operation instance that can be passed among other operations toModeledFramework.inTransaction(java.util.List)to be executed as a single transaction.checkExistsOp(int version) Check exists operation instance that can be passed among other operations toModeledFramework.inTransaction(java.util.List)to be executed as a single transaction.Return a new Modeled Curator instance with all the same options but applying to the given child node of this Modeled Curator's path.children()Return the child paths of this instance's path (in no particular order)AsyncStage<List<ZNode<T>>> Return the child paths of this instance's path (in no particular order) and deserialize into a models.Create operation instance that can be passed among other operations toModeledFramework.inTransaction(java.util.List)to be executed as a single transaction.delete()Delete the ZNode at this instance's path passing -1 for the delete versiondelete(int version) Delete the ZNode at this instance's path passing the given delete versiondeleteOp()Delete operation instance that can be passed among other operations toModeledFramework.inTransaction(java.util.List)to be executed as a single transaction.deleteOp(int version) Delete operation instance that can be passed among other operations toModeledFramework.inTransaction(java.util.List)to be executed as a single transaction.inTransaction(List<CuratorOp> operations) Invoke ZooKeeper to commit the given operations as a single transaction.static booleanisCompressed(Set<CreateOption> createOptions) Return the model being usedparent()Return a new Modeled Curator instance with all the same options but applying to the parent node of this Modeled Curator's path.read()Read the ZNode at this instance's path and deserialize into a modelread(org.apache.zookeeper.data.Stat storingStatIn) Read the ZNode at this instance's path and deserialize into a modelAsyncStage<ZNode<T>> Read the ZNode at this instance's path and deserialize into a modelCreate (or update depending on build options) a ZNode at this instance's path with a serialized version of the given modelCreate (or update depending on build options) a ZNode at this instance's path with a serialized version of the given modelCreate (or update depending on build options) a ZNode at this instance's path with a serialized form of the given modelCreate (or update depending on build options) a ZNode at this instance's path with a serialized form of the given modelunwrap()Returns the client that was originally passed toModeledFramework.wrap(org.apache.curator.x.async.AsyncCuratorFramework, ModelSpec)or the builder.AsyncStage<org.apache.zookeeper.data.Stat> Update the ZNode at this instance's path with a serialized form of the given model passing "-1" for the update versionAsyncStage<org.apache.zookeeper.data.Stat> Update the ZNode at this instance's path with a serialized form of the given model passing the given update versionUpdate operation instance that can be passed among other operations toModeledFramework.inTransaction(java.util.List)to be executed as a single transaction.Create operation instance that can be passed among other operations toModeledFramework.inTransaction(java.util.List)to be executed as a single transaction.Return mutator APIs that work withVersionedcontainersReturn a Modeled Curator instance with all the same options but using the given path.
- 
Method Details- 
buildpublic static <T> ModeledFrameworkImpl<T> build(AsyncCuratorFramework client, ModelSpec<T> model, WatchMode watchMode, UnaryOperator<org.apache.zookeeper.WatchedEvent> watcherFilter, UnhandledErrorListener unhandledErrorListener, UnaryOperator<CuratorEvent> resultFilter, Set<ModeledOptions> modeledOptions) 
- 
cachedDescription copied from interface:ModeledFrameworkUse an internally created cache as a front for this modeled instance. All read APIs use the internal cache. i.e. read calls always use the cache instead of making direct queries. Note: you must call CachedModeledFramework.start()andCachedModeledFramework.close()to start/stopNote: the root node (the main path of the model) is not cached. i.e. only nodes below the root are cached. Note: this method internally allocates an Executor for the cache and read methods. Use ModeledFramework.cached(java.util.concurrent.ExecutorService)if you'd like to provide your own executor service.- Specified by:
- cachedin interface- ModeledFramework<T>
- Returns:
- wrapped instance
 
- 
cachedDescription copied from interface:ModeledFrameworkSame asModeledFramework.cached()but allows for providing an executor service- Specified by:
- cachedin interface- ModeledFramework<T>
- Parameters:
- executor- thread pool to use for the cache and for read operations
- Returns:
- wrapped instance
 
- 
versionedDescription copied from interface:ModeledFrameworkReturn mutator APIs that work withVersionedcontainers- Specified by:
- versionedin interface- ModeledFramework<T>
- Returns:
- wrapped instance
 
- 
modelSpecDescription copied from interface:ModeledFrameworkReturn the model being used- Specified by:
- modelSpecin interface- ModeledFramework<T>
- Returns:
- model
 
- 
unwrapDescription copied from interface:ModeledFrameworkReturns the client that was originally passed toModeledFramework.wrap(org.apache.curator.x.async.AsyncCuratorFramework, ModelSpec)or the builder.- Specified by:
- unwrapin interface- ModeledFramework<T>
- Returns:
- original client
 
- 
setDescription copied from interface:ModeledFrameworkCreate (or update depending on build options) a ZNode at this instance's path with a serialized version of the given model- Specified by:
- setin interface- ModeledFramework<T>
- Parameters:
- item- model to write
- Returns:
- AsyncStage
- See Also:
 
- 
setDescription copied from interface:ModeledFrameworkCreate (or update depending on build options) a ZNode at this instance's path with a serialized form of the given model- Specified by:
- setin interface- ModeledFramework<T>
- Parameters:
- item- model to write
- storingStatIn- the stat for the new ZNode is stored here
- Returns:
- AsyncStage
- See Also:
 
- 
setDescription copied from interface:ModeledFrameworkCreate (or update depending on build options) a ZNode at this instance's path with a serialized version of the given model- Specified by:
- setin interface- ModeledFramework<T>
- Parameters:
- item- model to write
- version- if data is being set instead of creating the node, the data version to use
- Returns:
- AsyncStage
- See Also:
 
- 
setDescription copied from interface:ModeledFrameworkCreate (or update depending on build options) a ZNode at this instance's path with a serialized form of the given model- Specified by:
- setin interface- ModeledFramework<T>
- Parameters:
- item- model to write
- storingStatIn- the stat for the new ZNode is stored here
- version- if data is being set instead of creating the node, the data version to use
- Returns:
- AsyncStage
- See Also:
 
- 
readDescription copied from interface:ModeledFrameworkRead the ZNode at this instance's path and deserialize into a model- Specified by:
- readin interface- ModeledFramework<T>
- Returns:
- AsyncStage
- See Also:
 
- 
readDescription copied from interface:ModeledFrameworkRead the ZNode at this instance's path and deserialize into a model- Specified by:
- readin interface- ModeledFramework<T>
- Parameters:
- storingStatIn- the stat for the new ZNode is stored here
- Returns:
- AsyncStage
- See Also:
 
- 
readAsZNodeDescription copied from interface:ModeledFrameworkRead the ZNode at this instance's path and deserialize into a model- Specified by:
- readAsZNodein interface- ModeledFramework<T>
- Returns:
- AsyncStage
- See Also:
 
- 
updateDescription copied from interface:ModeledFrameworkUpdate the ZNode at this instance's path with a serialized form of the given model passing "-1" for the update version- Specified by:
- updatein interface- ModeledFramework<T>
- Parameters:
- item- model to write
- Returns:
- AsyncStage
- See Also:
 
- 
updateDescription copied from interface:ModeledFrameworkUpdate the ZNode at this instance's path with a serialized form of the given model passing the given update version- Specified by:
- updatein interface- ModeledFramework<T>
- Parameters:
- item- model to write
- version- update version to use
- Returns:
- AsyncStage
- See Also:
 
- 
checkExistsDescription copied from interface:ModeledFrameworkCheck to see if the ZNode at this instance's path exists- Specified by:
- checkExistsin interface- ModeledFramework<T>
- Returns:
- AsyncStage
- See Also:
 
- 
deleteDescription copied from interface:ModeledFrameworkDelete the ZNode at this instance's path passing -1 for the delete version- Specified by:
- deletein interface- ModeledFramework<T>
- Returns:
- AsyncStage
- See Also:
 
- 
deleteDescription copied from interface:ModeledFrameworkDelete the ZNode at this instance's path passing the given delete version- Specified by:
- deletein interface- ModeledFramework<T>
- Parameters:
- version- update version to use
- Returns:
- AsyncStage
- See Also:
 
- 
childrenDescription copied from interface:ModeledFrameworkReturn the child paths of this instance's path (in no particular order)- Specified by:
- childrenin interface- ModeledFramework<T>
- Returns:
- AsyncStage
- See Also:
 
- 
childrenAsZNodesDescription copied from interface:ModeledFrameworkReturn the child paths of this instance's path (in no particular order) and deserialize into a models. IMPORTANT: this results in a ZooKeeper query for each child node returned. i.e. if the initial children() call returns 10 nodes an additional 10 ZooKeeper queries are made to get the data. Note: cannot be used if any of theModeledFrameworkBuilder.watched()modes are used.- Specified by:
- childrenAsZNodesin interface- ModeledFramework<T>
- Returns:
- AsyncStage
- See Also:
 
- 
parentDescription copied from interface:ModeledFrameworkReturn a new Modeled Curator instance with all the same options but applying to the parent node of this Modeled Curator's path. E.g. if this Modeled Curator instance applies to "/a/b/c", calling modeled.parent()returns an instance that applies to "/a/b".The replacement is the toString()value of child or, if it implementsNodeName, the value ofnodeName().- Specified by:
- parentin interface- ModeledFramework<T>
- Returns:
- new Modeled Curator instance
 
- 
childDescription copied from interface:ModeledFrameworkReturn 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 interface- ModeledFramework<T>
- Parameters:
- child- child node.
- Returns:
- new Modeled Curator instance
 
- 
withPathDescription copied from interface:ModeledFrameworkReturn a Modeled Curator instance with all the same options but using the given path.- Specified by:
- withPathin interface- ModeledFramework<T>
- Parameters:
- path- new path
- Returns:
- new Modeled Curator instance
 
- 
isCompressed
- 
createOpDescription copied from interface:ModeledFrameworkCreate operation instance that can be passed among other operations toModeledFramework.inTransaction(java.util.List)to be executed as a single transaction. Note: due to ZooKeeper transaction limits, this is a _not_ a "set or update" operation but only a create operation and will generate an error if the node already exists.- Specified by:
- createOpin interface- ModeledFramework<T>
- Parameters:
- model- the model
- Returns:
- operation
 
- 
updateOpDescription copied from interface:ModeledFrameworkUpdate operation instance that can be passed among other operations toModeledFramework.inTransaction(java.util.List)to be executed as a single transaction.- Specified by:
- updateOpin interface- ModeledFramework<T>
- Parameters:
- model- the model
- Returns:
- operation
 
- 
updateOpDescription copied from interface:ModeledFrameworkCreate operation instance that can be passed among other operations toModeledFramework.inTransaction(java.util.List)to be executed as a single transaction.- Specified by:
- updateOpin interface- ModeledFramework<T>
- Parameters:
- model- the model
- version- update version to use
- Returns:
- operation
 
- 
deleteOpDescription copied from interface:ModeledFrameworkDelete operation instance that can be passed among other operations toModeledFramework.inTransaction(java.util.List)to be executed as a single transaction.- Specified by:
- deleteOpin interface- ModeledFramework<T>
- Returns:
- operation
 
- 
deleteOpDescription copied from interface:ModeledFrameworkDelete operation instance that can be passed among other operations toModeledFramework.inTransaction(java.util.List)to be executed as a single transaction.- Specified by:
- deleteOpin interface- ModeledFramework<T>
- Parameters:
- version- delete version to use
- Returns:
- operation
 
- 
checkExistsOpDescription copied from interface:ModeledFrameworkCheck exists operation instance that can be passed among other operations toModeledFramework.inTransaction(java.util.List)to be executed as a single transaction.- Specified by:
- checkExistsOpin interface- ModeledFramework<T>
- Returns:
- operation
 
- 
checkExistsOpDescription copied from interface:ModeledFrameworkCheck exists operation instance that can be passed among other operations toModeledFramework.inTransaction(java.util.List)to be executed as a single transaction.- Specified by:
- checkExistsOpin interface- ModeledFramework<T>
- Parameters:
- version- version to use
- Returns:
- operation
 
- 
inTransactionDescription copied from interface:ModeledFrameworkInvoke ZooKeeper to commit the given operations as a single transaction.- Specified by:
- inTransactionin interface- ModeledFramework<T>
- Parameters:
- operations- operations that make up the transaction.
- Returns:
- AsyncStage instance for managing the completion
 
 
-