(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.2 and 1.36

version 1.2, 2003/08/18 14:14:40 version 1.36, 2005/05/24 10:42:51
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%2005////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // The Open Group, Tivoli Systems  // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
   // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation, The Open Group.
   // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; VERITAS Software Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 25 
Line 31 
 // //
 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
 //                (carolann_graves@hp.com) //                (carolann_graves@hp.com)
 //              Karl Schopmeyer - Add Cim_Namespace capabilities.  //              Karl Schopmeyer - Created Cim_Namespace capabilities.
 //              Karl Schopmeyer - Temp added objectmanager and communication classes  //              Karl Schopmeyer - added objectmanager and communication classes
   //              Josephine Eskaline Joyce, IBM (jojustin@in.ibm.com) for Bug#3194
   //              David Dillard, VERITAS Software Corp.
   //                  (david.dillard@veritas.com)
   //              Aruran, IBM (ashanmug@in.ibm.com) for Bug# 3659
 // //
 //%//////////////////////////////////////////////////////////////////////////// //%////////////////////////////////////////////////////////////////////////////
  
  
 /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
 //  Namespace Provider  //  Interop Provider - This provider services those classes from the
   //  DMTF Interop schema association with the CIMOM itself
 // //
 //      This provider answers to the "false" class __namespace.  This is the  //  This provider services the following classes:
 //      deprecated version of manipulation in the DMTF WBEM model.  This function  //      CIMObjectManager
 //      is defined in the CIM Operations over HTTP docuement.  However, while  //      CIM_ObjectManagerCommunicationMechanism
 //      the function exists, no class was ever defined in the CIM model for  //      CIM_CIMXMLCommunicationMechanism
 //      __nemaspace.  Therefore each implementation is free to provide its own  //      CIM_ProtocolAdapter  (Note: Removed because deprecated class in cim 2.9)
 //      class definition.  //      CIM_Namespace (Effective Pegasus 2.4 we use PG_Namespace which
   //      is a subclass of CIM_Namespace with additional properties for
   //      shared namespaces.
   //
   //      It also services the Interop associations tied to these classes
   //      including:
   //      CIM_NamespaceInManager
   //      ...
   //      This is a control provider and as such uses the Tracer functions
   //      for data and function traces.  Since we do not expect high volume
   //      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.
  
 /* STATUS: In process but running 12 August 2003 KS */      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 51 
Line 80 
 #include <iostream> #include <iostream>
  
 #include "InteropProvider.h" #include "InteropProvider.h"
   #include "Guid.h"
 #include <Pegasus/Common/String.h> #include <Pegasus/Common/String.h>
 #include <Pegasus/Common/System.h> #include <Pegasus/Common/System.h>
 #include <Pegasus/Common/ArrayInternal.h> #include <Pegasus/Common/ArrayInternal.h>
Line 63 
Line 93 
 #include <Pegasus/Common/Tracer.h> #include <Pegasus/Common/Tracer.h>
 #include <Pegasus/Common/OperationContext.h> #include <Pegasus/Common/OperationContext.h>
 #include <Pegasus/Config/ConfigManager.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>
  
 // ATTN: KS these are in header  
 #include <Pegasus/Repository/CIMRepository.h>  
 #include <Pegasus/Provider/CIMInstanceProvider.h>  
 //#include <Pegasus/Provider/CIMAssociationProvider.h>  
 #include <Pegasus/Common/ResponseHandler.h>  
  
   #include <stdlib.h>
  
 #include <Pegasus/Common/XmlWriter.h>  //The following include is needed for gethostbyname
   #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) PEGASUS_STD(cout) << "InteropProvider " << X << PEGASUS_STD(endl)  
 //#define CDEBUG(X)  
 //#define DEBUG(X) Logger::put (Logger::DEBUG_LOG, "Linux_ProcessorProvider", Logger::INFORMATION, "$0", X)  
  
 /**  #define CDEBUG(X)
  * Specification for CIM Operations over HTTP  #define LDEBUG()
  *  //#define CDEBUG(X) PEGASUS_STD(cout) << "InteropProvider " << X << PEGASUS_STD(endl)
  * Version 1.0  //#define LDEBUG(X) Logger::put (Logger::DEBUG_LOG, "InteropProvider", Logger::TRACE, "$0", X)
  *  
  * 2.5. Namespace Manipulation  //**************************************************************************
  * There are no intrinsic methods defined specifically for the  //
  * purpose of manipulating CIM Namespaces. However, the modelling  //    Constants representing the class names processed
  * of a CIM Namespace using the class __Namespace, together with  //
  * the requirement that the root Namespace MUST be supported by  //**************************************************************************
  * all CIM Servers, implies that all Namespace operations can be  
  * supported.  const char * thisProvider = "InteropProvider";
  *  // The following should be moved to somewhere like constants.
  * For example:  static const String PegasusInstanceIDGlobalPrefix = "PEG";
  *  
  * Enumeration of all child Namespaces of a particular Namespace  
  * is realized by calling the intrinsic method  
  * EnumerateInstanceNames against the parent Namespace,  
  * specifying a value for the ClassName parameter of __Namespace.  
  *  
  * Creation of a child Namespace is realized by calling the  
  * intrinsic method CreateInstance against the parent Namespace,  
  * specifying a value for the NewInstance parameter which defines  
  * a valid instance of the class __Namespace and whose Name  
  * property is the desired name of the new Namespace.  
  *  
 */  
  
 /** /**
     The constants representing the class names we process     The constants representing the class names we process
 */ */
 static const CIMName __NAMESPACE_CLASSNAME  = CIMName ("__Namespace");  // ATTN DELETE: static const CIMName __NAMESPACE_CLASSNAME  = CIMName ("__Namespace");
 static const CIMName CIM_NAMESPACE_CLASSNAME  = CIMName ("CIM_Namespace"); static const CIMName CIM_NAMESPACE_CLASSNAME  = CIMName ("CIM_Namespace");
   static const CIMName PG_NAMESPACE_CLASSNAME  = CIMName ("PG_Namespace");
   
 static const CIMName CIM_OBJECTMANAGER_CLASSNAME  = CIMName ("CIM_ObjectManager"); static const CIMName CIM_OBJECTMANAGER_CLASSNAME  = CIMName ("CIM_ObjectManager");
 static const CIMName CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM_CLASSNAME  = static const CIMName CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM_CLASSNAME  =
         CIMName ("CIM_ObjectManagerCommunicationMechanism");         CIMName ("CIM_ObjectManagerCommunicationMechanism");
 static const CIMName CIM_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME  =  static const CIMName PG_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME  =
         CIMName ("CIM_CIMXMLCommunicationMechanism");          CIMName ("PG_CIMXMLCommunicationMechanism");
   static const CIMName CIM_COMMMECHANISMFORMANAGER_CLASSNAME  =
           CIMName ("CIM_CommMechanismForManager");
   static const CIMName CIM_NAMESPACEINMANAGER_CLASSNAME  =
           CIMName ("CIM_NamespaceInManager");
  
 // Property Names for __Namespace Class // Property Names for __Namespace Class
 static const CIMName NAMESPACE_PROPERTYNAME  = CIMName ("Name"); static const CIMName NAMESPACE_PROPERTYNAME  = CIMName ("Name");
Line 128 
Line 153 
 // Property names for CIM_ObjectManager Class // Property names for CIM_ObjectManager Class
 static const CIMName OM_GATHERSTATISTICALDATA  = static const CIMName OM_GATHERSTATISTICALDATA  =
  CIMName ("GatherStatisticalData");  CIMName ("GatherStatisticalData");
   // Property for the slp template.
   static const CIMName OM_DESCRIPTIONPROPERTY =
       CIMName("Description");
  
 // Property Names for ObjectManagerCommunicationMechanism Class // Property Names for ObjectManagerCommunicationMechanism Class
 static const CIMName OM_COMMUNICATIONMECHANISM  = static const CIMName OM_COMMUNICATIONMECHANISM  =
Line 153 
Line 180 
  
 static const String CIMXMLProtocolVersion = "1.0"; static const String CIMXMLProtocolVersion = "1.0";
  
   
 // Defines to serve as the ENUM for class selection  
 #define __NAMESPACE 1  
 #define CIM_NAMESPACE 2  
 #define CIM_OBJECTMANAGER 3  
 #define CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM 4  
 #define CIM_CIMXMLCOMMUNICATIONMECHANISM 5  
   
 // Property names for CIM_Namespace Class // Property names for CIM_Namespace Class
   
 static const CIMName CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME = static const CIMName CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME =
         CIMName ("SystemCreationClassName");         CIMName ("SystemCreationClassName");
 static const CIMName CIM_NAMESPACE_PROPERTY_SYSTEMNAME = static const CIMName CIM_NAMESPACE_PROPERTY_SYSTEMNAME =
Line 178 
Line 198 
 static const CIMName CIM_NAMESPACE_PROPERTY_DESCRIPTIONOFCLASSINFO = static const CIMName CIM_NAMESPACE_PROPERTY_DESCRIPTIONOFCLASSINFO =
         CIMName ("DescriptionOfClassInfo");         CIMName ("DescriptionOfClassInfo");
  
   // Additional Property names for PG_Namespace Class
   
   static const CIMName PG_NAMESPACE_PROPERTY_SCHEMAUPDATESALLOWED =
           CIMName ("SchemaUpdatesAllowed");
   static const CIMName PG_NAMESPACE_PROPERTY_ISSHAREABLE =
           CIMName ("IsShareable");
   static const CIMName PG_NAMESPACE_PROPERTY_PARENTNAMESPACE =
           CIMName ("ParentNamespace");
   static const CIMName PG_NAMESPACE_PROPERTY_NAME =
           CIMName ("Name");
   
   // Defines to serve as the ENUM for class selection for instance
   // operations.
   
   enum targetClass{
           //__NAMESPACE = 1,
           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");
        _repository = repository;
   
       //***********************************************
       // This is a tempory fix untill there is a method created for the InteropProvider to
       // do it's inaliaztion work. This fix sets StatisticalData::CopyGSD, enabling the
       //statistical gathering function.
       Array<CIMInstance> instance = repository->enumerateInstances(CIMNamespaceName("root/cimv2"), CIMName ("CIM_ObjectManager"));
   
       if(instance.size() > 0)
       {
           Boolean output = false;
           Uint32 pos;
           if ((pos = instance[0].findProperty(CIMName("GatherStatisticalData"))) != PEG_NOT_FOUND)
           {
               CIMConstProperty p1 = instance[0].getProperty(pos);
               if (p1.getType() == CIMTYPE_BOOLEAN)
               {
                   CIMValue v1  = p1.getValue();
                   if (!v1.isNull())
                   {
                       v1.get(output);
                       if (v1 == true)
                       {
                           StatisticalData* sd = StatisticalData::current();
                           sd->setCopyGSD(true);
                       }
                   }
               }
           }
       }
       //******************************************* end of temporary fix
       PEG_METHOD_EXIT();
    }
   
   
  
 //*************************************************************** //***************************************************************
 // Utility Functions  // Provider Utility Functions
 //*************************************************************** //***************************************************************
  
   String _showBool(Boolean x)
   {
       return(x? "true" : "false");
   }
   
   static String _toStringPropertyList(const CIMPropertyList& pl)
   {
       String tmp;
       for (Uint32 i = 0; i < pl.size() ; i++)
       {
           if (i > 0)
               tmp.append(", ");
           tmp.append(pl[i].getString());
       }
       return(tmp);
   }
   
   static String _showPropertyList(const CIMPropertyList& pl)
   {
       if (pl.isNull())
           return("NULL");
   
       String tmp;
   
       tmp.append((pl.size() == 0) ? "Empty" : _toStringPropertyList(pl));
       return(tmp);
   }
   
   /** get one string property from an instance. Note that these functions simply
       return the default value if the property cannot be found or is of the wrong
       type thus, in reality being a maintenance problem since there is no
       error indication.
       @param instance CIMInstance from which we get property value
       @param 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;
       Uint32 pos;
       if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)
       {
           CIMConstProperty p1 = instance.getProperty(pos);
           if (p1.getType() == CIMTYPE_STRING)
           {
               CIMValue v1  = p1.getValue();
   
               if (!v1.isNull())
                   v1.get(output);
           }
       }
       return(output);
   }
   
   // Overload of _getPropertyValue for boolean type
   Boolean _getPropertyValue(const CIMInstance& instance, const CIMName& propertyName, const Boolean defaultValue)
   {
       Boolean output = defaultValue;
       Uint32 pos;
       if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)
       {
           CIMConstProperty p1 = instance.getProperty(pos);
           if (p1.getType() == CIMTYPE_BOOLEAN)
           {
               CIMValue v1  = p1.getValue();
   
               if (!v1.isNull())
                   v1.get(output);
           }
       }
       return(output);
   }
   
   /** get Host IP address from host name. If the
       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
       @return String with the IP address to be used
       NOTE: This code should not be in slpprovider. This
       should be in the Interop classes but for the moment
       it is not.
   */
   String _getHostAddress(String hostName)
   {
     String ipAddress;
   
     if (hostName == String::EMPTY)
           hostName = System::getHostName();
   
     if ((ipAddress = System::getHostIP(hostName)) == String::EMPTY)
     {
         // set default address if everything else failed
         ipAddress = String("127.0.0.1");
     }
     return ipAddress;
   }
   
    Array<String> _getFunctionalProfiles(Array<Uint16> & profiles)
    {
        Array<String> profileDescriptions;
        profiles.append(2); profileDescriptions.append("Basic Read");
        profiles.append(3); profileDescriptions.append("Basic Write");
        profiles.append(4); profileDescriptions.append("Schema Manipulation");
        profiles.append(5); profileDescriptions.append("Instance Manipulation");
        profiles.append(6); profileDescriptions.append("Association Traversal");
        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
       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()
   {
   
       char * trademark;
       trademark = getenv("PEGASUS_TRADEMARK_PREFIX");
       return((trademark)? trademark : PegasusInstanceIDGlobalPrefix);
   }
   /** Builds the UUID string for this CIMOM.
   **/
   String getUUIDString()
   {
       return(Guid::getGuid());
   }
   
 /* Test the keys in the CIM_Namespace for valid values /* Test the keys in the CIM_Namespace for valid values
    This includes all of the keys above the name key.    This includes all of the keys above the name key.
    THis is a dummy for now.    THis is a dummy for now.
    ATTN: KS Extend and finish this function.    ATTN: KS Extend and finish this function.
 */ */
 Boolean _testKeys(const CIMObjectPath& path)  Boolean _validateProperties(const CIMObjectPath& path)
 { {
     return true;     return true;
 } }
 Boolean _testKeys(const CIMInstance& instance)  
   Boolean _validateProperties(const CIMInstance& instance)
 { {
     return true;     return true;
 } }
  
   /* Validate that the property exists, is string type and
 /* Query the repository for array of all namespacenames     optionally the value itself. Note processes only String
      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
 */ */
 Array<CIMNamespaceName> InteropProvider::_enumerateNameSpaces()  Boolean _validateRequiredProperty(const CIMInstance& instance,
                             const CIMName& propertyName,
                             const String& value)
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_enumerateNameSpaces()");              "InteropProvider::_validateRequiredProperty()");
     Array<CIMNamespaceName> namespaceNames;      Uint32 pos;
     _repository->read_lock();  
  
     try      if ((pos = instance.findProperty (propertyName)) == PEG_NOT_FOUND)
     {     {
         namespaceNames = _repository->enumerateNameSpaces();          PEG_METHOD_EXIT();
           return(false);
     }     }
     catch(CIMException& e)      //
       //  Get the property
       //
       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()))
     {     {
         _repository->read_unlock();  
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         throw e;          return(false);
     }     }
     catch(Exception& e)  
       String valueField;
       theValue.get(valueField);
       if ((value == String::EMPTY) || (valueField == value))
     {     {
         _repository->read_unlock();  
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         throw e;          return(true);
     }     }
   
     _repository->read_unlock();  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(namespaceNames);      return(false);
 } }
  
 /* get the CIM_Namespace Class defintion from the repository or  Boolean _validateRequiredProperty(const CIMInstance& instance,
    from local static storage.                            const CIMName& propertyName,
    @param namespace in which to look for the class.                            const Uint16& value)
    @param name of class to get.  
    @return the CIMClass object  
    @Exceptions any repository exceptions if class not found.  
 */  
 CIMClass InteropProvider::_getClass(const CIMNamespaceName& nameSpace,  
                                                  const CIMName& className)  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_getCIM_NamespaceClass()");          "InteropProvider::_validateRequiredProperty()");
     CIMClass myClass;  
     CDEBUG("Get Class from repository " <<  className.getString());      PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4, "Validate "
     if (myClass.isUninitialized())          + propertyName.getString());
     {  
         _repository->read_lock();      Uint32 pos;
         try      if ((pos = instance.findProperty (propertyName)) == PEG_NOT_FOUND)
         {  
             myClass = _repository->getClass(_operationNamespace, className );  
         }  
         catch(CIMException& e)  
         {         {
             _repository->read_unlock();  
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             throw e;          return(false);
         }         }
         catch(Exception& e)      //
       //  Get the property
       //
       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()) )
         {         {
             _repository->read_unlock();  
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             throw e;          return(false);
         }  
         _repository->read_unlock();  
     }     }
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return myClass;      return(true);
 } }
  
   Boolean _validateRequiredProperty(const CIMObjectPath& objectPath,
 /* Verify that this is one of the legal classnames and                            const CIMName& propertyName,
    return indicator which.                            const String value)
    @param - Classname  
    @return - Uint32 indicating type  
    @Exceptions - throws CIMNotSupportedException if invalid class.  
 */  
 Uint32 _verifyValidClassInput(const CIMName& className)  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_verifyValidClassInput()");              "InteropProvider::_validateRequiedProperty()");
     // Verify that ClassName == __Namespace or CIM_Namespace      Array<CIMKeyBinding> kbArray = objectPath.getKeyBindings();
     // ATTN: KS Check to determine if equal is case independent  
     CDEBUG("Class Name Input = " << className.getString());  
  
     if (className.equal(__NAMESPACE_CLASSNAME))      // find the correct key binding
       for (Uint32 i = 0; i < kbArray.size(); i++)
       {
           if (kbArray[i].getName() == propertyName)
           {
               if (value != String::EMPTY)
               {
                   if (value !=kbArray[i].getValue())
     {     {
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         return __NAMESPACE;                      return(true);
                   }
               }
           }
     }     }
   
     if (className.equal(CIM_OBJECTMANAGER_CLASSNAME))  
     {  
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         return CIM_OBJECTMANAGER;      return(true);
     }     }
  
     if (className.equal(CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM_CLASSNAME))  /* Query the repository for array of all namespacenames
      @return Array<CIMNamespaceName> with all namespaces
      @exception Passes all exception that repository may generate.
   */
   Array<CIMNamespaceName> InteropProvider::_enumerateNameSpaces()
     {     {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_enumerateNameSpaces()");
   
       Array<CIMNamespaceName> namespaceNames;
   
       namespaceNames = _repository->enumerateNameSpaces();
   
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         return CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM;      return(namespaceNames);
     }     }
  
     if (className.equal(CIM_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME))  /* get a class defintion. Gets the class defined by
       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 CIMNamespaceName& nameSpace,
                                       const CIMName& className)
     {     {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_getClass");
   
       CIMClass myClass = _repository->getClass(nameSpace, className,
                               false,true,true);
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         return CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM;      return myClass;
     }     }
  
     // Last entry, reverse test and returnOK if CIM_Namespace  /* Verify that this is one of the legal classnames and
     if (!className.equal(CIM_NAMESPACE_CLASSNAME))     return indicator which.
      @param - Classname
      @return - Uint32 indicating type
      @Exceptions - throws CIMNotSupportedException if invalid class.
   */
   static targetClass _verifyValidClassInput(const CIMName& className)
     {     {
         PEG_METHOD_EXIT();      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "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         throw CIMNotSupportedException
             (className.getString() + " not supported by Interop Provider");             (className.getString() + " not supported by Interop Provider");
   
       PEG_METHOD_EXIT();
       return PG_NAMESPACE;
     }     }
  
   static targetAssocClass _verifyValidAssocClassInput(const CIMName& className)
   {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_verifyValidAssocClassInput");
       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();     PEG_METHOD_EXIT();
     return CIM_NAMESPACE;      return CIM_COMMMECHANISMFORMANAGERASSOC;
 } }
  
 /* validate the authorization of the user name against the namespace. /* validate the authorization of the user name against the namespace.
 */ */
 String _validateUserID(const OperationContext & context) String _validateUserID(const OperationContext & context)
 { {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_validateUserID");
     //ATTN-DME-P3-20020522: ADD AUTHORIZATION CHECK TO __NAMESPACE PROVIDER     //ATTN-DME-P3-20020522: ADD AUTHORIZATION CHECK TO __NAMESPACE PROVIDER
     String userName;     String userName;
     try     try
Line 331 
Line 627 
         IdentityContainer container = context.get(IdentityContainer::NAME);         IdentityContainer container = context.get(IdentityContainer::NAME);
         userName = container.getUserName();         userName = container.getUserName();
     }     }
   
     catch (...)     catch (...)
     {     {
        userName = String::EMPTY;        userName = String::EMPTY;
     }     }
   
       PEG_METHOD_EXIT();
     return userName;     return userName;
 } }
  
 /* Create an instance of the CIM_Namespace class which is based  /** Set the value of a property defined by property name in the instance provided.
    on the following CIM MOF Specification      Sets a String into the value field unless the property name cannot be found.
 [Version ("2.6.0"), Description (      If the property cannot be found, it simply returns.
     "Namespace provides a domain (in other words, a container), "      ATTN: This function does not pass an error back if property not found.
     "in which the instances [of a class] are guaranteed to be "      @param instance CIMInstance in which to set property value
     "unique per the KEY qualifier definitions.  It is named "      @param propertyName CIMName of property in which value will be set.
     "relative to the CIM_ObjectManager implementation that "      @param value String value to set into property
     "provides such a domain.") ]  
 class CIM_Namespace : CIM_ManagedElement {  
   
     [Propagated("CIM_ObjectManager.SystemCreationClassName"), Key,  
         MaxLen (256), Description (  
            "The scoping System's CreationClassName.") ]  
     string SystemCreationClassName;  
   
     [Propagated("CIM_ObjectManager.SystemName"), Key, MaxLen (256),  
         Description ("The scoping System's Name.") ]  
     string SystemName;  
   
     [Propagated ("CIM_ObjectManager.CreationClassName"), Key,  
         MaxLen (256), Description (  
            "The scoping ObjectManager's CreationClassName.") ]  
     string ObjectManagerCreationClassName;  
   
     [Propagated ("CIM_ObjectManager.Name"), Key, MaxLen (256),  
         Description ("The scoping ObjectManager's Name.") ]  
     string ObjectManagerName;  
   
     [Key, MaxLen (256), Description (  
         "CreationClassName indicates the name of the class or the "  
         "subclass used in the creation of an instance. When used "  
         "with the other key properties of this class, this property "  
         "allows all instances of this class and its subclasses to "  
         "be uniquely identified.") ]  
     string CreationClassName;  
   
     [Key, MaxLen (256), Description (  
         "A string to uniquely identify the Namespace within "  
         "the ObjectManager.") ]  
     string Name;  
   
     [Required, Write, Description (  
         "Enumeration indicating the organization/schema of the "  
         "Namespace's objects. For example, they may be instances "  
         "of classes of a specific CIM version."),  
         ValueMap {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",  
                   "10", "200", "201", "202"},  
         Values {"Unknown", "Other", "CIM 1.0", "CIM 2.0",  
               "CIM 2.1", "CIM 2.2", "CIM 2.3", "CIM 2.4", "CIM 2.5",  
               "CIM 2.6", "CIM 2.7", "DMI Recast", "SNMP Recast",  
                   "CMIP Recast"},  
         ModelCorrespondence {"CIM_Namespace.DescriptionOfClassInfo"} ]  
     uint16 ClassInfo;  
   
     [Write, Description (  
         "A string providing more detail (beyond the general "  
         "classification in ClassInfo) for the object hierarchy of "  
         "the Namespace."),  
         ModelCorrespondence {"CIM_Namespace.ClassInfo"} ]  
     string DescriptionOfClassInfo;  
 };  
  
 */ */
 void _buildInstanceCommonKeys(CIMInstance& instance)  void _setPropertyValue(CIMInstance& instance, const CIMName propertyName, const String& value)
 { {
       Uint32 pos;
       if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)
           instance.getProperty(pos).setValue(CIMValue(value));
   }
  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  void _setPropertyValue(CIMInstance& instance, const CIMName propertyName, const Boolean& value)
             "InteropProvider::_buildInstanceCommonKeys()");  {
     String SystemCreationClassName = System::getSystemCreationClassName ();      Uint32 pos;
     if (SystemCreationClassName == String::EMPTY)      if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)
           instance.getProperty(pos).setValue(CIMValue(value));
   }
   
   void _setPropertyValue(CIMInstance& instance, const CIMName propertyName, const Uint16& value)
   {
       Uint32 pos;
       if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)
           instance.getProperty(pos).setValue(CIMValue(value));
   }
   
   void _setPropertyValue(CIMInstance& instance, const CIMName propertyName, const Array<String>& value)
   {
       Uint32 pos;
       if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)
           instance.getProperty(pos).setValue(CIMValue(value));
   }
   
   void _setPropertyValue(CIMInstance& instance, const CIMName propertyName, const Array<Uint16>& value)
   {
       Uint32 pos;
       if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)
           instance.getProperty(pos).setValue(CIMValue(value));
   }
   
   void _setPropertyValue(CIMInstance& instance, const CIMName propertyName, const CIMObjectPath& value)
     {     {
         SystemCreationClassName = "CIM_ComputerSystem";      Uint32 pos;
       if ((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)
           instance.getProperty(pos).setValue(CIMValue(value));
     }     }
  
     String SystemName = System::getHostName();  /** 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
  
     instance.addProperty(      _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_SYSTEMNAME,System::getFullyQualifiedHostName());
         (CIMProperty(CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,  
                      SystemCreationClassName)));  
     // SystemName  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_SYSTEMNAME,  
                      SystemName)));  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
 CIMInstance _buildInstancCIMXMLCommunicationMechanism()  /** 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 CIMName& className)
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_buildInstanceCIMXMLCommunicationMechanism()");              "InteropProvider::_buildInstanceSkeleton()");
       CIMClass myClass;
  
     CIMInstance instance(CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM_CLASSNAME);      CIMInstance skeleton(className);
           myClass = _repository->getClass(_operationNamespace, className, false, true, true);
  
     _buildInstanceCommonKeys(instance);      // copy the qualifiers
       for (Uint32 i = 0 ; i < myClass.getQualifierCount() ; i++)
           skeleton.addQualifier(myClass.getQualifier(i));
  
     //CreationClassName      // copy the properties
     instance.addProperty(      for (Uint32 i = 0 ; i < myClass.getPropertyCount() ; i++)
         (CIMProperty(CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,          skeleton.addProperty(myClass.getProperty(i));
             CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM_CLASSNAME.getString() )));  
   
     String name = "PegasusCommunicationMechanism";  
   
     //Name, this CommunicationMechanism.  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_NAME,  
                      name )));  
   
     // CommunicationMechanism Property  
     instance.addProperty(  
         (CIMProperty(OM_COMMUNICATIONMECHANISM,  
                      Uint16(2) )));  
   
     // CommunicationMechanism Property  
     instance.addProperty(  
         (CIMProperty(OM_COMMUNICATIONMECHANISM,  
                      Uint16(2) )));  
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(instance);      return(skeleton.clone());
 } }
  
   /* build a single instance of the cimxmlcommunicationmechanism class
 CIMInstance _buildInstancCIMObjectCommunicationMechanism()     using the parameter provided as the name property
      @parm name String representing the name to be used for this object.
      @return CIMInstance of the class
   */
   CIMInstance InteropProvider::_buildInstancePGCIMXMLCommunicationMechanism(
                                               const String& namespaceType,
                                               const String& IPAddress,
                                               const Boolean& includeQualifiers,
                                               const Boolean& includeClassOrigin,
                                               const CIMPropertyList& propertyList)
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_buildInstanceCIMObjectCommunicationMechanism()");              "InteropProvider::_buildInstancePGCIMXMLCommunicationMechanism()");
  
     CIMInstance instance(CIM_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME);      CIMInstance instance = _buildInstanceSkeleton(PG_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME);
   
     _buildInstanceCommonKeys(instance);  
  
       _fixInstanceCommonKeys(instance);
  
     //CreationClassName     //CreationClassName
     instance.addProperty(      _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,PG_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME.getString());
         (CIMProperty(CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,  
             CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM_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
     String name = "PegasusCommunicationMechanism";      // now.
     //Name, this CommunicationMechanism.      _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_NAME, (String("PEGASUSCOMM") + namespaceType));
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_NAME,      // CommunicationMechanism Property - Force to 2.
                      name )));      _setPropertyValue(instance, OM_COMMUNICATIONMECHANISM, Uint16(2));
   
     // CommunicationMechanism Property  
     instance.addProperty(  
         (CIMProperty(OM_COMMUNICATIONMECHANISM,  
                      Uint16(2) )));  
  
     //Functional Profiles Supported Property.     //Functional Profiles Supported Property.
     Array<Uint16> profiles;     Array<Uint16> profiles;
     Array<String> profileDescriptions;      Array<String> profileDescriptions = _getFunctionalProfiles(profiles);
     CIMValue profileValue(profiles);  
     CIMValue profileDescriptionsValue(profileDescriptions);  
  
     profiles.append(2); profileDescriptions.append("Basic Read");      // Set functional profiles in instance
     profiles.append(3); profileDescriptions.append("Basic Write");      _setPropertyValue(instance, OM_FUNCTIONALPROFILESSUPPORTED, profiles);
     profiles.append(4); profileDescriptions.append("Schema Manipulation");  
     profiles.append(5); profileDescriptions.append("Instance Manipulation");  
     profiles.append(6); profileDescriptions.append("Association Traversal");  
     profiles.append(8); profileDescriptions.append("Qualifier Declaration");  
     profiles.append(9); profileDescriptions.append("Indications");  
  
     instance.addProperty(      _setPropertyValue(instance, OM_FUNCTIONALPROFILEDESCRIPTIONS, profileDescriptions);
         (CIMProperty(OM_FUNCTIONALPROFILESSUPPORTED,  
                      profileValue )));  
     instance.addProperty(  
         (CIMProperty(OM_FUNCTIONALPROFILEDESCRIPTIONS,  
                      profileDescriptionsValue )));  
  
     // Multiple OperationsSupported Property     // Multiple OperationsSupported Property
     instance.addProperty(      _setPropertyValue(instance, OM_MULTIPLEOPERATIONSSUPPORTED, false);
         (CIMProperty(OM_MULTIPLEOPERATIONSSUPPORTED,  
                      Boolean(false) )));  
     // AuthenticationMechanismsSupported  
  
       // AuthenticationMechanismsSupported Property
     Array<Uint16> authentications;     Array<Uint16> authentications;
     Array<String> authenticationDescriptions;     Array<String> authenticationDescriptions;
     CIMValue authenticationValue(authentications);  
     CIMValue authenticationDescriptionsValue(authenticationDescriptions);  
     profiles.append(3); profileDescriptions.append("Basic");  
   
     instance.addProperty(  
         (CIMProperty(OM_AUTHENTICATIONMECHANISMSSUPPORTED,  
                      authenticationValue )));  
     instance.addProperty(  
         (CIMProperty(OM_AUTHENTICATIONMECHANISMDESCRIPTIONS,  
                      authenticationDescriptionsValue )));  
   
     //Version property  
     instance.addProperty(  
         (CIMProperty(OM_VERSION,  
                      CIMXMLProtocolVersion )));  
  
     PEG_METHOD_EXIT();      // Note that we have fixed authentication here.
     return(instance);      authentications.append(3); authenticationDescriptions.append("Basic");
 }  
  
 String _getObjectManagerName()      _setPropertyValue(instance, OM_AUTHENTICATIONMECHANISMSSUPPORTED, authentications);
 {  
     return ("PEG_123456789");  
 }  
  
 CIMInstance _buildInstanceCIMObjectManager()      _setPropertyValue(instance, OM_AUTHENTICATIONMECHANISMDESCRIPTIONS, authenticationDescriptions);
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_buildInstanceCIMObjectManager()");  
  
     CIMInstance instance(CIM_OBJECTMANAGER_CLASSNAME);      _setPropertyValue(instance, OM_VERSION, CIMXMLProtocolVersion);
  
     _buildInstanceCommonKeys(instance);      // Obsolete function
       _setPropertyValue(instance, "namespaceType", namespaceType);
  
     //CreationClassName      _setPropertyValue(instance, "IPAddress", IPAddress);
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,  
                      CIM_OBJECTMANAGER_CLASSNAME.getString() )));  
     //Name, this CIMObject Manager.  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_NAME,  
                      _getObjectManagerName() )));  
  
     //Property GatherStatisticalData. Note that today we do not      PEG_METHOD_EXIT();
     // have a dynamic activation for this value.      return(instance);
   }
  
 #ifdef PEGASUS_HAS_PERFINST  Array<CIMInstance> InteropProvider::_buildInstancesPGCIMXMLCommunicationMechanism(
     Boolean gatherStatData = true;                                              const Boolean includeQualifiers,
 #else                                              const Boolean includeClassOrigin,
     Boolean gatherStatData = false;                                              const CIMPropertyList& propertyList)
   {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_buildInstancesPGCIMXMLCommunicationMechanism");
   
       // This is a temporary hack to get the multiple connections.
       ConfigManager* configManager = ConfigManager::getInstance();
       Boolean enableHttpConnection = String::equal(
           configManager->getCurrentValue("enableHttpConnection"), "true");
       Boolean enableHttpsConnection = String::equal(
           configManager->getCurrentValue("enableHttpsConnection"), "true");
   
       String IPAddress = _getHostAddress(System::getHostName());
       Array<CIMInstance> instances;
   
       if (enableHttpConnection)
       {
           CDEBUG("building pgcimxmlinstances 1");
           CIMInstance instance = _buildInstancePGCIMXMLCommunicationMechanism(
                               "http", IPAddress,
                               includeQualifiers,
                               includeClassOrigin,
                               propertyList);
           instances.append(instance);
       }
   
       if (enableHttpsConnection)
       {
           CDEBUG("building pgcimxmlinstances 2");
           CIMInstance instance = _buildInstancePGCIMXMLCommunicationMechanism(
                                                   "https", IPAddress,
                                                   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(
                           CIMInstance& rtnInstance,
                           const Boolean includeQualifiers,
                           const Boolean includeClassOrigin,
                           const CIMPropertyList& propertyList)
   {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_getInstanceCIMObjectManager");
       // Try to get persistent instance from repository
       Array<CIMInstance> instances;
       try
       {
           instances = _repository->enumerateInstances(_operationNamespace,
                         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());
               }
               CDEBUG("getInstanceFromRepository returning true");
               return(true);
           }
           else
           {
               CDEBUG("getInstanceFromRepository returning false");
               return(false);
           }
       }
       catch(const CIMException&)
       {
           Logger::put(Logger::ERROR_LOG, System::CIMSERVER, Logger::INFORMATION,
               "Error. Cannot access $0 in repository", CIM_OBJECTMANAGER_CLASSNAME.getString());
           PEG_METHOD_EXIT();
           throw;
       }
       catch(const Exception&)
       {
           Logger::put(Logger::ERROR_LOG, System::CIMSERVER, Logger::INFORMATION,
               "Error. Cannot access $0 in repository", CIM_OBJECTMANAGER_CLASSNAME.getString());
           PEG_METHOD_EXIT();
           throw;
       }
   }
   
   /** build an instance of the CIM_ObjectManager class filling out
       the required properties if one does not already exist in the
       repository. This function will either return an instance
       or throw an exception.
       @param includeQualifiers Boolean
       @param includeClassOrigin Boolean
       @param propertylist CIMPropertyList
       @return CIMInstance with a single built instance of the class
       @exception repository instances if exception to enumerateInstances
           for this class.
   */
   CIMInstance InteropProvider::_getInstanceCIMObjectManager(
                           const Boolean includeQualifiers,
                           const Boolean includeClassOrigin,
                           const CIMPropertyList& propertyList)
   {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_buildInstanceCIMObjectManager");
   
       // Try to get the current object.  If true then it is already created.
       CIMInstance instance;
       if (!_getInstanceFromRepositoryCIMObjectManager(instance, includeQualifiers,includeClassOrigin,propertyList))
       {
           //
           // No instance in the repository. Build new instance and save it.
           //
           CDEBUG("Creating New instance of CIMOBjectManager");
           instance = _buildInstanceSkeleton(CIM_OBJECTMANAGER_CLASSNAME);
   
           _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.
           // Provided undocumented option to get this from the environment.
           // This should probably be removed or documented.
           //
           String description;
           char * envDescription;
           envDescription = getenv("PEGASUS_CIMOM_DESCRIPTION");
   
           description = (envDescription) ? envDescription :
               String(PEGASUS_PRODUCT_NAME) + " Version " +
                   String(PEGASUS_PRODUCT_VERSION);
   
           _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 #endif
     instance.addProperty(  
         (CIMProperty(OM_GATHERSTATISTICALDATA,          // write instance to the repository
                      Boolean(gatherStatData) )));          CIMObjectPath instancePath;
           // Add the instance path to this if necessary ATTN ATTN:
           try
           {
               CDEBUG("Create Instance for CIM_ObjectManager");
               instancePath = _repository->createInstance(_operationNamespace,
                              instance );
           }
           catch(const CIMException&)
           {
               // ATTN: KS generate log error if this not possible
               PEG_METHOD_EXIT();
               throw;
           }
           catch(const Exception&)
           {
               // ATTN: Generate log error.
               PEG_METHOD_EXIT();
               throw;
           }
           instance.setPath(instancePath);
       }
       instance.filter(includeQualifiers, includeClassOrigin, propertyList);
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(instance);     return(instance);
 } }
  
   /** Get the instances of CIM_Namespace. Gets all instances of the namespace from
       the repository namespace management functions
       Pegasus 2.4 - This now gets CIM_Namespace and its subclass PG_Namespace
   */
   Array<CIMInstance> InteropProvider::_getInstancesCIMNamespace(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;
   
       // We build instances of PG namespace since that is the leaf class
       for (Uint32 i = 0; i < namespaceNames.size(); i++)
       {
          instanceArray.append( _buildInstancePGNamespace(namespaceNames[i]));
       }
       CDEBUG("Build this many PG_Namespace Instances. count= " << instanceArray.size());
       PEG_METHOD_EXIT();
       return(instanceArray);
   }
   
   /** get the instance of namespace defined by the input parameter which is the object path
       for the instance required.
       ATTN: Note that this is incorrect. We are supplying the namespace name and need to supply
       the objectpath
       @param TBD
       @return CIMInstance with the found instance or CIMInstance() if nothing found.
   */
   CIMInstance InteropProvider::_getInstanceCIMNamespace(const CIMNamespaceName & nameSpace)
   {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_getInstancesCIMNamespace()");
   
       Array<CIMInstance> instances = _getInstancesCIMNamespace(true, true, CIMPropertyList());
   
       // search the instances for one with the name property value = input parameter.
       for (Uint32 i = 0 ; i < instances.size() ; i++)
       {
           if (_getPropertyValue(instances[i], CIMName("name"), String::EMPTY) == nameSpace.getString())
           {
               PEG_METHOD_EXIT();
               return(instances[i]);
           }
       }
       PEG_METHOD_EXIT();
       CIMInstance nullInstance;
       return(nullInstance);
   }
   
   CIMObjectPath InteropProvider::_buildReference(const CIMInstance& instance, const CIMName& className)
   {
       return(_buildObjectPath(_operationNamespace,className, instance));
   }
   
   Array<CIMInstance> InteropProvider::_buildInstancesNamespaceInManager()
   {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_buildInstancesNamespaceInManager");
   
       Array<CIMInstance> namespaceInstances = _getInstancesCIMNamespace(false,
                               false, CIMPropertyList());
   
       CIMInstance instanceObjMgr = _getInstanceCIMObjectManager( true, true, CIMPropertyList());
   
       CIMObjectPath refObjMgr = _buildReference(instanceObjMgr, CIM_OBJECTMANAGER_CLASSNAME);
   
       Array<CIMInstance> assocInstances;
   
       for (Uint32 i = 0 ; i < namespaceInstances.size() ; i++)
       {
           CIMInstance instance = _buildInstanceSkeleton(CIM_NAMESPACEINMANAGER_CLASSNAME);
   
           _setPropertyValue(instance, CIMName("Antecedent"), refObjMgr);
           //ATTNATTN: this is weak qualifier.
           _setPropertyValue(instance, CIMName("Dependent"), _buildReference(namespaceInstances[i],
                                                               CIM_NAMESPACEINMANAGER_CLASSNAME));
           assocInstances.append(instance);
       }
   
       PEG_METHOD_EXIT();
       return(assocInstances);
   }
   
   Array<CIMInstance> InteropProvider::_buildInstancesCommMechanismForManager()
   {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_buildInstancesCommMechanismForManager");
   
       Array<CIMInstance> commInstances = _buildInstancesPGCIMXMLCommunicationMechanism(true,
            true, CIMPropertyList());
   
       CIMInstance instanceObjMgr = _getInstanceCIMObjectManager( true, true, CIMPropertyList());
   
       CIMObjectPath refObjMgr = _buildReference(instanceObjMgr, CIM_OBJECTMANAGER_CLASSNAME);
       Array<CIMInstance> assocInstances;
   
       for (Uint32 i = 0 ; i < commInstances.size() ; i++)
       {
   
           CIMInstance instance = _buildInstanceSkeleton(CIM_COMMMECHANISMFORMANAGER_CLASSNAME);
   
           _setPropertyValue(instance,CIMName("Antecedent"), refObjMgr);
           //ATTNATTN: this is weak qualifier.
           _setPropertyValue(instance,CIMName("Dependent"), _buildReference(commInstances[i],CIM_COMMMECHANISMFORMANAGER_CLASSNAME));
           assocInstances.append(instance);
       }
   
       PEG_METHOD_EXIT();
       return(assocInstances);
   }
   
 /* generate one instance of the CIM_Namespace class with the /* generate one instance of the CIM_Namespace class with the
    properties    properties
      NOTE: CIM 2.4 - Changed to build PG namespace
    @param namespace name to put into the class    @param namespace name to put into the class
    @exceptions - exceptions carried forward from create instance    @exceptions - exceptions carried forward from create instance
    and addProperty.    and addProperty.
 */ */
 CIMInstance _buildInstanceCIMNamespace(const CIMNamespaceName & nameSpace)  CIMInstance InteropProvider::_buildInstancePGNamespace(const CIMNamespaceName & nameSpace)
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_buildInstanceCIMNamespace()");              "InteropProvider::_buildInstancePGNamespace");
   // Values for test  
     //String SystemCreationClassName = "creationclassname";      // ATTN: KS need to get the real objectManager name from elsewhere.  the only place
     //String SystemName = "SystemNameValue";      // 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";     String ObjectManagerName = "ObjectManagerNameValue";
     String ClassInfo = "ClassInfo";  
     String DescriptionOfClassInfo = "DescriptionOfClassInfo";  
  
     CIMInstance instance(CIM_NAMESPACE_CLASSNAME);      CIMInstance instance = _buildInstanceSkeleton(PG_NAMESPACE_CLASSNAME);
  
     /*  The following moved to common create      _fixInstanceCommonKeys(instance);
     // Add the properties  
     // SystemCreationClassName  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,  
                      SystemCreationClassName)));  
     // SystemName  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_SYSTEMNAME,  
                      SystemName)));  
     */  
     _buildInstanceCommonKeys(instance);  
  
     //ObjectManagerCreationClassName     //ObjectManagerCreationClassName
     instance.addProperty(      _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME, CIM_OBJECTMANAGER_CLASSNAME.getString());
         (CIMProperty(CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME,  
                      CIM_OBJECTMANAGER_CLASSNAME.getString())));  
     //ObjectManagerName     //ObjectManagerName
     // This is the one we have to sort out ATTN: TBD KS P0      _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME, ObjectManagerName);
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME,  
                      ObjectManagerName)));  
     //CreationClassName     //CreationClassName
     instance.addProperty(      // Class in which this was created,
         (CIMProperty(CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,      _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME, CIM_NAMESPACE_CLASSNAME.getString());
                      CIM_NAMESPACE_CLASSNAME.getString() )));  
     //Name     //Name
     instance.addProperty(      // This is the namespace name itself
         (CIMProperty(CIM_NAMESPACE_PROPERTY_NAME,      _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_NAME, nameSpace.getString());
                      nameSpace.getString() )));  
  
     //ClassInfo     //ClassInfo
     instance.addProperty(      // Set the classinfo to unknown and the description to namespace.
         (CIMProperty(CIM_NAMESPACE_PROPERTY_CLASSINFO,      _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CLASSINFO, Uint16(0));
                      ClassInfo)));      _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_DESCRIPTIONOFCLASSINFO, String("namespace"));
   
     //DescriptionofClassInfo  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_DESCRIPTIONOFCLASSINFO,  
                      DescriptionOfClassInfo)));  
     PEG_METHOD_EXIT();  
     return(instance);  
 }  
 /* given a namespace name, 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 - TBD  
 */  
 // ATTN: KS Build path from instance and instance from class.  Not sure  
 //   we want to always do this.  Consider change to build keys directly  
   
 CIMObjectPath InteropProvider::_buildInstancePath(const CIMNamespaceName& name,  
                                            const CIMName className,  
                                            const CIMInstance& instance)  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_buildInstancePath()");  
  
     // get the class CIM_Namespace class to use in building path      //
     //CIMNamespaceName thisNamespace = classReference.getNameSpace();      //  Everything above was commmon to CIM Namespace.  The following is PG_Namespace Properties
     CIMClass thisClass = _getClass(_operationNamespace, className);      //
       // ATTN: KS Get the correct values for these entities from repository interface.
     // XmlWriter::printInstanceElement(instance);  
  
     CIMObjectPath ref = instance.buildPath(thisClass);      CIMRepository::NameSpaceAttributes attributes;
       _repository->getNameSpaceAttributes(nameSpace.getString(), attributes);
       String parent="";
           String name = "";
       Boolean shareable=false;
       Boolean updatesAllowed=true;
       for (CIMRepository::NameSpaceAttributes::Iterator i = attributes.start(); i; i++)
       {
          String key=i.key();
          String value = i.value();
  
     CDEBUG("Built path. path = " << ref.toString() );         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();     PEG_METHOD_EXIT();
     return(ref);                // This is poor exception since it reflects internal error. Do error log
                 throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED,
                     "Namespace attribute rtnd error for key " + key + "expected " +
                      nameSpace.getString()+ value + " in " + String(thisProvider));
 } }
  
                     name = value;
          }
          else if (String::equalNoCase(key,"parent"))
              {
             parent=value;
              }
          else
          {
             PEG_METHOD_EXIT();
             // Poor error definition since it reflects internal error. do error log
             throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, nameSpace.getString()+
                 " namespace attribute " + key + " option not supported in"+ String(thisProvider));
          }
       }
       _setPropertyValue(instance, PG_NAMESPACE_PROPERTY_SCHEMAUPDATESALLOWED, updatesAllowed);
       _setPropertyValue(instance, PG_NAMESPACE_PROPERTY_ISSHAREABLE, shareable);
       _setPropertyValue(instance, PG_NAMESPACE_PROPERTY_PARENTNAMESPACE, parent);
           _setPropertyValue(instance, PG_NAMESPACE_PROPERTY_NAME, name);
  
 /* _isNamespace determines if the namespace in the second      PEG_METHOD_EXIT();
    parameter is in the array in the first parameter.      return(instance);
     @param array of possible namespaces  }
     @param canidate namespace  void _validateCIMNamespaceKeys(const CIMObjectPath& objectPath)
     @return - true if found  {
 */      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
 Boolean _isNamespace(              "InteropProvider::_validateCIMNamespaceKeys");
         Array<CIMNamespaceName>& namespaceNames,  
         CIMNamespaceName& namespaceName)  
  
       Boolean valid = true;
       CIMName propertyName;
       if (!_validateRequiredProperty(objectPath,
                   CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,
                   System::getSystemCreationClassName ()))
 { {
      Boolean found = false;          propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME;
      for(Uint32 i = 0; i < namespaceNames.size(); i++)          valid = false;
       }
       if (!_validateRequiredProperty(objectPath,
                   CIM_NAMESPACE_PROPERTY_SYSTEMNAME,
                   System::getFullyQualifiedHostName()))
      {      {
         if(namespaceNames[i].equal ( namespaceName))          propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMNAME;
           valid = false;
       }
       if (!_validateRequiredProperty(objectPath,
                   CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME,
                   CIM_OBJECTMANAGER_CLASSNAME.getString()))
         {         {
             return true;          propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME;
           valid = false;
         }         }
   
       // ATTN: This one still a problem.  We have to get the name first
       if (!_validateRequiredProperty(objectPath,
                   CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME,
                   String::EMPTY))
       {
           propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME;
           valid = false;
      }      }
      return false;      if (!_validateRequiredProperty(objectPath,
                   CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,
                   System::getHostName()))
       {
           propertyName = CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME;
           valid = false;
 } }
  
 Boolean _isChild(      if (!_validateRequiredProperty(objectPath,
         CIMNamespaceName& parentNamespaceName,                  CIM_NAMESPACE_PROPERTY_NAME,
         CIMNamespaceName& namespaceName)                  String::EMPTY))
   
 {  
     String parent = parentNamespaceName.getString();  
     String child = namespaceName.getString();  
    //  
    //  If length of namespace name is shorter than or equal to the  
    //  length of parent namespace name, cannot be a child  
    //  
    if (child.size () <= parent.size ())  
    {    {
       return false;          propertyName = CIM_NAMESPACE_PROPERTY_NAME;
           valid = false;
    }    }
  
    //      if (false)
    //  Compare prefix substring of namespace name with parent namespace name  
    //  
    else if (String::equalNoCase (child.subString (0, parent.size ()), parent))  
    {    {
       return true;          PEG_METHOD_EXIT();
           throw CIMInvalidParameterException(
               "Invalid key property: " + propertyName.getString());
    }    }
    return false;      PEG_METHOD_EXIT();
 } }
 //**************************************************************  
 // Overloaded functions to get key value with different params  
 //**************************************************************  
  
 /* find the name key in the keybindings and return the value.  /** completes a property in the defined instance either
     Executes exception if the key not found      by adding the complete property if it does not exist
     @param object path we will search      or by adding the value if the property does exist.
     @param keyName - Name of the key to find.      Used to make sure that key properties for things
     @return value of name property      like systemcreationclass are included in the
     @exceptions CIMInvalidParameterException      creation of new instances and that the
       values are logical for the CIMOM.
 */ */
 String _getKeyValue(const CIMObjectPath& instanceName, const CIMName& keyName)  Boolean _completeProperty(CIMInstance& instance,
       const CIMName& propertyName,
       const String& value)
 { {
     Array<CIMKeyBinding> kbArray = instanceName.getKeyBindings();  
  
     // find the correct key binding      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
     for (Uint32 i = 0; i < kbArray.size(); i++)              "InteropProvider::_completeProperty()");
   
       Uint32 pos;
   
       if (!_validateRequiredProperty(instance,
                   propertyName,
                   value))
     {     {
         if (kbArray[i].getName() == keyName)          if ((pos = instance.findProperty (propertyName)) == PEG_NOT_FOUND)
         {         {
             return (kbArray[i].getValue());              // Add the property.  Should be from the class.
               PEG_METHOD_EXIT();
               return(false);
         }         }
           else
           {
               //
               _setPropertyValue(instance, propertyName, value);
     }     }
     throw CIMInvalidParameterException("Invalid key property: " + keyName.getString());  
 } }
  
 String _getKeyValue(const CIMInstance& instance, const CIMName& keyName)      PEG_METHOD_EXIT();
       return(true);
   }
   Boolean _completeCIMNamespaceKeys(CIMInstance& instance)
 { {
     Uint32 pos;  
     CIMValue propertyValue;  
  
     pos = instance.findProperty(keyName);      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
     if (pos == PEG_NOT_FOUND)              "InteropProvider::_completeCIMNamespaceKeys");
   
       Boolean valid = true;
       CIMName propertyName;
   
       if (!_completeProperty(instance,
                   CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,
                   System::getSystemCreationClassName ()))
     {     {
        throw CIMPropertyNotFoundException  
            (NAMESPACE_PROPERTYNAME.getString());          propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME;
           valid = false;
     }     }
  
     propertyValue = instance.getProperty(pos).getValue();      if (!_completeProperty(instance,
     if (propertyValue.getType() != CIMTYPE_STRING)                  CIM_NAMESPACE_PROPERTY_SYSTEMNAME,
                   System::getFullyQualifiedHostName()))
     {     {
        throw CIMInvalidParameterException("Invalid type for property: "          propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMNAME;
                              + NAMESPACE_PROPERTYNAME.getString());          valid = false;
     }     }
     String name;  
     propertyValue.get(name);      if (!_completeProperty(instance,
     return(name);                  CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME,
     //ATTN: KS Returns String whereas below returns CIMNamespaceName.                  CIM_OBJECTMANAGER_CLASSNAME.getString()))
       {
           propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME;
           valid = false;
 } }
  
 /* gets the key value for the __Namespace property "name"      if (!_completeProperty(instance,
    from the instance provided. Sets childNamespaceName and                  CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME,
    isRelativeName fields                  String::EMPTY))
    This overload called if instance provided.      {
 */          propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME;
 void _getKeyValue (          valid = false;
     const CIMInstance& namespaceInstance,      }
         CIMNamespaceName& childNamespaceName,      if (!_completeProperty(instance,
         Boolean& isRelativeName)                  CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,
                   System::getHostName()))
       {
           propertyName = CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME;
           valid = false;
       }
  
       if (!_completeProperty(instance,
                   CIM_NAMESPACE_PROPERTY_NAME,
                   String::EMPTY))
 { {
     //Validate key property          propertyName = CIM_NAMESPACE_PROPERTY_NAME;
           valid = false;
       }
  
     Uint32 pos;      if (!valid)
     CIMValue propertyValue;      {
           PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
               "Invalid CIM_Namespace Key Property " +  propertyName.getString());
           PEG_METHOD_EXIT();
           throw CIMInvalidParameterException(
               "Invalid CIM_Namespace key property: " + propertyName.getString());
       }
       PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4, "CIM_Namespace Keys Valid");
       PEG_METHOD_EXIT();
       return(valid);
   }
  
     // [Key, MaxLen (256), Description (  
     //       "A string that uniquely identifies the Namespace "  
     //       "within the ObjectManager.") ]  
     // string Name;  
  
     pos = namespaceInstance.findProperty(NAMESPACE_PROPERTYNAME);  void _validateCIMNamespaceKeys(const CIMInstance& instance)
     if (pos == PEG_NOT_FOUND)  
     {     {
        throw CIMPropertyNotFoundException      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
            (NAMESPACE_PROPERTYNAME.getString());              "InteropProvider::_validateCIMNamespaceKeys");
       Boolean valid = true;
       CIMName propertyName;
       if (!_validateRequiredProperty(instance,
                   CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,
                   System::getSystemCreationClassName ()))
       {
           propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME;
           valid = false;
     }     }
  
     propertyValue = namespaceInstance.getProperty(pos).getValue();      if (!_validateRequiredProperty(instance,
     if (propertyValue.getType() != CIMTYPE_STRING)                  CIM_NAMESPACE_PROPERTY_SYSTEMNAME,
                   System::getFullyQualifiedHostName ()))
     {     {
        throw CIMInvalidParameterException("Invalid type for property: "          propertyName = CIM_NAMESPACE_PROPERTY_SYSTEMNAME;
                              + NAMESPACE_PROPERTYNAME.getString());          valid = false;
     }     }
  
     String cnsName;      if (!_validateRequiredProperty(instance,
     propertyValue.get(cnsName);                  CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME,
     childNamespaceName = CIMNamespaceName (cnsName);                  CIM_OBJECTMANAGER_CLASSNAME.getString()))
       {
     isRelativeName = !(childNamespaceName.isNull());          propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME;
           valid = false;
 } }
 /* gets the key value for the __Namespace property "name"  
    from the instance provided. Sets childNamespaceName and  
    isRelativeName fields  
    This overload called if object path provided.  
 */  
  
 void _getKeyValue (      // ATTN: This one still a problem.  We have to get the name first
         const CIMObjectPath&  instanceName,      if (!_validateRequiredProperty(instance,
         CIMNamespaceName& childNamespaceName,                  CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME,
         Boolean& isRelativeName)                  String::EMPTY))
 { {
           propertyName = CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME;
           valid = false;
       }
       if (!_validateRequiredProperty(instance,
                   CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,
                   System::getHostName()))
       {
           propertyName = CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME;
           valid = false;
       }
  
     Array<CIMKeyBinding> kbArray = instanceName.getKeyBindings();      if (!_validateRequiredProperty(instance,
     if ((kbArray.size() == 1) &&                  CIM_NAMESPACE_PROPERTY_NAME,
             (kbArray[0].getName() == NAMESPACE_PROPERTYNAME))                  String::EMPTY))
     {     {
        childNamespaceName = CIMNamespaceName (kbArray[0].getValue());          propertyName = CIM_NAMESPACE_PROPERTY_NAME;
        isRelativeName = !(childNamespaceName.isNull());          valid = false;
     }     }
     else  
       if (false)
     {     {
        throw CIMInvalidParameterException("Invalid key property:  ");          PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
               "Invalid CIM_Namespace Key Property " +  propertyName.getString());
           PEG_METHOD_EXIT();
           throw CIMInvalidParameterException(
               "Invalid CIM_Namespace key property: " + propertyName.getString());
     }     }
       PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4, "CIM_Namespace Keys Valid");
       PEG_METHOD_EXIT();
 } }
  
 /* generate the full namespace name from the parent and child  /** builds complete object path from instance and classinfo by building the full path
    components      with host and namespace names included.
    @param namespaceNames - List of all namespaces  */
    @param parentNamespaceName  CIMObjectPath InteropProvider::_buildObjectPath(const CIMNamespaceName& name,
    @param childNamespaceName                                                  const CIMName& className,
    @param Boolean isrelative                                                  const CIMInstance& instance)
    @return full namespacename created from parent + child  {
    Note that if isrelative is true, parent is tested for validty      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::_buildObjectPath");
   
       CIMObjectPath objectPath;
       objectPath = _buildInstancePath(name,className,instance);
   
       objectPath.setHost(System::getHostName());
   
       objectPath.setNameSpace(name);
   
       PEG_METHOD_EXIT();
       return(objectPath);
   }
   
   /* 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.
 */ */
 CIMNamespaceName _generateFullNamespaceName(  
         Array<CIMNamespaceName>& namespaceNames,  
         CIMNamespaceName& parentNamespaceName,  
         CIMNamespaceName& childNamespaceName,  
         Boolean isRelativeName)  
  
   CIMObjectPath InteropProvider::_buildInstancePath(const CIMNamespaceName& name,
                                              const CIMName& className,
                                              const CIMInstance& instance)
 { {
     // If isRelativeName is true, then the parentNamespace      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
     // MUST exist              "InteropProvider::_buildInstancePath");
     //  
     CIMNamespaceName fullNamespaceName;      // get the class CIM_Namespace class to use in building path
       // Exception out if Class does not exist in this namespace
       CIMClass thisClass = _getClass(name, className);
   
       CIMObjectPath ref = instance.buildPath(thisClass);
  
     if (isRelativeName)      PEG_METHOD_EXIT();
       return(ref);
   }
   
   //**************************************************************
   // Overloaded functions to get key value with different params
   //**************************************************************
   
   /*  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)
     {     {
       if (!_isNamespace(namespaceNames, parentNamespaceName))      Array<CIMKeyBinding> kbArray = instanceName.getKeyBindings();
   
       // find the correct key binding
       for (Uint32 i = 0; i < kbArray.size(); i++)
       {       {
          throw CIMObjectNotFoundException("Parent namespace does not exist: "          if (kbArray[i].getName() == keyName)
                                   + parentNamespaceName.getString());              return (kbArray[i].getValue());
       }       }
       // Create full namespace name by prepending parentNamespaceName  
       fullNamespaceName = CIMNamespaceName (parentNamespaceName.getString()      throw CIMInvalidParameterException("Invalid key property: " + keyName.getString());
           + "/" + childNamespaceName.getString());  
     }     }
     else  
   String _getKeyValue(const CIMInstance& instance, const CIMName& keyName)
     {     {
       fullNamespaceName = parentNamespaceName;      Uint32 pos;
     }      CIMValue propertyValue;
     return(fullNamespaceName);  
       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);
       //ATTN: KS Returns String whereas below returns CIMNamespaceName.
 } }
  
 //*************************************************************************** //***************************************************************************
Line 883 
Line 1576 
     {     {
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::createInstance()");         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::createInstance()");
  
         CIMNamespaceName childNamespaceName;          Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
               "%s createInstance. InstanceReference= %s",
               thisProvider,
               (const char *) instanceReference.toString().getCString());
   
           handler.processing();
         CIMNamespaceName newNamespaceName;         CIMNamespaceName newNamespaceName;
         Boolean isRelativeName;  
         CDEBUG("CreateInstance " << instanceReference.toString());         CDEBUG("CreateInstance " << instanceReference.toString());
         // operation namespace needed internally to get class.         // operation namespace needed internally to get class.
         _operationNamespace = instanceReference.getNameSpace();         _operationNamespace = instanceReference.getNameSpace();
  
         // Verify that ClassName is correct and get value         // Verify that ClassName is correct and get value
         Uint32 classEnum  = _verifyValidClassInput(instanceReference.getClassName());          targetClass classEnum  = _verifyValidClassInput(instanceReference.getClassName());
  
         String userName = _validateUserID(context);         String userName = _validateUserID(context);
         CIMObjectPath newInstanceReference;         CIMObjectPath newInstanceReference;
  
         if (classEnum == CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM)          if ((classEnum == CIM_OBJECTMANAGER) ||
             throw CIMNotSupportedException("InteropProvider::createInstance");              (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM))
               throw CIMNotSupportedException("InteropProvider, Create Not allowed");
         if (classEnum == CIM_CIMXMLCOMMUNICATIONMECHANISM)  
             throw CIMNotSupportedException("InteropProvider::createInstance");          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();
  
         if (classEnum == CIM_NAMESPACE)              _completeCIMNamespaceKeys(localInstance);
         {              // Validate that keys are as required. Does its own exception.
             CDEBUG("Create Class from CIM_Namespace");  
             Boolean isGood = _testKeys(instanceReference);  
             String namespaceName;  
             newNamespaceName = _getKeyValue(myInstance, CIM_NAMESPACE_PROPERTY_NAME);             newNamespaceName = _getKeyValue(myInstance, CIM_NAMESPACE_PROPERTY_NAME);
             // ATTN: KS TBD  
             //Array<CIMKeyBinding> keyBindings;              newInstanceReference = _buildInstancePath(_operationNamespace,
             //keyBindings = _buildKeyBindings();                                          PG_NAMESPACE_CLASSNAME, localInstance);
             //newInstanceReference.set(String::EMPTY, namespaceName,  #endif
             //                   CIM_NAMESPACE_CLASSNAME, keyBindings);  
             //CDEBUG("Create namespace = " << newNamespaceName);  
             CIMInstance instance = _buildInstanceCIMNamespace(namespaceName);  
             newInstanceReference = _buildInstancePath(CIMNamespaceName(namespaceName),  
                                         CIM_NAMESPACE_CLASSNAME, instance);  
         }         }
         else   // Process the __Namespace request to get namespace name value  
           else   // Invalid class for the create functions.
         {         {
             _getKeyValue(myInstance, childNamespaceName, isRelativeName);              PEGASUS_ASSERT(false);
             CIMNamespaceName parentNamespaceName = instanceReference.getNameSpace();          }
  
           // Create the new namespace
           try
           {
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
                "childNamespaceName = " + childNamespaceName.getString() +                  "Namespace = " + newNamespaceName.getString() +
                ", isRelativeName = " +                      " to be created.");
                (isRelativeName?String("true"):String("false")) +              Boolean updatesAllowed = false;
                ", parentNamespaceName = " + parentNamespaceName.getString());              Boolean shareable = false;
               String parent = String::EMPTY;
             Array<CIMNamespaceName> namespaceNames;  
             namespaceNames = _enumerateNameSpaces();              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");
  
             newNamespaceName = _generateFullNamespaceName(              // Optional property.  Set false if not found.
                 namespaceNames, parentNamespaceName,              if (myInstance.findProperty(PG_NAMESPACE_PROPERTY_SCHEMAUPDATESALLOWED) != PEG_NOT_FOUND)
                          childNamespaceName, isRelativeName);              {
                   if (_getPropertyValue(myInstance, PG_NAMESPACE_PROPERTY_SCHEMAUPDATESALLOWED, false))
             // return key (i.e., CIMObjectPath) for newly created namespace                  {
                       attributes.insert("updatesAllowed","true");
             Array<CIMKeyBinding> keyBindings;                      updatesAllowed = true;
             keyBindings.append(CIMKeyBinding(NAMESPACE_PROPERTYNAME,  
                  isRelativeName?childNamespaceName.getString():  
                                     parentNamespaceName.getString(),  
                                          CIMKeyBinding::STRING));  
             //Add namespace class and keybindings  
             newInstanceReference.set(String::EMPTY, parentNamespaceName,  
                                          __NAMESPACE_CLASSNAME, keyBindings);  
         }         }
         // Create the new namespace                  else
         try                      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)
         {         {
             _repository->createNameSpace(newNamespaceName);                  String parent = _getPropertyValue(myInstance, PG_NAMESPACE_PROPERTY_PARENTNAMESPACE, String::EMPTY);
                   if (parent != String::EMPTY)
                       attributes.insert("parent",parent);
               }
               _repository->createNameSpace(newNamespaceName, attributes);
  
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
                 "Namespace = " + newNamespaceName.getString() +                 "Namespace = " + newNamespaceName.getString() +
                     " successfully created.");                     " successfully created.");
             // ATTN: Add standardlog entry here.              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
                   "Create Namespace: Shareable = $0, Updates allows: $1,  Parent: $2",
                   newNamespaceName.getString(), shareable? "true" : "false", shareable? "true" : "false", parent );
   
         }         }
         catch(CIMException& e)          catch(const CIMException&)
         {         {
            _repository->write_unlock();  
            PEG_METHOD_EXIT();            PEG_METHOD_EXIT();
            throw e;             throw;
         }         }
         catch(Exception& e)          catch(const Exception&)
         {         {
            _repository->write_unlock();  
            PEG_METHOD_EXIT();            PEG_METHOD_EXIT();
            throw e;             throw;
         }         }
  
         _repository->write_unlock();  
   
         // begin processing the request         // begin processing the request
         handler.processing();  
   
  
        handler.deliver(newInstanceReference);        handler.deliver(newInstanceReference);
  
Line 994 
Line 1712 
         ResponseHandler & handler)         ResponseHandler & handler)
     {     {
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::deleteInstance");         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::deleteInstance");
         CDEBUG("deleteInstance" << instanceName.toString());  
         CIMNamespaceName childNamespaceName;  
         CIMNamespaceName deleteNamespaceName;  
         Boolean isRelativeName;  
  
           Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
               "%s deleteInstance. instanceName= %s",
               thisProvider,
               (const char *) instanceName.toString().getCString());
   
           _operationNamespace = instanceName.getNameSpace();
           handler.processing();
         // Verify that ClassName is correct and get value         // Verify that ClassName is correct and get value
         Uint32 classEnum  = _verifyValidClassInput(instanceName.getClassName());          targetClass classEnum  = _verifyValidClassInput(instanceName.getClassName());
  
         String userName = _validateUserID(context);         String userName = _validateUserID(context);
  
         Array<CIMNamespaceName> namespaceNames;          // Delete the instance since it may be in persistent storage
         namespaceNames = _enumerateNameSpaces();          if ((classEnum == CIM_OBJECTMANAGER))
   
         if (classEnum == CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM)  
             throw CIMNotSupportedException("InteropProvider::createInstance");  
   
         if (classEnum == CIM_CIMXMLCOMMUNICATIONMECHANISM)  
             throw CIMNotSupportedException("InteropProvider::createInstance");  
   
         if (classEnum == CIM_NAMESPACE)  
         {         {
             _testKeys(instanceName);              try
             deleteNamespaceName = _getKeyValue(instanceName, CIM_NAMESPACE_PROPERTY_NAME);              {
             CDEBUG("Delete namespace = " << deleteNamespaceName );                  _repository->deleteInstance(_operationNamespace,instanceName);
         }         }
         else  // Procesing for __namespace              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);
  
            _getKeyValue(instanceName, childNamespaceName, isRelativeName);              deleteNamespaceName = _getKeyValue(instanceName, CIM_NAMESPACE_PROPERTY_NAME);
            CIMNamespaceName parentNamespaceName = instanceName.getNameSpace();  #endif
   
            PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                "childNamespaceName = " + childNamespaceName.getString() +  
                (isRelativeName?String("true"):String("false")) +  
                ", parentNamespaceName = " + parentNamespaceName.getString());  
   
            // begin processing the request  
  
            deleteNamespaceName = _generateFullNamespaceName(              Array<CIMNamespaceName> namespaceNames;
                namespaceNames, parentNamespaceName,              namespaceNames = _enumerateNameSpaces();
                          childNamespaceName, isRelativeName);  
         }  
  
             // ATTN: KS Why THis???  
         if (deleteNamespaceName.equal (ROOTNS))         if (deleteNamespaceName.equal (ROOTNS))
        {        {
            throw CIMNotSupportedException("root namespace cannot be deleted.");            throw CIMNotSupportedException("root namespace cannot be deleted.");
Line 1048 
Line 1766 
            PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,            PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
                "Namespace = " + deleteNamespaceName.getString() +                "Namespace = " + deleteNamespaceName.getString() +
                " successfully deleted.");                " successfully deleted.");
        // ATTN: Log entry for deletion.  
               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.processing();        handler.processing();
  
        // complete processing the request  
        handler.complete();        handler.complete();
  
        PEG_METHOD_EXIT();        PEG_METHOD_EXIT();
Line 1066 
Line 1792 
     const CIMObjectPath & instanceName,     const CIMObjectPath & instanceName,
     const Boolean includeQualifiers,     const Boolean includeQualifiers,
     const Boolean includeClassOrigin,     const Boolean includeClassOrigin,
     const CIMPropertyList & properatyList,      const CIMPropertyList & propertyList,
     InstanceResponseHandler & handler)     InstanceResponseHandler & handler)
     {     {
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::getInstance");         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::getInstance");
  
           Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
               "%s getInstance. instanceName= %s , includeQualifiers= %s, includeClassOrigin= %s, PropertyList= %s",
               thisProvider,
               (const char *)instanceName.toString().getCString(),
               (const char *)_showBool(includeQualifiers).getCString(),
               (const char*) _showBool(includeClassOrigin).getCString(),
               (const char *)_showPropertyList(propertyList).getCString());
         // Verify that ClassName is correct and get value         // Verify that ClassName is correct and get value
         Uint32 classEnum  = _verifyValidClassInput(instanceName.getClassName());          targetClass classEnum  = _verifyValidClassInput(instanceName.getClassName());
  
           _operationNamespace = instanceName.getNameSpace();
         String userName = _validateUserID(context);         String userName = _validateUserID(context);
   
         // begin processing the request         // begin processing the request
         handler.processing();         handler.processing();
         if (classEnum == CIM_OBJECTMANAGER)         if (classEnum == CIM_OBJECTMANAGER)
         {         {
             CIMInstance instance = _buildInstanceCIMObjectManager();              CIMInstance instance = _getInstanceCIMObjectManager(includeQualifiers,
                                           includeClassOrigin, propertyList);
             handler.deliver(instance);             handler.deliver(instance);
             handler.complete();             handler.complete();
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return;             return;
         }         }
  
         if (classEnum == CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM)          if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)
         {         {
             CIMInstance instance = _buildInstancCIMObjectCommunicationMechanism();              // ATTN: test for correct instance KS: Priority 1
             handler.deliver(instance);              Array <CIMInstance> instances = _buildInstancesPGCIMXMLCommunicationMechanism(
                                       includeQualifiers,
                                       includeClassOrigin, propertyList);
               handler.deliver(instances[0]);
             handler.complete();             handler.complete();
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return;             return;
         }         }
  
           if (classEnum == CIM_NAMESPACEINMANAGER)
         if (classEnum == CIM_CIMXMLCOMMUNICATIONMECHANISM)  
         {         {
             CIMInstance instance = _buildInstancCIMXMLCommunicationMechanism();  
             handler.deliver(instance);  
             handler.complete();             handler.complete();
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return;             return;
   
         }         }
  
         // Get List of namespaces         // Get List of namespaces
Line 1112 
Line 1845 
         namespaceNames = _enumerateNameSpaces();         namespaceNames = _enumerateNameSpaces();
         CIMInstance instance;         CIMInstance instance;
  
           if (classEnum == PG_NAMESPACE)
         if (classEnum == CIM_NAMESPACE)  
         {         {
             // Not clear what we have to take into account here.             // Not clear what we have to take into account here.
             // get the namespace from the name value.             // get the namespace from the name value.
             // should check the other keys to see if valid.             // should check the other keys to see if valid.
             CIMNamespaceName namespaceName;             CIMNamespaceName namespaceName;
             namespaceName = _getKeyValue(instanceName, CIM_NAMESPACE_PROPERTY_NAME);             namespaceName = _getKeyValue(instanceName, CIM_NAMESPACE_PROPERTY_NAME);
             // ATTN: Why this CIMNamespaceName parentNamespaceName = instanceName.getNameSpace();  
  
             if (!_isNamespace(namespaceNames, namespaceName))              // ATTN: Why this CIMNamespaceName parentNamespaceName = instanceName.getNameSpace();
               if (!Contains(namespaceNames, namespaceName))
             {             {
                 throw CIMObjectNotFoundException("Namespace does not exist: "                 throw CIMObjectNotFoundException("Namespace does not exist: "
                                      + namespaceName.getString());                                      + namespaceName.getString());
             }             }
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
                "Namespace = " + namespaceName.getString() + " successfully found.");                "Namespace = " + namespaceName.getString() + " successfully found.");
             instance = _buildInstanceCIMNamespace(namespaceName);  
               instance = _getInstanceCIMNamespace(namespaceName);
         }         }
         else  // processing for __Namespace         else  // processing for __Namespace
         {         {
             CIMNamespaceName childNamespaceName;              PEGASUS_ASSERT(false);
             CIMNamespaceName getNamespaceName;  
             Boolean isRelativeName;  
   
             _getKeyValue(instanceName, childNamespaceName, isRelativeName);  
             CIMNamespaceName parentNamespaceName = instanceName.getNameSpace();  
   
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                "childNamespaceName = " + childNamespaceName.getString() +  
                (isRelativeName?String("true"):String("false")) +  
                ", parentNamespaceName = " + parentNamespaceName.getString());  
   
   
             getNamespaceName = _generateFullNamespaceName(  
                 namespaceNames, parentNamespaceName,  
                          childNamespaceName, isRelativeName);  
   
             // exception if not valid namespace  
             if (!_isNamespace(namespaceNames, getNamespaceName))  
             {  
               throw CIMObjectNotFoundException("Namespace deos not exist: "  
                                      + getNamespaceName.getString());  
             }  
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                "Namespace = " + getNamespaceName.getString() +  
                    " successfully found.");  
   
             //Set name of class  
             CIMInstance instance(__NAMESPACE_CLASSNAME);  
   
             //  
             // construct the instance  
             //  
             instance.addProperty(CIMProperty(NAMESPACE_PROPERTYNAME,  
             isRelativeName?childNamespaceName.getString():  
                               parentNamespaceName.getString()));  
             //instance.setPath(instanceName);  
        }        }
  
        handler.deliver(instance);        handler.deliver(instance);
Line 1193 
Line 1890 
     InstanceResponseHandler & handler)     InstanceResponseHandler & handler)
     {     {
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::enumerateInstances()");         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::enumerateInstances()");
         CDEBUG("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         // Verify that ClassName is correct and get value
         Uint32 classEnum  = _verifyValidClassInput(ref.getClassName());          targetClass classEnum  = _verifyValidClassInput(ref.getClassName());
  
         String userName = _validateUserID(context);          // operation namespace needed internally to get class.
           _operationNamespace = ref.getNameSpace();
           CDEBUG("Namespace = " << _operationNamespace.getString());
           //String userName = _validateUserID(context);
  
         // The following 3 classes deliver a single instance because         // The following 3 classes deliver a single instance because
         // that is all there is today.         // that is all there is today.
         if (classEnum == CIM_OBJECTMANAGER)         if (classEnum == CIM_OBJECTMANAGER)
         {         {
             CIMInstance instance = _buildInstanceCIMObjectManager();              CIMInstance instance = _getInstanceCIMObjectManager(includeQualifiers,
                                       includeClassOrigin,
                                       propertyList);
   
               //Array<Sint8> tmp;
               ///XmlWriter::appendInstanceElement(tmp, instance);
               //tmp.append('\0');
               //Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
               //        "Instance - XML content: $0", tmp.getData());
               ///XmlWriter::printInstanceElement(instance);
             handler.deliver(instance);             handler.deliver(instance);
             handler.complete();              //handler.complete();
             PEG_METHOD_EXIT();              //PEG_METHOD_EXIT();
             return;              //return;
         }         }
  
         if (classEnum == CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM)          else if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)
         {         {
             CIMInstance instance = _buildInstancCIMObjectCommunicationMechanism();              Array<CIMInstance> instances = _buildInstancesPGCIMXMLCommunicationMechanism(includeQualifiers,
             handler.deliver(instance);                                      includeClassOrigin, propertyList);
               CDEBUG("Build instances of PGCIMXML. count= " << instances.size());
               handler.deliver(instances);
               //handler.complete();
               //PEG_METHOD_EXIT();
               //return;
           }
   
           else if (classEnum == CIM_NAMESPACEINMANAGER)
           {
               //handler.complete();
               //PEG_METHOD_EXIT();
               //return;
           }
   
           else if (classEnum == PG_NAMESPACE)
           {
               Array<CIMInstance> instances = _getInstancesCIMNamespace(includeQualifiers,
                                       includeClassOrigin, propertyList);
   
               handler.deliver(instances);
               //handler.complete();
               //PEG_METHOD_EXIT();
               //return;
           }
           else
           {
               throw CIMNotSupportedException
                   ("EnumerateInstance for " + ref.getClassName().getString() + " not supported");
           }
   
             handler.complete();             handler.complete();
   
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return;  
         }         }
  
   void InteropProvider::modifyObjectManagerInstance(const OperationContext & context,
       const CIMObjectPath & instanceReference,
       const CIMInstance& modifiedIns,
       const Boolean includeQualifiers,
       const CIMPropertyList& propertyList,
       ResponseHandler & handler)
   {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::modifyInstanceManagerInstance");
       // the only allowed modification is this one property, statistical data
       if (modifiedIns.findProperty(OM_GATHERSTATISTICALDATA) != PEG_NOT_FOUND)
       {
           // the following is a temporary hack to set the value of the statistics
           // gathering function dynamically.  We simply get the  value from input
           // and call the internal method to set it each time this object is
           // built.
   #ifndef PEGASUS_DISABLE_PERFINST
           Boolean statisticsFlag = _getPropertyValue(modifiedIns, OM_GATHERSTATISTICALDATA, false);
           CIMInstance instance;
           instance = _getInstanceCIMObjectManager(true, true, CIMPropertyList());
  
         if (classEnum == CIM_CIMXMLCOMMUNICATIONMECHANISM)          if (statisticsFlag != _getPropertyValue(instance,  OM_GATHERSTATISTICALDATA, false))
         {         {
             CIMInstance instance = _buildInstancCIMXMLCommunicationMechanism();              // set the changed property into the
             handler.deliver(instance);              _setPropertyValue(instance, OM_GATHERSTATISTICALDATA, statisticsFlag);
             handler.complete();              // Modify the object on disk
               try
               {
                   _repository->modifyInstance(_operationNamespace,
                                  instance );
               }
               catch(const CIMException&)
               {
                   // ATTN: KS generate log error if this not possible
                   PEG_METHOD_EXIT();
                   throw;
               }
               catch(const Exception&)
               {
                   // ATTN: Generate log error.
             PEG_METHOD_EXIT();             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;             return;
   #endif
  
         }         }
       PEG_METHOD_EXIT();
       // ATTN Expand this defintion to be more precise since it allows only mod of
       // one property and that property MUST be in the instance to be modifiable.
       throw CIMNotSupportedException
           (OM_GATHERSTATISTICALDATA.getString() + " modify operation not supported by Interop Provider");
   }
   //***************************************************************************
   //                modifyInstance
   //***************************************************************************
   void InteropProvider::modifyInstance(const OperationContext & context,
       const CIMObjectPath & instanceReference,
       const CIMInstance& modifiedIns,
       const Boolean includeQualifiers,
       const CIMPropertyList& propertyList,
       ResponseHandler & handler)
   {
  
         // ATTN: Fix this up.  should not be here.      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
         CIMNamespaceName parentNamespaceName = ref.getNameSpace();              "InteropProvider::modifyInstance");
  
         // ATTN KS Fix this so references both types of namespace      Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
         PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,          "%s modifyInstance. instanceReference= %s, includeQualifiers= %s, PropertyList= %s",
            "parentNamespaceName = " + parentNamespaceName.getString());          thisProvider,
           (const char *) instanceReference.toString().getCString(),
           (const char *) _showBool(includeQualifiers).getCString(),
           (const char *) _showPropertyList(propertyList).getCString());
  
       // ATTN: KS 31 August 2004. This must test for privileged user.
       _operationNamespace = instanceReference.getNameSpace();
       CIMName className =  instanceReference.getClassName();
       targetClass classEnum  = _verifyValidClassInput(instanceReference.getClassName());
   
       String userName = _validateUserID(context);
         // begin processing the request         // begin processing the request
         handler.processing();         handler.processing();
  
         Array<CIMNamespaceName> namespaceNames = _enumerateNameSpaces();      if (classEnum == CIM_OBJECTMANAGER)
   
         Array<CIMInstance> instanceArray;  
         CDEBUG("Found " << namespaceNames.size() << " namespaces.");  
         // Build response objects based on class requested  
         for (Uint32 i = 0; i < namespaceNames.size(); i++)  
         {         {
             CDEBUG("For namespace' " << namespaceNames[i].getString());          modifyObjectManagerInstance(context, instanceReference,modifiedIns,
             CDEBUG("Evaluate ClassEnum" << classEnum);              includeQualifiers, propertyList, handler);
             if (classEnum == CIM_NAMESPACE)          // for the moment allow modification of the statistics property only
             {  
                 CDEBUG("Evaluate CIM_Namespace" << classEnum);  
                 // Create a valid CIM_Namespace Instance  
                 CIMInstance instance = _buildInstanceCIMNamespace(namespaceNames[i]);  
                 instanceArray.append(instance);  
   
                 PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                 "Namespace = " + namespaceNames[i].getString());  
   
             }             }
             else // the else covers __NAMESPACE  
             {  
                 // Build the instances. For now simply build the __Namespace instances  
                 // the only property is name.  
                 if (_isChild(parentNamespaceName, namespaceNames[i]))  
                 {  
                     CIMInstance instance(__NAMESPACE_CLASSNAME);  
                     instance.addProperty(  
                         (CIMProperty(NAMESPACE_PROPERTYNAME,  
                         namespaceNames[i].getString().subString  
                             (parentNamespaceName.getString().size()+1,  
                             namespaceNames[i].getString().size()-  
                         parentNamespaceName.getString().size()-1))));  
  
                     instanceArray.append(instance);      else if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)
       {
  
                     //instance.setPath(instanceName);          PEG_METHOD_EXIT();
                     PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,          throw CIMNotSupportedException
                     "childNamespace = " + namespaceNames[i].getString());              (className.getString() + " not supported by Interop Provider");
                 }                 }
       else if (classEnum == PG_NAMESPACE)
       {
   #ifdef PEGASUS_OS_OS400
               MessageLoaderParms mparms("ControlProviders.InteropProvider.MODIFY_INSTANCE_NOT_ALLOWED",
                                         "Modify instance operation not allowed by Interop Provider for class $0.",
                                         PG_NAMESPACE_CLASSNAME.getString());
               throw CIMNotSupportedException(mparms);
   #else
           // for the moment allow modification of the statistics property only
           PEG_METHOD_EXIT();
           throw CIMNotSupportedException
               (className.getString() + " not supported by Interop Provider");
   #endif
             }             }
       else
       {
           PEGASUS_ASSERT(false);  // should never get here.
         }         }
         handler.deliver(instanceArray);  
  
         // complete processing the request  
         handler.complete();         handler.complete();
   
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
       return;
     }     }
  
 //*************************************************************************** //***************************************************************************
 //                enumerateInstanceNames //                enumerateInstanceNames
 //*************************************************************************** //***************************************************************************
   
 void InteropProvider::enumerateInstanceNames( void InteropProvider::enumerateInstanceNames(
         const OperationContext & context,         const OperationContext & context,
         const CIMObjectPath & classReference,         const CIMObjectPath & classReference,
Line 1305 
Line 2107 
         // operation namespace needed internally to get class.         // operation namespace needed internally to get class.
         _operationNamespace = classReference.getNameSpace();         _operationNamespace = classReference.getNameSpace();
  
         Uint32 classEnum  = _verifyValidClassInput(classReference.getClassName());          targetClass classEnum  = _verifyValidClassInput(classReference.getClassName());
   
           String userName = _validateUserID(context);
  
         // begin processing the request         // begin processing the request
         handler.processing();         handler.processing();
  
         // The following 3 classes deliver a single instance because          // Deliver a single instance because there should only be one instance.
         // that is all there is today.  
         if (classEnum == CIM_OBJECTMANAGER)         if (classEnum == CIM_OBJECTMANAGER)
         {         {
             CIMInstance instance = _buildInstanceCIMObjectManager();              CIMInstance instance = _getInstanceCIMObjectManager( true, true, CIMPropertyList());
             CIMObjectPath ref = _buildInstancePath(CIMNamespaceName(),              CIMObjectPath ref = _buildInstancePath(_operationNamespace,
                 CIM_OBJECTMANAGER_CLASSNAME, instance);                 CIM_OBJECTMANAGER_CLASSNAME, instance);
             handler.deliver(ref);             handler.deliver(ref);
             handler.complete();             handler.complete();
Line 1323 
Line 2126 
             return;             return;
         }         }
  
         if (classEnum == CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM)          // Deliver all possible instances of this class
           if (classEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)
           {
               Array<CIMInstance> instances = _buildInstancesPGCIMXMLCommunicationMechanism(true,
                    true, CIMPropertyList());
   
               for (Uint32 i = 0 ; i < instances.size() ; i++)
         {         {
             CIMInstance instance = _buildInstancCIMObjectCommunicationMechanism();                  CIMObjectPath ref = _buildInstancePath(_operationNamespace,
             CIMObjectPath ref = _buildInstancePath(CIMNamespaceName(),                      PG_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME, instances[i]);
                 CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM_CLASSNAME, instance);  
             handler.deliver(ref);             handler.deliver(ref);
               }
             handler.complete();             handler.complete();
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return;             return;
         }         }
  
           if (classEnum == CIM_NAMESPACEINMANAGER)
         if (classEnum == CIM_CIMXMLCOMMUNICATIONMECHANISM)  
         {         {
             CIMInstance instance = _buildInstancCIMXMLCommunicationMechanism();  
             CIMObjectPath ref = _buildInstancePath(CIMNamespaceName(),  
                 CIM_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME, instance);  
             handler.deliver(ref);  
             handler.complete();             handler.complete();
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return;             return;
   
         }         }
  
         String userName = _validateUserID(context);          if (classEnum == PG_NAMESPACE)
   
         // ATTN: Move this trace  
         CIMNamespaceName parentNamespaceName = classReference.getNameSpace();  
         PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
            "parentNamespaceName = " + parentNamespaceName.getString());  
         CDEBUG("Enumerate Instance Names. ns = " << parentNamespaceName.getString());  
   
         // Get list of all namespaces  
         Array<CIMNamespaceName> namespaceNames = _enumerateNameSpaces();  
         CDEBUG("Found " << namespaceNames.size() << " namespaces.");  
   
         // Build the cimObjectPath for each namespace found  
         for (Uint32 i = 0; i < namespaceNames.size(); i++)  
         {         {
             if (classEnum == CIM_NAMESPACE)              Array<CIMInstance> instances = _getInstancesCIMNamespace(false,
                                       false, CIMPropertyList());
               CDEBUG("EvalNames. Found instances. Count= " << instances.size());
               for (Uint32 i = 0 ; i < instances.size() ; i++)
             {             {
                   CIMObjectPath ref = _buildInstancePath(_operationNamespace,
                 CDEBUG("Calling BuildInstancePath for "<< namespaceNames[i].getString() );                                              CIM_NAMESPACE_CLASSNAME, instances[i]);
                 CIMInstance instance = _buildInstanceCIMNamespace(namespaceNames[i]);  
                 CIMObjectPath ref = _buildInstancePath(CIMNamespaceName(namespaceNames[i]),  
                                             CIM_NAMESPACE_CLASSNAME, instance);  
   
                 handler.deliver(ref);                 handler.deliver(ref);
   
                 PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                     "namespace = " + namespaceNames[i].getString());  
             }             }
             else  
             {  
                 Array<CIMKeyBinding> keyBindings;  
                 // Build the __Namespace objectpath  
                 // Note that for the moment, the only property is name.  
                 if (_isChild(parentNamespaceName, namespaceNames[i]))  
                 {  
                     keyBindings.clear();  
                       keyBindings.append(CIMKeyBinding(NAMESPACE_PROPERTYNAME,  
                           namespaceNames[i].getString().subString  
                           (parentNamespaceName.getString().size()+1,  
                           namespaceNames[i].getString().size()-  
                           parentNamespaceName.getString().size()-1),  
                           CIMKeyBinding::STRING));  
  
                       CIMObjectPath ref(String::EMPTY, parentNamespaceName,              handler.complete();
                       __NAMESPACE_CLASSNAME, keyBindings);              PEG_METHOD_EXIT();
               return;
           }
  
           if (classEnum == CIM_COMMMECHANISMFORMANAGERINST)
           {
               Array<CIMInstance> instances = _buildInstancesCommMechanismForManager();
               for (Uint32 i = 0 ; i < instances.size() ; i++ )
               {
                   CIMObjectPath ref = _buildObjectPath(_operationNamespace,
                           CIM_COMMMECHANISMFORMANAGER_CLASSNAME, instances[i]);
                       handler.deliver(ref);                       handler.deliver(ref);
                       PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                           "childNamespace = " + namespaceNames[i].getString());  
                 }                 }
             }             }
   
           if (classEnum == CIM_NAMESPACEINMANAGERINST)
           {
               Array<CIMInstance> instances = _buildInstancesNamespaceInManager();
               for (Uint32 i = 0 ; i < instances.size() ; i++ )
               {
                   CIMObjectPath ref = _buildObjectPath(_operationNamespace,
                           CIM_NAMESPACEINMANAGER_CLASSNAME, instances[i]);
                   handler.deliver(ref);
               }
         }         }
  
         handler.complete();  
  
           // ATTN: Exception response because of error
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
     }     }
  
   
 //************************************************************** //**************************************************************
 //************************************************************** //**************************************************************
 // Association Functions // Association Functions
Line 1424 
Line 2212 
         const CIMPropertyList & propertyList,         const CIMPropertyList & propertyList,
         ObjectResponseHandler & handler)         ObjectResponseHandler & handler)
 { {
         throw CIMNotSupportedException("AssociationProvider::associators");      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::associatorNames()");
           //throw CIMNotSupportedException("AssociationProvider::associators");
 } }
  
 void InteropProvider::associatorNames( void InteropProvider::associatorNames(
Line 1436 
Line 2226 
         const String & resultRole,         const String & resultRole,
         ObjectPathResponseHandler & handler)         ObjectPathResponseHandler & handler)
 { {
         throw CIMNotSupportedException("AssociationProvider::associatorNames");      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::associatorNames()");
           //throw CIMNotSupportedException("AssociationProvider::associatorNames");
 } }
  
 void InteropProvider::references( void InteropProvider::references(
Line 1449 
Line 2241 
         const CIMPropertyList & propertyList,         const CIMPropertyList & propertyList,
         ObjectResponseHandler & handler)         ObjectResponseHandler & handler)
 { {
         throw CIMNotSupportedException("AssociationProvider::references");      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( void InteropProvider::referenceNames(
Line 1459 
Line 2262 
         const String & role,         const String & role,
         ObjectPathResponseHandler & handler)         ObjectPathResponseHandler & handler)
 { {
         throw CIMNotSupportedException("AssociationProvider::referenceNames");      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
               "InteropProvider::referenceNames()");
       CDEBUG("::referenceNames(): object= " << objectName.toString() << " result Class= " << resultClass.getString());
   
       // operation namespace needed internally to get class.
       _operationNamespace = objectName.getNameSpace();
       String userName = _validateUserID(context);
       // begin processing the request
       handler.processing();
   
       // determine if valid class result class
   
       CIMName targetAssocClassName = resultClass;
   
       CIMName targetClassName = objectName.getClassName();
   
       targetAssocClass classEnum  = _verifyValidAssocClassInput(targetAssocClassName);
   
       Array<CIMInstance> assocInstances;
   
       if (classEnum == CIM_COMMMECHANISMFORMANAGERASSOC)
           assocInstances = _buildInstancesCommMechanismForManager();
   
       if (classEnum == CIM_NAMESPACEINMANAGERASSOC)
           assocInstances = _buildInstancesNamespaceInManager();
   
       _filterAssocInstances(assocInstances, resultClass, role);
   
       for (Uint32 i = 0 ; i < assocInstances.size() ; i++ )
       {
           CIMObjectPath ref = _buildObjectPath(_operationNamespace,
                   targetAssocClassName, assocInstances[i]);
           CDEBUG("referenceNames returns: " << ref.toString());
           handler.deliver(ref);
       }
   
       handler.complete();
   
       PEG_METHOD_EXIT();
       // Convert the instances to referenceNames response
 } }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2