public interface ConfigService
Modifier and Type | Method and Description |
---|---|
void |
create(String... path)
Recursive creation of a path, allowing for the existence of any or all of the path.
|
void |
delete(String... path)
Recursive delete of a path without any option to recover.
|
boolean |
exists(String... path)
Check if a given path exists
|
Set<String> |
getChildren(ConfigChildListener listener,
String... path)
Retrieve the children of a given path
|
ClassLoader |
getClassLoader(ConfigClassesListener listener,
ClassLoader parent,
String... path)
Retrieve a
ClassLoader rooted at the given location |
ClassLoader |
getJarLoader(ConfigClassesListener listener,
ClassLoader parent,
String... path)
Retrieve a
URLClassLoader rooted at the given location. |
Properties |
getProperties(ConfigDataListener listener,
String... path)
Retrieve the properties from a given path
|
String |
getString(ConfigDataListener listener,
String... path)
Retrieve string data from a given path
|
String |
setData(ConfigDataListener listener,
boolean ephemeral,
boolean sequential,
byte[] bytes,
String... path)
Set binary data
|
String |
setProperties(ConfigDataListener listener,
boolean ephemeral,
boolean sequential,
Properties properties,
String... path)
Set properties against a path
|
String |
setString(ConfigDataListener listener,
boolean ephemeral,
boolean sequential,
String value,
String... path)
Retrieve string data from a given path
|
boolean |
updateData(byte[] bytes,
String... path)
Update data at a given path
|
boolean |
updateProperties(Properties properties,
String... path)
Update properties at a given path
|
boolean |
updateString(String value,
String... path)
Update a specific string value
|
static final String SEPARATOR
boolean exists(String... path)
path
- the path (over and above any root path) to checkvoid delete(String... path)
path
- the path (over and above any root path)void create(String... path)
exists
must always return
truepath
- the path to ensureString getString(ConfigDataListener listener, String... path)
listener
- a listener to call if the data changes (null allowed)path
- the path to the dataString setData(ConfigDataListener listener, boolean ephemeral, boolean sequential, byte[] bytes, String... path)
listener
- a listener to call if the properties change (null allowed)ephemeral
- true if the path should be removed when the server stopssequential
- true if the last path element must have an auto-incrementing
value attached i.e. if the final path element is always newbytes
- the data to setpath
- the path to the propertiesboolean updateData(byte[] bytes, String... path)
bytes
- the properties to setpath
- the path to the propertiesString setString(ConfigDataListener listener, boolean ephemeral, boolean sequential, String value, String... path)
listener
- a listener to call if the data changes (null allowed)ephemeral
- true if the path should be removed when the server stopssequential
- true if the last path element must have an auto-incrementing
value attached i.e. if the final path element is always newvalue
- the value to setpath
- the path to the propertiesboolean updateString(String value, String... path)
value
- the value to setpath
- the path to the propertiesProperties getProperties(ConfigDataListener listener, String... path)
listener
- a listener to call if the properties change (null allowed)path
- the path to the propertiesString setProperties(ConfigDataListener listener, boolean ephemeral, boolean sequential, Properties properties, String... path)
listener
- a listener to call if the properties change (null allowed)ephemeral
- true if the path should be removed when the server stopssequential
- true if the last path element must have an auto-incrementing
value attached i.e. if the final path element is always newproperties
- the properties to setpath
- the path to the propertiesboolean updateProperties(Properties properties, String... path)
properties
- the properties to setpath
- the path to the propertiesSet<String> getChildren(ConfigChildListener listener, String... path)
listener
- a listener to call if the the children change (null allowed)path
- the path to the parentClassLoader getClassLoader(ConfigClassesListener listener, ClassLoader parent, String... path)
ClassLoader
rooted at the given locationlistener
- a listener to call if the classes change (null allowed)parent
- the parent ClassLoader
path
- the path to the classes root (akin to a classpath)ClassLoader
ClassLoader getJarLoader(ConfigClassesListener listener, ClassLoader parent, String... path)
URLClassLoader
rooted at the given location. The children of the given
path are found and each is treated as a separate jar file.listener
- a listener to call if the classes change (null allowed)parent
- the parent ClassLoader
path
- the path to the jarClassLoader
Copyright © 2014. All rights reserved.