NetworkManager.ActivateConnection and java-dbus

Vladimir Prus vladimir at codesourcery.com
Thu Apr 25 09:43:27 PDT 2013


Hi,

I am trying to use NetworkManager interfaces using java-dbus (as of version 2.7), and seem to
be missing some design behind DBusInterface and Path classes. Running CreateInterface as follows:

    ./CreateInterface --system org.freedesktop.NetworkManager /org/freedesktop/NetworkManager

created me a class that has this method:

     public DBusInterface ActivateConnection(DBusInterface connection, DBusInterface device, DBusInterface specific_object);

Documentation for that method say that the last parameter should be the object path of "/", at least when activating
wired connection, and the only way I could do that is to is to change type of last parameter to Path, like so:

     public DBusInterface ActivateConnection(DBusInterface connection, DBusInterface device, Path specific_object);

This works to me now, but it seems that if in future, I need to pass DBusInterface for the last parameter, I will
have a reserve problem. So:

      - DBusInterface cannot be created for object path of "/"
      - It does not appear I can convert DBusInterface to Path, unless I keep track of the original path used
        to obtain each DBusInterface instance

Am I missing something, and what's the right type to use for third parameter here?

-- 
Vladimir Prus
CodeSourcery / Mentor Graphics
http://www.mentor.com/embedded-software/



More information about the dbus mailing list