Package org.apache.curator.ensemble
Interface EnsembleProvider
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Implementing Classes:
FixedEnsembleProvider
public interface EnsembleProvider extends java.io.Closeable
Abstraction that provides the ZooKeeper connection string
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Curator will call this method whenCuratorZookeeperClient.close()
is calledjava.lang.String
getConnectionString()
Return the current connection string to use.void
setConnectionString(java.lang.String connectionString)
A new connection string event was receivedvoid
start()
Curator will call this method whenCuratorZookeeperClient.start()
is calledboolean
updateServerListEnabled()
Return true if this ensemble provider supportsZooKeeper.updateServerList(String)
-
-
-
Method Detail
-
start
void start() throws java.lang.Exception
Curator will call this method whenCuratorZookeeperClient.start()
is called- Throws:
java.lang.Exception
- errors
-
getConnectionString
java.lang.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
void close() throws java.io.IOException
Curator will call this method whenCuratorZookeeperClient.close()
is called- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
- errors
-
setConnectionString
void setConnectionString(java.lang.String connectionString)
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
-
-