OW_WQLFilterRep.cpp

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 #include "OW_config.h"
00036 #include "OW_WQLFilterRep.hpp"
00037 #include "OW_CIMException.hpp"
00038 #include "OW_CIMQualifierType.hpp"
00039 #include "OW_Array.hpp"
00040 #include "OW_CIMClass.hpp"
00041 #include "OW_CIMServer.hpp"
00042 #include "OW_CIMValue.hpp"
00043 #include "OW_CIMObjectPath.hpp"
00044 #include "OW_ServiceIFCNames.hpp"
00045 
00046 namespace OW_NAMESPACE
00047 {
00048 
00049 using namespace WBEMFlags;
00051 WQLFilterRep::WQLFilterRep(const CIMInstance& inst,
00052    const RepositoryIFCRef& cimServer)
00053    : RepositoryIFC()
00054    , m_inst(inst)
00055    , m_pCIMServer(cimServer)
00056 {
00057 }
00059 String
00060 WQLFilterRep::getName() const
00061 {
00062    return ServiceIFCNames::WQLFilterRep;
00063 }
00065 ServiceEnvironmentIFCRef
00066 WQLFilterRep::getEnvironment() const
00067 {
00068    return m_pCIMServer->getEnvironment();
00069 }
00071 void
00072 WQLFilterRep::enumNameSpace(
00073    StringResultHandlerIFC&,
00074    OperationContext&)
00075 {
00076    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00077       "is supported in the WQLCIMOMHandle.");
00078 }
00079 #if !defined(OW_DISABLE_INSTANCE_MANIPULATION) && !defined(OW_DISABLE_NAMESPACE_MANIPULATION)
00080 
00081 void
00082 WQLFilterRep::createNameSpace(const String& /*ns*/,
00083    OperationContext&)
00084 {
00085    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00086       "is supported in the WQLCIMOMHandle.");
00087 }
00089 void
00090 WQLFilterRep::deleteNameSpace(const String& /*ns*/,
00091    OperationContext&)
00092 {
00093    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00094       "is supported in the WQLCIMOMHandle.");
00095 }
00096 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00097 
00098 CIMQualifierType
00099 WQLFilterRep::getQualifierType(const String&,
00100    const String&,
00101    OperationContext&)
00102 {
00103    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00104       "is supported in the WQLCIMOMHandle.");
00105 }
00106 #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00107 
00108 void
00109 WQLFilterRep::setQualifierType(const String &/*ns*/,
00110    const CIMQualifierType &/*qt*/, OperationContext&)
00111 {
00112    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00113       "is supported in the WQLCIMOMHandle.");
00114 }
00116 void
00117 WQLFilterRep::enumQualifierTypes(
00118    const String&,
00119    CIMQualifierTypeResultHandlerIFC&, OperationContext&)
00120 {
00121    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00122       "is supported in the WQLCIMOMHandle.");
00123 }
00125 void
00126 WQLFilterRep::deleteQualifierType(const String& /*ns*/, const String& /*qualName*/,
00127    OperationContext&)
00128 {
00129    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00130       "is supported in the WQLCIMOMHandle.");
00131 }
00132 #endif // #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00133 #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00134 
00135 void
00136 WQLFilterRep::createClass(const String &/*path*/,
00137    const CIMClass &/*cimClass*/, OperationContext&)
00138 {
00139    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00140       "is supported in the WQLCIMOMHandle.");
00141 }
00143 CIMClass
00144 WQLFilterRep::modifyClass(const String &/*name*/,
00145    const CIMClass &/*cc*/, OperationContext&)
00146 {
00147    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00148       "is supported in the WQLCIMOMHandle.");
00149 }
00151 CIMClass
00152 WQLFilterRep::deleteClass(const String& /*ns*/, const String& /*className*/,
00153    OperationContext&)
00154 {
00155    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00156       "is supported in the WQLCIMOMHandle.");
00157 }
00158 #endif // #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00159 
00160 CIMClass
00161 WQLFilterRep::getClass(
00162    const String& ns,
00163    const String& className,
00164    ELocalOnlyFlag localOnly, EIncludeQualifiersFlag includeQualifiers,
00165    EIncludeClassOriginFlag includeClassOrigin, const StringArray* propertyList,
00166    OperationContext& context)
00167 {
00168    return m_pCIMServer->getClass(ns, className, localOnly, includeQualifiers, includeClassOrigin, propertyList,
00169       context);
00170 }
00172 CIMInstance
00173 WQLFilterRep::getInstance(const String&, const CIMObjectPath&,
00174    ELocalOnlyFlag localOnly, EIncludeQualifiersFlag includeQualifiers,
00175    EIncludeClassOriginFlag includeClassOrigin, const StringArray* propertyList,
00176    OperationContext&)
00177 {
00178    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00179       "is supported in the WQLCIMOMHandle.");
00180 }
00182 void
00183 WQLFilterRep::enumClasses(const String& ns,
00184    const String& className,
00185    CIMClassResultHandlerIFC& result,
00186    EDeepFlag deep,
00187    ELocalOnlyFlag localOnly,
00188    EIncludeQualifiersFlag includeQualifiers,
00189    EIncludeClassOriginFlag includeClassOrigin, OperationContext&)
00190 {
00191    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00192       "is supported in the WQLCIMOMHandle.");
00193 }
00195 void
00196 WQLFilterRep::enumClassNames(
00197    const String&,
00198    const String&,
00199    StringResultHandlerIFC&,
00200    EDeepFlag /*deep*/, OperationContext&)
00201 {
00202    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00203       "is supported in the WQLCIMOMHandle.");
00204 }
00206 void
00207 WQLFilterRep::enumInstances(
00208    const String& ns,
00209    const String& className,
00210    CIMInstanceResultHandlerIFC& result,
00211    EDeepFlag deep,
00212    ELocalOnlyFlag localOnly, EIncludeQualifiersFlag includeQualifiers, EIncludeClassOriginFlag includeClassOrigin,
00213    const StringArray* propertyList, EEnumSubclassesFlag enumSubclasses, OperationContext& context)
00214 {
00215    CIMName superClassName = m_inst.getClassName();
00216    while (superClassName != CIMName())
00217    {
00218       if (superClassName == className)
00219       {
00220          // Don't need to do correct localOnly & deep processing.
00221          //result.handleInstance(m_inst.clone(localOnly, includeQualifiers,
00222          // includeClassOrigin, propertyList));
00223          // This is more efficient
00224          result.handle(m_inst);
00225          break;
00226       }
00227       
00228       superClassName = m_pCIMServer->getClass(ns, superClassName.toString(),
00229          E_NOT_LOCAL_ONLY, E_INCLUDE_QUALIFIERS, E_INCLUDE_CLASS_ORIGIN,
00230          NULL, context).getSuperClass();
00231    }
00232 }
00234 void
00235 WQLFilterRep::enumInstanceNames(
00236    const String&,
00237    const String&,
00238    CIMObjectPathResultHandlerIFC&,
00239    EDeepFlag,
00240    OperationContext&)
00241 {
00242    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00243       "is supported in the WQLCIMOMHandle.");
00244 }
00245 #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00246 
00247 CIMObjectPath
00248 WQLFilterRep::createInstance(const String&,
00249    const CIMInstance &/*ci*/, OperationContext&)
00250 {
00251    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00252       "is supported in the WQLCIMOMHandle.");
00253 }
00255 CIMInstance
00256 WQLFilterRep::modifyInstance(
00257    const String& ns,
00258    const CIMInstance& modifiedInstance,
00259    EIncludeQualifiersFlag includeQualifiers,
00260    const StringArray* propertyList,
00261    OperationContext&)
00262 {
00263    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00264       "is supported in the WQLCIMOMHandle.");
00265 }
00267 CIMInstance
00268 WQLFilterRep::deleteInstance(const String& /*ns*/, const CIMObjectPath &/*cop*/,
00269    OperationContext&)
00270 {
00271    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00272       "is supported in the WQLCIMOMHandle.");
00273 }
00274 #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00275 
00276 void
00277 WQLFilterRep::setProperty(
00278    const String&,
00279    const CIMObjectPath &/*name*/,
00280    const String& /*propertyName*/, const CIMValue &/*cv*/,
00281    OperationContext&)
00282 {
00283    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00284       "is supported in the WQLCIMOMHandle.");
00285 }
00286 #endif // #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00287 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00288 #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00289 
00290 CIMValue
00291 WQLFilterRep::getProperty(
00292    const String&,
00293    const CIMObjectPath &/*name*/,
00294    const String &/*propertyName*/, OperationContext&)
00295 {
00296    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00297       "is supported in the WQLCIMOMHandle.");
00298 }
00299 #endif // #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00300 
00301 CIMValue
00302 WQLFilterRep::invokeMethod(const String&, const CIMObjectPath &/*name*/,
00303    const String &/*methodName*/, const CIMParamValueArray &/*inParams*/,
00304    CIMParamValueArray &/*outParams*/, OperationContext&)
00305 {
00306    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00307       "is supported in the WQLCIMOMHandle.");
00308 }
00309 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00310 
00311 void
00312 WQLFilterRep::associators(
00313    const String& ns,
00314    const CIMObjectPath &path,
00315    CIMInstanceResultHandlerIFC& result,
00316    const String &assocClass, const String &resultClass,
00317    const String &role, const String &resultRole,
00318    EIncludeQualifiersFlag includeQualifiers, EIncludeClassOriginFlag includeClassOrigin,
00319    const StringArray *propertyList, OperationContext&)
00320 {
00321    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00322       "is supported in the WQLCIMOMHandle.");
00323 }
00325 void
00326 WQLFilterRep::associatorsClasses(
00327    const String& ns,
00328    const CIMObjectPath &path,
00329    CIMClassResultHandlerIFC& result,
00330    const String &assocClass, const String &resultClass,
00331    const String &role, const String &resultRole,
00332    EIncludeQualifiersFlag includeQualifiers, EIncludeClassOriginFlag includeClassOrigin,
00333    const StringArray *propertyList, OperationContext&)
00334 {
00335    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00336       "is supported in the WQLCIMOMHandle.");
00337 }
00339 void
00340 WQLFilterRep::referenceNames(
00341    const String&,
00342    const CIMObjectPath &/*path*/,
00343    CIMObjectPathResultHandlerIFC&,
00344    const String &/*resultClass*/,
00345    const String &/*role*/, OperationContext&)
00346 {
00347    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00348       "is supported in the WQLCIMOMHandle.");
00349 }
00351 void
00352 WQLFilterRep::associatorNames(
00353    const String&,
00354    const CIMObjectPath &/*path*/,
00355    CIMObjectPathResultHandlerIFC&,
00356    const String &/*assocClass*/,
00357    const String &/*resultClass*/, const String &/*role*/,
00358    const String &/*resultRole*/, OperationContext&)
00359 {
00360    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00361       "is supported in the WQLCIMOMHandle.");
00362 }
00364 void
00365 WQLFilterRep::references(
00366    const String& ns,
00367    const CIMObjectPath &path,
00368    CIMInstanceResultHandlerIFC& result,
00369    const String &resultClass, const String &role,
00370    EIncludeQualifiersFlag includeQualifiers, EIncludeClassOriginFlag includeClassOrigin,
00371    const StringArray *propertyList, OperationContext&)
00372 {
00373    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00374       "is supported in the WQLCIMOMHandle.");
00375 }
00377 void
00378 WQLFilterRep::referencesClasses(
00379    const String& ns,
00380    const CIMObjectPath &path,
00381    CIMClassResultHandlerIFC& result,
00382    const String &resultClass, const String &role,
00383    EIncludeQualifiersFlag includeQualifiers, EIncludeClassOriginFlag includeClassOrigin,
00384    const StringArray *propertyList, OperationContext&)
00385 {
00386    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00387       "is supported in the WQLCIMOMHandle.");
00388 }
00389 #endif // #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00390 
00391 void
00392 WQLFilterRep::execQuery(const String& /*ns*/,
00393    CIMInstanceResultHandlerIFC&,
00394    const String &/*query*/, const String &/*queryLanguage*/,
00395    OperationContext&)
00396 {
00397    OW_THROWCIMMSG(CIMException::INVALID_QUERY, "Only EnumInstances() "
00398       "is supported in the WQLCIMOMHandle.");
00399 }
00401 void
00402 WQLFilterRep::beginOperation(WBEMFlags::EOperationFlag, OperationContext&)
00403 {
00404 }
00406 void
00407 WQLFilterRep::endOperation(WBEMFlags::EOperationFlag, OperationContext&, WBEMFlags::EOperationResultFlag result)
00408 {
00409 }
00410 
00411 } // end namespace OW_NAMESPACE
00412 

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