public class FixedEnsembleProvider extends Object implements EnsembleProvider
Constructor and Description |
---|
FixedEnsembleProvider(String connectionString)
The connection string to use
|
FixedEnsembleProvider(String connectionString,
boolean updateServerListEnabled)
The connection string to use
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Curator will call this method when
CuratorZookeeperClient.close() is called |
String |
getConnectionString()
Return the current connection string to use.
|
void |
setConnectionString(String connectionString)
A new connection string event was received
|
void |
start()
Curator will call this method when
CuratorZookeeperClient.start() is
called |
boolean |
updateServerListEnabled()
Return true if this ensemble provider supports
ZooKeeper.updateServerList(String) |
public FixedEnsembleProvider(String connectionString)
connectionString
- connection stringpublic FixedEnsembleProvider(String connectionString, boolean updateServerListEnabled)
connectionString
- connection stringupdateServerListEnabled
- if true, allow Curator to call ZooKeeper.updateServerList(String)
public void start() throws Exception
EnsembleProvider
CuratorZookeeperClient.start()
is
calledstart
in interface EnsembleProvider
Exception
- errorspublic void close() throws IOException
EnsembleProvider
CuratorZookeeperClient.close()
is calledclose
in interface Closeable
close
in interface AutoCloseable
close
in interface EnsembleProvider
IOException
- errorspublic void setConnectionString(String connectionString)
EnsembleProvider
setConnectionString
in interface EnsembleProvider
connectionString
- the new connection stringpublic String getConnectionString()
EnsembleProvider
getConnectionString
in interface EnsembleProvider
ZooKeeper(String, int, Watcher)
etc.)public boolean updateServerListEnabled()
EnsembleProvider
ZooKeeper.updateServerList(String)
updateServerListEnabled
in interface EnsembleProvider
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.