version 1.11.8.3, 2006/03/07 18:45:56
|
version 1.11.8.4, 2006/03/10 14:30:39
|
|
|
#include "OperationResponseHandler.h" | #include "OperationResponseHandler.h" |
| |
#include <Pegasus/Common/Logger.h> | #include <Pegasus/Common/Logger.h> |
|
#include <Pegasus/Provider/CIMOMHandle.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
/********************************************************** |
|
* Define CIMOMHandleContext class |
|
**********************************************************/ |
|
class CIMOMHandleContext : public NormalizerContext |
|
{ |
|
public: |
|
CIMOMHandleContext() {} |
|
virtual ~CIMOMHandleContext() {} |
|
|
|
virtual CIMClass getClass( |
|
const CIMNamespaceName& nameSpace, |
|
const CIMName& name); |
|
|
|
virtual Array<CIMName> enumerateClassNames( |
|
const CIMNamespaceName& nameSpace, const CIMName& className, |
|
bool deepInheritance); |
|
|
|
virtual AutoPtr<NormalizerContext> clone(); |
|
|
|
protected: |
|
CIMOMHandleContext(CIMOMHandle & hndl) : handle(hndl) {} |
|
private: |
|
CIMOMHandle handle; |
|
OperationContext emptyContext; |
|
}; |
|
|
|
CIMClass CIMOMHandleContext::getClass( |
|
const CIMNamespaceName& nameSpace, |
|
const CIMName& name) |
|
{ |
|
// Get the whole class definition |
|
return handle.getClass(emptyContext, nameSpace, name, false, true, true, |
|
CIMPropertyList()); |
|
} |
|
|
|
Array<CIMName> CIMOMHandleContext::enumerateClassNames( |
|
const CIMNamespaceName& nameSpace, const CIMName& className, |
|
bool deepInheritance) |
|
{ |
|
return handle.enumerateClassNames(emptyContext, nameSpace, className, |
|
deepInheritance); |
|
} |
|
|
|
AutoPtr<NormalizerContext> CIMOMHandleContext::clone() |
|
{ |
|
AutoPtr<NormalizerContext> tmpPtr(new CIMOMHandleContext(handle)); |
|
return tmpPtr; |
|
} |
|
|
|
/********************************************************** |
|
* End CIMOMHandleContext class |
|
**********************************************************/ |
|
|
// | // |
// OperationResponseHandler | // OperationResponseHandler |
// | // |
|
|
// operation. | // operation. |
CIMClass cimClass; | CIMClass cimClass; |
| |
NormalizerContext * context = 0; |
|
|
|
try | try |
{ | { |
CachedClassDefinitionContainer container = | CachedClassDefinitionContainer container = |
request->operationContext.get(CachedClassDefinitionContainer::NAME); | request->operationContext.get(CachedClassDefinitionContainer::NAME); |
| |
cimClass = container.getClass(); | cimClass = container.getClass(); |
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
NormalizerContextContainer contextContainer = |
|
request->operationContext.get(NormalizerContextContainer::NAME); |
|
context = contextContainer.getContext(); |
|
#endif //PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
} | } |
catch(Exception &) | catch(Exception &) |
{ | { |
|
|
// for this operation. | // for this operation. |
} | } |
| |
_normalizer = |
AutoPtr<NormalizerContext> tmpContext(new CIMOMHandleContext()); |
ObjectNormalizer( |
ObjectNormalizer tmpNormalizer( |
cimClass, | cimClass, |
request->includeQualifiers, | request->includeQualifiers, |
request->includeClassOrigin, | request->includeClassOrigin, |
request->nameSpace, | request->nameSpace, |
context); |
tmpContext); |
|
_normalizer = tmpNormalizer; |
#endif | #endif |
} | } |
| |
|
|
// operation. If it does not exist, then this feature is disabled for this | // operation. If it does not exist, then this feature is disabled for this |
// operation. | // operation. |
CIMClass cimClass; | CIMClass cimClass; |
NormalizerContext * context = 0; |
|
| |
try | try |
{ | { |
|
|
request->operationContext.get(CachedClassDefinitionContainer::NAME); | request->operationContext.get(CachedClassDefinitionContainer::NAME); |
| |
cimClass = container.getClass(); | cimClass = container.getClass(); |
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
NormalizerContextContainer contextContainer = |
|
request->operationContext.get(NormalizerContextContainer::NAME); |
|
context = contextContainer.getContext(); |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
} | } |
catch(Exception &) | catch(Exception &) |
{ | { |
|
|
// for this operation. | // for this operation. |
} | } |
| |
_normalizer = |
AutoPtr<NormalizerContext> tmpContext(new CIMOMHandleContext()); |
ObjectNormalizer( |
ObjectNormalizer tmpNormalizer( |
cimClass, | cimClass, |
request->includeQualifiers, | request->includeQualifiers, |
request->includeClassOrigin, | request->includeClassOrigin, |
request->nameSpace, | request->nameSpace, |
context); |
tmpContext); |
|
_normalizer = tmpNormalizer; |
#endif | #endif |
} | } |
| |
|
|
// operation. If it does not exist, then this feature is disabled for this | // operation. If it does not exist, then this feature is disabled for this |
// operation. | // operation. |
CIMClass cimClass; | CIMClass cimClass; |
NormalizerContext * context = 0; |
|
| |
try | try |
{ | { |
|
|
request->operationContext.get(CachedClassDefinitionContainer::NAME); | request->operationContext.get(CachedClassDefinitionContainer::NAME); |
| |
cimClass = container.getClass(); | cimClass = container.getClass(); |
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
NormalizerContextContainer contextContainer = |
|
request->operationContext.get(NormalizerContextContainer::NAME); |
|
context = contextContainer.getContext(); |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
} | } |
catch(Exception &) | catch(Exception &) |
{ | { |
|
|
// for this operation. | // for this operation. |
} | } |
| |
_normalizer = |
AutoPtr<NormalizerContext> tmpContext(new CIMOMHandleContext()); |
ObjectNormalizer( |
ObjectNormalizer tmpNormalizer( |
cimClass, | cimClass, |
false, | false, |
false, | false, |
request->nameSpace, | request->nameSpace, |
context); |
tmpContext); |
|
_normalizer = tmpNormalizer; |
#endif | #endif |
} | } |
| |