Class AddressBuilder

java.lang.Object
org.freedesktop.dbus.utils.AddressBuilder

public final class AddressBuilder extends Object
  • Field Details

    • DBUS_SYSTEM_BUS_ADDRESS

      @Deprecated(forRemoval=true, since="v4.2.2 - 2023-01-20") public static final String DBUS_SYSTEM_BUS_ADDRESS
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constant has been moved to DBusSysProps.
      See Also:
    • DEFAULT_SYSTEM_BUS_ADDRESS

      @Deprecated(forRemoval=true, since="v4.2.2 - 2023-01-20") public static final String DEFAULT_SYSTEM_BUS_ADDRESS
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constant has been moved to DBusSysProps.
      See Also:
    • DBUS_SESSION_BUS_ADDRESS

      @Deprecated(forRemoval=true, since="v4.2.2 - 2023-01-20") public static final String DBUS_SESSION_BUS_ADDRESS
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constant has been moved to DBusSysProps.
      See Also:
  • Method Details

    • getSystemConnection

      public static BusAddress getSystemConnection()
      Determine the address of the DBus system connection.
      Returns:
      String
    • getSessionConnection

      public static BusAddress getSessionConnection(String _dbusMachineIdFile)
      Retrieves the connection address to connect to the DBus session-bus.
      Will return TCP connection when no unix transport found and TCP is available.
      Parameters:
      _dbusMachineIdFile - alternative location of dbus machine id file, use null if not needed
      Returns:
      address
      Throws:
      AddressResolvingException - when no suitable address can be found for any available transport
    • getDbusMachineId

      public static String getDbusMachineId(String _dbusMachineIdFile)
      Extracts the machine-id usually found on Linux in various system directories, or generate a fake id for non-Linux platforms.
      Parameters:
      _dbusMachineIdFile - alternative location of dbus machine id file, null if not needed
      Returns:
      machine-id string, never null