(file) Return to CimomMessage.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2