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

Diff for /pegasus/src/Pegasus/Repository/CIMRepository.h between version 1.26 and 1.26.2.7

version 1.26, 2001/07/16 21:59:59 version 1.26.2.7, 2001/12/12 17:10:07
Line 22 
Line 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)
   //              Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com)
   //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 30 
Line 32 
 #define PegasusRepository_Repository_h #define PegasusRepository_Repository_h
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
   #include <Pegasus/Common/IPC.h>
 #include <Pegasus/Common/CIMClass.h> #include <Pegasus/Common/CIMClass.h>
   #include <Pegasus/Common/CIMObject.h>
 #include <Pegasus/Common/CIMInstance.h> #include <Pegasus/Common/CIMInstance.h>
   #include <Pegasus/Common/CIMNamedInstance.h>
   #include <Pegasus/Common/CIMPropertyList.h>
 #include <Pegasus/Common/CIMQualifierDecl.h> #include <Pegasus/Common/CIMQualifierDecl.h>
 #include <Pegasus/Common/CIMOperations.h>  #include <Pegasus/Config/ConfigManager.h>
 #include <Pegasus/Repository/NameSpaceManager.h> #include <Pegasus/Repository/NameSpaceManager.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 class RepositoryDeclContext; class RepositoryDeclContext;
  
 /** This class derives from the CIMOperations class and provides a simple  /** This class provides a simple implementation of a CIM repository.
     implementation of a CIM repository. It only implements the methods  
     for manipulating classes and instances. The others throw this exception:  
   
     <pre>  
         CIMException(CIM_ERR_NOT_SUPPORTED)  
     </pre>  
 */ */
   class PEGASUS_REPOSITORY_LINKAGE CIMRepository
 class PEGASUS_REPOSITORY_LINKAGE CIMRepository : public CIMOperations  
 { {
 public: public:
  
Line 59 
Line 58 
     /// Descructor     /// Descructor
     virtual ~CIMRepository();     virtual ~CIMRepository();
  
       // Repositories MUST Have a read/write lock
   
       virtual void read_lock(void) throw(IPCException);
       virtual void read_unlock(void);
   
       virtual void write_lock(void) throw(IPCException);
       virtual void write_unlock(void);
   
     /// virtual class CIMClass. From the operations class     /// virtual class CIMClass. From the operations class
     virtual CIMClass getClass(     virtual CIMClass getClass(
         const String& nameSpace,         const String& nameSpace,
Line 66 
Line 73 
         Boolean localOnly = true,         Boolean localOnly = true,
         Boolean includeQualifiers = true,         Boolean includeQualifiers = true,
         Boolean includeClassOrigin = false,         Boolean includeClassOrigin = false,
         const Array<String>& propertyList = EmptyStringArray());          const CIMPropertyList& propertyList = CIMPropertyList());
  
     /// getInstance     /// getInstance
     virtual CIMInstance getInstance(     virtual CIMInstance getInstance(
Line 75 
Line 82 
         Boolean localOnly = true,         Boolean localOnly = true,
         Boolean includeQualifiers = false,         Boolean includeQualifiers = false,
         Boolean includeClassOrigin = false,         Boolean includeClassOrigin = false,
         const Array<String>& propertyList = EmptyStringArray());          const CIMPropertyList& propertyList = CIMPropertyList());
  
     /// deleteClass     /// deleteClass
     virtual void deleteClass(     virtual void deleteClass(
Line 93 
Line 100 
         const CIMClass& newClass);         const CIMClass& newClass);
  
     /// createInstance     /// createInstance
     virtual void createInstance(      virtual CIMReference createInstance(
         const String& nameSpace,         const String& nameSpace,
         const CIMInstance& newInstance);         const CIMInstance& newInstance);
  
Line 105 
Line 112 
     /// modifyInstance     /// modifyInstance
     virtual void modifyInstance(     virtual void modifyInstance(
         const String& nameSpace,         const String& nameSpace,
         const CIMInstance& modifiedInstance);          const CIMNamedInstance& modifiedInstance,
           Boolean includeQualifiers = true,
           const CIMPropertyList& propertyList = CIMPropertyList());
  
     /// enumerateClasses     /// enumerateClasses
     virtual Array<CIMClass> enumerateClasses(     virtual Array<CIMClass> enumerateClasses(
Line 123 
Line 132 
         Boolean deepInheritance = false);         Boolean deepInheritance = false);
  
     /// enumerateInstances     /// enumerateInstances
     virtual Array<CIMInstance> enumerateInstances(      virtual Array<CIMNamedInstance> enumerateInstances(
         const String& nameSpace,         const String& nameSpace,
         const String& className,         const String& className,
         Boolean deepInheritance = true,         Boolean deepInheritance = true,
         Boolean localOnly = true,         Boolean localOnly = true,
         Boolean includeQualifiers = false,         Boolean includeQualifiers = false,
         Boolean includeClassOrigin = false,         Boolean includeClassOrigin = false,
         const Array<String>& propertyList = EmptyStringArray());          const CIMPropertyList& propertyList = CIMPropertyList());
  
     /// enumerateInstanceNames     /// enumerateInstanceNames
     virtual Array<CIMReference> enumerateInstanceNames(     virtual Array<CIMReference> enumerateInstanceNames(
Line 152 
Line 161 
         const String& resultRole = String::EMPTY,         const String& resultRole = String::EMPTY,
         Boolean includeQualifiers = false,         Boolean includeQualifiers = false,
         Boolean includeClassOrigin = false,         Boolean includeClassOrigin = false,
         const Array<String>& propertyList = EmptyStringArray());          const CIMPropertyList& propertyList = CIMPropertyList());
  
     /// associateNames     /// associateNames
     virtual Array<CIMReference> associatorNames(     virtual Array<CIMReference> associatorNames(
Line 171 
Line 180 
         const String& role = String::EMPTY,         const String& role = String::EMPTY,
         Boolean includeQualifiers = false,         Boolean includeQualifiers = false,
         Boolean includeClassOrigin = false,         Boolean includeClassOrigin = false,
         const Array<String>& propertyList = EmptyStringArray());          const CIMPropertyList& propertyList = CIMPropertyList());
  
     /// referenceNames     /// referenceNames
     virtual Array<CIMReference> referenceNames(     virtual Array<CIMReference> referenceNames(
Line 250 
Line 259 
     */     */
     void setDeclContext(RepositoryDeclContext *context);     void setDeclContext(RepositoryDeclContext *context);
  
       /** Indicates whether instance operations that do not have a provider
           registered should be served by this repository.
       */
       Boolean isDefaultInstanceProvider()
       {
           return _isDefaultInstanceProvider;
       }
   
       /** Indicates the name by which this repository explicitly registers as
           an instance provider.
       */
       const String& getProviderName()
       {
           return _providerName;
       }
   
 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   namedInstances an array of CIMNamedInstance objects to which
                                   the loaded instances are appended
   
           @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<CIMNamedInstance>& namedInstances);
   
       /** 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;
  
       // These must be initialized in the constructor using values from the
       // ConfigManager.
       Boolean _isDefaultInstanceProvider;
       String _providerName;
   
 protected: protected:
       ReadWriteSem _lock;
     RepositoryDeclContext* _context;     RepositoryDeclContext* _context;
 }; };
  
   
   
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  
 #endif /* PegasusRepository_Repository_h */ #endif /* PegasusRepository_Repository_h */


Legend:
Removed from v.1.26  
changed lines
  Added in v.1.26.2.7

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2