version 1.48, 2013/05/01 23:20:09
|
version 1.49, 2013/06/29 17:55:08
|
|
|
// | // |
qs->applyProjection(a[i], true); | qs->applyProjection(a[i], true); |
} | } |
else a.remove(i); |
|
} |
|
catch (...) |
|
{ |
|
a.remove(i); |
|
} |
|
} |
|
} |
|
|
|
void WQLOperationRequestDispatcher::handleQueryResponseAggregation( |
|
OperationAggregate* poA) |
|
{ |
|
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"WQLOperationRequestDispatcher::handleQueryResponseAggregation"); |
|
|
|
Uint32 numberResponses = poA->numberResponses(); |
|
|
|
PEG_TRACE(( |
|
TRC_DISPATCHER, |
|
Tracer::LEVEL4, |
|
"WQLOperationRequestDispatcher::ExecQuery Response - " |
|
"Name Space: %s Class name: %s Response Count: %u", |
|
CSTRING(poA->_nameSpace.getString()), |
|
CSTRING(poA->_className.getString()), |
|
numberResponses)); |
|
|
|
if (numberResponses == 0) |
|
return; |
|
|
|
CIMResponseMessage* response = poA->getResponse(0); |
|
CIMExecQueryResponseMessage* toResponse = 0; |
|
Uint32 startIndex = 0; |
|
Uint32 endIndex = numberResponses - 1; |
|
Boolean manyResponses = true; |
|
if (response->getType() == CIM_ENUMERATE_INSTANCES_RESPONSE_MESSAGE) |
|
{ |
|
// Create an ExecQuery response from an EnumerateInstances request |
|
CIMOperationRequestMessage* request = poA->getRequest(); |
|
AutoPtr<CIMExecQueryResponseMessage> query( |
|
new CIMExecQueryResponseMessage( |
|
request->messageId, |
|
CIMException(), |
|
request->queueIds.copyAndPop())); |
|
query->syncAttributes(request); |
|
toResponse = query.release(); |
|
} |
|
else | else |
{ | { |
toResponse = (CIMExecQueryResponseMessage*) response; |
a.remove(i); |
manyResponses = false; |
|
} |
|
|
|
// Work backward and delete each response off the end of the array |
|
for (Uint32 i = endIndex; i >= startIndex; i--) |
|
{ |
|
if (manyResponses) |
|
response = poA->getResponse(i); |
|
|
|
if (response->getType() == CIM_ENUMERATE_INSTANCES_RESPONSE_MESSAGE) |
|
{ |
|
// convert enumerate instances responses to exec query responses |
|
applyQueryToEnumeration(response, poA->_query); |
|
CIMEnumerateInstancesResponseMessage* fromResponse = |
|
(CIMEnumerateInstancesResponseMessage*) response; |
|
CIMClass cimClass; |
|
|
|
Boolean clsRead=false; |
|
Array<CIMInstance>& a = |
|
fromResponse->getResponseData().getInstances(); |
|
for (Uint32 j = 0, m = a.size(); |
|
j < m; j++) |
|
{ |
|
CIMObject co=CIMObject(a[j]); |
|
CIMObjectPath op=co.getPath(); |
|
const Array<CIMKeyBinding>& kbs=op.getKeyBindings(); |
|
if (kbs.size() == 0) |
|
{ // no path set why ? |
|
if (clsRead == false) |
|
{ |
|
cimClass = _repository->getClass( |
|
poA->_nameSpace, op.getClassName(), |
|
false,true,false, CIMPropertyList()); |
|
clsRead=true; |
|
} |
|
op = a[j].buildPath(cimClass); |
|
} |
|
op.setNameSpace(poA->_nameSpace); |
|
op.setHost(System::getHostName()); |
|
co.setPath(op); |
|
if (manyResponses) |
|
toResponse->getResponseData().appendObject(co); |
|
} | } |
} | } |
else |
catch (...) |
{ |
|
CIMExecQueryResponseMessage* fromResponse = |
|
(CIMExecQueryResponseMessage*) response; |
|
|
|
CIMResponseData & from = fromResponse->getResponseData(); |
|
from.completeHostNameAndNamespace( |
|
System::getHostName(), |
|
poA->_nameSpace); |
|
|
|
if (manyResponses) |
|
{ | { |
toResponse->getResponseData().appendResponseData(from); |
a.remove(i); |
} | } |
} | } |
if (manyResponses) |
|
{ |
|
poA->deleteResponse(i); |
|
} |
|
|
|
if (i == 0) |
|
break; |
|
} // for all responses in response list |
|
|
|
// if we started with an enumerateInstances repsonse, then add it to overall |
|
if ((startIndex == 0) && manyResponses) |
|
poA->appendResponse(toResponse); |
|
|
|
PEG_METHOD_EXIT(); |
|
} | } |
| |
void WQLOperationRequestDispatcher::handleQueryRequest( | void WQLOperationRequestDispatcher::handleQueryRequest( |
|
|
| |
// Set the number of expected responses in the OperationAggregate | // Set the number of expected responses in the OperationAggregate |
Uint32 numClasses = providerInfos.size(); | Uint32 numClasses = providerInfos.size(); |
/// KS _ Should we have to do this??? |
|
poA->_nameSpace=request->nameSpace; | poA->_nameSpace=request->nameSpace; |
| |
if (_repository->isDefaultInstanceProvider()) | if (_repository->isDefaultInstanceProvider()) |
|
|
context->insert(*providerIdContainer); | context->insert(*providerIdContainer); |
| |
context->insert(identityContainer); | context->insert(identityContainer); |
|
|
_forwardRequestForAggregation( | _forwardRequestForAggregation( |
providerInfo.serviceId, | providerInfo.serviceId, |
providerInfo.controlProviderName, | providerInfo.controlProviderName, |