#include <metadatabase.h>
Link against: commsdat.lib
class CommsDat::MMetaDatabase : public Meta::MMetaData, public Meta::MMetaData |
Public Member Functions | |
---|---|
virtual | ~MMetaDatabase() |
IMPORT_C TInt | CancelNotification(CMDBSession &, TRequestStatus &) |
IMPORT_C void | DeleteL(CMDBSession &) |
IMPORT_C TBool | FindL(CMDBSession &) |
IMPORT_C void | LoadL(CMDBSession &) |
IMPORT_C void | ModifyL(CMDBSession &) |
IMPORT_C void | RefreshL(CMDBSession &) |
IMPORT_C TInt | RequestNotification(CMDBSession &, TRequestStatus &) |
IMPORT_C void | StoreL(CMDBSession &) |
Protected Member Functions | |
---|---|
MMetaDatabase() |
Inherited Functions | |
---|---|
Meta::MMetaData::GetAttribPtr(const TInt)const | |
Meta::MMetaData::GetVDataTable()const |
Interface for interaction with a database server Inherited by each data set type that can be stored
IMPORT_C | MMetaDatabase | ( | ) | [protected, explicit] |
Protected and explicit constructor - nothing to construct
IMPORT_C TInt | CancelNotification | ( | CMDBSession & | aSession, |
TRequestStatus & | aRequestStatus | |||
) |
CancelNotification - cancel an outstanding notification request
note that all outstanding notification requests can be cancelled by a call to
CMDBSession::CancelAllNotifications
There is an outstanding notification request
IMPORT_C void | DeleteL | ( | CMDBSession & | aSession | ) |
Delete fields from the database.
Client can request to ignore access control flags by setting the attribute mask, but only fields that the client has capabilities to delete will be removed.
A request to delete data in unauthorised area will cause the function to leave
Leave Codes | |
---|---|
If | client not authorised to read or write the data, will leave with KErrPermissionDenied May also leave with other general error codes if there are unexpected problems (e.g. KErrNoMemory when out of memory) |
IMPORT_C TBool | FindL | ( | CMDBSession & | aSession | ) |
FindL - Find and Load the data set(s) that match all the data values entered by the client in this container
Client can request to ignore access control flags by setting the attribute mask, CMDBSession::SetAttributeMask() However will not load data that the client is not authorised to see (by platsec) even if the client has sets the appropriate attribute mask
Will return ETrue on success EFalse if no data found that the client is authorised to view
May also leave with KErrGeneral or other general error codes.
On failure, the container should be discarded or repopulated before it is used again
Please note - a case insensitive search is done in the case of text based fields
IMPORT_C void | LoadL | ( | CMDBSession & | aSession | ) |
LoadL - Load this container with data from the database
Any data in the container will be discarded
Individual fields may legitimately be NULL in the database, but if no data at all is found for an entire table or record, LoadL will leave with KErrNotFound
The client can request to ignore access control flags by setting the attribute mask CMDBSession::SetAttributeMask() However, only fields that the client has capabilities to write will be stored in the database A request to read data from an unauthorised area of the database will cause the function to leave.with KErrPermissionDenied
In a record, fields in an unauthorised column may be silently ignored and returned as NULL
May also leave with KErrNoMemory or other general error codes
On failure, the container should be discarded or reloaded before it is used again
Loads each member of the MMetaDatabase object from the database. Will (delete and) overwrite any data already in the container.
IMPORT_C void | ModifyL | ( | CMDBSession & | aSession | ) |
Modify all fields in the database that have been changed in this container by the caller
Modification is atomic for this container. It uses an internal transaction even if no overall transaction set by client. All changed fields in the element are modified in database on success. No fields are altered in the database if the function leaves
Client can request to ignore access control flags by setting the attribute mask CMDBSession::SetAttributeMask() However, only fields that the client has capabilities to alter will be modified.in the database A request to modify data in an unauthorised area will cause the function to leave.with KErrPermissionDenied
May also leave with other general error codes if there are unexpected problems (e.g. KErrNoMemory when out of memory)
On failure, the container should be discarded or repopulated before it is used again
Modifies each changed member of the MMetaDatabase object in the database
IMPORT_C void | RefreshL | ( | CMDBSession & | aSession | ) |
Refresh all fields in the container that have not been changed by the client
The client can request to ignore access control flags by setting the attribute mask, CMDBSession::SetAttributeMask() However, only data that the client has capabilities to view will be loaded Unauthorised data elements will be silently ignored and will remain NULL
If no data at all is found the functon will leave with KErrNotFound
If fields are not accessible for reading the function may leave with KErrPermissionDenied
May also leave with other general error codes if there are unexpected problems (e.g. KErrNoMemory when out of memory)
On failure, the container should be discarded or reloaded before it is used again
Updates each unchanged member of the MMetaDatabase object from the database
IMPORT_C TInt | RequestNotification | ( | CMDBSession & | aSession, |
TRequestStatus & | aRequestStatus | |||
) |
RequestNotification - Register for notification of events from all clients of the database
aRequestStatus will be completed when the following events occur TransactionComplete TransactionRollback SessionClose
this aRequestStatus can be cancelled by a call to
MMetaDatabase::CancelNotification
all outstanding aRequestStatus can be cancelled by a call to
CMDBSession::CancelAllNotifications
Capability | |
---|---|
WriteDeviceData |
IMPORT_C void | StoreL | ( | CMDBSession & | aSession | ) |
StoreL - Store all fields in the database that have been changed in this container and create new records where necessary.
StoreL is atomic for this container. An internal transaction is used even if no overall transaction is set by client. All changed fields in the element are stored in the database on success. No fields or records are stored in the database if the function leaves
If a client has an open transaction in the session, the stored data will be available to this session as soon as StoreL completes but will not be visible to other sessions until the transaction completes successfully
The client can request to ignore access control flags by setting the attribute mask CMDBSession::SetAttributeMask() However, only fields that the client has capabilities to write will be stored in the database A request to modify data in an unauthorised area of the database will cause the function to leave.with KErrPermissionDenied
If a field already exists, StoreL will leave with KErrAlreadyExists
May also leave with other general error codes if there are unexpected problems (e.g. KErrNoMemory when out of memory)
Store will be atomic - all fields stored after success. No fields stored if the function leaves
If StoreL fails or the later commit is not successful, The data in the container will not match the data in the database.
On failure, the container should be discarded or repopulated before it is used again