CNSmlDmDbHandler Class Reference

class CNSmlDmDbHandler : public CBase

CNSmlDmDbHandler is interface to physical tree db database

Since

Inherits from

Public Member Functions
~CNSmlDmDbHandler ()
IMPORT_C TInt AddMappingInfoL ( TUint32 , const TDesC8 &, const TDesC8 &)
IMPORT_C TBool CheckAclL (const TDesC8 &, TNSmlDmCmdType )
IMPORT_C TInt DefaultACLsToServerL (const TDesC8 &)
IMPORT_C TInt DeleteAclL (const TDesC8 &)
IMPORT_C TInt EraseServerIdL (const TDesC8 &)
IMPORT_C TInt GetAclL (const TDesC8 &, CBufBase &, TBool )
IMPORT_C TInt GetMappingInfoLC ( TUint32 , const TDesC8 &, HBufC8 *&)
IMPORT_C TInt GetURISegmentListL ( TUint32 , const TDesC8 &, CArrayFix < TSmlDmMappingInfo > &)
IMPORT_C CNSmlDmDbHandler * NewL ()
IMPORT_C CNSmlDmDbHandler * NewLC ()
IMPORT_C TInt RemoveMappingInfoL ( TUint32 , const TDesC8 &, TBool )
IMPORT_C TInt RenameMappingL ( TUint32 , const TDesC8 &, const TDesC8 &)
IMPORT_C void SetServerL (const TDesC8 &)
IMPORT_C TInt UpdateAclL (const TDesC8 &, const TDesC8 &)
IMPORT_C void UpdateMappingInfoL ( TUint32 , const TDesC8 &, CBufBase &)
IMPORT_C TInt WriteAclInfoToDbL ()
IMPORT_C TInt WriteMappingInfoToDbL ()
Private Member Functions
void ConstructL ()
void CreateDatabaseL (const TDesC &)
TInt GetAclDataFromDbL ()
void ReadAllURIMappingsFromDbL ()
void ReadOneLineFromDbL ()
TInt RenameAclL (const TDesC8 &, const TDesC8 &)
TInt SearchRowInDbL ( TUint32 , const TDesC8 &)
TInt SearchUriL ( TUint32 , const TDesC8 &, TNSmlDmSearchMethod , TInt &, RArray < TInt > &)
void UpdateInternalArrayL ( TUint32 , const TDesC8 &, const TDesC8 &, TNSmlDmMapOperation , TNSmlDmSearchMethod , const TDesC8 &)
void UpdateRowInDbL ( TUint32 , const TDesC8 &, const TDesC8 &, TNSmlDmMapOperation )
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
RPointerArray < HBufC8 > iAclURIs
TBool iAclUpToDate
RPointerArray < HBufC8 > iAcls
RPointerArray < CNSmlDmAdapterElement > iAdapters
RDbStoreDatabase iDatabase
CFileStore * iFileStore
RFs iFsSession
TBool iPrepareView
HBufC8 * iServer
TBool iURIMappingsReadFromDb
RDbView iView

Constructor & Destructor Documentation

~CNSmlDmDbHandler()

IMPORT_C ~CNSmlDmDbHandler ( )

Destructor

Member Functions Documentation

AddMappingInfoL(TUint32, const TDesC8 &, const TDesC8 &)

IMPORT_C TInt AddMappingInfoL ( TUint32 aAdapterId,
const TDesC8 & aURI,
const TDesC8 & aLuid
)

Adds new mapping info to db

Parameters

TUint32 aAdapterId Adapter id
const TDesC8 & aURI URI which is mapped with luid
const TDesC8 & aLuid Luid which is mapped with URI

CheckAclL(const TDesC8 &, TNSmlDmCmdType)

IMPORT_C TBool CheckAclL ( const TDesC8 & aURI,
TNSmlDmCmdType aCmdType
)

Check if current server has aacl rights for URI

Parameters

const TDesC8 & aURI URI for checking ACL
TNSmlDmCmdType aCmdType Type of command (add,..)

ConstructL()

void ConstructL ( ) [private]

