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
CuratorFramework
s, 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 void
create()
Start a create builderfinal void
createContainers
(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 String
Return the current namespace or "" if noneprotected final void
internalSync
(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 CuratorFramework
Returns 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.void
Perform a sync on the given path - syncs are always in the backgroundStart a transaction builderAllocate an operation that can be used withCuratorFramework.transaction()
.final WatchesBuilder
watchers()
Start a watch builder.final RemoveWatchesBuilder
watches()
Start a remove watches builder.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
-
nonNamespaceView
Description copied from interface:CuratorFramework
Returns a facade of the current instance that does _not_ automatically pre-pend the namespace to all paths- Specified by:
nonNamespaceView
in interfaceCuratorFramework
- Returns:
- facade
-
getNamespace
Description copied from interface:CuratorFramework
Return the current namespace or "" if none- Specified by:
getNamespace
in interfaceCuratorFramework
- Returns:
- namespace
-
newNamespaceAwareEnsurePath
Deprecated.Description copied from interface:CuratorFramework
Allocates an ensure path instance that is namespace aware- Specified by:
newNamespaceAwareEnsurePath
in interfaceCuratorFramework
- Parameters:
path
- path to ensure- Returns:
- new EnsurePath instance
-
checkState
protected final void checkState() -
internalSync
-
create
Description copied from interface:CuratorFramework
Start a create builder- Specified by:
create
in interfaceCuratorFramework
- Returns:
- builder object
-
delete
Description copied from interface:CuratorFramework
Start a delete builder- Specified by:
delete
in interfaceCuratorFramework
- Returns:
- builder object
-
checkExists
Description copied from interface:CuratorFramework
Start 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:
checkExists
in interfaceCuratorFramework
- Returns:
- builder object
-
getData
Description copied from interface:CuratorFramework
Start a get data builder- Specified by:
getData
in interfaceCuratorFramework
- Returns:
- builder object
-
setData
Description copied from interface:CuratorFramework
Start a set data builder- Specified by:
setData
in interfaceCuratorFramework
- Returns:
- builder object
-
getChildren
Description copied from interface:CuratorFramework
Start a get children builder- Specified by:
getChildren
in interfaceCuratorFramework
- Returns:
- builder object
-
getACL
Description copied from interface:CuratorFramework
Start a get ACL builder- Specified by:
getACL
in interfaceCuratorFramework
- Returns:
- builder object
-
setACL
Description copied from interface:CuratorFramework
Start a set ACL builder- Specified by:
setACL
in interfaceCuratorFramework
- Returns:
- builder object
-
reconfig
Description copied from interface:CuratorFramework
Start a reconfig builder- Specified by:
reconfig
in interfaceCuratorFramework
- Returns:
- builder object
-
getConfig
Description copied from interface:CuratorFramework
Start a getConfig builder- Specified by:
getConfig
in interfaceCuratorFramework
- Returns:
- builder object
-
inTransaction
Description copied from interface:CuratorFramework
Start a transaction builder- Specified by:
inTransaction
in interfaceCuratorFramework
- Returns:
- builder object
-
transaction
Description copied from interface:CuratorFramework
Start a transaction builder- Specified by:
transaction
in interfaceCuratorFramework
- Returns:
- builder object
-
transactionOp
Description copied from interface:CuratorFramework
Allocate an operation that can be used withCuratorFramework.transaction()
. NOTE:CuratorOp
instances created by this builder are reusable.- Specified by:
transactionOp
in interfaceCuratorFramework
- Returns:
- operation builder
-
sync
Description copied from interface:CuratorFramework
Perform a sync on the given path - syncs are always in the background- Specified by:
sync
in interfaceCuratorFramework
- Parameters:
path
- the pathcontext
- optional context
-
sync
Description copied from interface:CuratorFramework
Start a sync builder. Note: sync is ALWAYS in the background even if you don't use one of the background() methods- Specified by:
sync
in interfaceCuratorFramework
- Returns:
- builder object
-
watches
Description copied from interface:CuratorFramework
Start a remove watches builder.- Specified by:
watches
in interfaceCuratorFramework
- Returns:
- builder object
-
watchers
Description copied from interface:CuratorFramework
Start a watch builder. Supported only when ZooKeeper JAR of version 3.6 or above is used, throwsIllegalStateException
for ZooKeeper JAR 3.5 or below- Specified by:
watchers
in interfaceCuratorFramework
- Returns:
- builder object
-
createContainers
Description copied from interface:CuratorFramework
Create all nodes in the specified path as containers if they don't already exist- Specified by:
createContainers
in interfaceCuratorFramework
- Parameters:
path
- path to create- Throws:
Exception
- errors
-
newWatcherRemoveCuratorFramework
Description copied from interface:CuratorFramework
Returns a facade of the current instance that tracks watchers created and allows a one-shot removal of all watchers viaWatcherRemoveCuratorFramework.removeWatchers()
- Specified by:
newWatcherRemoveCuratorFramework
in interfaceCuratorFramework
- Returns:
- facade
-