class CommsDat::MMetaDatabase : public Meta::MMetaData |
Interface for interaction with a database server Inherited by each data set type that can be stored
Public Member Functions | |
---|---|
~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() |
Private Member Functions | |
---|---|
void | DoFindL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &, RArray< TUint32 > &, RArray< TUint32 > &) |
void | DoLoadL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &, TMDBElementId, TMDBElementId, TBool) |
void | DoLoadL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &, TMDBElementId, TMDBElementId, RArray< TUint32 > &, TBool) |
void | DoModifyL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &) |
void | DoRefreshL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &) |
void | DoStoreL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &) |
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
CMDBSession & aSession | |
TRequestStatus & aRequestStatus |
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
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)
Ensure the ElementId for this container fully identifies the target data in the database <Record> Ensure that the session object has appropriate access control attributes to manage the target data in the database Ensure the ElementId for this container correcty identifies the target data in the database
CMDBSession & aSession |
void | DoFindL | ( | CMDBSessionImpl * | aSession, |
CMDBElement * | aElement, | |||
CMDBElement * | aMapper, | |||
TInt & | aErr, | |||
RArray< TUint32 > & | candidates, | |||
RArray< TUint32 > & | matches | |||
) | [private] |
CMDBSessionImpl * aSession | |
CMDBElement * aElement | |
CMDBElement * aMapper | |
TInt & aErr | |
RArray< TUint32 > & candidates | |
RArray< TUint32 > & matches |
void | DoLoadL | ( | CMDBSessionImpl * | aSession, |
CMDBElement * | aElement, | |||
CMDBElement * | aMapper, | |||
TInt & | aErr, | |||
TMDBElementId | aRecordId, | |||
TMDBElementId | aAttributes, | |||
TBool | isTheLoadForMapper = EFalse | |||
) | [private] |
CMDBSessionImpl * aSession | |
CMDBElement * aElement | |
CMDBElement * aMapper | |
TInt & aErr | |
TMDBElementId aRecordId | |
TMDBElementId aAttributes | |
TBool isTheLoadForMapper = EFalse |
void | DoLoadL | ( | CMDBSessionImpl * | aSession, |
CMDBElement * | aElement, | |||
CMDBElement * | aMapper, | |||
TInt & | aErr, | |||
TMDBElementId | aRecordId, | |||
TMDBElementId | aAttributes, | |||
RArray< TUint32 > & | aMatches, | |||
TBool | isTheLoadForMapper = EFalse | |||
) | [private] |
CMDBSessionImpl * aSession | |
CMDBElement * aElement | |
CMDBElement * aMapper | |
TInt & aErr | |
TMDBElementId aRecordId | |
TMDBElementId aAttributes | |
RArray< TUint32 > & aMatches | |
TBool isTheLoadForMapper = EFalse |
void | DoModifyL | ( | CMDBSessionImpl * | aSession, |
CMDBElement * | aElement, | |||
CMDBElement * | aMapper, | |||
TInt & | aErr | |||
) | [private] |
CMDBSessionImpl * aSession | |
CMDBElement * aElement | |
CMDBElement * aMapper | |
TInt & aErr |
void | DoRefreshL | ( | CMDBSessionImpl * | aSession, |
CMDBElement * | aElement, | |||
CMDBElement * | aMapper, | |||
TInt & | aErr | |||
) | [private] |
CMDBSessionImpl * aSession | |
CMDBElement * aElement | |
CMDBElement * aMapper | |
TInt & aErr |
void | DoStoreL | ( | CMDBSessionImpl * | aSession, |
CMDBElement * | aElement, | |||
CMDBElement * | aMapper, | |||
TInt & | aErr | |||
) | [private] |
CMDBSessionImpl * aSession | |
CMDBElement * aElement | |
CMDBElement * aMapper | |
TInt & aErr |
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
Populate this container where necessary with valid data to match during the find operation Ensure the ElementId for this container correcty identifies the target table in the database Ensure that the session object has been initialised with the correct dataset version Ensure that the session object has appropriate access control attributes to manage the target data in the database
CMDBSession & aSession |
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
Ensure the ElementId for this container fully identifies the target data in the database <Record> Ensure that the session object has been initialised with the correct dataset version Ensure that the session object has appropriate access control attributes to manage the target data in the database
CMDBSession & aSession |
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
Populate this container with valid data for storage Ensure the ElementId for this container fully identifies the target data in the database <Record> Ensure that the session object has been initialised with the correct dataset version Ensure that the session object has appropriate access control attributes to manage the target data in the database
CMDBSession & aSession |
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
Ensure the ElementId for this container fully identifies the target data in the database <Record> Ensure that the session object has been initialised with the correct dataset version Ensure that the session object has appropriate access control attributes to manage the target data in the database
CMDBSession & aSession |
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
KErrNone on success. A system wide error on failure
aSession a valid session object aRequestStatus the requestStatus object that will be completed on notification
None
A notification request will be outstanding
CMDBSession & aSession | |
TRequestStatus & aRequestStatus |
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
Populate this container with valid data for storage Ensure the ElementId for this container fully identifies the target location in the database <Record> Ensure that the session object has been initialised with the correct dataset version Ensure that the session object has appropriate access control attributes to manage the target data in the database
CMDBSession & aSession |