Class FixedEnsembleProvider
java.lang.Object
org.apache.curator.ensemble.fixed.FixedEnsembleProvider
- All Implemented Interfaces:
Closeable,AutoCloseable,EnsembleProvider
Standard ensemble provider that wraps a fixed connection string
-
Constructor Summary
ConstructorsConstructorDescriptionFixedEnsembleProvider(String connectionString) The connection string to useFixedEnsembleProvider(String connectionString, boolean updateServerListEnabled) The connection string to use -
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)
-
Constructor Details
-
FixedEnsembleProvider
The connection string to use- Parameters:
connectionString- connection string
-
FixedEnsembleProvider
The connection string to use- Parameters:
connectionString- connection stringupdateServerListEnabled- if true, allow Curator to callZooKeeper.updateServerList(String)
-
-
Method Details
-
start
Description copied from interface:EnsembleProviderCurator will call this method whenCuratorZookeeperClient.start()is called- Specified by:
startin interfaceEnsembleProvider- Throws:
Exception- errors
-
close
Description copied from interface:EnsembleProviderCurator will call this method whenCuratorZookeeperClient.close()is called- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceEnsembleProvider- Throws:
IOException- errors
-
setConnectionString
Description copied from interface:EnsembleProviderA new connection string event was received- Specified by:
setConnectionStringin interfaceEnsembleProvider- Parameters:
connectionString- the new connection string
-
getConnectionString
Description copied from interface:EnsembleProviderReturn the current connection string to use. Curator will call this each time it needs to create a ZooKeeper instance- Specified by:
getConnectionStringin interfaceEnsembleProvider- Returns:
- connection string (per
ZooKeeper(String, int, Watcher)etc.)
-
updateServerListEnabled
public boolean updateServerListEnabled()Description copied from interface:EnsembleProviderReturn true if this ensemble provider supportsZooKeeper.updateServerList(String)- Specified by:
updateServerListEnabledin interfaceEnsembleProvider- Returns:
- true/false
-