1 karl 1.62 //%2005////////////////////////////////////////////////////////////////////////
|
2 mike 1.4 //
|
3 karl 1.58 // 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.48 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.58 // 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.62 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 mike 1.4 //
12 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
13 chip 1.24 // of this software and associated documentation files (the "Software"), to
14 // deal in the Software without restriction, including without limitation the
15 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
16 mike 1.4 // sell copies of the Software, and to permit persons to whom the Software is
17 // furnished to do so, subject to the following conditions:
|
18 kumpf 1.37 //
|
19 chip 1.24 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
20 mike 1.4 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
21 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
22 chip 1.24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
23 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
25 mike 1.4 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 //==============================================================================
29 //
30 // Author: Mike Brasher (mbrasher@bmc.com)
31 //
|
32 mike 1.6 // Modified By: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
|
33 kumpf 1.27 // Carol Ann Krug Graves, Hewlett-Packard Company
34 // (carolann_graves@hp.com)
35 // Mike Day (mdday@us.ibm.com)
36 // Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
37 sage 1.30 // Arthur Pichlkostner (via Markus: sedgewick_de@yahoo.de)
|
38 w.white 1.56 // Willis White (whiwill@us.ibm.com) PEP 127 and 128
|
39 brian.campbell 1.55 // Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase1
|
40 a.arora 1.57 // Amit K Arora, IBM (amita@in.ibm.com) for Bug#1090
|
41 w.white 1.56 //
|
42 mike 1.4 //
43 //%/////////////////////////////////////////////////////////////////////////////
44
45 #ifndef Pegasus_Message_h
46 #define Pegasus_Message_h
47
|
48 mike 1.6 #include <Pegasus/Common/Config.h>
|
49 mike 1.4 #include <iostream>
|
50 mike 1.6 #include <cstring>
|
51 kumpf 1.39 #include <Pegasus/Common/InternalException.h>
|
52 mike 1.6 #include <Pegasus/Common/IPC.h>
|
53 sage 1.30 #include <Pegasus/Common/StatisticalData.h>
|
54 kumpf 1.38 #include <Pegasus/Common/Linkage.h>
|
55 w.white 1.52 #include <Pegasus/Common/CIMDateTime.h>
|
56 w.white 1.63 #include <Pegasus/Common/CIMOperationType.h>
|
57 mike 1.4
58 PEGASUS_NAMESPACE_BEGIN
59
|
60 mday 1.18 // REVIEW: could class be renamed to MessageMask (coding standard)
|
61 mike 1.11
|
62 chip 1.24 class PEGASUS_COMMON_LINKAGE message_mask
|
63 mike 1.6 {
64 public:
|
65 mike 1.11
|
66 mike 1.6 static Uint32 type_legacy;
|
67 mday 1.9 static Uint32 type_CIMOperation;
68 static Uint32 type_CIMAsyncOperation;
69 static Uint32 type_export;
70 static Uint32 type_lifetime;
|
71 mike 1.6 static Uint32 type_socket;
72 static Uint32 type_connection;
73 static Uint32 type_http;
|
74 kumpf 1.27 static Uint32 type_http_error;
|
75 mike 1.6 static Uint32 type_cimom;
|
76 mday 1.9 static Uint32 type_control;
77 static Uint32 type_service;
78 static Uint32 type_broadcast;
|
79 kumpf 1.28 static Uint32 type_client_exception;
|
80 chip 1.24
|
81 mday 1.9 static Uint32 ha_no_delete;
82 static Uint32 ha_request;
83 static Uint32 ha_reply;
|
84 mday 1.10 static Uint32 ha_synchronous;
|
85 mday 1.13 static Uint32 ha_async;
|
86 mday 1.22 static Uint32 ha_wait;
|
87 chip 1.24
88
89 // more for documentation than for use
|
90 mike 1.7
|
91 mday 1.9 inline Uint32 get_type(Uint32 flags)
|
92 mike 1.6 {
93 return (flags & 0x000fffff);
94 }
95
96 inline Uint32 get_handling(Uint32 flags)
97 {
98 return( flags & 0xfff00000);
99 }
100 };
101
|
102 mday 1.20 class cimom;
|
103 mike 1.4 class MessageQueue;
|
104 mday 1.19 class MessageQueueService;
105 class AsyncLegacyOperationStart;
106 class AsyncLegacyOperationResult;
|
107 mike 1.4
|
108 kumpf 1.40 enum HttpMethod
109 {
110 HTTP_METHOD__POST,
111 HTTP_METHOD_M_POST
112 };
113
|
114 chip 1.24 /** The Message class and derived classes are used to pass messages between
|
115 mike 1.4 modules. Messages are passed between modules using the message queues
116 (see MessageQueue class). Derived classes may add their own fields.
117 This base class defines two common fields: type, which is the type of
118 the message, and key which is a key value whose meaning is defined by
119 the derived class. The MessageQueue class provides methods for finding
120 messages by both type and key.
121
122 The Message class also provides previous and next pointers which are
123 used to place the messages on a queue by the MessageQueue class.
124 */
|
125 mike 1.5 class PEGASUS_COMMON_LINKAGE Message
|
126 mike 1.4 {
|
127 mday 1.8 public:
|
128 mike 1.4
|
129 mday 1.8 Message(
|
130 mday 1.20 Uint32 type,
131 Uint32 destination = 0,
|
132 chip 1.24 Uint32 key = getNextKey(),
|
133 mday 1.8 Uint32 routing_code = 0,
|
134 chip 1.24 Uint32 mask = message_mask::type_legacy )
135 :
136 _type(type),
137 _key(key),
138 _routing_code(routing_code),
|
139 mday 1.8 _mask(mask),
|
140 kumpf 1.45 _httpMethod (HTTP_METHOD__POST),
|
141 mday 1.44 _last_thread_id(pegasus_thread_self()),
|
142 chip 1.24 _next(0),
|
143 mday 1.19 _prev(0),
|
144 mday 1.20 _async(0),
|
145 brian.campbell 1.55 dest(destination),
146 _isComplete(true),
147 _index(0)
|
148 chip 1.24 {
|
149 mday 1.8
150 }
|
151 mike 1.6
|
152 mday 1.32 Message & operator = ( const Message & msg)
153 {
154 if (this != &msg)
155 {
156 _type = msg._type;
157 _key = msg._key;
158 _routing_code = msg._routing_code;
159 _mask = msg._mask;
|
160 mday 1.44 _last_thread_id = msg._last_thread_id;
|
161 mday 1.32 _next = _prev = _async = 0;
162 dest = msg.dest;
|
163 brian.campbell 1.55 _httpMethod = msg._httpMethod;
164 _index = msg._index;
165 _isComplete = msg._isComplete;
|
166 mday 1.44
|
167 mday 1.32 }
168 return *this;
169 }
|
170 chip 1.34
|
171 chip 1.24
172 virtual ~Message();
|
173 mike 1.4
|
174 mday 1.8 Uint32 getType() const { return _type; }
|
175 mike 1.4
|
176 mday 1.8 void setType(Uint32 type) { _type = type; }
|
177 mike 1.4
|
178 mday 1.8 Uint32 getKey() const { return _key; }
|
179 mike 1.4
|
180 mday 1.8 void setKey(Uint32 key) { _key = key; }
|
181 mike 1.4
|
182 mday 1.8 Uint32 getRouting() const { return _routing_code; }
183 void setRouting(Uint32 routing) { _routing_code = routing; }
|
184 mike 1.4
|
185 mday 1.8 Uint32 getMask() const { return _mask; }
|
186 chip 1.24
|
187 mday 1.8 void setMask(Uint32 mask) { _mask = mask; }
|
188 chip 1.24
|
189 kumpf 1.40 HttpMethod getHttpMethod() const { return _httpMethod; }
190
191 void setHttpMethod(HttpMethod httpMethod) {_httpMethod = httpMethod;}
192
|
193 w.white 1.63
|
194 karl 1.61 #ifndef PEGASUS_DISABLE_PERFINST
|
195 sage 1.30 //
196 // Needed for performance measurement
197 //
198
199 void startServer();
200
201 void endServer();
202
203 void startProvider();
204
205 void endProvider();
206
|
207 w.white 1.52 CIMDateTime getStartServerTime() const { return _timeServerStart; }
|
208 sage 1.30
|
209 w.white 1.52 void setStartServerTime(CIMDateTime timeServerStart)
|
210 sage 1.30 {
211 _timeServerStart = timeServerStart;
212 }
213
|
214 w.white 1.52 CIMDateTime getStartProviderTime() const { return _timeProviderStart; }
|
215 sage 1.30
|
216 w.white 1.52 void setStartProviderTime(CIMDateTime timeProviderStart)
|
217 sage 1.30 {
218 _timeProviderStart = timeProviderStart;
219 }
220
|
221 w.white 1.52 CIMDateTime getEndServerTime() const { return _timeServerEnd; }
|
222 sage 1.30
|
223 w.white 1.52 void setEndServerTime (CIMDateTime timeServerEnd)
|
224 sage 1.30 {
225 _timeServerEnd = timeServerEnd;
226 }
227
|
228 w.white 1.52 CIMDateTime getEndProviderTime() const { return _timeProviderEnd; }
|
229 sage 1.30
|
230 w.white 1.52 void setEndProviderTime(CIMDateTime timeProviderEnd)
|
231 sage 1.30 {
232 _timeProviderEnd = timeProviderEnd;
233 }
234
|
235 w.white 1.52 CIMDateTime getProviderTime() { return _providerTime;}
236
237 CIMDateTime getTotalTime() { return _totalTime; }
238
239 CIMDateTime getServerTime() { return _serverTime; }
|
240 sage 1.30 //
|
241 sage 1.31 #endif
|
242 sage 1.30
|
243 mday 1.8 Message* getNext() { return _next; }
|
244 mike 1.4
|
245 mday 1.8 const Message* getNext() const { return _next; }
|
246 mike 1.4
|
247 mday 1.8 Message* getPrevious() { return _prev; }
|
248 mike 1.4
|
249 mday 1.8 const Message* getPrevious() const { return _prev; }
|
250 mike 1.4
|
251 chip 1.24 static Uint32 getNextKey()
252 {
|
253 a.arora 1.57 AutoMutex autoMut(_mut);
254 Uint32 ret = _nextKey++;
255 return ret;
|
256 mike 1.6 }
|
257 chip 1.24
|
258 w.white 1.63 static CIMOperationType convertMessageTypetoCIMOpType(const Uint32 type)
259 {
260 Uint32 in_type, enum_type;
261 CIMOperationType cT;
262
263
|
264 carolann.graves 1.64 in_type = type%38; /* groups request/response message by type ie. getClassRequestMessage
265 (type = 1) gives the same result as getClassResponseMessage (type = 39)*/
|
266 w.white 1.63
267 if (in_type < 3) {
268 enum_type = in_type;
269 }
270 else if((3 < in_type) && (in_type < 25)){
271 enum_type = in_type -1;
272 }
273 else if (in_type == 25) {
274 enum_type = 0;
275 }
276 else{
277 return ((CIMOperationType)40); //error condition
278 }
279
280 cT = (CIMOperationType)enum_type;
281 return cT;
282 }
283
284
|
285 mike 1.36 virtual void print(
286 PEGASUS_STD(ostream)& os,
287 Boolean printHeader = true) const;
|
288 mike 1.4
|
289 chip 1.24 // << Thu Dec 27 10:46:04 2001 mdd >> for use with DQueue container
290 // as used by AsyncOpNode
|
291 kumpf 1.23 Boolean operator == (const void *msg )
|
292 mday 1.13 {
|
293 mday 1.16 if (reinterpret_cast<void *>(this) == msg )
|
294 mday 1.13 return true;
295 return false;
296 }
|
297 chip 1.24
|
298 mday 1.22 Message *get_async(void)
299 {
300 Message *ret = _async;
301 _async = 0;
302 return ret;
|
303 chip 1.24
|
304 mday 1.22 }
|
305 chip 1.24
|
306 mday 1.22 void put_async(Message * msg)
307 {
308 _async = msg;
309 }
|
310 chip 1.24
|
311 mday 1.44 // << Tue Jul 1 11:02:49 2003 mdd >> pep_88 and helper for i18n and l10n
312 Boolean thread_changed(void)
313 {
314 if(_last_thread_id != pegasus_thread_self())
315 {
316 _last_thread_id = pegasus_thread_self();
317 return true;
318 }
319
320 return false;
321 }
322
323 // << Tue Jul 1 13:41:02 2003 mdd >> pep_88 -
324 // assist in synchronizing responses with requests
325
326 void synch_response(Message *req)
327 {
328 _key = req->_key;
329 _routing_code = req->_routing_code;
330 }
331
|
332 brian.campbell 1.55 // set the message index indicating what piece (or sequence) this is
333 // message indexes start at zero
334 void setIndex(Uint32 index) { _index = index; }
335
336 // increment the message index
337 void incrementIndex() { _index++; }
338
339 // set the complete flag indicating if this message piece is the
340 // last or not
341 void setComplete(Boolean isComplete)
342 { _isComplete = isComplete ? true:false; }
343
344 // get the message index (or sequence number)
345 Uint32 getIndex() const { return _index; }
346
347 // is this the first piece of the message ?
348 Boolean isFirst() const { return _index == 0 ? true : false; }
349
350 // is this message complete? (i.e the last in a one or more sequence)
351 Boolean isComplete() const { return _isComplete; }
|
352 chip 1.24
|
353 mday 1.8 private:
|
354 mike 1.6 Uint32 _type;
355 Uint32 _key;
|
356 mday 1.8 Uint32 _routing_code;
|
357 mike 1.6 Uint32 _mask;
|
358 kumpf 1.40 HttpMethod _httpMethod;
|
359 sage 1.30 // Needed for performance measurement
|
360 w.white 1.52 CIMDateTime _timeServerStart;
361 CIMDateTime _timeServerEnd;
362 CIMDateTime _timeProviderStart;
363 CIMDateTime _timeProviderEnd;
364 CIMDateTime _providerTime;
365 CIMDateTime _serverTime;
366 CIMDateTime _totalTime;
|
367 sage 1.30 //
|
368 mday 1.44
369 // << Tue Jul 1 11:02:35 2003 mdd >> pep_88 and helper for i18n and l10n
370 PEGASUS_THREAD_TYPE _last_thread_id;
371
|
372 mike 1.6 Message* _next;
373 Message* _prev;
|
374 mday 1.32
|
375 mday 1.19 protected:
|
376 mday 1.32
377 public:
|
378 mday 1.19 Message *_async;
|
379 mday 1.20 Uint32 dest;
|
380 w.white 1.56 //needed for PEP 128 - transmitting Server Response Time to Client
381 Uint64 totServerTime;
382
|
383 mday 1.19 private:
|
384 mike 1.6 MessageQueue* _owner;
|
385 brian.campbell 1.55 Boolean _isComplete;
386 Uint32 _index;
|
387 mike 1.6 static Uint32 _nextKey;
388 static Mutex _mut;
|
389 mday 1.44
390
391
|
392 mday 1.20 friend class cimom;
|
393 mike 1.6 friend class MessageQueue;
|
394 mday 1.19 friend class MessageQueueService;
395 friend class AsyncLegacyOperationStart;
396 friend class AsyncLegacyOperationResult;
|
397 chip 1.24
|
398 mike 1.4 };
|
399 mike 1.5
|
400 mike 1.6
|
401 mike 1.5 enum MessageType
402 {
403 DUMMY_MESSAGE,
404
405 // CIM Message types:
406
407 CIM_GET_CLASS_REQUEST_MESSAGE,
408 CIM_GET_INSTANCE_REQUEST_MESSAGE,
|
409 mike 1.6 CIM_EXPORT_INDICATION_REQUEST_MESSAGE,
|
410 mike 1.5 CIM_DELETE_CLASS_REQUEST_MESSAGE,
411 CIM_DELETE_INSTANCE_REQUEST_MESSAGE,
412 CIM_CREATE_CLASS_REQUEST_MESSAGE,
413 CIM_CREATE_INSTANCE_REQUEST_MESSAGE,
414 CIM_MODIFY_CLASS_REQUEST_MESSAGE,
415 CIM_MODIFY_INSTANCE_REQUEST_MESSAGE,
|
416 mday 1.32 CIM_ENUMERATE_CLASSES_REQUEST_MESSAGE, //10
|
417 mike 1.5 CIM_ENUMERATE_CLASS_NAMES_REQUEST_MESSAGE,
418 CIM_ENUMERATE_INSTANCES_REQUEST_MESSAGE,
419 CIM_ENUMERATE_INSTANCE_NAMES_REQUEST_MESSAGE,
420 CIM_EXEC_QUERY_REQUEST_MESSAGE,
421 CIM_ASSOCIATORS_REQUEST_MESSAGE,
422 CIM_ASSOCIATOR_NAMES_REQUEST_MESSAGE,
423 CIM_REFERENCES_REQUEST_MESSAGE,
424 CIM_REFERENCE_NAMES_REQUEST_MESSAGE,
425 CIM_GET_PROPERTY_REQUEST_MESSAGE,
|
426 mday 1.32 CIM_SET_PROPERTY_REQUEST_MESSAGE, //20
|
427 mike 1.5 CIM_GET_QUALIFIER_REQUEST_MESSAGE,
428 CIM_SET_QUALIFIER_REQUEST_MESSAGE,
429 CIM_DELETE_QUALIFIER_REQUEST_MESSAGE,
430 CIM_ENUMERATE_QUALIFIERS_REQUEST_MESSAGE,
431 CIM_INVOKE_METHOD_REQUEST_MESSAGE,
|
432 mike 1.6 CIM_ENABLE_INDICATION_SUBSCRIPTION_REQUEST_MESSAGE,
433 CIM_MODIFY_INDICATION_SUBSCRIPTION_REQUEST_MESSAGE,
434 CIM_DISABLE_INDICATION_SUBSCRIPTION_REQUEST_MESSAGE,
|
435 kumpf 1.15 CIM_PROCESS_INDICATION_REQUEST_MESSAGE,
|
436 mday 1.32 CIM_HANDLE_INDICATION_REQUEST_MESSAGE, // 30
|
437 kumpf 1.15 CIM_NOTIFY_PROVIDER_REGISTRATION_REQUEST_MESSAGE,
438 CIM_NOTIFY_PROVIDER_TERMINATION_REQUEST_MESSAGE,
|
439 chip 1.25
440 // new
441 CIM_CREATE_SUBSCRIPTION_REQUEST_MESSAGE,
442 CIM_MODIFY_SUBSCRIPTION_REQUEST_MESSAGE,
443 CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE,
444
|
445 kumpf 1.29 // new
446 CIM_DISABLE_MODULE_REQUEST_MESSAGE,
447 CIM_ENABLE_MODULE_REQUEST_MESSAGE,
448
|
449 carolann.graves 1.64 CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE,
|
450 kumpf 1.35
|
451 kumpf 1.43 CIM_GET_CLASS_RESPONSE_MESSAGE,
|
452 carolann.graves 1.64 CIM_GET_INSTANCE_RESPONSE_MESSAGE, // 40
|
453 kumpf 1.43 CIM_EXPORT_INDICATION_RESPONSE_MESSAGE,
|
454 mike 1.5 CIM_DELETE_CLASS_RESPONSE_MESSAGE,
455 CIM_DELETE_INSTANCE_RESPONSE_MESSAGE,
456 CIM_CREATE_CLASS_RESPONSE_MESSAGE,
457 CIM_CREATE_INSTANCE_RESPONSE_MESSAGE,
458 CIM_MODIFY_CLASS_RESPONSE_MESSAGE,
459 CIM_MODIFY_INSTANCE_RESPONSE_MESSAGE,
|
460 carolann.graves 1.64 CIM_ENUMERATE_CLASSES_RESPONSE_MESSAGE,
|
461 mike 1.5 CIM_ENUMERATE_CLASS_NAMES_RESPONSE_MESSAGE,
|
462 carolann.graves 1.64 CIM_ENUMERATE_INSTANCES_RESPONSE_MESSAGE, // 50
|
463 mike 1.5 CIM_ENUMERATE_INSTANCE_NAMES_RESPONSE_MESSAGE,
464 CIM_EXEC_QUERY_RESPONSE_MESSAGE,
465 CIM_ASSOCIATORS_RESPONSE_MESSAGE,
466 CIM_ASSOCIATOR_NAMES_RESPONSE_MESSAGE,
467 CIM_REFERENCES_RESPONSE_MESSAGE,
468 CIM_REFERENCE_NAMES_RESPONSE_MESSAGE,
469 CIM_GET_PROPERTY_RESPONSE_MESSAGE,
|
470 carolann.graves 1.64 CIM_SET_PROPERTY_RESPONSE_MESSAGE,
|
471 mike 1.5 CIM_GET_QUALIFIER_RESPONSE_MESSAGE,
|
472 carolann.graves 1.64 CIM_SET_QUALIFIER_RESPONSE_MESSAGE, // 60
|
473 mike 1.5 CIM_DELETE_QUALIFIER_RESPONSE_MESSAGE,
474 CIM_ENUMERATE_QUALIFIERS_RESPONSE_MESSAGE,
475 CIM_INVOKE_METHOD_RESPONSE_MESSAGE,
|
476 mike 1.6 CIM_ENABLE_INDICATION_SUBSCRIPTION_RESPONSE_MESSAGE,
477 CIM_MODIFY_INDICATION_SUBSCRIPTION_RESPONSE_MESSAGE,
478 CIM_DISABLE_INDICATION_SUBSCRIPTION_RESPONSE_MESSAGE,
|
479 kumpf 1.15 CIM_PROCESS_INDICATION_RESPONSE_MESSAGE,
|
480 carolann.graves 1.64 CIM_NOTIFY_PROVIDER_REGISTRATION_RESPONSE_MESSAGE,
|
481 kumpf 1.15 CIM_NOTIFY_PROVIDER_TERMINATION_RESPONSE_MESSAGE,
|
482 carolann.graves 1.64 CIM_HANDLE_INDICATION_RESPONSE_MESSAGE, // 70
|
483 mike 1.6
|
484 chip 1.25 // new
485 CIM_CREATE_SUBSCRIPTION_RESPONSE_MESSAGE,
486 CIM_MODIFY_SUBSCRIPTION_RESPONSE_MESSAGE,
487 CIM_DELETE_SUBSCRIPTION_RESPONSE_MESSAGE,
|
488 kumpf 1.29
489 // new
490 CIM_DISABLE_MODULE_RESPONSE_MESSAGE,
491 CIM_ENABLE_MODULE_RESPONSE_MESSAGE,
|
492 kumpf 1.35
|
493 carolann.graves 1.64 CIM_STOP_ALL_PROVIDERS_RESPONSE_MESSAGE,
|
494 chip 1.24
|
495 mike 1.6 // Monitor-related messages:
496
497 SOCKET_MESSAGE,
498
499 // Connection-oriented messages:
500
501 CLOSE_CONNECTION_MESSAGE,
502
503 // HTTP messages:
504
505 HTTP_MESSAGE,
|
506 carolann.graves 1.64 HTTP_ERROR_MESSAGE, // 80
|
507 kumpf 1.28
508 // Exception messages to be passed to a CIM client application:
509
510 CLIENT_EXCEPTION_MESSAGE,
|
511 mike 1.5
|
512 mday 1.33 ASYNC_REGISTER_CIM_SERVICE,
513 ASYNC_DEREGISTER_CIM_SERVICE,
514 ASYNC_UPDATE_CIM_SERVICE,
515 ASYNC_IOCTL,
|
516 carolann.graves 1.64 ASYNC_CIMSERVICE_START,
|
517 mday 1.33 ASYNC_CIMSERVICE_STOP,
518 ASYNC_CIMSERVICE_PAUSE,
519 ASYNC_CIMSERVICE_RESUME,
520
|
521 carolann.graves 1.64 ASYNC_ASYNC_OP_START, // 90
|
522 mday 1.33 ASYNC_ASYNC_OP_RESULT,
523 ASYNC_ASYNC_LEGACY_OP_START,
|
524 chip 1.34 ASYNC_ASYNC_LEGACY_OP_RESULT,
525
|
526 mday 1.33 ASYNC_FIND_SERVICE_Q,
527 ASYNC_FIND_SERVICE_Q_RESULT,
|
528 carolann.graves 1.64 ASYNC_ENUMERATE_SERVICE,
|
529 mday 1.33 ASYNC_ENUMERATE_SERVICE_RESULT,
|
530 chip 1.34
|
531 mday 1.33 ASYNC_REGISTERED_MODULE,
532 ASYNC_DEREGISTERED_MODULE,
|
533 carolann.graves 1.64 ASYNC_FIND_MODULE_IN_SERVICE, // 100
|
534 mday 1.33 ASYNC_FIND_MODULE_IN_SERVICE_RESPONSE,
|
535 chip 1.34
|
536 mday 1.33 ASYNC_ASYNC_MODULE_OP_START,
537 ASYNC_ASYNC_MODULE_OP_RESULT,
538
|
539 kumpf 1.53 CIM_NOTIFY_PROVIDER_ENABLE_REQUEST_MESSAGE,
540 CIM_NOTIFY_PROVIDER_ENABLE_RESPONSE_MESSAGE,
541
542 CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE,
|
543 w.white 1.52 CIM_INITIALIZE_PROVIDER_RESPONSE_MESSAGE,
544
|
545 kumpf 1.53 CIM_INITIALIZE_PROVIDER_AGENT_REQUEST_MESSAGE,
546 CIM_INITIALIZE_PROVIDER_AGENT_RESPONSE_MESSAGE,
|
547 kumpf 1.47
|
548 kumpf 1.54 CIM_NOTIFY_CONFIG_CHANGE_REQUEST_MESSAGE,
549 CIM_NOTIFY_CONFIG_CHANGE_RESPONSE_MESSAGE,
550
|
551 carolann.graves 1.64 CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE,
552 CIM_SUBSCRIPTION_INIT_COMPLETE_RESPONSE_MESSAGE,
553
|
554 mike 1.5 NUMBER_OF_MESSAGES
555 };
556
557 PEGASUS_COMMON_LINKAGE const char* MessageTypeToString(Uint32 messageType);
|
558 mike 1.6
559 /** This class implements a stack of queue-ids. Many messages must keep a
560 stack of queue-ids of queues which they must be returned to. This provides
561 a light efficient stack for this purpose.
562 */
|
563 karl 1.60 class PEGASUS_COMMON_LINKAGE QueueIdStack
|
564 mike 1.6 {
565 public:
566
|
567 chip 1.24 QueueIdStack() : _size(0)
568 {
|
569 mike 1.6 }
570
|
571 karl 1.59 QueueIdStack(const QueueIdStack& x);
|
572 mike 1.6
|
573 karl 1.59 PEGASUS_EXPLICIT QueueIdStack(Uint32 x);
|
574 mike 1.6
|
575 karl 1.59 PEGASUS_EXPLICIT QueueIdStack(Uint32 x1, Uint32 x2);
|
576 mike 1.6
|
577 chip 1.24 ~QueueIdStack()
578 {
|
579 mike 1.6 }
580
|
581 karl 1.59 QueueIdStack& operator=(const QueueIdStack& x);
|
582 mike 1.6
|
583 chip 1.24 Uint32 size() const
584 {
585 return _size;
|
586 mike 1.6 }
587
|
588 chip 1.24 Boolean isEmpty() const
589 {
590 return _size == 0;
|
591 mike 1.6 }
592
|
593 chip 1.24 void push(Uint32 x)
|
594 mike 1.6 {
|
595 karl 1.59 #ifdef PEGASUS_DEBUG
|
596 mike 1.6 if (_size == MAX_SIZE)
597 throw StackOverflow();
|
598 karl 1.59 #endif
|
599 mike 1.6 _items[_size++] = x;
600 }
601
602 Uint32& top()
603 {
|
604 karl 1.59 #ifdef PEGASUS_DEBUG
|
605 mike 1.6 if (_size == 0)
606 throw StackUnderflow();
|
607 karl 1.59 #endif
|
608 mike 1.6 return _items[_size-1];
609 }
610
|
611 chip 1.24 Uint32 top() const
|
612 mike 1.6 {
|
613 chip 1.24 return ((QueueIdStack*)this)->top();
|
614 mike 1.6 }
615
|
616 chip 1.24 void pop()
|
617 mike 1.6 {
|
618 karl 1.59 #ifdef PEGASUS_DEBUG
|
619 mike 1.6 if (_size == 0)
620 throw StackUnderflow();
|
621 karl 1.59 #endif
|
622 mike 1.6 _size--;
623 }
624
625 /** Make a copy of this stack and then pop the top element. */
|
626 karl 1.59 QueueIdStack copyAndPop() const;
|
627 mike 1.6
628 private:
629
630 // Copy the given stack but then pop the top element:
|
631 karl 1.59 QueueIdStack(const QueueIdStack& x, int);
|
632 mike 1.6
633 enum { MAX_SIZE = 5 };
634 Uint32 _items[MAX_SIZE];
635 Uint32 _size;
636 };
|
637 mike 1.4
638 PEGASUS_NAMESPACE_END
639
640 #endif /* Pegasus_Message_h */
|