|
1 // Copyright (c) 2008-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 // cmdnsconsistencymgr.cpp |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef CMDNSCACHECONSISTENCYMGR_H_ |
|
19 #define CMDNSCACHECONSISTENCYMGR_H_ |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <mdns/mdnscachemgr.h> |
|
23 #include <mdns/ccacheentry.h> |
|
24 #include <mdns/cdnsmessage.h> |
|
25 #include "mmessagehandler.h" |
|
26 #include "mdnsdebug.h" |
|
27 |
|
28 const TUint KDefaultCheckInterval = 10;//*60; // TODO:Change to 60 seconds for practical purposes |
|
29 //#include "cmessagehandler.h" |
|
30 class CMessageHandler; |
|
31 class CMDNSCacheConsistencyMgr : public CActive,public MMessageHandler |
|
32 { |
|
33 public: |
|
34 |
|
35 static CMDNSCacheConsistencyMgr* NewL(TBool aActiveCacheMgmtEnabled,CMessageHandler& aMessageHandler); |
|
36 static CMDNSCacheConsistencyMgr* NewLC(TBool aActiveCacheMgmtEnabled,CMessageHandler& aMessageHandler); |
|
37 |
|
38 //From MMessageHandler |
|
39 void OnPacketSendL(TInt aError); |
|
40 |
|
41 void Start(TUint aWalkInterval = KDefaultCheckInterval); |
|
42 |
|
43 void Stop(); |
|
44 |
|
45 ~CMDNSCacheConsistencyMgr(); |
|
46 void DoCancel(); |
|
47 |
|
48 private: |
|
49 |
|
50 void RunL(); |
|
51 TInt RunError(TInt aError); |
|
52 |
|
53 void IterateCacheL(); |
|
54 void DeleteEntry(CCacheEntry* aEntry); |
|
55 void Query(CCacheEntry* aEntry); |
|
56 const TDesC8& GetHostName(CCacheEntry* aEntry); |
|
57 const TDesC8& GetServiceName(CCacheEntry* aEntry); |
|
58 |
|
59 void Delay(TRequestStatus& status); |
|
60 |
|
61 private: |
|
62 |
|
63 CMDNSCacheConsistencyMgr(TBool aActiveCacheMgmtEnabled,CMessageHandler& aMessageHandler); |
|
64 void ConstructL(); |
|
65 |
|
66 private: |
|
67 |
|
68 //MDNSCacheMgr& iCache; |
|
69 |
|
70 TBool iActiveCacheMgmtEnabled; |
|
71 |
|
72 CMessageHandler& iMessageHandler; |
|
73 |
|
74 TUint iWalkInterval; |
|
75 |
|
76 RTimer iTimer; |
|
77 |
|
78 /** |
|
79 FLOGGER debug trace member variable. |
|
80 */ |
|
81 __FLOG_DECLARATION_MEMBER_MUTABLE; |
|
82 |
|
83 }; |
|
84 |
|
85 |
|
86 #endif /*CMDNSCACHECONSISTENCYMGR_H_*/ |