![]() ![]() |
![]() |
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 kumpf 1.4 CIMProvider* getProvider(); | ||
60 kumpf 1.1 void setProvider(CIMProvider* provider); 61 void initialize(CIMOMHandle& cimom); 62 void terminate(); 63 void subscriptionInitComplete(); 64 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 CIMProvider* _provider; 129 PEGASUS_INDICATION_CALLBACK_T _indicationCallback; 130 PEGASUS_RESPONSE_CHUNK_CALLBACK_T _responseChunkCallback; 131 Boolean _subscriptionInitComplete; 132 EnableIndicationsResponseHandler* _indicationResponseHandler; 133 134 kumpf 1.1 public: 135 ProviderStatus status; 136 }; 137 138 139 /** | ||
140 kumpf 1.2 Encapsulates the calling of operationBegin() and operationEnd() for a 141 ProviderMessageHandler to help ensure an accurate count of provider 142 operations. | ||
143 kumpf 1.1 */ | ||
144 kumpf 1.2 class PEGASUS_DEFPM_LINKAGE ProviderOperationCounter | ||
145 kumpf 1.1 { 146 public: 147 ProviderOperationCounter(ProviderMessageHandler* p) 148 : _provider(p) 149 { 150 PEGASUS_ASSERT(_provider != 0); | ||
151 kumpf 1.2 _provider->status.operationBegin(); | ||
152 kumpf 1.1 } 153 154 ProviderOperationCounter(const ProviderOperationCounter& p) 155 : _provider(p._provider) 156 { 157 PEGASUS_ASSERT(_provider != 0); | ||
158 kumpf 1.2 _provider->status.operationBegin(); | ||
159 kumpf 1.1 } 160 161 ~ProviderOperationCounter() 162 { | ||
163 kumpf 1.2 _provider->status.operationEnd(); | ||
164 kumpf 1.1 } 165 166 ProviderMessageHandler& GetProvider() 167 { 168 return *_provider; 169 } 170 171 private: 172 ProviderOperationCounter(); 173 ProviderOperationCounter& operator=(const ProviderOperationCounter&); 174 175 ProviderMessageHandler* _provider; 176 }; 177 178 PEGASUS_NAMESPACE_END 179 180 #endif |
No CVS admin address has been configured |
Powered by ViewCVS 0.9.2 |