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

Diff for /pegasus/src/Pegasus/IndicationService/SubscriptionTable.cpp between version 1.29 and 1.29.8.1

version 1.29, 2009/05/27 05:56:29 version 1.29.8.1, 2013/04/08 10:36:23
Line 63 
Line 63 
         "SubscriptionTable::getSubscriptionEntry");         "SubscriptionTable::getSubscriptionEntry");
  
     Boolean succeeded = false;     Boolean succeeded = false;
     String activeSubscriptionsKey = _generateActiveSubscriptionsKey      SubscriptionKey activeSubscriptionsKey =
         (subscriptionPath);          SubscriptionKey(subscriptionPath);
     if (_lockedLookupActiveSubscriptionsEntry     if (_lockedLookupActiveSubscriptionsEntry
         (activeSubscriptionsKey, tableValue))         (activeSubscriptionsKey, tableValue))
     {     {
Line 77 
Line 77 
         //         //
         PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL1,         PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL1,
             "Subscription (%s) not found in ActiveSubscriptionsTable",             "Subscription (%s) not found in ActiveSubscriptionsTable",
             (const char*)activeSubscriptionsKey.getCString()));              (const char*)activeSubscriptionsKey.toString().getCString()));
     }     }
  
     PEG_METHOD_EXIT ();     PEG_METHOD_EXIT ();
Line 119 
Line 119 
                     //  Check if the provider who generated this indication                     //  Check if the provider who generated this indication
                     //  accepted this subscription                     //  accepted this subscription
                     //                     //
                     String activeSubscriptionsKey =                      SubscriptionKey activeSubscriptionsKey =
                         _generateActiveSubscriptionsKey                          SubscriptionKey(subscriptions [j].getPath ());
                             (subscriptions [j].getPath ());  
                     ActiveSubscriptionsTableEntry asTableValue;                     ActiveSubscriptionsTableEntry asTableValue;
                     if (_lockedLookupActiveSubscriptionsEntry(                     if (_lockedLookupActiveSubscriptionsEntry(
                             activeSubscriptionsKey, asTableValue))                             activeSubscriptionsKey, asTableValue))
Line 210 
Line 209 
             //             //
             //  Update the entry in the active subscriptions hash table             //  Update the entry in the active subscriptions hash table
             //             //
             String activeSubscriptionsKey =              SubscriptionKey activeSubscriptionsKey =
                 _generateActiveSubscriptionsKey                  SubscriptionKey(providerSubscriptions [k].getPath ());
                     (providerSubscriptions [k].getPath ());  
             ActiveSubscriptionsTableEntry asTableValue;             ActiveSubscriptionsTableEntry asTableValue;
             if (_activeSubscriptionsTable.lookup(             if (_activeSubscriptionsTable.lookup(
                     activeSubscriptionsKey, asTableValue))                     activeSubscriptionsKey, asTableValue))
