MSmlDmAdapter Class Reference

class MSmlDmAdapter

Abstract Device Management adapter. Implementations of this interface are able to map settings in device stores to portions of the Device Management Tree.

Public Member Functions
voidAddNodeObjectL(const TDesC8 &, const TDesC8 &, TInt)
voidChildURIListL(const TDesC8 &, const TDesC8 &, const CArrayFix< TSmlDmMappingInfo > &, TInt, TInt)
voidCommitAtomicL()
voidCompleteOutstandingCmdsL()
voidCopyCommandL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const TDesC8 &, const TDesC8 &, TInt)
voidDDFStructureL(MSmlDmDDFObject &)
voidDDFVersionL(CBufBase &)
voidDeleteObjectL(const TDesC8 &, const TDesC8 &, TInt)
voidExecuteCommandL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const TDesC8 &, TInt)
voidExecuteCommandL(const TDesC8 &, const TDesC8 &, RWriteStream *&, const TDesC8 &, TInt)
voidFetchLeafObjectL(const TDesC8 &, const TDesC8 &, const TDesC8 &, TInt, TInt)
voidFetchLeafObjectSizeL(const TDesC8 &, const TDesC8 &, const TDesC8 &, TInt, TInt)
voidRollbackAtomicL()
voidStartAtomicL()
voidStreamCommittedL()
TBool StreamingSupport(TInt &)
voidUpdateLeafObjectL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const TDesC8 &, TInt)
voidUpdateLeafObjectL(const TDesC8 &, const TDesC8 &, RWriteStream *&, const TDesC8 &, TInt)
Public Member Enumerations
enumTError {
EOk = 0, ENotFound, EInvalidObject, EAlreadyExists, ETooLargeObject, EDiskFull, EError, ERollbackFailed, EObjectInUse, ENoMemory, ECommitOK, ERollbackOK, ECommitFailed, ENotAllowed, EAcceptedForProcessing, EExecSuccess, EExecClientError, EExecUserCancelled, EExecDownloadFailed, EExecAltDwnldAuthFail, EExecDownFailOOM, EExecInstallFailed, EExecInstallOOM, EExecPkgValidationFail, EExecRemoveFailed, EExecActivateFailed, EExecDeactivateFailed, EExecNotImplemented, EExecUndefError, EExecOperationReject, EExecAltDwnldSrvError, EExecAltDwnldSrvUnavailable
}

Member Functions Documentation

AddNodeObjectL(const TDesC8 &, const TDesC8 &, TInt)

voidAddNodeObjectL(const TDesC8 &aURI,
const TDesC8 &aParentLUID,
TIntaStatusRef
)[pure virtual]

The function adds node object. In some cases an implementation of the function may be empty function, if the node object does not need concrete database update. Still this function may be helpful to an adapter, i.e. in passing mapping LUID of the node to DM Module. The SetStatusL should be used as described in UpdateLeafObjectL()

Parameters

const TDesC8 & aURIURI of the object
const TDesC8 & aParentLUIDLUID of the parent object (if the adapter have earlier returned LUID to the DM Module).
TInt aStatusRefReference to correct command, i.e. this reference must be used when calling the SetStatusL of this command.

ChildURIListL(const TDesC8 &, const TDesC8 &, const CArrayFix< TSmlDmMappingInfo > &, TInt, TInt)

voidChildURIListL(const TDesC8 &aURI,
const TDesC8 &aLUID,
const CArrayFix< TSmlDmMappingInfo > &aPreviousURISegmentList,
TIntaResultsRef,
TIntaStatusRef
)[pure virtual]

The function fetches URI list. An adapter returns the list of URI segments under the given URI be separated by slash ("/"). The URI segment names for new objects must be given by the adapter. The list is returned by calling the SetResultsL function of MSmlCallback callback interface. Results from this call MUST NOT be streamed.

Parameters

