(file) Return to IndicationService.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / IndicationService

   1 kumpf 1.1 //%//////-*-c++-*-//////////////////////////////////////////////////////////////
   2           //
   3           // Copyright (c) 2000, 2001 BMC Software, Hewlett-Packard Company, IBM,
   4           // The Open Group, Tivoli Systems
   5           //
   6           // Permission is hereby granted, free of charge, to any person obtaining a copy
   7           // of this software and associated documentation files (the "Software"), to
   8           // deal in the Software without restriction, including without limitation the
   9           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  10           // sell copies of the Software, and to permit persons to whom the Software is
  11           // furnished to do so, subject to the following conditions:
  12           //
  13           // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
  14           // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
  15           // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
  16           // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  17           // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  18           // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  19           // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  20           // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21           //
  22 kumpf 1.1 //==============================================================================
  23           //
  24           // Author: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
  25           //
  26           // Modified By:  Carol Ann Krug Graves, Hewlett-Packard Company
  27           //               (carolann_graves@hp.com)
  28           //
  29           // Modified By:  Ben Heilbronn, Hewlett-Packard Company
  30           //               (ben_heilbronn@hp.com)
  31           //
  32           //%/////////////////////////////////////////////////////////////////////////////
  33           
  34           #ifndef Pegasus_IndicationService_h
  35           #define Pegasus_IndicationService_h
  36           
  37           #include <Pegasus/Common/Config.h>
  38           #include <Pegasus/Common/MessageQueueService.h>
  39           #include <Pegasus/Common/CIMMessage.h>
  40           #include <Pegasus/Repository/CIMRepository.h>
  41 kumpf 1.6 #include <Pegasus/Server/ProviderRegistrationManager/ProviderRegistrationManager.h>
  42 kumpf 1.1 #include <Pegasus/WQL/WQLParser.h>
  43           #include <Pegasus/WQL/WQLSelectStatement.h>
  44           #include <Pegasus/WQL/WQLSimplePropertySource.h>
  45           
  46           PEGASUS_NAMESPACE_BEGIN
  47           
  48 kumpf 1.10 /**
  49                Entry for list of indication providers
  50             */
  51            struct providerClassList
  52 kumpf 1.1  {
  53 kumpf 1.6      CIMInstance provider;
  54                CIMInstance providerModule;
  55 kumpf 1.1      Array <String> classList;
  56            };
  57 kumpf 1.10 typedef struct providerClassList ProviderClassList;
  58            
  59            /**
  60                Entry for Subscription table
  61             */
  62            struct SubscriptionTableEntry
  63            {
  64                CIMNamedInstance subscription;
  65                CIMInstance provider;
  66                Array <String> classList;
  67            };
  68 kumpf 1.1  
  69 kumpf 1.10 /**
  70                Table for subscription information.
  71                The table keys are generated by concatenating the Subscription namespace 
  72                name, Filter and Handler key values, and Provider key values.  Each table 
  73                value includes the Subscription, the Provider, and the list of classnames.
  74                The key allows quick access when the subscription and provider are both 
  75                known (i.e. initialize, instance operations, provider registration changes).
  76                When only the provider is known (i.e. provider termination), an iterator is
  77                used to search the table.  That is, the table is designed to optimize all 
  78                operations except provider termination.
  79             */
  80            typedef HashTable <String, 
  81                               SubscriptionTableEntry, 
  82                               EqualFunc <String>, 
  83                               HashFunc <String> > SubscriptionTable;
  84 kumpf 1.1  
  85            /**
  86            
  87 kumpf 1.5      IndicationService class is the service that serves the
  88 kumpf 1.10     Indication Subscription, Indication Filter, and Indication Handler
  89 kumpf 1.5      classes, and processes indications.
  90 kumpf 1.1  
  91                @author  Hewlett-Packard Company
  92            
  93             */
  94            
  95            class PEGASUS_SERVER_LINKAGE IndicationService : public MessageQueueService
  96            {
  97            public:
  98            
  99                typedef MessageQueueService Base;
 100            
 101                /**
 102                    Constructs an IndicationSubscription instance and initializes instance
 103                    variables.
 104                 */
 105 kumpf 1.6      IndicationService (
 106                    CIMRepository * repository,
 107 kumpf 1.8          ProviderRegistrationManager * providerRegManager);
 108 kumpf 1.1  
 109                virtual ~IndicationService(void);
 110            
 111 mday  1.2      void handleEnqueue(Message* message);
 112 kumpf 1.1  
 113                virtual void handleEnqueue(void); 
 114            
 115                virtual void _handle_async_request(AsyncRequest *req);
 116            
 117                AtomicInt dienow;
 118            
 119                /**
 120 kumpf 1.5          Operation types for the NotifyProviderRegistration message
 121 kumpf 1.1       */
 122 kumpf 1.5      enum Operation {OP_CREATE = 1, OP_DELETE = 2, OP_MODIFY = 3};
 123 kumpf 1.1  
 124 kumpf 1.5  private:
 125 kumpf 1.1  
 126                void _initialize (void);
 127            
 128                void _terminate (void);
 129            
 130                void _handleGetInstanceRequest(const Message * message);
 131            
 132                void _handleEnumerateInstancesRequest(const Message * message);
 133            
 134                void _handleEnumerateInstanceNamesRequest(const Message * message);
 135            
 136                void _handleCreateInstanceRequest(const Message * message);
 137            
 138                void _handleModifyInstanceRequest(const Message * message);
 139            
 140                void _handleDeleteInstanceRequest(const Message * message);
 141            
 142                void _handleProcessIndicationRequest(const Message * message);
 143            
 144                /**
 145            	Notifies the Indication Service that a change in provider registration
 146 kumpf 1.1  	has occurred.  The Indication Service retrieves the subscriptions
 147 kumpf 1.10 	affected by the registration change, sends the appropriate enable,
 148                    modify, and/or disable requests to the provider, and sends an alert to 
 149                    handler instances of subscriptions that are no longer served by the 
 150                    provider.
 151 kumpf 1.1      */
 152                void _handleNotifyProviderRegistrationRequest(const Message * message);
 153            
 154                /**
 155 kumpf 1.11         Notifies the Indication Service that a provider has
 156                    terminated (either intentionally or abnormally).  The 
 157                    Indication Service retrieves the subscriptions affected by the
 158 kumpf 1.1          termination, and sends an alert to handler instances of
 159                    subscriptions that are no longer served by the provider.
 160                 */
 161                void _handleNotifyProviderTerminationRequest(const Message * message);
 162            
 163                /**
 164 kumpf 1.12         Implements the subscription's On Fatal Error Policy.
 165                    This function is called when a fatal error has occurred in the
 166                    indication provider or indication handler, and the subscription can no
 167                    longer be served.
 168                    If the subscription's policy is Disable, the Subscription State is
 169                    set to Disabled.
 170                    If the subscription's policy is Remove, the subscription instance is 
 171                    deleted.
 172            
 173                    @param   subscription          the subscription named instance
 174            
 175                    @return  True if the subscription has been disabled or deleted
 176                             False otherwise
 177                 */
 178                Boolean _handleError (
 179                    const CIMNamedInstance subscription);
 180            
 181                /**
 182                    Disables the subscription.
 183                    This function is called when a fatal error has occurred in the
 184                    indication provider or indication handler, the subscription can no
 185 kumpf 1.12         longer be served, and the subscription's policy is Disable.
 186                    The Subscription State is set to Disabled.
 187            
 188                    @param   subscription          the subscription named instance
 189                 */
 190                void _disableSubscription (
 191                    CIMNamedInstance subscription);
 192            
 193                /**
 194                    Deletes the subscription instance.
 195                    This function is called when a fatal error has occurred in the
 196                    indication provider or indication handler, the subscription can no
 197                    longer be served, and the subscription's policy is Remove.
 198                    The subscription instance is deleted.
 199            
 200                    @param   subscription          the subscription named instance
 201                 */
 202                void _deleteSubscription (
 203                    const CIMNamedInstance subscription);
 204            
 205                /**
 206 kumpf 1.5          Ensures that all subscription classes in the repository include the
 207                    Creator property.
 208            
 209                    @throw   CIMException               if any error except 
 210                                                        CIM_ERR_INVALID_CLASS occurs
 211                 */
 212                void _checkClasses (void);
 213            
 214                /**
 215                    Determines if it is legal to create an instance. 
 216                    Checks for existence of all key and required properties.  Checks that 
 217                    properties that MUST NOT exist (based on values of other properties), 
 218                    do not exist.  For any property that has a default value, if it does 
 219                    not exist, adds the property with the default value.
 220            
 221                    @param   instance              instance to be created
 222                    @param   nameSpace             namespace for instance to be created
 223            
 224                    @throw   CIM_ERR_INVALID_PARAMETER  if instance is invalid
 225                    @throw   CIM_ERR_NOT_SUPPORTED      if the specified class is not 
 226                                                        supported
 227 kumpf 1.5  
 228                    @return  True if the instance can be created
 229 kumpf 1.10                  Otherwise throws an exception
 230 kumpf 1.5       */
 231                Boolean _canCreate (
 232                    CIMInstance & instance,
 233                    const String & nameSpace);
 234            
 235                /**
 236 kumpf 1.10         Determines if the user is authorized to modify the instance, and if the
 237                    specified modification is supported.  Currently, the only modification 
 238                    supported is of the Subscription State property of the Subscription 
 239                    class.
 240 kumpf 1.5  
 241                    @param   request               modification request
 242                    @param   instance              instance to be modified
 243            
 244 kumpf 1.10         @throw   CIM_ERR_NOT_SUPPORTED      if the specified modification is 
 245 kumpf 1.5                                              not supported
 246                    @throw   CIM_ERR_ACCESS_DENIED      if the user is not authorized to
 247                                                        modify the instance
 248            
 249                    @return  True if the instance can be modified
 250 kumpf 1.10                  Otherwise throws an exception
 251 kumpf 1.5       */
 252                Boolean _canModify (
 253                    const CIMModifyInstanceRequestMessage * request,
 254                    const CIMReference & instanceReference,
 255                    const CIMInstance & instance);
 256            
 257                /**
 258 kumpf 1.10         Determines if the user is authorized to delete the instance, and if it 
 259 kumpf 1.11         is legal to delete the instance.  If authorized, Subscription instances 
 260 kumpf 1.10         may always be deleted.  Filter and non-transient Handler instances may 
 261                    only be deleted if they are not being referenced by any Subscription 
 262                    instances. If the instance to be deleted is a transient Handler, any 
 263                    referencing Subscriptions are also deleted.
 264 kumpf 1.5  
 265                    @param   instanceReference     reference for instance to be deleted
 266                    @param   nameSpace             namespace for instance to be deleted
 267 kumpf 1.10         @param   currentUser           current user
 268            
 269                    @throw   CIM_ERR_ACCESS_DENIED      if the user is not authorized to
 270                                                        delete the instance
 271                    @throw   CIM_ERR_FAILED             if the instance to be deleted is 
 272                                                        referenced by a subscription
 273 kumpf 1.5  
 274                    @return  True if the instance can be deleted
 275 kumpf 1.10                  Otherwise throws an exception
 276 kumpf 1.1       */
 277                Boolean _canDelete (
 278                    const CIMReference & instanceReference,
 279 kumpf 1.10         const String & nameSpace,
 280                    const String & currentUser);
 281 kumpf 1.1  
 282                /**
 283                    Retrieves list of enabled subscription instances in all namespaces.
 284            
 285 kumpf 1.7          @return   list of CIMNamedInstance subscriptions
 286 kumpf 1.1       */
 287 kumpf 1.7      Array <CIMNamedInstance> _getActiveSubscriptions () const;
 288 kumpf 1.1  
 289                /**
 290                    Retrieves list of enabled subscription instances in all namespaces,
 291                    where the subscription indication class matches or is a superclass
 292 kumpf 1.10         of the supported class, and the properties required to process the
 293                    subscription are all contained in the list of supported properties.
 294 kumpf 1.1  
 295 kumpf 1.10         @param   supportedClass       the supported class
 296                    @param   nameSpaces           the list of supported namespaces
 297                    @param   supportedProperties  the list of supported properties
 298 kumpf 1.1  
 299 kumpf 1.7          @return   list of CIMNamedInstance subscriptions
 300 kumpf 1.1       */
 301 kumpf 1.7      Array <CIMNamedInstance> _getMatchingSubscriptions (
 302 kumpf 1.10         const String & supportedClass,
 303 kumpf 1.9          const Array <String> nameSpaces,
 304 kumpf 1.10         const CIMPropertyList & supportedProperties);
 305 kumpf 1.1  
 306                /**
 307                    Retrieves lists of enabled subscription instances in all namespaces
 308                    that are either newly supported or previously supported, based on the
 309 kumpf 1.9          supported class, the supported namespaces before and after modification,
 310                    and the supported properties before and after modification.  For 
 311 kumpf 1.10         subscriptions based on the supported class, the newSubscriptions list 
 312 kumpf 1.9          returned contains the subscriptions for which the properties required 
 313                    to process the subscription are all contained in the new list of 
 314                    supported properties, but are not all contained in the old list of 
 315                    supported properties, and/or the filter source namespace is contained in
 316                    the new list if supported namespaces, but is not contained in the old 
 317                    list of supported namespaces.  The formerSubscriptions list returned 
 318                    contains the subscriptions for which the properties required to process
 319                    the subscription are not all contained in the new list of supported 
 320                    properties, but are all contained in the old list of supported 
 321                    properties, and/or the filter source namespace is not contained in the 
 322                    new list if supported namespaces, but is contained in the old list of 
 323                    supported namespaces.
 324            
 325 kumpf 1.10         @param   supportedClass       the supported class
 326 kumpf 1.9          @param   newNameSpaces        namespaces supported after modification
 327                    @param   oldNameSpaces        namespaces supported before modification
 328                    @param   newProperties        properties supported after modification
 329                    @param   oldProperties        properties supported before modification
 330 kumpf 1.1          @param   newSubscriptions     the list of newly supported subscriptions
 331                    @param   formerSubscriptions  the list of previously supported
 332                                                      subscriptions
 333                 */
 334                void _getModifiedSubscriptions (
 335 kumpf 1.10         const String & supportedClass,
 336 kumpf 1.9          const Array <String> & newNameSpaces,
 337                    const Array <String> & oldNameSpaces,
 338 kumpf 1.1          const CIMPropertyList & newProperties,
 339                    const CIMPropertyList & oldProperties,
 340 kumpf 1.7          Array <CIMNamedInstance> & newSubscriptions,
 341                    Array <CIMNamedInstance> & formerSubscriptions);
 342 kumpf 1.1  
 343                /**
 344 kumpf 1.9          Determines if all of the required properties in the specified list
 345                    are contained in the specified list of supported properties.
 346            
 347                    @param   requiredProperties  the required properties
 348 kumpf 1.10         @param   supportedProperties the supported properties
 349 kumpf 1.9  
 350                    @return   true if all required properties are supported
 351                              false otherwise
 352                 */
 353                Boolean _inPropertyList (
 354                    const CIMPropertyList & requiredProperties,
 355 kumpf 1.10         const CIMPropertyList & supportedProperties);
 356 kumpf 1.9  
 357                /**
 358 kumpf 1.1          Retrieves list of enabled subscription instances in all namespaces,
 359                    that are served by the specified provider.
 360            
 361 kumpf 1.10         @param   provider          the provider instance
 362 kumpf 1.1  
 363 kumpf 1.7          @return   list of CIMNamedInstance subscriptions
 364 kumpf 1.1       */
 365 kumpf 1.7      Array <CIMNamedInstance> _getProviderSubscriptions (
 366 kumpf 1.10         const CIMInstance & provider);
 367 kumpf 1.1  
 368                /**
 369 kumpf 1.10         Retrieves the values of the filter query, source namespace,
 370                    and query language properties for the specified subscription instance.
 371 kumpf 1.1  
 372 kumpf 1.10         @param   subscription      Input subscription instance
 373                    @param   nameSpaceName     Input namespace name
 374                    @param   query             Output query for the filter
 375                    @param   sourceNameSpace   Output source namespace for the filter
 376                                                   subscription
 377                    @param   queryLanguage     Output query language in which the filter
 378                                                   query is expressed
 379 kumpf 1.1       */
 380 kumpf 1.10     void _getFilterProperties (
 381 kumpf 1.1          const CIMInstance & subscription,
 382 kumpf 1.10         const String & nameSpaceName,
 383                    String & query,
 384                    String & sourceNameSpace,
 385                    String & queryLanguage);
 386 kumpf 1.1  
 387                /**
 388 kumpf 1.10         Retrieves the values of the filter query and source namespace
 389                    properties for the specified subscription instance.
 390 kumpf 1.8  
 391 kumpf 1.10         @param   subscription      Input subscription instance
 392                    @param   nameSpaceName     Input namespace name
 393                    @param   query             Output query for the filter
 394                    @param   sourceNameSpace   Output source namespace for the filter
 395                                                   subscription
 396 kumpf 1.8       */
 397 kumpf 1.10     void _getFilterProperties (
 398 kumpf 1.8          const CIMInstance & subscription,
 399 kumpf 1.10         const String & nameSpaceName,
 400                    String & query,
 401                    String & sourceNameSpace);
 402 kumpf 1.8  
 403                /**
 404 kumpf 1.10         Retrieves the values of the filter query property 
 405 kumpf 1.1          for the specified subscription instance.
 406            
 407 kumpf 1.10         @param   subscription      Input subscription instance
 408                    @param   nameSpaceName     Input namespace name
 409                    @param   query             Output query for the filter
 410 kumpf 1.1       */
 411 kumpf 1.10     void _getFilterProperties (
 412 kumpf 1.1          const CIMInstance & subscription,
 413 kumpf 1.10         const String & nameSpaceName,
 414                    String & query);
 415 kumpf 1.1  
 416                /**
 417                    Parses the filter query string, and returns the corresponding
 418                    WQLSelectStatement object.
 419            
 420                    @param   filterQuery           the filter query string
 421            
 422                    @return  WQLSelectStatement representing the filter query
 423                 */
 424                WQLSelectStatement _getSelectStatement (
 425                    const String & filterQuery) const;
 426            
 427                /**
 428                    Extracts the indication class name from the specified WQL select
 429                    statement, and validates that the name represents a subclass of the
 430                    Indication class.
 431            
 432                    @param   selectStatement       the WQL select statement
 433                    @param   nameSpaceName         the namespace
 434            
 435                    @return  String containing the indication class name
 436 kumpf 1.1       */
 437                String _getIndicationClassName (
 438                    const WQLSelectStatement & selectStatement,
 439                    const String & nameSpaceName) const;
 440            
 441                /**
 442                    Retrieves the list of indication providers that serve the specified
 443                    indication subclasses.
 444            
 445                    @param   nameSpaceName         the namespace name
 446                    @param   indicationClassName   the indication class name
 447                    @param   indicationSubclasses  the list of indication subclass names
 448                    @param   requiredPropertyList  the properties required
 449            
 450                    @return  list of ProviderClassList structs
 451                 */
 452 kumpf 1.10     Array <ProviderClassList> _getIndicationProviders (
 453 kumpf 1.1          const String & nameSpace,
 454                    const String & indicationClassName,
 455                    const Array <String> & indicationSubclasses,
 456                    const CIMPropertyList & requiredPropertyList) const;
 457            
 458                /**
 459                    Retrieves the list of properties referenced by the specified
 460                    filter query select statement.
 461            
 462                    @param   selectStatement       the WQL select statement
 463            
 464                    @return  list of properties referenced by the filter query select
 465                             statement
 466                 */
 467                CIMPropertyList _getPropertyList (
 468 kumpf 1.11         const WQLSelectStatement & selectStatement,
 469                    const String & nameSpaceName,
 470                    const String & indicationClassName) const;
 471 kumpf 1.1  
 472                /**
 473                    Extracts the condition (WHERE Clause) from the specified filter query
 474                    string.
 475            
 476                    @param   filterQuery       the filter query
 477            
 478                    @return  String containing the filter query condition
 479                 */
 480                String _getCondition (
 481                    const String & filterQuery) const;
 482            
 483                /**
 484 kumpf 1.7          Retrieves the Handler CIMNamedInstance representing the handler of the
 485 kumpf 1.1          specified subscription.
 486            
 487 kumpf 1.7          @param   subscription          the subscription
 488 kumpf 1.1  
 489 kumpf 1.7          @return  a Handler CIMNamedInstance for the subscription's handler
 490 kumpf 1.1       */
 491 kumpf 1.7      CIMNamedInstance _getHandler (
 492                    const CIMNamedInstance & subscription) const;
 493 kumpf 1.1  
 494                /**
 495 kumpf 1.4          Determines if specified handler is Transient.
 496            
 497                    @param   nameSpace             the name space
 498                    @param   handler               the handler reference
 499            
 500                    @return  True if the Handler is Transient, 
 501                             False otherwise
 502                 */
 503                Boolean _isTransient (
 504                    const String & nameSpace,
 505                    const CIMReference & handler) const;
 506            
 507                /**
 508                    Deletes subscriptions referencing the specified handler.
 509            
 510                    @param   nameSpace             the name space
 511                    @param   referenceProperty     the name of the reference property in the
 512                                                       subscription instance
 513                    @param   handler               the handler reference
 514                 */
 515                void _deleteReferencingSubscriptions (
 516 kumpf 1.4          const String & nameSpace,
 517                    const String & referenceProperty,
 518                    const CIMReference & handler);
 519            
 520                /**
 521                    Determines if specified Subscription has expired
 522            
 523                    NOTE: It is assumed that the instance passed to this function is a
 524                    Subscription instance, and that the Subscription Duration and
 525                    Start Time properties exist
 526            
 527                    @param   instance              the subscription instance
 528            
 529                    @return  True if the Subscription has expired, 
 530                             False otherwise
 531                 */
 532                Boolean _isExpired (
 533                    const CIMInstance & instance) const;
 534            
 535                /**
 536 kumpf 1.5          Deletes specified subscription 
 537            
 538                    @param   nameSpace             the name space
 539                    @param   subscription          the subscription reference
 540                 */
 541                void _deleteExpiredSubscription (
 542                    const String & nameSpace,
 543                    const CIMReference & subscription);
 544            
 545                /**
 546 kumpf 1.4          Sets the Subscription Time Remaining property
 547            
 548                    Calculates time remaining from Subscription Start Time, Subscription 
 549                    Duration, and current date time
 550                  
 551                    NOTE: It is assumed that the instance passed to this function is a
 552                    Subscription instance, and that the Subscription Duration and
 553                    Start Time properties exist
 554            
 555                    @param   instance              the subscription instance
 556                 */
 557                void _setTimeRemaining (
 558                    CIMInstance & instance);
 559            
 560                /**
 561 kumpf 1.10         Gets the parameter values required to create or modify the subscription
 562                    request.
 563 kumpf 1.5          If no indication providers are found, condition and queryLanguage are 
 564 kumpf 1.3          set to empty string.
 565            
 566                    @param   nameSpace             Input namespace name
 567                    @param   subscription          Input subscription instance
 568                    @param   indicationProviders   Output list of providers with associated
 569                                                       classes
 570                    @param   propertyList          Output list of properties required by the
 571                                                       subscription
 572                    @param   condition             Output condition part of the filter query
 573                    @param   queryLanguage         Output query language in which the filter
 574                                                       query is expressed
 575                 */
 576                void _getEnableParams (
 577                    const String & nameSpaceName,
 578                    const CIMInstance & subscriptionInstance,
 579 kumpf 1.10         Array <ProviderClassList> & indicationProviders,
 580                    CIMPropertyList & propertyList,
 581                    String & condition,
 582                    String & queryLanguage);
 583            
 584                /**
 585                    Gets the parameter values required to create or modify the subscription
 586                    request.
 587            
 588                    @param   nameSpace             Input namespace name
 589                    @param   subscription          Input subscription instance
 590                    @param   propertyList          Output list of properties required by the
 591                                                       subscription
 592                    @param   condition             Output condition part of the filter query
 593                    @param   queryLanguage         Output query language in which the filter
 594                                                       query is expressed
 595                 */
 596                void _getEnableParams (
 597                    const String & nameSpaceName,
 598                    const CIMInstance & subscriptionInstance,
 599 kumpf 1.3          CIMPropertyList & propertyList,
 600                    String & condition,
 601                    String & queryLanguage);
 602            
 603                /**
 604 kumpf 1.5          Gets the parameter values required to disable the subscription request.
 605            
 606                    @param   nameSpace             Input namespace name
 607                    @param   subscription          Input subscription instance
 608            
 609                    @return  List of providers with associated classes to disable
 610                 */
 611 kumpf 1.10     Array <ProviderClassList> _getDisableParams (
 612 kumpf 1.5          const String & nameSpaceName,
 613                    const CIMInstance & subscriptionInstance);
 614            
 615                /**
 616 kumpf 1.1          Sends enable subscription request for the specified subscription
 617                    to each provider in the list.
 618            
 619                    @param   indicationProviders   list of providers with associated classes
 620                    @param   nameSpace             the namespace name
 621                    @param   propertyList          the properties referenced by the
 622                                                       subscription
 623                    @param   condition             the condition part of the filter query
 624                    @param   queryLanguage         the query language in which the filter
 625                                                       query is expressed
 626                    @param   subscription          the subscription to be enabled
 627 kumpf 1.9          @param   userName              the userName for authentication
 628                    @param   authType              the authentication type
 629            
 630                    @return  True if at least one provider accepted the subscription
 631                             False otherwise
 632 kumpf 1.1       */
 633 kumpf 1.9      Boolean _sendEnableRequests (
 634 kumpf 1.10         const Array <ProviderClassList> & indicationProviders,
 635 kumpf 1.1          const String & nameSpace,
 636                    const CIMPropertyList & propertyList,
 637                    const String & condition,
 638                    const String & queryLanguage,
 639 kumpf 1.9          const CIMNamedInstance & subscription,
 640                    const String & userName,
 641                    const String & authType = String::EMPTY);
 642 kumpf 1.1  
 643                /**
 644                    Sends modify subscription request for the specified subscription
 645                    to each provider in the list.
 646            
 647                    @param   indicationProviders   list of providers with associated classes
 648                    @param   nameSpace             the namespace name
 649                    @param   propertyList          the properties referenced by the
 650                                                       subscription
 651                    @param   condition             the condition part of the filter query
 652                    @param   queryLanguage         the query language in which the filter
 653                                                       query is expressed
 654                    @param   subscription          the subscription to be modified
 655 kumpf 1.9          @param   userName              the userName for authentication
 656                    @param   authType              the authentication type
 657 kumpf 1.1       */
 658                void _sendModifyRequests (
 659 kumpf 1.10         const Array <ProviderClassList> & indicationProviders,
 660 kumpf 1.1          const String & nameSpace,
 661                    const CIMPropertyList & propertyList,
 662                    const String & condition,
 663                    const String & queryLanguage,
 664 kumpf 1.9          const CIMNamedInstance & subscription,
 665                    const String & userName,
 666                    const String & authType = String::EMPTY);
 667 kumpf 1.1  
 668                /**
 669                    Sends disable subscription request for the specified subscription
 670                    to each provider in the list.
 671            
 672                    @param   indicationProviders   list of providers with associated classes
 673                    @param   nameSpace             the namespace name
 674                    @param   subscription          the subscription to be modified
 675 kumpf 1.9          @param   userName              the userName for authentication
 676                    @param   authType              the authentication type
 677 kumpf 1.1       */
 678                void _sendDisableRequests (
 679 kumpf 1.10         const Array <ProviderClassList> & indicationProviders,
 680 kumpf 1.1          const String & nameSpace,
 681 kumpf 1.9          const CIMNamedInstance & subscription,
 682                    const String & userName,
 683                    const String & authType = String::EMPTY);
 684 kumpf 1.1  
 685                /**
 686 kumpf 1.10         Generates a unique String key from the subscription instance name and
 687                    provider keys.
 688            
 689                    @param   subscription          the subscription named instance
 690                    @param   provider              the provider instance
 691            
 692                    @return  the generated key
 693                 */
 694                String _generateKey (
 695                    const CIMNamedInstance & subscription,
 696                    const CIMInstance provider);
 697            
 698                /**
 699                    Inserts an entry into the subscription table.
 700            
 701                    @param   subscription          the subscription named instance
 702                    @param   provider              the provider instance
 703                    @param   classList             the list of class names
 704                 */
 705                void _insertEntry (
 706                    const CIMNamedInstance & subscription,
 707 kumpf 1.10         const CIMInstance & provider,
 708                    const Array <String> classList);
 709            
 710                /**
 711 kumpf 1.1          Creates an alert instance of the specified class.
 712            
 713                    @param   alertClassName        the alert class name
 714 kumpf 1.7          @param   subscriptions         subscriptions for which alert is to be
 715 kumpf 1.1                                             created
 716            
 717                    @return  the created alert instance
 718                 */
 719                CIMInstance _createAlertInstance (
 720                    const String & alertClassName,
 721 kumpf 1.7          const Array <CIMNamedInstance> & subscriptions);
 722 kumpf 1.1  
 723                /**
 724                    Sends specified alert to each unique handler instance for the
 725                    specified subscriptions in the list.
 726            
 727 kumpf 1.7          @param   subscriptions         subscriptions for which alert is to be
 728 kumpf 1.1                                             sent
 729                    @param   alertInstance         the alert to be sent
 730                 */
 731                void _sendAlerts (
 732 kumpf 1.7          const Array <CIMNamedInstance> & subscriptions,
 733 kumpf 1.1          /* const */ CIMInstance & alertInstance);
 734            
 735                WQLSimplePropertySource _getPropertySourceFromInstance(
 736                    CIMInstance & indicationInstance);
 737 kumpf 1.5  
 738 kumpf 1.6      CIMRepository * _repository;
 739            
 740 kumpf 1.8      /**
 741                    Handle to Provider Registration Manager
 742                 */
 743                ProviderRegistrationManager * _providerRegManager;
 744 kumpf 1.5  
 745                /**
 746                    Integer representing queue ID for accessing Provider Manager Service
 747                 */
 748                Uint32 _providerManager;
 749            
 750                /**
 751                    Integer representing queue ID for accessing Handler Manager Service
 752                 */
 753                Uint32 _handlerService;
 754            
 755                /**
 756                    Integer representing queue ID for accessing Repository Service
 757                 */
 758                //Uint32 _repository;
 759            
 760                /**
 761 kumpf 1.10         Subscription information table
 762                 */
 763                SubscriptionTable _subscriptionTable;
 764            
 765                /**
 766 kumpf 1.5          Values for the Subscription State property of the Subscription class,
 767                    as defined in the CIM Events MOF
 768                 */
 769                enum SubscriptionState {_STATE_UNKNOWN = 0, _STATE_OTHER = 1, 
 770                     _STATE_ENABLED = 2, _STATE_ENABLEDDEGRADED = 3, _STATE_DISABLED = 4};
 771            
 772                /**
 773                    Values for the Repeat Notification Policy property of the Subscription 
 774                    class, as defined in the CIM Events MOF
 775                 */
 776                enum RepeatNotificationPolicy {_POLICY_UNKNOWN = 0, _POLICY_OTHER = 1,
 777                     _POLICY_NONE = 2, _POLICY_SUPPRESS = 3, _POLICY_DELAY = 4};
 778            
 779                /**
 780                    Values for the On Fatal Error Policy property of the Subscription 
 781                    class, as defined in the CIM Events MOF
 782                 */
 783                enum OnFatalErrorPolicy {_ERRORPOLICY_OTHER = 1, _ERRORPOLICY_IGNORE = 2, 
 784                    _ERRORPOLICY_DISABLE = 3, _ERRORPOLICY_REMOVE = 4};
 785            
 786                /**
 787 kumpf 1.5          Values for the Persistence Type property of the Handler class, 
 788                    as defined in the CIM Events MOF
 789                 */
 790                enum PersistenceType {_PERSISTENCE_OTHER = 1, _PERSISTENCE_PERMANENT = 2, 
 791                    _PERSISTENCE_TRANSIENT = 3};
 792            
 793                /**
 794                    Values for the Perceived Severity property of the Alert Indication 
 795                    class, as defined in the CIM Events MOF
 796                 */
 797                enum PerceivedSeverity {_SEVERITY_UNKNOWN = 0, _SEVERITY_OTHER = 1, 
 798                     _SEVERITY_INFORMATION = 2, _SEVERITY_WARNING = 3, _SEVERITY_MINOR = 4,
 799                     _SEVERITY_MAJOR = 5, _SEVERITY_CRITICAL = 6, _SEVERITY_FATAL = 7};
 800            
 801                /**
 802                    Values for the Probable Cause property of the Alert Indication 
 803                    class, as defined in the CIM Events MOF
 804                    Note: not all possible values have been included
 805                 */
 806                enum ProbableCause {_CAUSE_UNKNOWN = 0, _CAUSE_OTHER = 1};
 807            
 808 kumpf 1.5      /**
 809                    Values for the Alert Type property of the Alert Indication class, 
 810                    as defined in the CIM Events MOF
 811                 */
 812                enum AlertType {_TYPE_OTHER = 1, _TYPE_COMMUNICATIONS = 2, _TYPE_QOS = 3,
 813                     _TYPE_PROCESSING = 4, _TYPE_DEVICE = 5, _TYPE_ENVIRONMENTAL = 6,
 814                     _TYPE_MODELCHANGE = 7, _TYPE_SECURITY = 8};
 815 kumpf 1.1  
 816 kumpf 1.3      //
 817                //  Class names
 818                //
 819            
 820 kumpf 1.1      /**
 821                    The name of the CIMOM Shutdown alert indication class
 822                 */
 823                static const char   _CLASS_CIMOM_SHUTDOWN_ALERT [];
 824            
 825                /**
 826                    The name of the No Provider alert indication class
 827                 */
 828                static const char   _CLASS_NO_PROVIDER_ALERT [];
 829            
 830                /**
 831                    The name of the CIMOM shutdown alert indication class
 832                 */
 833                static const char   _CLASS_PROVIDER_TERMINATED_ALERT [];
 834            
 835            
 836 kumpf 1.3      //
 837                //  Property names
 838                //
 839            
 840 kumpf 1.1      /**
 841                    The name of the Subscription State property for Indication Subscription
 842                    class
 843                 */
 844                static const char   _PROPERTY_STATE [];
 845            
 846                /**
 847                    The name of the Other Subscription State property for Indication
 848                    Subscription class
 849                 */
 850                static const char   _PROPERTY_OTHERSTATE [];
 851            
 852                /**
 853                    The name of the repeat notification policy property for indication
 854                    subscription class
 855                 */
 856                static const char   _PROPERTY_REPEATNOTIFICATIONPOLICY [];
 857            
 858                /**
 859                    The name of the other repeat notification policy property for
 860                    indication subscription class
 861 kumpf 1.1       */
 862                static const char   _PROPERTY_OTHERREPEATNOTIFICATIONPOLICY [];
 863            
 864                /**
 865                    The name of the repeat notification interval property for indication
 866                    subscription class
 867                 */
 868                static const char   _PROPERTY_REPEATNOTIFICATIONINTERVAL [];
 869            
 870                /**
 871                    The name of the repeat notification gap property for indication
 872                    subscription class
 873                 */
 874                static const char   _PROPERTY_REPEATNOTIFICATIONGAP [];
 875            
 876                /**
 877                    The name of the repeat notification count property for indication
 878                    subscription class
 879                 */
 880                static const char   _PROPERTY_REPEATNOTIFICATIONCOUNT [];
 881            
 882 kumpf 1.1      /**
 883                    The name of the On Fatal Error Policy property for Indication 
 884                    Subscription class
 885                 */
 886                static const char   _PROPERTY_ONFATALERRORPOLICY [];
 887            
 888                /**
 889                    The name of the Other On Fatal Error Policy property for Indication
 890                    Subscription class
 891                 */
 892                static const char   _PROPERTY_OTHERONFATALERRORPOLICY [];
 893            
 894                /**
 895 kumpf 1.4          The name of the Time Of Last State Change property for Indication 
 896                    Subscription class
 897                 */
 898                static const char   _PROPERTY_LASTCHANGE [];
 899            
 900                /**
 901                    The name of the Subscription Start Time property for Indication 
 902                    Subscription class
 903                 */
 904                static const char   _PROPERTY_STARTTIME [];
 905            
 906                /**
 907                    The name of the Subscription Duration property for Indication 
 908                    Subscription class
 909                 */
 910                static const char   _PROPERTY_DURATION [];
 911            
 912                /**
 913                    The name of the Subscription Time Remaining property for Indication 
 914                    Subscription class
 915                 */
 916 kumpf 1.4      static const char   _PROPERTY_TIMEREMAINING [];
 917            
 918                /**
 919 kumpf 1.1          The name of the filter reference property for indication subscription
 920                    class
 921                 */
 922                static const char   _PROPERTY_FILTER [];
 923            
 924                /**
 925                    The name of the handler reference property for indication subscription
 926                    class
 927                 */
 928                static const char   _PROPERTY_HANDLER [];
 929            
 930                /**
 931                    The name of the query property for indication filter class
 932                 */
 933                static const char   _PROPERTY_QUERY [];
 934            
 935                /**
 936                    The name of the query language property for indication filter class
 937                 */
 938                static const char   _PROPERTY_QUERYLANGUAGE [];
 939            
 940 kumpf 1.1      /**
 941                    The name of the Source Namespace property for indication filter class
 942                 */
 943                static const char   _PROPERTY_SOURCENAMESPACE [];
 944            
 945                /**
 946                    The name of the name property for indication filter and indication
 947                    handler classes
 948                 */
 949                static const char   _PROPERTY_NAME [];
 950            
 951                /**
 952                    The name of the creation class name property for indication filter and
 953                    indication handler classes
 954                 */
 955                static const char   _PROPERTY_CREATIONCLASSNAME [];
 956            
 957                /**
 958                    The name of the system name property for indication filter and
 959                    indication handler classes
 960                 */
 961 kumpf 1.1      static const char   _PROPERTY_SYSTEMNAME [];
 962            
 963                /**
 964                    The name of the system creation class name property for indication
 965                    filter and indication handler classes
 966                 */
 967                static const char   _PROPERTY_SYSTEMCREATIONCLASSNAME [];
 968            
 969                /**
 970                    The name of the Persistence Type property for Indication Handler class
 971                 */
 972                static const char   _PROPERTY_PERSISTENCETYPE [];
 973            
 974                /**
 975                    The name of the Other Persistence Type property for Indication Handler
 976                    class
 977                 */
 978                static const char   _PROPERTY_OTHERPERSISTENCETYPE [];
 979            
 980                /**
 981 kumpf 1.7          The name of the Destination property for CIM XML Indication Handler 
 982                    subclass
 983 kumpf 1.1       */
 984                static const char   _PROPERTY_DESTINATION [];
 985 kumpf 1.7  
 986                /**
 987                    The name of the Trap Destination property for SNMP Mapper Indication
 988                    Handler subclass
 989                 */
 990                static const char   _PROPERTY_TRAPDESTINATION [];
 991 kumpf 1.1  
 992                /**
 993                    The name of the SNMP Type property for SNMP Indication Handler class
 994                 */
 995                static const char   _PROPERTY_SNMPTYPE [];
 996            
 997                /**
 998                    The name of the Alert Type property for Alert Indication class
 999                 */
1000                static const char   _PROPERTY_ALERTTYPE [];
1001            
1002                /**
1003                    The name of the Other Alert Type property for Alert Indication class
1004                 */
1005                static const char   _PROPERTY_OTHERALERTTYPE [];
1006            
1007                /**
1008                    The name of the Perceived Severity property for Alert Indication class
1009                 */
1010                static const char   _PROPERTY_PERCEIVEDSEVERITY [];
1011            
1012 kumpf 1.1      /**
1013                    The name of the Probable Cause property for Alert Indication class
1014                 */
1015                static const char   _PROPERTY_PROBABLECAUSE [];
1016            
1017                /**
1018 kumpf 1.10         The name of the Provider Name property for Provider class
1019 kumpf 1.1       */
1020 kumpf 1.10     static const char   _PROPERTY_PROVIDERNAME [];
1021 kumpf 1.1  
1022                /**
1023 kumpf 1.10         The name of the Provider Module Name property for Provider class
1024 kumpf 1.1       */
1025 kumpf 1.10     static const char   _PROPERTY_PROVIDERMODULENAME [];
1026 kumpf 1.1  
1027                /**
1028 kumpf 1.10         The name of the Creator property for a class
1029 kumpf 1.1       */
1030 kumpf 1.10     static const char   _PROPERTY_CREATOR [];
1031 kumpf 1.1  
1032 kumpf 1.9  
1033                //
1034                //  Qualifier names
1035                //
1036            
1037                /**
1038                    The name of the Indication qualifier for classes
1039                 */
1040                static const char   _QUALIFIER_INDICATION [];
1041            
1042 kumpf 1.4  
1043                //
1044                //  Other literal values
1045                //
1046 kumpf 1.1  
1047                /**
1048 kumpf 1.4          The WHERE keyword in WQL
1049 kumpf 1.1       */
1050 kumpf 1.4      static const char   _QUERY_WHERE [];
1051 kumpf 1.1  
1052                /**
1053 kumpf 1.4          The string representing the asterisk all properties symbol in WQL
1054 kumpf 1.1       */
1055 kumpf 1.4      static const char   _QUERY_ALLPROPERTIES [];
1056 kumpf 1.3  
1057                //
1058                //  Message substrings used in exception messages
1059                //
1060            
1061                static const char _MSG_MISSING_REQUIRED [];
1062            
1063                static const char _MSG_KEY_PROPERTY [];
1064            
1065                static const char _MSG_PROPERTY [];
1066            
1067                static const char _MSG_PROPERTY_PRESENT [];
1068            
1069                static const char _MSG_VALUE_NOT [];
1070            
1071                static const char _MSG_NO_PROVIDERS [];
1072            
1073 kumpf 1.9      static const char _MSG_NOT_ACCEPTED [];
1074            
1075 kumpf 1.3      static const char _MSG_INVALID_CLASSNAME [];
1076            
1077                static const char _MSG_IN_FROM [];
1078 kumpf 1.4  
1079                static const char _MSG_EXPIRED [];
1080 kumpf 1.9  
1081                static const char _MSG_REFERENCED [];
1082 kumpf 1.1  };
1083            
1084            PEGASUS_NAMESPACE_END
1085            
1086            #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2