version 1.14, 2006/02/24 19:16:28
|
version 1.16, 2006/07/21 18:44:08
|
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include "OperationResponseHandler.h" | #include "OperationResponseHandler.h" |
|
#include "CIMOMHandleContext.h" |
| |
#include <Pegasus/Common/Logger.h> | #include <Pegasus/Common/Logger.h> |
|
#include <Pegasus/Common/AutoPtr.h> |
|
#include <Pegasus/Provider/CIMOMHandle.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
// operation. | // operation. |
CIMClass cimClass; | CIMClass cimClass; |
| |
try |
if(request->operationContext.contains(CachedClassDefinitionContainer::NAME)) |
{ | { |
CachedClassDefinitionContainer container = | CachedClassDefinitionContainer container = |
request->operationContext.get(CachedClassDefinitionContainer::NAME); |
request->operationContext.get( |
|
CachedClassDefinitionContainer::NAME); |
| |
cimClass = container.getClass(); | cimClass = container.getClass(); |
|
|
} |
|
catch(Exception &) |
|
{ |
|
// Do nothing. Container is missing, which implies normalization is disabled |
|
// for this operation. |
|
} | } |
| |
_normalizer = |
AutoPtr<NormalizerContext> tmpContext(new CIMOMHandleContext()); |
ObjectNormalizer( |
ObjectNormalizer tmpNormalizer( |
cimClass, | cimClass, |
request->includeQualifiers, | request->includeQualifiers, |
request->includeClassOrigin); |
request->includeClassOrigin, |
|
request->nameSpace, |
|
tmpContext); |
|
_normalizer = tmpNormalizer; |
#endif | #endif |
} | } |
| |
|
|
// operation. | // operation. |
CIMClass cimClass; | CIMClass cimClass; |
| |
try |
if(request->operationContext.contains(CachedClassDefinitionContainer::NAME)) |
{ | { |
CachedClassDefinitionContainer container = | CachedClassDefinitionContainer container = |
request->operationContext.get(CachedClassDefinitionContainer::NAME); |
request->operationContext.get( |
|
CachedClassDefinitionContainer::NAME); |
cimClass = container.getClass(); | cimClass = container.getClass(); |
} | } |
catch(Exception &) |
|
{ |
|
// Do nothing. Container is missing, which implies normalization is disabled |
|
// for this operation. |
|
} |
|
| |
_normalizer = |
AutoPtr<NormalizerContext> tmpContext(new CIMOMHandleContext()); |
ObjectNormalizer( |
ObjectNormalizer tmpNormalizer( |
cimClass, | cimClass, |
request->includeQualifiers, | request->includeQualifiers, |
request->includeClassOrigin); |
request->includeClassOrigin, |
|
request->nameSpace, |
|
tmpContext); |
|
_normalizer = tmpNormalizer; |
#endif | #endif |
} | } |
| |
|
|
// operation. | // operation. |
CIMClass cimClass; | CIMClass cimClass; |
| |
try |
if(request->operationContext.contains(CachedClassDefinitionContainer::NAME)) |
{ | { |
CachedClassDefinitionContainer container = | CachedClassDefinitionContainer container = |
request->operationContext.get(CachedClassDefinitionContainer::NAME); |
request->operationContext.get( |
|
CachedClassDefinitionContainer::NAME); |
| |
cimClass = container.getClass(); | cimClass = container.getClass(); |
} | } |
catch(Exception &) |
|
{ |
|
// Do nothing. Container is missing, which implies normalization is disabled |
|
// for this operation. |
|
} |
|
| |
_normalizer = |
AutoPtr<NormalizerContext> tmpContext(new CIMOMHandleContext()); |
ObjectNormalizer( |
ObjectNormalizer tmpNormalizer( |
cimClass, | cimClass, |
false, | false, |
false); |
false, |
|
request->nameSpace, |
|
tmpContext); |
|
_normalizer = tmpNormalizer; |
#endif | #endif |
} | } |
| |
|
|
// Get list of subscription instance names from context | // Get list of subscription instance names from context |
Array<CIMObjectPath> subscriptionInstanceNames; | Array<CIMObjectPath> subscriptionInstanceNames; |
| |
try |
if(context.contains(SubscriptionInstanceNamesContainer::NAME)) |
{ | { |
SubscriptionInstanceNamesContainer container = | SubscriptionInstanceNamesContainer container = |
context.get(SubscriptionInstanceNamesContainer::NAME); | context.get(SubscriptionInstanceNamesContainer::NAME); |
| |
subscriptionInstanceNames = container.getInstanceNames(); | subscriptionInstanceNames = container.getInstanceNames(); |
} | } |
catch(Exception &) |
else |
{ | { |
subscriptionInstanceNames.clear(); | subscriptionInstanceNames.clear(); |
} | } |
|
|
// l10n | // l10n |
ContentLanguageList contentLangs; | ContentLanguageList contentLangs; |
| |
try |
if(context.contains(ContentLanguageListContainer::NAME)) |
{ | { |
// Get the Content-Language for this indication. The provider | // Get the Content-Language for this indication. The provider |
// does not have to add specify a language for the indication. | // does not have to add specify a language for the indication. |
|
|
| |
contentLangs = langContainer.getLanguages(); | contentLangs = langContainer.getLanguages(); |
} | } |
catch(Exception &) |
else |
{ | { |
// The provider did not explicitly set a Content-Language for | // The provider did not explicitly set a Content-Language for |
// the indication. Fall back to the lang set in this object. | // the indication. Fall back to the lang set in this object. |
|
|
| |
request->operationContext = context; | request->operationContext = context; |
| |
try |
if(request->operationContext.contains(ContentLanguageListContainer::NAME)) |
{ | { |
request->operationContext.set(ContentLanguageListContainer(contentLangs)); | request->operationContext.set(ContentLanguageListContainer(contentLangs)); |
} | } |
catch(Exception &) |
else |
{ | { |
request->operationContext.insert(ContentLanguageListContainer(contentLangs)); | request->operationContext.insert(ContentLanguageListContainer(contentLangs)); |
} | } |