version 1.13, 2008/12/01 17:50:33
|
version 1.15.4.2, 2014/03/14 17:30:21
|
|
|
#include "InteropProvider.h" | #include "InteropProvider.h" |
#include "InteropProviderUtils.h" | #include "InteropProviderUtils.h" |
#include "InteropConstants.h" | #include "InteropConstants.h" |
|
#include <Pegasus/Common/ArrayIterator.h> |
| |
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
|
|
setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CLASSTYPE, | setPropertyValue(instance, CIM_NAMESPACE_PROPERTY_CLASSTYPE, |
Uint16(2)); | Uint16(2)); |
| |
|
|
// | // |
// Everything above was commmon to CIM Namespace. The following are | // Everything above was commmon to CIM Namespace. The following are |
// PG_Namespace Properties | // PG_Namespace Properties |
|
|
return instance; | return instance; |
} | } |
| |
|
CIMInstance InteropProvider::getNameSpaceInstance( |
|
const CIMObjectPath & ref) |
|
{ |
|
PEG_METHOD_ENTER(TRC_CONTROLPROVIDER, |
|
"getNameSpaceInstance()"); |
|
Array<CIMKeyBinding> keyBindings = ref.getKeyBindings(); |
|
ConstArrayIterator<CIMKeyBinding> keyIter(keyBindings); |
|
String name; |
|
|
|
for (Uint32 i = 0; i < keyIter.size(); i++) |
|
{ |
|
if (keyIter[i].getName().equal(CIM_NAMESPACE_PROPERTY_NAME)) |
|
{ |
|
name = keyIter[i].getValue(); |
|
break; |
|
} |
|
} |
|
|
|
if(repository->nameSpaceExists(name)) |
|
{ |
|
CIMInstance newInst = buildNamespaceInstance(name); |
|
if( newInst.getPath() != ref ) |
|
{ |
|
throw CIMObjectNotFoundException(ref.toString()); |
|
} |
|
PEG_METHOD_EXIT(); |
|
return newInst; |
|
} |
|
|
|
PEG_METHOD_EXIT(); |
|
throw CIMObjectNotFoundException(ref.toString()); |
|
} |
|
|
// | // |
// Function that takes an instance of the CIM_Namespace class, checks whether | // Function that takes an instance of the CIM_Namespace class, checks whether |
// the key properties are present, | // the key properties are present, |
|
|
CIMRepository::NameSpaceAttributes attributes; | CIMRepository::NameSpaceAttributes attributes; |
| |
// Set shareable attribute to "false" if property is not present | // Set shareable attribute to "false" if property is not present |
Boolean shareable = false; |
|
if (getPropertyValue(namespaceInstance, | if (getPropertyValue(namespaceInstance, |
PG_NAMESPACE_PROPERTY_ISSHAREABLE, false)) | PG_NAMESPACE_PROPERTY_ISSHAREABLE, false)) |
{ | { |
|
|
} | } |
| |
// Set updatesAllowed attribute to "false" if property is not present | // Set updatesAllowed attribute to "false" if property is not present |
Boolean updatesAllowed = false; |
|
if (getPropertyValue(namespaceInstance, | if (getPropertyValue(namespaceInstance, |
PG_NAMESPACE_PROPERTY_SCHEMAUPDATESALLOWED, false)) | PG_NAMESPACE_PROPERTY_SCHEMAUPDATESALLOWED, false)) |
{ | { |
|
|
PEG_TRACE(( | PEG_TRACE(( |
TRC_CONTROLPROVIDER, | TRC_CONTROLPROVIDER, |
Tracer::LEVEL4, | Tracer::LEVEL4, |
"Namespace %s: Shareable = %s, Updates allowed: %s, Parent: %s" |
"Namespace %s: Parent: %s" |
" successfully created.", | " successfully created.", |
(const char*) newNamespaceName.getString().getCString(), | (const char*) newNamespaceName.getString().getCString(), |
shareable? "true" : "false", |
|
updatesAllowed? "true" : "false", |
|
(const char*) parent.getCString())); | (const char*) parent.getCString())); |
| |
return newInstanceReference; | return newInstanceReference; |