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 //%/////////////////////////////////////////////////////////////////////////////
33
34 #include "CimomMessage.h"
35
36 PEGASUS_NAMESPACE_BEGIN
37
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 const Uint32 async_results::ASYNC_STARTED = 0x00000005;
45 const Uint32 async_results::ASYNC_PROCESSING = 0x00000006;
46 const Uint32 async_results::ASYNC_COMPLETE = 0x00000007;
47 const Uint32 async_results::ASYNC_CANCELLED = 0x00000008;
48 mday 1.1 const Uint32 async_results::ASYNC_PAUSED = 0x00000009;
49 const Uint32 async_results::ASYNC_RESUMED = 0x0000000a;
50
51 const Uint32 async_results::CIM_SERVICE_STARTED = 0x0000000b;
52 const Uint32 async_results::CIM_SERVICE_STOPPED = 0x0000000c;
53
54 const Uint32 async_results::CIM_SERVICE_PAUSED = 0x0000000d;
55 const Uint32 async_results::CIM_SERVICE_RESUMED = 0x0000000e;
56 const Uint32 async_results::CIM_NAK = 0x0000000f;
57
58 const Uint32 async_results::ASYNC_PHASE_COMPLETE = 0x00000010;
59 const Uint32 async_results::ASYNC_CHILD_COMPLETE = 0x00000011;
60 const Uint32 async_results::ASYNC_PHASE_STARTED = 0x00000012;
61 const Uint32 async_results::ASYNC_CHILD_STARTED = 0x00000013;
|
62 mday 1.4 const Uint32 async_results::CIM_PAUSED = 0x00000014;
63 const Uint32 async_results::CIM_STOPPED = 0x00000015;
64
|
65 mday 1.1
|
66 jim.wunderlich 1.21 const Uint32 async_messages::HEARTBEAT = DUMMY_MESSAGE;
67 const Uint32 async_messages::REPLY = DUMMY_MESSAGE;
|
68 kumpf 1.28 const Uint32 async_messages::REGISTER_CIM_SERVICE =
69 ASYNC_REGISTER_CIM_SERVICE;
70 const Uint32 async_messages::DEREGISTER_CIM_SERVICE =
71 ASYNC_DEREGISTER_CIM_SERVICE;
72 const Uint32 async_messages::UPDATE_CIM_SERVICE =
73 ASYNC_UPDATE_CIM_SERVICE;
|
74 jim.wunderlich 1.21 const Uint32 async_messages::IOCTL = ASYNC_IOCTL;
75 const Uint32 async_messages::CIMSERVICE_START = ASYNC_CIMSERVICE_START;
76 const Uint32 async_messages::CIMSERVICE_STOP = ASYNC_CIMSERVICE_STOP;
77 const Uint32 async_messages::CIMSERVICE_PAUSE = ASYNC_CIMSERVICE_PAUSE;
78 const Uint32 async_messages::CIMSERVICE_RESUME = ASYNC_CIMSERVICE_RESUME;
79
80 const Uint32 async_messages::ASYNC_OP_START = ASYNC_ASYNC_OP_START;
81 const Uint32 async_messages::ASYNC_OP_RESULT = ASYNC_ASYNC_OP_RESULT;
|
82 kumpf 1.28 const Uint32 async_messages::ASYNC_LEGACY_OP_START =
83 ASYNC_ASYNC_LEGACY_OP_START;
84 const Uint32 async_messages::ASYNC_LEGACY_OP_RESULT =
85 ASYNC_ASYNC_LEGACY_OP_RESULT;
86
87 const Uint32 async_messages::FIND_SERVICE_Q =
88 ASYNC_FIND_SERVICE_Q;
89 const Uint32 async_messages::FIND_SERVICE_Q_RESULT =
90 ASYNC_FIND_SERVICE_Q_RESULT;
91 const Uint32 async_messages::ENUMERATE_SERVICE =
92 ASYNC_ENUMERATE_SERVICE;
93 const Uint32 async_messages::ENUMERATE_SERVICE_RESULT =
94 ASYNC_ENUMERATE_SERVICE_RESULT;
95
96 const Uint32 async_messages::REGISTERED_MODULE =
97 ASYNC_REGISTERED_MODULE;
98 const Uint32 async_messages::DEREGISTERED_MODULE =
99 ASYNC_DEREGISTERED_MODULE;
100 const Uint32 async_messages::FIND_MODULE_IN_SERVICE =
101 ASYNC_FIND_MODULE_IN_SERVICE;
102 const Uint32 async_messages::FIND_MODULE_IN_SERVICE_RESPONSE =
103 kumpf 1.28 ASYNC_FIND_MODULE_IN_SERVICE_RESPONSE;
104 const Uint32 async_messages::ASYNC_MODULE_OP_START =
105 ASYNC_ASYNC_MODULE_OP_START;
106 const Uint32 async_messages::ASYNC_MODULE_OP_RESULT =
107 ASYNC_ASYNC_MODULE_OP_RESULT;
|
108 mday 1.13
|
109 mday 1.12
|
110 kumpf 1.26 AsyncMessage::AsyncMessage(
111 Uint32 type,
112 Uint32 destination,
113 Uint32 mask,
114 AsyncOpNode* operation)
|
115 kumpf 1.27 : Message(type, destination, mask | MessageMask::ha_async),
|
116 kumpf 1.26 op(operation)
117 {
118 }
|
119 mday 1.1
|
120 kumpf 1.26 AsyncRequest::AsyncRequest(
121 Uint32 type,
122 Uint32 mask,
123 AsyncOpNode* operation,
124 Uint32 destination,
125 Uint32 response,
126 Boolean blocking)
127 : AsyncMessage(
|
128 kumpf 1.27 type, destination, mask | MessageMask::ha_request, operation),
|
129 kumpf 1.26 resp(response),
130 block(blocking)
131 {
132 if (op != 0)
133 op->setRequest(this);
134 }
135
136 AsyncReply::AsyncReply(
137 Uint32 type,
138 Uint32 mask,
139 AsyncOpNode* operation,
140 Uint32 resultCode,
141 Uint32 destination,
142 Boolean blocking)
143 : AsyncMessage(
|
144 kumpf 1.27 type, destination, mask | MessageMask::ha_reply, operation),
|
145 kumpf 1.26 result(resultCode),
146 block(blocking)
147 {
148 if (op != 0)
149 op->setResponse(this);
|
150 mday 1.1 }
151
|
152 kumpf 1.24 RegisterCimService::RegisterCimService(
|
153 kumpf 1.26 AsyncOpNode* operation,
154 Boolean blocking,
155 const String& serviceName,
156 Uint32 serviceCapabilities,
157 Uint32 serviceMask,
158 Uint32 serviceQueue)
159 : AsyncRequest(
160 async_messages::REGISTER_CIM_SERVICE,
161 0, operation, CIMOM_Q_ID,
162 serviceQueue, blocking),
163 name(serviceName),
164 capabilities(serviceCapabilities),
165 mask(serviceMask),
166 queue(serviceQueue)
167 {
|
168 mday 1.1 }
|
169 kumpf 1.26
|
170 mday 1.1
|
171 kumpf 1.24 DeRegisterCimService::DeRegisterCimService(
|
172 kumpf 1.26 AsyncOpNode* operation,
173 Boolean blocking,
174 Uint32 serviceQueue)
175 : AsyncRequest(
176 async_messages::DEREGISTER_CIM_SERVICE,
177 0, operation, CIMOM_Q_ID,
178 serviceQueue, blocking),
179 queue(serviceQueue)
180 {
|
181 mday 1.1 }
182
183
|
184 kumpf 1.24 UpdateCimService::UpdateCimService(
|
185 kumpf 1.26 AsyncOpNode* operation,
186 Boolean blocking,
187 Uint32 serviceQueue,
188 Uint32 serviceCapabilities,
189 Uint32 serviceMask)
190 : AsyncRequest(
191 async_messages::UPDATE_CIM_SERVICE,
192 0, operation, CIMOM_Q_ID,
193 serviceQueue, blocking),
194 queue(serviceQueue),
195 capabilities(serviceCapabilities),
196 mask(serviceMask)
197 {
|
198 mday 1.1 }
199
|
200 kumpf 1.24 RegisteredModule::RegisteredModule(
|
201 kumpf 1.26 AsyncOpNode* operation,
202 Boolean blocking,
203 Uint32 serviceQueue,
204 const String& newModule)
205 : AsyncRequest(
206 async_messages::REGISTERED_MODULE,
207 0,
208 operation,
209 CIMOM_Q_ID,
210 serviceQueue,
211 blocking),
212 _module(newModule)
|
213 mday 1.12 {
214 }
215
|
216 kumpf 1.24 DeRegisteredModule::DeRegisteredModule(
|
217 kumpf 1.26 AsyncOpNode* operation,
218 Boolean blocking,
219 Uint32 serviceQueue,
220 const String& removedModule)
221 : AsyncRequest(
222 async_messages::DEREGISTERED_MODULE,
223 0,
224 operation,
225 CIMOM_Q_ID,
226 serviceQueue,
227 blocking),
228 _module(removedModule)
|
229 mday 1.12 {
230 }
231
232
|
233 kumpf 1.24 FindModuleInService::FindModuleInService(
|
234 kumpf 1.26 AsyncOpNode* operation,
235 Boolean blocking,
236 Uint32 responseQueue,
237 const String& module)
238 : AsyncRequest(
239 async_messages::FIND_MODULE_IN_SERVICE,
240 0,
241 operation,
242 CIMOM_Q_ID,
243 responseQueue,
244 blocking),
245 _module(module)
|
246 mday 1.12 {
247 }
248
|
249 kumpf 1.24 FindModuleInServiceResponse::FindModuleInServiceResponse(
|
250 kumpf 1.26 AsyncOpNode* operation,
251 Uint32 resultCode,
252 Uint32 destination,
253 Boolean blocking,
254 Uint32 moduleServiceQueue)
255 : AsyncReply(
256 async_messages::FIND_MODULE_IN_SERVICE_RESPONSE,
257 0,
258 operation,
259 resultCode,
260 destination,
261 blocking),
262 _module_service_queue(moduleServiceQueue)
|
263 mday 1.12 {
264 }
|
265 mday 1.1
|
266 kumpf 1.24 AsyncIoctl::AsyncIoctl(
|
267 kumpf 1.26 AsyncOpNode* operation,
268 Uint32 destination,
269 Uint32 response,
270 Boolean blocking,
271 Uint32 code,
272 Uint32 intParam,
273 void* pParam)
274 : AsyncRequest(
275 async_messages::IOCTL,
276 0, operation,
277 destination, response, blocking),
278 ctl(code),
279 intp(intParam),
280 voidp(pParam)
281 {
|
282 mday 1.1 }
283
284
|
285 kumpf 1.24 CimServiceStart::CimServiceStart(
|
286 kumpf 1.26 AsyncOpNode* operation,
287 Uint32 destination,
288 Uint32 response,
289 Boolean blocking)
290 : AsyncRequest(
291 async_messages::CIMSERVICE_START,
292 0, operation, destination,
293 response, blocking)
294 {
|
295 mday 1.1 }
296
297
|
298 kumpf 1.24 CimServiceStop::CimServiceStop(
|
299 kumpf 1.26 AsyncOpNode* operation,
300 Uint32 destination,
301 Uint32 response,
302 Boolean blocking)
303 : AsyncRequest(
304 async_messages::CIMSERVICE_STOP,
305 0, operation, destination,
306 response, blocking)
307 {
|
308 mday 1.1 }
309
310
|
311 kumpf 1.24 CimServicePause::CimServicePause(
|
312 kumpf 1.26 AsyncOpNode* operation,
313 Uint32 destination,
314 Uint32 response,
315 Boolean blocking)
316 : AsyncRequest(
317 async_messages::CIMSERVICE_PAUSE,
318 0, operation, destination,
319 response, blocking)
320 {
|
321 mday 1.1 }
322
323
|
324 kumpf 1.24 CimServiceResume::CimServiceResume(
|
325 kumpf 1.26 AsyncOpNode* operation,
326 Uint32 destination,
327 Uint32 response,
328 Boolean blocking)
329 : AsyncRequest(
330 async_messages::CIMSERVICE_RESUME,
331 0, operation, destination,
332 response, blocking)
333 {
|
334 mday 1.1 }
335
|
336 kumpf 1.24 AsyncOperationStart::AsyncOperationStart(
|
337 kumpf 1.26 AsyncOpNode* operation,
338 Uint32 destination,
339 Uint32 response,
340 Boolean blocking,
341 Message* action)
342 : AsyncRequest(
343 async_messages::ASYNC_OP_START,
344 0,
345 operation,
346 destination, response, blocking),
347 _act(action)
348 {
|
349 mday 1.1 }
350
|
351 kumpf 1.26 Message* AsyncOperationStart::get_action()
352 {
353 Message* ret = _act;
354 _act = 0;
355 ret->put_async(0);
356 return ret;
|
357 mday 1.9 }
358
|
359 kumpf 1.24 AsyncOperationResult::AsyncOperationResult(
|
360 kumpf 1.26 AsyncOpNode* operation,
361 Uint32 resultCode,
362 Uint32 destination,
363 Boolean blocking)
364 : AsyncReply(
365 async_messages::ASYNC_OP_RESULT,
366 0,
367 operation,
368 resultCode,
369 destination,
370 blocking)
371 {
|
372 mday 1.1 }
373
374
|
375 kumpf 1.24 AsyncModuleOperationStart::AsyncModuleOperationStart(
|
376 kumpf 1.26 AsyncOpNode* operation,
377 Uint32 destination,
378 Uint32 response,
379 Boolean blocking,
380 const String& targetModule,
381 Message* action)
382 : AsyncRequest(
383 async_messages::ASYNC_MODULE_OP_START,
384 0,
385 operation,
386 destination,
387 response,
388 blocking),
389 _target_module(targetModule),
390 _act(action)
391 {
392 _act->put_async(this);
|
393 mday 1.13 }
394
395
|
396 kumpf 1.26 Message* AsyncModuleOperationStart::get_action()
397 {
398 Message* ret = _act;
399 _act = 0;
400 ret->put_async(0);
401 return ret;
|
402 mday 1.13 }
403
|
404 kumpf 1.24 AsyncModuleOperationResult::AsyncModuleOperationResult(
|
405 kumpf 1.26 AsyncOpNode* operation,
406 Uint32 resultCode,
407 Uint32 destination,
408 Boolean blocking,
409 const String& targetModule,
410 Message* result)
411 : AsyncReply(
412 async_messages::ASYNC_MODULE_OP_RESULT,
413 0,
414 operation, resultCode, destination,
415 blocking),
416 _targetModule(targetModule),
417 _res(result)
418 {
419 _res->put_async(this);
420 }
421
422 Message* AsyncModuleOperationResult::get_result()
423 {
424 Message* ret = _res;
425 _res = 0;
426 kumpf 1.26 ret->put_async(0);
427 return ret;
|
428 mday 1.14 }
429
430
|
431 kumpf 1.24 AsyncLegacyOperationStart::AsyncLegacyOperationStart(
|
432 kumpf 1.26 AsyncOpNode* operation,
433 Uint32 destination,
434 Message* action,
435 Uint32 actionDestination)
436 : AsyncRequest(
437 async_messages::ASYNC_LEGACY_OP_START,
438 0,
439 operation, destination, CIMOM_Q_ID, false),
440 _act(action),
441 _legacy_destination(actionDestination)
442 {
443 _act->put_async(this);
|
444 mday 1.1 }
445
446
|
447 kumpf 1.26 Message* AsyncLegacyOperationStart::get_action()
448 {
449 Message* ret = _act;
450 _act = 0;
451 // ret->put_async(0);
452 return ret;
453
|
454 mday 1.9 }
455
|
456 kumpf 1.24 AsyncLegacyOperationResult::AsyncLegacyOperationResult(
|
457 kumpf 1.26 AsyncOpNode* operation,
458 Message* result)
459 : AsyncReply(
460 async_messages::ASYNC_LEGACY_OP_RESULT,
461 0, operation,
462 0, CIMOM_Q_ID, false),
463 _res(result)
464 {
465 _res->put_async(this);
466 }
467
468 Message* AsyncLegacyOperationResult::get_result()
469 {
470 Message* ret = _res;
471 _res = 0;
472 // ret->put_async(0);
473 return ret;
|
474 mday 1.9 }
|
475 mday 1.1
|
476 kumpf 1.24 FindServiceQueue::FindServiceQueue(
|
477 kumpf 1.26 AsyncOpNode* operation,
478 Uint32 response,
479 Boolean blocking,
480 const String& serviceName,
481 Uint32 serviceCapabilities,
482 Uint32 serviceMask)
483 : AsyncRequest(
484 async_messages::FIND_SERVICE_Q,
485 0, operation,
486 CIMOM_Q_ID,
487 response,
488 blocking),
489 name(serviceName),
490 capabilities(serviceCapabilities),
491 mask(serviceMask)
492 {
|
493 mday 1.1 }
494
|
495 kumpf 1.26
|
496 kumpf 1.24 FindServiceQueueResult::FindServiceQueueResult(
|
497 kumpf 1.26 AsyncOpNode* operation,
498 Uint32 resultCode,
499 Uint32 destination,
500 Boolean blocking,
501 Array<Uint32> queueIds)
502 : AsyncReply(
503 async_messages::FIND_SERVICE_Q_RESULT,
504 0, operation,
505 resultCode, destination, blocking),
506 qids(queueIds)
507 {
|
508 mday 1.1 }
509
|
510 kumpf 1.24 EnumerateService::EnumerateService(
|
511 kumpf 1.26 AsyncOpNode* operation,
512 Uint32 response,
513 Boolean blocking,
514 Uint32 queueId)
515 : AsyncRequest(
516 async_messages::ENUMERATE_SERVICE,
517 0,
518 operation,
519 CIMOM_Q_ID,
520 response,
521 blocking),
522 qid(queueId)
523 {
|
524 mday 1.1 }
525
|
526 kumpf 1.24 EnumerateServiceResponse::EnumerateServiceResponse(
|
527 kumpf 1.26 AsyncOpNode* operation,
528 Uint32 resultCode,
529 Uint32 response,
530 Boolean blocking,
531 const String& serviceName,
532 Uint32 serviceCapabilities,
533 Uint32 serviceMask,
534 Uint32 serviceQid)
535 : AsyncReply(
536 async_messages::ENUMERATE_SERVICE_RESULT,
537 0,
538 operation,
539 resultCode,
540 response,
541 blocking),
542 name(serviceName),
543 capabilities(serviceCapabilities),
544 mask(serviceMask),
545 qid(serviceQid)
|
546 mday 1.1 {
547 }
548
|
549 kumpf 1.26 AsyncMessage::~AsyncMessage()
|
550 karl 1.19 {
551 }
552
|
553 kumpf 1.26 AsyncRequest::~AsyncRequest()
|
554 karl 1.19 {
555 }
|
556 mday 1.1
557 PEGASUS_NAMESPACE_END
|