version 1.23.18.1, 2006/02/10 16:09:38
|
version 1.32, 2008/12/02 09:00:52
|
|
|
//%2006//////////////////////////////////////////////////////////////////////// |
//%LICENSE//////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Licensed to The Open Group (TOG) under one or more contributor license |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
// agreements. Refer to the OpenPegasusNOTICE.txt file distributed with |
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
// this work for additional information regarding copyright ownership. |
// IBM Corp.; EMC Corporation, The Open Group. |
// Each contributor licenses this file to you under the OpenPegasus Open |
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
// Source License; you may not use this file except in compliance with the |
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// License. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
|
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy |
// Permission is hereby granted, free of charge, to any person obtaining a |
// of this software and associated documentation files (the "Software"), to |
// copy of this software and associated documentation files (the "Software"), |
// deal in the Software without restriction, including without limitation the |
// to deal in the Software without restriction, including without limitation |
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
// the rights to use, copy, modify, merge, publish, distribute, sublicense, |
// sell copies of the Software, and to permit persons to whom the Software is |
// and/or sell copies of the Software, and to permit persons to whom the |
// furnished to do so, subject to the following conditions: |
// Software is furnished to do so, subject to the following conditions: |
// | // |
// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN |
// The above copyright notice and this permission notice shall be included |
// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED |
// in all copies or substantial portions of the Software. |
// "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. |
|
// | // |
//============================================================================== |
// 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. |
|
// |
|
////////////////////////////////////////////////////////////////////////// |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
#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: |
| |
/** | /** |
ResponseHandler 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. |
|
|
//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; |
virtual void processing(void) = 0; |
|
|
/** |
/** |
Informs the CIM Server that delivery of results is complete. |
Inform the CIM server that delivery of results is complete. |
This method must be called when all the results have been delivered. |
<p>The provider must call <tt>complete</tt> when all |
The deliver() method must not be called after this method is called. |
results have been delivered. The provider must not call <tt>deliver</tt> |
*/ |
after calling <tt>complete</tt>.</p> |
virtual void complete() = 0; |
*/ |
|
virtual void complete(void) = 0; |
/** |
|
Sets the context for operation responses delivered to the CIM Server. |
#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES |
This method allows a provider to communicate context information |
/** <I><B>Experimental Interface</B></I><BR> |
(such as content language) along with an operation response. The |
Set the context for the results delivered to the CIM Server. |
context information applies to all the operation response data |
<p>The <tt>setContext</tt> function is used by providers to |
delivered to this ResponseHandler object. The context information |
set a context for the response, in the form of an OperationContext |
is applied at the time the complete() method is called. |
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.</p> |
|
<p>This method may be called at any point in the response |
|
processing before <tt>complete</tt> is called.</p> |
|
<p>Currently supported OperationContext containers: |
|
<li> |
|
ContentLanguageListContainer: used to set the ContentLanguageList of the |
|
results. |
|
</li> |
|
</p> |
|
<p>Implementation Note: This method is concrete to preserve |
|
binary compatibility with previous releases of the CIMServer</p> |
|
*/ | */ |
#ifdef PEGASUS_OS_OS400 |
|
virtual |
|
#endif |
|
void setContext(const OperationContext & context); | void setContext(const OperationContext & context); |
#endif // PEGASUS_USE_EXPERIMENTAL_INTERFACES |
|
| |
protected: | protected: |
| |
|
/** |
|
The default constructor is not available for the ResponseHandler class. |
|
*/ |
ResponseHandler(); | ResponseHandler(); |
| |
|
/** |
|
The copy constructor is not available for the ResponseHandler class. |
|
*/ |
ResponseHandler(const ResponseHandler& handler); | ResponseHandler(const ResponseHandler& handler); |
| |
|
/** |
|
The assignment operator is not available for the ResponseHandler class. |
|
*/ |
ResponseHandler& operator=(const ResponseHandler& handler); | ResponseHandler& operator=(const ResponseHandler& handler); |
| |
/** | /** |
Gets the context for the results delivered to the CIM server. |
Gets the context for the results delivered to the CIM Server. |
*/ | */ |
OperationContext getContext(void) const; |
OperationContext getContext() const; |
}; | }; |
| |
| |
/** | /** |
The InstanceResponseHandler class is a subclass to the ResponseHandler class. |
The InstanceResponseHandler class is a subclass of the ResponseHandler |
The InstanceResponseHandler class contains functions that are specific to an |
class which allows delivery of instance results. |
instance of the ResponseHandler class. |
|
*/ | */ |
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; |
| |
/** <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; |
| |
/** <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; |
}; | }; |
| |
| |
/** | /** |
The MethodResultResponseHandler class is a subclass to the ResponseHandler class. |
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: |
/** | /** |
Add documentation here. |
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; |
| |
/** | /** |
Add documentation here. |
Delivers a set of output parameters to the CIM Server. This method |
*/ |
may be invoked multiple times, if necessary. |
virtual void deliverParamValue(const Array<CIMParamValue> & outParamValues) = 0; |
@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; |
| |
/** | /** |
Add documentation here. |
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; |
}; | }; |
| |
| |
/** | /** |
The IndicationResponseHandler class is a subclass to the ResponseHandler class. |
The IndicationResponseHandler class is a subclass of the ResponseHandler |
<p> NOTE: This class definition should not be considered complete until indication |
class which allows delivery of generated indications. |
support has been completed in Pegasus. Implementation of indication support may |
|
reveal a need for API changes in this class.</p> |
|
*/ | */ |
class PEGASUS_COMMON_LINKAGE IndicationResponseHandler : virtual public ResponseHandler |
class PEGASUS_COMMON_LINKAGE IndicationResponseHandler |
|
: virtual public ResponseHandler |
{ | { |
public: | public: |
/** | /** |
Add documentation here. |
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; |
| |
/** | /** |
Add documentation here. |
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; |
| |
/** | /** |
Add documentation here. |
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; |
| |
/** | /** |
Add documentation here. |
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, |
|
|
}; | }; |
| |
| |
// |
/** |
// 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; |
| |
/** <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; |
}; | }; |