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

Diff for /pegasus/src/Pegasus/IndicationService/IndicationService.cpp between version 1.12 and 1.13

version 1.12, 2002/03/13 00:10:41 version 1.13, 2002/03/15 18:32:55
Line 169 
Line 169 
  
 void IndicationService::_initialize (void) void IndicationService::_initialize (void)
 { {
     Array <struct SubscriptionRef> activeSubscriptions;      Array <CIMNamedInstance> activeSubscriptions;
     Array <struct SubscriptionRef> noProviderSubscriptions;      Array <CIMNamedInstance> noProviderSubscriptions;
     Array <CIMInstance> startProviders;     Array <CIMInstance> startProviders;
     Boolean duplicate;     Boolean duplicate;
  
Line 249 
Line 249 
         //         //
         //  Check for expired subscription         //  Check for expired subscription
         //         //
         if ((activeSubscriptions [i].subscription.existsProperty          if ((activeSubscriptions [i].getInstance ().existsProperty
                (_PROPERTY_DURATION)) &&                (_PROPERTY_DURATION)) &&
             (_isExpired (activeSubscriptions [i].subscription)))              (_isExpired (activeSubscriptions [i].getInstance ())))
         {         {
             CIMClass subscriptionClass = _repository->getClass             CIMClass subscriptionClass = _repository->getClass
                 (activeSubscriptions [i].nameSpaceName, _CLASS_SUBSCRIPTION);                  (activeSubscriptions [i].getInstanceName ().getNameSpace (),
                    _CLASS_SUBSCRIPTION);
  
             _deleteExpiredSubscription (activeSubscriptions [i].nameSpaceName,              _deleteExpiredSubscription
                 activeSubscriptions [i].subscription.getInstanceName                  (activeSubscriptions [i].getInstanceName ().getNameSpace (),
                     (subscriptionClass));                  activeSubscriptions [i].getInstanceName ());
  
             continue;             continue;
         }         }
  
         _getEnableParams (activeSubscriptions [i].nameSpaceName,          _getEnableParams
             activeSubscriptions [i].subscription, indicationProviders,              (activeSubscriptions [i].getInstanceName ().getNameSpace (),
               activeSubscriptions [i].getInstance (), indicationProviders,
             propertyList, condition, queryLanguage);             propertyList, condition, queryLanguage);
  
         if (indicationProviders.size () == 0)         if (indicationProviders.size () == 0)
Line 281 
Line 283 
         //  Send enable request message to each provider         //  Send enable request message to each provider
         //         //
         _sendEnableRequests (indicationProviders,         _sendEnableRequests (indicationProviders,
             activeSubscriptions [i].nameSpaceName,              activeSubscriptions [i].getInstanceName ().getNameSpace (),
             propertyList, condition, queryLanguage,             propertyList, condition, queryLanguage,
             activeSubscriptions [i].subscription);              activeSubscriptions [i].getInstance ());
  
         //         //
         //  Merge provider list into list of unique providers to start         //  Merge provider list into list of unique providers to start
Line 337 
Line 339 
  
 void IndicationService::_terminate (void) void IndicationService::_terminate (void)
 { {
     Array <struct SubscriptionRef> activeSubscriptions;      Array <CIMNamedInstance> activeSubscriptions;
     CIMInstance indicationInstance;     CIMInstance indicationInstance;
  
     const char METHOD_NAME [] = "IndicationService::_terminate";     const char METHOD_NAME [] = "IndicationService::_terminate";
Line 387 
Line 389 
         {         {
             //             //
             //  Add creator property to Instance             //  Add creator property to Instance
             //  ATTN: need method to get current user              //  NOTE: userName is only set in the request if authentication
               //  is turned on
               //
               String currentUser = request->userName;
               try
               {
                   instance.addProperty (CIMProperty
                       (_PROPERTY_CREATOR, currentUser));
               }
               catch (NoSuchProperty & e)
               {
                   //
                   //  If the property does not exist, add it to the class
                   //
                   CIMClass theClass = _repository->getClass
                       (request->nameSpace, instance.getClassName ());
                   theClass.addProperty (CIMProperty (_PROPERTY_CREATOR,
                       CIMValue (String::EMPTY)));
   
                   _repository->write_lock ();
   
                   try
                   {
                       _repository->modifyClass (request->nameSpace,
                           theClass);
                   }
                   catch (Exception & exception)
                   {
                       //
                       //  ATTN: Log a message??
             //             //
             String currentUser = String::EMPTY;                  }
             instance.addProperty (CIMProperty (_PROPERTY_CREATOR, currentUser));  
                   _repository->write_unlock ();
   
                   instance.addProperty (CIMProperty
                       (_PROPERTY_CREATOR, currentUser));
               }
  
             //             //
             //  If the instance is of the CIM_IndicationSubscription class             //  If the instance is of the CIM_IndicationSubscription class
Line 450 
Line 486 
                     lastChange.setValue (CIMValue (currentDateTime));                     lastChange.setValue (CIMValue (currentDateTime));
                 }                 }
  
                   CIMDateTime startDateTime;
                   if ((subscriptionState == _STATE_ENABLED) ||
                       (subscriptionState == _STATE_ENABLEDDEGRADED))
                   {
                       startDateTime = currentDateTime;
                   }
                   else
                   {
                       //
                       //  If subscription is not enabled, set Subscription
                       //  Start Time to null CIMDateTime value
                       //
                       startDateTime = CIMDateTime ();
                   }
   
                 //                 //
                 //  Set Subscription Start Time to current date time                  //  Set Subscription Start Time
                 //                 //
                 if (!instance.existsProperty (_PROPERTY_STARTTIME))                 if (!instance.existsProperty (_PROPERTY_STARTTIME))
                 {                 {
                     instance.addProperty                     instance.addProperty
                         (CIMProperty (_PROPERTY_STARTTIME, currentDateTime));                          (CIMProperty (_PROPERTY_STARTTIME, startDateTime));
                 }                 }
                 else                 else
                 {                 {
                     CIMProperty startTime = instance.getProperty                     CIMProperty startTime = instance.getProperty
                         (instance.findProperty (_PROPERTY_STARTTIME));                         (instance.findProperty (_PROPERTY_STARTTIME));
                     startTime.setValue (CIMValue (currentDateTime));                      startTime.setValue (CIMValue (startDateTime));
                 }                 }
             }             }
  
Line 859 
Line 910 
                 //  ATTN: need method to get current date time in CIMDateTime                 //  ATTN: need method to get current date time in CIMDateTime
                 //  format                 //  format
                 //                 //
                   CIMDateTime currentDateTime = CIMDateTime ();
                 if (newState != currentState)                 if (newState != currentState)
                 {                 {
                     CIMDateTime currentDateTime = CIMDateTime ();  
                     CIMProperty lastChange = instance.getProperty                     CIMProperty lastChange = instance.getProperty
                         (instance.findProperty (_PROPERTY_LASTCHANGE));                         (instance.findProperty (_PROPERTY_LASTCHANGE));
                     lastChange.setValue (CIMValue (currentDateTime));                     lastChange.setValue (CIMValue (currentDateTime));
                 }                 }
  
                 //                 //
                   //  If Subscription is to be enabled, and this is the first
                   //  time, set Subscription Start Time
                   //
                   if ((newState == _STATE_ENABLED) ||
                       (newState == _STATE_ENABLEDDEGRADED))
                   {
                       //
                       //  If Subscription Start Time is null, set value
                       //  to the current date time
                       //
                       CIMDateTime startTime;
                       CIMProperty startTimeProperty = instance.getProperty
                           (instance.findProperty (_PROPERTY_STARTTIME));
                       CIMValue startTimeValue = instance.getProperty
                           (instance.findProperty
                           (_PROPERTY_STARTTIME)).getValue ();
                       if (startTimeValue.isNull ())
                       {
                           startTimeProperty.setValue (CIMValue (currentDateTime));
                       }
                       else
                       {
                           startTimeValue.get (startTime);
                           if (startTime.isNull ())
                           {
                               startTimeProperty.setValue
                                   (CIMValue (currentDateTime));
                           }
                       }
                   }
   
                   //
                 //  If subscription is to be enabled, determine if there are                 //  If subscription is to be enabled, determine if there are
                 //  any indication providers that can serve the subscription                 //  any indication providers that can serve the subscription
                 //                 //
Line 1053 
Line 1136 
             (_PROPERTY_CREATOR)).getValue ().toString ();             (_PROPERTY_CREATOR)).getValue ().toString ();
  
         //         //
         //  ATTN: need method to get current user  
         //  
         String currentUser = String::EMPTY;  
   
         //  
         //  Current user must be privileged user or instance Creator to delete         //  Current user must be privileged user or instance Creator to delete
         //  ATTN: need method to determine if current user is Privileged          //  NOTE: if authentication was not turned on when instance was created,
         //          //  instance creator will be String::EMPTY
         if (/*(!System::isPrivilegedUser (currentUser) && */          //  If creator is String::EMPTY, anyone may modify or delete the
           //  instance
           //
           String currentUser = request->userName;
   //cout << "creator: " << creator << endl;
   //cout << "currentUser: " << currentUser << endl;
   //cout << "System::isPrivilegedUser (currentUser): " <<
            //System::isPrivilegedUser (currentUser) << endl;
           if ((creator != String::EMPTY) &&
               (!System::isPrivilegedUser (currentUser)) &&
             (currentUser != creator))             (currentUser != creator))
         {         {
             PEG_FUNC_EXIT (TRC_INDICATION_SERVICE, METHOD_NAME);             PEG_FUNC_EXIT (TRC_INDICATION_SERVICE, METHOD_NAME);
Line 1200 
Line 1287 
     Array<String> propertyList;     Array<String> propertyList;
     Boolean match;     Boolean match;
  
     Array <struct SubscriptionRef> matchedSubscriptions;      Array <CIMNamedInstance> matchedSubscriptions;
     struct HandlerRef handlerRef;      CIMNamedInstance handlerNamedInstance;
  
     WQLSelectStatement selectStatement;     WQLSelectStatement selectStatement;
  
Line 1224 
Line 1311 
             match = true;             match = true;
  
             filterQuery = _getFilterQuery(             filterQuery = _getFilterQuery(
                 matchedSubscriptions[i].subscription,                  matchedSubscriptions[i].getInstance (),
                 matchedSubscriptions[i].nameSpaceName);                  matchedSubscriptions[i].getInstanceName ().getNameSpace ());
  
             selectStatement = _getSelectStatement (filterQuery);             selectStatement = _getSelectStatement (filterQuery);
  
Line 1239 
Line 1326 
  
             if (match)             if (match)
             {             {
                  handlerRef = _getHandlerRef(matchedSubscriptions[i]);                   handlerNamedInstance = _getHandler
                        (matchedSubscriptions[i]);
  
                  CIMRequestMessage * handler_request =                  CIMRequestMessage * handler_request =
                      new CIMHandleIndicationRequestMessage (                      new CIMHandleIndicationRequestMessage (
                          XmlWriter::getNextMessageId (),                          XmlWriter::getNextMessageId (),
                          request->nameSpace,                          request->nameSpace,
                          handlerRef.handler,                           handlerNamedInstance.getInstance (),
                            //handlerRef.handler,
                          indication,                          indication,
                          QueueIdStack(_handlerService, getQueueId()));                          QueueIdStack(_handlerService, getQueueId()));
  
Line 1308 
Line 1397 
     CIMPropertyList newPropertyNames = request->newPropertyNames;     CIMPropertyList newPropertyNames = request->newPropertyNames;
     CIMPropertyList oldPropertyNames = request->oldPropertyNames;     CIMPropertyList oldPropertyNames = request->oldPropertyNames;
  
     Array <struct SubscriptionRef> newSubscriptions;      Array <CIMNamedInstance> newSubscriptions;
     Array <struct SubscriptionRef> formerSubscriptions;      Array <CIMNamedInstance> formerSubscriptions;
     Array <struct ProviderClassList> indicationProviders;     Array <struct ProviderClassList> indicationProviders;
     struct ProviderClassList indicationProvider;     struct ProviderClassList indicationProvider;
  
Line 1382 
Line 1471 
         //         //
         for (Uint8 i = 0; i < newSubscriptions.size (); i++)         for (Uint8 i = 0; i < newSubscriptions.size (); i++)
         {         {
             _getEnableParams (newSubscriptions [i].nameSpaceName,              _getEnableParams
                 newSubscriptions [i].subscription, indicationProviders,                  (newSubscriptions [i].getInstanceName ().getNameSpace (),
                   newSubscriptions [i].getInstance (), indicationProviders,
                 requiredProperties, condition, queryLanguage);                 requiredProperties, condition, queryLanguage);
  
             //             //
             //  Send enable request             //  Send enable request
             //             //
             _sendEnableRequests (indicationProviders,             _sendEnableRequests (indicationProviders,
                 newSubscriptions [i].nameSpaceName, requiredProperties,                  newSubscriptions [i].getInstanceName ().getNameSpace (),
                 condition, queryLanguage, newSubscriptions [i].subscription);                  requiredProperties, condition, queryLanguage,
                   newSubscriptions [i].getInstance ());
  
             //             //
             //  Send start message to each provider             //  Send start message to each provider
Line 1417 
Line 1508 
         for (Uint8 i = 0; i < formerSubscriptions.size (); i++)         for (Uint8 i = 0; i < formerSubscriptions.size (); i++)
         {         {
             _sendDisableRequests (indicationProviders,             _sendDisableRequests (indicationProviders,
                 formerSubscriptions [i].nameSpaceName,                  formerSubscriptions [i].getInstanceName ().getNameSpace (),
                 formerSubscriptions [i].subscription);                  formerSubscriptions [i].getInstance ());
         }         }
  
         //         //
Line 1446 
Line 1537 
 void IndicationService::_handleNotifyProviderTerminationRequest void IndicationService::_handleNotifyProviderTerminationRequest
     (const Message * message)     (const Message * message)
 { {
     Array <struct SubscriptionRef> providerSubscriptions;      Array <CIMNamedInstance> providerSubscriptions;
     CIMInstance indicationInstance;     CIMInstance indicationInstance;
  
     const char METHOD_NAME [] =     const char METHOD_NAME [] =
Line 1973 
Line 2064 
                 }                 }
             }             }
  
               if (instance.getClassName () == _CLASS_HANDLERCIMXML)
               {
             //             //
             //  Destination property is required for CIMXML and SNMP                  //  Destination property is required for CIMXML
             //  Handler subclasses                  //  Handler subclass
             //             //
             if (!instance.existsProperty (_PROPERTY_DESTINATION))             if (!instance.existsProperty (_PROPERTY_DESTINATION))
             {             {
Line 1986 
Line 2079 
                 throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER,                 throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER,
                     exceptionStr);                     exceptionStr);
             }             }
               }
  
             if (instance.getClassName () == _CLASS_HANDLERSNMP)             if (instance.getClassName () == _CLASS_HANDLERSNMP)
             {             {
                 //                 //
                   //  Trap Destination property is required for SNMP
                   //  Handler subclass
                   //
                   if (!instance.existsProperty (_PROPERTY_TRAPDESTINATION))
                   {
                       String exceptionStr = _MSG_MISSING_REQUIRED;
                       exceptionStr.append (_PROPERTY_TRAPDESTINATION);
                       exceptionStr.append (_MSG_PROPERTY);
                       PEG_FUNC_EXIT (TRC_INDICATION_SERVICE, METHOD_NAME);
                       throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER,
                           exceptionStr);
                   }
   
                   //
                 //  SNMP Type property is required for SNMP Handler                 //  SNMP Type property is required for SNMP Handler
                 //                 //
                 if (!instance.existsProperty (_PROPERTY_SNMPTYPE))                 if (!instance.existsProperty (_PROPERTY_SNMPTYPE))
Line 2090 
Line 2198 
         (_PROPERTY_CREATOR)).getValue ().toString ();         (_PROPERTY_CREATOR)).getValue ().toString ();
  
     //     //
     //  ATTN: need method to get current user  
     //  
     String currentUser = String::EMPTY;  
   
     //  
     //  Current user must be privileged user or instance Creator to modify     //  Current user must be privileged user or instance Creator to modify
     //  ATTN: need method to determine if current user is Privileged      //  NOTE: if authentication was not turned on when instance was created,
     //      //  instance creator will be String::EMPTY
     if (/*(!System::isPrivilegedUser (currentUser)) && */      //  If creator is String::EMPTY, anyone may modify or delete the
       //  instance
       //
       String currentUser = request->userName;
   //cout << "creator: " << creator << endl;
   //cout << "currentUser: " << currentUser << endl;
   //cout << "System::isPrivilegedUser (currentUser): " <<
            //System::isPrivilegedUser (currentUser) << endl;
       if ((creator != String::EMPTY) &&
           (!System::isPrivilegedUser (currentUser)) &&
         (currentUser != creator))         (currentUser != creator))
     {     {
         PEG_FUNC_EXIT (TRC_INDICATION_SERVICE, METHOD_NAME);         PEG_FUNC_EXIT (TRC_INDICATION_SERVICE, METHOD_NAME);
Line 2208 
Line 2320 
 } }
  
  
 Array <SubscriptionRef> IndicationService::_getActiveSubscriptions () const  Array <CIMNamedInstance> IndicationService::_getActiveSubscriptions () const
 { {
     Array <SubscriptionRef> activeSubscriptions;      Array <CIMNamedInstance> activeSubscriptions;
     Array <String> nameSpaceNames;     Array <String> nameSpaceNames;
     Array <CIMNamedInstance> subscriptions;     Array <CIMNamedInstance> subscriptions;
     CIMValue subscriptionStateValue;     CIMValue subscriptionStateValue;
     Uint16 subscriptionState;     Uint16 subscriptionState;
     struct SubscriptionRef current;  
  
     const char METHOD_NAME [] =     const char METHOD_NAME [] =
         "IndicationService::_getActiveSubscriptions";         "IndicationService::_getActiveSubscriptions";
Line 2279 
Line 2390 
             if ((subscriptionState == _STATE_ENABLED) ||             if ((subscriptionState == _STATE_ENABLED) ||
                 (subscriptionState == _STATE_ENABLEDDEGRADED))                 (subscriptionState == _STATE_ENABLEDDEGRADED))
             {             {
                 current.subscription = subscriptions [j].getInstance ();                  //
                 current.nameSpaceName = nameSpaceNames [i];                  //  CIMNamedInstances returned from repository do not include
                   //  namespace
                 activeSubscriptions.append (current);                  //  Set namespace here
                   //
                   CIMReference instanceName =
                       subscriptions [j].getInstanceName ();
                   instanceName.setNameSpace (nameSpaceNames [i]);
                   CIMNamedInstance currentInstance
                       (instanceName, subscriptions [j].getInstance ());
                   activeSubscriptions.append (currentInstance);
             }  // if subscription is enabled             }  // if subscription is enabled
         }  // for each subscription         }  // for each subscription
     }  // for each namespace     }  // for each namespace
Line 2293 
Line 2410 
 } }
  
  
 Array <SubscriptionRef> IndicationService::_getMatchingSubscriptions (  Array <CIMNamedInstance> IndicationService::_getMatchingSubscriptions (
     const String & targetClass,     const String & targetClass,
     const CIMPropertyList & targetProperties) const     const CIMPropertyList & targetProperties) const
 { {
     Array <SubscriptionRef> matchingSubscriptions;      Array <CIMNamedInstance> matchingSubscriptions;
     Array <String> nameSpaceNames;     Array <String> nameSpaceNames;
     Array <CIMNamedInstance> subscriptions;     Array <CIMNamedInstance> subscriptions;
     CIMValue subscriptionStateValue;     CIMValue subscriptionStateValue;
     Uint16 subscriptionState;     Uint16 subscriptionState;
     String filterQuery;  
     WQLSelectStatement selectStatement;  
     String indicationClassName;  
     Array <String> indicationSubclasses;  
     CIMPropertyList propertyList;  
     Boolean match;  
     struct SubscriptionRef current;  
  
     const char METHOD_NAME [] =     const char METHOD_NAME [] =
         "IndicationService::_getMatchingSubscriptions";         "IndicationService::_getMatchingSubscriptions";
Line 2371 
Line 2481 
             if ((subscriptionState == _STATE_ENABLED) ||             if ((subscriptionState == _STATE_ENABLED) ||
                 (subscriptionState == _STATE_ENABLEDDEGRADED))                 (subscriptionState == _STATE_ENABLEDDEGRADED))
             {             {
                   String filterQuery;
                   WQLSelectStatement selectStatement;
                   String indicationClassName;
                   Array <String> indicationSubclasses;
                   CIMPropertyList propertyList;
                   Boolean match;
   
                 //                 //
                 //  Get filter query                 //  Get filter query
                 //                 //
Line 2449 
Line 2566 
                     //                     //
                     if (match)                     if (match)
                     {                     {
                         current.subscription = subscriptions [j].getInstance ();                          //
                         current.nameSpaceName = nameSpaceNames [i];                          //  CIMNamedInstances returned from repository do not
                         matchingSubscriptions.append (current);                          //  include namespace
                           //  Set namespace here
                           //
                           CIMReference instanceName =
                               subscriptions [j].getInstanceName ();
                           instanceName.setNameSpace (nameSpaceNames [i]);
                           CIMNamedInstance currentInstance
                               (instanceName, subscriptions [j].getInstance ());
                           matchingSubscriptions.append (currentInstance);
                     }                     }
   
                 }  // if subscription includes target class                 }  // if subscription includes target class
             }  // if subscription is enabled             }  // if subscription is enabled
         }  // for each subscription         }  // for each subscription
Line 2467 
Line 2591 
     const String & targetClass,     const String & targetClass,
     const CIMPropertyList & newProperties,     const CIMPropertyList & newProperties,
     const CIMPropertyList & oldProperties,     const CIMPropertyList & oldProperties,
     Array <struct SubscriptionRef> & newSubscriptions,      Array <CIMNamedInstance> & newSubscriptions,
     Array <struct SubscriptionRef> & formerSubscriptions)      Array <CIMNamedInstance> & formerSubscriptions)
 { {
     Array <String> nameSpaceNames;     Array <String> nameSpaceNames;
     Array <CIMNamedInstance> subscriptions;     Array <CIMNamedInstance> subscriptions;
     CIMValue subscriptionStateValue;     CIMValue subscriptionStateValue;
     Uint16 subscriptionState;     Uint16 subscriptionState;
     String filterQuery;  
     WQLSelectStatement selectStatement;  
     String indicationClassName;  
     Array <String> indicationSubclasses;  
     CIMPropertyList propertyList;  
     Boolean newMatch;  
     Boolean formerMatch;  
     struct SubscriptionRef current;  
  
     const char METHOD_NAME [] =     const char METHOD_NAME [] =
         "IndicationService::_getModifiedSubscriptions";         "IndicationService::_getModifiedSubscriptions";
Line 2547 
Line 2663 
             if ((subscriptionState == _STATE_ENABLED) ||             if ((subscriptionState == _STATE_ENABLED) ||
                 (subscriptionState == _STATE_ENABLEDDEGRADED))                 (subscriptionState == _STATE_ENABLEDDEGRADED))
             {             {
                   String filterQuery;
                   WQLSelectStatement selectStatement;
                   String indicationClassName;
                   Array <String> indicationSubclasses;
                   CIMPropertyList propertyList;
                   Boolean newMatch;
                   Boolean formerMatch;
   
                 //                 //
                 //  Get filter query                 //  Get filter query
                 //                 //
Line 2655 
Line 2779 
                     }                     }
  
                     //                     //
                     //  Add current subscription ref to appropriate list                      //  Add current subscription to appropriate list
                     //                     //
                     if (newMatch && !formerMatch)                     if (newMatch && !formerMatch)
                     {                     {
                         current.subscription = subscriptions [j].getInstance ();                          //
                         current.nameSpaceName = nameSpaceNames [i];                          //  CIMNamedInstances returned from repository do not
                         newSubscriptions.append (current);                          //  include namespace
                           //  Set namespace here
                           //
                           CIMReference instanceName =
                               subscriptions [j].getInstanceName ();
                           instanceName.setNameSpace (nameSpaceNames [i]);
                           CIMNamedInstance currentInstance
                               (instanceName, subscriptions [j].getInstance ());
                           newSubscriptions.append (currentInstance);
                     }                     }
                     else if (!newMatch && formerMatch)                     else if (!newMatch && formerMatch)
                     {                     {
                         current.subscription = subscriptions [j].getInstance ();                          //
                         current.nameSpaceName = nameSpaceNames [i];                          //  CIMNamedInstances returned from repository do not
                         formerSubscriptions.append (current);                          //  include namespace
                           //  Set namespace here
                           //
                           CIMReference instanceName =
                               subscriptions [j].getInstanceName ();
                           instanceName.setNameSpace (nameSpaceNames [i]);
                           CIMNamedInstance currentInstance
                               (instanceName, subscriptions [j].getInstance ());
                           formerSubscriptions.append (currentInstance);
                     }                     }
   
                 }  // if subscription includes target class                 }  // if subscription includes target class
             }  // if subscription is enabled             }  // if subscription is enabled
         }  // for each subscription         }  // for each subscription
