summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkarl <karl>2005-08-10 15:23:21 +0000
committerkarl <karl>2005-08-10 15:23:21 +0000
commit56e9c6b760ea677247998934cb3eacb404bcd9c8 (patch)
tree6e7df879fc2cbdb87cce3ecda4099c6bed2fe620 /src
parent4c9b04192352162d148e6b377d1f040291641094 (diff)
downloadtog-pegasus-56e9c6b760ea677247998934cb3eacb404bcd9c8.zip
tog-pegasus-56e9c6b760ea677247998934cb3eacb404bcd9c8.tar.gz
tog-pegasus-56e9c6b760ea677247998934cb3eacb404bcd9c8.tar.xz
BUG#: 4061
TITLE: Property Value Error in CIM_Namespace DESCRIPTION: a property was assigned a fixed value rather than the name of CIMOM as is defined in the MOF. Updated to get the persistent CIMOM name and set it into the property value.
Diffstat (limited to 'src')
-rw-r--r--src/Pegasus/ControlProviders/InteropProvider/InteropProvider.cpp60
-rw-r--r--src/Pegasus/ControlProviders/InteropProvider/InteropProvider.h8
2 files changed, 49 insertions, 19 deletions
diff --git a/src/Pegasus/ControlProviders/InteropProvider/InteropProvider.cpp b/src/Pegasus/ControlProviders/InteropProvider/InteropProvider.cpp
index 87073cd..786423b 100644
--- a/src/Pegasus/ControlProviders/InteropProvider/InteropProvider.cpp
+++ b/src/Pegasus/ControlProviders/InteropProvider/InteropProvider.cpp
@@ -617,8 +617,7 @@ Boolean _checkRequiredProperty(CIMInstance& instance,
const CIMType expectedType,
const String & message)
{
-
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
"_checkRequiredProperty");
Boolean propertyError = false;
@@ -1076,8 +1075,6 @@ String buildObjectManagerName()
@return Boolean true if already exists. False if
not initialized. Also returns with the current version set
into local parameter.
- ATTN: Probably should get rid of the local parameter since
- this is used so infrequently, waste of space.
*/
Boolean InteropProvider::_getInstanceFromRepositoryCIMObjectManager(
const CIMObjectPath& objectPath,
@@ -1087,7 +1084,7 @@ Boolean InteropProvider::_getInstanceFromRepositoryCIMObjectManager(
const CIMPropertyList& propertyList)
{
PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
- "InteropProvider::_getInstanceCIMObjectManager");
+ "InteropProvider::_getInstanceFromRepositoryCIMObjectManager");
// Try to get persistent instance from repository
Array<CIMInstance> instances;
@@ -1139,7 +1136,7 @@ Boolean InteropProvider::_getInstanceFromRepositoryCIMObjectManager(
}
}
-/** build an instance of the CIM_ObjectManager class filling out
+/** get an instance of the CIM_ObjectManager class filling out
the required properties if one does not already exist in the
repository. This function will either return an instance
or throw an exception.
@@ -1175,7 +1172,9 @@ CIMInstance InteropProvider::_getInstanceCIMObjectManager(
_setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CREATIONCLASSNAME,
CIM_OBJECTMANAGER_CLASSNAME.getString());
- _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_NAME,buildObjectManagerName());
+
+ _objectManagerName = buildObjectManagerName();
+ _setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_NAME,_objectManagerName);
_setPropertyValue(instance, CIMName("ElementName"), String("Pegasus"));
//
@@ -1204,11 +1203,8 @@ CIMInstance InteropProvider::_getInstanceCIMObjectManager(
_setPropertyValue(instance, OM_GATHERSTATISTICALDATA, Boolean(gatherStatDataFlag));
- // ATTN: This one is a problem KS rethink this.
- // the following is a temporary hack to set the value of the statistics
- // gathering function dynamically. We simply get the correct value
- // and call the internal method to set it each time this object is
- // built.
+ // Set the statistics property into the Statisticaldata class so that
+ // it can perform statistics gathering if necessary.
#ifndef PEGASUS_DISABLE_PERFINST
StatisticalData* sd = StatisticalData::current();
sd->setCopyGSD(gatherStatDataFlag);
@@ -1240,6 +1236,36 @@ CIMInstance InteropProvider::_getInstanceCIMObjectManager(
return(instance);
}
+/** getObjectNamagerName returns the name property for this object manager
+ return String name of this object manager. This is a convience function
+ to deliver only the name field from the CIM_ObjectManager object.
+ If the object Manager has been created and the name saved in this
+ provider, that name is returned. Else it calls the function to
+ get the instance of the Object Manager.
+ @return String containing the persistent name property for this
+ object manager
+
+*/
+
+String InteropProvider::_getObjectManagerName()
+{
+ if (_objectManagerName != String::EMPTY)
+ {
+ return _objectManagerName;
+ }
+ else
+ {
+ CIMObjectPath path;
+ path.setNameSpace(PEGASUS_NAMESPACENAME_INTEROP);
+ CIMInstance instance = _getInstanceCIMObjectManager(path, true, true, CIMPropertyList());
+ // get the property name.
+ String name = _getPropertyValue(instance, CIM_NAMESPACE_PROPERTY_NAME,
+ String::EMPTY);
+ return name;
+ }
+
+}
+
/** Get the instances of CIM_Namespace. Gets all instances of the namespace from
the repository namespace management functions. Builds instances that
match all of the request attributes.
@@ -1386,7 +1412,7 @@ CIMInstance InteropProvider::_buildInstancePGNamespace(const CIMObjectPath& obje
// ATTN: KS need to get the real objectManager name from elsewhere. the only place
// this exists is through the objectmanager object.
- String ObjectManagerName = "ObjectManagerNameValue";
+ String ObjectManagerName = _getObjectManagerName();
CIMClass targetClass;
CIMInstance instance = _buildInstanceSkeleton(objectPath, PG_NAMESPACE_CLASSNAME,
@@ -2366,7 +2392,7 @@ void InteropProvider::modifyObjectManagerInstance(const OperationContext & conte
ResponseHandler & handler)
{
PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
- "InteropProvider::modifyInstanceManagerInstance");
+ "InteropProvider::modifyObjectManagerInstance");
// the only allowed modification is this one property, statistical data
@@ -2619,9 +2645,9 @@ void InteropProvider::associators(
ObjectResponseHandler & handler)
{
PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
- "InteropProvider::associatorNames()");
+ "InteropProvider::associators()");
Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
- "%s associatorNames. objectName= %s , assocClass= %s resultClass= %s role= %s resultRole %includeQualifiers= %s, includeClassOrigin= %s, PropertyList= %s",
+ "%s associators. objectName= %s , assocClass= %s resultClass= %s role= %s resultRole %includeQualifiers= %s, includeClassOrigin= %s, PropertyList= %s",
thisProvider,
(const char *)objectName.toString().getCString(),
(const char *)associationClass.getString().getCString(),
@@ -2765,7 +2791,7 @@ Array<CIMObject> InteropProvider::localReferences(
{
PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,
- "InteropProvider::references()");
+ "InteropProvider::localReferences()");
Tracer::trace(TRC_CONTROLPROVIDER, Tracer::LEVEL4,
"%s references. objectName= %s , resultClass= %s role= %s includeQualifiers= %s, includeClassOrigin= %s, PropertyList= %s",
thisProvider,
diff --git a/src/Pegasus/ControlProviders/InteropProvider/InteropProvider.h b/src/Pegasus/ControlProviders/InteropProvider/InteropProvider.h
index 661b62e..0ee337a 100644
--- a/src/Pegasus/ControlProviders/InteropProvider/InteropProvider.h
+++ b/src/Pegasus/ControlProviders/InteropProvider/InteropProvider.h
@@ -234,6 +234,8 @@ private:
const Boolean includeClassOrigin,
const CIMPropertyList& propertyList);
+ String _getObjectManagerName();
+
Array<CIMInstance> _getInstancesCIMNamespace(
const CIMObjectPath& objectPath);
@@ -289,9 +291,11 @@ private:
const Boolean includeQualifiers,
const Boolean includeClassOrigin,
const CIMPropertyList & propertyList);
- // Repository Instance variable
- //
+
+ // Repository Instance variable
CIMRepository* _repository;
+ // local save for name of object manager
+ String _objectManagerName;
};
PEGASUS_NAMESPACE_END