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