1 a.dunfey 1.28.8.1 //%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 a.dunfey 1.28.8.1 // 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 a.dunfey 1.28.8.1 //
|
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 // Author: Chip Vincent (cvincent@us.ibm.com)
33 //
|
34 chip 1.11 // Modified By:
35 // Carol Ann Krug Graves, Hewlett-Packard Company (carolann_graves@hp.com)
36 // Dave Rosckes (rosckes@us.ibm.com)
37 // Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com)
38 // Adrian Schuur (schuur@de.ibm.com)
39 // Seema Gupta (gseema@in.ibm.com) for PEP135
40 // Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase2
|
41 schuur 1.1 //
42 //%/////////////////////////////////////////////////////////////////////////////
43
44 #ifndef Pegasus_OperationResponseHandler_h
45 #define Pegasus_OperationResponseHandler_h
46
47 #include <Pegasus/Common/Config.h>
48 #include <Pegasus/Common/CIMMessage.h>
49 #include <Pegasus/Common/MessageQueueService.h>
50 #include <Pegasus/Common/Constants.h>
51
52 #include <Pegasus/Common/CIMClass.h>
53 #include <Pegasus/Common/CIMInstance.h>
54 #include <Pegasus/Common/CIMIndication.h>
55 #include <Pegasus/Common/CIMValue.h>
56
|
57 chip 1.14 #include <Pegasus/Common/OperationContext.h>
58 #include <Pegasus/Common/OperationContextInternal.h>
59
60 #include <Pegasus/Common/ObjectNormalizer.h>
|
61 chip 1.25
|
62 schuur 1.1 #include <Pegasus/Common/ResponseHandler.h>
|
63 chip 1.25 #include <Pegasus/ProviderManager2/SimpleResponseHandler.h>
|
64 schuur 1.1
65 #include <Pegasus/ProviderManager2/Linkage.h>
66
67 PEGASUS_NAMESPACE_BEGIN
68
69 class PEGASUS_PPM_LINKAGE OperationResponseHandler
70 {
|
71 chip 1.11 friend class SimpleResponseHandler;
|
72 brian.campbell 1.9
|
73 schuur 1.1 public:
|
74 chip 1.11 OperationResponseHandler(
75 CIMRequestMessage * request,
76 CIMResponseMessage * response);
|
77 schuur 1.1
|
78 brian.campbell 1.9 virtual ~OperationResponseHandler(void);
|
79 chip 1.11
|
80 chip 1.25 CIMRequestMessage * getRequest(void) const;
81
82 CIMResponseMessage * getResponse(void) const;
|
83 schuur 1.1
|
84 chip 1.11 virtual void setStatus(
85 const Uint32 code,
|
86 chip 1.25 const String & message = String::EMPTY);
|
87 schuur 1.1
|
88 chip 1.11 virtual void setStatus(
89 const Uint32 code,
|
90 a.dunfey 1.28.8.1 const ContentLanguageList & langs,
|
91 chip 1.25 const String & message = String::EMPTY);
|
92 schuur 1.1
93 protected:
|
94 chip 1.11 // the default for all derived handlers. Some handlers may not apply
95 // async behavior because their callers cannot handle partial responses.
|
96 chip 1.25 virtual Boolean isAsync(void) const;
|
97 brian.campbell 1.9
|
98 chip 1.11 // send (deliver) asynchronously
99 virtual void send(Boolean isComplete);
|
100 brian.campbell 1.9
|
101 chip 1.11 // transfer any objects from handler to response. this does not clear()
|
102 chip 1.25 virtual void transfer(void);
|
103 brian.campbell 1.9
|
104 chip 1.11 // validate whatever is necessary before the transfer
|
105 chip 1.25 virtual void validate(void);
106
107 virtual String getClass(void) const;
108
109 Uint32 getResponseObjectTotal(void) const;
|
110 brian.campbell 1.9
|
111 chip 1.11 // there can be many objects per message (or none at all - i.e complete())
|
112 chip 1.25 Uint32 getResponseMessageTotal(void) const;
113
114 Uint32 getResponseObjectThreshold(void) const;
|
115 brian.campbell 1.9
|
116 schuur 1.1 CIMRequestMessage * _request;
117 CIMResponseMessage * _response;
118
|
119 brian.campbell 1.9 private:
|
120 chip 1.11 Uint32 _responseObjectTotal;
121 Uint32 _responseMessageTotal;
122 Uint32 _responseObjectThreshold;
123
|
124 schuur 1.1 };
125
|
126 chip 1.26 class PEGASUS_PPM_LINKAGE GetInstanceResponseHandler : public OperationResponseHandler, public SimpleInstanceResponseHandler
|
127 chip 1.11 {
128 public:
129 GetInstanceResponseHandler(
130 CIMGetInstanceRequestMessage * request,
|
131 chip 1.25 CIMGetInstanceResponseMessage * response);
132
133 virtual void deliver(const CIMInstance & cimInstance);
|
134 kumpf 1.28 virtual void deliver(const Array<CIMInstance> & cimInstanceArray)
135 {
136 SimpleInstanceResponseHandler::deliver(cimInstanceArray);
137 }
138
|
139 chip 1.26 virtual void complete(void);
|
140 chip 1.25
141 protected:
142 virtual String getClass(void) const;
143
144 virtual void transfer(void);
145
146 virtual void validate(void);
|
147 chip 1.14
148 private:
149 ObjectNormalizer _normalizer;
150
|
151 schuur 1.1 };
152
|
153 chip 1.26 class PEGASUS_PPM_LINKAGE EnumerateInstancesResponseHandler : public OperationResponseHandler, public SimpleInstanceResponseHandler
|
154 schuur 1.1 {
155 public:
|
156 chip 1.11 EnumerateInstancesResponseHandler(
157 CIMEnumerateInstancesRequestMessage * request,
|
158 chip 1.25 CIMEnumerateInstancesResponseMessage * response);
159
160 virtual void deliver(const CIMInstance & cimInstance);
|
161 kumpf 1.28 virtual void deliver(const Array<CIMInstance> & cimInstanceArray)
162 {
163 SimpleInstanceResponseHandler::deliver(cimInstanceArray);
164 }
|
165 chip 1.11
|
166 chip 1.25 protected:
167 virtual String getClass(void) const;
168
169 virtual void transfer(void);
|
170 chip 1.14
171 private:
172 ObjectNormalizer _normalizer;
173
|
174 schuur 1.1 };
175
|
176 chip 1.26 class PEGASUS_PPM_LINKAGE EnumerateInstanceNamesResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
177 schuur 1.1 {
178 public:
|
179 chip 1.11 EnumerateInstanceNamesResponseHandler(
180 CIMEnumerateInstanceNamesRequestMessage * request,
|
181 chip 1.25 CIMEnumerateInstanceNamesResponseMessage * response);
|
182 chip 1.11
|
183 chip 1.25 virtual void deliver(const CIMObjectPath & cimObjectPath);
|
184 kumpf 1.28 virtual void deliver(const Array<CIMObjectPath> & cimObjectPathArray)
185 {
186 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
187 }
|
188 chip 1.25
189 protected:
190 virtual String getClass(void) const;
191
192 virtual void transfer(void);
|
193 chip 1.14
194 private:
195 ObjectNormalizer _normalizer;
196
|
197 schuur 1.1 };
198
|
199 chip 1.26 class PEGASUS_PPM_LINKAGE CreateInstanceResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
200 schuur 1.1 {
201 public:
|
202 chip 1.11 CreateInstanceResponseHandler(
203 CIMCreateInstanceRequestMessage * request,
|
204 chip 1.25 CIMCreateInstanceResponseMessage * response);
205
206 virtual void deliver(const CIMObjectPath & cimObjectPath);
|
207 kumpf 1.28 virtual void deliver(const Array<CIMObjectPath> & cimObjectPathArray)
208 {
209 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
210 }
211
|
212 chip 1.26 virtual void complete(void);
|
213 chip 1.25
214 protected:
215 virtual String getClass(void) const;
216
217 virtual void transfer(void);
218
|
219 schuur 1.1 };
220
|
221 chip 1.26 class PEGASUS_PPM_LINKAGE ModifyInstanceResponseHandler : public OperationResponseHandler, public SimpleResponseHandler
|
222 schuur 1.1 {
223 public:
|
224 chip 1.11 ModifyInstanceResponseHandler(
225 CIMModifyInstanceRequestMessage * request,
|
226 chip 1.25 CIMModifyInstanceResponseMessage * response);
|
227 chip 1.11
|
228 chip 1.18 protected:
|
229 chip 1.25 virtual String getClass(void) const;
230
|
231 schuur 1.1 };
232
|
233 chip 1.26 class PEGASUS_PPM_LINKAGE DeleteInstanceResponseHandler : public OperationResponseHandler, public SimpleResponseHandler
|
234 schuur 1.1 {
235 public:
|
236 chip 1.11 DeleteInstanceResponseHandler(
237 CIMDeleteInstanceRequestMessage * request,
|
238 chip 1.25 CIMDeleteInstanceResponseMessage * response);
|
239 chip 1.11
|
240 chip 1.18 protected:
|
241 chip 1.25 virtual String getClass(void) const;
|
242 chip 1.11
|
243 schuur 1.1 };
244
|
245 chip 1.26 class PEGASUS_PPM_LINKAGE GetPropertyResponseHandler : public OperationResponseHandler, public SimpleValueResponseHandler
|
246 schuur 1.1 {
247 public:
|
248 chip 1.11 GetPropertyResponseHandler(
249 CIMGetPropertyRequestMessage * request,
|
250 chip 1.25 CIMGetPropertyResponseMessage * response);
251
252 virtual void deliver(const CIMValue & cimValue);
|
253 kumpf 1.28 virtual void deliver(const Array<CIMValue> & cimValueArray)
254 {
255 SimpleValueResponseHandler::deliver(cimValueArray);
256 }
|
257 chip 1.25
258 protected:
259 virtual String getClass(void) const;
260
261 virtual void transfer(void);
262
263 virtual void validate(void);
264
|
265 schuur 1.1 };
266
|
267 chip 1.26 class PEGASUS_PPM_LINKAGE SetPropertyResponseHandler : public OperationResponseHandler, public SimpleResponseHandler
|
268 schuur 1.1 {
269 public:
|
270 chip 1.11 SetPropertyResponseHandler(
271 CIMSetPropertyRequestMessage * request,
|
272 chip 1.25 CIMSetPropertyResponseMessage * response);
|
273 chip 1.11
|
274 chip 1.18 protected:
|
275 chip 1.25 virtual String getClass(void) const;
|
276 chip 1.11
|
277 schuur 1.1 };
278
|
279 chip 1.26 class PEGASUS_PPM_LINKAGE ExecQueryResponseHandler : public OperationResponseHandler, public SimpleInstance2ObjectResponseHandler
|
280 schuur 1.1 {
281 public:
|
282 chip 1.11 ExecQueryResponseHandler(
283 CIMExecQueryRequestMessage * request,
|
284 chip 1.25 CIMExecQueryResponseMessage * response);
285
286 virtual void deliver(const CIMInstance & cimInstance);
|
287 kumpf 1.28 virtual void deliver(const Array<CIMInstance> & cimInstanceArray)
288 {
289 SimpleInstance2ObjectResponseHandler::deliver(cimInstanceArray);
290 }
|
291 chip 1.25
292 protected:
293 virtual String getClass(void) const;
294
295 virtual void transfer(void);
296
297 virtual Boolean isAsync(void) const;
298
|
299 schuur 1.1 };
300
|
301 chip 1.26 class PEGASUS_PPM_LINKAGE AssociatorsResponseHandler : public OperationResponseHandler, public SimpleObjectResponseHandler
|
302 schuur 1.1 {
303 public:
|
304 chip 1.11 AssociatorsResponseHandler(
305 CIMAssociatorsRequestMessage * request,
|
306 chip 1.25 CIMAssociatorsResponseMessage * response);
307
308 virtual void deliver(const CIMObject & cimObject);
|
309 kumpf 1.28 virtual void deliver(const Array<CIMObject> & cimObjectArray)
310 {
311 SimpleObjectResponseHandler::deliver(cimObjectArray);
312 }
|
313 chip 1.25
314 protected:
315 virtual String getClass(void) const;
316
317 virtual void transfer(void);
|
318 chip 1.11
|
319 schuur 1.1 };
320
|
321 chip 1.26 class PEGASUS_PPM_LINKAGE AssociatorNamesResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
322 schuur 1.1 {
323 public:
|
324 chip 1.11 AssociatorNamesResponseHandler(
325 CIMAssociatorNamesRequestMessage * request,
|
326 chip 1.25 CIMAssociatorNamesResponseMessage * response);
327
328 virtual void deliver(const CIMObjectPath & cimObjectPath);
|
329 kumpf 1.28 virtual void deliver(const Array<CIMObjectPath> & cimObjectPathArray)
330 {
331 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
332 }
|
333 chip 1.25
334 protected:
335 virtual String getClass(void) const;
336
337 virtual void transfer(void);
|
338 chip 1.11
|
339 schuur 1.1 };
340
|
341 chip 1.26 class PEGASUS_PPM_LINKAGE ReferencesResponseHandler : public OperationResponseHandler, public SimpleObjectResponseHandler
|
342 schuur 1.1 {
343 public:
|
344 chip 1.11 ReferencesResponseHandler(
345 CIMReferencesRequestMessage * request,
|
346 chip 1.25 CIMReferencesResponseMessage * response);
347
348 virtual void deliver(const CIMObject & cimObject);
|
349 kumpf 1.28 virtual void deliver(const Array<CIMObject> & cimObjectArray)
350 {
351 SimpleObjectResponseHandler::deliver(cimObjectArray);
352 }
|
353 chip 1.25
354 protected:
355 virtual String getClass(void) const;
356
357 virtual void transfer(void);
|
358 chip 1.11
|
359 schuur 1.1 };
360
|
361 chip 1.26 class PEGASUS_PPM_LINKAGE ReferenceNamesResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler
|
362 schuur 1.1 {
363 public:
|
364 chip 1.11 ReferenceNamesResponseHandler(
365 CIMReferenceNamesRequestMessage * request,
|
366 chip 1.25 CIMReferenceNamesResponseMessage * response);
367
368 virtual void deliver(const CIMObjectPath & cimObjectPath);
|
369 kumpf 1.28 virtual void deliver(const Array<CIMObjectPath> & cimObjectPathArray)
370 {
371 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
372 }
|
373 chip 1.25
374 protected:
375 virtual String getClass(void) const;
376
377 virtual void transfer(void);
|
378 chip 1.11
|
379 schuur 1.1 };
380
|
381 chip 1.26 class PEGASUS_PPM_LINKAGE InvokeMethodResponseHandler : public OperationResponseHandler, public SimpleMethodResultResponseHandler
|
382 schuur 1.1 {
383 public:
|
384 chip 1.11 InvokeMethodResponseHandler(
385 CIMInvokeMethodRequestMessage * request,
|
386 chip 1.25 CIMInvokeMethodResponseMessage * response);
387
388 virtual void deliverParamValue(const CIMParamValue & cimParamValue);
|
389 kumpf 1.28 virtual void deliverParamValue(
390 const Array<CIMParamValue> & cimParamValueArray)
391 {
392 SimpleMethodResultResponseHandler::deliverParamValue(
393 cimParamValueArray);
394 }
|
395 chip 1.25
396 virtual void deliver(const CIMValue & cimValue);
397
398 protected:
399 virtual String getClass(void) const;
400
401 virtual void transfer(void);
402
|
403 schuur 1.1 };
404
|
405 brian.campbell 1.9 typedef void (*PEGASUS_INDICATION_CALLBACK)(CIMProcessIndicationRequestMessage*);
|
406 kumpf 1.2
|
407 chip 1.26 class PEGASUS_PPM_LINKAGE EnableIndicationsResponseHandler : public OperationResponseHandler, public SimpleIndicationResponseHandler
|
408 schuur 1.1 {
409 public:
|
410 chip 1.11 EnableIndicationsResponseHandler(
|
411 carolann.graves 1.19 CIMRequestMessage * request,
412 CIMResponseMessage * response,
|
413 chip 1.11 CIMInstance & provider,
|
414 chip 1.25 PEGASUS_INDICATION_CALLBACK indicationCallback);
415
416 virtual void deliver(const CIMIndication & cimIndication);
417
418 virtual void deliver(const OperationContext & context, const CIMIndication & cimIndication);
419
420 virtual void deliver(const Array<CIMIndication> & cimIndications);
421
422 virtual void deliver(const OperationContext & context, const Array<CIMIndication> & cimIndications);
423
424 protected:
425 virtual String getClass(void) const;
426
427 virtual Boolean isAsync(void) const;
|
428 chip 1.18
|
429 brian.campbell 1.9 private:
|
430 chip 1.11 PEGASUS_INDICATION_CALLBACK _indicationCallback;
|
431 schuur 1.1
|
432 brian.campbell 1.9 };
|
433 schuur 1.1
434 PEGASUS_NAMESPACE_END
435
436 #endif
|