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

  1 kumpf 1.16 //%/////////////////////////////////////////////////////////////////////////////
  2 mday  1.1  //
  3 kumpf 1.16 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
  4 mday  1.1  // The Open Group, Tivoli Systems
  5            //
  6            // Permission is hereby granted, free of charge, to any person obtaining a copy
  7 kumpf 1.16 // 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 mday  1.1  // 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 kumpf 1.16 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 14 mday  1.1  // 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 kumpf 1.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 mday  1.1  // 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            //==============================================================================
 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.15 const Uint32 async_messages::HEARTBEAT =                       DUMMY_MESSAGE;
 67            const Uint32 async_messages::REPLY =                           DUMMY_MESSAGE;
 68            const Uint32 async_messages::REGISTER_CIM_SERVICE =            NUMBER_OF_MESSAGES + 0x00000001;
 69            const Uint32 async_messages::DEREGISTER_CIM_SERVICE =          NUMBER_OF_MESSAGES + 0x00000002;
 70            const Uint32 async_messages::UPDATE_CIM_SERVICE =              NUMBER_OF_MESSAGES + 0x00000003;
 71            const Uint32 async_messages::IOCTL =                           NUMBER_OF_MESSAGES + 0x00000004;
 72            const Uint32 async_messages::CIMSERVICE_START =                NUMBER_OF_MESSAGES + 0x00000005;
 73            const Uint32 async_messages::CIMSERVICE_STOP =                 NUMBER_OF_MESSAGES + 0x00000006;
 74            const Uint32 async_messages::CIMSERVICE_PAUSE =                NUMBER_OF_MESSAGES + 0x00000007;
 75            const Uint32 async_messages::CIMSERVICE_RESUME =               NUMBER_OF_MESSAGES + 0x00000008;
 76 mday  1.13 
 77 mday  1.15 const Uint32 async_messages::ASYNC_OP_START =                  NUMBER_OF_MESSAGES + 0x00000009;
 78            const Uint32 async_messages::ASYNC_OP_RESULT =                 NUMBER_OF_MESSAGES + 0x0000000a;
 79            const Uint32 async_messages::ASYNC_LEGACY_OP_START =           NUMBER_OF_MESSAGES + 0x0000000b;
 80            const Uint32 async_messages::ASYNC_LEGACY_OP_RESULT =          NUMBER_OF_MESSAGES + 0x0000000c;
 81 mday  1.13 
 82 mday  1.15 const Uint32 async_messages::FIND_SERVICE_Q =                  NUMBER_OF_MESSAGES + 0x0000000d;
 83            const Uint32 async_messages::FIND_SERVICE_Q_RESULT =           NUMBER_OF_MESSAGES + 0x0000000e;
 84            const Uint32 async_messages::ENUMERATE_SERVICE =               NUMBER_OF_MESSAGES + 0x0000000f;
 85            const Uint32 async_messages::ENUMERATE_SERVICE_RESULT =        NUMBER_OF_MESSAGES + 0x00000010;
 86 mday  1.13 
 87 mday  1.15 const Uint32 async_messages::REGISTERED_MODULE =               NUMBER_OF_MESSAGES + 0x00000011;
 88            const Uint32 async_messages::DEREGISTERED_MODULE =             NUMBER_OF_MESSAGES + 0x00000012;
 89            const Uint32 async_messages::FIND_MODULE_IN_SERVICE =          NUMBER_OF_MESSAGES + 0x00000013;
 90            const Uint32 async_messages::FIND_MODULE_IN_SERVICE_RESPONSE = NUMBER_OF_MESSAGES + 0x00000014;
 91 mday  1.12 
 92 mday  1.15 const Uint32 async_messages::ASYNC_MODULE_OP_START =           NUMBER_OF_MESSAGES + 0x00000015;
 93            const Uint32 async_messages::ASYNC_MODULE_OP_RESULT  =         NUMBER_OF_MESSAGES + 0x00000016;
 94 mday  1.13 
 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 mday  1.14 Message * AsyncModuleOperationResult::get_result(void)
