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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #include "srvrepos_noc.h"
22 #include "clientrequest.h"
26 class CSessionManager;
28 class CServerSubSession : public CObject
30 friend class CServerSession;
32 CServerSubSession(CServerSession* aSession);
34 void ServiceError(TInt aError);
35 TInt ServiceL(const RMessage2& aMessage);
37 enum { KDontCompleteMessage = 1 };
40 typedef TInt (CServerSubSession::*TServerFunc)(const TClientRequest&);
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);
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);
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);
89 CServerSession* iSession;
90 CServerRepository iRepository;
91 CSessionNotifier iNotifier;
92 RArray<TUint32> iFindResult;
94 #if defined (__CENTREP_SERVER_PERFTEST__) || defined(SRVSUBSESS_TRACE) || defined(CENTREP_TRACE)
100 #if defined (__CENTREP_SERVER_PERFTEST__) || defined(SRVSUBSESS_TRACE) || defined(CENTREP_TRACE)
101 // For testing purposes only
103 inline TUid RepositoryUid()
105 return iRepositoryUid;
111 #endif // SRVSUBSESS_H