1 kumpf 1.1 //%/////////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to
8 // deal in the Software without restriction, including without limitation the
9 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 // sell copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
14 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
15 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
16 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 //
22 kumpf 1.1 //==============================================================================
23 //
24 // Author: Chip Vincent (cvincent@us.ibm.com)
25 //
26 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
27 //
28 //%/////////////////////////////////////////////////////////////////////////////
29
30 #ifndef Pegasus_SimpleResponseHandler_h
31 #define Pegasus_SimpleResponseHandler_h
32
33 #include <Pegasus/Common/Config.h>
34 #include <Pegasus/Common/ResponseHandler.h>
|
35 kumpf 1.3 #include <Pegasus/Server/Linkage.h>
|
36 kumpf 1.1
37 PEGASUS_NAMESPACE_BEGIN
38
|
39 kumpf 1.2 class PEGASUS_SERVER_LINKAGE SimpleResponseHandler : virtual public ResponseHandler
|
40 kumpf 1.1 {
41 public:
42 SimpleResponseHandler(void)
43 {
44 }
45
46 virtual ~SimpleResponseHandler(void)
47 {
48 }
49
50 virtual void processing(void)
51 {
52 // do nothing
53 }
54
55 virtual void complete(void)
56 {
57 // do nothing
58 }
59 };
60
|
61 kumpf 1.2 class PEGASUS_SERVER_LINKAGE SimpleInstanceResponseHandler : public SimpleResponseHandler, public InstanceResponseHandler
|
62 kumpf 1.1 {
63 public:
64 SimpleInstanceResponseHandler(void)
65 {
66 }
67
68 void processing(void) { SimpleResponseHandler::processing(); }
69 void complete(void) { SimpleResponseHandler::complete(); }
70
71 virtual void deliver(const CIMInstance & instance)
72 {
73 _objects.append(instance);
74 }
75
76 virtual void deliver(const Array<CIMInstance> & instances)
77 {
78 // call deliver for each object in the array
79 for(Uint32 i = 0, n = instances.size(); i < n; i++)
80 {
81 deliver(instances[i]);
82 }
83 kumpf 1.1 }
84
85 const Array<CIMInstance> getObjects(void) const
86 {
87 return _objects;
88 }
89
90 private:
91 Array<CIMInstance> _objects;
92
93 };
94
|
95 kumpf 1.2 class PEGASUS_SERVER_LINKAGE SimpleObjectPathResponseHandler : public SimpleResponseHandler, public ObjectPathResponseHandler
|
96 kumpf 1.1 {
97 public:
98 SimpleObjectPathResponseHandler(void)
99 {
100 }
101
102 void processing(void) { SimpleResponseHandler::processing(); }
103 void complete(void) { SimpleResponseHandler::complete(); }
104
105 virtual void deliver(const CIMObjectPath & objectPath)
106 {
107 _objects.append(objectPath);
108 }
109
110 virtual void deliver(const Array<CIMObjectPath> & objectPaths)
111 {
112 // call deliver for each object in the array
113 for(Uint32 i = 0, n = objectPaths.size(); i < n; i++)
114 {
115 deliver(objectPaths[i]);
116 }
117 kumpf 1.1 }
118
119 const Array<CIMObjectPath> getObjects(void) const
120 {
121 return _objects;
122 }
123
124 private:
125 Array<CIMObjectPath> _objects;
126
127 };
128
|
129 kumpf 1.2 class PEGASUS_SERVER_LINKAGE SimpleMethodResultResponseHandler : public SimpleResponseHandler, public MethodResultResponseHandler
|
130 kumpf 1.1 {
131 public:
132 SimpleMethodResultResponseHandler(void)
133 {
134 }
135
136 void processing(void) { SimpleResponseHandler::processing(); }
137 void complete(void) { SimpleResponseHandler::complete(); }
138
139 virtual void deliverParamValue(const CIMParamValue & outParamValue)
140 {
141 _objects.append(outParamValue);
142 }
143
144 virtual void deliverParamValue(const Array<CIMParamValue> & outParamValues)
145 {
146 // call deliver for each object in the array
147 for(Uint32 i = 0, n = outParamValues.size(); i < n; i++)
148 {
149 deliverParamValue(outParamValues[i]);
150 }
151 kumpf 1.1 }
152
153 virtual void deliver(const CIMValue & returnValue)
154 {
155 _returnValue = returnValue;
156 }
157
158 const Array<CIMParamValue> getParamValues(void) const
159 {
160 return _objects;
161 }
162
163 const CIMValue getReturnValue(void) const
164 {
165 return _returnValue;
166 }
167
168 private:
169 Array<CIMParamValue> _objects;
170
171 CIMValue _returnValue;
172 kumpf 1.1
173 };
174
|
175 kumpf 1.2 class PEGASUS_SERVER_LINKAGE SimpleIndicationResponseHandler : public SimpleResponseHandler, public IndicationResponseHandler
|
176 kumpf 1.1 {
177 public:
178 SimpleIndicationResponseHandler(void)
179 {
180 }
181
182 void processing(void) { SimpleResponseHandler::processing(); }
183 void complete(void) { SimpleResponseHandler::complete(); }
184
185 virtual void deliver(const CIMIndication & indication)
186 {
187 _objects.append(indication);
188 }
189
190 virtual void deliver(const Array<CIMIndication> & indications)
191 {
192 // call deliver for each object in the array
193 for(Uint32 i = 0, n = indications.size(); i < n; i++)
194 {
195 deliver(indications[i]);
196 }
197 kumpf 1.1 }
198
|
199 kumpf 1.4 virtual void deliver(
200 const OperationContext & context,
201 const CIMIndication & indication)
202 {
203 _objects.append(indication);
204 }
205
206 virtual void deliver(
207 const OperationContext & context,
208 const Array<CIMIndication> & indications)
209 {
210 // call deliver for each object in the array
211 for(Uint32 i = 0, n = indications.size(); i < n; i++)
212 {
213 deliver(indications[i]);
214 }
215 }
216
|
217 kumpf 1.1 const Array<CIMIndication> getObjects(void) const
218 {
219 return _objects;
220 }
221
222 private:
223 Array<CIMIndication> _objects;
224
225 };
226
|
227 kumpf 1.2 class PEGASUS_SERVER_LINKAGE SimpleObjectResponseHandler : public SimpleResponseHandler, public ObjectResponseHandler
|
228 kumpf 1.1 {
229 public:
230 SimpleObjectResponseHandler(void)
231 {
232 }
233
234 void processing(void) { SimpleResponseHandler::processing(); }
235 void complete(void) { SimpleResponseHandler::complete(); }
236
237 virtual void deliver(const CIMObject & object)
238 {
239 _objects.append(object);
240 }
241
242 virtual void deliver(const Array<CIMObject> & objects)
243 {
244 // call deliver for each object in the array
245 for(Uint32 i = 0, n = objects.size(); i < n; i++)
246 {
247 deliver(objects[i]);
248 }
249 kumpf 1.1 }
250
251 const Array<CIMObject> getObjects(void) const
252 {
253 return _objects;
254 }
255
256 private:
257 Array<CIMObject> _objects;
258
259 };
260
|
261 kumpf 1.2 class PEGASUS_SERVER_LINKAGE SimpleValueResponseHandler : public SimpleResponseHandler, public ValueResponseHandler
|
262 kumpf 1.1 {
263 public:
264 SimpleValueResponseHandler(void)
265 {
266 }
267
268 void processing(void) { SimpleResponseHandler::processing(); }
269 void complete(void) { SimpleResponseHandler::complete(); }
270
271 virtual void deliver(const CIMValue & value)
272 {
273 _objects.append(value);
274 }
275
276 virtual void deliver(const Array<CIMValue> & values)
277 {
278 // call deliver for each object in the array
279 for(Uint32 i = 0, n = values.size(); i < n; i++)
280 {
281 deliver(values[i]);
282 }
283 kumpf 1.1 }
284
285 const Array<CIMValue> getObjects(void) const
286 {
287 return _objects;
288 }
289
290 private:
291 Array<CIMValue> _objects;
292
293 };
294
|
295 kumpf 1.2 class PEGASUS_SERVER_LINKAGE SimpleClassResponseHandler : public SimpleResponseHandler, public ClassResponseHandler
|
296 kumpf 1.1 {
297 public:
298 SimpleClassResponseHandler(void)
299 {
300 }
301
302 void processing(void) { SimpleResponseHandler::processing(); }
303 void complete(void) { SimpleResponseHandler::complete(); }
304
305 virtual void deliver(const CIMClass & classObj)
306 {
307 _objects.append(classObj);
308 }
309
310 virtual void deliver(const Array<CIMClass> & classObjs)
311 {
312 // call deliver for each object in the array
313 for(Uint32 i = 0, n = classObjs.size(); i < n; i++)
314 {
315 deliver(classObjs[i]);
316 }
317 kumpf 1.1 }
318
319 const Array<CIMClass> getObjects(void) const
320 {
321 return _objects;
322 }
323
324 private:
325 Array<CIMClass> _objects;
326
327 };
328
329 PEGASUS_NAMESPACE_END
330
331 #endif
|