const TDesC8 & aURI
const TDesC8 & aLUID
const CArrayFix< TSmlDmMappingInfo > & aPreviousURISegmentListURI list with mapping LUID information, which is known by DM engine. An adapter can use this information when verifying if old objects still exists. An adapter also knows what objects are new to DM engine and can provide LUID mapping for them. aPreviousURISegmentList parameter (see above) helps to recognise new objects.
TInt aResultsRefReference to correct results, i.e. this reference must be used when returning the result by calling the SetResultsL.
TInt aStatusRefReference to correct command, i.e. this reference must be used when calling the SetStatusL of this command.

CommitAtomicL()

voidCommitAtomicL()[pure virtual]

The function indicates successful end of Atomic command. The adapter should commit all changes issued between StartAtomicL() and CommitAtomicL()

CompleteOutstandingCmdsL()

voidCompleteOutstandingCmdsL()[pure virtual]

The function tells the adapter that all the commands of the message that can be passed to the adapter have now been passed. This indciates that the adapter must supply status codes and results to any buffered commands. This must be done at latest by the time this function returns. This function is used at the end of SyncML messages, and during processing of Atomic. In the case of Atomic processing, the function will be followed by a call to CommitAtomicL or RollbackAtomicL.

CopyCommandL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const TDesC8 &, const TDesC8 &, TInt)

voidCopyCommandL(const TDesC8 &aTargetURI,
const TDesC8 &aTargetLUID,
const TDesC8 &aSourceURI,
const TDesC8 &aSourceLUID,
const TDesC8 &aType,
TIntaStatusRef
)[pure virtual]

The function implements copy command. The information about the success of the command should be returned by calling SetStatusL function of MSmlDmCallback callback interface. This makes it possible to buffer the commands. However, all the status codes for buffered commands must be returned at the latest when the CompleteOutstandingCmdsL() of adapter is called.

Parameters

const TDesC8 & aTargetURITarget URI for the command
const TDesC8 & aTargetLUID
const TDesC8 & aSourceURISource URI for the command
const TDesC8 & aSourceLUIDLUID of the source object (if the adapter has earlier returned a LUID to the DM Module).
const TDesC8 & aTypeMIME type of the objects
TInt aStatusRefReference to correct command, i.e. this reference must be used when calling the SetStatusL of this command.

DDFStructureL(MSmlDmDDFObject &)

voidDDFStructureL(MSmlDmDDFObject &aDDF)[pure virtual]

The function for filling the DDF structure of the adapter This function is only called once, immediately after the adapter is created.

Parameters

MSmlDmDDFObject & aDDF

DDFVersionL(CBufBase &)

voidDDFVersionL(CBufBase &aVersion)[pure virtual]

The function returns current version of the DDF. By asking current DDF versions from adapters DM Module can control possible changes in the data structure and send the changed DDF description to a management server. This function is always called after DDFStructureL.

Parameters

CBufBase & aVersionDDF version of the adapter. (filled by the adapter)

DeleteObjectL(const TDesC8 &, const TDesC8 &, TInt)

voidDeleteObjectL(const TDesC8 &aURI,
const TDesC8 &aLUID,
TIntaStatusRef
)[pure virtual]

The function deletes an object and its child objects. The SetStatusL should be used as described in UpdateLeafObjectL()

Parameters

const TDesC8 & aURIURI of the object
const TDesC8 & aLUIDLUID of the object (if the adapter have earlier returned LUID to the DM Module).
TInt aStatusRefReference to correct command, i.e. this reference must be used when calling the SetStatusL of this command.

ExecuteCommandL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const TDesC8 &, TInt)

voidExecuteCommandL(const TDesC8 &aURI,
const TDesC8 &aLUID,
const TDesC8 &aArgument,
const TDesC8 &aType,
TIntaStatusRef
)[pure virtual]

The function implements execute command. The information about the success of the command should be returned by calling SetStatusL function of MSmlDmCallback callback interface. This makes it possible to buffer the commands. However, all the status codes for buffered commands must be returned at the latest when the CompleteOutstandingCmdsL() of adapter is called.