436            {
437               Message *ret = _res;
438               _res = 0;
439               ret->put_async(0);
440               return ret;
441            }
442            
443            
444 mday  1.1  AsyncLegacyOperationStart::AsyncLegacyOperationStart(Uint32 routing, 
445            						     AsyncOpNode *operation, 
446            						     Uint32 destination, 
447 mday  1.5  						     Message *action,
448            						     Uint32 action_destination)
449 mday  1.1     : AsyncRequest(async_messages::ASYNC_LEGACY_OP_START, 
450            		  Message::getNextKey(), routing, 0,
451            		  operation, destination, CIMOM_Q_ID, false),
452 mday  1.9       _act(action) , _legacy_destination(action_destination)
453 mday  1.1  {  
454 mday  1.9     _act->put_async(this);
455 mday  1.1  }
456            
457            
458 mday  1.9  Message * AsyncLegacyOperationStart::get_action(void)
459            {
460               Message *ret = _act;
461               _act = 0;
462            //   ret->put_async(0);
463               return ret;
464               
465            }
466            
467 mday  1.1  AsyncLegacyOperationResult::AsyncLegacyOperationResult(Uint32 key, 
468            						       Uint32 routing, 
469            						       AsyncOpNode *operation,
470            						       Message *result)
471               : AsyncReply(async_messages::ASYNC_LEGACY_OP_RESULT, 
472            		key, routing, 0, operation, 
473            		0, CIMOM_Q_ID, false),
474 mday  1.9       _res(result)
475 mday  1.1  {   
476 mday  1.9     _res->put_async(this);
477 mday  1.1  }
478                  
479 mday  1.9  Message *AsyncLegacyOperationResult::get_result(void)
480            {
481               Message *ret = _res;
482               _res = 0;
483            //   ret->put_async(0);
484               return ret;
485            }
486 mday  1.1  
487            FindServiceQueue::FindServiceQueue(Uint32 routing, 
488            				   AsyncOpNode *operation, 
489            				   Uint32 response,
490            				   Boolean blocking, 
491            				   String service_name, 
492            				   Uint32 service_capabilities, 
493            				   Uint32 service_mask)
494               : AsyncRequest(async_messages::FIND_SERVICE_Q, 
495            		  Message::getNextKey(),
496            		  routing, 0, operation, 
497            		  CIMOM_Q_ID, 
498            		  response, 
499            		  blocking),
500                 name(service_name),
501                 capabilities(service_capabilities),
502                 mask(service_mask) 
503            { 
504            	 
505            }
506            
507 mday  1.9   
508 mday  1.1  FindServiceQueueResult::FindServiceQueueResult(Uint32 key, 
509            					       Uint32 routing, 
510            					       AsyncOpNode *operation, 
511            					       Uint32 result_code, 
512            					       Uint32 destination, 
513            					       Boolean blocking, 
514            					       Array<Uint32> queue_ids)
515               : AsyncReply(async_messages::FIND_SERVICE_Q_RESULT, 
516            		key, routing, 0, operation, 
517            		result_code, destination, blocking),
518                 qids(queue_ids) 
519            {  
520            	 
521            }
522            
523            EnumerateService::EnumerateService(Uint32 routing, 
524            				   AsyncOpNode *operation, 
525            				   Uint32 response, 
526            				   Boolean blocking, 
527            				   Uint32 queue_id)
528               : AsyncRequest(async_messages::ENUMERATE_SERVICE, 
529 mday  1.1  		  Message::getNextKey(),
530            		  routing, 0, 
531            		  operation, 
532            		  CIMOM_Q_ID, 
533            		  response, 
534            		  blocking),
535                 qid(queue_id) 
536            {  
537            	 
538            }
539            
540            EnumerateServiceResponse::EnumerateServiceResponse(Uint32 key, 
541            						   Uint32 routing, 
542            						   AsyncOpNode *operation, 
543            						   Uint32 result_code, 
544            						   Uint32 response, 
545            						   Boolean blocking,
546            						   String service_name, 
547            						   Uint32 service_capabilities, 
548            						   Uint32 service_mask, 
549            						   Uint32 service_qid)
550 mday  1.1     : AsyncReply(async_messages::ENUMERATE_SERVICE_RESULT, 
551            		key, 
552            		routing, 0,
553            		operation,
554            		result_code,
555            		response, 
556            		blocking),
557                 name(service_name),
558                 capabilities(service_capabilities),
559                 mask(service_mask),
560                 qid(service_qid) 
561            {
562            	 
563            }
564            
565            
566            PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2