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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2