(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.5.2.12 and 1.34

version 1.5.2.12, 2004/03/18 15:40:34 version 1.34, 2005/05/19 13:56:13
Line 1 
Line 1 
 //%2003////////////////////////////////////////////////////////////////////////  //%2005////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.  // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
 // IBM Corp.; EMC Corporation, The Open Group. // IBM Corp.; EMC Corporation, The Open Group.
   // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; VERITAS Software Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 27 
Line 31 
 // //
 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
 //                (carolann_graves@hp.com) //                (carolann_graves@hp.com)
 //              Karl Schopmeyer - Add Cim_Namespace capabilities.  //              Karl Schopmeyer - Created Cim_Namespace capabilities.
 //              Karl Schopmeyer - Temp added objectmanager and communication classes  //              Karl Schopmeyer - added objectmanager and communication classes
   //              Josephine Eskaline Joyce, IBM (jojustin@in.ibm.com) for Bug#3194
   //              David Dillard, VERITAS Software Corp.
   //                  (david.dillard@veritas.com)
 // //
 //%//////////////////////////////////////////////////////////////////////////// //%////////////////////////////////////////////////////////////////////////////
  
Line 41 
Line 48 
 //      CIMObjectManager //      CIMObjectManager
 //      CIM_ObjectManagerCommunicationMechanism //      CIM_ObjectManagerCommunicationMechanism
 //      CIM_CIMXMLCommunicationMechanism //      CIM_CIMXMLCommunicationMechanism
 //      CIM_ProtocolAdapter  //      CIM_ProtocolAdapter  (Note: Removed because deprecated class in cim 2.9)
 //      CIM_Namespace  //      CIM_Namespace (Effective Pegasus 2.4 we use PG_Namespace which
   //      is a subclass of CIM_Namespace with additional properties for
   //      shared namespaces.
 // //
 //      It also services the Interop associations tied to these classes //      It also services the Interop associations tied to these classes
 //      including: //      including:
 //      CIM_NamespaceInManager //      CIM_NamespaceInManager
 //      ... //      ...
   //      This is a control provider and as such uses the Tracer functions
 //      CIM Version: Interop Provider was written for CIM 2.7 adn 2.8.  //      for data and function traces.  Since we do not expect high volume
 //       Note: all 2.8 functions are controlled by a flag and can be  //      use we added a number of traces to help diagnostics.
 //      disabled.  
 /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
   /* TODO LIST:
       1. Finish the association functions
  
 /* STATUS: In process but running 12 feburary 2004 KS */      2. UUID generation should become a system function since it will be used
 /* TODO: 12 Feb 2004  
     Add the association functions  
     UUID generation should become a system function since it will be used  
     by many providers, etc. as part of id generation.     by many providers, etc. as part of id generation.
   
       3. Review the key parameters on create, etc. to be sort out which are
          required from user and which we can supply.  I think we are asking too
          much of the user right now.
 */ */
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
Line 83 
Line 94 
 #include <Pegasus/Config/ConfigManager.h> #include <Pegasus/Config/ConfigManager.h>
 #include <Pegasus/Common/XmlWriter.h> #include <Pegasus/Common/XmlWriter.h>
 #include <Pegasus/Config/ConfigManager.h> #include <Pegasus/Config/ConfigManager.h>
   #include <Pegasus/Common/StatisticalData.h>
   #include <Pegasus/Common/HashTable.h>
  
 #include <sstream>  
 #include <string>  
  
 #include <stdlib.h> #include <stdlib.h>
  
Line 101 
Line 112 
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 //#define CDEBUG(X)  #define CDEBUG(X)
 #define CDEBUG(X) PEGASUS_STD(cout) << "InteropProvider " << X << PEGASUS_STD(endl)  #define LDEBUG()
 //#define CDEBUG(X) Logger::put (Logger::DEBUG_LOG, "Linux_ProcessorProvider", Logger::INFORMATION, "$0", X)  //#define CDEBUG(X) PEGASUS_STD(cout) << "InteropProvider " << X << PEGASUS_STD(endl)
 //#define CDEBUG(X) {std::stringstream ss; std::string r;ss << X;ss>>r; PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4, r)}  //#define LDEBUG(X) Logger::put (Logger::DEBUG_LOG, "InteropProvider", Logger::INFORMATION, "$0", X)
   
  
 //************************************************************************** //**************************************************************************
 // //
Line 113 
Line 123 
 // //
 //************************************************************************** //**************************************************************************
  
   const char * thisProvider = "InteropProvider";
 // The following should be moved to somewhere like constants. // The following should be moved to somewhere like constants.
 static const String PegasusInstanceIDGlobalPrefix = "PEG"; static const String PegasusInstanceIDGlobalPrefix = "PEG";
  
 /** /**
     The constants representing the class names we process     The constants representing the class names we process
 */ */
 static const CIMName __NAMESPACE_CLASSNAME  = CIMName ("__Namespace");  // ATTN DELETE: static const CIMName __NAMESPACE_CLASSNAME  = CIMName ("__Namespace");
 static const CIMName CIM_NAMESPACE_CLASSNAME  = CIMName ("CIM_Namespace"); static const CIMName CIM_NAMESPACE_CLASSNAME  = CIMName ("CIM_Namespace");
   static const CIMName PG_NAMESPACE_CLASSNAME  = CIMName ("PG_Namespace");
   
 static const CIMName CIM_OBJECTMANAGER_CLASSNAME  = CIMName ("CIM_ObjectManager"); static const CIMName CIM_OBJECTMANAGER_CLASSNAME  = CIMName ("CIM_ObjectManager");
 static const CIMName CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM_CLASSNAME  = static const CIMName CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM_CLASSNAME  =
         CIMName ("CIM_ObjectManagerCommunicationMechanism");         CIMName ("CIM_ObjectManagerCommunicationMechanism");
Line 143 
Line 156 
 static const CIMName OM_DESCRIPTIONPROPERTY = static const CIMName OM_DESCRIPTIONPROPERTY =
     CIMName("Description");     CIMName("Description");
  
   
 // Property Names for ObjectManagerCommunicationMechanism Class // Property Names for ObjectManagerCommunicationMechanism Class
 static const CIMName OM_COMMUNICATIONMECHANISM  = static const CIMName OM_COMMUNICATIONMECHANISM  =
         CIMName ("CommunicationMechanism");         CIMName ("CommunicationMechanism");
Line 185 
Line 197 
 static const CIMName CIM_NAMESPACE_PROPERTY_DESCRIPTIONOFCLASSINFO = static const CIMName CIM_NAMESPACE_PROPERTY_DESCRIPTIONOFCLASSINFO =
         CIMName ("DescriptionOfClassInfo");         CIMName ("DescriptionOfClassInfo");
  
   // Additional Property names for PG_Namespace Class
   
   static const CIMName PG_NAMESPACE_PROPERTY_SCHEMAUPDATESALLOWED =
           CIMName ("SchemaUpdatesAllowed");
   static const CIMName PG_NAMESPACE_PROPERTY_ISSHAREABLE =
           CIMName ("IsShareable");
   static const CIMName PG_NAMESPACE_PROPERTY_PARENTNAMESPACE =
           CIMName ("ParentNamespace");
   static const CIMName PG_NAMESPACE_PROPERTY_NAME =
           CIMName ("Name");
   
 // Defines to serve as the ENUM for class selection for instance // Defines to serve as the ENUM for class selection for instance
 // operations. // operations.
  
 enum targetClass{ enum targetClass{
      __NAMESPACE = 1,          //__NAMESPACE = 1,
      CIM_NAMESPACE = 2,          PG_NAMESPACE = 1,
      CIM_OBJECTMANAGER = 3,          CIM_OBJECTMANAGER = 2,
      PG_CIMXMLCOMMUNICATIONMECHANISM = 4          PG_CIMXMLCOMMUNICATIONMECHANISM = 3,
           CIM_NAMESPACEINMANAGERINST =4,
           CIM_COMMMECHANISMFORMANAGERINST=5,
           CIM_NAMESPACEINMANAGER=6
      };      };
  
  enum targetAssocClass{  enum targetAssocClass{
      CIM_NAMESPACEINMANAGER =1,       CIM_NAMESPACEINMANAGERASSOC = 1,
      CIM_COMMMECHANISMFORMANAGER=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
 //*************************************************************** //***************************************************************
 /*  
 void _removeQualifiers(CIMProperty& p)  
 {  
  
     Uint32 count;  String _showBool(Boolean x)
     while((count = p.getQualifierCount()) > 0)  
         p.removeQualifier(count - 1);  
 }  
 void _removeQualifiers(CIMInstance& cimInstance)  
 { {
     // remove qualifiers of the class      return(x? "true" : "false");
     Uint32 count;  }
     while((count = cimInstance.getQualifierCount()) > 0)  
         cimInstance.removeQualifier(count - 1);  
  
     // remove qualifiers from the properties  static String _toStringPropertyList(const CIMPropertyList& pl)
     for (Uint32 i = 0; i < cimInstance.getPropertyCount(); i++)  {
       String tmp;
       for (Uint32 i = 0; i < pl.size() ; i++)
     {     {
         _removeQualifiers(cimInstance.getProperty(i));          if (i > 0)
               tmp.append(", ");
           tmp.append(pl[i].getString());
     }     }
       return(tmp);
 } }
 */  
  
 /** get one string property from an instance.  static String _showPropertyList(const CIMPropertyList& pl)
   {
       if (pl.isNull())
           return("NULL");
   
       String tmp;
   
       tmp.append((pl.size() == 0) ? "Empty" : _toStringPropertyList(pl));
       return(tmp);
   }
   
   /** get one string property from an instance. Note that these functions simply
       return the default value if the property cannot be found or is of the wrong
       type thus, in reality being a maintenance problem since there is no
       error indication.
     @param instance CIMInstance from which we get property value     @param instance CIMInstance from which we get property value
     @param propertyName String name of the property containing the value     @param propertyName String name of the property containing the value
     @param default String optional parameter that is substituted if the property does     @param default String optional parameter that is substituted if the property does
     not exist, is Null, or is not a string type. The substitute is String::EMPTY     not exist, is Null, or is not a string type. The substitute is String::EMPTY
     @return String value found or defaultValue.     @return String value found or defaultValue.
 */ */
 String _getPropertyValue(const CIMInstance& instance, const CIMName& propertyName, const String& defaultValue = String::EMPTY)  String _getPropertyValue(const CIMInstance& instance, const CIMName& propertyName, const String& defaultValue)
 { {
     String output;      String output = defaultValue;
     Uint32 pos;     Uint32 pos;
     if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)     if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)
     {     {
Line 246 
Line 324 
  
             if (!v1.isNull())             if (!v1.isNull())
                 v1.get(output);                 v1.get(output);
             else  
                 output = defaultValue;  
         }         }
         else  
             output = defaultValue;  
     }     }
     else  
         output = defaultValue;  
     return(output);     return(output);
 } }
   
   // Overload of _getPropertyValue for boolean type
   Boolean _getPropertyValue(const CIMInstance& instance, const CIMName& propertyName, const Boolean defaultValue)
   {
       Boolean output = defaultValue;
       Uint32 pos;
       if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)
       {
           CIMConstProperty p1 = instance.getProperty(pos);
           if (p1.getType() == CIMTYPE_BOOLEAN)
           {
               CIMValue v1  = p1.getValue();
   
               if (!v1.isNull())
                   v1.get(output);
           }
       }
       return(output);
   }
   
 /** get Host IP address from host name. If the /** get Host IP address from host name. If the
     host name is not provided, uses internal function.     host name is not provided, uses internal function.
     If everything fails, gets the definition normally     If everything fails, gets the definition normally
Line 269 
Line 361 
 */ */
 String _getHostAddress(String hostName) String _getHostAddress(String hostName)
 { {
   // set default address    String ipAddress;
   String ipAddress("127.0.0.1");  
  
   if (hostName == String::EMPTY)   if (hostName == String::EMPTY)
         hostName = System::getHostName();         hostName = System::getHostName();
  
   struct hostent * phostent;    if ((ipAddress = System::getHostIP(hostName)) == String::EMPTY)
   struct in_addr   inaddr;  
   
   if ((phostent = ::gethostbyname((const char *)hostName.getCString())) != NULL)  
     {     {
      ::memcpy( &inaddr, phostent->h_addr,4);        // set default address if everything else failed
       ipAddress = ::inet_ntoa( inaddr );        ipAddress = String("127.0.0.1");
     }     }
   return ipAddress;   return ipAddress;
 } }
  
  Array<String> _getFunctionalProfiles(Array<Uint16> profiles)   Array<String> _getFunctionalProfiles(Array<Uint16> & profiles)
  {  {
      Array<String> profileDescriptions;      Array<String> profileDescriptions;
      profiles.append(2); profileDescriptions.append("Basic Read");      profiles.append(2); profileDescriptions.append("Basic Read");
Line 330 
Line 418 
 { {
     return true;     return true;
 } }
   
 Boolean _validateProperties(const CIMInstance& instance) Boolean _validateProperties(const CIMInstance& instance)
 { {
     return true;     return true;
Line 415 
Line 504 
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(true);     return(true);
 } }
   
 Boolean _validateRequiredProperty(const CIMObjectPath& objectPath, Boolean _validateRequiredProperty(const CIMObjectPath& objectPath,
                           const CIMName& propertyName,                           const CIMName& propertyName,
                           const String value)                           const String value)
Line 484 
Line 574 
    @return - Uint32 indicating type    @return - Uint32 indicating type
    @Exceptions - throws CIMNotSupportedException if invalid class.    @Exceptions - throws CIMNotSupportedException if invalid class.
 */ */
 targetClass _verifyValidClassInput(const CIMName& className)  static targetClass _verifyValidClassInput(const CIMName& className)
 { {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_verifyValidClassInput");
     if (className.equal(CIM_OBJECTMANAGER_CLASSNAME))     if (className.equal(CIM_OBJECTMANAGER_CLASSNAME))
         return CIM_OBJECTMANAGER;         return CIM_OBJECTMANAGER;
  
     if (className.equal(PG_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME))     if (className.equal(PG_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME))
         return PG_CIMXMLCOMMUNICATIONMECHANISM;         return PG_CIMXMLCOMMUNICATIONMECHANISM;
  
     // Last entry, reverse test and return OK if CIM_Namespace      if (className.equal(CIM_NAMESPACEINMANAGER_CLASSNAME))
     if (!className.equal(CIM_NAMESPACE_CLASSNAME))          return CIM_NAMESPACEINMANAGER;
   
       // Last entry, reverse test and return OK if PG_Namespace
       // Note: Changed to PG_Namespace for CIM 2.4
       if (!className.equal(PG_NAMESPACE_CLASSNAME))
         throw CIMNotSupportedException         throw CIMNotSupportedException
             (className.getString() + " not supported by Interop Provider");             (className.getString() + " not supported by Interop Provider");
  
     return CIM_NAMESPACE;      PEG_METHOD_EXIT();
       return PG_NAMESPACE;
 } }
  
 targetAssocClass _verifyValidAssocClassInput(const CIMName& className)  static targetAssocClass _verifyValidAssocClassInput(const CIMName& className)
 { {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_verifyValidAssocClassInput");
     if (className.equal(CIM_NAMESPACEINMANAGER_CLASSNAME))     if (className.equal(CIM_NAMESPACEINMANAGER_CLASSNAME))
         return CIM_NAMESPACEINMANAGER;          return CIM_NAMESPACEINMANAGERASSOC;
     // Last entry, reverse test and return OK if CIM_Namespace  
       // Last entry, reverse test and return OK if CIM_CommMech....
     if (!className.equal(CIM_COMMMECHANISMFORMANAGER_CLASSNAME))     if (!className.equal(CIM_COMMMECHANISMFORMANAGER_CLASSNAME))
         throw CIMNotSupportedException         throw CIMNotSupportedException
             (className.getString() + " not supported by Interop Provider");             (className.getString() + " not supported by Interop Provider");
  
     return CIM_COMMMECHANISMFORMANAGER;      PEG_METHOD_EXIT();
       return CIM_COMMMECHANISMFORMANAGERASSOC;
 } }
  
   
 /* validate the authorization of the user name against the namespace. /* validate the authorization of the user name against the namespace.
 */ */
 String _validateUserID(const OperationContext & context) String _validateUserID(const OperationContext & context)
 { {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_validateUserID");
     //ATTN-DME-P3-20020522: ADD AUTHORIZATION CHECK TO __NAMESPACE PROVIDER     //ATTN-DME-P3-20020522: ADD AUTHORIZATION CHECK TO __NAMESPACE PROVIDER
     String userName;     String userName;
     try     try
Line 524 
Line 626 
         IdentityContainer container = context.get(IdentityContainer::NAME);         IdentityContainer container = context.get(IdentityContainer::NAME);
         userName = container.getUserName();         userName = container.getUserName();
     }     }
   
     catch (...)     catch (...)
     {     {
        userName = String::EMPTY;        userName = String::EMPTY;
     }     }
   
       PEG_METHOD_EXIT();
     return userName;     return userName;
 } }
  
 /** set the value of a property defined by property name in the instance provided.  /** Set the value of a property defined by property name in the instance provided.
     Sets a String into the value field unless the property name cannot be found.     Sets a String into the value field unless the property name cannot be found.
     If the property cannot be found, it simply returns.     If the property cannot be found, it simply returns.
     ATTN: This function does not pass an error back if property not found.     ATTN: This function does not pass an error back if property not found.
Line 591 
Line 696 
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_fixInstanceCommonKeys()");             "InteropProvider::_fixInstanceCommonKeys()");
     String SystemCreationClassName = System::getSystemCreationClassName ();     String SystemCreationClassName = System::getSystemCreationClassName ();
     if (SystemCreationClassName == String::EMPTY)  
     {  
         //Attn: Get this globally. For now This in place because global is often Empty  
         SystemCreationClassName = "CIM_ComputerSystem";  
     }  
  
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,SystemCreationClassName);     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,SystemCreationClassName);
  
     // Add property SystemName     // Add property SystemName
  
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_SYSTEMNAME,System::getHostName());      _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_SYSTEMNAME,System::getFullyQualifiedHostName());
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
   
 /** builds one instance of the class named className. Gets Class defintion and f /** builds one instance of the class named className. Gets Class defintion and f
     fills in the correct properties from the class.  This requires a repository     fills in the correct properties from the class.  This requires a repository
     getclass request for each instance built. The skeleton is built by     getclass request for each instance built. The skeleton is built by
Line 620 
Line 719 
 */ */
 CIMInstance InteropProvider::_buildInstanceSkeleton(const CIMName& className) CIMInstance InteropProvider::_buildInstanceSkeleton(const CIMName& className)
 { {
     CIMClass myClass;  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_buildInstanceSkeleton()");             "InteropProvider::_buildInstanceSkeleton()");
       CIMClass myClass;
  
     CIMInstance skeleton(className);     CIMInstance skeleton(className);
         myClass = _repository->getClass(_operationNamespace, className, false, true, true);         myClass = _repository->getClass(_operationNamespace, className, false, true, true);
Line 661 
Line 760 
     //CreationClassName     //CreationClassName
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,PG_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME.getString());     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,PG_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME.getString());
  
     //Name, this CommunicationMechanism.      //Name, this CommunicationMechanism.  We need to make it unique.  To do this
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_NAME, PG_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME.getString());      // we simply append the commtype to the classname since we have max of two right
       // now.
       _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_NAME, (String("PEGASUSCOMM") + namespaceType));
  
     // CommunicationMechanism Property      // CommunicationMechanism Property - Force to 2.
     _setPropertyValue(instance, OM_COMMUNICATIONMECHANISM, Uint16(2));     _setPropertyValue(instance, OM_COMMUNICATIONMECHANISM, Uint16(2));
  
     //Functional Profiles Supported Property.     //Functional Profiles Supported Property.
