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

  1 martin 1.6 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.7 //
  3 martin 1.6 // Licensed to The Open Group (TOG) under one or more contributor license
  4            // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
  5            // this work for additional information regarding copyright ownership.
  6            // Each contributor licenses this file to you under the OpenPegasus Open
  7            // Source License; you may not use this file except in compliance with the
  8            // License.
  9 martin 1.7 //
 10 martin 1.6 // Permission is hereby granted, free of charge, to any person obtaining a
 11            // copy of this software and associated documentation files (the "Software"),
 12            // to deal in the Software without restriction, including without limitation
 13            // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 14            // and/or sell copies of the Software, and to permit persons to whom the
 15            // Software is furnished to do so, subject to the following conditions:
 16 martin 1.7 //
 17 martin 1.6 // The above copyright notice and this permission notice shall be included
 18            // in all copies or substantial portions of the Software.
 19 martin 1.7 //
 20 martin 1.6 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.7 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.6 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 23            // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 24            // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 25            // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 26            // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27 martin 1.7 //
 28 martin 1.6 //////////////////////////////////////////////////////////////////////////
 29 schuur 1.1 //
 30            //%/////////////////////////////////////////////////////////////////////////////
 31            
 32            #ifndef Pegasus_QuerySupportRouter_h
 33            #define Pegasus_QuerySupportRouter_h
 34            
 35            #include <Pegasus/Common/Config.h>
 36            #include <Pegasus/Common/String.h>
 37            
 38            #include <Pegasus/Server/CIMOperationRequestDispatcher.h>
 39            
 40            PEGASUS_NAMESPACE_BEGIN
 41            
 42 kumpf  1.5 /**
 43                This class is the basis for encapsulating Query support such that
 44                CIMOperationRequestDispatcher.cpp is not to be changed for adding
 45                new/additional types of query support.
 46            
 47 karl   1.8     The router provides routing of two functions
 48                    - routeHandleExecQueryRequest
 49                    - routeApplyQueryToEnumeration
 50            
 51                where the corresponding functions:
 52                    - handleExecQueryRequest
 53                    - applyQueryToEnumeration
 54            
 55                are specific the the query language.
 56            
 57                New types of query support need to subclass
 58 kumpf  1.5     CIMOperationRequestDispatcher as can be seen in
 59                WQLCIMOperatioRequestDispatcher.
 60            
 61 karl   1.8     The QuerySupportRouter.cpp must be extended to recognize
 62                the new  query language identifier and route the requests to
 63                the appropriate query language processor. The new query
 64                language processor has to be added to the pegserver library.
 65 schuur 1.1 
 66 kumpf  1.5     In addition, ProviderManager2/QueryExpressionFactory.h has to be
 67                extended similarly.
 68 schuur 1.1 */
 69 karl   1.8 
 70            // Define a typedef for the pointer to applyQueryToEnumeration function
 71            typedef void (*applyQueryFunctionPtr)(
 72                               CIMResponseMessage* msg,
 73                               QueryExpressionRep* query);
 74            
 75 kumpf  1.5 class QuerySupportRouter
 76            {
 77            public:
 78 karl   1.9     /**  Handle the ExecQuery request by handing it off to the
 79 karl   1.8         correct handler for the defined query language. The handler validates
 80                    the request and processes it either by doing an enumeration and
 81                    filtering the result or handing it to the provider if the provider has
 82                    query processing capabilities.
 83                    @param opThis
 84                    @param msg CIMExecQueryRequestMessage to be processed
 85 karl   1.9         @param exception CIMException to be completed and retruned if return
 86                    false
 87                    @param enumerationContext pointer to the enumerationContext for
 88                    this operation if it is a pull operation.
 89 karl   1.8         @return true if the query language is supported.
 90                    @exception Exceptions may be generated by the individual handlers
 91            
 92                */
 93 kumpf  1.5     static Boolean routeHandleExecQueryRequest(
 94                    CIMOperationRequestDispatcher* opThis,
 95 karl   1.9         CIMExecQueryRequestMessage* msg,
 96                    CIMException& cimException,
 97                    EnumerationContext* enumerationContext = NULL);
 98 kumpf  1.5 
 99 karl   1.8     /** get pointer to  the correct applyQueryToEnumeration function
100                 *  @param opThis
101                 *  @param query Query ExpressionRep containing query. Used to
102                 *  access query language
103                 *  @return applyQueryToEnumerationPtr pointer to function
104                */
105                static applyQueryFunctionPtr getFunctPtr(
106                   CIMOperationRequestDispatcher* opThis,
107                   QueryExpressionRep* query);
108            };
109 kumpf  1.5 
110 schuur 1.1 
111            PEGASUS_NAMESPACE_END
112            
113            #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2