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