CMsvSession Class Reference

class CMsvSession : public CActive

Represents a channel of communication between a client thread (Client-side MTM, User Interface MTM, or message client application) and the Message Server thread.

The class provides the means by which clients are notified when important Message Server events occur.

Note the following significant groups of functions:

Creation functions: a message client application must use OpenSyncL() or OpenASyncL() to create a session object, before it can instantiate any MTM or CMsvEntry object. Only a single session should be created within a thread. As Client-side MTM, User Interface MTM, and CMsvEntry objects are created in the client thread, these use the client session, and do not create their own. Note that to close a session, delete all objects relying on that session, and then the session object itself.

Cleanup functions: CMsvSession provides the ability to handle the cleanup of entries in the event of a leave occurring, in a very similar manner to the standard cleanup stack. The difference is that, on a leave, any entries that are on the entry cleanup stack are removed from the Message Server. The implementation uses the standard cleanup stack, so entry push and pop functions should be used in the same order as all other types of push and pop. The functions can be used both by MTM implementations and message client applications.

Inherits from

Public Member Functions
~CMsvSession()
IMPORT_C voidAddObserverL(MMsvSessionObserver &)
IMPORT_C voidChangeAttributesL(const CMsvEntrySelection &, TUint, TUint)
IMPORT_C CMsvOperation *ChangeDriveL(TInt, TRequestStatus &)
IMPORT_C voidCleanupEntry(TAny *)
IMPORT_C voidCleanupEntryPop(TInt)
IMPORT_C voidCleanupEntryPushL(TMsvId)
IMPORT_C voidCloseMessageServer()
IMPORT_C CMsvOperation *CopyStoreL(const TDriveUnit &, TRequestStatus &)
IMPORT_C TDriveUnitCurrentDriveL()
IMPORT_C TIntDeInstallMtmGroup(const TDesC &)
IMPORT_C voidDecPcSyncCountL(const CMsvEntrySelection &)
IMPORT_C CMsvOperation *DeleteStoreL(const TDriveUnit &, TRequestStatus &)
IMPORT_C TBoolDriveContainsStoreL(TDriveUnit)
IMPORT_C RFs &FileSession()
IMPORT_C TBoolGetAndClearIndexCorruptFlagL()
IMPORT_C voidGetChildIdsL(TMsvId, const CMsvEntryFilter &, CMsvEntrySelection &)
IMPORT_C TIntGetEntry(TMsvId, TMsvId &, TMsvEntry &)
IMPORT_C CMsvEntry *GetEntryL(TMsvId)
IMPORT_C voidGetMtmRequiredCapabilitiesL(TUid, TCapabilitySet &)
IMPORT_C voidIncPcSyncCountL(const CMsvEntrySelection &)
IMPORT_C TIntInstallMtmGroup(const TDesC &)
IMPORT_C TBoolMessageStoreDrivePresentL()
IMPORT_C CMsvSession *OpenAsObserverL(MMsvSessionObserver &)
IMPORT_C CMsvSession *OpenAsObserverL(MMsvSessionObserver &, RFs &)
IMPORT_C CMsvSession *OpenAsObserverL(MMsvSessionObserver &, TInt)
IMPORT_C CMsvSession *OpenAsObserverL(MMsvSessionObserver &, RFs &, TInt)
IMPORT_C CMsvSession *OpenAsyncL(MMsvSessionObserver &)
IMPORT_C CMsvSession *OpenAsyncL(MMsvSessionObserver &, RFs &)
IMPORT_C CMsvSession *OpenAsyncL(MMsvSessionObserver &, TInt)
IMPORT_C CMsvSession *OpenAsyncL(MMsvSessionObserver &, RFs &, TInt)
IMPORT_C CMsvSession *OpenSyncL(MMsvSessionObserver &)
IMPORT_C CMsvSession *OpenSyncL(MMsvSessionObserver &, RFs &)
IMPORT_C CMsvSession *OpenSyncL(MMsvSessionObserver &, TInt)
IMPORT_C CMsvSession *OpenSyncL(MMsvSessionObserver &, RFs &, TInt)
IMPORT_C TIntOutstandingOperationsL()
IMPORT_C voidRemoveEntry(TMsvId)
IMPORT_C voidRemoveObserver(MMsvSessionObserver &)
IMPORT_C TIntServiceAccessPointId(TMsvId, TUint32 &)
IMPORT_C TBoolServiceActive(TMsvId)
IMPORT_C TIntServiceProgress(TMsvId, TDes8 &)
IMPORT_C TIntSetReceiveEntryEvents(TBool)
IMPORT_C TIntStopService(TMsvId)
MMsvStoreManager &StoreManager()
IMPORT_C CMsvOperation *TransferCommandL(const CMsvEntrySelection &, TInt, const TDesC8 &, TRequestStatus &)
IMPORT_C voidTransferCommandL(const CMsvEntrySelection &, TInt, const TDesC8 &, TDes8 &)
Protected Member Functions
CMsvSession(MMsvSessionObserver &)
CMsvSession(MMsvSessionObserver &, RFs &)
CMsvSession(MMsvSessionObserver &, TInt)
CMsvSession(MMsvSessionObserver &, RFs &, TInt)
voidCheckDrive()
voidConstructAsObserverL()
voidConstructL(TBool)
voidDoCancel()
IMPORT_C TIntOperationId()
TInt RunError(TInt)
voidRunL()
IMPORT_C RMsvServerSession &Session()
Private Member Functions
voidCleanupEntryDelete()
voidCreateSessionLogL()
voidDoHandleNotifyL(TMsvNotifBuffer &)
voidDoRunL(TMsvNotifBuffer &)
voidGetMessageFolderL()
voidHandleNotifyL()
voidLog(TRefByValue< const TDesC >, ...)
voidNotifyAllObserversL(MMsvSessionObserver::TMsvSessionEvent, TAny *, TAny *, TAny *)
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
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()
Inherited Enumerations
CActive:TPriority
Private Attributes
TInt dummy1
TInt dummy2
TInt dummy3
TMsvNotifBuffer iChange
CMsvEntrySelection *iCleanupList
TDriveNumber iDrive
RFs iFs
RFileLogger iLog
MMsvSessionObserver &iMainObserver
HBufC *iMessageFolder
CMsvEntrySelection *iNotifSelection
TUint32 iNotifySequence
CArrayPtrFlat< MMsvSessionObserver > *iObservers
TInt iOperationId
TBool iReceiveEntryEvents
TPckgBuf< TUint32 >iSequenceBuf
RMsvServerSession *iSession
TInt iSyncStart
TBool iUseSharedFs
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CMsvSession(MMsvSessionObserver &)

