1 martin 1.35 //%LICENSE////////////////////////////////////////////////////////////////
2 //
3 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
16 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 martin 1.35 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 karl 1.30 //
|
28 martin 1.35 //////////////////////////////////////////////////////////////////////////
|
29 schuur 1.1 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_OperationResponseHandler_h
33 #define Pegasus_OperationResponseHandler_h
34
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/CIMMessage.h>
37 #include <Pegasus/Common/MessageQueueService.h>
38 #include <Pegasus/Common/Constants.h>
39
40 #include <Pegasus/Common/CIMClass.h>
41 #include <Pegasus/Common/CIMInstance.h>
42 #include <Pegasus/Common/CIMIndication.h>
43 #include <Pegasus/Common/CIMValue.h>
44
|
45 chip 1.14 #include <Pegasus/Common/OperationContext.h>
46 #include <Pegasus/Common/OperationContextInternal.h>
47
48 #include <Pegasus/Common/ObjectNormalizer.h>
|
49 chip 1.25
|
50 schuur 1.1 #include <Pegasus/Common/ResponseHandler.h>
|
51 chip 1.25 #include <Pegasus/ProviderManager2/SimpleResponseHandler.h>
|
52 schuur 1.1
53 #include <Pegasus/ProviderManager2/Linkage.h>
54
55 PEGASUS_NAMESPACE_BEGIN
56
|
57 kumpf 1.31 typedef void (*PEGASUS_RESPONSE_CHUNK_CALLBACK_T)(
58 CIMRequestMessage* request, CIMResponseMessage* response);
59
|
60 schuur 1.1 class PEGASUS_PPM_LINKAGE OperationResponseHandler
61 {
|
62 chip 1.11 friend class SimpleResponseHandler;
|
63 brian.campbell 1.9
|
64 schuur 1.1 public:
|
65 chip 1.11 OperationResponseHandler(
|
66 kumpf 1.31 CIMRequestMessage* request,
67 CIMResponseMessage* response,
68 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
69 schuur 1.1
|
70 kumpf 1.34 virtual ~OperationResponseHandler();
|
71 chip 1.11
|
72 kumpf 1.34 CIMRequestMessage* getRequest() const;
|
73 chip 1.25
|
74 kumpf 1.34 CIMResponseMessage* getResponse() const;
|
75 schuur 1.1
|
76 chip 1.11 virtual void setStatus(
77 const Uint32 code,
|
78 kumpf 1.34 const String& message = String::EMPTY);
|
79 schuur 1.1
|
80 chip 1.11 virtual void setStatus(
81 const Uint32 code,
|
82 kumpf 1.34 const ContentLanguageList& langs,
83 const String& message = String::EMPTY);
|
84 schuur 1.1
|
85 mike 1.33 virtual void setCIMException(const CIMException& cimException);
86
|
87 schuur 1.1 protected:
|
88 chip 1.11 // the default for all derived handlers. Some handlers may not apply
89 // async behavior because their callers cannot handle partial responses.
|
90 kumpf 1.34 virtual Boolean isAsync() const;
|
91 brian.campbell 1.9
|
92 chip 1.11 // send (deliver) asynchronously
93 virtual void send(Boolean isComplete);
|
94 brian.campbell 1.9
|
95 chip 1.11 // transfer any objects from handler to response. this does not clear()
|
96 kumpf 1.34 virtual void transfer();
|
97 brian.campbell 1.9
|
98 chip 1.11 // validate whatever is necessary before the transfer
|
99 kumpf 1.34 virtual void validate();
|
100 chip 1.25
|
101 kumpf 1.34 virtual String getClass() const;
|
102 chip 1.25
|
103 kumpf 1.34 Uint32 getResponseObjectTotal() const;
|
104 brian.campbell 1.9
|
105 chip 1.11 // there can be many objects per message (or none at all - i.e complete())
|
106 kumpf 1.34 Uint32 getResponseMessageTotal() const;
|
107 chip 1.25
|
108 kumpf 1.34 Uint32 getResponseObjectThreshold() const;
|
109 brian.campbell 1.9
|
110 kumpf 1.34 CIMRequestMessage* _request;
111 CIMResponseMessage* _response;
|
112 kumpf 1.31 PEGASUS_RESPONSE_CHUNK_CALLBACK_T _responseChunkCallback;
|
113 schuur 1.1
|
114 brian.campbell 1.9 private:
|
115 chip 1.11 Uint32 _responseObjectTotal;
116 Uint32 _responseMessageTotal;
117 Uint32 _responseObjectThreshold;
118
|
119 schuur 1.1 };
120
|
121 kumpf 1.34 class PEGASUS_PPM_LINKAGE GetInstanceResponseHandler :
122 public OperationResponseHandler, public SimpleInstanceResponseHandler
|
123 chip 1.11 {
124 public:
125 GetInstanceResponseHandler(
|
126 kumpf 1.31 CIMGetInstanceRequestMessage* request,
127 CIMGetInstanceResponseMessage* response,
128 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
129 chip 1.25
|
130 kumpf 1.34 virtual void deliver(const CIMInstance& cimInstance);
131 virtual void deliver(const Array<CIMInstance>& cimInstanceArray)
|
132 kumpf 1.28 {
133 SimpleInstanceResponseHandler::deliver(cimInstanceArray);
134 }
135
|
136 kumpf 1.34 virtual void complete();
|
137 chip 1.25
138 protected:
|
139 kumpf 1.34 virtual String getClass() const;
|
140 chip 1.25
|
141 kumpf 1.34 virtual void transfer();
|
142 chip 1.25
|
143 kumpf 1.34 virtual void validate();
|
144 chip 1.14
145 private:
146 ObjectNormalizer _normalizer;
147
|
148 schuur 1.1 };
149
|
150 kumpf 1.34 class PEGASUS_PPM_LINKAGE EnumerateInstancesResponseHandler :
151 public OperationResponseHandler, public SimpleInstanceResponseHandler
|
152 schuur 1.1 {
153 public:
|
154 chip 1.11 EnumerateInstancesResponseHandler(
|
155 kumpf 1.31 CIMEnumerateInstancesRequestMessage* request,
156 CIMEnumerateInstancesResponseMessage* response,
157 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
158 chip 1.25
|
159 kumpf 1.34 virtual void deliver(const CIMInstance& cimInstance);
160 virtual void deliver(const Array<CIMInstance>& cimInstanceArray)
|
161 kumpf 1.28 {
162 SimpleInstanceResponseHandler::deliver(cimInstanceArray);
163 }
|
164 chip 1.11
|
165 chip 1.25 protected:
|
166 kumpf 1.34 virtual String getClass() const;
|
167 chip 1.25
|
168 kumpf 1.34 virtual void transfer();
|
169 chip 1.14
170 private:
171 ObjectNormalizer _normalizer;
172
|
173 schuur 1.1 };
174
|
175 kumpf 1.34 class PEGASUS_PPM_LINKAGE EnumerateInstanceNamesResponseHandler :
176 public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
177 schuur 1.1 {
178 public:
|
179 chip 1.11 EnumerateInstanceNamesResponseHandler(
|
180 kumpf 1.31 CIMEnumerateInstanceNamesRequestMessage* request,
181 CIMEnumerateInstanceNamesResponseMessage* response,
182 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
183 chip 1.11
|
184 kumpf 1.34 virtual void deliver(const CIMObjectPath& cimObjectPath);
185 virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
|
186 kumpf 1.28 {
187 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
188 }
|
189 chip 1.25
190 protected:
|
191 kumpf 1.34 virtual String getClass() const;
|
192 chip 1.25
|
193 kumpf 1.34 virtual void transfer();
|
194 chip 1.14
195 private:
196 ObjectNormalizer _normalizer;
197
|
198 schuur 1.1 };
199
|
200 kumpf 1.34 class PEGASUS_PPM_LINKAGE CreateInstanceResponseHandler :
201 public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
202 schuur 1.1 {
203 public:
|
204 chip 1.11 CreateInstanceResponseHandler(
|
205 kumpf 1.31 CIMCreateInstanceRequestMessage* request,
206 CIMCreateInstanceResponseMessage* response,
207 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
208 chip 1.25
|
209 kumpf 1.34 virtual void deliver(const CIMObjectPath& cimObjectPath);
210 virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
|
211 kumpf 1.28 {
212 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
213 }
214
|
215 kumpf 1.34 virtual void complete();
|
216 chip 1.25
217 protected:
|
218 kumpf 1.34 virtual String getClass() const;
|
219 chip 1.25
|
220 kumpf 1.34 virtual void transfer();
|
221 chip 1.25
|
222 schuur 1.1 };
223
|
224 kumpf 1.34 class PEGASUS_PPM_LINKAGE ModifyInstanceResponseHandler :
225 public OperationResponseHandler, public SimpleResponseHandler
|
226 schuur 1.1 {
227 public:
|
228 chip 1.11 ModifyInstanceResponseHandler(
|
229 kumpf 1.31 CIMModifyInstanceRequestMessage* request,
230 CIMModifyInstanceResponseMessage* response,
231 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
232 chip 1.11
|
233 chip 1.18 protected:
|
234 kumpf 1.34 virtual String getClass() const;
|
235 chip 1.25
|
236 schuur 1.1 };
237
|
238 kumpf 1.34 class PEGASUS_PPM_LINKAGE DeleteInstanceResponseHandler :
239 public OperationResponseHandler, public SimpleResponseHandler
|
240 schuur 1.1 {
241 public:
|
242 chip 1.11 DeleteInstanceResponseHandler(
|
243 kumpf 1.31 CIMDeleteInstanceRequestMessage* request,
244 CIMDeleteInstanceResponseMessage* response,
245 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
246 chip 1.11
|
247 chip 1.18 protected:
|
248 kumpf 1.34 virtual String getClass() const;
|
249 chip 1.11
|
250 schuur 1.1 };
251
|
252 kumpf 1.34 class PEGASUS_PPM_LINKAGE GetPropertyResponseHandler :
253 public OperationResponseHandler, public SimpleValueResponseHandler
|
254 schuur 1.1 {
255 public:
|
256 chip 1.11 GetPropertyResponseHandler(
|
257 kumpf 1.31 CIMGetPropertyRequestMessage* request,
258 CIMGetPropertyResponseMessage* response,
259 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
260 chip 1.25
|
261 kumpf 1.34 virtual void deliver(const CIMValue& cimValue);
262 virtual void deliver(const Array<CIMValue>& cimValueArray)
|
263 kumpf 1.28 {
264 SimpleValueResponseHandler::deliver(cimValueArray);
265 }
|
266 chip 1.25
267 protected:
|
268 kumpf 1.34 virtual String getClass() const;
|
269 chip 1.25
|
270 kumpf 1.34 virtual void transfer();
|
271 chip 1.25
|
272 kumpf 1.34 virtual void validate();
|
273 chip 1.25
|
274 schuur 1.1 };
275
|
276 kumpf 1.34 class PEGASUS_PPM_LINKAGE SetPropertyResponseHandler :
277 public OperationResponseHandler, public SimpleResponseHandler
|
278 schuur 1.1 {
279 public:
|
280 chip 1.11 SetPropertyResponseHandler(
|
281 kumpf 1.31 CIMSetPropertyRequestMessage* request,
282 CIMSetPropertyResponseMessage* response,
283 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
284 chip 1.11
|
285 chip 1.18 protected:
|
286 kumpf 1.34 virtual String getClass() const;
|
287 chip 1.11
|
288 schuur 1.1 };
289
|
290 kumpf 1.34 class PEGASUS_PPM_LINKAGE ExecQueryResponseHandler :
291 public OperationResponseHandler,
292 public SimpleInstance2ObjectResponseHandler
|
293 schuur 1.1 {
294 public:
|
295 chip 1.11 ExecQueryResponseHandler(
|
296 kumpf 1.31 CIMExecQueryRequestMessage* request,
297 CIMExecQueryResponseMessage* response,
298 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
299 chip 1.25
|
300 kumpf 1.34 virtual void deliver(const CIMInstance& cimInstance);
301 virtual void deliver(const Array<CIMInstance>& cimInstanceArray)
|
302 kumpf 1.28 {
303 SimpleInstance2ObjectResponseHandler::deliver(cimInstanceArray);
304 }
|
305 chip 1.25
306 protected:
|
307 kumpf 1.34 virtual String getClass() const;
|
308 chip 1.25
|
309 kumpf 1.34 virtual void transfer();
|
310 chip 1.25
|
311 kumpf 1.34 virtual Boolean isAsync() const;
|
312 chip 1.25
|
313 schuur 1.1 };
314
|
315 kumpf 1.34 class PEGASUS_PPM_LINKAGE AssociatorsResponseHandler :
316 public OperationResponseHandler, public SimpleObjectResponseHandler
|
317 schuur 1.1 {
318 public:
|
319 chip 1.11 AssociatorsResponseHandler(
|
320 kumpf 1.31 CIMAssociatorsRequestMessage* request,
321 CIMAssociatorsResponseMessage* response,
322 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
323 chip 1.25
|
324 kumpf 1.34 virtual void deliver(const CIMObject& cimObject);
325 virtual void deliver(const Array<CIMObject>& cimObjectArray)
|
326 kumpf 1.28 {
327 SimpleObjectResponseHandler::deliver(cimObjectArray);
328 }
|
329 chip 1.25
330 protected:
|
331 kumpf 1.34 virtual String getClass() const;
|
332 chip 1.25
|
333 kumpf 1.34 virtual void transfer();
|
334 chip 1.11
|
335 schuur 1.1 };
336
|
337 kumpf 1.34 class PEGASUS_PPM_LINKAGE AssociatorNamesResponseHandler :
338 public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
339 schuur 1.1 {
340 public:
|
341 chip 1.11 AssociatorNamesResponseHandler(
|
342 kumpf 1.31 CIMAssociatorNamesRequestMessage* request,
343 CIMAssociatorNamesResponseMessage* response,
344 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
345 chip 1.25
|
346 kumpf 1.34 virtual void deliver(const CIMObjectPath& cimObjectPath);
347 virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
|
348 kumpf 1.28 {
349 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
350 }
|
351 chip 1.25
352 protected:
|
353 kumpf 1.34 virtual String getClass() const;
|
354 chip 1.25
|
355 kumpf 1.34 virtual void transfer();
|
356 chip 1.11
|
357 schuur 1.1 };
358
|
359 kumpf 1.34 class PEGASUS_PPM_LINKAGE ReferencesResponseHandler :
360 public OperationResponseHandler, public SimpleObjectResponseHandler
|
361 schuur 1.1 {
362 public:
|
363 chip 1.11 ReferencesResponseHandler(
|
364 kumpf 1.31 CIMReferencesRequestMessage* request,
365 CIMReferencesResponseMessage* response,
366 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
367 chip 1.25
|
368 kumpf 1.34 virtual void deliver(const CIMObject& cimObject);
369 virtual void deliver(const Array<CIMObject>& cimObjectArray)
|
370 kumpf 1.28 {
371 SimpleObjectResponseHandler::deliver(cimObjectArray);
372 }
|
373 chip 1.25
374 protected:
|
375 kumpf 1.34 virtual String getClass() const;
|
376 chip 1.25
|
377 kumpf 1.34 virtual void transfer();
|
378 chip 1.11
|
379 schuur 1.1 };
380
|
381 kumpf 1.34 class PEGASUS_PPM_LINKAGE ReferenceNamesResponseHandler :
382 public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
383 schuur 1.1 {
384 public:
|
385 chip 1.11 ReferenceNamesResponseHandler(
|
386 kumpf 1.31 CIMReferenceNamesRequestMessage* request,
387 CIMReferenceNamesResponseMessage* response,
388 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
389 chip 1.25
|
390 kumpf 1.34 virtual void deliver(const CIMObjectPath& cimObjectPath);
391 virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
|
392 kumpf 1.28 {
393 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
394 }
|
395 chip 1.25
396 protected:
|
397 kumpf 1.34 virtual String getClass() const;
|
398 chip 1.25
|
399 kumpf 1.34 virtual void transfer();
|
400 chip 1.11
|
401 schuur 1.1 };
402
|
403 kumpf 1.34 class PEGASUS_PPM_LINKAGE InvokeMethodResponseHandler :
404 public OperationResponseHandler, public SimpleMethodResultResponseHandler
|
405 schuur 1.1 {
406 public:
|
407 chip 1.11 InvokeMethodResponseHandler(
|
408 kumpf 1.31 CIMInvokeMethodRequestMessage* request,
409 CIMInvokeMethodResponseMessage* response,
410 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
411 chip 1.25
|
412 kumpf 1.34 virtual void deliverParamValue(const CIMParamValue& cimParamValue);
|
413 kumpf 1.28 virtual void deliverParamValue(
|
414 kumpf 1.34 const Array<CIMParamValue>& cimParamValueArray)
|
415 kumpf 1.28 {
416 SimpleMethodResultResponseHandler::deliverParamValue(
417 cimParamValueArray);
418 }
|
419 chip 1.25
|
420 kumpf 1.34 virtual void deliver(const CIMValue& cimValue);
|
421 chip 1.25
422 protected:
|
423 kumpf 1.34 virtual String getClass() const;
|
424 chip 1.25
|
425 kumpf 1.34 virtual void transfer();
|
426 chip 1.25
|
427 schuur 1.1 };
428
|
429 kumpf 1.31 typedef void (*PEGASUS_INDICATION_CALLBACK_T)(
430 CIMProcessIndicationRequestMessage*);
|
431 kumpf 1.2
|
432 kumpf 1.34 class PEGASUS_PPM_LINKAGE EnableIndicationsResponseHandler :
433 public OperationResponseHandler, public SimpleIndicationResponseHandler
|
434 schuur 1.1 {
435 public:
|
436 chip 1.11 EnableIndicationsResponseHandler(
|
437 kumpf 1.31 CIMRequestMessage* request,
438 CIMResponseMessage* response,
|
439 kumpf 1.32 const CIMInstance& provider,
|
440 kumpf 1.31 PEGASUS_INDICATION_CALLBACK_T indicationCallback,
441 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
442 chip 1.25
|
443 kumpf 1.34 virtual void deliver(const CIMIndication& cimIndication);
|
444 chip 1.25
|
445 kumpf 1.34 virtual void deliver(
446 const OperationContext& context,
447 const CIMIndication& cimIndication);
|
448 chip 1.25
|
449 kumpf 1.34 virtual void deliver(const Array<CIMIndication>& cimIndications);
|
450 chip 1.25
|
451 kumpf 1.34 virtual void deliver(
452 const OperationContext& context,
453 const Array<CIMIndication>& cimIndications);
|
454 chip 1.25
455 protected:
|
456 kumpf 1.34 virtual String getClass() const;
|
457 chip 1.25
|
458 kumpf 1.34 virtual Boolean isAsync() const;
|
459 chip 1.18
|
460 brian.campbell 1.9 private:
|
461 kumpf 1.31 PEGASUS_INDICATION_CALLBACK_T _indicationCallback;
|
462 schuur 1.1
|
463 brian.campbell 1.9 };
|
464 schuur 1.1
465 PEGASUS_NAMESPACE_END
466
467 #endif
|