|
1 |
|
2 // Copyright (c) 2007-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 "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 // policycheckrequestqueue.h |
|
16 // This file provides the interface for the policy check request |
|
17 // queue and its associated elements. |
|
18 // @internalComponent |
|
19 // @prototype |
|
20 // |
|
21 // |
|
22 |
|
23 #ifndef NETUPS_PCR_QUEUE_H |
|
24 #define NETUPS_PCR_QUEUE_H |
|
25 |
|
26 #include <e32base.h> // defines CBase, CActive |
|
27 #include <e32std.h> // defines TSglQueLink |
|
28 |
|
29 #include "netupstypes.h" |
|
30 |
|
31 #include <comms-infras/commsdebugutility.h> // defines the comms debug logging utility |
|
32 |
|
33 namespace NetUps |
|
34 { |
|
35 class CSubSession; |
|
36 class MPolicyCheckRequestOriginator; |
|
37 |
|
38 NONSHARABLE_CLASS (CPolicyCheckRequestData) : public CBase |
|
39 { |
|
40 public: |
|
41 static CPolicyCheckRequestData* NewL(const TPolicyCheckRequestData& PolicyCheckRequestData); |
|
42 ~CPolicyCheckRequestData(); |
|
43 private: |
|
44 void ConstructL(const TDesC& aDestinationName, |
|
45 const TDesC& aAccessPointName); |
|
46 |
|
47 CPolicyCheckRequestData(const TPolicyCheckRequestData& aPolicyCheckRequestData) : |
|
48 iProcessId(aPolicyCheckRequestData.iProcessId), |
|
49 iThreadId(aPolicyCheckRequestData.iThreadId), |
|
50 iServiceId(aPolicyCheckRequestData.iServiceId), |
|
51 iPlatSecCheckResult(aPolicyCheckRequestData.iPlatSecCheckResult), |
|
52 iCommsId(aPolicyCheckRequestData.iCommsId), |
|
53 iPolicyCheckRequestOriginator(aPolicyCheckRequestData.iPolicyCheckRequestOriginator) |
|
54 { |
|
55 } |
|
56 public: |
|
57 TProcessId iProcessId; |
|
58 TThreadId iThreadId; |
|
59 TInt32 iServiceId; |
|
60 TBool iPlatSecCheckResult; |
|
61 RBuf iDestinationName; |
|
62 RBuf iAccessPointName; |
|
63 Messages::TNodeId iCommsId; |
|
64 MPolicyCheckRequestOriginator& iPolicyCheckRequestOriginator; |
|
65 private: |
|
66 __FLOG_DECLARATION_MEMBER; |
|
67 }; |
|
68 |
|
69 NONSHARABLE_CLASS (CQueuedPolicyCheckRequest) : public CBase |
|
70 { |
|
71 friend class CPolicyCheckRequestQueue; // needs iLink |
|
72 public: |
|
73 static CQueuedPolicyCheckRequest* NewL(const TPolicyCheckRequestData& aPolicyCheckRequestData, const TRequestId& aRequestId); |
|
74 ~CQueuedPolicyCheckRequest(); |
|
75 CPolicyCheckRequestData& PolicyCheckRequestData() { return *iPolicyCheckRequestData; } |
|
76 const TRequestId& RequestId(); |
|
77 private: |
|
78 void ConstructL(const TPolicyCheckRequestData& PolicyCheckRequestData); |
|
79 CQueuedPolicyCheckRequest(const TRequestId& aRequestId); |
|
80 private: |
|
81 TRequestId iRequestId; |
|
82 CPolicyCheckRequestData* iPolicyCheckRequestData; |
|
83 TSglQueLink iLink; |
|
84 }; |
|
85 |
|
86 NONSHARABLE_CLASS (CPolicyCheckRequestQueue) : public CBase |
|
87 { |
|
88 public: |
|
89 static CPolicyCheckRequestQueue* NewL(CSubSession&); |
|
90 ~CPolicyCheckRequestQueue(); |
|
91 |
|
92 TBool IsEmpty() const; |
|
93 CPolicyCheckRequestData& GetNextRequest(); // used by the subSession to get 1st entry on queue. |
|
94 void DeleteCurrentEntry(); |
|
95 |
|
96 TBool OutStandingRequestToProcess(); // used by the subSession to get entries other than the 1st entry in order |
|
97 // to reply outstanding requests when entering a Session State |
|
98 // (other than 1st entry for which are reply has already been received from the UPS Server). |
|
99 CPolicyCheckRequestData& GetOutStandingRequestToProcess(); |
|
100 void DeleteOutStandingRequest(); |
|
101 |
|
102 void SendRequestL(const TPolicyCheckRequestData& aPolicyCheckRequestData, const TRequestId& aRequestId); |
|
103 TInt CancelRequest(const Messages::TNodeId& aCommsId, const TRequestId& aRequestId); |
|
104 void CancelAllRequests(TInt aError); |
|
105 private: |
|
106 void ConstructL(); |
|
107 void DoCancel(); |
|
108 CPolicyCheckRequestQueue(CSubSession& aSubsession); |
|
109 |
|
110 void PostFirstRequestOnQueueToUpsServer(); |
|
111 private: |
|
112 TSglQue<CQueuedPolicyCheckRequest> iRequestQueue; |
|
113 CSubSession& iSubSession; |
|
114 |
|
115 __FLOG_DECLARATION_MEMBER; |
|
116 }; |
|
117 |
|
118 } // end namespace NetUps |
|
119 |
|
120 #endif // NETUPS_PCR_QUEUE_H |