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