version 1.2.4.1, 2007/01/19 19:25:31
|
version 1.2.4.2, 2008/02/22 21:49:57
|
|
|
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// | // |
//============================================================================== |
//============================================================================= |
| |
| |
/////////////////////////////////////////////////////////////////////////////// | /////////////////////////////////////////////////////////////////////////////// |
|
|
return tmpInstance; | return tmpInstance; |
} | } |
| |
|
Array<CIMInstance> InteropProvider::enumElementConformsToProfileRPRPInstances( |
|
const OperationContext & opContext, |
|
const CIMNamespaceName & opNamespace) |
|
{ |
|
CIMClass elementConformsClass = repository->getClass( |
|
PEGASUS_NAMESPACENAME_INTEROP, |
|
PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE_RP_RP, |
|
false, true, false); |
|
|
|
Array<CIMInstance> instances; |
|
CIMObjectPath smisVersionProfile, profRegProfile; |
|
|
|
if (opNamespace == PEGASUS_NAMESPACENAME_INTEROP) |
|
{ |
|
//Add associations between the 1.2 SMIS-Version profile and all |
|
//the version 1.2.0 profiles and subprofiles. |
|
smisVersionProfile = buildDependencyReference( |
|
hostName, |
|
buildProfileInstanceId(SNIA_NAME, "SMI-S", SNIA_VER_120), |
|
PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE); |
|
|
|
Array<CIMInstance> profileInstances = |
|
enumRegisteredProfileInstances(); |
|
Array<CIMInstance> subprofileInstances = |
|
enumRegisteredSubProfileInstances(); |
|
profileInstances.appendArray(subprofileInstances); |
|
Array<CIMInstance> profilesForVersion = getProfilesForVersion( |
|
profileInstances, |
|
SNIA_VER_120); |
|
for (Uint32 i = 0, n = profilesForVersion.size(); i < n; ++i) |
|
{ |
|
instances.append(buildElementConformsToProfile( |
|
smisVersionProfile, |
|
profilesForVersion[i].getPath(), |
|
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; |
|
} |
|
|
// | // |
// Enumerates all of the ElementConformsToProfile association instances. | // Enumerates all of the ElementConformsToProfile association instances. |
// | // |
|
|
CIMInstance & currentInstance = | CIMInstance & currentInstance = |
elementConformsInstances[k]; | elementConformsInstances[k]; |
| |
|
// NOCHKSRC |
// Make sure that the current instance points to the | // Make sure that the current instance points to the |
// current profile ID. | // current profile ID. |
CIMObjectPath profilePath = | CIMObjectPath profilePath = |
getRequiredValue<CIMObjectPath>( | getRequiredValue<CIMObjectPath>( |
elementConformsInstances[k], | elementConformsInstances[k], |
ELEMENTCONFORMSTOPROFILE_PROPERTY_CONFORMANTSTANDARD); | ELEMENTCONFORMSTOPROFILE_PROPERTY_CONFORMANTSTANDARD); |
|
// DOCHKSRC |
const Array<CIMKeyBinding> & keys = | const Array<CIMKeyBinding> & keys = |
profilePath.getKeyBindings(); | profilePath.getKeyBindings(); |
if(keys.size() != 1) | if(keys.size() != 1) |
continue; | continue; |
if(keys.size() == 1 && keys[0].getValue() == profileId) | if(keys.size() == 1 && keys[0].getValue() == profileId) |
{ | { |
|
// NOCHKSRC |
conformingElementPaths.append( | conformingElementPaths.append( |
getRequiredValue<CIMObjectPath>( | getRequiredValue<CIMObjectPath>( |
currentInstance, | currentInstance, |
ELEMENTCONFORMSTOPROFILE_PROPERTY_MANAGEDELEMENT)); | ELEMENTCONFORMSTOPROFILE_PROPERTY_MANAGEDELEMENT)); |
|
// DOCHKSRC |
} | } |
} | } |
} | } |
|
|
// and the ObjectManager (if we're in the Interop namespace) | // and the ObjectManager (if we're in the Interop namespace) |
if(opNamespace == PEGASUS_NAMESPACENAME_INTEROP) | if(opNamespace == PEGASUS_NAMESPACENAME_INTEROP) |
{ | { |
// Build up the Object Path for the server profile |
// Build up the Object Path for the server profile version 1.1.0 |
CIMObjectPath serverProfile = buildDependencyReference(hostName, |
CIMObjectPath serverProfile = buildDependencyReference( |
|
hostName, |
buildProfileInstanceId(SNIA_NAME, "Server", SNIA_VER_110), | buildProfileInstanceId(SNIA_NAME, "Server", SNIA_VER_110), |
PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE); | PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE); |
// Retrieve the Object Manager instance | // Retrieve the Object Manager instance |
CIMInstance objManager = getObjectManagerInstance(); | CIMInstance objManager = getObjectManagerInstance(); |
| |
instances.append(buildElementConformsToProfile(serverProfile, |
instances.append( |
objManager.getPath(), elementConformsClass)); |
buildElementConformsToProfile( |
} |
serverProfile, |
|
objManager.getPath(), |
|
elementConformsClass)); |
|
|
|
// Build up the Object Path for the server profile ver 1.2.0 |
|
// and add the elementconformstoprofile association instance |
|
serverProfile = buildDependencyReference( |
|
hostName, |
|
buildProfileInstanceId(SNIA_NAME, "Server", SNIA_VER_120), |
|
PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE); |
|
instances.append( |
|
buildElementConformsToProfile( |
|
serverProfile, |
|
objManager.getPath(), |
|
elementConformsClass)); |
| |
|
} |
return instances; | return instances; |
} | } |
| |
|
//Method that filters the registered profile or registered subprofile instances |
|
//for the SMI-S version. |
|
Array<CIMInstance> InteropProvider::getProfilesForVersion( |
|
Array<CIMInstance>& profiles, |
|
const String version) |
|
{ |
|
Array<CIMInstance> instances; |
|
instances.clear(); |
|
for (Uint32 i = 0, n = profiles.size(); i < n; ++i) |
|
{ |
|
String versionNumber; |
|
String profileName; |
|
Uint32 index = profiles[i].findProperty("RegisteredVersion"); |
|
if (index != PEG_NOT_FOUND) |
|
{ |
|
const CIMValue &tmpVal = profiles[i].getProperty(index).getValue(); |
|
if (!tmpVal.isNull()) |
|
{ |
|
tmpVal.get(versionNumber); |
|
} |
|
} |
|
index = profiles[i].findProperty("RegisteredName"); |
|
if (index != PEG_NOT_FOUND) |
|
{ |
|
const CIMValue &tmpVal = profiles[i].getProperty(index).getValue(); |
|
if (!tmpVal.isNull()) |
|
{ |
|
tmpVal.get(profileName); |
|
} |
|
} |
|
|
|
if ((versionNumber == version) && (profileName != String("SMI-S"))) |
|
{ |
|
instances.append(profiles[i]); |
|
} |
|
} |
|
return instances; |
|
} |
| |
typedef Array<String> StringArray; | typedef Array<String> StringArray; |
| |