(file) Return to FileBasedStore.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Repository

Diff for /pegasus/src/Pegasus/Repository/FileBasedStore.cpp between version 1.2 and 1.3

version 1.2, 2008/08/20 15:09:03 version 1.3, 2008/08/21 17:54:03
Line 1320 
Line 1320 
  
 void FileBasedStore::createClass( void FileBasedStore::createClass(
     const CIMNamespaceName& nameSpace,     const CIMNamespaceName& nameSpace,
     const CIMClass& newClass)      const CIMClass& newClass,
       const Array<ClassAssociation>& classAssocEntries)
 { {
     PEG_METHOD_ENTER(TRC_REPOSITORY, "FileBasedStore::createClass");     PEG_METHOD_ENTER(TRC_REPOSITORY, "FileBasedStore::createClass");
  
Line 1345 
Line 1346 
     _streamer->encode(classXml, newClass);     _streamer->encode(classXml, newClass);
     _SaveObject(classFilePath, classXml, _streamer);     _SaveObject(classFilePath, classXml, _streamer);
  
       if (classAssocEntries.size())
       {
           _addClassAssociationEntries(nameSpace, classAssocEntries);
       }
   
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
 void FileBasedStore::modifyClass( void FileBasedStore::modifyClass(
     const CIMNamespaceName& nameSpace,     const CIMNamespaceName& nameSpace,
     const CIMClass& modifiedClass)      const CIMClass& modifiedClass,
       Boolean isAssociation,
       const Array<ClassAssociation>& classAssocEntries)
 { {
     PEG_METHOD_ENTER(TRC_REPOSITORY, "FileBasedStore::modifyClass");     PEG_METHOD_ENTER(TRC_REPOSITORY, "FileBasedStore::modifyClass");
  
Line 1382 
Line 1390 
     _streamer->encode(classXml, modifiedClass);     _streamer->encode(classXml, modifiedClass);
     _SaveObject(classFilePath, classXml, _streamer);     _SaveObject(classFilePath, classXml, _streamer);
  
       //
       // Update the association entries
       //
   
       if (isAssociation)
       {
           _removeClassAssociationEntries(nameSpace, modifiedClass.getClassName());
           if (classAssocEntries.size())
           {
               _addClassAssociationEntries(nameSpace, classAssocEntries);
           }
       }
   
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
 void FileBasedStore::deleteClass( void FileBasedStore::deleteClass(
     const CIMNamespaceName& nameSpace,     const CIMNamespaceName& nameSpace,
     const CIMName& className,     const CIMName& className,
     const CIMName& superClassName)      const CIMName& superClassName,
       Boolean isAssociation,
       const Array<CIMNamespaceName>& dependentNameSpaceNames)
 { {
     PEG_METHOD_ENTER(TRC_REPOSITORY, "FileBasedStore::deleteClass");     PEG_METHOD_ENTER(TRC_REPOSITORY, "FileBasedStore::deleteClass");
  
       //
       // Clean up the instance files in this namespace and in all dependent
       // namespaces.  (It was already checked that no instances exist.)
       //
   
       for (Uint32 i = 0; i < dependentNameSpaceNames.size(); i++)
       {
           String indexFilePath =
               _getInstanceIndexFilePath(nameSpace, className);
           String dataFilePath =
               _getInstanceDataFilePath(nameSpace, className);
   
           FileSystem::removeFileNoCase(indexFilePath);
           FileSystem::removeFileNoCase(dataFilePath);
       }
   
     // Remove class file     // Remove class file
  
     String classFilePath =     String classFilePath =
Line 1403 
Line 1442 
         throw CannotRemoveFile(classFilePath);         throw CannotRemoveFile(classFilePath);
     }     }
  
       //
       // Remove association entries
       //
   
       if (isAssociation)
       {
           _removeClassAssociationEntries(nameSpace, className);
       }
   
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
Line 1520 
Line 1568 
 void FileBasedStore::createInstance( void FileBasedStore::createInstance(
     const CIMNamespaceName& nameSpace,     const CIMNamespaceName& nameSpace,
     const CIMObjectPath& instanceName,     const CIMObjectPath& instanceName,
     const CIMInstance& cimInstance)      const CIMInstance& cimInstance,
       const Array<InstanceAssociation>& instAssocEntries)
 { {
     PEG_METHOD_ENTER(TRC_REPOSITORY, "FileBasedStore::createInstance");     PEG_METHOD_ENTER(TRC_REPOSITORY, "FileBasedStore::createInstance");
  
Line 1581 
Line 1630 
  
     transaction.complete();     transaction.complete();
  
       //
       // Create association entries if an association instance.
       //
   
       if (instAssocEntries.size())
       {
           _addInstanceAssociationEntries(nameSpace, instAssocEntries);
       }
   
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
Line 1742 
Line 1800 
  
     transaction.complete();     transaction.complete();
  
     PEG_METHOD_EXIT();      //
 }      // Delete from association table (if an association).
       //
 void FileBasedStore::deleteAllInstances(  
     const CIMNamespaceName& nameSpace,  
     const CIMName& className)  
 {  
     PEG_METHOD_ENTER(TRC_REPOSITORY, "FileBasedStore::deleteAllInstances");  
   
     String indexFilePath =  
         _getInstanceIndexFilePath(nameSpace, className);  
     String dataFilePath =  
         _getInstanceDataFilePath(nameSpace, className);  
  
     FileSystem::removeFileNoCase(indexFilePath);      _removeInstanceAssociationEntries(nameSpace, instanceName);
     FileSystem::removeFileNoCase(dataFilePath);  
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
Line 1783 
Line 1830 
     return false;     return false;
 } }
  
 void FileBasedStore::addClassAssociations(  void FileBasedStore::_addClassAssociationEntries(
     const CIMNamespaceName& nameSpace,     const CIMNamespaceName& nameSpace,
     const Array<ClassAssociation>& classAssocEntries)     const Array<ClassAssociation>& classAssocEntries)
 { {
     PEG_METHOD_ENTER(TRC_REPOSITORY, "FileBasedStore::addClassAssociations");      PEG_METHOD_ENTER(TRC_REPOSITORY,
           "FileBasedStore::_addClassAssociationEntries");
  
     String assocFileName = _getAssocClassPath(nameSpace);     String assocFileName = _getAssocClassPath(nameSpace);
     PEGASUS_STD(ofstream) os;     PEGASUS_STD(ofstream) os;
Line 1813 
Line 1861 
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
 Boolean FileBasedStore::removeClassAssociation(  void FileBasedStore::_removeClassAssociationEntries(
     const CIMNamespaceName& nameSpace,     const CIMNamespaceName& nameSpace,
     const CIMName& assocClassName)     const CIMName& assocClassName)
 { {
     PEG_METHOD_ENTER(TRC_REPOSITORY, "FileBasedStore::removeClassAssociation");      PEG_METHOD_ENTER(TRC_REPOSITORY,
           "FileBasedStore::_removeClassAssociationEntries");
  
     String assocFileName = _getAssocClassPath(nameSpace);     String assocFileName = _getAssocClassPath(nameSpace);
   
     Boolean returnStatus =  
         AssocClassTable::deleteAssociation(assocFileName, assocClassName);         AssocClassTable::deleteAssociation(assocFileName, assocClassName);
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return returnStatus;  
 } }
  
 void FileBasedStore::getClassAssociatorNames( void FileBasedStore::getClassAssociatorNames(
Line 1877 
Line 1923 
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
 void FileBasedStore::addInstanceAssociations(  void FileBasedStore::_addInstanceAssociationEntries(
     const CIMNamespaceName& nameSpace,     const CIMNamespaceName& nameSpace,
     const Array<InstanceAssociation>& instanceAssocEntries)     const Array<InstanceAssociation>& instanceAssocEntries)
 { {
     PEG_METHOD_ENTER(TRC_REPOSITORY, "FileBasedStore::addInstanceAssociations");      PEG_METHOD_ENTER(TRC_REPOSITORY,
           "FileBasedStore::_addInstanceAssociationEntries");
  
     String assocFileName = _getAssocInstPath(nameSpace);     String assocFileName = _getAssocInstPath(nameSpace);
     PEGASUS_STD(ofstream) os;     PEGASUS_STD(ofstream) os;
Line 1909 
Line 1956 
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
 void FileBasedStore::removeInstanceAssociation(  void FileBasedStore::_removeInstanceAssociationEntries(
     const CIMNamespaceName& nameSpace,     const CIMNamespaceName& nameSpace,
     const CIMObjectPath& assocInstanceName)     const CIMObjectPath& assocInstanceName)
 { {
     PEG_METHOD_ENTER(TRC_REPOSITORY,     PEG_METHOD_ENTER(TRC_REPOSITORY,
         "FileBasedStore::removeInstanceAssociation");          "FileBasedStore::_removeInstanceAssociationEntries");
  
     String assocFileName = _getAssocInstPath(nameSpace);     String assocFileName = _getAssocInstPath(nameSpace);
     AssocInstTable::deleteAssociation(assocFileName, assocInstanceName);     AssocInstTable::deleteAssociation(assocFileName, assocInstanceName);


Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2