1 chuck 1.1.2.8 //%2003////////////////////////////////////////////////////////////////////////
|
2 chuck 1.1.2.5 //
3 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Development
4 // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.
|
5 chuck 1.1.2.9 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
|
6 chuck 1.1.2.5 // IBM Corp.; EMC Corporation, The Open Group.
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to
10 // deal in the Software without restriction, including without limitation the
11 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 // sell copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
16 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
17 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
18 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 //
24 //==============================================================================
25 //
26 // Authors: David Rosckes (rosckes@us.ibm.com)
27 chuck 1.1.2.5 // Bert Rivero (hurivero@us.ibm.com)
28 // Chuck Carmack (carmack@us.ibm.com)
29 // Brian Lucier (lucier@us.ibm.com)
30 //
31 // Modified By:
32 //
33 //%/////////////////////////////////////////////////////////////////////////////
34
|
35 humberto 1.1.2.2 #ifndef Pegasus_CQLSelectStatement_h
36 #define Pegasus_CQLSelectStatement_h
|
37 humberto 1.1.2.1
38 #include <Pegasus/Common/Config.h>
|
39 chuck 1.1.2.10 #include <Pegasus/Common/AutoPtr.h>
|
40 humberto 1.1.2.2 #include <Pegasus/CQL/SelectStatement.h>
41 #include <Pegasus/CQL/CQLChainedIdentifier.h>
|
42 humberto 1.1.2.1 #include <Pegasus/CQL/CQLIdentifier.h>
43 #include <Pegasus/CQL/Linkage.h>
44
45
|
46 humberto 1.1.2.2 PEGASUS_NAMESPACE_BEGIN
47
|
48 humberto 1.1.2.3 class PEGASUS_CQL_LINKAGE CQLSelectStatementRep;
49
|
50 humberto 1.1.2.2 /**
51 This class is derived from the SelectStatement base class.
52 The purpose of this class is to perform the select statement operations for
53 CIM Query Language (CQL).
54
55 Notes on CQLSelectStatement class:
56
57 (A) Contains a CQLPredicate for the WHERE clause
58 (B) Contains an array of CQLIdentifiers for the SELECT projection
59 (C) Contains an array of classpaths from the FROM clause
60
61
62 */
63 class PEGASUS_CQL_LINKAGE CQLSelectStatement : public SelectStatement
64 {
65 public:
|
66 humberto 1.1.2.4 CQLSelectStatement();
|
67 humberto 1.1.2.3
|
68 humberto 1.1.2.2 /** This is the constructor for the CQLSelectStatement object.
69 The ctor requires 3 parameters:
70 query language (qlang) which is CQL,
71 the query itself,
72 and the name of the CIM namespace.
73 */
74 CQLSelectStatement(
75 /** The query language is needed so the
76 base class can retrieve the query language.
77 The class member variable where this data
78 is stored is located in the base SelectStatement
79 class.
80 */
|
81 chuck 1.1.2.5 String& inQlang,
|
82 humberto 1.1.2.2 /** input parameter containing the query string.
83 */
|
84 chuck 1.1.2.5 String& inQuery,
|
85 humberto 1.1.2.2
|
86 chuck 1.1.2.10 QueryContext& inCtx);
|
87 humberto 1.1.2.2
|
88 chuck 1.1.2.5 CQLSelectStatement(const CQLSelectStatement& statement);
|
89 humberto 1.1.2.4
|
90 chuck 1.1.2.5 ~CQLSelectStatement();
91
92 CQLSelectStatement& operator=(const CQLSelectStatement& rhs);
|
93 humberto 1.1.2.3
|
94 humberto 1.1.2.2 /** Implements the evaluate method from the
95 base SelectStatement class.
96
97 */
98 Boolean evaluate(
99 /** The CIM instance that will be evaluated.
100 The CIMInstance object is not modified by this method.
101 */
|
102 chuck 1.1.2.5 const CIMInstance& inCI);
|
103 humberto 1.1.2.2
104 /** Implements the applyProjection method from the
105 base SelectStatement class.
106 */
|
107 chuck 1.1.2.5 void applyProjection(
|
108 humberto 1.1.2.2 /** Input the CIMInstance object in which to apply the
109 projection.
110 */
|
111 chuck 1.1.2.5 CIMInstance& inCI) throw(Exception);
|
112 humberto 1.1.2.2
113 /** Implements the validatedClass method from the
114 base SelectStatement class.
115 */
116 void validateClass(const CIMObjectPath& inClassName) throw(Exception);
117
118 /** Implements the validatedProperties method from the
119 base SelectStatement class.
120 */
121 void validateProperties() throw(Exception);
122
123 /** Returns an array of CIMObjectPath objects that are the
124 class paths from the select statement in the FROM list.
125 */
|
126 chuck 1.1.2.5 Array<CIMObjectPath> getClassPathList();
|
127 humberto 1.1.2.2
128 /** Returns the required properties from the combined SELECT and WHERE
129 clauses for the classname passed in.
130
131 If all the properties for the input classname are required, a null
132 CIMPropertyList is returned.
133 */
134 CIMPropertyList getPropertyList(
135 /** The input parameter className is one of the
136 classes from the FROM list.
137 */
|
138 chuck 1.1.2.12 const CIMObjectPath& inClassName = CIMObjectPath());
|
139 humberto 1.1.2.2
|
140 chuck 1.1.2.14 CIMPropertyList getSelectPropertyList(
141 const CIMObjectPath& inClassName = CIMObjectPath());
142
143 CIMPropertyList getWherePropertyList(
144 const CIMObjectPath& inClassName = CIMObjectPath());
145
|
146 chuck 1.1.2.15 Array<CQLChainedIdentifier> getSelectChainedIdentifiers();
147
148 Array<CQLChainedIdentifier> getWhereChainedIdentifiers();
149
|
150 humberto 1.1.2.2 /** Modifier. This method should not be called by the user (only by the
151 parser).
152 Appends a CQLIdentifier to an array of CIMObjectPaths from the FROM
153 statement.
154 */
155 void appendClassPath(
156 /**
157 */
158 const CQLIdentifier& inIdentifier);
159
160 /** Sets a predicate into this object. This method should only
161 be called by Bison.
162 */
|
163 chuck 1.1.2.16 void setPredicate(const CQLPredicate& inPredicate);
164
165 /** Gets the top-level predicate contained by this object */
166 CQLPredicate getPredicate() const;
|
167 humberto 1.1.2.2
168 /** This method calls QueryContext::insertClassPathAlias() to insert a
169 classpath-alias pair
170 into the hash table. The record is keyed by the class alias.
171
172 This method is used by Bison.
173
174 TODO: think about exceptions such as duplicate key.
175 */
176 void insertClassPathAlias(
177 /** The CQLIdentifier object that contains the class path.
178 */
179 const CQLIdentifier& inIdentifier,
180 /** The alias for the class.
181 */
182 String inAlias);
183
184 /** Appends a CQL chained identifier to the CQL identifier list. The user
185 should
186 not call this method; it should only be called by the Bison.
187 */
188 humberto 1.1.2.2 void appendSelectIdentifier(const CQLChainedIdentifier& x);
189
|
190 chuck 1.1.2.7 /**
191 Applies the class contexts from the FROM list to the identifiers
192 in the statement.
193 */
194 void applyContext();
195
196 /**
197 Normalizes the WHERE clause to disjunction of conjunctions.
198 */
199 void normalizeToDOC();
|
200 chuck 1.1.2.6
201 void setHasWhereClause();
202
203 Boolean hasWhereClause();
204
|
205 chuck 1.1.2.7 String toString();
206
|
207 chuck 1.1.2.6 void clear();
208
|
209 humberto 1.1.2.2 private:
|
210 humberto 1.1.2.3 CQLSelectStatementRep* _rep;
|
211 humberto 1.1.2.2
212 };
213
214 PEGASUS_NAMESPACE_END
215
216 #endif
|