Class FixedEnsembleProvider
- java.lang.Object
-
- org.apache.curator.ensemble.fixed.FixedEnsembleProvider
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,EnsembleProvider
public class FixedEnsembleProvider extends java.lang.Object implements EnsembleProvider
Standard ensemble provider that wraps a fixed connection string
-
-
Constructor Summary
Constructors Constructor Description FixedEnsembleProvider(java.lang.String connectionString)The connection string to useFixedEnsembleProvider(java.lang.String connectionString, boolean updateServerListEnabled)The connection string to use
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Curator will call this method whenCuratorZookeeperClient.close()is calledjava.lang.StringgetConnectionString()Return the current connection string to use.voidsetConnectionString(java.lang.String connectionString)A new connection string event was receivedvoidstart()Curator will call this method whenCuratorZookeeperClient.start()is calledbooleanupdateServerListEnabled()Return true if this ensemble provider supportsZooKeeper.updateServerList(String)
-
-
-
Constructor Detail
-
FixedEnsembleProvider
public FixedEnsembleProvider(java.lang.String connectionString)
The connection string to use- Parameters:
connectionString- connection string
-
FixedEnsembleProvider
public FixedEnsembleProvider(java.lang.String connectionString, boolean updateServerListEnabled)The connection string to use- Parameters:
connectionString- connection stringupdateServerListEnabled- if true, allow Curator to callZooKeeper.updateServerList(String)
-
-
Method Detail
-
start
public void start() throws java.lang.ExceptionDescription copied from interface:EnsembleProviderCurator will call this method whenCuratorZookeeperClient.start()is called- Specified by:
startin interfaceEnsembleProvider- Throws:
java.lang.Exception- errors
-
close
public void close() throws java.io.IOExceptionDescription copied from interface:EnsembleProviderCurator will call this method whenCuratorZookeeperClient.close()is called- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceEnsembleProvider- Throws:
java.io.IOException- errors
-
setConnectionString
public void setConnectionString(java.lang.String connectionString)
Description copied from interface:EnsembleProviderA new connection string event was received- Specified by:
setConnectionStringin interfaceEnsembleProvider- Parameters:
connectionString- the new connection string
-
getConnectionString
public java.lang.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
-
-