Line 683 
Line 784 
     Array<Uint16> authentications;     Array<Uint16> authentications;
     Array<String> authenticationDescriptions;     Array<String> authenticationDescriptions;
  
     authentications.append(3); authenticationDescriptions.append("basic");      // Note that we have fixed authentication here.
       authentications.append(3); authenticationDescriptions.append("Basic");
  
     _setPropertyValue(instance, OM_AUTHENTICATIONMECHANISMSSUPPORTED, authentications);     _setPropertyValue(instance, OM_AUTHENTICATIONMECHANISMSSUPPORTED, authentications);
  
Line 691 
Line 793 
  
     _setPropertyValue(instance, OM_VERSION, CIMXMLProtocolVersion);     _setPropertyValue(instance, OM_VERSION, CIMXMLProtocolVersion);
  
       // Obsolete function
     _setPropertyValue(instance, "namespaceType", namespaceType);     _setPropertyValue(instance, "namespaceType", namespaceType);
  
     _setPropertyValue(instance, "IPAddress", IPAddress);     _setPropertyValue(instance, "IPAddress", IPAddress);
Line 704 
Line 807 
                                             const Boolean includeClassOrigin,                                             const Boolean includeClassOrigin,
                                             const CIMPropertyList& propertyList)                                             const CIMPropertyList& propertyList)
 { {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_buildInstancesPGCIMXMLCommunicationMechanism");
   
     // This is a temporary hack to get the multiple connections.     // This is a temporary hack to get the multiple connections.
     ConfigManager* configManager = ConfigManager::getInstance();     ConfigManager* configManager = ConfigManager::getInstance();
     Boolean enableHttpConnection = String::equal(     Boolean enableHttpConnection = String::equal(
Line 735 
Line 841 
                                                 propertyList);                                                 propertyList);
         instances.append(instance);         instances.append(instance);
     }     }
       PEG_METHOD_EXIT();
     return(instances);     return(instances);
 } }
 /*  Gets the value for the CIMObjectManager name.  This is a key /*  Gets the value for the CIMObjectManager name.  This is a key
Line 752 
Line 859 
     return(getTrademarkCIMOMIDPrefix() + ":" + getUUIDString());     return(getTrademarkCIMOMIDPrefix() + ":" + getUUIDString());
 } }
  
 /** build an instance of the CIM_ObjectManager class filling out  /** get either the local or disk CIMObjectmanager instance.
     the required properties      @return Boolean true if already exists. False if
     @param includeQualifiers Boolean      not initialized. Also returns with the current version set
     @param includeClassOrigin Boolean      into local parameter.
     @param propertylist CIMPropertyList      ATTN: Probably should get rid of the local parameter since
     @return CIMInstance with a single built instance of the class      this is used so infrequently, waste of space.
     @exception repository instances if exception to enumerateInstances  
         for this class.  
 */ */
   Boolean InteropProvider::_getInstanceFromRepositoryCIMObjectManager(
 CIMInstance InteropProvider::_buildInstanceCIMObjectManager(                          CIMInstance& rtnInstance,
                         const Boolean includeQualifiers,                         const Boolean includeQualifiers,
                         const Boolean includeClassOrigin,                         const Boolean includeClassOrigin,
                         const CIMPropertyList& propertyList)                         const CIMPropertyList& propertyList)
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_buildInstanceCIMObjectManager()");              "InteropProvider::_getInstanceCIMObjectManager");
   
     // If there is already an instance of this class, use it locally use it.  
     if (!instanceOfCIMObjectManager.isUninitialized())  
     {  
         PEG_METHOD_EXIT();  
         return(instanceOfCIMObjectManager);  
     }  
   
     // Try to get persistent instance from repository     // Try to get persistent instance from repository
     Array<CIMInstance> instances;     Array<CIMInstance> instances;
       try
       {
     instances = _repository->enumerateInstances(_operationNamespace,     instances = _repository->enumerateInstances(_operationNamespace,
                   CIM_OBJECTMANAGER_CLASSNAME, true, false, includeQualifiers,                   CIM_OBJECTMANAGER_CLASSNAME, true, false, includeQualifiers,
                     includeClassOrigin, propertyList);                     includeClassOrigin, propertyList);
  
     // ATTN: KS How do we really account for multiple instances of          CDEBUG("_getInstancefrom... " << instances.size());
     // this class and determine which one is really us.  
     if (instances.size() >= 1)     if (instances.size() >= 1)
     {     {
         instanceOfCIMObjectManager = instances[0];              // set this instance into global variable.
               rtnInstance = instances[0];
   
               // log entry if there is more than one instance.
               // Some day we may support multiple entries to see other CIMOMs but
               // for now this should be illegal and represent an internal error.
               // but we will still continue to use the first entry.
               if (instances.size() > 1)
               {
                   Logger::put(Logger::ERROR_LOG, System::CIMSERVER, Logger::INFORMATION,
                       "Error. Multiple definitons of : $0", CIM_OBJECTMANAGER_CLASSNAME.getString());
               }
               CDEBUG("getInstanceFromRepository returning true");
               return(true);
           }
           else
           {
               CDEBUG("getInstanceFromRepository returning false");
               return(false);
           }
       }
       catch(const CIMException&)
       {
           Logger::put(Logger::ERROR_LOG, System::CIMSERVER, Logger::INFORMATION,
               "Error. Cannot access $0 in repository", CIM_OBJECTMANAGER_CLASSNAME.getString());
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         return(instanceOfCIMObjectManager);          throw;
       }
       catch(const Exception&)
       {
           Logger::put(Logger::ERROR_LOG, System::CIMSERVER, Logger::INFORMATION,
               "Error. Cannot access $0 in repository", CIM_OBJECTMANAGER_CLASSNAME.getString());
           PEG_METHOD_EXIT();
           throw;
       }
     }     }
  
   /** build an instance of the CIM_ObjectManager class filling out
       the required properties if one does not already exist in the
       repository. This function will either return an instance
       or throw an exception.
       @param includeQualifiers Boolean
       @param includeClassOrigin Boolean
       @param propertylist CIMPropertyList
       @return CIMInstance with a single built instance of the class
       @exception repository instances if exception to enumerateInstances
           for this class.
   */
   CIMInstance InteropProvider::_getInstanceCIMObjectManager(
                           const Boolean includeQualifiers,
                           const Boolean includeClassOrigin,
                           const CIMPropertyList& propertyList)
   {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_buildInstanceCIMObjectManager");
   
       // Try to get the current object.  If true then it is already created.
       CIMInstance instance;
       if (!_getInstanceFromRepositoryCIMObjectManager(instance, includeQualifiers,includeClassOrigin,propertyList))
       {
     //     //
     // Repository empty. Must build new instance and save it.          // No instance in the repository. Build new instance and save it.
     //     //
     CIMInstance instance = _buildInstanceSkeleton(CIM_OBJECTMANAGER_CLASSNAME);          CDEBUG("Creating New instance of CIMOBjectManager");
           instance = _buildInstanceSkeleton(CIM_OBJECTMANAGER_CLASSNAME);
  
     _fixInstanceCommonKeys(instance);     _fixInstanceCommonKeys(instance);
     instanceOfCIMObjectManager = instance;  
  
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,CIM_OBJECTMANAGER_CLASSNAME.getString());     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,CIM_OBJECTMANAGER_CLASSNAME.getString());
   
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_NAME,buildObjectManagerName());     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_NAME,buildObjectManagerName());
   
     _setPropertyValue(instance, CIMName("ElementName"), String("Pegasus"));     _setPropertyValue(instance, CIMName("ElementName"), String("Pegasus"));
  
           //
     //Description property this object manager instance     //Description property this object manager instance
     // default is Pegasus CIM_Server Version          // default is Pegasus CIM_Server Version.
           // Provided undocumented option to get this from the environment.
           // This should probably be removed or documented.
           //
     String description;     String description;
     char * envDescription;     char * envDescription;
     envDescription = getenv("PEGASUS_CIMOM_DESCRIPTION");     envDescription = getenv("PEGASUS_CIMOM_DESCRIPTION");
  
     if (envDescription)          description = (envDescription) ? envDescription :
         description = envDescription;              String(PEGASUS_PRODUCT_NAME) + " Version " +
     else                  String(PEGASUS_PRODUCT_VERSION);
         description = "Pegasus " + String(PEGASUS_NAME) + "Version " + String(PEGASUS_VERSION);  
  
     _setPropertyValue(instance, CIMName("Description"), description);     _setPropertyValue(instance, CIMName("Description"), description);
  
     //Property GatherStatisticalData. Note that today we do not          //Property GatherStatisticalData. Initially this is set to false
     // have a dynamic activation for this value.          // and can then be modified by a modify instance on the instance.
  
 #ifdef PEGASUS_HAS_PERFINST          Boolean gatherStatDataFlag = false;
     Boolean gatherStatData = true;  
 #else          _setPropertyValue(instance, OM_GATHERSTATISTICALDATA, Boolean(gatherStatDataFlag));
     Boolean gatherStatData = false;  
 #endif  
  
     _setPropertyValue(instance, OM_GATHERSTATISTICALDATA, Boolean(gatherStatData));          // ATTN: This one is a problem KS rethink this.
           // the following is a temporary hack to set the value of the statistics
           // gathering function dynamically.  We simply get the correct value
           // and call the internal method to set it each time this object is
           // built.
       #ifndef PEGASUS_DISABLE_PERFINST
           StatisticalData* sd = StatisticalData::current();
           sd->setCopyGSD(gatherStatDataFlag);
       #endif
  
     // write the instance to the repository          // write instance to the repository
     CIMObjectPath instancepath;          CIMObjectPath instancePath;
           // Add the instance path to this if necessary ATTN ATTN:
     try     try
     {     {
         instancepath = _repository->createInstance(_operationNamespace,              CDEBUG("Create Instance for CIM_ObjectManager");
                        instanceOfCIMObjectManager );              instancePath = _repository->createInstance(_operationNamespace,
                              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.
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
         throw e;              throw;
     }     }
           instance.setPath(instancePath);
       }
       instance.filter(includeQualifiers, includeClassOrigin, propertyList);
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(instanceOfCIMObjectManager);      return(instance);
 } }
  
 /** Get the instances of CIM_Namespace  /** Get the instances of CIM_Namespace. Gets all instances of the namespace from
     ATTN: KS For the moment we build them.  We really want to get them from the repository and      the repository namespace management functions
     compare with the existing namespaces.      Pegasus 2.4 - This now gets CIM_Namespace and its subclass PG_Namespace
 */ */
 Array<CIMInstance> InteropProvider::_getInstancesCIMNamespace(const Boolean& includeQualifiers, Array<CIMInstance> InteropProvider::_getInstancesCIMNamespace(const Boolean& includeQualifiers,
                             const Boolean& includeClassOrigin,                             const Boolean& includeClassOrigin,
Line 863 
Line 1028 
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_getInstancesCIMNamespace()");             "InteropProvider::_getInstancesCIMNamespace()");
     CDEBUG("_getinstancesCIMNamespace");  
     Array<CIMNamespaceName> namespaceNames = _enumerateNameSpaces();  
  
       CDEBUG("_getinstancesPGNamespace");
       Array<CIMNamespaceName> namespaceNames = _enumerateNameSpaces();
       CDEBUG("_getInstancesCIMNamespace. count = " << namespaceNames.size());
     Array<CIMInstance> instanceArray;     Array<CIMInstance> instanceArray;
  
       // We build instances of PG namespace since that is the leaf class
     for (Uint32 i = 0; i < namespaceNames.size(); i++)     for (Uint32 i = 0; i < namespaceNames.size(); i++)
     {     {
        instanceArray.append( _buildInstanceCIMNamespace(namespaceNames[i]));         instanceArray.append( _buildInstancePGNamespace(namespaceNames[i]));
     }     }
       CDEBUG("Build this many PG_Namespace Instances. count= " << instanceArray.size());
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(instanceArray);     return(instanceArray);
 } }
