version 1.321, 2009/06/30 10:31:33
|
version 1.322, 2009/12/15 11:39:42
|
|
|
AutoPtr<CIMGetInstanceResponseMessage> response( | AutoPtr<CIMGetInstanceResponseMessage> response( |
dynamic_cast<CIMGetInstanceResponseMessage*>( | dynamic_cast<CIMGetInstanceResponseMessage*>( |
request->buildResponse())); | request->buildResponse())); |
response->getResponseData().setCimInstance(cimInstance); |
response->getResponseData().setInstance(cimInstance); |
| |
_enqueueResponse(request, response.release()); | _enqueueResponse(request, response.release()); |
} | } |
|
|
String::EMPTY); | String::EMPTY); |
} | } |
| |
response->getResponseData().setNamedInstances(cimNamedInstances); |
response->getResponseData().setInstances(cimNamedInstances); |
response->cimException = cimException; | response->cimException = cimException; |
| |
poA->appendResponse(response.release()); | poA->appendResponse(response.release()); |
|
|
try | try |
{ | { |
// Enumerate instances only for this class | // Enumerate instances only for this class |
response->instanceNames = |
const Array<CIMObjectPath>& cops = |
_repository->enumerateInstanceNamesForClass( | _repository->enumerateInstanceNamesForClass( |
request->nameSpace, | request->nameSpace, |
providerInfo.className); | providerInfo.className); |
|
response->getResponseData().setInstanceNames(cops); |
} | } |
catch (const CIMException& exception) | catch (const CIMException& exception) |
{ | { |
|
|
AutoPtr<CIMAssociatorsResponseMessage> response( | AutoPtr<CIMAssociatorsResponseMessage> response( |
dynamic_cast<CIMAssociatorsResponseMessage*>( | dynamic_cast<CIMAssociatorsResponseMessage*>( |
request->buildResponse())); | request->buildResponse())); |
response->getResponseData().setCIMObjects(cimObjects); |
response->getResponseData().setObjects(cimObjects); |
| |
_enqueueResponse(request, response.release()); | _enqueueResponse(request, response.release()); |
} | } |
|
|
request->includeClassOrigin, | request->includeClassOrigin, |
request->propertyList); | request->propertyList); |
| |
response->getResponseData().setCIMObjects(cimObjects); |
response->getResponseData().setObjects(cimObjects); |
| |
PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, | PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, |
"Associators repository access: class = %s, count = %u.", | "Associators repository access: class = %s, count = %u.", |
(const char*)request->objectName.toString().getCString(), | (const char*)request->objectName.toString().getCString(), |
response->getResponseData().getCIMObjects().size())); |
response->getResponseData().getObjects().size())); |
} | } |
| |
if (providerCount == 0) | if (providerCount == 0) |
|
|
AutoPtr<CIMAssociatorNamesResponseMessage> response( | AutoPtr<CIMAssociatorNamesResponseMessage> response( |
dynamic_cast<CIMAssociatorNamesResponseMessage*>( | dynamic_cast<CIMAssociatorNamesResponseMessage*>( |
request->buildResponse())); | request->buildResponse())); |
response->objectNames = objectNames; |
response->getResponseData().setInstanceNames(objectNames); |
| |
_enqueueResponse(request, response.release()); | _enqueueResponse(request, response.release()); |
} | } |
|
|
response.reset(dynamic_cast<CIMAssociatorNamesResponseMessage*>( | response.reset(dynamic_cast<CIMAssociatorNamesResponseMessage*>( |
request->buildResponse())); | request->buildResponse())); |
| |
response->objectNames = _repository->associatorNames( |
Array<CIMObjectPath> objectNames = _repository->associatorNames( |
request->nameSpace, | request->nameSpace, |
request->objectName, | request->objectName, |
request->assocClass, | request->assocClass, |
request->resultClass, | request->resultClass, |
request->role, | request->role, |
request->resultRole); | request->resultRole); |
|
response->getResponseData().setInstanceNames(objectNames); |
| |
PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, | PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, |
"AssociatorNames repository access: class = %s, count = %u.", | "AssociatorNames repository access: class = %s, count = %u.", |
(const char*)request->objectName.toString().getCString(), | (const char*)request->objectName.toString().getCString(), |
response->objectNames.size())); |
objectNames.size())); |
} | } |
| |
if (providerCount == 0) | if (providerCount == 0) |
|
|
AutoPtr<CIMReferencesResponseMessage> response( | AutoPtr<CIMReferencesResponseMessage> response( |
dynamic_cast<CIMReferencesResponseMessage*>( | dynamic_cast<CIMReferencesResponseMessage*>( |
request->buildResponse())); | request->buildResponse())); |
response->cimObjects = cimObjects; |
response->getResponseData().setObjects(cimObjects); |
| |
_enqueueResponse(request, response.release()); | _enqueueResponse(request, response.release()); |
} | } |
|
|
response.reset(dynamic_cast<CIMReferencesResponseMessage*>( | response.reset(dynamic_cast<CIMReferencesResponseMessage*>( |
request->buildResponse())); | request->buildResponse())); |
| |
response->cimObjects = _repository->references( |
Array<CIMObject> cimObjects = _repository->references( |
request->nameSpace, | request->nameSpace, |
request->objectName, | request->objectName, |
request->resultClass, | request->resultClass, |
|
|
request->includeQualifiers, | request->includeQualifiers, |
request->includeClassOrigin, | request->includeClassOrigin, |
request->propertyList); | request->propertyList); |
|
response->getResponseData().setObjects(cimObjects); |
| |
PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, | PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, |
"References repository access: class = %s, count = %u.", | "References repository access: class = %s, count = %u.", |
(const char*)request->objectName.toString().getCString(), | (const char*)request->objectName.toString().getCString(), |
response->cimObjects.size())); |
cimObjects.size())); |
} | } |
| |
if (providerCount == 0) | if (providerCount == 0) |
|
|
AutoPtr<CIMReferenceNamesResponseMessage> response( | AutoPtr<CIMReferenceNamesResponseMessage> response( |
dynamic_cast<CIMReferenceNamesResponseMessage*>( | dynamic_cast<CIMReferenceNamesResponseMessage*>( |
request->buildResponse())); | request->buildResponse())); |
response->objectNames = objectNames; |
response->getResponseData().setInstanceNames(objectNames); |
| |
_enqueueResponse(request, response.release()); | _enqueueResponse(request, response.release()); |
} | } |
|
|
response.reset(dynamic_cast<CIMReferenceNamesResponseMessage*>( | response.reset(dynamic_cast<CIMReferenceNamesResponseMessage*>( |
request->buildResponse())); | request->buildResponse())); |
| |
response->objectNames = _repository->referenceNames( |
Array<CIMObjectPath> objectNames = _repository->referenceNames( |
request->nameSpace, | request->nameSpace, |
request->objectName, | request->objectName, |
request->resultClass, | request->resultClass, |
request->role); | request->role); |
|
response->getResponseData().setInstanceNames(objectNames); |
| |
PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, | PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, |
"ReferenceNames repository access: class = %s, count = %u.", | "ReferenceNames repository access: class = %s, count = %u.", |
(const char*)request->objectName.toString().getCString(), | (const char*)request->objectName.toString().getCString(), |
response->objectNames.size())); |
objectNames.size())); |
} | } |
| |
if (providerCount == 0) | if (providerCount == 0) |
|
|
CSTRING(poA->_className.getString()), | CSTRING(poA->_className.getString()), |
poA->numberResponses())); | poA->numberResponses())); |
| |
// This double loop has 2 purposes: |
// Work backward and delete each response off the end of the array |
// 1. To work backward and delete each response off the end of the array |
CIMResponseData & to = toResponse->getResponseData(); |
// and append each instance to the list of instances of the first |
for (Uint32 i = poA->numberResponses() - 1; i > 0; i--) |
// element in the array. |
|
// 2. fill in host, namespace on all instances on all elements of array |
|
// if they have been left out. This is required because XML reader |
|
// will fail without them populated |
|
|
|
Uint32 i = poA->numberResponses() - 1; |
|
do |
|
{ | { |
CIMAssociatorNamesResponseMessage* fromResponse = | CIMAssociatorNamesResponseMessage* fromResponse = |
(CIMAssociatorNamesResponseMessage*)poA->getResponse(i); | (CIMAssociatorNamesResponseMessage*)poA->getResponse(i); |
|
CIMResponseData & from = fromResponse->getResponseData(); |
for (Uint32 j = 0, n = fromResponse->objectNames.size(); j < n; j++) |
to.appendResponseData(from); |
{ |
poA->deleteResponse(i); |
CIMObjectPath& p = fromResponse->objectNames[j]; |
|
|
|
if (p.getHost().size() == 0) |
|
p.setHost(cimAggregationLocalHost); |
|
|
|
if (p.getNameSpace().isNull()) |
|
p.setNameSpace(poA->_nameSpace); |
|
|
|
// only append if we are not the first response |
|
if (i > 0) |
|
toResponse->objectNames.append(p); |
|
} | } |
|
// fill in host, namespace on all instances on all elements of array |
// only delete if we are not the first response, else we're done |
// if they have been left out. This is required because XML reader |
if (i == 0) |
// will fail without them populated |
break; |
to.completeHostNameAndNamespace(cimAggregationLocalHost,poA->_nameSpace); |
else poA->deleteResponse(i--); |
|
|
|
} while (true); |
|
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
|
|
CSTRING(poA->_className.getString()), | CSTRING(poA->_className.getString()), |
poA->numberResponses())); | poA->numberResponses())); |
| |
// This double loop has 2 purposes: |
// Work backward and delete each response off the end of the array |
// 1. To work backward and delete each response off the end of the array |
CIMResponseData & to = toResponse->getResponseData(); |
// and append each instance to the list of instances of the first |
for (Uint32 i = poA->numberResponses() - 1; i > 0; i--) |
// element in the array. |
|
// 2. fill in host, namespace on all instances on all elements of array |
|
// if they have been left out. This is required because XML reader |
|
// will fail without them populated |
|
|
|
Uint32 i = poA->numberResponses() - 1; |
|
do |
|
{ | { |
CIMAssociatorsResponseMessage* fromResponse = | CIMAssociatorsResponseMessage* fromResponse = |
(CIMAssociatorsResponseMessage*)poA->getResponse(i); | (CIMAssociatorsResponseMessage*)poA->getResponse(i); |
|
CIMResponseData & from = fromResponse->getResponseData(); |
const Array<CIMObject>& cimObjects = |
to.appendResponseData(from); |
fromResponse->getResponseData().getCIMObjects(); |
poA->deleteResponse(i); |
|
|
for (Uint32 j = 0, n = cimObjects.size(); j < n; j++) |
|
{ |
|
const CIMObject& object = cimObjects[j]; |
|
CIMObjectPath& p = const_cast<CIMObjectPath&>(object.getPath()); |
|
|
|
if (p.getHost().size() ==0) |
|
{ |
|
p.setHost(cimAggregationLocalHost); |
|
} |
|
|
|
if (p.getNameSpace().isNull()) |
|
{ |
|
p.setNameSpace(poA->_nameSpace); |
|
} |
|
|
|
// only append if we are not the first response |
|
if (i > 0) |
|
toResponse->getResponseData().getCIMObjects().append(object); |
|
} | } |
|
// fill in host, namespace on all instances on all elements of array |
// only delete if we are not the first response, else we're done |
// if they have been left out. This is required because XML reader |
if (i == 0) |
// will fail without them populated |
break; |
to.completeHostNameAndNamespace(cimAggregationLocalHost,poA->_nameSpace); |
else poA->deleteResponse(i--); |
|
|
|
} while (true); |
|
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
|
|
CSTRING(poA->_className.getString()), | CSTRING(poA->_className.getString()), |
poA->numberResponses())); | poA->numberResponses())); |
| |
// This double loop has 2 purposes: |
// Work backward and delete each response off the end of the array |
// 1. To work backward and delete each response off the end of the array |
CIMResponseData & to = toResponse->getResponseData(); |
// and append each instance to the list of instances of the first |
for (Uint32 i = poA->numberResponses() - 1; i > 0; i--) |
// element in the array. |
|
// 2. fill in host, namespace on all instances on all elements of array |
|
// if they have been left out. This is required because XML reader |
|
// will fail without them populated |
|
|
|
Uint32 i = poA->numberResponses() - 1; |
|
do |
|
{ | { |
CIMReferencesResponseMessage* fromResponse = | CIMReferencesResponseMessage* fromResponse = |
(CIMReferencesResponseMessage*)poA->getResponse(i); | (CIMReferencesResponseMessage*)poA->getResponse(i); |
|
CIMResponseData & from = fromResponse->getResponseData(); |
for (Uint32 j = 0, n = fromResponse->cimObjects.size(); j < n; j++) |
to.appendResponseData(from); |
{ |
poA->deleteResponse(i); |
// Test and complete path if necessary. Required because |
|
// XML not correct without full path. |
|
const CIMObject& object = fromResponse->cimObjects[j]; |
|
CIMObjectPath& p = const_cast<CIMObjectPath&>(object.getPath()); |
|
|
|
if (p.getHost().size() == 0) |
|
p.setHost(cimAggregationLocalHost); |
|
|
|
if (p.getNameSpace().isNull()) |
|
p.setNameSpace(poA->_nameSpace); |
|
|
|
// only append if we are not the first response |
|
if (i > 0) |
|
toResponse->cimObjects.append(object); |
|
} | } |
|
// fill in host, namespace on all instances on all elements of array |
// only delete if we are not the first response, else we're done |
// if they have been left out. This is required because XML reader |
if (i == 0) |
// will fail without them populated |
break; |
to.completeHostNameAndNamespace(cimAggregationLocalHost,poA->_nameSpace); |
else poA->deleteResponse(i--); |
|
|
|
} while (true); |
|
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
|
|
CIMReferenceNamesResponseMessage* toResponse = | CIMReferenceNamesResponseMessage* toResponse = |
(CIMReferenceNamesResponseMessage*) poA->getResponse(0); | (CIMReferenceNamesResponseMessage*) poA->getResponse(0); |
| |
// Work backward and delete each response off the end of the array |
|
// adding it to the toResponse, which is really the first response. |
|
PEG_TRACE(( | PEG_TRACE(( |
TRC_DISPATCHER, | TRC_DISPATCHER, |
Tracer::LEVEL3, | Tracer::LEVEL3, |
|
|
CSTRING(poA->_className.getString()), | CSTRING(poA->_className.getString()), |
poA->numberResponses())); | poA->numberResponses())); |
| |
// This double loop has 2 purposes: |
// Work backward and delete each response off the end of the array |
// 1. To work backward and delete each response off the end of the array |
CIMResponseData & to = toResponse->getResponseData(); |
// and append each instance to the list of instances of the first |
for (Uint32 i = poA->numberResponses() - 1; i > 0; i--) |
// element in the array. |
|
// 2. fill in host, namespace on all instances on all elements of array |
|
// if they have been left out. This is required because XML reader |
|
// will fail without them populated |
|
|
|
Uint32 i = poA->numberResponses() - 1; |
|
do |
|
{ | { |
CIMReferenceNamesResponseMessage* fromResponse = | CIMReferenceNamesResponseMessage* fromResponse = |
(CIMReferenceNamesResponseMessage*)poA->getResponse(i); | (CIMReferenceNamesResponseMessage*)poA->getResponse(i); |
|
CIMResponseData & from = fromResponse->getResponseData(); |
for (Uint32 j = 0, n = fromResponse->objectNames.size(); j < n; j++) |
to.appendResponseData(from); |
{ |
poA->deleteResponse(i); |
CIMObjectPath& p = fromResponse->objectNames[j]; |
|
|
|
if (p.getHost().size() == 0) |
|
p.setHost(cimAggregationLocalHost); |
|
|
|
if (p.getNameSpace().isNull()) |
|
p.setNameSpace(poA->_nameSpace); |
|
|
|
// only append if we are not the first response |
|
if (i > 0) |
|
toResponse->objectNames.append(p); |
|
} | } |
|
// fill in host, namespace on all instances on all elements of array |
// only delete if we are not the first response, else we're done |
// if they have been left out. This is required because XML reader |
if (i == 0) |
// will fail without them populated |
break; |
to.completeHostNameAndNamespace(cimAggregationLocalHost,poA->_nameSpace); |
else poA->deleteResponse(i--); |
|
|
|
} while (true); |
|
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
|
|
poA->numberResponses())); | poA->numberResponses())); |
| |
// Work backward and delete each response off the end of the array | // Work backward and delete each response off the end of the array |
|
CIMResponseData & to = toResponse->getResponseData(); |
for (Uint32 i = poA->numberResponses() - 1; i > 0; i--) | for (Uint32 i = poA->numberResponses() - 1; i > 0; i--) |
{ | { |
CIMEnumerateInstanceNamesResponseMessage* fromResponse = | CIMEnumerateInstanceNamesResponseMessage* fromResponse = |
(CIMEnumerateInstanceNamesResponseMessage*)poA->getResponse(i); | (CIMEnumerateInstanceNamesResponseMessage*)poA->getResponse(i); |
| |
for (Uint32 j = 0; j < fromResponse->instanceNames.size(); j++) |
CIMResponseData & from = fromResponse->getResponseData(); |
{ |
to.appendResponseData(from); |
// Duplicate test goes here if we decide to eliminate dups in |
|
// the future. |
|
toResponse->instanceNames.append(fromResponse->instanceNames[j]); |
|
} |
|
poA->deleteResponse(i); | poA->deleteResponse(i); |
} | } |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
|
|
CIMEnumerateInstancesRequestMessage* request = | CIMEnumerateInstancesRequestMessage* request = |
(CIMEnumerateInstancesRequestMessage*)poA->getRequest(); | (CIMEnumerateInstancesRequestMessage*)poA->getRequest(); |
| |
|
CIMResponseData & to = toResponse->getResponseData(); |
// Work backward and delete each response off the end of the array | // Work backward and delete each response off the end of the array |
for (Uint32 i = poA->numberResponses() - 1; i > 0; i--) | for (Uint32 i = poA->numberResponses() - 1; i > 0; i--) |
{ | { |
CIMEnumerateInstancesResponseMessage* fromResponse = | CIMEnumerateInstancesResponseMessage* fromResponse = |
(CIMEnumerateInstancesResponseMessage*)poA->getResponse(i); | (CIMEnumerateInstancesResponseMessage*)poA->getResponse(i); |
| |
Array<CIMInstance>& from = |
CIMResponseData & from = fromResponse->getResponseData(); |
fromResponse->getResponseData().getNamedInstances(); |
to.appendResponseData(from); |
Array<CIMInstance>& to = |
|
toResponse->getResponseData().getNamedInstances(); |
|
|
|
for (Uint32 j = 0; j < from.size(); j++) |
|
{ |
|
to.append(from[j]); |
|
} |
|
|
|
poA->deleteResponse(i); | poA->deleteResponse(i); |
} | } |
| |