(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 kumpf 1.3     OperationContext _createProviderOperationContext(
 68                   const OperationContext& context);
 69           
 70 kumpf 1.1     CIMResponseMessage* _handleGetInstanceRequest(
 71                   CIMRequestMessage* message);
 72               CIMResponseMessage* _handleEnumerateInstancesRequest(
 73                   CIMRequestMessage* message);
 74               CIMResponseMessage* _handleEnumerateInstanceNamesRequest(
 75                   CIMRequestMessage* message);
 76               CIMResponseMessage* _handleCreateInstanceRequest(
 77                   CIMRequestMessage* message);
 78               CIMResponseMessage* _handleModifyInstanceRequest(
 79                   CIMRequestMessage* message);
 80               CIMResponseMessage* _handleDeleteInstanceRequest(
 81                   CIMRequestMessage* message);
 82           
 83               CIMResponseMessage* _handleExecQueryRequest(
 84                   CIMRequestMessage* message);
 85           
 86               CIMResponseMessage* _handleAssociatorsRequest(
 87                   CIMRequestMessage* message);
 88               CIMResponseMessage* _handleAssociatorNamesRequest(
 89                   CIMRequestMessage* message);
 90               CIMResponseMessage* _handleReferencesRequest(
 91 kumpf 1.1         CIMRequestMessage* message);
 92               CIMResponseMessage* _handleReferenceNamesRequest(
 93                   CIMRequestMessage* message);
 94           
 95               CIMResponseMessage* _handleGetPropertyRequest(
 96                   CIMRequestMessage* message);
 97               CIMResponseMessage* _handleSetPropertyRequest(
 98                   CIMRequestMessage* message);
 99           
100               CIMResponseMessage* _handleInvokeMethodRequest(
101                   CIMRequestMessage* message);
102           
103               CIMResponseMessage* _handleCreateSubscriptionRequest(
104                   CIMRequestMessage* message);
105               CIMResponseMessage* _handleModifySubscriptionRequest(
106                   CIMRequestMessage* message);
107               CIMResponseMessage* _handleDeleteSubscriptionRequest(
108                   CIMRequestMessage* message);
109           
110               CIMResponseMessage* _handleExportIndicationRequest(
111                   CIMRequestMessage* message);
112 kumpf 1.1 
113               /**
114                   Calls the provider's enableIndications() method.
115                   If successful, the indications response handler is stored in
116                   _indicationResponseHandler.
117           
118                   Note that since an exception thrown by the provider's
119                   enableIndications() method is considered a provider error, any such
120                   exception is logged and not propagated by this method.
121                */
122               void _enableIndications();
123           
124               void _disableIndications();
125           
126               String _name;
127               CIMProvider* _provider;
128               PEGASUS_INDICATION_CALLBACK_T _indicationCallback;
129               PEGASUS_RESPONSE_CHUNK_CALLBACK_T _responseChunkCallback;
130               Boolean _subscriptionInitComplete;
131               EnableIndicationsResponseHandler* _indicationResponseHandler;
132           
133 kumpf 1.1 public:
134               ProviderStatus status;
135           };
136           
137           
138           /**
139 kumpf 1.2     Encapsulates the calling of operationBegin() and operationEnd() for a
140               ProviderMessageHandler to help ensure an accurate count of provider
141               operations.
142 kumpf 1.1 */
143 kumpf 1.2 class PEGASUS_DEFPM_LINKAGE ProviderOperationCounter
144 kumpf 1.1 {
145           public:
146               ProviderOperationCounter(ProviderMessageHandler* p)
147                   : _provider(p)
148               {
149                   PEGASUS_ASSERT(_provider != 0);
150 kumpf 1.2         _provider->status.operationBegin();
151 kumpf 1.1     }
152           
153               ProviderOperationCounter(const ProviderOperationCounter& p)
154                   : _provider(p._provider)
155               {
156                   PEGASUS_ASSERT(_provider != 0);
157 kumpf 1.2         _provider->status.operationBegin();
158 kumpf 1.1     }
159           
160               ~ProviderOperationCounter()
161               {
162 kumpf 1.2         _provider->status.operationEnd();
163 kumpf 1.1     }
164           
165               ProviderMessageHandler& GetProvider()
166               {
167                   return *_provider;
168               }
169           
170           private:
171               ProviderOperationCounter();
172               ProviderOperationCounter& operator=(const ProviderOperationCounter&);
173           
174               ProviderMessageHandler* _provider;
175           };
176           
177           PEGASUS_NAMESPACE_END
178           
179           #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2