00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
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
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
00249
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
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 }
00278
00279 #endif