Line 888 
Line 1056 
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_getInstancesCIMNamespace()");             "InteropProvider::_getInstancesCIMNamespace()");
  
     CDEBUG("_getinstanceCIMNamespace Gets ONE only from Namespace=" << nameSpace.getString());  
     Array<CIMInstance> instances = _getInstancesCIMNamespace(true, true, CIMPropertyList());     Array<CIMInstance> instances = _getInstancesCIMNamespace(true, true, CIMPropertyList());
  
       // search the instances for one with the name property value = input parameter.
     for (Uint32 i = 0 ; i < instances.size() ; i++)     for (Uint32 i = 0 ; i < instances.size() ; i++)
     {     {
         if (_getPropertyValue(instances[i], CIMName("name")) == nameSpace.getString())          if (_getPropertyValue(instances[i], CIMName("name"), String::EMPTY) == nameSpace.getString())
         {         {
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return(instances[i]);             return(instances[i]);
Line 905 
Line 1073 
 } }
  
 CIMObjectPath InteropProvider::_buildReference(const CIMInstance& instance, const CIMName& className) CIMObjectPath InteropProvider::_buildReference(const CIMInstance& instance, const CIMName& className)
   
 { {
     return(_buildObjectPath(_operationNamespace,className, instance));     return(_buildObjectPath(_operationNamespace,className, instance));
 } }
  
 Array<CIMInstance> InteropProvider::_buildInstancesNamespaceInManager() Array<CIMInstance> InteropProvider::_buildInstancesNamespaceInManager()
 { {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_buildInstancesNamespaceInManager");
  
     Array<CIMInstance> namespaceInstances = _getInstancesCIMNamespace(false,     Array<CIMInstance> namespaceInstances = _getInstancesCIMNamespace(false,
                             false, CIMPropertyList());                             false, CIMPropertyList());
  
     CIMInstance instanceObjMgr = _buildInstanceCIMObjectManager( true, true, CIMPropertyList());      CIMInstance instanceObjMgr = _getInstanceCIMObjectManager( true, true, CIMPropertyList());
  
     CIMObjectPath refObjMgr = _buildReference(instanceObjMgr, CIM_OBJECTMANAGER_CLASSNAME);     CIMObjectPath refObjMgr = _buildReference(instanceObjMgr, CIM_OBJECTMANAGER_CLASSNAME);
  
Line 932 
Line 1101 
                                                             CIM_NAMESPACEINMANAGER_CLASSNAME));                                                             CIM_NAMESPACEINMANAGER_CLASSNAME));
         assocInstances.append(instance);         assocInstances.append(instance);
     }     }
   
       PEG_METHOD_EXIT();
     return(assocInstances);     return(assocInstances);
 } }
  
 Array<CIMInstance> InteropProvider::_buildInstancesCommMechanismForManager() Array<CIMInstance> InteropProvider::_buildInstancesCommMechanismForManager()
 { {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_buildInstancesCommMechanismForManager");
  
     Array<CIMInstance> commInstances = _buildInstancesPGCIMXMLCommunicationMechanism(true,     Array<CIMInstance> commInstances = _buildInstancesPGCIMXMLCommunicationMechanism(true,
          true, CIMPropertyList());          true, CIMPropertyList());
  
     CIMInstance instanceObjMgr = _buildInstanceCIMObjectManager( true, true, CIMPropertyList());      CIMInstance instanceObjMgr = _getInstanceCIMObjectManager( true, true, CIMPropertyList());
  
     CIMObjectPath refObjMgr = _buildReference(instanceObjMgr, CIM_OBJECTMANAGER_CLASSNAME);     CIMObjectPath refObjMgr = _buildReference(instanceObjMgr, CIM_OBJECTMANAGER_CLASSNAME);
     Array<CIMInstance> assocInstances;     Array<CIMInstance> assocInstances;
Line 956 
Line 1129 
         _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);
     }     }
   
       PEG_METHOD_EXIT();
     return(assocInstances);     return(assocInstances);
 } }
  
 /* generate one instance of the CIM_Namespace class with the /* generate one instance of the CIM_Namespace class with the
    properties    properties
      NOTE: CIM 2.4 - Changed to build PG namespace
    @param namespace name to put into the class    @param namespace name to put into the class
    @exceptions - exceptions carried forward from create instance    @exceptions - exceptions carried forward from create instance
    and addProperty.    and addProperty.
 */ */
 CIMInstance InteropProvider::_buildInstanceCIMNamespace(const CIMNamespaceName & nameSpace)  CIMInstance InteropProvider::_buildInstancePGNamespace(const CIMNamespaceName & nameSpace)
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_buildInstanceCIMNamespace()");              "InteropProvider::_buildInstancePGNamespace");
  
     // ATTN: KS need to get the real objectManager name from elsewhere.  the only place     // ATTN: KS need to get the real objectManager name from elsewhere.  the only place
     // this exists is through the objectmanager object.     // this exists is through the objectmanager object.