CMsvSession(MMsvSessionObserver &aObserver)[protected]

Parameters

MMsvSessionObserver & aObserver

CMsvSession(MMsvSessionObserver &, RFs &)

CMsvSession(MMsvSessionObserver &aObserver,
RFs &aFs
)[protected]

Parameters

MMsvSessionObserver & aObserver
RFs & aFs

CMsvSession(MMsvSessionObserver &, TInt)

CMsvSession(MMsvSessionObserver &aObserver,
TIntaPriority
)[protected]

Parameters

MMsvSessionObserver & aObserver
TInt aPriority

CMsvSession(MMsvSessionObserver &, RFs &, TInt)

CMsvSession(MMsvSessionObserver &aObserver,
RFs &aFs,
TIntaPriority
)[protected]

Parameters

MMsvSessionObserver & aObserver
RFs & aFs
TInt aPriority

~CMsvSession()

~CMsvSession()

Member Functions Documentation

AddObserverL(MMsvSessionObserver &)

IMPORT_C voidAddObserverL(MMsvSessionObserver &aObserver)

Parameters

MMsvSessionObserver & aObserver

ChangeAttributesL(const CMsvEntrySelection &, TUint, TUint)

IMPORT_C voidChangeAttributesL(const CMsvEntrySelection &aSelection,
TUintaSetAttributes,
TUintaClearAttributes
)

Parameters

const CMsvEntrySelection & aSelection
TUint aSetAttributes
TUint aClearAttributes

ChangeDriveL(TInt, TRequestStatus &)

IMPORT_C CMsvOperation *ChangeDriveL(TIntaDrive,
TRequestStatus &aStatus
)

Parameters

TInt aDrive
TRequestStatus & aStatus

CheckDrive()

voidCheckDrive()[protected]

CleanupEntry(TAny *)

IMPORT_C voidCleanupEntry(TAny *aPtr)[static]

