|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.ibm.wbi.persistent.Section
Persistent store mechanism. A Section is the unified interface for persistent storage in WBI. A Section contains arbitrary key/value pairs accessed by the getValue(...) methods, and other named subsections accessed by the getSection(...) methods. In other words, the Section persistence mechanism is a hierarchical database much like a filesystem. It can be mapped onto different backends including a filesystem and LDAP.
| Field Summary | |
static java.lang.String |
COPYRIGHT
|
| Method Summary | |
Section |
createSection(java.lang.String pathstr)
Creates the named Section and returns it. |
Section |
createSection(java.lang.String pathstr,
java.lang.ClassLoader loader)
|
void |
disposeSection(java.lang.String pathstr)
The Section system maintains references to Sections that have already been opened to ensure that when a section is asked for by name twice, the same Section is returned each time. |
boolean |
getBooleanValue(java.lang.String key)
|
boolean |
getBooleanValue(java.lang.String key,
boolean def)
|
byte |
getByteValue(java.lang.String key)
|
byte |
getByteValue(java.lang.String key,
byte def)
|
char |
getCharacterValue(java.lang.String key)
|
char |
getCharacterValue(java.lang.String key,
char def)
|
double |
getDoubleValue(java.lang.String key)
|
double |
getDoubleValue(java.lang.String key,
double def)
|
float |
getFloatValue(java.lang.String key)
|
float |
getFloatValue(java.lang.String key,
float def)
|
int |
getIntegerValue(java.lang.String key)
|
int |
getIntegerValue(java.lang.String key,
int def)
|
long |
getLongValue(java.lang.String key)
|
long |
getLongValue(java.lang.String key,
long def)
|
java.lang.String |
getName()
Get the name, or last component of the path, for this section. |
java.io.Serializable |
getObjectValue(java.lang.String key)
|
java.io.Serializable |
getObjectValue(java.lang.String key,
java.io.Serializable def)
|
Section |
getParentSection()
Get the parent of this section. |
java.lang.String |
getPath()
Get the fully-qualified path of this section. |
Section |
getSection(java.lang.String pathstr)
Get the Section specified by the path. |
Section |
getSection(java.lang.String pathstr,
java.lang.ClassLoader loader)
|
short |
getShortValue(java.lang.String key)
|
short |
getShortValue(java.lang.String key,
short def)
|
java.lang.String |
getValue(java.lang.String key)
Get the value associated with the given key. |
java.lang.String |
getValue(java.lang.String key,
java.lang.String def)
Get the value associated with this key or the default. |
boolean |
isContainer()
|
boolean |
isEmpty()
Return whether or not the section is empty (no keys or children). |
boolean |
keyExists(java.lang.String key)
Tell whether a key exists in this section |
java.util.Enumeration |
keys()
Get the keys associated with this section. |
int |
keysSize()
Return the number of keys associated with this section |
static void |
main(java.lang.String[] args)
Internal-use testing suite |
void |
removeKey(java.lang.String key)
Remove a key from this section |
void |
removeSection(java.lang.String pathstr)
Removes the named section. |
boolean |
revert()
Revert the Section to the last saved state. |
void |
save()
Save the current state. |
void |
save(boolean force)
Save the current state. |
boolean |
saveWithStatus()
Save the current state. |
boolean |
saveWithStatus(boolean force)
Save the current state. |
boolean |
sectionExists(java.lang.String pathstr)
Tell whether the named section exists (not recursive) |
java.util.Enumeration |
sections()
Get an enumeration of immediately contained sections. |
java.util.Enumeration |
sections(java.lang.ClassLoader loader)
|
java.util.Enumeration |
sectionsRecursively()
Get an enumeration of all contained sections, recursively. |
java.util.Enumeration |
sectionsRecursively(java.lang.ClassLoader loader)
|
int |
sectionsSize()
Return the number of sections contained in this section |
void |
setAutoSave(boolean enabled)
Enable/disable autosave. |
void |
setDefaultClassLoader(java.lang.ClassLoader defloader)
|
void |
setValue(java.lang.String key,
boolean value)
|
void |
setValue(java.lang.String key,
byte value)
|
void |
setValue(java.lang.String key,
char value)
|
void |
setValue(java.lang.String key,
double value)
|
void |
setValue(java.lang.String key,
float value)
|
void |
setValue(java.lang.String key,
int value)
|
void |
setValue(java.lang.String key,
long value)
|
void |
setValue(java.lang.String key,
java.io.Serializable value)
Set the value associated with the given key. |
void |
setValue(java.lang.String key,
short value)
|
java.lang.String |
toString()
Give a string representation of this section. |
java.util.Enumeration |
values()
Get the values associated with this section. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String COPYRIGHT
| Method Detail |
public void setDefaultClassLoader(java.lang.ClassLoader defloader)
public void setAutoSave(boolean enabled)
enabled - enable this featurepublic int keysSize()
public int sectionsSize()
public boolean isEmpty()
public boolean revert()
public void removeSection(java.lang.String pathstr)
pathstr - name of section to remove, e.g., "a/b/c"getSection(String)public void disposeSection(java.lang.String pathstr)
pathstr - The path name for the sectiongetSection(String)public Section createSection(java.lang.String pathstr)
pathstr - path of the newly created SectiongetSection(String)
public Section createSection(java.lang.String pathstr,
java.lang.ClassLoader loader)
public Section getSection(java.lang.String pathstr)
pathstr - The path of the section to get
public Section getSection(java.lang.String pathstr,
java.lang.ClassLoader loader)
public Section getParentSection()
public java.util.Enumeration sections()
sectionsRecursively()public java.util.Enumeration sections(java.lang.ClassLoader loader)
public java.util.Enumeration sectionsRecursively()
sections()public java.util.Enumeration sectionsRecursively(java.lang.ClassLoader loader)
public boolean sectionExists(java.lang.String pathstr)
pathstr - The path to the tested Sectionpublic void save()
setValue() or
removeKey() are called.save(boolean force)public boolean saveWithStatus()
setValue() or
removeKey() are called.saveWithStatus(boolean force)public void save(boolean force)
force - disregard the dirty flag; save alwayssaveWithStatus()public boolean saveWithStatus(boolean force)
setValue() or removeKey()
are called. Since it is possible to save an object with nested
values, the dirty flag might not be maintained correctly. In
this case the force flag should be used. Typically
save(), which sets the force flag to false, is
appropriate.
If the save is successful, true is returned. Otherwise, false is returned.
force - disregard the dirty flag; save alwayssave()public java.lang.String getPath()
public java.lang.String getName()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Enumeration keys()
public java.util.Enumeration values()
public boolean keyExists(java.lang.String key)
key - The key to testpublic void removeKey(java.lang.String key)
key - The key to removepublic java.lang.String getValue(java.lang.String key)
getValue() returns a String; to get an arbitrary
Serializable Object, use getObjectValue().key - Which key to get the value for
public java.lang.String getValue(java.lang.String key,
java.lang.String def)
key - Which key to get the value fordef - Default value if key does not existgetValue(String)public java.io.Serializable getObjectValue(java.lang.String key)
getValue(String)
public java.io.Serializable getObjectValue(java.lang.String key,
java.io.Serializable def)
getValue(String, String)public int getIntegerValue(java.lang.String key)
getValue(String)
public int getIntegerValue(java.lang.String key,
int def)
getValue(String, String)public short getShortValue(java.lang.String key)
getValue(String)
public short getShortValue(java.lang.String key,
short def)
getValue(String, String)public long getLongValue(java.lang.String key)
getValue(String)
public long getLongValue(java.lang.String key,
long def)
getValue(String, String)public double getDoubleValue(java.lang.String key)
getValue(String)
public double getDoubleValue(java.lang.String key,
double def)
getValue(String, String)public float getFloatValue(java.lang.String key)
getValue(String)
public float getFloatValue(java.lang.String key,
float def)
getValue(String, String)public boolean getBooleanValue(java.lang.String key)
getValue(String)
public boolean getBooleanValue(java.lang.String key,
boolean def)
getValue(String, String)public char getCharacterValue(java.lang.String key)
getValue(String)
public char getCharacterValue(java.lang.String key,
char def)
getValue(String, String)public byte getByteValue(java.lang.String key)
getValue(String)
public byte getByteValue(java.lang.String key,
byte def)
getValue(String, String)
public void setValue(java.lang.String key,
java.io.Serializable value)
key - The key to bind the value tovalue - The value to bind to the key
public void setValue(java.lang.String key,
short value)
setValue(String, Serializable)
public void setValue(java.lang.String key,
int value)
setValue(String, Serializable)
public void setValue(java.lang.String key,
long value)
setValue(String, Serializable)
public void setValue(java.lang.String key,
float value)
setValue(String, Serializable)
public void setValue(java.lang.String key,
double value)
setValue(String, Serializable)
public void setValue(java.lang.String key,
boolean value)
setValue(String, Serializable)
public void setValue(java.lang.String key,
char value)
setValue(String, Serializable)
public void setValue(java.lang.String key,
byte value)
setValue(String, Serializable)public boolean isContainer()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||