CreateDatabaseL(const TDesC &)

void CreateDatabaseL ( const TDesC & aFullName ) [private]

Parameters

const TDesC & aFullName

DefaultACLsToServerL(const TDesC8 &)

IMPORT_C TInt DefaultACLsToServerL ( const TDesC8 & aURI )

Set default acls to current server for certain URI

Parameters

const TDesC8 & aURI URI which acl is set to default for curren server

DeleteAclL(const TDesC8 &)

IMPORT_C TInt DeleteAclL ( const TDesC8 & aURI )

Delete ACL which is set to URI

Parameters

const TDesC8 & aURI URI from which the acl info must be deleted

EraseServerIdL(const TDesC8 &)

IMPORT_C TInt EraseServerIdL ( const TDesC8 & aServerId )

Erase server references from all the acls

Parameters

const TDesC8 & aServerId

GetAclDataFromDbL()

TInt GetAclDataFromDbL ( ) [private]

GetAclL(const TDesC8 &, CBufBase &, TBool)

IMPORT_C TInt GetAclL ( const TDesC8 & aURI,
CBufBase & aACL,
TBool aInherited = ETrue
)

Get ACL which is set for URI

Parameters

const TDesC8 & aURI URI for returning the ACL info
CBufBase & aACL Buffer for writing the found acl
TBool aInherited = ETrue If true, the inherited value is given if the ACL is not set to given URI

GetMappingInfoLC(TUint32, const TDesC8 &, HBufC8 *&)

IMPORT_C TInt GetMappingInfoLC ( TUint32 aAdapterId,
const TDesC8 & aURI,
HBufC8 *& aLuid
)

Get mapping info from db

Parameters

TUint32 aAdapterId Adapter id
const TDesC8 & aURI URI for returning the mapped luid
HBufC8 *& aLuid Buffer for writing the mapped luid

GetURISegmentListL(TUint32, const TDesC8 &, CArrayFix< TSmlDmMappingInfo > &)

IMPORT_C TInt GetURISegmentListL ( TUint32 aAdapterId,
const TDesC8 & aURI,
CArrayFix < TSmlDmMappingInfo > & aURISegList
)

Get list of mappings in certain level

Parameters

TUint32 aAdapterId Adapter id
const TDesC8 & aURI URI which should be renamed
CArrayFix < TSmlDmMappingInfo > & aURISegList Reference to list where to write list of mappings

NewL()

IMPORT_C CNSmlDmDbHandler * NewL ( ) [static]

Two-phased constructor

NewLC()

IMPORT_C CNSmlDmDbHandler * NewLC ( ) [static]

Two-phased constructor, leaves pointer to cleanup stack

ReadAllURIMappingsFromDbL()

void ReadAllURIMappingsFromDbL ( ) [private]

ReadOneLineFromDbL()

void ReadOneLineFromDbL ( ) [private]

RemoveMappingInfoL(TUint32, const TDesC8 &, TBool)

IMPORT_C TInt RemoveMappingInfoL ( TUint32 aAdapterId,
const TDesC8 & aURI,
TBool aChildAlso = ETrue
)

Removes mapping info

Parameters

TUint32 aAdapterId Adapter id
const TDesC8 & aURI URI which should be deleted from mappings
TBool aChildAlso = ETrue If true, also child uries are removed

RenameAclL(const TDesC8 &, const TDesC8 &)

TInt RenameAclL ( const TDesC8 & aURI,
const TDesC8 & aNewURI
) [private]

Parameters

const TDesC8 & aURI
const TDesC8 & aNewURI

RenameMappingL(TUint32, const TDesC8 &, const TDesC8 &)

IMPORT_C TInt RenameMappingL ( TUint32 aAdapterId,
const TDesC8 & aURI,
const TDesC8 & aObject
)

Renames mapping info

Parameters

TUint32 aAdapterId Adapter id
const TDesC8 & aURI URI which should be renamed
const TDesC8 & aObject New name, i.e. last uri segment

SearchRowInDbL(TUint32, const TDesC8 &)

TInt SearchRowInDbL ( TUint32 aAdapterId,
const TDesC8 & aURI
) [private]

