(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 AsyncIoctl::AsyncIoctl(
109 kumpf 1.26     AsyncOpNode* operation,
110                Uint32 destination,
111                Uint32 response,
112                Boolean blocking,
113                Uint32 code,
114                Uint32 intParam,
115                void* pParam)
116                : AsyncRequest(
117 kumpf 1.29           ASYNC_IOCTL,
118 kumpf 1.26           0, operation,
119                      destination, response, blocking),
120                  ctl(code),
121                  intp(intParam),
122                  voidp(pParam)
123            {
124 mday  1.1  }
125            
126 kumpf 1.24 CimServiceStart::CimServiceStart(
127 kumpf 1.26     AsyncOpNode* operation,
128                Uint32 destination,
129                Uint32 response,
130                Boolean blocking)
131                : AsyncRequest(
132 kumpf 1.29           ASYNC_CIMSERVICE_START,
133 kumpf 1.26           0, operation, destination,
134                      response, blocking)
135            {
136 mday  1.1  }
137            
138            
139 kumpf 1.24 CimServiceStop::CimServiceStop(
140 kumpf 1.26     AsyncOpNode* operation,
141                Uint32 destination,
142                Uint32 response,
143                Boolean blocking)
144                : AsyncRequest(
145 kumpf 1.29           ASYNC_CIMSERVICE_STOP,
146 kumpf 1.26           0, operation, destination,
147                      response, blocking)
148            {
149 mday  1.1  }
150            
151 kumpf 1.24 AsyncOperationStart::AsyncOperationStart(
152 kumpf 1.26     AsyncOpNode* operation,
153                Uint32 destination,
154                Uint32 response,
155                Boolean blocking,
156                Message* action)
157                : AsyncRequest(
158 kumpf 1.29           ASYNC_ASYNC_OP_START,
159 kumpf 1.26           0,
160                      operation,
161                      destination, response, blocking),
162                  _act(action)
163            {
164 mday  1.1  }
165            
166 kumpf 1.26 Message* AsyncOperationStart::get_action()
167            {
168                Message* ret = _act;
169                _act = 0;
170                ret->put_async(0);
171                return ret;
172 mday  1.9  }
173            
174 kumpf 1.24 AsyncOperationResult::AsyncOperationResult(
175 kumpf 1.26     AsyncOpNode* operation,
176                Uint32 resultCode,
177                Uint32 destination,
178                Boolean blocking)
179                : AsyncReply(
180 kumpf 1.29           ASYNC_ASYNC_OP_RESULT,
181 kumpf 1.26           0,
182                      operation,
183                      resultCode,
184                      destination,
185                      blocking)
186            {
187 mday  1.1  }
188            
189            
190 kumpf 1.24 AsyncModuleOperationStart::AsyncModuleOperationStart(
191 kumpf 1.26     AsyncOpNode* operation,
192                Uint32 destination,
193                Uint32 response,
194                Boolean blocking,
195                const String& targetModule,
196                Message* action)
197                : AsyncRequest(
198 kumpf 1.29           ASYNC_ASYNC_MODULE_OP_START,
199 kumpf 1.26           0,
200                      operation,
201                      destination,
202                      response,
203                      blocking),
204                  _target_module(targetModule),
205                  _act(action)
206            {
207                _act->put_async(this);
208 mday  1.13 }
209            
210            
211 kumpf 1.26 Message* AsyncModuleOperationStart::get_action()
212            {
213                Message* ret = _act;
214                _act = 0;
215                ret->put_async(0);
216                return ret;
217 mday  1.13 }
218            
219 kumpf 1.24 AsyncModuleOperationResult::AsyncModuleOperationResult(
220 kumpf 1.26     AsyncOpNode* operation,
221                Uint32 resultCode,
222                Uint32 destination,
223                Boolean blocking,
224                const String& targetModule,
225                Message* result)
226                : AsyncReply(
227 kumpf 1.29           ASYNC_ASYNC_MODULE_OP_RESULT,
228 kumpf 1.26           0,
229                      operation, resultCode, destination,
230                      blocking),
231                  _targetModule(targetModule),
232                  _res(result)
233            {
234                _res->put_async(this);
235            }
236            
237            Message* AsyncModuleOperationResult::get_result()
238            {
239                Message* ret = _res;
240                _res = 0;
241                ret->put_async(0);
242                return ret;
243 mday  1.14 }
244            
245            
246 kumpf 1.24 AsyncLegacyOperationStart::AsyncLegacyOperationStart(
247 kumpf 1.26     AsyncOpNode* operation,
248                Uint32 destination,
249 venkat.puvvada 1.30     Message* action)
250 kumpf          1.26     : AsyncRequest(
251 kumpf          1.29           ASYNC_ASYNC_LEGACY_OP_START,
252 kumpf          1.26           0,
253                               operation, destination, CIMOM_Q_ID, false),
254 venkat.puvvada 1.30       _act(action)
255 kumpf          1.26 {
256                         _act->put_async(this);
257 mday           1.1  }
258                     
259                     
260 kumpf          1.26 Message* AsyncLegacyOperationStart::get_action()
261                     {
262                         Message* ret = _act;
263                         _act = 0;
264                     //    ret->put_async(0);
265                         return ret;
266                     
267 mday           1.9  }
268                     
269 kumpf          1.24 AsyncLegacyOperationResult::AsyncLegacyOperationResult(
270 kumpf          1.26     AsyncOpNode* operation,
271                         Message* result)
272                         : AsyncReply(
273 kumpf          1.29           ASYNC_ASYNC_LEGACY_OP_RESULT,
274 kumpf          1.26           0, operation,
275                               0, CIMOM_Q_ID, false),
276                           _res(result)
277                     {
278                         _res->put_async(this);
279                     }
280                     
281                     Message* AsyncLegacyOperationResult::get_result()
282                     {
283                         Message* ret = _res;
284                         _res = 0;
285                     //    ret->put_async(0);
286                         return ret;
287 mday           1.9  }
288 mday           1.1  
289 kumpf          1.26 AsyncMessage::~AsyncMessage()
290 karl           1.19 {
291                     }
292                     
293 kumpf          1.26 AsyncRequest::~AsyncRequest()
294 karl           1.19 {
295                     }
296 mday           1.1  
297                     PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2