(file) Return to CimomMessage.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  1 mday  1.1 //%///-*-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 mday  1.1 //==============================================================================
 23           //
 24           // Author: Mike Day (mdday@us.ibm.com)
 25           //
 26           // Modified By: 
 27           //
 28           //%/////////////////////////////////////////////////////////////////////////////
 29           
 30           #include "CimomMessage.h"
 31           
 32           PEGASUS_NAMESPACE_BEGIN
 33           
 34 mday  1.6 
 35 mday  1.1 
 36           const Uint32 async_results::OK =                        0x00000000;
 37           const Uint32 async_results::PARAMETER_ERROR =           0x00000001;
 38           const Uint32 async_results::MODULE_ALREADY_REGISTERED = 0x00000002;
 39           const Uint32 async_results::MODULE_NOT_FOUND =          0x00000003;
 40           const Uint32 async_results::INTERNAL_ERROR =            0x00000004;
 41           
 42           
 43           const Uint32 async_results::ASYNC_STARTED =             0x00000005;
 44           const Uint32 async_results::ASYNC_PROCESSING =          0x00000006;
 45           const Uint32 async_results::ASYNC_COMPLETE =            0x00000007;
 46           const Uint32 async_results::ASYNC_CANCELLED =           0x00000008;
 47           const Uint32 async_results::ASYNC_PAUSED =              0x00000009;
 48           const Uint32 async_results::ASYNC_RESUMED =             0x0000000a;
 49           
 50           const Uint32 async_results::CIM_SERVICE_STARTED =       0x0000000b;
 51           const Uint32 async_results::CIM_SERVICE_STOPPED  =      0x0000000c;
 52           
 53           const Uint32 async_results::CIM_SERVICE_PAUSED  =       0x0000000d;
 54           const Uint32 async_results::CIM_SERVICE_RESUMED =       0x0000000e;
 55           const Uint32 async_results::CIM_NAK =                   0x0000000f;
 56 mday  1.1 
 57           const Uint32 async_results::ASYNC_PHASE_COMPLETE =      0x00000010;
 58           const Uint32 async_results::ASYNC_CHILD_COMPLETE =      0x00000011;
 59           const Uint32 async_results::ASYNC_PHASE_STARTED =       0x00000012;
 60           const Uint32 async_results::ASYNC_CHILD_STARTED =       0x00000013;
 61 mday  1.4 const Uint32 async_results::CIM_PAUSED =                0x00000014;
 62           const Uint32 async_results::CIM_STOPPED =               0x00000015;
 63           
 64 mday  1.1 
 65           
 66 mday  1.13 const Uint32 async_messages::HEARTBEAT =                       0x00000000;
 67            const Uint32 async_messages::REPLY =                           0x00000000;
 68            const Uint32 async_messages::REGISTER_CIM_SERVICE =            0x00000001;
 69            const Uint32 async_messages::DEREGISTER_CIM_SERVICE =          0x00000002;
 70            const Uint32 async_messages::UPDATE_CIM_SERVICE =              0x00000003;
 71            const Uint32 async_messages::IOCTL =                           0x00000004;
 72            const Uint32 async_messages::CIMSERVICE_START =                0x00000005;
 73            const Uint32 async_messages::CIMSERVICE_STOP =                 0x00000006;
 74            const Uint32 async_messages::CIMSERVICE_PAUSE =                0x00000007;
 75            const Uint32 async_messages::CIMSERVICE_RESUME =               0x00000008;
 76            
 77            const Uint32 async_messages::ASYNC_OP_START =                  0x00000009;
 78            const Uint32 async_messages::ASYNC_OP_RESULT =                 0x0000000a;
 79            const Uint32 async_messages::ASYNC_LEGACY_OP_START =           0x0000000b;
 80            const Uint32 async_messages::ASYNC_LEGACY_OP_RESULT =          0x0000000c;
 81            
 82            const Uint32 async_messages::FIND_SERVICE_Q =                  0x0000000d;
 83            const Uint32 async_messages::FIND_SERVICE_Q_RESULT =           0x0000000e;
 84            const Uint32 async_messages::ENUMERATE_SERVICE =               0x0000000f;
 85            const Uint32 async_messages::ENUMERATE_SERVICE_RESULT =        0x00000010;
 86            
 87 mday  1.13 const Uint32 async_messages::REGISTERED_MODULE =               0x00000011;
 88            const Uint32 async_messages::DEREGISTERED_MODULE =             0x00000012;
 89            const Uint32 async_messages::FIND_MODULE_IN_SERVICE =          0x00000013;
 90 mday  1.12 const Uint32 async_messages::FIND_MODULE_IN_SERVICE_RESPONSE = 0x00000014;
 91            
 92 mday  1.13 const Uint32 async_messages::ASYNC_MODULE_OP_START =           0x00000015;
 93            const Uint32 async_messages::ASYNC_MODULE_OP_RESULT  =         0x00000016;
 94            
 95 mday  1.12 
 96 mday  1.1  
 97            AsyncMessage::AsyncMessage(Uint32 type, 
 98 mday  1.8  			   Uint32 destination,
 99 mday  1.1  			   Uint32 key, 
100            			   Uint32 routing,
101            			   Uint32 mask,
102            			   AsyncOpNode *operation)
103 mday  1.8     : Message(type, destination, key, routing, mask | message_mask::ha_async),
104 mday  1.11      op(operation)
105 mday  1.1  {  
106               
107            }
108            
109            AsyncRequest::AsyncRequest(Uint32 type, 
110            			   Uint32 key, 
111            			   Uint32 routing,
112            			   Uint32 mask,
113            			   AsyncOpNode *operation,
114            			   Uint32 destination,
115            			   Uint32 response,
116            			   Boolean blocking) 
117 mday  1.8     : AsyncMessage(type, destination, key, routing, mask | message_mask::ha_request, operation),
118 mday  1.1       resp(response),
119                 block(blocking) 
120            {  
121 mday  1.2     if( op != 0 )
122                  op->put_request(this);
123 mday  1.1  }
124            
125            AsyncReply::AsyncReply(Uint32 type, 
126            		       Uint32 key, 
127            		       Uint32 routing, 
128            		       Uint32 mask,
129            		       AsyncOpNode *operation,
130            		       Uint32 result_code,
131            		       Uint32 destination,
132            		       Boolean blocking) 
133 mday  1.8     : AsyncMessage(type, destination, key, routing, mask | message_mask::ha_reply, operation),
134 mday  1.1       result(result_code),
135                 block(blocking) 
136            {  
137 mday  1.2     if( op != 0 )
138                  op->put_response(this);
139 mday  1.1  }
140            
141            
142            
143            
144            RegisterCimService::RegisterCimService(Uint32 routing, 
145            				       AsyncOpNode *operation,
146            				       Boolean blocking,
147            				       String service_name,
148            				       Uint32 service_capabilities, 
149            				       Uint32 service_mask,
150            				       Uint32 service_queue)
151               : AsyncRequest( async_messages::REGISTER_CIM_SERVICE,
152            		   Message::getNextKey(),
153            		   routing, 0, operation, CIMOM_Q_ID,
154            		   service_queue, blocking),
155                 name(service_name),
156                 capabilities(service_capabilities),
157                 mask(service_mask),
158                 queue(service_queue) 
159            {   
160 mday  1.1     
161            }
162                  
163            
164            DeRegisterCimService::DeRegisterCimService(Uint32 routing, 
165            					   AsyncOpNode *operation,
166            					   Boolean blocking, 
167            					   Uint32 service_queue)
168               : AsyncRequest( async_messages::DEREGISTER_CIM_SERVICE,
169            		   Message::getNextKey(), 
170            		   routing, 0, operation, CIMOM_Q_ID, 
171            		   service_queue, blocking),
172                 queue(service_queue) 
173            {   
174            	 
175            }
176            
177            
178            
179            UpdateCimService::UpdateCimService(Uint32 routing, 
180            				   AsyncOpNode *operation,
181 mday  1.1  				   Boolean blocking, 
182            				   Uint32 service_queue, 
183            				   Uint32 service_capabilities, 
184            				   Uint32 service_mask) 
185               : AsyncRequest( async_messages::UPDATE_CIM_SERVICE, 
186            		   Message::getNextKey(), 
187            		   routing, 0, operation, CIMOM_Q_ID, 
188            		   service_queue, blocking),
189                 queue(service_queue),
190                 capabilities(service_capabilities),
191                 mask(service_mask) 
192            {   
193               
194            }
195            
196 mday  1.12 RegisteredModule::RegisteredModule(Uint32 routing, 
197            				   AsyncOpNode *operation,
198            				   Boolean blocking, 
199            				   Uint32 service_queue, 
200            				   String new_module)
201               : AsyncRequest( async_messages::REGISTERED_MODULE, 
202            		   Message::getNextKey(),
203            		   routing, 
204            		   0, 
205            		   operation, 
206            		   CIMOM_Q_ID, 
207            		   service_queue, 
208            		   blocking),
209                 _module(new_module)
210            {
211            
212            }
213            
214            DeRegisteredModule::DeRegisteredModule(Uint32 routing, 
215            				     AsyncOpNode *operation,
216            				     Boolean blocking, 
217 mday  1.12 				     Uint32 service_queue, 
218            				     String removed_module)
219               : AsyncRequest( async_messages::DEREGISTERED_MODULE, 
220            		   Message::getNextKey(),
221            		   routing, 
222            		   0, 
223            		   operation, 
224            		   CIMOM_Q_ID, 
225            		   service_queue, 
226            		   blocking),
227                 _module(removed_module)
228            {
229            
230            }
231            
232            
233            FindModuleInService::FindModuleInService(Uint32 routing, 
234            					 AsyncOpNode *operation, 
235            					 Boolean blocking,
236            					 Uint32 response_queue,
237            					 String module)
238 mday  1.12    : AsyncRequest(async_messages::FIND_MODULE_IN_SERVICE, 
239            		  Message::getNextKey(),
240            		  routing, 
241            		  0, 
242            		  operation, 
243            		  CIMOM_Q_ID,
244            		  response_queue,
245            		  blocking),
246                 _module(module)
247            {
248            
249            }
250            
251            FindModuleInServiceResponse::FindModuleInServiceResponse(Uint32 routing,
252            							 Uint32 key,
253            							 AsyncOpNode *operation,
254            							 Uint32 result_code, 
255            							 Uint32 destination, 
256            							 Uint32 blocking, 
257            							 Uint32 module_service_queue)
258            
259 mday  1.12    : AsyncReply(async_messages::FIND_MODULE_IN_SERVICE_RESPONSE,
260            		key, 
261            		routing, 
262            		0, 
263            		operation, 
264            		result_code,
265            		destination, 
266            		blocking),
267                 _module_service_queue(module_service_queue)
268            {
269            
270            }
271 mday  1.1  
272            AsyncIoctl::AsyncIoctl(Uint32 routing, 
273            		       AsyncOpNode *operation, 
274            		       Uint32 destination, 
275            		       Uint32 response,
276            		       Boolean blocking,
277            		       Uint32 code, 
278            		       Uint32 int_param,
279            		       void *p_param)
280               : AsyncRequest( async_messages::IOCTL, 
281            		   Message::getNextKey(), 
282            		   routing, 0, operation, 
283            		   destination, response, blocking),
284                 ctl(code), 
285                 intp(int_param),
286 mday  1.3       voidp(p_param)
287 mday  1.1  {  
288            	 
289            }
290            
291            
292            CimServiceStart::CimServiceStart(Uint32 routing, 
293            				 AsyncOpNode *operation, 
294            				 Uint32 destination, 
295            				 Uint32 response, 
296            				 Boolean blocking)
297               : AsyncRequest(async_messages::CIMSERVICE_START,
298            		  Message::getNextKey(), routing, 
299            		  0, operation, destination, 
300            		  response, blocking) 
301            {  
302            	 
303            }
304            
305            
306            CimServiceStop::CimServiceStop(Uint32 routing, 
307            			       AsyncOpNode *operation, 
308 mday  1.1  			       Uint32 destination, 
309            			       Uint32 response, 
310            			       Boolean blocking)
311               : AsyncRequest(async_messages::CIMSERVICE_STOP,
312            		  Message::getNextKey(), routing, 
313            		  0, operation, destination, 
314            		  response, blocking) 
315            {  
316            
317            }
318            
319            
320            
321            CimServicePause::CimServicePause(Uint32 routing, 
322            				 AsyncOpNode *operation, 
323            				 Uint32 destination, 
324            				 Uint32 response, 
325            				 Boolean blocking)
326               : AsyncRequest(async_messages::CIMSERVICE_PAUSE,
327            		  Message::getNextKey(), routing, 
328            		  0, operation, destination, 
329 mday  1.1  		  response, blocking) 
330            {  
331            	 
332            }
333            
334            
335            CimServiceResume::CimServiceResume(Uint32 routing, 
336            				   AsyncOpNode *operation, 
337            				   Uint32 destination, 
338            				   Uint32 response, 
339            				   Boolean blocking)
340               : AsyncRequest(async_messages::CIMSERVICE_RESUME,
341            		  Message::getNextKey(), routing, 
342            		  0, operation, destination, 
343            		  response, blocking) 
344            {  
345            	 
346            }
347            
348            AsyncOperationStart::AsyncOperationStart(Uint32 routing, 
349            					 AsyncOpNode *operation, 
350 mday  1.1  					 Uint32 destination, 
351            					 Uint32 response, 
352            					 Boolean blocking, 
353            					 Message *action)
354               : AsyncRequest(async_messages::ASYNC_OP_START, 
355            		  Message::getNextKey(), routing, 0,
356            		  operation, 
357            		  destination, response, blocking),
358 mday  1.9       _act(action) 
359 mday  1.1  {  
360 mday  1.7  
361 mday  1.1  }
362            
363            
364 mday  1.10 Message * AsyncOperationStart::get_action(void)
365 mday  1.9  {
366               Message *ret = _act;
367               _act = 0;
368               ret->put_async(0);
369               return ret;
370               
371            }
372            
373            
374 mday  1.1  AsyncOperationResult::AsyncOperationResult(Uint32 key, 
375            					   Uint32 routing, 
376            					   AsyncOpNode *operation,
377            					   Uint32 result_code, 
378            					   Uint32 destination,
379            					   Uint32 blocking)
380               : AsyncReply(async_messages::ASYNC_OP_RESULT, 
381            		key, routing, 0,
382            		operation, result_code, destination, 
383            		blocking) 
384            {   
385            	 
386            }
387            
388            
389 mday  1.13 AsyncModuleOperationStart::AsyncModuleOperationStart(Uint32 routing, 
390            						     AsyncOpNode *operation, 
391            						     Uint32 destination, 
392            						     Uint32 response, 
393            						     Boolean blocking, 
394            						     String target_module,
395            						     Message *action)
396               : AsyncRequest(async_messages::ASYNC_MODULE_OP_START, 
397            		  Message::getNextKey(), routing, 0,
398            		  operation, 
399            		  destination, response, blocking),
400                 _target_module(target_module),
401                 _act(action) 
402            {  
403               _act->put_async(this);
404               
405            }
406            
407            
408            Message * AsyncModuleOperationStart::get_action(void)
409            {
410 mday  1.13    Message *ret = _act;
411               _act = 0;
412               ret->put_async(0);
413               return ret;
414               
415            }
416            
417            AsyncModuleOperationResult::AsyncModuleOperationResult(Uint32 key, 
418            						       Uint32 routing, 
419            						       AsyncOpNode *operation,
420            						       Uint32 result_code, 
421            						       Uint32 destination,
422            						       Uint32 blocking,
423            						       String target_module,
424            						       Message *result)
425               : AsyncReply(async_messages::ASYNC_MODULE_OP_RESULT, 
426            		key, routing, 0,
427            		operation, result_code, destination, 
428            		blocking),
429                 _target_module(target_module),
430                 _res(result)
431 mday  1.13 {   
432               _res->put_async(this);
433            }
434 mday  1.1  
435            AsyncLegacyOperationStart::AsyncLegacyOperationStart(Uint32 routing, 
436            						     AsyncOpNode *operation, 
437            						     Uint32 destination, 
438 mday  1.5  						     Message *action,
439            						     Uint32 action_destination)
440 mday  1.1     : AsyncRequest(async_messages::ASYNC_LEGACY_OP_START, 
441            		  Message::getNextKey(), routing, 0,
442            		  operation, destination, CIMOM_Q_ID, false),
443 mday  1.9       _act(action) , _legacy_destination(action_destination)
444 mday  1.1  {  
445 mday  1.9     _act->put_async(this);
446 mday  1.1  }
447            
448            
449 mday  1.9  Message * AsyncLegacyOperationStart::get_action(void)
450            {
451               Message *ret = _act;
452               _act = 0;
453            //   ret->put_async(0);
454               return ret;
455               
456            }
457            
458 mday  1.1  AsyncLegacyOperationResult::AsyncLegacyOperationResult(Uint32 key, 
459            						       Uint32 routing, 
460            						       AsyncOpNode *operation,
461            						       Message *result)
462               : AsyncReply(async_messages::ASYNC_LEGACY_OP_RESULT, 
463            		key, routing, 0, operation, 
464            		0, CIMOM_Q_ID, false),
465 mday  1.9       _res(result)
466 mday  1.1  {   
467 mday  1.9     _res->put_async(this);
468 mday  1.1  }
469                  
470 mday  1.9  Message *AsyncLegacyOperationResult::get_result(void)
471            {
472               Message *ret = _res;
473               _res = 0;
474            //   ret->put_async(0);
475               return ret;
476            }
477 mday  1.1  
478            FindServiceQueue::FindServiceQueue(Uint32 routing, 
479            				   AsyncOpNode *operation, 
480            				   Uint32 response,
481            				   Boolean blocking, 
482            				   String service_name, 
483            				   Uint32 service_capabilities, 
484            				   Uint32 service_mask)
485               : AsyncRequest(async_messages::FIND_SERVICE_Q, 
486            		  Message::getNextKey(),
487            		  routing, 0, operation, 
488            		  CIMOM_Q_ID, 
489            		  response, 
490            		  blocking),
491                 name(service_name),
492                 capabilities(service_capabilities),
493                 mask(service_mask) 
494            { 
495            	 
496            }
497            
498 mday  1.9   
499 mday  1.1  FindServiceQueueResult::FindServiceQueueResult(Uint32 key, 
500            					       Uint32 routing, 
501            					       AsyncOpNode *operation, 
502            					       Uint32 result_code, 
503            					       Uint32 destination, 
504            					       Boolean blocking, 
505            					       Array<Uint32> queue_ids)
506               : AsyncReply(async_messages::FIND_SERVICE_Q_RESULT, 
507            		key, routing, 0, operation, 
508            		result_code, destination, blocking),
509                 qids(queue_ids) 
510            {  
511            	 
512            }
513            
514            EnumerateService::EnumerateService(Uint32 routing, 
515            				   AsyncOpNode *operation, 
516            				   Uint32 response, 
517            				   Boolean blocking, 
518            				   Uint32 queue_id)
519               : AsyncRequest(async_messages::ENUMERATE_SERVICE, 
520 mday  1.1  		  Message::getNextKey(),
521            		  routing, 0, 
522            		  operation, 
523            		  CIMOM_Q_ID, 
524            		  response, 
525            		  blocking),
526                 qid(queue_id) 
527            {  
528            	 
529            }
530            
531            EnumerateServiceResponse::EnumerateServiceResponse(Uint32 key, 
532            						   Uint32 routing, 
533            						   AsyncOpNode *operation, 
534            						   Uint32 result_code, 
535            						   Uint32 response, 
536            						   Boolean blocking,
537            						   String service_name, 
538            						   Uint32 service_capabilities, 
539            						   Uint32 service_mask, 
540            						   Uint32 service_qid)
541 mday  1.1     : AsyncReply(async_messages::ENUMERATE_SERVICE_RESULT, 
542            		key, 
543            		routing, 0,
544            		operation,
545            		result_code,
546            		response, 
547            		blocking),
548                 name(service_name),
549                 capabilities(service_capabilities),
550                 mask(service_mask),
551                 qid(service_qid) 
552            {
553            	 
554            }
555            
556            
557            PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2