Class 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 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 string
        updateServerListEnabled - if true, allow Curator to call ZooKeeper.updateServerList(String)
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Description copied from interface: EnsembleProvider
        Curator will call this method when CuratorZookeeperClient.close() is called
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface EnsembleProvider
        Throws:
        java.io.IOException - errors
      • setConnectionString

        public void setConnectionString​(java.lang.String connectionString)
        Description copied from interface: EnsembleProvider
        A new connection string event was received
        Specified by:
        setConnectionString in interface EnsembleProvider
        Parameters:
        connectionString - the new connection string
      • getConnectionString

        public java.lang.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 interface EnsembleProvider
        Returns:
        connection string (per ZooKeeper(String, int, Watcher) etc.)
      • updateServerListEnabled

        public boolean updateServerListEnabled()
        Description copied from interface: EnsembleProvider
        Return true if this ensemble provider supports ZooKeeper.updateServerList(String)
        Specified by:
        updateServerListEnabled in interface EnsembleProvider
        Returns:
        true/false