OW_MetaRepository.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * Copyright (C) 2001-2004 Vintela, 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 Vintela, Inc. 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 Vintela, 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 
00036 #ifndef OW_METAREPOSITORY_HPP_
00037 #define OW_METAREPOSITORY_HPP_
00038 #include "OW_config.h"
00039 #include "OW_GenericHDBRepository.hpp"
00040 #include "OW_CIMFwd.hpp"
00041 #include "OW_CIMException.hpp"
00042 #include "OW_ResultHandlerIFC.hpp"
00043 #include "OW_Cache.hpp"
00044 #include "OW_WBEMFlags.hpp"
00045 
00046 namespace OW_NAMESPACE
00047 {
00048 
00049 class OW_HDB_API MetaRepository : public GenericHDBRepository
00050 {
00051 public:
00055    MetaRepository();
00056    ~MetaRepository();
00061    void open(const String& path);
00062    virtual void init(const ServiceEnvironmentIFCRef& env);
00072    CIMQualifierType getQualifierType(const String& ns,
00073       const CIMName& qualName, HDBHandle* hdl=0);
00074 #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00075 
00083    bool deleteQualifierType(const String& ns, const CIMName& qualName);
00090    void setQualifierType(const String& ns, const CIMQualifierType& qt);
00096    void enumQualifierTypes(const String& ns,
00097       CIMQualifierTypeResultHandlerIFC& result);
00098 #endif // #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00099 
00109    CIMException::ErrNoType getCIMClass(const String& ns,
00110       const CIMName& className, WBEMFlags::ELocalOnlyFlag localOnly,
00111       WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00112       const StringArray* propertyList,
00113       CIMClass& cc);
00114 #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00115 
00122    bool deleteClass(const String& ns, const CIMName& className);
00133    void createClass(const String& ns, CIMClass& cimClass);
00141    void modifyClass(const String& ns, const CIMClass& cimClass);
00142 #endif // #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00143 
00160    void enumClass(const String& ns,
00161       const CIMName& className,
00162       CIMClassResultHandlerIFC& result,
00163       WBEMFlags::EDeepFlag deep, WBEMFlags::ELocalOnlyFlag localOnly,
00164       WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin);
00176    void enumClassNames(const String& ns,
00177       const CIMName& className,
00178       StringResultHandlerIFC& result,
00179       WBEMFlags::EDeepFlag deep);
00180 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00181 
00186    void getTopLevelAssociations(const String& ns,
00187       CIMClassResultHandlerIFC& result);
00188 #endif
00189 #if !defined(OW_DISABLE_INSTANCE_MANIPULATION) && !defined(OW_DISABLE_NAMESPACE_MANIPULATION)
00190 
00194    void deleteNameSpace(const String& nsName);
00202    virtual int createNameSpace(const String& ns);
00203 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00204 private:
00205    // unimplemented
00206    MetaRepository(const MetaRepository& x);
00207    MetaRepository& operator=(const MetaRepository& x);
00215    HDBNode _getQualContainer(HDBHandleLock& hdl, const String& ns);
00222    String _makeQualPath(const String& ns, const CIMName& qualName);
00229    String _makeClassPath(const String& ns, const CIMName& className);
00230 #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00231 
00237    void _addQualifierType(const String& ns, const CIMQualifierType& qt,
00238       HDBHandle* phdl=0);
00239 #endif
00240    void _getClassNodes(const String& ns, CIMClassResultHandlerIFC& result, HDBNode node,
00241       HDBHandle hdl,
00242       WBEMFlags::EDeepFlag deep,
00243       WBEMFlags::ELocalOnlyFlag localOnly = WBEMFlags::E_NOT_LOCAL_ONLY,
00244       WBEMFlags::EIncludeQualifiersFlag includeQualifiers = WBEMFlags::E_INCLUDE_QUALIFIERS,
00245       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin = WBEMFlags::E_INCLUDE_CLASS_ORIGIN);
00246    void _getClassNameNodes(StringResultHandlerIFC& result, HDBNode node,
00247       HDBHandle hdl, WBEMFlags::EDeepFlag deep);
00248 // void _getClassChildNames(StringArray& ra, HDBNode node,
00249 //    HDBHandle hdl);
00250    void _resolveClass(CIMClass& cls, HDBNode& node, HDBHandle& hdl,
00251       const String& ns);
00252 #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00253    HDBNode adjustClass(const String& ns, CIMClass& childClass,
00254       HDBHandle hdl);
00255    void _resolveQualifiers(const String& ns, CIMQualifierArray& quals,
00256       HDBHandle hdl);
00257 #endif
00258    CIMClass _getClassFromNode(HDBNode& node, HDBHandle hdl,
00259       const String& ns);
00260    CIMName _getClassNameFromNode(HDBNode& node);
00261    //void _throwIfBadClass(const CIMClass& cc, const CIMClass& parentClass);
00262 
00263 #ifdef OW_WIN32
00264 #pragma warning (push)
00265 #pragma warning (disable: 4251)
00266 #endif
00267 
00268    Cache<CIMClass> m_classCache;
00269    Cache<CIMQualifierType> m_qualCache;
00270 
00271 #ifdef OW_WIN32
00272 #pragma warning (pop)
00273 #endif
00274 
00275 };
00276 
00277 } // end namespace OW_NAMESPACE
00278 
00279 #endif

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