Line 976 
Line 1152 
     // interop or more generally somewhere within the system for common access.     // interop or more generally somewhere within the system for common access.
     String ObjectManagerName = "ObjectManagerNameValue";     String ObjectManagerName = "ObjectManagerNameValue";
  
     CIMInstance instance = _buildInstanceSkeleton(CIM_NAMESPACE_CLASSNAME);      CIMInstance instance = _buildInstanceSkeleton(PG_NAMESPACE_CLASSNAME);
  
     _fixInstanceCommonKeys(instance);     _fixInstanceCommonKeys(instance);
  
Line 998 
Line 1174 
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CLASSINFO, Uint16(0));     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CLASSINFO, Uint16(0));
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_DESCRIPTIONOFCLASSINFO, String("namespace"));     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_DESCRIPTIONOFCLASSINFO, String("namespace"));
  
       //
       //  Everything above was commmon to CIM Namespace.  The following is PG_Namespace Properties
       //
       // ATTN: KS Get the correct values for these entities from repository interface.
   
       CIMRepository::NameSpaceAttributes attributes;
       _repository->getNameSpaceAttributes(nameSpace.getString(), attributes);
       String parent="";
           String name = "";
       Boolean shareable=false;
       Boolean updatesAllowed=true;
       for (CIMRepository::NameSpaceAttributes::Iterator i = attributes.start(); i; i++)
       {
          String key=i.key();
          String value = i.value();
   
          if (String::equalNoCase(key,"shareable"))
              {
             if (String::equalNoCase(value,"true"))
                 shareable=true;
              }
          else if (String::equalNoCase(key,"updatesAllowed"))
              {
             if (String::equalNoCase(value,"false"))
                 updatesAllowed=false;
              }
          // Test to be sure we are returning proper namespace name
          else if (String::equalNoCase(key,"name"))
          {
             if (!String::equalNoCase(value, nameSpace.getString()))
             {
                 PEG_METHOD_EXIT();
                 // This is poor exception since it reflects internal error. Do error log
                 throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED,
                     "Namespace attribute rtnd error for key " + key + "expected " +
                      nameSpace.getString()+ value + " in " + String(thisProvider));
             }
   
                     name = value;
          }
          else if (String::equalNoCase(key,"parent"))
              {
             parent=value;
              }
          else
          {
             PEG_METHOD_EXIT();
             // Poor error definition since it reflects internal error. do error log
             throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, nameSpace.getString()+
                 " namespace attribute " + key + " option not supported in"+ String(thisProvider));
          }
       }
       _setPropertyValue(instance, PG_NAMESPACE_PROPERTY_SCHEMAUPDATESALLOWED, updatesAllowed);
       _setPropertyValue(instance, PG_NAMESPACE_PROPERTY_ISSHAREABLE, shareable);
       _setPropertyValue(instance, PG_NAMESPACE_PROPERTY_PARENTNAMESPACE, parent);
           _setPropertyValue(instance, PG_NAMESPACE_PROPERTY_NAME, name);
   
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(instance);     return(instance);
 } }
