version 1.9, 2002/03/27 19:05:31
|
version 1.10, 2002/03/29 18:55:27
|
|
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
struct ProviderClassList |
/** |
|
Entry for list of indication providers |
|
*/ |
|
struct providerClassList |
{ | { |
CIMInstance provider; | CIMInstance provider; |
CIMInstance providerModule; | CIMInstance providerModule; |
Array <String> classList; | Array <String> classList; |
}; | }; |
|
typedef struct providerClassList ProviderClassList; |
| |
|
/** |
|
Entry for Subscription table |
|
*/ |
|
struct SubscriptionTableEntry |
|
{ |
|
CIMNamedInstance subscription; |
|
CIMInstance provider; |
|
Array <String> classList; |
|
}; |
|
|
|
/** |
|
Table for subscription information. |
|
The table keys are generated by concatenating the Subscription namespace |
|
name, Filter and Handler key values, and Provider key values. Each table |
|
value includes the Subscription, the Provider, and the list of classnames. |
|
The key allows quick access when the subscription and provider are both |
|
known (i.e. initialize, instance operations, provider registration changes). |
|
When only the provider is known (i.e. provider termination), an iterator is |
|
used to search the table. That is, the table is designed to optimize all |
|
operations except provider termination. |
|
*/ |
|
typedef HashTable <String, |
|
SubscriptionTableEntry, |
|
EqualFunc <String>, |
|
HashFunc <String> > SubscriptionTable; |
| |
/** | /** |
| |
IndicationService class is the service that serves the | IndicationService class is the service that serves the |
CIM_IndicationSubscription, CIM_IndicationFilter, and CIM_IndicationHandler |
Indication Subscription, Indication Filter, and Indication Handler |
classes, and processes indications. | classes, and processes indications. |
| |
@author Hewlett-Packard Company | @author Hewlett-Packard Company |
|
|
/** | /** |
Notifies the Indication Service that a change in provider registration | Notifies the Indication Service that a change in provider registration |
has occurred. The Indication Service retrieves the subscriptions | has occurred. The Indication Service retrieves the subscriptions |
affected by the registration change, sends the appropriate enable |
affected by the registration change, sends the appropriate enable, |
and/or disable requests to the provider, and sends an alert to handler |
modify, and/or disable requests to the provider, and sends an alert to |
instances of subscriptions that are no longer served by the provider. |
handler instances of subscriptions that are no longer served by the |
|
provider. |
*/ | */ |
void _handleNotifyProviderRegistrationRequest(const Message * message); | void _handleNotifyProviderRegistrationRequest(const Message * message); |
| |
|
|
supported | supported |
| |
@return True if the instance can be created | @return True if the instance can be created |
otherwise throws an exception |
Otherwise throws an exception |
*/ | */ |
Boolean _canCreate ( | Boolean _canCreate ( |
CIMInstance & instance, | CIMInstance & instance, |
const String & nameSpace); | const String & nameSpace); |
| |
/** | /** |
Determines if the specified modification is supported. |
Determines if the user is authorized to modify the instance, and if the |
|
specified modification is supported. Currently, the only modification |
|
supported is of the Subscription State property of the Subscription |
|
class. |
| |
@param request modification request | @param request modification request |
@param instance instance to be modified | @param instance instance to be modified |
| |
@throw CIM_ERR_NOT_SUPPORTED if the specified modificastion is |
@throw CIM_ERR_NOT_SUPPORTED if the specified modification is |
not supported | not supported |
@throw CIM_ERR_ACCESS_DENIED if the user is not authorized to | @throw CIM_ERR_ACCESS_DENIED if the user is not authorized to |
modify the instance | modify the instance |
| |
@return True if the instance can be modified | @return True if the instance can be modified |
otherwise throws an exception |
Otherwise throws an exception |
*/ | */ |
Boolean _canModify ( | Boolean _canModify ( |
const CIMModifyInstanceRequestMessage * request, | const CIMModifyInstanceRequestMessage * request, |
|
|
const CIMInstance & instance); | const CIMInstance & instance); |
| |
/** | /** |
Determines if it is legal to delete an instance. Subscription |
Determines if the user is authorized to delete the instance, and if it |
instances may always be deleted. Filter and Handler instances |
is legal to delete an instance. If authorized, Subscription instances |
may only be deleted if they are not being referenced by any |
may always be deleted. Filter and non-transient Handler instances may |
Subscription instances. Authorization checks are NOT performed |
only be deleted if they are not being referenced by any Subscription |
by _canDelete. |
instances. If the instance to be deleted is a transient Handler, any |
|
referencing Subscriptions are also deleted. |
| |
@param instanceReference reference for instance to be deleted | @param instanceReference reference for instance to be deleted |
@param nameSpace namespace for instance to be deleted | @param nameSpace namespace for instance to be deleted |
|
@param currentUser current user |
|
|
|
@throw CIM_ERR_ACCESS_DENIED if the user is not authorized to |
|
delete the instance |
|
@throw CIM_ERR_FAILED if the instance to be deleted is |
|
referenced by a subscription |
| |
@return True if the instance can be deleted | @return True if the instance can be deleted |
False otherwise |
Otherwise throws an exception |
*/ | */ |
Boolean _canDelete ( | Boolean _canDelete ( |
const CIMReference & instanceReference, | const CIMReference & instanceReference, |
const String & nameSpace); |
const String & nameSpace, |
|
const String & currentUser); |
| |
/** | /** |
Retrieves list of enabled subscription instances in all namespaces. | Retrieves list of enabled subscription instances in all namespaces. |
|
|
/** | /** |
Retrieves list of enabled subscription instances in all namespaces, | Retrieves list of enabled subscription instances in all namespaces, |
where the subscription indication class matches or is a superclass | where the subscription indication class matches or is a superclass |
of the target class, and the properties required to process the |
of the supported class, and the properties required to process the |
subscription are all contained in the list of target properties. |
subscription are all contained in the list of supported properties. |
| |
@param targetClass the supported class |
@param supportedClass the supported class |
@param nameSpaces the list of supported namespaces | @param nameSpaces the list of supported namespaces |
@param targetProperties the list of supported properties |
@param supportedProperties the list of supported properties |
| |
@return list of CIMNamedInstance subscriptions | @return list of CIMNamedInstance subscriptions |
*/ | */ |
Array <CIMNamedInstance> _getMatchingSubscriptions ( | Array <CIMNamedInstance> _getMatchingSubscriptions ( |
const String & targetClass, |
const String & supportedClass, |
const Array <String> nameSpaces, | const Array <String> nameSpaces, |
const CIMPropertyList & targetProperties) const; |
const CIMPropertyList & supportedProperties); |
| |
/** | /** |
Retrieves lists of enabled subscription instances in all namespaces | Retrieves lists of enabled subscription instances in all namespaces |
that are either newly supported or previously supported, based on the | that are either newly supported or previously supported, based on the |
supported class, the supported namespaces before and after modification, | supported class, the supported namespaces before and after modification, |
and the supported properties before and after modification. For | and the supported properties before and after modification. For |
subscriptions based on the target class, the newSubscriptions list |
subscriptions based on the supported class, the newSubscriptions list |
returned contains the subscriptions for which the properties required | returned contains the subscriptions for which the properties required |
to process the subscription are all contained in the new list of | to process the subscription are all contained in the new list of |
supported properties, but are not all contained in the old list of | supported properties, but are not all contained in the old list of |
|
|
new list if supported namespaces, but is contained in the old list of | new list if supported namespaces, but is contained in the old list of |
supported namespaces. | supported namespaces. |
| |
@param targetClass the supported class |
@param supportedClass the supported class |
@param newNameSpaces namespaces supported after modification | @param newNameSpaces namespaces supported after modification |
@param oldNameSpaces namespaces supported before modification | @param oldNameSpaces namespaces supported before modification |
@param newProperties properties supported after modification | @param newProperties properties supported after modification |
|
|
subscriptions | subscriptions |
*/ | */ |
void _getModifiedSubscriptions ( | void _getModifiedSubscriptions ( |
const String & targetClass, |
const String & supportedClass, |
const Array <String> & newNameSpaces, | const Array <String> & newNameSpaces, |
const Array <String> & oldNameSpaces, | const Array <String> & oldNameSpaces, |
const CIMPropertyList & newProperties, | const CIMPropertyList & newProperties, |
|
|
/** | /** |
Determines if all of the required properties in the specified list | Determines if all of the required properties in the specified list |
are contained in the specified list of supported properties. | are contained in the specified list of supported properties. |
that are served by the specified provider. |
|
| |
@param requiredProperties the required properties | @param requiredProperties the required properties |
@param propertyList the supported properties |
@param supportedProperties the supported properties |
| |
@return true if all required properties are supported | @return true if all required properties are supported |
false otherwise | false otherwise |
*/ | */ |
Boolean _inPropertyList ( | Boolean _inPropertyList ( |
const CIMPropertyList & requiredProperties, | const CIMPropertyList & requiredProperties, |
const CIMPropertyList & propertyList); |
const CIMPropertyList & supportedProperties); |
| |
/** | /** |
Retrieves list of enabled subscription instances in all namespaces, | Retrieves list of enabled subscription instances in all namespaces, |
that are served by the specified provider. | that are served by the specified provider. |
| |
@param providerName the provider name |
@param provider the provider instance |
| |
@return list of CIMNamedInstance subscriptions | @return list of CIMNamedInstance subscriptions |
*/ | */ |
Array <CIMNamedInstance> _getProviderSubscriptions ( | Array <CIMNamedInstance> _getProviderSubscriptions ( |
const CIMReference & providerReference); |
const CIMInstance & provider); |
| |
/** | /** |
Retrieves the string value of the filter query property |
Retrieves the values of the filter query, source namespace, |
for the specified subscription instance. |
and query language properties for the specified subscription instance. |
| |
@param subscription the subscription instance |
@param subscription Input subscription instance |
@param nameSpaceName the namespace name |
@param nameSpaceName Input namespace name |
|
@param query Output query for the filter |
@return String containing the filter query |
@param sourceNameSpace Output source namespace for the filter |
|
subscription |
|
@param queryLanguage Output query language in which the filter |
|
query is expressed |
*/ | */ |
String _getFilterQuery ( |
void _getFilterProperties ( |
const CIMInstance & subscription, | const CIMInstance & subscription, |
const String & nameSpaceName) const; |
const String & nameSpaceName, |
|
String & query, |
|
String & sourceNameSpace, |
|
String & queryLanguage); |
| |
/** | /** |
Retrieves the string value of the filter source namespace property |
Retrieves the values of the filter query and source namespace |
for the specified subscription instance. |
properties for the specified subscription instance. |
| |
@param subscription the subscription instance |
@param subscription Input subscription instance |
@param nameSpaceName the namespace name |
@param nameSpaceName Input namespace name |
|
@param query Output query for the filter |
@return String containing the filter source namespace |
@param sourceNameSpace Output source namespace for the filter |
|
subscription |
*/ | */ |
String _getSourceNameSpace ( |
void _getFilterProperties ( |
const CIMInstance & subscription, | const CIMInstance & subscription, |
const String & nameSpaceName) const; |
const String & nameSpaceName, |
|
String & query, |
|
String & sourceNameSpace); |
| |
/** | /** |
Retrieves the string value of the filter query language property |
Retrieves the values of the filter query property |
for the specified subscription instance. | for the specified subscription instance. |
| |
@param subscription the subscription instance |
@param subscription Input subscription instance |
@param nameSpaceName the namespace name |
@param nameSpaceName Input namespace name |
|
@param query Output query for the filter |
@return String containing the filter query language |
|
*/ | */ |
String _getFilterQueryLanguage ( |
void _getFilterProperties ( |
const CIMInstance & subscription, | const CIMInstance & subscription, |
const String & nameSpaceName) const; |
const String & nameSpaceName, |
|
String & query); |
| |
/** | /** |
Parses the filter query string, and returns the corresponding | Parses the filter query string, and returns the corresponding |
|
|
| |
@return list of ProviderClassList structs | @return list of ProviderClassList structs |
*/ | */ |
Array <struct ProviderClassList> _getIndicationProviders ( |
Array <ProviderClassList> _getIndicationProviders ( |
const String & nameSpace, | const String & nameSpace, |
const String & indicationClassName, | const String & indicationClassName, |
const Array <String> & indicationSubclasses, | const Array <String> & indicationSubclasses, |
|
|
CIMInstance & instance); | CIMInstance & instance); |
| |
/** | /** |
Gets the parameter values required to enable the subscription request. |
Gets the parameter values required to create or modify the subscription |
|
request. |
If no indication providers are found, condition and queryLanguage are | If no indication providers are found, condition and queryLanguage are |
set to empty string. | set to empty string. |
| |
|
|
void _getEnableParams ( | void _getEnableParams ( |
const String & nameSpaceName, | const String & nameSpaceName, |
const CIMInstance & subscriptionInstance, | const CIMInstance & subscriptionInstance, |
Array <struct ProviderClassList> & indicationProviders, |
Array <ProviderClassList> & indicationProviders, |
|
CIMPropertyList & propertyList, |
|
String & condition, |
|
String & queryLanguage); |
|
|
|
/** |
|
Gets the parameter values required to create or modify the subscription |
|
request. |
|
|
|
@param nameSpace Input namespace name |
|
@param subscription Input subscription instance |
|
@param propertyList Output list of properties required by the |
|
subscription |
|
@param condition Output condition part of the filter query |
|
@param queryLanguage Output query language in which the filter |
|
query is expressed |
|
*/ |
|
void _getEnableParams ( |
|
const String & nameSpaceName, |
|
const CIMInstance & subscriptionInstance, |
CIMPropertyList & propertyList, | CIMPropertyList & propertyList, |
String & condition, | String & condition, |
String & queryLanguage); | String & queryLanguage); |
|
|
| |
@return List of providers with associated classes to disable | @return List of providers with associated classes to disable |
*/ | */ |
Array <struct ProviderClassList> _getDisableParams ( |
Array <ProviderClassList> _getDisableParams ( |
const String & nameSpaceName, | const String & nameSpaceName, |
const CIMInstance & subscriptionInstance); | const CIMInstance & subscriptionInstance); |
| |
|
|
False otherwise | False otherwise |
*/ | */ |
Boolean _sendEnableRequests ( | Boolean _sendEnableRequests ( |
const Array <struct ProviderClassList> & indicationProviders, |
const Array <ProviderClassList> & indicationProviders, |
const String & nameSpace, | const String & nameSpace, |
const CIMPropertyList & propertyList, | const CIMPropertyList & propertyList, |
const String & condition, | const String & condition, |
|
|
@param authType the authentication type | @param authType the authentication type |
*/ | */ |
void _sendModifyRequests ( | void _sendModifyRequests ( |
const Array <struct ProviderClassList> & indicationProviders, |
const Array <ProviderClassList> & indicationProviders, |
const String & nameSpace, | const String & nameSpace, |
const CIMPropertyList & propertyList, | const CIMPropertyList & propertyList, |
const String & condition, | const String & condition, |
|
|
@param authType the authentication type | @param authType the authentication type |
*/ | */ |
void _sendDisableRequests ( | void _sendDisableRequests ( |
const Array <struct ProviderClassList> & indicationProviders, |
const Array <ProviderClassList> & indicationProviders, |
const String & nameSpace, | const String & nameSpace, |
const CIMNamedInstance & subscription, | const CIMNamedInstance & subscription, |
const String & userName, | const String & userName, |
const String & authType = String::EMPTY); | const String & authType = String::EMPTY); |
| |
/** | /** |
|
Generates a unique String key from the subscription instance name and |
|
provider keys. |
|
|
|
@param subscription the subscription named instance |
|
@param provider the provider instance |
|
|
|
@return the generated key |
|
*/ |
|
String _generateKey ( |
|
const CIMNamedInstance & subscription, |
|
const CIMInstance provider); |
|
|
|
/** |
|
Inserts an entry into the subscription table. |
|
|
|
@param subscription the subscription named instance |
|
@param provider the provider instance |
|
@param classList the list of class names |
|
*/ |
|
void _insertEntry ( |
|
const CIMNamedInstance & subscription, |
|
const CIMInstance & provider, |
|
const Array <String> classList); |
|
|
|
/** |
Creates an alert instance of the specified class. | Creates an alert instance of the specified class. |
| |
@param alertClassName the alert class name | @param alertClassName the alert class name |
|
|
//Uint32 _repository; | //Uint32 _repository; |
| |
/** | /** |
|
Subscription information table |
|
*/ |
|
SubscriptionTable _subscriptionTable; |
|
|
|
/** |
Values for the Subscription State property of the Subscription class, | Values for the Subscription State property of the Subscription class, |
as defined in the CIM Events MOF | as defined in the CIM Events MOF |
*/ | */ |
|
|
static const char _CLASS_HANDLERSNMP []; | static const char _CLASS_HANDLERSNMP []; |
| |
/** | /** |
The name of the Indication class |
|
*/ |
|
static const char _CLASS_INDICATION []; |
|
|
|
/** |
|
The name of the CIMOM Shutdown alert indication class | The name of the CIMOM Shutdown alert indication class |
*/ | */ |
static const char _CLASS_CIMOM_SHUTDOWN_ALERT []; | static const char _CLASS_CIMOM_SHUTDOWN_ALERT []; |
|
|
*/ | */ |
static const char _CLASS_PROVIDER_TERMINATED_ALERT []; | static const char _CLASS_PROVIDER_TERMINATED_ALERT []; |
| |
/** |
|
The name of the Provider Capabilities class |
|
*/ |
|
static const char _CLASS_PROVIDER_CAPABILITIES []; |
|
| |
// | // |
// Property names | // Property names |
|
|
static const char _PROPERTY_PROBABLECAUSE []; | static const char _PROPERTY_PROBABLECAUSE []; |
| |
/** | /** |
The name of the Creator property for a class |
The name of the Provider Name property for Provider class |
*/ |
|
static const char _PROPERTY_CREATOR []; |
|
|
|
/** |
|
The name of the Provider Name property for Provider Capabilities class |
|
*/ |
|
static const char _PROPERTY_PROVIDER_NAME []; |
|
|
|
/** |
|
The name of the Class Name property for Provider Capabilities class |
|
*/ | */ |
static const char _PROPERTY_CLASS_NAME []; |
static const char _PROPERTY_PROVIDERNAME []; |
| |
/** | /** |
The name of the Supported Properties property for Provider Capabilities |
The name of the Provider Module Name property for Provider class |
class |
|
*/ | */ |
static const char _PROPERTY_SUPPORTED_PROPERTIES []; |
static const char _PROPERTY_PROVIDERMODULENAME []; |
| |
/** | /** |
The name of the Provider Type property for Provider Capabilities class |
The name of the Creator property for a class |
*/ | */ |
static const char _PROPERTY_PROVIDER_TYPE []; |
static const char _PROPERTY_CREATOR []; |
| |
| |
// | // |
|
|
// | // |
| |
/** | /** |
The integer representing the Indication value for the Provider Type |
|
property of the Provider Capabilities class |
|
*/ |
|
static const Uint16 _VALUE_INDICATION; |
|
|
|
/** |
|
The WHERE keyword in WQL | The WHERE keyword in WQL |
*/ | */ |
static const char _QUERY_WHERE []; | static const char _QUERY_WHERE []; |