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

Diff for /pegasus/src/Pegasus/Repository/CIMRepository.cpp between version 1.45 and 1.46

version 1.45, 2001/07/08 03:58:32 version 1.46, 2001/07/08 05:37:09
Line 258 
Line 258 
     const String& nameSpace,     const String& nameSpace,
     const String& className)     const String& className)
 { {
       // -- Get the class and check to see if it is an association class:
   
       CIMClass cimClass = getClass(nameSpace, className, false);
       Boolean isAssociation = cimClass.isAssociation();
   
     // -- Disallow deletion if class has instances:     // -- Disallow deletion if class has instances:
  
     String path = _getIndexFilePath(nameSpace, className);     String path = _getIndexFilePath(nameSpace, className);
   
     String realPath;     String realPath;
  
     if (FileSystem::existsNoCase(path, realPath))     if (FileSystem::existsNoCase(path, realPath))
Line 270 
Line 274 
     // -- Delete the class (disallowed if there are subclasses):     // -- Delete the class (disallowed if there are subclasses):
  
     _nameSpaceManager.deleteClass(nameSpace, className);     _nameSpaceManager.deleteClass(nameSpace, className);
   
       // -- Remove association:
   
       if (isAssociation)
       {
           String assocFileName = _MakeAssocClassPath(nameSpace, _repositoryRoot);
   
           if (FileSystem::exists(assocFileName))
               AssocClassTable::deleteAssociation(assocFileName, className);
       }
 } }
  
 void CIMRepository::deleteInstance( void CIMRepository::deleteInstance(
Line 317 
Line 331 
             "unexpected failure in CIMRepository::deleteInstance()");             "unexpected failure in CIMRepository::deleteInstance()");
     }     }
  
     // -- Remove if from the association table (if it is really association).      // -- Remove it from the association table (if it is really association).
     // -- We ignore the return value intentionally. If it is an association,     // -- We ignore the return value intentionally. If it is an association,
     // -- true is returned. Otherwise, true is returned.     // -- true is returned. Otherwise, true is returned.
  
     String assocFileName = _MakeAssocInstPath(nameSpace, _repositoryRoot);     String assocFileName = _MakeAssocInstPath(nameSpace, _repositoryRoot);
  
   
     if (FileSystem::exists(assocFileName))     if (FileSystem::exists(assocFileName))
         AssocInstTable::deleteAssociation(assocFileName, instanceName);         AssocInstTable::deleteAssociation(assocFileName, instanceName);
 } }
Line 836 
Line 849 
     const String& role,     const String& role,
     const String& resultRole)     const String& resultRole)
 { {
     String assocFileName = _MakeAssocInstPath(nameSpace, _repositoryRoot);  
     Array<String> associatorNames;     Array<String> associatorNames;
  
     // The return value of this function is ignored since it is okay for      if (objectName.isClassName())
     // the given object not to have any associators (in this case we just      {
     // return a zero-sized array of associators.          String assocFileName = _MakeAssocClassPath(nameSpace, _repositoryRoot);
   
           AssocClassTable::getAssociatorNames(
               assocFileName,
               objectName.toString(),
               assocClass,
               resultClass,
               role,
               resultRole,
               associatorNames);
       }
       else
       {
           String assocFileName = _MakeAssocInstPath(nameSpace, _repositoryRoot);
  
     AssocInstTable::getAssociatorNames(     AssocInstTable::getAssociatorNames(
         assocFileName,         assocFileName,
Line 851 
Line 876 
         role,         role,
         resultRole,         resultRole,
         associatorNames);         associatorNames);
       }
  
     Array<CIMReference> result;     Array<CIMReference> result;
  
Line 894 
Line 920 
         if (tmpNameSpace.size() == 0)         if (tmpNameSpace.size() == 0)
             tmpNameSpace = nameSpace;             tmpNameSpace = nameSpace;
  
         // ATTN: getInstance() should be able to handle instance names          // ATTN: getInstance() should this be able to handle instance names
         // with host names and namespaces.          // with host names and namespaces?
  
         CIMReference tmpRef = names[i];         CIMReference tmpRef = names[i];
         tmpRef.setHost(String());         tmpRef.setHost(String());
         tmpRef.setNameSpace(String());         tmpRef.setNameSpace(String());
  
           if (objectName.isClassName())
           {
               CIMClass cimClass = getClass(
                   tmpNameSpace,
                   tmpRef.getClassName(),
                   false,
                   includeQualifiers,
                   includeClassOrigin,
                   propertyList);
   
               result.append(CIMObjectWithPath(names[i], cimClass));
           }
           else
           {
         CIMInstance instance = getInstance(         CIMInstance instance = getInstance(
             tmpNameSpace,             tmpNameSpace,
             tmpRef,             tmpRef,
Line 911 
Line 951 
  
         result.append(CIMObjectWithPath(names[i], instance));         result.append(CIMObjectWithPath(names[i], instance));
     }     }
       }
  
     return result;     return result;
 } }
Line 921 
Line 962 
     const String& resultClass,     const String& resultClass,
     const String& role)     const String& role)
 { {
     String assocFileName = _MakeAssocInstPath(nameSpace, _repositoryRoot);  
     Array<String> tmpReferenceNames;     Array<String> tmpReferenceNames;
  
       if (objectName.isClassName())
       {
           String assocFileName = _MakeAssocClassPath(nameSpace, _repositoryRoot);
   
           if (!AssocClassTable::getReferenceNames(
               assocFileName,
               objectName.getClassName(),
               resultClass,
               role,
               tmpReferenceNames))
           {
               // Ignore error! It's okay not to have references.
           }
       }
       else
       {
           String assocFileName = _MakeAssocInstPath(nameSpace, _repositoryRoot);
   
     if (!AssocInstTable::getReferenceNames(     if (!AssocInstTable::getReferenceNames(
         assocFileName,         assocFileName,
         objectName,         objectName,
Line 931 
Line 989 
         role,         role,
         tmpReferenceNames))         tmpReferenceNames))
     {     {
         throw PEGASUS_CIM_EXCEPTION(FAILED, "references not found for: "              // Ignore error! It's okay not to have references.
             + objectName.toString());          }
     }     }
  
     Array<CIMReference> result;     Array<CIMReference> result;


Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2