Line 1017 
Line 1250 
     }     }
     if (!_validateRequiredProperty(objectPath,     if (!_validateRequiredProperty(objectPath,
                 CIM_NAMESPACE_PROPERTY_SYSTEMNAME,                 CIM_NAMESPACE_PROPERTY_SYSTEMNAME,
                 System::getHostName()))                  System::getFullyQualifiedHostName()))
     {     {
         propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMNAME;         propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMNAME;
         valid = false;         valid = false;
Line 1063 
Line 1296 
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
 void _validateCIMNamespaceKeys(const CIMInstance& instance)  /** completes a property in the defined instance either
       by adding the complete property if it does not exist
       or by adding the value if the property does exist.
       Used to make sure that key properties for things
       like systemcreationclass are included in the
       creation of new instances and that the
       values are logical for the CIMOM.
   */
   Boolean _completeProperty(CIMInstance& instance,
       const CIMName& propertyName,
       const String& value)
 { {
   
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_validateCIMNamespaceKeys");              "InteropProvider::_completeProperty()");
   
       Uint32 pos;
   
       if (!_validateRequiredProperty(instance,
                   propertyName,
                   value))
       {
           if ((pos = instance.findProperty (propertyName)) == PEG_NOT_FOUND)
           {
               // Add the property.  Should be from the class.
               PEG_METHOD_EXIT();
               return(false);
           }
           else
           {
               //
               _setPropertyValue(instance, propertyName, value);
           }
       }
   
       PEG_METHOD_EXIT();
       return(true);
   }
   Boolean _completeCIMNamespaceKeys(CIMInstance& instance)
   {
   
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_completeCIMNamespaceKeys");
   
     Boolean valid = true;     Boolean valid = true;
     CIMName propertyName;     CIMName propertyName;
     if (!_validateRequiredProperty(instance,  
       if (!_completeProperty(instance,
                 CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,                 CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,
                 System::getSystemCreationClassName ()))                 System::getSystemCreationClassName ()))
     {     {
   
         propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME;         propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME;
         valid = false;         valid = false;
     }     }
  
     if (!_validateRequiredProperty(instance,      if (!_completeProperty(instance,
                 CIM_NAMESPACE_PROPERTY_SYSTEMNAME,                 CIM_NAMESPACE_PROPERTY_SYSTEMNAME,
                 System::getHostName()))                  System::getFullyQualifiedHostName()))
     {     {
         propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMNAME;         propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMNAME;
         valid = false;         valid = false;
     }     }
  
     if (!_validateRequiredProperty(instance,      if (!_completeProperty(instance,
                 CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME,                 CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME,
                 CIM_OBJECTMANAGER_CLASSNAME.getString()))                 CIM_OBJECTMANAGER_CLASSNAME.getString()))
     {     {
Line 1093 
Line 1368 
         valid = false;         valid = false;
     }     }
  
     // ATTN: This one still a problem.  We have to get the name first      if (!_completeProperty(instance,
     if (!_validateRequiredProperty(instance,  
                 CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME,                 CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME,
                 String::EMPTY))                 String::EMPTY))
     {     {
         propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME;         propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME;
         valid = false;         valid = false;
     }     }
     if (!_validateRequiredProperty(instance,      if (!_completeProperty(instance,
                 CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,                 CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,
                 System::getHostName()))                 System::getHostName()))
     {     {
Line 1109 
Line 1383 
         valid = false;         valid = false;
     }     }
  
     if (!_validateRequiredProperty(instance,      if (!_completeProperty(instance,
                 CIM_NAMESPACE_PROPERTY_NAME,                 CIM_NAMESPACE_PROPERTY_NAME,
                 String::EMPTY))                 String::EMPTY))
     {     {
Line 1117 
Line 1391 
         valid = false;         valid = false;
     }     }
  
     if (false)      if (!valid)
     {     {
         PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,         PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
             "Invalid CIM_Namespace Key Property " +  propertyName.getString());             "Invalid CIM_Namespace Key Property " +  propertyName.getString());
Line 1127 
Line 1401 
     }     }
     PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4, "CIM_Namespace Keys Valid");     PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4, "CIM_Namespace Keys Valid");
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
       return(valid);
 } }
  
 /** builds complete object path from instance and classinfo by building the full path  
     with host and namespace names included.  
 */  
  
 CIMObjectPath InteropProvider::_buildObjectPath(const CIMNamespaceName& name,  void _validateCIMNamespaceKeys(const CIMInstance& instance)
                                                 const CIMName& className,  
                                                 const CIMInstance& instance)  
 { {
     CIMObjectPath objectPath;      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
     objectPath = _buildInstancePath(name,className,instance);              "InteropProvider::_validateCIMNamespaceKeys");
       Boolean valid = true;
     objectPath.setHost(System::getHostName());      CIMName propertyName;
       if (!_validateRequiredProperty(instance,
     objectPath.setNameSpace(name);                  CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,
     return(objectPath);                  System::getSystemCreationClassName ()))
       {
           propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME;
           valid = false;
 } }
  
 /* Given a class and instance build the instance path for a      if (!_validateRequiredProperty(instance,
    the object.  This builds all components of the path                  CIM_NAMESPACE_PROPERTY_SYSTEMNAME,
    @param namespace name to build                  System::getFullyQualifiedHostName ()))
    @return CIMObjectPath containing namespace, class and keybinding  
    components of path  
    @exceptions - Passes repository exceptions.  
 */  
 // ATTN: KS Build path from instance and instance from class.  Not sure  
 //   we want to always do this.  Consider change to build keys directly  
   
 CIMObjectPath InteropProvider::_buildInstancePath(const CIMNamespaceName& name,  
                                            const CIMName& className,  
                                            const CIMInstance& instance)  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,          propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMNAME;
             "InteropProvider::_buildInstancePath");          valid = false;
       }
  
     // get the class CIM_Namespace class to use in building path      if (!_validateRequiredProperty(instance,
                   CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME,
                   CIM_OBJECTMANAGER_CLASSNAME.getString()))
       {
           propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME;
           valid = false;
       }
  
     // Exception out if Class does not exist in this namespace      // ATTN: This one still a problem.  We have to get the name first
     CIMClass thisClass = _getClass(name, className);      if (!_validateRequiredProperty(instance,
                   CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME,
                   String::EMPTY))
       {
           propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME;
           valid = false;
       }
       if (!_validateRequiredProperty(instance,
                   CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,
                   System::getHostName()))
       {
           propertyName = CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME;
           valid = false;
       }
  
     // XmlWriter::printInstanceElement(instance);      if (!_validateRequiredProperty(instance,
     CIMObjectPath ref = instance.buildPath(thisClass);                  CIM_NAMESPACE_PROPERTY_NAME,
                   String::EMPTY))
       {
           propertyName = CIM_NAMESPACE_PROPERTY_NAME;
           valid = false;
       }
  
       if (false)
       {
           PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
               "Invalid CIM_Namespace Key Property " +  propertyName.getString());
           PEG_METHOD_EXIT();
           throw CIMInvalidParameterException(
               "Invalid CIM_Namespace key property: " + propertyName.getString());
       }
       PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4, "CIM_Namespace Keys Valid");
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(ref);  
 } }
  
 /* _isNamespace determines if the namespace in the second  /** builds complete object path from instance and classinfo by building the full path
    parameter is in the array in the first parameter.      with host and namespace names included.
     @param array of possible namespaces  */
     @param canidate namespace  CIMObjectPath InteropProvider::_buildObjectPath(const CIMNamespaceName& name,
     @return - true if found                                                  const CIMName& className,
 */                                                  const CIMInstance& instance)
 Boolean _isNamespace(  
             Array<CIMNamespaceName>& namespaceNames,  
                 CIMNamespaceName& namespaceName)  
   
 {  
      Boolean found = false;  
      for(Uint32 i = 0; i < namespaceNames.size(); i++)  
      {      {
         if(namespaceNames[i].equal ( namespaceName ))      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             return true;              "InteropProvider::_buildObjectPath");
      }  
      return false;      CIMObjectPath objectPath;
       objectPath = _buildInstancePath(name,className,instance);
   
       objectPath.setHost(System::getHostName());
   
       objectPath.setNameSpace(name);
   
       PEG_METHOD_EXIT();
       return(objectPath);
 } }
  
 Boolean _isChild(  /* Given a class and instance build the instance path for a
         CIMNamespaceName& parentNamespaceName,     the object.  This builds all components of the path
         CIMNamespaceName& namespaceName)     @param namespace name to build
      @return CIMObjectPath containing namespace, class and keybinding
      components of path
      @exceptions - Passes repository exceptions.
   */
  
   CIMObjectPath InteropProvider::_buildInstancePath(const CIMNamespaceName& name,
                                              const CIMName& className,
                                              const CIMInstance& instance)
 { {
     String parent = parentNamespaceName.getString();      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
     String child = namespaceName.getString();              "InteropProvider::_buildInstancePath");
     //  
     //  If length of namespace name is shorter than or equal to the  
     //  length of parent namespace name, cannot be a child  
     //  
     if (child.size () <= parent.size ())  
       return false;  
  
     //      // get the class CIM_Namespace class to use in building path
     //  Compare prefix substring of namespace name with parent namespace name      // Exception out if Class does not exist in this namespace
     //      CIMClass thisClass = _getClass(name, className);
     else if (String::equalNoCase (child.subString (0, parent.size ()), parent))  
       return true;      CIMObjectPath ref = instance.buildPath(thisClass);
  
     return false;      PEG_METHOD_EXIT();
       return(ref);
 } }
   
 //************************************************************** //**************************************************************
 // Overloaded functions to get key value with different params // Overloaded functions to get key value with different params
 //************************************************************** //**************************************************************
Line 1262 
Line 1562 
     //ATTN: KS Returns String whereas below returns CIMNamespaceName.     //ATTN: KS Returns String whereas below returns CIMNamespaceName.
 } }
  
 /* gets the key value for the __Namespace property "name"  
    from the instance provided. Sets childNamespaceName and  
    isRelativeName fields  
    This overload called if instance provided.  
 */  
 void _getKeyValue (  
     const CIMInstance& namespaceInstance,  
         CIMNamespaceName& childNamespaceName,  
         Boolean& isRelativeName)  
   
 {  
     //Validate key property  
   
     Uint32 pos;  
     CIMValue propertyValue;  
   
     pos = namespaceInstance.findProperty(NAMESPACE_PROPERTYNAME);  
     if (pos == PEG_NOT_FOUND)  
     {  
        throw CIMPropertyNotFoundException  
            (NAMESPACE_PROPERTYNAME.getString());  
     }  
   
     propertyValue = namespaceInstance.getProperty(pos).getValue();  
     if (propertyValue.getType() != CIMTYPE_STRING)  
        throw CIMInvalidParameterException("Invalid type for property: "  
                              + NAMESPACE_PROPERTYNAME.getString());  
   
     String cnsName;  
     propertyValue.get(cnsName);  
     childNamespaceName = CIMNamespaceName (cnsName);  
   
     isRelativeName = !(childNamespaceName.isNull());  
 }  
 /* gets the key value for the __Namespace property "name"  
    from the instance provided. Sets childNamespaceName and  
    isRelativeName fields  
    This overload called if object path provided.  
 */  
   
 void _getKeyValue (  
         const CIMObjectPath&  instanceName,  
         CIMNamespaceName& childNamespaceName,  
         Boolean& isRelativeName)  
 {  
   
     Array<CIMKeyBinding> kbArray = instanceName.getKeyBindings();  
   
     if ((kbArray.size() == 1) &&  
             (kbArray[0].getName() == NAMESPACE_PROPERTYNAME))  
     {  
        childNamespaceName = CIMNamespaceName (kbArray[0].getValue());  
        isRelativeName = !(childNamespaceName.isNull());  
     }  
     else  
        throw CIMInvalidParameterException("Invalid key property:  ");  
 }  
   
 /* generate the full namespace name from the parent and child  
    components  
    @param namespaceNames - List of all namespaces  
    @param parentNamespaceName  
    @param childNamespaceName  
    @param Boolean isrelative  
    @return full namespacename created from parent + child  
    Note that if isrelative is true, parent is tested for validty  
 */  
 CIMNamespaceName _generateFullNamespaceName(  
                 Array<CIMNamespaceName>& namespaceNames,  
                 CIMNamespaceName& parentNamespaceName,  
                 CIMNamespaceName& childNamespaceName,  
                 Boolean isRelativeName)  
   
 {  
     // If isRelativeName is true, then the parentNamespace  
     // MUST exist  
     //  
     CIMNamespaceName fullNamespaceName;  
   
     if (isRelativeName)  
     {  
       if (!_isNamespace(namespaceNames, parentNamespaceName))  
       {  
          throw CIMObjectNotFoundException("Parent namespace does not exist: "  
                                   + parentNamespaceName.getString());  
       }  
       // Create full namespace name by prepending parentNamespaceName  
       fullNamespaceName = CIMNamespaceName (parentNamespaceName.getString()  
           + "/" + childNamespaceName.getString());  
     }  
     else  
     {  
       fullNamespaceName = parentNamespaceName;  
     }  
     return(fullNamespaceName);  
   
 }  
   
 //*************************************************************************** //***************************************************************************
 //  The following section is the Instance Operation processors //  The following section is the Instance Operation processors
 //*************************************************************************** //***************************************************************************