Parameters

const TDesC8 & aURIURI of the command
const TDesC8 & aLUIDLUID of the object (if the adapter have earlier returned LUID to the DM Module).
const TDesC8 & aArgumentArgument for the command
const TDesC8 & aTypeMIME type of the object
TInt aStatusRefReference to correct command, i.e. this reference must be used when calling the SetStatusL of this command.

ExecuteCommandL(const TDesC8 &, const TDesC8 &, RWriteStream *&, const TDesC8 &, TInt)

voidExecuteCommandL(const TDesC8 &aURI,
const TDesC8 &aLUID,
RWriteStream *&aStream,
const TDesC8 &aType,
TIntaStatusRef
)[pure virtual]

The function implements execute command. The information about the success of the command should be returned by calling SetStatusL function of MSmlDmCallback callback interface. This makes it possible to buffer the commands. However, all the status codes for buffered commands must be returned at the latest when the CompleteOutstandingCmdsL() of adapter is called.

Parameters

const TDesC8 & aURIURI of the command
const TDesC8 & aLUIDLUID of the object (if the adapter have earlier returned LUID to the DM Module).
RWriteStream *& aStreamArgument for the command. Adapter should create write stream and return, when data is written to stream by DM agent, StreamCommittedL() is called by DM engine
const TDesC8 & aTypeMIME type of the object
TInt aStatusRefReference to correct command, i.e. this reference must be used when calling the SetStatusL of this command.

FetchLeafObjectL(const TDesC8 &, const TDesC8 &, const TDesC8 &, TInt, TInt)

voidFetchLeafObjectL(const TDesC8 &aURI,
const TDesC8 &aLUID,
const TDesC8 &aType,
TIntaResultsRef,
TIntaStatusRef
)[pure virtual]

The function fetches data of a leaf object. The SetStatusL should be used as described in UpdateLeafObjectL(). The data is returned by using the SetResultsL function of MSmlCallback callback interface, and may be streamed.

Parameters

const TDesC8 & aURIURI of the object
const TDesC8 & aLUIDLUID of the object (if the adapter have earlier returned LUID to the DM Module).
const TDesC8 & aTypeMIME type of the object
TInt aResultsRefReference to correct results, i.e. this reference must be used when returning the result by calling the SetResultsL.
TInt aStatusRefReference to correct command, i.e. this reference must be used when calling the SetStatusL of this command.

FetchLeafObjectSizeL(const TDesC8 &, const TDesC8 &, const TDesC8 &, TInt, TInt)

voidFetchLeafObjectSizeL(const TDesC8 &aURI,
const TDesC8 &aLUID,
const TDesC8 &aType,
TIntaResultsRef,
TIntaStatusRef
)[pure virtual]

The function fetches the size of the data of a leaf object. The size is in bytes, and must reflect the number of bytes that will be transferred when the framework calls FetchLeafObjectL. The SetStatusL should be used as described in FetchLeafObjectL(). The size value is returned by using the SetResultsL function of MSmlCallback callback interface, and must be a decimal integer expressed as a string, eg. "1234". Results from this call MUST NOT be streamed.

Parameters

const TDesC8 & aURIURI of the object
const TDesC8 & aLUIDLUID of the object (if the adapter have earlier returned LUID to the DM Module).
const TDesC8 & aTypeMIME type of the object
TInt aResultsRefReference to correct results, i.e. this reference must be used when returning the result by calling the SetResultsL.
TInt aStatusRefReference to correct command, i.e. this reference must be used when calling the SetStatusL of this command.

RollbackAtomicL()

voidRollbackAtomicL()[pure virtual]

The function indicates unsuccessful end of Atomic command. The adapter should rollback all changes issued between StartAtomicL() and RollbackAtomicL(). If rollback fails for a command, adapter should use SetStatusL() to indicate it.

StartAtomicL()

voidStartAtomicL()[pure virtual]

The function indicates start of Atomic command.

StreamCommittedL()

voidStreamCommittedL()[pure virtual]

