|
1 /* |
|
2 * Copyright (c) 2000-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: VPN OMA DM Adapter |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include <e32base.h> |
|
21 #include <ecom/implementationproxy.h> |
|
22 |
|
23 #include "dmadadapter.h" |
|
24 #include "dmadadapterimplconst.h" |
|
25 #include "dmadengine.h" |
|
26 #include "DmAdStore.h" |
|
27 #include "dmadddf.h" |
|
28 #include "dmadrtnodedataapic.h" |
|
29 #include "vpnlogger.h" |
|
30 |
|
31 #if defined(_DEBUG) |
|
32 _LIT(KDmAdLogFolder,"vpn"); |
|
33 _LIT(KDmAdLogFile,"dmadipsecvpn.txt"); |
|
34 #endif |
|
35 |
|
36 |
|
37 //=================================================================================================== |
|
38 |
|
39 #ifndef IMPLEMENTATION_PROXY_ENTRY |
|
40 #define IMPLEMENTATION_PROXY_ENTRY(aUid, aFuncPtr) {{aUid},(aFuncPtr)} |
|
41 #endif |
|
42 |
|
43 const TImplementationProxy ImplementationTable[] = |
|
44 { |
|
45 IMPLEMENTATION_PROXY_ENTRY(KDmAdImplUid, CDmAdAdapter::NewL) |
|
46 }; |
|
47 |
|
48 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) |
|
49 { |
|
50 aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); |
|
51 return ImplementationTable; |
|
52 } |
|
53 |
|
54 |
|
55 //=================================================================================================== |
|
56 |
|
57 CDmAdAdapter* CDmAdAdapter::NewL(MSmlDmCallback* aDmCallback) |
|
58 { |
|
59 CDmAdAdapter* self = NewLC(aDmCallback); |
|
60 CleanupStack::Pop(); |
|
61 return self; |
|
62 } |
|
63 |
|
64 CDmAdAdapter* CDmAdAdapter::NewLC(MSmlDmCallback* aDmCallback) |
|
65 { |
|
66 INITIALIZE_DEBUG_LOG_L(KDmAdLogFolder, KDmAdLogFile); |
|
67 DEBUG_LOG(_L("LOGGING INITIALIZED")); |
|
68 |
|
69 CDmAdAdapter* self = new (ELeave) CDmAdAdapter(aDmCallback); |
|
70 CleanupStack::PushL(self); |
|
71 self->ConstructL(aDmCallback); |
|
72 return self; |
|
73 } |
|
74 |
|
75 void CDmAdAdapter::ConstructL(MSmlDmCallback* aDmCallback) |
|
76 { |
|
77 TRACE("CDmAdAdapter::ConstructL"); |
|
78 |
|
79 iCallBack = CDmAdCallBack::NewL(aDmCallback, KDmAdOwnAdUriForGetLuidAllocLFix); |
|
80 iStore = CDmAdStore::NewL(); |
|
81 iDdf = CDmAdDdf::NewL(iCallBack, iStore); |
|
82 iRtNodeDataApi = CDmAdRtNodeDataApi::NewL(); |
|
83 iEngine = CDmAdEngine::NewL(iCallBack, iStore, iDdf, iRtNodeDataApi); |
|
84 } |
|
85 |
|
86 CDmAdAdapter::CDmAdAdapter(MSmlDmCallback* aDmCallback) : |
|
87 CSmlDmAdapter(aDmCallback) |
|
88 { |
|
89 TRACE("CDmAdAdapter::CDmAdAdapter"); |
|
90 } |
|
91 |
|
92 CDmAdAdapter::~CDmAdAdapter() |
|
93 { |
|
94 DEBUG_LOG(_L("CDmAdAdapter::~CDmAdAdapter")); |
|
95 delete iEngine; |
|
96 delete iRtNodeDataApi; |
|
97 delete iDdf; |
|
98 delete iStore; |
|
99 delete iCallBack; |
|
100 |
|
101 DEBUG_LOG(_L("FINALIZING LOGGING")); |
|
102 FINALIZE_DEBUG_LOG; |
|
103 } |
|
104 |
|
105 //=================================================================================================== |
|
106 |
|
107 void CDmAdAdapter::DDFVersionL(CBufBase& aDDFVersion) |
|
108 { |
|
109 TRACE("CDmAdAdapter::DDFVersionL"); |
|
110 iDdf->BuildDDFVersionL(aDDFVersion); |
|
111 } |
|
112 |
|
113 void CDmAdAdapter::DDFStructureL(MSmlDmDDFObject& aDDF) |
|
114 { |
|
115 TRACE("CDmAdAdapter::DDFStructureL"); |
|
116 iDdf->BuildDDFStructureL(aDDF); |
|
117 } |
|
118 |
|
119 |
|
120 void CDmAdAdapter::ChildURIListL(const TDesC8& aUri, const TDesC8& aParentLuid, const CArrayFix<TSmlDmMappingInfo>& aPreviousUriSegmentList, TInt aResultsRef, TInt aStatusRef) |
|
121 { |
|
122 TRACE("CDmAdAdapter::ChildURIListL"); |
|
123 DEBUG_LOG1(_L8("aUri = %S"), &aUri); |
|
124 |
|
125 iEngine->ChildURIListL(aUri, aParentLuid, aPreviousUriSegmentList, aResultsRef, aStatusRef); |
|
126 } |
|
127 |
|
128 void CDmAdAdapter::AddNodeObjectL(const TDesC8& aUri, const TDesC8& aParentLuid, TInt aStatusRef) |
|
129 { |
|
130 TRACE("CDmAdAdapter::AddNodeObjectL"); |
|
131 |
|
132 DEBUG_LOG1(_L8("aUri = %S"), &aUri); |
|
133 DEBUG_LOG1(_L8("aParentLuid = %S"), &aParentLuid); |
|
134 DEBUG_LOG1(_L("aStatusRef = %d"), aStatusRef); |
|
135 |
|
136 iEngine->AddNodeObjectL(aUri, aParentLuid, aStatusRef); |
|
137 } |
|
138 |
|
139 void CDmAdAdapter::UpdateLeafObjectL(const TDesC8& aUri, const TDesC8& aLuid, const TDesC8& aObject, const TDesC8& aType, TInt aStatusRef) |
|
140 { |
|
141 TRACE("CDmAdAdapter::UpdateLeafObjectL"); |
|
142 |
|
143 DEBUG_LOG1(_L8("aUri = %S"), &aUri); |
|
144 DEBUG_LOG1(_L8("aLuid = %S"), &aLuid); |
|
145 DEBUG_LOG(_L8("aObject:")); |
|
146 DEBUG_LOG_HEX(aObject); |
|
147 DEBUG_LOG1(_L8("aType = %S"), &aType); |
|
148 DEBUG_LOG1(_L("aStatusRef = %d"), aStatusRef); |
|
149 |
|
150 iEngine->UpdateLeafObjectL(aUri, aLuid, aObject, aType, aStatusRef); |
|
151 } |
|
152 |
|
153 void CDmAdAdapter::FetchLeafObjectL(const TDesC8& aUri, const TDesC8& aLuid, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef) |
|
154 { |
|
155 TRACE("CDmAdAdapter::FetchLeafObjectL"); |
|
156 DEBUG_LOG1(_L8("aUri = %S"), &aUri); |
|
157 |
|
158 iEngine->FetchLeafObjectL(aUri, aLuid, aType, aResultsRef, aStatusRef); |
|
159 } |
|
160 |
|
161 void CDmAdAdapter::DeleteObjectL(const TDesC8& aUri, const TDesC8& aLuid, TInt aStatusRef) |
|
162 { |
|
163 TRACE("CDmAdAdapter::DeleteObjectL"); |
|
164 DEBUG_LOG1(_L8("aUri = %S"), &aUri); |
|
165 |
|
166 iEngine->DeleteObjectL(aUri, aLuid, aStatusRef); |
|
167 } |
|
168 |
|
169 void CDmAdAdapter::CompleteOutstandingCmdsL() |
|
170 { |
|
171 TRACE("CDmAdAdapter::CompleteOutstandingCmdsL"); |
|
172 iEngine->CompleteOutstandingCmdsL(); |
|
173 } |
|
174 |
|
175 void CDmAdAdapter::UpdateLeafObjectL(const TDesC8& aUri, |
|
176 const TDesC8& aLuid, |
|
177 RWriteStream*& aStream, |
|
178 const TDesC8& aType, |
|
179 TInt aStatusRef) |
|
180 { |
|
181 TRACE("CDmAdAdapter::UpdateLeafObjectL"); |
|
182 iEngine->UpdateLeafObjectL(aUri, aLuid, aStream, aType, aStatusRef); |
|
183 } |
|
184 |
|
185 void CDmAdAdapter::FetchLeafObjectSizeL(const TDesC8& aUri, |
|
186 const TDesC8& aLuid, |
|
187 const TDesC8& aType, |
|
188 TInt aResultsRef, |
|
189 TInt aStatusRef) |
|
190 { |
|
191 TRACE("CDmAdAdapter::FetchLeafObjectSizeL"); |
|
192 DEBUG_LOG1(_L8("aUri = %S"), &aUri); |
|
193 |
|
194 iEngine->FetchLeafObjectSizeL(aUri, aLuid, aType, aResultsRef, aStatusRef); |
|
195 } |
|
196 |
|
197 void CDmAdAdapter::ExecuteCommandL(const TDesC8& aUri, |
|
198 const TDesC8& aLuid, |
|
199 const TDesC8& aArgument, |
|
200 const TDesC8& aType, |
|
201 TInt aStatusRef) |
|
202 { |
|
203 TRACE("CDmAdAdapter::ExecuteCommandL"); |
|
204 DEBUG_LOG1(_L8("aUri = %S"), &aUri); |
|
205 |
|
206 iEngine->ExecuteCommandL(aUri, aLuid, aArgument, aType, aStatusRef); |
|
207 } |
|
208 |
|
209 void CDmAdAdapter::ExecuteCommandL(const TDesC8& aUri, |
|
210 const TDesC8& aLuid, |
|
211 RWriteStream*& aStream, |
|
212 const TDesC8& aType, |
|
213 TInt aStatusRef) |
|
214 { |
|
215 TRACE("CDmAdAdapter::ExecuteCommandL"); |
|
216 DEBUG_LOG1(_L8("aUri = %S"), &aUri); |
|
217 |
|
218 iEngine->ExecuteCommandL(aUri, aLuid, aStream, aType, aStatusRef); |
|
219 } |
|
220 |
|
221 void CDmAdAdapter::CopyCommandL(const TDesC8& aTargetUri, |
|
222 const TDesC8& aTargetLuid, |
|
223 const TDesC8& aSourceUri, |
|
224 const TDesC8& aSourceLuid, |
|
225 const TDesC8& aType, |
|
226 TInt aStatusRef) |
|
227 { |
|
228 TRACE("CDmAdAdapter::CopyCommandL"); |
|
229 |
|
230 iEngine->CopyCommandL(aTargetUri, aTargetLuid, aSourceUri, aSourceLuid, aType, aStatusRef); |
|
231 } |
|
232 |
|
233 void CDmAdAdapter::StartAtomicL() |
|
234 { |
|
235 TRACE("CDmAdAdapter::StartAtomicL"); |
|
236 iEngine->StartAtomicL(); |
|
237 } |
|
238 |
|
239 void CDmAdAdapter::CommitAtomicL() |
|
240 { |
|
241 TRACE("CDmAdAdapter::CommitAtomicL"); |
|
242 iEngine->CommitAtomicL(); |
|
243 } |
|
244 |
|
245 void CDmAdAdapter::RollbackAtomicL() |
|
246 { |
|
247 TRACE("CDmAdAdapter::RollbackAtomicL"); |
|
248 iEngine->RollbackAtomicL(); |
|
249 } |
|
250 |
|
251 TBool CDmAdAdapter::StreamingSupport(TInt& aItemSize) |
|
252 { |
|
253 TRACE("CDmAdAdapter::StreamingSupport"); |
|
254 return iEngine->StreamingSupport(aItemSize); |
|
255 } |
|
256 |
|
257 void CDmAdAdapter::StreamCommittedL() |
|
258 { |
|
259 TRACE("CDmAdAdapter::StreamCommittedL"); |
|
260 iEngine->StreamCommittedL(); |
|
261 } |
|
262 |
|
263 |