summaryrefslogtreecommitdiffstats
path: root/src/Daemon
diff options
context:
space:
mode:
Diffstat (limited to 'src/Daemon')
-rw-r--r--src/Daemon/CommLayerServer.h24
-rw-r--r--src/Daemon/CommLayerServerDBus.cpp225
-rw-r--r--src/Daemon/CommLayerServerDBus.h48
-rw-r--r--src/Daemon/CommLayerServerSocket.cpp26
-rw-r--r--src/Daemon/CommLayerServerSocket.h7
-rw-r--r--src/Daemon/CrashWatcher.cpp8
-rw-r--r--src/Daemon/CrashWatcher.h17
-rw-r--r--src/Daemon/DBusServerProxy.cpp258
-rw-r--r--src/Daemon/DBusServerProxy.h85
-rw-r--r--src/Daemon/Makefile.am1
10 files changed, 248 insertions, 451 deletions
diff --git a/src/Daemon/CommLayerServer.h b/src/Daemon/CommLayerServer.h
index af79511a..76af62b2 100644
--- a/src/Daemon/CommLayerServer.h
+++ b/src/Daemon/CommLayerServer.h
@@ -9,40 +9,28 @@
#include "Observer.h"
#include "CrashTypes.h"
-/* just a helper function */
-template< class T >
-std::string
-to_string( T x )
-{
- std::ostringstream o;
- o << x;
- return o.str();
-}
-
-
class CCommLayerServer {
protected:
CObserver *m_pObserver;
public:
CCommLayerServer();
virtual ~CCommLayerServer();
+
/* observer */
void Attach(CObserver *pObs);
void Detach(CObserver *pObs);
void Notify(const std::string& pMessage);
- virtual vector_crash_infos_t GetCrashInfos(const std::string &pSender) = 0;
- virtual map_crash_report_t CreateReport(const std::string &pUUID,const std::string &pSender) = 0;
- virtual report_status_t Report(map_crash_report_t pReport,const std::string &pSender) = 0;
+ virtual vector_crash_infos_t GetCrashInfos(const std::string& pSender) = 0;
+ virtual report_status_t Report(const map_crash_report_t& pReport, const std::string& pSender) = 0;
virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pSender) = 0;
- public:
- /* just stubs to be called when not implemented in specific comm layer */
+ /* just stubs to be called when not implemented in specific comm layer */
virtual void Crash(const std::string& arg1) {}
- virtual void AnalyzeComplete(map_crash_report_t arg1) {}
+ virtual void AnalyzeComplete(const map_crash_report_t& arg1) {}
virtual void Error(const std::string& arg1) {}
virtual void Update(const std::string& pDest, const std::string& pMessage) {};
- virtual void Warning(const std::string& pDest, const std::string& pMessage) {};
+ virtual void Warning(const std::string& pMessage) {};
virtual void JobDone(const std::string &pDest, uint64_t pJobID) {};
};
diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp
index f0a9149b..db78cd38 100644
--- a/src/Daemon/CommLayerServerDBus.cpp
+++ b/src/Daemon/CommLayerServerDBus.cpp
@@ -18,8 +18,9 @@ DBus::Connection *CCommLayerServerDBus::init_dbus(CCommLayerServerDBus *self)
}
CCommLayerServerDBus::CCommLayerServerDBus()
-: CCommLayerServer(),
- DBus::ObjectAdaptor(*init_dbus(this), CC_DBUS_PATH)
+:
+ DBus::InterfaceAdaptor(CC_DBUS_IFACE),
+ DBus::ObjectAdaptor(*init_dbus(this), CC_DBUS_PATH)
{
try
{
@@ -33,12 +34,39 @@ CCommLayerServerDBus::CCommLayerServerDBus()
+ " * you have reloaded the dbus\n"+
+ "Original exception was:\n " + err.what());
}
+ register_method(CCommLayerServerDBus, GetCrashInfos, _GetCrashInfos_stub);
+ register_method(CCommLayerServerDBus, CreateReport, _CreateReport_stub);
+ register_method(CCommLayerServerDBus, Report, _Report_stub);
+ register_method(CCommLayerServerDBus, DeleteDebugDump, _DeleteDebugDump_stub);
+ register_method(CCommLayerServerDBus, GetJobResult, _GetJobResult_stub);
+ register_method(CCommLayerServerDBus, GetPluginsInfo, _GetPluginsInfo_stub);
+ register_method(CCommLayerServerDBus, GetPluginSettings, _GetPluginSettings_stub);
+ register_method(CCommLayerServerDBus, SetPluginSettings, _SetPluginSettings_stub);
+ register_method(CCommLayerServerDBus, RegisterPlugin, _RegisterPlugin_stub);
+ register_method(CCommLayerServerDBus, UnRegisterPlugin, _UnRegisterPlugin_stub);
}
CCommLayerServerDBus::~CCommLayerServerDBus()
{
}
+
+/*
+ * DBus call handlers
+ */
+
+/* unmarshaler (non-virtual private function) */
+DBus::Message CCommLayerServerDBus::_GetCrashInfos_stub(const DBus::CallMessage &call)
+{
+ DBus::MessageIter ri = call.reader();
+ //FIXME: @@@REMOVE!!
+ vector_crash_infos_t argout1 = GetCrashInfos(call.sender());
+ DBus::ReturnMessage reply(call);
+ DBus::MessageIter wi = reply.writer();
+ wi << argout1;
+ return reply;
+}
+/* handler (public function) */
vector_crash_infos_t CCommLayerServerDBus::GetCrashInfos(const std::string &pSender)
{
vector_crash_infos_t crashInfos;
@@ -46,16 +74,21 @@ vector_crash_infos_t CCommLayerServerDBus::GetCrashInfos(const std::string &pSen
crashInfos = m_pObserver->GetCrashInfos(to_string(unix_uid));
return crashInfos;
}
-//FIXME: fix CLI and remove this
-/*
-map_crash_report_t CCommLayerServerDBus::CreateReport(const std::string &pUUID,const std::string &pSender)
+
+DBus::Message CCommLayerServerDBus::_CreateReport_stub(const DBus::CallMessage &call)
{
- unsigned long unix_uid = m_pConn->sender_unix_uid(pSender.c_str());
- map_crash_report_t crashReport;
- crashReport = m_pObserver->CreateReport(pUUID, to_string(unix_uid));
- return crashReport;
+ DBus::MessageIter ri = call.reader();
+
+ std::string argin1;
+ ri >> argin1;
+ uint64_t argout1 = CreateReport_t(argin1, call.sender());
+ if (sizeof (uint64_t) != 8) abort ();
+ //map_crash_report_t argout1 = CreateReport(argin1,call.sender());
+ DBus::ReturnMessage reply(call);
+ DBus::MessageIter wi = reply.writer();
+ wi << argout1;
+ return reply;
}
-*/
uint64_t CCommLayerServerDBus::CreateReport_t(const std::string &pUUID,const std::string &pSender)
{
unsigned long unix_uid = m_pConn->sender_unix_uid(pSender.c_str());
@@ -64,7 +97,19 @@ uint64_t CCommLayerServerDBus::CreateReport_t(const std::string &pUUID,const std
return job_id;
}
-report_status_t CCommLayerServerDBus::Report(map_crash_report_t pReport,const std::string &pSender)
+DBus::Message CCommLayerServerDBus::_Report_stub(const DBus::CallMessage &call)
+{
+ DBus::MessageIter ri = call.reader();
+
+ map_crash_report_t argin1;
+ ri >> argin1;
+ report_status_t argout1 = Report(argin1, call.sender());
+ DBus::ReturnMessage reply(call);
+ DBus::MessageIter wi = reply.writer();
+ wi << argout1;
+ return reply;
+}
+report_status_t CCommLayerServerDBus::Report(const map_crash_report_t& pReport, const std::string &pSender)
{
report_status_t rs;
unsigned long unix_uid = m_pConn->sender_unix_uid(pSender.c_str());
@@ -72,6 +117,18 @@ report_status_t CCommLayerServerDBus::Report(map_crash_report_t pReport,const st
return rs;
}
+DBus::Message CCommLayerServerDBus::_DeleteDebugDump_stub(const DBus::CallMessage &call)
+{
+ DBus::MessageIter ri = call.reader();
+
+ std::string argin1;
+ ri >> argin1;
+ bool argout1 = DeleteDebugDump(argin1, call.sender());
+ DBus::ReturnMessage reply(call);
+ DBus::MessageIter wi = reply.writer();
+ wi << argout1;
+ return reply;
+}
bool CCommLayerServerDBus::DeleteDebugDump(const std::string& pUUID, const std::string& pSender)
{
unsigned long unix_uid = m_pConn->sender_unix_uid(pSender.c_str());
@@ -79,6 +136,17 @@ bool CCommLayerServerDBus::DeleteDebugDump(const std::string& pUUID, const std::
return true;
}
+DBus::Message CCommLayerServerDBus::_GetJobResult_stub(const DBus::CallMessage &call)
+{
+ DBus::MessageIter ri = call.reader();
+ uint64_t job_id;
+ ri >> job_id;
+ map_crash_report_t report = GetJobResult(job_id, call.sender());
+ DBus::ReturnMessage reply(call);
+ DBus::MessageIter wi = reply.writer();
+ wi << report;
+ return reply;
+}
map_crash_report_t CCommLayerServerDBus::GetJobResult(uint64_t pJobID, const std::string& pSender)
{
unsigned long unix_uid = m_pConn->sender_unix_uid(pSender.c_str());
@@ -87,63 +155,142 @@ map_crash_report_t CCommLayerServerDBus::GetJobResult(uint64_t pJobID, const std
return crashReport;
}
-void CCommLayerServerDBus::Crash(const std::string& arg)
+DBus::Message CCommLayerServerDBus::_GetPluginsInfo_stub(const DBus::CallMessage &call)
{
- CDBusServer_adaptor::Crash(arg);
+ vector_map_string_string_t plugins_info;
+ plugins_info = GetPluginsInfo();
+ DBus::ReturnMessage reply(call);
+ DBus::MessageIter wi = reply.writer();
+ wi << plugins_info;
+ return reply;
}
-
-void CCommLayerServerDBus::AnalyzeComplete(map_crash_report_t arg1)
+vector_map_string_string_t CCommLayerServerDBus::GetPluginsInfo()
{
- CDBusServer_adaptor::AnalyzeComplete(arg1);
+ //FIXME: simplify?
+ vector_map_string_string_t plugins_info;
+ plugins_info = m_pObserver->GetPluginsInfo();
+ return plugins_info;
}
-void CCommLayerServerDBus::Error(const std::string& arg1)
+DBus::Message CCommLayerServerDBus::_GetPluginSettings_stub(const DBus::CallMessage &call)
+{
+ DBus::MessageIter ri = call.reader();
+ std::string PluginName;
+ std::string uid;
+ ri >> PluginName;
+ map_plugin_settings_t plugin_settings;
+ plugin_settings = GetPluginSettings(PluginName, call.sender());
+ DBus::ReturnMessage reply(call);
+ DBus::MessageIter wi = reply.writer();
+ wi << plugin_settings;
+ return reply;
+}
+map_plugin_settings_t CCommLayerServerDBus::GetPluginSettings(const std::string& pName, const std::string& pSender)
{
- CDBusServer_adaptor::Error(arg1);
+ unsigned long unix_uid = m_pConn->sender_unix_uid(pSender.c_str());
+ return m_pObserver->GetPluginSettings(pName, to_string(unix_uid));
}
-void CCommLayerServerDBus::Update(const std::string& pDest, const std::string& pMessage)
+DBus::Message CCommLayerServerDBus::_SetPluginSettings_stub(const DBus::CallMessage &call)
+{
+ DBus::MessageIter ri = call.reader();
+ std::string PluginName;
+ map_plugin_settings_t plugin_settings;
+ ri >> PluginName;
+ ri >> plugin_settings;
+ SetPluginSettings(PluginName, call.sender(), plugin_settings);
+ DBus::ReturnMessage reply(call);
+ return reply;
+}
+void CCommLayerServerDBus::SetPluginSettings(const std::string& pName, const std::string& pSender, const map_plugin_settings_t& pSettings)
{
- CDBusServer_adaptor::Update(pDest, pMessage);
+ unsigned long unix_uid = m_pConn->sender_unix_uid(pSender.c_str());
+ return m_pObserver->SetPluginSettings(pName, to_string(unix_uid), pSettings);
}
-void CCommLayerServerDBus::JobDone(const std::string &pDest, uint64_t pJobID)
+DBus::Message CCommLayerServerDBus::_RegisterPlugin_stub(const DBus::CallMessage &call)
{
- CDBusServer_adaptor::JobDone(pDest, pJobID);
+ DBus::MessageIter ri = call.reader();
+ std::string PluginName;
+ ri >> PluginName;
+ RegisterPlugin(PluginName);
+ DBus::ReturnMessage reply(call);
+ //DBus::MessageIter wi = reply.writer();
+ //wi << plugin_settings;
+ return reply;
+}
+void CCommLayerServerDBus::RegisterPlugin(const std::string& pName)
+{
+ return m_pObserver->RegisterPlugin(pName);
}
-void CCommLayerServerDBus::Warning(const std::string& pDest, const std::string& pMessage)
+DBus::Message CCommLayerServerDBus::_UnRegisterPlugin_stub(const DBus::CallMessage &call)
{
- CDBusServer_adaptor::Warning(pMessage);
+ DBus::MessageIter ri = call.reader();
+ std::string PluginName;
+ ri >> PluginName;
+ UnRegisterPlugin(PluginName);
+ DBus::ReturnMessage reply(call);
+ return reply;
+}
+void CCommLayerServerDBus::UnRegisterPlugin(const std::string& pName)
+{
+ return m_pObserver->UnRegisterPlugin(pName);
}
-vector_map_string_string_t CCommLayerServerDBus::GetPluginsInfo()
+
+/*
+ * DBus signal emitters
+ */
+
+/* Notify the clients (UI) about a new crash */
+void CCommLayerServerDBus::Crash(const std::string& arg1)
{
- //FIXME: simplify?
- vector_map_string_string_t plugins_info;
- plugins_info = m_pObserver->GetPluginsInfo();
- return plugins_info;
+ ::DBus::SignalMessage sig("Crash");
+ ::DBus::MessageIter wi = sig.writer();
+ wi << arg1;
+ emit_signal(sig);
}
-map_plugin_settings_t CCommLayerServerDBus::GetPluginSettings(const std::string& pName, const std::string& pSender)
+/* Notify the clients that creating a report has finished */
+void CCommLayerServerDBus::AnalyzeComplete(const map_crash_report_t& arg1)
{
- unsigned long unix_uid = m_pConn->sender_unix_uid(pSender.c_str());
- return m_pObserver->GetPluginSettings(pName, to_string(unix_uid));
+ ::DBus::SignalMessage sig("AnalyzeComplete");
+ ::DBus::MessageIter wi = sig.writer();
+ wi << arg1;
+ emit_signal(sig);
}
-void CCommLayerServerDBus::RegisterPlugin(const std::string& pName)
+void CCommLayerServerDBus::JobDone(const std::string &pDest, uint64_t job_id)
{
- return m_pObserver->RegisterPlugin(pName);
+ ::DBus::SignalMessage sig("JobDone");
+ ::DBus::MessageIter wi = sig.writer();
+ wi << pDest;
+ wi << job_id;
+ emit_signal(sig);
}
-void CCommLayerServerDBus::UnRegisterPlugin(const std::string& pName)
+void CCommLayerServerDBus::Error(const std::string& arg1)
{
- return m_pObserver->UnRegisterPlugin(pName);
+ ::DBus::SignalMessage sig("Error");
+ ::DBus::MessageIter wi = sig.writer();
+ wi << arg1;
+ emit_signal(sig);
}
-void CCommLayerServerDBus::SetPluginSettings(const std::string& pName, const std::string& pSender, const map_plugin_settings_t& pSettings)
+void CCommLayerServerDBus::Update(const std::string& pDest, const std::string& pMessage)
{
- unsigned long unix_uid = m_pConn->sender_unix_uid(pSender.c_str());
- return m_pObserver->SetPluginSettings(pName, to_string(unix_uid), pSettings);
+ ::DBus::SignalMessage sig("Update");
+ ::DBus::MessageIter wi = sig.writer();
+ wi << pDest;
+ wi << pMessage;
+ emit_signal(sig);
}
+void CCommLayerServerDBus::Warning(const std::string& arg1)
+{
+ ::DBus::SignalMessage sig("Warning");
+ ::DBus::MessageIter wi = sig.writer();
+ wi << arg1;
+ emit_signal(sig);
+}
diff --git a/src/Daemon/CommLayerServerDBus.h b/src/Daemon/CommLayerServerDBus.h
index ad245061..bbc0c3d1 100644
--- a/src/Daemon/CommLayerServerDBus.h
+++ b/src/Daemon/CommLayerServerDBus.h
@@ -1,46 +1,58 @@
-#include "CommLayerServer.h"
+#ifndef COMMLAYERSERVERDBUS_H_
+#define COMMLAYERSERVERDBUS_H_
#include <dbus-c++/dbus.h>
#include <dbus-c++/glib-integration.h>
-#include "DBusServerProxy.h"
-#include <iostream>
+#include "CommLayerServer.h"
class CCommLayerServerDBus
: public CCommLayerServer,
- public CDBusServer_adaptor,
- public DBus::IntrospectableAdaptor,
+ public DBus::InterfaceAdaptor,
+// public DBus::IntrospectableAdaptor,
public DBus::ObjectAdaptor
{
private:
DBus::Connection *m_pConn;
static DBus::Connection *init_dbus(CCommLayerServerDBus *self);
+
public:
CCommLayerServerDBus();
virtual ~CCommLayerServerDBus();
+ /* DBus call handlers */
+ private:
+ /* unmarshalers */
+ DBus::Message _GetCrashInfos_stub(const DBus::CallMessage &call);
+ DBus::Message _CreateReport_stub(const DBus::CallMessage &call);
+ DBus::Message _Report_stub(const DBus::CallMessage &call);
+ DBus::Message _DeleteDebugDump_stub(const DBus::CallMessage &call);
+ DBus::Message _GetJobResult_stub(const DBus::CallMessage &call);
+ DBus::Message _GetPluginsInfo_stub(const DBus::CallMessage &call);
+ DBus::Message _GetPluginSettings_stub(const DBus::CallMessage &call);
+ DBus::Message _SetPluginSettings_stub(const DBus::CallMessage &call);
+ DBus::Message _RegisterPlugin_stub(const DBus::CallMessage &call);
+ DBus::Message _UnRegisterPlugin_stub(const DBus::CallMessage &call);
+ public:
+ /* handlers */
virtual vector_crash_infos_t GetCrashInfos(const std::string& pSender);
- /*FIXME: fix CLI and remove this stub*/
- virtual map_crash_report_t CreateReport(const std::string& pUUID, const std::string& pSender)
- {
- map_crash_report_t retval;
- return retval;
- }
virtual uint64_t CreateReport_t(const std::string& pUUID, const std::string& pSender);
- virtual report_status_t Report(map_crash_report_t pReport,const std::string& pSender);
+ virtual report_status_t Report(const map_crash_report_t& pReport, const std::string& pSender);
virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pSender);
virtual map_crash_report_t GetJobResult(uint64_t pJobID, const std::string& pSender);
virtual vector_map_string_string_t GetPluginsInfo();
virtual map_plugin_settings_t GetPluginSettings(const std::string& pName, const std::string& pSender);
- void SetPluginSettings(const std::string& pName, const std::string& pSender, const map_plugin_settings_t& pSettings);
- void RegisterPlugin(const std::string& pName);
- void UnRegisterPlugin(const std::string& pName);
+ virtual void SetPluginSettings(const std::string& pName, const std::string& pSender, const map_plugin_settings_t& pSettings);
+ virtual void RegisterPlugin(const std::string& pName);
+ virtual void UnRegisterPlugin(const std::string& pName);
+ /* DBus signal senders */
+ public:
virtual void Crash(const std::string& arg1);
- virtual void AnalyzeComplete(map_crash_report_t arg1);
+ virtual void AnalyzeComplete(const map_crash_report_t& arg1);
virtual void Error(const std::string& arg1);
virtual void Update(const std::string& pDest, const std::string& pMessage);
virtual void JobDone(const std::string& pDest, uint64_t pJobID);
- virtual void Warning(const std::string& pDest, const std::string& pMessage);
+ virtual void Warning(const std::string& pMessage);
};
/*
@@ -48,3 +60,5 @@ class CCommLayerServerDBus
* (otherwise "new DBus::Connection(DBus::Connection::SystemBus())" fails)
*/
void attach_dbus_dispatcher_to_glib_main_context();
+
+#endif
diff --git a/src/Daemon/CommLayerServerSocket.cpp b/src/Daemon/CommLayerServerSocket.cpp
index f5466d43..734c5a18 100644
--- a/src/Daemon/CommLayerServerSocket.cpp
+++ b/src/Daemon/CommLayerServerSocket.cpp
@@ -148,10 +148,11 @@ void CCommLayerServerSocket::ProcessMessage(const std::string& pMessage, GIOChan
}
else if (!strncmp(pMessage.c_str(), MESSAGE_CREATE_REPORT, sizeof(MESSAGE_CREATE_REPORT) - 1))
{
- std::string UUID = pMessage.substr(sizeof(MESSAGE_CREATE_REPORT) - 1);
- map_crash_report_t crashReport = CreateReport(UUID, UID);
- std::string message = MESSAGE_CREATE_REPORT + crash_report_to_string(crashReport);
- Send(message, pSource);
+// std::string UUID = pMessage.substr(sizeof(MESSAGE_CREATE_REPORT) - 1);
+// map_crash_report_t crashReport = CreateReport(UUID, UID);
+//use CreateReport_t instead of CreateReport?
+// std::string message = MESSAGE_CREATE_REPORT + crash_report_to_string(crashReport);
+// Send(message, pSource);
}
else if (!strncmp(pMessage.c_str(), MESSAGE_DELETE_DEBUG_DUMP, sizeof(MESSAGE_DELETE_DEBUG_DUMP) - 1))
{
@@ -212,14 +213,15 @@ vector_crash_infos_t CCommLayerServerSocket::GetCrashInfos(const std::string &pS
return crashInfos;
}
-map_crash_report_t CCommLayerServerSocket::CreateReport(const std::string &pUUID,const std::string &pSender)
-{
- map_crash_report_t crashReport;
- crashReport = m_pObserver->CreateReport(pUUID, pSender);
- return crashReport;
-}
+//reimplement as CreateReport_t(...)?
+//map_crash_report_t CCommLayerServerSocket::CreateReport(const std::string &pUUID,const std::string &pSender)
+//{
+// map_crash_report_t crashReport;
+// crashReport = m_pObserver->CreateReport(pUUID, pSender);
+// return crashReport;
+//}
-report_status_t CCommLayerServerSocket::Report(map_crash_report_t pReport, const std::string& pSender)
+report_status_t CCommLayerServerSocket::Report(const map_crash_report_t& pReport, const std::string& pSender)
{
report_status_t rs;
rs = m_pObserver->Report(pReport, pSender);
@@ -237,7 +239,7 @@ void CCommLayerServerSocket::Crash(const std::string& arg1)
//Send("(CRASH)New Crash Detected: " + arg1);
}
-void CCommLayerServerSocket::AnalyzeComplete(map_crash_report_t arg1)
+void CCommLayerServerSocket::AnalyzeComplete(const map_crash_report_t& arg1)
{
//Send("(ANALYZE_COMPLETE)Analyze Complete.");
}
diff --git a/src/Daemon/CommLayerServerSocket.h b/src/Daemon/CommLayerServerSocket.h
index 2dc9a7ae..e0b7478e 100644
--- a/src/Daemon/CommLayerServerSocket.h
+++ b/src/Daemon/CommLayerServerSocket.h
@@ -26,12 +26,11 @@ class CCommLayerServerSocket : public CCommLayerServer
CCommLayerServerSocket();
virtual ~CCommLayerServerSocket();
- virtual vector_crash_infos_t GetCrashInfos(const std::string &pSender);
- virtual map_crash_report_t CreateReport(const std::string &pUUID,const std::string &pSender);
- virtual report_status_t Report(map_crash_report_t pReport, const std::string& pSender);
+ virtual vector_crash_infos_t GetCrashInfos(const std::string& pSender);
+ virtual report_status_t Report(const map_crash_report_t& pReport, const std::string& pSender);
virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pSender);
virtual void Crash(const std::string& arg1);
- virtual void AnalyzeComplete(map_crash_report_t arg1);
+ virtual void AnalyzeComplete(const map_crash_report_t& arg1);
virtual void Error(const std::string& arg1);
};
diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp
index 89e9fe9a..f0593c1c 100644
--- a/src/Daemon/CrashWatcher.cpp
+++ b/src/Daemon/CrashWatcher.cpp
@@ -30,14 +30,14 @@ void CCrashWatcher::Status(const std::string& pMessage, const std::string& pDest
g_pCommLayer->Update(pDest, pMessage);
}
-void CCrashWatcher::Warning(const std::string& pMessage, const std::string& pDest)
+void CCrashWatcher::Warning(const std::string& pMessage)
{
std::cerr << "Warning: " + pMessage << std::endl;
if (g_pCommLayer != NULL)
- g_pCommLayer->Warning(pDest, pMessage);
+ g_pCommLayer->Warning(pMessage);
}
-void CCrashWatcher::Debug(const std::string& pMessage, const std::string& pDest)
+void CCrashWatcher::Debug(const std::string& pMessage)
{
//some logic to add logging levels?
std::cout << "Debug: " + pMessage << std::endl;
@@ -192,7 +192,7 @@ uint64_t CCrashWatcher::CreateReport_t(const std::string &pUUID,const std::strin
return 0;
}
-report_status_t CCrashWatcher::Report(map_crash_report_t pReport, const std::string& pUID)
+report_status_t CCrashWatcher::Report(const map_crash_report_t& pReport, const std::string& pUID)
{
//#define FIELD(X) crashReport.m_s##X = pReport[#X];
//crashReport.m_sUUID = pReport["UUID"];
diff --git a/src/Daemon/CrashWatcher.h b/src/Daemon/CrashWatcher.h
index ae600abb..ac12911b 100644
--- a/src/Daemon/CrashWatcher.h
+++ b/src/Daemon/CrashWatcher.h
@@ -42,9 +42,6 @@
class CCrashWatcher
-//: public CDBusServer_adaptor,
-// public DBus::IntrospectableAdaptor,
-// public DBus::ObjectAdaptor,
: public CObserver
{
public:
@@ -53,18 +50,12 @@ class CCrashWatcher
public:
/* Observer methods */
- virtual void Status(const std::string& pMessage,const std::string& pDest="0");
- virtual void Debug(const std::string& pMessage, const std::string& pDest="0");
- virtual void Warning(const std::string& pMessage, const std::string& pDest="0");
+ virtual void Status(const std::string& pMessage, const std::string& pDest="0");
+ virtual void Debug(const std::string& pMessage);
+ virtual void Warning(const std::string& pMessage);
virtual vector_crash_infos_t GetCrashInfos(const std::string &pUID);
- /*FIXME: fix CLI and remove this stub*/
- virtual map_crash_report_t CreateReport(const std::string &pUUID,const std::string &pUID)
- {
- map_crash_report_t retval;
- return retval;
- }
uint64_t CreateReport_t(const std::string &pUUID,const std::string &pUID, const std::string &pSender);
- virtual report_status_t Report(map_crash_report_t pReport, const std::string &pUID);
+ virtual report_status_t Report(const map_crash_report_t& pReport, const std::string &pUID);
virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pUID);
virtual map_crash_report_t GetJobResult(uint64_t pJobID, const std::string& pSender);
/* plugins related */
diff --git a/src/Daemon/DBusServerProxy.cpp b/src/Daemon/DBusServerProxy.cpp
deleted file mode 100644
index 5730fd52..00000000
--- a/src/Daemon/DBusServerProxy.cpp
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com)
- Copyright (C) 2009 RedHat inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "DBusServerProxy.h"
-#include <stdlib.h>
-
-/* public: */
-
-CDBusServer_adaptor::CDBusServer_adaptor()
-: DBus::InterfaceAdaptor(CC_DBUS_IFACE)
-{
- register_method(CDBusServer_adaptor, GetCrashInfos, _GetCrashInfos_stub);
- register_method(CDBusServer_adaptor, CreateReport, _CreateReport_stub);
- register_method(CDBusServer_adaptor, Report, _Report_stub);
- register_method(CDBusServer_adaptor, DeleteDebugDump, _DeleteDebugDump_stub);
- register_method(CDBusServer_adaptor, GetJobResult, _GetJobResult_stub);
- register_method(CDBusServer_adaptor, GetPluginsInfo, _GetPluginsInfo_stub);
- register_method(CDBusServer_adaptor, GetPluginSettings, _GetPluginSettings_stub);
- register_method(CDBusServer_adaptor, RegisterPlugin, _RegisterPlugin_stub);
- register_method(CDBusServer_adaptor, UnRegisterPlugin, _UnRegisterPlugin_stub);
- register_method(CDBusServer_adaptor, SetPluginSettings, _SetPluginSettings_stub);
-}
-/* reveal Interface introspection when we stabilize the API */
-/*
-DBus::IntrospectedInterface *const CDBusServer_adaptor::introspect() const
-{
- static DBus::IntrospectedArgument GetCrashInfos_args[] =
- {
- //{ "uid", "i", true},
- { "info", "a{ss}", false },
- { 0, 0, 0 }
- };
- static DBus::IntrospectedArgument Crash_args[] =
- {
- { "package", "s", false },
- { 0, 0, 0 }
- };
- static DBus::IntrospectedMethod CDBusServer_adaptor_methods[] =
- {
- { "GetCrashInfos", GetCrashInfos_args },
- { 0, 0 },
- { "GetCrashInfosMap", GetCrashInfos_args },
- { 0, 0 }
- };
- static DBus::IntrospectedMethod CDBusServer_adaptor_signals[] =
- {
- { "Crash", Crash_args },
- { 0, 0 }
- };
- static DBus::IntrospectedProperty CDBusServer_adaptor_properties[] =
- {
- { 0, 0, 0, 0 }
- };
- static DBus::IntrospectedInterface CDBusServer_adaptor_interface =
- {
- "com.redhat.abrt",
- CDBusServer_adaptor_methods,
- CDBusServer_adaptor_signals,
- CDBusServer_adaptor_properties
- };
- return &CDBusServer_adaptor_interface;
-}
-*/
-
-/* public: */
-
-/* signal emitters for this interface */
-
-/* Notify the clients (UI) about a new crash */
-void CDBusServer_adaptor::Crash(const std::string& arg1)
-{
- ::DBus::SignalMessage sig("Crash");
- ::DBus::MessageIter wi = sig.writer();
- wi << arg1;
- emit_signal(sig);
-}
-
-/* Notify the clients that creating a report has finished */
-void CDBusServer_adaptor::AnalyzeComplete(map_crash_report_t arg1)
-{
- ::DBus::SignalMessage sig("AnalyzeComplete");
- ::DBus::MessageIter wi = sig.writer();
- wi << arg1;
- emit_signal(sig);
-}
-
-void CDBusServer_adaptor::JobDone(const std::string &pDest, uint64_t job_id)
-{
- ::DBus::SignalMessage sig("JobDone");
- ::DBus::MessageIter wi = sig.writer();
- wi << pDest;
- wi << job_id;
- emit_signal(sig);
-}
-
-void CDBusServer_adaptor::Error(const std::string& arg1)
-{
- ::DBus::SignalMessage sig("Error");
- ::DBus::MessageIter wi = sig.writer();
- wi << arg1;
- emit_signal(sig);
-}
-
-void CDBusServer_adaptor::Update(const std::string pDest, const std::string& pMessage)
-{
- ::DBus::SignalMessage sig("Update");
- ::DBus::MessageIter wi = sig.writer();
- wi << pDest;
- wi << pMessage;
- emit_signal(sig);
-}
-
-void CDBusServer_adaptor::Warning(const std::string& arg1)
-{
- ::DBus::SignalMessage sig("Warning");
- ::DBus::MessageIter wi = sig.writer();
- wi << arg1;
- emit_signal(sig);
-}
-
-/* private: */
-
-/* unmarshalers (to unpack the DBus message before calling the actual interface method)
- */
-DBus::Message CDBusServer_adaptor::_GetCrashInfos_stub(const DBus::CallMessage &call)
-{
- DBus::MessageIter ri = call.reader();
- //FIXME: @@@REMOVE!!
- vector_crash_infos_t argout1 = GetCrashInfos(call.sender());
- DBus::ReturnMessage reply(call);
- DBus::MessageIter wi = reply.writer();
- wi << argout1;
- return reply;
-}
-
-DBus::Message CDBusServer_adaptor::_CreateReport_stub(const DBus::CallMessage &call)
-{
- DBus::MessageIter ri = call.reader();
-
- std::string argin1; ri >> argin1;
- uint64_t argout1 = CreateReport_t(argin1, call.sender());
- if(sizeof (uint64_t) != 8) abort ();
- //map_crash_report_t argout1 = CreateReport(argin1,call.sender());
- DBus::ReturnMessage reply(call);
- DBus::MessageIter wi = reply.writer();
- wi << argout1;
- return reply;
-}
-
-DBus::Message CDBusServer_adaptor::_Report_stub(const DBus::CallMessage &call)
-{
- DBus::MessageIter ri = call.reader();
-
- map_crash_report_t argin1; ri >> argin1;
- report_status_t argout1 = Report(argin1, call.sender());
- DBus::ReturnMessage reply(call);
- DBus::MessageIter wi = reply.writer();
- wi << argout1;
- return reply;
-}
-
-DBus::Message CDBusServer_adaptor::_DeleteDebugDump_stub(const DBus::CallMessage &call)
-{
- DBus::MessageIter ri = call.reader();
-
- std::string argin1; ri >> argin1;
- bool argout1 = DeleteDebugDump(argin1, call.sender());
- DBus::ReturnMessage reply(call);
- DBus::MessageIter wi = reply.writer();
- wi << argout1;
- return reply;
-}
-
-DBus::Message CDBusServer_adaptor::_GetJobResult_stub(const DBus::CallMessage &call)
-{
- DBus::MessageIter ri = call.reader();
- uint64_t job_id;
- ri >> job_id;
- map_crash_report_t report = GetJobResult(job_id, call.sender());
- DBus::ReturnMessage reply(call);
- DBus::MessageIter wi = reply.writer();
- wi << report;
- return reply;
-}
-
-DBus::Message CDBusServer_adaptor::_GetPluginsInfo_stub(const DBus::CallMessage &call)
-{
- vector_map_string_string_t plugins_info;
- plugins_info = GetPluginsInfo();
- DBus::ReturnMessage reply(call);
- DBus::MessageIter wi = reply.writer();
- wi << plugins_info;
- return reply;
-}
-
-DBus::Message CDBusServer_adaptor::_GetPluginSettings_stub(const DBus::CallMessage &call)
-{
- DBus::MessageIter ri = call.reader();
- std::string PluginName;
- std::string uid;
- ri >> PluginName;
- map_plugin_settings_t plugin_settings;
- plugin_settings = GetPluginSettings(PluginName, call.sender());
- DBus::ReturnMessage reply(call);
- DBus::MessageIter wi = reply.writer();
- wi << plugin_settings;
- return reply;
-}
-
-DBus::Message CDBusServer_adaptor::_RegisterPlugin_stub(const DBus::CallMessage &call)
-{
- DBus::MessageIter ri = call.reader();
- std::string PluginName;
- ri >> PluginName;
- RegisterPlugin(PluginName);
- DBus::ReturnMessage reply(call);
- //DBus::MessageIter wi = reply.writer();
- //wi << plugin_settings;
- return reply;
-}
-
-DBus::Message CDBusServer_adaptor::_UnRegisterPlugin_stub(const DBus::CallMessage &call)
-{
- DBus::MessageIter ri = call.reader();
- std::string PluginName;
- ri >> PluginName;
- UnRegisterPlugin(PluginName);
- DBus::ReturnMessage reply(call);
- return reply;
-}
-
-DBus::Message CDBusServer_adaptor::_SetPluginSettings_stub(const DBus::CallMessage &call)
-{
- DBus::MessageIter ri = call.reader();
- std::string PluginName;
- map_plugin_settings_t plugin_settings;
- ri >> PluginName;
- ri >> plugin_settings;
- SetPluginSettings(PluginName, call.sender(), plugin_settings);
- DBus::ReturnMessage reply(call);
- return reply;
-}
diff --git a/src/Daemon/DBusServerProxy.h b/src/Daemon/DBusServerProxy.h
deleted file mode 100644
index 20538412..00000000
--- a/src/Daemon/DBusServerProxy.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com)
- Copyright (C) 2009 RedHat inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef DBUSSERVERPROXY_H_
-#define DBUSSERVERPROXY_H_
-
-#include <dbus-c++/dbus.h>
-#include <dbus-c++/glib-integration.h>
-#include "DBusCommon.h"
-
-class CDBusServer_adaptor
-: public DBus::InterfaceAdaptor
-{
-public:
- CDBusServer_adaptor();
-/* reveal Interface introspection when we stabilize the API */
-/*
- DBus::IntrospectedInterface *const introspect() const;
-*/
-
-public:
- /* properties exposed by this interface, use
- * property() and property(value) to get and set a particular property
- */
-
-public:
- /* methods exported by this interface,
- * you will have to implement them in your ObjectAdaptor
- */
-
- virtual vector_crash_infos_t GetCrashInfos(const std::string &pDBusSender) = 0;
- virtual map_crash_report_t CreateReport(const std::string &pUUID, const std::string &pDBusSender) = 0;
- virtual uint64_t CreateReport_t(const std::string &pUUID, const std::string &pDBusSender) = 0;
- virtual report_status_t Report(map_crash_report_t pReport, const std::string &pDBusSender) = 0;
- virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pDBusSender) = 0;
- virtual map_crash_report_t GetJobResult(uint64_t pJobID, const std::string& pDBusSender) = 0;
- virtual vector_map_string_string_t GetPluginsInfo() = 0;
- virtual map_plugin_settings_t GetPluginSettings(const std::string& pName, const std::string& pDBusSender) = 0;
- virtual void SetPluginSettings(const std::string& pName, const std::string& pSender, const map_plugin_settings_t& pSettings) = 0;
- virtual void RegisterPlugin(const std::string& pName) = 0;
- virtual void UnRegisterPlugin(const std::string& pName) = 0;
-
-public:
- /* signal emitters for this interface
- */
- /* Notify the clients (UI) about a new crash */
- void Crash(const std::string& arg1);
- /* Notify the clients that creating a report has finished */
- void AnalyzeComplete(map_crash_report_t arg1);
- void JobDone(const std::string &pDest, uint64_t job_id);
- void Error(const std::string& arg1);
- void Update(const std::string pDest, const std::string& pMessage);
- void Warning(const std::string& arg1);
-
-private:
- /* unmarshalers (to unpack the DBus message before calling the actual interface method)
- */
- DBus::Message _GetCrashInfos_stub(const DBus::CallMessage &call);
- DBus::Message _CreateReport_stub(const DBus::CallMessage &call);
- DBus::Message _Report_stub(const DBus::CallMessage &call);
- DBus::Message _DeleteDebugDump_stub(const DBus::CallMessage &call);
- DBus::Message _GetJobResult_stub(const DBus::CallMessage &call);
- DBus::Message _GetPluginsInfo_stub(const DBus::CallMessage &call);
- DBus::Message _GetPluginSettings_stub(const DBus::CallMessage &call);
- DBus::Message _RegisterPlugin_stub(const DBus::CallMessage &call);
- DBus::Message _UnRegisterPlugin_stub(const DBus::CallMessage &call);
- DBus::Message _SetPluginSettings_stub(const DBus::CallMessage &call);
-};
-
-#endif
diff --git a/src/Daemon/Makefile.am b/src/Daemon/Makefile.am
index d36650ab..af2f406e 100644
--- a/src/Daemon/Makefile.am
+++ b/src/Daemon/Makefile.am
@@ -1,7 +1,6 @@
sbin_PROGRAMS = abrt
abrt_SOURCES = \
- DBusServerProxy.h DBusServerProxy.cpp \
ABRTPlugin.cpp ABRTPlugin.h \
PluginManager.cpp PluginManager.h \
MiddleWare.cpp MiddleWare.h \