summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-07-07 16:17:24 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-07-07 16:17:24 +0200
commit3ca0d6c07b45fd0aca092bd6d9272b2f0dda6fe1 (patch)
tree04958ecebb0c34d95335c10d99e61b2a2a9f8bfd
parent5b7b33d851002f67b9d32e0702c7da0d82fbbb58 (diff)
downloadabrt-3ca0d6c07b45fd0aca092bd6d9272b2f0dda6fe1.tar.gz
abrt-3ca0d6c07b45fd0aca092bd6d9272b2f0dda6fe1.tar.xz
abrt-3ca0d6c07b45fd0aca092bd6d9272b2f0dda6fe1.zip
Added dbus client to commlayer
-rw-r--r--lib/CommLayer/CommLayerClientDBus.cpp13
-rw-r--r--lib/CommLayer/CommLayerClientDBus.h17
-rw-r--r--lib/CommLayer/DBusClientProxy.h51
-rw-r--r--lib/CommLayer/DBusCommon.h2
-rw-r--r--lib/CommLayer/DBusServerProxy.h1
-rw-r--r--lib/CommLayer/Makefile.am3
6 files changed, 78 insertions, 9 deletions
diff --git a/lib/CommLayer/CommLayerClientDBus.cpp b/lib/CommLayer/CommLayerClientDBus.cpp
new file mode 100644
index 00000000..6f4e4b51
--- /dev/null
+++ b/lib/CommLayer/CommLayerClientDBus.cpp
@@ -0,0 +1,13 @@
+#include "CommLayerClientDBus.h"
+CCommLayerClientDBus::CCommLayerClientDBus(DBus::Connection &connection, const char *path, const char *name)
+: DBus::ObjectProxy(connection, path, name)
+{
+}
+CCommLayerClientDBus::~CCommLayerClientDBus()
+{
+};
+
+void Crash(std::string &value)
+{
+ std::cout << "Another Crash?" << std::endl;
+}
diff --git a/lib/CommLayer/CommLayerClientDBus.h b/lib/CommLayer/CommLayerClientDBus.h
new file mode 100644
index 00000000..9e63f58c
--- /dev/null
+++ b/lib/CommLayer/CommLayerClientDBus.h
@@ -0,0 +1,17 @@
+#include <DBusCommon.h>
+#include <DBusClientProxy.h>
+#include <iostream>
+
+class CCommLayerClientDBus
+: public CDBusClient_proxy,
+ public DBus::IntrospectableProxy,
+ public DBus::ObjectProxy
+{
+ public:
+ CCommLayerClientDBus(DBus::Connection &connection, const char *path, const char *name);
+ ~CCommLayerClientDBus();
+ void Crash(std::string &value)
+ {
+ std::cout << "Another Crash?" << std::endl;
+ }
+};
diff --git a/lib/CommLayer/DBusClientProxy.h b/lib/CommLayer/DBusClientProxy.h
index 4bbf5ee2..8895a11c 100644
--- a/lib/CommLayer/DBusClientProxy.h
+++ b/lib/CommLayer/DBusClientProxy.h
@@ -35,9 +35,6 @@ public:
public:
- /* properties exported by this interface */
-public:
-
/* methods exported by this interface,
* this functions will invoke the corresponding methods on the remote objects
*/
@@ -50,13 +47,12 @@ public:
...
>
*/
- vector_crash_infos_t GetCrashInfos(const std::string &pUID)
+ vector_crash_infos_t GetCrashInfos()
{
DBus::CallMessage call;
DBus::MessageIter wi = call.writer();
- wi << pUID;
call.member("GetCrashInfos");
DBus::Message ret = invoke_method(call);
DBus::MessageIter ri = ret.reader();
@@ -65,6 +61,51 @@ public:
ri >> argout;
return argout;
}
+
+ bool DeleteDebugDump(const std::string& pUUID)
+ {
+ DBus::CallMessage call;
+
+ DBus::MessageIter wi = call.writer();
+
+ wi << pUUID;
+ call.member("DeleteDebugDump");
+ DBus::Message ret = invoke_method(call);
+ DBus::MessageIter ri = ret.reader();
+
+ bool argout;
+ ri >> argout;
+ return argout;
+ }
+
+ map_crash_report_t CreateReport(const std::string& pUUID)
+ {
+ DBus::CallMessage call;
+
+ DBus::MessageIter wi = call.writer();
+
+ wi << pUUID;
+ call.member("CreateReport");
+ DBus::Message ret = invoke_method(call);
+ DBus::MessageIter ri = ret.reader();
+
+ map_crash_report_t argout;
+ ri >> argout;
+ return argout;
+ };
+
+ void Report(map_crash_report_t pReport)
+ {
+ DBus::CallMessage call;
+
+ DBus::MessageIter wi = call.writer();
+
+ wi << pReport;
+ call.member("Report");
+ DBus::Message ret = invoke_method(call);
+ DBus::MessageIter ri = ret.reader();
+ }
+
public:
/* signal handlers for this interface
diff --git a/lib/CommLayer/DBusCommon.h b/lib/CommLayer/DBusCommon.h
index 0f58abc1..0ea94d3b 100644
--- a/lib/CommLayer/DBusCommon.h
+++ b/lib/CommLayer/DBusCommon.h
@@ -21,6 +21,4 @@
#define CC_DBUS_PATH "/com/redhat/abrt"
#define CC_DBUS_IFACE "com.redhat.abrt"
-typedef std::vector< std::map<std::string, std::string> > dbus_vector_map_crash_infos_t;
-
#include "CrashTypes.h"
diff --git a/lib/CommLayer/DBusServerProxy.h b/lib/CommLayer/DBusServerProxy.h
index 45de2f8f..e8e43c56 100644
--- a/lib/CommLayer/DBusServerProxy.h
+++ b/lib/CommLayer/DBusServerProxy.h
@@ -128,7 +128,6 @@ private:
{
DBus::MessageIter ri = call.reader();
- std::string argin1; ri >> argin1;
vector_crash_infos_t argout1 = GetCrashInfos(call.sender());
DBus::ReturnMessage reply(call);
DBus::MessageIter wi = reply.writer();
diff --git a/lib/CommLayer/Makefile.am b/lib/CommLayer/Makefile.am
index 96f897b9..5a1fa503 100644
--- a/lib/CommLayer/Makefile.am
+++ b/lib/CommLayer/Makefile.am
@@ -3,7 +3,8 @@ libABRTCommLayer_la_SOURCES = CommLayerServer.h CommLayerServer.cpp \
CommLayerServerSocket.h CommLayerServerSocket.cpp \
CommLayerServerDBus.h CommLayerServerDBus.cpp \
DBusServerProxy.h Observer.h DBusCommon.h \
- CommLayerInner.h CommLayerInner.cpp
+ CommLayerInner.h CommLayerInner.cpp \
+ DBusClientProxy.h CommLayerClientDBus.h CommLayerClientDBus.cpp
libABRTCommLayer_la_LIBADD = ../../lib/MiddleWare/libABRTMiddleWare.la $(DL_LIBS) $(DBUSCPP_LIBS)
libABRTCommLayer_la_LDFLAGS = -version-info 0:1:0