|
1 /* |
|
2 * Copyright (c) 2005 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: Implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "MCEConstants.h" |
|
21 #include "TCmdUpdateSubscription.h" |
|
22 #include "CTcMCEContext.h" |
|
23 #include <MceOutRefer.h> |
|
24 |
|
25 #include "TcLog.h" //For testing purposes |
|
26 |
|
27 void TCmdUpdateSubscription::ExecuteL() |
|
28 { |
|
29 // ---------- Setup -------------------------------------------------------- |
|
30 |
|
31 // Get event |
|
32 CMceOutEvent* event = reinterpret_cast<CMceOutEvent*> |
|
33 (GetObjectForIdL(KEventId, EFalse)); |
|
34 |
|
35 // Get Headers |
|
36 CDesC8Array* headers = ExtractHeadersL( EFalse ); |
|
37 CleanupStack::PushL(headers); |
|
38 |
|
39 // Get ContentType |
|
40 HBufC8* contentType = HBufCParameterL(ExtractTextL(KParamContentType, |
|
41 EFalse)); |
|
42 CleanupStack::PushL(contentType); |
|
43 |
|
44 // Get Body |
|
45 HBufC8* body = HBufCParameterL(ExtractTextL(KParamBody, EFalse)); |
|
46 CleanupStack::PushL(body); |
|
47 |
|
48 //Get the RefreshInterval |
|
49 |
|
50 TUint32 refreshInterval = ExtractIntegerL(KParamRefreshInterval,0, EFalse); |
|
51 // ---------- Execution ---------------------------------------------------- |
|
52 |
|
53 //refershInterval default value is 0 |
|
54 event->UpdateL( refreshInterval, headers, contentType, body ); |
|
55 |
|
56 CleanupStack::Pop(body); |
|
57 CleanupStack::Pop(contentType); |
|
58 CleanupStack::Pop(headers); |
|
59 |
|
60 // ---------- Response creation -------------------------------------------- |
|
61 |
|
62 AddIdResponseL( KEventId, *event ); |
|
63 |
|
64 } |
|
65 |
|
66 TBool TCmdUpdateSubscription::Match( const TTcIdentifier& aId ) |
|
67 { |
|
68 return TTcMceCommandBase::Match( aId, _L8("UpdateSubscription") ); |
|
69 } |
|
70 |
|
71 TTcCommandBase* TCmdUpdateSubscription::CreateL( MTcTestContext& aContext ) |
|
72 { |
|
73 return new( ELeave ) TCmdUpdateSubscription( aContext ); |
|
74 } |