CommsDat::MMetaDatabase Class Reference

class CommsDat::MMetaDatabase : public Meta::MMetaData

Interface for interaction with a database server Inherited by each data set type that can be stored

Inherits from

Public Member Functions
~MMetaDatabase()
IMPORT_C TIntCancelNotification(CMDBSession &, TRequestStatus &)
IMPORT_C voidDeleteL(CMDBSession &)
IMPORT_C TBoolFindL(CMDBSession &)
IMPORT_C voidLoadL(CMDBSession &)
IMPORT_C voidModifyL(CMDBSession &)
IMPORT_C voidRefreshL(CMDBSession &)
IMPORT_C TIntRequestNotification(CMDBSession &, TRequestStatus &)
IMPORT_C voidStoreL(CMDBSession &)
Protected Member Functions
MMetaDatabase()
Private Member Functions
voidDoFindL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &, RArray< TUint32 > &, RArray< TUint32 > &)
voidDoLoadL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &, TMDBElementId, TMDBElementId, TBool)
voidDoLoadL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &, TMDBElementId, TMDBElementId, RArray< TUint32 > &, TBool)
voidDoModifyL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &)
voidDoRefreshL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &)
voidDoStoreL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &)

Constructor & Destructor Documentation

MMetaDatabase()

IMPORT_CMMetaDatabase()[protected, explicit]

~MMetaDatabase()

IMPORT_C~MMetaDatabase()[virtual]

Member Functions Documentation

CancelNotification(CMDBSession &, TRequestStatus &)

IMPORT_C TIntCancelNotification(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

Parameters

CMDBSession & aSession
TRequestStatus & aRequestStatus

DeleteL(CMDBSession &)

IMPORT_C voidDeleteL(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

Parameters

CMDBSession & aSession

DoFindL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &, RArray< TUint32 > &, RArray< TUint32 > &)

voidDoFindL(CMDBSessionImpl *aSession,
CMDBElement *aElement,
CMDBElement *aMapper,
TInt &aErr,
RArray< TUint32 > &candidates,
RArray< TUint32 > &matches
)[private]

Parameters

CMDBSessionImpl * aSession
CMDBElement * aElement
CMDBElement * aMapper
TInt & aErr
RArray< TUint32 > & candidates
RArray< TUint32 > & matches

DoLoadL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &, TMDBElementId, TMDBElementId, TBool)

voidDoLoadL(CMDBSessionImpl *aSession,
CMDBElement *aElement,
CMDBElement *aMapper,
TInt &aErr,
TMDBElementIdaRecordId,
TMDBElementIdaAttributes,
TBoolisTheLoadForMapper = EFalse
)[private]

Parameters

CMDBSessionImpl * aSession
CMDBElement * aElement
CMDBElement * aMapper
TInt & aErr
TMDBElementId aRecordId
TMDBElementId aAttributes
TBool isTheLoadForMapper = EFalse

DoLoadL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &, TMDBElementId, TMDBElementId, RArray< TUint32 > &, TBool)

voidDoLoadL(CMDBSessionImpl *aSession,
CMDBElement *aElement,
CMDBElement *aMapper,
TInt &aErr,
TMDBElementIdaRecordId,
TMDBElementIdaAttributes,
RArray< TUint32 > &aMatches,
TBoolisTheLoadForMapper = EFalse
)[private]

Parameters

CMDBSessionImpl * aSession
CMDBElement * aElement
CMDBElement * aMapper
TInt & aErr
TMDBElementId aRecordId
TMDBElementId aAttributes
RArray< TUint32 > & aMatches
TBool isTheLoadForMapper = EFalse

DoModifyL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &)

voidDoModifyL(CMDBSessionImpl *aSession,
CMDBElement *aElement,
CMDBElement *aMapper,
TInt &aErr
)[private]

Parameters

CMDBSessionImpl * aSession
CMDBElement * aElement
CMDBElement * aMapper
TInt & aErr

DoRefreshL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &)

voidDoRefreshL(CMDBSessionImpl *aSession,
CMDBElement *aElement,
CMDBElement *aMapper,
TInt &aErr
)[private]

Parameters

CMDBSessionImpl * aSession
CMDBElement * aElement
CMDBElement * aMapper
TInt & aErr

DoStoreL(CMDBSessionImpl *, CMDBElement *, CMDBElement *, TInt &)

voidDoStoreL(CMDBSessionImpl *aSession,
CMDBElement *aElement,
CMDBElement *aMapper,
TInt &aErr
)[private]

Parameters

CMDBSessionImpl * aSession
CMDBElement * aElement
CMDBElement * aMapper
TInt & aErr

FindL(CMDBSession &)

IMPORT_C TBoolFindL(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

Parameters

CMDBSession & aSession

LoadL(CMDBSession &)

IMPORT_C voidLoadL(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

Parameters

CMDBSession & aSession

ModifyL(CMDBSession &)

IMPORT_C voidModifyL(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

Parameters

CMDBSession & aSession

RefreshL(CMDBSession &)

IMPORT_C voidRefreshL(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

Parameters

CMDBSession & aSession

RequestNotification(CMDBSession &, TRequestStatus &)

IMPORT_C TIntRequestNotification(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

Parameters

CMDBSession & aSession
TRequestStatus & aRequestStatus

StoreL(CMDBSession &)

IMPORT_C voidStoreL(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

Parameters

CMDBSession & aSession