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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2