|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fao.geonet.kernel.setting.SettingManager
public class SettingManager
Allows hierarchical management of application settings. The settings API has been designed with the following goals: - speed: all the settings tree is kept into memory - transactional: changes follow the rules of transactions. The only issue is that changes are not visible until commit. If a thread changes a value and then reads it, the thread gets the old value. Added settings will not be visible and removed ones will still be visible until commit. - concurrent: many thread can access the settings API at the same time. A read/write lock is used to arbitrate threads Multiple removes: there are no issues. If thread A removes a subtree S1 and another thread B removes a subtree S2 inside S1, the first thread to commit succeeds while the second always rises a 'cannot serializable exception'. In any commit combination, the settings integrity is maintained. Tree structure: + system | + options | + useProxy | + host | + port | + harvesting
| Constructor Summary | |
|---|---|
SettingManager(Dbms dbms,
ProviderManager provMan)
|
|
| Method Summary | |
|---|---|
String |
add(Dbms dbms,
String path,
Object name,
Object value)
When adding to a newly created node, path must be 'id:...'. |
org.jdom.Element |
get(String path,
int level)
|
String |
getValue(String path)
|
boolean |
getValueAsBool(String path)
|
boolean |
getValueAsBool(String path,
boolean defValue)
|
Integer |
getValueAsInt(String path)
|
boolean |
refresh(Dbms dbms)
Refreshes current settings manager. |
boolean |
remove(Dbms dbms,
String path)
TODO javadoc. |
boolean |
removeChildren(Dbms dbms,
String path)
TODO javadoc. |
boolean |
setName(Dbms dbms,
String path,
String name)
TODO javadoc. |
boolean |
setValue(Dbms dbms,
String path,
Object value)
TODO javadoc. |
boolean |
setValues(Dbms dbms,
Map<String,Object> values)
TODO javadoc. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SettingManager(Dbms dbms,
ProviderManager provMan)
throws SQLException
SQLException| Method Detail |
|---|
public org.jdom.Element get(String path,
int level)
public String getValue(String path)
public boolean setName(Dbms dbms,
String path,
String name)
throws SQLException
dbms - path - name -
SQLException
public boolean setValue(Dbms dbms,
String path,
Object value)
throws SQLException
dbms - path - value -
SQLException
public boolean setValues(Dbms dbms,
Map<String,Object> values)
throws SQLException
dbms - values -
SQLException
public String add(Dbms dbms,
String path,
Object name,
Object value)
throws SQLException
dbms - path - name - value -
SQLException
public boolean remove(Dbms dbms,
String path)
throws SQLException
dbms - path -
SQLException
public boolean removeChildren(Dbms dbms,
String path)
throws SQLException
dbms - path -
SQLException
public boolean refresh(Dbms dbms)
throws SQLException
SQLException
public boolean getValueAsBool(String path,
boolean defValue)
public boolean getValueAsBool(String path)
public Integer getValueAsInt(String path)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||