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

  1 a.dunfey 1.23.18.1 //%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 a.dunfey 1.23.18.1 // 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 mike     1.2       
 51 chuck    1.12      PEGASUS_NAMESPACE_BEGIN
 52 kumpf    1.10      
 53 kumpf    1.4       /**
 54                    <p>The <tt>ResponseHandler</tt> class allows a provider
 55 kumpf    1.10      to report operation progress and results to the CIM Server.
 56 kumpf    1.4       Subclasses are defined for each of the types of object
 57 kumpf    1.10      that a provider can deliver to the CIM Server.
 58 kumpf    1.4       A <tt>ResponseHandler</tt> object of the appropriate type
 59                    is passed to provider
 60                    functions that are invoked to process client requests (it
 61                    is not passed to the <tt>{@link initialize initialize}</tt>
 62                    or <tt>{@link terminate terminate}</tt> functions). It
 63                    contains the following public member functions that
 64 kumpf    1.10      may be used to deliver results to the CIM Server:</p>
 65 kumpf    1.4       <ul>
 66 kumpf    1.10      <li><tt>{@link processing processing}</tt> - inform the CIM Server
 67                    that delivery of results is beginning.</li>
 68 kumpf    1.4       <li><tt>{@link deliver deliver}</tt> - deliver an incremental
 69 kumpf    1.10      result to the CIM Server; the CIM Server accumulates results as
 70                    they are received from the provider.</li>
 71                    <li><tt>{@link complete complete}</tt> - inform the CIM Server that
 72 kumpf    1.4       process of the request is complete and that no further
 73 kumpf    1.10      results will be delivered.</li>
 74 kumpf    1.4       </ul>
 75                    */
 76                    
 77 kumpf    1.5       class PEGASUS_COMMON_LINKAGE ResponseHandler
 78 kumpf    1.4       {
 79                    public:
 80                    
 81                        /**
 82 karl     1.18          ResponseHandler destructor.
 83 kumpf    1.4           */
 84                        virtual ~ResponseHandler(void);
 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 T & object);
 89                    
 90 kumpf    1.10          // This method is defined in subclasses, specialized for 
 91                        // the appropriate data type.
 92 kumpf    1.4           //virtual void deliver(const Array<T> & objects);
 93                    
 94                        /**
 95 karl     1.18          Inform the CIM server that delivery of results will begin.
 96 kumpf    1.4           <p>The provider must call <tt>processing</tt> before
 97                        attempting to call <tt>deliver</tt>.
 98                        */
 99                        virtual void processing(void) = 0;
