|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.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 String |
OBFUSCATED_PREFIX
|
| Method Summary | |
|---|---|
void |
addParameterGroup(String s)
|
static Configuration |
create(String id)
Add a configuration to the internal map of configurations. |
static String |
demansch(String arg)
Deprecated. |
static Configuration |
get()
Return the @enterprise configuration. |
static Configuration |
get(String id)
Get the configuration by the given id. |
Boolean |
getBoolean(String name)
Return the property value as Boolean. |
Class<?> |
getClass(String name)
Return the property value as class. |
static Map<String,Configuration> |
getConfigurations()
Return the whole map of configurations. |
Element |
getDefinition()
Return the definition of a configuration. |
Double |
getDouble(String name)
Return the property value as Double. |
String |
getFileName()
Return the file name the configuration is loaded from. |
Float |
getFloat(String name)
Return the property value as Float. |
String |
getId()
Return the id of this configuration. |
Integer |
getInt(String name)
Return the property value as Integer. |
Long |
getLong(String name)
Return the property value as Long. |
Object |
getObject(String name)
Return the property value. |
String |
getPasswordProperty(String name)
Get the value of a "mangled" property. |
Properties |
getProperties()
Return the whole paramter map. |
String |
getProperty(String name)
Returns the value of the property with the given name. |
String |
getProperty(String name,
String defValue)
Deprecated. define default values in the xml decsription of the configuration. |
Resource |
getResource()
Rerturn the resource for this configuration. |
Class |
getType(String name)
Return the type of the given property. |
boolean |
isPasswordProperty(String name)
|
static void |
loadTopLevel(String filename)
Load the main configuration. |
static String |
mansch(String arg)
Deprecated. |
boolean |
needsRestart(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 String |
saveConvert(String theString,
boolean escapeSpace)
|
void |
setFileName(String filename)
Set the file name for the configuration. |
void |
setProperty(String name,
Object value)
Set a property to a value. |
void |
setProperty(String name,
String value)
Set a property to a value. |
void |
setPropFile(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(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(Properties props,
File file)
|
static String |
valToString(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 String OBFUSCATED_PREFIX
| Method Detail |
|---|
public static Configuration create(String id)
id - the id of the application
public static Configuration get(String id)
id - the id of the configuration, normally the id of an application.
public static Map<String,Configuration> getConfigurations()
public static Configuration get()
public void setResource(Resource res)
res - a resource objectpublic Resource getResource()
public void setVisibility(String paramGroupId,
boolean visible)
paramGroupId - the id of the groupvisible - the new visibilitypublic Element getDefinition()
public void setPropFile(String url)
url - public void addParameterGroup(String s)
s - public boolean needsRestart(String param)
param - name of the property
public void reload()
throws IOException
IOException
public static void loadTopLevel(String filename)
throws IOException,
FileNotFoundException
IOException
FileNotFoundExceptionpublic void setSystemProps()
public String getFileName()
public void setFileName(String filename)
filename - public String getId()
public String getProperty(String name)
name - name of a property
@Deprecated
public String getProperty(String name,
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 Boolean getBoolean(String name)
name - the name of the property
public Integer getInt(String name)
name - the name of the property
public Long getLong(String name)
name - the name of the property
public Float getFloat(String name)
name - the name of the property
public Double getDouble(String name)
name - the name of the property
public Class<?> getClass(String name)
name - the name of the property
public Object getObject(String name)
name - the name of the property
public void setProperty(String name,
String value)
name - the name of the propertyvalue - the value string
public void setProperty(String name,
Object value)
name - the name of the propertyvalue - the value objectpublic boolean isPasswordProperty(String name)
public String getPasswordProperty(String name)
name -
public Class getType(String name)
name - the name of the property
public void store()
public static void storeProps(Properties props,
File file)
public static String valToString(Object value)
value - an object
@Deprecated public static String mansch(String arg)
@Deprecated public static String demansch(String arg)
public Properties getProperties()
public static String saveConvert(String theString,
boolean escapeSpace)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||