os/persistentdata/persistentstorage/centralrepository/cenrepsrv/srvsubsess.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef SRVSUBSESS_H
    17 #define SRVSUBSESS_H
    18 
    19 #include <e32base.h>
    20 #include "shrepos.h"
    21 #include "srvrepos_noc.h"
    22 #include "clientrequest.h"
    23 #include "sessnotf.h"
    24 
    25 class CServerSession;
    26 class CSessionManager;
    27 
    28 class CServerSubSession : public CObject
    29 	{
    30 friend class CServerSession;	
    31 public:
    32 	CServerSubSession(CServerSession* aSession);
    33 	~CServerSubSession();
    34 	void ServiceError(TInt aError);
    35 	TInt ServiceL(const RMessage2& aMessage);
    36 public:
    37 	enum { KDontCompleteMessage = 1 };
    38 
    39 private:
    40 	typedef TInt (CServerSubSession::*TServerFunc)(const TClientRequest&);
    41 
    42 	TInt GeneralOperationsL(const TClientRequest& aMessage, TServerFunc aFunc);
    43 	TInt ReadOperationsL(const TClientRequest& aMessage, TServerFunc aFunc);
    44 	TInt WriteOperationsL(const TClientRequest& aMessage, TServerFunc aFunc);
    45 	TInt ResetOperationsL(const TClientRequest& aMessage, TServerFunc aFunc);
    46 
    47 	TInt InitialiseL(const TClientRequest& aMessage);
    48 	TInt CreateIntL(const TClientRequest& aMessage);
    49 	TInt CreateRealL(const TClientRequest& aMessage);
    50 	TInt CreateStringL(const TClientRequest& aMessage);
    51 	TInt DeleteL(const TClientRequest& aMessage);
    52 	TInt DeleteRangeL(const TClientRequest& aMessage);
    53 	TInt GetIntL(const TClientRequest& aMessage);
    54 	TInt SetIntL(const TClientRequest& aMessage);
    55 	TInt GetRealL(const TClientRequest& aMessage);
    56 	TInt SetRealL(const TClientRequest& aMessage);
    57 	TInt GetStringL(const TClientRequest& aMessage);
    58 	TInt SetStringL(const TClientRequest& aMessage);
    59 	TInt FindL(const TClientRequest& aMessage);
    60 	TInt FindEqIntL(const TClientRequest& aMessage);
    61 	TInt FindEqRealL(const TClientRequest& aMessage);
    62 	TInt FindEqStringL(const TClientRequest& aMessage);
    63 	TInt FindNeqIntL(const TClientRequest& aMessage);
    64 	TInt FindNeqRealL(const TClientRequest& aMessage);
    65 	TInt FindNeqStringL(const TClientRequest& aMessage);
    66 	TInt GetFindResultL(const TClientRequest& aMessage);
    67 	TInt NotifyRequestCheck(const TClientRequest& aMessage);
    68 	TInt NotifyRequest(const TClientRequest& aMessage);
    69 	TInt NotifyCancel(const TClientRequest& aMessage);
    70 	TInt NotifyCancelAll(const TClientRequest& aMessage);
    71 	TInt GroupNotifyRequest(const TClientRequest& aMessage);
    72 	TInt GroupNotifyCancel(const TClientRequest& aMessage);
    73 	TInt ResetL(const TClientRequest& aMessage);
    74 	TInt ResetAllL(const TClientRequest& aMessage);
    75 	TInt TransactionStart(const TClientRequest& aMessage);
    76 	TInt TransactionCancel(const TClientRequest& aMessage);
    77 	TInt TransactionCommitL(const TClientRequest& aMessage);
    78 	TInt MoveL(const TClientRequest& aMessage) ;
    79 	TInt TransactionStateL(const TClientRequest& aMessage);
    80 	TInt TransactionFail(const TClientRequest& aMessage);
    81 	TInt GetMeta(const TClientRequest& aMessage);
    82 	
    83 	template <class T> TInt FindValueL(const TClientRequest& aMessage, const T& aVal, TComparison aComparison=EEqual);
    84 	inline CSessionManager* Server();	
    85 	TInt CheckPolicy(const TClientRequest& msg,const TSecurityPolicy& aPolicy,
    86 				const char *aDiagnostic);
    87 
    88 private:
    89 	CServerSession* iSession;
    90 	CServerRepository iRepository;
    91 	CSessionNotifier iNotifier;
    92 	RArray<TUint32> iFindResult;
    93 	TBool iInitialised;
    94 #if defined (__CENTREP_SERVER_PERFTEST__) || defined(SRVSUBSESS_TRACE) || defined(CENTREP_TRACE)
    95 
    96    	TUid iRepositoryUid;
    97  #endif	
    98 
    99 
   100 #if defined (__CENTREP_SERVER_PERFTEST__) || defined(SRVSUBSESS_TRACE) || defined(CENTREP_TRACE)
   101 // For testing purposes only
   102 public:
   103 	inline TUid RepositoryUid()
   104 	{
   105 	return iRepositoryUid;
   106 	}
   107 #endif
   108 	};
   109 
   110 
   111 #endif // SRVSUBSESS_H