Package org.bedework.util.config
Interface ConfigurationStore
-
- All Known Implementing Classes:
ConfigurationFileStore
public interface ConfigurationStoreA configuration store holds configurations, each identified by a unique name,In addition it may contain sub-stores.
Not surprisingly this looks like a file system with one file per config and directories representing the stores.
A store may be read-only or read-write. If read-write it may require credentials.
- Author:
- Mike Douglass douglm
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default PathensureDir(Path path)ConfigBase<?>getConfig(String name)Stored config must indicate class of object as an attributeConfigBase<?>getConfig(String name, Class<?> cl)List<String>getConfigs()List the configurations in the storePathgetDirPath()ResourceBundlegetResource(String name, String locale)ConfigurationStoregetStore(String name)Get the named child store.booleanreadOnly()voidsaveConfiguration(ConfigBase<?> config)
-
-
-
Method Detail
-
readOnly
boolean readOnly()
- Returns:
- true for a read-only store.
-
getDirPath
Path getDirPath()
- Returns:
- path for this store
-
saveConfiguration
void saveConfiguration(ConfigBase<?> config) throws ConfigException
- Parameters:
config- to save- Throws:
ConfigException- on error
-
getConfig
ConfigBase<?> getConfig(String name) throws ConfigException
Stored config must indicate class of object as an attribute- Parameters:
name- of the object- Returns:
- config or null
- Throws:
ConfigException- on error
-
getConfig
ConfigBase<?> getConfig(String name, Class<?> cl) throws ConfigException
- Parameters:
name- of the objectcl- - class of config object- Returns:
- config or null
- Throws:
ConfigException- on error
-
getConfigs
List<String> getConfigs() throws ConfigException
List the configurations in the store- Returns:
- list of configurations
- Throws:
ConfigException- on error
-
getStore
ConfigurationStore getStore(String name) throws ConfigException
Get the named child store. Create it if it does not exist- Parameters:
name- of the store- Returns:
- store
- Throws:
ConfigException- on error
-
getResource
ResourceBundle getResource(String name, String locale) throws ConfigException
- Parameters:
name- of bundlelocale- null for default or a locale String e.g. en_US- Returns:
- a ResourceBundle object or null.
- Throws:
ConfigException- on error
-
ensureDir
default Path ensureDir(Path path) throws ConfigException
- Throws:
ConfigException
-
-