|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Device Management Adapter Engine. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <utf.h> |
|
20 |
|
21 #include "dmadengine.h" |
|
22 #include "dmadutil.h" |
|
23 #include "vpnlogger.h" |
|
24 |
|
25 |
|
26 DMAD_EXPORT_C void CDmAdEngine::ChildURIListL(const TDesC& /*aUri*/, |
|
27 const TDesC& /*aParentLuid*/, |
|
28 const CArrayFix<TSmlDmMappingInfo>& /*aPreviousUriSegmentList*/, |
|
29 const TInt /*aResultsRef*/, |
|
30 const TInt /*aStatusRef*/) |
|
31 { |
|
32 TRACE("CDmAdEngine::ChildURIListL"); |
|
33 DEBUG_LOG(_L("Empty method")); |
|
34 } |
|
35 |
|
36 DMAD_EXPORT_C void CDmAdEngine::AddNodeObjectL(const TDesC& /*aUri*/, |
|
37 const TDesC& /*aParentLuid*/, |
|
38 const TInt /*aStatusRef*/) |
|
39 { |
|
40 TRACE("CDmAdEngine::AddNodeObjectL"); |
|
41 DEBUG_LOG(_L("Empty method")); |
|
42 } |
|
43 |
|
44 DMAD_EXPORT_C void CDmAdEngine::AddLeafObjectL(const TDesC& /*aUri*/, |
|
45 const TDesC& /*aParentLuid*/, |
|
46 const TDesC8& /*aObject*/, |
|
47 const TDesC& /*aType*/, |
|
48 const TInt /*aStatusRef*/) |
|
49 { |
|
50 TRACE("CDmAdEngine::AddLeafObjectL"); |
|
51 DEBUG_LOG(_L("Empty method")); |
|
52 } |
|
53 |
|
54 DMAD_EXPORT_C void CDmAdEngine::UpdateLeafObjectL(const TDesC& /*aUri*/, |
|
55 const TDesC& /*aLuid*/, |
|
56 const TDesC8& /*aObject*/, |
|
57 const TDesC& /*aType*/, |
|
58 const TInt /*aStatusRef*/) |
|
59 { |
|
60 TRACE("CDmAdEngine::UpdateLeafObjectL"); |
|
61 DEBUG_LOG(_L("Empty method")); |
|
62 } |
|
63 |
|
64 DMAD_EXPORT_C void CDmAdEngine::FetchLeafObjectL(const TDesC& /*aUri*/, |
|
65 const TDesC& /*aLuid*/, |
|
66 const TDesC& /*aType*/, |
|
67 const TInt /*aResultsRef*/, |
|
68 const TInt /*aStatusRef*/) |
|
69 { |
|
70 TRACE("CDmAdEngine::FetchLeafObjectL"); |
|
71 DEBUG_LOG(_L("Empty method")); |
|
72 } |
|
73 |
|
74 DMAD_EXPORT_C void CDmAdEngine::DeleteObjectL(const TDesC& /*aUri*/, |
|
75 const TDesC& /*aLuid*/, |
|
76 const TInt /*aStatusRef*/) |
|
77 { |
|
78 TRACE("CDmAdEngine::DeleteObjectL"); |
|
79 DEBUG_LOG(_L("Empty method")); |
|
80 } |
|
81 |
|
82 DMAD_EXPORT_C void CDmAdEngine::EndMessageL() |
|
83 { |
|
84 TRACE("CDmAdEngine::EndMessageL"); |
|
85 DEBUG_LOG(_L("Empty method")); |
|
86 } |
|
87 |
|
88 //=================================================================================================== |
|
89 |
|
90 DMAD_EXPORT_C void CDmAdEngine::UpdateLeafObjectL(const TDesC8& /*aUri*/, |
|
91 const TDesC8& /*aLuid*/, |
|
92 RWriteStream*& /*aStream*/, |
|
93 const TDesC8& /*aType*/, |
|
94 TInt aStatusRef) |
|
95 { |
|
96 TRACE("CDmAdEngine::UpdateLeafObjectL"); |
|
97 DEBUG_LOG(_L("Unsupported stream method called")); |
|
98 |
|
99 iCallBack->SetStatusL(aStatusRef, KErrGeneral); |
|
100 } |
|
101 |
|
102 DMAD_EXPORT_C void CDmAdEngine::FetchLeafObjectSizeL(const TDesC8& aUri, |
|
103 const TDesC8& aLuid, |
|
104 const TDesC8& aType, |
|
105 TInt aResultsRef, |
|
106 TInt aStatusRef) |
|
107 { |
|
108 TRACE("CDmAdEngine::FetchLeafObjectSizeL"); |
|
109 |
|
110 DEBUG_LOG1(_L8("aUri %S"), &aUri); |
|
111 DEBUG_LOG1(_L8("aLuid %S"), &aLuid); |
|
112 DEBUG_LOG1(_L8("aType %S"), &aType); |
|
113 DEBUG_LOG2(_L("aResultsRef = %d, aStatusRef = %d"), aResultsRef, aStatusRef); |
|
114 |
|
115 TPtrC8 uri(TDmAdUtil::RemoveDotSlash(aUri)); |
|
116 TInt status = KErrNone; |
|
117 CBufBase* object = 0; |
|
118 TRAPD(err, status = DoFetchLeafObjectL(uri, aLuid, aType, object)); |
|
119 if (err != KErrNone) |
|
120 { |
|
121 iCallBack->SetStatusL(aStatusRef, err); |
|
122 return; |
|
123 } |
|
124 if (status != KErrNone) |
|
125 { |
|
126 delete object; |
|
127 iCallBack->SetStatusL(aStatusRef, status); |
|
128 return; |
|
129 } |
|
130 |
|
131 CleanupStack::PushL(object); |
|
132 TInt objSizeInBytes = object->Size(); |
|
133 HBufC8* sizeBuf = TDmAdUtil::IntToDes8LC(objSizeInBytes); |
|
134 object->Reset(); |
|
135 object->InsertL(0, *sizeBuf); |
|
136 |
|
137 iCallBack->SetResultsL(aResultsRef, *object, aType); |
|
138 iCallBack->SetStatusL(aStatusRef, status); |
|
139 CleanupStack::PopAndDestroy(2); //sizeBuf, object |
|
140 } |
|
141 |
|
142 DMAD_EXPORT_C void CDmAdEngine::ExecuteCommandL(const TDesC8& aUri, |
|
143 const TDesC8& aLuid, |
|
144 const TDesC8& aArgument, |
|
145 const TDesC8& aType, |
|
146 TInt aStatusRef) |
|
147 { |
|
148 TRACE("CDmAdEngine::ExecuteCommandL"); |
|
149 |
|
150 DEBUG_LOG1(_L8("aUri %S"), &aUri); |
|
151 DEBUG_LOG1(_L8("aLuid %S"), &aLuid); |
|
152 |
|
153 DEBUG_LOG(_L("Argument:")); |
|
154 DEBUG_LOG_HEX(aArgument); |
|
155 |
|
156 DEBUG_LOG1(_L8("aType %S"), &aType); |
|
157 DEBUG_LOG1(_L("aStatusRef = %d"), aStatusRef); |
|
158 |
|
159 if (!iDdfApi->IsLeafUnderRtNodeL(aUri)) |
|
160 { |
|
161 iDdfApi->NotRtNodeUpdateLeafObjectL(aUri, aLuid, aArgument, aType, aStatusRef); |
|
162 } |
|
163 else |
|
164 { |
|
165 iCallBack->SetStatusL(aStatusRef, KErrNotFound); |
|
166 } |
|
167 } |
|
168 |
|
169 DMAD_EXPORT_C void CDmAdEngine::ExecuteCommandL(const TDesC8& /*aUri*/, |
|
170 const TDesC8& /*aLuid*/, |
|
171 RWriteStream*& /*aStream*/, |
|
172 const TDesC8& /*aType*/, |
|
173 TInt aStatusRef) |
|
174 { |
|
175 TRACE("CDmAdEngine::ExecuteCommandL"); |
|
176 DEBUG_LOG(_L("Unsupported stream method called")); |
|
177 |
|
178 iCallBack->SetStatusL(aStatusRef, KErrGeneral); |
|
179 } |
|
180 |
|
181 DMAD_EXPORT_C void CDmAdEngine::CopyCommandL(const TDesC8& aTargetUri, |
|
182 const TDesC8& aTargetLuid, |
|
183 const TDesC8& aSourceUri, |
|
184 const TDesC8& aSourceLuid, |
|
185 const TDesC8& aType, |
|
186 TInt aStatusRef) |
|
187 { |
|
188 TRACE("CDmAdEngine::CopyCommandL"); |
|
189 |
|
190 DEBUG_LOG1(_L8("aTargetUri = %S"), &aTargetUri); |
|
191 DEBUG_LOG1(_L8("aTargetLuid = %S"), &aTargetLuid); |
|
192 DEBUG_LOG1(_L8("aSourceUri = %S"), &aSourceUri); |
|
193 DEBUG_LOG1(_L8("aSourceLuid = %S"), &aSourceLuid); |
|
194 DEBUG_LOG1(_L8("aType = %S"), &aType); |
|
195 DEBUG_LOG1(_L("aStatusRef = %d"), aStatusRef); |
|
196 |
|
197 |
|
198 TInt err = KErrNone; |
|
199 TPtrC8 sourceUri(TDmAdUtil::RemoveDotSlash(aSourceUri)); |
|
200 TInt status = KErrNone; |
|
201 CBufBase* object = 0; |
|
202 TRAP(err, status = DoFetchLeafObjectL(sourceUri, aSourceLuid, aType, object)); |
|
203 if (err != KErrNone) |
|
204 { |
|
205 iCallBack->SetStatusL(aStatusRef, err); |
|
206 return; |
|
207 } |
|
208 if (status != KErrNone) |
|
209 { |
|
210 delete object; |
|
211 iCallBack->SetStatusL(aStatusRef, status); |
|
212 return; |
|
213 } |
|
214 |
|
215 CleanupStack::PushL(object); |
|
216 |
|
217 DEBUG_LOG(_L("object:")); |
|
218 DEBUG_LOG_HEX(object->Ptr(0)); |
|
219 |
|
220 TPtrC8 targetUri(TDmAdUtil::RemoveDotSlash(aTargetUri)); |
|
221 TRAP(err, DoUpdateLeafObjectL(targetUri, aTargetLuid, object->Ptr(0), aType, aStatusRef)); |
|
222 if (err != KErrNone) |
|
223 { |
|
224 iCallBack->SetStatusL(aStatusRef, err); |
|
225 } |
|
226 |
|
227 CleanupStack::PopAndDestroy(); // object |
|
228 } |
|
229 |
|
230 DMAD_EXPORT_C void CDmAdEngine::StartAtomicL() |
|
231 { |
|
232 TRACE("CDmAdEngine::StartAtomicL"); |
|
233 DEBUG_LOG(_L("Empty method")); |
|
234 } |
|
235 |
|
236 DMAD_EXPORT_C void CDmAdEngine::CommitAtomicL() |
|
237 { |
|
238 TRACE("CDmAdEngine::CommitAtomicL"); |
|
239 DEBUG_LOG(_L("Empty method")); |
|
240 } |
|
241 |
|
242 DMAD_EXPORT_C void CDmAdEngine::RollbackAtomicL() |
|
243 { |
|
244 TRACE("CDmAdEngine::RollbackAtomicL"); |
|
245 DEBUG_LOG(_L("Empty method")); |
|
246 } |
|
247 |
|
248 DMAD_EXPORT_C TBool CDmAdEngine::StreamingSupport(TInt& /*aItemSize*/) |
|
249 { |
|
250 TRACE("CDmAdEngine::StreamingSupport"); |
|
251 return EFalse; |
|
252 } |
|
253 |
|
254 DMAD_EXPORT_C void CDmAdEngine::StreamCommittedL() |
|
255 { |
|
256 TRACE("CDmAdEngine::StreamCommittedL"); |
|
257 DEBUG_LOG(_L("Empty method")); |
|
258 } |
|
259 |