OW_NAMESPACE::InstanceRepository Class Reference

#include <OW_InstanceRepository.hpp>

Inheritance diagram for OW_NAMESPACE::InstanceRepository:

Inheritance graph
[legend]
Collaboration diagram for OW_NAMESPACE::InstanceRepository:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 InstanceRepository ()
 Create a new InstanceRepository object.
void getCIMInstances (const String &ns, const String &className, const CIMClass &requestedClass, const CIMClass &theClass, CIMInstanceResultHandlerIFC &result, WBEMFlags::EDeepFlag deep, WBEMFlags::ELocalOnlyFlag localOnly, WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, const StringArray *propertyList=NULL)
void getInstanceNames (const String &ns, const CIMClass &theClass, CIMObjectPathResultHandlerIFC &result)
CIMInstance getCIMInstance (const String &ns, const CIMObjectPath &instanceName, const CIMClass &theClass, WBEMFlags::ELocalOnlyFlag localOnly, WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, const StringArray *propertyList)
 Retrieve a specific instance.
void deleteInstance (const String &ns, const CIMObjectPath &cop, const CIMClass &theClass)
 Delete an existing instance from the store.
void createInstance (const String &ns, const CIMClass &theClass, const CIMInstance &ci)
 Creates a instance in the store.
void modifyInstance (const String &ns, const CIMObjectPath &cop, const CIMClass &theClass, const CIMInstance &ci, const CIMInstance &oldInst, WBEMFlags::EIncludeQualifiersFlag includeQualifiers, const StringArray *propertyList)
 Update an instance.
bool classHasInstances (const CIMObjectPath &classPath)
 Determin if a given class has instances.
void deleteNameSpace (const String &nsName)
 Delete the given namespace and all object contained within it.
virtual int createNameSpace (const String &ns)
 Create the necessary containers to make a valid path.
void createClass (const String &ns, const CIMClass &cimClass)
 Ensure there is a container for a given class in the instance repository.
void deleteClass (const String &ns, const String &className)
 Remove the class name container for a given class.

Private Member Functions

String makeClassKey (const String &ns, const String &className)
String makeInstanceKey (const String &ns, const CIMObjectPath &cop, const CIMClass &theClass)
void _removeDuplicatedQualifiers (CIMInstance &inst, const CIMClass &theClass)

Detailed Description

Definition at line 47 of file OW_InstanceRepository.hpp.


Constructor & Destructor Documentation

OW_NAMESPACE::InstanceRepository::InstanceRepository  )  [inline]
 

Create a new InstanceRepository object.

Definition at line 53 of file OW_InstanceRepository.hpp.


Member Function Documentation

void OW_NAMESPACE::InstanceRepository::_removeDuplicatedQualifiers CIMInstance inst,
const CIMClass theClass
[private]
 

Definition at line 487 of file OW_InstanceRepository.cpp.

References OW_NAMESPACE::CIMClass::getQualifier(), OW_NAMESPACE::CIMInstance::getQualifiers(), OW_NAMESPACE::CIMQualifier::getValue(), inst, and theClass.

Referenced by createInstance().

bool OW_NAMESPACE::InstanceRepository::classHasInstances const CIMObjectPath classPath  ) 
 

Determin if a given class has instances.

Parameters:
classPath The object path for the class to check.
Returns:
true if the class specified has instances.

Definition at line 339 of file OW_InstanceRepository.cpp.

References OW_NAMESPACE::CIMObjectPath::getClassName(), OW_NAMESPACE::GenericHDBRepository::getHandle(), OW_NAMESPACE::CIMObjectPath::getNameSpace(), OW_NAMESPACE::HDBCLSNODE_FLAG, hdl, makeClassKey(), OW_THROW, and OW_NAMESPACE::GenericHDBRepository::throwIfNotOpen().

void OW_NAMESPACE::InstanceRepository::createClass const String ns,
const CIMClass cimClass
 

Ensure there is a container for a given class in the instance repository.

Parameters:
ns The namespace for the class
cimClass The class to create a container for

Definition at line 444 of file OW_InstanceRepository.cpp.

References OW_NAMESPACE::CIMException::ALREADY_EXISTS, OW_NAMESPACE::String::c_str(), cimClass, OW_NAMESPACE::GenericHDBRepository::getHandle(), OW_NAMESPACE::CIMClass::getName(), OW_NAMESPACE::GenericHDBRepository::getNameSpaceNode(), OW_NAMESPACE::HDBCLSNODE_FLAG, OW_NAMESPACE::HDBNSNODE_FLAG, hdl, OW_NAMESPACE::CIMException::INVALID_NAMESPACE, makeClassKey(), ns, OW_THROWCIMMSG, and OW_NAMESPACE::GenericHDBRepository::throwIfNotOpen().

void OW_NAMESPACE::InstanceRepository::createInstance const String ns,
const CIMClass theClass,
const CIMInstance ci
 

Creates a instance in the store.

