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

  1 martin 1.35 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.36 //
  3 martin 1.35 // Licensed to The Open Group (TOG) under one or more contributor license
  4             // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
  5             // this work for additional information regarding copyright ownership.
  6             // Each contributor licenses this file to you under the OpenPegasus Open
  7             // Source License; you may not use this file except in compliance with the
  8             // License.
  9 martin 1.36 //
 10 martin 1.35 // Permission is hereby granted, free of charge, to any person obtaining a
 11             // copy of this software and associated documentation files (the "Software"),
 12             // to deal in the Software without restriction, including without limitation
 13             // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 14             // and/or sell copies of the Software, and to permit persons to whom the
 15             // Software is furnished to do so, subject to the following conditions:
 16 martin 1.36 //
 17 martin 1.35 // The above copyright notice and this permission notice shall be included
 18             // in all copies or substantial portions of the Software.
 19 martin 1.36 //
 20 martin 1.35 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.36 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.35 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 23             // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 24             // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 25             // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 26             // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27 martin 1.36 //
 28 martin 1.35 //////////////////////////////////////////////////////////////////////////
 29 schuur 1.1  //
 30             //%/////////////////////////////////////////////////////////////////////////////
 31             
 32             #ifndef Pegasus_OperationResponseHandler_h
 33             #define Pegasus_OperationResponseHandler_h
 34             
 35             #include <Pegasus/Common/Config.h>
 36             #include <Pegasus/Common/CIMMessage.h>
 37             #include <Pegasus/Common/MessageQueueService.h>
 38             #include <Pegasus/Common/Constants.h>
 39             
 40             #include <Pegasus/Common/CIMClass.h>
 41             #include <Pegasus/Common/CIMInstance.h>
 42             #include <Pegasus/Common/CIMIndication.h>
 43             #include <Pegasus/Common/CIMValue.h>
 44             
 45 chip   1.14 #include <Pegasus/Common/OperationContext.h>
 46             #include <Pegasus/Common/OperationContextInternal.h>
 47             
 48             #include <Pegasus/Common/ObjectNormalizer.h>
 49 chip   1.25 
 50 schuur 1.1  #include <Pegasus/Common/ResponseHandler.h>
 51 chip   1.25 #include <Pegasus/ProviderManager2/SimpleResponseHandler.h>
 52 schuur 1.1  
 53             #include <Pegasus/ProviderManager2/Linkage.h>
 54             
 55             PEGASUS_NAMESPACE_BEGIN
 56             
 57 kumpf  1.31 typedef void (*PEGASUS_RESPONSE_CHUNK_CALLBACK_T)(
 58                 CIMRequestMessage* request, CIMResponseMessage* response);
 59             
 60 schuur 1.1  class PEGASUS_PPM_LINKAGE OperationResponseHandler
 61             {
 62 chip   1.11     friend class SimpleResponseHandler;
 63 brian.campbell 1.9  
 64 schuur         1.1  public:
 65 chip           1.11     OperationResponseHandler(
 66 kumpf          1.31         CIMRequestMessage* request,
 67                             CIMResponseMessage* response,
 68                             PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
 69 schuur         1.1  
 70 kumpf          1.34     virtual ~OperationResponseHandler();
 71 chip           1.11 
 72 kumpf          1.34     CIMRequestMessage* getRequest() const;
 73 chip           1.25 
 74 kumpf          1.34     CIMResponseMessage* getResponse() const;
 75 schuur         1.1  
 76 chip           1.11     virtual void setStatus(
 77                             const Uint32 code,
 78 kumpf          1.34         const String& message = String::EMPTY);
 79 schuur         1.1  
 80 chip           1.11     virtual void setStatus(
 81                             const Uint32 code,
 82 kumpf          1.34         const ContentLanguageList& langs,
 83                             const String& message = String::EMPTY);
 84 schuur         1.1  
 85 mike           1.33     virtual void setCIMException(const CIMException& cimException);
 86                     
 87 schuur         1.1  protected:
 88 chip           1.11     // the default for all derived handlers. Some handlers may not apply
 89                         // async behavior because their callers cannot handle partial responses.
 90 kumpf          1.34     virtual Boolean isAsync() const;
 91 brian.campbell 1.9  
 92 chip           1.11     // send (deliver) asynchronously
 93                         virtual void send(Boolean isComplete);
 94 brian.campbell 1.9  
 95 chip           1.11     // transfer any objects from handler to response. this does not clear()
 96 kumpf          1.34     virtual void transfer();
 97 brian.campbell 1.9  
 98 chip           1.11     // validate whatever is necessary before the transfer
 99 kumpf          1.34     virtual void validate();
100 chip           1.25 
101 kumpf          1.34     virtual String getClass() const;
102 chip           1.25 
103 kumpf          1.34     Uint32 getResponseObjectTotal() const;
104 brian.campbell 1.9  
105 chip           1.11     // there can be many objects per message (or none at all - i.e complete())
106 kumpf          1.34     Uint32 getResponseMessageTotal() const;
107 chip           1.25 
108 kumpf          1.34     Uint32 getResponseObjectThreshold() const;
109 brian.campbell 1.9  
110 kumpf          1.34     CIMRequestMessage* _request;
111                         CIMResponseMessage* _response;
112 kumpf          1.31     PEGASUS_RESPONSE_CHUNK_CALLBACK_T _responseChunkCallback;
113 schuur         1.1  
114 brian.campbell 1.9  private:
115 chip           1.11     Uint32 _responseObjectTotal;
116                         Uint32 _responseMessageTotal;
117                         Uint32 _responseObjectThreshold;
118                     
119 schuur         1.1  };
120                     
121 kumpf          1.34 class PEGASUS_PPM_LINKAGE GetInstanceResponseHandler :
122                         public OperationResponseHandler, public SimpleInstanceResponseHandler
123 chip           1.11 {
124                     public:
125                         GetInstanceResponseHandler(
126 kumpf          1.31         CIMGetInstanceRequestMessage* request,
127                             CIMGetInstanceResponseMessage* response,
128                             PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
129 chip           1.25 
130 kumpf          1.34     virtual void deliver(const CIMInstance& cimInstance);
131                         virtual void deliver(const Array<CIMInstance>& cimInstanceArray)
132 kumpf          1.28     {
133                             SimpleInstanceResponseHandler::deliver(cimInstanceArray);
134                         }
135 r.kieninger    1.36.4.2     virtual void deliver(const SCMOInstance& cimInstance);
136 kumpf          1.28     
137 kumpf          1.34         virtual void complete();
138 chip           1.25     
139                         protected:
140 kumpf          1.34         virtual String getClass() const;
141 chip           1.25     
142 kumpf          1.34         virtual void transfer();
143 chip           1.25     
144 kumpf          1.34         virtual void validate();
145 chip           1.14     
146                         private:
147                             ObjectNormalizer _normalizer;
148                         
149 schuur         1.1      };
150                         
151 kumpf          1.34     class PEGASUS_PPM_LINKAGE EnumerateInstancesResponseHandler :
152                             public OperationResponseHandler, public SimpleInstanceResponseHandler
153 schuur         1.1      {
154                         public:
155 chip           1.11         EnumerateInstancesResponseHandler(
156 kumpf          1.31             CIMEnumerateInstancesRequestMessage* request,
157                                 CIMEnumerateInstancesResponseMessage* response,
158                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
159 chip           1.25     
160 kumpf          1.34         virtual void deliver(const CIMInstance& cimInstance);
161                             virtual void deliver(const Array<CIMInstance>& cimInstanceArray)
162 kumpf          1.28         {
163                                 SimpleInstanceResponseHandler::deliver(cimInstanceArray);
164                             }
165 marek          1.36.4.3     virtual void deliver(const SCMOInstance& scmoInstance);
166 chip           1.11     
167 chip           1.25     protected:
168 kumpf          1.34         virtual String getClass() const;
169 chip           1.25     
170 kumpf          1.34         virtual void transfer();
171 chip           1.14     
172                         private:
173                             ObjectNormalizer _normalizer;
174                         
175 schuur         1.1      };
176                         
177 kumpf          1.34     class PEGASUS_PPM_LINKAGE EnumerateInstanceNamesResponseHandler :
178                             public OperationResponseHandler, public SimpleObjectPathResponseHandler
179 schuur         1.1      {
180                         public:
181 chip           1.11         EnumerateInstanceNamesResponseHandler(
182 kumpf          1.31             CIMEnumerateInstanceNamesRequestMessage* request,
183                                 CIMEnumerateInstanceNamesResponseMessage* response,
184                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
185 chip           1.11     
186 kumpf          1.34         virtual void deliver(const CIMObjectPath& cimObjectPath);
187                             virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
188 kumpf          1.28         {
189                                 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
190                             }
191 r.kieninger    1.36.4.1     virtual void deliver(const SCMOInstance& scmoObjectPath);
192 chip           1.25     
193                         protected:
194 kumpf          1.34         virtual String getClass() const;
195 chip           1.25     
196 kumpf          1.34         virtual void transfer();
197 chip           1.14     
198                         private:
199                             ObjectNormalizer _normalizer;
200                         
201 schuur         1.1      };
202                         
203 kumpf          1.34     class PEGASUS_PPM_LINKAGE CreateInstanceResponseHandler :
204                             public OperationResponseHandler, public SimpleObjectPathResponseHandler
205 schuur         1.1      {
206                         public:
207 chip           1.11         CreateInstanceResponseHandler(
208 kumpf          1.31             CIMCreateInstanceRequestMessage* request,
209                                 CIMCreateInstanceResponseMessage* response,
210                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
211 chip           1.25     
212 kumpf          1.34         virtual void deliver(const CIMObjectPath& cimObjectPath);
213                             virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
214 kumpf          1.28         {
215                                 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
216                             }
217                         
218 kumpf          1.34         virtual void complete();
219 chip           1.25     
220                         protected:
221 kumpf          1.34         virtual String getClass() const;
222 chip           1.25     
223 kumpf          1.34         virtual void transfer();
224 chip           1.25     
225 schuur         1.1      };
226                         
227 kumpf          1.34     class PEGASUS_PPM_LINKAGE ModifyInstanceResponseHandler :
228                             public OperationResponseHandler, public SimpleResponseHandler
229 schuur         1.1      {
230                         public:
231 chip           1.11         ModifyInstanceResponseHandler(
232 kumpf          1.31             CIMModifyInstanceRequestMessage* request,
233                                 CIMModifyInstanceResponseMessage* response,
234                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
235 chip           1.11     
236 chip           1.18     protected:
237 kumpf          1.34         virtual String getClass() const;
238 chip           1.25     
239 schuur         1.1      };
240                         
241 kumpf          1.34     class PEGASUS_PPM_LINKAGE DeleteInstanceResponseHandler :
242                             public OperationResponseHandler, public SimpleResponseHandler
243 schuur         1.1      {
244                         public:
245 chip           1.11         DeleteInstanceResponseHandler(
246 kumpf          1.31             CIMDeleteInstanceRequestMessage* request,
247                                 CIMDeleteInstanceResponseMessage* response,
248                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
249 chip           1.11     
250 chip           1.18     protected:
251 kumpf          1.34         virtual String getClass() const;
252 chip           1.11     
253 schuur         1.1      };
254                         
255 kumpf          1.34     class PEGASUS_PPM_LINKAGE GetPropertyResponseHandler :
256                             public OperationResponseHandler, public SimpleValueResponseHandler
257 schuur         1.1      {
258                         public:
259 chip           1.11         GetPropertyResponseHandler(
260 kumpf          1.31             CIMGetPropertyRequestMessage* request,
261                                 CIMGetPropertyResponseMessage* response,
262                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
263 chip           1.25     
264 kumpf          1.34         virtual void deliver(const CIMValue& cimValue);
265                             virtual void deliver(const Array<CIMValue>& cimValueArray)
266 kumpf          1.28         {
267                                 SimpleValueResponseHandler::deliver(cimValueArray);
268                             }
269 chip           1.25     
270                         protected:
271 kumpf          1.34         virtual String getClass() const;
272 chip           1.25     
273 kumpf          1.34         virtual void transfer();
274 chip           1.25     
275 kumpf          1.34         virtual void validate();
276 chip           1.25     
277 schuur         1.1      };
278                         
279 kumpf          1.34     class PEGASUS_PPM_LINKAGE SetPropertyResponseHandler :
280                             public OperationResponseHandler, public SimpleResponseHandler
281 schuur         1.1      {
282                         public:
283 chip           1.11         SetPropertyResponseHandler(
284 kumpf          1.31             CIMSetPropertyRequestMessage* request,
285                                 CIMSetPropertyResponseMessage* response,
286                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
287 chip           1.11     
288 chip           1.18     protected:
289 kumpf          1.34         virtual String getClass() const;
290 chip           1.11     
291 schuur         1.1      };
292                         
293 kumpf          1.34     class PEGASUS_PPM_LINKAGE ExecQueryResponseHandler :
294                             public OperationResponseHandler,
295                             public SimpleInstance2ObjectResponseHandler
296 schuur         1.1      {
297                         public:
298 chip           1.11         ExecQueryResponseHandler(
299 kumpf          1.31             CIMExecQueryRequestMessage* request,
300                                 CIMExecQueryResponseMessage* response,
301                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
302 chip           1.25     
303 kumpf          1.34         virtual void deliver(const CIMInstance& cimInstance);
304                             virtual void deliver(const Array<CIMInstance>& cimInstanceArray)
305 kumpf          1.28         {
306                                 SimpleInstance2ObjectResponseHandler::deliver(cimInstanceArray);
307                             }
308 marek          1.36.4.3     virtual void deliver(const SCMOInstance& scmoInstance);
309 chip           1.25     
310                         protected:
311 kumpf          1.34         virtual String getClass() const;
312 chip           1.25     
313 kumpf          1.34         virtual void transfer();
314 chip           1.25     
315 kumpf          1.34         virtual Boolean isAsync() const;
316 chip           1.25     
317 schuur         1.1      };
318                         
319 kumpf          1.34     class PEGASUS_PPM_LINKAGE AssociatorsResponseHandler :
320                             public OperationResponseHandler, public SimpleObjectResponseHandler
321 schuur         1.1      {
322                         public:
323 chip           1.11         AssociatorsResponseHandler(
324 kumpf          1.31             CIMAssociatorsRequestMessage* request,
325                                 CIMAssociatorsResponseMessage* response,
326                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
327 chip           1.25     
328 kumpf          1.34         virtual void deliver(const CIMObject& cimObject);
329                             virtual void deliver(const Array<CIMObject>& cimObjectArray)
330 kumpf          1.28         {
331                                 SimpleObjectResponseHandler::deliver(cimObjectArray);
332                             }
333 marek          1.36.4.3     virtual void deliver(const SCMOInstance& scmoObject);
334 chip           1.25     
335                         protected:
336 kumpf          1.34         virtual String getClass() const;
337 chip           1.25     
338 kumpf          1.34         virtual void transfer();
339 chip           1.11     
340 schuur         1.1      };
341                         
342 kumpf          1.34     class PEGASUS_PPM_LINKAGE AssociatorNamesResponseHandler :
343                             public OperationResponseHandler, public SimpleObjectPathResponseHandler
344 schuur         1.1      {
345                         public:
346 chip           1.11         AssociatorNamesResponseHandler(
347 kumpf          1.31             CIMAssociatorNamesRequestMessage* request,
348                                 CIMAssociatorNamesResponseMessage* response,
349                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
350 chip           1.25     
351 kumpf          1.34         virtual void deliver(const CIMObjectPath& cimObjectPath);
352                             virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
353 kumpf          1.28         {
354                                 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
355                             }
356 marek          1.36.4.3     virtual void deliver(const SCMOInstance& scmoObjectPath);
357 chip           1.25     
358                         protected:
359 kumpf          1.34         virtual String getClass() const;
360 chip           1.25     
361 kumpf          1.34         virtual void transfer();
362 chip           1.11     
363 schuur         1.1      };
364                         
365 kumpf          1.34     class PEGASUS_PPM_LINKAGE ReferencesResponseHandler :
366                             public OperationResponseHandler, public SimpleObjectResponseHandler
367 schuur         1.1      {
368                         public:
369 chip           1.11         ReferencesResponseHandler(
370 kumpf          1.31             CIMReferencesRequestMessage* request,
371                                 CIMReferencesResponseMessage* response,
372                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
373 chip           1.25     
374 kumpf          1.34         virtual void deliver(const CIMObject& cimObject);
375                             virtual void deliver(const Array<CIMObject>& cimObjectArray)
376 kumpf          1.28         {
377                                 SimpleObjectResponseHandler::deliver(cimObjectArray);
378                             }
379 marek          1.36.4.3     virtual void deliver(const SCMOInstance& scmoObject);
380 chip           1.25     
381                         protected:
382 kumpf          1.34         virtual String getClass() const;
383 chip           1.25     
384 kumpf          1.34         virtual void transfer();
385 chip           1.11     
386 schuur         1.1      };
387                         
388 kumpf          1.34     class PEGASUS_PPM_LINKAGE ReferenceNamesResponseHandler :
389                             public OperationResponseHandler, public SimpleObjectPathResponseHandler
390 schuur         1.1      {
391                         public:
392 chip           1.11         ReferenceNamesResponseHandler(
393 kumpf          1.31             CIMReferenceNamesRequestMessage* request,
394                                 CIMReferenceNamesResponseMessage* response,
395                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
396 chip           1.25     
397 kumpf          1.34         virtual void deliver(const CIMObjectPath& cimObjectPath);
398                             virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
399 kumpf          1.28         {
400                                 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
401                             }
402 marek          1.36.4.3     virtual void deliver(const SCMOInstance& scmoObjectPath);
403 chip           1.25     
404                         protected:
405 kumpf          1.34         virtual String getClass() const;
406 chip           1.25     
407 kumpf          1.34         virtual void transfer();
408 chip           1.11     
409 schuur         1.1      };
410                         
411 kumpf          1.34     class PEGASUS_PPM_LINKAGE InvokeMethodResponseHandler :
412                             public OperationResponseHandler, public SimpleMethodResultResponseHandler
413 schuur         1.1      {
414                         public:
415 chip           1.11         InvokeMethodResponseHandler(
416 kumpf          1.31             CIMInvokeMethodRequestMessage* request,
417                                 CIMInvokeMethodResponseMessage* response,
418                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
419 chip           1.25     
420 kumpf          1.34         virtual void deliverParamValue(const CIMParamValue& cimParamValue);
421 kumpf          1.28         virtual void deliverParamValue(
422 kumpf          1.34             const Array<CIMParamValue>& cimParamValueArray)
423 kumpf          1.28         {
424                                 SimpleMethodResultResponseHandler::deliverParamValue(
425                                     cimParamValueArray);
426                             }
427 chip           1.25     
428 kumpf          1.34         virtual void deliver(const CIMValue& cimValue);
429 chip           1.25     
430                         protected:
431 kumpf          1.34         virtual String getClass() const;
432 chip           1.25     
433 kumpf          1.34         virtual void transfer();
434 chip           1.25     
435 schuur         1.1      };
436                         
437 kumpf          1.31     typedef void (*PEGASUS_INDICATION_CALLBACK_T)(
438                             CIMProcessIndicationRequestMessage*);
439 kumpf          1.2      
440 kumpf          1.34     class PEGASUS_PPM_LINKAGE EnableIndicationsResponseHandler :
441                             public OperationResponseHandler, public SimpleIndicationResponseHandler
442 schuur         1.1      {
443                         public:
444 chip           1.11         EnableIndicationsResponseHandler(
445 kumpf          1.31             CIMRequestMessage* request,
446                                 CIMResponseMessage* response,
447 kumpf          1.32             const CIMInstance& provider,
448 kumpf          1.31             PEGASUS_INDICATION_CALLBACK_T indicationCallback,
449                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
450 chip           1.25     
451 kumpf          1.34         virtual void deliver(const CIMIndication& cimIndication);
452 chip           1.25     
453 kumpf          1.34         virtual void deliver(
454                                 const OperationContext& context,
455                                 const CIMIndication& cimIndication);
456 chip           1.25     
457 kumpf          1.34         virtual void deliver(const Array<CIMIndication>& cimIndications);
458 chip           1.25     
459 kumpf          1.34         virtual void deliver(
460                                 const OperationContext& context,
461                                 const Array<CIMIndication>& cimIndications);
462 chip           1.25     
463                         protected:
464 kumpf          1.34         virtual String getClass() const;
465 chip           1.25     
466 kumpf          1.34         virtual Boolean isAsync() const;
467 chip           1.18     
468 brian.campbell 1.9      private:
469 kumpf          1.31         PEGASUS_INDICATION_CALLBACK_T _indicationCallback;
470 schuur         1.1      
471 brian.campbell 1.9      };
472 schuur         1.1      
473                         PEGASUS_NAMESPACE_END
474                         
475                         #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2