OW_CppProxyProvider.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_CPPPROXYPROVIDER_HPP_
00036 #define OW_CPPPROXYPROVIDER_HPP_
00037 #include "OW_config.h"
00038 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00039 #include "OW_AssociatorProviderIFC.hpp"
00040 #endif
00041 #include "OW_InstanceProviderIFC.hpp"
00042 #include "OW_SecondaryInstanceProviderIFC.hpp"
00043 #include "OW_MethodProviderIFC.hpp"
00044 #include "OW_PolledProviderIFC.hpp"
00045 #include "OW_IndicationExportProviderIFC.hpp"
00046 #include "OW_IndicationProviderIFC.hpp"
00047 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00048 #include "OW_CppAssociatorProviderIFC.hpp"
00049 #endif
00050 #include "OW_CppInstanceProviderIFC.hpp"
00051 #include "OW_CppSecondaryInstanceProviderIFC.hpp"
00052 #include "OW_CppMethodProviderIFC.hpp"
00053 #include "OW_CppPolledProviderIFC.hpp"
00054 #include "OW_CppIndicationExportProviderIFC.hpp"
00055 #include "OW_CppIndicationProviderIFC.hpp"
00056 
00057 // The classes and functions defined in this file are not meant for general
00058 // use, they are internal implementation details.  They may change at any time.
00059 
00060 namespace OW_NAMESPACE
00061 {
00062 
00063 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00064 
00065 class OW_CPPPROVIFC_API CppAssociatorProviderProxy : public AssociatorProviderIFC
00066 {
00067 public:
00068    CppAssociatorProviderProxy(CppAssociatorProviderIFCRef pProv);
00069    
00070    virtual void associators(
00071          const ProviderEnvironmentIFCRef& env,
00072          CIMInstanceResultHandlerIFC& result,
00073          const String& ns,
00074          const CIMObjectPath& objectName,
00075          const String& assocClass,
00076          const String& resultClass,
00077          const String& role,
00078          const String& resultRole,
00079          WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00080          WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00081          const StringArray* propertyList);
00082    virtual void associatorNames(
00083          const ProviderEnvironmentIFCRef& env,
00084          CIMObjectPathResultHandlerIFC& result,
00085          const String& ns,
00086          const CIMObjectPath& objectName,
00087          const String& assocClass,
00088          const String& resultClass,
00089          const String& role,
00090          const String& resultRole);
00091    virtual void references(
00092          const ProviderEnvironmentIFCRef& env,
00093          CIMInstanceResultHandlerIFC& result,
00094          const String& ns,
00095          const CIMObjectPath& objectName,
00096          const String& resultClass,
00097          const String& role,
00098          WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00099          WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00100          const StringArray* propertyList);
00101    virtual void referenceNames(
00102          const ProviderEnvironmentIFCRef& env,
00103          CIMObjectPathResultHandlerIFC& result,
00104          const String& ns,
00105          const CIMObjectPath& objectName,
00106          const String& resultClass,
00107          const String& role);
00108 private:
00109    CppAssociatorProviderIFCRef m_pProv;
00110 };
00111 #endif // #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00112 
00113 class OW_CPPPROVIFC_API CppInstanceProviderProxy : public InstanceProviderIFC
00114 {
00115 public:
00116    CppInstanceProviderProxy(CppInstanceProviderIFCRef pProv);
00117    virtual void enumInstanceNames(
00118          const ProviderEnvironmentIFCRef& env,
00119          const String& ns,
00120          const String& className,
00121          CIMObjectPathResultHandlerIFC& result,
00122          const CIMClass& cimClass);
00123    virtual void enumInstances(
00124          const ProviderEnvironmentIFCRef& env,
00125          const String& ns,
00126          const String& className,
00127          CIMInstanceResultHandlerIFC& result,
00128          WBEMFlags::ELocalOnlyFlag localOnly, 
00129          WBEMFlags::EDeepFlag deep, 
00130          WBEMFlags::EIncludeQualifiersFlag includeQualifiers, 
00131          WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00132          const StringArray* propertyList,
00133          const CIMClass& requestedClass,
00134          const CIMClass& cimClass);
00135    virtual CIMInstance getInstance(
00136          const ProviderEnvironmentIFCRef& env,
00137          const String& ns,
00138          const CIMObjectPath& instanceName,
00139          WBEMFlags::ELocalOnlyFlag localOnly,
00140          WBEMFlags::EIncludeQualifiersFlag includeQualifiers, 
00141          WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00142          const StringArray* propertyList, 
00143          const CIMClass& cimClass);
00144 #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00145    virtual CIMObjectPath createInstance(
00146          const ProviderEnvironmentIFCRef& env,
00147          const String& ns,
00148          const CIMInstance& cimInstance);
00149    virtual void modifyInstance(
00150          const ProviderEnvironmentIFCRef& env,
00151          const String& ns,
00152          const CIMInstance& modifiedInstance,
00153          const CIMInstance& previousInstance,
00154          WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00155          const StringArray* propertyList,
00156          const CIMClass& theClass);
00157    virtual void deleteInstance(
00158          const ProviderEnvironmentIFCRef& env,
00159          const String& ns,
00160          const CIMObjectPath& cop);
00161 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00162 private:
00163    CppInstanceProviderIFCRef m_pProv;
00164 };
00165 
00166 class OW_CPPPROVIFC_API CppSecondaryInstanceProviderProxy : public SecondaryInstanceProviderIFC
00167 {
00168 public:
00169    CppSecondaryInstanceProviderProxy(CppSecondaryInstanceProviderIFCRef pProv);
00170    virtual void filterInstances(const ProviderEnvironmentIFCRef &env, const String &ns, const String &className, CIMInstanceArray &instances, WBEMFlags:: ELocalOnlyFlag localOnly, WBEMFlags:: EDeepFlag deep, WBEMFlags:: EIncludeQualifiersFlag includeQualifiers, WBEMFlags:: EIncludeClassOriginFlag includeClassOrigin, const StringArray *propertyList, const CIMClass &requestedClass, const CIMClass &cimClass);
00171 #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00172    virtual void createInstance(const ProviderEnvironmentIFCRef &env, const String &ns, const CIMInstance &cimInstance);
00173    virtual void modifyInstance(const ProviderEnvironmentIFCRef &env, const String &ns, const CIMInstance &modifiedInstance, const CIMInstance &previousInstance, WBEMFlags:: EIncludeQualifiersFlag includeQualifiers, const StringArray *propertyList, const CIMClass &theClass);
00174    virtual void deleteInstance(const ProviderEnvironmentIFCRef &env, const String &ns, const CIMObjectPath &cop);
00175 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00176 private:
00177    CppSecondaryInstanceProviderIFCRef m_pProv;
00178 };
00179 
00180 class OW_CPPPROVIFC_API CppMethodProviderProxy : public MethodProviderIFC
00181 {
00182 public:
00183    CppMethodProviderProxy(CppMethodProviderIFCRef pProv);
00184    virtual CIMValue invokeMethod(
00185          const ProviderEnvironmentIFCRef& env,
00186          const String& ns,
00187          const CIMObjectPath& path,
00188          const String& methodName,
00189          const CIMParamValueArray& in,
00190          CIMParamValueArray& out);
00191 private:
00192    CppMethodProviderIFCRef m_pProv;
00193 };
00194 class OW_CPPPROVIFC_API CppIndicationExportProviderProxy : public IndicationExportProviderIFC
00195 {
00196 public:
00197    CppIndicationExportProviderProxy(CppIndicationExportProviderIFCRef pProv) :
00198       m_pProv(pProv) {}
00199    virtual StringArray getHandlerClassNames()
00200    {
00201       return m_pProv->getHandlerClassNames();
00202    }
00203    
00204    virtual void exportIndication(const ProviderEnvironmentIFCRef& env,
00205       const String& ns,
00206       const CIMInstance& indHandlerInst, const CIMInstance& indicationInst)
00207    {
00208       m_pProv->exportIndication(env, ns, indHandlerInst, indicationInst);
00209    }
00210 
00211    virtual void doCooperativeCancel()
00212    {
00213       m_pProv->doCooperativeCancel();
00214    }
00215    virtual void doDefinitiveCancel()
00216    {
00217       m_pProv->doDefinitiveCancel();
00218    }
00219 private:
00220    CppIndicationExportProviderIFCRef m_pProv;
00221 };
00222 class OW_CPPPROVIFC_API CppPolledProviderProxy : public PolledProviderIFC
00223 {
00224 public:
00225    CppPolledProviderProxy(CppPolledProviderIFCRef pProv) :
00226       m_pProv(pProv) {}
00227    virtual Int32 poll(const ProviderEnvironmentIFCRef& env )
00228          { return m_pProv->poll(env); }
00229    virtual Int32 getInitialPollingInterval(const ProviderEnvironmentIFCRef& env )
00230          { return m_pProv->getInitialPollingInterval(env); }
00231    virtual void doCooperativeCancel()
00232    {
00233       m_pProv->doCooperativeCancel();
00234    }
00235    virtual void doDefinitiveCancel()
00236    {
00237       m_pProv->doDefinitiveCancel();
00238    }
00239 private:
00240    CppPolledProviderIFCRef m_pProv;
00241 };
00242 class OW_CPPPROVIFC_API CppIndicationProviderProxy : public IndicationProviderIFC
00243 {
00244 public:
00245    CppIndicationProviderProxy(CppIndicationProviderIFCRef pProv)
00246       : m_pProv(pProv)
00247       , m_activationCount(0) {}
00248    virtual void deActivateFilter(
00249       const ProviderEnvironmentIFCRef &env, 
00250       const WQLSelectStatement &filter, 
00251       const String &eventType, 
00252       const String& nameSpace,
00253       const StringArray& classes) 
00254    {
00255       bool lastActivation = (--m_activationCount == 0);
00256       m_pProv->deActivateFilter(env,filter,eventType,nameSpace, classes,lastActivation);
00257    }
00258    virtual void activateFilter(
00259       const ProviderEnvironmentIFCRef &env, 
00260       const WQLSelectStatement &filter, 
00261       const String &eventType, 
00262       const String& nameSpace,
00263       const StringArray& classes) 
00264    {
00265       bool firstActivation = (m_activationCount++ == 0);
00266       m_pProv->activateFilter(env,filter,eventType,nameSpace,classes,firstActivation);
00267    }
00268    virtual void authorizeFilter(
00269       const ProviderEnvironmentIFCRef &env, 
00270       const WQLSelectStatement &filter, 
00271       const String &eventType, 
00272       const String& nameSpace,
00273       const StringArray& classes, 
00274       const String &owner) 
00275    {
00276       m_pProv->authorizeFilter(env,filter,eventType,nameSpace,classes,owner);
00277    }
00278    virtual int mustPoll(
00279       const ProviderEnvironmentIFCRef& env,
00280       const WQLSelectStatement& filter, 
00281       const String& eventType, 
00282       const String& nameSpace,
00283       const StringArray& classes
00284       )
00285    {
00286       return m_pProv->mustPoll(env,filter,eventType,nameSpace,classes);
00287    }
00288 private:
00289    CppIndicationProviderIFCRef m_pProv;
00290    unsigned int m_activationCount;
00291 };
00292 
00293 } // end namespace OW_NAMESPACE
00294 
00295 #endif

Generated on Thu Feb 9 08:47:58 2006 for openwbem by  doxygen 1.4.6