![]() ![]() |
![]() |
File: [Pegasus] / pegasus / src / Pegasus / Repository / NameSpaceManager.h
(download)
Revision: 1.33.16.1, Wed Aug 20 22:05:55 2008 UTC (15 years, 10 months ago) by karl Branch: TASK-PEP328_SOLARIS_NEVADA_PORT_v2-branch Changes since 1.33: +124 -87 lines PEP#: 328 TITLE: Sun port. Update to new branch for test DESCRIPTION: Update to new branch for port test with current code |
//%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 Pegasus_NameSpaceManager_h #define Pegasus_NameSpaceManager_h #include <Pegasus/Common/Config.h> #include <Pegasus/Repository/InheritanceTree.h> #include <Pegasus/Repository/Linkage.h> #include <Pegasus/Repository/FileBasedStore.h> PEGASUS_NAMESPACE_BEGIN struct NameSpaceManagerRep; class NameSpace; /** The NameSpaceManager class manages a collection of NameSpace objects. The shared schema support is based on these tenets: 1. A primary namespace is a namespace with no parent namespace. 2. A secondary namespace is a namespace with a parent namespace. 3. A secondary namespace derives all the schema from its parent namespace. 4. A primary namespace is not read-only. 5. A read-only namespace contains no schema of its own, but it may contain instances. 6. The parent of a secondary read-write namespace must be a primary namespace. */ class PEGASUS_REPOSITORY_LINKAGE NameSpaceManager { friend class NameSpace; public: NameSpaceManager( FileBasedStore* persistentStore); /** Destructor. */ ~NameSpaceManager(); /** Determines whether the given namespace exists: @param nameSpaceName name of namespace. @return true if namespace eixsts; false otherwise. */ Boolean nameSpaceExists(const CIMNamespaceName& nameSpaceName) const; /** Checks whether the specified namespace may be created. @param nameSpaceName name of namespace to be created. @exception CIMException If the namespace may not be created as specified */ void checkCreateNameSpace( const CIMNamespaceName& nameSpaceName, Boolean shareable, Boolean updatesAllowed, const String& parent); /** Creates the given namespace. @param nameSpaceName name of namespace to be created. */ void createNameSpace( const CIMNamespaceName& nameSpaceName, Boolean shareable, Boolean updatesAllowed, const String& parent); void modifyNameSpace( const CIMNamespaceName& nameSpaceName, Boolean shareable, Boolean updatesAllowed); /** Deletes the given namespace. @param nameSpaceName name of namespace to be deleted. @exception CIMException(CIM_ERR_INVALID_NAMESPACE) @exception NonEmptyNameSpace @exception FailedToRemoveDirectory */ void deleteNameSpace(const CIMNamespaceName& nameSpaceName); Boolean isRemoteNameSpace( const CIMNamespaceName& nameSpaceName, String& remoteInfo); /** Gets array of all namespace names. @param nameSpaceNames filled with names of all namespaces. */ void getNameSpaceNames(Array<CIMNamespaceName>& nameSpaceNames) const; Boolean getNameSpaceAttributes( const CIMNamespaceName& nameSpace, Boolean& shareable, Boolean& updatesAllowed, String& parent); void validateNameSpace( const CIMNamespaceName& nameSpaceName) const; /** Gets a list of names of namespaces that are directly dependent on the specified namespace. The specified namespace is also included in the list. The list contains all derived read-write namespaces (and perhaps some read-only ones as well), but not necessarily all derived read-only namespaces. This makes it insufficient to find all instances of a given class in derived namespaces, as it is currently being used. @param nameSpaceName name of the origin namespace. @return An Array of namespace names that depend on the origin namespace. */ Array<CIMNamespaceName> getDependentSchemaNameSpaceNames( const CIMNamespaceName& nameSpaceName) const; /** Determines whether a specified namespace has one or more dependent namespaces. If so, the name of one of the dependents is returned. @param nameSpaceName Name of the namespace to check for dependents. @param nameSpaceName (Output) Name of a dependent namespace, if found. @return A Boolean indicating whether the namespace has a dependent namespace. */ Boolean hasDependentNameSpace( const CIMNamespaceName& nameSpaceName, CIMNamespaceName& dependentNameSpaceName) const; /** Lists the names of namespaces whose schema is accessible from the specified namespace. The list contains all R/W parent namespaces of the specified namespace, as well as the specified namespace if it is R/W. Since a R/W namespace may depend only on a primary namespace, the maximum length of the returned list is 2. @param nameSpaceName name of the origin namespace. @return An Array of namespace names whose schema is accessible from the specified namespace. */ Array<CIMNamespaceName> getSchemaNameSpaceNames( const CIMNamespaceName& nameSpaceName) const; /** Validates that the specified class exists in the specified namespace (or one of its parent namespaces). It is intended for use on instance operations. @param nameSpaceName The name of the namespace to check for the class. @param className The name of the class for which to validate existence. @exception CIMException Error code CIM_ERR_INVALID_CLASS if the class does not exist. */ void validateClass( const CIMNamespaceName& nameSpaceName, const CIMName& className) const; CIMName getSuperClassName( const CIMNamespaceName& nameSpaceName, const CIMName& className) const; void locateClass( const CIMNamespaceName& nameSpaceName, const CIMName& className, CIMNamespaceName& actualNameSpaceName, CIMName& superClassName) const; /** Check whether the specified class may be deleted @param nameSpaceName Namespace in which the class exists. @param className Name of class to be deleted. @exception CIMException If the class may not be deleted */ void checkDeleteClass( const CIMNamespaceName& nameSpaceName, const CIMName& className) const; /** Check whether the specified qualifier may be deleted @param nameSpaceName Namespace in which the qualifier exists. @param qualifierName Name of qualifier to be deleted. @exception CIMException If the class may not be deleted */ void checkSetOrDeleteQualifier( const CIMNamespaceName& nameSpaceName, const CIMName& qualifierName) const; /** Deletes the class file for the given class. @param nameSpaceName name of namespace. @param className name of class. @exception CIMException(CIM_ERR_INVALID_NAMESPACE) @exception CIMException(CIM_ERR_INVALID_CLASS) @exception CIMException(CIM_ERR_CLASS_HAS_CHILDREN) */ void deleteClass( const CIMNamespaceName& nameSpaceName, const CIMName& className) const; /** Print out the namespaces. */ void print(PEGASUS_STD(ostream)& os) const; /** Checks whether it is okay to create a new class. @param nameSpaceName namespace to contain class. @param className name of class @param superClassName name of superClassName */ void checkCreateClass( const CIMNamespaceName& nameSpaceName, const CIMName& className, const CIMName& superClassName); /** Creates an entry for a new class. @param nameSpaceName namespace to contain class. @param className name of class @param superClassName name of superClassName */ void createClass( const CIMNamespaceName& nameSpaceName, const CIMName& className, const CIMName& superClassName); /** Checks whether it is okay to modify this class. @param nameSpaceName namespace. @param className name of class being modified. @param superClassName superclass of class being modified. @exception CIMException(CIM_ERR_INVALID_CLASS) @exception CIMException(CIM_ERR_FAILED) if there is an attempt to change the superclass of this class. @exception CIMException(CIM_ERR_CLASS_HAS_CHILDREN) if class has any children. */ void checkModifyClass( const CIMNamespaceName& nameSpaceName, const CIMName& className, const CIMName& superClassName); /** Get subclass names of the given class in the given namespace. @param nameSpaceName @param className - class whose subclass names will be gotten. If className is empty, all classnames are returned. @param deepInheritance - if true all descendent classes of class are returned. If className is empty, only root classes are returned. @param subClassNames - output argument to hold subclass names. @exception CIMException(CIM_ERR_INVALID_CLASS) */ void getSubClassNames( const CIMNamespaceName& nameSpaceName, const CIMName& className, Boolean deepInheritance, Array<CIMName>& subClassNames, Boolean enm=false) const; /** Get the names of all superclasses (direct and indirect) of this class. */ void getSuperClassNames( const CIMNamespaceName& nameSpaceName, const CIMName& className, Array<CIMName>& subClassNames) const; Boolean classExists( NameSpace* nameSpace, const CIMName& className, Boolean throwExcp=false) const; Boolean classExists( const CIMNamespaceName& nameSpaceName, const CIMName& className) const; private: NameSpace* _getNameSpace(const CIMNamespaceName& ns) const; NameSpace* _lookupNameSpace(const String& ns); NameSpaceManagerRep* _rep; }; /** This exception is thrown if one attempts to remove a namespace that still contains classes, instances, or qualifier. */ class PEGASUS_REPOSITORY_LINKAGE NonEmptyNameSpace : public Exception { public: NonEmptyNameSpace(const String& nameSpaceName) : Exception(MessageLoaderParms( "Repository.NameSpaceManager.ATTEMPT_DELETE_NONEMPTY_NAMESPACE", "Attempt to delete a non-empty namespace: $0", nameSpaceName)) { } }; PEGASUS_NAMESPACE_END #endif /* Pegasus_NameSpaceManager_h */
No CVS admin address has been configured |
Powered by ViewCVS 0.9.2 |