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