version 1.56, 2009/12/15 11:39:39
|
version 1.56.4.1, 2011/10/11 18:18:23
|
|
|
case SCMO_OK: | case SCMO_OK: |
{ | { |
CMPIType ct=type2CMPIType(type, isArray); | CMPIType ct=type2CMPIType(type, isArray); |
CMPISCMOUtilities::scmoValue2CMPIData( value, ct, &data ); |
CMPISCMOUtilities::scmoValue2CMPIData(value, ct, &data, size); |
if ((ct&~CMPI_ARRAY) == CMPI_string) | if ((ct&~CMPI_ARRAY) == CMPI_string) |
{ | { |
// We always receive strings as an array of pointers | // We always receive strings as an array of pointers |
|
|
{ | { |
case SCMO_NOT_FOUND: | case SCMO_NOT_FOUND: |
{ | { |
|
data.state = CMPI_nullValue | CMPI_notFound; |
CMSetStatus(rc, CMPI_RC_ERR_NO_SUCH_PROPERTY); | CMSetStatus(rc, CMPI_RC_ERR_NO_SUCH_PROPERTY); |
return data; | return data; |
} | } |
|
|
{ | { |
// A NullValue does not indicate an error, but simply that | // A NullValue does not indicate an error, but simply that |
// no value has been set for the property. | // no value has been set for the property. |
|
|
// TBD: Though the CMPI specification mandates to return a |
|
// nullvalue when a property exists on an instance but has |
|
// not yet been assigned a value, for compatibility with |
|
// previous versions we return CMPI_RC_ERR_NO_SUCH_PROPERTY |
|
// in this case. |
|
// If SCMO would distinguish between nullvalues and values |
|
// that have not been set at all on an instance, we could |
|
// be more precise here. |
|
/* |
|
// Correct code for nullvalues |
|
data.type = type2CMPIType(type, isArray); | data.type = type2CMPIType(type, isArray); |
data.state = CMPI_nullValue; |
|
data.value.uint64 = 0; | data.value.uint64 = 0; |
*/ |
data.state = CMPI_nullValue; |
// Code for properties that have not been set |
CMSetStatus(rc, CMPI_RC_OK); |
CMSetStatus(rc, CMPI_RC_ERR_NO_SUCH_PROPERTY); |
|
return data; | return data; |
|
|
} | } |
break; | break; |
| |
|
|
if (!(type&CMPI_ARRAY)) | if (!(type&CMPI_ARRAY)) |
{ | { |
CIMType cimType=type2CIMType(type); | CIMType cimType=type2CIMType(type); |
SCMBUnion scmoData = value2SCMOValue(data, type); |
Boolean nullValue = false; |
|
SCMBUnion scmoData = value2SCMOValue(data, type, nullValue); |
| |
rc = inst->setPropertyWithOrigin(name, | rc = inst->setPropertyWithOrigin(name, |
cimType, | cimType, |
&scmoData, |
nullValue ? 0 : &scmoData, |
false, // isArray | false, // isArray |
0, // arraySize | 0, // arraySize |
origin); | origin); |
|
|
{ | { |
scmbArray=&(scmbArrayBuf[0]); | scmbArray=&(scmbArrayBuf[0]); |
} | } |
|
Boolean nullValue = false; |
for (unsigned int x=0; x<arraySize; x++) | for (unsigned int x=0; x<arraySize; x++) |
{ | { |
// Note: First element is the array status information, | // Note: First element is the array status information, |
// therefore cmpi array starts at index 1!!! | // therefore cmpi array starts at index 1!!! |
scmbArray[x] = value2SCMOValue( | scmbArray[x] = value2SCMOValue( |
&(arrData[x+1].value), | &(arrData[x+1].value), |
arrData[x+1].type); |
arrData[x+1].type, |
|
nullValue); |
} | } |
| |
rc = inst->setPropertyWithOrigin( | rc = inst->setPropertyWithOrigin( |
|
|
TRC_CMPIPROVIDERINTERFACE, | TRC_CMPIPROVIDERINTERFACE, |
"CMPI_Instance:instSetPropertyFilter()"); | "CMPI_Instance:instSetPropertyFilter()"); |
| |
if (!eInst->hdl) |
|
{ |
|
PEG_METHOD_EXIT(); |
|
CMReturn(CMPI_RC_ERR_INVALID_HANDLE); |
|
} |
|
/* The property list is to be applied on the given instance. |
|
Currently CMPI provider have to call instSetPropertyFilter to honor |
|
property filters or have to filter for themselves. |
|
Removing properties from the SCMOInstance here helps to effectively |
|
avoid the need to carry a property list around in the CMPI layer. |
|
|
|
A (propertyList == 0) means the property list is null and there |
|
should be no filtering. |
|
|
|
An empty propertylist(no property to be returned) is represented by |
|
a valid propertyList pointer pointing to a null pointer, i.e. |
|
(*propertyList == 0) |
|
*/ |
|
|
|
SCMOInstance* inst=(SCMOInstance*)eInst->hdl; | SCMOInstance* inst=(SCMOInstance*)eInst->hdl; |
inst->setPropertyFilter(propertyList); |
|
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
|
if (inst==NULL) |
|
{ |
|
CMReturn(CMPI_RC_ERR_INVALID_HANDLE); |
|
} |
|
//Property filtering is done by the CIMOM infrastructure. |
CMReturn(CMPI_RC_OK); | CMReturn(CMPI_RC_OK); |
} | } |
| |