Line 2678 
Line 2817 
     PEG_FUNC_EXIT (TRC_INDICATION_SERVICE, METHOD_NAME);     PEG_FUNC_EXIT (TRC_INDICATION_SERVICE, METHOD_NAME);
 } }
  
 Array <SubscriptionRef> IndicationService::_getProviderSubscriptions (  Array <CIMNamedInstance> IndicationService::_getProviderSubscriptions (
     const CIMReference & providerReference)     const CIMReference & providerReference)
 { {
     Array <SubscriptionRef> providerSubscriptions;      Array <CIMNamedInstance> providerSubscriptions;
     Array <String> propertyNames;     Array <String> propertyNames;
     Array <String> nameSpaceNames;     Array <String> nameSpaceNames;
     //Array <CIMNamedInstance> providerCapabilities;     //Array <CIMNamedInstance> providerCapabilities;
Line 3017 
Line 3156 
 } }
  
  
 struct HandlerRef IndicationService::_getHandlerRef (  CIMNamedInstance IndicationService::_getHandler (
     const struct SubscriptionRef & subscriptionRef) const      const CIMNamedInstance & subscription) const
 { {
     CIMValue handlerValue;     CIMValue handlerValue;
     CIMReference handlerRef;     CIMReference handlerRef;
     CIMInstance handlerInstance;     CIMInstance handlerInstance;
     struct HandlerRef handler;      const char METHOD_NAME [] = "IndicationService::_getHandler";
     const char METHOD_NAME [] = "IndicationService::_getHandlerRef";  
  
     PEG_FUNC_ENTER (TRC_INDICATION_SERVICE, METHOD_NAME);     PEG_FUNC_ENTER (TRC_INDICATION_SERVICE, METHOD_NAME);
  
     //     //
     //  Get Handler reference from subscription instance     //  Get Handler reference from subscription instance
     //     //
     handlerValue = subscriptionRef.subscription.getProperty      handlerValue = subscription.getInstance ().getProperty
         (subscriptionRef.subscription.findProperty          (subscription.getInstance ().findProperty
         (_PROPERTY_HANDLER)).getValue ();         (_PROPERTY_HANDLER)).getValue ();
  
     handlerValue.get (handlerRef);     handlerValue.get (handlerRef);
Line 3041 
Line 3179 
     //  Get Handler instance from the repository     //  Get Handler instance from the repository
     //     //
     handlerInstance = _repository->getInstance     handlerInstance = _repository->getInstance
         (subscriptionRef.nameSpaceName, handlerRef);          (subscription.getInstanceName ().getNameSpace (), handlerRef);
  
     handler.handler = handlerInstance;      //
     handler.nameSpaceName = subscriptionRef.nameSpaceName;      //  Set namespace and create CIMNamedInstance
       //
       handlerRef.setNameSpace
           (subscription.getInstanceName ().getNameSpace ());
       CIMNamedInstance handlerNamedInstance (handlerRef, handlerInstance);
  
     PEG_FUNC_EXIT (TRC_INDICATION_SERVICE, METHOD_NAME);     PEG_FUNC_EXIT (TRC_INDICATION_SERVICE, METHOD_NAME);
     return (handler);      return (handlerNamedInstance);
 } }
  
 Boolean IndicationService::_isTransient ( Boolean IndicationService::_isTransient (
Line 3194 
Line 3336 
     Uint64 duration;     Uint64 duration;
     durationValue = instance.getProperty     durationValue = instance.getProperty
         (instance.findProperty (_PROPERTY_DURATION)).getValue ();         (instance.findProperty (_PROPERTY_DURATION)).getValue ();
       if (durationValue.isNull ())
       {
           //
           //  If there is no duration value set, the subscription has no
           //  expiration date
           //
           return false;
       }
       else
       {
     durationValue.get (duration);     durationValue.get (duration);
       }
  
     //     //
     //  Get current date time, and determine if subscription has expired     //  Get current date time, and determine if subscription has expired
Line 3210 
Line 3363 
     else     else
     {     {
         PEG_FUNC_EXIT (TRC_INDICATION_SERVICE, METHOD_NAME);         PEG_FUNC_EXIT (TRC_INDICATION_SERVICE, METHOD_NAME);
         return false /* true */;          return true;
     }     }
 } }
  
