1 kumpf 1.6 //%//-*-c++-*-//////////////////////////////////////////////////////////////////
|
2 chip 1.1 //
3 // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to
7 // deal in the Software without restriction, including without limitation the
8 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 // sell copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
13 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
14 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
18 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 //
21 //==============================================================================
22 //
23 chip 1.1 // Author: Chip Vincent (cvincent@us.ibm.com)
24 //
|
25 kumpf 1.4 // Modified By: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
|
26 chip 1.1 //
27 //%/////////////////////////////////////////////////////////////////////////////
28
29 #ifndef Pegasus_CIMIndicationProvider_h
30 #define Pegasus_CIMIndicationProvider_h
31
32 #include <Pegasus/Common/Config.h>
|
33 kumpf 1.4 #include <Pegasus/Common/CIMInstance.h>
|
34 chip 1.1 #include <Pegasus/Provider/CIMBaseProvider.h>
35
36 #include <Pegasus/Common/Array.h>
37 #include <Pegasus/Common/String.h>
38 #include <Pegasus/Common/CIMReference.h>
|
39 kumpf 1.7 #include <Pegasus/Common/CIMObjectPath.h>
|
40 chip 1.1 #include <Pegasus/Common/CIMDateTime.h>
41
42 PEGASUS_NAMESPACE_BEGIN
43
44 /**
|
45 chip 1.3 This class defines the set of methods implemented by an indication provider. A providers that derives
46 from this class must implement all methods. The minimal method implementation simply throw the
47 NotSupported exception.
48
49 In general, the CIMOM classifies the provider as asynchronous or synchronous depending on the methods
50 implemented by the provider. An asynchronous indication provider supports provideIndication,
51 updateIndication, and cancelIndication. A synchronous provider supports checkIndication. A provider
52 can support both interfaces.
53
54 The CIMOM first attempts to call provideIndication, given at least once subscription exists.
55 If the provider does not support the method, the CIMOM assumes the provider generates indications
56 synchronously using checkIndication. If the provider does not support any of the methods of this
57 interface, is not considered an indication provider and an error is generated.
|
58 chip 1.1 */
|
59 chip 1.3 class PEGASUS_PROVIDER_LINKAGE CIMIndicationProvider : public virtual CIMBaseProvider
|
60 chip 1.1 {
61 public:
|
62 chip 1.3 CIMIndicationProvider(void);
63 virtual ~CIMIndicationProvider(void);
|
64 chip 1.1
|
65 chip 1.3 /**
66 Instructs the provider to begin generating indications of the type specified in
67 the classReference parameter.
68
69 This method is invoked when the CIMOM has at least one active subscription that
70 links the indication type with a handler. Once this method has been invoked, changes
71 to the active subscriptions are communicated via the updateIndication method. The
72 cancelIndication method is invoked when all active subscriptions have been removed.
73
74 For example, assume that two subscriptions exist that point to the following filters.
|
75 chip 1.1
76 <pre>
|
77 chip 1.3 <code>"SELECT Property1 FROM Sample_Indication WHERE Property1="foo" WITHIN 30000"</code>
78 <code>"SELECT Property2 FROM Sample_Indication WHERE Property1="bar" WITHIN 60000"</code>
|
79 chip 1.1 </pre>
80
|
81 chip 1.3 The contents of the paramters (in string form) to this method might look like the following.
|
82 chip 1.1
83 <pre>
|
84 chip 1.3 <code>classReference = "localhost/root/cimv2:Sample_Indication"</code>
85 <code>minimumInterval = "00000000003000.000000:000" (30 minutes)</code>
86 <code>maximumInterval = "00000000006000.000000:000" (60 minutes)</code>
87 <code>propertyList = "Property1", "Property2"</code>
|
88 chip 1.1 </pre>
89
|
90 chip 1.3 NOTE: The WHERE clause is not evaluated by the provider. Providers generate indications according
91 to predefined events and are not specified by indication filters. The existence of a filter simply
92 notifies a provider that some client is interested in indications of a specified type. The filters
93 specify the criteria for indication delivery, not creation.
94
95 Assuming the above parameters, the provider should attach to some resource and begin monitoring
96 every 30 seconds (optimally). When some predefined event occurs (a circumstance that merits an
97 indication), the provider should create and indication containing the properties listed in the
98 propertyList parameter. The provider then delivers the indication to the handler associated with the
99 indication type and continues monitoring. A call to updateIndication means that the indication
100 generation information (minimumInterval, maximumInterval, and propertyList) has changed, and a call
101 to cancelIndication notifies the provider to discontinue monitoring (no subscriptions exist).
102
103 NOTE: Under normal circumstances the provider should not call handler.complete() in this method;
104 it should be called in cancelIndication. Calling this method implies no more results are available
105 and will effectively disable result forwarding for the handler.
|
106 chip 1.1
|
107 chip 1.3 @param contex contains security and locale information relevant for the lifetime
108 of this operation.
|
109 chip 1.1
|
110 chip 1.3 @param classReference provides a fully qualified reference of the indication
111 class of interest.
|
112 chip 1.1
|
113 chip 1.3 @param minimumInterval specifies the minimum requested indication delivery frequency. This is an
114 optional parameter where an interval of zero ("0000000000.000000:000") implies not specified.
|
115 chip 1.1
|
116 chip 1.3 @param maximumInterval specifies the maximum requested indication delivery frequency. This is an
117 optional parameter where an interval of zero ("0000000000.000000:000") implies not specified.
|
118 chip 1.1
|
119 chip 1.3 @param propertyList specifies the properties of interest within the class
120 identified by the classReference parameter.
121
122 @param handler asynchronusly processes the results of this operation.
|
123 chip 1.1
124 @exception NotImplemented
125 @exception InvalidArgument
|
126 chip 1.3 */
127 virtual void provideIndication(
128 const OperationContext & context,
129 const CIMReference & classReference,
130 const CIMDateTime & minimumInterval,
131 const CIMDateTime & maximumInterval,
132 const Array<String> & propertyList,
|
133 kumpf 1.4 ResponseHandler<CIMInstance> & handler) = 0;
|
134 chip 1.3
135 /**
136 Instructs the provider update the information regarding the indication of the type specified
137 in the classReference parameter.
138
139 Once the provideIndication method has been called, the CIMOM communicated significant changes
140 to the indication generatation information (minimumInterval, maximumInterval, and propertyList)
|
141 chip 1.1 via this method.
142
|
143 chip 1.3 Assuming provideIndications was called with the parameters in the sample above, and a new
144 subscription is created for the following filter.
|
145 chip 1.1
146 <pre>
|
147 chip 1.3 <code>"SELECT Property1, Property3 FROM Sample_Indication WHERE Property1="bar" WITHIN 60000"</code>
|
148 chip 1.1 </pre>
149
|
150 chip 1.3 The contents of the paramters (in string form) to this method might look like the following.
|
151 chip 1.1
152 <pre>
|
153 chip 1.3 <code>classReference = "localhost/root/cimv2:Sample_Indication"</code>
154 <code>minimumInterval = "00000000003000.000000:000" (30 minutes)</code>
155 <code>maximumInterval = "00000000006000.000000:000" (60 minutes)</code>
156 <code>propertyList = "Property1", "Property2", "Property3"</code>
|
157 chip 1.1 </pre>
158
|
159 chip 1.3 NOTE: The WHERE clause is not evaluated by the provider. Providers generate indications according
160 to predefined events and are not specified by indication filters. The existence of a filter simply
161 notifies a provider that some client is interested in indications of a specified type. The filters
162 specify the criteria for indication delivery, not creation.
163
164 Assuming the above parameters, the provider should adjust add Property3 to any indications
165 generated from this point forward.
166
167 New subscriptions associated to existing filters do not result in calls to the provider.
168
169 NOTE: Under normal circumstances the provider should not call handler.complete() in this method;
170 it should be called in cancelIndication. Calling this method implies no more results are available
171 and will effectively disable result forwarding for the handler.
|
172 chip 1.1
173 @param context contains security and locale information
174 relevant for the lifetime of this operation.
175
|
176 chip 1.3 @param classReference provides a fully qualified reference of the indication
177 class of interest.
178
179 @param minimumInterval specifies the minimum requested indication delivery frequency. This is an
180 optional parameter where an interval of zero ("0000000000.000000:000") implies not specified.
|
181 chip 1.1
|
182 chip 1.3 @param maximumInterval specifies the maximum requested indication delivery frequency. This is an
183 optional parameter where an interval of zero ("0000000000.000000:000") implies not specified.
|
184 chip 1.1
|
185 chip 1.3 @param propertyList specifies the properties of interest within the class
186 identified by the classReference parameter.
|
187 chip 1.1
|
188 chip 1.3 @param handler asynchronusly processes the results of this operation.
|
189 chip 1.1
190 @exception NotImplemented
191 @exception InvalidArgument
|
192 chip 1.3 */
193 virtual void updateIndication(
194 const OperationContext & context,
195 const CIMReference & classReference,
196 const CIMDateTime & minimumInterval,
197 const CIMDateTime & maximumInterval,
198 const Array<String> & propertyList,
|
199 kumpf 1.4 ResponseHandler<CIMInstance> & handler) = 0;
|
200 chip 1.3
201 /**
202 Instructs the provider to stop providing indications of the type specified in the
203 classReference parameter.
204
205 This method is called after provideIndication and implies that either no
206 subscriptions exist or that the CIMOM is shutting down. The provider should release
207 resources associated with generating indications of the type specified in
208 classReference. If a subscription is later created, provideIndications will be
209 called again.
210
211 Upon completion of this method, the provider should call handler.complete (the CIMOM
212 will call it, if necessary) at which point the handle is no longer guaranteed to be
213 valid. Usage of the handle after complete is undefined.
|
214 chip 1.1
|
215 chip 1.3 @param context contains security and locale information relevant for the lifetime
216 of this operation.
|
217 chip 1.1
|
218 chip 1.3 @param classReference provides a fully qualified reference of the indication
219 class of interest.
|
220 chip 1.1
|
221 chip 1.3 @param handler asynchronusly processes the results of this operation.
|
222 chip 1.1
223 @exception NotImplemented
224 @exception InvalidArgument
|
225 chip 1.3 */
226 virtual void cancelIndication(
227 const OperationContext & context,
228 const CIMReference & classReference,
|
229 kumpf 1.4 ResponseHandler<CIMInstance> & handler) = 0;
|
230 chip 1.3
231 /**
232 Instructs the provider to check the managed resource and immediately generate indications,
233 if necessary, and complete.
234
235 This method is called periodically by the CIMOM to allow the provider to create indications
236 without actively monitoring a resource. Because the method executes on the CIMOM's thread,
237 the provider should attempt to complete the method prompty to allow the CIMOM to service
238 other providers.
|
239 chip 1.1
240 @param context contains security and locale information
241 relevant for the lifetime of this operation.
242
|
243 chip 1.3 @param classReference provides a fully qualified reference of the indication
244 class of interest.
|
245 chip 1.1
|
246 chip 1.3 @param The propertyList specifies the properties of interest within the class
247 identified by the classReference parameter.
|
248 chip 1.1
|
249 chip 1.3 @param handler asynchronusly processes the results of this operation.
|
250 chip 1.1
251 @exception NotImplemented
252 @exception InvalidArgument
|
253 chip 1.3 */
254 virtual void checkIndication(
255 const OperationContext & context,
256 const CIMReference & classReference,
257 const Array<String> & propertyList,
|
258 kumpf 1.4 ResponseHandler<CIMInstance> & handler) = 0;
259
260 virtual void enableIndication(
261 const OperationContext & context,
262 const String & nameSpace,
263 const Array<String> & classNames,
|
264 kumpf 1.6 const CIMPropertyList & propertyList,
|
265 kumpf 1.4 const Uint16 repeatNotificationPolicy,
266 const String & otherRepeatNotificationPolicy,
267 const CIMDateTime & repeatNotificationInterval,
268 const CIMDateTime & repeatNotificationGap,
269 const Uint16 repeatNotificationCount,
270 const String & condition,
271 const String & queryLanguage,
272 const CIMInstance & subscription,
273 ResponseHandler<CIMInstance> & handler) = 0;
274
275 virtual void disableIndication(
276 const OperationContext & context,
277 const String & nameSpace,
278 const Array<String> & classNames,
279 const CIMInstance & subscription,
280 ResponseHandler<CIMInstance> & handler) = 0;
281
282 virtual void modifyIndication(
283 const OperationContext & context,
284 const String & nameSpace,
285 const Array<String> & classNames,
|
286 kumpf 1.6 const CIMPropertyList & propertyList,
|
287 kumpf 1.4 const Uint16 repeatNotificationPolicy,
288 const String & otherRepeatNotificationPolicy,
289 const CIMDateTime & repeatNotificationInterval,
290 const CIMDateTime & repeatNotificationGap,
291 const Uint16 repeatNotificationCount,
292 const String & condition,
293 const String & queryLanguage,
294 const CIMInstance & subscription,
295 ResponseHandler<CIMInstance> & handler) = 0;
|
296 chip 1.1 };
297
|
298 chip 1.5 /*
299 current (ongoing) indication interface proposal
300
301 class CIM_IndicationProvider : virtual public CIM_BaseProvider
302 {
303 public:
304 virtual void enableIndication(
305 const OperationContext & context,
306 const CIMObjectPath & className,
307 const CIMPropertyList & propertyList,
308 const CIMInstance & subscription,
309 ResponseHandler<CIMIndication> & handler) = 0;
310
311 virtual void modifyIndication(
312 const OperationContext & context,
313 const CIMObjectPath & className,
314 const CIMPropertyList & propertyList,
315 const CIMInstance & subscription) = 0;
316
317 virtual void disableIndication(
318 const OperationContext & context,
319 chip 1.5 const CIMObjectPath & className,
320 const CIMInstance & subscription) = 0;
321 };
322 */
323
|
324 chip 1.1 PEGASUS_NAMESPACE_END
325
|
326 chip 1.3 #endif
|