Package org.apache.curator.ensemble
Interface EnsembleProvider
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
FixedEnsembleProvider
Abstraction that provides the ZooKeeper connection string
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Curator will call this method whenCuratorZookeeperClient.close()is calledReturn the current connection string to use.voidsetConnectionString(String connectionString) A new connection string event was receivedvoidstart()Curator will call this method whenCuratorZookeeperClient.start()is calledbooleanReturn true if this ensemble provider supportsZooKeeper.updateServerList(String)
-
Method Details
-
start
Curator will call this method whenCuratorZookeeperClient.start()is called- Throws:
Exception- errors
-
getConnectionString
String getConnectionString()Return the current connection string to use. Curator will call this each time it needs to create a ZooKeeper instance- Returns:
- connection string (per
ZooKeeper(String, int, Watcher)etc.)
-
close
Curator will call this method whenCuratorZookeeperClient.close()is called- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- errors
-
setConnectionString
A new connection string event was received- Parameters:
connectionString- the new connection string
-
updateServerListEnabled
boolean updateServerListEnabled()Return true if this ensemble provider supportsZooKeeper.updateServerList(String)- Returns:
- true/false
-