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

  1 mday  1.1 //%///-*-c++-*-/////////////////////////////////////////////////////////////////
  2           //
  3           // Copyright (c) 2000, 2001 BMC Software, Hewlett-Packard Company, IBM,
  4           // The Open Group, Tivoli Systems
  5           //
  6           // Permission is hereby granted, free of charge, to any person obtaining a copy
  7           // of this software and associated documentation files (the "Software"), to 
  8           // deal in the Software without restriction, including without limitation the 
  9           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 
 10           // sell copies of the Software, and to permit persons to whom the Software is
 11           // furnished to do so, subject to the following conditions:
 12           // 
 13           // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN 
 14           // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 15           // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 16           // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
 17           // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
 18           // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 
 19           // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 20           // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 21           //
 22 mday  1.1 //==============================================================================
 23           //
 24           // Author: Mike Day (mdday@us.ibm.com)
 25           //
 26           // Modified By: 
 27           //
 28           //%/////////////////////////////////////////////////////////////////////////////
 29           
 30           #include "CimomMessage.h"
 31           
 32           PEGASUS_NAMESPACE_BEGIN
 33           
 34           const Uint32 CIMOM_Q_ID = MessageQueue::getNextQueueId();
 35           
 36           const Uint32 async_results::OK =                        0x00000000;
 37           const Uint32 async_results::PARAMETER_ERROR =           0x00000001;
 38           const Uint32 async_results::MODULE_ALREADY_REGISTERED = 0x00000002;
 39           const Uint32 async_results::MODULE_NOT_FOUND =          0x00000003;
 40           const Uint32 async_results::INTERNAL_ERROR =            0x00000004;
 41           
 42           
 43 mday  1.1 const Uint32 async_results::ASYNC_STARTED =             0x00000005;
 44           const Uint32 async_results::ASYNC_PROCESSING =          0x00000006;
 45           const Uint32 async_results::ASYNC_COMPLETE =            0x00000007;
 46           const Uint32 async_results::ASYNC_CANCELLED =           0x00000008;
 47           const Uint32 async_results::ASYNC_PAUSED =              0x00000009;
 48           const Uint32 async_results::ASYNC_RESUMED =             0x0000000a;
 49           
 50           const Uint32 async_results::CIM_SERVICE_STARTED =       0x0000000b;
 51           const Uint32 async_results::CIM_SERVICE_STOPPED  =      0x0000000c;
 52           
 53           const Uint32 async_results::CIM_SERVICE_PAUSED  =       0x0000000d;
 54           const Uint32 async_results::CIM_SERVICE_RESUMED =       0x0000000e;
 55           const Uint32 async_results::CIM_NAK =                   0x0000000f;
 56           
 57           const Uint32 async_results::ASYNC_PHASE_COMPLETE =      0x00000010;
 58           const Uint32 async_results::ASYNC_CHILD_COMPLETE =      0x00000011;
 59           const Uint32 async_results::ASYNC_PHASE_STARTED =       0x00000012;
 60           const Uint32 async_results::ASYNC_CHILD_STARTED =       0x00000013;
 61           
 62           
 63           const Uint32 async_messages::HEARTBEAT =                0x00000000;
 64 mday  1.1 const Uint32 async_messages::REPLY =                    0x00000000;
 65           const Uint32 async_messages::REGISTER_CIM_SERVICE =     0x00000001;
 66           const Uint32 async_messages::DEREGISTER_CIM_SERVICE =   0x00000002;
 67           const Uint32 async_messages::UPDATE_CIM_SERVICE =       0x00000003;
 68           const Uint32 async_messages::IOCTL =                    0x00000004;
 69           const Uint32 async_messages::CIMSERVICE_START =         0x00000005;
 70           const Uint32 async_messages::CIMSERVICE_STOP =          0x00000006;
 71           const Uint32 async_messages::CIMSERVICE_PAUSE =         0x00000007;
 72           const Uint32 async_messages::CIMSERVICE_RESUME =        0x00000008;
 73           
 74           const Uint32 async_messages::ASYNC_OP_START =           0x00000009;
 75           const Uint32 async_messages::ASYNC_OP_RESULT =          0x0000000a;
 76           const Uint32 async_messages::ASYNC_LEGACY_OP_START =    0x0000000b;
 77           const Uint32 async_messages::ASYNC_LEGACY_OP_RESULT =   0x0000000c;
 78           
 79           const Uint32 async_messages::FIND_SERVICE_Q =           0x0000000d;
 80           const Uint32 async_messages::FIND_SERVICE_Q_RESULT =    0x0000000e;
 81           const Uint32 async_messages::ENUMERATE_SERVICE =        0x0000000f;
 82           const Uint32 async_messages::ENUMERATE_SERVICE_RESULT = 0x00000010;
 83           
 84           
 85 mday  1.1 AsyncMessage::AsyncMessage(Uint32 type, 
 86           			   Uint32 key, 
 87           			   Uint32 routing,
 88           			   Uint32 mask,
 89           			   AsyncOpNode *operation)
 90              : Message(type, key, routing, mask | message_mask::ha_async),
 91 mday  1.3      op(operation),
 92                _myself(0), 
 93                _service(0)
 94 mday  1.1 {  
 95              
 96           }
 97           
 98           
 99           AsyncRequest::AsyncRequest(Uint32 type, 
100           			   Uint32 key, 
101           			   Uint32 routing,
102           			   Uint32 mask,
103           			   AsyncOpNode *operation,
104           			   Uint32 destination,
105           			   Uint32 response,
106           			   Boolean blocking) 
107              : AsyncMessage(type, key, routing, mask | message_mask::ha_request, operation),
108                dest(destination),
109                resp(response),
110                block(blocking) 
111           {  
112 mday  1.2    if( op != 0 )
113                 op->put_request(this);
114 mday  1.1 }
115           
116           AsyncReply::AsyncReply(Uint32 type, 
117           		       Uint32 key, 
118           		       Uint32 routing, 
119           		       Uint32 mask,
120           		       AsyncOpNode *operation,
121           		       Uint32 result_code,
122           		       Uint32 destination,
123           		       Boolean blocking) 
124              : AsyncMessage(type, key, routing, mask | message_mask::ha_reply, operation),
125                result(result_code),
126                dest(destination),
127                block(blocking) 
128           {  
129 mday  1.2    if( op != 0 )
130                 op->put_response(this);
131 mday  1.1 }
132           
133           
134           
135           
136           RegisterCimService::RegisterCimService(Uint32 routing, 
137           				       AsyncOpNode *operation,
138           				       Boolean blocking,
139           				       String service_name,
140           				       Uint32 service_capabilities, 
141           				       Uint32 service_mask,
142           				       Uint32 service_queue)
143              : AsyncRequest( async_messages::REGISTER_CIM_SERVICE,
144           		   Message::getNextKey(),
145           		   routing, 0, operation, CIMOM_Q_ID,
146           		   service_queue, blocking),
147                name(service_name),
148                capabilities(service_capabilities),
149                mask(service_mask),
150                queue(service_queue) 
151           {   
152 mday  1.1    
153           }
154                 
155           
156           DeRegisterCimService::DeRegisterCimService(Uint32 routing, 
157           					   AsyncOpNode *operation,
158           					   Boolean blocking, 
159           					   Uint32 service_queue)
160              : AsyncRequest( async_messages::DEREGISTER_CIM_SERVICE,
161           		   Message::getNextKey(), 
162           		   routing, 0, operation, CIMOM_Q_ID, 
163           		   service_queue, blocking),
164                queue(service_queue) 
165           {   
166           	 
167           }
168           
169           
170           
171           UpdateCimService::UpdateCimService(Uint32 routing, 
172           				   AsyncOpNode *operation,
173 mday  1.1 				   Boolean blocking, 
174           				   Uint32 service_queue, 
175           				   Uint32 service_capabilities, 
176           				   Uint32 service_mask) 
177              : AsyncRequest( async_messages::UPDATE_CIM_SERVICE, 
178           		   Message::getNextKey(), 
179           		   routing, 0, operation, CIMOM_Q_ID, 
180           		   service_queue, blocking),
181                queue(service_queue),
182                capabilities(service_capabilities),
183                mask(service_mask) 
184           {   
185              
186           }
187           
188           
189           AsyncIoctl::AsyncIoctl(Uint32 routing, 
190           		       AsyncOpNode *operation, 
191           		       Uint32 destination, 
192           		       Uint32 response,
193           		       Boolean blocking,
194 mday  1.1 		       Uint32 code, 
195           		       Uint32 int_param,
196           		       void *p_param)
197              : AsyncRequest( async_messages::IOCTL, 
198           		   Message::getNextKey(), 
199           		   routing, 0, operation, 
200           		   destination, response, blocking),
201                ctl(code), 
202                intp(int_param),
203 mday  1.3      voidp(p_param)
204 mday  1.1 {  
205           	 
206           }
207           
208           
209           CimServiceStart::CimServiceStart(Uint32 routing, 
210           				 AsyncOpNode *operation, 
211           				 Uint32 destination, 
212           				 Uint32 response, 
213           				 Boolean blocking)
214              : AsyncRequest(async_messages::CIMSERVICE_START,
215           		  Message::getNextKey(), routing, 
216           		  0, operation, destination, 
217           		  response, blocking) 
218           {  
219           	 
220           }
221           
222           
223           CimServiceStop::CimServiceStop(Uint32 routing, 
224           			       AsyncOpNode *operation, 
225 mday  1.1 			       Uint32 destination, 
226           			       Uint32 response, 
227           			       Boolean blocking)
228              : AsyncRequest(async_messages::CIMSERVICE_STOP,
229           		  Message::getNextKey(), routing, 
230           		  0, operation, destination, 
231           		  response, blocking) 
232           {  
233           
234           }
235           
236           
237           
238           CimServicePause::CimServicePause(Uint32 routing, 
239           				 AsyncOpNode *operation, 
240           				 Uint32 destination, 
241           				 Uint32 response, 
242           				 Boolean blocking)
243              : AsyncRequest(async_messages::CIMSERVICE_PAUSE,
244           		  Message::getNextKey(), routing, 
245           		  0, operation, destination, 
246 mday  1.1 		  response, blocking) 
247           {  
248           	 
249           }
250           
251           
252           CimServiceResume::CimServiceResume(Uint32 routing, 
253           				   AsyncOpNode *operation, 
254           				   Uint32 destination, 
255           				   Uint32 response, 
256           				   Boolean blocking)
257              : AsyncRequest(async_messages::CIMSERVICE_RESUME,
258           		  Message::getNextKey(), routing, 
259           		  0, operation, destination, 
260           		  response, blocking) 
261           {  
262           	 
263           }
264           
265           AsyncOperationStart::AsyncOperationStart(Uint32 routing, 
266           					 AsyncOpNode *operation, 
267 mday  1.1 					 Uint32 destination, 
268           					 Uint32 response, 
269           					 Boolean blocking, 
270           					 Message *action)
271              : AsyncRequest(async_messages::ASYNC_OP_START, 
272           		  Message::getNextKey(), routing, 0,
273           		  operation, 
274           		  destination, response, blocking),
275                act(action) 
276           {  
277 mday  1.2    if( op != 0 )
278                 op->put_request(act);
279 mday  1.1 }
280           
281           
282           AsyncOperationResult::AsyncOperationResult(Uint32 key, 
283           					   Uint32 routing, 
284           					   AsyncOpNode *operation,
285           					   Uint32 result_code, 
286           					   Uint32 destination,
287           					   Uint32 blocking)
288              : AsyncReply(async_messages::ASYNC_OP_RESULT, 
289           		key, routing, 0,
290           		operation, result_code, destination, 
291           		blocking) 
292           {   
293           	 
294           }
295           
296           
297           
298           AsyncLegacyOperationStart::AsyncLegacyOperationStart(Uint32 routing, 
299           						     AsyncOpNode *operation, 
300 mday  1.1 						     Uint32 destination, 
301           						     Message *action)
302              : AsyncRequest(async_messages::ASYNC_LEGACY_OP_START, 
303           		  Message::getNextKey(), routing, 0,
304           		  operation, destination, CIMOM_Q_ID, false),
305                act(action) 
306           {  
307 mday  1.2    if( op != 0 )
308                 op->put_request(act);
309 mday  1.1 }
310           
311           
312           AsyncLegacyOperationResult::AsyncLegacyOperationResult(Uint32 key, 
313           						       Uint32 routing, 
314           						       AsyncOpNode *operation,
315           						       Message *result)
316              : AsyncReply(async_messages::ASYNC_LEGACY_OP_RESULT, 
317           		key, routing, 0, operation, 
318           		0, CIMOM_Q_ID, false),
319                res(result)
320           {   
321 mday  1.2    if( op != 0 )
322                 op->put_response(res);
323 mday  1.1 }
324                 
325           
326           
327           FindServiceQueue::FindServiceQueue(Uint32 routing, 
328           				   AsyncOpNode *operation, 
329           				   Uint32 response,
330           				   Boolean blocking, 
331           				   String service_name, 
332           				   Uint32 service_capabilities, 
333           				   Uint32 service_mask)
334              : AsyncRequest(async_messages::FIND_SERVICE_Q, 
335           		  Message::getNextKey(),
336           		  routing, 0, operation, 
337           		  CIMOM_Q_ID, 
338           		  response, 
339           		  blocking),
340                name(service_name),
341                capabilities(service_capabilities),
342                mask(service_mask) 
343           { 
344 mday  1.1 	 
345           }
346           
347           
348           
349           FindServiceQueueResult::FindServiceQueueResult(Uint32 key, 
350           					       Uint32 routing, 
351           					       AsyncOpNode *operation, 
352           					       Uint32 result_code, 
353           					       Uint32 destination, 
354           					       Boolean blocking, 
355           					       Array<Uint32> queue_ids)
356              : AsyncReply(async_messages::FIND_SERVICE_Q_RESULT, 
357           		key, routing, 0, operation, 
358           		result_code, destination, blocking),
359                qids(queue_ids) 
360           {  
361           	 
362           }
363           
364           EnumerateService::EnumerateService(Uint32 routing, 
365 mday  1.1 				   AsyncOpNode *operation, 
366           				   Uint32 response, 
367           				   Boolean blocking, 
368           				   Uint32 queue_id)
369              : AsyncRequest(async_messages::ENUMERATE_SERVICE, 
370           		  Message::getNextKey(),
371           		  routing, 0, 
372           		  operation, 
373           		  CIMOM_Q_ID, 
374           		  response, 
375           		  blocking),
376                qid(queue_id) 
377           {  
378           	 
379           }
380           
381           EnumerateServiceResponse::EnumerateServiceResponse(Uint32 key, 
382           						   Uint32 routing, 
383           						   AsyncOpNode *operation, 
384           						   Uint32 result_code, 
385           						   Uint32 response, 
386 mday  1.1 						   Boolean blocking,
387           						   String service_name, 
388           						   Uint32 service_capabilities, 
389           						   Uint32 service_mask, 
390           						   Uint32 service_qid)
391              : AsyncReply(async_messages::ENUMERATE_SERVICE_RESULT, 
392           		key, 
393           		routing, 0,
394           		operation,
395           		result_code,
396           		response, 
397           		blocking),
398                name(service_name),
399                capabilities(service_capabilities),
400                mask(service_mask),
401                qid(service_qid) 
402           {
403           	 
404           }
405           
406           
407 mday  1.1 PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2