author | hgs |
Fri, 15 Oct 2010 12:09:28 +0530 | |
changeset 24 | 65456528cac2 |
parent 23 | d4d56f5e7c55 |
permissions | -rw-r--r-- |
0
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: This application is to monitor Harvester and Search Server |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
#include "CWDmonitor.h" |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#include "CWDTimer.h" |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#include <HarvesterServerLogger.h> |
16 | 21 |
#include <centralrepository.h> |
22 |
#include <cpixwatchdogcommon.h> |
|
23 |
#include "centrepmonitor.h" |
|
23 | 24 |
#include "servermonitor.h" |
1
6f2c1c46032b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
25 |
#include "OstTraceDefinitions.h" |
6f2c1c46032b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
26 |
#ifdef OST_TRACE_COMPILER_IN_USE |
6f2c1c46032b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
27 |
#include "cwdmonitorTraces.h" |
6f2c1c46032b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
28 |
#endif |
6f2c1c46032b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
29 |
|
0
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
// ----------------------------------------------------------------------------- |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
// CWDMonitor::NewL |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
// ----------------------------------------------------------------------------- |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
// |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
CWDMonitor* CWDMonitor::NewL( ) |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
{ |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
CWDMonitor* self = CWDMonitor::NewLC( ); |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
CleanupStack::Pop(); |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
return self; |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
} |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
// ----------------------------------------------------------------------------- |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
// CWDMonitor::NewLC |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
// ----------------------------------------------------------------------------- |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
// |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
CWDMonitor* CWDMonitor::NewLC( ) |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
{ |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
CWDMonitor* self = new ( ELeave ) CWDMonitor( ); |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
CleanupStack::PushL( self ); |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
self->ConstructL(); |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
return self; |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
} |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
|
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
// ----------------------------------------------------------------------------- |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
// CWDMonitor::~CWDMonitor() |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
// ----------------------------------------------------------------------------- |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
// |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
CWDMonitor::~CWDMonitor() |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
{ |
16 | 58 |
delete iHSName; |
59 |
delete iSSName; |
|
0
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
delete iWDTimer; |
23 | 61 |
delete aHSStatusMonitor; |
62 |
delete aSSStatusMonitor; |
|
63 |
delete aHSUidMonitor; |
|
64 |
delete aSSUidMonitor; |
|
65 |
delete aHSNameMonitor; |
|
66 |
delete aSSNameMonitor; |
|
67 |
delete iHarvesterMonitor; |
|
68 |
delete iSearchMonitor; |
|
0
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
} |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
|
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
71 |
// ----------------------------------------------------------------------------- |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
// CWDMonitor::CWDMonitor() |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
// ----------------------------------------------------------------------------- |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
// |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
CWDMonitor::CWDMonitor( ) |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
{ |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
77 |
} |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
|
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
// ----------------------------------------------------------------------------- |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
80 |
// CWDMonitor::ConstructL() |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
// ----------------------------------------------------------------------------- |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
// |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
void CWDMonitor::ConstructL() |
16 | 84 |
{ |
85 |
CRepository* wdrepo = CRepository::NewL( KWDrepoUidMenu ); |
|
86 |
wdrepo->Get( KHarvesterServerKey , iAllowHS ); |
|
87 |
wdrepo->Get( KSearchServerKey , iAllowSS ); |
|
88 |
||
89 |
//get the UID's of the servers |
|
90 |
TBuf<KCenrepUidLength> temp; |
|
91 |
TInt64 value; |
|
92 |
TLex uidvalue; |
|
93 |
//Read Harvester server UId value |
|
94 |
if ( KErrNone == wdrepo->Get( KHarvesterServerUIDKey, temp ) ) |
|
95 |
{ |
|
96 |
uidvalue.Assign(temp); |
|
97 |
if (KErrNone == uidvalue.Val( value,EHex )) |
|
98 |
iHSUid.iUid = value; |
|
99 |
} |
|
100 |
//Read Search server Uid value |
|
101 |
if ( KErrNone == wdrepo->Get( KSearchServerUIDKey, temp )) |
|
102 |
{ |
|
103 |
uidvalue.Assign(temp); |
|
104 |
if (KErrNone == uidvalue.Val( value,EHex )) |
|
105 |
iSSUid.iUid = value; |
|
106 |
} |
|
107 |
||
108 |
//Read Harvester server Name |
|
109 |
if ( KErrNone == wdrepo->Get( KHarvesterServerNAMEKey, temp )) |
|
110 |
{ |
|
111 |
iHSName = HBufC::NewL( temp.Length() ); |
|
112 |
TPtr hsname = iHSName->Des(); |
|
113 |
hsname.Copy( temp ); |
|
114 |
} |
|
115 |
//Read Search server Name |
|
116 |
if ( KErrNone == wdrepo->Get( KSearchServerNAMEKey, temp )) |
|
117 |
{ |
|
118 |
iSSName = HBufC::NewL( temp.Length() ); |
|
119 |
TPtr ssname = iSSName->Des(); |
|
120 |
ssname.Copy( temp ); |
|
121 |
} |
|
122 |
delete wdrepo; |
|
123 |
if ( iAllowHS || iAllowSS ) |
|
124 |
iWDTimer = CWDTimer::NewL( this ); |
|
125 |
||
23 | 126 |
aHSStatusMonitor = CentrepMonitor::NewL( this, KHarvesterServerKey); |
127 |
aHSStatusMonitor->StartNotifier(); |
|
128 |
aSSStatusMonitor = CentrepMonitor::NewL( this, KSearchServerKey); |
|
129 |
aSSStatusMonitor->StartNotifier(); |
|
130 |
aHSUidMonitor = CentrepMonitor::NewL( this, KHarvesterServerUIDKey); |
|
131 |
aHSUidMonitor->StartNotifier(); |
|
132 |
aSSUidMonitor = CentrepMonitor::NewL( this, KSearchServerUIDKey); |
|
133 |
aSSUidMonitor->StartNotifier(); |
|
134 |
aHSNameMonitor = CentrepMonitor::NewL( this, KHarvesterServerNAMEKey); |
|
135 |
aHSNameMonitor->StartNotifier(); |
|
136 |
aSSNameMonitor = CentrepMonitor::NewL( this, KSearchServerNAMEKey); |
|
137 |
aSSNameMonitor->StartNotifier(); |
|
138 |
||
0
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
139 |
} |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
|
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
141 |
// ----------------------------------------------------------------------------- |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
142 |
// CWDMonitor::StartMonitor() |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
143 |
// ----------------------------------------------------------------------------- |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
144 |
// |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
145 |
void CWDMonitor::HandleWDTimerL() |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
146 |
{ |
1
6f2c1c46032b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
147 |
OstTrace0( TRACE_NORMAL, CWDMONITOR_HANDLEWDTIMERL, "CWDMonitor::HandleWDTimerL(): Check the servers" ); |
0
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
148 |
CPIXLOGSTRING("CWDMonitor::HandleWDTimerL(): Check the servers"); |
23 | 149 |
|
150 |
if ( !iHarvesterMonitor ) |
|
0
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
151 |
{ |
23 | 152 |
if ( iAllowHS ) |
153 |
iHarvesterMonitor = CServerMonitor::NewL( *iHSName , iHSUid ); |
|
154 |
iWDTimer->StartWDTimer(); |
|
155 |
return; |
|
0
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
} |
23 | 157 |
if ( iAllowSS ) |
158 |
iSearchMonitor = CServerMonitor::NewL( *iSSName , iSSUid ); |
|
0
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
159 |
return; |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
} |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
161 |
// ----------------------------------------------------------------------------- |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
162 |
// CWDMonitor::StartMonitor() |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
// ----------------------------------------------------------------------------- |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
// |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
void CWDMonitor::StartMonitor() |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
166 |
{ |
1
6f2c1c46032b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
167 |
OstTraceFunctionEntry0( CWDMONITOR_STARTMONITOR_ENTRY ); |
0
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
168 |
CPIXLOGSTRING("CWDMonitor::StartMonitor(): Entered"); |
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
169 |
iWDTimer->StartWDTimer(); |
1
6f2c1c46032b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
170 |
OstTraceFunctionExit0( CWDMONITOR_STARTMONITOR_EXIT ); |
0
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
171 |
} |
16 | 172 |
// ----------------------------------------------------------------------------- |
173 |
// CWDMonitor::HandlecentrepL() |
|
174 |
// ----------------------------------------------------------------------------- |
|
175 |
// |
|
176 |
void CWDMonitor::HandlecentrepL( TUint32 aKey ) |
|
177 |
{ |
|
178 |
CRepository* wdrepo = CRepository::NewL( KWDrepoUidMenu ); |
|
179 |
if ( KHarvesterServerKey == aKey ) |
|
180 |
{ |
|
181 |
// get the harvester server status |
|
23 | 182 |
wdrepo->Get( KHarvesterServerKey , iAllowHS ); |
183 |
||
184 |
if ( iAllowHS ) |
|
185 |
{ |
|
186 |
//start the Harvester server and start monitoring |
|
187 |
iHarvesterMonitor = CServerMonitor::NewL( *iHSName , iHSUid ); |
|
188 |
} |
|
189 |
else{ |
|
190 |
// Shutdown the harvester server |
|
191 |
iHarvesterMonitor->Cancel(); |
|
192 |
iHarvesterMonitor->ShutdownServer(); |
|
193 |
delete iHarvesterMonitor; |
|
194 |
iHarvesterMonitor = NULL; |
|
195 |
} |
|
16 | 196 |
} |
197 |
else if ( KSearchServerKey == aKey ) |
|
198 |
{ |
|
199 |
// get the Search server status |
|
23 | 200 |
wdrepo->Get( KSearchServerKey , iAllowSS ); |
201 |
||
202 |
if ( iAllowSS ) |
|
203 |
{ |
|
204 |
//Start the Search server and start monitoring |
|
205 |
iSearchMonitor = CServerMonitor::NewL( *iSSName , iSSUid ); |
|
206 |
} |
|
207 |
else |
|
208 |
{ |
|
209 |
//Shutdown the searchserver |
|
210 |
iSearchMonitor->Cancel(); |
|
211 |
iSearchMonitor->ShutdownServer(); |
|
212 |
delete iSearchMonitor; |
|
213 |
iSearchMonitor = NULL; |
|
214 |
} |
|
215 |
} |
|
216 |
else if ( (KHarvesterServerUIDKey == aKey)||( KHarvesterServerNAMEKey == aKey ) ) |
|
217 |
{ |
|
218 |
// Shutdown the existing server |
|
219 |
iHarvesterMonitor->Cancel(); |
|
220 |
iHarvesterMonitor->ShutdownServer(); |
|
221 |
delete iHarvesterMonitor; |
|
222 |
iHarvesterMonitor = NULL; |
|
223 |
//read the new values |
|
224 |
TBuf<KCenrepUidLength> temp; |
|
225 |
TInt64 value; |
|
226 |
TLex uidvalue; |
|
227 |
if ( KHarvesterServerUIDKey == aKey ) |
|
228 |
{ |
|
229 |
//Read Harvester server UId value |
|
230 |
if ( KErrNone == wdrepo->Get( KHarvesterServerUIDKey, temp ) ) |
|
231 |
{ |
|
232 |
uidvalue.Assign(temp); |
|
233 |
if (KErrNone == uidvalue.Val( value,EHex )) |
|
234 |
iHSUid.iUid = value; |
|
235 |
} |
|
236 |
} |
|
237 |
else |
|
238 |
{ |
|
239 |
//read harvester server name |
|
240 |
delete iHSName; |
|
24 | 241 |
iHSName = NULL; |
23 | 242 |
if ( KErrNone == wdrepo->Get( KHarvesterServerNAMEKey, temp )) |
243 |
{ |
|
244 |
iHSName = HBufC::NewL( temp.Length() ); |
|
245 |
TPtr hsname = iHSName->Des(); |
|
246 |
hsname.Copy( temp ); |
|
247 |
} |
|
248 |
} |
|
249 |
// Start the server with new values |
|
250 |
iHarvesterMonitor = CServerMonitor::NewL( *iHSName , iHSUid ); |
|
251 |
} |
|
252 |
else if ( (KSearchServerUIDKey == aKey)||( KSearchServerNAMEKey == aKey ) ) |
|
253 |
{ |
|
254 |
// Shutdown the existing server |
|
255 |
iSearchMonitor->Cancel(); |
|
256 |
iSearchMonitor->ShutdownServer(); |
|
257 |
delete iSearchMonitor; |
|
258 |
iSearchMonitor = NULL; |
|
259 |
//read the new values |
|
260 |
TBuf<KCenrepUidLength> temp; |
|
261 |
TInt64 value; |
|
262 |
TLex uidvalue; |
|
263 |
if ( KSearchServerUIDKey == aKey ) |
|
264 |
{ |
|
265 |
//read search server uid |
|
266 |
if ( KErrNone == wdrepo->Get( KSearchServerUIDKey, temp ) ) |
|
267 |
{ |
|
268 |
uidvalue.Assign(temp); |
|
269 |
if (KErrNone == uidvalue.Val( value,EHex )) |
|
270 |
iSSUid.iUid = value; |
|
271 |
} |
|
272 |
} |
|
273 |
else |
|
274 |
{ |
|
275 |
//read search server name |
|
276 |
delete iSSName; |
|
24 | 277 |
iSSName = NULL; |
23 | 278 |
if ( KErrNone == wdrepo->Get( KSearchServerNAMEKey, temp )) |
279 |
{ |
|
280 |
iSSName = HBufC::NewL( temp.Length() ); |
|
281 |
TPtr ssname = iSSName->Des(); |
|
282 |
ssname.Copy( temp ); |
|
283 |
} |
|
284 |
} |
|
285 |
// Start the server with new values |
|
286 |
iSearchMonitor = CServerMonitor::NewL( *iSSName , iSSUid ); |
|
16 | 287 |
} |
288 |
delete wdrepo; |
|
289 |
} |
|
0
671dee74050a
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
290 |
//End of file |