Parameters:
cop The CIMObectPath that specifies the instance
ci The instance that is to be stored with that object path
Returns:
The object path of the newly added CIMInstance. This will be cop + the keys from ci.
Exceptions:
HDBException 
CIMException 
IOException 

Definition at line 309 of file OW_InstanceRepository.cpp.

References _removeDuplicatedQualifiers(), OW_NAMESPACE::CIMException::ALREADY_EXISTS, OW_NAMESPACE::String::c_str(), OW_NAMESPACE::CIMInstance::getClassName(), OW_NAMESPACE::GenericHDBRepository::getHandle(), OW_NAMESPACE::GenericHDBRepository::getNameSpaceNode(), hdl, OW_NAMESPACE::CIMException::INVALID_CLASS, makeClassKey(), makeInstanceKey(), ns, ostrm, OW_THROWCIMMSG, theClass, OW_NAMESPACE::GenericHDBRepository::throwIfNotOpen(), and OW_NAMESPACE::CIMInstance::writeObject().

int OW_NAMESPACE::InstanceRepository::createNameSpace const String ns  )  [virtual]
 

Create the necessary containers to make a valid path.

Fail if the last container already exists.

Parameters:
ns The name of the namespace
Returns:
0 on success. Otherwise -1 if the bottom most container already exists.

Reimplemented from OW_NAMESPACE::GenericHDBRepository.

Definition at line 435 of file OW_InstanceRepository.cpp.

References OW_NAMESPACE::GenericHDBRepository::createNameSpace(), and ns.

void OW_NAMESPACE::InstanceRepository::deleteClass const String ns,
const String className
 

Remove the class name container for a given class.

Parameters:
ns The namespace that contains the class
className The name of the class container to remove.

Definition at line 468 of file OW_InstanceRepository.cpp.

References OW_NAMESPACE::HDBNode::areAllFlagsOn(), className, OW_NAMESPACE::GenericHDBRepository::getHandle(), OW_NAMESPACE::HDBCLSNODE_FLAG, hdl, makeClassKey(), ns, OW_THROW, and OW_NAMESPACE::GenericHDBRepository::throwIfNotOpen().

void OW_NAMESPACE::InstanceRepository::deleteInstance const String ns,
const CIMObjectPath cop,
const CIMClass theClass
 

Delete an existing instance from the store.

Parameters:
cop The CIMObectPath that specifies the instance
theClass The CIM class of the instance to delete
Exceptions:
HDBException 
CIMException 
IOException 

Definition at line 288 of file OW_InstanceRepository.cpp.

References OW_NAMESPACE::String::c_str(), OW_NAMESPACE::CIMNULL, cop, OW_NAMESPACE::GenericHDBRepository::getHandle(), hdl, makeInstanceKey(), OW_NAMESPACE::GenericHDBRepository::nodeToCIMObject(), OW_NAMESPACE::CIMException::NOT_FOUND, ns, OW_THROWCIMMSG, OW_NAMESPACE::CIMObjectPath::setNameSpace(), theClass, OW_NAMESPACE::GenericHDBRepository::throwIfNotOpen(), and OW_NAMESPACE::CIMObjectPath::toString().

void OW_NAMESPACE::InstanceRepository::deleteNameSpace const String nsName  ) 
 

Delete the given namespace and all object contained within it.

Parameters:
nsName The name of the namespace

Reimplemented from OW_NAMESPACE::GenericHDBRepository.

Definition at line 427 of file OW_InstanceRepository.cpp.

References OW_NAMESPACE::GenericHDBRepository::deleteNameSpace(), and OW_NAMESPACE::GenericHDBRepository::throwIfNotOpen().

CIMInstance OW_NAMESPACE::InstanceRepository::getCIMInstance const String ns,
const CIMObjectPath instanceName,
const CIMClass theClass,
WBEMFlags::ELocalOnlyFlag  localOnly,
WBEMFlags::EIncludeQualifiersFlag  includeQualifiers,
WBEMFlags::EIncludeClassOriginFlag  includeClassOrigin,
const StringArray propertyList
 

Retrieve a specific instance.

Parameters:
ns The namespace
instanceName The CIMObectPath that specifies the instance
theClass The CIM class of the instance to retrieve
Returns:
An CIMInstance object
Exceptions:
HDBException 
CIMException 
IOException 

Definition at line 252 of file OW_InstanceRepository.cpp.

References OW_NAMESPACE::String::c_str(), OW_NAMESPACE::CIMNULL, cop, OW_NAMESPACE::WBEMFlags::E_EXCLUDE_CLASS_ORIGIN, OW_NAMESPACE::WBEMFlags::E_EXCLUDE_QUALIFIERS, OW_NAMESPACE::WBEMFlags::E_INCLUDE_QUALIFIERS, OW_NAMESPACE::WBEMFlags::E_LOCAL_ONLY, OW_NAMESPACE::GenericHDBRepository::getHandle(), hdl, makeInstanceKey(), OW_NAMESPACE::GenericHDBRepository::nodeToCIMObject(), OW_NAMESPACE::CIMException::NOT_FOUND, ns, OW_THROWCIMMSG, propertyList, OW_NAMESPACE::CIMObjectPath::setNameSpace(), theClass, OW_NAMESPACE::GenericHDBRepository::throwIfNotOpen(), and OW_NAMESPACE::CIMObjectPath::toString().

