(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.43 and 1.72

version 1.43, 2005/06/02 12:54:31 version 1.72, 2008/02/20 14:00:31
Line 1 
Line 1 
 //%2005////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // 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.
Line 8 
Line 8 
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 // EMC Corporation; VERITAS Software Corporation; The Open Group. // EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; Symantec 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 25 
Line 27 
 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // //
 //==============================================================================  //=============================================================================
 //  
 // Author: Karl Schopmeyer (k.schopmeyer@opengroup.org)  
 //  
 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company  
 //                (carolann_graves@hp.com)  
 //              Karl Schopmeyer - Created Cim_Namespace capabilities.  
 //              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)  
 //              Aruran, IBM (ashanmug@in.ibm.com) for Bug# 3659  
 // //
 //%//////////////////////////////////////////////////////////////////////////// //%////////////////////////////////////////////////////////////////////////////
  
   
 /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
 //  Interop Provider - This provider services those classes from the //  Interop Provider - This provider services those classes from the
 //  DMTF Interop schema association with the CIMOM itself  //  DMTF Interop schema in an implementation compliant with the SMI-S v1.1
   //  Server Profile
 // //
 //  This provider services the following classes:  //  Please see PG_ServerProfile20.mof in the directory
 //      CIMObjectManager  //  $(PEGASUS_ROOT)/Schemas/Pegasus/InterOp/VER20 for retails regarding the
 //      CIM_ObjectManagerCommunicationMechanism  //  classes supported by this control provider.
 //      CIM_CIMXMLCommunicationMechanism  //
 //      CIM_ProtocolAdapter  (Note: Removed because deprecated class in cim 2.9)  //  Interop forces all creates to the PEGASUS_NAMESPACENAME_INTEROP
 //      CIM_Namespace (Effective Pegasus 2.4 we use PG_Namespace.  //  namespace. There is a test on each operation that returns
 //  //  the Invalid Class CIMDError
 //      PG_Namespace - Pegasus particular subclass of CIM_Namespace that  
 //      add the parameters for shared namespaces  
 //  
 //      PG_CIMXMLCommunicationMechanism - Pegasus subclass of  
 //      CIM_CIMXMLCommunicationMechanism that adds support for passing  
 //      additional communication parameters (ie. port, https vs. http, etc.)  
 //  
 //      It also services the Interop associations tied to these classes  
 //      including:  
 //      CIM_NamespaceInManager  
 //      ...  
 //      This is a control provider and as such uses the Tracer functions //      This is a control provider and as such uses the Tracer functions
 //      for data and function traces.  Since we do not expect high volume //      for data and function traces.  Since we do not expect high volume
 //      use we added a number of traces to help diagnostics. //      use we added a number of traces to help diagnostics.
 /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
 /* TODO LIST:  
     1. Finish the association functions  
   
     2. UUID generation should become a system function since it will be used  
        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>
 #include <Pegasus/Common/PegasusVersion.h> #include <Pegasus/Common/PegasusVersion.h>
Line 85 
Line 55 
 #include <iostream> #include <iostream>
  
 #include "InteropProvider.h" #include "InteropProvider.h"
 #include "Guid.h"  #include "InteropProviderUtils.h"
 #include <Pegasus/Common/String.h>  #include "InteropConstants.h"
 #include <Pegasus/Common/System.h>  
 #include <Pegasus/Common/ArrayInternal.h>  
 #include <Pegasus/Common/CIMName.h>  
 #include <Pegasus/Common/CIMType.h>  
 #include <Pegasus/Common/CIMInstance.h>  
 #include <Pegasus/Common/CIMObjectPath.h>  
 #include <Pegasus/Common/InternalException.h>  
 #include <Pegasus/Common/CIMStatusCode.h>  
 #include <Pegasus/Common/Tracer.h>  
 #include <Pegasus/Common/OperationContext.h>  
 #include <Pegasus/Config/ConfigManager.h>  
 #include <Pegasus/Common/XmlWriter.h>  
 #include <Pegasus/Config/ConfigManager.h>  
 #include <Pegasus/Common/StatisticalData.h>  
 #include <Pegasus/Common/HashTable.h>  
   
   
 #include <stdlib.h>  
  
 //The following include is needed for gethostbyname  #include <Pegasus/Common/StatisticalData.h>
 #if defined(PEGASUS_OS_TYPE_WINDOWS)  
 #include <objbase.h>  
 #else  
 #include <netdb.h>  
 #include <arpa/inet.h>  
 #endif  
  
 PEGASUS_USING_STD; PEGASUS_USING_STD;
   
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 #define CDEBUG(X)  /*****************************************************************************
 #define LDEBUG()   *
 //#define CDEBUG(X) PEGASUS_STD(cout) << "InteropProvider " << X << PEGASUS_STD(endl)   * The following are constants representing property names for the classes
 //#define LDEBUG(X) Logger::put (Logger::DEBUG_LOG, "InteropProvider", Logger::TRACE, "$0", X)   * managed by the Interop Provider. Where multiple classes have properties of
    * the same name, there will be a common CIMName object defined, and a macro
 //**************************************************************************   * defined that points to the common CIMName object, but whose macro name
 //   * reflects the class in which the property is used.
 //    Constants representing the class names processed   *
 //   *****************************************************************************/
 //**************************************************************************  
   //
 const char * thisProvider = "InteropProvider";  // Constructor for the InteropProvider control provider
 // The following should be moved to somewhere like constants.  //
 static const String PegasusInstanceIDGlobalPrefix = "PEG";  InteropProvider::InteropProvider(CIMRepository * rep) : repository(rep),
       hostName(System::getHostName()), providerInitialized(false),
 /**      profileIds(Array<String>()), conformingElements(Array<CIMNameArray>()),
     The constants representing the class names we process      elementNamespaces(Array<CIMNamespaceArray>())
 */  
 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_OBJECTMANAGERCOMMUNICATIONMECHANISM_CLASSNAME  =  
         CIMName ("CIM_ObjectManagerCommunicationMechanism");  
 static const CIMName PG_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME  =  
         CIMName ("PG_CIMXMLCommunicationMechanism");  
 static const CIMName CIM_COMMMECHANISMFORMANAGER_CLASSNAME  =  
         CIMName ("CIM_CommMechanismForManager");  
 static const CIMName CIM_NAMESPACEINMANAGER_CLASSNAME  =  
         CIMName ("CIM_NamespaceInManager");  
   
 // Property Names for CIM_Namespace Class  
 static const CIMName NAMESPACE_PROPERTYNAME  = CIMName ("Name");  
   
 // Root Namespace Name for test.  
 static const CIMNamespaceName ROOTNS  = CIMNamespaceName ("root");  
   
   
 // Property names for CIM_ObjectManager Class  
 static const CIMName OM_GATHERSTATISTICALDATA  =  
  CIMName ("GatherStatisticalData");  
   
 // Property for the slp template.  
 static const CIMName OM_DESCRIPTIONPROPERTY =  
     CIMName("Description");  
   
 // Property Names for ObjectManagerCommunicationMechanism Class  
 static const CIMName OM_COMMUNICATIONMECHANISM  =  
         CIMName ("CommunicationMechanism");  
 static const CIMName OM_FUNCTIONALPROFILESSUPPORTED  =  
  CIMName ("FunctionalProfilesSupported");  
 static const CIMName OM_FUNCTIONALPROFILEDESCRIPTIONS  =  
  CIMName ("FunctionalProfileDescriptions");  
 static const CIMName OM_AUTHENTICATIONMECHANISMSSUPPORTED  =  
  CIMName ("AuthenticationMechanismsSupported");  
 static const CIMName OM_AUTHENTICATIONMECHANISMDESCRIPTIONS  =  
  CIMName ("AuthenticationMechanismDescriptions");  
 static const CIMName OM_MULTIPLEOPERATIONSSUPPORTED  =  
  CIMName ("MultipleOperationsSupported");  
 static const CIMName OM_VERSION  =  
  CIMName ("Version");  
   
 // Property Names for CIMXML CommunicationMechanism  
   
 static const CIMName CIMVALIDATED  =  
  CIMName ("CIMValidated");  
   
 static const String CIMXMLProtocolVersion = "1.0";  
   
 // Property names for CIM_Namespace Class  
   
 static const CIMName CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME =  
         CIMName ("SystemCreationClassName");  
 static const CIMName CIM_NAMESPACE_PROPERTY_SYSTEMNAME =  
         CIMName ("SystemName");  
 static const CIMName CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME =  
         CIMName ("ObjectManagerCreationClassName");  
 static const CIMName CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME =  
         CIMName ("ObjectManagerName");  
 static const CIMName CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME =  
         CIMName ("CreationClassName");  
 static const CIMName CIM_NAMESPACE_PROPERTY_NAME  = CIMName ("Name");  
 static const CIMName CIM_NAMESPACE_PROPERTY_CLASSINFO =  
         CIMName ("ClassInfo");  
 static const CIMName CIM_NAMESPACE_PROPERTY_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  
 // operations.  
   
 enum targetClass{  
         PG_NAMESPACE = 1,  
         CIM_OBJECTMANAGER = 2,  
         PG_CIMXMLCOMMUNICATIONMECHANISM = 3,  
         CIM_NAMESPACEINMANAGERINST =4,  
         CIM_COMMMECHANISMFORMANAGERINST=5,  
         CIM_NAMESPACEINMANAGER=6  
     };  
   
  enum targetAssocClass{  
      CIM_NAMESPACEINMANAGERASSOC = 1,  
      CIM_COMMMECHANISMFORMANAGERASSOC=2  
  };  
   
   
 //*************************************************************  
 //  Constructor  
 //**********************************************************  
 InteropProvider::InteropProvider(CIMRepository* repository)  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,"InteropProvider::InteropProvider");     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 inalization work. This fix sets StatisticalData::CopyGSD, enabling the  
     //statistical gathering function.  
   
   
      Boolean InstancesExists = true;  
      Array<CIMInstance> instance;  
  
   #ifndef PEGASUS_DISABLE_PERFINST
      try      try
      {      {
          instance = repository->enumerateInstances(CIMNamespaceName("root/cimv2"),          initProvider();
                                                    CIMName ("CIM_ObjectManager"));  
      }      }
      catch(Exception e)      catch(const Exception &)
      {      {
        InstancesExists = false;          // Provider initialization may fail if the repository is not
           // populated
      }      }
   #endif
  
      /* When Bug 3696 is fixed the following try block will replace the try block above. But for      PEG_METHOD_EXIT();
         now if no instances of the CIM_ObjectManager class are found in the root/cimv2 name space  
         the root/PG_InterOp name space will be checked  
      */  
      if(!InstancesExists)  
      {  
          try  
          {  
              instance = repository->enumerateInstances(CIMNamespaceName("root/PG_InterOp"),  
                                                        CIMName ("CIM_ObjectManager"));  
          }          }
          catch(Exception e)  
   //
   // Local version of getInstance to be used by other functions in the the
   // provider. Returns a single instance. Note that it always returns an
   // instance. If none was found, it is uninialitized.
   //
   CIMInstance InteropProvider::localGetInstance(
       const OperationContext & context,
       const CIMObjectPath & instanceName,
       const CIMPropertyList & propertyList)
          {          {
              InstancesExists = false;      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::localGetInstance");
          }  
       PEG_TRACE((TRC_CONTROLPROVIDER, Tracer::LEVEL4,
           "%s getInstance. instanceName= %s , PropertyList= %s",
           thisProvider,
           (const char *)instanceName.toString().getCString(),
           (const char *)propertyListToString(propertyList).getCString()));
   
       // Test if we're looking for something outside of our namespace. This will
       // happen during associators calls from PG_RegisteredProfile instances
       // through the PG_ElementConformsToProfile association
       CIMNamespaceName opNamespace = instanceName.getNameSpace();
       CIMName opClass = instanceName.getClassName();
       if(opNamespace != PEGASUS_NAMESPACENAME_INTEROP &&
           opClass != PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE)
       {
           AutoMutex mut(interopMut);
           CIMInstance gotInstance = cimomHandle.getInstance(
                                            context,
                                            opNamespace,
                                            instanceName,
                                            false,
                                            false,
                                            false,
                                            propertyList);
           PEG_METHOD_EXIT();
           return gotInstance;
      }      }
  
      if(instance.size() > 0 && InstancesExists)      // Create reference from host, namespace, class components of
      {      // instance name
         Boolean output = false;      CIMObjectPath ref;
         Uint32 pos;      ref.setHost(instanceName.getHost());
         if ((pos = instance[0].findProperty(CIMName("GatherStatisticalData"))) != PEG_NOT_FOUND)      ref.setClassName(opClass);
         {      ref.setNameSpace(opNamespace);
             CIMConstProperty p1 = instance[0].getProperty(pos);  
             if (p1.getType() == CIMTYPE_BOOLEAN)      // Enumerate instances for this class. Returns all instances
             {      // Note that this returns paths setup and instances already
                 CIMValue v1  = p1.getValue();      // filtered per the input criteria.
                 if (!v1.isNull())      Array<CIMInstance> instances =  localEnumerateInstances(
           context,
           ref,
           propertyList);
   
       // deliver a single instance if found.
       CIMInstance retInstance;
   
       bool found = false;
       for(Uint32 i = 0, n = instances.size(); i < n; i++)
                 {                 {
                     v1.get(output);          CIMObjectPath currentInstRef = instances[i].getPath();
                     if (v1 == true)          currentInstRef.setHost(instanceName.getHost());
           currentInstRef.setNameSpace(instanceName.getNameSpace());
           if(instanceName == currentInstRef)
                     {                     {
                         StatisticalData* sd = StatisticalData::current();              retInstance = instances[i];
                         sd->setCopyGSD(true);              found = true;
                     }              break;
                 }  
             }             }
         }         }
   
       if(!found)
       {
         cout << "Coule not find instance: " << instanceName.toString() << endl;
     }     }
     //******************************************* end of temporary fix  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
       return retInstance;
  }  }
  
 //***************************************************************  
 // Provider Utility Functions  
 //***************************************************************  
  
 String _showBool(Boolean x)  //
   // Local version of enumerateInstances to be used by other functions in the
   // provider. Note that this delivers instances as a group rather than one
   // at a time. This design point may need to be revisited if this provider
   // is used in environments such that returning segmented responses would have
   // significant performance advantages. For now, that doesn't seem to be the
   // case.
   //
   Array<CIMInstance> InteropProvider::localEnumerateInstances(
       const OperationContext & context,
       const CIMObjectPath & ref,
       const CIMPropertyList& propertyList)
 { {
     return(x? "true" : "false");      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
 }          "InteropProvider::localEnumerateInstances()");
       const CIMName & className = ref.getClassName();
       PEG_TRACE((TRC_CONTROLPROVIDER, Tracer::LEVEL4,
           "%s enumerateInstances. referenc= %s , PropertyList= %s",
           thisProvider,
           (const char *)className.getString().getCString(),
           (const char *)propertyListToString(propertyList).getCString()));
   
       // Verify that ClassName is correct and get its enum value
       TARGET_CLASS classEnum  = translateClassInput(className);
  
 static String _toStringPropertyList(const CIMPropertyList& pl)      Array<CIMInstance> instances;
       switch(classEnum)
 { {
     String tmp;          case PG_OBJECTMANAGER:
     for (Uint32 i = 0; i < pl.size() ; i++)  
     {     {
         if (i > 0)              instances.append(getObjectManagerInstance());
             tmp.append(", ");              break;
         tmp.append(pl[i].getString());  
     }     }
     return(tmp);          case PG_CIMXMLCOMMUNICATIONMECHANISM:
           {
               instances = enumCIMXMLCommunicationMechanismInstances();
               break;
 } }
           case PG_NAMESPACEINMANAGER:
   
 /* set the hostname and namespace fields into the cimobjectpath  
    of the defined instance  
 */  
   
 void _setCompleteInstancePath(CIMInstance& instance,  
                            const CIMObjectPath& inputPath)  
 { {
     CIMObjectPath p = instance.getPath();              instances = enumNamespaceInManagerInstances();
     p.setHost(inputPath.getHost());              break;
     p.setNameSpace(inputPath.getNameSpace());  
   
     instance.setPath(p);  
 } }
           case PG_COMMMECHANISMFORMANAGER:
 /* complete the instance by setting the complete path into the instance  
    and executing the instance filter to set the qualifiers, classorigin and  
    propertylist in accordance with the input.  Note that this can only remove  
    characteristics, except for the path completion so that it expects instances  
    with qualifiers included, class origin included and a complete property  
    list.  
 */  
   
   
  void _finishInstance(CIMInstance& instance, const CIMObjectPath& path, Boolean includeQualifiers,  
      Boolean includeClassOrigin, const CIMPropertyList& propertyList)  
  {  {
      _setCompleteInstancePath( instance, path);              instances = enumCommMechanismForManagerInstances();
               break;
      instance.filter(includeQualifiers,  
                      includeClassOrigin,  
                      propertyList );  
  }  }
 static String _showPropertyList(const CIMPropertyList& pl)          case PG_NAMESPACE:
 { {
     if (pl.isNull())              instances = enumNamespaceInstances();
         return("NULL");              break;
   
     String tmp;  
   
     tmp.append((pl.size() == 0) ? "Empty" : _toStringPropertyList(pl));  
     return(tmp);  
 } }
           case PG_REGISTEREDPROFILE:
 /** 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 propertyName String name of the property containing the value  
     @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  
     @return String value found or defaultValue.  
 */  
 String _getPropertyValue(const CIMInstance& instance, const CIMName& propertyName, const String& defaultValue)  
 { {
     String output = defaultValue;              instances = enumRegisteredProfileInstances();
     Uint32 pos;              break;
     if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)          }
           case PG_REGISTEREDSUBPROFILE:
     {     {
         CIMConstProperty p1 = instance.getProperty(pos);              instances = enumRegisteredSubProfileInstances();
         if (p1.getType() == CIMTYPE_STRING)              break;
           }
           case PG_REFERENCEDPROFILE:
         {         {
             CIMValue v1  = p1.getValue();              instances = enumReferencedProfileInstances();
               break;
             if (!v1.isNull())  
                 v1.get(output);  
         }         }
           case PG_ELEMENTCONFORMSTOPROFILE:
           {
               instances = enumElementConformsToProfileInstances(context,
                   ref.getNameSpace());
               break;
     }     }
     return(output);          case PG_ELEMENTCONFORMSTOPROFILE_RP_RP:
           {
               instances = enumElementConformsToProfileRPRPInstances(
                   context,
                   ref.getNameSpace());
               break;
 } }
           case PG_SUBPROFILEREQUIRESPROFILE:
 // Overload of _getPropertyValue for boolean type  
 Boolean _getPropertyValue(const CIMInstance& instance, const CIMName& propertyName, const Boolean defaultValue)  
 { {
     Boolean output = defaultValue;              instances = enumSubProfileRequiresProfileInstances();
     Uint32 pos;              break;
     if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)          }
           case PG_SOFTWAREIDENTITY:
     {     {
         CIMConstProperty p1 = instance.getProperty(pos);              instances = enumSoftwareIdentityInstances();
         if (p1.getType() == CIMTYPE_BOOLEAN)              break;
           }
           case PG_ELEMENTSOFTWAREIDENTITY:
         {         {
             CIMValue v1  = p1.getValue();              instances = enumElementSoftwareIdentityInstances();
               break;
             if (!v1.isNull())  
                 v1.get(output);  
         }         }
           case PG_INSTALLEDSOFTWAREIDENTITY:
           {
               instances = enumInstalledSoftwareIdentityInstances();
               break;
     }     }
     return(output);          case PG_COMPUTERSYSTEM:
           {
               instances.append(getComputerSystemInstance());
               break;
 } }
           case PG_HOSTEDOBJECTMANAGER:
 /** get Host IP address from host name. If the  
     host name is not provided, uses internal function.  
     If everything fails, gets the definition normally  
     used for localhost (127.0.0.1).  
   
     @param hostName String with the name of the host  
     @param namespaceType - Uint32 representing the  
     access protocol for this request.  This is exactly  
     the definition in the PG_CIMXMLCommunicationMechanism  
     mof for the property namespaceAccessProtocol.  
     @return String with the IP address to be used. This must  
     be the complete address sufficient to access the  
     IP address. Therefore, it includes the port number.  
 */  
 String _getHostAddress(String & hostName, Uint32  namespaceType)  
 { {
   String ipAddress;              instances.append(getHostedObjectManagerInstance());
               break;
   if (hostName == String::EMPTY)          }
         hostName = System::getHostName();          case PG_HOSTEDACCESSPOINT:
   
   if ((ipAddress = System::getHostIP(hostName)) == String::EMPTY)  
   {   {
       // set default address if everything else failed              instances = enumHostedAccessPointInstances();
       ipAddress = String("127.0.0.1");              break;
           }
           default:
               PEG_METHOD_EXIT();
               throw CIMNotSupportedException(className.getString() +
                 " not supported by Interop Provider enumerate");
   }   }
   // Question: is there a case where we leave off the port number.  
   // Code to get the property service_location_tcp ( which is equivalent to "IP address:5988")  
   // Need to tie these two together.  
   Uint32 portNumber;  
   
   /********************** Drop this  
   ConfigManager* configManager = ConfigManager::getInstance();  
   Boolean enableHttpConnection = String::equal(  
       configManager->getCurrentValue("enableHttpConnection"), "true");  
   Boolean enableHttpsConnection = String::equal(  
       configManager->getCurrentValue("enableHttpsConnection"), "true");  
   ***********************/  
   
   // ATTN: The following is incorrect and must be modified as part  
   // of bug 1857 and possibly other bug reports. KS. This is 2.5 mustfix.  
  
   // Match the protocol and port number from internal information.      // Filter and deliver the resulting instances
   if (namespaceType == 3)      for (Uint32 i = 0 ; i < instances.size() ; i++)
        portNumber = System::lookupPort(WBEM_HTTPS_SERVICE_NAME,  
           WBEM_DEFAULT_HTTPS_PORT);  
   else if (namespaceType == 2)  
   {   {
       portNumber = System::lookupPort(WBEM_HTTP_SERVICE_NAME,          normalizeInstance(instances[i], ref, false,
           WBEM_DEFAULT_HTTP_PORT);              false, propertyList);
   }   }
   else  
       portNumber = 0;  
   // convert portNumber to ascii  
   char buffer[32];  
   sprintf(buffer, ":%u", portNumber);  
   if (portNumber != 0)  
       ipAddress.append(buffer);  
  
   // now fillout the serviceIDAttribute from the object manager instance name property.      PEG_METHOD_EXIT();
   // This is a key field so must have a value.      return instances;
   //String strUUID = _getPropertyValue( instance_ObjMgr, namePropertyName, "DefaultEmptyUUID");  
   
   return ipAddress;  
 } }
  
  Array<String> _getFunctionalProfiles(Array<Uint16> & profiles)  //
   // Class that determines whether or not the origin class in an association
   // operation is valid for the given association class, and also determines
   // the origin and target "roles". These values generally correspond to the
   // role and resultRole parameter of an associators/associatorNames operation.
   //
   bool InteropProvider::validAssocClassForObject(
       const OperationContext & context,
       const CIMName & assocClass,
       const CIMObjectPath & objectName,
       const CIMNamespaceName & opNamespace,
       String & originProperty,
       String & targetProperty)
   {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
           "InteropProvider::validAssocClassForObject()");
       TARGET_CLASS assocClassEnum = translateClassInput(assocClass);
       TARGET_CLASS originClassEnum;
       CIMName originClass = objectName.getClassName();
       // If the association class is PG_ElementConformsToProfile, we'll have to
       // do some special processing in case the origin instance for the operation
       // is managed by another provider.
       if(assocClassEnum == PG_ELEMENTCONFORMSTOPROFILE)
       {
           // Test if the origin is an element managed by another provider
           // that has implemented a registered profile.
           if(opNamespace != PEGASUS_NAMESPACENAME_INTEROP ||
               (originClass != PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE &&
                originClass != PEGASUS_CLASSNAME_PG_OBJECTMANAGER ))
           {
               //
               // Search the cached conformingElements list for the originClass,
               // returning false if it is not found
               //
               bool found = false;
   
               PEGASUS_ASSERT(conformingElements.size() ==
                   elementNamespaces.size());
               for(Uint32 i = 0, n = conformingElements.size(); i < n; ++i)
               {
                   CIMNameArray & elementList = conformingElements[i];
                   CIMNamespaceArray & namespaceList = elementNamespaces[i];
                   PEGASUS_ASSERT(elementList.size() == namespaceList.size());
                   for(Uint32 j = 0, m = elementList.size(); j < m; ++j)
                   {
                       CIMName & curElement = elementList[j];
                       if((curElement == originClass ||
                         curElement.getString().find(PEGASUS_DYNAMIC) == 0) &&
                         opNamespace == namespaceList[j])
  {  {
      Array<String> profileDescriptions;                          found = true;
      profiles.append(2); profileDescriptions.append("Basic Read");                          break;
      profiles.append(3); profileDescriptions.append("Basic Write");                      }
      profiles.append(4); profileDescriptions.append("Schema Manipulation");                  }
      profiles.append(5); profileDescriptions.append("Instance Manipulation");                  if(found)
      profiles.append(6); profileDescriptions.append("Association Traversal");                      break;
      profiles.append(8); profileDescriptions.append("Qualifier Declaration");  
      profiles.append(9); profileDescriptions.append("Indications");  
      return(profileDescriptions);  
  }  }
  
 /*  get the prefix that will be part of the cimom identification              if(!found)
     This can be either the default PEG or if the environment  
     variable PEGASUS_TRADEMARK_PREFIX is defined this is used.  
     NOTE: getting from the environment variable is a hack until  
     we can come up with a better source.  
     @return String containing the unique name for the CIMOM ID  
 */  
   
 String getTrademarkCIMOMIDPrefix()  
 { {
                   PEG_METHOD_EXIT();
     char * trademark;                  return false;
     trademark = getenv("PEGASUS_TRADEMARK_PREFIX");              }
     return((trademark)? trademark : PegasusInstanceIDGlobalPrefix);  
 } }
 /** Builds the UUID string for this CIMOM.      }
 **/      else
 String getUUIDString()  
 { {
     return(Guid::getGuid());          // Otherwise, just get the enum value representing the origin class
           // for this operation
           originClassEnum = translateClassInput(originClass);
 } }
  
 /* Test the keys in the CIM_Namespace for valid values      CIMName expectedTargetRole;
    This includes all of the keys above the name key.      CIMName expectedOriginRole;
    THis is a dummy for now.  
    ATTN: KS Extend and finish this function.      Array<CIMName> propNames;
 */      String profileName;
 Boolean _validateProperties(const CIMObjectPath& path)      CIMPropertyList propertyList;
       CIMInstance tmpInstance;
       Uint32 index;
       propNames.clear();
   
       //
       // Set the target and origin role values. Note that if these values are
       // not set following the switch block, that implies that the origin class
       // is not valid for the supplied association class.
       //
       switch(assocClassEnum)
 { {
     return true;        case PG_NAMESPACEINMANAGER:
             if(originClassEnum == PG_OBJECTMANAGER)
             {
                 expectedTargetRole = PROPERTY_DEPENDENT;
                 expectedOriginRole = PROPERTY_ANTECEDENT;
 } }
             else if(originClassEnum == PG_NAMESPACE)
 Boolean _validateProperties(const CIMInstance& instance)  
 { {
     return true;                expectedTargetRole = PROPERTY_ANTECEDENT;
                 expectedOriginRole = PROPERTY_DEPENDENT;
 } }
             break;
 /* Validate that the property exists, is string type and        case PG_COMMMECHANISMFORMANAGER:
    optionally the value itself. Note processes only String            if(originClassEnum == PG_OBJECTMANAGER)
    properties.  
    @param Instance to search for property.  
    @param CIMName containing property Name  
    @value String containing value. If not String::EMPTY, compare to  
    value in the property  
    @return True if passes all tests  
 */  
 Boolean _validateRequiredProperty(const CIMInstance& instance,  
                           const CIMName& propertyName,  
                           const String& value)  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,                expectedTargetRole = PROPERTY_DEPENDENT;
             "InteropProvider::_validateRequiredProperty()");                expectedOriginRole = PROPERTY_ANTECEDENT;
     Uint32 pos;            }
             else if(originClassEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)
     if ((pos = instance.findProperty (propertyName)) == PEG_NOT_FOUND)  
     {     {
         PEG_METHOD_EXIT();                expectedTargetRole = PROPERTY_ANTECEDENT;
         return(false);                expectedOriginRole = PROPERTY_DEPENDENT;
     }     }
     //            break;
     //  Get the property        case PG_ELEMENTCONFORMSTOPROFILE:
     //            if(originClass.equal(PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE))
     CIMConstProperty theProperty = instance.getProperty(pos);  
     const CIMValue theValue = theProperty.getValue ();  
     //  
     //  ATTN: Required property must have a non-null value  
     //  
     if ((theValue.getType() != CIMTYPE_STRING) || (theValue.isNull()))  
     {     {
         PEG_METHOD_EXIT();                expectedTargetRole =
         return(false);                    ELEMENTCONFORMSTOPROFILE_PROPERTY_MANAGEDELEMENT;
                 expectedOriginRole =
                     ELEMENTCONFORMSTOPROFILE_PROPERTY_CONFORMANTSTANDARD;
     }     }
             else
     String valueField;  
     theValue.get(valueField);  
     if ((value == String::EMPTY) || (valueField == value))  
     {     {
         PEG_METHOD_EXIT();                expectedTargetRole =
         return(true);                    ELEMENTCONFORMSTOPROFILE_PROPERTY_CONFORMANTSTANDARD;
                 expectedOriginRole =
                     ELEMENTCONFORMSTOPROFILE_PROPERTY_MANAGEDELEMENT;
     }     }
     PEG_METHOD_EXIT();            break;
     return(false);        case PG_ELEMENTCONFORMSTOPROFILE_RP_RP:
             propNames.append(CIMName("RegisteredName"));
             propertyList = CIMPropertyList(propNames);
             tmpInstance = localGetInstance(
                 context,
                 objectName,
                 propertyList);
             index = tmpInstance.findProperty("RegisteredName");
             if (index != PEG_NOT_FOUND)
             {
                 const CIMValue &tmpVal =
                     tmpInstance.getProperty(index).getValue();
                 if (!tmpVal.isNull())
                 {
                     tmpVal.get(profileName);
 } }
             }
 Boolean _validateRequiredProperty(const CIMInstance& instance,            if (String::compareNoCase(profileName, String("SMI-S")) == 0)
                           const CIMName& propertyName,  
                           const Uint16& value)  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,                expectedTargetRole =
         "InteropProvider::_validateRequiredProperty()");                    ELEMENTCONFORMSTOPROFILE_PROPERTY_MANAGEDELEMENT;
                 expectedOriginRole =
     PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4, "Validate "                    ELEMENTCONFORMSTOPROFILE_PROPERTY_CONFORMANTSTANDARD;
         + propertyName.getString());            }
             else
     Uint32 pos;  
     if ((pos = instance.findProperty (propertyName)) == PEG_NOT_FOUND)  
     {     {
         PEG_METHOD_EXIT();                expectedTargetRole =
         return(false);                    ELEMENTCONFORMSTOPROFILE_PROPERTY_CONFORMANTSTANDARD;
                 expectedOriginRole =
                     ELEMENTCONFORMSTOPROFILE_PROPERTY_MANAGEDELEMENT;
     }     }
     //            break;
     //  Get the property        case PG_SUBPROFILEREQUIRESPROFILE:
     //            if(originClassEnum == PG_REGISTEREDPROFILE)
     CIMConstProperty theProperty = instance.getProperty(pos);  
     CIMValue theValue = theProperty.getValue ();  
     //  
     //  ATTN:Required property must have a non-null value  
     //  
     if ((theValue.getType() != CIMTYPE_UINT16)  
         || (theValue.isNull()) )  
     {     {
         PEG_METHOD_EXIT();                expectedTargetRole = PROPERTY_DEPENDENT;
         return(false);                expectedOriginRole = PROPERTY_ANTECEDENT;
     }     }
     PEG_METHOD_EXIT();            else if(originClassEnum == PG_REGISTEREDSUBPROFILE)
     return(true);            {
                 expectedTargetRole = PROPERTY_ANTECEDENT;
                 expectedOriginRole = PROPERTY_DEPENDENT;
 } }
             break;
 Boolean _validateRequiredProperty(const CIMObjectPath& objectPath,        case PG_REFERENCEDPROFILE:
                           const CIMName& propertyName,            if (originClassEnum == PG_REGISTEREDSUBPROFILE)
                           const String value)  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,                expectedTargetRole = PROPERTY_ANTECEDENT;
             "InteropProvider::_validateRequiedProperty()");                expectedOriginRole = PROPERTY_DEPENDENT;
     Array<CIMKeyBinding> kbArray = objectPath.getKeyBindings();            }
             else if (originClassEnum == PG_REGISTEREDPROFILE)
     // find the correct key binding  
     for (Uint32 i = 0; i < kbArray.size(); i++)  
     {     {
         if (kbArray[i].getName() == propertyName)                if ((targetProperty.size() != 0) &&
                     (originProperty.size() != 0) &&
                     String::equalNoCase(targetProperty, originProperty))
         {         {
             if (value != String::EMPTY)                    return false;
                 }
                 if (targetProperty.size() != 0)
             {             {
                 if (value !=kbArray[i].getValue())                    if (!(String::equalNoCase(targetProperty, "Antecedent") ||
                         String::equalNoCase(targetProperty, "Dependent") ))
                 {                 {
                     PEG_METHOD_EXIT();                        return false;
                     return(true);  
                 }                 }
             }             }
                 if (originProperty.size() != 0)
                 {
                     if (!(String::equalNoCase(originProperty, "Antecedent") ||
                         String::equalNoCase(originProperty, "Dependent") ))
                     {
                         return false;
         }         }
     }     }
     PEG_METHOD_EXIT();                if (String::equalNoCase(originProperty, "Antecedent") &&
     return(true);                    targetProperty.size() == 0)
                 {
                     targetProperty = String("Dependent");
 } }
                 if (String::equalNoCase(originProperty, "Dependent") &&
 /* Query the repository for array of all namespacenames                    targetProperty.size() == 0)
    @return Array<CIMNamespaceName> with all namespaces  
    @exception Passes all exception that repository may generate.  
 */  
 Array<CIMNamespaceName> InteropProvider::_enumerateNameSpaces()  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,                    targetProperty = String("Antecedent");
             "InteropProvider::_enumerateNameSpaces()");  
   
     Array<CIMNamespaceName> namespaceNames;  
   
     namespaceNames = _repository->enumerateNameSpaces();  
   
     PEG_METHOD_EXIT();  
     return(namespaceNames);  
 } }
                 if (String::equalNoCase(targetProperty, "Antecedent") &&
 /* get a class defintion. Gets the class defined by                    originProperty.size() == 0)
     the parameters. Generates exception of class not defined.  
    @param namespace in which to look for the class.  
    @param name of class to get.  
    @return the CIMClass object  
    @Exceptions any repository exceptions if class not found.  
 */  
 CIMClass InteropProvider::_getClass(const CIMObjectPath& objectPath,  
                                     const CIMName& className)  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,                    originProperty = String("Dependent");
             "InteropProvider::_getClass");  
   
     CIMClass myClass = _repository->getClass(objectPath.getNameSpace(), className,  
                             false,true,true);  
     PEG_METHOD_EXIT();  
     return myClass;  
 } }
                 if (String::equalNoCase(targetProperty, "Dependent") &&
 /* Verify that this is one of the legal classnames and                    originProperty.size() == 0)
    return indicator which.  
    @param - Classname  
    @return - Uint32 indicating type  
    @Exceptions - throws CIMNotSupportedException if invalid class.  
 */  
 static targetClass _verifyValidClassInput(const CIMName& className)  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,                    originProperty = String("Antecedent");
             "InteropProvider::_verifyValidClassInput");  
     if (className.equal(CIM_OBJECTMANAGER_CLASSNAME))  
         return CIM_OBJECTMANAGER;  
   
     if (className.equal(PG_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME))  
         return PG_CIMXMLCOMMUNICATIONMECHANISM;  
   
     if (className.equal(CIM_NAMESPACEINMANAGER_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  
             (className.getString() + " not supported by Interop Provider");  
   
     PEG_METHOD_EXIT();  
     return PG_NAMESPACE;  
 } }
                 return true;
 static targetAssocClass _verifyValidAssocClassInput(const CIMName& className)            }
             break;
         case PG_ELEMENTSOFTWAREIDENTITY:
             if(originClassEnum == PG_SOFTWAREIDENTITY)
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,                expectedTargetRole = PROPERTY_DEPENDENT;
             "InteropProvider::_verifyValidAssocClassInput");                expectedOriginRole = PROPERTY_ANTECEDENT;
     if (className.equal(CIM_NAMESPACEINMANAGER_CLASSNAME))  
         return CIM_NAMESPACEINMANAGERASSOC;  
   
     // Last entry, reverse test and return OK if CIM_CommMech....  
     if (!className.equal(CIM_COMMMECHANISMFORMANAGER_CLASSNAME))  
         throw CIMNotSupportedException  
             (className.getString() + " not supported by Interop Provider");  
   
     PEG_METHOD_EXIT();  
     return CIM_COMMMECHANISMFORMANAGERASSOC;  
 } }
             else if(originClassEnum == PG_REGISTEREDPROFILE ||
 /* validate the authorization of the user name against the namespace.                originClassEnum == PG_REGISTEREDSUBPROFILE)
 */  
 String _validateUserID(const OperationContext & context)  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,                expectedTargetRole = PROPERTY_ANTECEDENT;
             "InteropProvider::_validateUserID");                expectedOriginRole = PROPERTY_DEPENDENT;
     //ATTN-DME-P3-20020522: ADD AUTHORIZATION CHECK TO __NAMESPACE PROVIDER            }
     String userName;            break;
     try        case PG_INSTALLEDSOFTWAREIDENTITY:
             if(originClassEnum == PG_SOFTWAREIDENTITY)
     {     {
         IdentityContainer container = context.get(IdentityContainer::NAME);                expectedTargetRole = INSTALLEDSOFTWAREIDENTITY_PROPERTY_SYSTEM;
         userName = container.getUserName();                expectedOriginRole =
                     INSTALLEDSOFTWAREIDENTITY_PROPERTY_INSTALLEDSOFTWARE;
             }
             else if(originClassEnum == PG_COMPUTERSYSTEM)
             {
                 expectedTargetRole =
                     INSTALLEDSOFTWAREIDENTITY_PROPERTY_INSTALLEDSOFTWARE;
                 expectedOriginRole = INSTALLEDSOFTWAREIDENTITY_PROPERTY_SYSTEM;
     }     }
             break;
     catch (...)        case PG_HOSTEDACCESSPOINT:
             if(originClassEnum == PG_COMPUTERSYSTEM)
     {     {
        userName = String::EMPTY;                expectedTargetRole = PROPERTY_DEPENDENT;
                 expectedOriginRole = PROPERTY_ANTECEDENT;
     }     }
             else if(originClassEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)
     PEG_METHOD_EXIT();            {
     return userName;                expectedTargetRole = PROPERTY_ANTECEDENT;
                 expectedOriginRole = PROPERTY_DEPENDENT;
 } }
         case PG_HOSTEDOBJECTMANAGER:
 /** Set the value of a property defined by property name in the instance provided.            if(originClassEnum == PG_COMPUTERSYSTEM)
     Sets a String into the value field unless the property name cannot be found.  
     If the property cannot be found, it simply returns.  
     ATTN: This function does not pass an error back if property not found.  
     @param instance CIMInstance in which to set property value  
     @param propertyName CIMName of property in which value will be set.  
     @param value String value to set into property  
   
 */  
 void _setPropertyValue(CIMInstance& instance, const CIMName propertyName, const String& value)  
 { {
     Uint32 pos;                expectedTargetRole = PROPERTY_DEPENDENT;
     if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)                expectedOriginRole = PROPERTY_ANTECEDENT;
         instance.getProperty(pos).setValue(CIMValue(value));  
 } }
             else if(originClassEnum == PG_OBJECTMANAGER)
 void _setPropertyValue(CIMInstance& instance, const CIMName propertyName, const Boolean& value)  
 { {
     Uint32 pos;                expectedTargetRole = PROPERTY_ANTECEDENT;
     if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)                expectedOriginRole = PROPERTY_DEPENDENT;
         instance.getProperty(pos).setValue(CIMValue(value));            }
             break;
         default:
             break;
 } }
  
 void _setPropertyValue(CIMInstance& instance, const CIMName propertyName, const Uint16& value)      //
       // The rest of this method checks to see if target role and origin roles
       // were found for the association and origin class combination and, if
       // found, checks against the input target and origin roles if provided.
       // Failure for any of these tests points to an invalid association
       // traversal request.
       //
       if(expectedTargetRole.isNull() ||
           expectedOriginRole.isNull())
 { {
     Uint32 pos;          PEG_METHOD_EXIT();
     if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)          return false;
         instance.getProperty(pos).setValue(CIMValue(value));  
 } }
  
 void _setPropertyValue(CIMInstance& instance, const CIMName propertyName, const Array<String>& value)      if(targetProperty.size() == 0)
 { {
     Uint32 pos;          targetProperty = expectedTargetRole.getString();
     if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)  
         instance.getProperty(pos).setValue(CIMValue(value));  
 } }
       else if(!expectedTargetRole.equal(targetProperty))
 void _setPropertyValue(CIMInstance& instance, const CIMName propertyName, const Array<Uint16>& value)  
 { {
     Uint32 pos;          PEG_METHOD_EXIT();
     if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)          return false;
         instance.getProperty(pos).setValue(CIMValue(value));  
 } }
  
 void _setPropertyValue(CIMInstance& instance, const CIMName propertyName, const CIMObjectPath& value)      if(originProperty.size() == 0)
 { {
     Uint32 pos;          originProperty = expectedOriginRole.getString();
     if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)  
         instance.getProperty(pos).setValue(CIMValue(value));  
 } }
       else if(!expectedOriginRole.equal(originProperty))
 /** add the correct values to the common keys defined for all of the classes. This is  
     systemcreationclassname and systemname  
     Note that if the properties do not exist, we simply ignore them.  
 */  
 void _fixInstanceCommonKeys(CIMInstance& instance)  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_fixInstanceCommonKeys()");  
     String SystemCreationClassName = System::getSystemCreationClassName ();  
   
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,  
             SystemCreationClassName);  
   
     // Add property SystemName  
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_SYSTEMNAME,  
             System::getFullyQualifiedHostName());  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
           return false;
 } }
  
 /** 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  
     getclass request for each instance built. The skeleton is built by  
     creating the instance and copying qualifiers and properties from  
     the class. Finally the instance is cloned to separate it from the  
     original objects.  
     NOTE: This is very inefficient for anything larger than a few instances.  
     We should separate the get from the createSkeleton.  
     @param className CIMName of the class for which the instance is to be built  
     @return CIMInstance of this class with properties complete.  
     @exception passes on any exceptions received from the repository request.  
 */  
 CIMInstance InteropProvider::_buildInstanceSkeleton(const CIMObjectPath & objectPath,  
                                                     const CIMName& className,  
                                                     CIMClass& returnedClass)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_buildInstanceSkeleton()");  
     // get class with lo = false, qualifier = true classorig = true  
     CIMClass myClass = _repository->getClass(objectPath.getNameSpace(),  
                                         className, false, true, true);  
     returnedClass = myClass;  
     CIMInstance skeleton = myClass.buildInstance(true,true,CIMPropertyList());  
   
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(skeleton);      return true;
 } }
  
 /* build a single instance of the cimxmlcommunicationmechanism class  //
    using the parameter provided as the name property  // Local version of the references operation. It validates the input
    @parm name String representing the name to be used for this object.  // parameters, setting the origin and target property values if not set
    @return CIMInstance of the class  // already, and then performs an enumeration on the association class. It then
 */  // filters the results of that enumeration to see if one of the reference
 CIMInstance InteropProvider::_buildInstancePGCIMXMLCommunicationMechanism(  // properties matches the objectName parameter passed into the method. If so,
             const CIMObjectPath& objectPath,  // then it is added to the array of association instances to be returned.
             const String& namespaceType,  //
             const Uint16& accessProtocol,  Array<CIMInstance> InteropProvider::localReferences(
             const String& IPAddress,      const OperationContext & context,
             const Boolean& includeQualifiers,      const CIMObjectPath & objectName,
             const Boolean& includeClassOrigin,      const CIMName & assocClass,
             const CIMPropertyList& propertyList)      String & originProperty,
       String & targetProperty,
       const CIMPropertyList & propertyList,
       const CIMName & targetClass)
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_buildInstancePGCIMXMLCommunicationMechanism()");          "InteropProvider::localReferences()");
     CIMClass targetClass;  
     CIMInstance instance = _buildInstanceSkeleton(objectPath,  
                             PG_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME,  
                             targetClass);  
   
     _fixInstanceCommonKeys(instance);  
  
     //CreationClassName      Array<CIMInstance> instances;
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,      CIMName originClass = objectName.getClassName();
             PG_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME.getString());  
   
     //Name, this CommunicationMechanism.  We need to make it unique.  To do this  
     // 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 - Force to 2.  
     _setPropertyValue(instance, OM_COMMUNICATIONMECHANISM, Uint16(2));  
   
     //Functional Profiles Supported Property.  
     Array<Uint16> profiles;  
     Array<String> profileDescriptions = _getFunctionalProfiles(profiles);  
  
     // Set functional profiles in instance      Array<CIMName> targetSubclasses;
     _setPropertyValue(instance, OM_FUNCTIONALPROFILESSUPPORTED, profiles);      CIMNamespaceName lastTargetNamespace;
       CIMNamespaceName originNamespace(objectName.getNameSpace());
     _setPropertyValue(instance, OM_FUNCTIONALPROFILEDESCRIPTIONS, profileDescriptions);  
       // Check that the association traversal request is valid
     // Multiple OperationsSupported Property      if (validAssocClassForObject(
     _setPropertyValue(instance, OM_MULTIPLEOPERATIONSSUPPORTED, false);          context,
           assocClass,
     // AuthenticationMechanismsSupported Property          objectName,
     Array<Uint16> authentications;          originNamespace,
     Array<String> authenticationDescriptions;          originProperty,
           targetProperty))
     // Note that we have fixed authentication here.      {
     authentications.append(3); authenticationDescriptions.append("Basic");          // retrieve all of the association class instances
           Array<CIMInstance> localInstances = localEnumerateInstances(context,
     _setPropertyValue(instance, OM_AUTHENTICATIONMECHANISMSSUPPORTED, authentications);              CIMObjectPath(hostName, originNamespace,
                   assocClass));
     _setPropertyValue(instance, OM_AUTHENTICATIONMECHANISMDESCRIPTIONS, authenticationDescriptions);          // Filter the association class instances based on the origin instance
           // and other input parameters.
     _setPropertyValue(instance, OM_VERSION, CIMXMLProtocolVersion);          for(Uint32 i = 0, n = localInstances.size(); i < n; ++i)
           {
     // Obsolete function              CIMInstance & currentInstance = localInstances[i];
     _setPropertyValue(instance, "namespaceType", namespaceType);              CIMObjectPath originPath = getRequiredValue<CIMObjectPath>(
                   currentInstance, originProperty);
     _setPropertyValue(instance, "namespaceAccessProtocol", accessProtocol);              originPath.setNameSpace(objectName.getNameSpace());
               originPath.setHost(objectName.getHost());
     _setPropertyValue(instance, "IPAddress", IPAddress);              // Only include instances where the origin instance is present in
               // the association.
     PEG_METHOD_EXIT();              if(originPath.identical(objectName))
     return(instance);              {
 }                  if(!targetClass.isNull())
                   {
 Array<CIMInstance> InteropProvider::_buildInstancesPGCIMXMLCommunicationMechanism(                      // Have to check if the target reference is of the
                                             const CIMObjectPath& objectPath,                      // targetClass type. We first must determine all the
                                             const Boolean includeQualifiers,                      // possible subclasses of the targetClass in the target
                                             const Boolean includeClassOrigin,                      // namespace.
                                             const CIMPropertyList& propertyList)                      CIMObjectPath targetPath = getRequiredValue<CIMObjectPath>(
 {                          currentInstance, targetProperty);
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_buildInstancesPGCIMXMLCommunicationMechanism");                      CIMNamespaceName targetNamespace(
                           targetPath.getNameSpace());
     // This is a temporary hack to get the multiple connections.                      if(targetNamespace.isNull())
     // This is based on the configmanager being the source of what  
     // protocols are available, http and https.  
   
     ConfigManager* configManager = ConfigManager::getInstance();  
     Boolean enableHttpConnection = String::equal(  
         configManager->getCurrentValue("enableHttpConnection"), "true");  
     Boolean enableHttpsConnection = String::equal(  
         configManager->getCurrentValue("enableHttpsConnection"), "true");  
   
     Array<CIMInstance> instances;  
     Uint32 namespaceAccessProtocol;  
     String namespaceType;  
   
     // for each type, create the instance if that type is defined.  
     String hostName = System::getHostName();  
     if (enableHttpConnection)  
     {  
         namespaceAccessProtocol = 2;  
         namespaceType = "http";  
         CIMInstance instance =  
             _buildInstancePGCIMXMLCommunicationMechanism(  
                 objectPath,  
                 namespaceType,  
                 namespaceAccessProtocol,  
                 _getHostAddress(hostName, namespaceAccessProtocol),  
                 includeQualifiers,  
                 includeClassOrigin,  
                 propertyList);  
         instances.append(instance);  
     }  
   
     if (enableHttpsConnection)  
     {  
         namespaceAccessProtocol = 3;  
         namespaceType = "https";  
         CIMInstance instance =  
             _buildInstancePGCIMXMLCommunicationMechanism(  
                 objectPath,  
                 namespaceType,  
                 namespaceAccessProtocol,  
                 _getHostAddress(hostName, namespaceAccessProtocol),  
                 includeQualifiers,  
                 includeClassOrigin,  
                 propertyList);  
         instances.append(instance);  
     }  
   
   
     PEG_METHOD_EXIT();  
     return(instances);  
 }  
 /*  Gets the value for the CIMObjectManager name.  This is a key  
     property with the following characteristics.  
     1. It is persistent. This must be persistent through CIMOM  
     restarts.  We will save it in the instance database to achieve this.  
     2. It must be unique. We cannot create duplicate CIMOM names  
     3. It is based on the DMTF description of how unique InstanceIds  
     are defined (Trademark/etc followed by unique identification.  
     Use the Global constant PegasusInstanceIDGlobalPrefix as the  
     prefix allowing this to be changed.  
 */  
 String buildObjectManagerName()  
 {  
     return(getTrademarkCIMOMIDPrefix() + ":" + getUUIDString());  
 }  
   
 /** get either the local or disk CIMObjectmanager instance.  
     @return Boolean true if already exists. False if  
     not initialized. Also returns with the current version set  
     into local parameter.  
     ATTN: Probably should get rid of the local parameter since  
     this is used so infrequently, waste of space.  
 */  
 Boolean InteropProvider::_getInstanceFromRepositoryCIMObjectManager(  
                         const CIMObjectPath& objectPath,  
                         CIMInstance& rtnInstance,  
                         const Boolean includeQualifiers,  
                         const Boolean includeClassOrigin,  
                         const CIMPropertyList& propertyList)  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,                          targetNamespace = originNamespace;
             "InteropProvider::_getInstanceCIMObjectManager");                          targetPath.setNameSpace(targetNamespace);
   
     // Try to get persistent instance from repository  
     Array<CIMInstance> instances;  
     try  
     {  
         instances = _repository->enumerateInstances(  
                 objectPath.getNameSpace(),  
                 CIM_OBJECTMANAGER_CLASSNAME, true, false, includeQualifiers,  
                 includeClassOrigin, propertyList);  
   
         CDEBUG("_getInstancefrom... " << instances.size());  
         if (instances.size() >= 1)  
         {  
             // 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());  
             }  
             return(true);  
         }  
         else  
         {  
             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();  
         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;  
     }  
 } }
                       if(targetNamespace != lastTargetNamespace)
 /** 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 CIMObjectPath& objectPath,  
                         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(objectPath,  
                 instance, includeQualifiers,includeClassOrigin,propertyList))  
     {  
         //  
         // No instance in the repository. Build new instance and save it.  
         //  
         CIMClass targetClass;  
         instance = _buildInstanceSkeleton(objectPath, CIM_OBJECTMANAGER_CLASSNAME,  
                     targetClass);  
   
         _fixInstanceCommonKeys(instance);  
   
         _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,  
                 CIM_OBJECTMANAGER_CLASSNAME.getString());  
         _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_NAME,buildObjectManagerName());  
         _setPropertyValue(instance, CIMName("ElementName"), String("Pegasus"));  
   
         //  
         //Description property this object manager instance  
         // default is Pegasus CIM_Server Version. Get from  
         // fields defined in PegasusVersion.  
         // TODO. Add as an alternative the capability to get this  
         // from config parameters.  
         // If PEGASUS_CIMOM_DESCRIPTION is non-zero length, use it.  
         // Otherwise build form the components below.  
   
         String description = (String(PEGASUS_CIMOM_DESCRIPTION).size() != 0) ?  
                 String(PEGASUS_CIMOM_DESCRIPTION)  
             :  
                 String(PEGASUS_CIMOM_GENERIC_NAME) + " " +  
                 String(PEGASUS_PRODUCT_NAME) + " Version " +  
                 String(PEGASUS_PRODUCT_VERSION) + " " +  
                 String(PEGASUS_PRODUCT_STATUS);  
   
         cout << "Description: " << description << endl;  
         _setPropertyValue(instance, CIMName("Description"), description);  
   
         //Property GatherStatisticalData. Initially this is set to false  
         // and can then be modified by a modify instance on the instance.  
   
         Boolean gatherStatDataFlag = false;  
   
         _setPropertyValue(instance, OM_GATHERSTATISTICALDATA, Boolean(gatherStatDataFlag));  
   
         // 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 instance to the repository  
         CIMObjectPath instancePath;  
         // Add the instance path to this if necessary ATTN ATTN:  
         try         try
         {         {
             CDEBUG("Create Instance for CIM_ObjectManager");                              targetSubclasses = repository->enumerateClassNames(
             instancePath = _repository->createInstance(objectPath.getNameSpace(),                                  targetNamespace, targetClass, true);
                            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;  
         }  
         instance.setPath(instancePath);  
     }  
     // KS_TEMP Drop Thisinstance.filter(includeQualifiers, includeClassOrigin, propertyList);  
     PEG_METHOD_EXIT();  
     return(instance);  
 } }
                           catch(...)
 /** Get the instances of CIM_Namespace. Gets all instances of the namespace from  
     the repository namespace management functions. Builds instances that  
     match all of the request attributes.  
 */  
 Array<CIMInstance> InteropProvider::_getInstancesCIMNamespace(  
                             const CIMObjectPath& objectPath,  
                             const Boolean& includeQualifiers,  
                             const Boolean& includeClassOrigin,  
                             const CIMPropertyList& propertyList)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_getInstancesCIMNamespace()");  
   
     CDEBUG("_getinstancesPGNamespace");  
     Array<CIMNamespaceName> namespaceNames = _enumerateNameSpaces();  
     CDEBUG("_getInstancesCIMNamespace. count = " << namespaceNames.size());  
     Array<CIMInstance> instanceArray;  
   
     // Build instances of PG namespace since that is the leaf class  
     for (Uint32 i = 0; i < namespaceNames.size(); i++)  
     {     {
        instanceArray.append( _buildInstancePGNamespace(objectPath, namespaceNames[i]));                              // If an exception was thrown during enumeration,
                               // then the base class didn't exist in the
                               // namespace, so the target instance retrieved
                               // must not match the targetClass parameter.
                               continue;
     }     }
     CDEBUG("Build this many PG_Namespace Instances. count= " << instanceArray.size());                          targetSubclasses.append(targetClass);
     PEG_METHOD_EXIT();                          lastTargetNamespace = targetNamespace;
     return(instanceArray);  
 } }
  
 /** get the instance of namespace defined by the input parameter which is the object path                      // Try to find the targetPath's class in the search space
     for the instance required.                      CIMName targetPathClass = targetPath.getClassName();
     ATTN: Note that this is incorrect. We are supplying the namespace name and need to supply                      for(Uint32 j = 0, m = targetSubclasses.size(); j < m; ++j)
     the objectpath  
     @param objectPath CIMObjectPath from request  
     @param nameSpace CIMNamespaceName for instance to get  
     @return CIMInstance with the found instance or CIMInstance() if nothing found.  
 */  
 CIMInstance InteropProvider::_getInstanceCIMNamespace(const CIMObjectPath& objectPath)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_getInstancesCIMNamespace()");  
   
     Array<CIMInstance> instances = _getInstancesCIMNamespace(objectPath, true, true, CIMPropertyList());  
   
     CIMNamespaceName nameSpace = objectPath.getNameSpace();  
     // search the instances for one with the name property value = input parameter.  
     for (Uint32 i = 0 ; i < instances.size() ; i++)  
     {     {
         if (_getPropertyValue(instances[i], CIMName("name"), String::EMPTY) == nameSpace.getString())                          if(targetPathClass == targetSubclasses[j])
         {         {
             PEG_METHOD_EXIT();                              instances.append(currentInstance);
             return(instances[i]);                              break;
         }         }
     }     }
     PEG_METHOD_EXIT();  
     CIMInstance nullInstance;  
     return(nullInstance);  
 } }
                   else
 CIMObjectPath InteropProvider::_buildReference(const CIMObjectPath& objectPath,  
         const CIMInstance& instance, const CIMName& className)  
 { {
     return(_buildObjectPath(objectPath,className, instance));                      instances.append(currentInstance);
 } }
   
 Array<CIMInstance> InteropProvider::_buildInstancesNamespaceInManager(const CIMObjectPath& objectPath)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_buildInstancesNamespaceInManager");  
   
     Array<CIMInstance> namespaceInstances = _getInstancesCIMNamespace(objectPath, false,  
                             false, CIMPropertyList());  
   
     CIMInstance instanceObjMgr = _getInstanceCIMObjectManager(objectPath, true, true, CIMPropertyList());  
   
     CIMObjectPath refObjMgr = _buildReference(objectPath,instanceObjMgr, CIM_OBJECTMANAGER_CLASSNAME);  
   
     Array<CIMInstance> assocInstances;  
     CIMClass targetClass;  
   
     for (Uint32 i = 0 ; i < namespaceInstances.size() ; i++)  
     {  
         CIMInstance instance = _buildInstanceSkeleton(objectPath, CIM_NAMESPACEINMANAGER_CLASSNAME,  
                                                     targetClass);  
   
         _setPropertyValue(instance, CIMName("Antecedent"), refObjMgr);  
         //ATTNATTN: this is weak qualifier.  
         _setPropertyValue(instance, CIMName("Dependent"),  
             _buildReference(objectPath, namespaceInstances[i], CIM_NAMESPACEINMANAGER_CLASSNAME));  
         instance.setPath(instance.buildPath(targetClass));  
         assocInstances.append(instance);  
     }     }
   
     PEG_METHOD_EXIT();  
   
     return(assocInstances);  
 } }
   
 Array<CIMInstance> InteropProvider::_buildInstancesCommMechanismForManager(  
     const CIMObjectPath& objectPath)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_buildInstancesCommMechanismForManager");  
   
     Array<CIMInstance> commInstances = _buildInstancesPGCIMXMLCommunicationMechanism(  
          objectPath,true,  
          true, CIMPropertyList());  
   
     CIMInstance instanceObjMgr = _getInstanceCIMObjectManager(objectPath, true, true, CIMPropertyList());  
   
     CIMObjectPath refObjMgr = _buildReference(objectPath, instanceObjMgr, CIM_OBJECTMANAGER_CLASSNAME);  
   
     Array<CIMInstance> assocInstances;  
     CIMClass targetClass;  
     for (Uint32 i = 0 ; i < commInstances.size() ; i++)  
     {  
   
         CIMInstance instance = _buildInstanceSkeleton(objectPath,CIM_COMMMECHANISMFORMANAGER_CLASSNAME,  
                                                       targetClass);  
   
         _setPropertyValue(instance,CIMName("Antecedent"), refObjMgr);  
         //ATTNATTN: this is weak qualifier.  
         _setPropertyValue(instance,CIMName("Dependent"),  
             _buildReference(objectPath, commInstances[i],CIM_COMMMECHANISMFORMANAGER_CLASSNAME));  
   
         instance.setPath(instance.buildPath(targetClass));  
         assocInstances.append(instance);  
     }     }
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(assocInstances);      return instances;
 } }
  
 /* generate one instance of the CIM_Namespace class with the  
    properties  
    NOTE: CIM 2.4 - Changed to build PG namespace  
    @param objectPath  
    @param namespace name to put into the class  
    @exceptions - exceptions carried forward from create instance  
    and addProperty.  
 */  
 CIMInstance InteropProvider::_buildInstancePGNamespace(const CIMObjectPath& objectPath,  
         CIMNamespaceName& nameSpace)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_buildInstancePGNamespace");  
   
     // ATTN: KS need to get the real objectManager name from elsewhere.  the only place  
     // this exists is through the objectmanager object.  
     // ATTN: Should we be saving the objectmanager name somewhere internally either in  
     // interop or more generally somewhere within the system for common access.  
     String ObjectManagerName = "ObjectManagerNameValue";  
   
     CIMClass targetClass;  
     CIMInstance instance = _buildInstanceSkeleton(objectPath, PG_NAMESPACE_CLASSNAME,  
                                                   targetClass);  
   
     _fixInstanceCommonKeys(instance);  
   
     //ObjectManagerCreationClassName  
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME, CIM_OBJECTMANAGER_CLASSNAME.getString());  
   
     //ObjectManagerName  
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME, ObjectManagerName);  
   
     //CreationClassName  
     // Class in which this was created,  
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME, CIM_NAMESPACE_CLASSNAME.getString());  
     //Name  
     // This is the namespace name itself  
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_NAME, nameSpace.getString());  
   
     //ClassInfo  
     // Set the classinfo to unknown and the description to namespace.  
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CLASSINFO, Uint16(0));  
     _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_DESCRIPTIONOFCLASSINFO, String("namespace"));  
  
     //     //
     //  Everything above was commmon to CIM Namespace.  The following is PG_Namespace Properties  // Builds an instance of the class named className. Gets Class defintion and
   // fills in the correct properties from the class.  This requires a repository
   // getClass request for each instance built. The skeleton is built by
   // creating the instance and copying qualifiers and properties from
   // the class. Finally the instance is cloned to separate it from the
   // original objects.
   // NOTE: This is very inefficient for anything larger than a few instances.
   // We should separate the get from the createSkeleton.
   // @param className CIMName of the class for which the instance is to be built
   // @return CIMInstance of this class with properties complete.
   // @exception passes on any exceptions received from the repository request.
     //     //
     // ATTN: KS Get the correct values for these entities from repository interface.  CIMInstance InteropProvider::buildInstanceSkeleton(
         const CIMNamespaceName & nameSpace,
     CIMRepository::NameSpaceAttributes attributes;        const CIMName& className,
     _repository->getNameSpaceAttributes(nameSpace.getString(), attributes);        CIMClass& returnedClass)
     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();      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
           // Poor error definition since it reflects internal error. do error log          "InteropProvider::_buildInstanceSkeleton()");
           throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, nameSpace.getString()+      // get class with lo = false, qualifier = true classorig = true
               " namespace attribute " + key + " option not supported in"+ String(thisProvider));      returnedClass = repository->getClass(nameSpace,
        }          className, false, true, true);
     }      CIMInstance skeleton = returnedClass.buildInstance(true,true,
     _setPropertyValue(instance, PG_NAMESPACE_PROPERTY_SCHEMAUPDATESALLOWED, updatesAllowed);          CIMPropertyList());
     _setPropertyValue(instance, PG_NAMESPACE_PROPERTY_ISSHAREABLE, shareable);  
     _setPropertyValue(instance, PG_NAMESPACE_PROPERTY_PARENTNAMESPACE, parent);  
         _setPropertyValue(instance, PG_NAMESPACE_PROPERTY_NAME, name);  
  
     instance.setPath(instance.buildPath(targetClass));  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(instance);      return skeleton;
 } }
  
 void _validateCIMNamespaceKeys(const CIMObjectPath& objectPath)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_validateCIMNamespaceKeys");  
   
     Boolean valid = true;  
     CIMName propertyName;  
     if (!_validateRequiredProperty(objectPath,  
                 CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,  
                 System::getSystemCreationClassName ()))  
     {  
         propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME;  
         valid = false;  
     }  
     if (!_validateRequiredProperty(objectPath,  
                 CIM_NAMESPACE_PROPERTY_SYSTEMNAME,  
                 System::getFullyQualifiedHostName()))  
     {  
         propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMNAME;  
         valid = false;  
     }  
     if (!_validateRequiredProperty(objectPath,  
                 CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME,  
                 CIM_OBJECTMANAGER_CLASSNAME.getString()))  
     {  
         propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME;  
         valid = false;  
     }  
  
     // ATTN: This one still a problem.  We have to get the name first  CIMInstance InteropProvider::buildDependencyInstance(
     if (!_validateRequiredProperty(objectPath,      const String & antecedentId,
                 CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME,      const CIMName & antecedentClass,
                 String::EMPTY))      const String & dependentId,
     {      const CIMName & dependentClass,
         propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME;      const CIMClass & dependencyClass)
         valid = false;  
     }  
     if (!_validateRequiredProperty(objectPath,  
                 CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,  
                 System::getHostName()))  
     {     {
         propertyName = CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME;      Array<CIMKeyBinding> dependentKeys;
         valid = false;  
     }  
  
     if (!_validateRequiredProperty(objectPath,      dependentKeys.append(CIMKeyBinding(
                 CIM_NAMESPACE_PROPERTY_NAME,          COMMON_PROPERTY_INSTANCEID,
                 String::EMPTY))          dependentId,CIMKeyBinding::STRING));
     {  
         propertyName = CIM_NAMESPACE_PROPERTY_NAME;  
         valid = false;  
     }  
  
     if (false)      return buildDependencyInstanceFromPaths(
     {          buildDependencyReference(hostName, antecedentId, antecedentClass),
         PEG_METHOD_EXIT();          buildDependencyReference(hostName, dependentId, dependentClass),
         throw CIMInvalidParameterException(          dependencyClass);
             "Invalid key property: " + propertyName.getString());  
     }  
     PEG_METHOD_EXIT();  
 } }
  
 /** completes a property in the defined instance either  void InteropProvider::initProvider()
     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)  
 { {
       if(providerInitialized)
           return;
       // Placed METHOD_ENTER trace statement after checking whether the
       // provider is initialized because this method will be called for every
       // operation through the InteropProvider, and this method is only
       // interesting the first time it is successfully run.
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_completeProperty()");          "InteropProvider::initProvider()");
   
     Uint32 pos;  
  
     if (!_validateRequiredProperty(instance,      AutoMutex lock(interopMut);
                 propertyName,      if(!providerInitialized)
                 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);          //
         }          // Initialize the object manager instance for the CIM Server, and
     }          // retrieve the object manager's name property. This is retrieved once
           // and stored for use in constructing other instances requiring its
           // value.
           //
           CIMInstance objectManager = getObjectManagerInstance();
           objectManager.getProperty(objectManager.findProperty(
               OM_PROPERTY_NAME)).getValue().get(objectManagerName);
  
     PEG_METHOD_EXIT();          //
     return(true);          // Determine whether the CIMOM should be gathering statistical data
 }          // based on the GatherStatisticalData property in the object manager.
 Boolean _completeCIMNamespaceKeys(CIMInstance& instance)          //
           Uint32 gatherDataIndex = objectManager.findProperty(
               OM_PROPERTY_GATHERSTATISTICALDATA);
           if(gatherDataIndex != PEG_NOT_FOUND)
 { {
               CIMConstProperty gatherDataProp =
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,                  objectManager.getProperty(gatherDataIndex);
             "InteropProvider::_completeCIMNamespaceKeys");              if (gatherDataProp.getType() == CIMTYPE_BOOLEAN)
   
     Boolean valid = true;  
     CIMName propertyName;  
   
     if (!_completeProperty(instance,  
                 CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,  
                 System::getSystemCreationClassName ()))  
     {     {
                   CIMValue gatherDataVal  = gatherDataProp.getValue();
         propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME;                  if (!gatherDataVal.isNull())
         valid = false;  
     }  
   
     if (!_completeProperty(instance,  
                 CIM_NAMESPACE_PROPERTY_SYSTEMNAME,  
                 System::getFullyQualifiedHostName()))  
     {     {
         propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMNAME;                      Boolean gatherData;
         valid = false;                      gatherDataVal.get(gatherData);
     }                      if (gatherData == true)
   
     if (!_completeProperty(instance,  
                 CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME,  
                 CIM_OBJECTMANAGER_CLASSNAME.getString()))  
     {     {
         propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME;                          StatisticalData* sd = StatisticalData::current();
         valid = false;                          sd->setCopyGSD(true);
     }     }
   
     if (!_completeProperty(instance,  
                 CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME,  
                 String::EMPTY))  
     {  
         propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME;  
         valid = false;  
     }     }
     if (!_completeProperty(instance,  
                 CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,  
                 System::getHostName()))  
     {  
         propertyName = CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME;  
         valid = false;  
     }     }
   
     if (!_completeProperty(instance,  
                 CIM_NAMESPACE_PROPERTY_NAME,  
                 String::EMPTY))  
     {  
         propertyName = CIM_NAMESPACE_PROPERTY_NAME;  
         valid = false;  
     }     }
  
     if (!valid)          // Cache this class definition for use later.
           profileCapabilitiesClass = repository->getClass(
               PEGASUS_NAMESPACENAME_INTEROP,
               PEGASUS_CLASSNAME_PG_PROVIDERPROFILECAPABILITIES,
               false, true, false);
   
           providerClassifications.append(Uint16(5)); // "Instrumentation"
   
           //
           // Initialize the namespaces so that all namespaces with the
           // CIM_ElementConformsToProfile class also have the
           // PG_ElementConformsToProfile class. Needed in order to implement
           // the cross-namespace ElementConformsToProfile association in both
           // directions.
           //
           Array<CIMNamespaceName> namespaceNames =
               repository->enumerateNameSpaces();
           // get the PG_ElementConformstoProfile class without the qualifiers
           // and then add just the required ASSOCIATION qualifier, so that
           // resolveclass doesn't fail for the test/EmbeddedInstance/Dynamic
           // namespace, which uses the CIM25 schema that doesn't include any
           // of the new qualifiers added to this class in later versions of
           // the CIMSchema.
           CIMClass conformsClass = repository->getClass(
               PEGASUS_NAMESPACENAME_INTEROP,
               PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE, true, false);
           conformsClass.addQualifier(CIMQualifier(CIMName("ASSOCIATION"),
                                 CIMValue(true)));
           CIMClass profileClass = repository->getClass(
               PEGASUS_NAMESPACENAME_INTEROP,
               PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE, true, false);
           for(Uint32 i = 0, n = namespaceNames.size(); i < n; ++i)
           {
               // Check if the PG_ElementConformsToProfile class is present
               CIMNamespaceName & currentNamespace = namespaceNames[i];
               CIMClass tmpCimClass;
               CIMClass tmpPgClass;
               CIMClass tmpPgProfileClass;
               try
     {     {
         PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,                  // Look for these classes in the same try-block since the
             "Invalid CIM_Namespace Key Property " +  propertyName.getString());                  // second depends on the first
         PEG_METHOD_EXIT();                  tmpCimClass = repository->getClass(currentNamespace,
         throw CIMInvalidParameterException(                      PEGASUS_CLASSNAME_CIM_ELEMENTCONFORMSTOPROFILE);
             "Invalid CIM_Namespace key property: " + propertyName.getString());                  tmpPgClass = repository->getClass(currentNamespace,
     }                      PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE);
     PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4, "CIM_Namespace Keys Valid");  
     PEG_METHOD_EXIT();  
     return(valid);  
 } }
               catch(const Exception &)
   
 void _validateCIMNamespaceKeys(const CIMInstance& instance)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_validateCIMNamespaceKeys");  
     Boolean valid = true;  
     CIMName propertyName;  
     if (!_validateRequiredProperty(instance,  
                 CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,  
                 System::getSystemCreationClassName ()))  
     {     {
         propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME;  
         valid = false;  
     }     }
               try
     if (!_validateRequiredProperty(instance,  
                 CIM_NAMESPACE_PROPERTY_SYSTEMNAME,  
                 System::getFullyQualifiedHostName ()))  
     {     {
         propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMNAME;                  tmpPgProfileClass = repository->getClass(currentNamespace,
         valid = false;                      PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE);
     }     }
               catch(const Exception &)
     if (!_validateRequiredProperty(instance,  
                 CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME,  
                 CIM_OBJECTMANAGER_CLASSNAME.getString()))  
     {     {
         propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME;                  // Note: if any of the above three classes aren't found,
         valid = false;                  // an exception will be thrown, which we can ignore since it's
                   // an expected case
                   // TBD: Log trace message?
     }     }
  
     // ATTN: This one still a problem.  We have to get the name first              // If the CIM_ElementConformsToProfile class is present, but
     if (!_validateRequiredProperty(instance,              // the PG_ElementConformsToProfile or PG_RegisteredProfile
                 CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME,              // class is not, then add it to that namespace.
                 String::EMPTY))              //
     {              // Note that we don't have to check for the
         propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME;              // CIM_RegisteredProfile class because if the
         valid = false;              // CIM_ElementConformsToProfile class is present, the
     }              // CIM_RegisteredProfile class must also be present.
     if (!_validateRequiredProperty(instance,              if(!tmpCimClass.isUninitialized())
                 CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,  
                 System::getHostName()))  
     {     {
         propertyName = CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME;                  if(tmpPgClass.isUninitialized())
         valid = false;  
     }  
   
     if (!_validateRequiredProperty(instance,  
                 CIM_NAMESPACE_PROPERTY_NAME,  
                 String::EMPTY))  
     {     {
         propertyName = CIM_NAMESPACE_PROPERTY_NAME;                      CIMClass newclass = conformsClass.clone();
         valid = false;                      CIMObjectPath newPath = conformsClass.getPath();
                       newPath.setNameSpace(currentNamespace);
                       newclass.setPath(newPath);
                       repository->createClass(currentNamespace,
                           newclass);
     }     }
                   if(tmpPgProfileClass.isUninitialized())
     if (false)  
     {     {
         PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,                      CIMClass newclass = profileClass.clone();
             "Invalid CIM_Namespace Key Property " +  propertyName.getString());                      CIMObjectPath newPath = profileClass.getPath();
         PEG_METHOD_EXIT();                      newPath.setNameSpace(currentNamespace);
         throw CIMInvalidParameterException(                      newclass.setPath(newPath);
             "Invalid CIM_Namespace key property: " + propertyName.getString());                      repository->createClass(currentNamespace,
     }                          newclass);
     PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4, "CIM_Namespace Keys Valid");  
     PEG_METHOD_EXIT();  
 } }
   
 /** builds complete object path from instance and classinfo by building the full path  
     with host and namespace names included.  
 */  
 CIMObjectPath InteropProvider::_buildObjectPath(const CIMObjectPath& objectPath,  
                                                 const CIMName& className,  
                                                 const CIMInstance& instance)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_buildObjectPath");  
   
     CIMObjectPath rtnObjectPath;  
     rtnObjectPath = _buildInstancePath(objectPath,className,instance);  
   
     rtnObjectPath.setHost(objectPath.getHost());  
   
     rtnObjectPath.setNameSpace(objectPath.getNameSpace());  
   
     PEG_METHOD_EXIT();  
     return(rtnObjectPath);  
 } }
   
 /* Given a class and instance build the instance path for a  
    the object.  This builds all components of the path  
    @param namespace name to build  
    @return CIMObjectPath containing namespace, class and keybinding  
    components of path  
    @exceptions - Passes repository exceptions.  
 */  
   
 CIMObjectPath InteropProvider::_buildInstancePath(const CIMObjectPath& objectPath,  
                                            const CIMName& className,  
                                            const CIMInstance& instance)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_buildInstancePath");  
   
     // get the class CIM_Namespace class to use in building path  
     // Exception out if Class does not exist in this namespace  
     CIMClass thisClass = _getClass(objectPath, className);  
   
     CIMObjectPath ref = instance.buildPath(thisClass);  
   
     PEG_METHOD_EXIT();  
     return(ref);  
 } }
  
 //**************************************************************          // Now cache the Registration info used for ElementConformsToProfile
 // Overloaded functions to get key value with different params          cacheProfileRegistrationInfo();
 //**************************************************************  
   
 /*  find the name key in the keybindings and return the value.  
     Executes exception if the key not found  
     @param object path we will search  
     @param keyName - Name of the key to find.  
     @return value of name property  
     @exceptions CIMInvalidParameterException  
 */  
 String _getKeyValue(const CIMObjectPath& instanceName, const CIMName& keyName)  
 {  
     Array<CIMKeyBinding> kbArray = instanceName.getKeyBindings();  
   
     // find the correct key binding  
     for (Uint32 i = 0; i < kbArray.size(); i++)  
     {  
         if (kbArray[i].getName() == keyName)  
             return (kbArray[i].getValue());  
     }  
  
     throw CIMInvalidParameterException("Invalid key property: " + keyName.getString());          providerInitialized = true;
 } }
  
 String _getKeyValue(const CIMInstance& instance, const CIMName& keyName)  
 {  
     Uint32 pos;  
     CIMValue propertyValue;  
   
     pos = instance.findProperty(keyName);  
     if (pos == PEG_NOT_FOUND)  
        throw CIMPropertyNotFoundException  
            (NAMESPACE_PROPERTYNAME.getString());  
   
     propertyValue = instance.getProperty(pos).getValue();  
     if (propertyValue.getType() != CIMTYPE_STRING)  
        throw CIMInvalidParameterException("Invalid type for property: "  
                              + NAMESPACE_PROPERTYNAME.getString());  
     String name;  
     propertyValue.get(name);  
     return(name);  
 }  
   
 //***************************************************************************  
 //  The following section is the Instance Operation processors  
 //***************************************************************************  
 //                createInstance  
 //***************************************************************************  
 void InteropProvider::createInstance(  
         const OperationContext & context,  
         const CIMObjectPath & instanceReference,  
     const CIMInstance& myInstance,  
         ObjectPathResponseHandler & handler)  
     {  
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::createInstance()");  
   
         Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
             "%s createInstance. InstanceReference= %s",  
             thisProvider,  
             (const char *) instanceReference.toString().getCString());  
   
         handler.processing();  
   
         CDEBUG("CreateInstance " << instanceReference.toString());  
         // operation namespace needed internally to get class.  
         // KS_TEMP _operationNamespace = instanceReference.getNameSpace();  
   
         // Verify that ClassName is correct and get value  
         targetClass classEnum  = _verifyValidClassInput(instanceReference.getClassName());  
   
         String userName = _validateUserID(context);  
         CIMObjectPath newInstanceReference;  
   
         CIMNamespaceName newNamespaceName;  
         if (classEnum == PG_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.  
             newNamespaceName = _getKeyValue(myInstance, CIM_NAMESPACE_PROPERTY_NAME);  
   
             newInstanceReference = _buildInstancePath(instanceReference,  
                                         PG_NAMESPACE_CLASSNAME, localInstance);  
 #endif  
         }  
   
         else if ((classEnum == CIM_OBJECTMANAGER) ||  
             (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM))  
         {  
             PEG_METHOD_EXIT();  
             throw CIMNotSupportedException("InteropProvider, Create Not allowed");  
         }  
   
         else   // Invalid class for the create functions.  
         {  
             PEGASUS_ASSERT(false);  
         }  
   
         // Create the new namespace  
         try  
         {  
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                 "Namespace = " + newNamespaceName.getString() +  
                     " 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");  
   
             // 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,  
                 "Namespace = " + newNamespaceName.getString() +  
                     " successfully created.");  
             Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,  
                 "Create Namespace: Shareable = $0, Updates allowed: $1,  Parent: $2",  
                 newNamespaceName.getString(), shareable?  
                         "true" : "false", shareable? "true" : "false", parent );  
   
         }  
         catch(const CIMException&)  
         {  
            PEG_METHOD_EXIT();  
            throw;  
         }  
         catch(const Exception&)  
         {  
            PEG_METHOD_EXIT();  
            throw;  
         }  
   
         // begin processing the request  
   
        handler.deliver(newInstanceReference);  
   
        // complete processing the request  
        handler.complete();  
   
        PEG_METHOD_EXIT();  
        return;  
    }  
   
 //***************************************************************************  
 //                deleteInstance  
 //***************************************************************************  
 void InteropProvider::deleteInstance(  
         const OperationContext & context,  
         const CIMObjectPath & instanceName,  
         ResponseHandler & handler)  
     {  
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::deleteInstance");  
   
         Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
             "%s deleteInstance. instanceName= %s",  
             thisProvider,  
             (const char *) instanceName.toString().getCString());  
   
         // KS_TEMP _operationNamespace = instanceName.getNameSpace();  
         handler.processing();  
         // Verify that ClassName is correct and get value  
         targetClass classEnum  = _verifyValidClassInput(instanceName.getClassName());  
   
         String userName = _validateUserID(context);  
   
         // Delete the instance since it may be in persistent storage  
         if ((classEnum == CIM_OBJECTMANAGER))  
         {  
             try  
             {  
                 _repository->deleteInstance(instanceName.getNameSpace(),instanceName);  
             }  
             catch(const CIMException&)  
             {  
                 PEG_METHOD_EXIT();  
                 throw;  
             }  
         }  
         else if (classEnum == PG_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  
             _validateCIMNamespaceKeys(instanceName);  
   
             deleteNamespaceName = _getKeyValue(instanceName, CIM_NAMESPACE_PROPERTY_NAME);  
 #endif  
   
             Array<CIMNamespaceName> namespaceNames;  
             namespaceNames = _enumerateNameSpaces();  
   
             if (deleteNamespaceName.equal (ROOTNS))  
             {  
                throw CIMNotSupportedException("root namespace cannot be deleted.");  
             }  
   
             _repository->deleteNameSpace(deleteNamespaceName);  
   
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                "Namespace = " + deleteNamespaceName.getString() +  
                    " successfully deleted.");  
   
             Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,  
                "Interop Provider Delete Namespace: $0",  
                deleteNamespaceName.getString());  
         }  
         else  
         {  
             throw CIMNotSupportedException("Delete Not allowed for " + instanceName.getClassName().getString());  
         }  
   
         handler.complete();  
   
         PEG_METHOD_EXIT();  
         return ;  
     }  
   
 //***************************************************************************  
 //                getInstance  
 //***************************************************************************  
 void InteropProvider::getInstance(  
     const OperationContext & context,  
     const CIMObjectPath & instanceName,  
     const Boolean includeQualifiers,  
     const Boolean includeClassOrigin,  
     const CIMPropertyList & propertyList,  
     InstanceResponseHandler & handler)  
     {  
         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  
         targetClass classEnum  = _verifyValidClassInput(instanceName.getClassName());  
   
         String userName = _validateUserID(context);  
   
         // begin processing the request  
         handler.processing();  
         CIMInstance instance;  
         Boolean found = false;  
         if (classEnum == CIM_OBJECTMANAGER)  
         {  
             instance = _getInstanceCIMObjectManager(  
                             instanceName,  
                             includeQualifiers,  
                             includeClassOrigin, propertyList);  
             if (instanceName == instance.getPath())  
             {  
                 found = true;  
             }  
             //handler.deliver(instance);  
         }  
   
         else if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)  
         {  
             // ATTN: test for correct instance KS: Priority 1  
             Array <CIMInstance> instances =  
                 _buildInstancesPGCIMXMLCommunicationMechanism(  
                             instanceName,  
                             includeQualifiers,  
                             includeClassOrigin, propertyList);  
             for (Uint32 i = 0 ; i < instances.size() ; i++)  
             {  
                 if (instanceName == instances[i].getPath())  
                 {  
                     instance = instances[i];  
                     found = true;  
                     break;  
                 }  
             }  
             //instance = instances[0];  
             //handler.deliver(instances[0]);  
         }  
   
         else if (classEnum == CIM_NAMESPACEINMANAGER)  
         {  
         }  
   
         else if (classEnum == PG_NAMESPACE)  
         {  
             // Get List of namespaces  
             Array<CIMNamespaceName> namespaceNames;  
             namespaceNames = _enumerateNameSpaces();  
   
             // Not clear what we have to take into account here.  
             // get the namespace from the name value.  
             // should check the other keys to see if valid.  
             CIMNamespaceName namespaceName =  
                 _getKeyValue(instanceName, CIM_NAMESPACE_PROPERTY_NAME);  
   
             // ATTN: Why this CIMNamespaceName parentNamespaceName = instanceName.getNameSpace();  
             if (!Contains(namespaceNames, namespaceName))  
             {  
                 throw CIMObjectNotFoundException("Namespace does not exist: "  
                                      + namespaceName.getString());  
             }  
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                "Namespace = " + namespaceName.getString() + " successfully found.");  
   
             instance = _getInstanceCIMNamespace(instanceName);  
             found = true;  
         }  
         else  // processing for __Namespace  
         {  
             PEG_METHOD_EXIT();  
             throw CIMNotSupportedException  
                 (instanceName.getClassName().getString() + " not supported by Interop Provider");  
         }  
        if (found)  
        {  
            instance.filter( includeQualifiers,  
                             includeClassOrigin,  
                             propertyList);  
            handler.deliver(instance);  
        }  
   
        handler.complete();  
   
        PEG_METHOD_EXIT();  
        return ;  
     }  
   
   
   
 //***************************************************************************  
 //                enumerateInstances  
 //***************************************************************************  
 void InteropProvider::enumerateInstances(  
     const OperationContext & context,  
     const CIMObjectPath & ref,  
     const Boolean includeQualifiers,  
     const Boolean includeClassOrigin,  
     const CIMPropertyList& propertyList,  
     InstanceResponseHandler & handler)  
     {  
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::enumerateInstances()");  
   
         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());  
   
         //String userName = _validateUserID(context);  
   
         // The following 3 classes deliver a single instance because  
         // that is all there is today.  
   
         Array<CIMInstance> instances;  
         if (classEnum == CIM_OBJECTMANAGER)  
         {  
             CIMInstance instance = _getInstanceCIMObjectManager(  
                                     ref,  
                                     includeQualifiers,  
                                     includeClassOrigin,  
                                     propertyList);  
   
             instances.append(instance);  
         }  
   
         else if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)  
         {  
             instances = _buildInstancesPGCIMXMLCommunicationMechanism(  
                                     ref,  
                                     includeQualifiers,  
                                     includeClassOrigin,  
                                     propertyList);  
         }  
   
         else if (classEnum == CIM_NAMESPACEINMANAGER)  
         {  
             //handler.complete();  
             //PEG_METHOD_EXIT();  
             //return;  
         }  
   
         else if (classEnum == PG_NAMESPACE)  
         {  
             instances = _getInstancesCIMNamespace(  
                                     ref,  
                                     includeQualifiers,  
                                     includeClassOrigin,  
                                     propertyList);  
         }  
         else  
         {  
             PEG_METHOD_EXIT();  
             throw CIMNotSupportedException  
                 (ref.getClassName().getString() + " not supported by Interop Provider");  
         }  
   
         // Filter and deliver the resulting instances  
         for (Uint32 i = 0 ; i < instances.size() ; i++)  
         {  
             _finishInstance(instances[i], ref, includeQualifiers,  
                                 includeClassOrigin,  
                                 propertyList );  
             /*** Debug Trace of the Instances generated  
             Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                 "%s enumerateInstances return instance number %u\npath: %s\n %s",thisProvider, i,  
                 (instances[i].getPath().toString().getCString()),  
                 ( ( CIMObject) instances[i]).toString().getCString());  
             ****/  
   
             handler.deliver(instances[i]);  
         }  
         handler.complete();  
   
         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(instanceReference,  
                 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(instanceReference.getNameSpace(),  
                                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::TRACE,  
                 "Interop Provider Set Statistics gathering in CIM_ObjectManager: $0",  
                 (statisticsFlag? "true" : "false"));  
             StatisticalData* sd = StatisticalData::current();  
             sd->setCopyGSD(statisticsFlag);  
         }  
         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)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::modifyInstance");  
   
     Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
         "%s modifyInstance. instanceReference= %s, includeQualifiers= %s, PropertyList= %s",  
         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.  
   
     CIMName className =  instanceReference.getClassName();  
     targetClass classEnum  = _verifyValidClassInput(className);  
   
     String userName = _validateUserID(context);  
     // begin processing the request  
     handler.processing();  
   
     if (classEnum == CIM_OBJECTMANAGER)  
     {  
         modifyObjectManagerInstance(context, instanceReference,modifiedIns,  
             includeQualifiers, propertyList, handler);  
         // for the moment allow modification of the statistics property only  
     }  
   
     else if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)  
     {  
   
         PEG_METHOD_EXIT();  
         throw CIMNotSupportedException  
             (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  
     {  
         PEG_METHOD_EXIT();  
         throw CIMNotSupportedException(  
             className.getString() + " not supported by Interop Provider");  
     }  
   
     handler.complete();  
     PEG_METHOD_EXIT();  
     return;  
 }  
   
 //***************************************************************************  
 //                enumerateInstanceNames  
 //***************************************************************************  
 void InteropProvider::enumerateInstanceNames(  
         const OperationContext & context,  
         const CIMObjectPath & classReference,  
         ObjectPathResponseHandler & handler)  
     {  
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
                 "InteropProvider::enumerateInstanceNames()");  
   
         Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
             "%s enumerateInstanceNames. classReference= %s",  
             thisProvider,  
             (const char *) classReference.toString().getCString());  
   
         targetClass classEnum  =  
                 _verifyValidClassInput(classReference.getClassName());  
   
         String userName = _validateUserID(context);  
   
         // begin processing the request  
         handler.processing();  
   
         // Deliver a single instance because there should only be one instance.  
         if (classEnum == CIM_OBJECTMANAGER)  
         {  
             CIMInstance instance = _getInstanceCIMObjectManager(  
                             classReference, true, true, CIMPropertyList());  
   
             CIMObjectPath ref = _buildInstancePath(classReference,  
                 CIM_OBJECTMANAGER_CLASSNAME, instance);  
   
             handler.deliver(ref);  
         }  
   
         // Deliver all possible instances of this class  
         else if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)  
         {  
             Array<CIMInstance> instances =  
                 _buildInstancesPGCIMXMLCommunicationMechanism(  
                         classReference, true,  
                         true, CIMPropertyList());  
   
             for (Uint32 i = 0 ; i < instances.size() ; i++)  
             {  
                 CIMObjectPath ref = _buildInstancePath(classReference,  
                         PG_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME, instances[i]);  
                 handler.deliver(ref);  
             }  
         }  
   
         else if (classEnum == CIM_NAMESPACEINMANAGER)  
         {  
         }  
   
         else if (classEnum == PG_NAMESPACE)  
         {  
             Array<CIMInstance> instances = _getInstancesCIMNamespace(  
                                     classReference,  
                                     false,  
                                     false, CIMPropertyList());  
             CDEBUG("EvalNames. Found instances. Count= " << instances.size());  
   
             for (Uint32 i = 0 ; i < instances.size() ; i++)  
             {  
                 CIMObjectPath ref = _buildInstancePath(classReference,  
                         CIM_NAMESPACE_CLASSNAME, instances[i]);  
                 handler.deliver(ref);  
             }  
         }  
   
         else if (classEnum == CIM_COMMMECHANISMFORMANAGERINST)  
         {  
             Array<CIMInstance> instances =  
                 _buildInstancesCommMechanismForManager(classReference);  
   
             for (Uint32 i = 0 ; i < instances.size() ; i++ )  
             {  
                 CIMObjectPath ref = _buildObjectPath(classReference,  
                         CIM_COMMMECHANISMFORMANAGER_CLASSNAME, instances[i]);  
                 handler.deliver(ref);  
             }  
         }  
   
         else if (classEnum == CIM_NAMESPACEINMANAGERINST)  
         {  
             Array<CIMInstance> instances = _buildInstancesNamespaceInManager(classReference);  
             for (Uint32 i = 0 ; i < instances.size() ; i++ )  
             {  
                 CIMObjectPath ref = _buildObjectPath(classReference,  
                         CIM_NAMESPACEINMANAGER_CLASSNAME, instances[i]);  
                 handler.deliver(ref);  
             }  
         }  
         else  
         {  
             // ERROR: Code should never get here because of Enum tests.  
             throw CIMNotSupportedException("Class not processed by Interop "  
                  + classReference.getClassName().getString());  
         }  
   
   
         // ATTN: Exception response because of error  
         handler.complete();  
         PEG_METHOD_EXIT();  
     }  
   
 //**************************************************************  
 //**************************************************************  
 // Association Functions  
 //**************************************************************  
 //**************************************************************  
   
 void InteropProvider::associators(  
         const OperationContext & context,  
         const CIMObjectPath & objectName,  
         const CIMName & associationClass,  
         const CIMName & resultClass,  
         const String & role,  
         const String & resultRole,  
         const Boolean includeQualifiers,  
         const Boolean includeClassOrigin,  
         const CIMPropertyList & propertyList,  
         ObjectResponseHandler & handler)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::associatorNames()");  
         //throw CIMNotSupportedException("AssociationProvider::associators");  
 }  
   
 void InteropProvider::associatorNames(  
         const OperationContext & context,  
         const CIMObjectPath & objectName,  
         const CIMName & associationClass,  
         const CIMName & resultClass,  
         const String & role,  
         const String & resultRole,  
         ObjectPathResponseHandler & handler)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::associatorNames()");  
         //throw CIMNotSupportedException("AssociationProvider::associatorNames");  
 }  
   
 void InteropProvider::references(  
         const OperationContext & context,  
         const CIMObjectPath & objectName,  
         const CIMName & resultClass,  
         const String & role,  
         const Boolean includeQualifiers,  
         const Boolean includeClassOrigin,  
         const CIMPropertyList & propertyList,  
         ObjectResponseHandler & handler)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::references()");  
         //throw CIMNotSupportedException("AssociationProvider::references");  
 }  
   
 void _filterAssocInstances(Array<CIMInstance>& instances,  
                       CIMName assocClassName,  
                       String assocRole,  
                       CIMName resultClassName = CIMName(),  
                       String resultRole = String::EMPTY)  
 {  
     return;  
 }  
   
 void InteropProvider::referenceNames(  
         const OperationContext & context,  
         const CIMObjectPath & objectName,  
         const CIMName & resultClass,  
         const String & role,  
         ObjectPathResponseHandler & handler)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::referenceNames()");  
     CDEBUG("::referenceNames(): object= " << objectName.toString() << " result Class= " << resultClass.getString());  
   
     // operation namespace needed internally to get class.  
     // KS_TEMP _operationNamespace = objectName.getNameSpace();  
     String userName = _validateUserID(context);  
     // begin processing the request  
     handler.processing();  
   
     // determine if valid class result class  
   
     CIMName targetAssocClassName = resultClass;  
   
     // KSTEMPCIMName targetClassName = objectName.getClassName();  
   
     targetAssocClass classEnum  = _verifyValidAssocClassInput(targetAssocClassName);  
   
     Array<CIMInstance> assocInstances;  
   
     if (classEnum == CIM_COMMMECHANISMFORMANAGERASSOC)  
         assocInstances = _buildInstancesCommMechanismForManager(objectName);  
   
     if (classEnum == CIM_NAMESPACEINMANAGERASSOC)  
         assocInstances = _buildInstancesNamespaceInManager(objectName);  
   
     _filterAssocInstances(assocInstances, resultClass, role);  
   
     for (Uint32 i = 0 ; i < assocInstances.size() ; i++ )  
     {  
         CIMObjectPath ref = _buildObjectPath(objectName,  
                 targetAssocClassName, assocInstances[i]);  
         CDEBUG("referenceNames returns: " << ref.toString());  
         handler.deliver(ref);  
     }  
   
     handler.complete();  
   
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     // Convert the instances to referenceNames response  
 } }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
 // END_OF_FILE  // END OF FILE


Legend:
Removed from v.1.43  
changed lines
  Added in v.1.72

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2