OW_RepositoryCIMOMHandle.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_REPOSITORY_CIMOMHANDLE_HPP_INCLUDE_GUARD_
00036 #define OW_REPOSITORY_CIMOMHANDLE_HPP_INCLUDE_GUARD_
00037 #include "OW_config.h"
00038 #include "OW_Types.hpp"
00039 #include "OW_CIMOMHandleIFC.hpp"
00040 #include "OW_RepositoryIFC.hpp"
00041 #include "OW_RWLocker.hpp"
00042 #include "OW_IntrusiveReference.hpp"
00043 #include "OW_CommonFwd.hpp"
00044 
00045 namespace OW_NAMESPACE
00046 {
00047 
00052 class OW_COMMON_API RepositoryCIMOMHandle : public CIMOMHandleIFC
00053 {
00054 public:
00055 
00056    enum ELockingFlag
00057    {
00058       E_NO_LOCKING,
00059       E_LOCKING
00060    };
00074    RepositoryCIMOMHandle(const RepositoryIFCRef& pRepos,
00075       OperationContext& context, ELockingFlag lock = E_LOCKING);
00076    
00077    virtual void close();
00078 
00079 #if !defined(OW_DISABLE_INSTANCE_MANIPULATION) && !defined(OW_DISABLE_NAMESPACE_MANIPULATION)
00080    virtual void createNameSpace(const String& ns);
00081    virtual void deleteNameSpace(const String& ns);
00082 #endif
00083    virtual void enumNameSpace(StringResultHandlerIFC& result);
00084    virtual void enumClass(
00085       const String& ns,
00086       const String& className,
00087       CIMClassResultHandlerIFC& result,
00088       WBEMFlags::EDeepFlag deep = WBEMFlags::E_SHALLOW,
00089       WBEMFlags::ELocalOnlyFlag localOnly = WBEMFlags::E_NOT_LOCAL_ONLY,
00090       WBEMFlags::EIncludeQualifiersFlag includeQualifiers = WBEMFlags::E_INCLUDE_QUALIFIERS,
00091       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin = WBEMFlags::E_INCLUDE_CLASS_ORIGIN);
00092    virtual void enumClassNames(
00093       const String& ns,
00094       const String& className,
00095       StringResultHandlerIFC& result,
00096       WBEMFlags::EDeepFlag deep=WBEMFlags::E_DEEP);
00097    virtual CIMQualifierType getQualifierType(const String& ns,
00098       const String& qualifierName);
00099 #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00100    virtual void enumQualifierTypes(
00101       const String& ns,
00102       CIMQualifierTypeResultHandlerIFC& result);
00103    virtual void deleteQualifierType(const String& ns, const String& qualName);
00104    virtual void setQualifierType(const String& ns,
00105       const CIMQualifierType& qt);
00106 #endif // #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00107    virtual CIMInstance getInstance(
00108       const String& ns,
00109       const CIMObjectPath& instanceName,
00110       WBEMFlags::ELocalOnlyFlag localOnly = WBEMFlags::E_NOT_LOCAL_ONLY,
00111       WBEMFlags::EIncludeQualifiersFlag includeQualifiers = WBEMFlags::E_EXCLUDE_QUALIFIERS,
00112       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin = WBEMFlags::E_EXCLUDE_CLASS_ORIGIN,
00113       const StringArray* propertyList=0);
00114    virtual void enumInstances(
00115       const String& ns,
00116       const String& className,
00117       CIMInstanceResultHandlerIFC& result,
00118       WBEMFlags::EDeepFlag deep = WBEMFlags::E_DEEP,
00119       WBEMFlags::ELocalOnlyFlag localOnly = WBEMFlags::E_NOT_LOCAL_ONLY,
00120       WBEMFlags::EIncludeQualifiersFlag includeQualifiers = WBEMFlags::E_EXCLUDE_QUALIFIERS,
00121       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin = WBEMFlags::E_EXCLUDE_CLASS_ORIGIN,
00122       const StringArray* propertyList=0);
00123    virtual void enumInstanceNames(
00124       const String& ns,
00125       const String& className,
00126       CIMObjectPathResultHandlerIFC& result);
00127    virtual CIMClass getClass(
00128       const String& ns,
00129       const String& className,
00130       WBEMFlags::ELocalOnlyFlag localOnly = WBEMFlags::E_NOT_LOCAL_ONLY,
00131       WBEMFlags::EIncludeQualifiersFlag includeQualifiers = WBEMFlags::E_INCLUDE_QUALIFIERS,
00132       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin = WBEMFlags::E_INCLUDE_CLASS_ORIGIN,
00133       const StringArray* propertyList=NULL);
00134    virtual CIMValue invokeMethod(
00135       const String& ns,
00136       const CIMObjectPath& path,
00137       const String &methodName, const CIMParamValueArray &inParams,
00138       CIMParamValueArray &outParams);
00139 #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00140    virtual void createClass(const String& ns,
00141       const CIMClass &cc);
00142    virtual void modifyClass(const String &ns, const CIMClass &cc);
00143    virtual void deleteClass(const String& ns, const String& className);
00144 #endif // #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00145 #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00146    virtual CIMObjectPath createInstance(const String& ns,
00147       const CIMInstance &ci);
00148 #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00149    virtual void setProperty(
00150       const String& ns,
00151       const CIMObjectPath &name,
00152       const String &propertyName, const CIMValue &cv);
00153 #endif // #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00154    virtual void modifyInstance(
00155       const String& ns,
00156       const CIMInstance& modifiedInstance,
00157       WBEMFlags::EIncludeQualifiersFlag includeQualifiers,
00158       const StringArray* propertyList);
00159    virtual void deleteInstance(const String& ns, const CIMObjectPath& path);
00160 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00161 #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00162    virtual CIMValue getProperty(
00163       const String& ns,
00164       const CIMObjectPath &name,
00165       const String &propertyName);
00166 #endif // #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00167 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00168    virtual void associators(
00169       const String& ns,
00170       const CIMObjectPath &path,
00171       CIMInstanceResultHandlerIFC& result,
00172       const String &assocClass, const String &resultClass,
00173       const String &role, const String &resultRole,
00174       WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00175       const StringArray* propertyList);
00176    virtual void associatorsClasses(
00177       const String& ns,
00178       const CIMObjectPath& path,
00179       CIMClassResultHandlerIFC& result,
00180       const String& assocClass=String(),
00181       const String& resultClass=String(),
00182       const String& role=String(),
00183       const String& resultRole=String(),
00184       WBEMFlags::EIncludeQualifiersFlag includeQualifiers=WBEMFlags::E_EXCLUDE_QUALIFIERS,
00185       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin=WBEMFlags::E_EXCLUDE_CLASS_ORIGIN,
00186       const StringArray* propertyList=0);
00187 virtual void references(
00188       const String& ns,
00189       const CIMObjectPath &path,
00190       CIMInstanceResultHandlerIFC& result,
00191       const String &resultClass, const String &role,
00192       WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00193       const StringArray* propertyList);
00194    virtual void referencesClasses(
00195       const String& ns,
00196       const CIMObjectPath &path,
00197       CIMClassResultHandlerIFC& result,
00198       const String &resultClass, const String &role,
00199       WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin,
00200       const StringArray* propertyList);
00201    virtual void associatorNames(
00202       const String& ns,
00203       const CIMObjectPath &path,
00204       CIMObjectPathResultHandlerIFC& result,
00205       const String &assocClass,
00206       const String &resultClass, const String &role,
00207       const String &resultRole);
00208    virtual void referenceNames(
00209       const String& ns,
00210       const CIMObjectPath &path,
00211       CIMObjectPathResultHandlerIFC& result,
00212       const String &resultClass,
00213       const String &role);
00214 #endif
00215    
00216    virtual void execQuery(
00217       const String& ns,
00218       CIMInstanceResultHandlerIFC& result,
00219       const String &query, const String& queryLanguage);
00220 
00221    typedef RepositoryIFCRef RepositoryCIMOMHandle::*safe_bool;
00222    operator safe_bool () const
00223       {  return (m_pServer) ? &RepositoryCIMOMHandle::m_pServer : 0; }
00224    bool operator!() const
00225       {  return !m_pServer; }
00226    void beginOperation(WBEMFlags::EOperationFlag op, OperationContext& context);
00227    void endOperation(WBEMFlags::EOperationFlag op, OperationContext& context, WBEMFlags::EOperationResultFlag result);
00228 
00229 private:
00230 
00231 #ifdef OW_WIN32
00232 #pragma warning (push)
00233 #pragma warning (disable: 4251)
00234 #endif
00235 
00241    RepositoryIFCRef m_pServer;
00242 
00243 #ifdef OW_WIN32
00244 #pragma warning (pop)
00245 #endif
00246 
00251    ELockingFlag m_lock;
00252    OperationContext& m_context;
00253 };
00254 OW_EXPORT_TEMPLATE(OW_COMMON_API, IntrusiveReference, RepositoryCIMOMHandle);
00255 
00256 } // end namespace OW_NAMESPACE
00257 
00258 #endif

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