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

Diff for /pegasus/src/Pegasus/Common/ResponseHandler.h between version 1.10 and 1.32.4.4

version 1.10, 2003/03/12 21:02:53 version 1.32.4.4, 2009/12/04 14:09:02
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%LICENSE////////////////////////////////////////////////////////////////
 //  
 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,  
 // The Open Group, Tivoli Systems  
 //  
 // Permission is hereby granted, free of charge, to any person obtaining a copy  
 // of this software and associated documentation files (the "Software"), to  
 // deal in the Software without restriction, including without limitation the  
 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or  
 // sell copies of the Software, and to permit persons to whom the Software is  
 // furnished to do so, subject to the following conditions:  
 //  
 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN  
 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED  
 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT  
 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR  
 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT  
 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN  
 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION  
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  
 //  
 //==============================================================================  
 // //
 // Author: Chip Vincent (cvincent@us.ibm.com)  // Licensed to The Open Group (TOG) under one or more contributor license
   // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
   // this work for additional information regarding copyright ownership.
   // Each contributor licenses this file to you under the OpenPegasus Open
   // Source License; you may not use this file except in compliance with the
   // License.
   //
   // Permission is hereby granted, free of charge, to any person obtaining a
   // copy of this software and associated documentation files (the "Software"),
   // to deal in the Software without restriction, including without limitation
   // the rights to use, copy, modify, merge, publish, distribute, sublicense,
   // and/or sell copies of the Software, and to permit persons to whom the
   // Software is furnished to do so, subject to the following conditions:
   //
   // The above copyright notice and this permission notice shall be included
   // in all copies or substantial portions of the Software.
   //
   // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
   // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
   // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
   // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // //
 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)  //////////////////////////////////////////////////////////////////////////
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 43 
Line 45 
 #include <Pegasus/Common/CIMClass.h> #include <Pegasus/Common/CIMClass.h>
 #include <Pegasus/Common/OperationContext.h> #include <Pegasus/Common/OperationContext.h>
  
   
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 /** /**
 <p>The <tt>ResponseHandler</tt> class allows a provider      The ResponseHandler class allows a provider to report operation
 to report operation progress and results to the CIM Server.      progress and results to the CIM Server.  Subclasses are defined
 Subclasses are defined for each of the types of object      for each type of result data.
 that a provider can deliver to the CIM Server.  
 A <tt>ResponseHandler</tt> object of the appropriate type  
 is passed to provider  
 functions that are invoked to process client requests (it  
 is not passed to the <tt>{@link initialize initialize}</tt>  
 or <tt>{@link terminate terminate}</tt> functions). It  
 contains the following public member functions that  
 may be used to deliver results to the CIM Server:</p>  
 <ul>  
 <li><tt>{@link processing processing}</tt> - inform the CIM Server  
 that delivery of results is beginning.</li>  
 <li><tt>{@link deliver deliver}</tt> - deliver an incremental  
 result to the CIM Server; the CIM Server accumulates results as  
 they are received from the provider.</li>  
 <li><tt>{@link complete complete}</tt> - inform the CIM Server that  
 process of the request is complete and that no further  
 results will be delivered.</li>  
 </ul>  
 */ */
   
 class PEGASUS_COMMON_LINKAGE ResponseHandler class PEGASUS_COMMON_LINKAGE ResponseHandler
 { {
 public: public:
  
     /**     /**
     Destructor.          Destructs the ResponseHandler.
     */     */
     virtual ~ResponseHandler(void);      virtual ~ResponseHandler();
  
     // This method is defined in subclasses, specialized for     // This method is defined in subclasses, specialized for
     // the appropriate data type.     // the appropriate data type.
Line 88 
Line 70 
     //virtual void deliver(const Array<T> & objects);     //virtual void deliver(const Array<T> & objects);
  
     /**     /**
     Inform the CIM Server that delivery of results will begin.          Informs the CIM Server that delivery of results will begin.
     <p>The provider must call <tt>processing</tt> before          This method must be called before deliver() is called.
     attempting to call <tt>deliver</tt>.      */
       virtual void processing() = 0;
   
       /**
           Informs the CIM Server that delivery of results is complete.
           This method must be called when all the results have been delivered.
           The deliver() method must not be called after this method is called.
       */
       virtual void complete() = 0;
   
       /**
           Sets the context for operation responses delivered to the CIM Server.
           This method allows a provider to communicate context information
           (such as content language) along with an operation response.  The
           context information applies to all the operation response data
           delivered to this ResponseHandler object.  The context information
           is applied at the time the complete() method is called.
       */
       void setContext(const OperationContext & context);
   
   protected:
   
       /**
           The default constructor is not available for the ResponseHandler class.
       */
       ResponseHandler();
   
       /**
           The copy constructor is not available for the ResponseHandler class.
     */     */
     virtual void processing(void) = 0;      ResponseHandler(const ResponseHandler& handler);
  
     /**     /**
     Inform the CIM Server that delivery of results is complete.          The assignment operator is not available for the ResponseHandler class.
     <p>The provider must call <tt>complete</tt> when all  
     results have been delivered. It must not call <tt>deliver</tt>  
     after calling <tt>complete</tt>.</p>  
     */     */
     virtual void complete(void) = 0;      ResponseHandler& operator=(const ResponseHandler& handler);
   
       /**
           Gets the context for the results delivered to the CIM Server.
       */
       OperationContext getContext() const;
 }; };
  
   class SCMOInstance;
  
 //  /**
 // InstanceResponseHandler      The InstanceResponseHandler class is a subclass of the ResponseHandler
 ///      class which allows delivery of instance results.
 class PEGASUS_COMMON_LINKAGE InstanceResponseHandler : virtual public ResponseHandler  */
   class PEGASUS_COMMON_LINKAGE InstanceResponseHandler
       : virtual public ResponseHandler
 { {
 public: public:
     /** <p>The <tt>deliver</tt> function is used by providers to      /**
         deliver results to the CIM Server. For operations that require a          Delivers an instance result to the CIM Server.  This method may
         single element result (<tt>getInstance</tt>, for example),          be called multiple times when more than one result needs to be
         <tt>deliver</tt> should be called only once to deliver the          delivered.  An Array form of this method is also available to
         entire result. For operations that involve          deliver multiple results.
         enumeration, the single-element form shown here may be          @param instance The instance to deliver to the CIM Server.
         used, each iteration delivering an incremental element          @exception Exception May be thrown if the data that is delivered is
         of the total result. The Array form below may be used          not consistent with the corresponding request or associated schema.
         to deliver a larger set of result elements.</p>  
     */     */
     virtual void deliver(const CIMInstance & instance) = 0;     virtual void deliver(const CIMInstance & instance) = 0;
       virtual void deliver(const SCMOInstance & instance) = 0;
  
     /** <p>This form of the <tt>deliver</tt> function may be used      /**
         to return a set of elements to the CIM Server. The set is not          Delivers multiple instance results to the CIM Server.  This method
         required to be complete, and the provider may invoke this          may be invoked multiple times, if necessary.
         function multiple times, if necessary. This form should only          @param instances The instances to deliver to the CIM Server.
         be used when the operation requires a result consisting          @exception Exception May be thrown if the data that is delivered is
         of more than one element, such as an enumeration.</p>          not consistent with the corresponding request or associated schema.
     */     */
     virtual void deliver(const Array<CIMInstance> & instances) = 0;     virtual void deliver(const Array<CIMInstance> & instances) = 0;
 }; };
  
  
 //  /**
 // ObjectPathResponseHandler      The ObjectPathResponseHandler class is a subclass of the ResponseHandler
 ///      class which allows delivery of object path results.
 class PEGASUS_COMMON_LINKAGE ObjectPathResponseHandler : virtual public ResponseHandler  */
   class PEGASUS_COMMON_LINKAGE ObjectPathResponseHandler
       : virtual public ResponseHandler
 { {
 public: public:
     /** <p>The <tt>deliver</tt> function is used by providers to      /**
         deliver results to the CIM Server. For operations that require a          Delivers an object path result to the CIM Server.  This method may
         single element result (<tt>getInstance</tt>, for example),          be called multiple times when more than one result needs to be
         <tt>deliver</tt> should be called only once to deliver the          delivered.  An Array form of this method is also available to
         entire result. For operations that involve          deliver multiple results.
         enumeration, the single-element form shown here may be          @param objectPath The object path to deliver to the CIM Server.
         used, each iteration delivering an incremental element          @exception Exception May be thrown if the data that is delivered is
         of the total result. The Array form below may be used          not consistent with the corresponding request or associated schema.
         to deliver a larger set of result elements.</p>  
     */     */
     virtual void deliver(const CIMObjectPath & objectPath) = 0;     virtual void deliver(const CIMObjectPath & objectPath) = 0;
       virtual void deliver(const SCMOInstance & instance) = 0;
  
     /** <p>This form of the <tt>deliver</tt> function may be used      /**
         to return a set of elements to the CIM Server. The set is not          Delivers multiple object path results to the CIM Server.  This method
         required to be complete, and the provider may invoke this          may be invoked multiple times, if necessary.
         function multiple times, if necessary. This form should only          @param objectPaths The object paths to deliver to the CIM Server.
         be used when the operation requires a result consisting          @exception Exception May be thrown if the data that is delivered is
         of more than one element, such as an enumeration.</p>          not consistent with the corresponding request or associated schema.
     */     */
     virtual void deliver(const Array<CIMObjectPath> & objectPaths) = 0;     virtual void deliver(const Array<CIMObjectPath> & objectPaths) = 0;
 }; };
  
  
 //  /**
 // MethodResultResponseHandler      The MethodResultResponseHandler class is a subclass of the ResponseHandler
 ///      class which allows delivery of extrinsic method results.
 class PEGASUS_COMMON_LINKAGE MethodResultResponseHandler : virtual public ResponseHandler  */
   class PEGASUS_COMMON_LINKAGE MethodResultResponseHandler
       : virtual public ResponseHandler
 { {
 public: public:
     ///      /**
           Delivers extrinsic method output parameters to the CIM Server.
           This method may be called multiple times when more than one result
           needs to be delivered.  An Array form of this method is also
           available to deliver multiple results.
           @param outParamValue The output parameter to deliver to the CIM Server.
           @exception Exception May be thrown if the data that is delivered is
           not consistent with the corresponding request or associated schema.
       */
     virtual void deliverParamValue(const CIMParamValue & outParamValue) = 0;     virtual void deliverParamValue(const CIMParamValue & outParamValue) = 0;
  
     ///      /**
     virtual void deliverParamValue(const Array<CIMParamValue> & outParamValues) = 0;          Delivers a set of output parameters to the CIM Server.  This method
           may be invoked multiple times, if necessary.
           @param outParamValues An Array of method output parameters to deliver
           to the CIM Server.
           @exception Exception May be thrown if the data that is delivered is
           not consistent with the corresponding request or associated schema.
       */
       virtual void deliverParamValue(
           const Array<CIMParamValue> & outParamValues) = 0;
  
     ///      /**
           Delivers an extrinsic method return value to the CIM Server.
           @param returnValue The return value to deliver to the CIM Server.
           @exception Exception May be thrown if the data that is delivered is
           not consistent with the corresponding request or associated schema.
       */
     virtual void deliver(const CIMValue & returnValue) = 0;     virtual void deliver(const CIMValue & returnValue) = 0;
 }; };
  
  
 //  /**
 // IndicationResponseHandler      The IndicationResponseHandler class is a subclass of the ResponseHandler
 //      class which allows delivery of generated indications.
 // NOTE: This class definition should not be considered complete until  */
 // indication support has been completed in Pegasus.  Implementation of  class PEGASUS_COMMON_LINKAGE IndicationResponseHandler
 // indication support may reveal a need for API changes in this class.      : virtual public ResponseHandler
 class PEGASUS_COMMON_LINKAGE IndicationResponseHandler : virtual public ResponseHandler  
 { {
 public: public:
       /**
           Delivers an indication to the CIM Server.  An Array form of this
           method is available to deliver multiple indications at once.
           Another form is also available to specify the context for the
           delivery.
           @param indication The indication instance to deliver to the CIM Server.
           @exception Exception May be thrown if the data that is delivered is
           not consistent with the corresponding request or associated schema.
       */
     virtual void deliver(const CIMIndication & indication) = 0;     virtual void deliver(const CIMIndication & indication) = 0;
  
       /**
           Delivers multiple indications to the CIM Server.  Another form of
           this method is available to specify the context for the delivery.
           @param indications An Array of indication instances to deliver to the
           CIM Server.
           @exception Exception May be thrown if the data that is delivered is
           not consistent with the corresponding request or associated schema.
       */
     virtual void deliver(const Array<CIMIndication> & indications) = 0;     virtual void deliver(const Array<CIMIndication> & indications) = 0;
  
       /**
           Delivers an indication to the CIM Server with a specified context.
           An Array form of this method is available to deliver multiple
           indications at once.  The context may include data to be associated
           with the indication, such as the content language.
           @param context A context associated with the indication delivery.
           @param indication The indication instance to deliver to the CIM Server.
           @exception Exception May be thrown if the data that is delivered is
           not consistent with the corresponding request or associated schema.
       */
     virtual void deliver(     virtual void deliver(
         const OperationContext & context,         const OperationContext & context,
         const CIMIndication & indication) = 0;         const CIMIndication & indication) = 0;
  
       /**
           Delivers multiple indications to the CIM Server with a specified
           context.  The context may include data to be associated with the
           indications, such as the content language.
           @param context A context associated with the indication delivery.
           @param indications An Array of indication instances to deliver to the
           CIM Server.
           @exception Exception May be thrown if the data that is delivered is
           not consistent with the corresponding request or associated schema.
       */
     virtual void deliver(     virtual void deliver(
         const OperationContext & context,         const OperationContext & context,
         const Array<CIMIndication> & indications) = 0;         const Array<CIMIndication> & indications) = 0;
 }; };
  
  
 //  /**
 // ObjectResponseHandler      The ObjectResponseHandler class is a subclass of the ResponseHandler
 //      class which allows delivery of object results.
 // NOTE: This class definition should not be considered complete until  */
 // association provider and/or query provider support has been completed  class PEGASUS_COMMON_LINKAGE ObjectResponseHandler
 // in Pegasus, as those are the only APIs that use this response handler      : virtual public ResponseHandler
 // type.  Implementation of support for those provider types may reveal  
 // a need for API changes in this class.  
 ///  
 class PEGASUS_COMMON_LINKAGE ObjectResponseHandler : virtual public ResponseHandler  
 { {
 public: public:
     /** <p>The <tt>deliver</tt> function is used by providers to      /**
         deliver results to the CIM Server. For operations that require a          Delivers an object result to the CIM Server.  This method may
         single element result (<tt>getInstance</tt>, for example),          be called multiple times when more than one result needs to be
         <tt>deliver</tt> should be called only once to deliver the          delivered.  An Array form of this method is also available to
         entire result. For operations that involve          deliver multiple results.
         enumeration, the single-element form shown here may be          @param object The object to deliver to the CIM Server.
         used, each iteration delivering an incremental element          @exception Exception May be thrown if the data that is delivered is
         of the total result. The Array form below may be used          not consistent with the corresponding request or associated schema.
         to deliver a larger set of result elements.</p>  
     */     */
     virtual void deliver(const CIMObject & object) = 0;     virtual void deliver(const CIMObject & object) = 0;
       virtual void deliver(const CIMInstance & instance) = 0;
       virtual void deliver(const SCMOInstance & instance) = 0;
  
     /** <p>This form of the <tt>deliver</tt> function may be used      /**
         to return a set of elements to the CIM Server. The set is not          Delivers multiple object results to the CIM Server.  This method
         required to be complete, and the provider may invoke this          may be invoked multiple times, if necessary.
         function multiple times, if necessary. This form should only          @param objects The objects to deliver to the CIM Server.
         be used when the operation requires a result consisting          @exception Exception May be thrown if the data that is delivered is
         of more than one element, such as an enumeration.</p>          not consistent with the corresponding request or associated schema.
     */     */
     virtual void deliver(const Array<CIMObject> & objects) = 0;     virtual void deliver(const Array<CIMObject> & objects) = 0;
 }; };
  
   
 #ifdef PEGASUS_INTERNALONLY  
 // This type is used in CIMPropertyProvider which Pegasus does not support  
 //  
 // ValueResponseHandler  
 //  
 class PEGASUS_COMMON_LINKAGE ValueResponseHandler : virtual public ResponseHandler  
 {  
 public:  
     virtual void deliver(const CIMValue & value) = 0;  
   
     virtual void deliver(const Array<CIMValue> & values) = 0;  
 };  
 #endif  
   
   
 #ifdef PEGASUS_INTERNALONLY  
 // This type is used in CIMClassProvider which Pegasus does not support  
 //  
 // ClassResponseHandler  
 //  
 class PEGASUS_COMMON_LINKAGE ClassResponseHandler : virtual public ResponseHandler  
 {  
 public:  
     virtual void deliver(const CIMClass & classObj) = 0;  
   
     virtual void deliver(const Array<CIMClass> & classObjs) = 0;  
 };  
 #endif  
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  
 #endif #endif


Legend:
Removed from v.1.10  
changed lines
  Added in v.1.32.4.4

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2