1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/centralrepository/cenrepsrv/srvsubsess.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,111 @@
1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef SRVSUBSESS_H
1.20 +#define SRVSUBSESS_H
1.21 +
1.22 +#include <e32base.h>
1.23 +#include "shrepos.h"
1.24 +#include "srvrepos_noc.h"
1.25 +#include "clientrequest.h"
1.26 +#include "sessnotf.h"
1.27 +
1.28 +class CServerSession;
1.29 +class CSessionManager;
1.30 +
1.31 +class CServerSubSession : public CObject
1.32 + {
1.33 +friend class CServerSession;
1.34 +public:
1.35 + CServerSubSession(CServerSession* aSession);
1.36 + ~CServerSubSession();
1.37 + void ServiceError(TInt aError);
1.38 + TInt ServiceL(const RMessage2& aMessage);
1.39 +public:
1.40 + enum { KDontCompleteMessage = 1 };
1.41 +
1.42 +private:
1.43 + typedef TInt (CServerSubSession::*TServerFunc)(const TClientRequest&);
1.44 +
1.45 + TInt GeneralOperationsL(const TClientRequest& aMessage, TServerFunc aFunc);
1.46 + TInt ReadOperationsL(const TClientRequest& aMessage, TServerFunc aFunc);
1.47 + TInt WriteOperationsL(const TClientRequest& aMessage, TServerFunc aFunc);
1.48 + TInt ResetOperationsL(const TClientRequest& aMessage, TServerFunc aFunc);
1.49 +
1.50 + TInt InitialiseL(const TClientRequest& aMessage);
1.51 + TInt CreateIntL(const TClientRequest& aMessage);
1.52 + TInt CreateRealL(const TClientRequest& aMessage);
1.53 + TInt CreateStringL(const TClientRequest& aMessage);
1.54 + TInt DeleteL(const TClientRequest& aMessage);
1.55 + TInt DeleteRangeL(const TClientRequest& aMessage);
1.56 + TInt GetIntL(const TClientRequest& aMessage);
1.57 + TInt SetIntL(const TClientRequest& aMessage);
1.58 + TInt GetRealL(const TClientRequest& aMessage);
1.59 + TInt SetRealL(const TClientRequest& aMessage);
1.60 + TInt GetStringL(const TClientRequest& aMessage);
1.61 + TInt SetStringL(const TClientRequest& aMessage);
1.62 + TInt FindL(const TClientRequest& aMessage);
1.63 + TInt FindEqIntL(const TClientRequest& aMessage);
1.64 + TInt FindEqRealL(const TClientRequest& aMessage);
1.65 + TInt FindEqStringL(const TClientRequest& aMessage);
1.66 + TInt FindNeqIntL(const TClientRequest& aMessage);
1.67 + TInt FindNeqRealL(const TClientRequest& aMessage);
1.68 + TInt FindNeqStringL(const TClientRequest& aMessage);
1.69 + TInt GetFindResultL(const TClientRequest& aMessage);
1.70 + TInt NotifyRequestCheck(const TClientRequest& aMessage);
1.71 + TInt NotifyRequest(const TClientRequest& aMessage);
1.72 + TInt NotifyCancel(const TClientRequest& aMessage);
1.73 + TInt NotifyCancelAll(const TClientRequest& aMessage);
1.74 + TInt GroupNotifyRequest(const TClientRequest& aMessage);
1.75 + TInt GroupNotifyCancel(const TClientRequest& aMessage);
1.76 + TInt ResetL(const TClientRequest& aMessage);
1.77 + TInt ResetAllL(const TClientRequest& aMessage);
1.78 + TInt TransactionStart(const TClientRequest& aMessage);
1.79 + TInt TransactionCancel(const TClientRequest& aMessage);
1.80 + TInt TransactionCommitL(const TClientRequest& aMessage);
1.81 + TInt MoveL(const TClientRequest& aMessage) ;
1.82 + TInt TransactionStateL(const TClientRequest& aMessage);
1.83 + TInt TransactionFail(const TClientRequest& aMessage);
1.84 + TInt GetMeta(const TClientRequest& aMessage);
1.85 +
1.86 + template <class T> TInt FindValueL(const TClientRequest& aMessage, const T& aVal, TComparison aComparison=EEqual);
1.87 + inline CSessionManager* Server();
1.88 + TInt CheckPolicy(const TClientRequest& msg,const TSecurityPolicy& aPolicy,
1.89 + const char *aDiagnostic);
1.90 +
1.91 +private:
1.92 + CServerSession* iSession;
1.93 + CServerRepository iRepository;
1.94 + CSessionNotifier iNotifier;
1.95 + RArray<TUint32> iFindResult;
1.96 + TBool iInitialised;
1.97 +#if defined (__CENTREP_SERVER_PERFTEST__) || defined(SRVSUBSESS_TRACE) || defined(CENTREP_TRACE)
1.98 +
1.99 + TUid iRepositoryUid;
1.100 + #endif
1.101 +
1.102 +
1.103 +#if defined (__CENTREP_SERVER_PERFTEST__) || defined(SRVSUBSESS_TRACE) || defined(CENTREP_TRACE)
1.104 +// For testing purposes only
1.105 +public:
1.106 + inline TUid RepositoryUid()
1.107 + {
1.108 + return iRepositoryUid;
1.109 + }
1.110 +#endif
1.111 + };
1.112 +
1.113 +
1.114 +#endif // SRVSUBSESS_H