Parameters

TUint32 aAdapterId
const TDesC8 & aURI

SearchUriL(TUint32, const TDesC8 &, TNSmlDmSearchMethod, TInt &, RArray< TInt > &)

TInt SearchUriL ( TUint32 aAdapterId,
const TDesC8 & aURI,
TNSmlDmSearchMethod aSearchMethod,
TInt & aAdIndex,
RArray < TInt > & aUriIndex
) [private]

Parameters

TUint32 aAdapterId
const TDesC8 & aURI
TNSmlDmSearchMethod aSearchMethod
TInt & aAdIndex
RArray < TInt > & aUriIndex

SetServerL(const TDesC8 &)

IMPORT_C void SetServerL ( const TDesC8 & aServerId )

Sets server id. This is not stored, this is set at the beginning of session fro checkin acls

Parameters

const TDesC8 & aServerId Server identifier

UpdateAclL(const TDesC8 &, const TDesC8 &)

IMPORT_C TInt UpdateAclL ( const TDesC8 & aURI,
const TDesC8 & aACL
)

Update ACL for URI

Parameters

const TDesC8 & aURI URI for updating the ACL info
const TDesC8 & aACL

UpdateInternalArrayL(TUint32, const TDesC8 &, const TDesC8 &, TNSmlDmMapOperation, TNSmlDmSearchMethod, const TDesC8 &)

void UpdateInternalArrayL ( TUint32 aAdapterId,
const TDesC8 & aURI,
const TDesC8 & aLUID,
TNSmlDmMapOperation aOperation,
TNSmlDmSearchMethod aMethod,
const TDesC8 & aNwUri =  KNullDesC8
) [private]

Parameters

TUint32 aAdapterId
const TDesC8 & aURI
const TDesC8 & aLUID
TNSmlDmMapOperation aOperation
TNSmlDmSearchMethod aMethod
const TDesC8 & aNwUri =  KNullDesC8

UpdateMappingInfoL(TUint32, const TDesC8 &, CBufBase &)

IMPORT_C void UpdateMappingInfoL ( TUint32 aAdapterId,
const TDesC8 & aURI,
CBufBase & aCurrentList
)

Clears the tree when child list is got from plug-in adapter

Parameters

TUint32 aAdapterId Adapter id
const TDesC8 & aURI URI which should be renamed
CBufBase & aCurrentList List of children. The mappings which are not in list are removed

UpdateRowInDbL(TUint32, const TDesC8 &, const TDesC8 &, TNSmlDmMapOperation)

void UpdateRowInDbL ( TUint32 aAdapterId,
const TDesC8 & aURI,
const TDesC8 & aLUID,
TNSmlDmMapOperation aOperation
) [private]

Parameters

TUint32 aAdapterId
const TDesC8 & aURI
const TDesC8 & aLUID
TNSmlDmMapOperation aOperation

WriteAclInfoToDbL()

IMPORT_C TInt WriteAclInfoToDbL ( )

Write ACLs from memory to db

WriteMappingInfoToDbL()

IMPORT_C TInt WriteMappingInfoToDbL ( )

Writes mappings from memory to database

Member Data Documentation

RPointerArray< HBufC8 > iAclURIs

RPointerArray < HBufC8 > iAclURIs [private]

TBool iAclUpToDate

TBool iAclUpToDate [private]

RPointerArray< HBufC8 > iAcls

RPointerArray < HBufC8 > iAcls [private]

RPointerArray< CNSmlDmAdapterElement > iAdapters

RPointerArray < CNSmlDmAdapterElement > iAdapters [private]

RDbStoreDatabase iDatabase

RDbStoreDatabase iDatabase [private]

CFileStore * iFileStore

CFileStore * iFileStore [private]

RFs iFsSession

RFs iFsSession [private]

TBool iPrepareView

TBool iPrepareView [private]

HBufC8 * iServer

HBufC8 * iServer [private]

TBool iURIMappingsReadFromDb

TBool iURIMappingsReadFromDb [private]

RDbView iView

RDbView iView [private]