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

Diff for /pegasus/src/Pegasus/ControlProviders/InteropProvider/InteropProvider.cpp between version 1.30 and 1.36

version 1.30, 2005/03/30 12:57:57 version 1.36, 2005/05/24 10:42:51
Line 34 
Line 34 
 //              Karl Schopmeyer - Created Cim_Namespace capabilities. //              Karl Schopmeyer - Created Cim_Namespace capabilities.
 //              Karl Schopmeyer - added objectmanager and communication classes //              Karl Schopmeyer - added objectmanager and communication classes
 //              Josephine Eskaline Joyce, IBM (jojustin@in.ibm.com) for Bug#3194 //              Josephine Eskaline Joyce, IBM (jojustin@in.ibm.com) for Bug#3194
   //              David Dillard, VERITAS Software Corp.
   //                  (david.dillard@veritas.com)
   //              Aruran, IBM (ashanmug@in.ibm.com) for Bug# 3659
 // //
 //%//////////////////////////////////////////////////////////////////////////// //%////////////////////////////////////////////////////////////////////////////
  
Line 113 
Line 116 
 #define CDEBUG(X) #define CDEBUG(X)
 #define LDEBUG() #define LDEBUG()
 //#define CDEBUG(X) PEGASUS_STD(cout) << "InteropProvider " << X << PEGASUS_STD(endl) //#define CDEBUG(X) PEGASUS_STD(cout) << "InteropProvider " << X << PEGASUS_STD(endl)
 //#define LDEBUG(X) Logger::put (Logger::DEBUG_LOG, "InteropProvider", Logger::INFORMATION, "$0", X)  //#define LDEBUG(X) Logger::put (Logger::DEBUG_LOG, "InteropProvider", Logger::TRACE, "$0", X)
  
 //************************************************************************** //**************************************************************************
 // //
Line 224 
Line 227 
      CIM_COMMMECHANISMFORMANAGERASSOC=2      CIM_COMMMECHANISMFORMANAGERASSOC=2
  };  };
  
   
   //*************************************************************
   //  Constructor
   //**********************************************************
   InteropProvider::InteropProvider(CIMRepository* repository)
   {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,"InteropProvider::InteropProvider");
        _repository = repository;
   
       //***********************************************
       // This is a tempory fix untill there is a method created for the InteropProvider to
       // do it's inaliaztion work. This fix sets StatisticalData::CopyGSD, enabling the
       //statistical gathering function.
       Array<CIMInstance> instance = repository->enumerateInstances(CIMNamespaceName("root/cimv2"), CIMName ("CIM_ObjectManager"));
   
       if(instance.size() > 0)
       {
           Boolean output = false;
           Uint32 pos;
           if ((pos = instance[0].findProperty(CIMName("GatherStatisticalData"))) != PEG_NOT_FOUND)
           {
               CIMConstProperty p1 = instance[0].getProperty(pos);
               if (p1.getType() == CIMTYPE_BOOLEAN)
               {
                   CIMValue v1  = p1.getValue();
                   if (!v1.isNull())
                   {
                       v1.get(output);
                       if (v1 == true)
                       {
                           StatisticalData* sd = StatisticalData::current();
                           sd->setCopyGSD(true);
                       }
                   }
               }
           }
       }
       //******************************************* end of temporary fix
       PEG_METHOD_EXIT();
    }
   
   
   
 //*************************************************************** //***************************************************************
 // Provider Utility Functions // Provider Utility Functions
 //*************************************************************** //***************************************************************
Line 748 
Line 794 
  
     _setPropertyValue(instance, OM_VERSION, CIMXMLProtocolVersion);     _setPropertyValue(instance, OM_VERSION, CIMXMLProtocolVersion);
  
     // Obsolete function _setPropertyValue(instance, "namespaceType", namespaceType);      // Obsolete function
       _setPropertyValue(instance, "namespaceType", namespaceType);
  
     _setPropertyValue(instance, "IPAddress", IPAddress);     _setPropertyValue(instance, "IPAddress", IPAddress);
  
