1 kumpf 1.4 //%/////////////////////////////////////////////////////////////////////////////
|
2 mike 1.2 //
|
3 kumpf 1.4 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
|
5 mike 1.2 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to
8 // deal in the Software without restriction, including without limitation the
9 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 // sell copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
14 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
15 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
16 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 //
22 //==============================================================================
23 //
24 // Author: Chip Vincent (cvincent@us.ibm.com)
25 //
|
26 kumpf 1.4 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
27 mike 1.2 //
28 //%/////////////////////////////////////////////////////////////////////////////
29
30 #ifndef Pegasus_ResponseHandler_h
31 #define Pegasus_ResponseHandler_h
32
33 #include <Pegasus/Common/Config.h>
34 #include <Pegasus/Common/Array.h>
|
35 kumpf 1.6 #include <Pegasus/Common/Linkage.h>
|
36 kumpf 1.4
37 #include <Pegasus/Common/CIMInstance.h>
38 #include <Pegasus/Common/CIMObjectPath.h>
39 #include <Pegasus/Common/CIMParamValue.h>
40 #include <Pegasus/Common/CIMValue.h>
41 #include <Pegasus/Common/CIMIndication.h>
42 #include <Pegasus/Common/CIMObject.h>
43 #include <Pegasus/Common/CIMClass.h>
|
44 mike 1.2
45 PEGASUS_NAMESPACE_BEGIN
46
|
47 kumpf 1.4 /**
48 Callback to deliver results to the CIMOM.
49
50 <p>The <tt>ResponseHandler</tt> class allows a provider
51 to report operation progress and results to the CIMOM.
52 Subclasses are defined for each of the types of object
53 that a provider can deliver to the CIMOM.
54 A <tt>ResponseHandler</tt> object of the appropriate type
55 is passed to provider
56 functions that are invoked to process client requests (it
57 is not passed to the <tt>{@link initialize initialize}</tt>
58 or <tt>{@link terminate terminate}</tt> functions). It
59 contains the following public member functions that
60 may be used to deliver results to the CIMOM:</p>
61 <ul>
62 <li><tt>{@link processing processing}</tt> - inform the CIMOM
63 that delivery of results is beginning</li>
64 <li><tt>{@link deliver deliver}</tt> - deliver an incremental
65 result to the CIMOM; the CIMOM accumulates results as
66 they are received from the provider</li>
67 <li><tt>{@link complete complete}</tt> - inform the CIMOM that
68 kumpf 1.4 process of the request is complete and that no further
69 results will be delivered</li>
70 </ul>
71 */
72
|
73 kumpf 1.5 class PEGASUS_COMMON_LINKAGE ResponseHandler
|
74 kumpf 1.4 {
75 public:
76
77 /**
78 Destructor.
79 */
80 virtual ~ResponseHandler(void);
81
82 /**
83 Deliver a possibly partial result to CIMOM.
84 <p>The <tt>deliver</tt> function is used by providers to
85 deliver results to the CIMOM. For operations that require a
86 single element result (<tt>getInstance</tt>, for example),
87 <tt>deliver</tt> should be called only once to deliver the
88 entire result. For operations that involve
89 enumeration, the single-element form shown here may be
90 used, each iteration delivering an incremental element
91 of the total result. The Array form below may be used
92 to deliver a larger set of result elements.</p>
93 */
94 //virtual void deliver(const T & object);
95 kumpf 1.4
96 /**
97 Deliver a set of results to CIMOM.
98 <p>This form of the <tt>deliver</tt> function may be used
99 to return a set of elements to the CIMOM. The set is not
100 required to be complete, and the provider may invoke this
101 function multiple times, if necessary. This form should only
102 be used when the operation requires a result consisting
103 of more than one element, such as an enumeration.</p>
104 */
105 //virtual void deliver(const Array<T> & objects);
106
107 /**
108 Inform the CIMOM that delivery of results will begin.
109 <p>The provider must call <tt>processing</tt> before
110 attempting to call <tt>deliver</tt>.
111 */
112 virtual void processing(void) = 0;
113
114 /**
115 Inform the CIMOM that delivery of results is complete.
116 kumpf 1.4 <p>The provider must call <tt>complete</tt> when all
117 results have been delivered. It must not call <tt>deliver</tt>
118 after calling <tt>complete</tt>.</p>
119 */
120 virtual void complete(void) = 0;
121 };
122
123
124 //
125 // InstanceResponseHandler
126 //
|
127 kumpf 1.5 class PEGASUS_COMMON_LINKAGE InstanceResponseHandler : virtual public ResponseHandler
|
128 kumpf 1.4 {
129 public:
130 virtual void deliver(const CIMInstance & instance) = 0;
131
132 virtual void deliver(const Array<CIMInstance> & instances) = 0;
133 };
134
135
136 //
137 // ObjectPathResponseHandler
138 //
|
139 kumpf 1.5 class PEGASUS_COMMON_LINKAGE ObjectPathResponseHandler : virtual public ResponseHandler
|
140 kumpf 1.4 {
141 public:
142 virtual void deliver(const CIMObjectPath & objectPath) = 0;
143
144 virtual void deliver(const Array<CIMObjectPath> & objectPaths) = 0;
145 };
146
147
148 //
149 // MethodResultResponseHandler
150 //
|
151 kumpf 1.5 class PEGASUS_COMMON_LINKAGE MethodResultResponseHandler : virtual public ResponseHandler
|
152 kumpf 1.4 {
153 public:
154 virtual void deliverParamValue(const CIMParamValue & outParamValue) = 0;
155
156 virtual void deliverParamValue(const Array<CIMParamValue> & outParamValues) = 0;
157
158 virtual void deliver(const CIMValue & returnValue) = 0;
159 };
160
161
162 //
163 // IndicationResponseHandler
164 //
|
165 kumpf 1.5 class PEGASUS_COMMON_LINKAGE IndicationResponseHandler : virtual public ResponseHandler
|
166 kumpf 1.4 {
167 public:
168 virtual void deliver(const CIMIndication & indication) = 0;
169
170 virtual void deliver(const Array<CIMIndication> & indications) = 0;
171 };
172
173
174 //
175 // ObjectResponseHandler
176 //
|
177 kumpf 1.5 class PEGASUS_COMMON_LINKAGE ObjectResponseHandler : virtual public ResponseHandler
|
178 kumpf 1.4 {
179 public:
180 virtual void deliver(const CIMObject & object) = 0;
181
182 virtual void deliver(const Array<CIMObject> & objects) = 0;
183 };
184
185
|
186 kumpf 1.7 #ifdef PEGASUS_INTERNALONLY
187 // This type is used in CIMPropertyProvider which Pegasus does not support
|
188 kumpf 1.4 //
189 // ValueResponseHandler
190 //
|
191 kumpf 1.5 class PEGASUS_COMMON_LINKAGE ValueResponseHandler : virtual public ResponseHandler
|
192 kumpf 1.4 {
193 public:
194 virtual void deliver(const CIMValue & value) = 0;
195
196 virtual void deliver(const Array<CIMValue> & values) = 0;
197 };
|
198 kumpf 1.7 #endif
|
199 kumpf 1.4
200
|
201 kumpf 1.7 #ifdef PEGASUS_INTERNALONLY
202 // This type is used in CIMClassProvider which Pegasus does not support
|
203 kumpf 1.4 //
204 // ClassResponseHandler
205 //
|
206 kumpf 1.5 class PEGASUS_COMMON_LINKAGE ClassResponseHandler : virtual public ResponseHandler
|
207 mike 1.2 {
208 public:
|
209 kumpf 1.4 virtual void deliver(const CIMClass & classObj) = 0;
|
210 mike 1.2
|
211 kumpf 1.4 virtual void deliver(const Array<CIMClass> & classObjs) = 0;
|
212 mike 1.2 };
|
213 kumpf 1.7 #endif
|
214 mike 1.2
215 PEGASUS_NAMESPACE_END
216
217 #endif
|