(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                   const String& name,
 51                   CIMProvider* provider,
 52                   PEGASUS_INDICATION_CALLBACK_T indicationCallback,
 53                   PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback,
 54                   Boolean subscriptionInitComplete);
 55           
 56               virtual ~ProviderMessageHandler();
 57           
 58               String getName() const;
 59               void setProvider(CIMProvider* provider);
 60               void initialize(CIMOMHandle& cimom);
 61               void terminate();
 62               void subscriptionInitComplete();
 63           
 64 kumpf 1.1     CIMResponseMessage* processMessage(CIMRequestMessage* request);
 65           
 66           private:
 67               CIMResponseMessage* _handleGetInstanceRequest(
 68                   CIMRequestMessage* message);
 69               CIMResponseMessage* _handleEnumerateInstancesRequest(
 70                   CIMRequestMessage* message);
 71               CIMResponseMessage* _handleEnumerateInstanceNamesRequest(
 72                   CIMRequestMessage* message);
 73               CIMResponseMessage* _handleCreateInstanceRequest(
 74                   CIMRequestMessage* message);
 75               CIMResponseMessage* _handleModifyInstanceRequest(
 76                   CIMRequestMessage* message);
 77               CIMResponseMessage* _handleDeleteInstanceRequest(
 78                   CIMRequestMessage* message);
 79           
 80               CIMResponseMessage* _handleExecQueryRequest(
 81                   CIMRequestMessage* message);
 82           
 83               CIMResponseMessage* _handleAssociatorsRequest(
 84                   CIMRequestMessage* message);
 85 kumpf 1.1     CIMResponseMessage* _handleAssociatorNamesRequest(
 86                   CIMRequestMessage* message);
 87               CIMResponseMessage* _handleReferencesRequest(
 88                   CIMRequestMessage* message);
 89               CIMResponseMessage* _handleReferenceNamesRequest(
 90                   CIMRequestMessage* message);
 91           
 92               CIMResponseMessage* _handleGetPropertyRequest(
 93                   CIMRequestMessage* message);
 94               CIMResponseMessage* _handleSetPropertyRequest(
 95                   CIMRequestMessage* message);
 96           
 97               CIMResponseMessage* _handleInvokeMethodRequest(
 98                   CIMRequestMessage* message);
 99           
100               CIMResponseMessage* _handleCreateSubscriptionRequest(
101                   CIMRequestMessage* message);
102               CIMResponseMessage* _handleModifySubscriptionRequest(
103                   CIMRequestMessage* message);
104               CIMResponseMessage* _handleDeleteSubscriptionRequest(
105                   CIMRequestMessage* message);
106 kumpf 1.1 
107               CIMResponseMessage* _handleExportIndicationRequest(
108                   CIMRequestMessage* message);
109           
110               /**
111                   Calls the provider's enableIndications() method.
112                   If successful, the indications response handler is stored in
113                   _indicationResponseHandler.
114           
115                   Note that since an exception thrown by the provider's
116                   enableIndications() method is considered a provider error, any such
117                   exception is logged and not propagated by this method.
118                */
119               void _enableIndications();
120           
121               void _disableIndications();
122           
123               String _name;
124               CIMProvider* _provider;
125               PEGASUS_INDICATION_CALLBACK_T _indicationCallback;
126               PEGASUS_RESPONSE_CHUNK_CALLBACK_T _responseChunkCallback;
127 kumpf 1.1     Boolean _subscriptionInitComplete;
128               EnableIndicationsResponseHandler* _indicationResponseHandler;
129           
130           public:
131               ProviderStatus status;
132           };
133           
134           
135           /**
136               Encapsulates the incrementing/decrementing of the _currentOperations
137               for a ProviderMessageHandler so it won't be unloaded during operations.
138           */
139           class ProviderOperationCounter
140           {
141           public:
142               ProviderOperationCounter(ProviderMessageHandler* p)
143                   : _provider(p)
144               {
145                   PEGASUS_ASSERT(_provider != 0);
146                   _provider->status._currentOperations++;
147               }
148 kumpf 1.1 
149               ProviderOperationCounter(const ProviderOperationCounter& p)
150                   : _provider(p._provider)
151               {
152                   PEGASUS_ASSERT(_provider != 0);
153                   _provider->status._currentOperations++;
154               }
155           
156               ~ProviderOperationCounter()
157               {
158                   _provider->status._currentOperations--;
159               }
160           
161               ProviderMessageHandler& GetProvider()
162               {
163                   return *_provider;
164               }
165           
166           private:
167               ProviderOperationCounter();
168               ProviderOperationCounter& operator=(const ProviderOperationCounter&);
169 kumpf 1.1 
170               ProviderMessageHandler* _provider;
171           };
172           
173           PEGASUS_NAMESPACE_END
174           
175           #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2