23 #include "xmlrpc_thread.h" 24 #include "xmlrpc_processor.h" 25 #include "methods/plugin.h" 26 #include "methods/log.h" 28 #include <core/version.h> 29 #include <webview/server.h> 30 #include <webview/url_manager.h> 31 #include <webview/request_dispatcher.h> 53 XmlRpcThread::~XmlRpcThread()
63 __custom_server =
false;
65 if (__custom_server) {
69 __cache_logger.
clear();
73 xmlrpc_c::registry *registry = __processor->
registry();
77 if (__custom_server) {
80 __webserver =
new WebServer(__cfg_port, __dispatcher);
82 logger->
log_info(
"XmlRpcThread",
"Listening for HTTP connections on port %u",
88 "_http._tcp", __cfg_port);
89 __xmlrpc_service->
add_txt(
"fawkesver=%u.%u.%u", FAWKES_VERSION_MAJOR,
90 FAWKES_VERSION_MINOR, FAWKES_VERSION_MICRO);
94 logger->
log_info(
"XmlRpcThread",
"Registering as /xmlrpc in webview");
103 if (__custom_server) {
105 delete __xmlrpc_service;
108 delete __plugin_methods;
110 delete __url_manager;
121 if (__custom_server) {
virtual void init()
Initialize the thread.
Thread aspect that allows to provide a logger to Fawkes.
PluginManager * plugin_manager
This is the member used to access the PluginManager.
Encapsulation of the libmicrohttpd webserver.
virtual void finalize()
Finalize the thread.
virtual void log_info(const char *component, const char *format,...)=0
Log informational message.
void clear()
Clear messages.
ServicePublisher * service_publisher
Service publisher to publish services on the network.
virtual void unpublish_service(NetworkService *service)=0
Revoke service publication.
virtual void publish_service(NetworkService *service)=0
Publish service.
Fawkes library namespace.
virtual bool get_bool(const char *path)=0
Get value from configuration which is of type bool.
void process()
Process requests.
Wrapper class for plugin related XML-RPC methods.
Wrapper class for logging related XML-RPC methods.
virtual void loop()
Code to execute in the thread.
Thread class encapsulation of pthreads.
void set_prepfin_conc_loop(bool concurrent=true)
Set concurrent execution of prepare_finalize() and loop().
Logger * logger
This is the Logger member used to access the logger.
XmlRpcThread()
Constructor.
Base class for exceptions in Fawkes.
WebUrlManager * webview_url_manager
Webview request processor manager.
void unregister_baseurl(const char *url_prefix)
Remove a request processor.
void set_opmode(OpMode op_mode)
Set operation mode.
void add_txt(const char *format,...)
Add a TXT record.
NetworkNameResolver * nnresolver
Network name resolver to lookup IP addresses of hostnames and vice versa.
XML-RPC web request processor.
Representation of a service announced or found via service discovery (i.e.
xmlrpc_c::registry * registry()
Get XML-RPC registry.
virtual unsigned int get_uint(const char *path)=0
Get value from configuration which is of type unsigned int.
Configuration * config
This is the Configuration member used to access the configuration.
void register_baseurl(const char *url_prefix, WebRequestProcessor *processor)
Add a request processor.