Called when stream returned from UpdateLeafObjectL or ExecuteCommandL has been written to and committed. Not called when fetching item.

StreamingSupport(TInt &)

TBool StreamingSupport(TInt &aItemSize)[pure virtual]

Returns ETrue if adapter supports streaming otherwise EFalse.

Parameters

TInt & aItemSizesize limit for stream usage

UpdateLeafObjectL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const TDesC8 &, TInt)

voidUpdateLeafObjectL(const TDesC8 &aURI,
const TDesC8 &aLUID,
const TDesC8 &aObject,
const TDesC8 &aType,
TIntaStatusRef
)[pure virtual]

The function creates new leaf objects, or replaces data in existing leaf objects. The information about the success of the command should be returned by calling SetStatusL function of MSmlDmCallback callback interface. This makes it possible to buffer the commands. However, all the status codes for buffered commands must be returned at the latest when the adapter's CompleteOutstandingCmdsL() is called.

Parameters

const TDesC8 & aURIURI of the object
const TDesC8 & aLUIDLUID of the object (if the adapter has earlier returned a LUID to the DM Module). For new objects, this is the LUID inherited through the parent node.
const TDesC8 & aObjectData of the object.
const TDesC8 & aTypeMIME type of the object
TInt aStatusRefReference to correct command, i.e. this reference must be used when calling the SetStatusL of this command

UpdateLeafObjectL(const TDesC8 &, const TDesC8 &, RWriteStream *&, const TDesC8 &, TInt)

voidUpdateLeafObjectL(const TDesC8 &aURI,
const TDesC8 &aLUID,
RWriteStream *&aStream,
const TDesC8 &aType,
TIntaStatusRef
)[pure virtual]

The function creates new leaf objects, or replaces data in existing leaf objects, in the case where data is large enough to be streamed. The information about the success of the command should be returned by calling SetStatusL function of MSmlDmCallback callback interface. This makes it possible to buffer the commands. However, all the status codes for buffered commands must be returned at the latest when the CompleteOutstandingCmdsL() of adapter is called.

Parameters

const TDesC8 & aURIURI of the object
const TDesC8 & aLUIDLUID of the object (if the adapter has earlier returned a LUID to the DM Module). For new objects, this is the LUID inherited through the parent node.
RWriteStream *& aStreamData of the object. Adapter should create write stream and return, when data is written to stream by DM agent, StreamCommittedL() is called by DM engine
const TDesC8 & aTypeMIME type of the object
TInt aStatusRefReference to correct command, i.e. this reference must be used when calling the SetStatusL of this command.

Member Enumerations Documentation

Enum TError

An enumeration of the error codes which may be returned by DM adapters.

Enumerators

EOk = 0

The command was successful

ENotFound

The command failed because no setting exists in the store which corresponds to the URI or LUID passed to the adapter

EInvalidObject

The command failed because the setting can't take the value being passed to the adapter

EAlreadyExists

The command failed because the setting already exists in the store

ETooLargeObject

The command failed because the setting value is too large to be accommodated in the store

EDiskFull

The command failed because the disk on which the device store resides is full

EError

The command failed for an unspecified reason

ERollbackFailed

The command could not be rolled back successfully

EObjectInUse

The command failed because the setting is being used by another client

ENoMemory

The command failed because no memory could be allocated

ECommitOK

The command succesfully committed

ERollbackOK

The command rolled back succesfully

ECommitFailed

The commit of command failed

ENotAllowed
EAcceptedForProcessing
EExecSuccess
EExecClientError
EExecUserCancelled
EExecDownloadFailed
EExecAltDwnldAuthFail
EExecDownFailOOM
EExecInstallFailed
EExecInstallOOM
EExecPkgValidationFail
EExecRemoveFailed
EExecActivateFailed
EExecDeactivateFailed
EExecNotImplemented
EExecUndefError
EExecOperationReject
EExecAltDwnldSrvError
EExecAltDwnldSrvUnavailable