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 #include "OWBI1_config.h" 00036 #include "OWBI1_ProxyProviderDetail.hpp" 00037 00038 #include "OW_SharedLibraryReference.hpp" 00039 #include "OW_TempFileStream.hpp" 00040 #include "OW_BinarySerialization.hpp" 00041 #include "OWBI1_CIMInstance.hpp" 00042 #include "OWBI1_WQLSelectStatement.hpp" 00043 #include "OW_ResultHandlerIFC.hpp" 00044 #include "OWBI1_ResultHandlerIFC.hpp" 00045 #include "OW_CIMObjectPath.hpp" 00046 #include "OWBI1_CIMObjectPath.hpp" 00047 #include "OW_CIMClass.hpp" 00048 #include "OWBI1_CIMClass.hpp" 00049 #include "OW_CIMValue.hpp" 00050 #include "OWBI1_CIMValue.hpp" 00051 #include "OWBI1_CIMPropertyList.hpp" 00052 #include "OWBI1_ProviderEnvironmentIFC.hpp" 00053 #include "OW_CIMParamValue.hpp" 00054 #include "OWBI1_CIMParamValue.hpp" 00055 00056 // The classes and functions defined in this file are not meant for general 00057 // use, they are internal implementation details. They may change at any time. 00058 00059 namespace OWBI1 00060 { 00061 00062 namespace detail 00063 { 00064 00065 OWBI1::CIMInstance convertCIMInstance(const OpenWBEM::CIMInstance& inst) 00066 { 00067 return OWBI1::CIMInstance(OWBI1::CIMInstanceRep(inst)); 00068 } 00069 00070 OpenWBEM::CIMInstance convertCIMInstance(const OWBI1::CIMInstance& inst) 00071 { 00072 return inst.getRep()->inst; 00073 } 00074 00075 OWBI1::CIMInstanceArray convertCIMInstances(const OpenWBEM::CIMInstanceArray& inst) 00076 { 00077 return OWBI1::CIMInstanceArray(); 00078 } 00079 00080 OpenWBEM::CIMInstanceArray convertCIMInstances(const OWBI1::CIMInstanceArray& inst) 00081 { 00082 return OpenWBEM::CIMInstanceArray(); 00083 } 00084 00085 OWBI1::CIMObjectPath convertCIMObjectPath(const OpenWBEM::CIMObjectPath& inst) 00086 { 00087 return OWBI1::CIMObjectPath(); 00088 } 00089 00090 OpenWBEM::CIMObjectPath convertCIMObjectPath(const OWBI1::CIMObjectPath& inst) 00091 { 00092 return OpenWBEM::CIMObjectPath(); 00093 } 00094 00095 OWBI1::CIMClass convertCIMClass(const OpenWBEM::CIMClass& inst) 00096 { 00097 return OWBI1::CIMClass(); 00098 } 00099 00100 OpenWBEM::CIMClass convertCIMClass(const OWBI1::CIMClass& inst) 00101 { 00102 return OpenWBEM::CIMClass(); 00103 } 00104 00105 OWBI1::CIMParamValueArray convertCIMParamValues(const OpenWBEM::CIMParamValueArray& inst) 00106 { 00107 return OWBI1::CIMParamValueArray(); 00108 } 00109 00110 OpenWBEM::CIMParamValueArray convertCIMParamValues(const OWBI1::CIMParamValueArray& inst) 00111 { 00112 return OpenWBEM::CIMParamValueArray(); 00113 } 00114 00115 OWBI1::CIMValue convertCIMValue(const OpenWBEM::CIMValue& inst) 00116 { 00117 return OWBI1::CIMValue(CIMNULL); 00118 } 00119 00120 OpenWBEM::CIMValue convertCIMValue(const OWBI1::CIMValue& inst) 00121 { 00122 return OpenWBEM::CIMValue(OpenWBEM::CIMNULL); 00123 } 00124 00125 OWBI1::ProviderEnvironmentIFCRef createProvEnvWrapper(const OpenWBEM::ProviderEnvironmentIFCRef& env) 00126 { 00127 return OWBI1::ProviderEnvironmentIFCRef(); 00128 } 00129 00130 OWBI1::WQLSelectStatement convertWQLSelectStatement(const OpenWBEM::WQLSelectStatement& stmt) 00131 { 00132 return OWBI1::WQLSelectStatement(); 00133 } 00134 00135 OWBI1::StringArray convertStringArray(const OpenWBEM::StringArray& in) 00136 { 00137 OpenWBEM::TempFileStream tfs; 00138 OpenWBEM::BinarySerialization::writeArray(tfs, in); 00139 OWBI1::StringArray out; 00140 OpenWBEM::BinarySerialization::readArray(tfs, out); 00141 return out; 00142 } 00143 00144 OpenWBEM::StringArray convertStringArray(const OWBI1::StringArray& in) 00145 { 00146 OpenWBEM::TempFileStream tfs; 00147 OpenWBEM::BinarySerialization::writeArray(tfs, in); 00148 OpenWBEM::StringArray out; 00149 OpenWBEM::BinarySerialization::readArray(tfs, out); 00150 return out; 00151 } 00152 00153 OWBI1::WBEMFlags::EIncludeQualifiersFlag convertWBEMFlag(OpenWBEM::WBEMFlags::EIncludeQualifiersFlag includeQualifiers) 00154 { 00155 return OWBI1::WBEMFlags::EIncludeQualifiersFlag(); 00156 } 00157 OWBI1::WBEMFlags::EIncludeClassOriginFlag convertWBEMFlag(OpenWBEM::WBEMFlags::EIncludeClassOriginFlag includeClassOrigin) 00158 { 00159 return OWBI1::WBEMFlags::EIncludeClassOriginFlag(); 00160 } 00161 00162 OWBI1::WBEMFlags::ELocalOnlyFlag convertWBEMFlag(OpenWBEM::WBEMFlags::ELocalOnlyFlag includeClassOrigin) 00163 { 00164 return OWBI1::WBEMFlags::ELocalOnlyFlag(); 00165 } 00166 OWBI1::WBEMFlags::EDeepFlag convertWBEMFlag(OpenWBEM::WBEMFlags::EDeepFlag includeClassOrigin) 00167 { 00168 return OWBI1::WBEMFlags::EDeepFlag(); 00169 } 00170 00171 OWBI1::CIMPropertyList convertPropertyList(const OpenWBEM::StringArray* propertyList) 00172 { 00173 return OWBI1::CIMPropertyList(); 00174 } 00175 00176 CIMInstanceResultHandlerWrapper::CIMInstanceResultHandlerWrapper(OpenWBEM::CIMInstanceResultHandlerIFC& wrapped) 00177 : m_wrapped(wrapped) 00178 { 00179 } 00180 00181 void CIMInstanceResultHandlerWrapper::doHandle(const CIMInstance& i) 00182 { 00183 // TODO: handle includeQualifiers & includeClassOrigin 00184 m_wrapped.handle(convertCIMInstance(i)); 00185 } 00186 00187 CIMObjectPathResultHandlerWrapper::CIMObjectPathResultHandlerWrapper(OpenWBEM::CIMObjectPathResultHandlerIFC& wrapped) 00188 : m_wrapped(wrapped) 00189 { 00190 } 00191 00192 void CIMObjectPathResultHandlerWrapper::doHandle(const CIMObjectPath& i) 00193 { 00194 m_wrapped.handle(convertCIMObjectPath(i)); 00195 } 00196 00197 00198 } // end namespace ProxyProviderDetail 00199 } // end namespace OWBI1 00200 00201 00202