1 karl 1.30 //%2006////////////////////////////////////////////////////////////////////////
|
2 schuur 1.1 //
|
3 karl 1.8 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 schuur 1.1 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.8 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.17 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.30 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 schuur 1.1 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
|
20 karl 1.30 //
|
21 schuur 1.1 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34 #ifndef Pegasus_OperationResponseHandler_h
35 #define Pegasus_OperationResponseHandler_h
36
37 #include <Pegasus/Common/Config.h>
38 #include <Pegasus/Common/CIMMessage.h>
39 #include <Pegasus/Common/MessageQueueService.h>
40 #include <Pegasus/Common/Constants.h>
41
42 schuur 1.1 #include <Pegasus/Common/CIMClass.h>
43 #include <Pegasus/Common/CIMInstance.h>
44 #include <Pegasus/Common/CIMIndication.h>
45 #include <Pegasus/Common/CIMValue.h>
46
|
47 chip 1.14 #include <Pegasus/Common/OperationContext.h>
48 #include <Pegasus/Common/OperationContextInternal.h>
49
50 #include <Pegasus/Common/ObjectNormalizer.h>
|
51 chip 1.25
|
52 schuur 1.1 #include <Pegasus/Common/ResponseHandler.h>
|
53 chip 1.25 #include <Pegasus/ProviderManager2/SimpleResponseHandler.h>
|
54 schuur 1.1
55 #include <Pegasus/ProviderManager2/Linkage.h>
56
57 PEGASUS_NAMESPACE_BEGIN
58
|
59 kumpf 1.31 typedef void (*PEGASUS_RESPONSE_CHUNK_CALLBACK_T)(
60 CIMRequestMessage* request, CIMResponseMessage* response);
61
|
62 schuur 1.1 class PEGASUS_PPM_LINKAGE OperationResponseHandler
63 {
|
64 chip 1.11 friend class SimpleResponseHandler;
|
65 brian.campbell 1.9
|
66 schuur 1.1 public:
|
67 chip 1.11 OperationResponseHandler(
|
68 kumpf 1.31 CIMRequestMessage* request,
69 CIMResponseMessage* response,
70 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
71 schuur 1.1
|
72 kumpf 1.34 virtual ~OperationResponseHandler();
|
73 chip 1.11
|
74 kumpf 1.34 CIMRequestMessage* getRequest() const;
|
75 chip 1.25
|
76 kumpf 1.34 CIMResponseMessage* getResponse() const;
|
77 schuur 1.1
|
78 chip 1.11 virtual void setStatus(
79 const Uint32 code,
|
80 kumpf 1.34 const String& message = String::EMPTY);
|
81 schuur 1.1
|
82 chip 1.11 virtual void setStatus(
83 const Uint32 code,
|
84 kumpf 1.34 const ContentLanguageList& langs,
85 const String& message = String::EMPTY);
|
86 schuur 1.1
|
87 mike 1.33 virtual void setCIMException(const CIMException& cimException);
88
|
89 schuur 1.1 protected:
|
90 chip 1.11 // the default for all derived handlers. Some handlers may not apply
91 // async behavior because their callers cannot handle partial responses.
|
92 kumpf 1.34 virtual Boolean isAsync() const;
|
93 brian.campbell 1.9
|
94 chip 1.11 // send (deliver) asynchronously
95 virtual void send(Boolean isComplete);
|
96 brian.campbell 1.9
|
97 chip 1.11 // transfer any objects from handler to response. this does not clear()
|
98 kumpf 1.34 virtual void transfer();
|
99 brian.campbell 1.9
|
100 chip 1.11 // validate whatever is necessary before the transfer
|
101 kumpf 1.34 virtual void validate();
|
102 chip 1.25
|
103 kumpf 1.34 virtual String getClass() const;
|
104 chip 1.25
|
105 kumpf 1.34 Uint32 getResponseObjectTotal() const;
|
106 brian.campbell 1.9
|
107 chip 1.11 // there can be many objects per message (or none at all - i.e complete())
|
108 kumpf 1.34 Uint32 getResponseMessageTotal() const;
|
109 chip 1.25
|
110 kumpf 1.34 Uint32 getResponseObjectThreshold() const;
|
111 brian.campbell 1.9
|
112 kumpf 1.34 CIMRequestMessage* _request;
113 CIMResponseMessage* _response;
|
114 kumpf 1.31 PEGASUS_RESPONSE_CHUNK_CALLBACK_T _responseChunkCallback;
|
115 schuur 1.1
|
116 brian.campbell 1.9 private:
|
117 chip 1.11 Uint32 _responseObjectTotal;
118 Uint32 _responseMessageTotal;
119 Uint32 _responseObjectThreshold;
120
|
121 schuur 1.1 };
122
|
123 kumpf 1.34 class PEGASUS_PPM_LINKAGE GetInstanceResponseHandler :
124 public OperationResponseHandler, public SimpleInstanceResponseHandler
|
125 chip 1.11 {
126 public:
127 GetInstanceResponseHandler(
|
128 kumpf 1.31 CIMGetInstanceRequestMessage* request,
129 CIMGetInstanceResponseMessage* response,
130 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
131 chip 1.25
|
132 kumpf 1.34 virtual void deliver(const CIMInstance& cimInstance);
133 virtual void deliver(const Array<CIMInstance>& cimInstanceArray)
|
134 kumpf 1.28 {
135 SimpleInstanceResponseHandler::deliver(cimInstanceArray);
136 }
137
|
138 kumpf 1.34 virtual void complete();
|
139 chip 1.25
140 protected:
|
141 kumpf 1.34 virtual String getClass() const;
|
142 chip 1.25
|
143 kumpf 1.34 virtual void transfer();
|
144 chip 1.25
|
145 kumpf 1.34 virtual void validate();
|
146 chip 1.14
147 private:
148 ObjectNormalizer _normalizer;
149
|
150 schuur 1.1 };
151
|
152 kumpf 1.34 class PEGASUS_PPM_LINKAGE EnumerateInstancesResponseHandler :
153 public OperationResponseHandler, public SimpleInstanceResponseHandler
|
154 schuur 1.1 {
155 public:
|
156 chip 1.11 EnumerateInstancesResponseHandler(
|
157 kumpf 1.31 CIMEnumerateInstancesRequestMessage* request,
158 CIMEnumerateInstancesResponseMessage* response,
159 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
160 chip 1.25
|
161 kumpf 1.34 virtual void deliver(const CIMInstance& cimInstance);
162 virtual void deliver(const Array<CIMInstance>& cimInstanceArray)
|
163 kumpf 1.28 {
164 SimpleInstanceResponseHandler::deliver(cimInstanceArray);
165 }
|
166 chip 1.11
|
167 chip 1.25 protected:
|
168 kumpf 1.34 virtual String getClass() const;
|
169 chip 1.25
|
170 kumpf 1.34 virtual void transfer();
|
171 chip 1.14
172 private:
173 ObjectNormalizer _normalizer;
174
|
175 schuur 1.1 };
176
|
177 kumpf 1.34 class PEGASUS_PPM_LINKAGE EnumerateInstanceNamesResponseHandler :
178 public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
179 schuur 1.1 {
180 public:
|
181 chip 1.11 EnumerateInstanceNamesResponseHandler(
|
182 kumpf 1.31 CIMEnumerateInstanceNamesRequestMessage* request,
183 CIMEnumerateInstanceNamesResponseMessage* response,
184 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
185 chip 1.11
|
186 kumpf 1.34 virtual void deliver(const CIMObjectPath& cimObjectPath);
187 virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
|
188 kumpf 1.28 {
189 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
190 }
|
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 chip 1.25
308 protected:
|
309 kumpf 1.34 virtual String getClass() const;
|
310 chip 1.25
|
311 kumpf 1.34 virtual void transfer();
|
312 chip 1.25
|
313 kumpf 1.34 virtual Boolean isAsync() const;
|
314 chip 1.25
|
315 schuur 1.1 };
316
|
317 kumpf 1.34 class PEGASUS_PPM_LINKAGE AssociatorsResponseHandler :
318 public OperationResponseHandler, public SimpleObjectResponseHandler
|
319 schuur 1.1 {
320 public:
|
321 chip 1.11 AssociatorsResponseHandler(
|
322 kumpf 1.31 CIMAssociatorsRequestMessage* request,
323 CIMAssociatorsResponseMessage* response,
324 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
325 chip 1.25
|
326 kumpf 1.34 virtual void deliver(const CIMObject& cimObject);
327 virtual void deliver(const Array<CIMObject>& cimObjectArray)
|
328 kumpf 1.28 {
329 SimpleObjectResponseHandler::deliver(cimObjectArray);
330 }
|
331 chip 1.25
332 protected:
|
333 kumpf 1.34 virtual String getClass() const;
|
334 chip 1.25
|
335 kumpf 1.34 virtual void transfer();
|
336 chip 1.11
|
337 schuur 1.1 };
338
|
339 kumpf 1.34 class PEGASUS_PPM_LINKAGE AssociatorNamesResponseHandler :
340 public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
341 schuur 1.1 {
342 public:
|
343 chip 1.11 AssociatorNamesResponseHandler(
|
344 kumpf 1.31 CIMAssociatorNamesRequestMessage* request,
345 CIMAssociatorNamesResponseMessage* response,
346 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
347 chip 1.25
|
348 kumpf 1.34 virtual void deliver(const CIMObjectPath& cimObjectPath);
349 virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
|
350 kumpf 1.28 {
351 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
352 }
|
353 chip 1.25
354 protected:
|
355 kumpf 1.34 virtual String getClass() const;
|
356 chip 1.25
|
357 kumpf 1.34 virtual void transfer();
|
358 chip 1.11
|
359 schuur 1.1 };
360
|
361 kumpf 1.34 class PEGASUS_PPM_LINKAGE ReferencesResponseHandler :
362 public OperationResponseHandler, public SimpleObjectResponseHandler
|
363 schuur 1.1 {
364 public:
|
365 chip 1.11 ReferencesResponseHandler(
|
366 kumpf 1.31 CIMReferencesRequestMessage* request,
367 CIMReferencesResponseMessage* response,
368 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
369 chip 1.25
|
370 kumpf 1.34 virtual void deliver(const CIMObject& cimObject);
371 virtual void deliver(const Array<CIMObject>& cimObjectArray)
|
372 kumpf 1.28 {
373 SimpleObjectResponseHandler::deliver(cimObjectArray);
374 }
|
375 chip 1.25
376 protected:
|
377 kumpf 1.34 virtual String getClass() const;
|
378 chip 1.25
|
379 kumpf 1.34 virtual void transfer();
|
380 chip 1.11
|
381 schuur 1.1 };
382
|
383 kumpf 1.34 class PEGASUS_PPM_LINKAGE ReferenceNamesResponseHandler :
384 public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
385 schuur 1.1 {
386 public:
|
387 chip 1.11 ReferenceNamesResponseHandler(
|
388 kumpf 1.31 CIMReferenceNamesRequestMessage* request,
389 CIMReferenceNamesResponseMessage* response,
390 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
391 chip 1.25
|
392 kumpf 1.34 virtual void deliver(const CIMObjectPath& cimObjectPath);
393 virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
|
394 kumpf 1.28 {
395 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
396 }
|
397 chip 1.25
398 protected:
|
399 kumpf 1.34 virtual String getClass() const;
|
400 chip 1.25
|
401 kumpf 1.34 virtual void transfer();
|
402 chip 1.11
|
403 schuur 1.1 };
404
|
405 kumpf 1.34 class PEGASUS_PPM_LINKAGE InvokeMethodResponseHandler :
406 public OperationResponseHandler, public SimpleMethodResultResponseHandler
|
407 schuur 1.1 {
408 public:
|
409 chip 1.11 InvokeMethodResponseHandler(
|
410 kumpf 1.31 CIMInvokeMethodRequestMessage* request,
411 CIMInvokeMethodResponseMessage* response,
412 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
413 chip 1.25
|
414 kumpf 1.34 virtual void deliverParamValue(const CIMParamValue& cimParamValue);
|
415 kumpf 1.28 virtual void deliverParamValue(
|
416 kumpf 1.34 const Array<CIMParamValue>& cimParamValueArray)
|
417 kumpf 1.28 {
418 SimpleMethodResultResponseHandler::deliverParamValue(
419 cimParamValueArray);
420 }
|
421 chip 1.25
|
422 kumpf 1.34 virtual void deliver(const CIMValue& cimValue);
|
423 chip 1.25
424 protected:
|
425 kumpf 1.34 virtual String getClass() const;
|
426 chip 1.25
|
427 kumpf 1.34 virtual void transfer();
|
428 chip 1.25
|
429 schuur 1.1 };
430
|
431 kumpf 1.31 typedef void (*PEGASUS_INDICATION_CALLBACK_T)(
432 CIMProcessIndicationRequestMessage*);
|
433 kumpf 1.2
|
434 kumpf 1.34 class PEGASUS_PPM_LINKAGE EnableIndicationsResponseHandler :
435 public OperationResponseHandler, public SimpleIndicationResponseHandler
|
436 schuur 1.1 {
437 public:
|
438 chip 1.11 EnableIndicationsResponseHandler(
|
439 kumpf 1.31 CIMRequestMessage* request,
440 CIMResponseMessage* response,
|
441 kumpf 1.32 const CIMInstance& provider,
|
442 kumpf 1.31 PEGASUS_INDICATION_CALLBACK_T indicationCallback,
443 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
|
444 chip 1.25
|
445 kumpf 1.34 virtual void deliver(const CIMIndication& cimIndication);
|
446 chip 1.25
|
447 kumpf 1.34 virtual void deliver(
448 const OperationContext& context,
449 const CIMIndication& cimIndication);
|
450 chip 1.25
|
451 kumpf 1.34 virtual void deliver(const Array<CIMIndication>& cimIndications);
|
452 chip 1.25
|
453 kumpf 1.34 virtual void deliver(
454 const OperationContext& context,
455 const Array<CIMIndication>& cimIndications);
|
456 chip 1.25
457 protected:
|
458 kumpf 1.34 virtual String getClass() const;
|
459 chip 1.25
|
460 kumpf 1.34 virtual Boolean isAsync() const;
|
461 chip 1.18
|
462 brian.campbell 1.9 private:
|
463 kumpf 1.31 PEGASUS_INDICATION_CALLBACK_T _indicationCallback;
|
464 schuur 1.1
|
465 brian.campbell 1.9 };
|
466 schuur 1.1
467 PEGASUS_NAMESPACE_END
468
469 #endif
|