java.lang.AutoCloseable, java.io.CloseableWatcherRemoveCuratorFrameworkCuratorFrameworkImplpublic interface CuratorFramework
extends java.io.Closeable
| Modifier and Type | Method | Description |
|---|---|---|
void |
blockUntilConnected() |
Block until a connection to ZooKeeper is available.
|
boolean |
blockUntilConnected(int maxWaitTime,
java.util.concurrent.TimeUnit units) |
Block until a connection to ZooKeeper is available or the maxWaitTime has been exceeded
|
ExistsBuilder |
checkExists() |
Start an exists builder
|
void |
clearWatcherReferences(org.apache.zookeeper.Watcher watcher) |
Deprecated.
As of ZooKeeper 3.5 Curators recipes will handle removing watcher references
when they are no longer used. If you write your own recipe, follow the example of Curator
recipes and use
newWatcherRemoveCuratorFramework() calling WatcherRemoveCuratorFramework.removeWatchers()
when closing your instance. |
void |
close() |
Stop the client
|
CreateBuilder |
create() |
Start a create builder
|
void |
createContainers(java.lang.String path) |
Create all nodes in the specified path as containers if they don't
already exist
|
DeleteBuilder |
delete() |
Start a delete builder
|
GetACLBuilder |
getACL() |
Start a get ACL builder
|
GetChildrenBuilder |
getChildren() |
Start a get children builder
|
GetConfigBuilder |
getConfig() |
Start a getConfig builder
|
ConnectionStateErrorPolicy |
getConnectionStateErrorPolicy() |
Return the configured error policy
|
Listenable<ConnectionStateListener> |
getConnectionStateListenable() |
Returns the listenable interface for the Connect State
|
Listenable<CuratorListener> |
getCuratorListenable() |
Returns the listenable interface for events
|
org.apache.zookeeper.server.quorum.flexible.QuorumVerifier |
getCurrentConfig() |
Current maintains a cached view of the Zookeeper quorum config.
|
GetDataBuilder |
getData() |
Start a get data builder
|
java.lang.String |
getNamespace() |
Return the current namespace or "" if none
|
SchemaSet |
getSchemaSet() |
Return this instance's schema set
|
CuratorFrameworkState |
getState() |
Returns the state of this instance
|
Listenable<UnhandledErrorListener> |
getUnhandledErrorListenable() |
Returns the listenable interface for unhandled errors
|
org.apache.curator.CuratorZookeeperClient |
getZookeeperClient() |
Return the managed zookeeper client
|
CuratorTransaction |
inTransaction() |
Deprecated.
use
transaction() instead |
boolean |
isStarted() |
Deprecated.
use
getState() instead |
boolean |
isZk34CompatibilityMode() |
Return true if this instance is running in ZK 3.4.x compatibility mode
|
org.apache.curator.utils.EnsurePath |
newNamespaceAwareEnsurePath(java.lang.String path) |
Deprecated.
|
WatcherRemoveCuratorFramework |
newWatcherRemoveCuratorFramework() |
Returns a facade of the current instance that tracks
watchers created and allows a one-shot removal of all watchers
via
WatcherRemoveCuratorFramework.removeWatchers() |
CuratorFramework |
nonNamespaceView() |
Deprecated.
Since 2.9.0 - use
usingNamespace(java.lang.String) passing null |
ReconfigBuilder |
reconfig() |
Start a reconfig builder
|
SetACLBuilder |
setACL() |
Start a set ACL builder
|
SetDataBuilder |
setData() |
Start a set data builder
|
void |
start() |
Start the client.
|
SyncBuilder |
sync() |
Start a sync builder.
|
void |
sync(java.lang.String path,
java.lang.Object backgroundContextObject) |
Deprecated.
use
sync() instead |
CuratorMultiTransaction |
transaction() |
Start a transaction builder
|
TransactionOp |
transactionOp() |
Allocate an operation that can be used with
transaction(). |
CuratorFramework |
usingNamespace(java.lang.String newNamespace) |
Returns a facade of the current instance that uses the specified namespace
or no namespace if
newNamespace is null. |
RemoveWatchesBuilder |
watches() |
Start a remove watches builder.
|
void start()
void close()
close in interface java.lang.AutoCloseableclose in interface java.io.CloseableCuratorFrameworkState getState()
@Deprecated boolean isStarted()
getState() insteadCreateBuilder create()
DeleteBuilder delete()
ExistsBuilder checkExists()
The 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.
GetDataBuilder getData()
SetDataBuilder setData()
GetChildrenBuilder getChildren()
GetACLBuilder getACL()
SetACLBuilder setACL()
ReconfigBuilder reconfig()
GetConfigBuilder getConfig()
CuratorTransaction inTransaction()
transaction() insteadCuratorMultiTransaction transaction()
TransactionOp transactionOp()
transaction().
NOTE: CuratorOp instances created by this builder are
reusable.@Deprecated
void sync(java.lang.String path,
java.lang.Object backgroundContextObject)
sync() insteadpath - the pathbackgroundContextObject - optional contextvoid createContainers(java.lang.String path)
throws java.lang.Exception
path - path to createjava.lang.Exception - errorsSyncBuilder sync()
RemoveWatchesBuilder watches()
Listenable<ConnectionStateListener> getConnectionStateListenable()
Listenable<CuratorListener> getCuratorListenable()
Listenable<UnhandledErrorListener> getUnhandledErrorListenable()
@Deprecated CuratorFramework nonNamespaceView()
usingNamespace(java.lang.String) passing nullCuratorFramework usingNamespace(java.lang.String newNamespace)
newNamespace is null.newNamespace - the new namespace or null for nonejava.lang.String getNamespace()
org.apache.curator.CuratorZookeeperClient getZookeeperClient()
@Deprecated org.apache.curator.utils.EnsurePath newNamespaceAwareEnsurePath(java.lang.String path)
CreateBuilderMain.creatingParentContainersIfNeeded(), ExistsBuilder.creatingParentContainersIfNeeded()
or createContainers(String)path - path to ensure@Deprecated void clearWatcherReferences(org.apache.zookeeper.Watcher watcher)
newWatcherRemoveCuratorFramework() calling WatcherRemoveCuratorFramework.removeWatchers()
when closing your instance.watcher - the watcherboolean blockUntilConnected(int maxWaitTime,
java.util.concurrent.TimeUnit units)
throws java.lang.InterruptedException
maxWaitTime - The maximum wait time. Specify a value <= 0 to wait indefinitelyunits - The time units for the maximum wait time.java.lang.InterruptedException - If interrupted while waitingvoid blockUntilConnected()
throws java.lang.InterruptedException
java.lang.InterruptedException - If interrupted while waitingWatcherRemoveCuratorFramework newWatcherRemoveCuratorFramework()
WatcherRemoveCuratorFramework.removeWatchers()ConnectionStateErrorPolicy getConnectionStateErrorPolicy()
org.apache.zookeeper.server.quorum.flexible.QuorumVerifier getCurrentConfig()
SchemaSet getSchemaSet()
boolean isZk34CompatibilityMode()
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.