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_CIMSERVER_HPP_INCLUDE_GUARD_
00037 #define OW_CIMSERVER_HPP_INCLUDE_GUARD_
00038 #include "OW_config.h"
00039 #include "OW_RepositoryIFC.hpp"
00040 #include "OW_CIMClass.hpp"
00041 #include "OW_Authorizer2IFC.hpp"
00042 #include "OW_CimomCommonFwd.hpp"
00043 #include "OW_ProviderFwd.hpp"
00044 #include "OW_CommonFwd.hpp"
00045 #include "OW_CIMFwd.hpp"
00046 #include "OW_Mutex.hpp"
00047
00048 namespace OW_NAMESPACE
00049 {
00050
00051 class CIMRepository;
00052
00053
00054
00055 class OW_CIMOMCOMMON_API CIMServer : public RepositoryIFC
00056 {
00057 public:
00058 static const char* const INST_REPOS_NAME;
00059 static const char* const META_REPOS_NAME;
00060 static const char* const NS_REPOS_NAME;
00061 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00062 static const char* const CLASS_ASSOC_REPOS_NAME;
00063 static const char* const INST_ASSOC_REPOS_NAME;
00064 #endif
00065
00068 CIMServer(const ServiceEnvironmentIFCRef& env,
00069 const ProviderManagerRef& providerManager,
00070 const RepositoryIFCRef& repository,
00071 const AuthorizerManagerRef& authorizerMgr);
00075 virtual ~CIMServer();
00080 virtual void open(const String& path);
00081 virtual String getName() const;
00082 virtual StringArray getDependencies() const;
00083
00087 void init(const ServiceEnvironmentIFCRef& env);
00091 virtual void close();
00095 virtual void shutdown();
00096 #if !defined(OW_DISABLE_INSTANCE_MANIPULATION) && !defined(OW_DISABLE_NAMESPACE_MANIPULATION)
00097
00103 virtual void createNameSpace(const String& ns, OperationContext& context);
00110 virtual void deleteNameSpace(const String& ns, OperationContext& context);
00111 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00112
00119 virtual void enumNameSpace(StringResultHandlerIFC& result,
00120 OperationContext& context);
00130 virtual CIMQualifierType getQualifierType(const String& ns,
00131 const String& qualifierName,
00132 OperationContext& context);
00133 #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00134
00141 virtual void enumQualifierTypes(
00142 const String& ns,
00143 CIMQualifierTypeResultHandlerIFC& result,
00144 OperationContext& context);
00151 virtual void deleteQualifierType(const String& ns, const String& qualName,
00152 OperationContext& context);
00162 virtual void setQualifierType(const String& ns,
00163 const CIMQualifierType& qt, OperationContext& context);
00164 #endif // #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00165
00189 virtual CIMClass getClass(
00190 const String& ns,
00191 const String& className,
00192 WBEMFlags::ELocalOnlyFlag localOnly, WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00193 WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, const StringArray* propertyList,
00194 OperationContext& context);
00195 #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00196
00213 virtual CIMClass deleteClass(const String& ns, const String& className,
00214 OperationContext& context);
00230 virtual void createClass(const String& ns, const CIMClass& cimClass,
00231 OperationContext& context);
00252 virtual CIMClass modifyClass(
00253 const String& ns,
00254 const CIMClass& cc,
00255 OperationContext& context);
00256 #endif // #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00257
00279 virtual void enumClasses(const String& ns,
00280 const String& className,
00281 CIMClassResultHandlerIFC& result,
00282 WBEMFlags::EDeepFlag deep, WBEMFlags::ELocalOnlyFlag localOnly, WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00283 WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, OperationContext& context);
00303 virtual void enumClassNames(const String& ns,
00304 const String& className,
00305 StringResultHandlerIFC& result,
00306 WBEMFlags::EDeepFlag deep, OperationContext& context);
00333 virtual void enumInstances(
00334 const String& ns,
00335 const String& className,
00336 CIMInstanceResultHandlerIFC& result,
00337 WBEMFlags::EDeepFlag deep,
00338 WBEMFlags::ELocalOnlyFlag localOnly,
00339 WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00340 WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00341 const StringArray* propertyList,
00342 WBEMFlags::EEnumSubclassesFlag enumSubclasses,
00343 OperationContext& context);
00364 virtual void enumInstanceNames(
00365 const String& ns,
00366 const String& className,
00367 CIMObjectPathResultHandlerIFC& result,
00368 WBEMFlags::EDeepFlag deep, OperationContext& context);
00392 virtual CIMInstance getInstance(
00393 const String& ns,
00394 const CIMObjectPath& instanceName,
00395 WBEMFlags::ELocalOnlyFlag localOnly, WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00396 WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, const StringArray* propertyList,
00397 OperationContext& context);
00398 virtual CIMInstance getInstance(
00399 const String& ns,
00400 const CIMObjectPath& instanceName,
00401 WBEMFlags::ELocalOnlyFlag localOnly, WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00402 WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, const StringArray* propertyList,
00403 CIMClass* pOutClass, OperationContext& context);
00404 #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00405
00419 virtual CIMInstance deleteInstance(const String& ns, const CIMObjectPath& cop,
00420 OperationContext& context);
00436 virtual CIMObjectPath createInstance(const String& ns,
00437 const CIMInstance& ci,
00438 OperationContext& context);
00457 virtual CIMInstance modifyInstance(
00458 const String& ns,
00459 const CIMInstance& modifiedInstance,
00460 WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00461 const StringArray* propertyList,
00462 OperationContext& context);
00463 #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00464
00472 virtual void setProperty(
00473 const String& ns,
00474 const CIMObjectPath& name, const String& propertyName,
00475 const CIMValue& cv, OperationContext& context);
00476 #endif // #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00477
00478 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00479
00480 #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00481
00490 virtual CIMValue getProperty(
00491 const String& ns,
00492 const CIMObjectPath& name,
00493 const String& propertyName, OperationContext& context);
00494 #endif // #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00495
00508 virtual CIMValue invokeMethod(
00509 const String& ns,
00510 const CIMObjectPath& path,
00511 const String& methodName, const CIMParamValueArray& inParams,
00512 CIMParamValueArray& outParams, OperationContext& context);
00513 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00514 virtual void associatorNames(
00515 const String& ns,
00516 const CIMObjectPath& path,
00517 CIMObjectPathResultHandlerIFC& result,
00518 const String& assocClass,
00519 const String& resultClass, const String& role,
00520 const String& resultRole, OperationContext& context);
00521 virtual void associators(
00522 const String& ns,
00523 const CIMObjectPath& path,
00524 CIMInstanceResultHandlerIFC& result,
00525 const String& assocClass,
00526 const String& resultClass, const String& role,
00527 const String& resultRole, WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00528 WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, const StringArray* propertyList,
00529 OperationContext& context);
00530 virtual void associatorsClasses(
00531 const String& ns,
00532 const CIMObjectPath& path,
00533 CIMClassResultHandlerIFC& result,
00534 const String& assocClass,
00535 const String& resultClass, const String& role,
00536 const String& resultRole, WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00537 WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, const StringArray* propertyList,
00538 OperationContext& context);
00539 virtual void referenceNames(
00540 const String& ns,
00541 const CIMObjectPath& path,
00542 CIMObjectPathResultHandlerIFC& result,
00543 const String& resultClass,
00544 const String& role, OperationContext& context);
00545 virtual void references(
00546 const String& ns,
00547 const CIMObjectPath& path,
00548 CIMInstanceResultHandlerIFC& result,
00549 const String& resultClass,
00550 const String& role, WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00551 WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, const StringArray* propertyList,
00552 OperationContext& context);
00553
00554 virtual void referencesClasses(
00555 const String& ns,
00556 const CIMObjectPath& path,
00557 CIMClassResultHandlerIFC& result,
00558 const String& resultClass,
00559 const String& role, WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00560 WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, const StringArray* propertyList,
00561 OperationContext& context);
00562 #endif // #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00563
00576 virtual void execQuery(
00577 const String& ns,
00578 CIMInstanceResultHandlerIFC& result,
00579 const String &query, const String& queryLanguage,
00580 OperationContext& context);
00581
00582 ServiceEnvironmentIFCRef getEnvironment() const;
00583 public:
00584 void _getCIMInstanceNames(const String& ns, const CIMName& className,
00585 const CIMClass& theClass, CIMObjectPathResultHandlerIFC& result,
00586 OperationContext& context);
00587 void _getCIMInstances(
00588 const String& ns,
00589 const CIMName& className,
00590 const CIMClass& theTopClass,
00591 const CIMClass& theClass, CIMInstanceResultHandlerIFC& result,
00592 WBEMFlags::ELocalOnlyFlag localOnly, WBEMFlags::EDeepFlag deep, WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00593 WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, const StringArray* propertyList,
00594 OperationContext& context);
00595 private:
00604 bool _instanceExists(const String& ns, const CIMObjectPath& cop,
00605 OperationContext& context);
00606 public:
00607 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00608 bool _isDynamicAssoc(const String& ns, const CIMClass& cc, OperationContext& context);
00609 #endif
00610 private:
00611 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00612 void _commonAssociators(
00613 const String& ns,
00614 const CIMObjectPath& path,
00615 const CIMName& assocClassName, const CIMName& resultClass,
00616 const CIMName& role, const CIMName& resultRole,
00617 WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00618 const StringArray* propertyList, CIMInstanceResultHandlerIFC* piresult,
00619 CIMObjectPathResultHandlerIFC* popresult,
00620 CIMClassResultHandlerIFC* pcresult,
00621 OperationContext& context);
00622 void _dynamicAssociators(const CIMObjectPath& path,
00623 const CIMClassArray& assocClasses, const CIMName& resultClass,
00624 const CIMName& role, const CIMName& resultRole,
00625 WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00626 const StringArray* propertyList, CIMInstanceResultHandlerIFC* piresult,
00627 CIMObjectPathResultHandlerIFC* popresult, OperationContext& context);
00628 void _commonReferences(
00629 const String& ns,
00630 const CIMObjectPath& path,
00631 const CIMName& resultClass, const CIMName& role,
00632 WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00633 const StringArray* propertyList, CIMInstanceResultHandlerIFC* piresult,
00634 CIMObjectPathResultHandlerIFC* popresult,
00635 CIMClassResultHandlerIFC* pcresult,
00636 OperationContext& context);
00637 void _dynamicReferences(const CIMObjectPath& path,
00638 const CIMClassArray& dynamicAssocs, const CIMName& role,
00639 WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00640 const StringArray* propertyList, CIMInstanceResultHandlerIFC* piresult,
00641 CIMObjectPathResultHandlerIFC* popresult, OperationContext& context);
00642 void _getAssociationClasses(const String& ns,
00643 const CIMName& assocClassName, const CIMName& className,
00644 CIMClassResultHandlerIFC& result, const CIMName& role, OperationContext& context);
00645 #endif
00646
00652 CIMClass _getNameSpaceClass(const CIMName& className);
00653 InstanceProviderIFCRef _getInstanceProvider(const String& ns,
00654 const CIMClass& cls, OperationContext& context);
00655 SecondaryInstanceProviderIFCRefArray _getSecondaryInstanceProviders(const String& ns, const CIMName& className, OperationContext& context);
00656
00657 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00658 AssociatorProviderIFCRef _getAssociatorProvider(const String& ns, const CIMClass& cls, OperationContext& context);
00659 #endif
00660 private:
00661 CIMClass _instGetClass(const String& ns, const CIMName& className,
00662 WBEMFlags::ELocalOnlyFlag localOnly,
00663 WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00664 const StringArray* propertyList, OperationContext& context);
00665
00666 void _checkNameSpaceAccess(OperationContext& context,
00667 const String& ns, Authorizer2IFC::EAccessType acType);
00668
00669 ProviderManagerRef m_provManager;
00670
00671 virtual void beginOperation(WBEMFlags::EOperationFlag op, OperationContext& context);
00672 virtual void endOperation(WBEMFlags::EOperationFlag op, OperationContext& context, WBEMFlags::EOperationResultFlag result);
00673
00674 Mutex m_guard;
00675 CIMClass m_nsClass_Namespace;
00676 ServiceEnvironmentIFCRef m_env;
00677 RepositoryIFCRef m_cimRepository;
00678 IntrusiveReference<CIMRepository> m_realRepository;
00679 AuthorizerManagerRef m_authorizerMgr;
00680 LoggerRef m_logger;
00681 };
00682
00683 }
00684
00685 #endif