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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2