OW_CppInstanceProviderIFC.cpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * Copyright (C) 2003-2006 Novell 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 Novell 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 Novell, 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 #include "OW_config.h"
00036 #include "OW_CppInstanceProviderIFC.hpp"
00037 #include "OW_CIMInstance.hpp"
00038 #include "OW_ResultHandlerIFC.hpp"
00039 
00040 namespace OW_NAMESPACE
00041 {
00042 
00043     class _RHEnumInstances : public CIMObjectPathResultHandlerIFC
00044     {
00045     public:
00046         _RHEnumInstances(
00047           CppInstanceProviderIFC& ip,
00048           const ProviderEnvironmentIFCRef& env,
00049           const String& ns,
00050           CIMInstanceResultHandlerIFC& result,
00051           WBEMFlags::ELocalOnlyFlag localOnly,
00052           WBEMFlags::EDeepFlag deep,
00053           WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00054           WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00055           const StringArray* propertyList,
00056           const CIMClass& cimClass )
00057             : _ip(ip)
00058             , _env(env)
00059             , _ns(ns)
00060             , _realHandler(result)
00061             , _localOnly(localOnly)
00062             , _includeQualifiers(includeQualifiers)
00063             , _includeClassOrigin(includeClassOrigin)
00064             , _propertyList(propertyList)
00065             , _cimClass(cimClass)
00066         {}
00067 
00068         void doHandle(const CIMObjectPath& cop)
00069         {
00070             CIMInstance inst = _ip.getInstance(_env,_ns, cop,_localOnly,
00071                                                 _includeQualifiers,
00072                                                 _includeClassOrigin,
00073                                                 _propertyList, _cimClass);
00074             _realHandler.handle(inst);
00075         }
00076     private:
00077         CppInstanceProviderIFC& _ip;
00078         const ProviderEnvironmentIFCRef& _env;
00079         const String& _ns;
00080         CIMInstanceResultHandlerIFC& _realHandler;
00081         WBEMFlags::ELocalOnlyFlag _localOnly;
00082         WBEMFlags::EIncludeQualifiersFlag _includeQualifiers;
00083         WBEMFlags::EIncludeClassOriginFlag _includeClassOrigin;
00084         const StringArray* _propertyList;
00085         const CIMClass& _cimClass;
00086     };
00088 
00089     void
00090     CppInstanceProviderIFC::enumInstances(
00091                                       const ProviderEnvironmentIFCRef& env,
00092                                       const String& ns,
00093                                       const String& className,
00094                                       CIMInstanceResultHandlerIFC& result,
00095                                       WBEMFlags::ELocalOnlyFlag localOnly,
00096                                       WBEMFlags::EDeepFlag deep,
00097                                       WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00098                                       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00099                                       const StringArray* propertyList,
00100                                       const CIMClass& requestedClass,
00101                                       const CIMClass& cimClass )
00102     {
00103         _RHEnumInstances rh(*this,env , ns,result ,localOnly ,deep ,includeQualifiers ,
00104               includeClassOrigin ,propertyList , cimClass);
00105         enumInstanceNames(env,ns ,className , rh,cimClass);
00106     }
00107 
00109    void 
00110    CppInstanceProviderIFC::getInstanceProviderInfoWithEnv(
00111       const ProviderRegistrationEnvironmentIFCRef& env,
00112       InstanceProviderInfo& info)
00113    {
00114       return getInstanceProviderInfo(info);
00115    }
00116 
00118    void
00119    CppInstanceProviderIFC::getInstanceProviderInfo(InstanceProviderInfo& info)
00120    {
00121    }
00122 
00124    CppInstanceProviderIFC*
00125    CppInstanceProviderIFC::getInstanceProvider()
00126    {
00127       return this;
00128    }
00129 
00131    CppInstanceProviderIFC::CppInstanceProviderIFC()
00132    {
00133    }
00134 
00136    CppInstanceProviderIFC::~CppInstanceProviderIFC()
00137    {
00138    }
00139 
00140 } // end namespace OW_NAMESPACE
00141 

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