100 chuck    1.11      
101 kumpf    1.4           /**
102 karl     1.18          Inform the CIM server that delivery of results is complete.
103 kumpf    1.4           <p>The provider must call <tt>complete</tt> when all
104 karl     1.18          results have been delivered. The provider must not call <tt>deliver</tt>
105 kumpf    1.4           after calling <tt>complete</tt>.</p>
106                        */
107                        virtual void complete(void) = 0;
108 chuck    1.12      
109 chuck    1.14      #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
110 denise.eckstein 1.19          /** <I><B>Experimental Interface</B></I><BR>
111 chuck           1.12          Set the context for the results delivered to the CIM Server.
112                               <p>The <tt>setContext</tt> function is used by providers to
113                               set a context for the response, in the form of an OperationContext
114                               object.  The context of the response contains the settings that
115                               apply to all the results delivered to the CIM Server.  An example
116                               context is the language of the response, in the form of a 
117                               ContentLanguageListContainer in the OperationContext.</p>
118                               <p>This method may be called at any point in the response
119                               processing before <tt>complete</tt> is called.</p>
120                               <p>Currently supported OperationContext containers:
121                               <li>
122 a.dunfey        1.23.18.1     ContentLanguageListContainer: used to set the ContentLanguageList of the
123 chuck           1.12          results.
124                               </li>
125                               </p>
126                               <p>Implementation Note:  This method is concrete to preserve 
127                               binary compatibility with previous releases of the CIMServer</p> 
128                               */
129 chuck           1.16      #ifdef PEGASUS_OS_OS400
130                           virtual
131                           #endif
132 chuck           1.12          void setContext(const OperationContext & context);
133 chuck           1.14      #endif  // PEGASUS_USE_EXPERIMENTAL_INTERFACES
134 chuck           1.12      
135                           protected:
136                               
137                               ResponseHandler();
138                           
139 kumpf           1.13          ResponseHandler(const ResponseHandler& handler);
140                           
141                               ResponseHandler& operator=(const ResponseHandler& handler);
142                           
143 karl            1.18          /**
144                               Gets the context for the results delivered to the CIM server.
145                               */
146 chuck           1.12          OperationContext getContext(void) const;
147 kumpf           1.4       };
148                           
149                           
150 karl            1.18      /**
151                           The InstanceResponseHandler class is a subclass to the ResponseHandler class.
152                           The InstanceResponseHandler class contains functions that are specific to an 
153                           instance of the ResponseHandler class.
154                           */
155 kumpf           1.5       class PEGASUS_COMMON_LINKAGE InstanceResponseHandler : virtual public ResponseHandler
156 kumpf           1.4       {
157                           public:
158 kumpf           1.10          /** <p>The <tt>deliver</tt> function is used by providers to
159                                   deliver results to the CIM Server. For operations that require a
160                                   single element result (<tt>getInstance</tt>, for example),
161                                   <tt>deliver</tt> should be called only once to deliver the
162                                   entire result. For operations that involve
163                                   enumeration, the single-element form shown here may be
164                                   used, each iteration delivering an incremental element
165                                   of the total result. The Array form below may be used
166                                   to deliver a larger set of result elements.</p>
167                               */
168 kumpf           1.4           virtual void deliver(const CIMInstance & instance) = 0;
169                           
170 kumpf           1.10          /** <p>This form of the <tt>deliver</tt> function may be used
171                                   to return a set of elements to the CIM Server. The set is not
172                                   required to be complete, and the provider may invoke this
173                                   function multiple times, if necessary. This form should only
174                                   be used when the operation requires a result consisting
175                                   of more than one element, such as an enumeration.</p>
176                               */
177 kumpf           1.4           virtual void deliver(const Array<CIMInstance> & instances) = 0;
178                           };
179                           
180                           
181                           //
182                           // ObjectPathResponseHandler
183 kumpf           1.10      ///
184 kumpf           1.5       class PEGASUS_COMMON_LINKAGE ObjectPathResponseHandler : virtual public ResponseHandler
185 kumpf           1.4       {
186                           public:
187 kumpf           1.10          /** <p>The <tt>deliver</tt> function is used by providers to
188                                   deliver results to the CIM Server. For operations that require a
189                                   single element result (<tt>getInstance</tt>, for example),
190                                   <tt>deliver</tt> should be called only once to deliver the
191                                   entire result. For operations that involve
192                                   enumeration, the single-element form shown here may be
193                                   used, each iteration delivering an incremental element
194                                   of the total result. The Array form below may be used
195                                   to deliver a larger set of result elements.</p>
196                               */
197 kumpf           1.4           virtual void deliver(const CIMObjectPath & objectPath) = 0;
198                           
199 kumpf           1.10          /** <p>This form of the <tt>deliver</tt> function may be used
200                                   to return a set of elements to the CIM Server. The set is not
201                                   required to be complete, and the provider may invoke this
202                                   function multiple times, if necessary. This form should only
203                                   be used when the operation requires a result consisting
204                                   of more than one element, such as an enumeration.</p>
205                               */
206 kumpf           1.4           virtual void deliver(const Array<CIMObjectPath> & objectPaths) = 0;
207                           };
208                           
209                           
210 karl            1.18      /**
211                           The MethodResultResponseHandler class is a subclass to the ResponseHandler class.
212                           */
213 kumpf           1.5       class PEGASUS_COMMON_LINKAGE MethodResultResponseHandler : virtual public ResponseHandler
214 kumpf           1.4       {
215                           public:
216 karl            1.18          /**
217                           	Add documentation here.
218                           	*/
219 kumpf           1.4           virtual void deliverParamValue(const CIMParamValue & outParamValue) = 0;
220                           
221 karl            1.18          /**
222                           	Add documentation here.
223                           	*/
224 kumpf           1.4           virtual void deliverParamValue(const Array<CIMParamValue> & outParamValues) = 0;
225                           
226 karl            1.18          /**
227                           	Add documentation here.
228                           	*/
229 kumpf           1.4           virtual void deliver(const CIMValue & returnValue) = 0;
230                           };
231                           
232                           
233 karl            1.18      /**
234                           The IndicationResponseHandler class is a subclass to the ResponseHandler class.
235                           <p> NOTE: This class definition should not be considered complete until indication
236                           support has been completed in Pegasus.  Implementation of indication support may
237                           reveal a need for API changes in this class.</p>
238                           */
239 kumpf           1.5       class PEGASUS_COMMON_LINKAGE IndicationResponseHandler : virtual public ResponseHandler
240 kumpf           1.4       {
241                           public:
242 karl            1.18          /**
243                           	Add documentation here.
244                           	*/
245 kumpf           1.4           virtual void deliver(const CIMIndication & indication) = 0;
246                           
247 karl            1.18      	/**
248                           	Add documentation here.
249                           	*/
250 kumpf           1.4           virtual void deliver(const Array<CIMIndication> & indications) = 0;
251 kumpf           1.8       
252 karl            1.18      	/**
253                           	Add documentation here.
254                           	*/
255 kumpf           1.8           virtual void deliver(
256                                   const OperationContext & context,
257                                   const CIMIndication & indication) = 0;
258                           
259 karl            1.18      	/**
260                           	Add documentation here.
261                           	*/
262 kumpf           1.8           virtual void deliver(
263                                   const OperationContext & context,
264                                   const Array<CIMIndication> & indications) = 0;
265 kumpf           1.4       };
266                           
267                           
268                           //
269                           // ObjectResponseHandler
270                           //
271 kumpf           1.9       // NOTE: This class definition should not be considered complete until
272                           // association provider and/or query provider support has been completed
273                           // in Pegasus, as those are the only APIs that use this response handler
274                           // type.  Implementation of support for those provider types may reveal
275                           // a need for API changes in this class.
276 kumpf           1.10      ///
277 kumpf           1.5       class PEGASUS_COMMON_LINKAGE ObjectResponseHandler : virtual public ResponseHandler
278 kumpf           1.4       {
279                           public:
280 kumpf           1.10          /** <p>The <tt>deliver</tt> function is used by providers to
281                                   deliver results to the CIM Server. For operations that require a
282                                   single element result (<tt>getInstance</tt>, for example),
283                                   <tt>deliver</tt> should be called only once to deliver the
284                                   entire result. For operations that involve
285                                   enumeration, the single-element form shown here may be
286                                   used, each iteration delivering an incremental element
287                                   of the total result. The Array form below may be used
288                                   to deliver a larger set of result elements.</p>
289                               */
290 kumpf           1.4           virtual void deliver(const CIMObject & object) = 0;
291                           
292 kumpf           1.10          /** <p>This form of the <tt>deliver</tt> function may be used
293                                   to return a set of elements to the CIM Server. The set is not
294                                   required to be complete, and the provider may invoke this
295                                   function multiple times, if necessary. This form should only
296                                   be used when the operation requires a result consisting
297                                   of more than one element, such as an enumeration.</p>
298                               */
299 kumpf           1.4           virtual void deliver(const Array<CIMObject> & objects) = 0;
300                           };
301                           
302 mike            1.2       PEGASUS_NAMESPACE_END
303                           
304                           #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2