Line 860 
Line 907 
             return(false);             return(false);
         }         }
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         Logger::put(Logger::ERROR_LOG, System::CIMSERVER, Logger::INFORMATION,         Logger::put(Logger::ERROR_LOG, System::CIMSERVER, Logger::INFORMATION,
             "Error. Cannot access $0 in repository", CIM_OBJECTMANAGER_CLASSNAME.getString());             "Error. Cannot access $0 in repository", CIM_OBJECTMANAGER_CLASSNAME.getString());
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         throw e;          throw;
     }     }
     catch(Exception& e)      catch(const Exception&)
     {     {
         Logger::put(Logger::ERROR_LOG, System::CIMSERVER, Logger::INFORMATION,         Logger::put(Logger::ERROR_LOG, System::CIMSERVER, Logger::INFORMATION,
             "Error. Cannot access $0 in repository", CIM_OBJECTMANAGER_CLASSNAME.getString());             "Error. Cannot access $0 in repository", CIM_OBJECTMANAGER_CLASSNAME.getString());
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         throw e;          throw;
     }     }
 } }
  
Line 953 
Line 1000 
             instancePath = _repository->createInstance(_operationNamespace,             instancePath = _repository->createInstance(_operationNamespace,
                            instance );                            instance );
         }         }
         catch(CIMException& e)          catch(const CIMException&)
         {         {
             // ATTN: KS generate log error if this not possible             // ATTN: KS generate log error if this not possible
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             throw e;              throw;
         }         }
         catch(Exception& e)          catch(const Exception&)
         {         {
             // ATTN: Generate log error.             // ATTN: Generate log error.
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             throw e;              throw;
         }         }
         instance.setPath(instancePath);         instance.setPath(instancePath);
     }     }
Line 1049 
Line 1096 
     {     {
         CIMInstance instance = _buildInstanceSkeleton(CIM_NAMESPACEINMANAGER_CLASSNAME);         CIMInstance instance = _buildInstanceSkeleton(CIM_NAMESPACEINMANAGER_CLASSNAME);
  
         _setPropertyValue(instance, CIMName("Antecdent"), refObjMgr);          _setPropertyValue(instance, CIMName("Antecedent"), refObjMgr);
         //ATTNATTN: this is weak qualifier.         //ATTNATTN: this is weak qualifier.
         _setPropertyValue(instance, CIMName("Dependent"), _buildReference(namespaceInstances[i],         _setPropertyValue(instance, CIMName("Dependent"), _buildReference(namespaceInstances[i],
                                                             CIM_NAMESPACEINMANAGER_CLASSNAME));                                                             CIM_NAMESPACEINMANAGER_CLASSNAME));
Line 1078 
Line 1125 
  
         CIMInstance instance = _buildInstanceSkeleton(CIM_COMMMECHANISMFORMANAGER_CLASSNAME);         CIMInstance instance = _buildInstanceSkeleton(CIM_COMMMECHANISMFORMANAGER_CLASSNAME);
  
         _setPropertyValue(instance,CIMName("Antecdent"), refObjMgr);          _setPropertyValue(instance,CIMName("Antecedent"), refObjMgr);
         //ATTNATTN: this is weak qualifier.         //ATTNATTN: this is weak qualifier.
         _setPropertyValue(instance,CIMName("Dependent"), _buildReference(commInstances[i],CIM_COMMMECHANISMFORMANAGER_CLASSNAME));         _setPropertyValue(instance,CIMName("Dependent"), _buildReference(commInstances[i],CIM_COMMMECHANISMFORMANAGER_CLASSNAME));
         assocInstances.append(instance);         assocInstances.append(instance);
Line 1471 
Line 1518 
     return(ref);     return(ref);
 } }
  
 /* _isNamespace determines if the namespace in the second  
    parameter is in the array in the first parameter.  
     @param array of possible namespaces  
     @param canidate namespace  
     @return - true if found  
 */  
 static Boolean _isNamespace(  
             Array<CIMNamespaceName>& namespaceNames,  
                 CIMNamespaceName& namespaceName)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_isNamespace");  
   
      Boolean found = false;  
      for(Uint32 i = 0; i < namespaceNames.size(); i++)  
      {  
         if(namespaceNames[i].equal ( namespaceName ))  
             return true;  
      }  
   
      PEG_METHOD_EXIT();  
      return false;  
 }  
   
 //************************************************************** //**************************************************************
 // Overloaded functions to get key value with different params // Overloaded functions to get key value with different params
 //************************************************************** //**************************************************************
