Fawkes API  Fawkes Development Version
xmlrpc_thread.h
1 
2 /***************************************************************************
3  * xmlrpc_thread.h - Thread that handles xml-rpc requests
4  *
5  * Created: Sun Aug 30 12:44:30 2009
6  * Copyright 2006-2009 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef _PLUGINS_XMLRPC_XMLRPC_THREAD_H_
24 #define _PLUGINS_XMLRPC_XMLRPC_THREAD_H_
25 
26 #include <aspect/blackboard.h>
27 #include <aspect/configurable.h>
28 #include <aspect/logger.h>
29 #include <aspect/logging.h>
30 #include <aspect/network.h>
31 #include <aspect/plugin_director.h>
32 #include <aspect/webview.h>
33 #include <core/threading/thread.h>
34 #include <logging/cache.h>
35 
36 namespace fawkes {
37 class NetworkService;
38 class WebRequestDispatcher;
39 class WebUrlManager;
40 class WebServer;
41 } // namespace fawkes
42 
45 class XmlRpcLogMethods;
46 
48  public fawkes::LoggingAspect,
51  public fawkes::NetworkAspect,
52  public fawkes::LoggerAspect,
55 {
56 public:
57  XmlRpcThread();
58  ~XmlRpcThread();
59 
60  virtual void init();
61  virtual void finalize();
62  virtual void loop();
63 
64  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
65 protected:
66  virtual void
67  run()
68  {
69  Thread::run();
70  }
71 
72 private:
73  fawkes::WebServer * webserver_;
74  fawkes::WebRequestDispatcher *dispatcher_;
75  fawkes::WebUrlManager * url_manager_;
76 
77  XmlRpcRequestProcessor *processor_;
78  XmlRpcPluginMethods * plugin_methods_;
79  XmlRpcLogMethods * log_methods_;
80 
81  bool custom_server_;
82  unsigned int cfg_port_;
83 
84  fawkes::CacheLogger cache_logger_;
85  fawkes::NetworkService *xmlrpc_service_;
86 };
87 
88 #endif
XmlRpcThread::XmlRpcThread
XmlRpcThread()
Constructor.
Definition: xmlrpc_thread.cpp:43
fawkes::PluginDirectorAspect
Thread aspect to access the PluginManager.
Definition: plugin_director.h:33
XmlRpcThread::init
virtual void init()
Initialize the thread.
Definition: xmlrpc_thread.cpp:54
XmlRpcRequestProcessor
XML-RPC web request processor.
Definition: xmlrpc_processor.h:41
XmlRpcThread::finalize
virtual void finalize()
Finalize the thread.
Definition: xmlrpc_thread.cpp:105
XmlRpcThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: xmlrpc_thread.h:67
fawkes::WebServer
Encapsulation of the libmicrohttpd webserver.
Definition: server.h:44
fawkes::WebUrlManager
Manage URL mappings.
Definition: url_manager.h:40
fawkes::CacheLogger
Logging Cache.
Definition: cache.h:38
fawkes::WebRequestDispatcher
Web request dispatcher.
Definition: request_dispatcher.h:49
fawkes::LoggerAspect
Thread aspect that allows to provide a logger to Fawkes.
Definition: logger.h:34
XmlRpcThread
XML-RPC Thread.
Definition: xmlrpc_thread.h:55
XmlRpcThread::loop
virtual void loop()
Code to execute in the thread.
Definition: xmlrpc_thread.cpp:123
fawkes::NetworkService
Representation of a service announced or found via service discovery (i.e.
Definition: service.h:38
fawkes::BlackBoardAspect
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
fawkes
Fawkes library namespace.
fawkes::LoggingAspect
Thread aspect to log output.
Definition: logging.h:33
fawkes::WebviewAspect
Thread aspect to provide web pages via Webview.
Definition: webview.h:37
XmlRpcLogMethods
Wrapper class for logging related XML-RPC methods.
Definition: log.h:35
XmlRpcPluginMethods
Wrapper class for plugin related XML-RPC methods.
Definition: plugin.h:34
fawkes::Thread
Thread class encapsulation of pthreads.
Definition: thread.h:46
fawkes::ConfigurableAspect
Thread aspect to access configuration data.
Definition: configurable.h:33
fawkes::NetworkAspect
Thread aspect for network communication.
Definition: network.h:35