ResponseHandler.h
1 //%LICENSE////////////////////////////////////////////////////////////////
2 //
3 // 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 //
10 // 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 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // 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 //
29 //
30 //%/////////////////////////////////////////////////////////////////////////////
31 
32 #ifndef Pegasus_ResponseHandler_h
33 #define Pegasus_ResponseHandler_h
34 
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/Array.h>
37 #include <Pegasus/Common/Linkage.h>
38 
39 #include <Pegasus/Common/CIMInstance.h>
40 #include <Pegasus/Common/CIMObjectPath.h>
41 #include <Pegasus/Common/CIMParamValue.h>
42 #include <Pegasus/Common/CIMValue.h>
43 #include <Pegasus/Common/CIMIndication.h>
44 #include <Pegasus/Common/CIMObject.h>
45 #include <Pegasus/Common/CIMClass.h>
46 #include <Pegasus/Common/OperationContext.h>
47 
48 PEGASUS_NAMESPACE_BEGIN
49 
55 class PEGASUS_COMMON_LINKAGE ResponseHandler
56 {
57 public:
58 
62  virtual ~ResponseHandler();
63 
64  // This method is defined in subclasses, specialized for
65  // the appropriate data type.
66  //virtual void deliver(const T & object);
67 
68  // This method is defined in subclasses, specialized for
69  // the appropriate data type.
70  //virtual void deliver(const Array<T> & objects);
71 
76  virtual void processing() = 0;
77 
83  virtual void complete() = 0;
84 
93  void setContext(const OperationContext & context);
94 
95 protected:
96 
100  ResponseHandler();
101 
105  ResponseHandler(const ResponseHandler& handler);
106 
110  ResponseHandler& operator=(const ResponseHandler& handler);
111 
115  OperationContext getContext() const;
116 };
117 
122 class PEGASUS_COMMON_LINKAGE InstanceResponseHandler
123  : virtual public ResponseHandler
124 {
125 public:
135  virtual void deliver(const CIMInstance & instance) = 0;
136 
144  virtual void deliver(const Array<CIMInstance> & instances) = 0;
145 };
146 
147 
152 class PEGASUS_COMMON_LINKAGE ObjectPathResponseHandler
153  : virtual public ResponseHandler
154 {
155 public:
165  virtual void deliver(const CIMObjectPath & objectPath) = 0;
166 
174  virtual void deliver(const Array<CIMObjectPath> & objectPaths) = 0;
175 };
176 
177 
182 class PEGASUS_COMMON_LINKAGE MethodResultResponseHandler
183  : virtual public ResponseHandler
184 {
185 public:
195  virtual void deliverParamValue(const CIMParamValue & outParamValue) = 0;
196 
205  virtual void deliverParamValue(
206  const Array<CIMParamValue> & outParamValues) = 0;
207 
214  virtual void deliver(const CIMValue & returnValue) = 0;
215 };
216 
217 
222 class PEGASUS_COMMON_LINKAGE IndicationResponseHandler
223  : virtual public ResponseHandler
224 {
225 public:
235  virtual void deliver(const CIMIndication & indication) = 0;
236 
245  virtual void deliver(const Array<CIMIndication> & indications) = 0;
246 
257  virtual void deliver(
258  const OperationContext & context,
259  const CIMIndication & indication) = 0;
260 
271  virtual void deliver(
272  const OperationContext & context,
273  const Array<CIMIndication> & indications) = 0;
274 };
275 
276 
281 class PEGASUS_COMMON_LINKAGE ObjectResponseHandler
282  : virtual public ResponseHandler
283 {
284 public:
294  virtual void deliver(const CIMObject & object) = 0;
295 
303  virtual void deliver(const Array<CIMObject> & objects) = 0;
304 };
305 
306 PEGASUS_NAMESPACE_END
307 
308 #endif
Definition: CIMObjectPath.h:388
Definition: ResponseHandler.h:55
Definition: CIMInstance.h:64
Definition: CIMValue.h:63
Definition: ResponseHandler.h:281
Definition: ResponseHandler.h:152
Definition: OperationContext.h:52
Definition: ResponseHandler.h:182
Definition: CIMParamValue.h:62
Definition: ArrayInter.h:44
Definition: CIMObject.h:75
Definition: ResponseHandler.h:222
Definition: ResponseHandler.h:122