(file) Return to ProviderMessageHandler.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ProviderManager2 / Default

  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 kumpf  1.1 //
 30            //%/////////////////////////////////////////////////////////////////////////////
 31            
 32            #ifndef Pegasus_ProviderMessageHandler_h
 33            #define Pegasus_ProviderMessageHandler_h
 34            
 35            #include <Pegasus/Common/Config.h>
 36            #include <Pegasus/Common/CIMMessage.h>
 37            #include <Pegasus/Provider/CIMProvider.h>
 38            #include <Pegasus/ProviderManager2/OperationResponseHandler.h>
 39            #include <Pegasus/ProviderManager2/Default/ProviderStatus.h>
 40            #include <Pegasus/ProviderManager2/Default/Linkage.h>
 41            
 42            PEGASUS_NAMESPACE_BEGIN
 43            
 44            class PEGASUS_DEFPM_LINKAGE ProviderMessageHandler
 45            {
 46            public:
 47                ProviderMessageHandler(
 48 dmitry.mikulin 1.5         const String& moduleName,
 49 kumpf          1.1         const String& name,
 50                            CIMProvider* provider,
 51                            PEGASUS_INDICATION_CALLBACK_T indicationCallback,
 52                            PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback,
 53                            Boolean subscriptionInitComplete);
 54                    
 55                        virtual ~ProviderMessageHandler();
 56                    
 57                        String getName() const;
 58 kumpf          1.4     CIMProvider* getProvider();
 59 kumpf          1.1     void setProvider(CIMProvider* provider);
 60                        void initialize(CIMOMHandle& cimom);
 61                        void terminate();
 62                        void subscriptionInitComplete();
 63 venkat.puvvada 1.8     void indicationServiceDisabled();
 64 kumpf          1.1 
 65                        CIMResponseMessage* processMessage(CIMRequestMessage* request);
 66                    
 67                    private:
 68 kumpf          1.3     OperationContext _createProviderOperationContext(
 69                            const OperationContext& context);
 70                    
 71 kumpf          1.1     CIMResponseMessage* _handleGetInstanceRequest(
 72                            CIMRequestMessage* message);
 73                        CIMResponseMessage* _handleEnumerateInstancesRequest(
 74                            CIMRequestMessage* message);
 75                        CIMResponseMessage* _handleEnumerateInstanceNamesRequest(
 76                            CIMRequestMessage* message);
 77                        CIMResponseMessage* _handleCreateInstanceRequest(
 78                            CIMRequestMessage* message);
 79                        CIMResponseMessage* _handleModifyInstanceRequest(
 80                            CIMRequestMessage* message);
 81                        CIMResponseMessage* _handleDeleteInstanceRequest(
 82                            CIMRequestMessage* message);
 83                    
 84                        CIMResponseMessage* _handleExecQueryRequest(
 85                            CIMRequestMessage* message);
 86                    
 87                        CIMResponseMessage* _handleAssociatorsRequest(
 88                            CIMRequestMessage* message);
 89                        CIMResponseMessage* _handleAssociatorNamesRequest(
 90                            CIMRequestMessage* message);
 91                        CIMResponseMessage* _handleReferencesRequest(
 92 kumpf          1.1         CIMRequestMessage* message);
 93                        CIMResponseMessage* _handleReferenceNamesRequest(
 94                            CIMRequestMessage* message);
 95                    
 96                        CIMResponseMessage* _handleGetPropertyRequest(
 97                            CIMRequestMessage* message);
 98                        CIMResponseMessage* _handleSetPropertyRequest(
 99                            CIMRequestMessage* message);
100                    
101                        CIMResponseMessage* _handleInvokeMethodRequest(
102                            CIMRequestMessage* message);
103                    
104                        CIMResponseMessage* _handleCreateSubscriptionRequest(
105                            CIMRequestMessage* message);
106                        CIMResponseMessage* _handleModifySubscriptionRequest(
107                            CIMRequestMessage* message);
108                        CIMResponseMessage* _handleDeleteSubscriptionRequest(
109                            CIMRequestMessage* message);
110                    
111                        CIMResponseMessage* _handleExportIndicationRequest(
112                            CIMRequestMessage* message);
113 kumpf          1.1 
114                        /**
115                            Calls the provider's enableIndications() method.
116                            If successful, the indications response handler is stored in
117                            _indicationResponseHandler.
118                    
119                            Note that since an exception thrown by the provider's
120                            enableIndications() method is considered a provider error, any such
121                            exception is logged and not propagated by this method.
122                         */
123                        void _enableIndications();
124                    
125                        void _disableIndications();
126                    
127                        String _name;
128 dmitry.mikulin 1.5     String _fullyQualifiedProviderName;
129 kumpf          1.1     CIMProvider* _provider;
130                        PEGASUS_INDICATION_CALLBACK_T _indicationCallback;
131                        PEGASUS_RESPONSE_CHUNK_CALLBACK_T _responseChunkCallback;
132                        Boolean _subscriptionInitComplete;
133                        EnableIndicationsResponseHandler* _indicationResponseHandler;
134                    
135                    public:
136                        ProviderStatus status;
137                    };
138                    
139                    
140                    /**
141 kumpf          1.2     Encapsulates the calling of operationBegin() and operationEnd() for a
142                        ProviderMessageHandler to help ensure an accurate count of provider
143                        operations.
144 kumpf          1.1 */
145 kumpf          1.2 class PEGASUS_DEFPM_LINKAGE ProviderOperationCounter
146 kumpf          1.1 {
147                    public:
148                        ProviderOperationCounter(ProviderMessageHandler* p)
149                            : _provider(p)
150                        {
151                            PEGASUS_ASSERT(_provider != 0);
152 kumpf          1.2         _provider->status.operationBegin();
153 kumpf          1.1     }
154                    
155                        ProviderOperationCounter(const ProviderOperationCounter& p)
156                            : _provider(p._provider)
157                        {
158                            PEGASUS_ASSERT(_provider != 0);
159 kumpf          1.2         _provider->status.operationBegin();
160 kumpf          1.1     }
161                    
162                        ~ProviderOperationCounter()
163                        {
164 kumpf          1.2         _provider->status.operationEnd();
165 kumpf          1.1     }
166                    
167                        ProviderMessageHandler& GetProvider()
168                        {
169                            return *_provider;
170                        }
171                    
172                    private:
173                        ProviderOperationCounter();
174                        ProviderOperationCounter& operator=(const ProviderOperationCounter&);
175                    
176                        ProviderMessageHandler* _provider;
177                    };
178                    
179                    PEGASUS_NAMESPACE_END
180                    
181                    #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2