Re: CIMDataTime format when the value is Date type.
Marek Szermutzky <[email protected]>
| Newsgroups | gmane.network.open-pegasus.general |
|---|---|
| Message-ID | <OFC51A3977.F85B6A8A-ONC1257911.0040BC1D-C1257911.00421C39@de.ibm.com> |
If a CIM object (or instance) does have a property of type datetime and the provider does not set it, as well as there is no default value specified for the corresponding class, the returned value for the property should be NULL. Using the OpenPegasus C++ client interface you have to first get the CIMValue from a CIMProperty and check if the value is NULL (by calling isNull() function). That will tell you if the property value is NULL. If you want to explicitly set a property of type datetime to NULL you would do this by creating a null CIMValue object and then setting that on your CIMProperty using the setValue function. There is no way for a server to know from class definition allone if a datetime value actually is a time stamp or interval. That distinction can only be made when you have a specific value (from an instance or object) and thus can check through the separator. Mit freundlichen Grüßen / Kind regards Marek Szermutzky Software Engineer / OpenPegasus Maintainer (PMC) and z/OS PlatformRep. IBM Systems &Technology Group, Systems Software Development / z/OS Capacity Management and Support ------------------------------------------------------------------------------------------------------------------------------------------- IBM Deutschland Schoenaicher Str. 220 71032 Boeblingen Phone: +49-7031-16-5182 E-Mail: [email protected] ------------------------------------------------------------------------------------------------------------------------------------------- IBM Deutschland Research & Development GmbH / Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294 From: "Yaligar, Veeresh S \(USD SRDL\)" <[email protected]> To: "[email protected]" <[email protected]> Date: 16.09.2011 19:43 Subject: CIMDataTime format when the value is Date type. ---------- Hi All As per the documentation of CIMDataTime ( http://www.openpegasus.org/manual/CIMDateTime.html ) any CIM property of CIMDataTime if not initialized will be of value “00000000000000.000000:000” which is of type interval. Now, if a property of a CIM object is required to hold the Date value instead of interval ( for example Manufacture Date) and if that value is not explicitly set then it should have been implicitly set with some null value in the format of Date instead of interval for example “00000000000000.000000+000” or an empty string “”. I guess this would have been the desired behavior. Because one of our client application try to parse the date field and expects it in the Date format. If we are not filling it in the provider then there is no way to get it to the form as “00000000000000.000000+000”. Any thoughts how to handle this use case? Thanks in advance. Veeresh