//%2003////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Development
// Company, L. P., IBM Corp., The Open Group, Tivoli Systems.
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
// IBM Corp.; EMC Corporation, The Open Group.
//
// 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.
//
//==============================================================================
//
//%/////////////////////////////////////////////////////////////////////////////
#ifndef Pegasus_ResponseHandler_h
#define Pegasus_ResponseHandler_h
#include The ResponseHandler class allows a provider
to report operation progress and results to the CIM Server.
Subclasses are defined for each of the types of object
that a provider can deliver to the CIM Server.
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 CIM Server: The provider must call processing before
attempting to call deliver.
*/
virtual void processing(void) = 0;
/**
Inform the CIM server that delivery of results is complete.
The provider must call complete when all
results have been delivered. The provider must not call deliver
after calling complete. The setContext function is used by providers to
set a context for the response, in the form of an OperationContext
object. The context of the response contains the settings that
apply to all the results delivered to the CIM Server. An example
context is the language of the response, in the form of a
ContentLanguageListContainer in the OperationContext. This method may be called at any point in the response
processing before complete is called. Currently supported OperationContext containers:
*/
class PEGASUS_COMMON_LINKAGE ResponseHandler
{
public:
/**
ResponseHandler destructor.
*/
virtual ~ResponseHandler(void);
// 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
Set the context for the results delivered to the CIM Server.
Implementation Note: This method is concrete to preserve binary compatibility with previous releases of the CIMServer
*/ #ifdef PEGASUS_OS_OS400 virtual #endif void setContext(const OperationContext & context); #endif // PEGASUS_USE_EXPERIMENTAL_INTERFACES protected: ResponseHandler(); ResponseHandler(const ResponseHandler& handler); ResponseHandler& operator=(const ResponseHandler& handler); /** Gets the context for the results delivered to the CIM server. */ OperationContext getContext(void) const; }; /** The InstanceResponseHandler class is a subclass to the ResponseHandler class. The InstanceResponseHandler class contains functions that are specific to an instance of the ResponseHandler class. */ class PEGASUS_COMMON_LINKAGE InstanceResponseHandler : virtual public ResponseHandler { public: /**The deliver function is used by providers to deliver results to the CIM Server. 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 CIMInstance & instance) = 0; /**This form of the deliver function may be used to return a set of elements to the CIM Server. 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 ArrayThe deliver function is used by providers to deliver results to the CIM Server. 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 CIMObjectPath & objectPath) = 0; /**This form of the deliver function may be used to return a set of elements to the CIM Server. 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 ArrayNOTE: 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: /** Add documentation here. */ virtual void deliver(const CIMIndication & indication) = 0; /** Add documentation here. */ virtual void deliver(const ArrayThe deliver function is used by providers to deliver results to the CIM Server. 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 CIMObject & object) = 0; /**This form of the deliver function may be used to return a set of elements to the CIM Server. 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