(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 chuck 1.11 
 46 mike  1.2  
 47 chuck 1.12 PEGASUS_NAMESPACE_BEGIN
 48 kumpf 1.10 
 49 chuck 1.12 class ResponseHandlerRep;
 50 mike  1.2  
 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                Destructor.
 81                */
 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 kumpf 1.10     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 kumpf 1.10     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                results have been delivered. It must not call <tt>deliver</tt>
103                after calling <tt>complete</tt>.</p>
104                */
105                virtual void complete(void) = 0;
106 chuck 1.12 
107                /**
108                Set the context for the results delivered to the CIM Server.
109                <p>The <tt>setContext</tt> function is used by providers to
110                set a context for the response, in the form of an OperationContext
111                object.  The context of the response contains the settings that
112                apply to all the results delivered to the CIM Server.  An example
113                context is the language of the response, in the form of a 
114                ContentLanguageListContainer in the OperationContext.</p>
115                <p>This method may be called at any point in the response
116                processing before <tt>complete</tt> is called.</p>
117                <p>Currently supported OperationContext containers:
118                <li>
119                ContentLanguageListContainer: used to set the ContentLanguages of the
120                results.
121                </li>
122                </p>
123                <p>Implementation Note:  This method is concrete to preserve 
124                binary compatibility with previous releases of the CIMServer</p> 
125                */
126                void setContext(const OperationContext & context);
127 chuck 1.12 
128            protected:
129                
130                ResponseHandler();
131            
132                //
133                // Gets the context for the results delivered to the CIM Server.
134                //
135                OperationContext getContext(void) const;
136            
137                ResponseHandlerRep* _rep;
138 kumpf 1.4  };
139            
140            
141            //
142            // InstanceResponseHandler
143 kumpf 1.10 ///
144 kumpf 1.5  class PEGASUS_COMMON_LINKAGE InstanceResponseHandler : virtual public ResponseHandler
145 kumpf 1.4  {
146            public:
147 kumpf 1.10     /** <p>The <tt>deliver</tt> function is used by providers to
148                    deliver results to the CIM Server. For operations that require a
149                    single element result (<tt>getInstance</tt>, for example),
150                    <tt>deliver</tt> should be called only once to deliver the
151                    entire result. For operations that involve
152                    enumeration, the single-element form shown here may be
153                    used, each iteration delivering an incremental element
154                    of the total result. The Array form below may be used
155                    to deliver a larger set of result elements.</p>
156                */
157 kumpf 1.4      virtual void deliver(const CIMInstance & instance) = 0;
158            
159 kumpf 1.10     /** <p>This form of the <tt>deliver</tt> function may be used
160                    to return a set of elements to the CIM Server. The set is not
161                    required to be complete, and the provider may invoke this
162                    function multiple times, if necessary. This form should only
163                    be used when the operation requires a result consisting
164                    of more than one element, such as an enumeration.</p>
165                */
166 kumpf 1.4      virtual void deliver(const Array<CIMInstance> & instances) = 0;
167            };
168            
169            
170            //
171            // ObjectPathResponseHandler
172 kumpf 1.10 ///
173 kumpf 1.5  class PEGASUS_COMMON_LINKAGE ObjectPathResponseHandler : virtual public ResponseHandler
174 kumpf 1.4  {
175            public:
176 kumpf 1.10     /** <p>The <tt>deliver</tt> function is used by providers to
177                    deliver results to the CIM Server. For operations that require a
178                    single element result (<tt>getInstance</tt>, for example),
179                    <tt>deliver</tt> should be called only once to deliver the
180                    entire result. For operations that involve
181                    enumeration, the single-element form shown here may be
182                    used, each iteration delivering an incremental element
183                    of the total result. The Array form below may be used
184                    to deliver a larger set of result elements.</p>
185                */
186 kumpf 1.4      virtual void deliver(const CIMObjectPath & objectPath) = 0;
187            
188 kumpf 1.10     /** <p>This form of the <tt>deliver</tt> function may be used
189                    to return a set of elements to the CIM Server. The set is not
190                    required to be complete, and the provider may invoke this
191                    function multiple times, if necessary. This form should only
192                    be used when the operation requires a result consisting
193                    of more than one element, such as an enumeration.</p>
194                */
195 kumpf 1.4      virtual void deliver(const Array<CIMObjectPath> & objectPaths) = 0;
196            };
197            
198            
199            //
200            // MethodResultResponseHandler
201 kumpf 1.10 ///
202 kumpf 1.5  class PEGASUS_COMMON_LINKAGE MethodResultResponseHandler : virtual public ResponseHandler
203 kumpf 1.4  {
204            public:
205 kumpf 1.10     ///
206 kumpf 1.4      virtual void deliverParamValue(const CIMParamValue & outParamValue) = 0;
207            
208 kumpf 1.10     ///
209 kumpf 1.4      virtual void deliverParamValue(const Array<CIMParamValue> & outParamValues) = 0;
210            
211 kumpf 1.10     ///
212 kumpf 1.4      virtual void deliver(const CIMValue & returnValue) = 0;
213            };
214            
215            
216            //
217            // IndicationResponseHandler
218            //
219 kumpf 1.8  // NOTE: This class definition should not be considered complete until
220            // indication support has been completed in Pegasus.  Implementation of
221            // indication support may reveal a need for API changes in this class.
222 kumpf 1.5  class PEGASUS_COMMON_LINKAGE IndicationResponseHandler : virtual public ResponseHandler
223 kumpf 1.4  {
224            public:
225                virtual void deliver(const CIMIndication & indication) = 0;
226            
227                virtual void deliver(const Array<CIMIndication> & indications) = 0;
228 kumpf 1.8  
229                virtual void deliver(
230                    const OperationContext & context,
231                    const CIMIndication & indication) = 0;
232            
233                virtual void deliver(
234                    const OperationContext & context,
235                    const Array<CIMIndication> & indications) = 0;
236 kumpf 1.4  };
237            
238            
239            //
240            // ObjectResponseHandler
241            //
242 kumpf 1.9  // NOTE: This class definition should not be considered complete until
243            // association provider and/or query provider support has been completed
244            // in Pegasus, as those are the only APIs that use this response handler
245            // type.  Implementation of support for those provider types may reveal
246            // a need for API changes in this class.
247 kumpf 1.10 ///
248 kumpf 1.5  class PEGASUS_COMMON_LINKAGE ObjectResponseHandler : virtual public ResponseHandler
249 kumpf 1.4  {
250            public:
251 kumpf 1.10     /** <p>The <tt>deliver</tt> function is used by providers to
252                    deliver results to the CIM Server. For operations that require a
253                    single element result (<tt>getInstance</tt>, for example),
254                    <tt>deliver</tt> should be called only once to deliver the
255                    entire result. For operations that involve
256                    enumeration, the single-element form shown here may be
257                    used, each iteration delivering an incremental element
258                    of the total result. The Array form below may be used
259                    to deliver a larger set of result elements.</p>
260                */
261 kumpf 1.4      virtual void deliver(const CIMObject & object) = 0;
262            
263 kumpf 1.10     /** <p>This form of the <tt>deliver</tt> function may be used
264                    to return a set of elements to the CIM Server. The set is not
265                    required to be complete, and the provider may invoke this
266                    function multiple times, if necessary. This form should only
267                    be used when the operation requires a result consisting
268                    of more than one element, such as an enumeration.</p>
269                */
270 kumpf 1.4      virtual void deliver(const Array<CIMObject> & objects) = 0;
271            };
272            
273            
274 kumpf 1.7  #ifdef PEGASUS_INTERNALONLY
275            // This type is used in CIMPropertyProvider which Pegasus does not support
276 kumpf 1.4  //
277            // ValueResponseHandler
278            //
279 kumpf 1.5  class PEGASUS_COMMON_LINKAGE ValueResponseHandler : virtual public ResponseHandler
280 kumpf 1.4  {
281            public:
282                virtual void deliver(const CIMValue & value) = 0;
283            
284                virtual void deliver(const Array<CIMValue> & values) = 0;
285            };
286 kumpf 1.7  #endif
287 kumpf 1.4  
288            
289 kumpf 1.7  #ifdef PEGASUS_INTERNALONLY
290            // This type is used in CIMClassProvider which Pegasus does not support
291 kumpf 1.4  //
292            // ClassResponseHandler
293            //
294 kumpf 1.5  class PEGASUS_COMMON_LINKAGE ClassResponseHandler : virtual public ResponseHandler
295 mike  1.2  {
296            public:
297 kumpf 1.4      virtual void deliver(const CIMClass & classObj) = 0;
298 mike  1.2  
299 kumpf 1.4      virtual void deliver(const Array<CIMClass> & classObjs) = 0;
300 mike  1.2  };
301 kumpf 1.7  #endif
302 mike  1.2  
303            PEGASUS_NAMESPACE_END
304            
305            #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2