|
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file CWspTransportHandler.h |
|
18 @warning : This file contains Rose Model ID comments - please do not delete |
|
19 */ |
|
20 |
|
21 #ifndef __CWSPTRANSPORTHANDLER_H__ |
|
22 #define __CWSPTRANSPORTHANDLER_H__ |
|
23 |
|
24 // System includes |
|
25 #include <e32base.h> |
|
26 #include <stringpool.h> |
|
27 #include <http/framework/csecuritypolicy.h> |
|
28 |
|
29 // Forward class declarations |
|
30 class MWspCOSessionCallback; |
|
31 class MWspProxyInfoProvider; |
|
32 class MWspCapabilityProvider; |
|
33 class MWspSessionHeadersProvider; |
|
34 class MWspCOSessionInvoker; |
|
35 class MWspCOMethodInvoker; |
|
36 class MWspCOPushInvoker; |
|
37 class MWspCLMethodInvoker; |
|
38 class MWspCLPushInvoker; |
|
39 |
|
40 |
|
41 //##ModelId=3BBD849A0269 |
|
42 class CWspTransportHandler : public CBase, public MSecurityPolicy |
|
43 /** |
|
44 @since 7.0 |
|
45 The WSP Transport Handler API. The WSP TH provides its client with WSP services. |
|
46 It defines a set of interfaces that abstract the behaviour of the top-level of a |
|
47 WAP protocol stack - ie. the WSP layer. |
|
48 |
|
49 Five distinct services are offered: |
|
50 |
|
51 * MWspCOSessionInvoker a Connection-Oriented Session service. |
|
52 |
|
53 * MWspCOMethodInvoker a Connection-Oriented Transaction service. |
|
54 |
|
55 * MWspCOPushInvoker a Connection-Oriented Push service. |
|
56 |
|
57 * MWspCLMethodInvoker a Connection-Less Session service. |
|
58 |
|
59 * MWspCLPushInvoker a Connection-Less Push service. |
|
60 |
|
61 The API is specified as an ECOM interface. Specific implementations may offer |
|
62 some or all of the five services. |
|
63 |
|
64 All implementations must provide default security policy settings via the |
|
65 MSecurityPolicy interface. The defaults shall be used when no security policy |
|
66 plug-in is supplied by the caller of CWspTransportHandler::NewL(). This might |
|
67 occur if the plug-in could not be located on the device, |
|
68 @publishedAll |
|
69 @deprecated |
|
70 */ |
|
71 { |
|
72 public: // type definitions and enumerations |
|
73 |
|
74 /** A bit-field type that is set to contain a union of the services supported by the |
|
75 WSP transport handler. |
|
76 */ |
|
77 typedef TUint8 TWspSupportedServices; |
|
78 |
|
79 /** The five different service types that may be supported |
|
80 */ |
|
81 enum TWspService |
|
82 { |
|
83 ECOSessionService = 0x01, |
|
84 ECOMethodInvocationService = 0x02, |
|
85 ECOPushService = 0x04, |
|
86 ECLSessionService = 0x08, |
|
87 ECLPushService = 0x10 |
|
88 }; |
|
89 |
|
90 public: // methods |
|
91 |
|
92 /**Factory construction - instantiates the transport handler plug-in. |
|
93 @since 7.0 |
|
94 @param aStringPool (in) An open string pool reference. |
|
95 @param aSecurityPolicy (in) (optional) A security policy provider |
|
96 @param aSessionCB (in) A client callback API for CO session events. |
|
97 @param aProxyInfoProv (in) A client API that provides WAP proxy details |
|
98 @param aCapProv (in) A client API for capability negotatiation. |
|
99 @param aSessHdrProv (in) A client API for exchange of session headers |
|
100 @return The constructed plug-in. |
|
101 @leave KErrNotFound - if an ECOM implementation of the interface is not present on the device. |
|
102 @leave It could also leave with other ECOM error codes. |
|
103 */ |
|
104 //##ModelId=3C4C453103DD |
|
105 inline static CWspTransportHandler* NewL(RStringPool aStringPool, |
|
106 MSecurityPolicy* aSecurityPolicy, |
|
107 MWspCOSessionCallback& aSessionCB, |
|
108 MWspProxyInfoProvider& aProxyInfoProv, |
|
109 MWspCapabilityProvider& aCapProv, |
|
110 MWspSessionHeadersProvider& aSessHdrProv); |
|
111 |
|
112 /**Class destructor. |
|
113 @since 7.0 |
|
114 */ |
|
115 //##ModelId=3C4C453103AB |
|
116 inline virtual ~CWspTransportHandler(); |
|
117 |
|
118 public: // General API methods |
|
119 |
|
120 /**Query the services supported by this instantiation of the WSP |
|
121 transport handler plug-in. |
|
122 @since 7.0 |
|
123 @return A union of flags describing the services supported by the WSP transport |
|
124 handler |
|
125 */ |
|
126 //##ModelId=3C4C45310256 |
|
127 virtual TWspSupportedServices SupportedServices() const = 0; |
|
128 |
|
129 /** Get the Server Certificate for the current session. |
|
130 @param aServerCert A TCertInfo which will be filled with the certificate information |
|
131 @return An error code. KErrNone if aServerCert has been completed, otherwise one of |
|
132 the system wide error codes |
|
133 */ |
|
134 virtual TInt ServerCert(TCertInfo& aCertInfo) const = 0; |
|
135 |
|
136 /** Get the Server Certificate for this session. |
|
137 @return The certificate information (in an CWtlsCertificate object) |
|
138 or NULL if it is not available. |
|
139 */ |
|
140 virtual const CCertificate* ServerCert() = 0; |
|
141 |
|
142 public: // Connection-Oriented WSP API methods |
|
143 |
|
144 /**Obtain the connection-oriented session invocation API. |
|
145 @since 7.0 |
|
146 @return The API object that should be used by the client for CO session |
|
147 invocations. |
|
148 @leave This method will panic if the service isn't supported by a particular |
|
149 implementation of the API. |
|
150 */ |
|
151 //##ModelId=3BC577C202B2 |
|
152 virtual MWspCOSessionInvoker& COSessionInvoker() = 0; |
|
153 |
|
154 /**Obtain the connection-oriented transaction invocation API. |
|
155 @since 7.0 |
|
156 @return The API object that should be used by the client for transaction |
|
157 invocations. |
|
158 @leave This method will panic if the service isn't supported by a particular |
|
159 implementation of the API. |
|
160 */ |
|
161 //##ModelId=3BC577C70165 |
|
162 virtual MWspCOMethodInvoker& COTransactionInvoker() = 0; |
|
163 |
|
164 /**Obtain the connection-oriented push invocation API. |
|
165 @since 7.0 |
|
166 @return The API object that should be used by the client to signal |
|
167 readiness to receive CO push invocations. |
|
168 @leave This method will panic if the service isn't supported by a particular |
|
169 implementation of the API. |
|
170 */ |
|
171 //##ModelId=3C4C45310206 |
|
172 virtual MWspCOPushInvoker& COPushInvoker() = 0; |
|
173 |
|
174 public: // Connection-Less WSP API methods |
|
175 |
|
176 /**Obtain the connection-less method invocation API. |
|
177 @since 7.0 |
|
178 @return The API object that should be used by the client for CL method |
|
179 invocations. |
|
180 @leave This method will panic if the service isn't supported by a particular |
|
181 implementation of the API. |
|
182 */ |
|
183 //##ModelId=3C4C453101DE |
|
184 virtual MWspCLMethodInvoker& CLMethodInvoker() = 0; |
|
185 |
|
186 /**Obtain the connection-less push invocation API. |
|
187 @since 7.0 |
|
188 @return The API object that should be used by the client to signal |
|
189 readiness to receive CL push invocations. |
|
190 @leave This method will panic if the service isn't supported by a particular |
|
191 implementation of the API. |
|
192 */ |
|
193 //##ModelId=3C4C453101CA |
|
194 virtual MWspCLPushInvoker& CLPushInvoker() = 0; |
|
195 |
|
196 protected: // type definitions |
|
197 /** |
|
198 @struct SInstantiationParams |
|
199 A structure containing the instantiation parameters to NewL, passed across |
|
200 via ECOM to the sub-class NewL |
|
201 */ |
|
202 struct SInstantiationParams |
|
203 { |
|
204 /** |
|
205 An open string pool reference. |
|
206 */ |
|
207 RStringPool* iStringPool; |
|
208 /** |
|
209 The security policy plugin. |
|
210 */ |
|
211 MSecurityPolicy* iSecurityPolicy; |
|
212 /** |
|
213 A client callback API for CO session events. |
|
214 */ |
|
215 MWspCOSessionCallback* iSessionCB; |
|
216 /** |
|
217 A client API that provides WAP proxy details. |
|
218 */ |
|
219 MWspProxyInfoProvider* iProxyInfoProv; |
|
220 /** |
|
221 A client API for capability negotatiation. |
|
222 */ |
|
223 MWspCapabilityProvider* iCapProv; |
|
224 /** |
|
225 A client API for exchange of session headers. |
|
226 */ |
|
227 MWspSessionHeadersProvider* iSessHdrProv; |
|
228 }; |
|
229 |
|
230 protected: // methods |
|
231 |
|
232 /**Normal constructor. Creates an instance of the plug-in base. |
|
233 @since 7.0 |
|
234 @param aStringPool (in) An open string pool reference. |
|
235 @param aSecurityPolicy (in) (optional) A security policy plug-in instance |
|
236 @param aSessionCB (in) A client callback API for CO session events. |
|
237 @param aProxyInfoProv (in) A client API that provides WAP proxy details |
|
238 @param aCapProv (in) A client API for capability negotatiation. |
|
239 @param aSessHdrProv (in) A client API for exchange of session headers |
|
240 @return The constructed plug-in. |
|
241 */ |
|
242 inline CWspTransportHandler(RStringPool aStringPool, |
|
243 MSecurityPolicy* aSecurityPolicy, |
|
244 MWspCOSessionCallback& aSessionCB, |
|
245 MWspProxyInfoProvider& aProxyInfoProv, |
|
246 MWspCapabilityProvider& aCapProv, |
|
247 MWspSessionHeadersProvider& aSessHdrProv); |
|
248 |
|
249 protected: // attributes |
|
250 |
|
251 /** Handle for a string pool used by the WSP transport handler. This is owned |
|
252 and managed elsewhere. |
|
253 */ |
|
254 //##ModelId=3C4C453101A2 |
|
255 RStringPool iStringPool; |
|
256 |
|
257 /** An optional security policy plug-in. If a plug-in was not supplied, the |
|
258 value is NULL. |
|
259 */ |
|
260 //##ModelId=3C4C4531018E |
|
261 MSecurityPolicy* iSecurityPolicy; |
|
262 |
|
263 /** The client's callback for session events |
|
264 */ |
|
265 //##ModelId=3C4C4531017C |
|
266 MWspCOSessionCallback& iSessionCB; |
|
267 |
|
268 /** The client's provider of proxy information |
|
269 */ |
|
270 //##ModelId=3C4C45310170 |
|
271 MWspProxyInfoProvider& iProxyInfoProv; |
|
272 |
|
273 /** The client's provider of capabilities information |
|
274 */ |
|
275 //##ModelId=3C4C4531015C |
|
276 MWspCapabilityProvider& iCapProv; |
|
277 |
|
278 /** THe client's provider of session headers |
|
279 */ |
|
280 //##ModelId=3C4C45310148 |
|
281 MWspSessionHeadersProvider& iSessHdrProv; |
|
282 |
|
283 private: // attributes |
|
284 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
285 /** D'tor Key identification required for ECOM |
|
286 @internalAll |
|
287 */ |
|
288 #else |
|
289 /** D'tor Key identification required for ECOM |
|
290 */ |
|
291 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS |
|
292 //##ModelId=3C4C45310134 |
|
293 TUid iDtor_ID_Key; |
|
294 }; |
|
295 |
|
296 #include <wsp/cwsptransporthandler.inl> |
|
297 |
|
298 #endif // __CWSPTRANSPORTHANDLER_H__ |