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 #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
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 }
00257
00258 #endif