RMediatorServer Class Reference

class RMediatorServer : public RSessionBase

Client API for Mediator Server.

The Mediator Server is used to pass information between clients. The services of Mediator Server include passing events and passing commands with respective responses. For events there can be multiple event providers and consumers. For commands there can be only one initiator and one responder.

The operations of Mediator server have the following hierarchy. Domain -> Category -> Event/Command -> Data

The domain means the application domain, the purpose, for which the services of Mediator Server are used.

The category means the functionality area within the domain to which an event or a command belongs to.

An event or a command is a message passed to Mediator server. Each message may have data assosiated with it. For each command exactly one response shall be sent.

Before any messages can be sent to Mediator Server, the messages need to be registered. When registering messages, the capabilities required to consume that message are defined. In case of commands timeout values for responses are also defined.

MediatorClient.lib
Since
S60 3.1

Inherits from

Public Member Functions
RMediatorServer()
voidCancel()
TInt CancelCommand(TUid, TUid, TInt)
TInt CancelNotifications()
voidClose()
TInt Connect()
TInt FetchNotificationCommandList(TPtr8 &)
TInt FetchNotificationEventList(TPtr8 &)
TInt FetchParameterData(TPtr8 &)
TInt GetCategories(TUid, RCategoryList &)
TInt GetCommands(TUid, TUid, RCommandList &)
TInt GetDomains(RDomainList &)
TInt GetEvents(TUid, TUid, REventList &)
TInt IssueCommand(TUid, TUid, TInt, TVersion, const TDesC8 &)
TInt IssueResponse(TUid, TUid, TInt, TInt, const TDesC8 &)
TInt RaiseEvent(TUid, TUid, TInt, TVersion, const TDesC8 &)
voidReceiveCommands(TRequestStatus &, TMediatorCategoryRetBuffer &, TCommandRetBuffer &, TPtr8 &)
voidReceiveEvents(TRequestStatus &, TMediatorCategoryRetBuffer &, TEventRetBuffer &, TPtr8 &)
voidReceiveNotifications(TRequestStatus &, TMediatorCategoryRetBuffer &, TNotificationTypeRetBuffer &, TPtr8 &, TPtr8 &)
TInt RegisterCommandList(TUid, TUid, const RCommandList &)
TInt RegisterEventList(TUid, TUid, const REventList &)
TInt SubscribeEventList(TUid, TUid, const REventList &)
TInt UnregisterCommandList(TUid, TUid, const RCommandList &)
TInt UnregisterEventList(TUid, TUid, const REventList &)
TInt UnsubscribeEvent(TUid, TUid, TInt)
TInt UnsubscribeEventList(TUid, TUid, const REventList &)
voidWaitForCommandResponse(TRequestStatus &, TMediatorCategoryRetBuffer &, TCommandRetBuffer &, TPtr8 &, TPckg< TInt > &)
Private Member Functions
TInt StartServer()
TVersion Version()
Inherited Functions
RHandleBase::Attributes()const
RHandleBase::BTraceId()const
RHandleBase::DoExtendedClose()
RHandleBase::Duplicate(const RThread &,TOwnerType)
RHandleBase::FullName()const
RHandleBase::FullName(TDes &)const
RHandleBase::Handle()const
RHandleBase::HandleInfo(THandleInfo *)
RHandleBase::Name()const
RHandleBase::NotifyDestruction(TRequestStatus &)
RHandleBase::Open(const TFindHandleBase &,TOwnerType)
RHandleBase::OpenByName(const TDesC &,TOwnerType,TInt)
RHandleBase::RHandleBase()
RHandleBase::RHandleBase(TInt)
RHandleBase::SetHandle(TInt)
RHandleBase::SetHandleNC(TInt)
RSessionBase::CreateSession(RServer2,const TVersion &)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TRequestStatus *)
RSessionBase::Open(RMessagePtr2,TInt,TOwnerType)
RSessionBase::Open(RMessagePtr2,TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Open(TInt,TOwnerType)
RSessionBase::Open(TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Send(TInt)const
RSessionBase::Send(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt)const
RSessionBase::SendReceive(TInt,TRequestStatus &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSessionBase::SetReturnedHandle(TInt)
RSessionBase::SetReturnedHandle(TInt,RHandleBase &)
RSessionBase::SetReturnedHandle(TInt,const TSecurityPolicy &)
RSessionBase::ShareAuto()
RSessionBase::ShareProtected()
Inherited Enumerations
RHandleBase:TAttributes
RSessionBase:TAttachMode
Inherited Attributes
RHandleBase::iHandle

Constructor & Destructor Documentation

RMediatorServer()

RMediatorServer()

Session constructor.

Member Functions Documentation

Cancel()

voidCancel()

Cancels all ongoing async operations

Since
S60 3.1

CancelCommand(TUid, TUid, TInt)

TInt CancelCommand(TUidaDomain,
TUidaCategory,
TIntaCommandId
)

Cancel a command.

Since
S60 3.1

Parameters

TUid aDomainThe identifier of the domain.
TUid aCategoryThe identifier of the category.
TInt aCommandIdThe identifier of the command.

CancelNotifications()

TInt CancelNotifications()

Get a list of registered commands.

Since
S60 3.1

Close()

voidClose()

Closes the session to server

Since
S60 3.1

Connect()

TInt Connect()

Creates a connection to server. If server is not started, method will start the server first and then create a new session.

Since
S60 3.1

FetchNotificationCommandList(TPtr8 &)

TInt FetchNotificationCommandList(TPtr8 &aCommandArrayPtr)

Fetch command list, if list size was larger than default boundary.

Since
S60 3.1

Parameters

TPtr8 & aCommandArrayPtrpointer to data buffer where Mediator writes data

FetchNotificationEventList(TPtr8 &)

TInt FetchNotificationEventList(TPtr8 &aEventArrayPtr)

Fetch event list, if list size was larger than default boundary.

Since
S60 3.1

Parameters

TPtr8 & aEventArrayPtrpointer to data buffer where Mediator writes data

FetchParameterData(TPtr8 &)

TInt FetchParameterData(TPtr8 &aParameterData)

Fetch parameter data, if data size was larger than default boundary.

Since
S60 3.1

Parameters

TPtr8 & aParameterDatapointer to data buffer where Mediator writes data

GetCategories(TUid, RCategoryList &)

TInt GetCategories(TUidaDomain,
RCategoryList &aCategories
)

Get registered categories for the domain

Since
S60 3.1

Parameters

TUid aDomainUID for the domain.
RCategoryList & aCategoriesList of registered categories within the domain.

GetCommands(TUid, TUid, RCommandList &)

TInt GetCommands(TUidaDomain,
TUidaCategory,
RCommandList &aCommands
)

Get a list of registered commands.

Since
S60 3.1

Parameters

TUid aDomainThe identifier of the domain.
TUid aCategoryThe identifier of the category.
RCommandList & aCommandsThe list of registered commands for the category.

GetDomains(RDomainList &)

TInt GetDomains(RDomainList &aDomains)

Get registered domains

Since
S60 3.1

Parameters

RDomainList & aDomainsThe list of registered domains.

GetEvents(TUid, TUid, REventList &)

TInt GetEvents(TUidaDomain,
TUidaCategory,
REventList &aEvents
)

Get a list of registered events.

Since
S60 3.1

Parameters

TUid aDomainThe identifier of the domain.
TUid aCategoryThe identifier of the category.
REventList & aEventsThe list of registered events for the category.

IssueCommand(TUid, TUid, TInt, TVersion, const TDesC8 &)

TInt IssueCommand(TUidaDomain,
TUidaCategory,
TIntaCommandId,
TVersionaVersion,
const TDesC8 &aData
)

Issue a command.

Since
S60 3.1

Parameters

TUid aDomainThe identifier of the domain.
TUid aCategoryThe identifier of the category.
TInt aCommandIdThe identifier of the command.
TVersion aVersionThe version of the command.
const TDesC8 & aDataThe parameters of the command.

IssueResponse(TUid, TUid, TInt, TInt, const TDesC8 &)

TInt IssueResponse(TUidaDomain,
TUidaCategory,
TIntaCommandId,
TIntaStatus,
const TDesC8 &aData
)

Issue a response to a command.

Since
S60 3.1

Parameters

TUid aDomainThe identifier of the domain.
TUid aCategoryThe identifier of the category.
TInt aCommandIdThe identifier of the command.
TInt aStatusProcessing status of the command
const TDesC8 & aDataThe parameters of the response.

RaiseEvent(TUid, TUid, TInt, TVersion, const TDesC8 &)

TInt RaiseEvent(TUidaDomain,
TUidaCategory,
TIntaEventId,
TVersionaVersion,
const TDesC8 &aData
)

Raise an event.

Since
S60 3.1

Parameters

TUid aDomainThe identifier of the domain.
TUid aCategoryThe identifier of the category.
TInt aEventIdThe identifier of the event.
TVersion aVersionThe version of the event.
const TDesC8 & aDataThe parameters of the event.

ReceiveCommands(TRequestStatus &, TMediatorCategoryRetBuffer &, TCommandRetBuffer &, TPtr8 &)

voidReceiveCommands(TRequestStatus &aStatus,
TMediatorCategoryRetBuffer &aCategoryBuffer,
TCommandRetBuffer &aCommandBuffer,
TPtr8 &aCommandData
)

Get command requests.

Since
S60 3.1

Parameters

TRequestStatus & aStatus
TMediatorCategoryRetBuffer & aCategoryBufferCategory buffer.
TCommandRetBuffer & aCommandBufferCommand buffer
TPtr8 & aCommandDataPointer descriptor to buffer where command data is written.

ReceiveEvents(TRequestStatus &, TMediatorCategoryRetBuffer &, TEventRetBuffer &, TPtr8 &)

voidReceiveEvents(TRequestStatus &aStatus,
TMediatorCategoryRetBuffer &aCategoryBuffer,
TEventRetBuffer &aEventBuffer,
TPtr8 &aEventData
)

Start to receive events from Mediator Server

Since
S60 3.1

Parameters

TRequestStatus & aStatusTRequestStatus of the AO to be completed when event occurs.
TMediatorCategoryRetBuffer & aCategoryBufferCategory buffer.
TEventRetBuffer & aEventBuffer
TPtr8 & aEventDataPointer descriptor to buffer where event data is written.

ReceiveNotifications(TRequestStatus &, TMediatorCategoryRetBuffer &, TNotificationTypeRetBuffer &, TPtr8 &, TPtr8 &)

voidReceiveNotifications(TRequestStatus &aStatus,
TMediatorCategoryRetBuffer &aCategoryBuffer,
TNotificationTypeRetBuffer &aTypeBuffer,
TPtr8 &aEventArrayPtr,
TPtr8 &aCommandArrayPtr
)

Get a list of registered commands.

Since
S60 3.1

Parameters

TRequestStatus & aStatusTRequestStatus of the operation to be completed when notification is received.
TMediatorCategoryRetBuffer & aCategoryBufferCategory buffer.
TNotificationTypeRetBuffer & aTypeBufferType buffer
TPtr8 & aEventArrayPtrPointer descriptor to buffer where event data is written.
TPtr8 & aCommandArrayPtrPointer descriptor to buffer where command data is written.

RegisterCommandList(TUid, TUid, const RCommandList &)

TInt RegisterCommandList(TUidaDomain,
TUidaCategory,
const RCommandList &aCommands
)

Register a command list. After registering the list clients can initiate and respond the commands.

Since
S60 3.1

Parameters

TUid aDomainThe identifier of the domain.
TUid aCategoryThe identifier of the category.
const RCommandList & aCommandsList of commands to be registered

RegisterEventList(TUid, TUid, const REventList &)

TInt RegisterEventList(TUidaDomain,
TUidaCategory,
const REventList &aEvents
)

Registers an event list. After registering the list clients can provide and consume the events.

Since
S60 3.1

Parameters

TUid aDomainThe identifier of the domain.
TUid aCategoryThe identifier of the category.
const REventList & aEventsList of events to be registered

StartServer()

TInt StartServer()[private]

Server start function

Since
S60 3.1

SubscribeEventList(TUid, TUid, const REventList &)

TInt SubscribeEventList(TUidaDomain,
TUidaCategory,
const REventList &aEvents
)

Subscribes a list of events. Raised events will be delivered via the observer interface.

Since
S60 3.1

Parameters

TUid aDomainThe identifier of the domain.
TUid aCategoryThe identifier of the category.
const REventList & aEventsList of the events to be subscribed.

UnregisterCommandList(TUid, TUid, const RCommandList &)

TInt UnregisterCommandList(TUidaDomain,
TUidaCategory,
const RCommandList &aCommands
)

Unregister a command list. After unregistering no clients can initiate or respond to these events.

Since
S60 3.1

Parameters

TUid aDomainThe identifier of the domain.
TUid aCategoryThe identifier of the category.
const RCommandList & aCommandsList of commands to be unregistered.

UnregisterEventList(TUid, TUid, const REventList &)

TInt UnregisterEventList(TUidaDomain,
TUidaCategory,
const REventList &aEvents
)

Unregister an event list. After unregistering no clients can consume or provide these events.

Since
S60 3.1

Parameters

TUid aDomainThe identifier of the domain.
TUid aCategoryThe identifier of the category.
const REventList & aEventsList of events to be unregistered.

UnsubscribeEvent(TUid, TUid, TInt)

TInt UnsubscribeEvent(TUidaDomain,
TUidaCategory,
TIntaEventId
)

Unsubscribe an event.

Since
S60 3.1

Parameters

TUid aDomainThe identifier of the domain.
TUid aCategoryThe identifier of the category.
TInt aEventIdThe identifier of the event.

UnsubscribeEventList(TUid, TUid, const REventList &)

TInt UnsubscribeEventList(TUidaDomain,
TUidaCategory,
const REventList &aEvents
)

Unsubscribe an event list.

Since
S60 3.1

Parameters

TUid aDomainThe identifier of the domain.
TUid aCategoryThe identifier of the category.
const REventList & aEventsThe list of events.

Version()

TVersion Version()const [private]
Gets server version information.
Since
S60 3.1

WaitForCommandResponse(TRequestStatus &, TMediatorCategoryRetBuffer &, TCommandRetBuffer &, TPtr8 &, TPckg< TInt > &)

voidWaitForCommandResponse(TRequestStatus &aStatus,
TMediatorCategoryRetBuffer &aCategoryBuffer,
TCommandRetBuffer &aCommandBuffer,
TPtr8 &aCommandData,
TPckg< TInt > &aStatusBuffer
)

Wait for command response.

Since
S60 3.1

Parameters

TRequestStatus & aStatusTRequestStatus of the AO to be completed when command response is received.
TMediatorCategoryRetBuffer & aCategoryBufferCategory buffer.
TCommandRetBuffer & aCommandBufferCommand buffer
TPtr8 & aCommandDataPointer descriptor to buffer where command data is written.
TPckg< TInt > & aStatusBufferStatus buffer.