public class CuratorFrameworkImpl extends Object implements CuratorFramework
Modifier and Type | Field and Description |
---|---|
UnhandledErrorListener |
debugUnhandledErrorListener |
Modifier | Constructor and Description |
---|---|
|
CuratorFrameworkImpl(CuratorFrameworkFactory.Builder builder) |
protected |
CuratorFrameworkImpl(CuratorFrameworkImpl parent) |
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
|
protected void |
internalSync(CuratorFrameworkImpl impl,
String path,
Object context) |
CuratorTransaction |
inTransaction()
Start a transaction builder
|
boolean |
isStarted()
Deprecated.
|
EnsurePath |
newNamespaceAwareEnsurePath(String path)
Allocates an ensure path instance that is namespace aware
|
CuratorFramework |
nonNamespaceView()
Deprecated.
|
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 context)
Perform a sync on the given path - syncs are always in the background
|
CuratorFramework |
usingNamespace(String newNamespace)
Returns a facade of the current instance that uses the specified namespace
or no namespace if
newNamespace is null . |
public volatile UnhandledErrorListener debugUnhandledErrorListener
public CuratorFrameworkImpl(CuratorFrameworkFactory.Builder builder)
protected CuratorFrameworkImpl(CuratorFrameworkImpl parent)
public void createContainers(String path) throws Exception
CuratorFramework
createContainers
in interface CuratorFramework
path
- path to createException
- errorspublic void clearWatcherReferences(org.apache.zookeeper.Watcher watcher)
CuratorFramework
clearWatcherReferences
in interface CuratorFramework
watcher
- the watcherpublic CuratorFrameworkState getState()
CuratorFramework
getState
in interface CuratorFramework
@Deprecated public boolean isStarted()
CuratorFramework
isStarted
in interface CuratorFramework
public boolean blockUntilConnected(int maxWaitTime, TimeUnit units) throws InterruptedException
CuratorFramework
blockUntilConnected
in interface CuratorFramework
maxWaitTime
- The maximum wait time. Specify a value <= 0 to wait indefinitelyunits
- The time units for the maximum wait time.InterruptedException
- If interrupted while waitingpublic void blockUntilConnected() throws InterruptedException
CuratorFramework
blockUntilConnected
in interface CuratorFramework
InterruptedException
- If interrupted while waitingpublic void start()
CuratorFramework
start
in interface CuratorFramework
public void close()
CuratorFramework
close
in interface Closeable
close
in interface AutoCloseable
close
in interface CuratorFramework
@Deprecated public CuratorFramework nonNamespaceView()
CuratorFramework
nonNamespaceView
in interface CuratorFramework
public String getNamespace()
CuratorFramework
getNamespace
in interface CuratorFramework
public CuratorFramework usingNamespace(String newNamespace)
CuratorFramework
newNamespace
is null
.usingNamespace
in interface CuratorFramework
newNamespace
- the new namespace or null for nonepublic CreateBuilder create()
CuratorFramework
create
in interface CuratorFramework
public DeleteBuilder delete()
CuratorFramework
delete
in interface CuratorFramework
public ExistsBuilder checkExists()
CuratorFramework
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.
checkExists
in interface CuratorFramework
public GetDataBuilder getData()
CuratorFramework
getData
in interface CuratorFramework
public SetDataBuilder setData()
CuratorFramework
setData
in interface CuratorFramework
public GetChildrenBuilder getChildren()
CuratorFramework
getChildren
in interface CuratorFramework
public GetACLBuilder getACL()
CuratorFramework
getACL
in interface CuratorFramework
public SetACLBuilder setACL()
CuratorFramework
setACL
in interface CuratorFramework
public CuratorTransaction inTransaction()
CuratorFramework
inTransaction
in interface CuratorFramework
public Listenable<ConnectionStateListener> getConnectionStateListenable()
CuratorFramework
getConnectionStateListenable
in interface CuratorFramework
public Listenable<CuratorListener> getCuratorListenable()
CuratorFramework
getCuratorListenable
in interface CuratorFramework
public Listenable<UnhandledErrorListener> getUnhandledErrorListenable()
CuratorFramework
getUnhandledErrorListenable
in interface CuratorFramework
public void sync(String path, Object context)
CuratorFramework
sync
in interface CuratorFramework
path
- the pathcontext
- optional contextpublic SyncBuilder sync()
CuratorFramework
sync
in interface CuratorFramework
protected void internalSync(CuratorFrameworkImpl impl, String path, Object context)
public CuratorZookeeperClient getZookeeperClient()
CuratorFramework
getZookeeperClient
in interface CuratorFramework
public EnsurePath newNamespaceAwareEnsurePath(String path)
CuratorFramework
newNamespaceAwareEnsurePath
in interface CuratorFramework
path
- path to ensureCopyright © 2011–2019 The Apache Software Foundation. All rights reserved.