|
1 // Copyright (c) 2007-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __PRIVACYSERVER_H__ |
|
17 #define __PRIVACYSERVER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <lbs/lbsloccommon.h> |
|
21 #include "lbsprivacyservermsgenums.h" |
|
22 |
|
23 class MPrivacyProtocol; |
|
24 class CPrivacyShutdown; |
|
25 |
|
26 |
|
27 /** |
|
28 CPrivacyServer |
|
29 */ |
|
30 class CPrivacyServer : public CPolicyServer |
|
31 { |
|
32 public: |
|
33 static CPrivacyServer* NewL(MPrivacyProtocol& aProtocol); |
|
34 ~CPrivacyServer(); |
|
35 |
|
36 // CPolicyServer methods: |
|
37 |
|
38 virtual CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const; |
|
39 |
|
40 void SetShutdownDelay(TInt32 aShutdownDelay); |
|
41 void SetMaxNetworkSessions(TInt aMaxNetworkSessions); |
|
42 |
|
43 void IncSessionCount(TLbsProxyApiType aApiType); |
|
44 void DecSessionCount(TLbsProxyApiType aApiType); |
|
45 TBool MaxSessionsReached(TLbsProxyApiType aApiType) const; |
|
46 |
|
47 protected: |
|
48 |
|
49 virtual CPolicyServer::TCustomResult CustomSecurityCheckL(const RMessage2 &aMsg, TInt &aAction, TSecurityInfo &aMissing); |
|
50 |
|
51 private: |
|
52 // Constructors |
|
53 void ConstructL(); |
|
54 CPrivacyServer(MPrivacyProtocol& aProtocol); |
|
55 |
|
56 /** Maintains a count of the number of active local sessions */ |
|
57 TInt iLocalSessionCount; |
|
58 |
|
59 /** Maintains a count of the number of active network sessions */ |
|
60 TInt iNetworkSessionCount; |
|
61 |
|
62 /** The maximum number of network sessions allowed */ |
|
63 TInt iMaxNetworkSessions; |
|
64 |
|
65 /** Interface to send privacy requests to */ |
|
66 MPrivacyProtocol& iProtocol; |
|
67 |
|
68 /** Timer used to shutdown LBS after the last session has finished */ |
|
69 CPrivacyShutdown* iShutdown; |
|
70 |
|
71 /** Time to wait after the last client disconnects before shutting down LBS */ |
|
72 TInt32 iShutdownDelay; |
|
73 |
|
74 }; |
|
75 |
|
76 #endif // __PRIVACYSERVER_H__ |