Line 1373 
Line 1575 
     {     {
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::createInstance()");         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::createInstance()");
  
         CIMNamespaceName childNamespaceName;          Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
               "%s createInstance. InstanceReference= %s",
               thisProvider,
               (const char *) instanceReference.toString().getCString());
   
           handler.processing();
         CIMNamespaceName newNamespaceName;         CIMNamespaceName newNamespaceName;
         Boolean isRelativeName;  
         CDEBUG("CreateInstance " << instanceReference.toString());         CDEBUG("CreateInstance " << instanceReference.toString());
         // operation namespace needed internally to get class.         // operation namespace needed internally to get class.
         _operationNamespace = instanceReference.getNameSpace();         _operationNamespace = instanceReference.getNameSpace();
  
         // Verify that ClassName is correct and get value         // Verify that ClassName is correct and get value
         targetClass classEnum  = _verifyValidClassInput(instanceReference.getClassName());         targetClass classEnum  = _verifyValidClassInput(instanceReference.getClassName());
         CDEBUG("Class Validated");  
         String userName = _validateUserID(context);         String userName = _validateUserID(context);
         CIMObjectPath newInstanceReference;         CIMObjectPath newInstanceReference;
         CDEBUG("UserIDValidated");  
         if ((classEnum == CIM_OBJECTMANAGER) ||         if ((classEnum == CIM_OBJECTMANAGER) ||
             (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM))             (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM))
             throw CIMNotSupportedException("InteropProvider, Create Not allowed");             throw CIMNotSupportedException("InteropProvider, Create Not allowed");
  
         CDEBUG("CreateInstance: No test for CIM_NamepsaceClass");          if (classEnum == PG_NAMESPACE)
         if (classEnum == CIM_NAMESPACE)  
         {         {
   #ifdef PEGASUS_OS_OS400
               MessageLoaderParms mparms("ControlProviders.InteropProvider.CREATE_INSTANCE_NOT_ALLOWED",
                                         "Create instance operation not allowed by Interop Provider for class $0.",
                                         PG_NAMESPACE_CLASSNAME.getString());
               throw CIMNotSupportedException(mparms);
   #else
               // Create local instance to complete any keys.
               CIMInstance localInstance = myInstance.clone();
   
               _completeCIMNamespaceKeys(localInstance);
             // Validate that keys are as required. Does its own exception.             // Validate that keys are as required. Does its own exception.
             _validateCIMNamespaceKeys(myInstance);  
             String namespaceName;  
             newNamespaceName = _getKeyValue(myInstance, CIM_NAMESPACE_PROPERTY_NAME);             newNamespaceName = _getKeyValue(myInstance, CIM_NAMESPACE_PROPERTY_NAME);
  
             CIMInstance instance = _buildInstanceCIMNamespace(namespaceName);              newInstanceReference = _buildInstancePath(_operationNamespace,
             CDEBUG("CreateInstance:Rtn from _BuildInstanceCIMNamespace for namespace= " << namespaceName);                                          PG_NAMESPACE_CLASSNAME, localInstance);
             newInstanceReference = _buildInstancePath(CIMNamespaceName(namespaceName),  #endif
                                         CIM_NAMESPACE_CLASSNAME, instance);  
             CDEBUG("CreateInstance:Go to common create functions");  
         }         }
  
         else   // Process the __Namespace request to get namespace name value          else   // Invalid class for the create functions.
         {          {
             CDEBUG("CreateInstance: Fell through to __Namespace processing");              PEGASUS_ASSERT(false);
             _getKeyValue(myInstance, childNamespaceName, isRelativeName);  
             CIMNamespaceName parentNamespaceName = instanceReference.getNameSpace();  
   
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                "childNamespaceName = " + childNamespaceName.getString() +  
                ", isRelativeName = " +  
                (isRelativeName?String("true"):String("false")) +  
                ", parentNamespaceName = " + parentNamespaceName.getString());  
             CDEBUG("__Namespace Process. parent= " << parentNamespaceName.getString() );  
             Array<CIMNamespaceName> namespaceNames;  
             namespaceNames = _enumerateNameSpaces();  
   
             newNamespaceName = _generateFullNamespaceName(  
                 namespaceNames, parentNamespaceName,  
                          childNamespaceName, isRelativeName);  
   
             // return key (i.e., CIMObjectPath) for newly created namespace  
   
             Array<CIMKeyBinding> keyBindings;  
             keyBindings.append(CIMKeyBinding(NAMESPACE_PROPERTYNAME,  
                  isRelativeName?childNamespaceName.getString():  
                                     parentNamespaceName.getString(),  
                                          CIMKeyBinding::STRING));  
             //Add namespace class and keybindings  
             newInstanceReference.set(String::EMPTY, parentNamespaceName,  
                                          __NAMESPACE_CLASSNAME, keyBindings);  
         }         }
   
         // Create the new namespace         // Create the new namespace
         try         try
         {         {
             CDEBUG("Create namespace " << newNamespaceName.getString());  
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
                 "Namespace = " + newNamespaceName.getString() +                 "Namespace = " + newNamespaceName.getString() +
                     " to be created.");                     " to be created.");
               Boolean updatesAllowed = false;
               Boolean shareable = false;
               String parent = String::EMPTY;
   
               CIMRepository::NameSpaceAttributes attributes;
               // optional property.  Set false if not found.
               // ATTN: Should set to class default.
               if (myInstance.findProperty(PG_NAMESPACE_PROPERTY_ISSHAREABLE) != PEG_NOT_FOUND)
               {
                   if (_getPropertyValue(myInstance, PG_NAMESPACE_PROPERTY_ISSHAREABLE, false))
                   {
                       attributes.insert("shareable","true");
                       shareable = true;
                   }
                   else
                       attributes.insert("shareable", "false");
               }
               else
                   attributes.insert("shareable", "false");
  
             _repository->createNameSpace(newNamespaceName);              // Optional property.  Set false if not found.
               if (myInstance.findProperty(PG_NAMESPACE_PROPERTY_SCHEMAUPDATESALLOWED) != PEG_NOT_FOUND)
               {
                   if (_getPropertyValue(myInstance, PG_NAMESPACE_PROPERTY_SCHEMAUPDATESALLOWED, false))
                   {
                       attributes.insert("updatesAllowed","true");
                       updatesAllowed = true;
                   }
                   else
                       attributes.insert("updatesAllowed", "false");
               }
               else
                   attributes.insert("updatesAllowed", "false");
   
               // ATTN: Need to reflect and dependencies between these properties. Right now
               // this lets anything happen.
               if (myInstance.findProperty(PG_NAMESPACE_PROPERTY_PARENTNAMESPACE) != PEG_NOT_FOUND)
               {
                   String parent = _getPropertyValue(myInstance, PG_NAMESPACE_PROPERTY_PARENTNAMESPACE, String::EMPTY);
                   if (parent != String::EMPTY)
                       attributes.insert("parent",parent);
               }
               _repository->createNameSpace(newNamespaceName, attributes);
  
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
                 "Namespace = " + newNamespaceName.getString() +                 "Namespace = " + newNamespaceName.getString() +
                     " successfully created.");                     " successfully created.");
             // ATTN: Add standardlog entry here.              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,
                   "Create Namespace: Shareable = $0, Updates allows: $1,  Parent: $2",
                   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
         handler.processing();  
   
  
        handler.deliver(newInstanceReference);        handler.deliver(newInstanceReference);
  
Line 1484 
Line 1712 
     {     {
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::deleteInstance");         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::deleteInstance");
  
         CIMNamespaceName childNamespaceName;          Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
         CIMNamespaceName deleteNamespaceName;              "%s deleteInstance. instanceName= %s",
         Boolean isRelativeName;              thisProvider,
               (const char *) instanceName.toString().getCString());
  
         _operationNamespace = instanceName.getNameSpace();         _operationNamespace = instanceName.getNameSpace();
         handler.processing();         handler.processing();
Line 1495 
Line 1724 
  
         String userName = _validateUserID(context);         String userName = _validateUserID(context);
  
   
         if ((classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM))  
             throw CIMNotSupportedException("Delete Not allowed");  
   
         // Delete the instance since it may be in persistent storage         // Delete the instance since it may be in persistent storage
         if ((classEnum == CIM_OBJECTMANAGER))         if ((classEnum == CIM_OBJECTMANAGER))
         {         {
             CIMInstance instance;  
             try             try
             {             {
             instance = _repository->getInstance(_operationNamespace, instanceName);  
   
             // If instance found, then delete it.  
             _repository->deleteInstance(_operationNamespace,instanceName);             _repository->deleteInstance(_operationNamespace,instanceName);
   
             PEG_METHOD_EXIT();  
             handler.complete();  
             return;  
             }             }
             catch(CIMException& e)              catch(const CIMException&)
             {             {
                 PEG_METHOD_EXIT();                 PEG_METHOD_EXIT();
                 throw e;                  throw;
             }             }
         }         }
           else if (classEnum == PG_NAMESPACE)
         Array<CIMNamespaceName> namespaceNames;  
         namespaceNames = _enumerateNameSpaces();  
         if (classEnum == CIM_NAMESPACE)  
         {         {
               CIMNamespaceName deleteNamespaceName;
   #ifdef PEGASUS_OS_OS400
               MessageLoaderParms mparms("ControlProviders.InteropProvider.DELETE_INSTANCE_NOT_ALLOWED",
                                         "Delete instance operation not allowed by Interop Provider for class $0.",
                                         PG_NAMESPACE_CLASSNAME.getString());
               throw CIMNotSupportedException(mparms);
   #else
             // validate requred keys.  Exception out if not valid             // validate requred keys.  Exception out if not valid
             _validateCIMNamespaceKeys(instanceName);             _validateCIMNamespaceKeys(instanceName);
  
             deleteNamespaceName = _getKeyValue(instanceName, CIM_NAMESPACE_PROPERTY_NAME);             deleteNamespaceName = _getKeyValue(instanceName, CIM_NAMESPACE_PROPERTY_NAME);
             CDEBUG("Delete namespace = " << deleteNamespaceName );  #endif
         }  
         else  // Procesing for __namespace  
         {  
   
             CIMNamespaceName childNamespaceName;  
             CIMNamespaceName deleteNamespaceName;  
             Boolean isRelativeName;  
             _getKeyValue(instanceName, childNamespaceName, isRelativeName);  
             CIMNamespaceName parentNamespaceName = instanceName.getNameSpace();  
   
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                "childNamespaceName = " + childNamespaceName.getString() +  
                (isRelativeName?String("true"):String("false")) +  
                ", parentNamespaceName = " + parentNamespaceName.getString());  
   
             // begin processing the request  
  
             deleteNamespaceName = _generateFullNamespaceName(              Array<CIMNamespaceName> namespaceNames;
                namespaceNames, parentNamespaceName,              namespaceNames = _enumerateNameSpaces();
                          childNamespaceName, isRelativeName);  
         }  
  
             // ATTN: KS Why THis???  
         if (deleteNamespaceName.equal (ROOTNS))         if (deleteNamespaceName.equal (ROOTNS))
        {        {
            throw CIMNotSupportedException("root namespace cannot be deleted.");            throw CIMNotSupportedException("root namespace cannot be deleted.");
Line 1567 
Line 1769 
        Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,        Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,
            "Interop Provider Delete Namespace: $0",            "Interop Provider Delete Namespace: $0",
            deleteNamespaceName.getString());            deleteNamespaceName.getString());
           }
           else
           {
               throw CIMNotSupportedException("Delete Not allowed for " + instanceName.getClassName().getString());
           }
  
        handler.processing();        handler.processing();
  
        // complete processing the request  
        handler.complete();        handler.complete();
  
        PEG_METHOD_EXIT();        PEG_METHOD_EXIT();
