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

  1 karl  1.30 //%2006////////////////////////////////////////////////////////////////////////
  2 schuur 1.1  //
  3 karl   1.8  // 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 schuur 1.1  // IBM Corp.; EMC Corporation, The Open Group.
  7 karl   1.8  // 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.17 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10             // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 karl   1.30 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12             // EMC Corporation; Symantec Corporation; The Open Group.
 13 schuur 1.1  //
 14             // Permission is hereby granted, free of charge, to any person obtaining a copy
 15             // 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             // 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 karl   1.30 // 
 21 schuur 1.1  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 22             // 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             // 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             // 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: Chip Vincent (cvincent@us.ibm.com)
 33             //
 34 chip   1.11 // Modified By:
 35             //      Carol Ann Krug Graves, Hewlett-Packard Company (carolann_graves@hp.com)
 36             //      Dave Rosckes (rosckes@us.ibm.com)
 37             //      Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com)
 38             //      Adrian Schuur (schuur@de.ibm.com)
 39             //      Seema Gupta (gseema@in.ibm.com) for PEP135
 40             //      Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase2
 41 schuur 1.1  //
 42             //%/////////////////////////////////////////////////////////////////////////////
 43             
 44             #ifndef Pegasus_OperationResponseHandler_h
 45             #define Pegasus_OperationResponseHandler_h
 46             
 47             #include <Pegasus/Common/Config.h>
 48             #include <Pegasus/Common/CIMMessage.h>
 49             #include <Pegasus/Common/MessageQueueService.h>
 50             #include <Pegasus/Common/Constants.h>
 51             
 52             #include <Pegasus/Common/CIMClass.h>
 53             #include <Pegasus/Common/CIMInstance.h>
 54             #include <Pegasus/Common/CIMIndication.h>
 55             #include <Pegasus/Common/CIMValue.h>
 56             
 57 chip   1.14 #include <Pegasus/Common/OperationContext.h>
 58             #include <Pegasus/Common/OperationContextInternal.h>
 59             
 60             #include <Pegasus/Common/ObjectNormalizer.h>
 61 chip   1.25 
 62 schuur 1.1  #include <Pegasus/Common/ResponseHandler.h>
 63 chip   1.25 #include <Pegasus/ProviderManager2/SimpleResponseHandler.h>
 64 schuur 1.1  
 65             #include <Pegasus/ProviderManager2/Linkage.h>
 66             
 67             PEGASUS_NAMESPACE_BEGIN
 68             
 69 kumpf  1.30.2.1 typedef void (*PEGASUS_RESPONSE_CHUNK_CALLBACK_T)(
 70                     CIMRequestMessage* request, CIMResponseMessage* response);
 71                 
 72 schuur 1.1      class PEGASUS_PPM_LINKAGE OperationResponseHandler
 73                 {
 74 chip   1.11         friend class SimpleResponseHandler;
 75 brian.campbell 1.9      
 76 schuur         1.1      public:
 77 chip           1.11         OperationResponseHandler(
 78 kumpf          1.30.2.1         CIMRequestMessage* request,
 79                                 CIMResponseMessage* response,
 80                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
 81 schuur         1.1      
 82 brian.campbell 1.9          virtual ~OperationResponseHandler(void);
 83 chip           1.11     
 84 chip           1.25         CIMRequestMessage * getRequest(void) const;
 85                         
 86                             CIMResponseMessage * getResponse(void) const;
 87 schuur         1.1      
 88 chip           1.11         virtual void setStatus(
 89                                 const Uint32 code,
 90 chip           1.25             const String & message = String::EMPTY);
 91 schuur         1.1      
 92 chip           1.11         virtual void setStatus(
 93                                 const Uint32 code,
 94 kumpf          1.29             const ContentLanguageList & langs,
 95 chip           1.25             const String & message = String::EMPTY);
 96 schuur         1.1      
 97                         protected:
 98 chip           1.11         // the default for all derived handlers. Some handlers may not apply
 99                             // async behavior because their callers cannot handle partial responses.
100 chip           1.25         virtual Boolean isAsync(void) const;
101 brian.campbell 1.9      
102 chip           1.11         // send (deliver) asynchronously
103                             virtual void send(Boolean isComplete);
104 brian.campbell 1.9      
105 chip           1.11         // transfer any objects from handler to response. this does not clear()
106 chip           1.25         virtual void transfer(void);
107 brian.campbell 1.9      
108 chip           1.11         // validate whatever is necessary before the transfer
109 chip           1.25         virtual void validate(void);
110                         
111                             virtual String getClass(void) const;
112                         
113                             Uint32 getResponseObjectTotal(void) const;
114 brian.campbell 1.9      
115 chip           1.11         // there can be many objects per message (or none at all - i.e complete())
116 chip           1.25         Uint32 getResponseMessageTotal(void) const;
117                         
118                             Uint32 getResponseObjectThreshold(void) const;
119 brian.campbell 1.9      
120 schuur         1.1          CIMRequestMessage * _request;
121                             CIMResponseMessage * _response;
122 kumpf          1.30.2.1     PEGASUS_RESPONSE_CHUNK_CALLBACK_T _responseChunkCallback;
123 schuur         1.1      
124 brian.campbell 1.9      private:
125 chip           1.11         Uint32 _responseObjectTotal;
126                             Uint32 _responseMessageTotal;
127                             Uint32 _responseObjectThreshold;
128                         
129 schuur         1.1      };
130                         
131 chip           1.26     class PEGASUS_PPM_LINKAGE GetInstanceResponseHandler : public OperationResponseHandler, public SimpleInstanceResponseHandler
132 chip           1.11     {
133                         public:
134                             GetInstanceResponseHandler(
135 kumpf          1.30.2.1         CIMGetInstanceRequestMessage* request,
136                                 CIMGetInstanceResponseMessage* response,
137                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
138 chip           1.25     
139                             virtual void deliver(const CIMInstance & cimInstance);
140 kumpf          1.28         virtual void deliver(const Array<CIMInstance> & cimInstanceArray)
141                             {
142                                 SimpleInstanceResponseHandler::deliver(cimInstanceArray);
143                             }
144                         
145 chip           1.26         virtual void complete(void);
146 chip           1.25     
147                         protected:
148                             virtual String getClass(void) const;
149                         
150                             virtual void transfer(void);
151                         
152                             virtual void validate(void);
153 chip           1.14     
154                         private:
155                             ObjectNormalizer _normalizer;
156                         
157 schuur         1.1      };
158                         
159 chip           1.26     class PEGASUS_PPM_LINKAGE EnumerateInstancesResponseHandler : public OperationResponseHandler, public SimpleInstanceResponseHandler
160 schuur         1.1      {
161                         public:
162 chip           1.11         EnumerateInstancesResponseHandler(
163 kumpf          1.30.2.1         CIMEnumerateInstancesRequestMessage* request,
164                                 CIMEnumerateInstancesResponseMessage* response,
165                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
166 chip           1.25     
167                             virtual void deliver(const CIMInstance & cimInstance);
168 kumpf          1.28         virtual void deliver(const Array<CIMInstance> & cimInstanceArray)
169                             {
170                                 SimpleInstanceResponseHandler::deliver(cimInstanceArray);
171                             }
172 chip           1.11     
173 chip           1.25     protected:
174                             virtual String getClass(void) const;
175                         
176                             virtual void transfer(void);
177 chip           1.14     
178                         private:
179                             ObjectNormalizer _normalizer;
180                         
181 schuur         1.1      };
182                         
183 chip           1.26     class PEGASUS_PPM_LINKAGE EnumerateInstanceNamesResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler
184 schuur         1.1      {
185                         public:
186 chip           1.11         EnumerateInstanceNamesResponseHandler(
187 kumpf          1.30.2.1         CIMEnumerateInstanceNamesRequestMessage* request,
188                                 CIMEnumerateInstanceNamesResponseMessage* response,
189                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
190 chip           1.11     
191 chip           1.25         virtual void deliver(const CIMObjectPath & cimObjectPath);
192 kumpf          1.28         virtual void deliver(const Array<CIMObjectPath> & cimObjectPathArray)
193                             {
194                                 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
195                             }
196 chip           1.25     
197                         protected:
198                             virtual String getClass(void) const;
199                         
200                             virtual void transfer(void);
201 chip           1.14     
202                         private:
203                             ObjectNormalizer _normalizer;
204                         
205 schuur         1.1      };
206                         
207 chip           1.26     class PEGASUS_PPM_LINKAGE CreateInstanceResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler
208 schuur         1.1      {
209                         public:
210 chip           1.11         CreateInstanceResponseHandler(
211 kumpf          1.30.2.1         CIMCreateInstanceRequestMessage* request,
212                                 CIMCreateInstanceResponseMessage* response,
213                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
214 chip           1.25     
215                             virtual void deliver(const CIMObjectPath & cimObjectPath);
216 kumpf          1.28         virtual void deliver(const Array<CIMObjectPath> & cimObjectPathArray)
217                             {
218                                 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
219                             }
220                         
221 chip           1.26         virtual void complete(void);
222 chip           1.25     
223                         protected:
224                             virtual String getClass(void) const;
225                         
226                             virtual void transfer(void);
227                         
228 schuur         1.1      };
229                         
230 chip           1.26     class PEGASUS_PPM_LINKAGE ModifyInstanceResponseHandler : public OperationResponseHandler, public SimpleResponseHandler
231 schuur         1.1      {
232                         public:
233 chip           1.11         ModifyInstanceResponseHandler(
234 kumpf          1.30.2.1         CIMModifyInstanceRequestMessage* request,
235                                 CIMModifyInstanceResponseMessage* response,
236                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
237 chip           1.11     
238 chip           1.18     protected:
239 chip           1.25         virtual String getClass(void) const;
240                         
241 schuur         1.1      };
242                         
243 chip           1.26     class PEGASUS_PPM_LINKAGE DeleteInstanceResponseHandler : public OperationResponseHandler, public SimpleResponseHandler
244 schuur         1.1      {
245                         public:
246 chip           1.11         DeleteInstanceResponseHandler(
247 kumpf          1.30.2.1         CIMDeleteInstanceRequestMessage* request,
248                                 CIMDeleteInstanceResponseMessage* response,
249                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
250 chip           1.11     
251 chip           1.18     protected:
252 chip           1.25         virtual String getClass(void) const;
253 chip           1.11     
254 schuur         1.1      };
255                         
256 chip           1.26     class PEGASUS_PPM_LINKAGE GetPropertyResponseHandler : public OperationResponseHandler, public SimpleValueResponseHandler
257 schuur         1.1      {
258                         public:
259 chip           1.11         GetPropertyResponseHandler(
260 kumpf          1.30.2.1         CIMGetPropertyRequestMessage* request,
261                                 CIMGetPropertyResponseMessage* response,
262                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
263 chip           1.25     
264                             virtual void deliver(const CIMValue & cimValue);
265 kumpf          1.28         virtual void deliver(const Array<CIMValue> & cimValueArray)
266                             {
267                                 SimpleValueResponseHandler::deliver(cimValueArray);
268                             }
269 chip           1.25     
270                         protected:
271                             virtual String getClass(void) const;
272                         
273                             virtual void transfer(void);
274                         
275                             virtual void validate(void);
276                         
277 schuur         1.1      };
278                         
279 chip           1.26     class PEGASUS_PPM_LINKAGE SetPropertyResponseHandler : public OperationResponseHandler, public SimpleResponseHandler
280 schuur         1.1      {
281                         public:
282 chip           1.11         SetPropertyResponseHandler(
283 kumpf          1.30.2.1         CIMSetPropertyRequestMessage* request,
284                                 CIMSetPropertyResponseMessage* response,
285                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
286 chip           1.11     
287 chip           1.18     protected:
288 chip           1.25         virtual String getClass(void) const;
289 chip           1.11     
290 schuur         1.1      };
291                         
292 chip           1.26     class PEGASUS_PPM_LINKAGE ExecQueryResponseHandler : public OperationResponseHandler, public SimpleInstance2ObjectResponseHandler
293 schuur         1.1      {
294                         public:
295 chip           1.11         ExecQueryResponseHandler(
296 kumpf          1.30.2.1         CIMExecQueryRequestMessage* request,
297                                 CIMExecQueryResponseMessage* response,
298                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
299 chip           1.25     
300                             virtual void deliver(const CIMInstance & cimInstance);
301 kumpf          1.28         virtual void deliver(const Array<CIMInstance> & cimInstanceArray)
302                             {
303                                 SimpleInstance2ObjectResponseHandler::deliver(cimInstanceArray);
304                             }
305 chip           1.25     
306                         protected:
307                             virtual String getClass(void) const;
308                         
309                             virtual void transfer(void);
310                         
311                             virtual Boolean isAsync(void) const;
312                         
313 schuur         1.1      };
314                         
315 chip           1.26     class PEGASUS_PPM_LINKAGE AssociatorsResponseHandler : public OperationResponseHandler, public SimpleObjectResponseHandler
316 schuur         1.1      {
317                         public:
318 chip           1.11         AssociatorsResponseHandler(
319 kumpf          1.30.2.1         CIMAssociatorsRequestMessage* request,
320                                 CIMAssociatorsResponseMessage* response,
321                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
322 chip           1.25     
323                             virtual void deliver(const CIMObject & cimObject);
324 kumpf          1.28         virtual void deliver(const Array<CIMObject> & cimObjectArray)
325                             {
326                                 SimpleObjectResponseHandler::deliver(cimObjectArray);
327                             }
328 chip           1.25     
329                         protected:
330                             virtual String getClass(void) const;
331                         
332                             virtual void transfer(void);
333 chip           1.11     
334 schuur         1.1      };
335                         
336 chip           1.26     class PEGASUS_PPM_LINKAGE AssociatorNamesResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler
337 schuur         1.1      {
338                         public:
339 chip           1.11         AssociatorNamesResponseHandler(
340 kumpf          1.30.2.1         CIMAssociatorNamesRequestMessage* request,
341                                 CIMAssociatorNamesResponseMessage* response,
342                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
343 chip           1.25     
344                             virtual void deliver(const CIMObjectPath & cimObjectPath);
345 kumpf          1.28         virtual void deliver(const Array<CIMObjectPath> & cimObjectPathArray)
346                             {
347                                 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
348                             }
349 chip           1.25     
350                         protected:
351                             virtual String getClass(void) const;
352                         
353                             virtual void transfer(void);
354 chip           1.11     
355 schuur         1.1      };
356                         
357 chip           1.26     class PEGASUS_PPM_LINKAGE ReferencesResponseHandler : public OperationResponseHandler, public SimpleObjectResponseHandler
358 schuur         1.1      {
359                         public:
360 chip           1.11         ReferencesResponseHandler(
361 kumpf          1.30.2.1         CIMReferencesRequestMessage* request,
362                                 CIMReferencesResponseMessage* response,
363                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
364 chip           1.25     
365                             virtual void deliver(const CIMObject & cimObject);
366 kumpf          1.28         virtual void deliver(const Array<CIMObject> & cimObjectArray)
367                             {
368                                 SimpleObjectResponseHandler::deliver(cimObjectArray);
369                             }
370 chip           1.25     
371                         protected:
372                             virtual String getClass(void) const;
373                         
374                             virtual void transfer(void);
375 chip           1.11     
376 schuur         1.1      };
377                         
378 chip           1.26     class PEGASUS_PPM_LINKAGE ReferenceNamesResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler
379 schuur         1.1      {
380                         public:
381 chip           1.11         ReferenceNamesResponseHandler(
382 kumpf          1.30.2.1         CIMReferenceNamesRequestMessage* request,
383                                 CIMReferenceNamesResponseMessage* response,
384                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
385 chip           1.25     
386                             virtual void deliver(const CIMObjectPath & cimObjectPath);
387 kumpf          1.28         virtual void deliver(const Array<CIMObjectPath> & cimObjectPathArray)
388                             {
389                                 SimpleObjectPathResponseHandler::deliver(cimObjectPathArray);
390                             }
391 chip           1.25     
392                         protected:
393                             virtual String getClass(void) const;
394                         
395                             virtual void transfer(void);
396 chip           1.11     
397 schuur         1.1      };
398                         
399 chip           1.26     class PEGASUS_PPM_LINKAGE InvokeMethodResponseHandler : public OperationResponseHandler, public SimpleMethodResultResponseHandler
400 schuur         1.1      {
401                         public:
402 chip           1.11         InvokeMethodResponseHandler(
403 kumpf          1.30.2.1         CIMInvokeMethodRequestMessage* request,
404                                 CIMInvokeMethodResponseMessage* response,
405                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
406 chip           1.25     
407                             virtual void deliverParamValue(const CIMParamValue & cimParamValue);
408 kumpf          1.28         virtual void deliverParamValue(
409                                 const Array<CIMParamValue> & cimParamValueArray)
410                             {
411                                 SimpleMethodResultResponseHandler::deliverParamValue(
412                                     cimParamValueArray);
413                             }
414 chip           1.25     
415                             virtual void deliver(const CIMValue & cimValue);
416                         
417                         protected:
418                             virtual String getClass(void) const;
419                         
420                             virtual void transfer(void);
421                         
422 schuur         1.1      };
423                         
424 kumpf          1.30.2.1 typedef void (*PEGASUS_INDICATION_CALLBACK_T)(
425                             CIMProcessIndicationRequestMessage*);
426 kumpf          1.2      
427 chip           1.26     class PEGASUS_PPM_LINKAGE EnableIndicationsResponseHandler : public OperationResponseHandler, public SimpleIndicationResponseHandler
428 schuur         1.1      {
429                         public:
430 chip           1.11         EnableIndicationsResponseHandler(
431 kumpf          1.30.2.1         CIMRequestMessage* request,
432                                 CIMResponseMessage* response,
433                                 CIMInstance& provider,
434                                 PEGASUS_INDICATION_CALLBACK_T indicationCallback,
435                                 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback);
436 chip           1.25     
437                             virtual void deliver(const CIMIndication & cimIndication);
438                         
439                             virtual void deliver(const OperationContext & context, const CIMIndication & cimIndication);
440                         
441                             virtual void deliver(const Array<CIMIndication> & cimIndications);
442                         
443                             virtual void deliver(const OperationContext & context, const Array<CIMIndication> & cimIndications);
444                         
445                         protected:
446                             virtual String getClass(void) const;
447                         
448                             virtual Boolean isAsync(void) const;
449 chip           1.18     
450 brian.campbell 1.9      private:
451 kumpf          1.30.2.1     PEGASUS_INDICATION_CALLBACK_T _indicationCallback;
452 schuur         1.1      
453 brian.campbell 1.9      };
454 schuur         1.1      
455                         PEGASUS_NAMESPACE_END
456                         
457                         #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2