OW_ProviderManager.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 
00035 #ifndef OW_PROVIDERMANAGER_HPP_
00036 #define OW_PROVIDERMANAGER_HPP_
00037 #include "OW_config.h"
00038 #include "OW_InstanceProviderIFC.hpp"
00039 #include "OW_MethodProviderIFC.hpp"
00040 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00041 #include "OW_AssociatorProviderIFC.hpp"
00042 #endif
00043 #include "OW_PolledProviderIFC.hpp"
00044 #include "OW_IndicationExportProviderIFC.hpp"
00045 #include "OW_IndicationProviderIFC.hpp"
00046 #include "OW_SecondaryInstanceProviderIFC.hpp"
00047 #include "OW_ProviderIFCLoader.hpp"
00048 #include "OW_Mutex.hpp"
00049 #include "OW_HashMap.hpp"
00050 #include "OW_HashMultiMap.hpp"
00051 #include "OW_ServiceIFC.hpp"
00052 #include "OW_Logger.hpp"
00053 #include "OW_CimomCommonFwd.hpp"
00054 #include "OW_SortedVectorSet.hpp"
00055 
00056 namespace OW_NAMESPACE
00057 {
00058 
00064 class OW_CIMOMCOMMON_API ProviderManager : public ServiceIFC
00065 {
00066 public:
00074    void load(const ProviderIFCLoaderRef& ifcLoader, const ServiceEnvironmentIFCRef& env);
00075 
00076    virtual String getName() const;
00082    virtual void init(const ServiceEnvironmentIFCRef& env);
00083    
00088    virtual void shutdown();
00089 
00095    virtual void shuttingDown();
00096 
00113    InstanceProviderIFCRef getInstanceProvider(const ProviderEnvironmentIFCRef& env,
00114       const String& ns, const CIMClass& cc) const;
00115 
00125    SecondaryInstanceProviderIFCRefArray getSecondaryInstanceProviders(const ProviderEnvironmentIFCRef& env,
00126       const String& ns, const CIMName& className) const;
00141    MethodProviderIFCRef getMethodProvider(const ProviderEnvironmentIFCRef& env,
00142       const String& ns, const CIMClass& cc, const CIMMethod& method) const;
00143 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00144 
00160    AssociatorProviderIFCRef getAssociatorProvider(const ProviderEnvironmentIFCRef& env,
00161       const String& ns, const CIMClass& cc) const;
00162 #endif
00163 
00167    IndicationExportProviderIFCRefArray
00168       getIndicationExportProviders(const ProviderEnvironmentIFCRef& env) const;
00173    PolledProviderIFCRefArray
00174       getPolledProviders(const ProviderEnvironmentIFCRef& env) const;
00182    IndicationProviderIFCRefArray
00183       getIndicationProviders(const ProviderEnvironmentIFCRef& env,
00184          const String& ns, const CIMName& indicationClassName,
00185          const CIMNameArray& monitoredClassNames) const;
00190    void unloadProviders(const ProviderEnvironmentIFCRef& env);
00191 private:
00192    ProviderIFCBaseIFCRef getProviderIFC(const ProviderEnvironmentIFCRef& env,
00193       const CIMQualifier& qual,
00194       String& provStr) const;
00195    bool isRestrictedNamespace(const String& ns) const;
00196    Array<ProviderIFCBaseIFCRef> m_IFCArray;
00197    Mutex m_guard;
00198 public:  // so free functions in cpp file can access them.
00199    struct ProvReg
00200    {
00201       String provName;
00202       ProviderIFCBaseIFCRef ifc;
00203    };
00204    typedef HashMap<String, ProvReg> ProvRegMap_t;
00205    typedef HashMultiMap<String, ProvReg> MultiProvRegMap_t;
00206    typedef SortedVectorSet<String> NameSpaceSet_t;
00207    
00208    static String COMPONENT_NAME;
00209 
00210 private:
00211 
00212    void findIndicationProviders(
00213       const ProviderEnvironmentIFCRef& env,
00214       const String& ns,
00215       const CIMName& className,
00216       const ProviderManager::MultiProvRegMap_t& indProvs,
00217       IndicationProviderIFCRefArray& rval) const;
00218 
00219    // The key must be: a classname if the provider supports any namespace,
00220    // or namespace:classname for a specific namespace.
00221    ProvRegMap_t m_registeredInstProvs;
00222 
00223    // The key must be: a classname if the provider supports any namespace,
00224    // or namespace:classname for a specific namespace.
00225    MultiProvRegMap_t m_registeredSecInstProvs;
00226 
00227 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00228    ProvRegMap_t m_registeredAssocProvs;
00229 #endif
00230    // The key must be: [namespace:]className[:methodname]
00231    ProvRegMap_t m_registeredMethProvs;
00232    // The key must be: [namespace:]className[:propertyname]
00233    ProvRegMap_t m_registeredPropProvs;
00234    // The key must be: a classname if the provider supports any namespace,
00235    // namespace:classname for a specific namespace.
00236    // For a lifecycle provider, /* and /classname entries are made for each lifecycle class.
00237    MultiProvRegMap_t m_registeredIndProvs;
00238 
00239    LoggerRef m_logger;
00240    ServiceEnvironmentIFCRef m_env;
00241    NameSpaceSet_t m_restrictedNamespaces;
00242 };
00243 
00244 } // end namespace OW_NAMESPACE
00245 
00246 #endif

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