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