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

Diff for /pegasus/src/Pegasus/IndicationService/SubscriptionRepository.cpp between version 1.14 and 1.14.8.2

version 1.14, 2006/10/20 19:19:44 version 1.14.8.2, 2007/11/12 06:57:37
Line 29 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Carol Ann Krug Graves, Hewlett-Packard Company  
 //             (carolann_graves@hp.com)  
 //  
 // Modified By: David Dillard, VERITAS Software Corp.  
 //                  (david.dillard@veritas.com)  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
Line 43 
Line 37 
  
 #include "IndicationConstants.h" #include "IndicationConstants.h"
 #include "SubscriptionRepository.h" #include "SubscriptionRepository.h"
   #include "IndicationMessageConstants.h"
  
 PEGASUS_USING_STD; PEGASUS_USING_STD;
  
Line 52 
Line 47 
     CIMRepository * repository)     CIMRepository * repository)
     : _repository (repository)     : _repository (repository)
 { {
       _normalizedSubscriptionTable =
           new NormalizedSubscriptionTable(getAllSubscriptions());
 } }
  
 SubscriptionRepository::~SubscriptionRepository () SubscriptionRepository::~SubscriptionRepository ()
 { {
 } }
  
   void SubscriptionRepository::beginCreateSubscription(
       const CIMObjectPath &subPath)
   {
       Boolean subscriptionExists;
       AutoMutex mtx(_normalizedSubscriptionTableMutex);
       if(_normalizedSubscriptionTable->exists(subPath, subscriptionExists))
       {
           if (subscriptionExists)
           {
               throw PEGASUS_CIM_EXCEPTION(CIM_ERR_ALREADY_EXISTS,
                   subPath.toString());
           }
           throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,
                     MessageLoaderParms(_MSG_DUPLICATE_SUBSCRIPTION_REQUEST_KEY,
                         _MSG_DUPLICATE_SUBSCRIPTION_REQUEST, subPath.toString()));
       }
       _normalizedSubscriptionTable->add(subPath, false);
   }
   
   void SubscriptionRepository::cancelCreateSubscription(
       const CIMObjectPath &subPath)
   {
       AutoMutex mtx(_normalizedSubscriptionTableMutex);
       _normalizedSubscriptionTable->remove(subPath);
   }
   
   void SubscriptionRepository::commitCreateSubscription(
       const CIMObjectPath &subPath)
   {
       AutoMutex mtx(_normalizedSubscriptionTableMutex);
       _normalizedSubscriptionTable->remove(subPath);
       _normalizedSubscriptionTable->add(subPath, true);
   }
   
 CIMObjectPath SubscriptionRepository::createInstance ( CIMObjectPath SubscriptionRepository::createInstance (
     CIMInstance instance,     CIMInstance instance,
     const CIMNamespaceName & nameSpace,     const CIMNamespaceName & nameSpace,
Line 370 
Line 401 
     PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,     PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
         "SubscriptionRepository::getState");         "SubscriptionRepository::getState");
  
     Uint32 stateIndex = instance.findProperty (PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE);      Uint32 stateIndex = instance.findProperty
           (PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE);
     if (stateIndex != PEG_NOT_FOUND)     if (stateIndex != PEG_NOT_FOUND)
     {     {
         CIMValue stateValue = instance.getProperty         CIMValue stateValue = instance.getProperty
             (stateIndex).getValue ();             (stateIndex).getValue ();
         if (stateValue.isNull ())         if (stateValue.isNull ())
         {         {
             PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL,              PEG_TRACE_CSTRING (TRC_INDICATION_SERVICE_INTERNAL,
                 Tracer::LEVEL2,                 Tracer::LEVEL2,
                 "Null SubscriptionState property value");                 "Null SubscriptionState property value");
  
Line 412 
Line 444 
     }     }
     else     else
     {     {
         PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL,          PEG_TRACE_CSTRING (TRC_INDICATION_SERVICE_INTERNAL,
             Tracer::LEVEL2,             Tracer::LEVEL2,
             "Missing SubscriptionState property");             "Missing SubscriptionState property");
  
Line 464 
Line 496 
     //     //
     try     try
     {     {
         _repository->deleteInstance (nameSpace, subscription);          deleteInstance (nameSpace, subscription);
     }     }
     catch (Exception & exception)     catch (Exception & exception)
     {     {
Line 563 
Line 595 
                     CIMObjectPath path ("", CIMNamespaceName (),                     CIMObjectPath path ("", CIMNamespaceName (),
                         subscriptions [i].getPath ().getClassName (),                         subscriptions [i].getPath ().getClassName (),
                         subscriptions [i].getPath ().getKeyBindings ());                         subscriptions [i].getPath ().getKeyBindings ());
                     _repository->deleteInstance                      deleteInstance
                         (subscriptions [i].getPath ().getNameSpace (), path);                         (subscriptions [i].getPath ().getNameSpace (), path);
                 }                 }
                 catch (Exception & exception)                 catch (Exception & exception)
Line 1014 
Line 1046 
     const CIMObjectPath & instanceName)     const CIMObjectPath & instanceName)
 { {
     _repository->deleteInstance (nameSpace, instanceName);     _repository->deleteInstance (nameSpace, instanceName);
       // If deleted instance was SubscriptionInstance, delete from
       // Normalized subscriptions table.
       if (instanceName.getClassName().equal(
           PEGASUS_CLASSNAME_INDSUBSCRIPTION) ||
           instanceName.getClassName ().equal(
               PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION))
       {
           CIMObjectPath tmpPath = instanceName;
           tmpPath.setNameSpace(nameSpace);
           _normalizedSubscriptionTable->remove(tmpPath);
       }
 } }
  
 Array <CIMInstance> SubscriptionRepository::enumerateInstancesForClass ( Array <CIMInstance> SubscriptionRepository::enumerateInstancesForClass (
Line 1103 
Line 1146 
     //     //
     try     try
     {     {
         _repository->deleteInstance          deleteInstance
             (subscription.getPath ().getNameSpace (),             (subscription.getPath ().getNameSpace (),
             subscription.getPath ());             subscription.getPath ());
     }     }


Legend:
Removed from v.1.14  
changed lines
  Added in v.1.14.8.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2