CApaAppServer Class Reference

class CApaAppServer : public CPolicyServer

Base class for all server application's servers. Server applications must derive from this class to implement their servers. These must be instantiated in an override of CApaApplication::NewAppServerL(). The main task of this class is to create service implementations that clients of a server app may connect to.

CEikAppServer

CPolicyServer

Inherits from

Public Member Functions
~CApaAppServer()
IMPORT_C voidConstructL(const TDesC &)
IMPORT_C CApaAppServiceBase *CreateServiceL(TUid)
IMPORT_C TCustomResultCreateServiceSecurityCheckL(TUid, const RMessage2 &, TInt &, TSecurityInfo &)
IMPORT_C voidNotifyServerExit(TInt)
Protected Member Functions
CApaAppServer()
IMPORT_C TCustomResultCustomSecurityCheckL(const RMessage2 &, TInt &, TSecurityInfo &)
IMPORT_C voidDoConnect(const RMessage2 &)
Private Member Functions
IMPORT_C voidCApaAppServer_Reserved1()
IMPORT_C voidCApaAppServer_Reserved2()
TUid ConnectMessageServiceUid(const RMessage2 &)
IMPORT_C voidExtensionInterface(TUid, TAny *&)
IMPORT_C CSession2 *NewSessionL(const TVersion &, const RMessage2 &)
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
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()
CPolicyServer::CPolicyServer(TInt,const TPolicy &,TServerType)
CPolicyServer::CheckFailedL(const RMessage2 &,TInt,const TSecurityInfo &)
CPolicyServer::CustomFailureActionL(const RMessage2 &,TInt,const TSecurityInfo &)
CPolicyServer::Extension_(TUint,TAny *&,TAny *)
CPolicyServer::ProcessError(const RMessage2 &,TInt)
CPolicyServer::ProcessL(const RMessage2 &)
CServer2::CServer2(TInt,TServerType)
CServer2::DoCancel()
CServer2::Message()const
CServer2::ReStart()
CServer2::Server()const
CServer2::SetMaster(const CServer2 *)
CServer2::SetPinClientDescriptors(TBool)
CServer2::Start(const TDesC &)
CServer2::StartL(const TDesC &)
CServer2::~CServer2()
Inherited Enumerations
CActive:TPriority
CPolicyServer:TCustomResult
CPolicyServer:TFailureAction
CPolicyServer:TSpecialCase
CServer2:TPanic
CServer2:TServerType
Private Attributes
TInt iApaReserved1
TInt iApaReserved2
Inherited Attributes
CActive::iStatus
CServer2::iSessionIter

Constructor & Destructor Documentation

CApaAppServer()

IMPORT_CCApaAppServer()[protected]

~CApaAppServer()

IMPORT_C~CApaAppServer()

Member Functions Documentation

CApaAppServer_Reserved1()

IMPORT_C voidCApaAppServer_Reserved1()[private, virtual]

CApaAppServer_Reserved2()

IMPORT_C voidCApaAppServer_Reserved2()[private, virtual]

ConnectMessageServiceUid(const RMessage2 &)

TUid ConnectMessageServiceUid(const RMessage2 &aMsg)const [private]

Parameters

const RMessage2 & aMsg

ConstructL(const TDesC &)

IMPORT_C voidConstructL(const TDesC &aFixedServerName)[virtual]

Parameters

const TDesC & aFixedServerName

CreateServiceL(TUid)

IMPORT_C CApaAppServiceBase *CreateServiceL(TUidaServiceType)const [virtual]

Parameters

TUid aServiceType

CreateServiceSecurityCheckL(TUid, const RMessage2 &, TInt &, TSecurityInfo &)

IMPORT_C TCustomResultCreateServiceSecurityCheckL(TUidaServiceType,
const RMessage2 &aMsg,
TInt &aAction,
TSecurityInfo &aMissing
)[virtual]

Parameters

TUid aServiceType
const RMessage2 & aMsg
TInt & aAction
TSecurityInfo & aMissing

CustomSecurityCheckL(const RMessage2 &, TInt &, TSecurityInfo &)

IMPORT_C TCustomResultCustomSecurityCheckL(const RMessage2 &aMsg,
TInt &aAction,
TSecurityInfo &aMissing
)[protected, virtual]

Performs a custom security check. Derived server classes must implement this function if any element in iElementsIndex has the value CPolicyServer::ECustomCheck. Similarly, if CPolicyServer::ECustomCheck is not used, then this function can be safely ignored.

If CPolicyServer::ECustomCheck is used, there are two further cases to consider:
  1. The custom security check can synchronously decide if the message should pass. In this case, the derived implementation must simply return either EPass or EFail depending on the result of the security check.

  2. The custom security check needs to use asynchronous methods in order to determine whether the message should procceed. In this case, these asysnchronous methods should be started and then the EAsync value returned. Furthermore, implmentations returning EAsync commit to the following:
    • If the security check eventually passes, ProcessL() must be called with the appropriate message.

    • If the security check eventually fails, CheckFailedL() must be called with that message.

    • Pending messages on a given session need to be completed and discarded if the session is closed.

IMPORTANT NOTE. When processing a message asynchronously, a copy must be made of the RMessage2 object. Saving a refernece or pointer to the original message will produce unpredictable defects. This is because the object will be reused for the next message that the server receives.

In both cases, synchronous and asynchronous, the derived implementation has the option of updating the aAction and/or aMissing parameters if that is appropriate.

A value from TCustomResult.

panic

CBase 95 If the default implementation is called.

Parameters

const RMessage2 & aMsgThe message to check.
TInt & aActionA reference to the action to take if the security check fails. This is either a value from TFailureAction or a negative value which has meaning to the CustomFailureActionL() method of a derived class. The policy server framework gives this value a default of EFailClient. If a derived implementation wishes a different value, then it should change this.
TSecurityInfo & aMissingA reference to the list of security attributes missing from the checked process. The policy server initialises this object to zero (that is a sid of 0, a vid of 0, and no capabilities). If derived implementations wish to take advantage of a list of missing attributes in their implementation of CustomFailureActionL(), then they should set those missing attributes here in CustomSecurityCheckL().

DoConnect(const RMessage2 &)

IMPORT_C voidDoConnect(const RMessage2 &aMessage)[protected, virtual]

Parameters

const RMessage2 & aMessage

ExtensionInterface(TUid, TAny *&)

IMPORT_C voidExtensionInterface(TUidaInterfaceId,
TAny *&aImplementaion
)[private, virtual]

Parameters

TUid aInterfaceId
TAny *& aImplementaion

NewSessionL(const TVersion &, const RMessage2 &)

IMPORT_C CSession2 *NewSessionL(const TVersion &aVersion,
const RMessage2 &aMessage
)const [private, virtual]

Creates a server-side session object.

The session represents a communication link between a client and a server, and its creation is initiated by the client through a call to one of the RSessionBase::CreateSession() variants.

A server must provide an implementation, which as a minimum should:

  • check that the version of the server is compatible with the client by comparing the client supplied version number against the server's version number; it should leave if there is incompatibility.

  • construct and return the server side client session object.

A pointer to the newly created server-side session object.

User::QueryVersionSupported()

Parameters

const TVersion & aVersionThe version information supplied by the client.
const RMessage2 & aMessageRepresents the details of the client request that is requesting the creation of the session.

NotifyServerExit(TInt)

IMPORT_C voidNotifyServerExit(TIntaReason)

Parameters

TInt aReason

Member Data Documentation

TInt iApaReserved1

TInt iApaReserved1[private]

TInt iApaReserved2

TInt iApaReserved2[private]