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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2