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
ConstructorDescriptionFixedEnsembleProvider
(String connectionString) The connection string to useFixedEnsembleProvider
(String connectionString, boolean updateServerListEnabled) The connection string to use -
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)
-
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:EnsembleProvider
Curator will call this method whenCuratorZookeeperClient.start()
is called- Specified by:
start
in interfaceEnsembleProvider
- Throws:
Exception
- errors
-
close
Description copied from interface:EnsembleProvider
Curator will call this method whenCuratorZookeeperClient.close()
is called- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceEnsembleProvider
- Throws:
IOException
- errors
-
setConnectionString
Description copied from interface:EnsembleProvider
A new connection string event was received- Specified by:
setConnectionString
in interfaceEnsembleProvider
- Parameters:
connectionString
- the new connection string
-
getConnectionString
Description copied from interface:EnsembleProvider
Return the current connection string to use. Curator will call this each time it needs to create a ZooKeeper instance- Specified by:
getConnectionString
in interfaceEnsembleProvider
- Returns:
- connection string (per
ZooKeeper(String, int, Watcher)
etc.)
-
updateServerListEnabled
public boolean updateServerListEnabled()Description copied from interface:EnsembleProvider
Return true if this ensemble provider supportsZooKeeper.updateServerList(String)
- Specified by:
updateServerListEnabled
in interfaceEnsembleProvider
- Returns:
- true/false
-