version 1.72, 2008/02/20 14:00:31
|
version 1.75, 2008/05/16 06:26:48
|
|
|
// | // |
InteropProvider::InteropProvider(CIMRepository * rep) : repository(rep), | InteropProvider::InteropProvider(CIMRepository * rep) : repository(rep), |
hostName(System::getHostName()), providerInitialized(false), | hostName(System::getHostName()), providerInitialized(false), |
|
updateProfileCache(0), |
profileIds(Array<String>()), conformingElements(Array<CIMNameArray>()), | profileIds(Array<String>()), conformingElements(Array<CIMNameArray>()), |
elementNamespaces(Array<CIMNamespaceArray>()) | elementNamespaces(Array<CIMNamespaceArray>()) |
{ | { |
|
|
CIMNamespaceName opNamespace = instanceName.getNameSpace(); | CIMNamespaceName opNamespace = instanceName.getNameSpace(); |
CIMName opClass = instanceName.getClassName(); | CIMName opClass = instanceName.getClassName(); |
if(opNamespace != PEGASUS_NAMESPACENAME_INTEROP && | if(opNamespace != PEGASUS_NAMESPACENAME_INTEROP && |
opClass != PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE) |
opClass != PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE |
|
// Get CIM_IndicationService instance from IndicationService. |
|
#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT |
|
|| opClass == PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE |
|
#endif |
|
) |
{ | { |
AutoMutex mut(interopMut); | AutoMutex mut(interopMut); |
CIMInstance gotInstance = cimomHandle.getInstance( | CIMInstance gotInstance = cimomHandle.getInstance( |
|
|
instances = enumHostedAccessPointInstances(); | instances = enumHostedAccessPointInstances(); |
break; | break; |
} | } |
|
//We don't support enumerate CIM_Namespace instances. PG_Namespace is |
|
//supported. |
|
case CIM_NAMESPACE: |
|
{ |
|
break; |
|
} |
|
case PG_PROVIDERPROFILECAPABILITIES: |
|
{ |
|
instances = enumProviderProfileCapabilityInstances(false, false); |
|
break; |
|
} |
|
|
|
#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT |
|
case PG_ELEMENTCAPABILITIES: |
|
{ |
|
instances = enumElementCapabilityInstances(context); |
|
break; |
|
} |
|
case PG_HOSTEDINDICATIONSERVICE: |
|
{ |
|
instances = enumHostedIndicationServiceInstances(context); |
|
break; |
|
} |
|
case PG_SERVICEAFFECTSELEMENT: |
|
{ |
|
instances = enumServiceAffectsElementInstances(context); |
|
break; |
|
} |
|
#endif |
default: | default: |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
throw CIMNotSupportedException(className.getString() + | throw CIMNotSupportedException(className.getString() + |
|
|
context, | context, |
objectName, | objectName, |
propertyList); | propertyList); |
|
if (!tmpInstance.isUninitialized()) |
|
{ |
index = tmpInstance.findProperty("RegisteredName"); | index = tmpInstance.findProperty("RegisteredName"); |
if (index != PEG_NOT_FOUND) | if (index != PEG_NOT_FOUND) |
{ | { |
|
|
tmpVal.get(profileName); | tmpVal.get(profileName); |
} | } |
} | } |
|
} |
if (String::compareNoCase(profileName, String("SMI-S")) == 0) | if (String::compareNoCase(profileName, String("SMI-S")) == 0) |
{ | { |
expectedTargetRole = | expectedTargetRole = |
|
|
expectedOriginRole = PROPERTY_DEPENDENT; | expectedOriginRole = PROPERTY_DEPENDENT; |
} | } |
break; | break; |
|
#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT |
|
case PG_HOSTEDINDICATIONSERVICE: |
|
if(originClassEnum == PG_COMPUTERSYSTEM) |
|
{ |
|
expectedTargetRole = PROPERTY_DEPENDENT; |
|
expectedOriginRole = PROPERTY_ANTECEDENT; |
|
} |
|
break; |
|
#endif |
default: | default: |
break; | break; |
} | } |
|
|
profileCapabilitiesClass = repository->getClass( | profileCapabilitiesClass = repository->getClass( |
PEGASUS_NAMESPACENAME_INTEROP, | PEGASUS_NAMESPACENAME_INTEROP, |
PEGASUS_CLASSNAME_PG_PROVIDERPROFILECAPABILITIES, | PEGASUS_CLASSNAME_PG_PROVIDERPROFILECAPABILITIES, |
false, true, false); |
false, |
|
true, |
|
false); |
| |
providerClassifications.append(Uint16(5)); // "Instrumentation" | providerClassifications.append(Uint16(5)); // "Instrumentation" |
| |
|
// initialize namespaces. |
|
initializeNamespaces(); |
|
|
|
// Now cache the Registration info used for ElementConformsToProfile |
|
cacheProfileRegistrationInfo(); |
|
|
|
providerInitialized = true; |
|
} |
|
PEG_METHOD_EXIT(); |
|
} |
|
|
// | // |
// Initialize the namespaces so that all namespaces with the | // Initialize the namespaces so that all namespaces with the |
// CIM_ElementConformsToProfile class also have the | // CIM_ElementConformsToProfile class also have the |
|
|
// the cross-namespace ElementConformsToProfile association in both | // the cross-namespace ElementConformsToProfile association in both |
// directions. | // directions. |
// | // |
Array<CIMNamespaceName> namespaceNames = |
void InteropProvider::initializeNamespaces() |
repository->enumerateNameSpaces(); |
{ |
|
Array<CIMNamespaceName> namespaceNames = repository->enumerateNameSpaces(); |
// get the PG_ElementConformstoProfile class without the qualifiers | // get the PG_ElementConformstoProfile class without the qualifiers |
// and then add just the required ASSOCIATION qualifier, so that | // and then add just the required ASSOCIATION qualifier, so that |
// resolveclass doesn't fail for the test/EmbeddedInstance/Dynamic | // resolveclass doesn't fail for the test/EmbeddedInstance/Dynamic |
|
|
// the CIMSchema. | // the CIMSchema. |
CIMClass conformsClass = repository->getClass( | CIMClass conformsClass = repository->getClass( |
PEGASUS_NAMESPACENAME_INTEROP, | PEGASUS_NAMESPACENAME_INTEROP, |
PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE, true, false); |
PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE, |
conformsClass.addQualifier(CIMQualifier(CIMName("ASSOCIATION"), |
true, |
CIMValue(true))); |
false); |
|
conformsClass.addQualifier( |
|
CIMQualifier(CIMName("ASSOCIATION"), CIMValue(true))); |
CIMClass profileClass = repository->getClass( | CIMClass profileClass = repository->getClass( |
PEGASUS_NAMESPACENAME_INTEROP, | PEGASUS_NAMESPACENAME_INTEROP, |
PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE, true, false); |
PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE, |
|
true, |
|
false); |
for(Uint32 i = 0, n = namespaceNames.size(); i < n; ++i) | for(Uint32 i = 0, n = namespaceNames.size(); i < n; ++i) |
{ | { |
// Check if the PG_ElementConformsToProfile class is present | // Check if the PG_ElementConformsToProfile class is present |
|
|
{ | { |
// Look for these classes in the same try-block since the | // Look for these classes in the same try-block since the |
// second depends on the first | // second depends on the first |
tmpCimClass = repository->getClass(currentNamespace, |
tmpCimClass = repository->getClass( |
|
currentNamespace, |
PEGASUS_CLASSNAME_CIM_ELEMENTCONFORMSTOPROFILE); | PEGASUS_CLASSNAME_CIM_ELEMENTCONFORMSTOPROFILE); |
tmpPgClass = repository->getClass(currentNamespace, |
tmpPgClass = repository->getClass( |
|
currentNamespace, |
PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE); | PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE); |
} | } |
catch(const Exception &) | catch(const Exception &) |
|
|
} | } |
try | try |
{ | { |
tmpPgProfileClass = repository->getClass(currentNamespace, |
tmpPgProfileClass = repository->getClass( |
|
currentNamespace, |
PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE); | PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE); |
} | } |
catch(const Exception &) | catch(const Exception &) |
|
|
CIMObjectPath newPath = conformsClass.getPath(); | CIMObjectPath newPath = conformsClass.getPath(); |
newPath.setNameSpace(currentNamespace); | newPath.setNameSpace(currentNamespace); |
newclass.setPath(newPath); | newclass.setPath(newPath); |
repository->createClass(currentNamespace, |
repository->createClass( |
|
currentNamespace, |
newclass); | newclass); |
} | } |
if(tmpPgProfileClass.isUninitialized()) | if(tmpPgProfileClass.isUninitialized()) |
|
|
CIMObjectPath newPath = profileClass.getPath(); | CIMObjectPath newPath = profileClass.getPath(); |
newPath.setNameSpace(currentNamespace); | newPath.setNameSpace(currentNamespace); |
newclass.setPath(newPath); | newclass.setPath(newPath); |
repository->createClass(currentNamespace, |
repository->createClass( |
|
currentNamespace, |
newclass); | newclass); |
} | } |
} | } |
} | } |
|
|
// Now cache the Registration info used for ElementConformsToProfile |
|
cacheProfileRegistrationInfo(); |
|
|
|
providerInitialized = true; |
|
} |
|
|
|
PEG_METHOD_EXIT(); |
|
} | } |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |