//%///////////////////////////////////////////////////////////////////////////// // // 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) // // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) // //%///////////////////////////////////////////////////////////////////////////// #ifndef Pegasus_ResponseHandler_h #define Pegasus_ResponseHandler_h #include #include #include #include #include #include #include #include #include #include #include PEGASUS_NAMESPACE_BEGIN /** Callback to deliver results to the CIMOM.

The ResponseHandler class allows a provider 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 ResponseHandler object of the appropriate type is passed to provider functions that are invoked to process client requests (it is not passed to the {@link initialize initialize} or {@link terminate terminate} functions). It contains the following public member functions that may be used to deliver results to the CIMOM:

  • {@link processing processing} - inform the CIMOM that delivery of results is beginning
  • {@link deliver deliver} - deliver an incremental result to the CIMOM; the CIMOM accumulates results as they are received from the provider
  • {@link complete complete} - inform the CIMOM that process of the request is complete and that no further results will be delivered
*/ class PEGASUS_COMMON_LINKAGE ResponseHandler { public: /** Destructor. */ virtual ~ResponseHandler(void); /** Deliver a possibly partial result to CIMOM.

The deliver function is used by providers to deliver results to the CIMOM. For operations that require a single element result (getInstance, for example), deliver 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.

*/ //virtual void deliver(const T & object); /** Deliver a set of results to CIMOM.

This form of the deliver function may be used to return a set of elements to the CIMOM. The set is not 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.

*/ //virtual void deliver(const Array & objects); /** Inform the CIMOM that delivery of results will begin.

The provider must call processing before attempting to call deliver. */ virtual void processing(void) = 0; /** Inform the CIMOM that delivery of results is complete.

The provider must call complete when all results have been delivered. It must not call deliver after calling complete.

*/ virtual void complete(void) = 0; }; // // InstanceResponseHandler // class PEGASUS_COMMON_LINKAGE InstanceResponseHandler : virtual public ResponseHandler { public: virtual void deliver(const CIMInstance & instance) = 0; virtual void deliver(const Array & instances) = 0; }; // // ObjectPathResponseHandler // class PEGASUS_COMMON_LINKAGE ObjectPathResponseHandler : virtual public ResponseHandler { public: virtual void deliver(const CIMObjectPath & objectPath) = 0; virtual void deliver(const Array & objectPaths) = 0; }; // // MethodResultResponseHandler // class PEGASUS_COMMON_LINKAGE MethodResultResponseHandler : virtual public ResponseHandler { public: virtual void deliverParamValue(const CIMParamValue & outParamValue) = 0; virtual void deliverParamValue(const Array & outParamValues) = 0; virtual void deliver(const CIMValue & returnValue) = 0; }; // // IndicationResponseHandler // // NOTE: This class definition should not be considered complete until // indication support has been completed in Pegasus. Implementation of // indication support may reveal a need for API changes in this class. class PEGASUS_COMMON_LINKAGE IndicationResponseHandler : virtual public ResponseHandler { public: virtual void deliver(const CIMIndication & indication) = 0; virtual void deliver(const Array & indications) = 0; virtual void deliver( const OperationContext & context, const CIMIndication & indication) = 0; virtual void deliver( const OperationContext & context, const Array & indications) = 0; }; // // ObjectResponseHandler // // NOTE: This class definition should not be considered complete until // association provider and/or query provider support has been completed // in Pegasus, as those are the only APIs that use this response handler // 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: virtual void deliver(const CIMObject & object) = 0; virtual void deliver(const Array & 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 & 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 & classObjs) = 0; }; #endif PEGASUS_NAMESPACE_END #endif