Line 237 
Line 235 
                         "Provider (%s) not found in list for Subscription (%s)"                         "Provider (%s) not found in list for Subscription (%s)"
                         " in ActiveSubscriptionsTable",                         " in ActiveSubscriptionsTable",
                         (const char*)provider.getPath().toString().getCString(),                         (const char*)provider.getPath().toString().getCString(),
                         (const char*)activeSubscriptionsKey.getCString()));                          (const char*)
                               activeSubscriptionsKey.toString().getCString()));
                 }                 }
             }             }
             else             else
             {             {
                 PEG_TRACE((TRC_INDICATION_SERVICE,Tracer::LEVEL2,                 PEG_TRACE((TRC_INDICATION_SERVICE,Tracer::LEVEL2,
                     "Subscription (%s) not found in ActiveSubscriptionsTable",                     "Subscription (%s) not found in ActiveSubscriptionsTable",
                     (const char*)activeSubscriptionsKey.getCString()));                      (const char*)
                            activeSubscriptionsKey.toString().getCString()));
                 //                 //
                 //  The subscription may have been deleted in the mean time                 //  The subscription may have been deleted in the mean time
                 //  If so, no further update is required                 //  If so, no further update is required
Line 373 
Line 373 
             //             //
             //  Update the entry in the active subscriptions hash table             //  Update the entry in the active subscriptions hash table
             //             //
             String activeSubscriptionsKey =              SubscriptionKey activeSubscriptionsKey =
                 _generateActiveSubscriptionsKey                  SubscriptionKey(
                     (providerModuleSubscriptions [k].subscription.getPath ());                      providerModuleSubscriptions[k].subscription.getPath());
             ActiveSubscriptionsTableEntry asTableValue;             ActiveSubscriptionsTableEntry asTableValue;
             if (_activeSubscriptionsTable.lookup(             if (_activeSubscriptionsTable.lookup(
                     activeSubscriptionsKey, asTableValue))                     activeSubscriptionsKey, asTableValue))
Line 412 
Line 412 
     return providerModuleSubscriptions;     return providerModuleSubscriptions;
 } }
  
 String SubscriptionTable::_generateActiveSubscriptionsKey (  
     const CIMObjectPath & subscription) const  
 {  
     //  
     //  Get filter and handler object paths from subscription Filter and Handler  
     //  reference property values  
     //  
     Array<CIMKeyBinding> subscriptionKB = subscription.getKeyBindings ();  
     String filterPath;  
     String handlerPath;  
     for (Uint32 i = 0; i < subscriptionKB.size (); i++)  
     {  
         if ((subscriptionKB [i].getName () == PEGASUS_PROPERTYNAME_FILTER) &&  
             (subscriptionKB [i].getType () == CIMKeyBinding::REFERENCE))  
         {  
             filterPath = subscriptionKB [i].getValue ();  
         }  
         else  
         if ((subscriptionKB [i].getName () == PEGASUS_PROPERTYNAME_HANDLER) &&  
             (subscriptionKB [i].getType () == CIMKeyBinding::REFERENCE))  
         {  
             handlerPath = subscriptionKB [i].getValue ();  
         }  
     }  
   
     //  
     //  Construct subscription key from handler and filter.  
     //  To avoid ambiguity, the hostname part is removed, since the  
     //  hostname can only point to the local machine anyway.  
     //  
     const Char16 slash = '/';  
     if ((filterPath[0]==slash) && (filterPath[1]==slash))  
     {  
         Uint32 index = filterPath.find(2,slash);  
         filterPath = filterPath.subString(index+1);  
     }  
   
     if ((handlerPath[0]==slash) && (handlerPath[1]==slash))  
     {  
         Uint32 index = handlerPath.find(2,slash);  
         handlerPath = handlerPath.subString(index+1);  
     }  
   
     //  
     //  Assuming that most subscriptions will differ in the filter and handler  
     //  names, the namespace and classname of the subscription are added at the  
     //  end of the key.  
     //  
     String activeSubscriptionsKey(filterPath);  
     activeSubscriptionsKey.append(handlerPath);  
     activeSubscriptionsKey.append(slash);  
     activeSubscriptionsKey.append(subscription.getNameSpace().getString());  
     activeSubscriptionsKey.append(slash);  
     activeSubscriptionsKey.append(subscription.getClassName().getString());  
   
     return activeSubscriptionsKey;  
 }  
   
 Boolean SubscriptionTable::_lockedLookupActiveSubscriptionsEntry ( Boolean SubscriptionTable::_lockedLookupActiveSubscriptionsEntry (
     const String & key,      const SubscriptionKey & key,
     ActiveSubscriptionsTableEntry & tableEntry) const     ActiveSubscriptionsTableEntry & tableEntry) const
 { {
     ReadLock lock(_activeSubscriptionsTableLock);     ReadLock lock(_activeSubscriptionsTableLock);
Line 486 
Line 428 
     PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,     PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
         "SubscriptionTable::_insertActiveSubscriptionsEntry");         "SubscriptionTable::_insertActiveSubscriptionsEntry");
  
     String activeSubscriptionsKey = _generateActiveSubscriptionsKey      SubscriptionKey activeSubscriptionsKey =
         (subscription.getPath ());          SubscriptionKey(subscription.getPath ());
     ActiveSubscriptionsTableEntry entry;     ActiveSubscriptionsTableEntry entry;
     entry.subscription = subscription;     entry.subscription = subscription;
     entry.providers = providers;     entry.providers = providers;