Parameters

TAny * aPtr

CleanupEntryDelete()

voidCleanupEntryDelete()[private]

CleanupEntryPop(TInt)

IMPORT_C voidCleanupEntryPop(TIntaCount = 1)

Parameters

TInt aCount = 1

CleanupEntryPushL(TMsvId)

IMPORT_C voidCleanupEntryPushL(TMsvIdaId)

Parameters

TMsvId aId

CloseMessageServer()

IMPORT_C voidCloseMessageServer()

ConstructAsObserverL()

voidConstructAsObserverL()[protected]

ConstructL(TBool)

voidConstructL(TBoolaSyncOpening)[protected]

Parameters

TBool aSyncOpening

CopyStoreL(const TDriveUnit &, TRequestStatus &)

IMPORT_C CMsvOperation *CopyStoreL(const TDriveUnit &aDrive,
TRequestStatus &aStatus
)

Parameters

const TDriveUnit & aDrive
TRequestStatus & aStatus

CreateSessionLogL()

voidCreateSessionLogL()[private]

CurrentDriveL()

IMPORT_C TDriveUnitCurrentDriveL()

DeInstallMtmGroup(const TDesC &)

IMPORT_C TIntDeInstallMtmGroup(const TDesC &aFullName)

Parameters

const TDesC & aFullName

DecPcSyncCountL(const CMsvEntrySelection &)

IMPORT_C voidDecPcSyncCountL(const CMsvEntrySelection &aSelection)

Parameters

const CMsvEntrySelection & aSelection

DeleteStoreL(const TDriveUnit &, TRequestStatus &)

IMPORT_C CMsvOperation *DeleteStoreL(const TDriveUnit &aDrive,
TRequestStatus &aStatus
)

Parameters

const TDriveUnit & aDrive
TRequestStatus & aStatus

DoCancel()

voidDoCancel()[protected, virtual]

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel().

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel().

CActive::Cancel

DoHandleNotifyL(TMsvNotifBuffer &)

voidDoHandleNotifyL(TMsvNotifBuffer &aBuffer)[private]

Parameters

TMsvNotifBuffer & aBuffer

DoRunL(TMsvNotifBuffer &)

voidDoRunL(TMsvNotifBuffer &aBuffer)[private]

Parameters

TMsvNotifBuffer & aBuffer

DriveContainsStoreL(TDriveUnit)

IMPORT_C TBoolDriveContainsStoreL(TDriveUnitaDrive)

Parameters

TDriveUnit aDrive

FileSession()

IMPORT_C RFs &FileSession()

GetAndClearIndexCorruptFlagL()

IMPORT_C TBoolGetAndClearIndexCorruptFlagL()

GetChildIdsL(TMsvId, const CMsvEntryFilter &, CMsvEntrySelection &)

IMPORT_C voidGetChildIdsL(TMsvIdaId,
const CMsvEntryFilter &aFilter,
CMsvEntrySelection &aSelection
)

Parameters

TMsvId aId
const CMsvEntryFilter & aFilter
CMsvEntrySelection & aSelection

GetEntry(TMsvId, TMsvId &, TMsvEntry &)

IMPORT_C TIntGetEntry(TMsvIdaId,
TMsvId &aService,
TMsvEntry &aEntry
)

Parameters

TMsvId aId
TMsvId & aService
TMsvEntry & aEntry

GetEntryL(TMsvId)

IMPORT_C CMsvEntry *GetEntryL(TMsvIdaEntId)

Parameters

TMsvId aEntId

GetMessageFolderL()

voidGetMessageFolderL()[private]

GetMtmRequiredCapabilitiesL(TUid, TCapabilitySet &)

IMPORT_C voidGetMtmRequiredCapabilitiesL(TUidaMtmTypeUid,
TCapabilitySet &aCapSet
)const

Parameters

TUid aMtmTypeUid
TCapabilitySet & aCapSet

HandleNotifyL()

voidHandleNotifyL()[private]

IncPcSyncCountL(const CMsvEntrySelection &)

IMPORT_C voidIncPcSyncCountL(const CMsvEntrySelection &aSelection)

Parameters

const CMsvEntrySelection & aSelection

InstallMtmGroup(const TDesC &)

IMPORT_C TIntInstallMtmGroup(const TDesC &aFullName)

