|
1 /* |
|
2 * Copyright (c) 2009-2010 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 * Session side object representing a connection method. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #include <cmpluginbaseeng.h> |
|
21 #include <cmconnectionmethoddef.h> |
|
22 #include <cmpluginembdestinationdef.h> |
|
23 |
|
24 #include "cmmconnmethodinstance.h" |
|
25 #include "cmmsession.h" |
|
26 #include "cmmcache.h" |
|
27 #include "cmmconnmethodstruct.h" |
|
28 |
|
29 #include "OstTraceDefinitions.h" |
|
30 #ifdef OST_TRACE_COMPILER_IN_USE |
|
31 #include "cmmconnmethodinstanceTraces.h" |
|
32 #endif |
|
33 |
|
34 |
|
35 // --------------------------------------------------------------------------- |
|
36 // Two phased construction. |
|
37 // --------------------------------------------------------------------------- |
|
38 // |
|
39 CCmmConnMethodInstance* CCmmConnMethodInstance::NewL( CCmmSession* aCmmSession, CCmmCache* aCache ) |
|
40 { |
|
41 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_NEWL_ENTRY ); |
|
42 |
|
43 CCmmConnMethodInstance* self = CCmmConnMethodInstance::NewLC( aCmmSession, aCache ); |
|
44 CleanupStack::Pop( self ); |
|
45 |
|
46 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_NEWL_EXIT ); |
|
47 |
|
48 return self; |
|
49 } |
|
50 |
|
51 // --------------------------------------------------------------------------- |
|
52 // Two phased construction. |
|
53 // --------------------------------------------------------------------------- |
|
54 // |
|
55 CCmmConnMethodInstance* CCmmConnMethodInstance::NewLC( CCmmSession* aCmmSession, CCmmCache* aCache ) |
|
56 { |
|
57 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_NEWLC_ENTRY ); |
|
58 |
|
59 CCmmConnMethodInstance* self = new( ELeave ) CCmmConnMethodInstance( aCmmSession, aCache ); |
|
60 CleanupClosePushL( *self ); |
|
61 self->ConstructL(); |
|
62 |
|
63 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_NEWLC_EXIT ); |
|
64 |
|
65 return self; |
|
66 } |
|
67 |
|
68 // --------------------------------------------------------------------------- |
|
69 // Destructor. |
|
70 // --------------------------------------------------------------------------- |
|
71 // |
|
72 CCmmConnMethodInstance::~CCmmConnMethodInstance() |
|
73 { |
|
74 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_CCMMCONNMETHODINSTANCE_ENTRY ); |
|
75 |
|
76 // Tell cache this handle is beeing closed. Cache will update own bookkeeping. |
|
77 if ( iCache ) |
|
78 { |
|
79 iCache->CloseConnMethod( *this ); |
|
80 } |
|
81 |
|
82 delete iPluginDataInstance; |
|
83 |
|
84 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_CCMMCONNMETHODINSTANCE_EXIT ); |
|
85 } |
|
86 |
|
87 // --------------------------------------------------------------------------- |
|
88 // Constructor. |
|
89 // --------------------------------------------------------------------------- |
|
90 // |
|
91 CCmmConnMethodInstance::CCmmConnMethodInstance( CCmmSession* aCmmSession, CCmmCache* aCache ) |
|
92 : |
|
93 iCmmSession( aCmmSession ), |
|
94 iCache( aCache ) |
|
95 { |
|
96 OstTraceFunctionEntry0( DUP1_CCMMCONNMETHODINSTANCE_CCMMCONNMETHODINSTANCE_ENTRY ); |
|
97 |
|
98 iPlugin = NULL; |
|
99 iPluginDataInstance = NULL; |
|
100 iConnMethodId = 0; |
|
101 iBearerType = 0; |
|
102 iStatus = ECmmConnMethodStatusChanged; |
|
103 iHandle = 0; |
|
104 |
|
105 OstTraceFunctionExit0( DUP1_CCMMCONNMETHODINSTANCE_CCMMCONNMETHODINSTANCE_EXIT ); |
|
106 } |
|
107 |
|
108 // --------------------------------------------------------------------------- |
|
109 // Second phase constructor. |
|
110 // --------------------------------------------------------------------------- |
|
111 // |
|
112 void CCmmConnMethodInstance::ConstructL() |
|
113 { |
|
114 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_CONSTRUCTL_ENTRY ); |
|
115 |
|
116 iPluginDataInstance = CCmClientPluginInstance::NewL(); |
|
117 |
|
118 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_CONSTRUCTL_EXIT ); |
|
119 } |
|
120 |
|
121 // --------------------------------------------------------------------------- |
|
122 // Set the plugin base pointer. |
|
123 // --------------------------------------------------------------------------- |
|
124 // |
|
125 void CCmmConnMethodInstance::SetPlugin( CCmPluginBaseEng* aPlugin ) |
|
126 { |
|
127 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETPLUGIN_ENTRY ); |
|
128 |
|
129 iPlugin = aPlugin; |
|
130 |
|
131 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETPLUGIN_EXIT ); |
|
132 } |
|
133 |
|
134 // --------------------------------------------------------------------------- |
|
135 // Get the plugin base pointer. |
|
136 // --------------------------------------------------------------------------- |
|
137 // |
|
138 CCmPluginBaseEng* CCmmConnMethodInstance::GetPlugin() const |
|
139 { |
|
140 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETPLUGIN_ENTRY ); |
|
141 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_GETPLUGIN_EXIT ); |
|
142 return iPlugin; |
|
143 } |
|
144 |
|
145 // --------------------------------------------------------------------------- |
|
146 // Get pointer to the plugin data container. |
|
147 // --------------------------------------------------------------------------- |
|
148 // |
|
149 CCmClientPluginInstance* CCmmConnMethodInstance::GetPluginDataInstance() const |
|
150 { |
|
151 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETPLUGINDATAINSTANCE_ENTRY ); |
|
152 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_GETPLUGINDATAINSTANCE_EXIT ); |
|
153 return iPluginDataInstance; |
|
154 } |
|
155 |
|
156 // --------------------------------------------------------------------------- |
|
157 // Get connection method ID. |
|
158 // --------------------------------------------------------------------------- |
|
159 // |
|
160 TUint32 CCmmConnMethodInstance::GetId() const |
|
161 { |
|
162 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETID_ENTRY ); |
|
163 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_GETID_EXIT ); |
|
164 |
|
165 return iConnMethodId; |
|
166 } |
|
167 |
|
168 // --------------------------------------------------------------------------- |
|
169 // Set connection method ID. |
|
170 // --------------------------------------------------------------------------- |
|
171 // |
|
172 void CCmmConnMethodInstance::SetId( const TUint32& aConnMethodId ) |
|
173 { |
|
174 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETID_ENTRY ); |
|
175 |
|
176 iConnMethodId = aConnMethodId; |
|
177 |
|
178 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETID_EXIT ); |
|
179 } |
|
180 |
|
181 // --------------------------------------------------------------------------- |
|
182 // Return bearer type. |
|
183 // --------------------------------------------------------------------------- |
|
184 // |
|
185 TUint32 CCmmConnMethodInstance::GetBearerType() const |
|
186 { |
|
187 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETBEARERTYPE_ENTRY ); |
|
188 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_GETBEARERTYPE_EXIT ); |
|
189 |
|
190 return iBearerType; |
|
191 } |
|
192 |
|
193 // --------------------------------------------------------------------------- |
|
194 // Get bearer type. |
|
195 // --------------------------------------------------------------------------- |
|
196 // |
|
197 void CCmmConnMethodInstance::SetBearerType( const TUint32& aBearerType ) |
|
198 { |
|
199 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETBEARERTYPE_ENTRY ); |
|
200 |
|
201 iBearerType = aBearerType; |
|
202 |
|
203 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETBEARERTYPE_EXIT ); |
|
204 } |
|
205 |
|
206 // --------------------------------------------------------------------------- |
|
207 // Get handle ID. |
|
208 // --------------------------------------------------------------------------- |
|
209 // |
|
210 TInt CCmmConnMethodInstance::GetHandle() const |
|
211 { |
|
212 return iHandle; |
|
213 } |
|
214 |
|
215 // --------------------------------------------------------------------------- |
|
216 // Set handle ID. |
|
217 // --------------------------------------------------------------------------- |
|
218 // |
|
219 void CCmmConnMethodInstance::SetHandle( const TInt& aHandle ) |
|
220 { |
|
221 iHandle = aHandle; |
|
222 } |
|
223 |
|
224 // --------------------------------------------------------------------------- |
|
225 // Return ETrue, if this connection method represents an embedded destination. |
|
226 // --------------------------------------------------------------------------- |
|
227 // |
|
228 TBool CCmmConnMethodInstance::IsEmbeddedDestination() const |
|
229 { |
|
230 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_ISEMBEDDEDDESTINATION_ENTRY ); |
|
231 |
|
232 TBool result( EFalse ); |
|
233 if ( iBearerType == KUidEmbeddedDestination ) |
|
234 { |
|
235 result = ETrue; |
|
236 } |
|
237 |
|
238 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_ISEMBEDDEDDESTINATION_EXIT ); |
|
239 return result; |
|
240 } |
|
241 |
|
242 // --------------------------------------------------------------------------- |
|
243 // Save the contents of this connection method into database. The attribute |
|
244 // aTemporaryHandle must be true if this connection instance was temporarily |
|
245 // created for the duration of this update operation only. |
|
246 // --------------------------------------------------------------------------- |
|
247 // |
|
248 void CCmmConnMethodInstance::UpdateL( TBool aTemporaryHandle ) |
|
249 { |
|
250 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_UPDATEL_ENTRY ); |
|
251 |
|
252 if ( iCache ) |
|
253 { |
|
254 iCache->UpdateConnMethodL( *this, aTemporaryHandle ); |
|
255 } |
|
256 else |
|
257 { |
|
258 User::Leave( KErrBadHandle ); |
|
259 } |
|
260 |
|
261 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_UPDATEL_EXIT ); |
|
262 } |
|
263 |
|
264 // --------------------------------------------------------------------------- |
|
265 // Copy the relevant connection method information from cache side object. |
|
266 // --------------------------------------------------------------------------- |
|
267 // |
|
268 void CCmmConnMethodInstance::CopyDataL( CCmmConnMethodStruct* aConnMethodStruct ) |
|
269 { |
|
270 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_COPYDATAL_ENTRY ); |
|
271 |
|
272 if ( !aConnMethodStruct ) |
|
273 { |
|
274 User::Leave( KErrCorrupt ); |
|
275 } |
|
276 |
|
277 iConnMethodId = aConnMethodStruct->GetId(); |
|
278 iBearerType = aConnMethodStruct->GetBearerType(); |
|
279 |
|
280 iPlugin = aConnMethodStruct->GetPlugin(); |
|
281 if ( !iPlugin ) |
|
282 { |
|
283 User::Leave( KErrCorrupt ); |
|
284 } |
|
285 |
|
286 iPlugin->GetPluginDataL( iPluginDataInstance ); //TODO, check deletes for iPluginDataInstance |
|
287 aConnMethodStruct->IncrementReferenceCounter(); |
|
288 |
|
289 switch ( aConnMethodStruct->GetStatus() ) |
|
290 { |
|
291 case ECmmConnMethodStatusNotSaved: |
|
292 case ECmmConnMethodStatusToBeDeleted: |
|
293 { |
|
294 iStatus = ECmmConnMethodStatusChanged; |
|
295 } |
|
296 break; |
|
297 case ECmmConnMethodStatusValid: |
|
298 { |
|
299 iStatus = ECmmConnMethodStatusValid; |
|
300 } |
|
301 break; |
|
302 case ECmmConnMethodStatusChanged: |
|
303 default: |
|
304 User::Leave( KErrCorrupt ); // Error, invalid status. |
|
305 break; |
|
306 } |
|
307 |
|
308 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_COPYDATAL_EXIT ); |
|
309 } |
|
310 |
|
311 // --------------------------------------------------------------------------- |
|
312 // Refresh the relevant connection method data in cache side object to be in |
|
313 // synch with database and copy that data back to this session side connection |
|
314 // method object. |
|
315 // --------------------------------------------------------------------------- |
|
316 // |
|
317 //TODO, cleanup |
|
318 /* |
|
319 void CCmmConnMethodInstance::RefreshDataL( CCmmConnMethodStruct* aConnMethodStruct ) //TODO, remove |
|
320 { |
|
321 |
|
322 //TODO |
|
323 //if ( !aConnMethodStruct ) |
|
324 //{ |
|
325 //User::Leave( KErrCorrupt ); |
|
326 //} |
|
327 if ( !iPlugin ) |
|
328 { |
|
329 User::Leave( KErrCorrupt ); |
|
330 } |
|
331 |
|
332 switch ( aConnMethodStruct->GetStatus() ) |
|
333 { |
|
334 case ECmmConnMethodStatusValid: |
|
335 case ECmmConnMethodStatusToBeDeleted: |
|
336 { |
|
337 //TODO, add record status check later and only call Reload() if necessary. TCmmRecordStatus |
|
338 //if ( !aConnMethodStruct->UpToDate() ) |
|
339 // { |
|
340 iPlugin->ReLoadL(); |
|
341 // } |
|
342 iPlugin->GetPluginDataL( iPluginDataInstance ); |
|
343 } |
|
344 break; |
|
345 case ECmmConnMethodStatusNotSaved: // This is checked before. |
|
346 case ECmmConnMethodStatusChanged: |
|
347 default: |
|
348 User::Leave( KErrCorrupt ); // Error, invalid status. |
|
349 break; |
|
350 } |
|
351 |
|
352 // Internal state need to be set to the same state as after a successfull update. |
|
353 UpdateSuccessful(); |
|
354 |
|
355 }*/ |
|
356 |
|
357 // --------------------------------------------------------------------------- |
|
358 // CCmmConnMethodInstance::GetIntAttributeL |
|
359 // --------------------------------------------------------------------------- |
|
360 // |
|
361 TUint32 CCmmConnMethodInstance::GetIntAttributeL( const TUint32& aAttribute ) |
|
362 { |
|
363 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETINTATTRIBUTEL_ENTRY ); |
|
364 |
|
365 __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); |
|
366 |
|
367 return iPlugin->GetIntAttributeL( aAttribute, iPluginDataInstance ); |
|
368 } |
|
369 |
|
370 // --------------------------------------------------------------------------- |
|
371 // CCmmConnMethodInstance::GetBoolAttributeL |
|
372 // --------------------------------------------------------------------------- |
|
373 // |
|
374 TBool CCmmConnMethodInstance::GetBoolAttributeL( const TUint32& aAttribute ) |
|
375 { |
|
376 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETBOOLATTRIBUTEL_ENTRY ); |
|
377 |
|
378 __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); |
|
379 |
|
380 TBool retVal( EFalse ); |
|
381 |
|
382 switch ( aAttribute ) |
|
383 { |
|
384 case CMManager::ECmConnected: |
|
385 { |
|
386 if ( GetId() > 0 ) |
|
387 { |
|
388 if ( iCache ) |
|
389 { |
|
390 retVal = iCache->CheckIfCmConnected( GetId() ); |
|
391 } |
|
392 } |
|
393 } |
|
394 break; |
|
395 case CMManager::ECmIsLinked: |
|
396 { |
|
397 //TODO |
|
398 } |
|
399 break; |
|
400 default: |
|
401 { |
|
402 retVal = iPlugin->GetBoolAttributeL( aAttribute, iPluginDataInstance ); |
|
403 } |
|
404 } |
|
405 |
|
406 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_GETBOOLATTRIBUTEL_EXIT ); |
|
407 return retVal; |
|
408 } |
|
409 |
|
410 // --------------------------------------------------------------------------- |
|
411 // CCmmConnMethodInstance::GetStringAttributeL |
|
412 // --------------------------------------------------------------------------- |
|
413 // |
|
414 HBufC* CCmmConnMethodInstance::GetStringAttributeL( const TUint32& aAttribute ) |
|
415 { |
|
416 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETSTRINGATTRIBUTEL_ENTRY ); |
|
417 |
|
418 __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); |
|
419 |
|
420 return iPlugin->GetStringAttributeL( aAttribute, iPluginDataInstance ); |
|
421 } |
|
422 |
|
423 // --------------------------------------------------------------------------- |
|
424 // CCmmConnMethodInstance::GetString8AttributeL |
|
425 // --------------------------------------------------------------------------- |
|
426 // |
|
427 HBufC8* CCmmConnMethodInstance::GetString8AttributeL( const TUint32& aAttribute ) |
|
428 { |
|
429 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETSTRING8ATTRIBUTEL_ENTRY ); |
|
430 |
|
431 __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); |
|
432 |
|
433 return iPlugin->GetString8AttributeL( aAttribute, iPluginDataInstance ); |
|
434 } |
|
435 |
|
436 // --------------------------------------------------------------------------- |
|
437 // CCmmConnMethodInstance::SetIntAttributeL |
|
438 // --------------------------------------------------------------------------- |
|
439 // |
|
440 void CCmmConnMethodInstance::SetIntAttributeL( |
|
441 const TUint32& aAttribute, |
|
442 const TUint32& aValue ) |
|
443 { |
|
444 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETINTATTRIBUTEL_ENTRY ); |
|
445 |
|
446 __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); |
|
447 |
|
448 iPlugin->SetIntAttributeL( aAttribute, aValue, iPluginDataInstance ); |
|
449 |
|
450 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETINTATTRIBUTEL_EXIT ); |
|
451 } |
|
452 |
|
453 // --------------------------------------------------------------------------- |
|
454 // CCmmConnMethodInstance::SetBoolAttributeL |
|
455 // --------------------------------------------------------------------------- |
|
456 // |
|
457 void CCmmConnMethodInstance::SetBoolAttributeL( |
|
458 const TUint32& aAttribute, |
|
459 const TBool& aValue ) |
|
460 { |
|
461 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETBOOLATTRIBUTEL_ENTRY ); |
|
462 |
|
463 __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); |
|
464 |
|
465 iPlugin->SetBoolAttributeL( aAttribute, aValue, iPluginDataInstance ); |
|
466 |
|
467 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETBOOLATTRIBUTEL_EXIT ); |
|
468 } |
|
469 |
|
470 // --------------------------------------------------------------------------- |
|
471 // CCmmConnMethodInstance::SetStringAttributeL |
|
472 // --------------------------------------------------------------------------- |
|
473 // |
|
474 void CCmmConnMethodInstance::SetStringAttributeL( |
|
475 const TUint32& aAttribute, |
|
476 const TDesC16& aValue ) |
|
477 { |
|
478 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETSTRINGATTRIBUTEL_ENTRY ); |
|
479 |
|
480 __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); |
|
481 |
|
482 iPlugin->SetStringAttributeL( aAttribute, aValue, iPluginDataInstance ); |
|
483 |
|
484 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETSTRINGATTRIBUTEL_EXIT ); |
|
485 } |
|
486 |
|
487 // --------------------------------------------------------------------------- |
|
488 // CCmmConnMethodInstance::SetString8AttributeL |
|
489 // --------------------------------------------------------------------------- |
|
490 // |
|
491 void CCmmConnMethodInstance::SetString8AttributeL( |
|
492 const TUint32& aAttribute, |
|
493 const TDesC8& aValue ) |
|
494 { |
|
495 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETSTRING8ATTRIBUTEL_ENTRY ); |
|
496 |
|
497 __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); |
|
498 |
|
499 iPlugin->SetString8AttributeL( aAttribute, aValue, iPluginDataInstance ); |
|
500 |
|
501 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETSTRING8ATTRIBUTEL_EXIT ); |
|
502 } |
|
503 |
|
504 // --------------------------------------------------------------------------- |
|
505 // Gets the current status of this connection method instance. |
|
506 // --------------------------------------------------------------------------- |
|
507 // |
|
508 TCmmConnMethodStatus CCmmConnMethodInstance::GetStatus() const |
|
509 { |
|
510 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETSTATUS_ENTRY ); |
|
511 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_GETSTATUS_EXIT ); |
|
512 return iStatus; |
|
513 } |
|
514 |
|
515 // --------------------------------------------------------------------------- |
|
516 // Sets a new status value. |
|
517 // --------------------------------------------------------------------------- |
|
518 // |
|
519 void CCmmConnMethodInstance::SetStatus( const TCmmConnMethodStatus& aStatus ) |
|
520 { |
|
521 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETSTATUS_ENTRY ); |
|
522 |
|
523 iStatus = aStatus; |
|
524 |
|
525 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETSTATUS_EXIT ); |
|
526 } |
|
527 |
|
528 // --------------------------------------------------------------------------- |
|
529 // Called after this connection method has been updated and database |
|
530 // transaction has completed successfully. Sets the internal state of this |
|
531 // connection method instance to reflect the new valid state. |
|
532 // --------------------------------------------------------------------------- |
|
533 // |
|
534 void CCmmConnMethodInstance::UpdateSuccessful() |
|
535 { |
|
536 SetStatus( ECmmConnMethodStatusValid ); |
|
537 } |
|
538 |
|
539 // --------------------------------------------------------------------------- |
|
540 // Called after this connection method has been deleted and database |
|
541 // transaction has completed successfully. Sets the internal state of this |
|
542 // connection method structure to reflect the new deleted state. |
|
543 // --------------------------------------------------------------------------- |
|
544 // |
|
545 void CCmmConnMethodInstance::DeleteSuccessful( const TUint32& aNewSecondaryId ) |
|
546 { |
|
547 SetStatus( ECmmConnMethodStatusChanged ); |
|
548 SetId( aNewSecondaryId ); |
|
549 } |
|
550 |
|
551 // --------------------------------------------------------------------------- |
|
552 // After update/delete to database, refresh temporary ID to real ID if |
|
553 // necessary and refresh status information for any related handles for |
|
554 // all client sessions. |
|
555 // --------------------------------------------------------------------------- |
|
556 // |
|
557 void CCmmConnMethodInstance::RefreshHandlesForAllSessions( |
|
558 const TCmmIdStruct& aIdStruct ) |
|
559 { |
|
560 OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_REFRESHHANDLESFORALLSESSIONS_ENTRY ); |
|
561 |
|
562 if ( iCmmSession ) |
|
563 { |
|
564 iCmmSession->RefreshHandlesForAllSessions( aIdStruct ); |
|
565 } |
|
566 |
|
567 OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_REFRESHHANDLESFORALLSESSIONS_EXIT ); |
|
568 } |
|
569 |
|
570 // --------------------------------------------------------------------------- |
|
571 // Removes a connection method from any open destination handle in the same |
|
572 // session. |
|
573 // --------------------------------------------------------------------------- |
|
574 // |
|
575 void CCmmConnMethodInstance::RemoveConnMethodFromSessionDestinationHandles( |
|
576 const TUint32& aConnMethodId ) |
|
577 { |
|
578 if ( iCmmSession ) |
|
579 { |
|
580 iCmmSession->RemoveConnMethodFromDestinationHandles( aConnMethodId ); |
|
581 } |
|
582 } |
|
583 |
|
584 // End of file |