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