1 martin 1.35 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.36 //
|
3 martin 1.35 // 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 martin 1.36 //
|
10 martin 1.35 // 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 martin 1.36 //
|
17 martin 1.35 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.36 //
|
20 martin 1.35 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.36 // 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 martin 1.36 //
|
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 r.kieninger 1.36.4.1 virtual void deliver(const SCMOInstance& cimInstance);
|
165 chip 1.11
|
166 chip 1.25 protected:
|
167 kumpf 1.34 virtual String getClass() const;
|
168 chip 1.25
|
169 kumpf 1.34 virtual void transfer();
|
170 chip 1.14
171 private:
172 ObjectNormalizer _normalizer;
173
|
174 schuur 1.1 };
175
|
176 kumpf 1.34 class PEGASUS_PPM_LINKAGE EnumerateInstanceNamesResponseHandler :
177 public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
178 schuur 1.1 {
179 public:
|
180 chip 1.11 EnumerateInstanceNamesResponseHandler(
|
181 kumpf 1.31 CIMEnumerateInstanceNamesRequestMessage* request,
182 CIMEnumerateInstanceNamesResponseMessage* response,
183 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
184 chip 1.11
|
185 kumpf 1.34 virtual void deliver(const CIMObjectPath& cimObjectPath);
186 virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
|
187 kumpf 1.28 {
188 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
189 }
|
190 r.kieninger 1.36.4.1 virtual void deliver(const SCMOInstance& scmoObjectPath);
|
191 chip 1.25
192 protected:
|
193 kumpf 1.34 virtual String getClass() const;
|
194 chip 1.25
|
195 kumpf 1.34 virtual void transfer();
|
196 chip 1.14
197 private:
198 ObjectNormalizer _normalizer;
199
|
200 schuur 1.1 };
201
|
202 kumpf 1.34 class PEGASUS_PPM_LINKAGE CreateInstanceResponseHandler :
203 public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
204 schuur 1.1 {
205 public:
|
206 chip 1.11 CreateInstanceResponseHandler(
|
207 kumpf 1.31 CIMCreateInstanceRequestMessage* request,
208 CIMCreateInstanceResponseMessage* response,
209 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
210 chip 1.25
|
211 kumpf 1.34 virtual void deliver(const CIMObjectPath& cimObjectPath);
212 virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
|
213 kumpf 1.28 {
214 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
215 }
216
|
217 kumpf 1.34 virtual void complete();
|
218 chip 1.25
219 protected:
|
220 kumpf 1.34 virtual String getClass() const;
|
221 chip 1.25
|
222 kumpf 1.34 virtual void transfer();
|
223 chip 1.25
|
224 schuur 1.1 };
225
|
226 kumpf 1.34 class PEGASUS_PPM_LINKAGE ModifyInstanceResponseHandler :
227 public OperationResponseHandler, public SimpleResponseHandler
|
228 schuur 1.1 {
229 public:
|
230 chip 1.11 ModifyInstanceResponseHandler(
|
231 kumpf 1.31 CIMModifyInstanceRequestMessage* request,
232 CIMModifyInstanceResponseMessage* response,
233 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
234 chip 1.11
|
235 chip 1.18 protected:
|
236 kumpf 1.34 virtual String getClass() const;
|
237 chip 1.25
|
238 schuur 1.1 };
239
|
240 kumpf 1.34 class PEGASUS_PPM_LINKAGE DeleteInstanceResponseHandler :
241 public OperationResponseHandler, public SimpleResponseHandler
|
242 schuur 1.1 {
243 public:
|
244 chip 1.11 DeleteInstanceResponseHandler(
|
245 kumpf 1.31 CIMDeleteInstanceRequestMessage* request,
246 CIMDeleteInstanceResponseMessage* response,
247 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
248 chip 1.11
|
249 chip 1.18 protected:
|
250 kumpf 1.34 virtual String getClass() const;
|
251 chip 1.11
|
252 schuur 1.1 };
253
|
254 kumpf 1.34 class PEGASUS_PPM_LINKAGE GetPropertyResponseHandler :
255 public OperationResponseHandler, public SimpleValueResponseHandler
|
256 schuur 1.1 {
257 public:
|
258 chip 1.11 GetPropertyResponseHandler(
|
259 kumpf 1.31 CIMGetPropertyRequestMessage* request,
260 CIMGetPropertyResponseMessage* response,
261 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
262 chip 1.25
|
263 kumpf 1.34 virtual void deliver(const CIMValue& cimValue);
264 virtual void deliver(const Array<CIMValue>& cimValueArray)
|
265 kumpf 1.28 {
266 SimpleValueResponseHandler::deliver(cimValueArray);
267 }
|
268 chip 1.25
269 protected:
|
270 kumpf 1.34 virtual String getClass() const;
|
271 chip 1.25
|
272 kumpf 1.34 virtual void transfer();
|
273 chip 1.25
|
274 kumpf 1.34 virtual void validate();
|
275 chip 1.25
|
276 schuur 1.1 };
277
|
278 kumpf 1.34 class PEGASUS_PPM_LINKAGE SetPropertyResponseHandler :
279 public OperationResponseHandler, public SimpleResponseHandler
|
280 schuur 1.1 {
281 public:
|
282 chip 1.11 SetPropertyResponseHandler(
|
283 kumpf 1.31 CIMSetPropertyRequestMessage* request,
284 CIMSetPropertyResponseMessage* response,
285 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
286 chip 1.11
|
287 chip 1.18 protected:
|
288 kumpf 1.34 virtual String getClass() const;
|
289 chip 1.11
|
290 schuur 1.1 };
291
|
292 kumpf 1.34 class PEGASUS_PPM_LINKAGE ExecQueryResponseHandler :
293 public OperationResponseHandler,
294 public SimpleInstance2ObjectResponseHandler
|
295 schuur 1.1 {
296 public:
|
297 chip 1.11 ExecQueryResponseHandler(
|
298 kumpf 1.31 CIMExecQueryRequestMessage* request,
299 CIMExecQueryResponseMessage* response,
300 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
301 chip 1.25
|
302 kumpf 1.34 virtual void deliver(const CIMInstance& cimInstance);
303 virtual void deliver(const Array<CIMInstance>& cimInstanceArray)
|
304 kumpf 1.28 {
305 SimpleInstance2ObjectResponseHandler::deliver(cimInstanceArray);
306 }
|
307 r.kieninger 1.36.4.1 virtual void deliver(const SCMOInstance& cimInstance);
|
308 chip 1.25
309 protected:
|
310 kumpf 1.34 virtual String getClass() const;
|
311 chip 1.25
|
312 kumpf 1.34 virtual void transfer();
|
313 chip 1.25
|
314 kumpf 1.34 virtual Boolean isAsync() const;
|
315 chip 1.25
|
316 schuur 1.1 };
317
|
318 kumpf 1.34 class PEGASUS_PPM_LINKAGE AssociatorsResponseHandler :
319 public OperationResponseHandler, public SimpleObjectResponseHandler
|
320 schuur 1.1 {
321 public:
|
322 chip 1.11 AssociatorsResponseHandler(
|
323 kumpf 1.31 CIMAssociatorsRequestMessage* request,
324 CIMAssociatorsResponseMessage* response,
325 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
326 chip 1.25
|
327 kumpf 1.34 virtual void deliver(const CIMObject& cimObject);
328 virtual void deliver(const Array<CIMObject>& cimObjectArray)
|
329 kumpf 1.28 {
330 SimpleObjectResponseHandler::deliver(cimObjectArray);
331 }
|
332 chip 1.25
333 protected:
|
334 kumpf 1.34 virtual String getClass() const;
|
335 chip 1.25
|
336 kumpf 1.34 virtual void transfer();
|
337 chip 1.11
|
338 schuur 1.1 };
339
|
340 kumpf 1.34 class PEGASUS_PPM_LINKAGE AssociatorNamesResponseHandler :
341 public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
342 schuur 1.1 {
343 public:
|
344 chip 1.11 AssociatorNamesResponseHandler(
|
345 kumpf 1.31 CIMAssociatorNamesRequestMessage* request,
346 CIMAssociatorNamesResponseMessage* response,
347 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
348 chip 1.25
|
349 kumpf 1.34 virtual void deliver(const CIMObjectPath& cimObjectPath);
350 virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
|
351 kumpf 1.28 {
352 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
353 }
|
354 chip 1.25
355 protected:
|
356 kumpf 1.34 virtual String getClass() const;
|
357 chip 1.25
|
358 kumpf 1.34 virtual void transfer();
|
359 chip 1.11
|
360 schuur 1.1 };
361
|
362 kumpf 1.34 class PEGASUS_PPM_LINKAGE ReferencesResponseHandler :
363 public OperationResponseHandler, public SimpleObjectResponseHandler
|
364 schuur 1.1 {
365 public:
|
366 chip 1.11 ReferencesResponseHandler(
|
367 kumpf 1.31 CIMReferencesRequestMessage* request,
368 CIMReferencesResponseMessage* response,
369 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
370 chip 1.25
|
371 kumpf 1.34 virtual void deliver(const CIMObject& cimObject);
372 virtual void deliver(const Array<CIMObject>& cimObjectArray)
|
373 kumpf 1.28 {
374 SimpleObjectResponseHandler::deliver(cimObjectArray);
375 }
|
376 chip 1.25
377 protected:
|
378 kumpf 1.34 virtual String getClass() const;
|
379 chip 1.25
|
380 kumpf 1.34 virtual void transfer();
|
381 chip 1.11
|
382 schuur 1.1 };
383
|
384 kumpf 1.34 class PEGASUS_PPM_LINKAGE ReferenceNamesResponseHandler :
385 public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
386 schuur 1.1 {
387 public:
|
388 chip 1.11 ReferenceNamesResponseHandler(
|
389 kumpf 1.31 CIMReferenceNamesRequestMessage* request,
390 CIMReferenceNamesResponseMessage* response,
391 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
392 chip 1.25
|
393 kumpf 1.34 virtual void deliver(const CIMObjectPath& cimObjectPath);
394 virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
|
395 kumpf 1.28 {
396 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
397 }
|
398 chip 1.25
399 protected:
|
400 kumpf 1.34 virtual String getClass() const;
|
401 chip 1.25
|
402 kumpf 1.34 virtual void transfer();
|
403 chip 1.11
|
404 schuur 1.1 };
405
|
406 kumpf 1.34 class PEGASUS_PPM_LINKAGE InvokeMethodResponseHandler :
407 public OperationResponseHandler, public SimpleMethodResultResponseHandler
|
408 schuur 1.1 {
409 public:
|
410 chip 1.11 InvokeMethodResponseHandler(
|
411 kumpf 1.31 CIMInvokeMethodRequestMessage* request,
412 CIMInvokeMethodResponseMessage* response,
413 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
414 chip 1.25
|
415 kumpf 1.34 virtual void deliverParamValue(const CIMParamValue& cimParamValue);
|
416 kumpf 1.28 virtual void deliverParamValue(
|
417 kumpf 1.34 const Array<CIMParamValue>& cimParamValueArray)
|
418 kumpf 1.28 {
419 SimpleMethodResultResponseHandler::deliverParamValue(
420 cimParamValueArray);
421 }
|
422 chip 1.25
|
423 kumpf 1.34 virtual void deliver(const CIMValue& cimValue);
|
424 chip 1.25
425 protected:
|
426 kumpf 1.34 virtual String getClass() const;
|
427 chip 1.25
|
428 kumpf 1.34 virtual void transfer();
|
429 chip 1.25
|
430 schuur 1.1 };
431
|
432 kumpf 1.31 typedef void (*PEGASUS_INDICATION_CALLBACK_T)(
433 CIMProcessIndicationRequestMessage*);
|
434 kumpf 1.2
|
435 kumpf 1.34 class PEGASUS_PPM_LINKAGE EnableIndicationsResponseHandler :
436 public OperationResponseHandler, public SimpleIndicationResponseHandler
|
437 schuur 1.1 {
438 public:
|
439 chip 1.11 EnableIndicationsResponseHandler(
|
440 kumpf 1.31 CIMRequestMessage* request,
441 CIMResponseMessage* response,
|
442 kumpf 1.32 const CIMInstance& provider,
|
443 kumpf 1.31 PEGASUS_INDICATION_CALLBACK_T indicationCallback,
444 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
445 chip 1.25
|
446 kumpf 1.34 virtual void deliver(const CIMIndication& cimIndication);
|
447 chip 1.25
|
448 kumpf 1.34 virtual void deliver(
449 const OperationContext& context,
450 const CIMIndication& cimIndication);
|
451 chip 1.25
|
452 kumpf 1.34 virtual void deliver(const Array<CIMIndication>& cimIndications);
|
453 chip 1.25
|
454 kumpf 1.34 virtual void deliver(
455 const OperationContext& context,
456 const Array<CIMIndication>& cimIndications);
|
457 chip 1.25
458 protected:
|
459 kumpf 1.34 virtual String getClass() const;
|
460 chip 1.25
|
461 kumpf 1.34 virtual Boolean isAsync() const;
|
462 chip 1.18
|
463 brian.campbell 1.9 private:
|
464 kumpf 1.31 PEGASUS_INDICATION_CALLBACK_T _indicationCallback;
|
465 schuur 1.1
|
466 brian.campbell 1.9 };
|
467 schuur 1.1
468 PEGASUS_NAMESPACE_END
469
470 #endif
|