Class EtcdAsConfigSource
- java.lang.Object
-
- org.lable.oss.dynamicconfig.provider.etcd.EtcdAsConfigSource
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ConfigurationSource
public class EtcdAsConfigSource extends Object implements ConfigurationSource
Retrieve configuration from an Etcd cluster, and maintain a watch for updates.
-
-
Constructor Summary
Constructors Constructor Description EtcdAsConfigSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidconfigure(org.apache.commons.configuration.Configuration configuration, org.apache.commons.configuration.Configuration defaults, ConfigChangeListener changeListener)voidlisten(String name)InputStreamload(String name)Stringname()voidstopListening(String name)List<String>systemProperties()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.lable.oss.dynamicconfig.core.spi.ConfigurationSource
normalizeRootConfigName
-
-
-
-
Method Detail
-
name
public String name()
- Specified by:
namein interfaceConfigurationSource
-
systemProperties
public List<String> systemProperties()
- Specified by:
systemPropertiesin interfaceConfigurationSource
-
configure
public void configure(org.apache.commons.configuration.Configuration configuration, org.apache.commons.configuration.Configuration defaults, ConfigChangeListener changeListener) throws ConfigurationExceptionThis class required two parameters to be set in the configuration object passed:
- cluster
- Comma-separated list of addresses for the Etcd cluster.
- namespace
- Key namespace.
- copy.cluster.to
- Copy the Etcd cluster endpoints to this configuration parameter to make it available in the configuration object loaded by this class.
- Specified by:
configurein interfaceConfigurationSource- Throws:
ConfigurationException
-
listen
public void listen(String name)
- Specified by:
listenin interfaceConfigurationSource
-
stopListening
public void stopListening(String name)
- Specified by:
stopListeningin interfaceConfigurationSource
-
load
public InputStream load(String name) throws ConfigurationException
- Specified by:
loadin interfaceConfigurationSource- Throws:
ConfigurationException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-