Line 1653 
Line 1676 
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
                 "Namespace = " + newNamespaceName.getString() +                 "Namespace = " + newNamespaceName.getString() +
                     " successfully created.");                     " successfully created.");
             Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
                 "Create Namespace: Shareable = $0, Updates allows: $1,  Parent: $2",                 "Create Namespace: Shareable = $0, Updates allows: $1,  Parent: $2",
                 newNamespaceName.getString(), shareable? "true" : "false", shareable? "true" : "false", parent );                 newNamespaceName.getString(), shareable? "true" : "false", shareable? "true" : "false", parent );
  
         }         }
         catch(CIMException& e)          catch(const CIMException&)
         {         {
            PEG_METHOD_EXIT();            PEG_METHOD_EXIT();
            throw e;             throw;
         }         }
         catch(Exception& e)          catch(const Exception&)
         {         {
            PEG_METHOD_EXIT();            PEG_METHOD_EXIT();
            throw e;             throw;
         }         }
  
         // begin processing the request         // begin processing the request
Line 1709 
Line 1732 
             {             {
                 _repository->deleteInstance(_operationNamespace,instanceName);                 _repository->deleteInstance(_operationNamespace,instanceName);
             }             }
             catch(CIMException& e)              catch(const CIMException&)
             {             {
                 PEG_METHOD_EXIT();                 PEG_METHOD_EXIT();
                 throw e;                  throw;
             }             }
         }         }
         else if (classEnum == PG_NAMESPACE)         else if (classEnum == PG_NAMESPACE)
Line 1744 
Line 1767 
                "Namespace = " + deleteNamespaceName.getString() +                "Namespace = " + deleteNamespaceName.getString() +
                    " successfully deleted.");                    " successfully deleted.");
  
             Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
                "Interop Provider Delete Namespace: $0",                "Interop Provider Delete Namespace: $0",
                deleteNamespaceName.getString());                deleteNamespaceName.getString());
         }         }
Line 1831 
Line 1854 
             namespaceName = _getKeyValue(instanceName, CIM_NAMESPACE_PROPERTY_NAME);             namespaceName = _getKeyValue(instanceName, CIM_NAMESPACE_PROPERTY_NAME);
  
             // ATTN: Why this CIMNamespaceName parentNamespaceName = instanceName.getNameSpace();             // ATTN: Why this CIMNamespaceName parentNamespaceName = instanceName.getNameSpace();
             if (!_isNamespace(namespaceNames, namespaceName))              if (!Contains(namespaceNames, namespaceName))
             {             {
                 throw CIMObjectNotFoundException("Namespace does not exist: "                 throw CIMObjectNotFoundException("Namespace does not exist: "
                                      + namespaceName.getString());                                      + namespaceName.getString());
Line 1974 
Line 1997 
                 _repository->modifyInstance(_operationNamespace,                 _repository->modifyInstance(_operationNamespace,
                                instance );                                instance );
             }             }
             catch(CIMException& e)              catch(const CIMException&)
             {             {
                 // ATTN: KS generate log error if this not possible                 // ATTN: KS generate log error if this not possible
                 PEG_METHOD_EXIT();                 PEG_METHOD_EXIT();
                 throw e;                  throw;
             }             }
             catch(Exception& e)              catch(const Exception&)
             {             {
                 // ATTN: Generate log error.                 // ATTN: Generate log error.
                 PEG_METHOD_EXIT();                 PEG_METHOD_EXIT();
                 throw e;                  throw;
             }             }
             Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
                 "Interop Provider Set Statistics gathering in CIM_ObjectManager: $0",                 "Interop Provider Set Statistics gathering in CIM_ObjectManager: $0",
                 (statisticsFlag? "true" : "false"));                 (statisticsFlag? "true" : "false"));
             StatisticalData* sd = StatisticalData::current();             StatisticalData* sd = StatisticalData::current();


Legend:
Removed from v.1.30  
changed lines
  Added in v.1.36

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2