(file) Return to CIMOperationRequestDispatcher.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Server

  1 mike  1.2 //%///////-*-c++-*-/////////////////////////////////////////////////////////////
  2           //
  3           // Copyright (c) 2000, 2001 BMC Software, Hewlett-Packard Company, IBM,
  4           // The Open Group, Tivoli Systems
  5           //
  6           // Permission is hereby granted, free of charge, to any person obtaining a copy
  7           // of this software and associated documentation files (the "Software"), to
  8           // deal in the Software without restriction, including without limitation the
  9           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 10           // sell copies of the Software, and to permit persons to whom the Software is
 11           // furnished to do so, subject to the following conditions:
 12           //
 13           // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 14           // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 15           // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 16           // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 17           // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 18           // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 19           // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 20           // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 21           //
 22 mike  1.2 //==============================================================================
 23           //
 24           // Author: Mike Brasher (mbrasher@bmc.com)
 25           //
 26           // Modified By: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
 27 kumpf 1.28 //              Mike Day (mdday@us.ibm.com)
 28            //              Yi Zhou (yi_zhou@hp.com)
 29            //              Carol Ann Krug Graves, Hewlett-Packard Company
 30            //                  (carolann_graves@hp.com)
 31            //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 32 karl  1.37 //		Karl Schopmeyer (k.schopmeyer@opengroup.org)
 33 mike  1.2  //
 34            //
 35            //%/////////////////////////////////////////////////////////////////////////////
 36            
 37            #ifndef PegasusDispatcher_Dispatcher_h
 38            #define PegasusDispatcher_Dispatcher_h
 39            
 40            #include <Pegasus/Common/Config.h>
 41            #include <Pegasus/Common/IPC.h>
 42            #include <Pegasus/Common/DQueue.h>
 43            #include <Pegasus/Common/Thread.h>
 44            #include <Pegasus/Common/MessageQueue.h>
 45            #include <Pegasus/Common/CIMMessage.h>
 46            #include <Pegasus/Common/CIMObject.h>
 47            #include <Pegasus/Common/OperationContext.h>
 48 chip  1.7  
 49            #include <Pegasus/Server/CIMServer.h>
 50 mike  1.2  
 51 chip  1.7  #include <Pegasus/Repository/CIMRepository.h>
 52 mike  1.2  
 53 kumpf 1.20 #include <Pegasus/Server/ProviderRegistrationManager/ProviderRegistrationManager.h>
 54 chip  1.8  
 55 mike  1.2  PEGASUS_NAMESPACE_BEGIN
 56            
 57 karl  1.37 
 58            /* Class to manage the aggregation of data required by post processors. This
 59                class is private to the dispatcher. An instance is created by the operation
 60                dispatcher to aggregate request and response information and used by the
 61                post processor to aggregate responses together.
 62            */
 63            class  PEGASUS_SERVER_LINKAGE operationAggregate
 64            {
 65            public:
 66            
 67                operationAggregate(CIMEnumerateInstanceNamesRequestMessage* request)
 68                {
 69            	_request = request;
 70            	_total = 0;
 71            	_returnedCount = 0;
 72                }
 73            
 74                ~operationAggregate(){
 75            
 76                }
 77            
 78 karl  1.37     /** Copy constructor */
 79                operationAggregate(const operationAggregate& x)
 80                {
 81            
 82                }
 83            
 84                 /* Assignment operator
 85                operationAggregate& operator=(const operationAggregate& x)
 86                {
 87            
 88                }
 89                 */
 90            
 91                void incrementReturned()
 92                {
 93            	_returnedCount++;
 94                }
 95            
 96                void setTotalIssued(Uint32 i)
 97                {
 98            	_total = i;
 99 karl  1.37 	_returnedCount = 0;
100                }
101            
102                Uint32 returned()
103                {
104            	return _returnedCount;
105                }
106                Uint32 total()
107                {
108            	return _total;
109                }
110                // Append a new entry to the response list
111                void appendResponse(CIMResponseMessage* response)
112                {
113            	_responseList.append(response);
114                }
115                Uint32 numberResponses()
116                {
117            	return _responseList.size();
118                }
119                CIMResponseMessage* getResponse(const Uint32& pos)
120 karl  1.37     {
121            	return _responseList[pos];
122                }
123                void deleteResponse(const Uint32&pos)
124                {
125            	_responseList[pos];
126                }
127                Array<String> _subClasses;
128                Array<String> _Servicenames;
129                Array<String> _ControlProviderNames;
130                Array<String> _provider;
131             
132            private:
133                Array<CIMResponseMessage*> _responseList;
134                CIMEnumerateInstanceNamesRequestMessage* _request;
135                Uint32 _returnedCount;
136                Uint32 _total;
137            };
138 mday  1.11 class PEGASUS_SERVER_LINKAGE CIMOperationRequestDispatcher : public MessageQueueService
139 mike  1.2  {
140 chip  1.19 public:
141 chip  1.6  
142 mday  1.18       typedef MessageQueueService Base;
143 chip  1.6  
144 mday  1.18       CIMOperationRequestDispatcher(
145 kumpf 1.25 	 CIMRepository* repository,
146 kumpf 1.28 	 ProviderRegistrationManager* providerRegistrationManager);
147 chip  1.6  
148 mday  1.16       virtual ~CIMOperationRequestDispatcher();
149 chip  1.19 
150 mday  1.18       virtual void handleEnqueue(Message *);
151            
152 mday  1.13       virtual void handleEnqueue();
153 chip  1.6  
154 mday  1.18       void handleGetClassRequest(
155            	 CIMGetClassRequestMessage* request);
156 chip  1.6  
157 mday  1.18       void handleGetInstanceRequest(
158            	 CIMGetInstanceRequestMessage* request);
159 chip  1.6  
160 mday  1.18       void handleDeleteClassRequest(
161            	 CIMDeleteClassRequestMessage* request);
162 chip  1.6  
163 mday  1.18       void handleDeleteInstanceRequest(
164            	 CIMDeleteInstanceRequestMessage* request);
165 chip  1.6  
166 mday  1.18       void handleCreateClassRequest(
167            	 CIMCreateClassRequestMessage* request);
168 chip  1.6  
169 mday  1.18       void handleCreateInstanceRequest(
170            	 CIMCreateInstanceRequestMessage* request);
171 chip  1.6  
172 mday  1.18       void handleModifyClassRequest(
173            	 CIMModifyClassRequestMessage* request);
174 mike  1.2  
175 mday  1.18       void handleModifyInstanceRequest(
176            	 CIMModifyInstanceRequestMessage* request);
177 mike  1.2  
178 mday  1.18       void handleEnumerateClassesRequest(
179            	 CIMEnumerateClassesRequestMessage* request);
180 mike  1.2  
181 mday  1.18       void handleEnumerateClassNamesRequest(
182            	 CIMEnumerateClassNamesRequestMessage* request);
183 mike  1.2  
184 mday  1.18       void handleEnumerateInstancesRequest(
185            	 CIMEnumerateInstancesRequestMessage* request);
186 mike  1.2  
187 karl  1.37       void postProcessEnumerateInstanceNamesResponse(
188            			operationAggregate* operationAggregator);
189            
190 mday  1.18       void handleEnumerateInstanceNamesRequest(
191            	 CIMEnumerateInstanceNamesRequestMessage* request);
192 mike  1.2  
193 mday  1.18       void handleAssociatorsRequest(
194            	 CIMAssociatorsRequestMessage* request);
195 mike  1.2  
196 mday  1.18       void handleAssociatorNamesRequest(
197            	 CIMAssociatorNamesRequestMessage* request);
198 mike  1.2  
199 mday  1.18       void handleReferencesRequest(
200            	 CIMReferencesRequestMessage* request);
201 mike  1.2  
202 mday  1.18       void handleReferenceNamesRequest(
203            	 CIMReferenceNamesRequestMessage* request);
204 mike  1.2  
205 mday  1.18       void handleGetPropertyRequest(
206            	 CIMGetPropertyRequestMessage* request);
207 mike  1.2  
208 mday  1.18       void handleSetPropertyRequest(
209            	 CIMSetPropertyRequestMessage* request);
210 mike  1.2  
211 mday  1.18       void handleGetQualifierRequest(
212            	 CIMGetQualifierRequestMessage* request);
213 mike  1.2  
214 mday  1.18       void handleSetQualifierRequest(
215            	 CIMSetQualifierRequestMessage* request);
216 mike  1.2  
217 mday  1.18       void handleDeleteQualifierRequest(
218            	 CIMDeleteQualifierRequestMessage* request);
219 mike  1.2  
220 mday  1.18       void handleEnumerateQualifiersRequest(
221            	 CIMEnumerateQualifiersRequestMessage* request);
222 mike  1.2  
223 kumpf 1.30       void handleExecQueryRequest(
224            	 CIMExecQueryRequestMessage* request);
225            
226 mday  1.18       void handleInvokeMethodRequest(
227            	 CIMInvokeMethodRequestMessage* request);
228 mike  1.2  
229 mday  1.18       void handleProcessIndicationRequest(
230            	 CIMProcessIndicationRequestMessage* request);
231 mday  1.31       
232                  static void _forwardToServiceCallBack(AsyncOpNode *, 
233            					    MessageQueue *,
234            					    void *);
235                  static void _forwardToModuleCallBack(AsyncOpNode *, 
236            					   MessageQueue *, 
237            					   void *);
238 karl  1.37       static void _forwardToDispatcherCallBack(AsyncOpNode *, 
239            					   MessageQueue *, 
240            					   void *);
241 mday  1.31       
242 karl  1.37       static void _forwardToServiceCallBackEnum(AsyncOpNode *, 
243            					    MessageQueue *,
244            					    void *);
245                  static void _forwardToModuleCallBackEnum(AsyncOpNode *, 
246            					   MessageQueue *, 
247            					   void *);
248 mday  1.31    protected:
249 kumpf 1.10 
250 karl  1.35 	/** _getSubClassNames - Gets the names of all subclasses of the defined
251            	    class (including the class) and returns it in an array of strings. Uses 
252            	    a similar function in the repository class to get the names.
253            	    @param namespace
254            	    @param className
255            	    @return Array of strings with class names.  Note that there should be 
256            	    at least one classname in the array (the input name)
257            	    Note that there is a special exception to this function, the __namespace
258            	    class which does not have any representation in the class repository.
259            	    @exception CIMException(CIM_ERR_INVALID_CLASS)
260            	*/
261 kumpf 1.36        Array<String> _getSubClassNames(
262 karl  1.35 	    String& nameSpace,
263            	    String& className) throw(CIMException);
264                   
265                   Boolean _lookupInternalProvider(
266 kumpf 1.26         const String& nameSpace,
267                    const String& className,
268                    String& service,
269                    String& provider);
270            
271 kumpf 1.21       String _lookupInstanceProvider(
272            	const String& nameSpace, const String& className);
273 karl  1.35 
274                  Boolean _lookupNewInstanceProvider(
275            	const String& nameSpace, 
276            	const String& className,
277            	String& serviceName,
278            	String& controlProviderName);
279 kumpf 1.21 
280 sage  1.33       Array<String> _lookupAssociationProvider(
281            	const String& nameSpace, const String& className,
282                    const String& assocClassName = String::EMPTY,
283                    const String& resultClassName = String::EMPTY);
284 kumpf 1.21 
285                  String _lookupMethodProvider(const String& nameSpace,
286            	const String& className, const String& methodName);
287            
288                  String _lookupIndicationProvider(
289            	const String& nameSpace, const String& className);
290 chip  1.14 
291 kumpf 1.27       void _forwardRequestToService(
292            	const String& serviceName,
293            	CIMRequestMessage* request,
294            	CIMResponseMessage*& response);
295            
296                  void _forwardRequestToControlProvider(
297            	const String& serviceName,
298            	const String& controlProviderName,
299            	CIMRequestMessage* request,
300            	CIMResponseMessage*& response);
301            
302 karl  1.34       void _forwardRequest(
303                    const String& className,
304            	const String& serviceName,
305            	const String& controlProviderName,
306 karl  1.37 	CIMRequestMessage* request);
307            
308            	//ATTNKSDELETE CIMRequestMessage* request,
309            	//ATTNKSDELETECIMResponseMessage*& response);
310            
311                  void _forwardRequestEnum(
312                    const String& className,
313            	const String& serviceName,
314            	const String& controlProviderName,
315            	CIMRequestMessage* request);
316 karl  1.34 
317 mday  1.13       void _enqueueResponse(
318            	 CIMRequestMessage* request, CIMResponseMessage* response);
319 chip  1.14 
320 kumpf 1.17       CIMValue _convertValueType(const CIMValue& value, CIMType type);
321            
322                  void _fixInvokeMethodParameterTypes(CIMInvokeMethodRequestMessage* request);
323            
324                  void _fixSetPropertyValueType(CIMSetPropertyRequestMessage* request);
325            
326 mday  1.13       CIMRepository * _repository;
327 chip  1.14 
328 kumpf 1.25       ProviderRegistrationManager* _providerRegistrationManager;
329 chip  1.14 
330 mday  1.13       AtomicInt _dying;
331 chip  1.14 
332 mday  1.18       // << Tue Feb 12 08:48:09 2002 mdd >> meta dispatcher integration
333 mday  1.13       virtual void _handle_async_request(AsyncRequest *req);
334 mday  1.23    private:
335                  static void _handle_enqueue_callback(AsyncOpNode *, MessageQueue *, void *);
336 chip  1.14 
337 mike  1.2  };
338            
339            PEGASUS_NAMESPACE_END
340            
341            #endif /* PegasusDispatcher_Dispatcher_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2