version 1.13, 2005/01/26 02:35:18
|
version 1.14, 2005/02/03 04:17:46
|
|
|
#include <Pegasus/Common/CIMIndication.h> | #include <Pegasus/Common/CIMIndication.h> |
#include <Pegasus/Common/CIMValue.h> | #include <Pegasus/Common/CIMValue.h> |
| |
|
#include <Pegasus/Common/OperationContext.h> |
|
#include <Pegasus/Common/OperationContextInternal.h> |
|
|
|
#include <Pegasus/Common/ObjectNormalizer.h> |
#include <Pegasus/Common/ResponseHandler.h> | #include <Pegasus/Common/ResponseHandler.h> |
#include <Pegasus/Common/Logger.h> | #include <Pegasus/Common/Logger.h> |
#include <Pegasus/Common/XmlWriter.h> | #include <Pegasus/Common/XmlWriter.h> |
|
|
} | } |
| |
protected: | protected: |
|
|
// the default for all derived handlers. Some handlers may not apply | // the default for all derived handlers. Some handlers may not apply |
// async behavior because their callers cannot handle partial responses. | // async behavior because their callers cannot handle partial responses. |
virtual Boolean isAsync(void) const | virtual Boolean isAsync(void) const |
|
|
CIMGetInstanceResponseMessage * response) | CIMGetInstanceResponseMessage * response) |
: OperationResponseHandler(request, response) | : OperationResponseHandler(request, response) |
{ | { |
|
#ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION |
|
// Attempt to get the cached class definition used to validate results of this |
|
// operation. If it does not exist, then this feature is disabled for this |
|
// operation. |
|
try |
|
{ |
|
CachedClassDefinitionContainer container = |
|
request->operationContext.get(CachedClassDefinitionContainer::NAME); |
|
|
|
CIMClass cimClass = container.getClass(); |
|
|
|
_normalizer = |
|
ObjectNormalizer( |
|
cimClass, |
|
request->localOnly, |
|
request->includeQualifiers, |
|
request->includeClassOrigin); |
|
} |
|
catch(Exception &) |
|
{ |
|
// Do nothing. Container is missing, which implies normalization is disabled |
|
// for this operation. |
|
} |
|
#endif |
} | } |
| |
|
/* |
|
#ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION |
|
virtual void deliver(const CIMInstance & cimInstance) |
|
{ |
|
// Normalize (if seeded, otherwise do nothing) and pass to subclass method for delivery. |
|
SimpleInstanceResponseHandler::deliver(_normalizer.processInstance(cimInstance)); |
|
} |
|
#endif |
|
*/ |
|
|
virtual String getClass(void) const | virtual String getClass(void) const |
{ | { |
return(String("GetInstanceResponseHandler")); | return(String("GetInstanceResponseHandler")); |
|
|
setStatus(CIM_ERR_NOT_FOUND); | setStatus(CIM_ERR_NOT_FOUND); |
} | } |
} | } |
|
|
|
private: |
|
ObjectNormalizer _normalizer; |
|
|
}; | }; |
| |
class EnumerateInstancesResponseHandler : public OperationResponseHandler, public SimpleInstanceResponseHandler | class EnumerateInstancesResponseHandler : public OperationResponseHandler, public SimpleInstanceResponseHandler |
|
|
CIMEnumerateInstancesResponseMessage * response) | CIMEnumerateInstancesResponseMessage * response) |
: OperationResponseHandler(request, response) | : OperationResponseHandler(request, response) |
{ | { |
|
#ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION |
|
// Attempt to get the cached class definition used to validate results of this |
|
// operation. If it does not exist, then this feature is disabled for this |
|
// operation. |
|
try |
|
{ |
|
CachedClassDefinitionContainer container = |
|
request->operationContext.get(CachedClassDefinitionContainer::NAME); |
|
|
|
CIMClass cimClass = container.getClass(); |
|
|
|
_normalizer = |
|
ObjectNormalizer( |
|
cimClass, |
|
request->localOnly, |
|
request->includeQualifiers, |
|
request->includeClassOrigin); |
|
} |
|
catch(Exception &) |
|
{ |
|
// Do nothing. Container is missing, which implies normalization is disabled |
|
// for this operation. |
|
} |
|
#endif |
} | } |
| |
|
/* |
|
#ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION |
|
virtual void deliver(const CIMInstance & cimInstance) |
|
{ |
|
// Normalize (if seeded, otherwise do nothing) and pass to subclass method for delivery. |
|
SimpleInstanceResponseHandler::deliver(_normalizer.processInstance(cimInstance)); |
|
} |
|
#endif |
|
*/ |
|
|
virtual String getClass(void) const | virtual String getClass(void) const |
{ | { |
return(String("EnumerateInstancesResponseHandler")); | return(String("EnumerateInstancesResponseHandler")); |
|
|
| |
msg.cimNamedInstances = getObjects(); | msg.cimNamedInstances = getObjects(); |
} | } |
|
|
|
private: |
|
ObjectNormalizer _normalizer; |
|
|
}; | }; |
| |
class EnumerateInstanceNamesResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler | class EnumerateInstanceNamesResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler |
|
|
CIMEnumerateInstanceNamesResponseMessage * response) | CIMEnumerateInstanceNamesResponseMessage * response) |
: OperationResponseHandler(request, response) | : OperationResponseHandler(request, response) |
{ | { |
|
#ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION |
|
// Attempt to get the cached class definition used to validate results of this |
|
// operation. If it does not exist, then this feature is disabled for this |
|
// operation. |
|
try |
|
{ |
|
CachedClassDefinitionContainer container = |
|
request->operationContext.get(CachedClassDefinitionContainer::NAME); |
|
|
|
CIMClass cimClass = container.getClass(); |
|
|
|
_normalizer = |
|
ObjectNormalizer( |
|
cimClass, |
|
false, |
|
false, |
|
false); |
} | } |
|
catch(Exception &) |
|
{ |
|
// Do nothing. Container is missing, which implies normalization is disabled |
|
// for this operation. |
|
} |
|
#endif |
|
} |
|
|
|
/* |
|
#ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION |
|
virtual void deliver(const CIMObjectPath & cimObjectPath) |
|
{ |
|
// Normalize (if seeded, otherwise do nothing) and pass to subclass method for delivery. |
|
SimpleObjectPathResponseHandler::deliver(_normalizer.processInstanceObjectPath(cimObjectPath)); |
|
} |
|
#endif |
|
*/ |
| |
virtual String getClass(void) const | virtual String getClass(void) const |
{ | { |
|
|
| |
msg.instanceNames = getObjects(); | msg.instanceNames = getObjects(); |
} | } |
|
|
|
private: |
|
ObjectNormalizer _normalizer; |
|
|
}; | }; |
| |
class CreateInstanceResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler | class CreateInstanceResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler |