1 /* |
|
2 * Copyright (c) 2008-2009 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 the License "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: |
|
15 * Defines server-side classes which are used to implement the STS server. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @internalComponent |
|
23 @released |
|
24 */ |
|
25 |
|
26 |
|
27 #ifndef __STSSERVER_H__ |
|
28 #define __STSSERVER_H__ |
|
29 |
|
30 #include <f32file.h> |
|
31 #include <scs/scsserver.h> |
|
32 #include <usif/sts/stsdefs.h> |
|
33 #include "stscommon.h" |
|
34 #include "integrityservices.h" |
|
35 #include "transactionwrapper.h" |
|
36 |
|
37 namespace Usif |
|
38 { |
|
39 class CStsServerSession; |
|
40 |
|
41 class CStsServer : public CScsServer |
|
42 /** |
|
43 The CScsServer-derived object which is used to generate STS sessions for the STS clients. |
|
44 */ |
|
45 { |
|
46 friend class CStsServerSession; |
|
47 |
|
48 public: |
|
49 static CStsServer* NewLC(); |
|
50 |
|
51 ~CStsServer(); |
|
52 |
|
53 //Implement from CScsServer |
|
54 CScsSession* DoNewSessionL(const RMessage2& aMessage); |
|
55 |
|
56 //Transaction management functions |
|
57 CIntegrityServices* CreateTransactionL(); |
|
58 CIntegrityServices* AttachTransactionL(TStsTransactionId aTransactionID); |
|
59 void ReleaseTransactionL(CIntegrityServices* &aTransactionPtr, TBool aMarkAsCompleted=EFalse); |
|
60 void FinaliseTransactionL(CIntegrityServices* &aTransactionPtr); |
|
61 |
|
62 protected: |
|
63 CPolicyServer::TCustomResult CustomSecurityCheckL(const RMessage2& aMsg, TInt& aAction, TSecurityInfo& aMissing); |
|
64 |
|
65 private: |
|
66 CStsServer(); |
|
67 void ConstructL(); |
|
68 //Transaction management helper functions |
|
69 TInt FindActiveTransaction(TStsTransactionId aTransactionID); |
|
70 TStsTransactionId CreateTransactionID(); |
|
71 TBool IsExistingTransaction(TStsTransactionId aTransactionID); |
|
72 |
|
73 //custom security check |
|
74 TBool CheckIfFileModificationAllowedL(const RMessage2& aMsg); |
|
75 |
|
76 //rolls back all pending transactions |
|
77 void RollBackAllPendingL(); |
|
78 |
|
79 private: |
|
80 // RFs iFs; |
|
81 RPointerArray<CReferenceCountedTransactionWrapper> iTransactionWrapperContainer; |
|
82 }; //End of class CStsServer |
|
83 |
|
84 } // End of namespace USIF |
|
85 #endif |
|