1 martin 1.31 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.32 //
|
3 martin 1.31 // 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.32 //
|
10 martin 1.31 // 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.32 //
|
17 martin 1.31 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.32 //
|
20 martin 1.31 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.32 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.31 // 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.32 //
|
28 martin 1.31 //////////////////////////////////////////////////////////////////////////
|
29 mike 1.2 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_ResponseHandler_h
33 #define Pegasus_ResponseHandler_h
34
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/Array.h>
|
37 kumpf 1.6 #include <Pegasus/Common/Linkage.h>
|
38 kumpf 1.4
39 #include <Pegasus/Common/CIMInstance.h>
40 #include <Pegasus/Common/CIMObjectPath.h>
41 #include <Pegasus/Common/CIMParamValue.h>
42 #include <Pegasus/Common/CIMValue.h>
43 #include <Pegasus/Common/CIMIndication.h>
44 #include <Pegasus/Common/CIMObject.h>
45 #include <Pegasus/Common/CIMClass.h>
|
46 kumpf 1.8 #include <Pegasus/Common/OperationContext.h>
|
47 chuck 1.11
|
48 chuck 1.12 PEGASUS_NAMESPACE_BEGIN
|
49 kumpf 1.10
|
50 kumpf 1.4 /**
|
51 kumpf 1.26 The ResponseHandler class allows a provider to report operation
52 progress and results to the CIM Server. Subclasses are defined
53 for each type of result data.
|
54 kumpf 1.4 */
|
55 kumpf 1.5 class PEGASUS_COMMON_LINKAGE ResponseHandler
|
56 kumpf 1.4 {
57 public:
58
59 /**
|
60 kumpf 1.26 Destructs the ResponseHandler.
|
61 kumpf 1.4 */
|
62 kumpf 1.26 virtual ~ResponseHandler();
|
63 kumpf 1.4
|
64 kumpf 1.26 // This method is defined in subclasses, specialized for
|
65 kumpf 1.10 // the appropriate data type.
|
66 kumpf 1.4 //virtual void deliver(const T & object);
67
|
68 kumpf 1.26 // This method is defined in subclasses, specialized for
|
69 kumpf 1.10 // the appropriate data type.
|
70 kumpf 1.4 //virtual void deliver(const Array<T> & objects);
71
72 /**
|
73 kumpf 1.26 Informs the CIM Server that delivery of results will begin.
74 This method must be called before deliver() is called.
|
75 kumpf 1.4 */
|
76 kumpf 1.26 virtual void processing() = 0;
|
77 chuck 1.11
|
78 kumpf 1.4 /**
|
79 kumpf 1.26 Informs the CIM Server that delivery of results is complete.
80 This method must be called when all the results have been delivered.
81 The deliver() method must not be called after this method is called.
|
82 kumpf 1.4 */
|
83 kumpf 1.26 virtual void complete() = 0;
|
84 chuck 1.12
|
85 kumpf 1.28 /**
|
86 kumpf 1.26 Sets the context for operation responses delivered to the CIM Server.
87 This method allows a provider to communicate context information
88 (such as content language) along with an operation response. The
89 context information applies to all the operation response data
90 delivered to this ResponseHandler object. The context information
91 is applied at the time the complete() method is called.
|
92 chuck 1.12 */
93 void setContext(const OperationContext & context);
94
95 protected:
|
96 kumpf 1.26
|
97 kumpf 1.30 /**
98 The default constructor is not available for the ResponseHandler class.
99 */
|
100 chuck 1.12 ResponseHandler();
101
|
102 kumpf 1.30 /**
103 The copy constructor is not available for the ResponseHandler class.
104 */
|
105 kumpf 1.13 ResponseHandler(const ResponseHandler& handler);
106
|
107 kumpf 1.30 /**
108 The assignment operator is not available for the ResponseHandler class.
109 */
|
110 kumpf 1.13 ResponseHandler& operator=(const ResponseHandler& handler);
111
|
112 karl 1.18 /**
|
113 kumpf 1.26 Gets the context for the results delivered to the CIM Server.
|
114 karl 1.18 */
|
115 kumpf 1.26 OperationContext getContext() const;
|
116 kumpf 1.4 };
117
|
118 karl 1.18 /**
|
119 kumpf 1.26 The InstanceResponseHandler class is a subclass of the ResponseHandler
120 class which allows delivery of instance results.
|
121 karl 1.18 */
|
122 kumpf 1.26 class PEGASUS_COMMON_LINKAGE InstanceResponseHandler
123 : virtual public ResponseHandler
|
124 kumpf 1.4 {
125 public:
|
126 kumpf 1.26 /**
127 Delivers an instance result to the CIM Server. This method may
128 be called multiple times when more than one result needs to be
129 delivered. An Array form of this method is also available to
130 deliver multiple results.
131 @param instance The instance to deliver to the CIM Server.
|
132 kumpf 1.27 @exception Exception May be thrown if the data that is delivered is
133 not consistent with the corresponding request or associated schema.
|
134 kumpf 1.10 */
|
135 kumpf 1.4 virtual void deliver(const CIMInstance & instance) = 0;
136
|
137 kumpf 1.26 /**
138 Delivers multiple instance results to the CIM Server. This method
139 may be invoked multiple times, if necessary.
140 @param instances The instances to deliver to the CIM Server.
|
141 kumpf 1.27 @exception Exception May be thrown if the data that is delivered is
142 not consistent with the corresponding request or associated schema.
|
143 kumpf 1.10 */
|
144 kumpf 1.4 virtual void deliver(const Array<CIMInstance> & instances) = 0;
145 };
146
147
|
148 kumpf 1.26 /**
149 The ObjectPathResponseHandler class is a subclass of the ResponseHandler
150 class which allows delivery of object path results.
151 */
152 class PEGASUS_COMMON_LINKAGE ObjectPathResponseHandler
153 : virtual public ResponseHandler
|
154 kumpf 1.4 {
155 public:
|
156 kumpf 1.26 /**
157 Delivers an object path result to the CIM Server. This method may
158 be called multiple times when more than one result needs to be
159 delivered. An Array form of this method is also available to
160 deliver multiple results.
161 @param objectPath The object path to deliver to the CIM Server.
|
162 kumpf 1.27 @exception Exception May be thrown if the data that is delivered is
163 not consistent with the corresponding request or associated schema.
|
164 kumpf 1.10 */
|
165 kumpf 1.4 virtual void deliver(const CIMObjectPath & objectPath) = 0;
166
|
167 kumpf 1.26 /**
168 Delivers multiple object path results to the CIM Server. This method
169 may be invoked multiple times, if necessary.
170 @param objectPaths The object paths to deliver to the CIM Server.
|
171 kumpf 1.27 @exception Exception May be thrown if the data that is delivered is
172 not consistent with the corresponding request or associated schema.
|
173 kumpf 1.10 */
|
174 kumpf 1.4 virtual void deliver(const Array<CIMObjectPath> & objectPaths) = 0;
175 };
176
177
|
178 karl 1.18 /**
|
179 kumpf 1.26 The MethodResultResponseHandler class is a subclass of the ResponseHandler
180 class which allows delivery of extrinsic method results.
|
181 karl 1.18 */
|
182 kumpf 1.26 class PEGASUS_COMMON_LINKAGE MethodResultResponseHandler
183 : virtual public ResponseHandler
|
184 kumpf 1.4 {
185 public:
|
186 karl 1.18 /**
|
187 kumpf 1.26 Delivers extrinsic method output parameters to the CIM Server.
188 This method may be called multiple times when more than one result
189 needs to be delivered. An Array form of this method is also
190 available to deliver multiple results.
191 @param outParamValue The output parameter to deliver to the CIM Server.
|
192 kumpf 1.27 @exception Exception May be thrown if the data that is delivered is
193 not consistent with the corresponding request or associated schema.
|
194 kumpf 1.26 */
|
195 kumpf 1.4 virtual void deliverParamValue(const CIMParamValue & outParamValue) = 0;
196
|
197 karl 1.18 /**
|
198 kumpf 1.26 Delivers a set of output parameters to the CIM Server. This method
199 may be invoked multiple times, if necessary.
200 @param outParamValues An Array of method output parameters to deliver
201 to the CIM Server.
|
202 kumpf 1.27 @exception Exception May be thrown if the data that is delivered is
203 not consistent with the corresponding request or associated schema.
|
204 kumpf 1.26 */
205 virtual void deliverParamValue(
206 const Array<CIMParamValue> & outParamValues) = 0;
|
207 kumpf 1.4
|
208 karl 1.18 /**
|
209 kumpf 1.26 Delivers an extrinsic method return value to the CIM Server.
210 @param returnValue The return value to deliver to the CIM Server.
|
211 kumpf 1.27 @exception Exception May be thrown if the data that is delivered is
212 not consistent with the corresponding request or associated schema.
|
213 kumpf 1.26 */
|
214 kumpf 1.4 virtual void deliver(const CIMValue & returnValue) = 0;
215 };
216
217
|
218 karl 1.18 /**
|
219 kumpf 1.26 The IndicationResponseHandler class is a subclass of the ResponseHandler
220 class which allows delivery of generated indications.
|
221 karl 1.18 */
|
222 kumpf 1.26 class PEGASUS_COMMON_LINKAGE IndicationResponseHandler
223 : virtual public ResponseHandler
|
224 kumpf 1.4 {
225 public:
|
226 karl 1.18 /**
|
227 kumpf 1.26 Delivers an indication to the CIM Server. An Array form of this
228 method is available to deliver multiple indications at once.
229 Another form is also available to specify the context for the
230 delivery.
231 @param indication The indication instance to deliver to the CIM Server.
|
232 kumpf 1.27 @exception Exception May be thrown if the data that is delivered is
233 not consistent with the corresponding request or associated schema.
|
234 kumpf 1.26 */
|
235 kumpf 1.4 virtual void deliver(const CIMIndication & indication) = 0;
236
|
237 kumpf 1.26 /**
238 Delivers multiple indications to the CIM Server. Another form of
239 this method is available to specify the context for the delivery.
240 @param indications An Array of indication instances to deliver to the
241 CIM Server.
|
242 kumpf 1.27 @exception Exception May be thrown if the data that is delivered is
243 not consistent with the corresponding request or associated schema.
|
244 kumpf 1.26 */
|
245 kumpf 1.4 virtual void deliver(const Array<CIMIndication> & indications) = 0;
|
246 kumpf 1.8
|
247 kumpf 1.26 /**
248 Delivers an indication to the CIM Server with a specified context.
249 An Array form of this method is available to deliver multiple
250 indications at once. The context may include data to be associated
251 with the indication, such as the content language.
252 @param context A context associated with the indication delivery.
253 @param indication The indication instance to deliver to the CIM Server.
|
254 kumpf 1.27 @exception Exception May be thrown if the data that is delivered is
255 not consistent with the corresponding request or associated schema.
|
256 kumpf 1.26 */
|
257 kumpf 1.8 virtual void deliver(
258 const OperationContext & context,
259 const CIMIndication & indication) = 0;
260
|
261 kumpf 1.26 /**
262 Delivers multiple indications to the CIM Server with a specified
263 context. The context may include data to be associated with the
264 indications, such as the content language.
265 @param context A context associated with the indication delivery.
266 @param indications An Array of indication instances to deliver to the
267 CIM Server.
|
268 kumpf 1.27 @exception Exception May be thrown if the data that is delivered is
269 not consistent with the corresponding request or associated schema.
|
270 kumpf 1.26 */
|
271 kumpf 1.8 virtual void deliver(
272 const OperationContext & context,
273 const Array<CIMIndication> & indications) = 0;
|
274 kumpf 1.4 };
275
276
|
277 kumpf 1.26 /**
278 The ObjectResponseHandler class is a subclass of the ResponseHandler
279 class which allows delivery of object results.
280 */
281 class PEGASUS_COMMON_LINKAGE ObjectResponseHandler
282 : virtual public ResponseHandler
283 {
284 public:
285 /**
286 Delivers an object result to the CIM Server. This method may
287 be called multiple times when more than one result needs to be
288 delivered. An Array form of this method is also available to
289 deliver multiple results.
290 @param object The object to deliver to the CIM Server.
|
291 kumpf 1.27 @exception Exception May be thrown if the data that is delivered is
292 not consistent with the corresponding request or associated schema.
|
293 kumpf 1.10 */
|
294 kumpf 1.4 virtual void deliver(const CIMObject & object) = 0;
295
|
296 kumpf 1.26 /**
297 Delivers multiple object results to the CIM Server. This method
298 may be invoked multiple times, if necessary.
299 @param objects The objects to deliver to the CIM Server.
|
300 kumpf 1.27 @exception Exception May be thrown if the data that is delivered is
301 not consistent with the corresponding request or associated schema.
|
302 kumpf 1.10 */
|
303 kumpf 1.4 virtual void deliver(const Array<CIMObject> & objects) = 0;
304 };
305
|
306 mike 1.2 PEGASUS_NAMESPACE_END
307
308 #endif
|