1 karl 1.65 //%2005////////////////////////////////////////////////////////////////////////
|
2 kumpf 1.1 //
|
3 karl 1.63 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.47 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.63 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.65 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 kumpf 1.1 //
12 // Permission is hereby granted, free of charge, to any person obtaining a copy
13 // of this software and associated documentation files (the "Software"), to
14 // deal in the Software without restriction, including without limitation the
15 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16 // sell copies of the Software, and to permit persons to whom the Software is
17 // furnished to do so, subject to the following conditions:
|
18 kumpf 1.27 //
|
19 kumpf 1.1 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
20 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
21 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
22 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
23 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
25 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 //==============================================================================
29 //
30 // Author: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
31 //
32 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
|
33 kumpf 1.39 // (carolann_graves@hp.com)
34 // Ben Heilbronn, Hewlett-Packard Company (ben_heilbronn@hp.com)
35 // Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
36 kumpf 1.1 //
37 //%/////////////////////////////////////////////////////////////////////////////
38
39 #ifndef Pegasus_IndicationService_h
40 #define Pegasus_IndicationService_h
41
42 #include <Pegasus/Common/Config.h>
43 #include <Pegasus/Common/MessageQueueService.h>
44 #include <Pegasus/Common/CIMMessage.h>
|
45 kumpf 1.24 #include <Pegasus/Common/IPC.h>
|
46 kumpf 1.54 #include <Pegasus/Common/AcceptLanguages.h> // l10n
47 #include <Pegasus/Common/ContentLanguages.h> // l10n
|
48 kumpf 1.6 #include <Pegasus/Server/ProviderRegistrationManager/ProviderRegistrationManager.h>
|
49 kumpf 1.54 #include <Pegasus/Server/Linkage.h>
|
50 chuck 1.64 #include <Pegasus/Query/QueryExpression/QueryExpression.h>
|
51 kumpf 1.1
|
52 kumpf 1.41 #include "ProviderClassList.h"
53 #include "IndicationOperationAggregate.h"
54
|
55 kumpf 1.1 PEGASUS_NAMESPACE_BEGIN
56
|
57 kumpf 1.54 class SubscriptionRepository;
58 class SubscriptionTable;
|
59 kumpf 1.1
60 /**
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 @author Hewlett-Packard Company
67
68 */
69
70 class PEGASUS_SERVER_LINKAGE IndicationService : public MessageQueueService
71 {
72 public:
73
74 /**
75 Constructs an IndicationSubscription instance and initializes instance
76 variables.
77 */
|
78 kumpf 1.6 IndicationService (
79 CIMRepository * repository,
|
80 kumpf 1.8 ProviderRegistrationManager * providerRegManager);
|
81 kumpf 1.1
82 virtual ~IndicationService(void);
83
|
84 mday 1.2 void handleEnqueue(Message* message);
|
85 kumpf 1.1
86 virtual void handleEnqueue(void);
87
88 virtual void _handle_async_request(AsyncRequest *req);
89
|
90 kumpf 1.54 /**
91 Gets a String containing the Provider Name, for use in a log message to
92 identify the provider.
93
94 @param provider provider instance
95
96 @return String containing the Provider Name
97 */
98 static String getProviderLogString
99 (CIMInstance & provider);
100
|
101 kumpf 1.1 AtomicInt dienow;
102
103 /**
|
104 kumpf 1.5 Operation types for the NotifyProviderRegistration message
|
105 kumpf 1.1 */
|
106 kumpf 1.5 enum Operation {OP_CREATE = 1, OP_DELETE = 2, OP_MODIFY = 3};
|
107 kumpf 1.24
108 static Mutex _mutex;
|
109 kumpf 1.1
|
110 kumpf 1.5 private:
|
111 kumpf 1.1
112 void _initialize (void);
113
114 void _terminate (void);
115
116 void _handleGetInstanceRequest(const Message * message);
117
118 void _handleEnumerateInstancesRequest(const Message * message);
119
120 void _handleEnumerateInstanceNamesRequest(const Message * message);
121
122 void _handleCreateInstanceRequest(const Message * message);
123
124 void _handleModifyInstanceRequest(const Message * message);
125
126 void _handleDeleteInstanceRequest(const Message * message);
127
128 void _handleProcessIndicationRequest(const Message * message);
129
130 /**
|
131 kumpf 1.57 Asynchronous callback function for _handleProcessIndicationRequest.
132 The response from the Handler is checked, and if it is not success, the
133 subscription's On Fatal Error Policy is implemented.
134
135 @param operation shared data structure that controls message
136 processing
137 @param destination target queue of completion callback
138 @param userParameter user parameter for callback processing
139 */
140 static void _handleIndicationCallBack (
141 AsyncOpNode * operation,
142 MessageQueue * destination,
143 void * userParameter);
144
145 /**
|
146 kumpf 1.1 Notifies the Indication Service that a change in provider registration
147 has occurred. The Indication Service retrieves the subscriptions
|
148 kumpf 1.23 affected by the registration change, sends the appropriate Create,
149 Modify, and/or Delete requests to the provider, and sends an alert to
|
150 kumpf 1.10 handler instances of subscriptions that are no longer served by the
151 provider.
|
152 kumpf 1.1 */
153 void _handleNotifyProviderRegistrationRequest(const Message * message);
154
155 /**
|
156 kumpf 1.33 Notifies the Indication Service that a provider has been disabled.
|
157 kumpf 1.51 The Indication Service retrieves the subscriptions served by the
158 disabled provider, and logs a message for each subscription that is no
159 longer served by the provider.
|
160 kumpf 1.1 */
161 void _handleNotifyProviderTerminationRequest(const Message * message);
162
163 /**
|
164 kumpf 1.51 Notifies the Indication Service that a provider has been enabled.
165 The Indication Service retrieves the subscriptions that can be served
166 by the enabled provider, sends Create Subscription and Enable
167 Indications requests to the provider, and logs a message for each
168 subscription that is now served by the provider.
169 */
170 void _handleNotifyProviderEnableRequest (const Message * message);
171
172 /**
|
173 kumpf 1.5 Determines if it is legal to create an instance.
174 Checks for existence of all key and required properties. Checks that
175 properties that MUST NOT exist (based on values of other properties),
176 do not exist. For any property that has a default value, if it does
177 not exist, adds the property with the default value.
178
179 @param instance instance to be created
180 @param nameSpace namespace for instance to be created
181
182 @throw CIM_ERR_INVALID_PARAMETER if instance is invalid
183 @throw CIM_ERR_NOT_SUPPORTED if the specified class is not
184 supported
185
|
186 kumpf 1.54 @return True, if the instance can be created;
|
187 kumpf 1.10 Otherwise throws an exception
|
188 kumpf 1.5 */
189 Boolean _canCreate (
190 CIMInstance & instance,
|
191 kumpf 1.31 const CIMNamespaceName & nameSpace);
|
192 kumpf 1.5
|
193 kumpf 1.21 /**
194 Validates the specified required property in the instance.
|
195 kumpf 1.56 If the property does not exist, or has a null value, or is not of the
196 expected type, an exception is thrown, using the specified message.
|
197 kumpf 1.21
198 This function is called by the _canCreate function, and is used to
199 validate the Filter and Handler properties in Subscription instances,
|
200 carolann.graves 1.62 the Name, Query and Query Language properties in
201 Filter instances, the Name and Destination
202 properties in CIMXML Handler instances, and the Name,
|
203 kumpf 1.21 Trap Destination, and SNMP Version properties in SNMP Mapper instances.
204
205 @param instance instance to be validated
206 @param propertyName name of property to be validated
|
207 kumpf 1.56 @param expectedType expected CIMType of property value
|
208 kumpf 1.21 @param message message to be used in exception
209
210 @throw CIM_ERR_INVALID_PARAMETER if required property is missing or
211 null
212 */
|
213 kumpf 1.20 void _checkRequiredProperty (
214 CIMInstance & instance,
|
215 kumpf 1.31 const CIMName & propertyName,
|
216 kumpf 1.56 const CIMType expectedType,
|
217 kumpf 1.20 const String & message);
218
|
219 kumpf 1.5 /**
|
220 kumpf 1.15 Validates the specified property and its corresponding Other___
221 property in the instance.
222 If the property does not exist, it is added with the default value.
223 If the property exists, but its value is NULL, its value is set to
224 the default value.
225 If the value of the property is Other, but the corresponding Other___
|
226 kumpf 1.56 property either does not exist, has a value of NULL, or is not of the
227 correct type, an exception is thrown.
|
228 kumpf 1.15 If the value of the property is not Other, but the corresponding
229 Other___ property exists and has a non-NULL value, an exception is
230 thrown.
|
231 kumpf 1.56 If the value of the property is not a supported value, an exception is
232 thrown.
|
233 kumpf 1.15 This function is called by the _canCreate function, and is used to
234 validate the following pairs of properties in Subscription or Handler
235 instances: Subscription State, Other Subscription State, Repeat
236 Notification Policy, Other Repeat Notification Policy, On Fatal Error
237 Policy, Other On Fatal Error Policy, Persistence Type, Other
238 Persistence Type.
239
240 @param instance instance to be validated
241 @param propertyName name of property to be validated
242 @param otherPropertyName name of Other___ property to be validated
243 @param defaultValue default value for property
244 @param otherValue "Other" value for property
|
245 kumpf 1.19 @param validValues set of valid values for property
|
246 kumpf 1.55 @param supportedValues set of supported values for property
|
247 kumpf 1.15
248 @throw CIM_ERR_INVALID_PARAMETER if value of property or Other___
249 property is invalid
250 */
|
251 kumpf 1.20 void _checkPropertyWithOther (
|
252 kumpf 1.15 CIMInstance & instance,
|
253 kumpf 1.31 const CIMName & propertyName,
254 const CIMName & otherPropertyName,
|
255 kumpf 1.15 const Uint16 defaultValue,
|
256 kumpf 1.19 const Uint16 otherValue,
|
257 kumpf 1.55 const Array <Uint16> & validValues,
258 const Array <Uint16> & supportedValues);
|
259 kumpf 1.20
|
260 kumpf 1.21 /**
261 Validates the specified property in the instance.
262 If the property does not exist, it is added with the default value.
263 If the property exists, but its value is NULL, its value is set to
264 the default value.
265 This function is called by the _canCreate function, and is used to
|
266 carolann.graves 1.62 validate the Source Namespace property in Filter instances.
|
267 kumpf 1.21
|
268 kumpf 1.56 Note: currently all properties validated by this function are of type
269 String. To use this function in the future with properties of other
270 types, a type parameter would need to be added, and the default value
271 would need to be passed as a CIMValue instead of a String.
272
|
273 kumpf 1.21 @param instance instance to be validated
274 @param propertyName name of property to be validated
275 @param defaultValue default value for property
276
277 @return the value of the property
278 */
|
279 kumpf 1.20 String _checkPropertyWithDefault (
280 CIMInstance & instance,
|
281 kumpf 1.31 const CIMName & propertyName,
|
282 kumpf 1.20 const String & defaultValue);
|
283 kumpf 1.56
284 /**
285 Validates the specified property in the instance.
|
286 carolann.graves 1.62 If the property does not exist, it is added with the default value.
287 If the property exists, but its value is NULL, its value is set to
288 the default value.
289 If the property exists and has a non-NULL value, its value is validated
290 against the default (expected) value. If the value is invalid, an
291 exception is thrown.
292 This function is called by the _canCreate function, and is used to
293 validate the Creation Class Name, System Name and System Creation Class
294 Name properties in Filter and Handler instances.
295
296 Note: currently all properties validated by this function are of type
297 String. To use this function in the future with properties of other
298 types, a type parameter would need to be added, and the default value
299 would need to be passed as a CIMValue instead of a String.
300
301 @param instance instance to be validated
302 @param propertyName name of property to be validated
303 @param defaultValue default value for property
304
305 @return the value of the property
306 */
307 carolann.graves 1.62 String _initOrValidateStringProperty (
308 CIMInstance & instance,
309 const CIMName & propertyName,
310 const String & defaultValue);
311
312 /**
313 Validates the specified property in the instance.
|
314 kumpf 1.56 If the property exists and its value is not NULL, but it is not of
315 the correct type, an exception is thrown.
316 This function is called by the _canCreate function. It is used to
317 validate the FailureTriggerTimeInterval, TimeOfLastStateChange,
318 SubscriptionDuration, SubscriptionStartTime, SubscriptionTimeRemaining,
319 RepeatNotificationInterval, RepeatNotificationGap, and
320 RepeatNotificationCount properties in Subscription instances, the Owner
321 property in Handler instances, and the PortNumber, SNMPSecurityName,
322 and SNMPEngineID properties in SNMP Mapper Handler instances.
323
324 @param instance instance to be validated
325 @param propertyName name of property to be validated
326 @param expectedType expected CIMType for property
327
328 @throw CIM_ERR_INVALID_PARAMETER if property exists and is not null
329 but is not of the correct type
330 */
331 void _checkProperty (
332 CIMInstance & instance,
333 const CIMName & propertyName,
334 const CIMType expectedType);
|
335 kumpf 1.15
336 /**
|
337 kumpf 1.10 Determines if the user is authorized to modify the instance, and if the
338 specified modification is supported. Currently, the only modification
339 supported is of the Subscription State property of the Subscription
340 class.
|
341 kumpf 1.5
342 @param request modification request
343 @param instance instance to be modified
|
344 kumpf 1.37 @param modifiedInstance modified instance
|
345 kumpf 1.5
|
346 kumpf 1.10 @throw CIM_ERR_NOT_SUPPORTED if the specified modification is
|
347 kumpf 1.5 not supported
348 @throw CIM_ERR_ACCESS_DENIED if the user is not authorized to
349 modify the instance
|
350 kumpf 1.37 @throw CIM_ERR_INVALID_PARAMETER if the modifiedInstance is invalid
|
351 kumpf 1.5
|
352 kumpf 1.54 @return True, if the instance can be modified;
|
353 kumpf 1.10 Otherwise throws an exception
|
354 kumpf 1.5 */
355 Boolean _canModify (
356 const CIMModifyInstanceRequestMessage * request,
|
357 kumpf 1.25 const CIMObjectPath & instanceReference,
|
358 kumpf 1.37 const CIMInstance & instance,
359 CIMInstance & modifiedInstance);
|
360 kumpf 1.5
361 /**
|
362 kumpf 1.10 Determines if the user is authorized to delete the instance, and if it
|
363 kumpf 1.11 is legal to delete the instance. If authorized, Subscription instances
|
364 kumpf 1.10 may always be deleted. Filter and non-transient Handler instances may
365 only be deleted if they are not being referenced by any Subscription
366 instances. If the instance to be deleted is a transient Handler, any
367 referencing Subscriptions are also deleted.
|
368 kumpf 1.5
369 @param instanceReference reference for instance to be deleted
370 @param nameSpace namespace for instance to be deleted
|
371 kumpf 1.10 @param currentUser current user
372
373 @throw CIM_ERR_ACCESS_DENIED if the user is not authorized to
374 delete the instance
375 @throw CIM_ERR_FAILED if the instance to be deleted is
376 referenced by a subscription
|
377 kumpf 1.5
|
378 kumpf 1.54 @return True, if the instance can be deleted;
|
379 kumpf 1.10 Otherwise throws an exception
|
380 kumpf 1.1 */
381 Boolean _canDelete (
|
382 kumpf 1.25 const CIMObjectPath & instanceReference,
|
383 kumpf 1.31 const CIMNamespaceName & nameSpace,
|
384 kumpf 1.10 const String & currentUser);
|
385 kumpf 1.1
386 /**
387 Retrieves list of enabled subscription instances in all namespaces,
388 where the subscription indication class matches or is a superclass
|
389 kumpf 1.10 of the supported class, and the properties required to process the
390 subscription are all contained in the list of supported properties.
|
391 kumpf 1.42 If the checkProvider parameter value is True, a subscription is only
392 included in the list returned if the specified provider accepted the
393 subscription. If the checkProvider parameter value is False, the
394 provider parameter is not used (ignored).
|
395 kumpf 1.1
|
396 kumpf 1.10 @param supportedClass the supported class
397 @param nameSpaces the list of supported namespaces
398 @param supportedProperties the list of supported properties
|
399 kumpf 1.42 @param checkProvider indicates whether provider acceptance is
400 checked
401 @param provider the provider (used if checkProvider True)
|
402 kumpf 1.1
|
403 kumpf 1.26 @return list of CIMInstance subscriptions
|
404 kumpf 1.1 */
|
405 kumpf 1.26 Array <CIMInstance> _getMatchingSubscriptions (
|
406 kumpf 1.31 const CIMName & supportedClass,
407 const Array <CIMNamespaceName> nameSpaces,
|
408 kumpf 1.42 const CIMPropertyList & supportedProperties,
|
409 kumpf 1.43 const Boolean checkProvider = false,
|
410 kumpf 1.42 const CIMInstance & provider = CIMInstance ());
|
411 kumpf 1.1
412 /**
413 Retrieves lists of enabled subscription instances in all namespaces
414 that are either newly supported or previously supported, based on the
|
415 kumpf 1.9 supported class, the supported namespaces before and after modification,
416 and the supported properties before and after modification. For
|
417 kumpf 1.10 subscriptions based on the supported class, the newSubscriptions list
|
418 kumpf 1.9 returned contains the subscriptions for which the properties required
419 to process the subscription are all contained in the new list of
420 supported properties, but are not all contained in the old list of
421 supported properties, and/or the filter source namespace is contained in
422 the new list if supported namespaces, but is not contained in the old
423 list of supported namespaces. The formerSubscriptions list returned
424 contains the subscriptions for which the properties required to process
425 the subscription are not all contained in the new list of supported
426 properties, but are all contained in the old list of supported
427 properties, and/or the filter source namespace is not contained in the
428 new list if supported namespaces, but is contained in the old list of
429 supported namespaces.
430
|
431 kumpf 1.10 @param supportedClass the supported class
|
432 kumpf 1.9 @param newNameSpaces namespaces supported after modification
433 @param oldNameSpaces namespaces supported before modification
434 @param newProperties properties supported after modification
435 @param oldProperties properties supported before modification
|
436 kumpf 1.1 @param newSubscriptions the list of newly supported subscriptions
437 @param formerSubscriptions the list of previously supported
438 subscriptions
439 */
440 void _getModifiedSubscriptions (
|
441 kumpf 1.31 const CIMName & supportedClass,
442 const Array <CIMNamespaceName> & newNameSpaces,
443 const Array <CIMNamespaceName> & oldNameSpaces,
|
444 kumpf 1.1 const CIMPropertyList & newProperties,
445 const CIMPropertyList & oldProperties,
|
446 kumpf 1.26 Array <CIMInstance> & newSubscriptions,
447 Array <CIMInstance> & formerSubscriptions);
|
448 kumpf 1.1
449 /**
|
450 kumpf 1.9 Determines if all of the required properties in the specified list
451 are contained in the specified list of supported properties.
452
453 @param requiredProperties the required properties
|
454 kumpf 1.10 @param supportedProperties the supported properties
|
455 kumpf 1.9
|
456 kumpf 1.54 @return true, if all required properties are supported;
|
457 kumpf 1.9 false otherwise
458 */
459 Boolean _inPropertyList (
460 const CIMPropertyList & requiredProperties,
|
461 kumpf 1.10 const CIMPropertyList & supportedProperties);
|
462 kumpf 1.9
463 /**
|
464 chuck 1.64 Builds a QueryExpression from the filter query string,
465 the query language name, and the namespace in which the query
466 is to be run.
|
467 kumpf 1.1
468 @param filterQuery the filter query string
|
469 chuck 1.64 @param queryLanguage the query language name
470 @param ns query namespace
|
471 kumpf 1.1
|
472 chuck 1.64 @return QueryExpression representing the filter query
|
473 kumpf 1.1 */
|
474 chuck 1.64 QueryExpression _getQueryExpression (const String& filterQuery,
475 const String& queryLanguage,
476 const CIMNamespaceName ns) const;
|
477 kumpf 1.1
478 /**
|
479 chuck 1.64 Extracts the indication class name from the specified query expression
480 (WQL or CQL), and validates that the name represents a subclass of the
|
481 kumpf 1.1 Indication class.
482
|
483 chuck 1.64 @param queryExpression the query expression
|
484 kumpf 1.1 @param nameSpaceName the namespace
485
486 @return String containing the indication class name
487 */
|
488 kumpf 1.31 CIMName _getIndicationClassName (
|
489 chuck 1.64 const QueryExpression & queryExpression,
|
490 kumpf 1.31 const CIMNamespaceName & nameSpaceName) const;
|
491 kumpf 1.15
492 /**
|
493 kumpf 1.1 Retrieves the list of indication providers that serve the specified
494 indication subclasses.
495
|
496 chuck 1.64 @param queryExpression the query expression
497 @param nameSpace the namespace name
|
498 kumpf 1.1 @param indicationClassName the indication class name
499 @param indicationSubclasses the list of indication subclass names
500
501 @return list of ProviderClassList structs
502 */
|
503 kumpf 1.10 Array <ProviderClassList> _getIndicationProviders (
|
504 chuck 1.64 const QueryExpression & queryExpression,
|
505 kumpf 1.31 const CIMNamespaceName & nameSpace,
506 const CIMName & indicationClassName,
|
507 chuck 1.64 const Array <CIMName> & indicationSubclasses) const;
|
508 kumpf 1.1
509 /**
510 Retrieves the list of properties referenced by the specified
|
511 chuck 1.64 filter query expression.
|
512 kumpf 1.1
|
513 chuck 1.64 @param queryExpression the query expression
|
514 kumpf 1.22 @param nameSpaceName the namespace
|
515 chuck 1.64 @param indicationClassName the indication class name
|
516 kumpf 1.1
|
517 kumpf 1.22 @return CIMPropertyList of properties referenced by the filter query
|
518 chuck 1.64 expression
|
519 kumpf 1.1 */
520 CIMPropertyList _getPropertyList (
|
521 chuck 1.64 const QueryExpression & queryExpression,
|
522 kumpf 1.31 const CIMNamespaceName & nameSpaceName,
523 const CIMName & indicationClassName) const;
|
524 kumpf 1.22
525 /**
526 Checks if the property list includes all properties in the specified
527 class. If so, a NULL CIMPropertyList is returned. Otherwise, a
|
528 carolann.graves 1.60 CIMPropertyList containing the properties is returned. The list of
529 property names in the specified indication class is also returned in
530 the indicationClassProperties parameter.
531
532 @param propertyList the list of property names
533 @param nameSpaceName the namespace
534 @param indicationClassName the indication class name
535 @param indicationClassProperties the list of property names in the
536 specified indication class
|
537 kumpf 1.22
538 @return CIMPropertyList of properties referenced by the filter query
539 select statement
540 */
541 CIMPropertyList _checkPropertyList (
|
542 kumpf 1.29 const Array <CIMName> & propertyList,
|
543 kumpf 1.31 const CIMNamespaceName & nameSpaceName,
|
544 carolann.graves 1.60 const CIMName & indicationClassName,
545 Array <CIMName> & indicationClassProperties) const;
|
546 kumpf 1.1
547 /**
548 Extracts the condition (WHERE Clause) from the specified filter query
549 string.
550
551 @param filterQuery the filter query
552
553 @return String containing the filter query condition
554 */
555 String _getCondition (
556 const String & filterQuery) const;
557
558 /**
|
559 kumpf 1.4 Deletes subscriptions referencing the specified handler.
560
561 @param nameSpace the name space
562 @param referenceProperty the name of the reference property in the
563 subscription instance
564 @param handler the handler reference
565 */
566 void _deleteReferencingSubscriptions (
|
567 kumpf 1.31 const CIMNamespaceName & nameSpace,
568 const CIMName & referenceProperty,
|
569 kumpf 1.25 const CIMObjectPath & handler);
|
570 kumpf 1.4
571 /**
572 Determines if specified Subscription has expired
573
574 NOTE: It is assumed that the instance passed to this function is a
575 Subscription instance, and that the Subscription Duration and
576 Start Time properties exist
577
578 @param instance the subscription instance
579
|
580 kumpf 1.54 @return True, if the Subscription has expired;
|
581 kumpf 1.4 False otherwise
582 */
583 Boolean _isExpired (
584 const CIMInstance & instance) const;
585
586 /**
|
587 kumpf 1.5 Deletes specified subscription
588
589 @param subscription the subscription reference
590 */
591 void _deleteExpiredSubscription (
|
592 kumpf 1.25 CIMObjectPath & subscription);
|
593 kumpf 1.21
594 /**
595 Gets the Subscription Time Remaining property
596
597 Calculates time remaining from Subscription Start Time, Subscription
598 Duration, and current date time. If the subscription has a non-null
599 Duration, the Time Remaining is set, and True is returned. If the
600 subscription does not have a non-null Duration, it has no expiration
601 date, and the time remaining is unlimited. In this case, the Time
602 Remaining is not set and False is returned.
603
604 NOTE: It is assumed that the instance passed to this function is a
605 Subscription instance, and that the Start Time property exists and
606 has a value
607
608 @param instance Input the subscription instance
609 @param timeRemaining Output the time remaining (seconds)
610
|
611 kumpf 1.54 @return True, if the subscription has a non-null Duration;
|
612 kumpf 1.21 False otherwise
613 */
614 Boolean _getTimeRemaining (
615 const CIMInstance & instance,
616 Uint64 & timeRemaining) const;
|
617 kumpf 1.5
618 /**
|
619 kumpf 1.4 Sets the Subscription Time Remaining property
620
621 Calculates time remaining from Subscription Start Time, Subscription
622 Duration, and current date time
623
624 NOTE: It is assumed that the instance passed to this function is a
625 Subscription instance, and that the Subscription Duration and
626 Start Time properties exist
627
628 @param instance the subscription instance
629 */
630 void _setTimeRemaining (
631 CIMInstance & instance);
632
633 /**
|
634 kumpf 1.23 Gets the parameter values required to Create or Modify the subscription
|
635 kumpf 1.10 request.
|
636 kumpf 1.5 If no indication providers are found, condition and queryLanguage are
|
637 kumpf 1.3 set to empty string.
638
|
639 kumpf 1.33 @param nameSpaceName Input namespace name (of subscription)
640 @param subscriptionInstance Input subscription instance
641 @param indicationSubclasses Output list of subclasses of indication
642 class in filter query
|
643 kumpf 1.3 @param indicationProviders Output list of providers with associated
644 classes
645 @param propertyList Output list of properties required by the
646 subscription
|
647 kumpf 1.17 @param sourceNameSpace Output source namespace for filter query
|
648 kumpf 1.3 @param condition Output condition part of the filter query
|
649 kumpf 1.58 @param query Output filter query
|
650 kumpf 1.3 @param queryLanguage Output query language in which the filter
651 query is expressed
652 */
|
653 kumpf 1.23 void _getCreateParams (
|
654 kumpf 1.31 const CIMNamespaceName & nameSpaceName,
|
655 kumpf 1.3 const CIMInstance & subscriptionInstance,
|
656 kumpf 1.33 Array <CIMName> & indicationSubclasses,
|
657 kumpf 1.10 Array <ProviderClassList> & indicationProviders,
658 CIMPropertyList & propertyList,
|
659 kumpf 1.31 CIMNamespaceName & sourceNameSpace,
|
660 kumpf 1.10 String & condition,
|
661 kumpf 1.58 String & query,
|
662 kumpf 1.10 String & queryLanguage);
663
664 /**
|
665 kumpf 1.23 Gets the parameter values required to Create or Modify the subscription
|
666 kumpf 1.10 request.
667
|
668 kumpf 1.33 @param nameSpaceName Input namespace name (of subscription)
669 @param subscriptionInstance Input subscription instance
670 @param indicationSubclasses Output list of subclasses of indication
671 class in filter query
|
672 kumpf 1.10 @param propertyList Output list of properties required by the
673 subscription
|
674 kumpf 1.17 @param sourceNameSpace Output source namespace for filter query
|
675 kumpf 1.10 @param condition Output condition part of the filter query
|
676 kumpf 1.58 @param query Output filter query
|
677 kumpf 1.10 @param queryLanguage Output query language in which the filter
678 query is expressed
679 */
|
680 kumpf 1.23 void _getCreateParams (
|
681 kumpf 1.31 const CIMNamespaceName & nameSpaceName,
|
682 kumpf 1.10 const CIMInstance & subscriptionInstance,
|
683 kumpf 1.33 Array <CIMName> & indicationSubclasses,
|
684 kumpf 1.3 CIMPropertyList & propertyList,
|
685 kumpf 1.31 CIMNamespaceName & sourceNameSpace,
|
686 kumpf 1.3 String & condition,
|
687 kumpf 1.58 String & query,
|
688 kumpf 1.3 String & queryLanguage);
689
690 /**
|
691 kumpf 1.23 Gets the parameter values required to Delete the subscription request.
|
692 kumpf 1.5
|
693 kumpf 1.33 @param nameSpaceName Input namespace name
694 @param subscriptionInstance Input subscription instance
695 @param indicationSubclasses Output list of subclasses of indication
696 class in filter query
697 @param sourceNameSpace Output source namespace for filter query
|
698 kumpf 1.5
|
699 kumpf 1.23 @return List of providers with associated classes to Delete
|
700 kumpf 1.5 */
|
701 kumpf 1.23 Array <ProviderClassList> _getDeleteParams (
|
702 kumpf 1.31 const CIMNamespaceName & nameSpaceName,
|
703 kumpf 1.33 const CIMInstance & subscriptionInstance,
704 Array <CIMName> & indicationSubclasses,
705 CIMNamespaceName & sourceNameSpace);
|
706 mday 1.13
|
707 kumpf 1.5 /**
|
708 kumpf 1.23 Sends Create subscription request for the specified subscription
|
709 kumpf 1.41 to each provider in the list. Create Subscription requests must be
710 sent to the indication providers in the following cases: (1) on
711 initialization, for each enabled subscription retrieved from the
712 repository, (2) on creation of an enabled subscription instance, (3) on
713 modification of a subscription instance, when the state changes to
714 enabled, and (4) on notification of a provider registration change
715 newly enabling the provider to serve the subscription. In cases (2) and
716 (3), there is an original Create Instance or Modify Instance request to
717 which the Indication Service must respond. In cases (1) and (4), there
718 is an original request (Notify Provider Registration Request), but no
719 response is required.
|
720 kumpf 1.1
721 @param indicationProviders list of providers with associated classes
|
722 kumpf 1.54 @param nameSpace the nameSpace name of the resource being
723 monitored, from the SourceNamespace
724 property of the CIM_IndicationFilter
725 instance for the specified
726 subscription
|
727 kumpf 1.1 @param propertyList the properties referenced by the
728 subscription
729 @param condition the condition part of the filter query
|
730 kumpf 1.58 @param query the filter query
|
731 kumpf 1.1 @param queryLanguage the query language in which the filter
732 query is expressed
|
733 kumpf 1.23 @param subscription the subscription to be created
|
734 chuck 1.35 @param acceptLangs the language of the response, and
735 future indications
736 @param contentLangs the language of the subscription
|
737 kumpf 1.41 @param origRequest the original request, if any (e.g. Create
738 Instance, Modify Instance, Provider
|
739 kumpf 1.59 Registration change, Provider Enable)
|
740 kumpf 1.41 @param indicationSubclasses the indication subclasses for the
741 subscription
|
742 kumpf 1.9 @param userName the userName for authentication
743 @param authType the authentication type
744
|
745 kumpf 1.1 */
|
746 kumpf 1.41 void _sendCreateRequests (
|
747 kumpf 1.10 const Array <ProviderClassList> & indicationProviders,
|
748 kumpf 1.31 const CIMNamespaceName & nameSpace,
|
749 kumpf 1.1 const CIMPropertyList & propertyList,
750 const String & condition,
|
751 kumpf 1.58 const String & query,
|
752 kumpf 1.1 const String & queryLanguage,
|
753 kumpf 1.26 const CIMInstance & subscription,
|
754 chuck 1.35 const AcceptLanguages & acceptLangs,
755 const ContentLanguages & contentLangs,
|
756 kumpf 1.41 const CIMRequestMessage * origRequest,
757 const Array <CIMName> & indicationSubclasses,
|
758 kumpf 1.9 const String & userName,
759 const String & authType = String::EMPTY);
|
760 mday 1.13
|
761 kumpf 1.1 /**
|
762 kumpf 1.23 Sends Modify subscription request for the specified subscription
|
763 kumpf 1.41 to each provider in the list. Modify Subscription requests must be
764 sent to the indication providers on notification of a provider
765 registration change, when the provider was formerly serving the
766 subscription, and is still serving the subscription, in the following
767 cases: (1) the provider is newly serving an additional indication
768 subclass specified by the subscription, and (2) the provider is
769 no longer serving an indication subclass specified by the subscription
770 (but is still serving at least one of the indication subclasses).
771 In cases (1) and (2), there is an original request (Notify Provider
772 Registration Request), but no response is required.
|
773 kumpf 1.1
774 @param indicationProviders list of providers with associated classes
|
775 kumpf 1.54 @param nameSpace the nameSpace name of the resource being
776 monitored, from the SourceNamespace
777 property of the CIM_IndicationFilter
778 instance for the specified
779 subscription
|
780 kumpf 1.1 @param propertyList the properties referenced by the
781 subscription
782 @param condition the condition part of the filter query
|
783 kumpf 1.58 @param query the filter query
|
784 kumpf 1.1 @param queryLanguage the query language in which the filter
785 query is expressed
786 @param subscription the subscription to be modified
|
787 chuck 1.35 @param acceptLangs the language of the response, and
788 future indications
789 @param contentLangs the language of the subscription
|
790 kumpf 1.41 @param origRequest the original request (Provider
791 Registration change)
|
792 kumpf 1.9 @param userName the userName for authentication
793 @param authType the authentication type
|
794 kumpf 1.1 */
795 void _sendModifyRequests (
|
796 kumpf 1.10 const Array <ProviderClassList> & indicationProviders,
|
797 kumpf 1.31 const CIMNamespaceName & nameSpace,
|
798 kumpf 1.1 const CIMPropertyList & propertyList,
799 const String & condition,
|
800 kumpf 1.58 const String & query,
|
801 kumpf 1.1 const String & queryLanguage,
|
802 kumpf 1.26 const CIMInstance & subscription,
|
803 chuck 1.35 const AcceptLanguages & acceptLangs,
804 const ContentLanguages & contentLangs,
|
805 kumpf 1.41 const CIMRequestMessage * origRequest,
|
806 kumpf 1.9 const String & userName,
807 const String & authType = String::EMPTY);
|
808 kumpf 1.1
809 /**
|
810 kumpf 1.23 Sends Delete subscription request for the specified subscription
|
811 kumpf 1.41 to each provider in the list. Delete Subscription requests must be
812 sent to the indication providers in the following cases: (1) on deletion
813 of an enabled subscription instance, (2) on modification of a
814 subscription instance, when the state changes to disabled, and (3) on
815 notification of a provider registration change newly preventing the
816 provider from serving the subscription.
817 In cases (1) and (2), there is an original Delete Instance or Modify
818 Instance request to which the Indication Service must respond. In case
819 (1), there is an original request (Notify Provider Registration
820 Request), but no response is required.
|
821 kumpf 1.1
822 @param indicationProviders list of providers with associated classes
|
823 kumpf 1.54 @param nameSpace the nameSpace name of the resource being
824 monitored, from the SourceNamespace
825 property of the CIM_IndicationFilter
826 instance for the specified
827 subscription
|
828 kumpf 1.1 @param subscription the subscription to be modified
|
829 chuck 1.35 @param acceptLangs the language of the response
830 @param contentLangs the language of the subscription
|
831 kumpf 1.59 @param origRequest the original request, if any (e.g. Delete
|
832 kumpf 1.41 Instance, Modify Instance, Provider
833 Registration change)
834 @param indicationSubclasses the indication subclasses for the
835 subscription
|
836 kumpf 1.9 @param userName the userName for authentication
837 @param authType the authentication type
|
838 kumpf 1.1 */
|
839 kumpf 1.23 void _sendDeleteRequests (
|
840 kumpf 1.10 const Array <ProviderClassList> & indicationProviders,
|
841 kumpf 1.31 const CIMNamespaceName & nameSpace,
|
842 kumpf 1.26 const CIMInstance & subscription,
|
843 chuck 1.35 const AcceptLanguages & acceptLangs,
844 const ContentLanguages & contentLangs,
|
845 kumpf 1.41 const CIMRequestMessage * origRequest,
846 const Array <CIMName> & indicationSubclasses,
|
847 kumpf 1.9 const String & userName,
848 const String & authType = String::EMPTY);
|
849 kumpf 1.1
850 /**
|
851 kumpf 1.41 Collects responses from providers for aggregation as they are received,
852 and stores them in the IndicationOperationAggregate instance. Calls
853 _handleOperationResponseAggregation to process the responses, once all
854 expected responses have been received.
855
|
856 kumpf 1.57 @param operation shared data structure that controls message
|
857 kumpf 1.41 processing
858 @param destination target queue of completion callback
859 @param userParameter user parameter for callback processing
860 */
861 static void _aggregationCallBack (
862 AsyncOpNode * operation,
863 MessageQueue * destination,
864 void * userParameter);
865
866 /**
867 Calls the appropriate function to processes responses from providers,
868 based on the type of request sent to providers, once all responses have
869 been received.
870
871 @param operationAggregate the operation aggregate instance
872 */
873 void _handleOperationResponseAggregation (
874 IndicationOperationAggregate * operationAggregate);
875
876 /**
877 Processes create subscription responses from providers, once all have
878 kumpf 1.41 been received. Takes the appropriate action, based on the type of the
879 original request, if any, and the responses received. Sends the
880 response to the original request, if required.
881
882 @param operationAggregate the operation aggregate instance
883 */
884 void _handleCreateResponseAggregation (
885 IndicationOperationAggregate * operationAggregate);
886
887 /**
888 Processes enable indications responses from providers, once all have
889 been received.
890
891 @param operationAggregate the operation aggregate instance
892 */
893 void _handleEnableResponseAggregation (
894 IndicationOperationAggregate * operationAggregate);
895
896 /**
897 Processes modify subscription responses from providers, once all have
898 been received. Updates the subscription hash tables.
899 kumpf 1.41
900 @param operationAggregate the operation aggregate instance
901 */
902 void _handleModifyResponseAggregation (
903 IndicationOperationAggregate * operationAggregate);
904
905 /**
906 Processes delete subscription responses from providers, once all have
907 been received. Updates the subscription hash tables appropriately,
908 based on the type of the original request, if any. Sends the response
909 to the original request, if required.
910
911 @param operationAggregate the operation aggregate instance
912 */
913 void _handleDeleteResponseAggregation (
914 IndicationOperationAggregate * operationAggregate);
915
916 /**
|
917 kumpf 1.50 Processes disable indications responses from providers, once all have
918 been received.
919
920 @param operationAggregate the operation aggregate instance
921 */
922 void _handleDisableResponseAggregation
923 (IndicationOperationAggregate * operationAggregate);
924
925 /**
|
926 kumpf 1.1 Creates an alert instance of the specified class.
927
928 @param alertClassName the alert class name
|
929 kumpf 1.7 @param subscriptions subscriptions for which alert is to be
|
930 kumpf 1.1 created
931
932 @return the created alert instance
933 */
934 CIMInstance _createAlertInstance (
|
935 kumpf 1.31 const CIMName & alertClassName,
|
936 kumpf 1.26 const Array <CIMInstance> & subscriptions);
|
937 mday 1.14
|
938 kumpf 1.40 #if 0
|
939 kumpf 1.33 /**
|
940 mday 1.14 Asynchronous completion routine for _sendAlerts
941 */
942
943 static void _sendAlertsCallBack(AsyncOpNode *operation,
944 MessageQueue *callback_destination,
945 void *parameter);
|
946 kumpf 1.1
947 /**
948 Sends specified alert to each unique handler instance for the
949 specified subscriptions in the list.
950
|
951 kumpf 1.7 @param subscriptions subscriptions for which alert is to be
|
952 kumpf 1.1 sent
953 @param alertInstance the alert to be sent
954 */
955 void _sendAlerts (
|
956 kumpf 1.26 const Array <CIMInstance> & subscriptions,
|
957 kumpf 1.1 /* const */ CIMInstance & alertInstance);
|
958 kumpf 1.40 #endif
|
959 mday 1.18
|
960 kumpf 1.16 /**
|
961 kumpf 1.50 Sends an Enable Indications request to the specified providers.
|
962 kumpf 1.16
|
963 kumpf 1.41 @param enableProviders the providers to be enabled
|
964 kumpf 1.59 @param origRequest the original request, if any (e.g. Create
965 Instance, Modify Instance, Provider
966 Registration change, Provider Enable)
967 @param path path of created instance (for create
968 instance request)
|
969 kumpf 1.16 */
|
970 kumpf 1.23 void _sendEnable (
|
971 kumpf 1.41 const Array <ProviderClassList> & enableProviders,
|
972 kumpf 1.59 const CIMRequestMessage * origRequest,
973 const CIMObjectPath & path = CIMObjectPath ());
|
974 kumpf 1.50
975 /**
976 Sends a Disable Indications request to the specified providers.
977
978 @param disableProviders the providers to be disabled
|
979 kumpf 1.59 @param origRequest the original request, if any (e.g. Delete
980 Instance, Modify Instance, Provider
981 Registration change)
|
982 kumpf 1.50 */
983 void _sendDisable
984 (const Array <ProviderClassList> & disableProviders,
985 const CIMRequestMessage * origRequest);
|
986 kumpf 1.16
|
987 kumpf 1.37 /**
988 Gets the value of the Creator property from the specified Subscription
989 instance. If this function returns False, the value of the creator
990 parameter is unchanged.
991
992 @param instance subscription instance
993 @param creator value of Creator property if retrieved
994
|
995 kumpf 1.54 @return True, if the value of the Creator property was retrieved;
|
996 kumpf 1.37 False if Creator property was missing, null, or of an
|
997 kumpf 1.54 incorrect type
|
998 kumpf 1.37 */
999 Boolean _getCreator (
1000 const CIMInstance & instance,
1001 String & creator) const;
1002
1003 /**
|
1004 kumpf 1.54 Validates the specified SubscriptionState property value.
|
1005 kumpf 1.37
|
1006 kumpf 1.54 @param state SubscriptionState property value
|
1007 kumpf 1.37
|
1008 kumpf 1.54 @return True, if the SubscriptionState property value is valid;
1009 False otherwise
|
1010 kumpf 1.37 */
|
1011 kumpf 1.54 Boolean _validateState (
1012 const Uint16 state) const;
|
1013 kumpf 1.37
|
1014 kumpf 1.46 /**
1015 This function peforms an authorization test based on the
1016 value of the enableSubscriptionForNonprivilegedUsers.
1017
1018 @param userName String
1019
|
1020 kumpf 1.54 @return True, if authentication is not enabled or the
1021 user is a privileged system user;
1022 False, if authentication is enabled and the
1023 user is not privileged
|
1024 kumpf 1.46 */
1025 void _checkNonprivilegedAuthorization (
1026 const String & userName);
1027
|
1028 kumpf 1.48 /**
|
1029 kumpf 1.49 Updates the propertyList, in preparation for calling the Repository.
1030 If the propertyList is not null, the Creator property must be added to
1031 the list. Also, if the request is for the Subscription class, the
1032 value of the Time Remaining property need only be calculated if it is
1033 requested. In that case, the Subscription Duration and Start Time
1034 properties must be added to the list if not already there.
1035
1036 @param className class name for the request
1037 @param propertyList list of properties requested
1038 @param setTimeRemaining indicates whether Time Remaining property
1039 was requested
1040 @param startTimeAdded indicates whether Start Time property was
1041 added to the list
1042 @param durationAdded indicates whether Duration property was
1043 added to the list
1044 */
1045 void _updatePropertyList
1046 (CIMName & className,
1047 CIMPropertyList & propertyList,
1048 Boolean & setTimeRemaining,
1049 Boolean & startTimeAdded,
1050 kumpf 1.49 Boolean & durationAdded);
1051
1052 /**
|
1053 kumpf 1.48 Gets a String containing the comma-separated Subscription Filter Name
1054 and Handler Name, for use in a log message to identify the subscription.
1055
1056 @param subscription subscription instance
1057
1058 @return String containing the comma-separated Subscription Filter Name
1059 and Handler Name
1060 */
1061 String _getSubscriptionLogString
1062 (CIMInstance & subscription);
1063
|
1064 kumpf 1.54 SubscriptionRepository* _subscriptionRepository;
|
1065 kumpf 1.51
|
1066 kumpf 1.54 SubscriptionTable * _subscriptionTable;
|
1067 kumpf 1.6
|
1068 kumpf 1.8 /**
1069 Handle to Provider Registration Manager
1070 */
1071 ProviderRegistrationManager * _providerRegManager;
|
1072 kumpf 1.5
|
1073 chuck 1.64 /**
1074 Pointer to CIMRepository, for use in building QueryExpression.
1075 */
1076 CIMRepository* _cimRepository;
1077
|
1078 kumpf 1.5 /**
1079 Integer representing queue ID for accessing Provider Manager Service
1080 */
1081 Uint32 _providerManager;
1082
1083 /**
1084 Integer representing queue ID for accessing Handler Manager Service
1085 */
1086 Uint32 _handlerService;
1087
1088 /**
|
1089 kumpf 1.46 Boolean indicating that the CIM Server has been configured to
1090 allow non-privileged users read and write access to the
1091 Subscription classes.
1092 */
1093 Boolean _enableSubscriptionsForNonprivilegedUsers;
1094
|
1095 kumpf 1.55 /**
1096 Arrays of valid and supported property values
1097
1098 Notes:
1099 Valid values are defined by the CIM Event Schema MOF
1100 Supported values are a subset of the valid values
1101 Some valid values, as defined in the MOF, are not currently supported
1102 by the Pegasus IndicationService
1103
1104 Supported Values
1105 SubscriptionState: Enabled, Disabled
1106 RepeatNotificationPolicy: Unknown, Other, None, Suppress, Delay
1107 OnFatalErrorPolicy: Ignore, Disable, Remove
1108 PersistenceType: Permanent, Transient
1109 */
|
1110 kumpf 1.19 Array <Uint16> _validStates;
1111 Array <Uint16> _validRepeatPolicies;
1112 Array <Uint16> _validErrorPolicies;
1113 Array <Uint16> _validPersistenceTypes;
|
1114 kumpf 1.55 Array <Uint16> _supportedStates;
1115 Array <Uint16> _supportedRepeatPolicies;
1116 Array <Uint16> _supportedErrorPolicies;
1117 Array <Uint16> _supportedPersistenceTypes;
|
1118 kumpf 1.1 };
1119
1120 PEGASUS_NAMESPACE_END
1121
|
1122 kumpf 1.41 #endif /* Pegasus_IndicationService_h */
|