#include <xmltooling/util/StorageService.h>
Public Member Functions | |
| virtual bool | createString (const char *context, const char *key, const char *value, time_t expiration)=0 |
| Creates a new "short" record in the storage service. | |
| virtual int | readString (const char *context, const char *key, std::string *pvalue=NULL, time_t *pexpiration=NULL, int version=0)=0 |
| Returns an existing "short" record from the storage service. | |
| virtual int | updateString (const char *context, const char *key, const char *value=NULL, time_t expiration=0, int version=0)=0 |
| Updates an existing "short" record in the storage service. | |
| virtual bool | deleteString (const char *context, const char *key)=0 |
| Deletes an existing "short" record from the storage service. | |
| virtual bool | createText (const char *context, const char *key, const char *value, time_t expiration)=0 |
| Creates a new "long" record in the storage service. | |
| virtual int | readText (const char *context, const char *key, std::string *pvalue=NULL, time_t *pexpiration=NULL, int version=0)=0 |
| Returns an existing "long" record from the storage service. | |
| virtual int | updateText (const char *context, const char *key, const char *value=NULL, time_t expiration=0, int version=0)=0 |
| Updates an existing "long" record in the storage service. | |
| virtual bool | deleteText (const char *context, const char *key)=0 |
| Deletes an existing "long" record from the storage service. | |
| virtual void | reap (const char *context)=0 |
| Manually trigger a cleanup of expired records. | |
| virtual void | updateContext (const char *context, time_t expiration)=0 |
| Updates the expiration time of all records in the context. | |
| virtual void | deleteContext (const char *context)=0 |
| Forcibly removes all records in a given context along with any associated resources devoted to maintaining the context. | |
Implementations will vary in how much persistence they can supply.
Storage is divided into "contexts" identified by a string label. Keys need to be unique only within a given context, so multiple components can share a single storage service safely as long as they use different labels.
| virtual bool xmltooling::StorageService::createString | ( | const char * | context, | |
| const char * | key, | |||
| const char * | value, | |||
| time_t | expiration | |||
| ) | [pure virtual] |
Creates a new "short" record in the storage service.
| context | a storage context label | |
| key | null-terminated unique key of up to 255 bytes | |
| value | null-terminated value of up to 255 bytes to store | |
| expiration | an expiration timestamp, after which the record can be purged |
| IOException | raised if fatal errors occur in the insertion process |
| virtual bool xmltooling::StorageService::createText | ( | const char * | context, | |
| const char * | key, | |||
| const char * | value, | |||
| time_t | expiration | |||
| ) | [pure virtual] |
Creates a new "long" record in the storage service.
| context | a storage context label | |
| key | null-terminated unique key of up to 255 bytes | |
| value | null-terminated value of arbitrary length | |
| expiration | an expiration timestamp, after which the record can be purged |
| IOException | raised if errors occur in the insertion process |
| virtual void xmltooling::StorageService::deleteContext | ( | const char * | context | ) | [pure virtual] |
Forcibly removes all records in a given context along with any associated resources devoted to maintaining the context.
| context | a storage context label |
| virtual bool xmltooling::StorageService::deleteString | ( | const char * | context, | |
| const char * | key | |||
| ) | [pure virtual] |
Deletes an existing "short" record from the storage service.
| context | a storage context label | |
| key | null-terminated unique key of up to 255 bytes |
| IOException | raised if errors occur in the deletion process |
| virtual bool xmltooling::StorageService::deleteText | ( | const char * | context, | |
| const char * | key | |||
| ) | [pure virtual] |
Deletes an existing "long" record from the storage service.
| context | a storage context label | |
| key | null-terminated unique key of up to 255 bytes |
| IOException | raised if errors occur in the deletion process |
| virtual int xmltooling::StorageService::readString | ( | const char * | context, | |
| const char * | key, | |||
| std::string * | pvalue = NULL, |
|||
| time_t * | pexpiration = NULL, |
|||
| int | version = 0 | |||
| ) | [pure virtual] |
Returns an existing "short" record from the storage service.
The version parameter can be set for "If-Modified-Since" semantics.
| context | a storage context label | |
| key | null-terminated unique key of up to 255 bytes | |
| pvalue | location in which to return the record value | |
| pexpiration | location in which to return the expiration timestamp | |
| version | if > 0, only copy back data if newer than supplied version |
| IOException | raised if errors occur in the read process |
| virtual int xmltooling::StorageService::readText | ( | const char * | context, | |
| const char * | key, | |||
| std::string * | pvalue = NULL, |
|||
| time_t * | pexpiration = NULL, |
|||
| int | version = 0 | |||
| ) | [pure virtual] |
Returns an existing "long" record from the storage service.
The version parameter can be set for "If-Modified-Since" semantics.
| context | a storage context label | |
| key | null-terminated unique key of up to 255 bytes | |
| pvalue | location in which to return the record value | |
| pexpiration | location in which to return the expiration timestamp | |
| version | if > 0, only copy back data if newer than supplied version |
| IOException | raised if errors occur in the read process |
| virtual void xmltooling::StorageService::reap | ( | const char * | context | ) | [pure virtual] |
Manually trigger a cleanup of expired records.
The method MAY return without guaranteeing that cleanup has already occurred.
| context | a storage context label |
| virtual void xmltooling::StorageService::updateContext | ( | const char * | context, | |
| time_t | expiration | |||
| ) | [pure virtual] |
Updates the expiration time of all records in the context.
| context | a storage context label | |
| expiration | a new expiration timestamp |
| virtual int xmltooling::StorageService::updateString | ( | const char * | context, | |
| const char * | key, | |||
| const char * | value = NULL, |
|||
| time_t | expiration = 0, |
|||
| int | version = 0 | |||
| ) | [pure virtual] |
Updates an existing "short" record in the storage service.
| context | a storage context label | |
| key | null-terminated unique key of up to 255 bytes | |
| value | null-terminated value of up to 255 bytes to store, or NULL to leave alone | |
| expiration | a new expiration timestamp, or 0 to leave alone | |
| version | if > 0, only update if the current version matches this value |
| IOException | raised if errors occur in the update process |
| virtual int xmltooling::StorageService::updateText | ( | const char * | context, | |
| const char * | key, | |||
| const char * | value = NULL, |
|||
| time_t | expiration = 0, |
|||
| int | version = 0 | |||
| ) | [pure virtual] |
Updates an existing "long" record in the storage service.
| context | a storage context label | |
| key | null-terminated unique key of up to 255 bytes | |
| value | null-terminated value of arbitrary length to store, or NULL to leave alone | |
| expiration | a new expiration timestamp, or 0 to leave alone | |
| version | if > 0, only update if the current version matches this value |
| IOException | raised if errors occur in the update process |
1.4.7