version 1.11, 2005/04/23 13:00:20
|
version 1.12, 2005/05/03 21:13:49
|
|
|
PEGASUS_UNREACHABLE( return true; ) //should never get here | PEGASUS_UNREACHABLE( return true; ) //should never get here |
} | } |
| |
void CQLSelectStatementRep::applyProjection(CIMInstance& inCI) throw(Exception) |
void CQLSelectStatementRep::applyProjection(CIMInstance& inCI, |
|
Boolean allowMissing) throw(Exception) |
{ | { |
PEG_METHOD_ENTER (TRC_CQL, "CQLSelectStatementRep::applyProjection(inCI)"); | PEG_METHOD_ENTER (TRC_CQL, "CQLSelectStatementRep::applyProjection(inCI)"); |
| |
|
|
// will not remove properties when filtering the embedded instance. | // will not remove properties when filtering the embedded instance. |
// This call returns whether the embedded instance property | // This call returns whether the embedded instance property |
// should be added to the required property list. | // should be added to the required property list. |
childRequired = applyProjection(childNode, childProp, allPropsRequired); |
childRequired = applyProjection(childNode, childProp, allPropsRequired, |
|
allowMissing); |
inCI.addProperty(childProp); | inCI.addProperty(childProp); |
} | } |
} | } |
|
|
allPropsRequired, | allPropsRequired, |
fromList[0].getName(), | fromList[0].getName(), |
requiredProps, | requiredProps, |
preserve); |
preserve, |
|
allowMissing); |
} | } |
| |
Boolean CQLSelectStatementRep::applyProjection(PropertyNode* node, | Boolean CQLSelectStatementRep::applyProjection(PropertyNode* node, |
CIMProperty& nodeProp, | CIMProperty& nodeProp, |
Boolean& preservePropsForParent) |
Boolean& preservePropsForParent, |
|
Boolean allowMissing) |
{ | { |
PEG_METHOD_ENTER (TRC_CQL, "CQLSelectStatementRep::applyProjection(node, nodeProp)"); | PEG_METHOD_ENTER (TRC_CQL, "CQLSelectStatementRep::applyProjection(node, nodeProp)"); |
| |
|
|
// should be added to the required property list. | // should be added to the required property list. |
Boolean preserve = | Boolean preserve = |
node->endpoint || allPropsRequired || preservePropsForParent; | node->endpoint || allPropsRequired || preservePropsForParent; |
childRequired = applyProjection(curChild, childProp, preserve); |
childRequired = applyProjection(curChild, childProp, preserve, |
|
allowMissing); |
nodeInst.addProperty(childProp); | nodeInst.addProperty(childProp); |
} | } |
} | } |
|
|
allPropsRequired, | allPropsRequired, |
nodeInst.getClassName(), | nodeInst.getClassName(), |
requiredProps, | requiredProps, |
preserveProps); |
preserveProps, |
|
allowMissing); |
| |
// Put the projected instance back into the property. | // Put the projected instance back into the property. |
CIMObject newNodeObj(nodeInst); | CIMObject newNodeObj(nodeInst); |
|
|
Boolean& allPropsRequired, | Boolean& allPropsRequired, |
const CIMName& allPropsClass, | const CIMName& allPropsClass, |
Array<CIMName>& requiredProps, | Array<CIMName>& requiredProps, |
Boolean& preserveProps) |
Boolean& preserveProps, |
|
Boolean allowMissing) |
{ | { |
PEG_METHOD_ENTER (TRC_CQL, "CQLSelectStatementRep::removeUnneededProperties"); |
PEG_METHOD_ENTER (TRC_CQL, "CQLSelectStatementRep::filterInstance"); |
PEG_TRACE_STRING (TRC_CQL, Tracer::LEVEL4,"instance = " + inst.getClassName().getString()); | PEG_TRACE_STRING (TRC_CQL, Tracer::LEVEL4,"instance = " + inst.getClassName().getString()); |
PEG_TRACE_STRING (TRC_CQL, Tracer::LEVEL4,"allPropsClass = " + allPropsClass.getString()); | PEG_TRACE_STRING (TRC_CQL, Tracer::LEVEL4,"allPropsClass = " + allPropsClass.getString()); |
| |
|
|
} | } |
| |
// Check that all required properties are on the instance. | // Check that all required properties are on the instance. |
|
if (!allowMissing) |
|
{ |
for (Uint32 i = 0; i < requiredProps.size(); i++) | for (Uint32 i = 0; i < requiredProps.size(); i++) |
{ | { |
if (!containsProperty(requiredProps[i], supportedProps)) | if (!containsProperty(requiredProps[i], supportedProps)) |
{ | { |
PEG_TRACE_STRING (TRC_CQL, Tracer::LEVEL4,"missing:" + requiredProps[i].getString()); |
PEG_TRACE_STRING (TRC_CQL, Tracer::LEVEL4,"missing:" + |
|
requiredProps[i].getString()); |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
MessageLoaderParms parms("CQL.CQLSelectStatementRep.PROJ_MISSING_PROP", |
MessageLoaderParms parms |
|
("CQL.CQLSelectStatementRep.PROJ_MISSING_PROP", |
"The property $0 is missing on the instance of class $1.", | "The property $0 is missing on the instance of class $1.", |
requiredProps[i].getString(), inst.getClassName().getString()); |
requiredProps[i].getString(), |
|
inst.getClassName().getString()); |
throw QueryRuntimePropertyException(parms); | throw QueryRuntimePropertyException(parms); |
} | } |
} | } |
|
} |
| |
// If requested, remove the properties on the instance that are not required. | // If requested, remove the properties on the instance that are not required. |
if (!preserveProps) | if (!preserveProps) |