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

  1 kumpf 1.4 //%/////////////////////////////////////////////////////////////////////////////
  2 mike  1.2 //
  3 kumpf 1.4 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
  4           // The Open Group, Tivoli Systems
  5 mike  1.2 //
  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           //==============================================================================
 23           //
 24           // Author: Chip Vincent (cvincent@us.ibm.com)
 25           //
 26 kumpf 1.4 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 27 mike  1.2 //
 28           //%/////////////////////////////////////////////////////////////////////////////
 29           
 30           #ifndef Pegasus_ResponseHandler_h
 31           #define Pegasus_ResponseHandler_h
 32           
 33           #include <Pegasus/Common/Config.h>
 34           #include <Pegasus/Common/Array.h>
 35 kumpf 1.6 #include <Pegasus/Common/Linkage.h>
 36 kumpf 1.4 
 37           #include <Pegasus/Common/CIMInstance.h>
 38           #include <Pegasus/Common/CIMObjectPath.h>
 39           #include <Pegasus/Common/CIMParamValue.h>
 40           #include <Pegasus/Common/CIMValue.h>
 41           #include <Pegasus/Common/CIMIndication.h>
 42           #include <Pegasus/Common/CIMObject.h>
 43           #include <Pegasus/Common/CIMClass.h>
 44 kumpf 1.8 #include <Pegasus/Common/OperationContext.h>
 45 mike  1.2 
 46           PEGASUS_NAMESPACE_BEGIN
 47           
 48 kumpf 1.4 /**
 49           Callback to deliver results to the CIMOM.
 50           
 51           <p>The <tt>ResponseHandler</tt> class allows a provider
 52           to report operation progress and results to the CIMOM.
 53           Subclasses are defined for each of the types of object
 54           that a provider can deliver to the CIMOM.
 55           A <tt>ResponseHandler</tt> object of the appropriate type
 56           is passed to provider
 57           functions that are invoked to process client requests (it
 58           is not passed to the <tt>{@link initialize initialize}</tt>
 59           or <tt>{@link terminate terminate}</tt> functions). It
 60           contains the following public member functions that
 61           may be used to deliver results to the CIMOM:</p>
 62           <ul>
 63           <li><tt>{@link processing processing}</tt> - inform the CIMOM
 64           that delivery of results is beginning</li>
 65           <li><tt>{@link deliver deliver}</tt> - deliver an incremental
 66           result to the CIMOM; the CIMOM accumulates results as
 67           they are received from the provider</li>
 68           <li><tt>{@link complete complete}</tt> - inform the CIMOM that
 69 kumpf 1.4 process of the request is complete and that no further
 70           results will be delivered</li>
 71           </ul>
 72           */
 73           
 74 kumpf 1.5 class PEGASUS_COMMON_LINKAGE ResponseHandler
 75 kumpf 1.4 {
 76           public:
 77           
 78               /**
 79               Destructor.
 80               */
 81               virtual ~ResponseHandler(void);
 82           
 83               /**
 84               Deliver a possibly partial result to CIMOM.
 85               <p>The <tt>deliver</tt> function is used by providers to
 86               deliver results to the CIMOM. For operations that require a
 87               single element result (<tt>getInstance</tt>, for example),
 88               <tt>deliver</tt> should be called only once to deliver the
 89               entire result. For operations that involve
 90               enumeration, the single-element form shown here may be
 91               used, each iteration delivering an incremental element
 92               of the total result. The Array form below may be used
 93               to deliver a larger set of result elements.</p>
 94               */
 95               //virtual void deliver(const T & object);
 96 kumpf 1.4 
 97               /**
 98               Deliver a set of results to CIMOM.
 99               <p>This form of the <tt>deliver</tt> function may be used
100               to return a set of elements to the CIMOM. The set is not
101               required to be complete, and the provider may invoke this
102               function multiple times, if necessary. This form should only
103               be used when the operation requires a result consisting
104               of more than one element, such as an enumeration.</p>
105               */
106               //virtual void deliver(const Array<T> & objects);
107           
108               /**
109               Inform the CIMOM that delivery of results will begin.
110               <p>The provider must call <tt>processing</tt> before
111               attempting to call <tt>deliver</tt>.
112               */
113               virtual void processing(void) = 0;
114           
115               /**
116               Inform the CIMOM that delivery of results is complete.
117 kumpf 1.4     <p>The provider must call <tt>complete</tt> when all
118               results have been delivered. It must not call <tt>deliver</tt>
119               after calling <tt>complete</tt>.</p>
120               */
121               virtual void complete(void) = 0;
122           };
123           
124           
125           //
126           // InstanceResponseHandler
127           //
128 kumpf 1.5 class PEGASUS_COMMON_LINKAGE InstanceResponseHandler : virtual public ResponseHandler
129 kumpf 1.4 {
130           public:
131               virtual void deliver(const CIMInstance & instance) = 0;
132           
133               virtual void deliver(const Array<CIMInstance> & instances) = 0;
134           };
135           
136           
137           //
138           // ObjectPathResponseHandler
139           //
140 kumpf 1.5 class PEGASUS_COMMON_LINKAGE ObjectPathResponseHandler : virtual public ResponseHandler
141 kumpf 1.4 {
142           public:
143               virtual void deliver(const CIMObjectPath & objectPath) = 0;
144           
145               virtual void deliver(const Array<CIMObjectPath> & objectPaths) = 0;
146           };
147           
148           
149           //
150           // MethodResultResponseHandler
151           //
152 kumpf 1.5 class PEGASUS_COMMON_LINKAGE MethodResultResponseHandler : virtual public ResponseHandler
153 kumpf 1.4 {
154           public:
155               virtual void deliverParamValue(const CIMParamValue & outParamValue) = 0;
156           
157               virtual void deliverParamValue(const Array<CIMParamValue> & outParamValues) = 0;
158           
159               virtual void deliver(const CIMValue & returnValue) = 0;
160           };
161           
162           
163           //
164           // IndicationResponseHandler
165           //
166 kumpf 1.8 // NOTE: This class definition should not be considered complete until
167           // indication support has been completed in Pegasus.  Implementation of
168           // indication support may reveal a need for API changes in this class.
169 kumpf 1.5 class PEGASUS_COMMON_LINKAGE IndicationResponseHandler : virtual public ResponseHandler
170 kumpf 1.4 {
171           public:
172               virtual void deliver(const CIMIndication & indication) = 0;
173           
174               virtual void deliver(const Array<CIMIndication> & indications) = 0;
175 kumpf 1.8 
176               virtual void deliver(
177                   const OperationContext & context,
178                   const CIMIndication & indication) = 0;
179           
180               virtual void deliver(
181                   const OperationContext & context,
182                   const Array<CIMIndication> & indications) = 0;
183 kumpf 1.4 };
184           
185           
186           //
187           // ObjectResponseHandler
188           //
189 kumpf 1.9 // NOTE: This class definition should not be considered complete until
190           // association provider and/or query provider support has been completed
191           // in Pegasus, as those are the only APIs that use this response handler
192           // type.  Implementation of support for those provider types may reveal
193           // a need for API changes in this class.
194 kumpf 1.5 class PEGASUS_COMMON_LINKAGE ObjectResponseHandler : virtual public ResponseHandler
195 kumpf 1.4 {
196           public:
197               virtual void deliver(const CIMObject & object) = 0;
198           
199               virtual void deliver(const Array<CIMObject> & objects) = 0;
200           };
201           
202           
203 mday  1.9.4.1 
204 kumpf 1.7     // This type is used in CIMPropertyProvider which Pegasus does not support
205 kumpf 1.4     //
206               // ValueResponseHandler
207               //
208 kumpf 1.5     class PEGASUS_COMMON_LINKAGE ValueResponseHandler : virtual public ResponseHandler
209 kumpf 1.4     {
210               public:
211                   virtual void deliver(const CIMValue & value) = 0;
212               
213                   virtual void deliver(const Array<CIMValue> & values) = 0;
214               };
215               
216               
217 mday  1.9.4.1 
218               
219 kumpf 1.7     // This type is used in CIMClassProvider which Pegasus does not support
220 kumpf 1.4     //
221               // ClassResponseHandler
222               //
223 kumpf 1.5     class PEGASUS_COMMON_LINKAGE ClassResponseHandler : virtual public ResponseHandler
224 mike  1.2     {
225               public:
226 kumpf 1.4         virtual void deliver(const CIMClass & classObj) = 0;
227 mike  1.2     
228 kumpf 1.4         virtual void deliver(const Array<CIMClass> & classObjs) = 0;
229 mike  1.2     };
230 mday  1.9.4.1 
231 mike  1.2     
232               PEGASUS_NAMESPACE_END
233               
234               #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2