PEP #: 18
TITLE: Merge-local: Modification of WQL classes to use CIMName
Version : 1.1
Authors: Carol Ann Krug Graves
State: Accepted
Approvals Required: Architecture Team
Type: Design
Created: 3 February 2003
Version History:
Version | Date | Authors | Reason |
1.0 | 3 February 2003 | Carol Ann Krug Graves | Initial proposal |
1.1 | 13 February 2003 | Carol Ann Krug Graves | Updated status |
Abstract: The Pegasus WQL classes currently use String to represent class and property names, but the CIMName class should be used to represent these types of data. Also, currently functions do not exist to test whether all properties were selected, and to return the select or where property list as a CIMPropertyList. This PEP proposes these enhancements, and describes the required changes in Pegasus.
Problem:
The Pegasus WQL classes currently use String to represent class and property names. The CIMName class should be used to represent these types of data. Currently, when all properties are selected in the query ("SELECT * FROM ..."), the WQL parser appends a property '*' to the list of select properties in the WQLSelectStatement object. Since '*' cannot be a valid CIM property name, this behavior is not ideal. Also, currently callers must get properties from the select list or the where clause one at a time. It would be more convenient to have additional functions that return a CIMPropertyList containing all the properties.
Solution:
This PEP proposes modification of the Pegasus WQL classes to use CIMName to represent class and property names, and additional functions in the WQLSelectStatement class to test whether all properties were selected ("SELECT * FROM ..."), and to return the select or where property list as a CIMPropertyList, as well as accompanying test cases. This proposal would require changes to the Pegasus WQL parser, sources, and tests to use CIMName for class and property names, to add the new functions, and to add new test cases. The IndicationService would also be modified to use the new WQL functions.
The proposed new functions in the WQLSelectStatement class are as follows:
/** Returns true if the query selects all properties ("*") */ Boolean getAllProperties() const; /** Used by the parser to indicate the query selects all properties ("*") This method should not be called by the user (only by the parser). */ void setAllProperties(const Boolean allProperties); /** Returns a CIMPropertyList containing the selected properties. The list is NULL if the query selects all properties (SELECT * FROM...). */ const CIMPropertyList getSelectPropertyList() const; /** Returns a CIMPropertyList containing the unique properties used in the WHERE clause */ const CIMPropertyList getWherePropertyList() const;
Schedule:
Action | Planned | Actual | Comment |
PEP Submitted | 3 February 2003 | 3 February 2003 | |
PEP Reviewed | 7 February 2003 | 7 February 2003 | |
PEP Approved | 7 February 2003 | 11 February 2003 | |
Code Committed | 14 February 2003 | 12 February 2003 |
Addendum:
This change has been implemented and submitted to the "local" branch. Following is the original COMMIT message associated with the submittal.
From: "Carol Ann Krug Graves"Date: Mon, 27 Jan 2003 15:10:11 -0800 Subject: COMMIT-local: WQL classes modified to use CIMName This change affects only the Pegasus "local" branch. The WQL classes have been modified to use CIMName where appropriate (instead of String). New functions have been added to get the select and where property lists, and to test if all properties were selected ("SELECT * FROM ..."). New test cases were added. Modified Files: pegasus/src/Pegasus/IndicationService/IndicationService.cpp pegasus/src/Pegasus/WQL/WQL.y pegasus/src/Pegasus/WQL/WQLParserState.h pegasus/src/Pegasus/WQL/WQLPropertySource.h pegasus/src/Pegasus/WQL/WQLSelectStatement.cpp pegasus/src/Pegasus/WQL/WQLSelectStatement.h pegasus/src/Pegasus/WQL/WQLSimplePropertySource.h pegasus/src/Pegasus/WQL/WQLYACC.cpp pegasus/src/Pegasus/WQL/tests/Parser/Parser.cpp pegasus/src/Pegasus/WQL/tests/ParserCLI/ParserCLI.cpp The changes have been tested successfully on HP-UX and Windows. Please let me know if you have any questions or problems related to these changes. Thanks, Carol Ann -- Carol Ann Krug Graves carolann.graves@hp.com Hewlett-Packard Company 408-447-5208