java question: Getting properties from org.freedesktop.DBus.Properties

Fotis P fotisp87 at gmail.com
Thu Jul 25 11:46:09 PDT 2013


Hello All,

I want to access the method org.freedesktop.DBus.Properties.GetAll() for a
NetworkManager AccessPoint object. To do this I use the following java
code:

    conn = DBusConnection.getConnection(DBusConnection.SYSTEM);

  NetworkManager c = (NetworkManager)
conn.getRemoteObject("org.freedesktop.NetworkManager",
"/org/freedesktop/NetworkManager");

        AccessPoint ap = (AccessPoint)
conn.getRemoteObject("org.freedesktop.NetworkManager",
"/org/freedesktop/NetworkManager/AccessPoint/193", AccessPoint.class);
        DBus.Properties props = (DBus.Properties)
conn.getRemoteObject("org.freedesktop.NetworkManager",
"/org/freedesktop/NetworkManager/AccessPoint/193", DBus.Properties.class);
#Comment: I have also tried giving org.freedesktop.DBus as interface name
for the first argument with no luck

Map<String, Variant> ap_props_map =
props.GetAll("org.freedesktop.NetworkManager.AccessPoint");

As a result I get the exception:

Exception in thread "main" org.freedesktop.DBus$Error$UnknownMethod: Method
"GetAll" with signature "s" on interface "org.freedesktop.DBus.Properties"
doesn't exist

Here are the pastebin of my code and interface declaration:

http://pastebin.com/bQk19t9i (code)
http://pastebin.com/ZLdHy0y2 (interfaces)


If anyone can direct me the to the correct way to do this I will be more
than grateful. It is very important to figure it out as it is part of my
final thesis and I have been stuck to this part for a long time. Many
thanks to anyone who will take the time to answer :)

Fotis

P.S. I can call these methods using qdbus successfully. Its java tha is
giving me a hard time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20130725/03d88005/attachment.html>


More information about the dbus mailing list