Line 3718 
Line 3871 
  
 CIMInstance IndicationService::_createAlertInstance ( CIMInstance IndicationService::_createAlertInstance (
     const String & alertClassName,     const String & alertClassName,
     const Array <struct SubscriptionRef> & subscriptionRefs)      const Array <CIMNamedInstance> & subscriptions)
 { {
     const char METHOD_NAME [] = "IndicationService::_createAlertInstance";     const char METHOD_NAME [] = "IndicationService::_createAlertInstance";
  
Line 3752 
Line 3905 
     //  ATTN: update once alert classes have been defined     //  ATTN: update once alert classes have been defined
     //  NB: for _CLASS_NO_PROVIDER_ALERT and _CLASS_PROVIDER_TERMINATED_ALERT,     //  NB: for _CLASS_NO_PROVIDER_ALERT and _CLASS_PROVIDER_TERMINATED_ALERT,
     //  one of the properties will be a list of affected subscriptions     //  one of the properties will be a list of affected subscriptions
     //  It is for that reason that subscriptionRefs is passed in as a parameter      //  It is for that reason that subscriptions is passed in as a parameter
     //     //
     if (alertClassName == _CLASS_CIMOM_SHUTDOWN_ALERT)     if (alertClassName == _CLASS_CIMOM_SHUTDOWN_ALERT)
     {     {
Line 3769 
Line 3922 
 } }
  
 void IndicationService::_sendAlerts ( void IndicationService::_sendAlerts (
     const Array <struct SubscriptionRef> & subscriptionRefs,      const Array <CIMNamedInstance> & subscriptions,
     /* const */ CIMInstance & alertInstance)     /* const */ CIMInstance & alertInstance)
 { {
     struct HandlerRef current;      CIMNamedInstance current;
     Boolean duplicate;     Boolean duplicate;
     Array <struct HandlerRef> handlers;      Array <CIMNamedInstance> handlers;
     const char METHOD_NAME [] = "IndicationService::_sendAlerts";     const char METHOD_NAME [] = "IndicationService::_sendAlerts";
  
     PEG_FUNC_ENTER (TRC_INDICATION_SERVICE, METHOD_NAME);     PEG_FUNC_ENTER (TRC_INDICATION_SERVICE, METHOD_NAME);
Line 3784 
Line 3937 
     //     //
     //  Get list of unique handler instances for all subscriptions in list     //  Get list of unique handler instances for all subscriptions in list
     //     //
     for (Uint8 i = 0; i < subscriptionRefs.size (); i++)      for (Uint8 i = 0; i < subscriptions.size (); i++)
     {     {
         //         //
         //  Get handler instance         //  Get handler instance
         //         //
         current = _getHandlerRef (subscriptionRefs [i]);          current = _getHandler (subscriptions [i]);
  
         //         //
         //  Merge into list of unique handler instances         //  Merge into list of unique handler instances
Line 3797 
Line 3950 
         duplicate = false;         duplicate = false;
         for (Uint8 j = 0; j < handlers.size () && !duplicate; j++)         for (Uint8 j = 0; j < handlers.size () && !duplicate; j++)
         {         {
             if ((current.handler == handlers [j].handler) &&              if ((current.getInstance () == handlers [j].getInstance ()) &&
                 (current.nameSpaceName == handlers [j].nameSpaceName))                  (current.getInstanceName () == handlers [j].getInstanceName ()))
             {             {
                 duplicate = true;                 duplicate = true;
             }             }
Line 3818 
Line 3971 
         CIMHandleIndicationRequestMessage * handler_request =         CIMHandleIndicationRequestMessage * handler_request =
             new CIMHandleIndicationRequestMessage (             new CIMHandleIndicationRequestMessage (
                 XmlWriter::getNextMessageId (),                 XmlWriter::getNextMessageId (),
                 handlers [k].nameSpaceName,                  handlers [k].getInstanceName ().getNameSpace (),
                 handlers [k].handler,                  handlers [k].getInstance (),
                 alertInstance,                 alertInstance,
                 QueueIdStack (_handlerService, getQueueId ()));                 QueueIdStack (_handlerService, getQueueId ()));
  
Line 3994 
Line 4147 
     The name of the SNMP Indication Handler class     The name of the SNMP Indication Handler class
  */  */
 const char   IndicationService::_CLASS_HANDLERSNMP []   = const char   IndicationService::_CLASS_HANDLERSNMP []   =
                  "PG_IndicationHandlerSNMP";                   "PG_IndicationHandlerSNMPMapper";
  
 /** /**
     The name of the Indication class     The name of the Indication class
Line 4195 
Line 4348 
                  "OtherPersistenceType";                  "OtherPersistenceType";
  
 /** /**
     The name of the Destination property for Indication Handler subclasses      The name of the Destination property for CIM XML Indication Handler
       subclass
  */  */
 const char   IndicationService::_PROPERTY_DESTINATION [] = "Destination"; const char   IndicationService::_PROPERTY_DESTINATION [] = "Destination";
  
 /** /**
       The name of the Trap Destination property for SNMP Mapper Indication
       Handler subclass
    */
   const char   IndicationService::_PROPERTY_TRAPDESTINATION [] =
                    "TrapDestination";
   
   /**
     The name of the SNMP Type property for SNMP Indication Handler class     The name of the SNMP Type property for SNMP Indication Handler class
  */  */
 const char   IndicationService::_PROPERTY_SNMPTYPE [] = "snmpType";  const char   IndicationService::_PROPERTY_SNMPTYPE [] = "SNMPVersion";
  
 /** /**
     The name of the Alert Type property for Alert Indication class     The name of the Alert Type property for Alert Indication class


Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2