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