Line 526 
Line 468 
 } }
  
 void SubscriptionTable::_removeActiveSubscriptionsEntry ( void SubscriptionTable::_removeActiveSubscriptionsEntry (
     const String & key)      const SubscriptionKey & key)
 { {
     PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,     PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
         "SubscriptionTable::_removeActiveSubscriptionsEntry");         "SubscriptionTable::_removeActiveSubscriptionsEntry");
Line 540 
Line 482 
 #ifdef PEGASUS_INDICATION_HASHTRACE #ifdef PEGASUS_INDICATION_HASHTRACE
     PEG_TRACE((TRC_INDICATION_SERVICE,Tracer::LEVEL4,     PEG_TRACE((TRC_INDICATION_SERVICE,Tracer::LEVEL4,
          "REMOVED _activeSubscriptionsTable entry: %s",          "REMOVED _activeSubscriptionsTable entry: %s",
          (const char*)key.getCString()));           (const char*)key.toString().getCString()));
 #endif #endif
  
     PEG_METHOD_EXIT ();     PEG_METHOD_EXIT ();
Line 636 
Line 578 
 } }
  
 void SubscriptionTable::_updateSubscriptionProviders void SubscriptionTable::_updateSubscriptionProviders
     (const String & activeSubscriptionsKey,      (const SubscriptionKey & activeSubscriptionsKey,
      const CIMInstance & subscription,      const CIMInstance & subscription,
      const Array <ProviderClassList> & updatedProviderList)      const Array <ProviderClassList> & updatedProviderList)
 { {
Line 796 
Line 738 
     PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,     PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
         "SubscriptionTable::updateProviders");         "SubscriptionTable::updateProviders");
  
     String activeSubscriptionsKey = _generateActiveSubscriptionsKey      SubscriptionKey activeSubscriptionsKey =
         (subscriptionPath);          SubscriptionKey(subscriptionPath);
   
     ActiveSubscriptionsTableEntry asTableValue;     ActiveSubscriptionsTableEntry asTableValue;
     {     {
         //         //
Line 831 
Line 774 
                         "in ActiveSubscriptionsTable",                         "in ActiveSubscriptionsTable",
                         (const char*)IndicationService::getProviderLogString(p)                         (const char*)IndicationService::getProviderLogString(p)
                         .getCString(),                         .getCString(),
                         (const char*)activeSubscriptionsKey.getCString()));                          (const char*)activeSubscriptionsKey
                           .toString().getCString()));
                 }                 }
             }             }
             else             else
Line 852 
Line 796 
                         "in ActiveSubscriptionsTable",                         "in ActiveSubscriptionsTable",
                         (const char*)IndicationService::getProviderLogString(p)                         (const char*)IndicationService::getProviderLogString(p)
                         .getCString(),                         .getCString(),
                         (const char*)activeSubscriptionsKey.getCString()));                          (const char*)
                               activeSubscriptionsKey.toString().getCString()));
                 }                 }
             }             }
         }         }
Line 860 
Line 805 
         {         {
             PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL2,             PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL2,
                 "Subscription (%s) not found in ActiveSubscriptionsTable",                 "Subscription (%s) not found in ActiveSubscriptionsTable",
                 (const char*)activeSubscriptionsKey.getCString()));                  (const char*)activeSubscriptionsKey.toString().getCString()));
  
             //             //
             //  The subscription may have been deleted in the mean time             //  The subscription may have been deleted in the mean time
Line 880 
Line 825 
     PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,     PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
         "SubscriptionTable::updateClasses");         "SubscriptionTable::updateClasses");
  
     String activeSubscriptionsKey = _generateActiveSubscriptionsKey      SubscriptionKey activeSubscriptionsKey = SubscriptionKey(subscriptionPath);
         (subscriptionPath);  
     ActiveSubscriptionsTableEntry asTableValue;     ActiveSubscriptionsTableEntry asTableValue;
  
     {     {
Line 923 
Line 867 
                     "Provider (%s) not found in list for Subscription (%s) in "                     "Provider (%s) not found in list for Subscription (%s) in "
                     "ActiveSubscriptionsTable",                     "ActiveSubscriptionsTable",
                     (const char*)provider.getPath().toString().getCString(),                     (const char*)provider.getPath().toString().getCString(),
                     (const char*)activeSubscriptionsKey.getCString()));                      (const char*)
                           activeSubscriptionsKey.toString().getCString()));
             }             }
         }         }
         else         else
