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