(file) Return to ResponseHandler.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  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             
119 karl   1.18 /**
120 kumpf  1.26     The InstanceResponseHandler class is a subclass of the ResponseHandler
121                 class which allows delivery of instance results.
122 karl   1.18 */
123 kumpf  1.26 class PEGASUS_COMMON_LINKAGE InstanceResponseHandler
124                 : virtual public ResponseHandler
125 kumpf  1.4  {
126             public:
127 kumpf  1.26     /**
128                     Delivers an instance result to the CIM Server.  This method may
129                     be called multiple times when more than one result needs to be
130                     delivered.  An Array form of this method is also available to
131                     deliver multiple results.
132                     @param instance The instance to deliver to the CIM Server.
133 kumpf  1.27         @exception Exception May be thrown if the data that is delivered is
134                     not consistent with the corresponding request or associated schema.
135 kumpf  1.10     */
136 kumpf  1.4      virtual void deliver(const CIMInstance & instance) = 0;
137             
138 kumpf  1.26     /**
139                     Delivers multiple instance results to the CIM Server.  This method
140                     may be invoked multiple times, if necessary.
141                     @param instances The instances to deliver to the CIM Server.
142 kumpf  1.27         @exception Exception May be thrown if the data that is delivered is
143                     not consistent with the corresponding request or associated schema.
144 kumpf  1.10     */
145 kumpf  1.4      virtual void deliver(const Array<CIMInstance> & instances) = 0;
146             };
147             
148             
149 kumpf  1.26 /**
150                 The ObjectPathResponseHandler class is a subclass of the ResponseHandler
151                 class which allows delivery of object path results.
152             */
153             class PEGASUS_COMMON_LINKAGE ObjectPathResponseHandler
154                 : virtual public ResponseHandler
155 kumpf  1.4  {
156             public:
157 kumpf  1.26     /**
158                     Delivers an object path result to the CIM Server.  This method may
159                     be called multiple times when more than one result needs to be
160                     delivered.  An Array form of this method is also available to
161                     deliver multiple results.
162                     @param objectPath The object path to deliver to the CIM Server.
163 kumpf  1.27         @exception Exception May be thrown if the data that is delivered is
164                     not consistent with the corresponding request or associated schema.
165 kumpf  1.10     */
166 kumpf  1.4      virtual void deliver(const CIMObjectPath & objectPath) = 0;
167             
168 kumpf  1.26     /**
169                     Delivers multiple object path results to the CIM Server.  This method
170                     may be invoked multiple times, if necessary.
171                     @param objectPaths The object paths to deliver to the CIM Server.
172 kumpf  1.27         @exception Exception May be thrown if the data that is delivered is
173                     not consistent with the corresponding request or associated schema.
174 kumpf  1.10     */
175 kumpf  1.4      virtual void deliver(const Array<CIMObjectPath> & objectPaths) = 0;
176             };
177             
178             
179 karl   1.18 /**
180 kumpf  1.26     The MethodResultResponseHandler class is a subclass of the ResponseHandler
181                 class which allows delivery of extrinsic method results.
182 karl   1.18 */
183 kumpf  1.26 class PEGASUS_COMMON_LINKAGE MethodResultResponseHandler
184                 : virtual public ResponseHandler
185 kumpf  1.4  {
186             public:
187 karl   1.18     /**
188 kumpf  1.26         Delivers extrinsic method output parameters to the CIM Server.
189                     This method may be called multiple times when more than one result
190                     needs to be delivered.  An Array form of this method is also
191                     available to deliver multiple results.
192                     @param outParamValue The output parameter to deliver to the CIM Server.
193 kumpf  1.27         @exception Exception May be thrown if the data that is delivered is
194                     not consistent with the corresponding request or associated schema.
195 kumpf  1.26     */
196 kumpf  1.4      virtual void deliverParamValue(const CIMParamValue & outParamValue) = 0;
197             
198 karl   1.18     /**
199 kumpf  1.26         Delivers a set of output parameters to the CIM Server.  This method
200                     may be invoked multiple times, if necessary.
201                     @param outParamValues An Array of method output parameters to deliver
202                     to the CIM Server.
203 kumpf  1.27         @exception Exception May be thrown if the data that is delivered is
204                     not consistent with the corresponding request or associated schema.
205 kumpf  1.26     */
206                 virtual void deliverParamValue(
207                     const Array<CIMParamValue> & outParamValues) = 0;
208 kumpf  1.4  
209 karl   1.18     /**
210 kumpf  1.26         Delivers an extrinsic method return value to the CIM Server.
211                     @param returnValue The return value to deliver to the CIM Server.
212 kumpf  1.27         @exception Exception May be thrown if the data that is delivered is
213                     not consistent with the corresponding request or associated schema.
214 kumpf  1.26     */
215 kumpf  1.4      virtual void deliver(const CIMValue & returnValue) = 0;
216             };
217             
218             
219 karl   1.18 /**
220 kumpf  1.26     The IndicationResponseHandler class is a subclass of the ResponseHandler
221                 class which allows delivery of generated indications.
222 karl   1.18 */
223 kumpf  1.26 class PEGASUS_COMMON_LINKAGE IndicationResponseHandler
224                 : virtual public ResponseHandler
225 kumpf  1.4  {
226             public:
227 karl   1.18     /**
228 kumpf  1.26         Delivers an indication to the CIM Server.  An Array form of this
229                     method is available to deliver multiple indications at once.
230                     Another form is also available to specify the context for the
231                     delivery.
232                     @param indication The indication instance to deliver to the CIM Server.
233 kumpf  1.27         @exception Exception May be thrown if the data that is delivered is
234                     not consistent with the corresponding request or associated schema.
235 kumpf  1.26     */
236 kumpf  1.4      virtual void deliver(const CIMIndication & indication) = 0;
237             
238 kumpf  1.26     /**
239                     Delivers multiple indications to the CIM Server.  Another form of
240                     this method is available to specify the context for the delivery.
241                     @param indications An Array of indication instances to deliver to the
242                     CIM Server.
243 kumpf  1.27         @exception Exception May be thrown if the data that is delivered is
244                     not consistent with the corresponding request or associated schema.
245 kumpf  1.26     */
246 kumpf  1.4      virtual void deliver(const Array<CIMIndication> & indications) = 0;
247 kumpf  1.8  
248 kumpf  1.26     /**
249                     Delivers an indication to the CIM Server with a specified context.
250                     An Array form of this method is available to deliver multiple
251                     indications at once.  The context may include data to be associated
252                     with the indication, such as the content language.
253                     @param context A context associated with the indication delivery.
254                     @param indication The indication instance to deliver to the CIM Server.
255 kumpf  1.27         @exception Exception May be thrown if the data that is delivered is
256                     not consistent with the corresponding request or associated schema.
257 kumpf  1.26     */
258 kumpf  1.8      virtual void deliver(
259                     const OperationContext & context,
260                     const CIMIndication & indication) = 0;
261             
262 kumpf  1.26     /**
263                     Delivers multiple indications to the CIM Server with a specified
264                     context.  The context may include data to be associated with the
265                     indications, such as the content language.
266                     @param context A context associated with the indication delivery.
267                     @param indications An Array of indication instances to deliver to the
268                     CIM Server.
269 kumpf  1.27         @exception Exception May be thrown if the data that is delivered is
270                     not consistent with the corresponding request or associated schema.
271 kumpf  1.26     */
272 kumpf  1.8      virtual void deliver(
273                     const OperationContext & context,
274                     const Array<CIMIndication> & indications) = 0;
275 kumpf  1.4  };
276             
277             
278 kumpf  1.26 /**
279                 The ObjectResponseHandler class is a subclass of the ResponseHandler
280                 class which allows delivery of object results.
281             */
282             class PEGASUS_COMMON_LINKAGE ObjectResponseHandler
283                 : virtual public ResponseHandler
284             {
285             public:
286                 /**
287                     Delivers an object result to the CIM Server.  This method may
288                     be called multiple times when more than one result needs to be
289                     delivered.  An Array form of this method is also available to
290                     deliver multiple results.
291                     @param object The object to deliver to the CIM Server.
292 kumpf  1.27         @exception Exception May be thrown if the data that is delivered is
293                     not consistent with the corresponding request or associated schema.
294 kumpf  1.10     */
295 kumpf  1.4      virtual void deliver(const CIMObject & object) = 0;
296             
297 kumpf  1.26     /**
298                     Delivers multiple object results to the CIM Server.  This method
299                     may be invoked multiple times, if necessary.
300                     @param objects The objects to deliver to the CIM Server.
301 kumpf  1.27         @exception Exception May be thrown if the data that is delivered is
302                     not consistent with the corresponding request or associated schema.
303 kumpf  1.10     */
304 kumpf  1.4      virtual void deliver(const Array<CIMObject> & objects) = 0;
305             };
306             
307 mike   1.2  PEGASUS_NAMESPACE_END
308             
309             #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2