(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 thilo.boehm    1.37     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 thilo.boehm    1.37     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 thilo.boehm    1.37     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 thilo.boehm    1.37     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 marek          1.38     CIMClass _cimClass;
318                     
319 schuur         1.1  };
320                     
321 kumpf          1.34 class PEGASUS_PPM_LINKAGE AssociatorsResponseHandler :
322                         public OperationResponseHandler, public SimpleObjectResponseHandler
323 schuur         1.1  {
324                     public:
325 chip           1.11     AssociatorsResponseHandler(
326 kumpf          1.31         CIMAssociatorsRequestMessage* request,
327                             CIMAssociatorsResponseMessage* response,
328                             PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
329 chip           1.25 
330 kumpf          1.34     virtual void deliver(const CIMObject& cimObject);
331 thilo.boehm    1.37     virtual void deliver(const CIMInstance& cimInstance);
332 kumpf          1.34     virtual void deliver(const Array<CIMObject>& cimObjectArray)
333 kumpf          1.28     {
334                             SimpleObjectResponseHandler::deliver(cimObjectArray);
335                         }
336 thilo.boehm    1.37     virtual void deliver(const SCMOInstance& scmoObject);
337 chip           1.25 
338                     protected:
339 kumpf          1.34     virtual String getClass() const;
340 chip           1.25 
341 kumpf          1.34     virtual void transfer();
342 chip           1.11 
343 schuur         1.1  };
344                     
345 kumpf          1.34 class PEGASUS_PPM_LINKAGE AssociatorNamesResponseHandler :
346                         public OperationResponseHandler, public SimpleObjectPathResponseHandler
347 schuur         1.1  {
348                     public:
349 chip           1.11     AssociatorNamesResponseHandler(
350 kumpf          1.31         CIMAssociatorNamesRequestMessage* request,
351                             CIMAssociatorNamesResponseMessage* response,
352                             PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
353 chip           1.25 
354 kumpf          1.34     virtual void deliver(const CIMObjectPath& cimObjectPath);
355                         virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
356 kumpf          1.28     {
357                             SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
358                         }
359 thilo.boehm    1.37     virtual void deliver(const SCMOInstance& scmoObjectPath);
360 chip           1.25 
361                     protected:
362 kumpf          1.34     virtual String getClass() const;
363 chip           1.25 
364 kumpf          1.34     virtual void transfer();
365 chip           1.11 
366 schuur         1.1  };
367                     
368 kumpf          1.34 class PEGASUS_PPM_LINKAGE ReferencesResponseHandler :
369                         public OperationResponseHandler, public SimpleObjectResponseHandler
370 schuur         1.1  {
371                     public:
372 chip           1.11     ReferencesResponseHandler(
373 kumpf          1.31         CIMReferencesRequestMessage* request,
374                             CIMReferencesResponseMessage* response,
375                             PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
376 chip           1.25 
377 kumpf          1.34     virtual void deliver(const CIMObject& cimObject);
378                         virtual void deliver(const Array<CIMObject>& cimObjectArray)
379 kumpf          1.28     {
380                             SimpleObjectResponseHandler::deliver(cimObjectArray);
381                         }
382 thilo.boehm    1.37     virtual void deliver(const SCMOInstance& scmoObject);
383 chip           1.25 
384                     protected:
385 kumpf          1.34     virtual String getClass() const;
386 chip           1.25 
387 kumpf          1.34     virtual void transfer();
388 chip           1.11 
389 schuur         1.1  };
390                     
391 kumpf          1.34 class PEGASUS_PPM_LINKAGE ReferenceNamesResponseHandler :
392                         public OperationResponseHandler, public SimpleObjectPathResponseHandler
393 schuur         1.1  {
394                     public:
395 chip           1.11     ReferenceNamesResponseHandler(
396 kumpf          1.31         CIMReferenceNamesRequestMessage* request,
397                             CIMReferenceNamesResponseMessage* response,
398                             PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
399 chip           1.25 
400 kumpf          1.34     virtual void deliver(const CIMObjectPath& cimObjectPath);
401                         virtual void deliver(const Array<CIMObjectPath>& cimObjectPathArray)
402 kumpf          1.28     {
403                             SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
404                         }
405 thilo.boehm    1.37     virtual void deliver(const SCMOInstance& scmoObjectPath);
406 chip           1.25 
407                     protected:
408 kumpf          1.34     virtual String getClass() const;
409 chip           1.25 
410 kumpf          1.34     virtual void transfer();
411 chip           1.11 
412 schuur         1.1  };
413                     
414 kumpf          1.34 class PEGASUS_PPM_LINKAGE InvokeMethodResponseHandler :
415                         public OperationResponseHandler, public SimpleMethodResultResponseHandler
416 schuur         1.1  {
417                     public:
418 chip           1.11     InvokeMethodResponseHandler(
419 kumpf          1.31         CIMInvokeMethodRequestMessage* request,
420                             CIMInvokeMethodResponseMessage* response,
421                             PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
422 chip           1.25 
423 kumpf          1.34     virtual void deliverParamValue(const CIMParamValue& cimParamValue);
424 kumpf          1.28     virtual void deliverParamValue(
425 kumpf          1.34         const Array<CIMParamValue>& cimParamValueArray)
426 kumpf          1.28     {
427                             SimpleMethodResultResponseHandler::deliverParamValue(
428                                 cimParamValueArray);
429                         }
430 chip           1.25 
431 kumpf          1.34     virtual void deliver(const CIMValue& cimValue);
432 chip           1.25 
433                     protected:
434 kumpf          1.34     virtual String getClass() const;
435 chip           1.25 
436 kumpf          1.34     virtual void transfer();
437 chip           1.25 
438 schuur         1.1  };
439                     
440 kumpf          1.31 typedef void (*PEGASUS_INDICATION_CALLBACK_T)(
441                         CIMProcessIndicationRequestMessage*);
442 kumpf          1.2  
443 kumpf          1.34 class PEGASUS_PPM_LINKAGE EnableIndicationsResponseHandler :
444                         public OperationResponseHandler, public SimpleIndicationResponseHandler
445 schuur         1.1  {
446                     public:
447 chip           1.11     EnableIndicationsResponseHandler(
448 kumpf          1.31         CIMRequestMessage* request,
449                             CIMResponseMessage* response,
450 kumpf          1.32         const CIMInstance& provider,
451 kumpf          1.31         PEGASUS_INDICATION_CALLBACK_T indicationCallback,
452                             PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
453 chip           1.25 
454 kumpf          1.34     virtual void deliver(const CIMIndication& cimIndication);
455 chip           1.25 
456 kumpf          1.34     virtual void deliver(
457                             const OperationContext& context,
458                             const CIMIndication& cimIndication);
459 chip           1.25 
460 kumpf          1.34     virtual void deliver(const Array<CIMIndication>& cimIndications);
461 chip           1.25 
462 kumpf          1.34     virtual void deliver(
463                             const OperationContext& context,
464                             const Array<CIMIndication>& cimIndications);
465 chip           1.25 
466                     protected:
467 kumpf          1.34     virtual String getClass() const;
468 chip           1.25 
469 kumpf          1.34     virtual Boolean isAsync() const;
470 chip           1.18 
471 brian.campbell 1.9  private:
472 kumpf          1.31     PEGASUS_INDICATION_CALLBACK_T _indicationCallback;
473 schuur         1.1  
474 brian.campbell 1.9  };
475 schuur         1.1  
476                     PEGASUS_NAMESPACE_END
477                     
478                     #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2