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

Diff for /pegasus/src/Pegasus/ControlProviders/InteropProvider/ElementConformsToProfile.cpp between version 1.6 and 1.12.6.2

version 1.6, 2008/04/24 06:28:01 version 1.12.6.2, 2013/06/03 22:35:54
Line 1 
Line 1 
 //%2006////////////////////////////////////////////////////////////////////////  //%LICENSE////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development  // Licensed to The Open Group (TOG) under one or more contributor license
 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.  // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;  // this work for additional information regarding copyright ownership.
 // IBM Corp.; EMC Corporation, The Open Group.  // Each contributor licenses this file to you under the OpenPegasus Open
 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;  // Source License; you may not use this file except in compliance with the
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.  // License.
 // 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
 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;  // copy of this software and associated documentation files (the "Software"),
 // EMC Corporation; Symantec Corporation; The Open Group.  // to deal in the Software without restriction, including without limitation
 //  // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 // Permission is hereby granted, free of charge, to any person obtaining a copy  // and/or sell copies of the Software, and to permit persons to whom the
 // of this software and associated documentation files (the "Software"), to  // Software is furnished to do so, subject to the following conditions:
 // deal in the Software without restriction, including without limitation the  //
 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or  // The above copyright notice and this permission notice shall be included
 // sell copies of the Software, and to permit persons to whom the Software is  // in all copies or substantial portions of the Software.
 // furnished to do so, subject to the following conditions:  //
 //  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN  // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED  // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT  // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR  // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT  // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN  // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION  
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  
 // //
 //=============================================================================  //////////////////////////////////////////////////////////////////////////
 // //
 //%//////////////////////////////////////////////////////////////////////////// //%////////////////////////////////////////////////////////////////////////////
  
Line 113 
Line 111 
             enumRegisteredSubProfileInstances();             enumRegisteredSubProfileInstances();
         profileInstances.appendArray(subprofileInstances);         profileInstances.appendArray(subprofileInstances);
         Array<CIMInstance> profilesForVersion = getProfilesForVersion(         Array<CIMInstance> profilesForVersion = getProfilesForVersion(
             profileInstances,              profileInstances, SNIA_NUM, 1, 2, 0);
             SNIA_VER_120);  
         for (Uint32 i = 0, n = profilesForVersion.size(); i < n; ++i)         for (Uint32 i = 0, n = profilesForVersion.size(); i < n; ++i)
         {         {
             instances.append(buildElementConformsToProfile(             instances.append(buildElementConformsToProfile(
Line 122 
Line 119 
                 profilesForVersion[i].getPath(),                 profilesForVersion[i].getPath(),
                 elementConformsClass));                 elementConformsClass));
         }         }
   
         //Add association between the 1.2 SMI-S registeredprofile and  
         //profileregistration registeredprofile with registeredversion 1.0.0  
         profRegProfile = buildDependencyReference(  
             hostName,  
             buildProfileInstanceId(  
                 SNIA_NAME,  
                 "Profile Registration",  
                 SNIA_VER_100),  
             PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE);  
         instances.append(buildElementConformsToProfile(  
             smisVersionProfile,  
             profRegProfile,  
             elementConformsClass));  
   
   
     }     }
     return instances;     return instances;
 } }
Line 286 
Line 267 
                 elementConformsClass));                 elementConformsClass));
  
     }     }
   
   #ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
       // Now add the  association between the Indication profile
       // and IndicationService
       if (opNamespace == PEGASUS_NAMESPACENAME_INTEROP)
       {
           CIMObjectPath serverProfile = buildDependencyReference(
               hostName,
               buildProfileInstanceId(DMTF_NAME, "Indications", DMTF_VER_110),
               PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE);
           // Retrieve the IndicationService instance
           Array<CIMInstance> indService =
               enumIndicationServiceInstances(OperationContext());
   
           instances.append(
               buildElementConformsToProfile(
                   serverProfile,
                   indService[0].getPath(),
                   elementConformsClass));
       }
   #endif
   
     return instances;     return instances;
 } }
  
 //Method that filters the registered profile or registered subprofile instances //Method that filters the registered profile or registered subprofile instances
 //for the SMI-S version.  //whose versions are greater or equal to the given version.
 Array<CIMInstance> InteropProvider::getProfilesForVersion( Array<CIMInstance> InteropProvider::getProfilesForVersion(
     Array<CIMInstance>& profiles,     Array<CIMInstance>& profiles,
     const String version)      Uint16 regOrg,
 {      Uint32 majorVer,
       Uint32 minorVer,
       Uint32 updateVer)
   {
       static const String SMISProfileName("SMI-S");
       static const String SNIAIndicationProfileName("Indication");
       static const String DMTFIndicationProfileName("Indications");
       static const String ServerProfileName("Server");
       static const String SoftwareProfileName("Software");
   
     Array<CIMInstance> instances;     Array<CIMInstance> instances;
     instances.clear();     instances.clear();
     for (Uint32 i = 0, n = profiles.size(); i < n; ++i)     for (Uint32 i = 0, n = profiles.size(); i < n; ++i)
     {     {
         String versionNumber;         String versionNumber;
         String profileName;         String profileName;
           //Can use 0 here as registered organization value of 0 is
           //ruled out(not specified in the CIM Schema
           Uint16 regOrgNo = 0;
   
         Uint32 index = profiles[i].findProperty("RegisteredVersion");         Uint32 index = profiles[i].findProperty("RegisteredVersion");
         if (index != PEG_NOT_FOUND)         if (index != PEG_NOT_FOUND)
         {         {
Line 319 
Line 335 
                 tmpVal.get(profileName);                 tmpVal.get(profileName);
             }             }
         }         }
           index = profiles[i].findProperty("RegisteredOrganization");
           if (index != PEG_NOT_FOUND)
           {
               const CIMValue &tmpVal = profiles[i].getProperty(index).getValue();
               if (!tmpVal.isNull())
               {
                   tmpVal.get(regOrgNo);
               }
           }
  
         if ((versionNumber == version) && (profileName != String("SMI-S")))          if ( regOrgNo != 0 && regOrg == regOrgNo)
           {
               if (profileName == ServerProfileName ||
                   (regOrg == SNIA_NUM &&
                       profileName == SNIAIndicationProfileName) ||
                   (regOrg == DMTF_NUM
                       && profileName == DMTFIndicationProfileName) ||
                   profileName == SoftwareProfileName)
               {
                   if (VersionUtil::isVersionGreaterOrEqual(
                       versionNumber, majorVer, minorVer, updateVer))
                   {
                       instances.append(profiles[i]);
                   }
               }
               else if (profileName != SMISProfileName)
         {         {
             instances.append(profiles[i]);             instances.append(profiles[i]);
         }         }
     }     }
       }
     return instances;     return instances;
 } }
  
