version 1.53, 2003/12/11 17:53:45
|
version 1.54, 2004/02/13 21:32:05
|
|
|
#include <Pegasus/Common/MessageQueueService.h> | #include <Pegasus/Common/MessageQueueService.h> |
#include <Pegasus/Common/CIMMessage.h> | #include <Pegasus/Common/CIMMessage.h> |
#include <Pegasus/Common/IPC.h> | #include <Pegasus/Common/IPC.h> |
#include <Pegasus/Repository/CIMRepository.h> |
#include <Pegasus/Common/AcceptLanguages.h> // l10n |
|
#include <Pegasus/Common/ContentLanguages.h> // l10n |
#include <Pegasus/Server/ProviderRegistrationManager/ProviderRegistrationManager.h> | #include <Pegasus/Server/ProviderRegistrationManager/ProviderRegistrationManager.h> |
|
#include <Pegasus/Server/Linkage.h> |
#include <Pegasus/WQL/WQLParser.h> | #include <Pegasus/WQL/WQLParser.h> |
#include <Pegasus/WQL/WQLSelectStatement.h> | #include <Pegasus/WQL/WQLSelectStatement.h> |
#include <Pegasus/WQL/WQLSimplePropertySource.h> | #include <Pegasus/WQL/WQLSimplePropertySource.h> |
#include <Pegasus/Server/Linkage.h> |
|
#include <Pegasus/Common/AcceptLanguages.h> // l10n |
|
#include <Pegasus/Common/ContentLanguages.h> // l10n |
|
| |
#include "ProviderClassList.h" | #include "ProviderClassList.h" |
#include "IndicationOperationAggregate.h" | #include "IndicationOperationAggregate.h" |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
/** |
class SubscriptionRepository; |
Entry for ActiveSubscriptions table |
class SubscriptionTable; |
*/ |
|
struct ActiveSubscriptionsTableEntry |
|
{ |
|
CIMInstance subscription; |
|
Array <ProviderClassList> providers; |
|
}; |
|
|
|
/** |
|
Table for active subscription information |
|
|
|
The ActiveSubscriptions table is used to keep track of active subscriptions. |
|
This table contains an entry for each subscription that is enabled |
|
(value of SubscriptionState property is enabled). |
|
Each entry consists of a Subscription instance, and a list of |
|
ProviderClassList structs representing the providers, if any, currently |
|
serving each subscription and the relevant indication subclasses served by |
|
each provider. |
|
The Key is generated by concatenating the namespace name of the |
|
subscription instance, and the subscription instance key values (filter and |
|
handler key values). |
|
Entries are inserted into the table on initialization, when an enabled |
|
subscription instance is created, or when a subscription instance is |
|
modified to be enabled. |
|
Entries are removed from the table when an enabled subscription instance is |
|
deleted, or when a subscription instance is modified to be disabled. |
|
Entries are updated (remove followed by insert) when a provider serving a |
|
subscription is disabled or enabled, or a provider registration change |
|
occurs. |
|
The _handleProcessIndicationRequest() function, when a list of |
|
subscriptions is included in request, looks up each subscription in the |
|
table. |
|
The _handleNotifyProviderRegistrationRequest() function, once matching |
|
subscriptions have been identified, looks up the provider information for |
|
each matching subscription in the table. |
|
The _handleModifyInstanceRequest() and _handleDeleteInstanceRequest() |
|
functions, when sending delete requests to providers, look up the providers |
|
for the subscription in the table. |
|
The _handleNotifyProviderTerminationRequest() function, when a provider is |
|
disabled, iterates through the table to retrieve all active |
|
subscriptions being served by the provider. |
|
The terminate() function, when the CIM Server is being shut down, iterates |
|
through the table to retrieve all active subscriptions. |
|
*/ |
|
typedef HashTable <String, |
|
ActiveSubscriptionsTableEntry, |
|
EqualFunc <String>, |
|
HashFunc <String> > ActiveSubscriptionsTable; |
|
|
|
/** |
|
Entry for SubscriptionClasses table |
|
*/ |
|
struct SubscriptionClassesTableEntry |
|
{ |
|
CIMName indicationClassName; |
|
CIMNamespaceName sourceNamespaceName; |
|
Array <CIMInstance> subscriptions; |
|
}; |
|
|
|
/** |
|
Table for subscription classes information |
|
|
|
The SubscriptionClasses Table is used to keep track of active subscriptions |
|
for each indication subclass-source namespace pair. |
|
Each entry consists of an indication subclass name, a source namespace name, |
|
and a list of subscription instances. |
|
The Key is generated by concatenating the indication subclass name, and the |
|
source namespace name. |
|
The _handleProcessIndicationRequest() function, when no list of |
|
subscriptions is included in the request, looks up matching subscriptions |
|
in the table, using the class name and namespace name of the indication |
|
instance. |
|
The _handleNotifyProviderRegistrationRequest() function, when an indication |
|
provider registration instance has been created or deleted, looks up |
|
matching subscriptions in the table, using the class name and namespace |
|
names from the provider registration instance. |
|
*/ |
|
typedef HashTable <String, |
|
SubscriptionClassesTableEntry, |
|
EqualFunc <String>, |
|
HashFunc <String> > SubscriptionClassesTable; |
|
| |
/** | /** |
| |
|
|
| |
virtual void _handle_async_request(AsyncRequest *req); | virtual void _handle_async_request(AsyncRequest *req); |
| |
|
/** |
|
Gets a String containing the Provider Name, for use in a log message to |
|
identify the provider. |
|
|
|
@param provider provider instance |
|
|
|
@return String containing the Provider Name |
|
*/ |
|
static String getProviderLogString |
|
(CIMInstance & provider); |
|
|
AtomicInt dienow; | AtomicInt dienow; |
| |
/** | /** |
|
|
void _handleNotifyProviderRegistrationRequest(const Message * message); | void _handleNotifyProviderRegistrationRequest(const Message * message); |
| |
/** | /** |
Determines if the specified provider is in the list of providers |
|
serving the subscription. |
|
|
|
@param provider the provider instance |
|
@param tableValue the Active Subscriptions Table entry |
|
|
|
@return The index of the provider in the list, if found |
|
PEG_NOT_FOUND otherwise |
|
*/ |
|
Uint32 _providerInList |
|
(const CIMInstance & provider, |
|
const ActiveSubscriptionsTableEntry & tableValue); |
|
|
|
/** |
|
Determines if the specified class is in the list of indication |
|
subclasses served by the specified provider, serving the subscription. |
|
|
|
@param className the class name |
|
@param providerClasses the list of providers serving the |
|
subscription, with the classes served |
|
|
|
@return The index of the class name in the list, if found |
|
PEG_NOT_FOUND otherwise |
|
*/ |
|
Uint32 _classInList |
|
(const CIMName & className, |
|
const ProviderClassList & providerClasses); |
|
|
|
/** |
|
Notifies the Indication Service that a provider has been disabled. | Notifies the Indication Service that a provider has been disabled. |
The Indication Service retrieves the subscriptions served by the | The Indication Service retrieves the subscriptions served by the |
disabled provider, and logs a message for each subscription that is no | disabled provider, and logs a message for each subscription that is no |
|
|
void _handleNotifyProviderEnableRequest (const Message * message); | void _handleNotifyProviderEnableRequest (const Message * message); |
| |
/** | /** |
Implements the subscription's On Fatal Error Policy. |
|
This function is called when a fatal error has occurred in the |
|
indication provider or indication handler, and the subscription can no |
|
longer be served. |
|
If the subscription's policy is Disable, the Subscription State is |
|
set to Disabled. |
|
If the subscription's policy is Remove, the subscription instance is |
|
deleted. |
|
|
|
@param subscription the subscription instance |
|
|
|
@return True if the subscription has been disabled or deleted |
|
False otherwise |
|
*/ |
|
Boolean _handleError ( |
|
const CIMInstance subscription); |
|
|
|
/** |
|
Disables the subscription. |
|
This function is called when a fatal error has occurred in the |
|
indication provider or indication handler, the subscription can no |
|
longer be served, and the subscription's policy is Disable. |
|
The Subscription State is set to Disabled. |
|
|
|
@param subscription the subscription instance |
|
*/ |
|
void _disableSubscription ( |
|
CIMInstance subscription); |
|
|
|
/** |
|
Deletes the subscription instance. |
|
This function is called when a fatal error has occurred in the |
|
indication provider or indication handler, the subscription can no |
|
longer be served, and the subscription's policy is Remove. |
|
The subscription instance is deleted. |
|
|
|
@param subscription the subscription instance |
|
*/ |
|
void _deleteSubscription ( |
|
const CIMInstance subscription); |
|
|
|
/** |
|
Determines if it is legal to create an instance. | Determines if it is legal to create an instance. |
Checks for existence of all key and required properties. Checks that | Checks for existence of all key and required properties. Checks that |
properties that MUST NOT exist (based on values of other properties), | properties that MUST NOT exist (based on values of other properties), |
|
|
@throw CIM_ERR_NOT_SUPPORTED if the specified class is not | @throw CIM_ERR_NOT_SUPPORTED if the specified class is not |
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 ( |
|
|
const String & defaultValue); | const String & defaultValue); |
| |
/** | /** |
Adds an instance in the repository. Adds or sets properties as |
|
necessary. |
|
|
|
@param request the create instance request message |
|
@param instance instance to be added |
|
@param enabled indicates instance is a subscription |
|
instance and is enabled |
|
|
|
@return the CIMObjectPath for the instance |
|
*/ |
|
CIMObjectPath _createInstance ( |
|
CIMCreateInstanceRequestMessage * request, |
|
CIMInstance instance, |
|
Boolean enabled); |
|
|
|
/** |
|
Determines if the user is authorized to modify the instance, and if the | Determines if the user is authorized to modify the instance, and if the |
specified modification is supported. Currently, the only modification | specified modification is supported. Currently, the only modification |
supported is of the Subscription State property of the Subscription | supported is of the Subscription State property of the Subscription |
|
|
modify the instance | modify the instance |
@throw CIM_ERR_INVALID_PARAMETER if the modifiedInstance is invalid | @throw CIM_ERR_INVALID_PARAMETER if the modifiedInstance is invalid |
| |
@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 ( |
|
|
@throw CIM_ERR_FAILED if the instance to be deleted is | @throw CIM_ERR_FAILED if the instance to be deleted is |
referenced by a subscription | referenced by a subscription |
| |
@return True if the instance can be deleted |
@return True, if the instance can be deleted; |
Otherwise throws an exception | Otherwise throws an exception |
*/ | */ |
Boolean _canDelete ( | Boolean _canDelete ( |
|
|
const String & currentUser); | const String & currentUser); |
| |
/** | /** |
Retrieves list of enabled subscription instances in all namespaces from |
|
the repository. |
|
|
|
@param activeSubscriptions the returned subscription instances |
|
|
|
@return True if a warning was logged |
|
False otherwise |
|
*/ |
|
Boolean _getActiveSubscriptionsFromRepository ( |
|
Array <CIMInstance> & activeSubscriptions) const; |
|
|
|
/** |
|
Retrieves list of enabled subscription instances in all namespaces from |
|
the Active Subscriptions table. |
|
|
|
@return list of CIMInstance subscriptions |
|
*/ |
|
Array <CIMInstance> _getActiveSubscriptions (); |
|
|
|
/** |
|
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 supported class, and the properties required to process the | of the supported class, and the properties required to process the |
|
|
Array <CIMInstance> & formerSubscriptions); | Array <CIMInstance> & formerSubscriptions); |
| |
/** | /** |
Retrieves list of subscriptions in the specified namespace. |
|
|
|
@param nameSpace the namespace |
|
|
|
@return List of subscription instances |
|
*/ |
|
Array <CIMInstance> _getSubscriptions ( |
|
const CIMNamespaceName & nameSpaceName) const; |
|
|
|
/** |
|
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. |
| |
@param requiredProperties the required properties | @param requiredProperties the required properties |
@param supportedProperties 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 & supportedProperties); | const CIMPropertyList & supportedProperties); |
| |
/** | /** |
Retrieves list of enabled subscription instances in all namespaces, |
|
that are served by the specified provider. This function is called |
|
when a provider is disabled. In the Active Subscriptions table, the |
|
specified provider is removed from the list of providers serving the |
|
subscription. If there are no remaining providers serving the |
|
subscription, the subscription is removed from the Active Subscriptions |
|
table. |
|
|
|
@param provider the provider instance |
|
|
|
@return list of CIMInstance subscriptions |
|
*/ |
|
Array <CIMInstance> _getProviderSubscriptions ( |
|
const CIMInstance & provider); |
|
|
|
/** |
|
Determines if the specified provider is currently in use serving one or |
|
more subscriptions in the Active Subscriptions table. This function is |
|
called when a provider is added to or removed from the Active |
|
Subscriptions table, to determine if an Enable or Disable Indications |
|
request must be sent to the provider. |
|
|
|
NOTE: The caller must acquire a lock on the Active Subscriptions table |
|
before calling. |
|
|
|
@param provider the provider instance |
|
|
|
@return True if the provider is serving one or more active |
|
subscriptions |
|
False otherwise |
|
*/ |
|
Boolean _providerInUse |
|
(const CIMInstance & provider); |
|
|
|
/** |
|
Retrieves the values of the filter query, source namespace, |
|
and query language properties for the specified subscription instance. |
|
|
|
@param subscription Input subscription instance |
|
@param nameSpaceName Input namespace name |
|
@param query Output query for the filter |
|
@param sourceNameSpace Output source namespace for the filter |
|
subscription |
|
@param queryLanguage Output query language in which the filter |
|
query is expressed |
|
*/ |
|
void _getFilterProperties ( |
|
const CIMInstance & subscription, |
|
const CIMNamespaceName & nameSpaceName, |
|
String & query, |
|
CIMNamespaceName & sourceNameSpace, |
|
String & queryLanguage); |
|
|
|
/** |
|
Retrieves the values of the filter query and source namespace |
|
properties for the specified subscription instance. |
|
|
|
@param subscription Input subscription instance |
|
@param nameSpaceName Input namespace name |
|
@param query Output query for the filter |
|
@param sourceNameSpace Output source namespace for the filter |
|
subscription |
|
*/ |
|
void _getFilterProperties ( |
|
const CIMInstance & subscription, |
|
const CIMNamespaceName & nameSpaceName, |
|
String & query, |
|
CIMNamespaceName & sourceNameSpace); |
|
|
|
/** |
|
Retrieves the value of the filter query property |
|
for the specified subscription instance. |
|
|
|
@param subscription Input subscription instance |
|
@param nameSpaceName Input namespace name |
|
@param query Output query for the filter |
|
*/ |
|
void _getFilterProperties ( |
|
const CIMInstance & subscription, |
|
const CIMNamespaceName & nameSpaceName, |
|
String & query); |
|
|
|
/** |
|
Parses the filter query string, and returns the corresponding | Parses the filter query string, and returns the corresponding |
WQLSelectStatement object. | WQLSelectStatement object. |
| |
|
|
const CIMNamespaceName & nameSpaceName) const; | const CIMNamespaceName & nameSpaceName) const; |
| |
/** | /** |
Enumerates the subclass names of the specified indication class. |
|
|
|
@param nameSpace the namespace |
|
@param indicationClassName the indication class name |
|
|
|
@return List of indication subclass names |
|
*/ |
|
Array <CIMName> _getIndicationSubclasses ( |
|
const CIMNamespaceName & nameSpace, |
|
const CIMName & indicationClassName) const; |
|
|
|
/** |
|
Retrieves the list of indication providers that serve the specified | Retrieves the list of indication providers that serve the specified |
indication subclasses. | indication subclasses. |
| |
|
|
const String & filterQuery) const; | const String & filterQuery) const; |
| |
/** | /** |
Retrieves the Handler CIMInstance representing the handler of the |
|
specified subscription. |
|
|
|
@param subscription the subscription |
|
|
|
@return a Handler CIMInstance for the subscription's handler |
|
*/ |
|
CIMInstance _getHandler ( |
|
const CIMInstance & subscription) const; |
|
|
|
/** |
|
Determines if specified handler is Transient. |
|
|
|
@param nameSpace the name space |
|
@param handler the handler reference |
|
|
|
@return True if the Handler is Transient, |
|
False otherwise |
|
*/ |
|
Boolean _isTransient ( |
|
const CIMNamespaceName & nameSpace, |
|
const CIMObjectPath & handler) const; |
|
|
|
/** |
|
Deletes subscriptions referencing the specified handler. | Deletes subscriptions referencing the specified handler. |
| |
@param nameSpace the name space | @param nameSpace the name space |
|
|
| |
@param instance the subscription instance | @param instance the subscription instance |
| |
@return True if the Subscription has expired, |
@return True, if the Subscription has expired; |
False otherwise | False otherwise |
*/ | */ |
Boolean _isExpired ( | Boolean _isExpired ( |
|
|
@param instance Input the subscription instance | @param instance Input the subscription instance |
@param timeRemaining Output the time remaining (seconds) | @param timeRemaining Output the time remaining (seconds) |
| |
@return True if the subscription has a non-null Duration |
@return True, if the subscription has a non-null Duration; |
False otherwise | False otherwise |
*/ | */ |
Boolean _getTimeRemaining ( | Boolean _getTimeRemaining ( |
|
|
response is required. | response is required. |
| |
@param indicationProviders list of providers with associated classes | @param indicationProviders list of providers with associated classes |
@param nameSpace the nameSpace name of the resource been monitored. |
@param nameSpace the nameSpace name of the resource being |
This value is contained in the SourceNamespace |
monitored, from the SourceNamespace |
property of the CIM_IndicationFilter | property of the CIM_IndicationFilter |
instance for the specified subscription |
instance for the specified |
|
subscription |
@param propertyList the properties referenced by the | @param propertyList the properties referenced by the |
subscription | subscription |
@param condition the condition part of the filter query | @param condition the condition part of the filter query |
|
|
Registration Request), but no response is required. | Registration Request), but no response is required. |
| |
@param indicationProviders list of providers with associated classes | @param indicationProviders list of providers with associated classes |
@param nameSpace the nameSpace name of the resource been monitored. |
@param nameSpace the nameSpace name of the resource being |
This value is contained in the SourceNamespace |
monitored, from the SourceNamespace |
property of the CIM_IndicationFilter | property of the CIM_IndicationFilter |
instance for the specified subscription |
instance for the specified |
|
subscription |
@param propertyList the properties referenced by the | @param propertyList the properties referenced by the |
subscription | subscription |
@param condition the condition part of the filter query | @param condition the condition part of the filter query |
|
|
Request), but no response is required. | Request), but no response is required. |
| |
@param indicationProviders list of providers with associated classes | @param indicationProviders list of providers with associated classes |
@param nameSpace the nameSpace name of the resource been monitored. |
@param nameSpace the nameSpace name of the resource being |
This value is contained in the SourceNamespace |
monitored, from the SourceNamespace |
property of the CIM_IndicationFilter | property of the CIM_IndicationFilter |
instance for the specified subscription |
instance for the specified |
|
subscription |
@param subscription the subscription to be modified | @param subscription the subscription to be modified |
@param acceptLangs the language of the response | @param acceptLangs the language of the response |
@param contentLangs the language of the subscription | @param contentLangs the language of the subscription |
|
|
(IndicationOperationAggregate * operationAggregate); | (IndicationOperationAggregate * operationAggregate); |
| |
/** | /** |
Generates a unique String key for the Active Subscriptions table from |
|
the subscription namespace name and key values. |
|
|
|
@param subscription the subscription instance |
|
|
|
@return the generated key |
|
*/ |
|
String _generateActiveSubscriptionsKey ( |
|
const CIMObjectPath & subscriptionRef); |
|
|
|
/** |
|
Locks the _subscriptionClassesTableLock for read access and looks |
|
up an entry in the Active Subscriptions table. |
|
|
|
@param key the hash table key |
|
@param tableEntry the table entry retrieved |
|
|
|
@return true if the key is found in the table, false otherwise |
|
*/ |
|
Boolean _lockedLookupActiveSubscriptionsEntry ( |
|
const String & key, |
|
ActiveSubscriptionsTableEntry & tableEntry); |
|
|
|
/** |
|
Inserts an entry into the Active Subscriptions table. The caller |
|
must first lock _activeSubscriptionsTableLock for write access. |
|
|
|
@param subscription the subscription instance |
|
@param providers the list of providers |
|
*/ |
|
void _insertActiveSubscriptionsEntry ( |
|
const CIMInstance & subscription, |
|
const Array <ProviderClassList> & providers); |
|
|
|
/** |
|
Removes an entry from the Active Subscriptions table. The caller |
|
must first lock _activeSubscriptionsTableLock for write access. |
|
|
|
@param key the key of the entry to remove |
|
*/ |
|
void _removeActiveSubscriptionsEntry ( |
|
const String & key); |
|
|
|
/** |
|
Generates a unique String key for the Subscription Classes table from |
|
the indication class name and source namespace name. |
|
|
|
@param indicationClassName the indication class name |
|
@param sourceNamespaceName the source namespace name |
|
|
|
@return the generated key |
|
*/ |
|
String _generateSubscriptionClassesKey ( |
|
const CIMName & indicationClassName, |
|
const CIMNamespaceName & sourceNamespaceName); |
|
|
|
/** |
|
Locks the _subscriptionClassesTableLock for read access and looks |
|
up an entry in the Subscription Classes table. |
|
|
|
@param key the hash table key |
|
@param tableEntry the table entry retrieved |
|
|
|
@return true if the key is found in the table, false otherwise |
|
*/ |
|
Boolean _lockedLookupSubscriptionClassesEntry ( |
|
const String & key, |
|
SubscriptionClassesTableEntry & tableEntry); |
|
|
|
/** |
|
Locks the _subscriptionClassesTableLock for write access and inserts |
|
an entry into the Subscription Classes table. |
|
|
|
@param indicationClassName the indication class name |
|
@param sourceNamespaceName the source namespace name |
|
@param subscriptions the list of subscription instances |
|
*/ |
|
void _lockedInsertSubscriptionClassesEntry ( |
|
const CIMName & indicationClassName, |
|
const CIMNamespaceName & sourceNamespaceName, |
|
const Array <CIMInstance> & subscriptions); |
|
|
|
/** |
|
Locks the _subscriptionClassesTableLock for write access and removes |
|
an entry from the Subscription Classes table. |
|
|
|
@param key the key of the entry to remove |
|
*/ |
|
void _lockedRemoveSubscriptionClassesEntry ( |
|
const String & key); |
|
|
|
/** |
|
Inserts entries (or updates existing entries) in the |
|
Active Subscriptions and Subscription Classes tables. |
|
|
|
@param subscription the subscription instance |
|
@param providers the list of providers |
|
@param indicationSubclassNames the list of indication subclass names |
|
@param sourceNamespaceName the source namespace name |
|
|
|
@return list of (0 or more) providers that must be enabled |
|
*/ |
|
Array <ProviderClassList> _insertToHashTables ( |
|
const CIMInstance & subscription, |
|
const Array <ProviderClassList> & providers, |
|
const Array <CIMName> & indicationSubclassNames, |
|
const CIMNamespaceName & sourceNamespaceName); |
|
|
|
/** |
|
Updates an entry in the Active Subscriptions table to either add a |
|
provider to or remove a provider from the list of providers serving the |
|
subscription. |
|
|
|
@param subscriptionPath the subscription object path |
|
@param provider the provider |
|
@param addProvider indicates if adding or removing |
|
provider |
|
|
|
@return list of (0 or 1) provider that must be enabled or disabled |
|
*/ |
|
Array <ProviderClassList> _updateHashTable ( |
|
const CIMObjectPath & subscriptionPath, |
|
const ProviderClassList & provider, |
|
Boolean addProvider); |
|
|
|
/** |
|
Removes entries (or updates entries) in the Active Subscriptions and |
|
Subscription Classes tables. |
|
|
|
@param subscription the subscription instance |
|
@param indicationSubclassNames the list of indication subclass names |
|
@param sourceNamespaceName the source namespace name |
|
@param providers the list of providers that had been |
|
serving the subscription |
|
|
|
@return list of (0 or more) providers that must be disabled |
|
*/ |
|
Array <ProviderClassList> _removeFromHashTables ( |
|
const CIMInstance & subscription, |
|
const Array <CIMName> & indicationSubclassNames, |
|
const CIMNamespaceName & sourceNamespaceName, |
|
const Array <ProviderClassList> & providers); |
|
|
|
/** |
|
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 |
|
|
@param instance subscription instance | @param instance subscription instance |
@param creator value of Creator property if retrieved | @param creator value of Creator property if retrieved |
| |
@return True if the value of the Creator property was retrieved |
@return True, if the value of the Creator property was retrieved; |
False if Creator property was missing, null, or of an | False if Creator property was missing, null, or of an |
incorrect type. |
incorrect type |
*/ | */ |
Boolean _getCreator ( | Boolean _getCreator ( |
const CIMInstance & instance, | const CIMInstance & instance, |
String & creator) const; | String & creator) const; |
| |
/** | /** |
Gets the value of the SubscriptionState property from the specified |
Validates the specified SubscriptionState property value. |
Subscription instance. If this function returns False, the value of |
|
the state parameter is unchanged. |
|
| |
@param instance subscription instance |
@param state SubscriptionState property value |
@param state value of SubscriptionState property if |
|
retrieved |
|
| |
@return True if the value of the SubscriptionState property was |
@return True, if the SubscriptionState property value is valid; |
retrieved |
False otherwise |
False if SubscriptionState property was missing, null, of an |
|
incorrect type, or with an invalid value. |
|
*/ | */ |
Boolean _getState ( |
Boolean _validateState ( |
const CIMInstance & instance, |
const Uint16 state) const; |
Uint16 & state) const; |
|
| |
/** | /** |
This function peforms an authorization test based on the | This function peforms an authorization test based on the |
|
|
| |
@param userName String | @param userName String |
| |
@return True if authentication is not enabled or the |
@return True, if authentication is not enabled or the |
user is a privileged system user. |
user is a privileged system user; |
False if authentication is enabled and the |
False, if authentication is enabled and the |
user is not privileged. |
user is not privileged |
*/ | */ |
void _checkNonprivilegedAuthorization ( | void _checkNonprivilegedAuthorization ( |
const String & userName); | const String & userName); |
|
|
String _getSubscriptionLogString | String _getSubscriptionLogString |
(CIMInstance & subscription); | (CIMInstance & subscription); |
| |
/** |
SubscriptionRepository* _subscriptionRepository; |
Gets a String containing the Provider Name, for use in a log message to |
|
identify the provider. |
|
|
|
@param provider provider instance |
|
|
|
@return String containing the Provider Name |
|
*/ |
|
String _getProviderLogString |
|
(CIMInstance & provider); |
|
|
|
/** |
|
Determines whether two instances are the same, based on the key values. |
|
|
|
@param instance1 one instance |
|
@param instance2 the other instance |
|
@param theClass the class to which the instances belong |
|
|
|
@return True if the instances are the same |
|
False otherwise |
|
*/ |
|
Boolean _sameInstance |
|
(const CIMInstance & instance1, |
|
const CIMInstance & instance2, |
|
const CIMClass & theClass) const; |
|
| |
CIMRepository * _repository; |
SubscriptionTable * _subscriptionTable; |
| |
/** | /** |
Handle to Provider Registration Manager | Handle to Provider Registration Manager |
|
|
Uint32 _handlerService; | Uint32 _handlerService; |
| |
/** | /** |
FUTURE: Integer representing queue ID for accessing Repository Service |
|
*/ |
|
//Uint32 _repository; |
|
|
|
/** |
|
Boolean indicating that the CIM Server has been configured to | Boolean indicating that the CIM Server has been configured to |
allow non-privileged users read and write access to the | allow non-privileged users read and write access to the |
Subscription classes. | Subscription classes. |
*/ | */ |
Boolean _enableSubscriptionsForNonprivilegedUsers; | Boolean _enableSubscriptionsForNonprivilegedUsers; |
| |
/** |
|
Active Subscriptions information table. Access to this table is |
|
controlled by the _activeSubscriptionsTableLock. |
|
*/ |
|
ActiveSubscriptionsTable _activeSubscriptionsTable; |
|
/** |
|
A lock to control access to the _activeSubscriptionsTable. Before |
|
accessing the _activeSubscriptionsTable, one must first lock this for |
|
read access. Before updating the _activeSubscriptionsTable, one must |
|
first lock this for write access. |
|
*/ |
|
ReadWriteSem _activeSubscriptionsTableLock; |
|
|
|
/** |
|
Subscription Classes information table. Access to this table is |
|
controlled by the _subscriptionClassesTableLock. |
|
*/ |
|
SubscriptionClassesTable _subscriptionClassesTable; |
|
/** |
|
A lock to control access to the _subscriptionClassesTable. Before |
|
accessing the _subscriptionClassesTable, one must first lock this for |
|
read access. Before updating the _subscriptionClassesTable, one must |
|
first lock this for write access. |
|
*/ |
|
ReadWriteSem _subscriptionClassesTableLock; |
|
|
|
Array <Uint16> _validStates; | Array <Uint16> _validStates; |
Array <Uint16> _validRepeatPolicies; | Array <Uint16> _validRepeatPolicies; |
Array <Uint16> _validErrorPolicies; | Array <Uint16> _validErrorPolicies; |
Array <Uint16> _validPersistenceTypes; | Array <Uint16> _validPersistenceTypes; |
|
|
/** |
|
Values for the Subscription State property of the Subscription class, |
|
as defined in the CIM Events MOF |
|
*/ |
|
enum SubscriptionState {_STATE_UNKNOWN = 0, _STATE_OTHER = 1, |
|
_STATE_ENABLED = 2, _STATE_ENABLEDDEGRADED = 3, _STATE_DISABLED = 4}; |
|
|
|
/** |
|
Values for the Repeat Notification Policy property of the Subscription |
|
class, as defined in the CIM Events MOF |
|
*/ |
|
enum RepeatNotificationPolicy {_POLICY_UNKNOWN = 0, _POLICY_OTHER = 1, |
|
_POLICY_NONE = 2, _POLICY_SUPPRESS = 3, _POLICY_DELAY = 4}; |
|
|
|
/** |
|
Values for the On Fatal Error Policy property of the Subscription |
|
class, as defined in the CIM Events MOF |
|
*/ |
|
enum OnFatalErrorPolicy {_ERRORPOLICY_OTHER = 1, _ERRORPOLICY_IGNORE = 2, |
|
_ERRORPOLICY_DISABLE = 3, _ERRORPOLICY_REMOVE = 4}; |
|
|
|
/** |
|
Values for the Persistence Type property of the Handler class, |
|
as defined in the CIM Events MOF |
|
*/ |
|
enum PersistenceType {_PERSISTENCE_OTHER = 1, _PERSISTENCE_PERMANENT = 2, |
|
_PERSISTENCE_TRANSIENT = 3}; |
|
|
|
/** |
|
Values for the Perceived Severity property of the Alert Indication |
|
class, as defined in the CIM Events MOF |
|
*/ |
|
enum PerceivedSeverity {_SEVERITY_UNKNOWN = 0, _SEVERITY_OTHER = 1, |
|
_SEVERITY_INFORMATION = 2, _SEVERITY_WARNING = 3, _SEVERITY_MINOR = 4, |
|
_SEVERITY_MAJOR = 5, _SEVERITY_CRITICAL = 6, _SEVERITY_FATAL = 7}; |
|
|
|
/** |
|
Values for the Probable Cause property of the Alert Indication |
|
class, as defined in the CIM Events MOF |
|
Note: not all possible values have been included |
|
*/ |
|
enum ProbableCause {_CAUSE_UNKNOWN = 0, _CAUSE_OTHER = 1}; |
|
|
|
/** |
|
Values for the Alert Type property of the Alert Indication class, |
|
as defined in the CIM Events MOF |
|
*/ |
|
enum AlertType {_TYPE_OTHER = 1, _TYPE_COMMUNICATIONS = 2, _TYPE_QOS = 3, |
|
_TYPE_PROCESSING = 4, _TYPE_DEVICE = 5, _TYPE_ENVIRONMENTAL = 6, |
|
_TYPE_MODELCHANGE = 7, _TYPE_SECURITY = 8}; |
|
|
|
// |
|
// Class names |
|
// |
|
|
|
/** |
|
The name of the CIMOM Shutdown alert indication class |
|
*/ |
|
static const CIMName _CLASS_CIMOM_SHUTDOWN_ALERT; |
|
|
|
/** |
|
The name of the No Provider alert indication class |
|
*/ |
|
static const CIMName _CLASS_NO_PROVIDER_ALERT; |
|
|
|
/** |
|
The name of the CIMOM shutdown alert indication class |
|
*/ |
|
static const CIMName _CLASS_PROVIDER_TERMINATED_ALERT; |
|
|
|
|
|
// |
|
// Property names |
|
// |
|
|
|
/** |
|
The name of the Subscription State property for Indication Subscription |
|
class |
|
*/ |
|
static const CIMName _PROPERTY_STATE; |
|
|
|
/** |
|
The name of the Other Subscription State property for Indication |
|
Subscription class |
|
*/ |
|
static const CIMName _PROPERTY_OTHERSTATE; |
|
|
|
/** |
|
The name of the repeat notification policy property for indication |
|
subscription class |
|
*/ |
|
static const CIMName _PROPERTY_REPEATNOTIFICATIONPOLICY; |
|
|
|
/** |
|
The name of the other repeat notification policy property for |
|
indication subscription class |
|
*/ |
|
static const CIMName _PROPERTY_OTHERREPEATNOTIFICATIONPOLICY; |
|
|
|
/** |
|
The name of the repeat notification interval property for indication |
|
subscription class |
|
*/ |
|
static const CIMName _PROPERTY_REPEATNOTIFICATIONINTERVAL; |
|
|
|
/** |
|
The name of the repeat notification gap property for indication |
|
subscription class |
|
*/ |
|
static const CIMName _PROPERTY_REPEATNOTIFICATIONGAP; |
|
|
|
/** |
|
The name of the repeat notification count property for indication |
|
subscription class |
|
*/ |
|
static const CIMName _PROPERTY_REPEATNOTIFICATIONCOUNT; |
|
|
|
/** |
|
The name of the On Fatal Error Policy property for Indication |
|
Subscription class |
|
*/ |
|
static const CIMName _PROPERTY_ONFATALERRORPOLICY; |
|
|
|
/** |
|
The name of the Other On Fatal Error Policy property for Indication |
|
Subscription class |
|
*/ |
|
static const CIMName _PROPERTY_OTHERONFATALERRORPOLICY; |
|
|
|
/** |
|
The name of the Time Of Last State Change property for Indication |
|
Subscription class |
|
*/ |
|
static const CIMName _PROPERTY_LASTCHANGE; |
|
|
|
/** |
|
The name of the Subscription Start Time property for Indication |
|
Subscription class |
|
*/ |
|
static const CIMName _PROPERTY_STARTTIME; |
|
|
|
/** |
|
The name of the Subscription Duration property for Indication |
|
Subscription class |
|
*/ |
|
static const CIMName _PROPERTY_DURATION; |
|
|
|
/** |
|
The name of the Subscription Time Remaining property for Indication |
|
Subscription class |
|
*/ |
|
static const CIMName _PROPERTY_TIMEREMAINING; |
|
|
|
/** |
|
The name of the filter reference property for indication subscription |
|
class |
|
*/ |
|
static const CIMName _PROPERTY_FILTER; |
|
|
|
/** |
|
The name of the handler reference property for indication subscription |
|
class |
|
*/ |
|
static const CIMName _PROPERTY_HANDLER; |
|
|
|
/** |
|
The name of the query property for indication filter class |
|
*/ |
|
static const CIMName _PROPERTY_QUERY; |
|
|
|
/** |
|
The name of the query language property for indication filter class |
|
*/ |
|
static const CIMName _PROPERTY_QUERYLANGUAGE; |
|
|
|
/** |
|
The name of the Source Namespace property for indication filter class |
|
*/ |
|
static const CIMName _PROPERTY_SOURCENAMESPACE; |
|
|
|
/** |
|
The name of the name property for indication filter and indication |
|
handler classes |
|
*/ |
|
static const CIMName _PROPERTY_NAME; |
|
|
|
/** |
|
The name of the creation class name property for indication filter and |
|
indication handler classes |
|
*/ |
|
static const CIMName _PROPERTY_CREATIONCLASSNAME; |
|
|
|
/** |
|
The name of the system name property for indication filter and |
|
indication handler classes |
|
*/ |
|
static const CIMName _PROPERTY_SYSTEMNAME; |
|
|
|
/** |
|
The name of the system creation class name property for indication |
|
filter and indication handler classes |
|
*/ |
|
static const CIMName _PROPERTY_SYSTEMCREATIONCLASSNAME; |
|
|
|
/** |
|
The name of the Persistence Type property for Indication Handler class |
|
*/ |
|
static const CIMName _PROPERTY_PERSISTENCETYPE; |
|
|
|
/** |
|
The name of the Other Persistence Type property for Indication Handler |
|
class |
|
*/ |
|
static const CIMName _PROPERTY_OTHERPERSISTENCETYPE; |
|
|
|
/** |
|
The name of the Destination property for CIM XML Indication Handler |
|
subclass |
|
*/ |
|
static const CIMName _PROPERTY_DESTINATION; |
|
|
|
/** |
|
The name of the TargetHost property for SNMP Mapper Indication |
|
Handler subclass |
|
*/ |
|
static const CIMName _PROPERTY_TARGETHOST; |
|
|
|
/** |
|
The name of the TargetHostFormat property for SNMP Indication Handler subclass |
|
*/ |
|
static const CIMName _PROPERTY_TARGETHOSTFORMAT; |
|
|
|
/** |
|
The name of the SNMP Version property for SNMP Indication Handler subclass |
|
*/ |
|
static const CIMName _PROPERTY_SNMPVERSION; |
|
|
|
/** |
|
The name of the Alert Type property for Alert Indication class |
|
*/ |
|
static const CIMName _PROPERTY_ALERTTYPE; |
|
|
|
/** |
|
The name of the Other Alert Type property for Alert Indication class |
|
*/ |
|
static const CIMName _PROPERTY_OTHERALERTTYPE; |
|
|
|
/** |
|
The name of the Perceived Severity property for Alert Indication class |
|
*/ |
|
static const CIMName _PROPERTY_PERCEIVEDSEVERITY; |
|
|
|
/** |
|
The name of the Probable Cause property for Alert Indication class |
|
*/ |
|
static const CIMName _PROPERTY_PROBABLECAUSE; |
|
|
|
/** |
|
The name of the Provider Name property for Provider class |
|
*/ |
|
static const CIMName _PROPERTY_PROVIDERNAME; |
|
|
|
/** |
|
The name of the Provider Module Name property for Provider class |
|
*/ |
|
static const CIMName _PROPERTY_PROVIDERMODULENAME; |
|
|
|
|
|
// |
|
// Qualifier names |
|
// |
|
|
|
/** |
|
The name of the Indication qualifier for classes |
|
*/ |
|
static const CIMName _QUALIFIER_INDICATION; |
|
|
|
|
|
// |
|
// Other literal values |
|
// |
|
|
|
/** |
|
The WHERE keyword in WQL |
|
*/ |
|
static const char _QUERY_WHERE []; |
|
|
|
/** |
|
The string representing the asterisk all properties symbol in WQL |
|
*/ |
|
static const char _QUERY_ALLPROPERTIES []; |
|
|
|
/** |
|
A zero value CIMDateTime interval |
|
*/ |
|
static const char _ZERO_INTERVAL_STRING []; |
|
|
|
|
|
// |
|
// Message substrings used in exception messages |
|
// |
|
|
|
// l10n |
|
|
|
// this one is tricky because it is used in _checkRequiredProperty with the two below |
|
static const char _MSG_MISSING_REQUIRED []; |
|
|
|
static const char _MSG_KEY_PROPERTY []; |
|
static const char _MSG_KEY_PROPERTY_KEY []; |
|
|
|
static const char _MSG_PROPERTY []; |
|
static const char _MSG_PROPERTY_KEY []; |
|
|
|
static const char _MSG_PROPERTY_PRESENT []; |
|
static const char _MSG_VALUE_NOT []; |
|
static const char _MSG_PROPERTY_PRESENT_BUT_VALUE_NOT_KEY []; |
|
|
|
static const char _MSG_NO_PROVIDERS []; |
|
static const char _MSG_NO_PROVIDERS_KEY[]; |
|
|
|
static const char _MSG_NOT_ACCEPTED []; |
|
static const char _MSG_NOT_ACCEPTED_KEY []; |
|
|
|
static const char _MSG_INVALID_CLASSNAME []; |
|
|
|
static const char _MSG_IN_FROM []; |
|
|
|
static const char _MSG_INVALID_CLASSNAME_IN_FROM_PROPERTY_KEY []; |
|
|
|
static const char _MSG_EXPIRED []; |
|
static const char _MSG_EXPIRED_KEY []; |
|
|
|
static const char _MSG_REFERENCED []; |
|
static const char _MSG_REFERENCED_KEY []; |
|
|
|
static const char _MSG_INVALID_VALUE []; |
|
|
|
static const char _MSG_INVALID_TYPE []; |
|
|
|
static const char _MSG_FOR_PROPERTY []; |
|
|
|
static const char _MSG_ARRAY_OF []; |
|
|
|
static const char _MSG_INVALID_VALUE_FOR_PROPERTY_KEY []; |
|
|
|
static const char _MSG_CLASS_NOT_SERVED []; |
|
|
|
static const char _MSG_CLASS_NOT_SERVED_KEY []; |
|
|
|
static const char _MSG_INVALID_INSTANCES []; |
|
|
|
static const char _MSG_INVALID_INSTANCES_KEY []; |
|
|
|
static const char _MSG_PROVIDER_NO_LONGER_SERVING []; |
|
|
|
static const char _MSG_PROVIDER_NO_LONGER_SERVING_KEY []; |
|
|
|
static const char _MSG_PROVIDER_NOW_SERVING []; |
|
|
|
static const char _MSG_PROVIDER_NOW_SERVING_KEY []; |
|
|
|
static const char _MSG_NO_PROVIDER []; |
|
|
|
static const char _MSG_NO_PROVIDER_KEY []; |
|
|
|
static const char _MSG_NON_PRIVILEGED_ACCESS_DISABLED []; |
|
|
|
static const char _MSG_NON_PRIVILEGED_ACCESS_DISABLED_KEY []; |
|
}; | }; |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |