version 1.11.8.3, 2006/03/07 18:45:56
|
version 1.23, 2006/11/14 18:34:56
|
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Chip Vincent (cvincent@us.ibm.com) |
|
// |
|
// Modified By: |
|
// Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase2 |
|
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#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 |
| |
|
|
_response = 0; | _response = 0; |
} | } |
| |
CIMRequestMessage * OperationResponseHandler::getRequest(void) const |
CIMRequestMessage* OperationResponseHandler::getRequest() const |
{ | { |
return(_request); |
return _request; |
} | } |
| |
CIMResponseMessage * OperationResponseHandler::getResponse(void) const |
CIMResponseMessage* OperationResponseHandler::getResponse() const |
{ | { |
return(_response); |
return _response; |
} | } |
| |
void OperationResponseHandler::setStatus( | void OperationResponseHandler::setStatus( |
const Uint32 code, | const Uint32 code, |
const String & message) | const String & message) |
{ | { |
_response->cimException = PEGASUS_CIM_EXCEPTION(CIMStatusCode(code), message); |
_response->cimException = |
|
PEGASUS_CIM_EXCEPTION(CIMStatusCode(code), message); |
} | } |
| |
void OperationResponseHandler::setStatus( | void OperationResponseHandler::setStatus( |
|
|
message); | message); |
} | } |
| |
Boolean OperationResponseHandler::isAsync(void) const |
void OperationResponseHandler::setCIMException( |
|
const CIMException& cimException) |
|
{ |
|
// Assign the cimException argument to _response->cimException. Note that |
|
// there is no need to use the PEGASUS_CIM_EXCEPTION_LANG() macro to create |
|
// a TraceableCIMException since both _response->cimException and |
|
// cimException are of type CIMException and the TraceableCIMException |
|
// constructor has no side effects. |
|
_response->cimException = cimException; |
|
} |
|
|
|
Boolean OperationResponseHandler::isAsync() const |
{ | { |
return(true); |
return _responseChunkCallback != 0; |
} | } |
| |
// This is only called from SimpleResponseHandler.deliver() but lives in this | // This is only called from SimpleResponseHandler.deliver() but lives in this |
|
|
// to go through. Only operation classes have a response pointer | // to go through. Only operation classes have a response pointer |
void OperationResponseHandler::send(Boolean isComplete) | void OperationResponseHandler::send(Boolean isComplete) |
{ | { |
// some handlers do not send async because their callers cannot handle |
// It is possible to instantiate this class directly (not a derived |
// partial responses. If this is the case, stop here. |
// class, which would also inherit from SimpleResponseHandler). |
|
// The caller would do this only if the operation does not have any |
if (isAsync() == false) |
// data to be returned. |
|
|
|
SimpleResponseHandler* simpleP = |
|
dynamic_cast<SimpleResponseHandler*>(this); |
|
if (simpleP == 0) |
{ | { |
// preserve tradional behavior |
// if there is no data to be returned, then the message should NEVER be |
if (isComplete == true) |
// incomplete (even on an error) |
{ |
PEGASUS_ASSERT(isComplete); |
transfer(); |
|
} |
|
|
|
return; | return; |
} | } |
| |
SimpleResponseHandler *simpleP = dynamic_cast<SimpleResponseHandler*>(this); |
// some handlers do not send async because their callers cannot handle |
|
// partial responses. If this is the case, stop here. |
// It is possible to instantiate this class directly (not derived) |
|
// The caller would do this only if the operation does not have any data to |
|
// be returned |
|
| |
if (! simpleP) |
if (!isAsync()) |
{ | { |
// if there is no data to be returned, then the message should NEVER be |
// preserve traditional behavior |
// incomplete (even on an error) |
if (isComplete) |
if (isComplete == false) |
{ |
|
if (_response != 0) |
{ | { |
PEGASUS_ASSERT(false); |
_response->operationContext.set( |
|
ContentLanguageListContainer(simpleP->getLanguages())); |
|
} |
|
transfer(); |
} | } |
| |
return; | return; |
|
|
_response->setComplete(isComplete); | _response->setComplete(isComplete); |
_responseObjectTotal += objectCount; | _responseObjectTotal += objectCount; |
| |
// since we are reusing response for every chunk,keep track of original count |
// since we are reusing response for every chunk, keep track of original |
|
// count |
_response->setIndex(_responseMessageTotal++); | _response->setIndex(_responseMessageTotal++); |
| |
// set the originally allocated response to one more than the current. | // set the originally allocated response to one more than the current. |
|
|
transfer(); | transfer(); |
simple.clear(); | simple.clear(); |
| |
// l10n |
_response->operationContext.set( |
_response->operationContext.set(ContentLanguageListContainer(simple.getLanguages())); |
ContentLanguageListContainer(simple.getLanguages())); |
| |
// call thru ProviderManager to get externally declared entry point | // call thru ProviderManager to get externally declared entry point |
| |
|
|
_response = response; | _response = response; |
} | } |
| |
void OperationResponseHandler::transfer(void) |
void OperationResponseHandler::transfer() |
{ | { |
} | } |
| |
void OperationResponseHandler::validate(void) |
void OperationResponseHandler::validate() |
{ | { |
} | } |
| |
String OperationResponseHandler::getClass(void) const |
String OperationResponseHandler::getClass() const |
{ | { |
return(String("OperationResponseHandler")); |
return String("OperationResponseHandler"); |
} | } |
| |
Uint32 OperationResponseHandler::getResponseObjectTotal(void) const |
Uint32 OperationResponseHandler::getResponseObjectTotal() const |
{ | { |
return(_responseObjectTotal); |
return _responseObjectTotal; |
} | } |
| |
Uint32 OperationResponseHandler::getResponseMessageTotal(void) const |
Uint32 OperationResponseHandler::getResponseMessageTotal() const |
{ | { |
return(_responseMessageTotal); |
return _responseMessageTotal; |
} | } |
| |
Uint32 OperationResponseHandler::getResponseObjectThreshold(void) const |
Uint32 OperationResponseHandler::getResponseObjectThreshold() const |
{ | { |
return(_responseObjectThreshold); |
return _responseObjectThreshold; |
} | } |
| |
// | // |
|
|
: OperationResponseHandler(request, response, responseChunkCallback) | : OperationResponseHandler(request, response, responseChunkCallback) |
{ | { |
#ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION | #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION |
// Attempt to get the cached class definition used to validate results of this |
// Attempt to get the cached class definition used to validate results of |
// operation. If it does not exist, then this feature is disabled for this |
// this operation. If it does not exist, then this feature is disabled |
// operation. |
// for this operation. |
CIMClass cimClass; | CIMClass cimClass; |
| |
NormalizerContext * context = 0; |
if (request->operationContext.contains( |
|
CachedClassDefinitionContainer::NAME)) |
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 &) |
|
{ |
|
// 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, | request->nameSpace, |
context); |
tmpContext); |
|
_normalizer = tmpNormalizer; |
#endif | #endif |
} | } |
| |
|
|
if(localInstance.getPath().getKeyBindings().size() == 0) | if(localInstance.getPath().getKeyBindings().size() == 0) |
{ | { |
// ATTN: should clone before modification | // ATTN: should clone before modification |
localInstance.setPath(static_cast<CIMGetInstanceRequestMessage *>(getRequest())->instanceName); |
localInstance.setPath(static_cast<CIMGetInstanceRequestMessage*>( |
|
getRequest())->instanceName); |
} | } |
| |
SimpleInstanceResponseHandler::deliver(_normalizer.processInstance(localInstance)); |
SimpleInstanceResponseHandler::deliver( |
|
_normalizer.processInstance(localInstance)); |
#else | #else |
SimpleInstanceResponseHandler::deliver(cimInstance); | SimpleInstanceResponseHandler::deliver(cimInstance); |
#endif | #endif |
} | } |
| |
void GetInstanceResponseHandler::complete(void) |
void GetInstanceResponseHandler::complete() |
{ | { |
if(SimpleInstanceResponseHandler::size() == 0) | if(SimpleInstanceResponseHandler::size() == 0) |
{ | { |
MessageLoaderParms message( | MessageLoaderParms message( |
"Server.OperationResponseHandler.TOO_FEW_OBJECTS_DELIVERED", | "Server.OperationResponseHandler.TOO_FEW_OBJECTS_DELIVERED", |
"Too few objects delivered."); | "Too few objects delivered."); |
|
// Provider claims success, no instances returned. -V see Bug #4104 |
|
setStatus(CIM_ERR_NOT_FOUND); |
throw CIMException(CIM_ERR_FAILED, message); | throw CIMException(CIM_ERR_FAILED, message); |
} | } |
| |
SimpleInstanceResponseHandler::complete(); | SimpleInstanceResponseHandler::complete(); |
} | } |
| |
String GetInstanceResponseHandler::getClass(void) const |
String GetInstanceResponseHandler::getClass() const |
{ | { |
return(String("GetInstanceResponseHandler")); |
return String("GetInstanceResponseHandler"); |
} | } |
| |
void GetInstanceResponseHandler::transfer(void) |
void GetInstanceResponseHandler::transfer() |
{ | { |
if(size() > 0) | if(size() > 0) |
{ | { |
|
|
} | } |
} | } |
| |
void GetInstanceResponseHandler::validate(void) |
void GetInstanceResponseHandler::validate() |
{ | { |
if(getResponseObjectTotal() == 0) | if(getResponseObjectTotal() == 0) |
{ | { |
|
|
: OperationResponseHandler(request, response, responseChunkCallback) | : OperationResponseHandler(request, response, responseChunkCallback) |
{ | { |
#ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION | #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION |
// Attempt to get the cached class definition used to validate results of this |
// Attempt to get the cached class definition used to validate results of |
// operation. If it does not exist, then this feature is disabled for this |
// this operation. If it does not exist, then this feature is disabled |
// operation. |
// for this operation. |
CIMClass cimClass; | CIMClass cimClass; |
NormalizerContext * context = 0; |
|
| |
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(); |
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
NormalizerContextContainer contextContainer = |
|
request->operationContext.get(NormalizerContextContainer::NAME); |
|
context = contextContainer.getContext(); |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
} |
|
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, | request->nameSpace, |
context); |
tmpContext); |
|
_normalizer = tmpNormalizer; |
#endif | #endif |
} | } |
| |
|
|
} | } |
| |
#ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION | #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION |
SimpleInstanceResponseHandler::deliver(_normalizer.processInstance(cimInstance)); |
SimpleInstanceResponseHandler::deliver( |
|
_normalizer.processInstance(cimInstance)); |
#else | #else |
SimpleInstanceResponseHandler::deliver(cimInstance); | SimpleInstanceResponseHandler::deliver(cimInstance); |
#endif | #endif |
} | } |
| |
String EnumerateInstancesResponseHandler::getClass(void) const |
String EnumerateInstancesResponseHandler::getClass() const |
{ | { |
return(String("EnumerateInstancesResponseHandler")); |
return String("EnumerateInstancesResponseHandler"); |
} | } |
| |
void EnumerateInstancesResponseHandler::transfer(void) |
void EnumerateInstancesResponseHandler::transfer() |
{ | { |
CIMEnumerateInstancesResponseMessage & msg = | CIMEnumerateInstancesResponseMessage & msg = |
*static_cast<CIMEnumerateInstancesResponseMessage *>(getResponse()); | *static_cast<CIMEnumerateInstancesResponseMessage *>(getResponse()); |
|
|
: OperationResponseHandler(request, response, responseChunkCallback) | : OperationResponseHandler(request, response, responseChunkCallback) |
{ | { |
#ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION | #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION |
// Attempt to get the cached class definition used to validate results of this |
// Attempt to get the cached class definition used to validate results of |
// operation. If it does not exist, then this feature is disabled for this |
// this operation. If it does not exist, then this feature is disabled |
// operation. |
// for this operation. |
CIMClass cimClass; | CIMClass cimClass; |
NormalizerContext * context = 0; |
|
| |
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(); |
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
NormalizerContextContainer contextContainer = |
|
request->operationContext.get(NormalizerContextContainer::NAME); |
|
context = contextContainer.getContext(); |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
} |
|
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, | request->nameSpace, |
context); |
tmpContext); |
|
_normalizer = tmpNormalizer; |
#endif | #endif |
} | } |
| |
void EnumerateInstanceNamesResponseHandler::deliver(const CIMObjectPath & cimObjectPath) |
void EnumerateInstanceNamesResponseHandler::deliver( |
|
const CIMObjectPath& cimObjectPath) |
{ | { |
if(cimObjectPath.getClassName().isNull()) | if(cimObjectPath.getClassName().isNull()) |
{ | { |
|
|
} | } |
| |
#ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION | #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION |
SimpleObjectPathResponseHandler::deliver(_normalizer.processInstanceObjectPath(cimObjectPath)); |
SimpleObjectPathResponseHandler::deliver( |
|
_normalizer.processInstanceObjectPath(cimObjectPath)); |
#else | #else |
SimpleObjectPathResponseHandler::deliver(cimObjectPath); | SimpleObjectPathResponseHandler::deliver(cimObjectPath); |
#endif | #endif |
} | } |
| |
String EnumerateInstanceNamesResponseHandler::getClass(void) const |
String EnumerateInstanceNamesResponseHandler::getClass() const |
{ | { |
return(String("EnumerateInstanceNamesResponseHandler")); |
return String("EnumerateInstanceNamesResponseHandler"); |
} | } |
| |
void EnumerateInstanceNamesResponseHandler::transfer(void) |
void EnumerateInstanceNamesResponseHandler::transfer() |
{ | { |
CIMEnumerateInstanceNamesResponseMessage & msg = | CIMEnumerateInstanceNamesResponseMessage & msg = |
*static_cast<CIMEnumerateInstanceNamesResponseMessage *>(getResponse()); | *static_cast<CIMEnumerateInstanceNamesResponseMessage *>(getResponse()); |
|
|
SimpleObjectPathResponseHandler::deliver(cimObjectPath); | SimpleObjectPathResponseHandler::deliver(cimObjectPath); |
} | } |
| |
void CreateInstanceResponseHandler::complete(void) |
void CreateInstanceResponseHandler::complete() |
{ | { |
if(SimpleObjectPathResponseHandler::size() == 0) | if(SimpleObjectPathResponseHandler::size() == 0) |
{ | { |
|
|
SimpleObjectPathResponseHandler::complete(); | SimpleObjectPathResponseHandler::complete(); |
} | } |
| |
String CreateInstanceResponseHandler::getClass(void) const |
String CreateInstanceResponseHandler::getClass() const |
{ | { |
return(String("CreateInstanceResponseHandler")); |
return String("CreateInstanceResponseHandler"); |
} | } |
| |
#if 0 | #if 0 |
// ATTN: is it an error to not return instance name? | // ATTN: is it an error to not return instance name? |
void CreateInstanceResponseHandler::validate(void) |
void CreateInstanceResponseHandler::validate() |
{ | { |
if(getResponseObjectTotal() == 0) | if(getResponseObjectTotal() == 0) |
{ | { |
|
|
} | } |
#endif | #endif |
| |
void CreateInstanceResponseHandler::transfer(void) |
void CreateInstanceResponseHandler::transfer() |
{ | { |
if(size() > 0) | if(size() > 0) |
{ | { |
|
|
{ | { |
} | } |
| |
String ModifyInstanceResponseHandler::getClass(void) const |
String ModifyInstanceResponseHandler::getClass() const |
{ | { |
return(String("ModifyInstanceResponseHandler")); |
return String("ModifyInstanceResponseHandler"); |
} | } |
| |
// | // |
|
|
{ | { |
} | } |
| |
String DeleteInstanceResponseHandler::getClass(void) const |
String DeleteInstanceResponseHandler::getClass() const |
{ | { |
return(String("DeleteInstanceResponseHandler")); |
return String("DeleteInstanceResponseHandler"); |
} | } |
| |
// | // |
|
|
SimpleValueResponseHandler::deliver(cimValue); | SimpleValueResponseHandler::deliver(cimValue); |
} | } |
| |
String GetPropertyResponseHandler::getClass(void) const |
String GetPropertyResponseHandler::getClass() const |
{ | { |
return(String("GetPropertyResponseHandler")); |
return String("GetPropertyResponseHandler"); |
} | } |
| |
void GetPropertyResponseHandler::transfer(void) |
void GetPropertyResponseHandler::transfer() |
{ | { |
if(size() > 0) | if(size() > 0) |
{ | { |
|
|
} | } |
} | } |
| |
void GetPropertyResponseHandler::validate(void) |
void GetPropertyResponseHandler::validate() |
{ | { |
// error? provider claims success, | // error? provider claims success, |
// but did not deliver an instance. | // but did not deliver an instance. |
|
|
{ | { |
} | } |
| |
String SetPropertyResponseHandler::getClass(void) const |
String SetPropertyResponseHandler::getClass() const |
{ | { |
return(String("SetPropertyResponseHandler")); |
return String("SetPropertyResponseHandler"); |
} | } |
| |
// | // |
|
|
SimpleInstance2ObjectResponseHandler::deliver(cimInstance); | SimpleInstance2ObjectResponseHandler::deliver(cimInstance); |
} | } |
| |
String ExecQueryResponseHandler::getClass(void) const |
String ExecQueryResponseHandler::getClass() const |
{ | { |
return(String("ExecQueryResponseHandler")); |
return String("ExecQueryResponseHandler"); |
} | } |
| |
void ExecQueryResponseHandler::transfer(void) |
void ExecQueryResponseHandler::transfer() |
{ | { |
CIMExecQueryResponseMessage & msg = | CIMExecQueryResponseMessage & msg = |
*static_cast<CIMExecQueryResponseMessage *>(getResponse()); | *static_cast<CIMExecQueryResponseMessage *>(getResponse()); |
|
|
msg.cimObjects = getObjects(); | msg.cimObjects = getObjects(); |
} | } |
| |
Boolean ExecQueryResponseHandler::isAsync(void) const |
Boolean ExecQueryResponseHandler::isAsync() const |
{ | { |
return(false); |
return false; |
} | } |
| |
// | // |
|
|
SimpleObjectResponseHandler::deliver(cimObject); | SimpleObjectResponseHandler::deliver(cimObject); |
} | } |
| |
String AssociatorsResponseHandler::getClass(void) const |
String AssociatorsResponseHandler::getClass() const |
{ | { |
return(String("AssociatorsResponseHandler")); |
return String("AssociatorsResponseHandler"); |
} | } |
| |
void AssociatorsResponseHandler::transfer(void) |
void AssociatorsResponseHandler::transfer() |
{ | { |
CIMAssociatorsResponseMessage & msg = | CIMAssociatorsResponseMessage & msg = |
*static_cast<CIMAssociatorsResponseMessage *>(getResponse()); | *static_cast<CIMAssociatorsResponseMessage *>(getResponse()); |
|
|
SimpleObjectPathResponseHandler::deliver(cimObjectPath); | SimpleObjectPathResponseHandler::deliver(cimObjectPath); |
} | } |
| |
String AssociatorNamesResponseHandler::getClass(void) const |
String AssociatorNamesResponseHandler::getClass() const |
{ | { |
return(String("AssociatorNamesResponseHandler")); |
return String("AssociatorNamesResponseHandler"); |
} | } |
| |
void AssociatorNamesResponseHandler::transfer(void) |
void AssociatorNamesResponseHandler::transfer() |
{ | { |
CIMAssociatorNamesResponseMessage & msg = | CIMAssociatorNamesResponseMessage & msg = |
*static_cast<CIMAssociatorNamesResponseMessage *>(getResponse()); | *static_cast<CIMAssociatorNamesResponseMessage *>(getResponse()); |
|
|
SimpleObjectResponseHandler::deliver(cimObject); | SimpleObjectResponseHandler::deliver(cimObject); |
} | } |
| |
String ReferencesResponseHandler::getClass(void) const |
String ReferencesResponseHandler::getClass() const |
{ | { |
return(String("ReferencesResponseHandler")); |
return String("ReferencesResponseHandler"); |
} | } |
| |
void ReferencesResponseHandler::transfer(void) |
void ReferencesResponseHandler::transfer() |
{ | { |
CIMReferencesResponseMessage & msg = | CIMReferencesResponseMessage & msg = |
*static_cast<CIMReferencesResponseMessage *>(getResponse()); | *static_cast<CIMReferencesResponseMessage *>(getResponse()); |
|
|
SimpleObjectPathResponseHandler::deliver(cimObjectPath); | SimpleObjectPathResponseHandler::deliver(cimObjectPath); |
} | } |
| |
String ReferenceNamesResponseHandler::getClass(void) const |
String ReferenceNamesResponseHandler::getClass() const |
{ | { |
return(String("ReferenceNamesResponseHandler")); |
return String("ReferenceNamesResponseHandler"); |
} | } |
| |
void ReferenceNamesResponseHandler::transfer(void) |
void ReferenceNamesResponseHandler::transfer() |
{ | { |
CIMReferenceNamesResponseMessage & msg = | CIMReferenceNamesResponseMessage & msg = |
*static_cast<CIMReferenceNamesResponseMessage *>(getResponse()); | *static_cast<CIMReferenceNamesResponseMessage *>(getResponse()); |
|
|
{ | { |
} | } |
| |
void InvokeMethodResponseHandler::deliverParamValue(const CIMParamValue & cimParamValue) |
void InvokeMethodResponseHandler::deliverParamValue( |
|
const CIMParamValue& cimParamValue) |
{ | { |
if(cimParamValue.isUninitialized()) | if(cimParamValue.isUninitialized()) |
{ | { |
|
|
SimpleMethodResultResponseHandler::deliver(cimValue); | SimpleMethodResultResponseHandler::deliver(cimValue); |
} | } |
| |
String InvokeMethodResponseHandler::getClass(void) const |
String InvokeMethodResponseHandler::getClass() const |
{ | { |
return(String("InvokeMethodResponseHandler")); |
return String("InvokeMethodResponseHandler"); |
} | } |
| |
void InvokeMethodResponseHandler::transfer(void) |
void InvokeMethodResponseHandler::transfer() |
{ | { |
CIMInvokeMethodResponseMessage & msg = | CIMInvokeMethodResponseMessage & msg = |
*static_cast<CIMInvokeMethodResponseMessage *>(getResponse()); | *static_cast<CIMInvokeMethodResponseMessage *>(getResponse()); |
|
|
EnableIndicationsResponseHandler::EnableIndicationsResponseHandler( | EnableIndicationsResponseHandler::EnableIndicationsResponseHandler( |
CIMRequestMessage* request, | CIMRequestMessage* request, |
CIMResponseMessage* response, | CIMResponseMessage* response, |
CIMInstance& provider, |
const CIMInstance& provider, |
PEGASUS_INDICATION_CALLBACK_T indicationCallback, | PEGASUS_INDICATION_CALLBACK_T indicationCallback, |
PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback) | PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback) |
: OperationResponseHandler(request, response, responseChunkCallback), | : OperationResponseHandler(request, response, responseChunkCallback), |
|
|
_provider = provider; | _provider = provider; |
} | } |
| |
void EnableIndicationsResponseHandler::deliver(const CIMIndication & cimIndication) |
void EnableIndicationsResponseHandler::deliver( |
|
const CIMIndication& cimIndication) |
{ | { |
OperationContext context; | OperationContext context; |
| |
Array<CIMObjectPath> subscriptionInstanceNames; | Array<CIMObjectPath> subscriptionInstanceNames; |
| |
context.insert(SubscriptionInstanceNamesContainer(subscriptionInstanceNames)); |
context.insert( |
|
SubscriptionInstanceNamesContainer(subscriptionInstanceNames)); |
| |
deliver(context, cimIndication); | deliver(context, cimIndication); |
} | } |
| |
void EnableIndicationsResponseHandler::deliver(const OperationContext & context, const CIMIndication & cimIndication) |
void EnableIndicationsResponseHandler::deliver( |
|
const OperationContext& context, |
|
const CIMIndication& cimIndication) |
{ | { |
if(cimIndication.isUninitialized()) | if(cimIndication.isUninitialized()) |
{ | { |
|
|
// 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 |
|
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. |
contentLangs = getLanguages(); | contentLangs = getLanguages(); |
} | } |
// l10n -end |
|
| |
// create message | // create message |
// l10n |
|
CIMProcessIndicationRequestMessage * request = | CIMProcessIndicationRequestMessage * request = |
new CIMProcessIndicationRequestMessage( | new CIMProcessIndicationRequestMessage( |
XmlWriter::getNextMessageId(), | XmlWriter::getNextMessageId(), |
|
|
| |
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)); |
} | } |
| |
_indicationCallback(request); | _indicationCallback(request); |
} | } |
| |
void EnableIndicationsResponseHandler::deliver(const Array<CIMIndication> & cimIndications) |
void EnableIndicationsResponseHandler::deliver( |
|
const Array<CIMIndication>& cimIndications) |
{ | { |
OperationContext context; | OperationContext context; |
| |
deliver(context, cimIndications); | deliver(context, cimIndications); |
} | } |
| |
void EnableIndicationsResponseHandler::deliver(const OperationContext & context, const Array<CIMIndication> & cimIndications) |
void EnableIndicationsResponseHandler::deliver( |
|
const OperationContext& context, |
|
const Array<CIMIndication>& cimIndications) |
{ | { |
for(Uint32 i = 0, n = cimIndications.size(); i < n; i++) | for(Uint32 i = 0, n = cimIndications.size(); i < n; i++) |
{ | { |
|
|
} | } |
} | } |
| |
String EnableIndicationsResponseHandler::getClass(void) const |
String EnableIndicationsResponseHandler::getClass() const |
{ | { |
return(String("EnableIndicationsResponseHandler")); |
return String("EnableIndicationsResponseHandler"); |
} | } |
| |
Boolean EnableIndicationsResponseHandler::isAsync(void) const |
Boolean EnableIndicationsResponseHandler::isAsync() const |
{ | { |
return(false); |
return false; |
} | } |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |