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 <core/threading/thread.h>
27 #include <aspect/logging.h>
28 #include <aspect/configurable.h>
29 #include <aspect/blackboard.h>
30 #include <aspect/network.h>
31 #include <aspect/logger.h>
32 #include <aspect/plugin_director.h>
33 #include <aspect/webview.h>
34 
35 #include <logging/cache.h>
36 
37 namespace fawkes {
38  class NetworkService;
39  class WebRequestDispatcher;
40  class WebUrlManager;
41  class WebServer;
42 }
43 
46 class XmlRpcLogMethods;
47 
49 : public fawkes::Thread,
50  public fawkes::LoggingAspect,
53  public fawkes::NetworkAspect,
54  public fawkes::LoggerAspect,
57 {
58  public:
59  XmlRpcThread();
60  ~XmlRpcThread();
61 
62  virtual void init();
63  virtual void finalize();
64  virtual void loop();
65 
66  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
67  protected: virtual void run() { Thread::run(); }
68 
69  private:
70  fawkes::WebServer *__webserver;
71  fawkes::WebRequestDispatcher *__dispatcher;
72  fawkes::WebUrlManager *__url_manager;
73 
74  XmlRpcRequestProcessor *__processor;
75  XmlRpcPluginMethods *__plugin_methods;
76  XmlRpcLogMethods *__log_methods;
77 
78  bool __custom_server;
79  unsigned int __cfg_port;
80 
81  fawkes::CacheLogger __cache_logger;
82  fawkes::NetworkService *__xmlrpc_service;
83 };
84 
85 #endif
Thread aspect that allows to provide a logger to Fawkes.
Definition: logger.h:36
Web request dispatcher.
Encapsulation of the libmicrohttpd webserver.
Definition: server.h:43
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Fawkes library namespace.
virtual void run()
Code to execute in the thread.
Definition: thread.cpp:939
Wrapper class for plugin related XML-RPC methods.
Definition: plugin.h:33
Wrapper class for logging related XML-RPC methods.
Definition: log.h:34
Logging Cache.
Definition: cache.h:40
Thread aspect for network communication.
Definition: network.h:37
Thread class encapsulation of pthreads.
Definition: thread.h:42
XML-RPC Thread.
Definition: xmlrpc_thread.h:48
Thread aspect to access the PluginManager.
Manage URL mappings.
Definition: url_manager.h:37
Thread aspect to log output.
Definition: logging.h:35
XML-RPC web request processor.
Representation of a service announced or found via service discovery (i.e.
Definition: service.h:37
Thread aspect to access configuration data.
Definition: configurable.h:35
Thread aspect to provide web pages via Webview.
Definition: webview.h:38
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: xmlrpc_thread.h:67