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