1 karl 1.22 //%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 karl 1.22 // 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 mask,
106 AsyncOpNode *operation)
|
107 kumpf 1.24 : Message(type, destination, 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 mask,
115 AsyncOpNode *operation,
116 Uint32 destination,
117 Uint32 response,
118 Boolean blocking)
|
119 kumpf 1.24 : AsyncMessage(type, destination, 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 mask,
129 AsyncOpNode *operation,
130 Uint32 result_code,
131 Uint32 destination,
132 Boolean blocking)
|
133 kumpf 1.24 : AsyncMessage(type, destination, 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 kumpf 1.24 RegisterCimService::RegisterCimService(
|
145 mday 1.1 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 kumpf 1.24 0, operation, CIMOM_Q_ID,
|
153 mday 1.1 service_queue, blocking),
154 name(service_name),
155 capabilities(service_capabilities),
156 mask(service_mask),
157 queue(service_queue)
158 {
159
160 }
161
162
|
163 kumpf 1.24 DeRegisterCimService::DeRegisterCimService(
|
164 mday 1.1 AsyncOpNode *operation,
165 Boolean blocking,
166 Uint32 service_queue)
167 : AsyncRequest( async_messages::DEREGISTER_CIM_SERVICE,
|
168 kumpf 1.24 0, operation, CIMOM_Q_ID,
|
169 mday 1.1 service_queue, blocking),
170 queue(service_queue)
171 {
172
173 }
174
175
176
|
177 kumpf 1.24 UpdateCimService::UpdateCimService(
|
178 mday 1.1 AsyncOpNode *operation,
179 Boolean blocking,
180 Uint32 service_queue,
181 Uint32 service_capabilities,
182 Uint32 service_mask)
183 : AsyncRequest( async_messages::UPDATE_CIM_SERVICE,
|
184 kumpf 1.24 0, operation, CIMOM_Q_ID,
|
185 mday 1.1 service_queue, blocking),
186 queue(service_queue),
187 capabilities(service_capabilities),
188 mask(service_mask)
189 {
190
191 }
192
|
193 kumpf 1.24 RegisteredModule::RegisteredModule(
|
194 mday 1.12 AsyncOpNode *operation,
195 Boolean blocking,
196 Uint32 service_queue,
197 String new_module)
198 : AsyncRequest( async_messages::REGISTERED_MODULE,
199 0,
200 operation,
201 CIMOM_Q_ID,
202 service_queue,
203 blocking),
204 _module(new_module)
205 {
206
207 }
208
|
209 kumpf 1.24 DeRegisteredModule::DeRegisteredModule(
|
210 mday 1.12 AsyncOpNode *operation,
211 Boolean blocking,
212 Uint32 service_queue,
213 String removed_module)
214 : AsyncRequest( async_messages::DEREGISTERED_MODULE,
215 0,
216 operation,
217 CIMOM_Q_ID,
218 service_queue,
219 blocking),
220 _module(removed_module)
221 {
222
223 }
224
225
|
226 kumpf 1.24 FindModuleInService::FindModuleInService(
|
227 mday 1.12 AsyncOpNode *operation,
228 Boolean blocking,
229 Uint32 response_queue,
230 String module)
231 : AsyncRequest(async_messages::FIND_MODULE_IN_SERVICE,
232 0,
233 operation,
234 CIMOM_Q_ID,
235 response_queue,
236 blocking),
237 _module(module)
238 {
239
240 }
241
|
242 kumpf 1.24 FindModuleInServiceResponse::FindModuleInServiceResponse(
|
243 mday 1.12 AsyncOpNode *operation,
244 Uint32 result_code,
245 Uint32 destination,
246 Uint32 blocking,
247 Uint32 module_service_queue)
248
249 : AsyncReply(async_messages::FIND_MODULE_IN_SERVICE_RESPONSE,
250 0,
251 operation,
252 result_code,
253 destination,
254 blocking),
255 _module_service_queue(module_service_queue)
256 {
257
258 }
|
259 mday 1.1
|
260 kumpf 1.24 AsyncIoctl::AsyncIoctl(
|
261 mday 1.1 AsyncOpNode *operation,
262 Uint32 destination,
263 Uint32 response,
264 Boolean blocking,
265 Uint32 code,
266 Uint32 int_param,
267 void *p_param)
268 : AsyncRequest( async_messages::IOCTL,
|
269 kumpf 1.24 0, operation,
|
270 mday 1.1 destination, response, blocking),
271 ctl(code),
272 intp(int_param),
|
273 mday 1.3 voidp(p_param)
|
274 mday 1.1 {
275
276 }
277
278
|
279 kumpf 1.24 CimServiceStart::CimServiceStart(
|
280 mday 1.1 AsyncOpNode *operation,
281 Uint32 destination,
282 Uint32 response,
283 Boolean blocking)
284 : AsyncRequest(async_messages::CIMSERVICE_START,
285 0, operation, destination,
286 response, blocking)
287 {
288
289 }
290
291
|
292 kumpf 1.24 CimServiceStop::CimServiceStop(
|
293 mday 1.1 AsyncOpNode *operation,
294 Uint32 destination,
295 Uint32 response,
296 Boolean blocking)
297 : AsyncRequest(async_messages::CIMSERVICE_STOP,
298 0, operation, destination,
299 response, blocking)
300 {
301
302 }
303
304
305
|
306 kumpf 1.24 CimServicePause::CimServicePause(
|
307 mday 1.1 AsyncOpNode *operation,
308 Uint32 destination,
309 Uint32 response,
310 Boolean blocking)
311 : AsyncRequest(async_messages::CIMSERVICE_PAUSE,
312 0, operation, destination,
313 response, blocking)
314 {
315
316 }
317
318
|
319 kumpf 1.24 CimServiceResume::CimServiceResume(
|
320 mday 1.1 AsyncOpNode *operation,
321 Uint32 destination,
322 Uint32 response,
323 Boolean blocking)
324 : AsyncRequest(async_messages::CIMSERVICE_RESUME,
325 0, operation, destination,
326 response, blocking)
327 {
328
329 }
330
|
331 kumpf 1.24 AsyncOperationStart::AsyncOperationStart(
|
332 mday 1.1 AsyncOpNode *operation,
333 Uint32 destination,
334 Uint32 response,
335 Boolean blocking,
336 Message *action)
337 : AsyncRequest(async_messages::ASYNC_OP_START,
|
338 kumpf 1.24 0,
|
339 mday 1.1 operation,
340 destination, response, blocking),
|
341 mday 1.9 _act(action)
|
342 mday 1.1 {
|
343 mday 1.7
|
344 mday 1.1 }
345
346
|
347 mday 1.10 Message * AsyncOperationStart::get_action(void)
|
348 mday 1.9 {
349 Message *ret = _act;
350 _act = 0;
351 ret->put_async(0);
352 return ret;
353
354 }
355
356
|
357 kumpf 1.24 AsyncOperationResult::AsyncOperationResult(
|
358 mday 1.1 AsyncOpNode *operation,
359 Uint32 result_code,
360 Uint32 destination,
361 Uint32 blocking)
362 : AsyncReply(async_messages::ASYNC_OP_RESULT,
|
363 kumpf 1.24 0,
|
364 mday 1.1 operation, result_code, destination,
365 blocking)
366 {
367
368 }
369
370
|
371 kumpf 1.24 AsyncModuleOperationStart::AsyncModuleOperationStart(
|
372 mday 1.13 AsyncOpNode *operation,
373 Uint32 destination,
374 Uint32 response,
375 Boolean blocking,
376 String target_module,
377 Message *action)
378 : AsyncRequest(async_messages::ASYNC_MODULE_OP_START,
|
379 kumpf 1.24 0,
|
380 mday 1.13 operation,
381 destination, response, blocking),
382 _target_module(target_module),
383 _act(action)
384 {
385 _act->put_async(this);
386
387 }
388
389
390 Message * AsyncModuleOperationStart::get_action(void)
391 {
392 Message *ret = _act;
393 _act = 0;
394 ret->put_async(0);
395 return ret;
396
397 }
398
|
399 kumpf 1.24 AsyncModuleOperationResult::AsyncModuleOperationResult(
|
400 mday 1.13 AsyncOpNode *operation,
401 Uint32 result_code,
402 Uint32 destination,
403 Uint32 blocking,
404 String target_module,
405 Message *result)
406 : AsyncReply(async_messages::ASYNC_MODULE_OP_RESULT,
|
407 kumpf 1.24 0,
|
408 mday 1.13 operation, result_code, destination,
409 blocking),
410 _target_module(target_module),
411 _res(result)
412 {
413 _res->put_async(this);
414 }
|
415 mday 1.1
|
416 mday 1.14 Message * AsyncModuleOperationResult::get_result(void)
417 {
418 Message *ret = _res;
419 _res = 0;
420 ret->put_async(0);
421 return ret;
422 }
423
424
|
425 kumpf 1.24 AsyncLegacyOperationStart::AsyncLegacyOperationStart(
|
426 mday 1.1 AsyncOpNode *operation,
427 Uint32 destination,
|
428 mday 1.5 Message *action,
429 Uint32 action_destination)
|
430 mday 1.1 : AsyncRequest(async_messages::ASYNC_LEGACY_OP_START,
|
431 kumpf 1.24 0,
|
432 mday 1.1 operation, destination, CIMOM_Q_ID, false),
|
433 mday 1.9 _act(action) , _legacy_destination(action_destination)
|
434 mday 1.1 {
|
435 mday 1.9 _act->put_async(this);
|
436 mday 1.1 }
437
438
|
439 mday 1.9 Message * AsyncLegacyOperationStart::get_action(void)
440 {
441 Message *ret = _act;
442 _act = 0;
443 // ret->put_async(0);
444 return ret;
445
446 }
447
|
448 kumpf 1.24 AsyncLegacyOperationResult::AsyncLegacyOperationResult(
|
449 mday 1.1 AsyncOpNode *operation,
450 Message *result)
451 : AsyncReply(async_messages::ASYNC_LEGACY_OP_RESULT,
|
452 kumpf 1.24 0, operation,
|
453 mday 1.1 0, CIMOM_Q_ID, false),
|
454 mday 1.9 _res(result)
|
455 mday 1.1 {
|
456 mday 1.9 _res->put_async(this);
|
457 mday 1.1 }
458
|
459 mday 1.9 Message *AsyncLegacyOperationResult::get_result(void)
460 {
461 Message *ret = _res;
462 _res = 0;
463 // ret->put_async(0);
464 return ret;
465 }
|
466 mday 1.1
|
467 kumpf 1.24 FindServiceQueue::FindServiceQueue(
|
468 mday 1.1 AsyncOpNode *operation,
469 Uint32 response,
470 Boolean blocking,
471 String service_name,
472 Uint32 service_capabilities,
473 Uint32 service_mask)
474 : AsyncRequest(async_messages::FIND_SERVICE_Q,
|
475 kumpf 1.24 0, operation,
|
476 mday 1.1 CIMOM_Q_ID,
477 response,
478 blocking),
479 name(service_name),
480 capabilities(service_capabilities),
481 mask(service_mask)
482 {
483
484 }
485
|
486 mday 1.9
|
487 kumpf 1.24 FindServiceQueueResult::FindServiceQueueResult(
|
488 mday 1.1 AsyncOpNode *operation,
489 Uint32 result_code,
490 Uint32 destination,
491 Boolean blocking,
492 Array<Uint32> queue_ids)
493 : AsyncReply(async_messages::FIND_SERVICE_Q_RESULT,
|
494 kumpf 1.24 0, operation,
|
495 mday 1.1 result_code, destination, blocking),
496 qids(queue_ids)
497 {
498
499 }
500
|
501 kumpf 1.24 EnumerateService::EnumerateService(
|
502 mday 1.1 AsyncOpNode *operation,
503 Uint32 response,
504 Boolean blocking,
505 Uint32 queue_id)
506 : AsyncRequest(async_messages::ENUMERATE_SERVICE,
|
507 kumpf 1.24 0,
|
508 mday 1.1 operation,
509 CIMOM_Q_ID,
510 response,
511 blocking),
512 qid(queue_id)
513 {
514
515 }
516
|
517 kumpf 1.24 EnumerateServiceResponse::EnumerateServiceResponse(
|
518 mday 1.1 AsyncOpNode *operation,
519 Uint32 result_code,
520 Uint32 response,
521 Boolean blocking,
522 String service_name,
523 Uint32 service_capabilities,
524 Uint32 service_mask,
525 Uint32 service_qid)
526 : AsyncReply(async_messages::ENUMERATE_SERVICE_RESULT,
|
527 kumpf 1.24 0,
|
528 mday 1.1 operation,
529 result_code,
530 response,
531 blocking),
532 name(service_name),
533 capabilities(service_capabilities),
534 mask(service_mask),
535 qid(service_qid)
536 {
537
538 }
539
|
540 karl 1.19 AsyncMessage::~AsyncMessage(void)
541 {
542 }
543
544 AsyncRequest::~AsyncRequest(void)
545 {
546 }
|
547 mday 1.1
548 PEGASUS_NAMESPACE_END
|