Class CuratorFrameworkBase
java.lang.Object
org.apache.curator.framework.imps.CuratorFrameworkBase
- All Implemented Interfaces:
Closeable,AutoCloseable,CuratorFramework
- Direct Known Subclasses:
CuratorFrameworkImpl
This is the base class of all
CuratorFrameworks, it is public for private usages (a.k.a. impls/details package).
Most internal codes should use CuratorFrameworkBase instead of CuratorFrameworkImpl, so
functionalities could be added additively by overriding methods in DelegatingCuratorFramework.
An instance of CuratorFramework MUST BE an instance of CuratorFrameworkBase.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionStart an exists builderprotected final voidabstract CuratorFrameworkclient()Return the underlying client which is the one constructed fromCuratorFrameworkFactory.create()Start a create builderfinal voidcreateContainers(String path) Create all nodes in the specified path as containers if they don't already existdelete()Start a delete buildergetACL()Start a get ACL builderStart a get children builderStart a getConfig buildergetData()Start a get data builderfinal StringReturn the current namespace or "" if noneprotected final voidinternalSync(CuratorFrameworkBase impl, String path, Object context) Start a transaction builderDeprecated.Returns a facade of the current instance that tracks watchers created and allows a one-shot removal of all watchers viaWatcherRemoveCuratorFramework.removeWatchers()final CuratorFrameworkReturns a facade of the current instance that does _not_ automatically pre-pend the namespace to all pathsreconfig()Start a reconfig buildersetACL()Start a set ACL buildersetData()Start a set data buildersync()Start a sync builder.voidPerform a sync on the given path - syncs are always in the backgroundStart a transaction builderAllocate an operation that can be used withCuratorFramework.transaction().final WatchesBuilderwatchers()Start a watch builder.final RemoveWatchesBuilderwatches()Start a remove watches builder.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.curator.framework.CuratorFramework
blockUntilConnected, blockUntilConnected, clearWatcherReferences, close, compressionEnabled, getConnectionStateErrorPolicy, getConnectionStateListenable, getCuratorListenable, getCurrentConfig, getSchemaSet, getState, getUnhandledErrorListenable, getZookeeperClient, getZookeeperCompatibility, isStarted, postSafeNotify, runSafe, start, usingNamespace
-
Constructor Details
-
CuratorFrameworkBase
public CuratorFrameworkBase()
-
-
Method Details
-
client
Return the underlying client which is the one constructed fromCuratorFrameworkFactory. -
nonNamespaceView
Description copied from interface:CuratorFrameworkReturns a facade of the current instance that does _not_ automatically pre-pend the namespace to all paths- Specified by:
nonNamespaceViewin interfaceCuratorFramework- Returns:
- facade
-
getNamespace
Description copied from interface:CuratorFrameworkReturn the current namespace or "" if none- Specified by:
getNamespacein interfaceCuratorFramework- Returns:
- namespace
-
newNamespaceAwareEnsurePath
Deprecated.Description copied from interface:CuratorFrameworkAllocates an ensure path instance that is namespace aware- Specified by:
newNamespaceAwareEnsurePathin interfaceCuratorFramework- Parameters:
path- path to ensure- Returns:
- new EnsurePath instance
-
checkState
protected final void checkState() -
internalSync
-
create
Description copied from interface:CuratorFrameworkStart a create builder- Specified by:
createin interfaceCuratorFramework- Returns:
- builder object
-
delete
Description copied from interface:CuratorFrameworkStart a delete builder- Specified by:
deletein interfaceCuratorFramework- Returns:
- builder object
-
checkExists
Description copied from interface:CuratorFrameworkStart an exists builderThe builder will return a Stat object as if org.apache.zookeeper.ZooKeeper.exists() were called. Thus, a null means that it does not exist and an actual Stat object means it does exist.
- Specified by:
checkExistsin interfaceCuratorFramework- Returns:
- builder object
-
getData
Description copied from interface:CuratorFrameworkStart a get data builder- Specified by:
getDatain interfaceCuratorFramework- Returns:
- builder object
-
setData
Description copied from interface:CuratorFrameworkStart a set data builder- Specified by:
setDatain interfaceCuratorFramework- Returns:
- builder object
-
getChildren
Description copied from interface:CuratorFrameworkStart a get children builder- Specified by:
getChildrenin interfaceCuratorFramework- Returns:
- builder object
-
getACL
Description copied from interface:CuratorFrameworkStart a get ACL builder- Specified by:
getACLin interfaceCuratorFramework- Returns:
- builder object
-
setACL
Description copied from interface:CuratorFrameworkStart a set ACL builder- Specified by:
setACLin interfaceCuratorFramework- Returns:
- builder object
-
reconfig
Description copied from interface:CuratorFrameworkStart a reconfig builder- Specified by:
reconfigin interfaceCuratorFramework- Returns:
- builder object
-
getConfig
Description copied from interface:CuratorFrameworkStart a getConfig builder- Specified by:
getConfigin interfaceCuratorFramework- Returns:
- builder object
-
inTransaction
Description copied from interface:CuratorFrameworkStart a transaction builder- Specified by:
inTransactionin interfaceCuratorFramework- Returns:
- builder object
-
transaction
Description copied from interface:CuratorFrameworkStart a transaction builder- Specified by:
transactionin interfaceCuratorFramework- Returns:
- builder object
-
transactionOp
Description copied from interface:CuratorFrameworkAllocate an operation that can be used withCuratorFramework.transaction(). NOTE:CuratorOpinstances created by this builder are reusable.- Specified by:
transactionOpin interfaceCuratorFramework- Returns:
- operation builder
-
sync
Description copied from interface:CuratorFrameworkPerform a sync on the given path - syncs are always in the background- Specified by:
syncin interfaceCuratorFramework- Parameters:
path- the pathcontext- optional context
-
sync
Description copied from interface:CuratorFrameworkStart a sync builder. Note: sync is ALWAYS in the background even if you don't use one of the background() methods- Specified by:
syncin interfaceCuratorFramework- Returns:
- builder object
-
watches
Description copied from interface:CuratorFrameworkStart a remove watches builder.- Specified by:
watchesin interfaceCuratorFramework- Returns:
- builder object
-
watchers
Description copied from interface:CuratorFrameworkStart a watch builder. Supported only when ZooKeeper JAR of version 3.6 or above is used, throwsIllegalStateExceptionfor ZooKeeper JAR 3.5 or below- Specified by:
watchersin interfaceCuratorFramework- Returns:
- builder object
-
createContainers
Description copied from interface:CuratorFrameworkCreate all nodes in the specified path as containers if they don't already exist- Specified by:
createContainersin interfaceCuratorFramework- Parameters:
path- path to create- Throws:
Exception- errors
-
newWatcherRemoveCuratorFramework
Description copied from interface:CuratorFrameworkReturns a facade of the current instance that tracks watchers created and allows a one-shot removal of all watchers viaWatcherRemoveCuratorFramework.removeWatchers()- Specified by:
newWatcherRemoveCuratorFrameworkin interfaceCuratorFramework- Returns:
- facade
-