policymanagement/policyengine/centreptoolserver/inc/CentRepToolServer.h
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Implementation of policymanagement components
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CENTREPTOOL_SERVER_H__
       
    20 #define __CENTREPTOOL_SERVER_H__
       
    21 
       
    22 // INCLUDES
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "CentRepToolClient.h"
       
    26 #include "PlatformSecurityPolicies.h"
       
    27 
       
    28 // CONSTANTS
       
    29 
       
    30 // ----------------------------------------------------------------------------------------
       
    31 // PolicyEngine server panic codes
       
    32 // ----------------------------------------------------------------------------------------
       
    33 enum TCentRepToolServerPanic
       
    34 	{
       
    35 	EPanicGeneral,
       
    36 	EBadSubsessionHandle,
       
    37 	EPanicIllegalFunction,
       
    38 	EBadDescriptor
       
    39 	};
       
    40 
       
    41 // MACROS
       
    42 // DATA TYPES
       
    43 // FUNCTION PROTOTYPES
       
    44 
       
    45 void PanicClient(const RMessagePtr2& aMessage, TCentRepToolServerPanic aPanic);
       
    46 
       
    47 // FORWARD DECLARATIONS
       
    48 
       
    49 class CRepositorySession;
       
    50 
       
    51 // CLASS DECLARATION     
       
    52 
       
    53 class CShutdown : public CTimer
       
    54 	{
       
    55 	enum {KPolicyEngineShutdownDelay=0x200000};	// approx 2s
       
    56 public:
       
    57 	inline CShutdown();
       
    58 	inline void ConstructL();
       
    59 	inline void Start();
       
    60 private:
       
    61 	void RunL();
       
    62 	};
       
    63 
       
    64 
       
    65 
       
    66 /**
       
    67 *  CPolicyEngineServer 
       
    68 *  Description.
       
    69 */
       
    70 
       
    71 class CCentRepToolServer : public CPolicyServer
       
    72 	{
       
    73 public:
       
    74 	static CServer2* NewLC();
       
    75 	~CCentRepToolServer();
       
    76 	void AddSession();
       
    77 	void DropSession();
       
    78 	
       
    79 	/**
       
    80     * Description
       
    81 	* @param a??? 
       
    82     * @return CObjectCon
       
    83     */
       
    84 
       
    85 	CObjectCon* NewContainerL();
       
    86 	
       
    87 	void Panic( TInt aPanicCode);
       
    88 private:
       
    89 	CCentRepToolServer();
       
    90 	void ConstructL();
       
    91 	CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;	
       
    92 private:
       
    93 	TInt iSessionCount;
       
    94 	
       
    95 	CShutdown iShutdown;
       
    96 	
       
    97 	CObjectConIx *iContainerIndex;
       
    98 	};
       
    99 
       
   100 
       
   101 class CCentRepToolSession : public CSession2
       
   102 	{
       
   103 public:
       
   104 	CCentRepToolSession();
       
   105 	void CreateL();
       
   106  private:
       
   107 	~CCentRepToolSession();
       
   108 	inline CCentRepToolServer& Server();
       
   109 
       
   110 	void ServiceL(const RMessage2& aMessage);
       
   111 	void DispatchMessageL(const RMessage2& aMessage);
       
   112 	void ServiceError(const RMessage2& aMessage,TInt aError);
       
   113 	
       
   114 	void NewRepositorySessionL( const RMessage2& aMessage);
       
   115 	CRepositorySession* RepositorySessionFromHandle( const RMessage2& aMessage);
       
   116 	void DeleteRepositorySession( const RMessage2& aMessage);
       
   117 	
       
   118 	void ExecuteRequestL( const RMessage2& aMessage);
       
   119 	
       
   120 	void PerformRFSL();
       
   121 
       
   122 private:	
       
   123 	TInt iSubsessionCount;
       
   124 	CRepositorySession* iCurrentSession;
       
   125 
       
   126 	CObjectCon *iContainer;		 		// object container for this session
       
   127 	CObjectIx* iRepositorySessions; 	// object index which stores objects for this session
       
   128 };
       
   129 
       
   130 #endif //__CENTREPTOOL_SERVER_H__