|
1 // Copyright (c) 2005-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 /** |
|
17 @file |
|
18 */ |
|
19 |
|
20 #define SYMBIAN_NETWORKING_UPS |
|
21 |
|
22 #include <comms-infras/ss_log.h> |
|
23 #include <comms-infras/api_ext_msg.h> |
|
24 #include <es_ini.h> |
|
25 #include <ss_glob.h> |
|
26 #include <comms-infras/ss_metaconnprov_internal.h> |
|
27 #include <comms-infras/ss_connselect.h> |
|
28 #include <comms-infras/ss_tiermanager.h> |
|
29 #include <comms-infras/ss_tiermanagerutils.h> |
|
30 #include <comms-infras/ss_tiermanager_internal.h> |
|
31 #include <comms-infras/ss_protcfgldr.h> |
|
32 #include <commsdattypesv1_1.h> // CommsDat |
|
33 |
|
34 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
35 #include <commsdattypesv1_1_partner.h> |
|
36 #include <commsdattypesv1_1_internal.h> |
|
37 #endif |
|
38 |
|
39 #ifdef _DEBUG |
|
40 // Panic category for "absolutely impossible!" vanilla ASSERT()-type panics from this module |
|
41 // (if it could happen through user error then you should give it an explicit, documented, category + code) |
|
42 _LIT(KSpecAssert_ESockSSocksmtcnp, "ESockSSocksmtcnp"); |
|
43 #endif |
|
44 |
|
45 using namespace ESock; |
|
46 using namespace CommsDat; |
|
47 using namespace Messages; |
|
48 using namespace Factories; |
|
49 |
|
50 // |
|
51 //CConfigAccessPointConfig |
|
52 EXPORT_START_ATTRIBUTE_TABLE_AND_FN(CConfigAccessPointConfig, CConfigAccessPointConfig::EUid, CConfigAccessPointConfig::ETypeId) |
|
53 END_ATTRIBUTE_TABLE() |
|
54 |
|
55 EXPORT_C CConfigAccessPointConfig* CConfigAccessPointConfig::NewL() |
|
56 { |
|
57 return new(ELeave) CConfigAccessPointConfig(); |
|
58 } |
|
59 |
|
60 EXPORT_C CConfigAccessPointConfig::~CConfigAccessPointConfig() |
|
61 { |
|
62 iLayers.Close(); |
|
63 iSCprs.Close(); |
|
64 } |
|
65 |
|
66 EXPORT_C void CConfigAccessPointConfig::AppendLayerL(const TConfigAccessPointLayer& aLayer) |
|
67 { |
|
68 for (TUint i = 0; i < iLayers.Count(); i++) |
|
69 if (iLayers[i].Id() == aLayer.Id()) |
|
70 return; |
|
71 |
|
72 iLayers.AppendL(aLayer); |
|
73 } |
|
74 |
|
75 EXPORT_C TBool CConfigAccessPointConfig::LayerExists(const TConfigAccessPointLayer& aLayer) const |
|
76 { |
|
77 for (TUint i = 0; i < iLayers.Count(); i++) |
|
78 if (iLayers[i].Id() == aLayer.Id()) |
|
79 return ETrue; |
|
80 |
|
81 return EFalse; |
|
82 } |
|
83 |
|
84 EXPORT_C void CConfigAccessPointConfig::GetTopLayersL(TUid aSCprUid, RPointerArray<TConfigAccessPointLayer>& aTopLayers) const |
|
85 { |
|
86 for (TUint i = 0; i < iLayers.Count(); i++) |
|
87 { |
|
88 if (iLayers[i].SCprUid() == aSCprUid && iLayers[i].TopLevel()) |
|
89 aTopLayers.AppendL(&iLayers[i]); |
|
90 } |
|
91 } |
|
92 |
|
93 EXPORT_C const TConfigAccessPointLayer& CConfigAccessPointConfig::GetLayerL(TUint aId) const |
|
94 { |
|
95 for (TUint i = 0; i < iLayers.Count(); i++) |
|
96 if (iLayers[i].Id() == aId) |
|
97 return iLayers[i]; |
|
98 |
|
99 User::Leave(KErrNotFound); |
|
100 |
|
101 return iLayers[0]; // this will never be reached. |
|
102 } |
|
103 |
|
104 EXPORT_C TUint CConfigAccessPointConfig::GetLayerCount() const |
|
105 { |
|
106 return iLayers.Count(); |
|
107 } |
|
108 |
|
109 EXPORT_C void CConfigAccessPointConfig::AppendSCprL(const TUid& aUid) |
|
110 { |
|
111 if (iSCprs.Find(aUid) == KErrNotFound) |
|
112 iSCprs.AppendL(aUid); |
|
113 } |
|
114 |
|
115 EXPORT_C const RArray<TUid>& CConfigAccessPointConfig::SCprs() const |
|
116 { |
|
117 return iSCprs; |
|
118 } |
|
119 |
|
120 // |
|
121 //CMetaConnectionProviderBase |
|
122 EXPORT_C CMetaConnectionProviderBase::CMetaConnectionProviderBase(CMetaConnectionProviderFactoryBase& aFactory, |
|
123 const TProviderInfo& aProviderInfo, |
|
124 const MeshMachine::TNodeActivityMap& aActivityMap) |
|
125 : CMMCommsProviderBase( aFactory,aActivityMap ), |
|
126 iProviderInfo(aProviderInfo), |
|
127 iBlockingDestroy(0) |
|
128 /** |
|
129 Constructor for CMetaConnectionProviderBase |
|
130 @param aFactory Parent container for the provider |
|
131 */ |
|
132 { |
|
133 LOG(ESockLog::Printf(KESockMetaConnectionTag, _L("CMetaConnectionProviderBase %08x:\tcreated [%d], factory Uid %08x"), |
|
134 this, sizeof(CMetaConnectionProviderBase), Factory().Uid().iUid)); |
|
135 } |
|
136 |
|
137 EXPORT_C CMetaConnectionProviderBase::~CMetaConnectionProviderBase() |
|
138 /** |
|
139 Destructor for CMetaConnectionProviderBase. |
|
140 Once constructed, a meta-CPR should only be destroyed when absolutely not needed any more. It should be the last |
|
141 thing to die and therefore doesn't need to tell anyone about it. |
|
142 */ |
|
143 { |
|
144 if (iTierManager) |
|
145 { |
|
146 iTierManager->RemoveMetaConnectionProvider(this); |
|
147 } |
|
148 |
|
149 iAccessPointConfig.Close(); |
|
150 } |
|
151 |
|
152 EXPORT_C const TProviderInfo& CMetaConnectionProviderBase::ProviderInfo() const |
|
153 /** Get the connection information |
|
154 |
|
155 @return Const reference to a descriptor with the connection information */ |
|
156 { |
|
157 return iProviderInfo; |
|
158 } |
|
159 |
|
160 EXPORT_C void CMetaConnectionProviderBase::SetProviderInfo(const TProviderInfo& aProviderInfo) |
|
161 { |
|
162 iProviderInfo = aProviderInfo; |
|
163 } |
|
164 |
|
165 //This fn could be optimised |
|
166 EXPORT_C void CMetaConnectionProviderBase::ConstructL() |
|
167 { |
|
168 CMMCommsProviderBase::ConstructL(); |
|
169 |
|
170 RMetaExtensionContainer mec; |
|
171 mec.Open(); |
|
172 CleanupClosePushL(mec); |
|
173 |
|
174 TProviderInfoExt* providerInfo = new TProviderInfoExt(iProviderInfo); |
|
175 CleanupStack::PushL(providerInfo); |
|
176 mec.AppendExtensionL(providerInfo); |
|
177 CleanupStack::Pop(providerInfo); |
|
178 |
|
179 iAccessPointConfig.Close(); |
|
180 iAccessPointConfig.Open(mec); |
|
181 CleanupStack::PopAndDestroy(&mec); |
|
182 |
|
183 SetAccessPointConfigL(); |
|
184 } |
|
185 |
|
186 EXPORT_C RNodeInterface* CMetaConnectionProviderBase::NewClientInterfaceL(const TClientType& aClientType, TAny* aClientInfo) |
|
187 { |
|
188 if (aClientType.Type() & TCFClientType::EServProvider) |
|
189 { |
|
190 //For all service providers, use the RMetaServiceProviderInterface (==RNodeAvailabilityProviderInterface) |
|
191 __ASSERT_DEBUG(aClientInfo, User::Panic(KSpecAssert_ESockSSocksmtcnp, 1)); |
|
192 const TProviderInfo* pi = static_cast<const TProviderInfo*>(aClientInfo); |
|
193 return new (ELeave) RMetaServiceProviderInterface(*pi); |
|
194 } |
|
195 else if (aClientType.Flags() & TCFClientType::EAvailabilityProvider) |
|
196 { |
|
197 //For all other types that use the EAvailabilityProvider flag use RNodeAvailabilityProviderInterface |
|
198 return new (ELeave) RNodeAvailabilityProviderInterface(); |
|
199 } |
|
200 else if (aClientType.Type() & TCFClientType::EData) //Assume that data client can't be availability provider |
|
201 { |
|
202 TUint priority = KMaxTUint; |
|
203 return new (ELeave) RCFNodePriorityInterface(priority); |
|
204 } |
|
205 else |
|
206 { |
|
207 return MeshMachine::AMMNodeBase::NewClientInterfaceL(aClientType, aClientInfo); |
|
208 } |
|
209 } |
|
210 |
|
211 EXPORT_C RMetaServiceProviderInterface* CMetaConnectionProviderBase::FindServiceProvider(TUint aAccessPoint) |
|
212 { |
|
213 __ASSERT_DEBUG(aAccessPoint, User::Panic(KSpecAssert_ESockSSocksmtcnp, 2)); //??? |
|
214 |
|
215 TClientIter<TDefaultClientMatchPolicy> iter = GetClientIter<TDefaultClientMatchPolicy>(TClientType(TCFClientType::EServProvider)); |
|
216 RMetaServiceProviderInterface* serviceProvider; |
|
217 while ((serviceProvider = static_cast<RMetaServiceProviderInterface*>(iter++)) != NULL) |
|
218 { |
|
219 TUint ap = serviceProvider->ProviderInfo().APId(); |
|
220 if (ap == aAccessPoint) |
|
221 { |
|
222 return serviceProvider; |
|
223 } |
|
224 } |
|
225 |
|
226 return NULL; |
|
227 } |
|
228 |
|
229 EXPORT_C void CMetaConnectionProviderBase::SetTierManagerL(CTierManagerBase* aTierManager) |
|
230 { |
|
231 //ASSERT(iTierManager==NULL); //This function should be called only once. |
|
232 if (iTierManager!=aTierManager) |
|
233 { |
|
234 aTierManager->AddMetaConnectionProviderL(this); |
|
235 // Save aTierMaanger pointer only after AddMetaConnectionProviderL. |
|
236 // If it was not possible to add this MCPR to TM due to OOM, then we do not need TM pointer also. |
|
237 iTierManager = aTierManager; |
|
238 } |
|
239 } |
|
240 |
|
241 void CMetaConnectionProviderBase::SetAccessPointConfigL() |
|
242 { |
|
243 LOG( ESockLog::Printf(KESockMetaConnectionTag, _L("CMetaConnectionProviderBase %08x:\tSetAccessPointConfigL() - loading access point record"), this) ); |
|
244 |
|
245 CMDBSession* dbs = CMDBSession::NewLC(KCDVersion1_2); |
|
246 CCDAccessPointRecord* apRec = TierManagerUtils::LoadAccessPointRecordL(iProviderInfo.APId(1/*dummy for the overload*/),*dbs); |
|
247 |
|
248 CleanupStack::PushL(apRec); |
|
249 |
|
250 LOG( ESockLog::Printf(KESockMetaConnectionTag, _L("\t\t\tTier=%d Mcpr=%d SelPol=%d Cpr=%d CprCfg=%d Scpr=%d Proto=%d AppSID=%d Priority=%d"), |
|
251 static_cast<TUint32>(apRec->iTier), |
|
252 static_cast<TUint32>(apRec->iMCpr), |
|
253 static_cast<TUint32>(apRec->iSelectionPolicy), |
|
254 static_cast<TUint32>(apRec->iCpr), |
|
255 static_cast<TUint32>(apRec->iCprConfig), |
|
256 static_cast<TUint32>(apRec->iSCpr), |
|
257 static_cast<TUint32>(apRec->iProtocol), |
|
258 static_cast<TUint32>(apRec->iAppSID), |
|
259 static_cast<TUint32>(apRec->iPriority) ) ); |
|
260 CCDTierRecord* tierRec = TierManagerUtils::LoadTierRecordL(apRec->iTier,*dbs); |
|
261 TInt tempTierId = tierRec->iRecordTag; |
|
262 delete tierRec; |
|
263 tierRec = NULL; |
|
264 |
|
265 TUid tierId = TUid::Uid(tempTierId); |
|
266 |
|
267 User::LeaveIfError((tierId==iProviderInfo.TierId())? KErrNone : KErrArgument); |
|
268 |
|
269 TUint selectionPolicy = apRec->iSelectionPolicy; |
|
270 TUint cprConfig = apRec->iCprConfig; |
|
271 TUint apPriority = (apRec->iPriority.IsNull()) ? KMaxTUint : (TUint)apRec->iPriority; |
|
272 if(apPriority == 0) |
|
273 { |
|
274 LOG(ESockLog::Printf(KESockMetaConnectionTag, _L("Error: Invalid priority value (%d) stored in access point record."),apPriority)); |
|
275 User::Leave(KErrArgument); |
|
276 } |
|
277 |
|
278 CCDMCprRecord* mcprRec = TierManagerUtils::LoadMCprRecordL(apRec->iMCpr,*dbs); |
|
279 TUint mCprUid = mcprRec->iMCprUid; |
|
280 delete mcprRec; |
|
281 mcprRec = NULL; |
|
282 |
|
283 CCDCprRecord* cprRec = TierManagerUtils::LoadCprRecordL(apRec->iCpr,*dbs); |
|
284 TUint cprUid = cprRec->iCprUid; |
|
285 delete cprRec; |
|
286 cprRec = NULL; |
|
287 |
|
288 CCDSCprRecord* scprRec = TierManagerUtils::LoadSCprRecordL(apRec->iSCpr,*dbs); |
|
289 TUint sCprUid = scprRec->iSCprUid; |
|
290 delete scprRec; |
|
291 scprRec = NULL; |
|
292 |
|
293 CCDProtocolRecord* prtRec = TierManagerUtils::LoadProtocolRecordL(apRec->iProtocol,*dbs); |
|
294 TUint protocolUid = prtRec->iProtocolUid; |
|
295 delete prtRec; |
|
296 prtRec = NULL; |
|
297 |
|
298 TUint customSelectionPolicy = TierManagerUtils::ReadCustomSelectionPolicyIdL(iProviderInfo.APId(),*dbs); |
|
299 TUint appSid = apRec->iAppSID; |
|
300 |
|
301 |
|
302 RMetaExtensionContainer mec; |
|
303 mec.Open(iAccessPointConfig); |
|
304 CleanupClosePushL(mec); |
|
305 |
|
306 const TDesC& configAPIdList = apRec->iConfigAPIdList; |
|
307 if (configAPIdList.Length() > 0) |
|
308 { |
|
309 RArray<TUint> tlids; |
|
310 CleanupClosePushL(tlids); |
|
311 |
|
312 CConfigAccessPointConfig *capext = CConfigAccessPointConfig::NewL(); |
|
313 |
|
314 CleanupStack::PushL(capext); |
|
315 mec.AppendExtensionL(capext); |
|
316 CleanupStack::Pop(capext); |
|
317 |
|
318 TierManagerUtils::ParseTLConfigAccessPointIdsL(tlids, apRec->iConfigAPIdList); |
|
319 |
|
320 for (TUint i = 0; i < tlids.Count(); i++) |
|
321 { |
|
322 /** |
|
323 Load the top level CAP record from the database, |
|
324 and save it to the provisioning structure |
|
325 */ |
|
326 CCDConfigAccessPointRecord* caprec = TierManagerUtils::LoadConfigAccessPointRecordL(tlids[i], *dbs); |
|
327 CleanupStack::PushL(caprec); |
|
328 |
|
329 CCDSCprRecord* scprRec = TierManagerUtils::LoadSCprRecordL(caprec->iSCpr,*dbs); |
|
330 TUint capSCprUid = scprRec->iSCprUid; |
|
331 delete scprRec; |
|
332 scprRec = NULL; |
|
333 |
|
334 CCDProtocolRecord* prtRec = TierManagerUtils::LoadProtocolRecordL(caprec->iProtocol,*dbs); |
|
335 TUint capProtocolUid = prtRec->iProtocolUid; |
|
336 TUint capProtocolConfigLoaderUid = prtRec->iProtocolConfigLoaderUid; |
|
337 delete prtRec; |
|
338 prtRec = NULL; |
|
339 |
|
340 /** |
|
341 Record SCpr to be started. Needed by Cpr |
|
342 */ |
|
343 TUid scprUid = TUid::Uid(capSCprUid); |
|
344 capext->AppendSCprL(scprUid); |
|
345 |
|
346 TConfigAccessPointLayer topLayer(caprec->iRecordTag, TUid::Uid(capSCprUid), |
|
347 TUid::Uid(capProtocolUid), caprec->iLayerBelow, ETrue); |
|
348 if(!capext->LayerExists(topLayer)) |
|
349 { |
|
350 capext->AppendLayerL(topLayer); |
|
351 |
|
352 /** |
|
353 Load configuration for each protocol using ecom plugin. |
|
354 */ |
|
355 if (capProtocolConfigLoaderUid) |
|
356 { |
|
357 CProtocolConfigLoader *cfgldr = CProtocolConfigLoader::NewL(dbs, TUid::Uid(capProtocolConfigLoaderUid)); |
|
358 CleanupStack::PushL(cfgldr); |
|
359 cfgldr->LoadConfigL(mec, TUid::Uid(capProtocolUid), caprec->iProtocolConfig); |
|
360 CleanupStack::PopAndDestroy(cfgldr); |
|
361 } |
|
362 } |
|
363 |
|
364 TUint layerbelow = caprec->iLayerBelow; |
|
365 CleanupStack::PopAndDestroy(caprec); |
|
366 caprec = NULL; |
|
367 |
|
368 /** |
|
369 Now load the info for each of it's lower layers. |
|
370 */ |
|
371 while (layerbelow != 0) |
|
372 { |
|
373 /* Load next layer from the database */ |
|
374 CCDConfigAccessPointRecord* caprec = TierManagerUtils::LoadConfigAccessPointRecordL(layerbelow, *dbs); |
|
375 CleanupStack::PushL(caprec); |
|
376 |
|
377 CCDProtocolRecord* prtRec = TierManagerUtils::LoadProtocolRecordL(caprec->iProtocol,*dbs); |
|
378 capProtocolUid = prtRec->iProtocolUid; |
|
379 capProtocolConfigLoaderUid = prtRec->iProtocolConfigLoaderUid; |
|
380 delete prtRec; |
|
381 prtRec = NULL; |
|
382 |
|
383 TConfigAccessPointLayer layer(caprec->iRecordTag, TUid::Uid(capSCprUid), |
|
384 TUid::Uid(capProtocolUid), caprec->iLayerBelow); |
|
385 |
|
386 if(!capext->LayerExists(layer)) |
|
387 { |
|
388 capext->AppendLayerL(layer); |
|
389 |
|
390 if (capProtocolConfigLoaderUid) |
|
391 { |
|
392 CProtocolConfigLoader *cfgldr |
|
393 = CProtocolConfigLoader::NewL(dbs, TUid::Uid(capProtocolConfigLoaderUid)); |
|
394 CleanupStack::PushL(cfgldr); |
|
395 TUid capuid = TUid::Uid(capProtocolUid); |
|
396 cfgldr->LoadConfigL(mec, capuid, caprec->iProtocolConfig); |
|
397 |
|
398 CleanupStack::PopAndDestroy(cfgldr); |
|
399 } |
|
400 } |
|
401 |
|
402 layerbelow = caprec->iLayerBelow; |
|
403 CleanupStack::PopAndDestroy(caprec); |
|
404 } |
|
405 } |
|
406 |
|
407 CleanupStack::PopAndDestroy(&tlids); |
|
408 } |
|
409 |
|
410 |
|
411 TLayerConfig* layerConfig = new(ELeave)TLayerConfig(TUid::Uid(mCprUid), TUid::Uid(cprUid), |
|
412 TUid::Uid(sCprUid), TUid::Uid(protocolUid), tierId); |
|
413 CleanupStack::PushL(layerConfig); |
|
414 mec.AppendExtensionL(layerConfig); |
|
415 CleanupStack::Pop(layerConfig); |
|
416 |
|
417 TLayerSelectionInfo* layerSelectInfo = new(ELeave)TLayerSelectionInfo(selectionPolicy, cprConfig, customSelectionPolicy); |
|
418 CleanupStack::PushL(layerSelectInfo); |
|
419 mec.AppendExtensionL(layerSelectInfo); |
|
420 CleanupStack::Pop(layerSelectInfo); |
|
421 |
|
422 TAppSidConfig* appSidConfig = new(ELeave)TAppSidConfig(appSid); |
|
423 CleanupStack::PushL(appSidConfig); |
|
424 mec.AppendExtensionL(appSidConfig); |
|
425 CleanupStack::Pop(appSidConfig); |
|
426 |
|
427 TAccessPointPriority* apPriorityExt = new(ELeave)TAccessPointPriority; |
|
428 CleanupStack::PushL(apPriorityExt); |
|
429 apPriorityExt->SetPriority(apPriority); |
|
430 mec.AppendExtensionL(apPriorityExt); |
|
431 CleanupStack::Pop(apPriorityExt); |
|
432 |
|
433 iAccessPointConfig.Close(); |
|
434 iAccessPointConfig.Open(mec); |
|
435 CleanupStack::PopAndDestroy(&mec); |
|
436 |
|
437 |
|
438 #ifdef SYMBIAN_NETWORKING_UPS |
|
439 ShowAccessPointRecordL(dbs, apRec); |
|
440 #endif |
|
441 |
|
442 CleanupStack::PopAndDestroy(apRec); |
|
443 CleanupStack::PopAndDestroy(dbs); |
|
444 |
|
445 LOG( ESockLog::Printf(KESockMetaConnectionTag, _L("\t\t\tTierId=%08x McprUid=%08x CprUid=%08x ScprUid=%08x ProtoUid=%08x"), |
|
446 tierId.iUid, |
|
447 layerConfig->MCprUid(), |
|
448 layerConfig->CprUid(), |
|
449 layerConfig->SCprUid(), |
|
450 layerConfig->ProtocolUid() |
|
451 ) ); |
|
452 } |
|
453 |
|
454 |
|
455 #ifdef SYMBIAN_NETWORKING_UPS |
|
456 |
|
457 EXPORT_C void CMetaConnectionProviderBase::ShowAccessPointRecordL(CommsDat::CMDBSession* /*aSession*/, CommsDat::CCDAccessPointRecord* /*aApRec*/) |
|
458 /** |
|
459 Allow derived classes to read fields from the Access Point Record whilst we already have it open. |
|
460 */ |
|
461 { |
|
462 } |
|
463 |
|
464 #endif |
|
465 |
|
466 |
|
467 // |
|
468 //Factories - Container |
|
469 CMetaConnectionFactoryContainer* CMetaConnectionFactoryContainer::NewL() |
|
470 /** Create a new instance of a meta connection factory container |
|
471 @exception Leaves in out of memory conditions |
|
472 @return Pointer to new instance of a meta connection factory container |
|
473 */ |
|
474 { |
|
475 CMetaConnectionFactoryContainer* container = new (ELeave) CMetaConnectionFactoryContainer; |
|
476 return container; |
|
477 } |
|
478 |
|
479 |
|
480 CMetaConnectionProviderFactoryBase* CMetaConnectionFactoryContainer::Factory(TInt aIndex) const |
|
481 { |
|
482 return static_cast<CMetaConnectionProviderFactoryBase*>(CCommsFactoryContainer::Factory(aIndex)); |
|
483 } |
|
484 |
|
485 CMetaConnectionFactoryContainer::~CMetaConnectionFactoryContainer() |
|
486 /** Empty meta connection factory container destructor */ |
|
487 { |
|
488 LOG_NODE_DESTROY(KESockMetaConnectionTag, CMetaConnectionFactoryContainer); |
|
489 } |
|
490 |
|
491 CMetaConnectionFactoryContainer::CMetaConnectionFactoryContainer() |
|
492 :CCommsFactoryContainer((CCommsFactoryContainer::TContaineeType)CMetaConnectionFactoryContainer::EId) |
|
493 /** Empty meta connection factory container constructor */ |
|
494 { |
|
495 LOG_NODE_CREATE(KESockMetaConnectionTag, CMetaConnectionFactoryContainer); |
|
496 } |
|
497 |
|
498 void CMetaConnectionFactoryContainer::ReceivedL(const TRuntimeCtxId& /*aSender*/, const TNodeId& /*aRecipient*/, TSignatureBase& aMessage) |
|
499 { |
|
500 (void)aMessage; |
|
501 |
|
502 NM_LOG_START_BLOCK(KESockMetaConnectionTag, _L8("CMetaConnectionFactoryContainer:ReceivedL")); |
|
503 NM_LOG((KESockMetaConnectionTag, _L8("ERROR: KErrNotSupported [this=0x%08x]"), this)); |
|
504 NM_LOG_MESSAGE(KESockMetaConnectionTag, aMessage); |
|
505 NM_LOG_END_BLOCK(KESockMetaConnectionTag, _L8("CMetaConnectionFactoryContainer:ReceivedL")); |
|
506 |
|
507 __ASSERT_DEBUG(EFalse, User::Panic(KSpecAssert_ESockSSocksmtcnp, 3)); //For debug configurations |
|
508 User::Leave(KErrNotSupported); //For release configurations |
|
509 } |
|
510 |
|
511 // |
|
512 //Factories |
|
513 EXPORT_C CMetaConnectionProviderFactoryBase::CMetaConnectionProviderFactoryBase(TUid aFactoryId, CMetaConnectionFactoryContainer& aParentContainer) |
|
514 /** Meta connection provider factory constructor |
|
515 @param aFactoryId Unique Integer Identifier of the meta connection provider factory |
|
516 @param aParentContainer Container to add the factory to */ |
|
517 : CCommsFactoryBase(aFactoryId, aParentContainer) |
|
518 { |
|
519 LOG(ESockLog::Printf(KESockMetaConnectionTag, _L("CMetaConnectionProviderFactoryBase %08x:\tCMetaConnectionProviderFactoryBase(%08x)"), this, aFactoryId)); |
|
520 } |
|
521 |
|
522 EXPORT_C CMetaConnectionProviderFactoryBase::~CMetaConnectionProviderFactoryBase() |
|
523 /** Empty meta connection factory base destructor */ |
|
524 { |
|
525 LOG(ESockLog::Printf(KESockMetaConnectionTag, _L("CMetaConnectionProviderFactoryBase %08x:\t~CMetaConnectionProviderFactoryBase()"), this)); |
|
526 } |
|
527 |
|
528 EXPORT_C ACommsFactoryNodeId* CMetaConnectionProviderFactoryBase::DoCreateObjectL(TFactoryQueryBase& /* aQuery */) |
|
529 { |
|
530 __ASSERT_DEBUG(EFalse, User::Panic(KSpecAssert_ESockSSocksmtcnp, 4)); |
|
531 User::Leave(KErrNotSupported); |
|
532 return NULL; |
|
533 } |
|
534 |
|
535 EXPORT_C void CMetaConnectionProviderFactoryBase::DoPostCreationL(ACommsFactoryNodeId* aObject,TFactoryQueryBase& aQuery) |
|
536 { //setting tiermanger to MCPR |
|
537 CMetaConnectionProviderBase* provider = static_cast<CMetaConnectionProviderBase*>(aObject); |
|
538 TMetaConnectionFactoryQuery tempQuery= static_cast<TMetaConnectionFactoryQuery&>(aQuery); |
|
539 CTierManagerFactoryBase* factory = static_cast<CTierManagerFactoryBase*>((*SockManGlobals::Get()->iTierManagerFactories).FindOrCreateFactoryL(tempQuery.iTierImplUid)); |
|
540 |
|
541 if (factory) |
|
542 { |
|
543 TAlwaysFindFactoryQuery query; |
|
544 CTierManagerBase* tierManager = static_cast<CTierManagerBase*>(factory->Find(query)); |
|
545 if (tierManager) |
|
546 provider->SetTierManagerL(tierManager); |
|
547 } |
|
548 |
|
549 } |
|
550 |
|
551 |