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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2