version 1.12, 2004/08/18 18:28:05
|
version 1.13, 2004/08/19 04:17:04
|
|
|
*/ | */ |
| |
// ATTN: this section of code replaces the section above so that only properties specified by the provider are | // ATTN: this section of code replaces the section above so that only properties specified by the provider are |
// returned. properties not in the reference instance are implicitly dropped. |
// returned. properties in the reference instance and not in the specified instance are implicitly dropped |
| |
// apply ONLY specified instance properties | // apply ONLY specified instance properties |
for(Uint32 i = 0, n = cimInstance.getPropertyCount(); i < n; i++) | for(Uint32 i = 0, n = cimInstance.getPropertyCount(); i < n; i++) |
|
|
| |
if(pos == PEG_NOT_FOUND) | if(pos == PEG_NOT_FOUND) |
{ | { |
// throw invalid property |
Tracer::trace( |
|
TRC_OBJECTRESOLUTION, Tracer::LEVEL4, |
|
"invalid property %s", |
|
(const char *)cimProperty.getName().getString().getCString()); |
|
|
|
throw CIMException(CIM_ERR_NO_SUCH_PROPERTY); |
} | } |
| |
// ATTN: convert const property to non const | // ATTN: convert const property to non const |
|
|
newInstance.addProperty(_resolveProperty(referenceProperty, cimProperty, includeQualifiers, includeClassOrigin)); | newInstance.addProperty(_resolveProperty(referenceProperty, cimProperty, includeQualifiers, includeClassOrigin)); |
} | } |
| |
// simple propgate the object's path |
// use the object path in the instance, if it exists |
newInstance.setPath(cimInstance.getPath()); |
if(cimInstance.getPath().getKeyBindings().size() != 0) |
|
{ |
|
// udpate object path |
|
CIMObjectPath path = newInstance.getPath(); |
|
|
|
// assume the specified instance has the correct keys |
|
path.setKeyBindings(cimInstance.getPath().getKeyBindings()); |
|
|
|
newInstance.setPath(path); |
|
} |
|
else |
|
{ |
|
// ATTN: this is just an ATTEMPT to update the object path. depending on the request parameters, |
|
// all the key properties may not be present. only present keys are updated, missing keys assume |
|
// the default value for the property type (e.g., String(), Uint32(0), etc.) |
| |
/* |
|
// update keys | // update keys |
Array<CIMKeyBinding> keys = referenceInstance.getPath().getKeyBindings(); | Array<CIMKeyBinding> keys = referenceInstance.getPath().getKeyBindings(); |
| |
|
|
{ | { |
Uint32 pos = newInstance.findProperty(keys[i].getName()); | Uint32 pos = newInstance.findProperty(keys[i].getName()); |
| |
if(pos == PEG_NOT_FOUND) |
if(pos != PEG_NOT_FOUND) |
{ | { |
// throw missing key. it must be present to create a valid object path |
|
} |
|
|
|
CIMValue value = newInstance.getProperty(pos).getValue(); | CIMValue value = newInstance.getProperty(pos).getValue(); |
|
|
// ATTN: check type | // ATTN: check type |
| |
keys[i].setValue(value.toString()); | keys[i].setValue(value.toString()); |
} | } |
|
} |
| |
// udpate object path | // udpate object path |
CIMObjectPath path = newInstance.getPath(); | CIMObjectPath path = newInstance.getPath(); |
|
|
path.setKeyBindings(keys); | path.setKeyBindings(keys); |
| |
newInstance.setPath(path); | newInstance.setPath(path); |
*/ |
} |
| |
return(newInstance); | return(newInstance); |
} | } |
|
|
| |
Tracer::trace( | Tracer::trace( |
TRC_OBJECTRESOLUTION, Tracer::LEVEL4, | TRC_OBJECTRESOLUTION, Tracer::LEVEL4, |
"adding qualifier %s", |
"adding reference qualifier %s", |
(const char *)referenceQualifier.getName().getString().getCString()); | (const char *)referenceQualifier.getName().getString().getCString()); |
| |
referenceInstance.addQualifier(referenceQualifier); | referenceInstance.addQualifier(referenceQualifier); |
|
|
{ | { |
CIMProperty referenceProperty = referenceClass.getProperty(i).clone(); | CIMProperty referenceProperty = referenceClass.getProperty(i).clone(); |
| |
|
Tracer::trace( |
|
TRC_OBJECTRESOLUTION, Tracer::LEVEL4, |
|
"adding reference property %s", |
|
(const char *)referenceProperty.getName().getString().getCString()); |
|
|
// the propagated value only applies to class properties, not instances. set it to false. | // the propagated value only applies to class properties, not instances. set it to false. |
referenceProperty.setPropagated(false); | referenceProperty.setPropagated(false); |
| |