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

  1 karl  1.17 //%2005////////////////////////////////////////////////////////////////////////
  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 schuur 1.1  //
 12             // Permission is hereby granted, free of charge, to any person obtaining a copy
 13             // of this software and associated documentation files (the "Software"), to
 14             // deal in the Software without restriction, including without limitation the
 15             // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 16             // sell copies of the Software, and to permit persons to whom the Software is
 17             // furnished to do so, subject to the following conditions:
 18 chip   1.18 //
 19 schuur 1.1  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 20             // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 21             // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 22             // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 23             // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 24             // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 25             // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 26             // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27             //
 28             //==============================================================================
 29             //
 30             // Author: Chip Vincent (cvincent@us.ibm.com)
 31             //
 32 chip   1.11 // Modified By:
 33             //      Carol Ann Krug Graves, Hewlett-Packard Company (carolann_graves@hp.com)
 34             //      Dave Rosckes (rosckes@us.ibm.com)
 35             //      Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com)
 36             //      Adrian Schuur (schuur@de.ibm.com)
 37             //      Seema Gupta (gseema@in.ibm.com) for PEP135
 38             //      Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase2
 39 schuur 1.1  //
 40             //%/////////////////////////////////////////////////////////////////////////////
 41             
 42             #ifndef Pegasus_OperationResponseHandler_h
 43             #define Pegasus_OperationResponseHandler_h
 44             
 45             #include <Pegasus/Common/Config.h>
 46             #include <Pegasus/Common/CIMMessage.h>
 47             #include <Pegasus/Common/MessageQueueService.h>
 48             #include <Pegasus/Common/Constants.h>
 49             
 50             #include <Pegasus/Common/CIMClass.h>
 51             #include <Pegasus/Common/CIMInstance.h>
 52             #include <Pegasus/Common/CIMIndication.h>
 53             #include <Pegasus/Common/CIMValue.h>
 54             
 55 chip   1.14 #include <Pegasus/Common/OperationContext.h>
 56             #include <Pegasus/Common/OperationContextInternal.h>
 57             
 58             #include <Pegasus/Common/ObjectNormalizer.h>
 59 chip   1.25 
 60 schuur 1.1  #include <Pegasus/Common/ResponseHandler.h>
 61 chip   1.25 #include <Pegasus/ProviderManager2/SimpleResponseHandler.h>
 62 schuur 1.1  
 63             #include <Pegasus/ProviderManager2/Linkage.h>
 64             
 65             PEGASUS_NAMESPACE_BEGIN
 66             
 67             class PEGASUS_PPM_LINKAGE OperationResponseHandler
 68             {
 69 chip   1.11     friend class SimpleResponseHandler;
 70 brian.campbell 1.9  
 71 schuur         1.1  public:
 72 chip           1.11     OperationResponseHandler(
 73                             CIMRequestMessage * request,
 74                             CIMResponseMessage * response);
 75 schuur         1.1  
 76 brian.campbell 1.9      virtual ~OperationResponseHandler(void);
 77 chip           1.11 
 78 chip           1.25     CIMRequestMessage * getRequest(void) const;
 79                     
 80                         CIMResponseMessage * getResponse(void) const;
 81 schuur         1.1  
 82 chip           1.11     virtual void setStatus(
 83                             const Uint32 code,
 84 chip           1.25         const String & message = String::EMPTY);
 85 schuur         1.1  
 86 chip           1.11     virtual void setStatus(
 87                             const Uint32 code,
 88                             const ContentLanguages & langs,
 89 chip           1.25         const String & message = String::EMPTY);
 90 schuur         1.1  
 91                     protected:
 92 chip           1.11     // the default for all derived handlers. Some handlers may not apply
 93                         // async behavior because their callers cannot handle partial responses.
 94 chip           1.25     virtual Boolean isAsync(void) const;
 95 brian.campbell 1.9  
 96 chip           1.11     // send (deliver) asynchronously
 97                         virtual void send(Boolean isComplete);
 98 brian.campbell 1.9  
 99 chip           1.11     // transfer any objects from handler to response. this does not clear()
100 chip           1.25     virtual void transfer(void);
101 brian.campbell 1.9  
102 chip           1.11     // validate whatever is necessary before the transfer
103 chip           1.25     virtual void validate(void);
104                     
105                         virtual String getClass(void) const;
106                     
107                         Uint32 getResponseObjectTotal(void) const;
108 brian.campbell 1.9  
109 chip           1.11     // there can be many objects per message (or none at all - i.e complete())
110 chip           1.25     Uint32 getResponseMessageTotal(void) const;
111                     
112                         Uint32 getResponseObjectThreshold(void) const;
113 brian.campbell 1.9  
114 schuur         1.1      CIMRequestMessage * _request;
115                         CIMResponseMessage * _response;
116                     
117 brian.campbell 1.9  private:
118 chip           1.11     Uint32 _responseObjectTotal;
119                         Uint32 _responseMessageTotal;
120                         Uint32 _responseObjectThreshold;
121                     
122 schuur         1.1  };
123                     
124 chip           1.11 class GetInstanceResponseHandler : public OperationResponseHandler, public SimpleInstanceResponseHandler
125                     {
126                     public:
127                         GetInstanceResponseHandler(
128                             CIMGetInstanceRequestMessage * request,
129 chip           1.25         CIMGetInstanceResponseMessage * response);
130                     
131                         virtual void deliver(const CIMInstance & cimInstance);
132                     
133                     protected:
134                         virtual String getClass(void) const;
135                     
136                         virtual void transfer(void);
137                     
138                         virtual void validate(void);
139 chip           1.14 
140                     private:
141                         ObjectNormalizer _normalizer;
142                     
143 schuur         1.1  };
144                     
145                     class EnumerateInstancesResponseHandler : public OperationResponseHandler, public SimpleInstanceResponseHandler
146                     {
147                     public:
148 chip           1.11     EnumerateInstancesResponseHandler(
149                             CIMEnumerateInstancesRequestMessage * request,
150 chip           1.25         CIMEnumerateInstancesResponseMessage * response);
151                     
152                         virtual void deliver(const CIMInstance & cimInstance);
153 chip           1.11 
154 chip           1.25 protected:
155                         virtual String getClass(void) const;
156                     
157                         virtual void transfer(void);
158 chip           1.14 
159                     private:
160                         ObjectNormalizer _normalizer;
161                     
162 schuur         1.1  };
163                     
164                     class EnumerateInstanceNamesResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler
165                     {
166                     public:
167 chip           1.11     EnumerateInstanceNamesResponseHandler(
168                             CIMEnumerateInstanceNamesRequestMessage * request,
169 chip           1.25         CIMEnumerateInstanceNamesResponseMessage * response);
170 chip           1.11 
171 chip           1.25     virtual void deliver(const CIMObjectPath & cimObjectPath);
172                     
173                     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                     class CreateInstanceResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler
184                     {
185                     public:
186 chip           1.11     CreateInstanceResponseHandler(
187                             CIMCreateInstanceRequestMessage * request,
188 chip           1.25         CIMCreateInstanceResponseMessage * response);
189                     
190                         virtual void deliver(const CIMObjectPath & cimObjectPath);
191                     
192                     protected:
193                         virtual String getClass(void) const;
194                     
195                         virtual void transfer(void);
196                     
197 schuur         1.1  };
198                     
199                     class ModifyInstanceResponseHandler : public OperationResponseHandler, public SimpleResponseHandler
200                     {
201                     public:
202 chip           1.11     ModifyInstanceResponseHandler(
203                             CIMModifyInstanceRequestMessage * request,
204 chip           1.25         CIMModifyInstanceResponseMessage * response);
205 chip           1.11 
206 chip           1.18 protected:
207 chip           1.25     virtual String getClass(void) const;
208                     
209 schuur         1.1  };
210                     
211                     class DeleteInstanceResponseHandler : public OperationResponseHandler, public SimpleResponseHandler
212                     {
213                     public:
214 chip           1.11     DeleteInstanceResponseHandler(
215                             CIMDeleteInstanceRequestMessage * request,
216 chip           1.25         CIMDeleteInstanceResponseMessage * response);
217 chip           1.11 
218 chip           1.18 protected:
219 chip           1.25     virtual String getClass(void) const;
220 chip           1.11 
221 schuur         1.1  };
222                     
223                     class GetPropertyResponseHandler : public OperationResponseHandler, public SimpleValueResponseHandler
224                     {
225                     public:
226 chip           1.11     GetPropertyResponseHandler(
227                             CIMGetPropertyRequestMessage * request,
228 chip           1.25         CIMGetPropertyResponseMessage * response);
229                     
230                         virtual void deliver(const CIMValue & cimValue);
231                     
232                     protected:
233                         virtual String getClass(void) const;
234                     
235                         virtual void transfer(void);
236                     
237                         virtual void validate(void);
238                     
239 schuur         1.1  };
240                     
241                     class SetPropertyResponseHandler : public OperationResponseHandler, public SimpleResponseHandler
242                     {
243                     public:
244 chip           1.11     SetPropertyResponseHandler(
245                             CIMSetPropertyRequestMessage * request,
246 chip           1.25         CIMSetPropertyResponseMessage * response);
247 chip           1.11 
248 chip           1.18 protected:
249 chip           1.25     virtual String getClass(void) const;
250 chip           1.11 
251 schuur         1.1  };
252                     
253                     class ExecQueryResponseHandler : public OperationResponseHandler, public SimpleInstance2ObjectResponseHandler
254                     {
255                     public:
256 chip           1.11     ExecQueryResponseHandler(
257                             CIMExecQueryRequestMessage * request,
258 chip           1.25         CIMExecQueryResponseMessage * response);
259                     
260                         virtual void deliver(const CIMInstance & cimInstance);
261                     
262                     protected:
263                         virtual String getClass(void) const;
264                     
265                         virtual void transfer(void);
266                     
267                         virtual Boolean isAsync(void) const;
268                     
269 schuur         1.1  };
270                     
271                     class AssociatorsResponseHandler : public OperationResponseHandler, public SimpleObjectResponseHandler
272                     {
273                     public:
274 chip           1.11     AssociatorsResponseHandler(
275                             CIMAssociatorsRequestMessage * request,
276 chip           1.25         CIMAssociatorsResponseMessage * response);
277                     
278                         virtual void deliver(const CIMObject & cimObject);
279                     
280                     protected:
281                         virtual String getClass(void) const;
282                     
283                         virtual void transfer(void);
284 chip           1.11 
285 schuur         1.1  };
286                     
287                     class AssociatorNamesResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler
288                     {
289                     public:
290 chip           1.11     AssociatorNamesResponseHandler(
291                             CIMAssociatorNamesRequestMessage * request,
292 chip           1.25         CIMAssociatorNamesResponseMessage * response);
293                     
294                         virtual void deliver(const CIMObjectPath & cimObjectPath);
295                     
296                     protected:
297                         virtual String getClass(void) const;
298                     
299                         virtual void transfer(void);
300 chip           1.11 
301 schuur         1.1  };
302                     
303                     class ReferencesResponseHandler : public OperationResponseHandler, public SimpleObjectResponseHandler
304                     {
305                     public:
306 chip           1.11     ReferencesResponseHandler(
307                             CIMReferencesRequestMessage * request,
308 chip           1.25         CIMReferencesResponseMessage * response);
309                     
310                         virtual void deliver(const CIMObject & cimObject);
311                     
312                     protected:
313                         virtual String getClass(void) const;
314                     
315                         virtual void transfer(void);
316 chip           1.11 
317 schuur         1.1  };
318                     
319                     class ReferenceNamesResponseHandler : public OperationResponseHandler, public SimpleObjectPathResponseHandler
320                     {
321                     public:
322 chip           1.11     ReferenceNamesResponseHandler(
323                             CIMReferenceNamesRequestMessage * request,
324 chip           1.25         CIMReferenceNamesResponseMessage * response);
325                     
326                         virtual void deliver(const CIMObjectPath & cimObjectPath);
327                     
328                     protected:
329                         virtual String getClass(void) const;
330                     
331                         virtual void transfer(void);
332 chip           1.11 
333 schuur         1.1  };
334                     
335                     class InvokeMethodResponseHandler : public OperationResponseHandler, public SimpleMethodResultResponseHandler
336                     {
337                     public:
338 chip           1.11     InvokeMethodResponseHandler(
339                             CIMInvokeMethodRequestMessage * request,
340 chip           1.25         CIMInvokeMethodResponseMessage * response);
341                     
342                         virtual void deliverParamValue(const CIMParamValue & cimParamValue);
343                     
344                         virtual void deliver(const CIMValue & cimValue);
345                     
346                     protected:
347                         virtual String getClass(void) const;
348                     
349                         virtual void transfer(void);
350                     
351 schuur         1.1  };
352                     
353 brian.campbell 1.9  typedef void (*PEGASUS_INDICATION_CALLBACK)(CIMProcessIndicationRequestMessage*);
354 kumpf          1.2  
355 schuur         1.1  class EnableIndicationsResponseHandler : public OperationResponseHandler, public SimpleIndicationResponseHandler
356                     {
357                     public:
358 chip           1.11     EnableIndicationsResponseHandler(
359 carolann.graves 1.19         CIMRequestMessage * request,
360                              CIMResponseMessage * response,
361 chip            1.11         CIMInstance & provider,
362 chip            1.25         PEGASUS_INDICATION_CALLBACK indicationCallback);
363                      
364                          virtual void deliver(const CIMIndication & cimIndication);
365                      
366                          virtual void deliver(const OperationContext & context, const CIMIndication & cimIndication);
367                      
368                          virtual void deliver(const Array<CIMIndication> & cimIndications);
369                      
370                          virtual void deliver(const OperationContext & context, const Array<CIMIndication> & cimIndications);
371                      
372                      protected:
373                          virtual String getClass(void) const;
374                      
375                          virtual Boolean isAsync(void) const;
376 chip            1.18 
377 brian.campbell  1.9  private:
378 chip            1.11     PEGASUS_INDICATION_CALLBACK _indicationCallback;
379 schuur          1.1  
380 brian.campbell  1.9  };
381 schuur          1.1  
382                      PEGASUS_NAMESPACE_END
383                      
384                      #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2