version 1.26, 2001/07/16 21:59:59
|
version 1.26.2.1, 2001/08/21 00:30:22
|
|
|
// Author: Mike Brasher (mbrasher@bmc.com) | // Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// Modified By: | // Modified By: |
|
// Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
| |
private: | private: |
| |
|
void _createAssocInstEntries( |
|
const String& nameSpace, |
|
const CIMConstClass& cimClass, |
|
const CIMInstance& cimInstance, |
|
const CIMReference& instanceName); |
|
|
|
void _createAssocClassEntries( |
|
const String& nameSpace, |
|
const CIMConstClass& assocClass); |
|
|
|
/** Returns the index (or byte location) and size of the instance |
|
record in the instance file for a given instance. Returns true |
|
if successful. Returns false if the instance cannot be found. |
|
|
|
@param nameSpace the namespace of the instance |
|
@param instanceName the name of the instance |
|
@param className the name of the class |
|
@param size the size of the instance record found |
|
@param index the byte positon of the instance record found |
|
@param searchSuper if true, search all superclasses |
|
|
|
@return true if the instance is found |
|
false if the instance cannot be found |
|
*/ |
Boolean _getInstanceIndex( | Boolean _getInstanceIndex( |
const String& nameSpace, | const String& nameSpace, |
const CIMReference& instanceName, | const CIMReference& instanceName, |
String& className, | String& className, |
|
Uint32& size, |
Uint32& index, | Uint32& index, |
Boolean searchSuperClasses = false) const; | Boolean searchSuperClasses = false) const; |
| |
|
/** Returns the file path of the instance index file. |
|
|
|
@param nameSpace the namespace of the instance |
|
@param className the name of the class |
|
|
|
@return a string containing the index file path |
|
*/ |
String _getIndexFilePath( | String _getIndexFilePath( |
const String& nameSpace, | const String& nameSpace, |
const String& className) const; | const String& className) const; |
| |
|
/** Returns the file path of the instance file. |
|
|
|
@param nameSpace the namespace of the instance |
|
@param className the name of the class |
|
|
|
@return a string containing the instance file path |
|
*/ |
String _getInstanceFilePath( | String _getInstanceFilePath( |
const String& nameSpace, | const String& nameSpace, |
const String& className, |
const String& className) const; |
Uint32 index) const; |
|
| |
void _createAssocInstEntries( |
/** Saves an instance object from memory to disk file. The byte |
const String& nameSpace, |
position and the size of the newly inserted instance record are |
const CIMConstClass& cimClass, |
returned. Returns true on success. |
const CIMInstance& cimInstance, |
|
const CIMReference& instanceName); |
@param path the file path of the instance file |
|
@param object the CIMInstance object to be saved |
|
@param index the byte positon of the saved instance record |
|
@param size the size of the saved instance record |
| |
void _createAssocClassEntries( |
@return true if successful |
|
false if an error occurs in saving the instance to file |
|
*/ |
|
Boolean _saveInstance( |
|
const String& path, |
|
const CIMInstance& object, |
|
Uint32& index, |
|
Uint32& size); |
|
|
|
/** loads an instance object from disk to memory. The caller passes |
|
the byte position and the size of the instance record to be loaded. |
|
Returns true on success. |
|
|
|
@param path the file path of the instance file |
|
@param object the CIMInstance object to be returned |
|
@param index the byte positon of the instance record |
|
@param size the size of the instance record |
|
@param data the buffer to hold the instance data |
|
|
|
@return true if successful |
|
false if an error occurs in loading the instance from file |
|
*/ |
|
Boolean _loadInstance( |
|
const String& path, |
|
CIMInstance& object, |
|
Uint32 index, |
|
Uint32 size); |
|
|
|
/** loads all the instance objects from disk to memeory. Returns true |
|
on success. |
|
|
|
@param nameSpace the namespace of the instances to be loaded |
|
@param className the class of the instances to be loaded |
|
@param instances an array of CIMInstance objects to be returned |
|
|
|
@return true if successful |
|
false if an error occurs in loading the instances |
|
*/ |
|
Boolean _loadAllInstances( |
const String& nameSpace, | const String& nameSpace, |
const CIMConstClass& assocClass); |
const String& className, |
|
Array<CIMInstance>& instances); |
|
|
|
/** Modifies an instance object saved in the disk file. The byte position |
|
and the size of the newly added instance record are returned. Returns |
|
true on success. |
|
|
|
@param path the file path of the instance file |
|
@param object the modified CIMInstance object |
|
@param oldIndex the byte positon of the old instance record |
|
@param oldSize the size of the old instance record |
|
@param newIndex the byte positon of the new instance record |
|
@param newSize the size of the new instance record |
|
|
|
@return true if successful |
|
false if an error occurs in modifying the instance |
|
*/ |
|
Boolean _modifyInstance( |
|
const String& path, |
|
const CIMInstance& object, |
|
Uint32 oldIndex, |
|
Uint32 oldSize, |
|
Uint32& newIndex, |
|
Uint32& newSize); |
|
|
|
/** Renames the temporary instance and instance index files back to the |
|
original files. The temporary files were created for an insert, |
|
remove, or modify operation (to avoid data inconsistency between |
|
the two files in case of unexpected system termination or failure). |
|
This method is called after a successful insert, remove, or modify |
|
operation on BOTH the index file and the instance file. Returns |
|
true on success. |
|
|
|
@param indexFilePath the file path of the instance index file |
|
@param instancePath the file path of the instance file |
|
|
|
@return true if successful |
|
false if an error occurs in removing the original files |
|
or renaming the temporary files. |
|
*/ |
|
Boolean _renameTempInstanceAndIndexFiles( |
|
const String& indexFilePath, |
|
const String& instanceFilePath); |
| |
String _repositoryRoot; | String _repositoryRoot; |
NameSpaceManager _nameSpaceManager; | NameSpaceManager _nameSpaceManager; |