java.lang.Object
org.freedesktop.dbus.utils.AddressBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringCreates a machine identifier by using the MD5 sum of the hostname.private static FiledetermineMachineIdFile(String _dbusMachineIdFile) Tries to find the DBus machine-id file in different locations.static StringgetDbusMachineId(String _dbusMachineIdFile) Extracts the machine-id usually found on Linux in various system directories, or generate a fake id for non-Linux platforms.private static StringGenerates a fake machine-id when DBus is running on Windows.static BusAddressgetSessionConnection(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.static BusAddressDetermine the address of the DBus system connection.
-
Constructor Details
-
AddressBuilder
private AddressBuilder()
-
-
Method Details
-
getSystemConnection
Determine the address of the DBus system connection.- Returns:
- String
-
getSessionConnection
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
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
-
determineMachineIdFile
Tries to find the DBus machine-id file in different locations.- Parameters:
_dbusMachineIdFile- alternative location of dbus machine id file- Returns:
- File with machine-id
-
getFakeDbusMachineId
Generates a fake machine-id when DBus is running on Windows.- Returns:
- String
-
createMachineId
Creates a machine identifier by using the MD5 sum of the hostname. If hostname could not be determined, a random string will be used.- Returns:
- String
-