public interface CuratorFramework extends Closeable
Modifier and Type | Method and Description |
---|---|
void |
blockUntilConnected()
Block until a connection to ZooKeeper is available.
|
boolean |
blockUntilConnected(int maxWaitTime,
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)
Curator can hold internal references to watchers that may inhibit garbage collection.
|
void |
close()
Stop the client
|
CreateBuilder |
create()
Start a create builder
|
void |
createContainers(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
|
Listenable<ConnectionStateListener> |
getConnectionStateListenable()
Returns the listenable interface for the Connect State
|
Listenable<CuratorListener> |
getCuratorListenable()
Returns the listenable interface for events
|
GetDataBuilder |
getData()
Start a get data builder
|
String |
getNamespace()
Return the current namespace or "" if none
|
CuratorFrameworkState |
getState()
Returns the state of this instance
|
Listenable<UnhandledErrorListener> |
getUnhandledErrorListenable()
Returns the listenable interface for unhandled errors
|
CuratorZookeeperClient |
getZookeeperClient()
Return the managed zookeeper client
|
CuratorTransaction |
inTransaction()
Start a transaction builder
|
boolean |
isStarted()
Deprecated.
use
getState() instead |
EnsurePath |
newNamespaceAwareEnsurePath(String path)
Deprecated.
|
CuratorFramework |
nonNamespaceView()
Deprecated.
Since 2.9.0 - use
usingNamespace(java.lang.String) passing null |
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(String path,
Object backgroundContextObject)
Deprecated.
use
sync() instead |
CuratorFramework |
usingNamespace(String newNamespace)
Returns a facade of the current instance that uses the specified namespace
or no namespace if
newNamespace is null . |
void start()
void close()
close
in interface AutoCloseable
close
in interface Closeable
CuratorFrameworkState 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()
CuratorTransaction inTransaction()
@Deprecated void sync(String path, Object backgroundContextObject)
sync()
insteadpath
- the pathbackgroundContextObject
- optional contextvoid createContainers(String path) throws Exception
path
- path to createException
- errorsSyncBuilder sync()
Listenable<ConnectionStateListener> getConnectionStateListenable()
Listenable<CuratorListener> getCuratorListenable()
Listenable<UnhandledErrorListener> getUnhandledErrorListenable()
@Deprecated CuratorFramework nonNamespaceView()
usingNamespace(java.lang.String)
passing null
CuratorFramework usingNamespace(String newNamespace)
newNamespace
is null
.newNamespace
- the new namespace or null for noneString getNamespace()
CuratorZookeeperClient getZookeeperClient()
@Deprecated EnsurePath newNamespaceAwareEnsurePath(String path)
CreateBuilder.creatingParentContainersIfNeeded()
, ExistsBuilder.creatingParentContainersIfNeeded()
or createContainers(String)
path
- path to ensurevoid clearWatcherReferences(org.apache.zookeeper.Watcher watcher)
watcher
- the watcherboolean blockUntilConnected(int maxWaitTime, TimeUnit units) throws InterruptedException
maxWaitTime
- The maximum wait time. Specify a value <= 0 to wait indefinitelyunits
- The time units for the maximum wait time.InterruptedException
- If interrupted while waitingvoid blockUntilConnected() throws InterruptedException
InterruptedException
- If interrupted while waitingCopyright © 2011–2019 The Apache Software Foundation. All rights reserved.