1 martin 1.87 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.88 //
|
3 martin 1.87 // 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 martin 1.88 //
|
10 martin 1.87 // 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 martin 1.88 //
|
17 martin 1.87 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.88 //
|
20 martin 1.87 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.88 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.87 // 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 martin 1.88 //
|
28 martin 1.87 //////////////////////////////////////////////////////////////////////////
|
29 kumpf 1.1 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_IndicationService_h
33 #define Pegasus_IndicationService_h
34
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/MessageQueueService.h>
37 #include <Pegasus/Common/CIMMessage.h>
|
38 kumpf 1.78 #include <Pegasus/Common/AcceptLanguageList.h>
39 #include <Pegasus/Common/ContentLanguageList.h>
|
40 yi.zhou 1.84 #include <Pegasus/Server/ProviderRegistrationManager/\
41 ProviderRegistrationManager.h>
|
42 kumpf 1.54 #include <Pegasus/Server/Linkage.h>
|
43 chuck 1.64 #include <Pegasus/Query/QueryExpression/QueryExpression.h>
|
44 kumpf 1.1
|
45 yi.zhou 1.84 #include <Pegasus/IndicationService/ProviderClassList.h>
46 #include <Pegasus/IndicationService/IndicationOperationAggregate.h>
47
48 #ifdef PEGASUS_ENABLE_INDICATION_COUNT
49 # include <Pegasus/IndicationService/ProviderIndicationCountTable.h>
50 #endif
|
51 kumpf 1.41
|
52 venkat.puvvada 1.85 #ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
53 # include <Pegasus/IndicationService/IndicationServiceConfiguration.h>
54 #endif
55
|
56 kumpf 1.1 PEGASUS_NAMESPACE_BEGIN
57
|
58 karl 1.97.2.1 // Holds information of control providers servicing the indications.
59 struct ControlProvIndReg
60 {
61 CIMName className;
62 CIMNamespaceName nameSpace;
63 CIMInstance providerModule;
64 CIMInstance provider;
65 };
66
67 typedef HashTable <String, ControlProvIndReg, EqualFunc <String>,
68 HashFunc <String> > ControlProvIndRegTable;
69
|
70 kumpf 1.54 class SubscriptionRepository;
71 class SubscriptionTable;
|
72 kumpf 1.1
73 /**
|
74 kumpf 1.5 IndicationService class is the service that serves the
|
75 kumpf 1.10 Indication Subscription, Indication Filter, and Indication Handler
|
76 kumpf 1.5 classes, and processes indications.
|
77 kumpf 1.1 */
78
79 class PEGASUS_SERVER_LINKAGE IndicationService : public MessageQueueService
80 {
81 public:
82
83 /**
84 Constructs an IndicationSubscription instance and initializes instance
85 variables.
86 */
|
87 kumpf 1.82 IndicationService(
88 CIMRepository* repository,
89 ProviderRegistrationManager* providerRegManager);
|
90 kumpf 1.1
|
91 kumpf 1.82 virtual ~IndicationService();
|
92 kumpf 1.1
|
93 mday 1.2 void handleEnqueue(Message* message);
|
94 kumpf 1.1
|
95 kumpf 1.82 virtual void handleEnqueue();
|
96 kumpf 1.1
|
97 kumpf 1.82 virtual void _handle_async_request(AsyncRequest* req);
|
98 kumpf 1.1
|
99 kumpf 1.54 /**
100 Gets a String containing the Provider Name, for use in a log message to
101 identify the provider.
102
103 @param provider provider instance
104
105 @return String containing the Provider Name
106 */
|
107 kumpf 1.82 static String getProviderLogString(CIMInstance& provider);
|
108 kumpf 1.54
|
109 venkat.puvvada 1.90 /**
110 Sends a Subscription Init Complete request to the Provider
111 Manager Service.
112 */
113 void sendSubscriptionInitComplete();
114
|
115 venkat.puvvada 1.91
|
116 kumpf 1.1 AtomicInt dienow;
117
118 /**
|
119 kumpf 1.5 Operation types for the NotifyProviderRegistration message
|
120 kumpf 1.1 */
|
121 kumpf 1.5 enum Operation {OP_CREATE = 1, OP_DELETE = 2, OP_MODIFY = 3};
|
122 kumpf 1.24
123 static Mutex _mutex;
|
124 kumpf 1.1
|
125 kumpf 1.5 private:
|
126 kumpf 1.1
|
127 kumpf 1.82 void _initialize();
|
128 kumpf 1.1
|
129 venkat.puvvada 1.91 /**
130 Reads active subscriptons from repository and sends create subscription
131 requests to the corresponding indication providers and initializes the
132 subscription repository and tables.
133 @param timeoutSeconds Timeout in seconds to complete the
134 initialization of active
135 subscriptions. Timeout value 0
136 means no time limit.
137
138 @return True, if the initialization completed within timeout period.
139 False, if the initialization can not completed within
140 timeout period.
141 */
142 Boolean _initializeActiveSubscriptionsFromRepository(Uint32 timeoutSeconds);
143
|
144 kumpf 1.82 void _terminate();
|
145 kumpf 1.1
|
146 kumpf 1.82 void _handleGetInstanceRequest(const Message* message);
|
147 kumpf 1.1
|
148 kumpf 1.82 void _handleEnumerateInstancesRequest(const Message* message);
|
149 kumpf 1.1
|
150 kumpf 1.82 void _handleEnumerateInstanceNamesRequest(const Message* message);
|
151 kumpf 1.1
|
152 kumpf 1.82 void _handleCreateInstanceRequest(const Message* message);
|
153 kumpf 1.1
|
154 kumpf 1.82 void _handleModifyInstanceRequest(const Message* message);
|
155 kumpf 1.1
156 void _handleDeleteInstanceRequest(const Message * message);
157
|
158 yi.zhou 1.83 void _handleProcessIndicationRequest(Message* message);
|
159 kumpf 1.1
|
160 venkat.puvvada 1.91 #ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
161
162 void _handleInvokeMethodRequest(Message* message);
163 /**
164 Sends CIMIndicationServiceDisabledRequestMessage to provider manager
165 service so that provider manager's resets _subscriptionInitComplete
166 flag.
167 */
168 void _sendIndicationServiceDisabled();
169
170 /**
171 Clears Subscription Table entries after sending delete subscription
172 requests to appropriate indication providers. Subscription state will
173 remain enabled.
174 @param timeoutSeconds Timeout in seconds to complete sending
175 the delete subscription requests to
176 all active indication providers.
177 Timeout value 0 means no time limit.
178
179 @return True, if the operation is completed within timeout period.
180 False, if the operation can not completed within
181 venkat.puvvada 1.91 timeout period.
182 */
183
184 Boolean _deleteActiveSubscriptions(Uint32 timeoutSeconds);
185
186 /**
187 Enables the indication service using method
188 _initializeActiveSubscriptionsFromRepository(). Sets the Service
189 EnabledState and HelathState properties appropriately.
190 @param timeoutSeconds Timeout in seconds to complete the
191 initialization of active
192 subscriptions. Timeout value 0
193 means no time limit.
194
195 @return _RETURNCODE_COMPLETEDWITHNOERROR, if the initialization
196 completed within timeout period. Service HealthState
197 is set to "OK" and EnabledState will be set to "Enabled".
198
199 _RETURNCODE_TIMEOUT, if the initialization can not completed
200 within timeout period. In this case, all active
201 subscriptions might not have been initialized. Service
202 venkat.puvvada 1.91 HealthState is set to "Degraded/Warning" and EnabledState
203 will be set to "Enabled".
204 */
205 Uint32 _enableIndicationService(Uint32 timeoutSeconds);
206
207 /**
208 Disables the indication service using _deleteActiveSubscriptions()
209 method. Sets the Service EnabledState and HelathState
210 properties appropriately.
211
212 @param timeoutSeconds Timeout in seconds to complete the
213 disabling of the service.
214 @param cimException Output parameter returned to calller
215 if there is an exception.
216
217 @return _RETURNCODE_COMPLETEDWITHNOERROR, if the disable
218 completed within timeout period. Service
219 HealthState is set to "OK" and EnabledState
220 will be set to "Disabled".
221
222 _RETURNCODE_TIMEOUT, if the disable cannot be completed
223 venkat.puvvada 1.91 within timeout period. In this case, all active
224 subscriptions might not have been disabled. Service
225 HealthState is set to "Degraded/Warning" and EnabledState
226 will remain "Enabled".
227 */
228 Uint32 _disableIndicationService(
229 Uint32 timeoutSeconds,
230 CIMException &cimException);
231
232 /**
233 Waits for async requets pending to complete. Returns true if there
234 are no async requests pending within timeout period.
235 */
236 Boolean _waitForAsyncRequestsComplete(
237 struct timeval* startTime,
238 Uint32 timeoutSeconds);
|
239 venkat.puvvada 1.94 /**
240 Sends the CIMNotifySubscriptionNotActiveRequestMessage to Handler
241 service when subscription has been disabled/deleted/expired.
242
243 @param subscriptionName The subscription instance path
244 */
245 void _sendSubscriptionNotActiveMessagetoHandlerService(
246 const CIMObjectPath &subscriptionName);
247
248 /**
249 Sends the CIMNotifyListenerNotActiveRequestMessage to Handler
250 service when listener has been deleted.
251
252 @param handlerName handler/listener instance path
253 */
254 void _sendListenerNotActiveMessagetoHandlerService(
255 const CIMObjectPath &handlerName);
|
256 venkat.puvvada 1.91 #endif
|
257 venkat.puvvada 1.94
|
258 venkat.puvvada 1.97 Uint16 _getEnabledState();
259 void _setEnabledState(Uint16 state);
260
|
261 venkat.puvvada 1.91 /**
262 Handles the CIM requests when IndicationService is not enabled. Very
263 few requests are handled by IndicationService when not enabled.
264 */
265 void _handleCimRequestWithServiceNotEnabled(Message *message);
266
267 void _handleCimRequest(Message *message);
268
|
269 kumpf 1.1 /**
|
270 kumpf 1.57 Asynchronous callback function for _handleProcessIndicationRequest.
271 The response from the Handler is checked, and if it is not success, the
|
272 carolann.graves 1.74 subscription's On Fatal Error Policy is implemented.
|
273 kumpf 1.57
274 @param operation shared data structure that controls message
275 processing
276 @param destination target queue of completion callback
277 @param userParameter user parameter for callback processing
278 */
|
279 kumpf 1.82 static void _handleIndicationCallBack(
280 AsyncOpNode* operation,
281 MessageQueue* destination,
282 void* userParameter);
|
283 kumpf 1.57
284 /**
|
285 kumpf 1.82 Notifies the Indication Service that a change in provider registration
286 has occurred. The Indication Service retrieves the subscriptions
287 affected by the registration change, sends the appropriate Create,
|
288 carolann.graves 1.74 Modify, and/or Delete requests to the provider, and sends an alert to
289 handler instances of subscriptions that are no longer served by the
|
290 kumpf 1.10 provider.
|
291 kumpf 1.1 */
|
292 kumpf 1.82 void _handleNotifyProviderRegistrationRequest(const Message* message);
|
293 kumpf 1.1
294 /**
|
295 carolann.graves 1.74 Notifies the Indication Service that a provider has been disabled.
|
296 kumpf 1.51 The Indication Service retrieves the subscriptions served by the
|
297 carolann.graves 1.74 disabled provider, and logs a message for each subscription that is no
|
298 kumpf 1.51 longer served by the provider.
|
299 kumpf 1.1 */
|
300 kumpf 1.82 void _handleNotifyProviderTerminationRequest(const Message* message);
|
301 kumpf 1.1
302 /**
|
303 carolann.graves 1.74 Notifies the Indication Service that a provider has been enabled.
304 The Indication Service retrieves the subscriptions that can be served
305 by the enabled provider, sends Create Subscription and Enable
306 Indications requests to the provider, and logs a message for each
|
307 kumpf 1.51 subscription that is now served by the provider.
308 */
|
309 kumpf 1.82 void _handleNotifyProviderEnableRequest(const Message* message);
|
310 kumpf 1.51
311 /**
|
312 carolann.graves 1.80 Notifies the Indication Service that failure of a provider module that
313 included at least one indication provider has been detected.
314 The Indication Service retrieves the subscriptions served by providers
315 in the failed module. The Indication Service returns in the response
316 the number of affected subscriptions, so the sender of the request
317 knows if any subscriptions were affected.
318 */
|
319 kumpf 1.82 void _handleNotifyProviderFailRequest(Message* message);
|
320 carolann.graves 1.80
321 /**
|
322 carolann.graves 1.74 Determines if it is legal to create an instance.
323 Checks for existence of all key and required properties. Checks that
324 properties that MUST NOT exist (based on values of other properties),
325 do not exist. For any property that has a default value, if it does
|
326 kumpf 1.5 not exist, adds the property with the default value.
327
328 @param instance instance to be created
329 @param nameSpace namespace for instance to be created
330
|
331 carolann.graves 1.73 @exception CIM_ERR_INVALID_PARAMETER if instance is invalid
|
332 carolann.graves 1.74 @exception CIM_ERR_NOT_SUPPORTED if the specified class is not
|
333 carolann.graves 1.73 supported
|
334 kumpf 1.5
|
335 kumpf 1.54 @return True, if the instance can be created;
|
336 kumpf 1.10 Otherwise throws an exception
|
337 kumpf 1.5 */
|
338 kumpf 1.82 Boolean _canCreate(
339 CIMInstance& instance,
340 const CIMNamespaceName& nameSpace);
|
341 kumpf 1.5
|
342 kumpf 1.21 /**
343 Validates the specified required property in the instance.
|
344 carolann.graves 1.74 If the property does not exist, or has a null value, or is not of the
|
345 kumpf 1.56 expected type, an exception is thrown, using the specified message.
|
346 kumpf 1.21
|
347 carolann.graves 1.74 This function is called by the _canCreate function, and is used to
|
348 kumpf 1.21 validate the Filter and Handler properties in Subscription instances,
|
349 carolann.graves 1.74 the Name, Query and Query Language properties in
350 Filter instances, the Name and Destination
351 properties in CIMXML Handler instances, and the Name,
|
352 kumpf 1.21 Trap Destination, and SNMP Version properties in SNMP Mapper instances.
353
354 @param instance instance to be validated
355 @param propertyName name of property to be validated
|
356 kumpf 1.56 @param expectedType expected CIMType of property value
|
357 kumpf 1.86 @param isKeyProperty indicates whether the property is a key
358 property (used for selection of error
359 message)
|
360 kumpf 1.82 @param isArray indicates whether the validated
361 property is array
|
362 kumpf 1.21
|
363 carolann.graves 1.73 @exception CIM_ERR_INVALID_PARAMETER if required property is missing
364 or null
|
365 kumpf 1.21 */
|
366 kumpf 1.82 void _checkRequiredProperty(
367 CIMInstance& instance,
368 const CIMName& propertyName,
|
369 kumpf 1.56 const CIMType expectedType,
|
370 kumpf 1.86 Boolean isKeyProperty,
371 Boolean isArray = false);
|
372 kumpf 1.20
|
373 kumpf 1.5 /**
|
374 carolann.graves 1.74 Validates the specified Uint16 (non-array) property and its
|
375 carolann.graves 1.69 corresponding String (non-array) Other___ property in the instance.
|
376 kumpf 1.15 If the property does not exist, it is added with the default value.
377 If the property exists, but its value is NULL, its value is set to
378 the default value.
379 If the value of the property is Other, but the corresponding Other___
|
380 kumpf 1.56 property either does not exist, has a value of NULL, or is not of the
|
381 carolann.graves 1.74 correct type, an exception is thrown.
|
382 kumpf 1.15 If the value of the property is not Other, but the corresponding
383 Other___ property exists and has a non-NULL value, an exception is
384 thrown.
|
385 carolann.graves 1.74 If the value of the property is not a supported value, an exception is
|
386 kumpf 1.56 thrown.
|
387 carolann.graves 1.74 This function is called by the _canCreate function, and is used to
388 validate the following pairs of properties in Subscription or Handler
389 instances: Subscription State, Other Subscription State, Repeat
390 Notification Policy, Other Repeat Notification Policy, On Fatal Error
391 Policy, Other On Fatal Error Policy, Persistence Type, Other
|
392 kumpf 1.15 Persistence Type.
393
394 @param instance instance to be validated
395 @param propertyName name of property to be validated
396 @param otherPropertyName name of Other___ property to be validated
397 @param defaultValue default value for property
398 @param otherValue "Other" value for property
|
399 kumpf 1.19 @param validValues set of valid values for property
|
400 kumpf 1.55 @param supportedValues set of supported values for property
|
401 kumpf 1.15
|
402 carolann.graves 1.73 @exception CIM_ERR_INVALID_PARAMETER if value of property or Other___
403 property is invalid
|
404 kumpf 1.15 */
|
405 kumpf 1.82 void _checkPropertyWithOther(
406 CIMInstance& instance,
407 const CIMName& propertyName,
408 const CIMName& otherPropertyName,
|
409 kumpf 1.15 const Uint16 defaultValue,
|
410 kumpf 1.19 const Uint16 otherValue,
|
411 kumpf 1.82 const Array<Uint16>& validValues,
412 const Array<Uint16>& supportedValues);
|
413 kumpf 1.20
|
414 kumpf 1.21 /**
415 Validates the specified property in the instance.
416 If the property does not exist, it is added with the default value.
417 If the property exists, but its value is NULL, its value is set to
418 the default value.
|
419 carolann.graves 1.74 This function is called by the _canCreate function, and is used to
|
420 carolann.graves 1.62 validate the Source Namespace property in Filter instances.
|
421 carolann.graves 1.74 This function is also called by the _initOrValidateStringProperty
422 function to validate the CreationClassName, SystemName, and
|
423 carolann.graves 1.69 SystemCreationClassName key properties in Filter and Handler instances.
|
424 kumpf 1.21
|
425 kumpf 1.56 Note: currently all properties validated by this function are of type
|
426 carolann.graves 1.74 String. To use this function in the future with properties of other
427 types, a type parameter would need to be added, and the default value
|
428 kumpf 1.56 would need to be passed as a CIMValue instead of a String.
429
|
430 carolann.graves 1.69 Note: currently all properties validated by this function are non-array
431 properties. To use this function in the future with both array and
|
432 carolann.graves 1.74 non-array properties, a Boolean isArray parameter would need to be
|
433 carolann.graves 1.69 added.
434
|
435 kumpf 1.21 @param instance instance to be validated
436 @param propertyName name of property to be validated
437 @param defaultValue default value for property
438
439 @return the value of the property
440 */
|
441 kumpf 1.82 String _checkPropertyWithDefault(
442 CIMInstance& instance,
443 const CIMName& propertyName,
444 const String& defaultValue);
|
445 kumpf 1.56
446 /**
447 Validates the specified property in the instance.
|
448 venkat.puvvada 1.93 If the property does not exist, it is added with the GUID value.
449 If the property exists, but its value is NULL, its value is set to
450 the GUID value.
451 This function is called by the _canCreate function, and is used to
452 set the name of the Handler instance.
453
454 @param instance instance to be validated
455 @param propertyName name of property to be validated
456 */
457 String _checkPropertyWithGuid(
458 CIMInstance& instance,
459 const CIMName& propertyName);
460
461 /**
462 Validates the specified property in the instance.
|
463 carolann.graves 1.62 If the property does not exist, it is added with the default value.
464 If the property exists, but its value is NULL, its value is set to
465 the default value.
|
466 carolann.graves 1.74 If the property exists and has a non-NULL value, its value is validated
467 against the default (expected) value. If the value is invalid, an
|
468 carolann.graves 1.62 exception is thrown.
|
469 carolann.graves 1.74 This function is called by the _canCreate function, and is used to
|
470 carolann.graves 1.62 validate the Creation Class Name, System Name and System Creation Class
471 Name properties in Filter and Handler instances.
472
473 Note: currently all properties validated by this function are of type
|
474 carolann.graves 1.74 String. To use this function in the future with properties of other
475 types, a type parameter would need to be added, and the default value
|
476 carolann.graves 1.62 would need to be passed as a CIMValue instead of a String.
477
|
478 carolann.graves 1.69 Note: currently all properties validated by this function are non-array
479 properties. To use this function in the future with both array and
|
480 carolann.graves 1.74 non-array properties, a Boolean isArray parameter would need to be
|
481 carolann.graves 1.69 added.
482
|
483 carolann.graves 1.62 @param instance instance to be validated
484 @param propertyName name of property to be validated
485 @param defaultValue default value for property
486
487 @return the value of the property
488 */
|
489 kumpf 1.82 String _initOrValidateStringProperty(
490 CIMInstance& instance,
491 const CIMName& propertyName,
492 const String& defaultValue);
|
493 carolann.graves 1.62
494 /**
495 Validates the specified property in the instance.
|
496 kumpf 1.56 If the property exists and its value is not NULL, but it is not of
497 the correct type, an exception is thrown.
|
498 carolann.graves 1.74 This function is called by the _canCreate function. It is used to
499 validate the FailureTriggerTimeInterval, TimeOfLastStateChange,
|
500 kumpf 1.56 SubscriptionDuration, SubscriptionStartTime, SubscriptionTimeRemaining,
501 RepeatNotificationInterval, RepeatNotificationGap, and
502 RepeatNotificationCount properties in Subscription instances, the Owner
|
503 carolann.graves 1.74 property in Handler instances, and the PortNumber, SNMPSecurityName,
|
504 kumpf 1.56 and SNMPEngineID properties in SNMP Mapper Handler instances.
505
|
506 carolann.graves 1.69 Note: currently all properties validated by this function are non-array
507 properties. To use this function in the future with both array and
|
508 carolann.graves 1.74 non-array properties, a Boolean isArray parameter would need to be
|
509 carolann.graves 1.69 added.
510
|
511 kumpf 1.56 @param instance instance to be validated
512 @param propertyName name of property to be validated
513 @param expectedType expected CIMType for property
|
514 yi.zhou 1.75 @param isArray indicates whether the validated
515 property is array
|
516 kumpf 1.56
|
517 carolann.graves 1.73 @exception CIM_ERR_INVALID_PARAMETER if property exists and is not
518 null but is not of the correct
519 type
|
520 kumpf 1.56 */
|
521 kumpf 1.82 void _checkProperty(
522 CIMInstance& instance,
523 const CIMName& propertyName,
|
524 yi.zhou 1.75 const CIMType expectedType,
525 const Boolean isArray = false);
|
526 kumpf 1.15
527 /**
|
528 carolann.graves 1.76 Validates that all properties in the instance are supported properties,
529 and throws an exception if an unknown, unsupported property is found.
530
531 @param instance instance to be validated
532
533 @exception CIM_ERR_NOT_SUPPORTED if instance includes an unknown,
534 unsupported property
535 */
|
536 kumpf 1.82 void _checkSupportedProperties(
537 const CIMInstance& instance);
|
538 carolann.graves 1.76
539 /**
|
540 kumpf 1.82 Validates value of the specified Uint16 property in the instance.
541 If the value of the property is not a valid value, or is not a
|
542 yi.zhou 1.77 supported value, an exception is thrown.
543
544 @param instance instance to be validated
545 @param propertyName name of property to be validated
546 @param validValues set of valid values for property
547 @param supportedValues set of supported values for property
|
548 kumpf 1.82
549 @exception CIM_ERR_NOT_SUPPORTED if the property value is not
|
550 yi.zhou 1.77 supported
|
551 kumpf 1.82 CIM_ERR_INVALID_PARAMETER if the property value is not
|
552 yi.zhou 1.77 valid
553 */
|
554 kumpf 1.82 void _checkValue(
555 const CIMInstance& instance,
556 const CIMName& propertyName,
557 const Array<Uint16>& validValues,
558 const Array<Uint16>& supportedValues);
|
559 yi.zhou 1.77
560 /**
|
561 kumpf 1.10 Determines if the user is authorized to modify the instance, and if the
|
562 carolann.graves 1.74 specified modification is supported. Currently, the only modification
563 supported is of the Subscription State property of the Subscription
|
564 kumpf 1.10 class.
|
565 kumpf 1.5
566 @param request modification request
567 @param instance instance to be modified
|
568 kumpf 1.37 @param modifiedInstance modified instance
|
569 kumpf 1.5
|
570 carolann.graves 1.73 @exception CIM_ERR_NOT_SUPPORTED if the specified modification is
571 not supported
572 @exception CIM_ERR_ACCESS_DENIED if the user is not authorized to
573 modify the instance
574 @exception CIM_ERR_INVALID_PARAMETER if the modifiedInstance is
575 invalid
|
576 kumpf 1.5
|
577 kumpf 1.54 @return True, if the instance can be modified;
|
578 kumpf 1.10 Otherwise throws an exception
|
579 kumpf 1.5 */
|
580 kumpf 1.82 Boolean _canModify(
581 const CIMModifyInstanceRequestMessage* request,
582 const CIMObjectPath& instanceReference,
583 const CIMInstance& instance,
584 CIMInstance& modifiedInstance);
|
585 kumpf 1.5
586 /**
|
587 carolann.graves 1.74 Determines if the user is authorized to delete the instance, and if it
588 is legal to delete the instance. If authorized, Subscription instances
589 may always be deleted. Filter and non-transient Handler instances may
590 only be deleted if they are not being referenced by any Subscription
591 instances. If the instance to be deleted is a transient Handler, any
|
592 kumpf 1.10 referencing Subscriptions are also deleted.
|
593 kumpf 1.5
594 @param instanceReference reference for instance to be deleted
595 @param nameSpace namespace for instance to be deleted
|
596 kumpf 1.10 @param currentUser current user
597
|
598 carolann.graves 1.73 @exception CIM_ERR_ACCESS_DENIED if the user is not authorized to
599 delete the instance
600 @exception CIM_ERR_FAILED if the instance to be deleted is
601 referenced by a subscription
|
602 kumpf 1.5
|
603 kumpf 1.54 @return True, if the instance can be deleted;
|
604 kumpf 1.10 Otherwise throws an exception
|
605 kumpf 1.1 */
|
606 kumpf 1.82 Boolean _canDelete(
607 const CIMObjectPath& instanceReference,
608 const CIMNamespaceName& nameSpace,
609 const String& currentUser);
|
610 kumpf 1.1
611 /**
612 Retrieves list of enabled subscription instances in all namespaces,
613 where the subscription indication class matches or is a superclass
|
614 kumpf 1.10 of the supported class, and the properties required to process the
615 subscription are all contained in the list of supported properties.
|
616 carolann.graves 1.74 If the checkProvider parameter value is True, a subscription is only
617 included in the list returned if the specified provider accepted the
618 subscription. If the checkProvider parameter value is False, the
|
619 kumpf 1.42 provider parameter is not used (ignored).
|
620 kumpf 1.1
|
621 kumpf 1.10 @param supportedClass the supported class
622 @param nameSpaces the list of supported namespaces
623 @param supportedProperties the list of supported properties
|
624 kumpf 1.42 @param checkProvider indicates whether provider acceptance is
625 checked
626 @param provider the provider (used if checkProvider True)
|
627 kumpf 1.1
|
628 kumpf 1.26 @return list of CIMInstance subscriptions
|
629 kumpf 1.1 */
|
630 karl 1.97.2.2 Array<SubscriptionWithSrcNamespace> _getMatchingSubscriptions(
|
631 kumpf 1.82 const CIMName& supportedClass,
632 const Array<CIMNamespaceName> nameSpaces,
633 const CIMPropertyList& supportedProperties,
|
634 kumpf 1.43 const Boolean checkProvider = false,
|
635 kumpf 1.82 const CIMInstance& provider = CIMInstance());
|
636 kumpf 1.1
637 /**
638 Retrieves lists of enabled subscription instances in all namespaces
639 that are either newly supported or previously supported, based on the
|
640 kumpf 1.9 supported class, the supported namespaces before and after modification,
|
641 carolann.graves 1.74 and the supported properties before and after modification. For
642 subscriptions based on the supported class, the newSubscriptions list
643 returned contains the subscriptions for which the properties required
644 to process the subscription are all contained in the new list of
645 supported properties, but are not all contained in the old list of
|
646 kumpf 1.9 supported properties, and/or the filter source namespace is contained in
|
647 carolann.graves 1.74 the new list if supported namespaces, but is not contained in the old
648 list of supported namespaces. The formerSubscriptions list returned
|
649 kumpf 1.9 contains the subscriptions for which the properties required to process
|
650 carolann.graves 1.74 the subscription are not all contained in the new list of supported
651 properties, but are all contained in the old list of supported
652 properties, and/or the filter source namespace is not contained in the
653 new list if supported namespaces, but is contained in the old list of
|
654 kumpf 1.9 supported namespaces.
655
|
656 kumpf 1.10 @param supportedClass the supported class
|
657 kumpf 1.9 @param newNameSpaces namespaces supported after modification
658 @param oldNameSpaces namespaces supported before modification
659 @param newProperties properties supported after modification
660 @param oldProperties properties supported before modification
|
661 kumpf 1.1 @param newSubscriptions the list of newly supported subscriptions
662 @param formerSubscriptions the list of previously supported
663 subscriptions
664 */
|
665 kumpf 1.82 void _getModifiedSubscriptions(
666 const CIMName& supportedClass,
667 const Array<CIMNamespaceName>& newNameSpaces,
668 const Array<CIMNamespaceName>& oldNameSpaces,
669 const CIMPropertyList& newProperties,
670 const CIMPropertyList& oldProperties,
|
671 karl 1.97.2.2 Array<SubscriptionWithSrcNamespace>& newSubscriptions,
672 Array<SubscriptionWithSrcNamespace>& formerSubscriptions);
|
673 kumpf 1.1
674 /**
|
675 kumpf 1.9 Determines if all of the required properties in the specified list
676 are contained in the specified list of supported properties.
677
678 @param requiredProperties the required properties
|
679 kumpf 1.10 @param supportedProperties the supported properties
|
680 kumpf 1.9
|
681 kumpf 1.54 @return true, if all required properties are supported;
|
682 kumpf 1.9 false otherwise
683 */
|
684 kumpf 1.82 Boolean _inPropertyList(
685 const CIMPropertyList& requiredProperties,
686 const CIMPropertyList& supportedProperties);
|
687 kumpf 1.9
688 /**
|
689 chuck 1.64 Builds a QueryExpression from the filter query string,
690 the query language name, and the namespace in which the query
691 is to be run.
|
692 kumpf 1.1
693 @param filterQuery the filter query string
|
694 chuck 1.64 @param queryLanguage the query language name
695 @param ns query namespace
|
696 kumpf 1.1
|
697 chuck 1.64 @return QueryExpression representing the filter query
|
698 kumpf 1.1 */
|
699 kumpf 1.82 QueryExpression _getQueryExpression(
700 const String& filterQuery,
701 const String& queryLanguage,
702 const CIMNamespaceName& ns) const;
|
703 kumpf 1.1
704 /**
|
705 chuck 1.64 Extracts the indication class name from the specified query expression
706 (WQL or CQL), and validates that the name represents a subclass of the
|
707 kumpf 1.1 Indication class.
708
|
709 chuck 1.64 @param queryExpression the query expression
|
710 kumpf 1.1 @param nameSpaceName the namespace
711
712 @return String containing the indication class name
713 */
|
714 kumpf 1.82 CIMName _getIndicationClassName(
715 const QueryExpression& queryExpression,
716 const CIMNamespaceName& nameSpaceName) const;
|
717 kumpf 1.15
718 /**
|
719 kumpf 1.1 Retrieves the list of indication providers that serve the specified
720 indication subclasses.
721
|
722 karl 1.97.2.2 @param query the query
723 @param queyLang the query language
|
724 kumpf 1.1 @param indicationClassName the indication class name
725 @param indicationSubclasses the list of indication subclass names
726
727 @return list of ProviderClassList structs
728 */
|
729 kumpf 1.82 Array<ProviderClassList> _getIndicationProviders(
|
730 karl 1.97.2.2 const String &query,
731 const String &queryLang,
|
732 kumpf 1.82 const CIMName& indicationClassName,
|
733 karl 1.97.2.2 const Array<NamespaceClassList>& indicationSubclasses) const;
|
734 kumpf 1.1
735 /**
|
736 carolann.graves 1.74 Retrieves the list of required properties (all the properties
737 referenced in the WHERE clause) for the specified filter query
|
738 carolann.graves 1.72 expression.
|
739 kumpf 1.1
|
740 chuck 1.64 @param queryExpression the query expression
|
741 kumpf 1.22 @param nameSpaceName the namespace
|
742 chuck 1.64 @param indicationClassName the indication class name
|
743 kumpf 1.1
|
744 carolann.graves 1.74 @return CIMPropertyList of required properties for the filter query
|
745 chuck 1.64 expression
|
746 kumpf 1.1 */
|
747 kumpf 1.82 CIMPropertyList _getPropertyList(
748 const QueryExpression& queryExpression,
749 const CIMNamespaceName& nameSpaceName,
750 const CIMName& indicationClassName) const;
|
751 kumpf 1.22
752 /**
|
753 carolann.graves 1.74 Checks if the property list includes all properties in the specified
|
754 kumpf 1.22 class. If so, a NULL CIMPropertyList is returned. Otherwise, a
|
755 carolann.graves 1.74 CIMPropertyList containing the properties is returned. The list of
756 property names in the specified indication class is also returned in
757 the indicationClassProperties parameter.
|
758 carolann.graves 1.60
759 @param propertyList the list of property names
760 @param nameSpaceName the namespace
761 @param indicationClassName the indication class name
762 @param indicationClassProperties the list of property names in the
763 specified indication class
|
764 kumpf 1.22
|
765 carolann.graves 1.74 @return CIMPropertyList of properties referenced by the filter query
|
766 kumpf 1.22 select statement
767 */
|
768 kumpf 1.82 CIMPropertyList _checkPropertyList(
769 const Array<CIMName>& propertyList,
770 const CIMNamespaceName& nameSpaceName,
771 const CIMName& indicationClassName,
772 Array<CIMName>& indicationClassProperties) const;
|
773 kumpf 1.1
774 /**
775 Extracts the condition (WHERE Clause) from the specified filter query
776 string.
777
778 @param filterQuery the filter query
779
780 @return String containing the filter query condition
781 */
|
782 kumpf 1.82 String _getCondition(
783 const String& filterQuery) const;
|
784 kumpf 1.1
785 /**
|
786 carolann.graves 1.74 Deletes subscriptions referencing the specified handler. All namespaces
787 are searched for subscriptions that reference the handler to be deleted.
|
788 kumpf 1.4
|
789 carolann.graves 1.74 @param nameSpace the name space of the handler being
790 deleted
|
791 kumpf 1.4 @param referenceProperty the name of the reference property in the
792 subscription instance
793 @param handler the handler reference
794 */
|
795 kumpf 1.82 void _deleteReferencingSubscriptions(
796 const CIMNamespaceName& nameSpace,
797 const CIMName& referenceProperty,
798 const CIMObjectPath& handler);
|
799 kumpf 1.4
800 /**
801 Determines if specified Subscription has expired
802
803 NOTE: It is assumed that the instance passed to this function is a
804 Subscription instance, and that the Subscription Duration and
805 Start Time properties exist
806
807 @param instance the subscription instance
808
|
809 kumpf 1.54 @return True, if the Subscription has expired;
|
810 kumpf 1.4 False otherwise
811 */
|
812 kumpf 1.82 Boolean _isExpired(
813 const CIMInstance& instance) const;
|
814 kumpf 1.4
815 /**
|
816 carolann.graves 1.74 Deletes specified subscription
|
817 kumpf 1.5
818 @param subscription the subscription reference
819 */
|
820 kumpf 1.82 void _deleteExpiredSubscription(
821 CIMObjectPath& subscription);
|
822 kumpf 1.21
823 /**
824 Gets the Subscription Time Remaining property
825
|
826 carolann.graves 1.74 Calculates time remaining from Subscription Start Time, Subscription
|
827 kumpf 1.21 Duration, and current date time. If the subscription has a non-null
|
828 carolann.graves 1.74 Duration, the Time Remaining is set, and True is returned. If the
829 subscription does not have a non-null Duration, it has no expiration
830 date, and the time remaining is unlimited. In this case, the Time
|
831 kumpf 1.21 Remaining is not set and False is returned.
|
832 carolann.graves 1.74
|
833 kumpf 1.21 NOTE: It is assumed that the instance passed to this function is a
|
834 carolann.graves 1.74 Subscription instance, and that the Start Time property exists and
|
835 kumpf 1.21 has a value
836
837 @param instance Input the subscription instance
838 @param timeRemaining Output the time remaining (seconds)
839
|
840 kumpf 1.54 @return True, if the subscription has a non-null Duration;
|
841 kumpf 1.21 False otherwise
842 */
|
843 kumpf 1.82 Boolean _getTimeRemaining(
844 const CIMInstance& instance,
845 Uint64& timeRemaining) const;
|
846 kumpf 1.5
847 /**
|
848 kumpf 1.4 Sets the Subscription Time Remaining property
849
|
850 carolann.graves 1.74 Calculates time remaining from Subscription Start Time, Subscription
|
851 kumpf 1.4 Duration, and current date time
|
852 carolann.graves 1.74
|
853 kumpf 1.4 NOTE: It is assumed that the instance passed to this function is a
854 Subscription instance, and that the Subscription Duration and
855 Start Time properties exist
856
857 @param instance the subscription instance
858 */
|
859 kumpf 1.82 void _setTimeRemaining(CIMInstance& instance);
|
860 kumpf 1.4
861 /**
|
862 kumpf 1.23 Gets the parameter values required to Create or Modify the subscription
|
863 kumpf 1.10 request.
|
864 carolann.graves 1.74 If no indication providers are found, condition and queryLanguage are
|
865 kumpf 1.3 set to empty string.
866
|
867 kumpf 1.33 @param subscriptionInstance Input subscription instance
|
868 carolann.graves 1.74 @param indicationSubclasses Output list of subclasses of indication
|
869 kumpf 1.33 class in filter query
|
870 kumpf 1.3 @param indicationProviders Output list of providers with associated
871 classes
872 @param propertyList Output list of properties required by the
873 subscription
874 @param condition Output condition part of the filter query
|
875 kumpf 1.58 @param query Output filter query
|
876 kumpf 1.3 @param queryLanguage Output query language in which the filter
877 query is expressed
878 */
|
879 kumpf 1.82 void _getCreateParams(
880 const CIMInstance& subscriptionInstance,
|
881 karl 1.97.2.2 Array<NamespaceClassList>& indicationSubclasses,
|
882 kumpf 1.82 Array<ProviderClassList>& indicationProviders,
883 CIMPropertyList& propertyList,
884 String& condition,
885 String& query,
886 String& queryLanguage);
|
887 kumpf 1.10
888 /**
|
889 kumpf 1.23 Gets the parameter values required to Create or Modify the subscription
|
890 kumpf 1.10 request.
891
|
892 kumpf 1.33 @param subscriptionInstance Input subscription instance
|
893 carolann.graves 1.74 @param indicationSubclasses Output list of subclasses of indication
|
894 kumpf 1.33 class in filter query
|
895 kumpf 1.10 @param propertyList Output list of properties required by the
896 subscription
897 @param condition Output condition part of the filter query
|
898 kumpf 1.58 @param query Output filter query
|
899 kumpf 1.10 @param queryLanguage Output query language in which the filter
900 query is expressed
901 */
|
902 kumpf 1.82 void _getCreateParams(
903 const CIMInstance& subscriptionInstance,
|
904 karl 1.97.2.2 Array<NamespaceClassList>& indicationSubclasses,
|
905 kumpf 1.82 CIMPropertyList& propertyList,
906 String& condition,
907 String& query,
908 String& queryLanguage);
|
909 kumpf 1.3
910 /**
|
911 kumpf 1.23 Gets the parameter values required to Delete the subscription request.
|
912 kumpf 1.5
|
913 kumpf 1.33 @param subscriptionInstance Input subscription instance
|
914 carolann.graves 1.74 @param indicationSubclasses Output list of subclasses of indication
|
915 kumpf 1.33 class in filter query
|
916 kumpf 1.5
|
917 kumpf 1.23 @return List of providers with associated classes to Delete
|
918 kumpf 1.5 */
|
919 kumpf 1.82 Array<ProviderClassList> _getDeleteParams(
920 const CIMInstance& subscriptionInstance,
|
921 karl 1.97.2.2 Array<NamespaceClassList>& indicationSubclasses);
|
922 mday 1.13
|
923 kumpf 1.5 /**
|
924 kumpf 1.23 Sends Create subscription request for the specified subscription
|
925 carolann.graves 1.68 to each provider in the list. The requests are sent using SendAsync,
|
926 carolann.graves 1.74 and the responses are aggregated in the callback methods. Create
927 Subscription requests are sent to the indication providers using
928 SendAsync in the following cases: (1) on creation of an enabled
|
929 venkat.puvvada 1.91 subscription instance, (2) on modification of a subscription
930 instance, when the state changes to enabled and (3) on initialization,
931 for each enabled subscription retrieved from the repository if timeout
932 is specified. In cases (1) and (2), there is an original Create Instance
933 or Modify Instance request to which the Indication Service must respond.
934 In case (3), there is no original request and no response is required.
|
935 kumpf 1.1
936 @param indicationProviders list of providers with associated classes
|
937 karl 1.97.2.2 with the nameSpace name of the resource
938 being monitored, from the SourceNamespace
|
939 carolann.graves 1.74 property of the CIM_IndicationFilter
940 instance for the specified
|
941 kumpf 1.54 subscription
|
942 kumpf 1.1 @param propertyList the properties referenced by the
943 subscription
944 @param condition the condition part of the filter query
|
945 kumpf 1.58 @param query the filter query
|
946 kumpf 1.1 @param queryLanguage the query language in which the filter
947 query is expressed
|
948 kumpf 1.23 @param subscription the subscription to be created
|
949 chuck 1.35 @param acceptLangs the language of the response, and
950 future indications
951 @param contentLangs the language of the subscription
|
952 carolann.graves 1.71 @param origRequest the original request (Create
|
953 carolann.graves 1.68 Instance, Modify Instance)
|
954 carolann.graves 1.74 @param indicationSubclasses the indication subclasses for the
|
955 kumpf 1.41 subscription
|
956 kumpf 1.9 @param userName the userName for authentication
957 @param authType the authentication type
958
|
959 kumpf 1.1 */
|
960 kumpf 1.82 void _sendAsyncCreateRequests(
961 const Array<ProviderClassList>& indicationProviders,
962 const CIMPropertyList& propertyList,
963 const String& condition,
964 const String& query,
965 const String& queryLanguage,
966 const CIMInstance& subscription,
967 const AcceptLanguageList& acceptLangs,
968 const ContentLanguageList& contentLangs,
|
969 kumpf 1.41 const CIMRequestMessage * origRequest,
|
970 karl 1.97.2.2 const Array<NamespaceClassList>& indicationSubclasses,
|
971 kumpf 1.82 const String& userName,
972 const String& authType = String::EMPTY);
|
973 mday 1.13
|
974 kumpf 1.1 /**
|
975 carolann.graves 1.68 Sends Create subscription request for the specified subscription
976 to each provider in the list. The requests are sent using SendWait,
977 so no callback methods are required. Create Subscription requests are
978 sent to the indication providers using SendWait in the following cases:
|
979 carolann.graves 1.74 (1) on notification of a provider registration change newly enabling
980 the provider to serve the subscription, (2) on notification that a
981 provider has been enabled and may now serve the subscription, and
|
982 carolann.graves 1.71 (3) on initialization, for each enabled subscription retrieved from the
983 repository. In cases (1) and (2), there is an original Notify Provider
|
984 carolann.graves 1.74 Registration or Notify Provider Enable request to which the Indication
|
985 carolann.graves 1.71 Service must respond. In case (3), there is no original request and no
986 response is required.
|
987 carolann.graves 1.68
988 @param indicationProviders list of providers with associated classes
|
989 karl 1.97.2.2 with the nameSpace name of the resource
990 being monitored, from the SourceNamespace
|
991 carolann.graves 1.68 property of the CIM_IndicationFilter
992 instance for the specified
993 subscription
994 @param propertyList the properties referenced by the
995 subscription
996 @param condition the condition part of the filter query
997 @param query the filter query
998 @param queryLanguage the query language in which the filter
999 query is expressed
1000 @param subscription the subscription to be created
1001 @param acceptLangs the language of the response, and
1002 future indications
1003 @param contentLangs the language of the subscription
1004 @param userName the userName for authentication
1005 @param authType the authentication type
1006
|
1007 carolann.graves 1.71 @return List of providers that accepted subscription
|
1008 carolann.graves 1.68 */
|
1009 kumpf 1.82 Array<ProviderClassList> _sendWaitCreateRequests(
1010 const Array<ProviderClassList>& indicationProviders,
1011 const CIMPropertyList& propertyList,
1012 const String& condition,
1013 const String& query,
1014 const String& queryLanguage,
1015 const CIMInstance& subscription,
1016 const AcceptLanguageList& acceptLangs,
1017 const ContentLanguageList& contentLangs,
1018 const String& userName,
1019 const String& authType = String::EMPTY);
|
1020 carolann.graves 1.68
1021 /**
|
1022 kumpf 1.23 Sends Modify subscription request for the specified subscription
|
1023 carolann.graves 1.68 to each provider in the list. The requests are sent using SendWait,
1024 so no callback methods are required. Modify Subscription requests must
|
1025 carolann.graves 1.74 be sent to the indication providers on notification of a provider
1026 registration change, when the provider was formerly serving the
1027 subscription, and is still serving the subscription, in the following
1028 cases: (1) the provider is newly serving an additional indication
|
1029 carolann.graves 1.68 subclass specified by the subscription, or (2) the provider is
|
1030 carolann.graves 1.74 no longer serving an indication subclass specified by the subscription
|
1031 kumpf 1.41 (but is still serving at least one of the indication subclasses).
|
1032 carolann.graves 1.68 In cases (1) and (2), there is an original Notify Provider Registration
1033 request to which the Indication Service must respond.
|
1034 kumpf 1.1
1035 @param indicationProviders list of providers with associated classes
|
1036 karl 1.97.2.2 with the nameSpace name of the resource
1037 being monitored, from the SourceNamespace
|
1038 kumpf 1.54 property of the CIM_IndicationFilter
|
1039 carolann.graves 1.74 instance for the specified
1040 subscription
|
1041 kumpf 1.1 @param propertyList the properties referenced by the
1042 subscription
1043 @param condition the condition part of the filter query
|
1044 kumpf 1.58 @param query the filter query
|
1045 kumpf 1.1 @param queryLanguage the query language in which the filter
1046 query is expressed
1047 @param subscription the subscription to be modified
|
1048 chuck 1.35 @param acceptLangs the language of the response, and
1049 future indications
|
1050 carolann.graves 1.74 @param contentLangs the language of the subscription
|
1051 kumpf 1.9 @param userName the userName for authentication
1052 @param authType the authentication type
|
1053 kumpf 1.1 */
|
1054 kumpf 1.82 void _sendWaitModifyRequests(
1055 const Array<ProviderClassList>& indicationProviders,
1056 const CIMPropertyList& propertyList,
1057 const String& condition,
1058 const String& query,
1059 const String& queryLanguage,
1060 const CIMInstance& subscription,
1061 const AcceptLanguageList& acceptLangs,
1062 const ContentLanguageList& contentLangs,
1063 const String& userName,
1064 const String& authType = String::EMPTY);
|
1065 kumpf 1.1
1066 /**
|
1067 kumpf 1.23 Sends Delete subscription request for the specified subscription
|
1068 carolann.graves 1.68 to each provider in the list. The requests are sent using SendAsync,
|
1069 carolann.graves 1.74 and the responses are aggregated in the callback methods. Delete
1070 Subscription requests are sent to the indication providers using
1071 SendAsync in the following cases: (1) on deletion of an enabled
1072 subscription instance, (2) on modification of a subscription instance,
1073 when the state changes to disabled, (3) on deletion of an expired
|
1074 venkat.puvvada 1.91 subscription, (4) on deletion of a subscription referencing a
1075 deleted transient handler and (5) when indication service is disabled
1076 dynamically. In cases (1) and (2), there is an original
|
1077 carolann.graves 1.74 Delete Instance or Modify Instance request to which the Indication
|
1078 venkat.puvvada 1.91 Service must respond. In cases (3), (4) and (5) , there is no
1079 orginal request and no response is required.
|
1080 kumpf 1.1
1081 @param indicationProviders list of providers with associated classes
|
1082 karl 1.97.2.2 with the nameSpace name of the resource
1083 being monitored, from the SourceNamespace
|
1084 kumpf 1.54 property of the CIM_IndicationFilter
|
1085 carolann.graves 1.74 instance for the specified
1086 subscription
|
1087 kumpf 1.1 @param subscription the subscription to be modified
|
1088 chuck 1.35 @param acceptLangs the language of the response
|
1089 carolann.graves 1.74 @param contentLangs the language of the subscription
1090 @param origRequest the original request (Delete Instance,
|
1091 carolann.graves 1.68 Modify Instance)
|
1092 carolann.graves 1.74 @param indicationSubclasses the indication subclasses for the
|
1093 kumpf 1.41 subscription
|
1094 kumpf 1.9 @param userName the userName for authentication
1095 @param authType the authentication type
|
1096 kumpf 1.1 */
|
1097 kumpf 1.82 void _sendAsyncDeleteRequests(
1098 const Array<ProviderClassList>& indicationProviders,
1099 const CIMInstance& subscription,
1100 const AcceptLanguageList& acceptLangs,
1101 const ContentLanguageList& contentLangs,
|
1102 kumpf 1.41 const CIMRequestMessage * origRequest,
|
1103 karl 1.97.2.2 const Array<NamespaceClassList>& indicationSubclasses,
|
1104 kumpf 1.82 const String& userName,
1105 const String& authType = String::EMPTY);
|
1106 kumpf 1.1
1107 /**
|
1108 carolann.graves 1.68 Sends Delete subscription request for the specified subscription
1109 to each provider in the list. The requests are sent using SendWait,
1110 so no callback methods are required. Delete Subscription requests are
|
1111 carolann.graves 1.74 sent to the indication providers using SendWait in the following case:
1112 (1) on notification of a provider registration change newly preventing
1113 the provider from serving the subscription. In case (1), there is an
1114 original Notify Provider Registration request to which the Indication
1115 Service must respond.
|
1116 carolann.graves 1.68
1117 @param indicationProviders list of providers with associated classes
|
1118 karl 1.97.2.2 with the nameSpace name of the resource
1119 being monitored, from the SourceNamespace
|
1120 carolann.graves 1.68 property of the CIM_IndicationFilter
1121 instance for the specified
1122 subscription
1123 @param subscription the subscription to be modified
1124 @param acceptLangs the language of the response
1125 @param contentLangs the language of the subscription
1126 @param userName the userName for authentication
1127 @param authType the authentication type
1128 */
|
1129 kumpf 1.82 void _sendWaitDeleteRequests(
1130 const Array<ProviderClassList>& indicationProviders,
1131 const CIMInstance& subscription,
1132 const AcceptLanguageList& acceptLangs,
1133 const ContentLanguageList& contentLangs,
1134 const String& userName,
1135 const String& authType = String::EMPTY);
|
1136 carolann.graves 1.68
1137 /**
|
1138 kumpf 1.41 Collects responses from providers for aggregation as they are received,
|
1139 carolann.graves 1.74 and stores them in the IndicationOperationAggregate instance. Calls
1140 _handleOperationResponseAggregation to process the responses, once all
|
1141 kumpf 1.41 expected responses have been received.
1142
|
1143 kumpf 1.57 @param operation shared data structure that controls message
|
1144 kumpf 1.41 processing
1145 @param destination target queue of completion callback
1146 @param userParameter user parameter for callback processing
1147 */
|
1148 kumpf 1.82 static void _aggregationCallBack(
|
1149 kumpf 1.41 AsyncOpNode * operation,
1150 MessageQueue * destination,
1151 void * userParameter);
1152
1153 /**
|
1154 carolann.graves 1.74 Calls the appropriate function to processes responses from providers,
|
1155 kumpf 1.41 based on the type of request sent to providers, once all responses have
|
1156 carolann.graves 1.74 been received.
|
1157 kumpf 1.41
|
1158 carolann.graves 1.74 @param operationAggregate the operation aggregate instance
|
1159 kumpf 1.41 */
|
1160 kumpf 1.82 void _handleOperationResponseAggregation(
|
1161 kumpf 1.41 IndicationOperationAggregate * operationAggregate);
1162
1163 /**
|
1164 carolann.graves 1.74 Processes create subscription responses from providers, once all have
1165 been received. Takes the appropriate action, based on the type of the
1166 original request, if any, and the responses received. Sends the
|
1167 kumpf 1.41 response to the original request, if required.
1168
|
1169 carolann.graves 1.74 @param operationAggregate the operation aggregate instance
|
1170 kumpf 1.41 */
|
1171 kumpf 1.82 void _handleCreateResponseAggregation(
|
1172 kumpf 1.41 IndicationOperationAggregate * operationAggregate);
1173
1174 /**
|
1175 carolann.graves 1.74 Processes modify subscription responses from providers, once all have
|
1176 kumpf 1.41 been received. Updates the subscription hash tables.
1177
|
1178 carolann.graves 1.74 @param operationAggregate the operation aggregate instance
|
1179 kumpf 1.41 */
|
1180 kumpf 1.82 void _handleModifyResponseAggregation(
|
1181 kumpf 1.41 IndicationOperationAggregate * operationAggregate);
1182
1183 /**
|
1184 carolann.graves 1.74 Processes delete subscription responses from providers, once all have
1185 been received. Updates the subscription hash tables appropriately,
1186 based on the type of the original request, if any. Sends the response
|
1187 kumpf 1.41 to the original request, if required.
1188
|
1189 carolann.graves 1.74 @param operationAggregate the operation aggregate instance
|
1190 kumpf 1.41 */
|
1191 kumpf 1.82 void _handleDeleteResponseAggregation(
|
1192 kumpf 1.41 IndicationOperationAggregate * operationAggregate);
1193
1194 /**
|
1195 kumpf 1.1 Creates an alert instance of the specified class.
1196
1197 @param alertClassName the alert class name
|
1198 kumpf 1.7 @param subscriptions subscriptions for which alert is to be
|
1199 kumpf 1.1 created
1200
1201 @return the created alert instance
1202 */
|
1203 kumpf 1.82 CIMInstance _createAlertInstance(
1204 const CIMName& alertClassName,
1205 const Array<CIMInstance>& subscriptions);
|
1206 mday 1.14
|
1207 kumpf 1.40 #if 0
|
1208 kumpf 1.82 /**
1209 Asynchronous completion routine for _sendAlerts
1210 */
1211
1212 static void _sendAlertsCallBack(
1213 AsyncOpNode* operation,
1214 MessageQueue* callback_destination,
1215 void* parameter);
|
1216 kumpf 1.1
1217 /**
1218 Sends specified alert to each unique handler instance for the
1219 specified subscriptions in the list.
1220
|
1221 kumpf 1.7 @param subscriptions subscriptions for which alert is to be
|
1222 kumpf 1.1 sent
1223 @param alertInstance the alert to be sent
1224 */
|
1225 kumpf 1.82 void _sendAlerts(
1226 const Array<CIMInstance>& subscriptions,
1227 /* const */ CIMInstance& alertInstance);
|
1228 kumpf 1.40 #endif
|
1229 carolann.graves 1.74
|
1230 kumpf 1.16 /**
|
1231 kumpf 1.37 Gets the value of the Creator property from the specified Subscription
|
1232 carolann.graves 1.74 instance. If this function returns False, the value of the creator
|
1233 kumpf 1.37 parameter is unchanged.
1234
1235 @param instance subscription instance
1236 @param creator value of Creator property if retrieved
1237
|
1238 kumpf 1.54 @return True, if the value of the Creator property was retrieved;
|
1239 kumpf 1.37 False if Creator property was missing, null, or of an
|
1240 kumpf 1.54 incorrect type
|
1241 kumpf 1.37 */
|
1242 kumpf 1.82 Boolean _getCreator(
1243 const CIMInstance& instance,
1244 String& creator) const;
|
1245 kumpf 1.37
1246 /**
|
1247 kumpf 1.54 Validates the specified SubscriptionState property value.
|
1248 kumpf 1.37
|
1249 kumpf 1.54 @param state SubscriptionState property value
|
1250 kumpf 1.37
|
1251 kumpf 1.54 @return True, if the SubscriptionState property value is valid;
1252 False otherwise
|
1253 kumpf 1.37 */
|
1254 kumpf 1.82 Boolean _validateState(
|
1255 kumpf 1.54 const Uint16 state) const;
|
1256 kumpf 1.37
|
1257 kumpf 1.46 /**
1258 This function peforms an authorization test based on the
1259 value of the enableSubscriptionForNonprivilegedUsers.
1260
1261 @param userName String
1262
|
1263 carolann.graves 1.74 @return True, if authentication is not enabled or the
|
1264 kumpf 1.54 user is a privileged system user;
1265 False, if authentication is enabled and the
1266 user is not privileged
|
1267 kumpf 1.46 */
|
1268 kumpf 1.82 void _checkNonprivilegedAuthorization(
1269 const String& userName);
|
1270 kumpf 1.46
|
1271 kumpf 1.48 /**
|
1272 kumpf 1.49 Updates the propertyList, in preparation for calling the Repository.
|
1273 carolann.graves 1.74 If the propertyList is not null, the Creator property must be added to
1274 the list. Also, if the request is for the Subscription class, the
1275 value of the Time Remaining property need only be calculated if it is
1276 requested. In that case, the Subscription Duration and Start Time
1277 properties must be added to the list if not already there.
|
1278 kumpf 1.49
1279 @param className class name for the request
1280 @param propertyList list of properties requested
1281 @param setTimeRemaining indicates whether Time Remaining property
1282 was requested
1283 @param startTimeAdded indicates whether Start Time property was
1284 added to the list
1285 @param durationAdded indicates whether Duration property was
1286 added to the list
1287 */
|
1288 kumpf 1.82 void _updatePropertyList(
1289 CIMName& className,
1290 CIMPropertyList& propertyList,
1291 Boolean& setTimeRemaining,
1292 Boolean& startTimeAdded,
1293 Boolean& durationAdded);
|
1294 kumpf 1.49
1295 /**
|
1296 carolann.graves 1.74 Gets a String containing the comma-separated Subscription Filter Name
|
1297 kumpf 1.48 and Handler Name, for use in a log message to identify the subscription.
1298
1299 @param subscription subscription instance
1300
1301 @return String containing the comma-separated Subscription Filter Name
1302 and Handler Name
1303 */
|
1304 kumpf 1.82 String _getSubscriptionLogString(CIMInstance& subscription);
|
1305 kumpf 1.48
|
1306 yi.zhou 1.83 /**
|
1307 kumpf 1.89 Retrieves list of enabled subscription instances based on the class
|
1308 yi.zhou 1.83 name and namespace of the generated indication. If the subscription
|
1309 kumpf 1.89 matches the class name and namespace of the generated indication
1310 and the provider who generated this indication accepted this
|
1311 yi.zhou 1.83 subscription, the subscription is added to the initial subscriptions
|
1312 kumpf 1.89 list.
1313 If the indication provider included subscriptions in the
1314 SubscriptionInstanceNamesContainer, the subset of subscriptions
|
1315 yi.zhou 1.83 specified by the indication provider that also appear in the initial
1316 subscriptions list is returned.
|
1317 kumpf 1.89 Any subscription included by the provider but not containing in the
|
1318 yi.zhou 1.83 initial subscriptions list is ignored.
|
1319 kumpf 1.89
1320 @param providedSubscriptionNames Subscriptions specified by the
|
1321 yi.zhou 1.83 indication provider
|
1322 kumpf 1.89 @param className The generated indication class
1323 name
1324 @param nameSpace The generated indication namespace
1325 @param indicationProvider The provider which generated
1326 the indication
|
1327 yi.zhou 1.84 @param subscriptions Output Array of subscription
1328 instances
1329 @param subscriptionKeys Output Array of keys associated
1330 with the subscriptions
|
1331 yi.zhou 1.83 */
|
1332 yi.zhou 1.84 void _getRelevantSubscriptions(
|
1333 yi.zhou 1.83 const Array<CIMObjectPath> & providedSubscriptionNames,
1334 const CIMName& className,
|
1335 kumpf 1.89 const CIMNamespaceName& nameSpace,
|
1336 yi.zhou 1.84 const CIMInstance& indicationProvider,
1337 Array<CIMInstance>& subscriptions,
1338 Array<String>& subscriptionKeys);
|
1339 yi.zhou 1.83
1340 /**
1341 Evaluate if the specified subscription matches the indication based on:
1342 1) Whether the properties (in WHERE clause) from filter query are
1343 supported by the indication provider;
1344 2) Whether the subscripton is expired;
1345 3) Whether the filter criteria are met by the generated indication
1346
1347 @param subscription The subscription to be evaluated
1348 @param indication The generated indication
1349 @param supportedPropertyList The properties are supported by the
1350 indication provider
1351 @param queryExpr The query expression of the evaluated
|
1352 kumpf 1.89 subscription which is used for
|
1353 yi.zhou 1.83 indication evaluation
1354 @param sourceNameSpace The source namespace of the filter
1355 instance
1356
1357 @return True, if the subscription is met all above conditions;
1358 False otherwise
1359 */
1360 Boolean _subscriptionMatch(
1361 const CIMInstance& subscription,
1362 const CIMInstance& indication,
1363 const CIMPropertyList& supportedPropertyList,
1364 QueryExpression& queryExpr,
1365 const CIMNamespaceName sourceNameSpace);
1366
1367 /**
1368 Format the generated indication based on:
1369 1) Use QueryExpression::applyProjection to remove properties not
1370 listed in the SELECT clause;
|
1371 kumpf 1.89 2) Remove any properties that may be left on the indication
|
1372 yi.zhou 1.83 that are not in the indication class. These are properties
1373 added by the provider incorrectly.
|
1374 kumpf 1.89
1375 @param formattedindication The generated indication to
|
1376 yi.zhou 1.83 be formatted
|
1377 kumpf 1.89 @param queryExpr, The query expression of the
|
1378 yi.zhou 1.83 matched subscription needs to be
|
1379 kumpf 1.89 used for indication projection
1380 @param ProviderSupportedProperties The properties are supported by
|
1381 yi.zhou 1.83 the indication provider
|
1382 kumpf 1.89 @param indicationClassProperties The indication class properties
|
1383 yi.zhou 1.83
1384 @return True, if the indication is formatted;
1385 False otherwise
1386 */
1387 Boolean _formatIndication(
1388 CIMInstance& formattedIndication,
1389 QueryExpression& queryExpr,
1390 const Array<CIMName>& providerSupportedProperties,
1391 const Array<CIMName>& indicationClassProperties);
1392
1393 /**
1394 Forward the formatted indication to the handler
1395
|
1396 kumpf 1.89 @param matchedSubscription The matched subscription
|
1397 yi.zhou 1.83 @param handlerInstance The handler instance for the matched
|
1398 kumpf 1.89 subscription
1399 @param formattedIndication The formatted indication
1400 @param namespaceName The generated indication namespace
1401 @param operationContext The operation context
|
1402 yi.zhou 1.83 */
1403 void _forwardIndToHandler(
1404 const CIMInstance& matchedSubscription,
1405 const CIMInstance& handlerInstance,
1406 const CIMInstance& formattedIndication,
1407 const CIMNamespaceName& namespaceName,
|
1408 karl 1.97.2.1 const OperationContext& operationContext,
1409 DeliveryStatusAggregator *deliveryStatusAggregator);
|
1410 yi.zhou 1.83
|
1411 venkat.puvvada 1.91 /**
1412 Updates the subscription table with the information of the providers
1413 those accepted the subscription. This method is called during indication
1414 service initialization.
1415
1416 @param subscription The accepted subscription.
1417 @param acceptedProviders Subscription accepted providers list.
1418 @param indicationSubclasses The indication subclasses for the
|
1419 karl 1.97.2.2 subscription with the source namespace.
|
1420 venkat.puvvada 1.91
1421 */
1422 void _updateAcceptedSubscription(
1423 CIMInstance &subscription,
1424 const Array<ProviderClassList> &acceptedProviders,
|
1425 karl 1.97.2.2 const Array<NamespaceClassList> &indicationSubclasses);
1426
1427 Array<ProviderClassList> _getIndicationProvidersWithNamespaceClassList(
1428 const Array<ProviderClassList> &providers);
1429
1430 void _addProviderToAcceptedProviderList(
1431 Array<ProviderClassList> &acceptedProviders,
1432 ProviderClassList &provider);
|
1433 venkat.puvvada 1.91
|
1434 venkat.puvvada 1.95 void _deliverWaitingIndications();
1435 void _beginCreateSubscription(const CIMObjectPath &objPath);
1436 void _cancelCreateSubscription(const CIMObjectPath &objPath);
1437 void _commitCreateSubscription(const CIMObjectPath &objPath);
1438
|
1439 venkat.puvvada 1.91
1440 AutoPtr<SubscriptionRepository> _subscriptionRepository;
|
1441 kumpf 1.51
|
1442 venkat.puvvada 1.91 AutoPtr<SubscriptionTable> _subscriptionTable;
|
1443 kumpf 1.6
|
1444 yi.zhou 1.84 #ifdef PEGASUS_ENABLE_INDICATION_COUNT
1445 ProviderIndicationCountTable _providerIndicationCountTable;
1446 #endif
1447
|
1448 venkat.puvvada 1.85 #ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
|
1449 venkat.puvvada 1.91
1450 /**
1451 Holds the number of async requests pending with the service.
1452 */
1453 AtomicInt _asyncRequestsPending;
1454
1455 /**
1456 Holds the number of threads processing the indications.
1457 */
1458 AtomicInt _processIndicationThreads;
1459
1460 AutoPtr<IndicationServiceConfiguration> _indicationServiceConfiguration;
|
1461 venkat.puvvada 1.97 #else
1462 Uint32 _enabledState;
|
1463 venkat.puvvada 1.85 #endif
1464
|
1465 kumpf 1.8 /**
|
1466 venkat.puvvada 1.95 Indications waiting for completion of pending create subscription
1467 requests.
1468 */
1469 List<Message, Mutex> _deliveryWaitIndications;
1470
1471 /**
|
1472 kumpf 1.8 Handle to Provider Registration Manager
1473 */
1474 ProviderRegistrationManager * _providerRegManager;
|
1475 kumpf 1.5
|
1476 carolann.graves 1.74 /**
|
1477 chuck 1.64 Pointer to CIMRepository, for use in building QueryExpression.
1478 */
1479 CIMRepository* _cimRepository;
1480
|
1481 kumpf 1.5 /**
1482 Integer representing queue ID for accessing Provider Manager Service
1483 */
1484 Uint32 _providerManager;
1485
1486 /**
1487 Integer representing queue ID for accessing Handler Manager Service
1488 */
1489 Uint32 _handlerService;
1490
1491 /**
|
1492 karl 1.97.2.1 Integer representing queue ID for accessing Module Controller
1493 */
1494 Uint32 _moduleController;
1495
1496 /**
|
1497 kumpf 1.46 Boolean indicating that the CIM Server has been configured to
1498 allow non-privileged users read and write access to the
1499 Subscription classes.
1500 */
1501 Boolean _enableSubscriptionsForNonprivilegedUsers;
1502
|
1503 kumpf 1.55 /**
|
1504 carolann.graves 1.80 Boolean indicating whether authentication is currently enabled in the
1505 CIM Server.
1506 */
1507 Boolean _authenticationEnabled;
1508
1509 /**
|
1510 kumpf 1.82 Gets the indication class specified by the subscription filter query.
|
1511 yi.zhou 1.66
|
1512 kumpf 1.82 @param instance the subscription instance
|
1513 yi.zhou 1.66
|
1514 kumpf 1.82 @return CIMClass object for the indication class
|
1515 yi.zhou 1.66 */
|
1516 kumpf 1.82 CIMClass _getIndicationClass(const CIMInstance& instance);
|
1517 yi.zhou 1.66
|
1518 karl 1.97.2.1 void _buildInternalControlProvidersRegistration();
1519
1520 Array<ProviderClassList> _getInternalIndProviders(
|
1521 karl 1.97.2.2 const Array<NamespaceClassList>& indicationSubclasses) const;
|
1522 karl 1.97.2.1
|
1523 yi.zhou 1.66 /**
|
1524 kumpf 1.55 Arrays of valid and supported property values
1525
|
1526 carolann.graves 1.74 Notes:
|
1527 kumpf 1.55 Valid values are defined by the CIM Event Schema MOF
1528 Supported values are a subset of the valid values
1529 Some valid values, as defined in the MOF, are not currently supported
1530 by the Pegasus IndicationService
1531
|
1532 carolann.graves 1.74 Supported Values
|
1533 kumpf 1.55 SubscriptionState: Enabled, Disabled
1534 RepeatNotificationPolicy: Unknown, Other, None, Suppress, Delay
1535 OnFatalErrorPolicy: Ignore, Disable, Remove
1536 PersistenceType: Permanent, Transient
|
1537 yi.zhou 1.77 SNMPVersion: SNMPv1 Trap, SNMPv2C Trap
|
1538 kumpf 1.55 */
|
1539 kumpf 1.82 Array<Uint16> _validStates;
1540 Array<Uint16> _validRepeatPolicies;
1541 Array<Uint16> _validErrorPolicies;
1542 Array<Uint16> _validPersistenceTypes;
1543 Array<Uint16> _validSNMPVersion;
1544 Array<Uint16> _supportedStates;
1545 Array<Uint16> _supportedRepeatPolicies;
1546 Array<Uint16> _supportedErrorPolicies;
1547 Array<Uint16> _supportedPersistenceTypes;
1548 Array<Uint16> _supportedSNMPVersion;
|
1549 yi.zhou 1.66
|
1550 carolann.graves 1.76 /**
1551 Arrays of names of supported properties for each class
1552 */
|
1553 kumpf 1.82 Array<CIMName> _supportedSubscriptionProperties;
1554 Array<CIMName> _supportedFormattedSubscriptionProperties;
1555 Array<CIMName> _supportedFilterProperties;
1556 Array<CIMName> _supportedCIMXMLHandlerProperties;
1557 Array<CIMName> _supportedCIMXMLListenerDestinationProperties;
1558 Array<CIMName> _supportedSNMPHandlerProperties;
1559 Array<CIMName> _supportedSyslogListenerDestinationProperties;
1560 Array<CIMName> _supportedEmailListenerDestinationProperties;
|
1561 karl 1.97.2.1 ControlProvIndRegTable _controlProvIndRegTable;
|
1562 kumpf 1.1 };
1563
|
1564 venkat.puvvada 1.91 // Use with AutoPtr to automatically decrement AtomicInt
1565 struct DecAtomicInt
1566 {
1567 void operator()(AtomicInt* ptr)
1568 {
1569 if (ptr)
1570 {
1571 ptr->dec();
1572 }
1573 }
1574 };
1575
|
1576 karl 1.97.2.1 struct ExpectedResponseCountSetDone
1577 {
1578 void operator()(DeliveryStatusAggregator* ptr)
1579 {
1580 if (ptr)
1581 {
1582 ptr->expectedResponseCountSetDone();
1583 }
1584 }
1585 };
1586
|
1587 kumpf 1.1 PEGASUS_NAMESPACE_END
1588
|
1589 kumpf 1.41 #endif /* Pegasus_IndicationService_h */
|