version 1.7, 2008/08/07 18:03:53
|
version 1.12.6.2, 2013/06/03 22:35:54
|
|
|
//%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. |
|
// | // |
//============================================================================= |
////////////////////////////////////////////////////////////////////////// |
// | // |
//%//////////////////////////////////////////////////////////////////////////// | //%//////////////////////////////////////////////////////////////////////////// |
| |
|
|
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( |
|
|
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; |
} | } |
|
|
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) |
{ | { |
|
|
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]); | instances.append(profiles[i]); |
} | } |
} | } |
|
else if (profileName != SMISProfileName) |
|
{ |
|
instances.append(profiles[i]); |
|
} |
|
} |
|
} |
return instances; | return instances; |
} | } |
| |
|
|
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 |
{ | { |
|
|
true, | true, |
false, | false, |
false, | false, |
false, |
|
CIMPropertyList(propList)); | CIMPropertyList(propList)); |
| |
CIMClass elementConformsClass = repository->getClass( | CIMClass elementConformsClass = repository->getClass( |
|
|
capPropList.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; |