Line 951 
Line 896 
     //     //
     {     {
         WriteLock lock(_activeSubscriptionsTableLock);         WriteLock lock(_activeSubscriptionsTableLock);
   
         _removeActiveSubscriptionsEntry (         _removeActiveSubscriptionsEntry (
             _generateActiveSubscriptionsKey (subscription.getPath ()));              SubscriptionKey(subscription.getPath()));
     }     }
  
     //     //
Line 1090 
Line 1034 
     const CIMNamespaceName & nameSpace,     const CIMNamespaceName & nameSpace,
     const CIMInstance& provider,     const CIMInstance& provider,
     Array<CIMInstance>& matchingSubscriptions,     Array<CIMInstance>& matchingSubscriptions,
     Array<String>& matchingSubscriptionKeys)      Array<SubscriptionKey>& matchingSubscriptionKeys)
 { {
     PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,     PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
         "SubscriptionTable::getMatchingClassNamespaceSubscriptions");         "SubscriptionTable::getMatchingClassNamespaceSubscriptions");
Line 1103 
Line 1047 
     //  Look up the indicationClass-sourceNamespace pair in the     //  Look up the indicationClass-sourceNamespace pair in the
     //  Subscription Classes table     //  Subscription Classes table
     //     //
     String subscriptionClassesKey = _generateSubscriptionClassesKey      String subscriptionClassesKey =
         (supportedClass, nameSpace);          _generateSubscriptionClassesKey(supportedClass, nameSpace);
     SubscriptionClassesTableEntry scTableValue;     SubscriptionClassesTableEntry scTableValue;
     if (_lockedLookupSubscriptionClassesEntry(     if (_lockedLookupSubscriptionClassesEntry(
             subscriptionClassesKey, scTableValue))             subscriptionClassesKey, scTableValue))
Line 1116 
Line 1060 
             //  Check if the provider who generated this indication             //  Check if the provider who generated this indication
             //  accepted this subscription             //  accepted this subscription
             //             //
             String activeSubscriptionsKey =              SubscriptionKey activeSubscriptionsKey =
                 _generateActiveSubscriptionsKey                  SubscriptionKey(subscriptions [j].getPath ());
                     (subscriptions [j].getPath ());  
             ActiveSubscriptionsTableEntry asTableValue;             ActiveSubscriptionsTableEntry asTableValue;
             if (_lockedLookupActiveSubscriptionsEntry(             if (_lockedLookupActiveSubscriptionsEntry(
                     activeSubscriptionsKey, asTableValue))                     activeSubscriptionsKey, asTableValue))
Line 1172 
Line 1115 
  
 void SubscriptionTable::updateMatchedIndicationCounts( void SubscriptionTable::updateMatchedIndicationCounts(
     const CIMInstance & providerInstance,     const CIMInstance & providerInstance,
     const Array<String>& activeSubscriptionsKeys)      const Array<SubscriptionKey>& activeSubscriptionsKeys)
 { {
     PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,     PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
         "SubscriptionTable::updateMatchedIndicationCounts");         "SubscriptionTable::updateMatchedIndicationCounts");
Line 1198 
Line 1141 
             // If so, no further update is required.             // If so, no further update is required.
             PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL2,             PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL2,
                 "Subscription %s not found in ActiveSubscriptionsTable",                 "Subscription %s not found in ActiveSubscriptionsTable",
                 (const char *) activeSubscriptionsKeys[i].getCString()));                  (const char *)
                       activeSubscriptionsKeys[i].toString().getCString()));
         }         }
     }     }
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();


Legend:
Removed from v.1.29  
changed lines
  Added in v.1.29.8.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2