summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-08-12 18:37:55 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-08-12 18:37:55 +0200
commit98f1102f06f5e593cd8f186271db5cadf0e28417 (patch)
tree3293a343264d8f12d950aedb459c4ab122dc94a0
parent944ace188c56c5b1313e7597d7bb11079ed5c01d (diff)
downloadabrt-98f1102f06f5e593cd8f186271db5cadf0e28417.tar.gz
abrt-98f1102f06f5e593cd8f186271db5cadf0e28417.tar.xz
abrt-98f1102f06f5e593cd8f186271db5cadf0e28417.zip
DBUS: exposed method SetPluginSettings
-rw-r--r--lib/CommLayer/CommLayerServerDBus.cpp6
-rw-r--r--lib/CommLayer/CommLayerServerDBus.h1
-rw-r--r--lib/CommLayer/DBusServerProxy.cpp13
-rw-r--r--lib/CommLayer/DBusServerProxy.h2
-rw-r--r--lib/CommLayer/Observer.h1
-rw-r--r--src/Daemon/CrashWatcher.cpp16
-rw-r--r--src/Daemon/CrashWatcher.h1
7 files changed, 40 insertions, 0 deletions
diff --git a/lib/CommLayer/CommLayerServerDBus.cpp b/lib/CommLayer/CommLayerServerDBus.cpp
index 4b6c99b0..5d5972a0 100644
--- a/lib/CommLayer/CommLayerServerDBus.cpp
+++ b/lib/CommLayer/CommLayerServerDBus.cpp
@@ -133,3 +133,9 @@ void CCommLayerServerDBus::UnRegisterPlugin(const std::string& pName)
return m_pObserver->UnRegisterPlugin(pName);
}
+void CCommLayerServerDBus::SetPluginSettings(const std::string& pName, const std::string& pSender, const map_plugin_settings_t& pSettings)
+{
+ unsigned long unix_uid = m_pConn->sender_unix_uid(pSender.c_str());
+ return m_pObserver->SetPluginSettings(pName, to_string(unix_uid), pSettings);
+}
+
diff --git a/lib/CommLayer/CommLayerServerDBus.h b/lib/CommLayer/CommLayerServerDBus.h
index a020e9bc..736a445b 100644
--- a/lib/CommLayer/CommLayerServerDBus.h
+++ b/lib/CommLayer/CommLayerServerDBus.h
@@ -28,6 +28,7 @@ class CCommLayerServerDBus
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);
diff --git a/lib/CommLayer/DBusServerProxy.cpp b/lib/CommLayer/DBusServerProxy.cpp
index a246e8ae..5c785cef 100644
--- a/lib/CommLayer/DBusServerProxy.cpp
+++ b/lib/CommLayer/DBusServerProxy.cpp
@@ -34,6 +34,7 @@ CDBusServer_adaptor::CDBusServer_adaptor()
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 */
/*
@@ -243,3 +244,15 @@ DBus::Message CDBusServer_adaptor::_UnRegisterPlugin_stub(const DBus::CallMessag
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/lib/CommLayer/DBusServerProxy.h b/lib/CommLayer/DBusServerProxy.h
index 299ab34e..5f767bc0 100644
--- a/lib/CommLayer/DBusServerProxy.h
+++ b/lib/CommLayer/DBusServerProxy.h
@@ -51,6 +51,7 @@ public:
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;
@@ -78,6 +79,7 @@ private:
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/lib/CommLayer/Observer.h b/lib/CommLayer/Observer.h
index 42688295..46b6226a 100644
--- a/lib/CommLayer/Observer.h
+++ b/lib/CommLayer/Observer.h
@@ -27,6 +27,7 @@ class CObserver {
virtual map_crash_report_t GetJobResult(uint64_t pJobID, const std::string &pSender) = 0;
virtual vector_map_string_string_t GetPluginsInfo() = 0;
virtual map_plugin_settings_t GetPluginSettings(const std::string& pName, const std::string& pUID) = 0;
+ virtual void SetPluginSettings(const std::string& pName, const std::string& pUID, const map_plugin_settings_t& pSettings) = 0;
virtual void RegisterPlugin(const std::string& pName) = 0;
virtual void UnRegisterPlugin(const std::string& pName) = 0;
};
diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp
index 4c0ba64e..44ac253d 100644
--- a/src/Daemon/CrashWatcher.cpp
+++ b/src/Daemon/CrashWatcher.cpp
@@ -931,3 +931,19 @@ void CCrashWatcher::UnRegisterPlugin(const std::string& pName)
Warning(e.what());
}
}
+
+void CCrashWatcher::SetPluginSettings(const std::string& pName, const std::string& pUID, const map_plugin_settings_t& pSettings)
+{
+ try
+ {
+ m_pMW->SetPluginSettings(pName, pUID, pSettings);
+ }
+ catch(CABRTException &e)
+ {
+ if (e.type() == EXCEP_FATAL)
+ {
+ throw e;
+ }
+ Warning(e.what());
+ }
+}
diff --git a/src/Daemon/CrashWatcher.h b/src/Daemon/CrashWatcher.h
index bc8c6f64..7851dfdb 100644
--- a/src/Daemon/CrashWatcher.h
+++ b/src/Daemon/CrashWatcher.h
@@ -133,6 +133,7 @@ class CCrashWatcher
/* plugins related */
virtual vector_map_string_string_t GetPluginsInfo();
virtual map_plugin_settings_t GetPluginSettings(const std::string& pName, const std::string& pUID);
+ void SetPluginSettings(const std::string& pName, const std::string& pUID, const map_plugin_settings_t& pSettings);
void RegisterPlugin(const std::string& pName);
void UnRegisterPlugin(const std::string& pName);