public class SingleJsonFileConfigurationStorage extends Object implements Configuration
Configuration.ConfigStorageType, Configuration.NodeFactoryBatchRunner.Batch| Modifier and Type | Field and Description |
|---|---|
static String |
CONF_FILENAME_SYSPROP |
private String |
fileName |
private static Logger |
log |
private org.codehaus.jackson.map.ObjectMapper |
objectMapper |
static String |
USE_GIT_SYSPROP
Experimental
|
CONF_STORAGE_SYSTEM_PROP, OLOCK_HASH_KEY, REFERENCE_BY_UUID_PATTERN, REFERENCE_KEY, UUID_KEY, WEAK_REFERENCE_KEY| Constructor and Description |
|---|
SingleJsonFileConfigurationStorage() |
SingleJsonFileConfigurationStorage(String fileName) |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(Hashtable<?,?> props) |
Object |
getConfigurationNode(Path path,
Class configurableClass)
Loads a configuration node under the specified path.
|
Map<String,Object> |
getConfigurationRoot()
Return the root of the configuration tree.
|
Path |
getPathByUUID(String uuid) |
void |
lock()
Aquire a global pessimistic lock (cluster-aware implementations should ensure that only a single node can aquire the lock at a time)
Subsequent calls from the same transaction should not block.
|
boolean |
nodeExists(Path path)
Tests if a node under the specified path exists.
|
void |
persistNode(Path path,
Map<String,Object> configNode,
Class configurableClass)
Persists the configuration node to the specified path.
|
void |
refreshNode(Path path)
Invalidates any present cached state for the node
It is imperative that some other nodes might also be refreshed during the operation.
|
void |
removeNode(Path path)
Removes a configuration node under the specified path with all its children permanently
|
static String |
resolveConfigFileNameSetting(Hashtable<?,?> props) |
void |
runBatch(BatchRunner.Batch batch)
Provides support for batching configuration changes.
|
Iterator |
search(String liteXPathExpression)
Performs a search on the configuration tree and returns an iterator to configuration nodes that satisfy the search criteria.
|
public static final String CONF_FILENAME_SYSPROP
public static final String USE_GIT_SYSPROP
private org.codehaus.jackson.map.ObjectMapper objectMapper
public SingleJsonFileConfigurationStorage()
public SingleJsonFileConfigurationStorage(String fileName)
public static String resolveConfigFileNameSetting(Hashtable<?,?> props)
public boolean nodeExists(Path path) throws ConfigurationException
ConfigurationnodeExists in interface ConfigurationConfigurationExceptionpublic Map<String,Object> getConfigurationRoot() throws ConfigurationException
ConfigurationgetConfigurationRoot in interface ConfigurationConfigurationExceptionpublic Object getConfigurationNode(Path path, Class configurableClass) throws ConfigurationException
ConfigurationgetConfigurationNode in interface Configurationpath - A reference to a nodeConfigurationExceptionpublic void persistNode(Path path, Map<String,Object> configNode, Class configurableClass) throws ConfigurationException
ConfigurationpersistNode in interface Configurationpath - path to the nodeconfigNode - configuration node to persistconfigurableClass - class annotated with ConfigurableClass, ConfigurableProperty annotations that corresponds to this node.ConfigurationExceptionpublic void refreshNode(Path path)
ConfigurationrefreshNode in interface Configurationpublic void removeNode(Path path) throws ConfigurationException
ConfigurationremoveNode in interface ConfigurationConfigurationExceptionpublic Path getPathByUUID(String uuid)
getPathByUUID in interface Configurationpublic Iterator search(String liteXPathExpression) throws IllegalArgumentException, ConfigurationException
Configurationsearch in interface ConfigurationliteXPathExpression - Must be absolute path, no double slashes, no @attributes (only [attr=val] or [attr<>val])IllegalArgumentExceptionConfigurationExceptionpublic void lock()
Configurationlock in interface Configurationpublic void runBatch(BatchRunner.Batch batch)
BatchRunnerrunBatch in interface BatchRunnerbatch - Configuration batch change to executeCopyright © 2017 dcm4che.org. All rights reserved.