version 1.20, 2006/08/22 18:29:38
|
version 1.21, 2006/08/23 19:42:21
|
|
|
Boolean manyResponses = true; | Boolean manyResponses = true; |
if (response->getType() == CIM_ENUMERATE_INSTANCES_RESPONSE_MESSAGE) | if (response->getType() == CIM_ENUMERATE_INSTANCES_RESPONSE_MESSAGE) |
{ | { |
CIMRequestMessage &request = *poA->getRequest(); |
CIMRequestMessage* request = poA->getRequest(); |
AutoPtr<CIMExecQueryResponseMessage> query |
AutoPtr<CIMExecQueryResponseMessage> query( |
(new CIMExecQueryResponseMessage(request.messageId, |
new CIMExecQueryResponseMessage(request->messageId, |
CIMException(), | CIMException(), |
request.queueIds.copyAndPop(), |
request->queueIds.copyAndPop(), |
Array<CIMObject>())); | Array<CIMObject>())); |
#ifndef PEGASUS_DISABLE_PERFINST |
query->syncAttributes(request); |
query->setStartServerTime(request.getStartServerTime()); |
|
#endif |
|
toResponse = query.release(); | toResponse = query.release(); |
} | } |
else | else |
|
|
void WQLOperationRequestDispatcher::handleQueryRequest( | void WQLOperationRequestDispatcher::handleQueryRequest( |
CIMExecQueryRequestMessage* request) | CIMExecQueryRequestMessage* request) |
{ | { |
|
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMOperationRequestDispatcher::handleExecQueryRequest"); |
|
|
Boolean exception=false; | Boolean exception=false; |
AutoPtr<WQLSelectStatement> selectStatement(new WQLSelectStatement()); | AutoPtr<WQLSelectStatement> selectStatement(new WQLSelectStatement()); |
AutoPtr<WQLQueryExpressionRep> qx; | AutoPtr<WQLQueryExpressionRep> qx; |
CIMException cimException; | CIMException cimException; |
CIMName className; | CIMName className; |
| |
//if (getenv("CMPI_DEBUG")) asm("int $3"); |
|
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMOperationRequestDispatcher::handleExecQueryRequest"); |
|
|
|
if (request->queryLanguage!="WQL") { | if (request->queryLanguage!="WQL") { |
cimException = | cimException = |
PEGASUS_CIM_EXCEPTION(CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED, request->queryLanguage); | PEGASUS_CIM_EXCEPTION(CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED, request->queryLanguage); |
|
|
} | } |
} | } |
| |
if (exception) { |
if (exception) |
Array<CIMObject> cimObjects; |
{ |
|
CIMResponseMessage* response = request->buildResponse(); |
AutoPtr<CIMExecQueryResponseMessage> response( |
response->cimException = cimException; |
new CIMExecQueryResponseMessage( |
|
request->messageId, |
|
cimException, |
|
request->queueIds.copyAndPop(), |
|
cimObjects)); |
|
| |
STAT_COPYDISPATCHER_REP |
_enqueueResponse(request, response); |
_enqueueResponse(request, response.release()); |
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return; | return; |
} | } |
|
|
} | } |
catch(CIMException& exception) { | catch(CIMException& exception) { |
// Return exception response if exception from getSubClasses | // Return exception response if exception from getSubClasses |
cimException = exception; |
CIMResponseMessage* response = request->buildResponse(); |
AutoPtr<CIMExecQueryResponseMessage> response( |
response->cimException = exception; |
new CIMExecQueryResponseMessage(request->messageId, |
|
cimException, |
|
request->queueIds.copyAndPop(), |
|
Array<CIMObject>())); |
|
|
|
STAT_COPYDISPATCHER_REP |
|
| |
_enqueueResponse(request, response.release()); |
_enqueueResponse(request, response); |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return; | return; |
} | } |
|
|
_maximumEnumerateBreadth, | _maximumEnumerateBreadth, |
providerCount)); | providerCount)); |
| |
// l10n |
CIMResponseMessage* response = request->buildResponse(); |
|
response->cimException = |
|
PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED, MessageLoaderParms( |
|
"Server.CIMOperationRequestDispatcher.QUERY_REQ_TOO_BROAD", |
|
"Query request too Broad")); |
| |
AutoPtr<CIMExecQueryResponseMessage> response( |
_enqueueResponse(request, response); |
new CIMExecQueryResponseMessage(request->messageId, |
|
PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED, |
|
MessageLoaderParms("Server.CIMOperationRequestDispatcher." |
|
"QUERY_REQ_TOO_BROAD", "Query request too Broad")), |
|
request->queueIds.copyAndPop(), |
|
Array<CIMObject>())); |
|
|
|
STAT_COPYDISPATCHER |
|
|
|
_enqueueResponse(request, response.release()); |
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return; | return; |
} | } |
|
|
PEG_TRACE_STRING(TRC_DISPATCHER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_DISPATCHER, Tracer::LEVEL4, |
"CIM_ERROR_NOT_SUPPORTED for " + request->className.getString()); | "CIM_ERROR_NOT_SUPPORTED for " + request->className.getString()); |
| |
AutoPtr<CIMExecQueryResponseMessage> response( |
CIMResponseMessage* response = request->buildResponse(); |
new CIMExecQueryResponseMessage(request->messageId, |
response->cimException = |
PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY), |
PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
request->queueIds.copyAndPop(), |
|
Array<CIMObject>())); |
|
| |
STAT_COPYDISPATCHER |
_enqueueResponse(request, response); |
|
|
_enqueueResponse(request, response.release()); |
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return; | return; |
} | } |
|
|
providerInfo.className.getString(), | providerInfo.className.getString(), |
i, numClasses, poA->_aggregationSN)); | i, numClasses, poA->_aggregationSN)); |
| |
CIMException cimException; |
AutoPtr<CIMEnumerateInstancesResponseMessage> response( |
Array<CIMInstance> cimInstances; |
dynamic_cast<CIMEnumerateInstancesResponseMessage*>( |
STAT_PROVIDERSTART |
request->buildResponse())); |
| |
try | try |
{ | { |
// Enumerate instances only for this class | // Enumerate instances only for this class |
cimInstances = |
response->cimNamedInstances = |
_repository->enumerateInstancesForClass( | _repository->enumerateInstancesForClass( |
request->nameSpace, | request->nameSpace, |
providerInfo.className, | providerInfo.className, |
|
|
} | } |
catch(CIMException& exception) | catch(CIMException& exception) |
{ | { |
cimException = exception; |
response->cimException = exception; |
} | } |
catch(Exception& exception) | catch(Exception& exception) |
{ | { |
cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
response->cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
exception.getMessage()); | exception.getMessage()); |
} | } |
catch(...) | catch(...) |
{ | { |
cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
response->cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
String::EMPTY); | String::EMPTY); |
} | } |
| |
STAT_PROVIDEREND |
|
|
|
AutoPtr<CIMEnumerateInstancesResponseMessage> response |
|
(new CIMEnumerateInstancesResponseMessage |
|
(request->messageId, cimException, request->queueIds.copyAndPop(), |
|
cimInstances)); |
|
|
|
STAT_COPYDISPATCHER_REP |
|
|
|
poA->appendResponse(response.release()); | poA->appendResponse(response.release()); |
} // for all classes and derived classes | } // for all classes and derived classes |
| |
|
|
if (! providerInfo.hasProvider) | if (! providerInfo.hasProvider) |
continue; | continue; |
| |
STAT_PROVIDERSTART |
|
|
|
PEG_TRACE_STRING(TRC_DISPATCHER, Tracer::LEVEL4, Formatter::format | PEG_TRACE_STRING(TRC_DISPATCHER, Tracer::LEVEL4, Formatter::format |
("Query Req. class $0 to svc \"$1\" for " | ("Query Req. class $0 to svc \"$1\" for " |
"control provider \"$2\", No $3 of $4, SN $5", | "control provider \"$2\", No $3 of $4, SN $5", |
|
|
requestCopy.release(), poA); | requestCopy.release(), poA); |
} | } |
| |
STAT_PROVIDEREND |
|
|
|
} // for all classes and derived classes | } // for all classes and derived classes |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |