00001 /** 00002 * @class wosh::bundles::WebExpositorBundle 00003 * @brief Manage Automations and generic tasks within WOSH. 00004 * 00005 * 00006 * 00007 * @see wosh::network 00008 * @ingroup Bundles 00009 **************************************************************************** 00010 * @version 0.8.013 $Id: WebExpositorBundle.h 3775 2011-01-01 16:38:17Z alex $ 00011 * @author Alessandro Polo 00012 ****************************************************************************/ 00013 /* Copyright (c) 2007-2011, WOSH - Wide Open Smart Home 00014 * by Alessandro Polo - OpenSmartHome.com 00015 * All rights reserved. 00016 * 00017 * Redistribution and use in source and binary forms, with or without 00018 * modification, are permitted provided that the following conditions are met: 00019 * * Redistributions of source code must retain the above copyright 00020 * notice, this list of conditions and the following disclaimer. 00021 * * Redistributions in binary form must reproduce the above copyright 00022 * notice, this list of conditions and the following disclaimer in the 00023 * documentation and/or other materials provided with the distribution. 00024 * * Neither the name of the OpenSmartHome.com WOSH nor the 00025 * names of its contributors may be used to endorse or promote products 00026 * derived from this software without specific prior written permission. 00027 * 00028 * THIS SOFTWARE IS PROVIDED BY Alessandro Polo ''AS IS'' AND ANY 00029 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00030 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00031 * DISCLAIMED. IN NO EVENT SHALL Alessandro Polo BE LIABLE FOR ANY 00032 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00033 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00034 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00035 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00036 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00037 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00038 ****************************************************************************/ 00039 00040 #ifndef __WOSH_Bundles_Services_WebExpositor_H__ 00041 #define __WOSH_Bundles_Services_WebExpositor_H__ 00042 00043 #include <core/BundleGeneric.h> 00044 #include <interfaces/network/WebExpositor.h> 00045 #include <framework/network/WebServer.h> 00046 00047 00048 class WebExpositorImpl; 00049 00050 using namespace wosh::network; 00051 namespace wosh { 00052 namespace bundles { 00053 00054 #define _WebExpositor_NAME "WebExpositor" 00055 #define _WebExpositor_VERSION 0.8711 00056 00057 class WebExpositorBundle : public BundleGeneric, 00058 public virtual wosh::interfaces::network::WebExpositor, 00059 public virtual wosh::network::IWebServerSimpleListener 00060 { 00061 WOSH_BUNDLE(wosh::bundles::WebExpositorBundle) 00062 00063 public: 00064 WebExpositorBundle(); 00065 virtual ~WebExpositorBundle(); 00066 00067 public: 00068 WRESULT bundleStart(); 00069 WRESULT bundleStop(); 00070 00071 void busMessage( const Message& message, const Bus* source ); 00072 bool updatingProperty( bool& do_update, const Variant& value_proposed, Property& property_current, const PropertiesProvider* source ); 00073 00074 00075 /** @name IWebServerListener interface 00076 * @{ 00077 ******************************************************************************/ 00078 public: 00079 virtual bool incomingConnection( const std::string& address_port, WebServer* source ); 00080 virtual bool webrequest_evaluate( WebServerRequest* request, WebServer* source ); 00081 00082 //@} 00083 protected: 00084 00085 private: 00086 00087 protected: 00088 BusConnector BusSecurity; 00089 00090 wosh::network::WebServer* webServer; 00091 00092 }; // class def 00093 00094 }; // namespace bundles 00095 }; // namespace wosh 00096 00097 #endif //__WOSH_Bundles_Services_WebExpositor_H__