(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.4 and 1.66.4.1

version 1.4, 2003/12/04 03:35:54 version 1.66.4.1, 2007/04/04 11:04:46
Line 1 
Line 1 
 //%2003////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.  // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
 // IBM Corp.; EMC Corporation, The Open Group. // IBM Corp.; EMC Corporation, The Open Group.
   // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; Symantec Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 22 
Line 28 
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // //
 //============================================================================== //==============================================================================
 //  
 // Author: Karl Schopmeyer (k.schopmeyer@opengroup.org)  
 //  
 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company  
 //                (carolann_graves@hp.com)  
 //              Karl Schopmeyer - Add Cim_Namespace capabilities.  
 //              Karl Schopmeyer - Temp added objectmanager and communication classes  
 //  
 //%////////////////////////////////////////////////////////////////////////////  
   
  
 /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
 //  Namespace Provider  //  Interop Provider - This provider services those classes from the
 //  //  DMTF Interop schema in an implementation compliant with the SMI-S v1.1
 //      This provider answers to the "false" class __namespace.  This is the  //  Server Profile
 //      deprecated version of manipulation in the DMTF WBEM model.  This function  //
 //      is defined in the CIM Operations over HTTP docuement.  However, while  //  Please see PG_ServerProfile20.mof in the directory
 //      the function exists, no class was ever defined in the CIM model for  //  $(PEGASUS_ROOT)/Schemas/Pegasus/InterOp/VER20 for retails regarding the
 //      __nemaspace.  Therefore each implementation is free to provide its own  //  classes supported by this control provider.
 //      class definition.  //
   //  Interop forces all creates to the PEGASUS_NAMESPACENAME_INTEROP
   //  namespace. There is a test on each operation that returns
   //  the Invalid Class CIMDError
   //  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.
 /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
  
 /* STATUS: In process but running 12 August 2003 KS */  
   
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
 #include <Pegasus/Common/PegasusVersion.h> #include <Pegasus/Common/PegasusVersion.h>
  
Line 53 
Line 53 
 #include <iostream> #include <iostream>
  
 #include "InteropProvider.h" #include "InteropProvider.h"
 #include <Pegasus/Common/String.h>  #include "InteropProviderUtils.h"
 #include <Pegasus/Common/System.h>  #include "InteropConstants.h"
 #include <Pegasus/Common/ArrayInternal.h>  
 #include <Pegasus/Common/CIMName.h>  
 #include <Pegasus/Common/CIMType.h>  
 #include <Pegasus/Common/CIMInstance.h>  
 #include <Pegasus/Common/CIMObjectPath.h>  
 #include <Pegasus/Common/InternalException.h>  
 #include <Pegasus/Common/CIMStatusCode.h>  
 #include <Pegasus/Common/Tracer.h>  
 #include <Pegasus/Common/OperationContext.h>  
 #include <Pegasus/Config/ConfigManager.h>  
   
 // 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 <Pegasus/Common/StatisticalData.h>
 #include <Pegasus/Common/XmlWriter.h>  
  
 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)  
  
 /**  /*****************************************************************************
  * Specification for CIM Operations over HTTP  
  *  
  * Version 1.0  
  *  
  * 2.5. Namespace Manipulation  
  * There are no intrinsic methods defined specifically for the  
  * purpose of manipulating CIM Namespaces. However, the modelling  
  * 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.  
  *  
  * For example:  
  *  *
  * Enumeration of all child Namespaces of a particular Namespace   * The following are constants representing property names for the classes
  * is realized by calling the intrinsic method   * managed by the Interop Provider. Where multiple classes have properties of
  * EnumerateInstanceNames against the parent Namespace,   * the same name, there will be a common CIMName object defined, and a macro
  * specifying a value for the ClassName parameter of __Namespace.   * defined that points to the common CIMName object, but whose macro name
    * reflects the class in which the property is used.
  *  *
  * 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  // Constructor for the InteropProvider control provider
 */  //
 static const CIMName __NAMESPACE_CLASSNAME  = CIMName ("__Namespace");  InteropProvider::InteropProvider(CIMRepository * rep) : repository(rep),
 static const CIMName CIM_NAMESPACE_CLASSNAME  = CIMName ("CIM_Namespace");      hostName(System::getHostName()), providerInitialized(false),
 static const CIMName CIM_OBJECTMANAGER_CLASSNAME  = CIMName ("CIM_ObjectManager");      profileIds(Array<String>()), conformingElements(Array<CIMNameArray>()),
 static const CIMName CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM_CLASSNAME  =      elementNamespaces(Array<CIMNamespaceArray>())
         CIMName ("CIM_ObjectManagerCommunicationMechanism");  
 static const CIMName CIM_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME  =  
         CIMName ("CIM_CIMXMLCommunicationMechanism");  
   
   
 // Property Names for __Namespace Class  
 static const CIMName NAMESPACE_PROPERTYNAME  = CIMName ("Name");  
 static const CIMNamespaceName ROOTNS  = CIMNamespaceName ("root");  
   
   
 // Property names for CIM_ObjectManager Class  
 static const CIMName OM_GATHERSTATISTICALDATA  =  
  CIMName ("GatherStatisticalData");  
   
   
 // Property Names for ObjectManagerCommunicationMechanism Class  
 static const CIMName OM_COMMUNICATIONMECHANISM  =  
         CIMName ("CommunicationMechanism");  
 static const CIMName OM_FUNCTIONALPROFILESSUPPORTED  =  
  CIMName ("FunctionalProfilesSupported");  
 static const CIMName OM_FUNCTIONALPROFILEDESCRIPTIONS  =  
  CIMName ("FunctionalProfileDescriptions");  
 static const CIMName OM_AUTHENTICATIONMECHANISMSSUPPORTED  =  
  CIMName ("AuthenticationMechanismsSupported");  
 static const CIMName OM_AUTHENTICATIONMECHANISMDESCRIPTIONS  =  
  CIMName ("AuthenticationMechanismDescriptions");  
 static const CIMName OM_MULTIPLEOPERATIONSSUPPORTED  =  
  CIMName ("MultipleOperationsSupported");  
 static const CIMName OM_VERSION  =  
  CIMName ("Version");  
   
 // Property Names for CIMXML CommunicationMechanism  
   
 static const CIMName CIMVALIDATED  =  
  CIMName ("CIMValidated");  
   
 static const String CIMXMLProtocolVersion = "1.0";  
   
   
 // 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  
 static const CIMName CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME =  
         CIMName ("SystemCreationClassName");  
 static const CIMName CIM_NAMESPACE_PROPERTY_SYSTEMNAME =  
         CIMName ("SystemName");  
 static const CIMName CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME =  
         CIMName ("ObjectManagerCreationClassName");  
 static const CIMName CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME =  
         CIMName ("ObjectManagerName");  
 static const CIMName CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME =  
         CIMName ("CreationClassName");  
 static const CIMName CIM_NAMESPACE_PROPERTY_NAME  = CIMName ("Name");  
 static const CIMName CIM_NAMESPACE_PROPERTY_CLASSINFO =  
         CIMName ("ClassInfo");  
 static const CIMName CIM_NAMESPACE_PROPERTY_DESCRIPTIONOFCLASSINFO =  
         CIMName ("DescriptionOfClassInfo");  
   
   
 //***************************************************************  
 // Utility Functions  
 //***************************************************************  
   
 /* Test the keys in the CIM_Namespace for valid values  
    This includes all of the keys above the name key.  
    THis is a dummy for now.  
    ATTN: KS Extend and finish this function.  
 */  
 Boolean _testKeys(const CIMObjectPath& path)  
 {  
     return true;  
 }  
 Boolean _testKeys(const CIMInstance& instance)  
 { {
     return true;      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,"InteropProvider::InteropProvider");
 }  
   
   
 /* Query the repository for array of all namespacenames  
 */  
 Array<CIMNamespaceName> InteropProvider::_enumerateNameSpaces()  
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_enumerateNameSpaces()");  
     Array<CIMNamespaceName> namespaceNames;  
  
   #ifndef PEGASUS_DISABLE_PERFINST
     try     try
     {     {
         namespaceNames = _repository->enumerateNameSpaces();          initProvider();
     }  
     catch(CIMException& e)  
     {  
         PEG_METHOD_EXIT();  
         throw e;  
     }     }
     catch(Exception& e)      catch(const Exception & e)
     {     {
         PEG_METHOD_EXIT();          // Provider initialization may fail if the repository is not
         throw e;          // populated
     }     }
   #endif
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(namespaceNames);  
 } }
  
 /* get the CIM_Namespace Class defintion from the repository or  //
    from local static storage.  // Local version of getInstance to be used by other functions in the the
    @param namespace in which to look for the class.  // provider. Returns a single instance. Note that it always returns an
    @param name of class to get.  // instance. If none was found, it is uninialitized.
    @return the CIMClass object  //
    @Exceptions any repository exceptions if class not found.  CIMInstance InteropProvider::localGetInstance(
 */      const OperationContext & context,
 CIMClass InteropProvider::_getClass(const CIMNamespaceName& nameSpace,      const CIMObjectPath & instanceName,
                                                  const CIMName& className)      const CIMPropertyList & propertyList)
 {  
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
             "InteropProvider::_getCIM_NamespaceClass()");  
     CIMClass myClass;  
     CDEBUG("Get Class from repository " <<  className.getString());  
     if (myClass.isUninitialized())  
     {     {
         try      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::localGetInstance");
   
       PEG_TRACE((TRC_CONTROLPROVIDER, Tracer::LEVEL4,
           "%s getInstance. instanceName= %s , PropertyList= %s",
           thisProvider,
           (const char *)instanceName.toString().getCString(),
           (const char *)propertyListToString(propertyList).getCString()));
   
       // Test if we're looking for something outside of our namespace. This will
       // happen during associators calls from PG_RegisteredProfile instances
       // through the PG_ElementConformsToProfile association
       CIMNamespaceName opNamespace = instanceName.getNameSpace();
       CIMName opClass = instanceName.getClassName();
       if(opNamespace != PEGASUS_NAMESPACENAME_INTEROP &&
           opClass != PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE)
         {         {
             myClass = _repository->getClass(_operationNamespace, className );          AutoMutex mut(interopMut);
           return cimomHandle.getInstance(context, opNamespace,
               instanceName, false, false, false, propertyList);
         }         }
         catch(CIMException& e)  
       // Create reference from host, namespace, class components of
       // instance name
       CIMObjectPath ref;
       ref.setHost(instanceName.getHost());
       ref.setClassName(opClass);
       ref.setNameSpace(opNamespace);
   
       // Enumerate instances for this class. Returns all instances
       // Note that this returns paths setup and instances already
       // filtered per the input criteria.
       Array<CIMInstance> instances =  localEnumerateInstances(
           context,
           ref,
           propertyList);
   
       // deliver a single instance if found.
       CIMInstance retInstance;
   
       bool found = false;
       for(Uint32 i = 0, n = instances.size(); i < n; i++)
         {         {
             PEG_METHOD_EXIT();          CIMObjectPath currentInstRef = instances[i].getPath();
             throw e;          currentInstRef.setHost(instanceName.getHost());
         }          currentInstRef.setNameSpace(instanceName.getNameSpace());
         catch(Exception& e)          if(instanceName == currentInstRef)
         {         {
             PEG_METHOD_EXIT();              retInstance = instances[i];
             throw e;              found = true;
               break;
           }
         }         }
   
       if(!found)
       {
         cout << "Coule not find instance: " << instanceName.toString() << endl;
     }     }
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return myClass;      return retInstance;
 } }
  
  
 /* Verify that this is one of the legal classnames and  //
    return indicator which.  // Local version of enumerateInstances to be used by other functions in the
    @param - Classname  // provider. Note that this delivers instances as a group rather than one
    @return - Uint32 indicating type  // at a time. This design point may need to be revisited if this provider
    @Exceptions - throws CIMNotSupportedException if invalid class.  // is used in environments such that returning segmented responses would have
 */  // significant performance advantages. For now, that doesn't seem to be the
 Uint32 _verifyValidClassInput(const CIMName& className)  // case.
   //
   Array<CIMInstance> InteropProvider::localEnumerateInstances(
       const OperationContext & context,
       const CIMObjectPath & ref,
       const CIMPropertyList& propertyList)
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             "InteropProvider::_verifyValidClassInput()");          "InteropProvider::localEnumerateInstances()");
     // Verify that ClassName == __Namespace or CIM_Namespace      const CIMName & className = ref.getClassName();
     // ATTN: KS Check to determine if equal is case independent      PEG_TRACE((TRC_CONTROLPROVIDER, Tracer::LEVEL4,
     CDEBUG("Class Name Input = " << className.getString());          "%s enumerateInstances. referenc= %s , PropertyList= %s",
           thisProvider,
           (const char *)className.getString().getCString(),
           (const char *)propertyListToString(propertyList).getCString()));
  
     if (className.equal(__NAMESPACE_CLASSNAME))      // Verify that ClassName is correct and get its enum value
     {      TARGET_CLASS classEnum  = translateClassInput(className);
         PEG_METHOD_EXIT();  
         return __NAMESPACE;  
     }  
  
     if (className.equal(CIM_OBJECTMANAGER_CLASSNAME))      Array<CIMInstance> instances;
       switch(classEnum)
     {     {
         PEG_METHOD_EXIT();          case PG_OBJECTMANAGER:
         return CIM_OBJECTMANAGER;          {
               instances.append(getObjectManagerInstance());
               break;
     }     }
           case PG_CIMXMLCOMMUNICATIONMECHANISM:
     if (className.equal(CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM_CLASSNAME))  
     {     {
         PEG_METHOD_EXIT();              instances = enumCIMXMLCommunicationMechanismInstances();
         return CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM;              break;
     }     }
           case PG_NAMESPACEINMANAGER:
     if (className.equal(CIM_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME))  
     {     {
         PEG_METHOD_EXIT();              instances = enumNamespaceInManagerInstances();
         return CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM;              break;
     }     }
           case PG_COMMMECHANISMFORMANAGER:
     // Last entry, reverse test and returnOK if CIM_Namespace  
     if (!className.equal(CIM_NAMESPACE_CLASSNAME))  
     {     {
         PEG_METHOD_EXIT();              instances = enumCommMechanismForManagerInstances();
         throw CIMNotSupportedException              break;
             (className.getString() + " not supported by Interop Provider");  
     }     }
           case PG_NAMESPACE:
           {
     PEG_METHOD_EXIT();              instances = enumNamespaceInstances();
     return CIM_NAMESPACE;              break;
 } }
           case PG_REGISTEREDPROFILE:
 /* validate the authorization of the user name against the namespace.  
 */  
 String _validateUserID(const OperationContext & context)  
 { {
     //ATTN-DME-P3-20020522: ADD AUTHORIZATION CHECK TO __NAMESPACE PROVIDER              instances = enumRegisteredProfileInstances();
     String userName;              break;
     try          }
           case PG_REGISTEREDSUBPROFILE:
     {     {
         IdentityContainer container = context.get(IdentityContainer::NAME);              instances = enumRegisteredSubProfileInstances();
         userName = container.getUserName();              break;
     }     }
     catch (...)          case PG_REFERENCEDPROFILE:
     {     {
        userName = String::EMPTY;              instances = enumReferencedProfileInstances();
               break;
     }     }
     return userName;          case PG_ELEMENTCONFORMSTOPROFILE:
           {
               instances = enumElementConformsToProfileInstances(context,
                   ref.getNameSpace());
               break;
 } }
           case PG_SUBPROFILEREQUIRESPROFILE:
 /* Create an instance of the CIM_Namespace class which is based  
    on the following CIM MOF Specification  
 [Version ("2.6.0"), Description (  
     "Namespace provides a domain (in other words, a container), "  
     "in which the instances [of a class] are guaranteed to be "  
     "unique per the KEY qualifier definitions.  It is named "  
     "relative to the CIM_ObjectManager implementation that "  
     "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)  
 { {
               instances = enumSubProfileRequiresProfileInstances();
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,              break;
             "InteropProvider::_buildInstanceCommonKeys()");  
     String SystemCreationClassName = System::getSystemCreationClassName ();  
     if (SystemCreationClassName == String::EMPTY)  
     {  
         SystemCreationClassName = "CIM_ComputerSystem";  
     }  
   
     String SystemName = System::getHostName();  
   
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,  
                      SystemCreationClassName)));  
     // SystemName  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_SYSTEMNAME,  
                      SystemName)));  
     PEG_METHOD_EXIT();  
 } }
           case PG_SOFTWAREIDENTITY:
 CIMInstance _buildInstancCIMXMLCommunicationMechanism()  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,              instances = enumSoftwareIdentityInstances();
             "InteropProvider::_buildInstanceCIMXMLCommunicationMechanism()");              break;
   
     CIMInstance instance(CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM_CLASSNAME);  
   
     _buildInstanceCommonKeys(instance);  
   
     //CreationClassName  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,  
             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();  
     return(instance);  
 } }
           case PG_ELEMENTSOFTWAREIDENTITY:
   
 CIMInstance _buildInstancCIMObjectCommunicationMechanism()  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,              instances = enumElementSoftwareIdentityInstances();
             "InteropProvider::_buildInstanceCIMObjectCommunicationMechanism()");              break;
   
     CIMInstance instance(CIM_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME);  
   
     _buildInstanceCommonKeys(instance);  
   
   
     //CreationClassName  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,  
             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) )));  
   
     //Functional Profiles Supported Property.  
     Array<Uint16> profiles;  
     Array<String> profileDescriptions;  
     CIMValue profileValue(profiles);  
     CIMValue profileDescriptionsValue(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");  
   
     instance.addProperty(  
         (CIMProperty(OM_FUNCTIONALPROFILESSUPPORTED,  
                      profileValue )));  
     instance.addProperty(  
         (CIMProperty(OM_FUNCTIONALPROFILEDESCRIPTIONS,  
                      profileDescriptionsValue )));  
   
     // Multiple OperationsSupported Property  
     instance.addProperty(  
         (CIMProperty(OM_MULTIPLEOPERATIONSSUPPORTED,  
                      Boolean(false) )));  
     // AuthenticationMechanismsSupported  
   
     Array<Uint16> authentications;  
     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();  
     return(instance);  
 } }
           case PG_INSTALLEDSOFTWAREIDENTITY:
 String _getObjectManagerName()  
 { {
     return ("PEG_123456789");              instances = enumInstalledSoftwareIdentityInstances();
               break;
 } }
           case PG_COMPUTERSYSTEM:
 CIMInstance _buildInstanceCIMObjectManager()  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,              instances.append(getComputerSystemInstance());
             "InteropProvider::_buildInstanceCIMObjectManager()");              break;
   
     CIMInstance instance(CIM_OBJECTMANAGER_CLASSNAME);  
   
     _buildInstanceCommonKeys(instance);  
   
     //CreationClassName  
     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  
     // have a dynamic activation for this value.  
   
 #ifdef PEGASUS_HAS_PERFINST  
     Boolean gatherStatData = true;  
 #else  
     Boolean gatherStatData = false;  
 #endif  
     instance.addProperty(  
         (CIMProperty(OM_GATHERSTATISTICALDATA,  
                      Boolean(gatherStatData) )));  
     PEG_METHOD_EXIT();  
     return(instance);  
 } }
           case PG_HOSTEDOBJECTMANAGER:
 /* generate one instance of the CIM_Namespace class with the  
    properties  
    @param namespace name to put into the class  
    @exceptions - exceptions carried forward from create instance  
    and addProperty.  
 */  
 CIMInstance _buildInstanceCIMNamespace(const CIMNamespaceName & nameSpace)  
 { {
     PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,              instances.append(getHostedObjectManagerInstance());
             "InteropProvider::_buildInstanceCIMNamespace()");              break;
   // Values for test  
     //String SystemCreationClassName = "creationclassname";  
     //String SystemName = "SystemNameValue";  
     String ObjectManagerName = "ObjectManagerNameValue";  
     String ClassInfo = "ClassInfo";  
     String DescriptionOfClassInfo = "DescriptionOfClassInfo";  
   
     CIMInstance instance(CIM_NAMESPACE_CLASSNAME);  
   
     /*  The following moved to common create  
     // Add the properties  
     // SystemCreationClassName  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_SYSTEMCREATIONCLASSNAME,  
                      SystemCreationClassName)));  
     // SystemName  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_SYSTEMNAME,  
                      SystemName)));  
     */  
     _buildInstanceCommonKeys(instance);  
   
     //ObjectManagerCreationClassName  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_OBJECTMANAGERCREATIONCLASSNAME,  
                      CIM_OBJECTMANAGER_CLASSNAME.getString())));  
     //ObjectManagerName  
     // This is the one we have to sort out ATTN: TBD KS P0  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_OBJECTMANAGERNAME,  
                      ObjectManagerName)));  
     //CreationClassName  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,  
                      CIM_NAMESPACE_CLASSNAME.getString() )));  
     //Name  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_NAME,  
                      nameSpace.getString() )));  
   
     //ClassInfo  
     instance.addProperty(  
         (CIMProperty(CIM_NAMESPACE_PROPERTY_CLASSINFO,  
                      ClassInfo)));  
   
     //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          case PG_HOSTEDACCESSPOINT:
    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,              instances = enumHostedAccessPointInstances();
             "InteropProvider::_buildInstancePath()");              break;
           }
     // get the class CIM_Namespace class to use in building path          default:
     //CIMNamespaceName thisNamespace = classReference.getNameSpace();  
     CIMClass thisClass = _getClass(_operationNamespace, className);  
   
     // XmlWriter::printInstanceElement(instance);  
   
     CIMObjectPath ref = instance.buildPath(thisClass);  
   
     CDEBUG("Built path. path = " << ref.toString() );  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return(ref);              throw CIMNotSupportedException(className.getString() +
                 " not supported by Interop Provider enumerate");
 } }
  
       // Filter and deliver the resulting instances
 /* _isNamespace determines if the namespace in the second      for (Uint32 i = 0 ; i < instances.size() ; i++)
    parameter is in the array in the first parameter.  
     @param array of possible namespaces  
     @param canidate namespace  
     @return - true if found  
 */  
 Boolean _isNamespace(  
         Array<CIMNamespaceName>& namespaceNames,  
         CIMNamespaceName& namespaceName)  
   
 {  
      Boolean found = false;  
      for(Uint32 i = 0; i < namespaceNames.size(); i++)  
      {  
         if(namespaceNames[i].equal ( namespaceName))  
         {         {
             return true;          normalizeInstance(instances[i], ref, false,
         }              false, propertyList);
      }  
      return false;  
 } }
  
 Boolean _isChild(      PEG_METHOD_EXIT();
         CIMNamespaceName& parentNamespaceName,      return instances;
         CIMNamespaceName& namespaceName)  }
  
 {  
     String parent = parentNamespaceName.getString();  
     String child = namespaceName.getString();  
    //    //
    //  If length of namespace name is shorter than or equal to the  // Class that determines whether or not the origin class in an association
    //  length of parent namespace name, cannot be a child  // operation is valid for the given association class, and also determines
   // the origin and target "roles". These values generally correspond to the
   // role and resultRole parameter of an associators/associatorNames operation.
    //    //
    if (child.size () <= parent.size ())  bool InteropProvider::validAssocClassForObject(
       const CIMName & assocClass, const CIMName & originClass,
       const CIMNamespaceName & opNamespace,
       String & originProperty, String & targetProperty)
   {
       PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
           "InteropProvider::validAssocClassForObject()");
       TARGET_CLASS assocClassEnum = translateClassInput(assocClass);
       TARGET_CLASS originClassEnum;
       // If the association class is PG_ElementConformsToProfile, we'll have to
       // do some special processing in case the origin instance for the operation
       // is managed by another provider.
       if(assocClassEnum == PG_ELEMENTCONFORMSTOPROFILE)
       {
           // Test if the origin is an element managed by another provider
           // that has implemented a registered profile.
           if(opNamespace != PEGASUS_NAMESPACENAME_INTEROP ||
               (originClass != PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE &&
               originClass != PEGASUS_CLASSNAME_PG_OBJECTMANAGER))
    {    {
       return false;  
    }  
   
    //    //
    //  Compare prefix substring of namespace name with parent namespace name              // Search the cached conformingElements list for the originClass,
               // returning false if it is not found
    //    //
    else if (String::equalNoCase (child.subString (0, parent.size ()), parent))              bool found = false;
    {  
       return true;  
    }  
    return false;  
 }  
 //**************************************************************  
 // Overloaded functions to get key value with different params  
 //**************************************************************  
  
 /* find the name key in the keybindings and return the value.              PEGASUS_ASSERT(conformingElements.size() ==
     Executes exception if the key not found                  elementNamespaces.size());
     @param object path we will search              for(Uint32 i = 0, n = conformingElements.size(); i < n; ++i)
     @param keyName - Name of the key to find.  
     @return value of name property  
     @exceptions CIMInvalidParameterException  
 */  
 String _getKeyValue(const CIMObjectPath& instanceName, const CIMName& keyName)  
 { {
     Array<CIMKeyBinding> kbArray = instanceName.getKeyBindings();                  CIMNameArray & elementList = conformingElements[i];
                   CIMNamespaceArray & namespaceList = elementNamespaces[i];
     // find the correct key binding                  PEGASUS_ASSERT(elementList.size() == namespaceList.size());
     for (Uint32 i = 0; i < kbArray.size(); i++)                  for(Uint32 j = 0, m = elementList.size(); j < m; ++j)
     {     {
         if (kbArray[i].getName() == keyName)                      CIMName & curElement = elementList[j];
                       if((curElement == originClass ||
                         curElement.getString().find(PEGASUS_DYNAMIC) == 0) &&
                         opNamespace == namespaceList[j])
         {         {
             return (kbArray[i].getValue());                          found = true;
                           break;
         }         }
     }     }
     throw CIMInvalidParameterException("Invalid key property: " + keyName.getString());                  if(found)
                       break;
 } }
  
 String _getKeyValue(const CIMInstance& instance, const CIMName& keyName)              if(!found)
 {                  return false;
     Uint32 pos;  
     CIMValue propertyValue;  
   
     pos = instance.findProperty(keyName);  
     if (pos == PEG_NOT_FOUND)  
     {  
        throw CIMPropertyNotFoundException  
            (NAMESPACE_PROPERTYNAME.getString());  
     }     }
   
     propertyValue = instance.getProperty(pos).getValue();  
     if (propertyValue.getType() != CIMTYPE_STRING)  
     {  
        throw CIMInvalidParameterException("Invalid type for property: "  
                              + NAMESPACE_PROPERTYNAME.getString());  
     }     }
     String name;      else
     propertyValue.get(name);      {
     return(name);          // Otherwise, just get the enum value representing the origin class
     //ATTN: KS Returns String whereas below returns CIMNamespaceName.          // for this operation
           originClassEnum = translateClassInput(originClass);
 } }
  
 /* gets the key value for the __Namespace property "name"      CIMName expectedTargetRole;
    from the instance provided. Sets childNamespaceName and      CIMName expectedOriginRole;
    isRelativeName fields  
    This overload called if instance provided.  
 */  
 void _getKeyValue (  
     const CIMInstance& namespaceInstance,  
         CIMNamespaceName& childNamespaceName,  
         Boolean& isRelativeName)  
  
       //
       // Set the target and origin role values. Note that if these values are
       // not set following the switch block, that implies that the origin class
       // is not valid for the supplied association class.
       //
       switch(assocClassEnum)
 { {
     //Validate key property        case PG_NAMESPACEINMANAGER:
             if(originClassEnum == PG_OBJECTMANAGER)
     Uint32 pos;  
     CIMValue propertyValue;  
   
     // [Key, MaxLen (256), Description (  
     //       "A string that uniquely identifies the Namespace "  
     //       "within the ObjectManager.") ]  
     // string Name;  
   
     pos = namespaceInstance.findProperty(NAMESPACE_PROPERTYNAME);  
     if (pos == PEG_NOT_FOUND)  
     {     {
        throw CIMPropertyNotFoundException                expectedTargetRole = PROPERTY_DEPENDENT;
            (NAMESPACE_PROPERTYNAME.getString());                expectedOriginRole = PROPERTY_ANTECEDENT;
     }     }
             else if(originClassEnum == PG_NAMESPACE)
     propertyValue = namespaceInstance.getProperty(pos).getValue();  
     if (propertyValue.getType() != CIMTYPE_STRING)  
     {     {
        throw CIMInvalidParameterException("Invalid type for property: "                expectedTargetRole = PROPERTY_ANTECEDENT;
                              + NAMESPACE_PROPERTYNAME.getString());                expectedOriginRole = PROPERTY_DEPENDENT;
     }     }
             break;
     String cnsName;        case PG_COMMMECHANISMFORMANAGER:
     propertyValue.get(cnsName);            if(originClassEnum == PG_OBJECTMANAGER)
     childNamespaceName = CIMNamespaceName (cnsName);            {
                 expectedTargetRole = PROPERTY_DEPENDENT;
     isRelativeName = !(childNamespaceName.isNull());                expectedOriginRole = PROPERTY_ANTECEDENT;
   
 } }
 /* gets the key value for the __Namespace property "name"            else if(originClassEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)
    from the instance provided. Sets childNamespaceName and  
    isRelativeName fields  
    This overload called if object path provided.  
 */  
   
 void _getKeyValue (  
         const CIMObjectPath&  instanceName,  
         CIMNamespaceName& childNamespaceName,  
         Boolean& isRelativeName)  
 { {
                 expectedTargetRole = PROPERTY_ANTECEDENT;
     Array<CIMKeyBinding> kbArray = instanceName.getKeyBindings();                expectedOriginRole = PROPERTY_DEPENDENT;
     if ((kbArray.size() == 1) &&            }
             (kbArray[0].getName() == NAMESPACE_PROPERTYNAME))            break;
         case PG_ELEMENTCONFORMSTOPROFILE:
             if(originClass.equal(PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE))
     {     {
        childNamespaceName = CIMNamespaceName (kbArray[0].getValue());                expectedTargetRole =
        isRelativeName = !(childNamespaceName.isNull());                    ELEMENTCONFORMSTOPROFILE_PROPERTY_MANAGEDELEMENT;
                 expectedOriginRole =
                     ELEMENTCONFORMSTOPROFILE_PROPERTY_CONFORMANTSTANDARD;
     }     }
     else     else
     {     {
        throw CIMInvalidParameterException("Invalid key property:  ");                expectedTargetRole =
     }                    ELEMENTCONFORMSTOPROFILE_PROPERTY_CONFORMANTSTANDARD;
                 expectedOriginRole =
                     ELEMENTCONFORMSTOPROFILE_PROPERTY_MANAGEDELEMENT;
 } }
             break;
 /* generate the full namespace name from the parent and child        case PG_SUBPROFILEREQUIRESPROFILE:
    components            if(originClassEnum == PG_REGISTEREDPROFILE)
    @param namespaceNames - List of all namespaces  
    @param parentNamespaceName  
    @param childNamespaceName  
    @param Boolean isrelative  
    @return full namespacename created from parent + child  
    Note that if isrelative is true, parent is tested for validty  
 */  
 CIMNamespaceName _generateFullNamespaceName(  
         Array<CIMNamespaceName>& namespaceNames,  
         CIMNamespaceName& parentNamespaceName,  
         CIMNamespaceName& childNamespaceName,  
         Boolean isRelativeName)  
   
 { {
     // If isRelativeName is true, then the parentNamespace                expectedTargetRole = PROPERTY_DEPENDENT;
     // MUST exist                expectedOriginRole = PROPERTY_ANTECEDENT;
     //            }
     CIMNamespaceName fullNamespaceName;            else if(originClassEnum == PG_REGISTEREDSUBPROFILE)
   
     if (isRelativeName)  
     {     {
       if (!_isNamespace(namespaceNames, parentNamespaceName))                expectedTargetRole = PROPERTY_ANTECEDENT;
                 expectedOriginRole = PROPERTY_DEPENDENT;
             }
             break;
         case PG_ELEMENTSOFTWAREIDENTITY:
             if(originClassEnum == PG_SOFTWAREIDENTITY)
       {       {
          throw CIMObjectNotFoundException("Parent namespace does not exist: "                expectedTargetRole = PROPERTY_DEPENDENT;
                                   + parentNamespaceName.getString());                expectedOriginRole = PROPERTY_ANTECEDENT;
       }       }
       // Create full namespace name by prepending parentNamespaceName            else if(originClassEnum == PG_REGISTEREDPROFILE ||
       fullNamespaceName = CIMNamespaceName (parentNamespaceName.getString()                originClassEnum == PG_REGISTEREDSUBPROFILE)
           + "/" + childNamespaceName.getString());            {
                 expectedTargetRole = PROPERTY_ANTECEDENT;
                 expectedOriginRole = PROPERTY_DEPENDENT;
     }     }
     else            break;
         case PG_INSTALLEDSOFTWAREIDENTITY:
             if(originClassEnum == PG_SOFTWAREIDENTITY)
     {     {
       fullNamespaceName = parentNamespaceName;                expectedTargetRole = INSTALLEDSOFTWAREIDENTITY_PROPERTY_SYSTEM;
                 expectedOriginRole =
                     INSTALLEDSOFTWAREIDENTITY_PROPERTY_INSTALLEDSOFTWARE;
     }     }
     return(fullNamespaceName);            else if(originClassEnum == PG_COMPUTERSYSTEM)
             {
                 expectedTargetRole =
                     INSTALLEDSOFTWAREIDENTITY_PROPERTY_INSTALLEDSOFTWARE;
                 expectedOriginRole = INSTALLEDSOFTWAREIDENTITY_PROPERTY_SYSTEM;
 } }
             break;
 //***************************************************************************        case PG_HOSTEDACCESSPOINT:
 //  The following section is the Instance Operation processors            if(originClassEnum == PG_COMPUTERSYSTEM)
 //***************************************************************************            {
 //                createInstance                expectedTargetRole = PROPERTY_DEPENDENT;
 //***************************************************************************                expectedOriginRole = PROPERTY_ANTECEDENT;
 void InteropProvider::createInstance(  
         const OperationContext & context,  
         const CIMObjectPath & instanceReference,  
     const CIMInstance& myInstance,  
         ObjectPathResponseHandler & handler)  
     {  
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::createInstance()");  
   
         CIMNamespaceName childNamespaceName;  
         CIMNamespaceName newNamespaceName;  
         Boolean isRelativeName;  
         CDEBUG("CreateInstance " << instanceReference.toString());  
         // operation namespace needed internally to get class.  
         _operationNamespace = instanceReference.getNameSpace();  
   
         // Verify that ClassName is correct and get value  
         Uint32 classEnum  = _verifyValidClassInput(instanceReference.getClassName());  
   
         String userName = _validateUserID(context);  
         CIMObjectPath newInstanceReference;  
   
         if (classEnum == CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM)  
             throw CIMNotSupportedException("InteropProvider::createInstance");  
   
         if (classEnum == CIM_CIMXMLCOMMUNICATIONMECHANISM)  
             throw CIMNotSupportedException("InteropProvider::createInstance");  
   
         if (classEnum == CIM_NAMESPACE)  
         {  
             CDEBUG("Create Class from CIM_Namespace");  
             Boolean isGood = _testKeys(instanceReference);  
             String namespaceName;  
             newNamespaceName = _getKeyValue(myInstance, CIM_NAMESPACE_PROPERTY_NAME);  
             // ATTN: KS TBD  
             //Array<CIMKeyBinding> keyBindings;  
             //keyBindings = _buildKeyBindings();  
             //newInstanceReference.set(String::EMPTY, namespaceName,  
             //                   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  
         {  
             _getKeyValue(myInstance, childNamespaceName, isRelativeName);  
             CIMNamespaceName parentNamespaceName = instanceReference.getNameSpace();  
   
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                "childNamespaceName = " + childNamespaceName.getString() +  
                ", isRelativeName = " +  
                (isRelativeName?String("true"):String("false")) +  
                ", parentNamespaceName = " + parentNamespaceName.getString());  
   
             Array<CIMNamespaceName> namespaceNames;  
             namespaceNames = _enumerateNameSpaces();  
   
             newNamespaceName = _generateFullNamespaceName(  
                 namespaceNames, parentNamespaceName,  
                          childNamespaceName, isRelativeName);  
   
             // return key (i.e., CIMObjectPath) for newly created namespace  
   
             Array<CIMKeyBinding> keyBindings;  
             keyBindings.append(CIMKeyBinding(NAMESPACE_PROPERTYNAME,  
                  isRelativeName?childNamespaceName.getString():  
                                     parentNamespaceName.getString(),  
                                          CIMKeyBinding::STRING));  
             //Add namespace class and keybindings  
             newInstanceReference.set(String::EMPTY, parentNamespaceName,  
                                          __NAMESPACE_CLASSNAME, keyBindings);  
         }         }
         // Create the new namespace            else if(originClassEnum == PG_CIMXMLCOMMUNICATIONMECHANISM)
         try  
         {         {
             _repository->createNameSpace(newNamespaceName);                expectedTargetRole = PROPERTY_ANTECEDENT;
                 expectedOriginRole = PROPERTY_DEPENDENT;
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                 "Namespace = " + newNamespaceName.getString() +  
                     " successfully created.");  
             // ATTN: Add standardlog entry here.  
         }         }
         catch(CIMException& e)        case PG_HOSTEDOBJECTMANAGER:
             if(originClassEnum == PG_COMPUTERSYSTEM)
         {         {
            _repository->write_unlock();                expectedTargetRole = PROPERTY_DEPENDENT;
            PEG_METHOD_EXIT();                expectedOriginRole = PROPERTY_ANTECEDENT;
            throw e;  
         }         }
         catch(Exception& e)            else if(originClassEnum == PG_OBJECTMANAGER)
         {         {
            _repository->write_unlock();                expectedTargetRole = PROPERTY_ANTECEDENT;
            PEG_METHOD_EXIT();                expectedOriginRole = PROPERTY_DEPENDENT;
            throw e;  
         }         }
             break;
         _repository->write_unlock();        default:
             break;
         // begin processing the request  
         handler.processing();  
   
   
        handler.deliver(newInstanceReference);  
   
        // complete processing the request  
        handler.complete();  
   
        PEG_METHOD_EXIT();  
        return;  
    }    }
  
 //***************************************************************************      //
 //                deleteInstance      // The rest of this method checks to see if target role and origin roles
 //***************************************************************************      // were found for the association and origin class combination and, if
 void InteropProvider::deleteInstance(      // found, checks against the input target and origin roles if provided.
         const OperationContext & context,      // Failure for any of these tests points to an invalid association
         const CIMObjectPath & instanceName,      // traversal request.
         ResponseHandler & handler)      //
       if(expectedTargetRole.isNull() ||
           expectedOriginRole.isNull())
     {     {
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::deleteInstance");          PEG_METHOD_EXIT();
         CDEBUG("deleteInstance" << instanceName.toString());          return false;
         CIMNamespaceName childNamespaceName;      }
         CIMNamespaceName deleteNamespaceName;  
         Boolean isRelativeName;  
   
         // Verify that ClassName is correct and get value  
         Uint32 classEnum  = _verifyValidClassInput(instanceName.getClassName());  
   
         String userName = _validateUserID(context);  
   
         Array<CIMNamespaceName> namespaceNames;  
         namespaceNames = _enumerateNameSpaces();  
   
         if (classEnum == CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM)  
             throw CIMNotSupportedException("InteropProvider::createInstance");  
   
         if (classEnum == CIM_CIMXMLCOMMUNICATIONMECHANISM)  
             throw CIMNotSupportedException("InteropProvider::createInstance");  
  
         if (classEnum == CIM_NAMESPACE)      if(targetProperty.size() == 0)
         {         {
             _testKeys(instanceName);          targetProperty = expectedTargetRole.getString();
             deleteNamespaceName = _getKeyValue(instanceName, CIM_NAMESPACE_PROPERTY_NAME);  
             CDEBUG("Delete namespace = " << deleteNamespaceName );  
         }         }
         else  // Procesing for __namespace      else if(!expectedTargetRole.equal(targetProperty))
         {         {
           PEG_METHOD_EXIT();
            _getKeyValue(instanceName, childNamespaceName, isRelativeName);          return false;
            CIMNamespaceName parentNamespaceName = instanceName.getNameSpace();  
   
            PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                "childNamespaceName = " + childNamespaceName.getString() +  
                (isRelativeName?String("true"):String("false")) +  
                ", parentNamespaceName = " + parentNamespaceName.getString());  
   
            // begin processing the request  
   
            deleteNamespaceName = _generateFullNamespaceName(  
                namespaceNames, parentNamespaceName,  
                          childNamespaceName, isRelativeName);  
         }         }
  
             // ATTN: KS Why THis???      if(originProperty.size() == 0)
         if (deleteNamespaceName.equal (ROOTNS))  
        {        {
            throw CIMNotSupportedException("root namespace cannot be deleted.");          originProperty = expectedOriginRole.getString();
       }
       else if(!expectedOriginRole.equal(originProperty))
       {
           PEG_METHOD_EXIT();
           return false;
        }        }
   
            _repository->deleteNameSpace(deleteNamespaceName);  
   
            PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                "Namespace = " + deleteNamespaceName.getString() +  
                " successfully deleted.");  
        // ATTN: Log entry for deletion.  
        handler.processing();  
   
        // complete processing the request  
        handler.complete();  
  
        PEG_METHOD_EXIT();        PEG_METHOD_EXIT();
        return ;      return true;
     }     }
  
 //***************************************************************************  //
 //                getInstance  // Local version of the references operation. It validates the input
 //***************************************************************************  // parameters, setting the origin and target property values if not set
 void InteropProvider::getInstance(  // already, and then performs an enumeration on the association class. It then
   // filters the results of that enumeration to see if one of the reference
   // properties matches the objectName parameter passed into the method. If so,
   // then it is added to the array of association instances to be returned.
   //
   Array<CIMInstance> InteropProvider::localReferences(
     const OperationContext & context,     const OperationContext & context,
     const CIMObjectPath & instanceName,      const CIMObjectPath & objectName,
     const Boolean includeQualifiers,      const CIMName & assocClass,
     const Boolean includeClassOrigin,      String & originProperty,
     const CIMPropertyList & properatyList,      String & targetProperty,
     InstanceResponseHandler & handler)      const CIMPropertyList & propertyList,
       const CIMName & targetClass)
     {     {
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::getInstance");      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
           "InteropProvider::localReferences()");
         // Verify that ClassName is correct and get value  
         Uint32 classEnum  = _verifyValidClassInput(instanceName.getClassName());  
  
         String userName = _validateUserID(context);      Array<CIMInstance> instances;
       CIMName originClass = objectName.getClassName();
  
         // begin processing the request      Array<CIMName> targetSubclasses;
         handler.processing();      CIMNamespaceName lastTargetNamespace;
         if (classEnum == CIM_OBJECTMANAGER)      CIMNamespaceName originNamespace(objectName.getNameSpace());
   
       // Check that the association traversal request is valid
       if(validAssocClassForObject(assocClass, objectName.getClassName(),
           originNamespace, originProperty, targetProperty))
       {
           // retrieve all of the association class instances
           Array<CIMInstance> localInstances = localEnumerateInstances(context,
               CIMObjectPath(hostName, originNamespace,
                   assocClass));
           // Filter the association class instances based on the origin instance
           // and other input parameters.
           for(Uint32 i = 0, n = localInstances.size(); i < n; ++i)
           {
               CIMInstance & currentInstance = localInstances[i];
               CIMObjectPath originPath = getRequiredValue<CIMObjectPath>(
                   currentInstance, originProperty);
               originPath.setNameSpace(objectName.getNameSpace());
               originPath.setHost(objectName.getHost());
               // Only include instances where the origin instance is present in
               // the association.
               if(originPath.identical(objectName))
               {
                   if(!targetClass.isNull())
                   {
                       // Have to check if the target reference is of the
                       // targetClass type. We first must determine all the
                       // possible subclasses of the targetClass in the target
                       // namespace.
                       CIMObjectPath targetPath = getRequiredValue<CIMObjectPath>(
                           currentInstance, targetProperty);
   
                       CIMNamespaceName targetNamespace(
                           targetPath.getNameSpace());
                       if(targetNamespace.isNull())
         {         {
             CIMInstance instance = _buildInstanceCIMObjectManager();                          targetNamespace = originNamespace;
             handler.deliver(instance);                          targetPath.setNameSpace(targetNamespace);
             handler.complete();  
             PEG_METHOD_EXIT();  
             return;  
         }         }
                       if(targetNamespace != lastTargetNamespace)
         if (classEnum == CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM)  
         {         {
             CIMInstance instance = _buildInstancCIMObjectCommunicationMechanism();                          try
             handler.deliver(instance);                          {
             handler.complete();                              targetSubclasses = repository->enumerateClassNames(
             PEG_METHOD_EXIT();                                  targetNamespace, targetClass, true);
             return;  
         }         }
                           catch(...)
   
         if (classEnum == CIM_CIMXMLCOMMUNICATIONMECHANISM)  
         {         {
             CIMInstance instance = _buildInstancCIMXMLCommunicationMechanism();                              // If an exception was thrown during enumeration,
             handler.deliver(instance);                              // then the base class didn't exist in the
             handler.complete();                              // namespace, so the target instance retrieved
             PEG_METHOD_EXIT();                              // must not match the targetClass parameter.
             return;                              continue;
                           }
                           targetSubclasses.append(targetClass);
                           lastTargetNamespace = targetNamespace;
         }         }
  
         // Get List of namespaces                      // Try to find the targetPath's class in the search space
         Array<CIMNamespaceName> namespaceNames;                      CIMName targetPathClass = targetPath.getClassName();
         namespaceNames = _enumerateNameSpaces();                      for(Uint32 j = 0, m = targetSubclasses.size(); j < m; ++j)
         CIMInstance instance;  
   
   
         if (classEnum == CIM_NAMESPACE)  
         {         {
             // Not clear what we have to take into account here.                          if(targetPathClass == targetSubclasses[j])
             // get the namespace from the name value.  
             // should check the other keys to see if valid.  
             CIMNamespaceName namespaceName;  
             namespaceName = _getKeyValue(instanceName, CIM_NAMESPACE_PROPERTY_NAME);  
             // ATTN: Why this CIMNamespaceName parentNamespaceName = instanceName.getNameSpace();  
   
             if (!_isNamespace(namespaceNames, namespaceName))  
             {             {
                 throw CIMObjectNotFoundException("Namespace does not exist: "                              instances.append(currentInstance);
                                      + namespaceName.getString());                              break;
             }             }
             PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                "Namespace = " + namespaceName.getString() + " successfully found.");  
             instance = _buildInstanceCIMNamespace(namespaceName);  
         }         }
         else  // processing for __Namespace                  }
         {                  else
             CIMNamespaceName childNamespaceName;  
             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: "                      instances.append(currentInstance);
                                      + 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);  
   
        // complete processing the request  
        handler.complete();  
   
        PEG_METHOD_EXIT();  
        return ;  
     }     }
   
 //***************************************************************************  
 //                enumerateInstances  
 //***************************************************************************  
 void InteropProvider::enumerateInstances(  
     const OperationContext & context,  
     const CIMObjectPath & ref,  
     const Boolean includeQualifiers,  
     const Boolean includeClassOrigin,  
     const CIMPropertyList& propertyList,  
     InstanceResponseHandler & handler)  
     {  
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, "InteropProvider::enumerateInstances()");  
         CDEBUG("EnumerateInstances");  
         // Verify that ClassName is correct and get value  
         Uint32 classEnum  = _verifyValidClassInput(ref.getClassName());  
   
         String userName = _validateUserID(context);  
   
         // The following 3 classes deliver a single instance because  
         // that is all there is today.  
         if (classEnum == CIM_OBJECTMANAGER)  
         {  
             CIMInstance instance = _buildInstanceCIMObjectManager();  
             handler.deliver(instance);  
             handler.complete();  
             PEG_METHOD_EXIT();  
             return;  
         }         }
  
         if (classEnum == CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM)  
         {  
             CIMInstance instance = _buildInstancCIMObjectCommunicationMechanism();  
             handler.deliver(instance);  
             handler.complete();  
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return;      return instances;
         }         }
  
  
         if (classEnum == CIM_CIMXMLCOMMUNICATIONMECHANISM)  //
   // Builds an instance of the class named className. Gets Class defintion and
   // fills in the correct properties from the class.  This requires a repository
   // getClass request for each instance built. The skeleton is built by
   // creating the instance and copying qualifiers and properties from
   // the class. Finally the instance is cloned to separate it from the
   // original objects.
   // NOTE: This is very inefficient for anything larger than a few instances.
   // We should separate the get from the createSkeleton.
   // @param className CIMName of the class for which the instance is to be built
   // @return CIMInstance of this class with properties complete.
   // @exception passes on any exceptions received from the repository request.
   //
   CIMInstance InteropProvider::buildInstanceSkeleton(
         const CIMNamespaceName & nameSpace,
         const CIMName& className,
         CIMClass& returnedClass)
         {         {
             CIMInstance instance = _buildInstancCIMXMLCommunicationMechanism();      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
             handler.deliver(instance);          "InteropProvider::_buildInstanceSkeleton()");
             handler.complete();      // get class with lo = false, qualifier = true classorig = true
             PEG_METHOD_EXIT();      returnedClass = repository->getClass(nameSpace,
             return;          className, false, true, true);
       CIMInstance skeleton = returnedClass.buildInstance(true,true,
           CIMPropertyList());
  
       PEG_METHOD_EXIT();
       return skeleton;
         }         }
  
         // ATTN: Fix this up.  should not be here.  
         CIMNamespaceName parentNamespaceName = ref.getNameSpace();  
  
         // ATTN KS Fix this so references both types of namespace  CIMInstance InteropProvider::buildDependencyInstance(
         PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,      const String & antecedentId,
            "parentNamespaceName = " + parentNamespaceName.getString());      const CIMName & antecedentClass,
       const String & dependentId,
       const CIMName & dependentClass,
       const CIMClass & dependencyClass)
   {
       Array<CIMKeyBinding> dependentKeys;
  
         // begin processing the request      dependentKeys.append(CIMKeyBinding(
         handler.processing();          COMMON_PROPERTY_INSTANCEID,
           dependentId,CIMKeyBinding::STRING));
  
         Array<CIMNamespaceName> namespaceNames = _enumerateNameSpaces();      return buildDependencyInstanceFromPaths(
           buildDependencyReference(hostName, antecedentId, antecedentClass),
           buildDependencyReference(hostName, dependentId, dependentClass),
           dependencyClass);
   }
  
         Array<CIMInstance> instanceArray;  void InteropProvider::initProvider()
         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());      if(providerInitialized)
             CDEBUG("Evaluate ClassEnum" << classEnum);          return;
             if (classEnum == CIM_NAMESPACE)      // Placed METHOD_ENTER trace statement after checking whether the
             {      // provider is initialized because this method will be called for every
                 CDEBUG("Evaluate CIM_Namespace" << classEnum);      // operation through the InteropProvider, and this method is only
                 // Create a valid CIM_Namespace Instance      // interesting the first time it is successfully run.
                 CIMInstance instance = _buildInstanceCIMNamespace(namespaceNames[i]);      PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
                 instanceArray.append(instance);          "InteropProvider::initProvider()");
  
                 PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,      AutoMutex lock(interopMut);
                 "Namespace = " + namespaceNames[i].getString());      if(!providerInitialized)
       {
           //
           // Initialize the object manager instance for the CIM Server, and
           // retrieve the object manager's name property. This is retrieved once
           // and stored for use in constructing other instances requiring its
           // value.
           //
           CIMInstance objectManager = getObjectManagerInstance();
           objectManager.getProperty(objectManager.findProperty(
               OM_PROPERTY_NAME)).getValue().get(objectManagerName);
  
             }          //
             else // the else covers __NAMESPACE          // Determine whether the CIMOM should be gathering statistical data
           // based on the GatherStatisticalData property in the object manager.
           //
           Uint32 gatherDataIndex = objectManager.findProperty(
               OM_PROPERTY_GATHERSTATISTICALDATA);
           if(gatherDataIndex != PEG_NOT_FOUND)
             {             {
                 // Build the instances. For now simply build the __Namespace instances              CIMConstProperty gatherDataProp =
                 // the only property is name.                  objectManager.getProperty(gatherDataIndex);
                 if (_isChild(parentNamespaceName, namespaceNames[i]))              if (gatherDataProp.getType() == CIMTYPE_BOOLEAN)
                 {                 {
                     CIMInstance instance(__NAMESPACE_CLASSNAME);                  CIMValue gatherDataVal  = gatherDataProp.getValue();
                     instance.addProperty(                  if (!gatherDataVal.isNull())
                         (CIMProperty(NAMESPACE_PROPERTYNAME,                  {
                         namespaceNames[i].getString().subString                      Boolean gatherData;
                             (parentNamespaceName.getString().size()+1,                      gatherDataVal.get(gatherData);
                             namespaceNames[i].getString().size()-                      if (gatherData == true)
                         parentNamespaceName.getString().size()-1))));                      {
                           StatisticalData* sd = StatisticalData::current();
                     instanceArray.append(instance);                          sd->setCopyGSD(true);
   
                     //instance.setPath(instanceName);  
                     PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                     "childNamespace = " + namespaceNames[i].getString());  
                 }                 }
             }             }
         }         }
         handler.deliver(instanceArray);  
   
         // complete processing the request  
         handler.complete();  
   
         PEG_METHOD_EXIT();  
     }     }
  
 //***************************************************************************          // Cache this class definition for use later.
 //                enumerateInstanceNames          profileCapabilitiesClass = repository->getClass(
 //***************************************************************************              PEGASUS_NAMESPACENAME_INTEROP,
               PEGASUS_CLASSNAME_PG_PROVIDERPROFILECAPABILITIES,
 void InteropProvider::enumerateInstanceNames(              false, true, false);
         const OperationContext & context,  
         const CIMObjectPath & classReference,  
         ObjectPathResponseHandler & handler)  
     {  
         PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,  
                 "InteropProvider::enumerateInstanceNames()");  
   
         // operation namespace needed internally to get class.  
         _operationNamespace = classReference.getNameSpace();  
   
         Uint32 classEnum  = _verifyValidClassInput(classReference.getClassName());  
  
         // begin processing the request          providerClassifications.append(Uint16(5)); // "Instrumentation"
         handler.processing();  
  
         // The following 3 classes deliver a single instance because          //
         // that is all there is today.          // Initialize the namespaces so that all namespaces with the
         if (classEnum == CIM_OBJECTMANAGER)          // CIM_ElementConformsToProfile class also have the
           // PG_ElementConformsToProfile class. Needed in order to implement
           // the cross-namespace ElementConformsToProfile association in both
           // directions.
           //
           Array<CIMNamespaceName> namespaceNames =
               repository->enumerateNameSpaces();
           CIMClass conformsClass = repository->getClass(
               PEGASUS_NAMESPACENAME_INTEROP,
               PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE);
           CIMClass profileClass = repository->getClass(
               PEGASUS_NAMESPACENAME_INTEROP,
               PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE);
           for(Uint32 i = 0, n = namespaceNames.size(); i < n; ++i)
         {         {
             CIMInstance instance = _buildInstanceCIMObjectManager();              // Check if the PG_ElementConformsToProfile class is present
             CIMObjectPath ref = _buildInstancePath(CIMNamespaceName(),              CIMNamespaceName & currentNamespace = namespaceNames[i];
                 CIM_OBJECTMANAGER_CLASSNAME, instance);  
             handler.deliver(ref);  
             handler.complete();  
             PEG_METHOD_EXIT();  
             return;  
         }  
  
         if (classEnum == CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM)              CIMClass tmpCimClass;
               CIMClass tmpPgClass;
               CIMClass tmpPgProfileClass;
               try
         {         {
             CIMInstance instance = _buildInstancCIMObjectCommunicationMechanism();                  // Look for these classes in the same try-block since the
             CIMObjectPath ref = _buildInstancePath(CIMNamespaceName(),                  // second depends on the first
                 CIM_OBJECTMANAGERCOMMUNICATIONMECHANISM_CLASSNAME, instance);                  tmpCimClass = repository->getClass(currentNamespace,
             handler.deliver(ref);                      PEGASUS_CLASSNAME_CIM_ELEMENTCONFORMSTOPROFILE);
             handler.complete();                  tmpPgClass = repository->getClass(currentNamespace,
             PEG_METHOD_EXIT();                      PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE);
             return;  
         }         }
               catch(const Exception &)
   
         if (classEnum == CIM_CIMXMLCOMMUNICATIONMECHANISM)  
         {         {
             CIMInstance instance = _buildInstancCIMXMLCommunicationMechanism();  
             CIMObjectPath ref = _buildInstancePath(CIMNamespaceName(),  
                 CIM_CIMXMLCOMMUNICATIONMECHANISM_CLASSNAME, instance);  
             handler.deliver(ref);  
             handler.complete();  
             PEG_METHOD_EXIT();  
             return;  
   
         }         }
               try
         String userName = _validateUserID(context);  
   
         // 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)                  tmpPgProfileClass = repository->getClass(currentNamespace,
                       PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE);
               }
               catch(const Exception &)
             {             {
                   // Note: if any of the above three classes aren't found,
                 CDEBUG("Calling BuildInstancePath for "<< namespaceNames[i].getString() );                  // an exception will be thrown, which we can ignore since it's
                 CIMInstance instance = _buildInstanceCIMNamespace(namespaceNames[i]);                  // an expected case
                 CIMObjectPath ref = _buildInstancePath(CIMNamespaceName(namespaceNames[i]),                  // TBD: Log trace message?
                                             CIM_NAMESPACE_CLASSNAME, instance);  
   
                 handler.deliver(ref);  
   
                 PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                     "namespace = " + namespaceNames[i].getString());  
             }             }
             else  
               // If the CIM_ElementConformsToProfile class is present, but
               // the PG_ElementConformsToProfile or PG_RegisteredProfile
               // class is not, then add it to that namespace.
               //
               // Note that we don't have to check for the
               // CIM_RegisteredProfile class because if the
               // CIM_ElementConformsToProfile class is present, the
               // CIM_RegisteredProfile class must also be present.
               if(!tmpCimClass.isUninitialized())
             {             {
                 Array<CIMKeyBinding> keyBindings;                  if(tmpPgClass.isUninitialized())
                 // Build the __Namespace objectpath  
                 // Note that for the moment, the only property is name.  
                 if (_isChild(parentNamespaceName, namespaceNames[i]))  
                 {                 {
                     keyBindings.clear();                      CIMObjectPath newPath = conformsClass.getPath();
                       keyBindings.append(CIMKeyBinding(NAMESPACE_PROPERTYNAME,                      newPath.setNameSpace(currentNamespace);
                           namespaceNames[i].getString().subString                      conformsClass.setPath(newPath);
                           (parentNamespaceName.getString().size()+1,                      repository->createClass(currentNamespace,
                           namespaceNames[i].getString().size()-                          conformsClass);
                           parentNamespaceName.getString().size()-1),  
                           CIMKeyBinding::STRING));  
   
                       CIMObjectPath ref(String::EMPTY, parentNamespaceName,  
                       __NAMESPACE_CLASSNAME, keyBindings);  
   
                       handler.deliver(ref);  
                       PEG_TRACE_STRING(TRC_CONTROLPROVIDER, Tracer::LEVEL4,  
                           "childNamespace = " + namespaceNames[i].getString());  
                 }  
             }             }
                   if(tmpPgProfileClass.isUninitialized())
                   {
                       CIMObjectPath newPath = conformsClass.getPath();
                       newPath.setNameSpace(currentNamespace);
                       conformsClass.setPath(newPath);
                       repository->createClass(currentNamespace,
                           profileClass);
         }         }
   
         handler.complete();  
   
         PEG_METHOD_EXIT();  
     }     }
   
   
 //**************************************************************  
 //**************************************************************  
 // Association Functions  
 //**************************************************************  
 //**************************************************************  
   
 void InteropProvider::associators(  
         const OperationContext & context,  
         const CIMObjectPath & objectName,  
         const CIMName & associationClass,  
         const CIMName & resultClass,  
         const String & role,  
         const String & resultRole,  
         const Boolean includeQualifiers,  
         const Boolean includeClassOrigin,  
         const CIMPropertyList & propertyList,  
         ObjectResponseHandler & handler)  
 {  
         throw CIMNotSupportedException("AssociationProvider::associators");  
 } }
  
 void InteropProvider::associatorNames(          // Now cache the Registration info used for ElementConformsToProfile
         const OperationContext & context,          cacheProfileRegistrationInfo();
         const CIMObjectPath & objectName,  
         const CIMName & associationClass,  
         const CIMName & resultClass,  
         const String & role,  
         const String & resultRole,  
         ObjectPathResponseHandler & handler)  
 {  
         throw CIMNotSupportedException("AssociationProvider::associatorNames");  
 }  
  
 void InteropProvider::references(          providerInitialized = true;
         const OperationContext & context,  
         const CIMObjectPath & objectName,  
         const CIMName & resultClass,  
         const String & role,  
         const Boolean includeQualifiers,  
         const Boolean includeClassOrigin,  
         const CIMPropertyList & propertyList,  
         ObjectResponseHandler & handler)  
 {  
         throw CIMNotSupportedException("AssociationProvider::references");  
 } }
  
 void InteropProvider::referenceNames(      PEG_METHOD_EXIT();
         const OperationContext & context,  
         const CIMObjectPath & objectName,  
         const CIMName & resultClass,  
         const String & role,  
         ObjectPathResponseHandler & handler)  
 {  
         throw CIMNotSupportedException("AssociationProvider::referenceNames");  
 } }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
 // END_OF_FILE  
   // END OF FILE


Legend:
Removed from v.1.4  
changed lines
  Added in v.1.66.4.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2