OW_CIMClient.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 
00036 #ifndef OW_CIMClient_hpp_INCLUDE_GUARD_
00037 #define OW_CIMClient_hpp_INCLUDE_GUARD_
00038 #include "OW_config.h"
00039 #include "OW_CIMFwd.hpp"
00040 #include "OW_ClientAuthCBIFC.hpp"
00041 #include "OW_ResultHandlerIFC.hpp"
00042 #include "OW_ClientCIMOMHandle.hpp"
00043 
00044 namespace OW_NAMESPACE
00045 {
00046 
00055 class OW_CLIENT_API CIMClient
00056 {
00057 public:
00071    CIMClient(const String& url, const String& ns,
00072          const ClientAuthCBIFCRef& authCB = ClientAuthCBIFCRef());
00073    void setNameSpace(const String& arg) { m_namespace = arg; }
00074    String getNameSpace() const { return m_namespace; }
00075    
00076 #if !defined(OW_DISABLE_INSTANCE_MANIPULATION) && !defined(OW_DISABLE_NAMESPACE_MANIPULATION)
00077 
00082    void createNameSpace(const String& ns);
00088    void deleteNameSpace(const String& ns);
00089 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00090 
00107    StringArray enumNameSpaceE(WBEMFlags::EDeepFlag deep=WBEMFlags::E_DEEP) OW_DEPRECATED; // in 3.1.0
00108    void enumNameSpace(StringResultHandlerIFC& result,
00109       WBEMFlags::EDeepFlag deep=WBEMFlags::E_DEEP) OW_DEPRECATED; // in 3.1.0
00110    
00120    StringArray enumCIM_NamespaceE();
00121    void enumCIM_Namespace(StringResultHandlerIFC& result);
00122 
00139    void enumClass(const String& className,
00140       CIMClassResultHandlerIFC& result,
00141       WBEMFlags::EDeepFlag deep = WBEMFlags::E_SHALLOW,
00142       WBEMFlags::ELocalOnlyFlag localOnly=WBEMFlags::E_NOT_LOCAL_ONLY,
00143       WBEMFlags::EIncludeQualifiersFlag includeQualifiers=WBEMFlags::E_INCLUDE_QUALIFIERS,
00144       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin=WBEMFlags::E_INCLUDE_CLASS_ORIGIN);
00145    CIMClassEnumeration enumClassE(const String& className,
00146       WBEMFlags::EDeepFlag deep = WBEMFlags::E_SHALLOW,
00147       WBEMFlags::ELocalOnlyFlag localOnly =WBEMFlags::E_NOT_LOCAL_ONLY,
00148       WBEMFlags::EIncludeQualifiersFlag includeQualifiers =WBEMFlags::E_INCLUDE_QUALIFIERS,
00149       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin =WBEMFlags::E_INCLUDE_CLASS_ORIGIN);
00159    void enumClassNames(
00160       const String& className,
00161       StringResultHandlerIFC& result,
00162       WBEMFlags::EDeepFlag deep=WBEMFlags::E_DEEP);
00163    StringEnumeration enumClassNamesE(
00164       const String& className,
00165       WBEMFlags::EDeepFlag deep=WBEMFlags::E_DEEP);
00194    void enumInstances(
00195       const String& className,
00196       CIMInstanceResultHandlerIFC& result,
00197       WBEMFlags::EDeepFlag deep = WBEMFlags::E_DEEP,
00198       WBEMFlags::ELocalOnlyFlag localOnly =WBEMFlags::E_NOT_LOCAL_ONLY,
00199       WBEMFlags::EIncludeQualifiersFlag includeQualifiers =WBEMFlags::E_EXCLUDE_QUALIFIERS,
00200       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin =WBEMFlags::E_EXCLUDE_CLASS_ORIGIN,
00201       const StringArray* propertyList=0);
00202    CIMInstanceEnumeration enumInstancesE(
00203       const String& className,
00204       WBEMFlags::EDeepFlag deep =WBEMFlags::E_DEEP,
00205       WBEMFlags::ELocalOnlyFlag localOnly =WBEMFlags::E_NOT_LOCAL_ONLY,
00206       WBEMFlags::EIncludeQualifiersFlag includeQualifiers =WBEMFlags::E_EXCLUDE_QUALIFIERS,
00207       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin =WBEMFlags::E_EXCLUDE_CLASS_ORIGIN,
00208       const StringArray* propertyList=0);
00217    void enumInstanceNames(
00218       const String& className,
00219       CIMObjectPathResultHandlerIFC& result);
00220    CIMObjectPathEnumeration enumInstanceNamesE(
00221       const String& className);
00240    CIMClass getClass(
00241       const String& className,
00242       WBEMFlags::ELocalOnlyFlag localOnly =WBEMFlags::E_NOT_LOCAL_ONLY,
00243       WBEMFlags::EIncludeQualifiersFlag includeQualifiers =WBEMFlags::E_INCLUDE_QUALIFIERS,
00244       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin =WBEMFlags::E_INCLUDE_CLASS_ORIGIN,
00245       const StringArray* propertyList = 0);
00271    CIMInstance getInstance(
00272       const CIMObjectPath& instanceName,
00273       WBEMFlags::ELocalOnlyFlag localOnly =WBEMFlags::E_NOT_LOCAL_ONLY,
00274       WBEMFlags::EIncludeQualifiersFlag includeQualifiers =WBEMFlags::E_EXCLUDE_QUALIFIERS,
00275       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin =WBEMFlags::E_EXCLUDE_CLASS_ORIGIN,
00276       const StringArray* propertyList=0) ;
00289    CIMValue invokeMethod(
00290       const CIMObjectPath& path,
00291       const String& methodName,
00292       const CIMParamValueArray& inParams,
00293       CIMParamValueArray& outParams);
00300    CIMQualifierType getQualifierType(const String& qualifierName);
00301 #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00302 
00307    void setQualifierType(const CIMQualifierType& qualifierType);
00313    void deleteQualifierType(const String& qualName);
00319    void enumQualifierTypes(
00320       CIMQualifierTypeResultHandlerIFC& result);
00321    CIMQualifierTypeEnumeration enumQualifierTypesE();
00322 #endif // #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00323 #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00324 
00329    void modifyClass(const CIMClass& cimClass) ;
00336    void createClass(const CIMClass& cimClass) ;
00342    void deleteClass(const String& className);
00343 #endif // #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00344 #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00345 
00353    void modifyInstance(const CIMInstance& modifiedInstance,
00354       WBEMFlags::EIncludeQualifiersFlag includeQualifiers =WBEMFlags::E_INCLUDE_QUALIFIERS,
00355       StringArray* propertyList = 0);
00363    CIMObjectPath createInstance(const CIMInstance& instance) ;
00372    void deleteInstance(const CIMObjectPath& path);
00373 #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00374 
00382    void setProperty(
00383       const CIMObjectPath& instanceName,
00384       const String& propertyName,
00385       const CIMValue& newValue) ;
00386 #endif // #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00387 #endif // #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00388 #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00389 
00397    CIMValue getProperty(
00398       const CIMObjectPath& instanceName,
00399       const String& propertyName);
00400 #endif // #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00401 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00402 
00439    void associatorNames(
00440       const CIMObjectPath& objectName,
00441       CIMObjectPathResultHandlerIFC& result,
00442       const String& assocClass=String(),
00443       const String& resultClass=String(),
00444       const String& role=String(),
00445       const String& resultRole=String()) ;
00446    CIMObjectPathEnumeration associatorNamesE(
00447       const CIMObjectPath& objectName,
00448       const String& assocClass=String(),
00449       const String& resultClass=String(),
00450       const String& role=String(),
00451       const String& resultRole=String());
00525    void associators(
00526       const CIMObjectPath& path,
00527       CIMInstanceResultHandlerIFC& result,
00528       const String& assocClass=String(),
00529       const String& resultClass=String(),
00530       const String& role=String(),
00531       const String& resultRole=String(),
00532       WBEMFlags::EIncludeQualifiersFlag includeQualifiers=WBEMFlags::E_EXCLUDE_QUALIFIERS,
00533       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin=WBEMFlags::E_EXCLUDE_CLASS_ORIGIN,
00534       const StringArray* propertyList=0);
00535    CIMInstanceEnumeration associatorsE(
00536       const CIMObjectPath& path,
00537       const String& assocClass=String(),
00538       const String& resultClass=String(),
00539       const String& role=String(),
00540       const String& resultRole=String(),
00541       WBEMFlags::EIncludeQualifiersFlag includeQualifiers=WBEMFlags::E_EXCLUDE_QUALIFIERS,
00542       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin=WBEMFlags::E_EXCLUDE_CLASS_ORIGIN,
00543       const StringArray* propertyList=0);
00617    void associatorsClasses(
00618       const CIMObjectPath& path,
00619       CIMClassResultHandlerIFC& result,
00620       const String& assocClass=String(),
00621       const String& resultClass=String(),
00622       const String& role=String(),
00623       const String& resultRole=String(),
00624       WBEMFlags::EIncludeQualifiersFlag includeQualifiers=WBEMFlags::E_EXCLUDE_QUALIFIERS,
00625       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin=WBEMFlags::E_EXCLUDE_CLASS_ORIGIN,
00626       const StringArray* propertyList=0);
00627    CIMClassEnumeration associatorsClassesE(
00628       const CIMObjectPath& path,
00629       const String& assocClass=String(),
00630       const String& resultClass=String(),
00631       const String& role=String(),
00632       const String& resultRole=String(),
00633       WBEMFlags::EIncludeQualifiersFlag includeQualifiers=WBEMFlags::E_EXCLUDE_QUALIFIERS,
00634       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin=WBEMFlags::E_EXCLUDE_CLASS_ORIGIN,
00635       const StringArray* propertyList=0);
00649    void referenceNames(
00650       const CIMObjectPath& path,
00651       CIMObjectPathResultHandlerIFC& result,
00652       const String& resultClass=String(),
00653       const String& role=String()) ;
00654    CIMObjectPathEnumeration referenceNamesE(
00655       const CIMObjectPath& path,
00656       const String& resultClass=String(),
00657       const String& role=String());
00688    void references(
00689       const CIMObjectPath& path,
00690       CIMInstanceResultHandlerIFC& result,
00691       const String& resultClass=String(),
00692       const String& role=String(),
00693       WBEMFlags::EIncludeQualifiersFlag includeQualifiers=WBEMFlags::E_EXCLUDE_QUALIFIERS,
00694       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin=WBEMFlags::E_EXCLUDE_CLASS_ORIGIN,
00695       const StringArray* propertyList=0) ;
00696    CIMInstanceEnumeration referencesE(
00697       const CIMObjectPath& path,
00698       const String& resultClass=String(),
00699       const String& role=String(),
00700       WBEMFlags::EIncludeQualifiersFlag includeQualifiers=WBEMFlags::E_EXCLUDE_QUALIFIERS,
00701       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin=WBEMFlags::E_EXCLUDE_CLASS_ORIGIN,
00702       const StringArray* propertyList=0);
00703    void referencesClasses(
00704       const CIMObjectPath& path,
00705       CIMClassResultHandlerIFC& result,
00706       const String& resultClass=String(),
00707       const String& role=String(),
00708       WBEMFlags::EIncludeQualifiersFlag includeQualifiers=WBEMFlags::E_EXCLUDE_QUALIFIERS,
00709       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin=WBEMFlags::E_EXCLUDE_CLASS_ORIGIN,
00710       const StringArray* propertyList=0) ;
00711    CIMClassEnumeration referencesClassesE(
00712       const CIMObjectPath& path,
00713       const String& resultClass=String(),
00714       const String& role=String(),
00715       WBEMFlags::EIncludeQualifiersFlag includeQualifiers=WBEMFlags::E_EXCLUDE_QUALIFIERS,
00716       WBEMFlags::EIncludeClassOriginFlag includeClassOrigin=WBEMFlags::E_EXCLUDE_CLASS_ORIGIN,
00717       const StringArray* propertyList=0);
00718 #endif // #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00719 
00737    void execQuery(
00738       CIMInstanceResultHandlerIFC& result,
00739       const String& query,
00740       const String& queryLanguage);
00741    CIMInstanceEnumeration execQueryE(
00742       const String& query,
00743       const String& queryLanguage);
00744 
00752    bool setHTTPRequestHeader(const String& hdrName,
00753       const String& hdrValue);
00754 
00764    bool getHTTPResponseHeader(const String& hdrName,
00765       String& valueOut) const;
00766    
00767 private:
00768    String m_namespace;
00769 
00770    // TODO: implement SLP integration to fetch the interop namespace so that namespace manipulation can be done correctly.
00771 
00772 #ifdef OW_WIN32
00773 #pragma warning (push)
00774 #pragma warning (disable: 4251)
00775 #endif
00776 
00777    ClientCIMOMHandleRef m_ch;
00778 
00779 #ifdef OW_WIN32
00780 #pragma warning (pop)
00781 #endif
00782    
00783 };
00784 
00785 } // end namespace OW_NAMESPACE
00786 
00787 #endif

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