Referenced by OW_NAMESPACE::CIMRepository::getInstance().

void OW_NAMESPACE::InstanceRepository::getCIMInstances const String ns,
const String className,
const CIMClass requestedClass,
const CIMClass theClass,
CIMInstanceResultHandlerIFC result,
WBEMFlags::EDeepFlag  deep,
WBEMFlags::ELocalOnlyFlag  localOnly,
WBEMFlags::EIncludeQualifiersFlag  includeQualifiers,
WBEMFlags::EIncludeClassOriginFlag  includeClassOrigin,
const StringArray propertyList = NULL
 

Definition at line 220 of file OW_InstanceRepository.cpp.

References OW_NAMESPACE::HDBNode::areAllFlagsOn(), className, OW_NAMESPACE::GenericHDBRepository::getHandle(), OW_NAMESPACE::HDBCLSNODE_FLAG, hdl, OW_NAMESPACE::CIMException::INVALID_CLASS, makeClassKey(), ns, OW_THROW, OW_THROWCIM, and OW_NAMESPACE::GenericHDBRepository::throwIfNotOpen().

Referenced by OW_NAMESPACE::CIMRepositoryImpl::instEnumerator::doHandle(), and OW_NAMESPACE::CIMRepository::enumInstances().

void OW_NAMESPACE::InstanceRepository::getInstanceNames const String ns,
const CIMClass theClass,
CIMObjectPathResultHandlerIFC result
 

Definition at line 189 of file OW_InstanceRepository.cpp.

References OW_NAMESPACE::HDBNode::areAllFlagsOn(), className, OW_NAMESPACE::GenericHDBRepository::getHandle(), OW_NAMESPACE::CIMClass::getName(), OW_NAMESPACE::HDBCLSNODE_FLAG, hdl, OW_NAMESPACE::CIMException::INVALID_CLASS, makeClassKey(), ns, OW_THROW, OW_THROWCIM, theClass, and OW_NAMESPACE::GenericHDBRepository::throwIfNotOpen().

String OW_NAMESPACE::InstanceRepository::makeClassKey const String ns,
const String className
[private]
 

Definition at line 179 of file OW_InstanceRepository.cpp.

References className, ns, OW_NAMESPACE::NS_SEPARATOR_C(), and OW_NAMESPACE::String::toLowerCase().

Referenced by classHasInstances(), createClass(), createInstance(), deleteClass(), getCIMInstances(), getInstanceNames(), and makeInstanceKey().

String OW_NAMESPACE::InstanceRepository::makeInstanceKey const String ns,
const CIMObjectPath cop,
const CIMClass theClass
[private]
 

Definition at line 65 of file OW_InstanceRepository.cpp.

References cop, OW_NAMESPACE::CIMObjectPath::getClassName(), OW_NAMESPACE::CIMClass::getKeys(), OW_NAMESPACE::CIMException::INVALID_PARAMETER, makeClassKey(), ns, OW_NAMESPACE::NS_SEPARATOR_C(), OW_THROWCIMMSG, OW_NAMESPACE::StringBuffer::releaseString(), OW_NAMESPACE::Array< T >::size(), and theClass.

Referenced by createInstance(), deleteInstance(), and getCIMInstance().

void OW_NAMESPACE::InstanceRepository::modifyInstance const String ns,
const CIMObjectPath cop,
const CIMClass theClass,
const CIMInstance ci,
const CIMInstance oldInst,
WBEMFlags::EIncludeQualifiersFlag  includeQualifiers,
const StringArray propertyList
 

Update an instance.

Parameters:
cop The CIMObectPath that specifies the instance
theClass The class the cim instance belongs to.
ci The instance with the new values
Exceptions:
HDBException 
CIMException 
IOException 

Definition at line 359 of file OW_InstanceRepository.cpp.

References OW_NAMESPACE::String::c_str(), OW_NAMESPACE::CIMInstance::createModifiedInstance(), OW_NAMESPACE::WBEMFlags::E_INCLUDE_QUALIFIERS, OW_NAMESPACE::GenericHDBRepository::getHandle(), OW_NAMESPACE::CIMInstance::getKeyValuePairs(), hdl, OW_THROWCIMMSG, propertyList, OW_NAMESPACE::Array< T >::size(), theClass, and OW_NAMESPACE::GenericHDBRepository::throwIfNotOpen().

Referenced by OW_NAMESPACE::CIMRepository::modifyInstance().


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:16:41 2006 for openwbem by  doxygen 1.4.6