|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ConfigurationService
This service handles retrieval of the configuration data for a DSpace instance.
The configuration files are properties files which look like this for simple values:
getPropertyAsType(String, Class) methods.
There are special case configuration parameters allowed as well.
The first allows setting of a parameter on any DSpace service by the given name:
The second allows controlling the implementation used for a service interface or provider:
| Method Summary | ||
|---|---|---|
Map<String,String> |
getAllProperties()
Get all currently known configuration settings |
|
Properties |
getProperties()
Convenience method - get all configuration properties (settings) from the system. |
|
String |
getProperty(String name)
Convenience method - get a configuration property (setting) from the system. |
|
|
getPropertyAsType(String name,
Class<T> type)
Get a configuration property (setting) from the system as a specified type. |
|
|
getPropertyAsType(String name,
T defaultValue)
Get a configuration property (setting) from the system, or return a default value if none is found. |
|
|
getPropertyAsType(String name,
T defaultValue,
boolean setDefaultIfNotFound)
Get a configuration property (setting) from the system, or return (and possibly store) a default value if none is found. |
|
boolean |
setProperty(String name,
Object value)
Set a configuration property (setting) in the system. |
|
| Method Detail |
|---|
<T> T getPropertyAsType(String name,
Class<T> type)
T - name - the property nametype - the type to return the property as
UnsupportedOperationException - if the type cannot be converted to the requested type
<T> T getPropertyAsType(String name,
T defaultValue)
T - name - the property namedefaultValue - the value to return if this name is not found
IllegalArgumentException - if the defaultValue type does not match the type of the property by name
<T> T getPropertyAsType(String name,
T defaultValue,
boolean setDefaultIfNotFound)
T - name - the property namedefaultValue - the value to return if this name is not foundsetDefaultIfNotFound - if this is true and the config value
is not found then the default value will be set in the
configuration store assuming it is not null. Otherwise the
default value is just returned but not set.
IllegalArgumentException - if the defaultValue type does not match the type of the property by nameMap<String,String> getAllProperties()
String getProperty(String name)
name - the property name
Properties getProperties()
boolean setProperty(String name,
Object value)
name - the property namevalue - the property value (set this to null to clear out the property)
IllegalArgumentException - if the name is null
UnsupportedOperationException - if the type cannot be converted to something that is understandable by the system as a configuration property value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||