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 TypeMethodDescriptionvoid
close()
Curator will call this method whenCuratorZookeeperClient.close()
is calledReturn the current connection string to use.void
setConnectionString
(String connectionString) A new connection string event was receivedvoid
start()
Curator will call this method whenCuratorZookeeperClient.start()
is calledboolean
Return 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:
close
in interfaceAutoCloseable
- Specified by:
close
in 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
-