Parameters

const TDesC & aFullName

Log(TRefByValue< const TDesC >, ...)

voidLog(TRefByValue< const TDesC >aFmt,
...
)[private]

Parameters

TRefByValue< const TDesC > aFmt
...

MessageStoreDrivePresentL()

IMPORT_C TBoolMessageStoreDrivePresentL()

NotifyAllObserversL(MMsvSessionObserver::TMsvSessionEvent, TAny *, TAny *, TAny *)

voidNotifyAllObserversL(MMsvSessionObserver::TMsvSessionEventaEvent,
TAny *aArg1,
TAny *aArg2,
TAny *aArg3
)[private]

Parameters

MMsvSessionObserver::TMsvSessionEvent aEvent
TAny * aArg1
TAny * aArg2
TAny * aArg3

OpenAsObserverL(MMsvSessionObserver &)

IMPORT_C CMsvSession *OpenAsObserverL(MMsvSessionObserver &aObserver)[static]

Parameters

MMsvSessionObserver & aObserver

OpenAsObserverL(MMsvSessionObserver &, RFs &)

IMPORT_C CMsvSession *OpenAsObserverL(MMsvSessionObserver &aObserver,
RFs &aFs
)[static]

Parameters

MMsvSessionObserver & aObserver
RFs & aFs

OpenAsObserverL(MMsvSessionObserver &, TInt)

IMPORT_C CMsvSession *OpenAsObserverL(MMsvSessionObserver &aObserver,
TIntaPriority
)[static]

Parameters

MMsvSessionObserver & aObserver
TInt aPriority

OpenAsObserverL(MMsvSessionObserver &, RFs &, TInt)

IMPORT_C CMsvSession *OpenAsObserverL(MMsvSessionObserver &aObserver,
RFs &aFs,
TIntaPriority
)[static]

Parameters

MMsvSessionObserver & aObserver
RFs & aFs
TInt aPriority

OpenAsyncL(MMsvSessionObserver &)

IMPORT_C CMsvSession *OpenAsyncL(MMsvSessionObserver &aObserver)[static]

Parameters

MMsvSessionObserver & aObserver

OpenAsyncL(MMsvSessionObserver &, RFs &)

IMPORT_C CMsvSession *OpenAsyncL(MMsvSessionObserver &aObserver,
RFs &aFs
)[static]

Parameters

MMsvSessionObserver & aObserver
RFs & aFs

OpenAsyncL(MMsvSessionObserver &, TInt)

IMPORT_C CMsvSession *OpenAsyncL(MMsvSessionObserver &aObserver,
TIntaPriority
)[static]

Parameters

MMsvSessionObserver & aObserver
TInt aPriority

OpenAsyncL(MMsvSessionObserver &, RFs &, TInt)

IMPORT_C CMsvSession *OpenAsyncL(MMsvSessionObserver &aObserver,
RFs &aFs,
TIntaPriority
)[static]

Parameters

MMsvSessionObserver & aObserver
RFs & aFs
TInt aPriority

OpenSyncL(MMsvSessionObserver &)

IMPORT_C CMsvSession *OpenSyncL(MMsvSessionObserver &aObserver)[static]

Parameters

MMsvSessionObserver & aObserver

OpenSyncL(MMsvSessionObserver &, RFs &)

IMPORT_C CMsvSession *OpenSyncL(MMsvSessionObserver &aObserver,
RFs &aFs
)[static]

Parameters

MMsvSessionObserver & aObserver
RFs & aFs

OpenSyncL(MMsvSessionObserver &, TInt)

IMPORT_C CMsvSession *OpenSyncL(MMsvSessionObserver &aObserver,
TIntaPriority
)[static]

Parameters

MMsvSessionObserver & aObserver
TInt aPriority

OpenSyncL(MMsvSessionObserver &, RFs &, TInt)

IMPORT_C CMsvSession *OpenSyncL(MMsvSessionObserver &aObserver,
RFs &aFs,
TIntaPriority
)[static]

Parameters

MMsvSessionObserver & aObserver
RFs & aFs
TInt aPriority

OperationId()

IMPORT_C TIntOperationId()[protected]

OutstandingOperationsL()

IMPORT_C TIntOutstandingOperationsL()

RemoveEntry(TMsvId)