Line 1590 
Line 1796 
     {     {
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::getInstance");         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::getInstance");
  
           Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
               "%s getInstance. instanceName= %s , includeQualifiers= %s, includeClassOrigin= %s, PropertyList= %s",
               thisProvider,
               (const char *)instanceName.toString().getCString(),
               (const char *)_showBool(includeQualifiers).getCString(),
               (const char*) _showBool(includeClassOrigin).getCString(),
               (const char *)_showPropertyList(propertyList).getCString());
         // Verify that ClassName is correct and get value         // Verify that ClassName is correct and get value
         targetClass classEnum  = _verifyValidClassInput(instanceName.getClassName());         targetClass classEnum  = _verifyValidClassInput(instanceName.getClassName());
  
           _operationNamespace = instanceName.getNameSpace();
         String userName = _validateUserID(context);         String userName = _validateUserID(context);
   
         // begin processing the request         // begin processing the request
         handler.processing();         handler.processing();
         if (classEnum == CIM_OBJECTMANAGER)         if (classEnum == CIM_OBJECTMANAGER)
         {         {
             CIMInstance instance = _buildInstanceCIMObjectManager(includeQualifiers,              CIMInstance instance = _getInstanceCIMObjectManager(includeQualifiers,
                                         includeClassOrigin, propertyList);                                         includeClassOrigin, propertyList);
             handler.deliver(instance);             handler.deliver(instance);
             handler.complete();             handler.complete();
Line 1607 
Line 1820 
             return;             return;
         }         }
  
   
         if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)         if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)
         {         {
             // ATTN: test for correct instance KS: Priority 1             // ATTN: test for correct instance KS: Priority 1
Line 1620 
Line 1832 
             return;             return;
         }         }
  
           if (classEnum == CIM_NAMESPACEINMANAGER)
           {
               handler.complete();
               PEG_METHOD_EXIT();
               return;
           }
   
         // Get List of namespaces         // Get List of namespaces
         Array<CIMNamespaceName> namespaceNames;         Array<CIMNamespaceName> namespaceNames;
         namespaceNames = _enumerateNameSpaces();         namespaceNames = _enumerateNameSpaces();
         CIMInstance instance;         CIMInstance instance;
  
         if (classEnum == CIM_NAMESPACE)          if (classEnum == PG_NAMESPACE)
         {         {
             // Not clear what we have to take into account here.             // Not clear what we have to take into account here.
             // get the namespace from the name value.             // get the namespace from the name value.
Line 1634 
Line 1853 
             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 1646 
Line 1865 
         }         }
         else  // processing for __Namespace         else  // processing for __Namespace
         {         {
             CIMNamespaceName childNamespaceName;              PEGASUS_ASSERT(false);
             CIMNamespaceName getNamespaceName;  
             Boolean isRelativeName;  
   
             _getKeyValue(instanceName, childNamespaceName, isRelativeName);  
             CIMNamespaceName parentNamespaceName = instanceName.getNameSpace();  
   
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                "childNamespaceName = " + childNamespaceName.getString() +  
                (isRelativeName?String("true"):String("false")) +  
                ", parentNamespaceName = " + parentNamespaceName.getString());  
   
   
             getNamespaceName = _generateFullNamespaceName(  
                 namespaceNames, parentNamespaceName,  
                          childNamespaceName, isRelativeName);  
   
             // exception if not valid namespace  
             if (!_isNamespace(namespaceNames, getNamespaceName))  
             {  
               throw CIMObjectNotFoundException("Namespace deos not exist: "  
                                      + getNamespaceName.getString());  
             }  
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                "Namespace = " + getNamespaceName.getString() +  
                    " successfully found.");  
   
             //Set name of class  
             CIMInstance instance(__NAMESPACE_CLASSNAME);  
   
             //  
             // construct the instance  
             //  
             instance.addProperty(CIMProperty(NAMESPACE_PROPERTYNAME,  
             isRelativeName?childNamespaceName.getString():  
                               parentNamespaceName.getString()));  
             //instance.setPath(instanceName);  
        }        }
  
        handler.deliver(instance);        handler.deliver(instance);
