public class MemoryConfigurationContext extends Object implements ConfigurationContext
ConfigurationContext
that stores content in memory only (not
persisting it).Constructor and Description |
---|
MemoryConfigurationContext() |
Modifier and Type | Method and Description |
---|---|
ConfigurationItem |
createConfigurationItem(String relativeLocation,
InputStream configuration)
Creates a new
ConfigurationItem at the relative location. |
void |
deleteConfigurationItem(String relativeLocation)
Deletes the
ConfigurationItem at the relative location. |
ConfigurationItem |
getConfigurationItem(String relativeLocation)
Obtains the
ConfigurationItem at the relative location. |
String |
getLocation()
Obtains the location for this
ConfigurationContext . |
boolean |
isReadOnly()
Indicates if the configuration is read-only.
|
public String getLocation()
ConfigurationContext
Obtains the location for this ConfigurationContext
.
This value is used in the equality of ConfigurationContext
instances.
getLocation
in interface ConfigurationContext
ConfigurationContext
.public ConfigurationItem getConfigurationItem(String relativeLocation) throws Exception
ConfigurationContext
ConfigurationItem
at the relative location.getConfigurationItem
in interface ConfigurationContext
relativeLocation
- Relative location of the ConfigurationItem
to obtain.ConfigurationItem
.Exception
- If can not obtain a ConfigurationItem
at the relative
location.public boolean isReadOnly()
ConfigurationContext
isReadOnly
in interface ConfigurationContext
true
should the configuration be read-only.public ConfigurationItem createConfigurationItem(String relativeLocation, InputStream configuration) throws Exception
ConfigurationContext
ConfigurationItem
at the relative location.createConfigurationItem
in interface ConfigurationContext
relativeLocation
- Relative location of the ConfigurationItem
to create.configuration
- Configuration for the ConfigurationItem
.ConfigurationItem
.Exception
- If fails to create the ConfigurationItem
.ReadOnlyConfigurationException
- Should the underlying implementation be read-only.public void deleteConfigurationItem(String relativeLocation)
ConfigurationContext
ConfigurationItem
at the relative location.deleteConfigurationItem
in interface ConfigurationContext
relativeLocation
- Relative location of the ConfigurationItem
to delete.Copyright © 2005–2016. All rights reserved.