📄 cimrepository.h
字号:
//%2006//////////////////////////////////////////////////////////////////////////// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;// IBM Corp.; EMC Corporation, The Open Group.// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;// EMC Corporation; VERITAS Software Corporation; The Open Group.// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;// EMC Corporation; Symantec Corporation; The Open Group.//// Permission is hereby granted, free of charge, to any person obtaining a copy// of this software and associated documentation files (the "Software"), to// deal in the Software without restriction, including without limitation the// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or// sell copies of the Software, and to permit persons to whom the Software is// furnished to do so, subject to the following conditions:// // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.////==============================================================================////%/////////////////////////////////////////////////////////////////////////////#ifndef PegasusRepository_Repository_h#define PegasusRepository_Repository_h#include <Pegasus/Common/Config.h>#include <Pegasus/Common/CIMClass.h>#include <Pegasus/Common/CIMObject.h>#include <Pegasus/Common/CIMInstance.h>#include <Pegasus/Common/CIMPropertyList.h>#include <Pegasus/Common/CIMQualifierDecl.h>#include <Pegasus/Common/CIMRepositoryBase.h>#include <Pegasus/Common/ContentLanguageList.h>#include <Pegasus/Config/ConfigManager.h>#include <Pegasus/Repository/NameSpaceManager.h>#include <Pegasus/Repository/Linkage.h>#include <Pegasus/Common/ReadWriteSem.h>#include <Pegasus/Common/ObjectStreamer.h>PEGASUS_NAMESPACE_BEGINclass RepositoryDeclContext;class compilerDeclContext;/** This class provides a simple implementation of a CIM repository. Concurrent access is controlled by an internal lock.*/class PEGASUS_REPOSITORY_LINKAGE CIMRepository : public CIMRepositoryBase{public: enum CIMRepositoryMode { MODE_DEFAULT = 0, MODE_XML = 1, MODE_BIN = 2, MODE_COMPRESSED = 4 }; /// Constructor CIMRepository( const String& repositoryRoot, Uint32 mode = CIMRepository::MODE_DEFAULT); /// Descructor virtual ~CIMRepository(); /// getClass virtual CIMClass getClass( const CIMNamespaceName& nameSpace, const CIMName& className, Boolean localOnly = true, Boolean includeQualifiers = true, Boolean includeClassOrigin = false, const CIMPropertyList& propertyList = CIMPropertyList()); /// getInstance virtual CIMInstance getInstance( const CIMNamespaceName& nameSpace, const CIMObjectPath& instanceName, Boolean localOnly = true, Boolean includeQualifiers = false, Boolean includeClassOrigin = false, const CIMPropertyList& propertyList = CIMPropertyList()); /// deleteClass virtual void deleteClass( const CIMNamespaceName& nameSpace, const CIMName& className); /// deleteInstance virtual void deleteInstance( const CIMNamespaceName& nameSpace, const CIMObjectPath& instanceName); /// createClass virtual void createClass( const CIMNamespaceName& nameSpace, const CIMClass& newClass, const ContentLanguageList& contentLangs = ContentLanguageList()); /// createInstance virtual CIMObjectPath createInstance( const CIMNamespaceName& nameSpace, const CIMInstance& newInstance, const ContentLanguageList& contentLangs = ContentLanguageList()); /// modifyClass virtual void modifyClass( const CIMNamespaceName& nameSpace, const CIMClass& modifiedClass, const ContentLanguageList& contentLangs = ContentLanguageList()); /// modifyInstance virtual void modifyInstance( const CIMNamespaceName& nameSpace, const CIMInstance& modifiedInstance, Boolean includeQualifiers = true, const CIMPropertyList& propertyList = CIMPropertyList(), const ContentLanguageList& contentLangs = ContentLanguageList()); /// enumerateClasses virtual Array<CIMClass> enumerateClasses( const CIMNamespaceName& nameSpace, const CIMName& className = CIMName(), Boolean deepInheritance = false, Boolean localOnly = true, Boolean includeQualifiers = true, Boolean includeClassOrigin = false); /// enumerateClassNames virtual Array<CIMName> enumerateClassNames( const CIMNamespaceName& nameSpace, const CIMName& className = CIMName(), Boolean deepInheritance = false); /** Enumerates the instances of the specified class and its subclasses. This method mimics the client behavior for the EnumerateInstances operation, but of course it can only return the instances that reside in the repository. This method does not perform deepInheritance filtering regardless of the value given for that parameter. This method is useful mainly for testing purposes, and should not be relied upon for complete results in a CIM Server environment. */ virtual Array<CIMInstance> enumerateInstancesForSubtree( const CIMNamespaceName& nameSpace, const CIMName& className, Boolean deepInheritance = true, Boolean localOnly = true, Boolean includeQualifiers = false, Boolean includeClassOrigin = false, const CIMPropertyList& propertyList = CIMPropertyList()); /** Enumerates the instances of just the specified class. This method mimics the provider behavior for the EnumerateInstances operation. */ virtual Array<CIMInstance> enumerateInstancesForClass( const CIMNamespaceName& nameSpace, const CIMName& className, Boolean localOnly = true, Boolean includeQualifiers = false, Boolean includeClassOrigin = false, const CIMPropertyList& propertyList = CIMPropertyList()); /** Enumerates the names of the instances of the specified class and its subclasses. This method mimics the client behavior for the EnumerateInstanceNames operation, but of course it can only return the names of the instances that reside in the repository. This method is useful mainly for testing purposes, and should not be relied upon for complete results in a CIM Server environment. @param nameSpace The namespace in which className resides. @param className The name the class for which to retrieve the instance names. @return An Array of CIMObjectPath objects containing the names of the instances of the specified class in the specified namespace. */ virtual Array<CIMObjectPath> enumerateInstanceNamesForSubtree( const CIMNamespaceName& nameSpace, const CIMName& className); /** Enumerates the names of the instances of just the specified class. This method mimics the provider behavior for the EnumerateInstanceNames operation. @param nameSpace The namespace in which className resides. @param className The name the class for which to retrieve the instance names. @return An Array of CIMObjectPath objects containing the names of the instances of the specified class in the specified namespace. */ virtual Array<CIMObjectPath> enumerateInstanceNamesForClass( const CIMNamespaceName& nameSpace, const CIMName& className); /// execQuery virtual Array<CIMInstance> execQuery( const String& queryLanguage, const String& query) ; /// associators virtual Array<CIMObject> associators( const CIMNamespaceName& nameSpace, const CIMObjectPath& objectName, const CIMName& assocClass = CIMName(), const CIMName& resultClass = CIMName(), const String& role = String::EMPTY, const String& resultRole = String::EMPTY, Boolean includeQualifiers = false, Boolean includeClassOrigin = false, const CIMPropertyList& propertyList = CIMPropertyList()); /// associatorNames virtual Array<CIMObjectPath> associatorNames( const CIMNamespaceName& nameSpace, const CIMObjectPath& objectName, const CIMName& assocClass = CIMName(), const CIMName& resultClass = CIMName(), const String& role = String::EMPTY, const String& resultRole = String::EMPTY); /// references virtual Array<CIMObject> references( const CIMNamespaceName& nameSpace, const CIMObjectPath& objectName, const CIMName& resultClass = CIMName(), const String& role = String::EMPTY, Boolean includeQualifiers = false, Boolean includeClassOrigin = false, const CIMPropertyList& propertyList = CIMPropertyList()); /// referenceNames virtual Array<CIMObjectPath> referenceNames( const CIMNamespaceName& nameSpace, const CIMObjectPath& objectName, const CIMName& resultClass = CIMName(), const String& role = String::EMPTY); /// getProperty virtual CIMValue getProperty( const CIMNamespaceName& nameSpace, const CIMObjectPath& instanceName, const CIMName& propertyName); /// setProperty virtual void setProperty( const CIMNamespaceName& nameSpace, const CIMObjectPath& instanceName, const CIMName& propertyName, const CIMValue& newValue = CIMValue(), const ContentLanguageList& contentLangs = ContentLanguageList()); /// getQualifier virtual CIMQualifierDecl getQualifier( const CIMNamespaceName& nameSpace, const CIMName& qualifierName); /// setQualifier virtual void setQualifier( const CIMNamespaceName& nameSpace, const CIMQualifierDecl& qualifierDecl, const ContentLanguageList& contentLangs = ContentLanguageList()); /// deleteQualifier virtual void deleteQualifier( const CIMNamespaceName& nameSpace, const CIMName& qualifierName); /// enumerateQualifiers virtual Array<CIMQualifierDecl> enumerateQualifiers( const CIMNamespaceName& nameSpace); /** CIMMethod createNameSpace - Creates a new namespace in the repository @param String with the name of the namespace @exception - Throws "Already_Exists if the Namespace exits. Throws "CannotCreateDirectory" if there are problems in the creation. */ virtual void createNameSpace(const CIMNamespaceName& nameSpace, const NameSpaceAttributes& attributes = NameSpaceAttributes());
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -