(file) Return to QueryExpression.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Query / QueryExpression

  1 karl  1.5 //%2006////////////////////////////////////////////////////////////////////////
  2 chuck 1.1 //
  3 karl  1.2 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
  4           // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
  5           // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
  6 chuck 1.1 // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.2 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
  8           // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
  9           // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10           // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 karl  1.5 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12           // EMC Corporation; Symantec Corporation; The Open Group.
 13 chuck 1.1 //
 14           // Permission is hereby granted, free of charge, to any person obtaining a copy
 15           // of this software and associated documentation files (the "Software"), to
 16           // deal in the Software without restriction, including without limitation the
 17           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 18           // sell copies of the Software, and to permit persons to whom the Software is
 19           // furnished to do so, subject to the following conditions:
 20 karl  1.5 // 
 21 chuck 1.1 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 22           // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 23           // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 24           // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 25           // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 26           // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 27           // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 28           // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 29           //
 30           //==============================================================================
 31           //
 32           // Author: Humberto Rivero (hurivero@us.ibm.com)
 33           //
 34 david.dillard 1.4 // Modified By: David Dillard, VERITAS Software Corp.
 35                   //                  (david.dillard@veritas.com)
 36 chuck         1.1 //
 37                   //%/////////////////////////////////////////////////////////////////////////////
 38                   
 39                   #ifndef Pegasus_QueryExpression_h
 40                   #define Pegasus_QueryExpression_h
 41                   
 42                   #include <Pegasus/Query/QueryExpression/Linkage.h>
 43                   #include <Pegasus/Common/Config.h>
 44                   #include <Pegasus/Common/String.h>
 45                   #include <Pegasus/Common/CIMInstance.h>
 46                   #include <Pegasus/Common/CIMPropertyList.h>
 47                   #include <Pegasus/Query/QueryCommon/QueryContext.h>
 48                   #include <Pegasus/Query/QueryCommon/SelectStatement.h>
 49                   
 50                   PEGASUS_NAMESPACE_BEGIN
 51                   
 52                   /** This class gives access to the particulars of a query expression.*/
 53                   
 54                   
 55                   class SelectStatement;
 56                   
 57 chuck         1.1 class PEGASUS_QUERYEXPRESSION_LINKAGE QueryExpression {
 58                       public:
 59                   
 60                     /**
 61                        Constructor
 62                        Note: this object will throw exceptions when it is used after
 63                        default construction.
 64                      */
 65                     QueryExpression();
 66                   
 67                      /**
 68                       Constructor.
 69                       At the moment the constructor only accepts WQL style Select statements.
 70                       The constructor is normally called by the Provider Manager.
 71                   
 72                       @param language contains the query language type, "WQL" is supported.
 73                       @param query contains a WQL style select statement
 74                     */
 75 david.dillard 1.4 
 76 chuck         1.1     QueryExpression(String queryLang, String query, QueryContext& ctx);
 77                   
 78                       QueryExpression(String queryLang, String query);
 79                   
 80                       QueryExpression(const QueryExpression& expr);
 81                   
 82                       /**
 83                       Destructor.
 84                       The destructor normally only called by the Provider Manager.
 85                       */
 86                       ~QueryExpression();
 87                   
 88                       /**
 89                       Operator =
 90                       */
 91                       QueryExpression operator=(const QueryExpression& rhs);
 92                   
 93                      /**
 94                       \Label{getQueryLanguage}
 95                       Returns the query language identifier.
 96                       @return A String instance containing the query language identifier.
 97 chuck         1.1     */
 98                       String getQueryLanguage() const;
 99                   
100                       /**
101                       \Label{getQuery}
102                       Returns the query select statement.
103                       @return A String instance containing the query select statement.
104                       */
105                       String getQuery() const;
106                   
107                       /**
108                       \Label{evaluate}
109                       Returns true if the instance passes where clause evaluation successfully.
110                   
111                       @param inst the instance to be evaluated.
112                       @return A Boolean indicating result of evaluation.
113                       */
114                       Boolean evaluate(const CIMInstance& inst) const;
115                   
116                       /**
117                       \Label{getPropertyList}
118 chuck         1.1     Returns the select clause projection specification as CIMPropertyList
119                       A NULL CIMPropertyList is returned when all properties are to be returned.
120                       @return A CIMPropertylist instance containing the select clause projection specification.
121                       */
122                       CIMPropertyList getPropertyList(const CIMObjectPath& objectPath = CIMObjectPath()) const;
123                   
124 carolann.graves 1.3     /**
125                             Returns the required properties from the SELECT clause for the specified
126                             class.
127                     
128                             @param  objectPath  the class; must be one of the classes from the FROM
129                                                 clause
130                     
131                             @return  CIMPropertyList containing the required properties from the
132                                      SELECT clause for the specified class;
133                                      or a null CIMPropertyList if all properties of the specified
134                                      class are required
135                         */
136 david.dillard   1.4     CIMPropertyList getSelectPropertyList
137 carolann.graves 1.3         (const CIMObjectPath& objectPath = CIMObjectPath ()) const;
138                     
139                         /**
140                             Returns the required properties from the WHERE clause for the specified
141                             class.
142                     
143                             @param  objectPath  the class; must be one of the classes from the FROM
144                                                 clause
145                     
146                             @return  CIMPropertyList containing the required properties from the
147                                      WHERE clause for the specified class;
148                                      or a null CIMPropertyList if all properties of the specified
149                                      class are required
150                         */
151 david.dillard   1.4     CIMPropertyList getWherePropertyList
152 carolann.graves 1.3         (const CIMObjectPath& objectPath = CIMObjectPath ()) const;
153                     
154 david.dillard   1.4     void applyProjection(CIMInstance instance,
155 carolann.graves 1.3         Boolean allowMissing);
156 chuck           1.1 
157                         void validate();
158                     
159                         Array<CIMObjectPath> getClassPathList()const;
160                     
161                         SelectStatement* getSelectStatement();
162                     
163 david.dillard   1.4     void setQueryContext(QueryContext& inCtx);
164 chuck           1.1 
165                       private:
166                         SelectStatement *_ss;
167                         String _queryLang;
168                     };
169                     
170                     PEGASUS_NAMESPACE_END
171                     
172                     #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2