|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.groiss.component.Configuration
public class Configuration
This class handles the access to the configuration. There are two types of configurations: the configuration of @enterprise and the configuration of the applications. On startup @enterprise reads the configuration files and keeps the contents in memory. For access to the system configuration use Configuration.get(). For accessing the configuration of an application use Configuration.get("appl-id").
A configuration object contains the map between parameter names and values.
Field Summary | |
---|---|
static java.lang.String |
OBFUSCATED_PREFIX
|
Method Summary | |
---|---|
void |
addParameterGroup(java.lang.String s)
|
static Configuration |
create(java.lang.String id)
Add a configuration to the internal map of configurations. |
static java.lang.String |
demansch(java.lang.String arg)
Deprecated. |
static Configuration |
get()
Return the @enterprise configuration. |
static Configuration |
get(java.lang.String id)
Get the configuration by the given id. |
java.lang.Boolean |
getBoolean(java.lang.String name)
Return the property value as Boolean. |
java.lang.Class<?> |
getClass(java.lang.String name)
Return the property value as class. |
static java.util.Map<java.lang.String,Configuration> |
getConfigurations()
Return the whole map of configurations. |
org.jdom.Element |
getDefinition()
Return the definition of a configuration. |
java.lang.Double |
getDouble(java.lang.String name)
Return the property value as Double. |
java.lang.String |
getFileName()
Return the file name the configuration is loaded from. |
java.lang.Float |
getFloat(java.lang.String name)
Return the property value as Float. |
java.lang.String |
getId()
Return the id of this configuration. |
java.lang.Integer |
getInt(java.lang.String name)
Return the property value as Integer. |
java.lang.Long |
getLong(java.lang.String name)
Return the property value as Long. |
java.lang.Object |
getObject(java.lang.String name)
Return the property value. |
java.lang.String |
getPasswordProperty(java.lang.String name)
Get the value of a "mangled" property. |
java.util.Properties |
getProperties()
Return the whole paramter map. |
java.util.Properties |
getPropertiesStartingWith(java.lang.String prefix)
Returns the subset of properties with names thhat start with a given prefix. |
java.lang.String |
getProperty(java.lang.String name)
Returns the value of the property with the given name. |
java.lang.String |
getProperty(java.lang.String name,
java.lang.String defValue)
Deprecated. define default values in the xml decsription of the configuration. |
java.util.Properties |
getPropertyAsProperties(java.lang.String name)
Returns the value of the (multi-valued) property with the given name in the form of a property. |
Resource |
getResource()
Rerturn the resource for this configuration. |
java.lang.Class |
getType(java.lang.String name)
Return the type of the given property. |
boolean |
isPasswordProperty(java.lang.String name)
|
static void |
loadTopLevel(java.lang.String filename)
Load the main configuration. |
static java.lang.String |
mansch(java.lang.String arg)
Deprecated. |
boolean |
needsRestart(java.lang.String param)
Returns true if the property change needs a server restart to become effective. |
void |
reload()
Reload the configuration from the configured file. |
static java.lang.String |
saveConvert(java.lang.String theString,
boolean escapeSpace)
|
void |
setFileName(java.lang.String filename)
Set the file name for the configuration. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Set a property to a value. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Set a property to a value. |
void |
setPropFile(java.lang.String url)
Set the url for the description file for the configuration. |
void |
setResource(Resource res)
Set a resource for internationalization of this configuration. |
void |
setSystemProps()
Copy all properties of this configuration into the system properties. |
void |
setVisibility(java.lang.String paramGroupId,
boolean visible)
Set the visibility of a parameter group in the configuration |
void |
store()
Save the configuration on the file system |
static void |
storeProps(java.util.Properties props,
java.io.File file)
|
static java.lang.String |
valToString(java.lang.Object value)
Convert a value from the configuration to a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String OBFUSCATED_PREFIX
Method Detail |
---|
public static Configuration create(java.lang.String id)
id
- the id of the application
public static Configuration get(java.lang.String id)
id
- the id of the configuration, normally the id of an application.
public static java.util.Map<java.lang.String,Configuration> getConfigurations()
public static Configuration get()
public void setResource(Resource res)
res
- a resource objectpublic Resource getResource()
public void setVisibility(java.lang.String paramGroupId, boolean visible)
paramGroupId
- the id of the groupvisible
- the new visibilitypublic org.jdom.Element getDefinition()
public void setPropFile(java.lang.String url)
url
- public void addParameterGroup(java.lang.String s)
s
- public boolean needsRestart(java.lang.String param)
param
- name of the property
public void reload() throws java.io.IOException
java.io.IOException
public static void loadTopLevel(java.lang.String filename) throws java.io.IOException, java.io.FileNotFoundException
java.io.IOException
java.io.FileNotFoundException
public void setSystemProps()
public java.lang.String getFileName()
public void setFileName(java.lang.String filename)
filename
- public java.lang.String getId()
public java.util.Properties getPropertiesStartingWith(java.lang.String prefix)
prefix
- the prefix to search for
public java.util.Properties getPropertyAsProperties(java.lang.String name)
name
- name of a property
public java.lang.String getProperty(java.lang.String name)
name
- name of a property
@Deprecated public java.lang.String getProperty(java.lang.String name, java.lang.String defValue)
defValue
, if the configuration entry is not found.
name
- the configuration entry keydefValue
- the default value
defValue
, if the configuration entry is not
found.public java.lang.Boolean getBoolean(java.lang.String name)
name
- the name of the property
public java.lang.Integer getInt(java.lang.String name)
name
- the name of the property
public java.lang.Long getLong(java.lang.String name)
name
- the name of the property
public java.lang.Float getFloat(java.lang.String name)
name
- the name of the property
public java.lang.Double getDouble(java.lang.String name)
name
- the name of the property
public java.lang.Class<?> getClass(java.lang.String name)
name
- the name of the property
public java.lang.Object getObject(java.lang.String name)
name
- the name of the property
public void setProperty(java.lang.String name, java.lang.String value)
name
- the name of the propertyvalue
- the value stringpublic void setProperty(java.lang.String name, java.lang.Object value)
name
- the name of the propertyvalue
- the value objectpublic boolean isPasswordProperty(java.lang.String name)
public java.lang.String getPasswordProperty(java.lang.String name)
name
-
public java.lang.Class getType(java.lang.String name)
name
- the name of the property
public void store()
public static void storeProps(java.util.Properties props, java.io.File file)
public static java.lang.String valToString(java.lang.Object value)
value
- an object
@Deprecated public static java.lang.String mansch(java.lang.String arg)
@Deprecated public static java.lang.String demansch(java.lang.String arg)
public java.util.Properties getProperties()
public static java.lang.String saveConvert(java.lang.String theString, boolean escapeSpace)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |