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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2