Line 373 
Line 414 
         propList.append(PROVIDERCAPABILITIES_PROPERTY_CLASSNAME);         propList.append(PROVIDERCAPABILITIES_PROPERTY_CLASSNAME);
         capabilities = repository->enumerateInstancesForClass(         capabilities = repository->enumerateInstancesForClass(
             PEGASUS_NAMESPACENAME_INTEROP,             PEGASUS_NAMESPACENAME_INTEROP,
             PEGASUS_CLASSNAME_PROVIDERCAPABILITIES, false, false, false);              PEGASUS_CLASSNAME_PROVIDERCAPABILITIES, false, false);
     }     }
     else     else
     {     {
Line 453 
Line 494 
             true,             true,
             false,             false,
             false,             false,
             false,  
             CIMPropertyList(propList));             CIMPropertyList(propList));
  
     CIMClass elementConformsClass = repository->getClass(     CIMClass elementConformsClass = repository->getClass(
Line 524 
Line 564 
             // Get the namespaces in which this provider operates and trim down             // Get the namespaces in which this provider operates and trim down
             // the list of capabilities instaces to just those that are related             // the list of capabilities instaces to just those that are related
             // to this one.             // to this one.
             String moduleName = getRequiredValue<String>(  
                 currentProfileInstance,  
                 CAPABILITIES_PROPERTY_PROVIDERMODULENAME);  
             String providerName = getRequiredValue<String>(  
                 currentProfileInstance,  
                 CAPABILITIES_PROPERTY_PROVIDERNAME);  
             if (capabilities.size() == 0)             if (capabilities.size() == 0)
             {             {
                 Array<CIMName> propList;                  Array<CIMName> capPropList;
                 propList.append(                  capPropList.append(
                     PROVIDERCAPABILITIES_PROPERTY_PROVIDERMODULENAME);                     PROVIDERCAPABILITIES_PROPERTY_PROVIDERMODULENAME);
                 propList.append(PROVIDERCAPABILITIES_PROPERTY_PROVIDERNAME);                  capPropList.append(PROVIDERCAPABILITIES_PROPERTY_PROVIDERNAME);
                 propList.append(PROVIDERCAPABILITIES_PROPERTY_NAMESPACES);                  capPropList.append(PROVIDERCAPABILITIES_PROPERTY_NAMESPACES);
                 propList.append(PROVIDERCAPABILITIES_PROPERTY_CLASSNAME);                  capPropList.append(PROVIDERCAPABILITIES_PROPERTY_CLASSNAME);
                 capabilities = repository->enumerateInstancesForClass(                 capabilities = repository->enumerateInstancesForClass(
                     PEGASUS_NAMESPACENAME_INTEROP,                     PEGASUS_NAMESPACENAME_INTEROP,
                     PEGASUS_CLASSNAME_PROVIDERCAPABILITIES, false, false,                      PEGASUS_CLASSNAME_PROVIDERCAPABILITIES, false, false);
                     false);  
             }             }
             Array<CIMInstance> capabilitiesForProvider;             Array<CIMInstance> capabilitiesForProvider;
             Array<CIMNamespaceName> namespacesForProvider;             Array<CIMNamespaceName> namespacesForProvider;
Line 581 
Line 614 
                         continue;                         continue;
  
                     // See if the current namespaces are already listed                     // See if the current namespaces are already listed
                     for (Sint32 z = 0, y = curNamespaces.size(); z < y; ++z)                      for (Sint32 w = 0; w < y; ++w)
                     {                     {
                         Sint32 foundIndex = -1;                         Sint32 foundIndex = -1;
                         CIMNamespaceName curNamespace = curNamespaces[z];                          CIMNamespaceName curNamespace = curNamespaces[w];
                         Uint32 k = 0;                         Uint32 k = 0;
                         Uint32 x = namespacesForProvider.size();                         Uint32 x = namespacesForProvider.size();
                         for (; k < x; ++k)                         for (; k < x; ++k)


Legend:
Removed from v.1.6  
changed lines
  Added in v.1.12.6.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2