OW_MetaRepository2.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * Copyright (C) 2001-3 Center 7, Inc All rights reserved.
00003 *
00004 * Redistribution and use in source and binary forms, with or without
00005 * modification, are permitted provided that the following conditions are met:
00006 *
00007 *  - Redistributions of source code must retain the above copyright notice,
00008 *    this list of conditions and the following disclaimer.
00009 *
00010 *  - Redistributions in binary form must reproduce the above copyright notice,
00011 *    this list of conditions and the following disclaimer in the documentation
00012 *    and/or other materials provided with the distribution.
00013 *
00014 *  - Neither the name of Center 7 nor the names of its
00015 *    contributors may be used to endorse or promote products derived from this
00016 *    software without specific prior written permission.
00017 *
00018 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00019 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 * ARE DISCLAIMED. IN NO EVENT SHALL Center 7, Inc OR THE CONTRIBUTORS
00022 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00023 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00024 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00025 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00026 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00027 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00028 * POSSIBILITY OF SUCH DAMAGE.
00029 *******************************************************************************/
00030 #ifndef OW_METAREPOSITORY_HPP_
00031 #define OW_METAREPOSITORY_HPP_
00032 #include "OW_config.h"
00033 #include "OW_CIMFwd.hpp"
00034 #include "OW_CIMException.hpp"
00035 #include "OW_ResultHandlerIFC.hpp"
00036 #include "OW_Cache.hpp"
00037 #include "OW_WBEMFlags.hpp"
00038 #include "OW_ServiceEnvironmentIFC.hpp"
00039 #include "OW_dbDatabase.hpp"
00040 
00041 #include <db.h>
00042 
00043 namespace OW_NAMESPACE
00044 {
00045 
00046 class MetaRepository2
00047 {
00048 public:
00052    MetaRepository2(const ServiceEnvironmentIFCRef& env);
00053    ~MetaRepository2();
00057    void open(::DB_ENV* env, ::DB_TXN* txn);
00058    void close();
00059 
00069    CIMQualifierType getQualifierType(const String& ns,
00070       const String& qualName);
00071 #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00072 
00080    bool deleteQualifierType(const String& ns, const String& qualName);
00087    void setQualifierType(const String& ns, const CIMQualifierType& qt);
00093    void enumQualifierTypes(const String& ns,
00094       CIMQualifierTypeResultHandlerIFC& result);
00095 #endif // #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00096 
00106    CIMException::ErrNoType getCIMClass(const String& ns,
00107       const String& className, WBEMFlags::ELocalOnlyFlag localOnly,
00108       WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00109       const StringArray* propertyList,
00110       CIMClass& cc);
00111 #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00112 
00119    bool deleteClass(const String& ns, const String& className);
00130    void createClass(const String& ns, CIMClass& cimClass);
00138    void modifyClass(const String& ns, const CIMClass& cimClass);
00139 #endif // #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00140 
00157    void enumClass(const String& ns,
00158       const String& className,
00159       CIMClassResultHandlerIFC& result,
00160       WBEMFlags::EDeepFlag deep, WBEMFlags::ELocalOnlyFlag localOnly,
00161       WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin);
00173    void enumClassNames(const String& ns,
00174       const String& className,
00175       StringResultHandlerIFC& result,
00176       WBEMFlags::EDeepFlag deep);
00177 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00178 
00183    void getTopLevelAssociations(const String& ns,
00184       CIMClassResultHandlerIFC& result);
00185 #endif
00186 #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00187 
00191    void deleteNameSpace(const String& nsName, OperationContext& context);
00198    void createNameSpace(String ns, OperationContext& context);
00199    
00200 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00201    
00202    void enumNameSpace(StringResultHandlerIFC& result,
00203       OperationContext& context);
00204 
00205    bool nameSpaceExists(const String& ns);
00206 
00207 private:
00208    // unimplemented
00209    MetaRepository2(const MetaRepository2& x);
00210    MetaRepository2& operator=(const MetaRepository2& x);
00217    String _makeQualPath(const String& ns, const String& qualName);
00224    String _makeClassPath(const String& ns, const String& className);
00225 #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00226 
00232    void _addQualifierType(const String& ns, const CIMQualifierType& qt);
00233 #endif
00234    void _getClassNodes(CIMClassResultHandlerIFC& result,
00235       WBEMFlags::EDeepFlag deep,
00236       WBEMFlags::ELocalOnlyFlag localOnly = WBEMFlags::E_NOT_LOCAL_ONLY,
00237       WBEMFlags::EIncludeQualifiersFlag includeQualifiers = WBEMFlags::E_INCLUDE_QUALIFIERS,
00238       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin = WBEMFlags::E_INCLUDE_CLASS_ORIGIN);
00239    void _getClassNameNodes(StringResultHandlerIFC& result, WBEMFlags::EDeepFlag deep);
00240    void _resolveClass(CIMClass& cls, const String& ns);
00241 #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00242    void _resolveQualifiers(const String& ns, CIMQualifierArray& quals);
00243 #endif
00244    Cache<CIMClass> m_classCache;
00245    Cache<CIMQualifierType> m_qualCache;
00246 
00247    dbDatabase m_namespaces;
00248    dbDatabase m_qualifiers;
00249    dbDatabase m_classes;
00250    dbDatabase m_subclasslists;
00251    dbDatabase m_qualifierlists;
00252 
00253    ServiceEnvironmentIFCRef m_env;
00254 };
00255 
00256 } // end namespace OW_NAMESPACE
00257 
00258 #endif

Generated on Thu Feb 9 08:48:05 2006 for openwbem by  doxygen 1.4.6