MSenMessage Class Reference

#include <mw/MSenMessage.h>

Link against: SenMessages.lib

class MSenMessage
Public Member Enumerations
enumTClass { EMessageBase, EHttpGetMsg, EHttpPostMsg, EHttpPutMsg, ..., EAtomMessage }
enumTDirection { EOutbound, EInbound }
Public Member Functions
pure virtual MSenMessage *CloneL()
pure virtual MSenMessageContext *Context()
pure virtual TDirection Direction()
pure virtual TBool IsSafeToCast(TClass)
pure virtual MSenProperties *Properties()
pure virtual TInt SetContext(MSenMessageContext *)
pure virtual TInt SetProperties(MSenProperties *)
pure virtual TInt TxnId()
pure virtual TClass Type()

Detailed Description

This is abstract interface defines set of WSF message classes, providing convenience for other components, which typically cast this to some subclass via IsSafeToCast() method.
Since
Series60 4.0

Member Enumeration Documentation

Enum TDirection

Direction Enumeration

EnumeratorValueDescription
EOutbound0
EInbound1

Member Function Documentation

CloneL ( )

MSenMessage *CloneL()[pure virtual]

Clone method that duplicates this message -- including all member data in the message. For the service consumers, a typical use case for cloning the message is when there is need to preserve the received response beyond the life time of a transaction. Normally, the response messages, that are owned by service connection are de-allocated after execution returns from MSenServiceConsumer interface's HandleMessageL or HandleErrorL method, back to the service connection.

Returns: a pointer to a new message class instance, which ownership IS transferred to a caller. Note that caller is expected to cast this pointer to a proper subclass via the use of IsSafeToCast method. In case of responses, the message type is normally equal with the type of the request message that was sent by the consumer.

Context ( )

MSenMessageContext *Context()[pure virtual]

Getter for message's context

Returns: message context, if this message relates to (has associated with) such context, or NULL.

Direction ( )

TDirection Direction()[pure virtual]

Gets the Message Direction

IsSafeToCast ( TClass )

TBool IsSafeToCast(TClassaType)[pure virtual]

Properties ( )

MSenProperties *Properties()[pure virtual]

Getter for message specific (transport) properties

Returns: (transport) properties of this message, if such have been applied to this message or NULL otherwise.

SetContext ( MSenMessageContext * )

TInt SetContext(MSenMessageContext *apNotOwnedContext)[pure virtual]

Sets message context for this message. If context already exists, it is discarded and replaced by this context (context reset is performed).

ParameterDescription
apNotOwnedContextis the context. Ownership is NOT transferred to this message.

Returns: KErrNone on success KErrArgument if apOwnedContext == NULL or system-wide errorcode otherwise.

SetProperties ( MSenProperties * )

TInt SetProperties(MSenProperties *apOwnedProperties)[pure virtual]

Sets properties for this message. Most typical use case is to set message spesific transport properties. 1. If message has context, the properties are (re)set into that context, discarding any pre-existing properties.

2. If context is NOT available, properties will be directly owned by this message.

ParameterDescription
apOwnedPropertiespointer to the properties, which ownership is transferred to this class. This is performed in two different manners:

Returns: KErrNone on success KErrArgument if apOwnedProperties == NULL or system-wide errorcode otherwise.

TxnId ( )

TInt TxnId()[pure virtual]

Getter for transaction ID of this message. In case of receiving a response message from service provider, this transaction ID may be used to map the response with request that the service consumer sent via service connection. In such case, the consumer can store return value from SendL method that was invoked in order maintain this mapping.

Returns: the transaction ID of this message

Type ( )

TClass Type()[pure virtual]

Gets the Message Type