Line 1706 
Line 1889 
     InstanceResponseHandler & handler)     InstanceResponseHandler & handler)
     {     {
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::enumerateInstances()");         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::enumerateInstances()");
         // Verify that ClassName is correct and get value  
  
           Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
               "%s enumerateInstances. ref= %s, includeQualifiers= %s, includeClassOrigin= %s, PropertyList= %s",
               thisProvider,
               (const char *) ref.toString().getCString(),
               (const char *) _showBool(includeQualifiers).getCString(),
               (const char *) _showBool(includeClassOrigin).getCString(),
               (const char *) _showPropertyList(propertyList).getCString());
   
           // Verify that ClassName is correct and get value
         targetClass classEnum  = _verifyValidClassInput(ref.getClassName());         targetClass classEnum  = _verifyValidClassInput(ref.getClassName());
  
         // operation namespace needed internally to get class.         // operation namespace needed internally to get class.
         _operationNamespace = ref.getNameSpace();         _operationNamespace = ref.getNameSpace();
           CDEBUG("Namespace = " << _operationNamespace.getString());
         //String userName = _validateUserID(context);         //String userName = _validateUserID(context);
  
         // The following 3 classes deliver a single instance because         // The following 3 classes deliver a single instance because
         // that is all there is today.         // that is all there is today.
         if (classEnum == CIM_OBJECTMANAGER)         if (classEnum == CIM_OBJECTMANAGER)
         {         {
             CIMInstance instance = _buildInstanceCIMObjectManager(includeQualifiers,              CIMInstance instance = _getInstanceCIMObjectManager(includeQualifiers,
                                     includeClassOrigin,                                     includeClassOrigin,
                                     propertyList);                                     propertyList);
   
               //Array<Sint8> tmp;
               ///XmlWriter::appendInstanceElement(tmp, instance);
               //tmp.append('\0');
               //Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
               //        "Instance - XML content: $0", tmp.getData());
               ///XmlWriter::printInstanceElement(instance);
             handler.deliver(instance);             handler.deliver(instance);
             handler.complete();              //handler.complete();
             PEG_METHOD_EXIT();              //PEG_METHOD_EXIT();
             return;              //return;
         }         }
  
         if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)          else if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)
         {         {
             Array<CIMInstance> instances = _buildInstancesPGCIMXMLCommunicationMechanism(includeQualifiers,             Array<CIMInstance> instances = _buildInstancesPGCIMXMLCommunicationMechanism(includeQualifiers,
                                     includeClassOrigin, propertyList);                                     includeClassOrigin, propertyList);
             CDEBUG("Build instances of PGCIMXML. count= " << instances.size());             CDEBUG("Build instances of PGCIMXML. count= " << instances.size());
             handler.deliver(instances);             handler.deliver(instances);
             handler.complete();              //handler.complete();
             PEG_METHOD_EXIT();              //PEG_METHOD_EXIT();
             return;              //return;
         }         }
  
           else if (classEnum == CIM_NAMESPACEINMANAGER)
           {
               //handler.complete();
               //PEG_METHOD_EXIT();
               //return;
           }
  
         if (classEnum == CIM_NAMESPACE)          else if (classEnum == PG_NAMESPACE)
         {         {
             Array<CIMInstance> instances = _getInstancesCIMNamespace(includeQualifiers,             Array<CIMInstance> instances = _getInstancesCIMNamespace(includeQualifiers,
                                     includeClassOrigin, propertyList);                                     includeClassOrigin, propertyList);
  
             handler.deliver(instances);             handler.deliver(instances);
               //handler.complete();
               //PEG_METHOD_EXIT();
               //return;
           }
           else
           {
               throw CIMNotSupportedException
                   ("EnumerateInstance for " + ref.getClassName().getString() + " not supported");
           }
   
             handler.complete();             handler.complete();
   
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
       }
   
   void InteropProvider::modifyObjectManagerInstance(const OperationContext & context,
       const CIMObjectPath & instanceReference,
       const CIMInstance& modifiedIns,
       const Boolean includeQualifiers,
       const CIMPropertyList& propertyList,
       ResponseHandler & handler)
   {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::modifyInstanceManagerInstance");
       // the only allowed modification is this one property, statistical data
       if (modifiedIns.findProperty(OM_GATHERSTATISTICALDATA) != PEG_NOT_FOUND)
       {
           // the following is a temporary hack to set the value of the statistics
           // gathering function dynamically.  We simply get the  value from input
           // and call the internal method to set it each time this object is
           // built.
   #ifndef PEGASUS_DISABLE_PERFINST
           Boolean statisticsFlag = _getPropertyValue(modifiedIns, OM_GATHERSTATISTICALDATA, false);
           CIMInstance instance;
           instance = _getInstanceCIMObjectManager(true, true, CIMPropertyList());
   
           if (statisticsFlag != _getPropertyValue(instance,  OM_GATHERSTATISTICALDATA, false))
           {
               // set the changed property into the
               _setPropertyValue(instance, OM_GATHERSTATISTICALDATA, statisticsFlag);
               // Modify the object on disk
               try
               {
                   _repository->modifyInstance(_operationNamespace,
                                  instance );
               }
               catch(const CIMException&)
               {
                   // ATTN: KS generate log error if this not possible
                   PEG_METHOD_EXIT();
                   throw;
               }
               catch(const Exception&)
               {
                   // ATTN: Generate log error.
                   PEG_METHOD_EXIT();
                   throw;
               }
               Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,
                   "Interop Provider Set Statistics gathering in CIM_ObjectManager: $0",
                   (statisticsFlag? "true" : "false"));
               StatisticalData* sd = StatisticalData::current();
               sd->setCopyGSD(statisticsFlag);
           }
             return;             return;
   #endif
   
       }
       PEG_METHOD_EXIT();
       // ATTN Expand this defintion to be more precise since it allows only mod of
       // one property and that property MUST be in the instance to be modifiable.
       throw CIMNotSupportedException
           (OM_GATHERSTATISTICALDATA.getString() + " modify operation not supported by Interop Provider");
         }         }
   //***************************************************************************
   //                modifyInstance
   //***************************************************************************
   void InteropProvider::modifyInstance(const OperationContext & context,
       const CIMObjectPath & instanceReference,
       const CIMInstance& modifiedIns,
       const Boolean includeQualifiers,
       const CIMPropertyList& propertyList,
       ResponseHandler & handler)
   {
  
         // ATTN: Fix this up.  should not be here.      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
         CIMNamespaceName parentNamespaceName = ref.getNameSpace();              "InteropProvider::modifyInstance");
  
         // ATTN KS Fix this so references both types of namespace      Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
         PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,          "%s modifyInstance. instanceReference= %s, includeQualifiers= %s, PropertyList= %s",
            "parentNamespaceName = " + parentNamespaceName.getString());          thisProvider,
           (const char *) instanceReference.toString().getCString(),
           (const char *) _showBool(includeQualifiers).getCString(),
           (const char *) _showPropertyList(propertyList).getCString());
  
       // ATTN: KS 31 August 2004. This must test for privileged user.
       _operationNamespace = instanceReference.getNameSpace();
       CIMName className =  instanceReference.getClassName();
       targetClass classEnum  = _verifyValidClassInput(instanceReference.getClassName());
   
       String userName = _validateUserID(context);
         // begin processing the request         // begin processing the request
         handler.processing();         handler.processing();
  
         Array<CIMNamespaceName> namespaceNames = _enumerateNameSpaces();      if (classEnum == CIM_OBJECTMANAGER)
   
         Array<CIMInstance> instanceArray;  
         CDEBUG("Found " << namespaceNames.size() << " namespaces.");  
         // Build response objects based on class requested  
         for (Uint32 i = 0; i < namespaceNames.size(); i++)  
         {         {
             // Build the instances. For now simply build the __Namespace instances          modifyObjectManagerInstance(context, instanceReference,modifiedIns,
             // the only property is name.              includeQualifiers, propertyList, handler);
             if (_isChild(parentNamespaceName, namespaceNames[i]))          // for the moment allow modification of the statistics property only
             {      }
                 CIMInstance instance(__NAMESPACE_CLASSNAME);  
                 instance.addProperty(  
                     (CIMProperty(NAMESPACE_PROPERTYNAME,  
                     namespaceNames[i].getString().subString  
                         (parentNamespaceName.getString().size()+1,  
                         namespaceNames[i].getString().size()-  
                     parentNamespaceName.getString().size()-1))));  
  
                 instanceArray.append(instance);      else if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)
       {
  
                 //instance.setPath(instanceName);          PEG_METHOD_EXIT();
                 PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,          throw CIMNotSupportedException
                 "childNamespace = " + namespaceNames[i].getString());              (className.getString() + " not supported by Interop Provider");
             }             }
       else if (classEnum == PG_NAMESPACE)
       {
   #ifdef PEGASUS_OS_OS400
               MessageLoaderParms mparms("ControlProviders.InteropProvider.MODIFY_INSTANCE_NOT_ALLOWED",
                                         "Modify instance operation not allowed by Interop Provider for class $0.",
                                         PG_NAMESPACE_CLASSNAME.getString());
               throw CIMNotSupportedException(mparms);
   #else
           // for the moment allow modification of the statistics property only
           PEG_METHOD_EXIT();
           throw CIMNotSupportedException
               (className.getString() + " not supported by Interop Provider");
   #endif
       }
       else
       {
           PEGASUS_ASSERT(false);  // should never get here.
         }         }
         handler.deliver(instanceArray);  
  
         // complete processing the request  
         handler.complete();         handler.complete();
   
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
       return;
     }     }
  
 //*************************************************************************** //***************************************************************************
 //                enumerateInstanceNames //                enumerateInstanceNames
 //*************************************************************************** //***************************************************************************
   
 void InteropProvider::enumerateInstanceNames( void InteropProvider::enumerateInstanceNames(
         const OperationContext & context,         const OperationContext & context,
         const CIMObjectPath & classReference,         const CIMObjectPath & classReference,
Line 1812 
Line 2109 
         targetClass classEnum  = _verifyValidClassInput(classReference.getClassName());         targetClass classEnum  = _verifyValidClassInput(classReference.getClassName());
  
         String userName = _validateUserID(context);         String userName = _validateUserID(context);
   
         // begin processing the request         // begin processing the request
         handler.processing();         handler.processing();
  
         // The following 3 classes deliver a single instance because          // Deliver a single instance because there should only be one instance.
         // that is all there is today.  
         if (classEnum == CIM_OBJECTMANAGER)         if (classEnum == CIM_OBJECTMANAGER)
         {         {
             CIMInstance instance = _buildInstanceCIMObjectManager( true, true, CIMPropertyList());              CIMInstance instance = _getInstanceCIMObjectManager( true, true, CIMPropertyList());
             CIMObjectPath ref = _buildInstancePath(_operationNamespace,             CIMObjectPath ref = _buildInstancePath(_operationNamespace,
                 CIM_OBJECTMANAGER_CLASSNAME, instance);                 CIM_OBJECTMANAGER_CLASSNAME, instance);
             handler.deliver(ref);             handler.deliver(ref);
Line 1828 
Line 2125 
             return;             return;
         }         }
  
           // Deliver all possible instances of this class
         if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)         if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)
         {         {
             Array<CIMInstance> instances = _buildInstancesPGCIMXMLCommunicationMechanism(true,             Array<CIMInstance> instances = _buildInstancesPGCIMXMLCommunicationMechanism(true,
Line 1844 
Line 2142 
             return;             return;
         }         }
  
         if (classEnum == CIM_NAMESPACE)          if (classEnum == CIM_NAMESPACEINMANAGER)
           {
               handler.complete();
               PEG_METHOD_EXIT();
               return;
           }
   
           if (classEnum == PG_NAMESPACE)
         {         {
             Array<CIMInstance> instances = _getInstancesCIMNamespace(false,             Array<CIMInstance> instances = _getInstancesCIMNamespace(false,
                                     false, CIMPropertyList());                                     false, CIMPropertyList());
Line 1861 
Line 2166 
             return;             return;
         }         }
  
         // __Namespace processing.          if (classEnum == CIM_COMMMECHANISMFORMANAGERINST)
         CIMNamespaceName parentNamespaceName = classReference.getNameSpace();  
         PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
            "parentNamespaceName = " + parentNamespaceName.getString());  
         CDEBUG("Enumerate Instance Names. ns = " << parentNamespaceName.getString());  
   
         // Get list of all namespaces  
         Array<CIMNamespaceName> namespaceNames = _enumerateNameSpaces();  
   
         // Build the cimObjectPath for each namespace found  
         for (Uint32 i = 0; i < namespaceNames.size(); i++)  
         {         {
             Array<CIMKeyBinding> keyBindings;              Array<CIMInstance> instances = _buildInstancesCommMechanismForManager();
             // Build the __Namespace objectpath              for (Uint32 i = 0 ; i < instances.size() ; i++ )
             // Note that for the moment, the only property is name.              {
             if (_isChild(parentNamespaceName, namespaceNames[i]))                  CIMObjectPath ref = _buildObjectPath(_operationNamespace,
             {                          CIM_COMMMECHANISMFORMANAGER_CLASSNAME, instances[i]);
                 keyBindings.clear();                  handler.deliver(ref);
                   keyBindings.append(CIMKeyBinding(NAMESPACE_PROPERTYNAME,              }
                       namespaceNames[i].getString().subString          }
                       (parentNamespaceName.getString().size()+1,  
                       namespaceNames[i].getString().size()-  
                       parentNamespaceName.getString().size()-1),  
                       CIMKeyBinding::STRING));  
   
                   CIMObjectPath ref(String::EMPTY, parentNamespaceName,  
                   __NAMESPACE_CLASSNAME, keyBindings);  
  
           if (classEnum == CIM_NAMESPACEINMANAGERINST)
           {
               Array<CIMInstance> instances = _buildInstancesNamespaceInManager();
               for (Uint32 i = 0 ; i < instances.size() ; i++ )
               {
                   CIMObjectPath ref = _buildObjectPath(_operationNamespace,
                           CIM_NAMESPACEINMANAGER_CLASSNAME, instances[i]);
                   handler.deliver(ref);                   handler.deliver(ref);
                   PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                       "childNamespace = " + namespaceNames[i].getString());  
             }             }
         }         }
         handler.complete();  
  
   
           // ATTN: Exception response because of error
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
     }     }
  
   
 //************************************************************** //**************************************************************
 //************************************************************** //**************************************************************
 // Association Functions // Association Functions
Line 1920 
Line 2213 
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::associatorNames()");             "InteropProvider::associatorNames()");
         throw CIMNotSupportedException("AssociationProvider::associators");          //throw CIMNotSupportedException("AssociationProvider::associators");
 } }
  
 void InteropProvider::associatorNames( void InteropProvider::associatorNames(
Line 1934 
Line 2227 
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::associatorNames()");             "InteropProvider::associatorNames()");
         throw CIMNotSupportedException("AssociationProvider::associatorNames");          //throw CIMNotSupportedException("AssociationProvider::associatorNames");
 } }
  
 void InteropProvider::references( void InteropProvider::references(
Line 1949 
Line 2242 
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::references()");             "InteropProvider::references()");
         throw CIMNotSupportedException("AssociationProvider::references");          //throw CIMNotSupportedException("AssociationProvider::references");
 } }
  
 void _filterAssocInstances(Array<CIMInstance>& instances, void _filterAssocInstances(Array<CIMInstance>& instances,
Line 1960 
Line 2253 
 { {
     return;     return;
 } }
   
 void InteropProvider::referenceNames( void InteropProvider::referenceNames(
         const OperationContext & context,         const OperationContext & context,
         const CIMObjectPath & objectName,         const CIMObjectPath & objectName,
Line 1985 
Line 2279 
  
     targetAssocClass classEnum  = _verifyValidAssocClassInput(targetAssocClassName);     targetAssocClass classEnum  = _verifyValidAssocClassInput(targetAssocClassName);
  
   
     Array<CIMInstance> assocInstances;     Array<CIMInstance> assocInstances;
  
     if (classEnum == CIM_COMMMECHANISMFORMANAGER)      if (classEnum == CIM_COMMMECHANISMFORMANAGERASSOC)
         assocInstances = _buildInstancesCommMechanismForManager();         assocInstances = _buildInstancesCommMechanismForManager();
  
     if (classEnum == CIM_NAMESPACEINMANAGER)      if (classEnum == CIM_NAMESPACEINMANAGERASSOC)
         assocInstances = _buildInstancesNamespaceInManager();         assocInstances = _buildInstancesNamespaceInManager();
  
     _filterAssocInstances(assocInstances, resultClass, role);     _filterAssocInstances(assocInstances, resultClass, role);
Line 2002 
Line 2295 
                 targetAssocClassName, assocInstances[i]);                 targetAssocClassName, assocInstances[i]);
         CDEBUG("referenceNames returns: " << ref.toString());         CDEBUG("referenceNames returns: " << ref.toString());
         handler.deliver(ref);         handler.deliver(ref);
   
     }     }
   
     handler.complete();     handler.complete();
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     // Convert the instances to referenceNames response     // Convert the instances to referenceNames response
   
 } }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.5.2.12  
changed lines
  Added in v.1.34

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2