OW_XMLExecute.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_XMLEXECUTE_HPP_INCLUDE_GUARD_
00037 #define OW_XMLEXECUTE_HPP_INCLUDE_GUARD_
00038 #include "OW_config.h"
00039 #include "OW_CIMOMHandleIFC.hpp"
00040 #include "OW_String.hpp"
00041 #include "OW_Map.hpp"
00042 #include "OW_XMLQualifier.hpp"
00043 #include "OW_RequestHandlerIFCXML.hpp"
00044 #include "OW_ServiceEnvironmentIFC.hpp"
00045 #include "OW_IfcsFwd.hpp"
00046 #include "OW_CIMObjectPath.hpp"
00047 
00048 #include <iosfwd>
00049 
00050 namespace OW_NAMESPACE
00051 {
00052 
00053 class XMLExecute : public RequestHandlerIFCXML
00054 {
00055 public:
00056    XMLExecute();
00057    virtual ~XMLExecute();
00058    int executeXML(CIMXMLParser& parser, std::ostream* ostrEntity,
00059       std::ostream* ostrError, OperationContext& userName);
00060    virtual RequestHandlerIFC* clone() const;
00061 protected:
00062    virtual void doOptions(CIMFeatures& cf, OperationContext& context);
00063    virtual void outputError(CIMException::ErrNoType errorCode,
00064       const String& msg, std::ostream& ostr);
00065    
00066    virtual String getName() const;
00067    virtual StringArray getDependencies() const;
00068    virtual void init(const ServiceEnvironmentIFCRef& env);
00069    virtual void shutdown();
00070 private:
00071    // These pointers will always be NULL when clone() is called
00072    // (clone() insures this).  They are assigned in executeXML().
00073    std::ostream* m_ostrEntity;
00074    std::ostream* m_ostrError;
00075    bool m_isIntrinsic;
00076    String m_functionName;
00080    void executeIntrinsic(std::ostream& osrt, CIMXMLParser& parser, CIMOMHandleIFC& hdl,
00081          const String& ns);
00082    void executeExtrinsic(std::ostream& ostr, CIMXMLParser& parser,
00083       CIMOMHandleIFC& lch);
00084    void doInvokeMethod(std::ostream& ostr, CIMXMLParser& parser,
00085       const String& methodName, CIMOMHandleIFC& lch);
00086    void processSimpleReq(CIMXMLParser& parser, std::ostream& ostrEntity,
00087       std::ostream& ostrError, OperationContext& context);
00088    static void getParameters(CIMXMLParser& parser,
00089       CIMParamValueArray& params);
00090 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00091    void associatorNames(std::ostream& ostr, CIMXMLParser& parser,
00092       const String& ns, CIMOMHandleIFC& hdl);
00093    void associators(std::ostream& ostr, CIMXMLParser& parser,
00094       const String& ns, CIMOMHandleIFC& hdl);
00095 #endif
00096 #ifndef OW_DISABLE_SCHEMA_MANIPULATION
00097    void createClass(std::ostream& ostr, CIMXMLParser& parser,
00098       const String& ns, CIMOMHandleIFC& hdl);
00099    void modifyClass(std::ostream& ostr, CIMXMLParser& parser,
00100       const String& ns, CIMOMHandleIFC& hdl);
00101    void deleteClass(std::ostream& ostr, CIMXMLParser& parser,
00102       const String& ns, CIMOMHandleIFC& hdl);
00103 #endif
00104 #ifndef OW_DISABLE_INSTANCE_MANIPULATION
00105    void createInstance(std::ostream& ostr, CIMXMLParser& parser,
00106       const String& ns, CIMOMHandleIFC& hdl);
00107    void deleteInstance(std::ostream& ostr, CIMXMLParser& parser,
00108       const String& ns, CIMOMHandleIFC& hdl);
00109    void modifyInstance(std::ostream& ostr, CIMXMLParser& parser,
00110       const String& ns, CIMOMHandleIFC& hdl);
00111 #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00112    void setProperty(std::ostream& ostr, CIMXMLParser& parser,
00113       const String& ns, CIMOMHandleIFC& hdl);
00114 #endif // #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00115 #endif
00116    void enumerateClassNames(std::ostream& ostr, CIMXMLParser& parser,
00117       const String& ns, CIMOMHandleIFC& hdl);
00118    void enumerateClasses( std::ostream& ostr, CIMXMLParser& parser,
00119       const String& ns, CIMOMHandleIFC& hdl) ;
00120    void enumerateInstanceNames(std::ostream& ostr, CIMXMLParser& parser,
00121       const String& ns, CIMOMHandleIFC& hdl);
00122    void enumerateInstances(std::ostream& ostr, CIMXMLParser& parser,
00123       const String& ns, CIMOMHandleIFC& hdl) ;
00124    void getClass(std::ostream& ostr, CIMXMLParser& parser,
00125       const String& ns, CIMOMHandleIFC& hdl) ;
00126    void getInstance(std::ostream& ostr, CIMXMLParser& parser,
00127       const String& ns, CIMOMHandleIFC& hdl);
00128 #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00129    void getProperty(std::ostream& ostr, CIMXMLParser& parser,
00130       const String& ns, CIMOMHandleIFC& hdl);
00131 #endif // #if !defined(OW_DISABLE_PROPERTY_OPERATIONS)
00132    void getQualifier(std::ostream& ostr, CIMXMLParser& parser,
00133       const String& ns, CIMOMHandleIFC& hdl);
00134 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00135    void referenceNames(std::ostream& ostr, CIMXMLParser& parser,
00136       const String& ns, CIMOMHandleIFC& hdl) ;
00137    void references(std::ostream& ostr, CIMXMLParser& parser,
00138       const String& ns, CIMOMHandleIFC& hdl) ;
00139 #endif
00140 #ifndef OW_DISABLE_QUALIFIER_DECLARATION
00141    void setQualifier(std::ostream& ostr, CIMXMLParser& parser,
00142       const String& ns, CIMOMHandleIFC& hdl);
00143    void deleteQualifier(std::ostream& ostr, CIMXMLParser& parser,
00144       const String& ns, CIMOMHandleIFC& hdl);
00145    void enumerateQualifiers(std::ostream& ostr, CIMXMLParser& parser,
00146       const String& ns, CIMOMHandleIFC& hdl);
00147 #endif
00148    void execQuery(std::ostream& ostr, CIMXMLParser& parser,
00149       const String& ns, CIMOMHandleIFC& hdl);
00150    typedef void (XMLExecute::*execFuncPtr_t)(std::ostream& ostr,
00151       CIMXMLParser& qualNode, const String& ns, CIMOMHandleIFC& hdl);
00152    struct FuncEntry
00153    {
00154       const char* name;
00155       execFuncPtr_t func;
00156    };
00157    
00158    static FuncEntry g_funcs[];
00159    static bool funcEntryCompare(const FuncEntry& f1, const FuncEntry& f2);
00160    static FuncEntry* g_funcsEnd;
00161 
00162    // this is the path to the interop instance of CIM_CIMXMLCommunicationMechanism this class manages.
00163    CIMObjectPath m_commMechPath;
00164    // this is the path to the interop instance of CIM_HostedAccessPoint this class manages.
00165    CIMObjectPath m_hostedAccessPointPath;
00166    // this is the path to the interop instance of OpenWBEM_CIMXMLCommMechanismForOpenWBEMManager this class manages.
00167    CIMObjectPath m_commMechForManager;
00168 };
00169 
00170 } // end namespace OW_NAMESPACE
00171 
00172 #endif

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