IMPORT_C voidRemoveEntry(TMsvIdaId)

Parameters

TMsvId aId

RemoveObserver(MMsvSessionObserver &)

IMPORT_C voidRemoveObserver(MMsvSessionObserver &aObserver)

Parameters

MMsvSessionObserver & aObserver

RunError(TInt)

TInt RunError(TIntaError)[protected, virtual]

Parameters

TInt aError

RunL()

voidRunL()[protected, virtual]

Handles an active object's request completion event.

A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.

The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.

Before calling this active object's RunL() function, the active scheduler has:

1. decided that this is the highest priority active object with a completed request

2. marked this active object's request as complete (i.e. the request is no longer outstanding)

RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.

Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.

CActiveScheduler::Start

CActiveScheduler::Error

CActiveScheduler::WaitForAnyRequest

TRAPD

ServiceAccessPointId(TMsvId, TUint32 &)

IMPORT_C TIntServiceAccessPointId(TMsvIdaServiceId,
TUint32 &aAccessPointId
)

Parameters

TMsvId aServiceId
TUint32 & aAccessPointId

ServiceActive(TMsvId)

IMPORT_C TBoolServiceActive(TMsvIdaServiceId)

Parameters

TMsvId aServiceId

ServiceProgress(TMsvId, TDes8 &)

IMPORT_C TIntServiceProgress(TMsvIdaServiceId,
TDes8 &aProgress
)

Parameters

TMsvId aServiceId
TDes8 & aProgress

Session()

IMPORT_C RMsvServerSession &Session()[protected]

SetReceiveEntryEvents(TBool)

IMPORT_C TIntSetReceiveEntryEvents(TBoolaReceive)

Parameters

TBool aReceive

StopService(TMsvId)

IMPORT_C TIntStopService(TMsvIdaServiceId)

Parameters

TMsvId aServiceId

StoreManager()

MMsvStoreManager &StoreManager()

TransferCommandL(const CMsvEntrySelection &, TInt, const TDesC8 &, TRequestStatus &)

IMPORT_C CMsvOperation *TransferCommandL(const CMsvEntrySelection &aSelection,
TIntaCommandId,
const TDesC8 &aParameter,
TRequestStatus &aStatus
)

Parameters

const CMsvEntrySelection & aSelection
TInt aCommandId
const TDesC8 & aParameter
TRequestStatus & aStatus

TransferCommandL(const CMsvEntrySelection &, TInt, const TDesC8 &, TDes8 &)

IMPORT_C voidTransferCommandL(const CMsvEntrySelection &aSelection,
TIntaCommandId,
const TDesC8 &aParameter,
TDes8 &aProgress
)

Parameters

const CMsvEntrySelection & aSelection
TInt aCommandId
const TDesC8 & aParameter
TDes8 & aProgress

Member Data Documentation

TInt dummy1

TInt dummy1[private]

TInt dummy2

TInt dummy2[private]

TInt dummy3

TInt dummy3[private]

TMsvNotifBuffer iChange

TMsvNotifBuffer iChange[private]

CMsvEntrySelection * iCleanupList

CMsvEntrySelection *iCleanupList[private]

TDriveNumber iDrive

TDriveNumber iDrive[private]

RFs iFs

RFs iFs[private]

RFileLogger iLog

RFileLogger iLog[private]

MMsvSessionObserver & iMainObserver

MMsvSessionObserver &iMainObserver[private]

HBufC * iMessageFolder

HBufC *iMessageFolder[private]

CMsvEntrySelection * iNotifSelection

CMsvEntrySelection *iNotifSelection[private]

TUint32 iNotifySequence

TUint32 iNotifySequence[private]

CArrayPtrFlat< MMsvSessionObserver > * iObservers

CArrayPtrFlat< MMsvSessionObserver > *iObservers[private]

TInt iOperationId

TInt iOperationId[private]

TBool iReceiveEntryEvents

TBool iReceiveEntryEvents[private]

TPckgBuf< TUint32 > iSequenceBuf

TPckgBuf< TUint32 >iSequenceBuf[private]

RMsvServerSession * iSession

RMsvServerSession *iSession[private]

TInt iSyncStart

TInt iSyncStart[private]

TBool iUseSharedFs

TBool iUseSharedFs[private]

Specifies whether to use the shared file server session