10 #ifndef __PION_WEBSERVER_HEADER__
11 #define __PION_WEBSERVER_HEADER__
14 #include <boost/asio.hpp>
15 #include <boost/bind.hpp>
16 #include <boost/shared_ptr.hpp>
17 #include <pion/PionConfig.hpp>
18 #include <pion/PionException.hpp>
19 #include <pion/PionPlugin.hpp>
20 #include <pion/PluginManager.hpp>
21 #include <pion/net/HTTPServer.hpp>
22 #include <pion/net/WebService.hpp>
41 :
PionException(
"No web services are identified by the resource: ", resource) {}
48 :
PionException(
"Web service configuration file not found: ", file) {}
55 :
PionException(
"Unable to parse configuration file: ", file) {}
62 :
PionException(
"Error in web server authorization config: ", error_msg) {}
70 std::string(
"): ") + file)
86 setLogger(PION_GET_LOGGER(
"pion.net.WebServer"));
94 explicit WebServer(
const boost::asio::ip::tcp::endpoint& endpoint)
97 setLogger(PION_GET_LOGGER(
"pion.net.WebServer"));
109 setLogger(PION_GET_LOGGER(
"pion.net.WebServer"));
121 setLogger(PION_GET_LOGGER(
"pion.net.WebServer"));
130 void addService(
const std::string& resource,
WebService *service_ptr);
139 void loadService(
const std::string& resource,
const std::string& service_name);
148 void setServiceOption(
const std::string& resource,
149 const std::string& name,
const std::string& value);
163 void loadServiceConfig(
const std::string& config_name);
167 if (isListening()) stop();
179 catch (std::exception& e) {
190 catch (std::exception& e) {
205 WebServiceManager m_services;
210 typedef boost::shared_ptr<WebServer> WebServerPtr;