(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 kumpf 1.10 
 47 mike  1.2  PEGASUS_NAMESPACE_BEGIN
 48            
 49 kumpf 1.4  /**
 50            <p>The <tt>ResponseHandler</tt> class allows a provider
 51 kumpf 1.10 to report operation progress and results to the CIM Server.
 52 kumpf 1.4  Subclasses are defined for each of the types of object
 53 kumpf 1.10 that a provider can deliver to the CIM Server.
 54 kumpf 1.4  A <tt>ResponseHandler</tt> object of the appropriate type
 55            is passed to provider
 56            functions that are invoked to process client requests (it
 57            is not passed to the <tt>{@link initialize initialize}</tt>
 58            or <tt>{@link terminate terminate}</tt> functions). It
 59            contains the following public member functions that
 60 kumpf 1.10 may be used to deliver results to the CIM Server:</p>
 61 kumpf 1.4  <ul>
 62 kumpf 1.10 <li><tt>{@link processing processing}</tt> - inform the CIM Server
 63            that delivery of results is beginning.</li>
 64 kumpf 1.4  <li><tt>{@link deliver deliver}</tt> - deliver an incremental
 65 kumpf 1.10 result to the CIM Server; the CIM Server accumulates results as
 66            they are received from the provider.</li>
 67            <li><tt>{@link complete complete}</tt> - inform the CIM Server that
 68 kumpf 1.4  process of the request is complete and that no further
 69 kumpf 1.10 results will be delivered.</li>
 70 kumpf 1.4  </ul>
 71            */
 72            
 73 kumpf 1.5  class PEGASUS_COMMON_LINKAGE ResponseHandler
 74 kumpf 1.4  {
 75            public:
 76            
 77                /**
 78                Destructor.
 79                */
 80                virtual ~ResponseHandler(void);
 81            
 82 kumpf 1.10     // This method is defined in subclasses, specialized for 
 83                // the appropriate data type.
 84 kumpf 1.4      //virtual void deliver(const T & object);
 85            
 86 kumpf 1.10     // This method is defined in subclasses, specialized for 
 87                // the appropriate data type.
 88 kumpf 1.4      //virtual void deliver(const Array<T> & objects);
 89            
 90                /**
 91 kumpf 1.10     Inform the CIM Server that delivery of results will begin.
 92 kumpf 1.4      <p>The provider must call <tt>processing</tt> before
 93                attempting to call <tt>deliver</tt>.
 94                */
 95                virtual void processing(void) = 0;
 96            
 97                /**
 98 kumpf 1.10     Inform the CIM Server that delivery of results is complete.
 99 kumpf 1.4      <p>The provider must call <tt>complete</tt> when all
100                results have been delivered. It must not call <tt>deliver</tt>
101                after calling <tt>complete</tt>.</p>
102                */
103                virtual void complete(void) = 0;
104            };
105            
106            
107            //
108            // InstanceResponseHandler
109 kumpf 1.10 ///
110 kumpf 1.5  class PEGASUS_COMMON_LINKAGE InstanceResponseHandler : virtual public ResponseHandler
111 kumpf 1.4  {
112            public:
113 kumpf 1.10     /** <p>The <tt>deliver</tt> function is used by providers to
114                    deliver results to the CIM Server. For operations that require a
115                    single element result (<tt>getInstance</tt>, for example),
116                    <tt>deliver</tt> should be called only once to deliver the
117                    entire result. For operations that involve
118                    enumeration, the single-element form shown here may be
119                    used, each iteration delivering an incremental element
120                    of the total result. The Array form below may be used
121                    to deliver a larger set of result elements.</p>
122                */
123 kumpf 1.4      virtual void deliver(const CIMInstance & instance) = 0;
124            
125 kumpf 1.10     /** <p>This form of the <tt>deliver</tt> function may be used
126                    to return a set of elements to the CIM Server. The set is not
127                    required to be complete, and the provider may invoke this
128                    function multiple times, if necessary. This form should only
129                    be used when the operation requires a result consisting
130                    of more than one element, such as an enumeration.</p>
131                */
132 kumpf 1.4      virtual void deliver(const Array<CIMInstance> & instances) = 0;
133            };
134            
135            
136            //
137            // ObjectPathResponseHandler
138 kumpf 1.10 ///
139 kumpf 1.5  class PEGASUS_COMMON_LINKAGE ObjectPathResponseHandler : virtual public ResponseHandler
140 kumpf 1.4  {
141            public:
142 kumpf 1.10     /** <p>The <tt>deliver</tt> function is used by providers to
143                    deliver results to the CIM Server. For operations that require a
144                    single element result (<tt>getInstance</tt>, for example),
145                    <tt>deliver</tt> should be called only once to deliver the
146                    entire result. For operations that involve
147                    enumeration, the single-element form shown here may be
148                    used, each iteration delivering an incremental element
149                    of the total result. The Array form below may be used
150                    to deliver a larger set of result elements.</p>
151                */
152 kumpf 1.4      virtual void deliver(const CIMObjectPath & objectPath) = 0;
153            
154 kumpf 1.10     /** <p>This form of the <tt>deliver</tt> function may be used
155                    to return a set of elements to the CIM Server. The set is not
156                    required to be complete, and the provider may invoke this
157                    function multiple times, if necessary. This form should only
158                    be used when the operation requires a result consisting
159                    of more than one element, such as an enumeration.</p>
160                */
161 kumpf 1.4      virtual void deliver(const Array<CIMObjectPath> & objectPaths) = 0;
162            };
163            
164            
165            //
166            // MethodResultResponseHandler
167 kumpf 1.10 ///
168 kumpf 1.5  class PEGASUS_COMMON_LINKAGE MethodResultResponseHandler : virtual public ResponseHandler
169 kumpf 1.4  {
170            public:
171 kumpf 1.10     ///
172 kumpf 1.4      virtual void deliverParamValue(const CIMParamValue & outParamValue) = 0;
173            
174 kumpf 1.10     ///
175 kumpf 1.4      virtual void deliverParamValue(const Array<CIMParamValue> & outParamValues) = 0;
176            
177 kumpf 1.10     ///
178 kumpf 1.4      virtual void deliver(const CIMValue & returnValue) = 0;
179            };
180            
181            
182            //
183            // IndicationResponseHandler
184            //
185 kumpf 1.8  // NOTE: This class definition should not be considered complete until
186            // indication support has been completed in Pegasus.  Implementation of
187            // indication support may reveal a need for API changes in this class.
188 kumpf 1.5  class PEGASUS_COMMON_LINKAGE IndicationResponseHandler : virtual public ResponseHandler
189 kumpf 1.4  {
190            public:
191                virtual void deliver(const CIMIndication & indication) = 0;
192            
193                virtual void deliver(const Array<CIMIndication> & indications) = 0;
194 kumpf 1.8  
195                virtual void deliver(
196                    const OperationContext & context,
197                    const CIMIndication & indication) = 0;
198            
199                virtual void deliver(
200                    const OperationContext & context,
201                    const Array<CIMIndication> & indications) = 0;
202 kumpf 1.4  };
203            
204            
205            //
206            // ObjectResponseHandler
207            //
208 kumpf 1.9  // NOTE: This class definition should not be considered complete until
209            // association provider and/or query provider support has been completed
210            // in Pegasus, as those are the only APIs that use this response handler
211            // type.  Implementation of support for those provider types may reveal
212            // a need for API changes in this class.
213 kumpf 1.10 ///
214 kumpf 1.5  class PEGASUS_COMMON_LINKAGE ObjectResponseHandler : virtual public ResponseHandler
215 kumpf 1.4  {
216            public:
217 kumpf 1.10     /** <p>The <tt>deliver</tt> function is used by providers to
218                    deliver results to the CIM Server. For operations that require a
219                    single element result (<tt>getInstance</tt>, for example),
220                    <tt>deliver</tt> should be called only once to deliver the
221                    entire result. For operations that involve
222                    enumeration, the single-element form shown here may be
223                    used, each iteration delivering an incremental element
224                    of the total result. The Array form below may be used
225                    to deliver a larger set of result elements.</p>
226                */
227 kumpf 1.4      virtual void deliver(const CIMObject & object) = 0;
228            
229 kumpf 1.10     /** <p>This form of the <tt>deliver</tt> function may be used
230                    to return a set of elements to the CIM Server. The set is not
231                    required to be complete, and the provider may invoke this
232                    function multiple times, if necessary. This form should only
233                    be used when the operation requires a result consisting
234                    of more than one element, such as an enumeration.</p>
235                */
236 kumpf 1.4      virtual void deliver(const Array<CIMObject> & objects) = 0;
237            };
238            
239            
240 kumpf 1.7  #ifdef PEGASUS_INTERNALONLY
241            // This type is used in CIMPropertyProvider which Pegasus does not support
242 kumpf 1.4  //
243            // ValueResponseHandler
244            //
245 kumpf 1.5  class PEGASUS_COMMON_LINKAGE ValueResponseHandler : virtual public ResponseHandler
246 kumpf 1.4  {
247            public:
248                virtual void deliver(const CIMValue & value) = 0;
249            
250                virtual void deliver(const Array<CIMValue> & values) = 0;
251            };
252 kumpf 1.7  #endif
253 kumpf 1.4  
254            
255 kumpf 1.7  #ifdef PEGASUS_INTERNALONLY
256            // This type is used in CIMClassProvider which Pegasus does not support
257 kumpf 1.4  //
258            // ClassResponseHandler
259            //
260 kumpf 1.5  class PEGASUS_COMMON_LINKAGE ClassResponseHandler : virtual public ResponseHandler
261 mike  1.2  {
262            public:
263 kumpf 1.4      virtual void deliver(const CIMClass & classObj) = 0;
264 mike  1.2  
265 kumpf 1.4      virtual void deliver(const Array<CIMClass> & classObjs) = 0;
266 mike  1.2  };
267 kumpf 1.7  #endif
268 mike  1.2  
269            PEGASUS_NAMESPACE_END
270            
271            #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2