#include <KeyValueStore.h>
Public Member Functions | |
virtual | ~KeyValueStore () |
Virtual destructor. | |
virtual StringBuffer | readPropertyValue (const char *prop) const =0 |
Returns the value of the given property. | |
virtual int | setPropertyValue (const char *prop, const char *value)=0 |
Sets a property value. | |
virtual int | removeProperty (const char *prop)=0 |
Remove a certain property. | |
virtual int | removeAllProperties ()=0 |
Remove all the properties in the value store. | |
virtual Enumeration & | getProperties ()=0 |
Get all the properties that are currently defined. | |
virtual int | close ()=0 |
Ensure that all properties are stored persistently. |
Some implementations might store them in some kind of background storage, others might only save them transiently in memory.
This class defines the common methods that have to be specialized by implementation on filesystem, registry, db...
virtual int KeyValueStore::close | ( | ) | [pure virtual] |
Ensure that all properties are stored persistently.
If setting a property led to an error earlier, this call will indicate the failure.
Implemented in MemoryKeyValueStore, PropertyFile, SQLiteKeyValueStore, and BlockingSQLiteKeyValueStore.
virtual StringBuffer KeyValueStore::readPropertyValue | ( | const char * | prop | ) | const [pure virtual] |
Returns the value of the given property.
prop | - the property name |
Implemented in MemoryKeyValueStore, and SQLKeyValueStore.
virtual int KeyValueStore::removeProperty | ( | const char * | prop | ) | [pure virtual] |
Remove a certain property.
prop | the name of the property which is to be removed |
Implemented in MemoryKeyValueStore, PropertyFile, and SQLKeyValueStore.
virtual int KeyValueStore::setPropertyValue | ( | const char * | prop, | |
const char * | value | |||
) | [pure virtual] |
Sets a property value.
The value might be cached inside the implementation of this interface. To ensure that it is stored persistently and to do error checking, call save().
prop | - the property name | |
value | - the property value (zero terminated string) |
Implemented in MemoryKeyValueStore, PropertyFile, and SQLKeyValueStore.