(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.5 and 1.32

version 1.5, 2002/09/04 21:02:41 version 1.32, 2008/12/02 09:00:52
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.  
 // //
 //==============================================================================  // 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.
 // //
 // Author: Chip Vincent (cvincent@us.ibm.com)  //////////////////////////////////////////////////////////////////////////
 //  
 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)  
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 32 
Line 34 
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
 #include <Pegasus/Common/Array.h> #include <Pegasus/Common/Array.h>
 #include <Pegasus/Provider/Linkage.h>  #include <Pegasus/Common/Linkage.h>
  
 #include <Pegasus/Common/CIMInstance.h> #include <Pegasus/Common/CIMInstance.h>
 #include <Pegasus/Common/CIMObjectPath.h> #include <Pegasus/Common/CIMObjectPath.h>
Line 41 
Line 43 
 #include <Pegasus/Common/CIMIndication.h> #include <Pegasus/Common/CIMIndication.h>
 #include <Pegasus/Common/CIMObject.h> #include <Pegasus/Common/CIMObject.h>
 #include <Pegasus/Common/CIMClass.h> #include <Pegasus/Common/CIMClass.h>
   #include <Pegasus/Common/OperationContext.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 /** /**
 Callback to deliver results to the CIMOM.      The ResponseHandler class allows a provider to report operation
       progress and results to the CIM Server.  Subclasses are defined
 <p>The <tt>ResponseHandler</tt> class allows a provider      for each type of result data.
 to report operation progress and results to the CIMOM.  
 Subclasses are defined for each of the types of object  
 that a provider can deliver to the CIMOM.  
 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 CIMOM:</p>  
 <ul>  
 <li><tt>{@link processing processing}</tt> - inform the CIMOM  
 that delivery of results is beginning</li>  
 <li><tt>{@link deliver deliver}</tt> - deliver an incremental  
 result to the CIMOM; the CIMOM accumulates results as  
 they are received from the provider</li>  
 <li><tt>{@link complete complete}</tt> - inform the CIMOM 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
       // the appropriate data type.
       //virtual void deliver(const T & object);
   
       // This method is defined in subclasses, specialized for
       // the appropriate data type.
       //virtual void deliver(const Array<T> & objects);
  
     /**     /**
     Deliver a possibly partial result to CIMOM.          Informs the CIM Server that delivery of results will begin.
     <p>The <tt>deliver</tt> function is used by providers to          This method must be called before deliver() is called.
     deliver results to the CIMOM. For operations that require a  
     single element result (<tt>getInstance</tt>, for example),  
     <tt>deliver</tt> should be called only once to deliver the  
     entire result. For operations that involve  
     enumeration, the single-element form shown here may be  
     used, each iteration delivering an incremental element  
     of the total result. The Array form below may be used  
     to deliver a larger set of result elements.</p>  
     */     */
     //virtual void deliver(const T & object);      virtual void processing() = 0;
  
     /**     /**
     Deliver a set of results to CIMOM.          Informs the CIM Server that delivery of results is complete.
     <p>This form of the <tt>deliver</tt> function may be used          This method must be called when all the results have been delivered.
     to return a set of elements to the CIMOM. The set is not          The deliver() method must not be called after this method is called.
     required to be complete, and the provider may invoke this  
     function multiple times, if necessary. This form should only  
     be used when the operation requires a result consisting  
     of more than one element, such as an enumeration.</p>  
     */     */
     //virtual void deliver(const Array<T> & objects);      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.
       */
       ResponseHandler(const ResponseHandler& handler);
  
     /**     /**
     Inform the CIMOM that delivery of results will begin.          The assignment operator is not available for the ResponseHandler class.
     <p>The provider must call <tt>processing</tt> before  
     attempting to call <tt>deliver</tt>.  
     */     */
     virtual void processing(void) = 0;      ResponseHandler& operator=(const ResponseHandler& handler);
  
     /**     /**
     Inform the CIMOM that delivery of results is complete.          Gets the context for the results delivered to the CIM Server.
     <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;      OperationContext getContext() const;
 }; };
  
  
 //  /**
 // 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:
       /**
           Delivers an instance result 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 instance The 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 CIMInstance & instance) = 0;     virtual void deliver(const CIMInstance & instance) = 0;
  
       /**
           Delivers multiple instance results to the CIM Server.  This method
           may be invoked multiple times, if necessary.
           @param instances The 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<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:
       /**
           Delivers an object path result 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 objectPath The object path 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 CIMObjectPath & objectPath) = 0;     virtual void deliver(const CIMObjectPath & objectPath) = 0;
  
       /**
           Delivers multiple object path results to the CIM Server.  This method
           may be invoked multiple times, if necessary.
           @param objectPaths The object paths 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<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.
 class PEGASUS_COMMON_LINKAGE IndicationResponseHandler : 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(
           const OperationContext & context,
           const CIMIndication & indication) = 0;
  
 //      /**
 // ObjectResponseHandler          Delivers multiple indications to the CIM Server with a specified
 //          context.  The context may include data to be associated with the
 class PEGASUS_COMMON_LINKAGE ObjectResponseHandler : virtual public ResponseHandler          indications, such as the content language.
 {          @param context A context associated with the indication delivery.
 public:          @param indications An Array of indication instances to deliver to the
     virtual void deliver(const CIMObject & object) = 0;          CIM Server.
           @exception Exception May be thrown if the data that is delivered is
     virtual void deliver(const Array<CIMObject> & objects) = 0;          not consistent with the corresponding request or associated schema.
 };      */
       virtual void deliver(
           const OperationContext & context,
 //          const Array<CIMIndication> & indications) = 0;
 // 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;  
 }; };
  
  
 //  /**
 // ClassResponseHandler      The ObjectResponseHandler class is a subclass of the ResponseHandler
 //      class which allows delivery of object results.
 class PEGASUS_COMMON_LINKAGE ClassResponseHandler : virtual public ResponseHandler  */
   class PEGASUS_COMMON_LINKAGE ObjectResponseHandler
       : virtual public ResponseHandler
 { {
 public: public:
     virtual void deliver(const CIMClass & classObj) = 0;      /**
           Delivers an object result 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 object The object 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 CIMObject & object) = 0;
  
     virtual void deliver(const Array<CIMClass> & classObjs) = 0;      /**
           Delivers multiple object results to the CIM Server.  This method
           may be invoked multiple times, if necessary.
           @param objects The objects 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<CIMObject> & objects) = 0;
 }; };
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.5  
changed lines
  Added in v.1.32

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2