|
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 MWspCOMethodCallback.h |
|
18 @warning : This file contains Rose Model ID comments - please do not delete |
|
19 */ |
|
20 |
|
21 #ifndef __MWSPCOMETHODCALLBACK_H__ |
|
22 #define __MWSPCOMETHODCALLBACK_H__ |
|
23 |
|
24 // System includes |
|
25 #include <e32std.h> |
|
26 #include <wsp/wsptypes.h> |
|
27 |
|
28 // Forward class declarations |
|
29 class MWspCOMethodInvoker; |
|
30 class MHTTPDataSupplier; |
|
31 |
|
32 // Types used for arguments in this file (e.g. TWspBearer) are from the Wap namespace |
|
33 using namespace Wap; |
|
34 |
|
35 |
|
36 class MWspCOMethodCallback |
|
37 /** |
|
38 @class MWspCOMethodCallback |
|
39 @since 7.0 |
|
40 The MWspCOMethodInvoker and MWspCOMethodCallback form the API that provides |
|
41 the WSP Connection-Orientated Session Service Method Invocation facility, as |
|
42 described in the WSP Specification, July 2001. |
|
43 |
|
44 The MWspCOMethodInvoker interface is supplied by the Provider entity. The |
|
45 MWspCOMethodCallback interface is supplied by the Client entity. The Provider |
|
46 implements the communications necessary to send the primitives issued by the |
|
47 Client to the Server, and from the Server to the Client. |
|
48 |
|
49 A method transaction can only be invoked under the following circumstances; |
|
50 1) The WSP session is in either the Connecting, Connected or Resuming |
|
51 state. |
|
52 2) The number of of outstanding method transactions has not reached the |
|
53 negotiated Method MOR. |
|
54 Both these circumstances must be statisfied before a method may be invoked. |
|
55 |
|
56 Further, during the capability negotiations, the Protocol Option for Large |
|
57 Data Transfer may be refused (WSP Specification 8.3.2.3). If this is the case, |
|
58 then the use of the S-MethodInvokeData (by the Client) and S-MethodResultData |
|
59 (by the Server) is forbidden. |
|
60 |
|
61 The effect of not supporting LDT is that POST data may not be streamed and |
|
62 must not overflow the negotiated Server SDU size. The amount of allowed data |
|
63 in the S-MethodInvoke.req is dependent on the size of the destination URI |
|
64 and the method headers. A method transaction that exceeds the Server SDU size |
|
65 is aborted by the Client and is not invoked on the Provider. |
|
66 |
|
67 Another case in which the Client may abort a method transaction is when the |
|
68 negotiated Server Message size has been exceeded. This also applies when LDT |
|
69 is supported in the WSP session. The Client aborts the method invocation on |
|
70 the Provider as well. |
|
71 |
|
72 The object that encapsulates the concept of a method transaction implements |
|
73 the call-back API MWspCOMethodCallback. The Provider associates each of |
|
74 these objects with a Transaction Id used to distinguish between method |
|
75 transactions during a WSP session. |
|
76 @publishedAll |
|
77 @deprecated |
|
78 */ |
|
79 { |
|
80 public: // Methods |
|
81 |
|
82 /** @fn MethodInvokeCnf() =0 |
|
83 Intended Usage : This represents the S-MethodInvoke.cnf primitive. The |
|
84 Provider issues this primitive when it has received the |
|
85 response to the method request invocation from the Server |
|
86 (S-MethodInvoke.res). If the negotiated Server Message |
|
87 size has been exceeded by the S-MethodInvoke.ind primitive, |
|
88 then the Provider aborts the method transaction. |
|
89 |
|
90 @since 7.0 |
|
91 @pre The WSP method transaction is in the Requesting state. |
|
92 @post If there are subsequent S-MethodInvokeData.req primitives to |
|
93 be issued for this method request, then the WSP method |
|
94 transaction remains in the Requesting state. If the entire |
|
95 request has been sent to the Server, then the WSP method |
|
96 transaction is in the Waiting state. |
|
97 */ |
|
98 virtual void MethodInvokeCnf() =0; |
|
99 |
|
100 /** @fn MethodInvokeDataCnf() =0 |
|
101 Intended Usage : This represents the S-MethodInvokeData.cnf primitive. |
|
102 The Provider issues this primitive when it has received |
|
103 the response to the method request invocation from the |
|
104 Server (S-MethodInvokeData.res).If the negotiated Server |
|
105 Message size has been exceeded, then the Provider aborts |
|
106 the method transaction. |
|
107 @since 7.0 |
|
108 @pre The WSP method transaction is in the Requesting state. |
|
109 @post If there are subsequent S-MethodInvokeData.req primitives |
|
110 to be issued for this method request, then the WSP method |
|
111 transaction remains in the Requesting state. If the entire |
|
112 request has been sent to the Server, then the WSP method |
|
113 transaction is in the Waiting state. |
|
114 */ |
|
115 virtual void MethodInvokeDataCnf() =0; |
|
116 |
|
117 /** @fn MethodAbortInd(TWspReason aReason) =0 |
|
118 Intended Usage : This represents the S-MethodAbort.ind primitive. This |
|
119 is issued when the method transaction has been aborted. |
|
120 @since 7.0 |
|
121 @param aReason A parameter that indicates the cause of the abort. |
|
122 The value maps to the Reason type defined in the WSP |
|
123 Specification, July 2001. |
|
124 @pre The WSP method transaction is not in the Null state. |
|
125 @post The WSP method transaction is in the Null state. |
|
126 */ |
|
127 virtual void MethodAbortInd(TWspReason aReason) =0; |
|
128 |
|
129 /** @fn MethodResultInd(TInt aStatus, const TDesC8& aResponseHeaders, MHTTPDataSupplier& aResponseBody, TBool aMoreData) =0 |
|
130 Intended Usage : This represents the S-MethodResult.ind primitive. The |
|
131 Provider issues this primitive when it has received the |
|
132 response for this method transaction from the Server. |
|
133 |
|
134 The aMoreData flag indicates whether there are subsequent |
|
135 S-MethodResultData primitives to follow. This is only |
|
136 possible if LDT is supported. |
|
137 |
|
138 If there are subsequent S-MethodResultData primitives |
|
139 for this transaction, then the data supplier object |
|
140 aResponseBody is used to obtain the body data in all the |
|
141 subsequent S-MethodResultData primitives. |
|
142 |
|
143 The Server expects the S-MethodResult.res primitive to |
|
144 be sent from the Client. |
|
145 @since 7.0 |
|
146 @param aStatus A status code whose value is given by |
|
147 the Status types defined in the WSP |
|
148 Specification, July 2001 . |
|
149 @param aResponseHeaders A reference to buffer that provides the |
|
150 encoded response headers. |
|
151 @param aResponseBody A reference to a data supplier object |
|
152 that provides the data associated |
|
153 with the response. |
|
154 @param aMoreDate A flag indicating that there are subsequent |
|
155 S-MethodResultData primitives to follow |
|
156 for this transaction. |
|
157 @pre The WSP method transaction is in the Waiting state. |
|
158 @post If subsequent S-MethodResultData primitives are expected, |
|
159 then the WSP method transaction is in the Waiting2 state. |
|
160 If all the response information has been received, then the |
|
161 WSP method transaction is in the Completing state. |
|
162 */ |
|
163 virtual void MethodResultInd( |
|
164 TInt aStatus, |
|
165 const TDesC8& aResponseHeaders, |
|
166 MHTTPDataSupplier& aResponseBody, |
|
167 TBool aMoreData |
|
168 ) =0; |
|
169 |
|
170 /** @fn MethodResultDataInd(const TDesC8& aTrailerHeaders, TBool aMoreData) =0 |
|
171 Intended Usage : This represents the S-MethodResultData.ind primitive. |
|
172 The Provider sends more data associated with a |
|
173 previous S-MethodResult.ind primitive. |
|
174 |
|
175 The remaining body data is obtained using the data |
|
176 supplier object aResponseBody provided to the Client |
|
177 as a parameter of the previous call to MethodResultInd(). |
|
178 |
|
179 The aMoreData flag indicates whether there are subsequent |
|
180 S-MethodResultData primitives to follow. |
|
181 |
|
182 If there are trailer headers these are provided by the |
|
183 input parameter aTrailerHeaders. This is only valid if |
|
184 this is the last S-MethodResultData primitive. |
|
185 |
|
186 The Server expects the S-MethodResultData.res primitive |
|
187 to be sent from the Client. |
|
188 @since 7.0 |
|
189 @param aTrailerHeaders A reference to a buffer with the encoded |
|
190 trailer headers. This must be empty unless |
|
191 this is the last S-MethodResultData |
|
192 primitive. |
|
193 @param aMoreDate A flag indicating that there are subsequent |
|
194 S-MethodResultData primitives to follow for |
|
195 this transaction. |
|
196 @pre The WSP method transaction is in the Waiting2 state. |
|
197 @post If subsequent S-MethodResultData primitives are expected, |
|
198 then the WSP method transaction is in the Waiting2 state. |
|
199 If all the response information has been received, then the |
|
200 WSP method transaction is in the Completing state. |
|
201 */ |
|
202 virtual void MethodResultDataInd(const TDesC8& aTrailerHeaders, TBool aMoreData) =0; |
|
203 |
|
204 }; |
|
205 |
|
206 #endif // __MWSPCOMETHODCALLBACK_H__ |