version 1.17, 2006/08/29 17:48:57
|
version 1.22, 2006/11/09 18:15:29
|
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// 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" |
|
|
message); | message); |
} | } |
| |
|
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(void) const | Boolean OperationResponseHandler::isAsync(void) const |
{ | { |
return _responseChunkCallback != 0; | return _responseChunkCallback != 0; |
|
|
// 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. |
{ |
|
// preserve tradional behavior |
SimpleResponseHandler* simpleP = |
if (isComplete == true) |
dynamic_cast<SimpleResponseHandler*>(this); |
|
if (simpleP == 0) |
{ | { |
transfer(); |
// if there is no data to be returned, then the message should NEVER be |
} |
// incomplete (even on an error) |
|
PEGASUS_ASSERT(isComplete); |
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; |
|
|
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); |
} | } |
| |