Class DBusConnectionBuilder
java.lang.Object
org.freedesktop.dbus.connections.impl.BaseConnectionBuilder<DBusConnectionBuilder,DBusConnection>
org.freedesktop.dbus.connections.impl.DBusConnectionBuilder
public final class DBusConnectionBuilder
extends BaseConnectionBuilder<DBusConnectionBuilder,DBusConnection>
Builder to create a new DBusConnection.
- Version:
- 4.1.0 - 2022-02-04
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDBusConnectionBuilder(BusAddress _address, String _machineId) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Create the newDBusConnection.static DBusConnectionBuilderforAddress(String _address) Use the given address to create the connection (e.g.static DBusConnectionBuilderforAddress(BusAddress _address) Use the given address to create the connection (e.g.static DBusConnectionBuilderCreate a new default connection connecting to the DBus session bus.static DBusConnectionBuilderforSessionBus(String _machineIdFileLocation) Create a new default connection connecting to DBus session bus but use an alternative input for the machineID.static DBusConnectionBuilderCreate new default connection to the DBus system bus.static DBusConnectionBuilderCreate a default connection to DBus using the given bus type.static DBusConnectionBuilderforType(DBusConnection.DBusBusType _type, String _machineIdFile) Create a default connection to DBus using the given bus type and machineIdFile.static byteDeprecated, for removal: This API element is subject to removal in a future version.private static BusAddressvalidateTransportAddress(BusAddress _address) Checks if the given address can be used with the available transports.withRegisterSelf(boolean _register) Register the new connection on DBus using 'hello' message.withShared(boolean _shared) Use this connection as shared connection.Methods inherited from class org.freedesktop.dbus.connections.impl.BaseConnectionBuilder
buildThreadConfig, buildTransportConfig, getDisconnectCallback, getEndianess, isWeakReference, receivingThreadConfig, self, transportConfig, withDisconnectCallback, withEndianess, withErrorHandlerThreadCount, withMethodCallThreadCount, withMethodReturnThreadCount, withSignalThreadCount, withWeakReferences
-
Field Details
-
machineId
-
registerSelf
private boolean registerSelf
-
-
Constructor Details
-
DBusConnectionBuilder
-
-
Method Details
-
forSessionBus
Create a new default connection connecting to DBus session bus but use an alternative input for the machineID.- Parameters:
_machineIdFileLocation- file with machine ID- Returns:
DBusConnectionBuilder
-
forSystemBus
Create new default connection to the DBus system bus.- Returns:
DBusConnectionBuilder
-
forSessionBus
Create a new default connection connecting to the DBus session bus.- Returns:
DBusConnectionBuilder
-
forType
Create a default connection to DBus using the given bus type.- Parameters:
_type- bus type- Returns:
- this
-
forType
public static DBusConnectionBuilder forType(DBusConnection.DBusBusType _type, String _machineIdFile) Create a default connection to DBus using the given bus type and machineIdFile.- Parameters:
_type- bus type_machineIdFile- machineId file- Returns:
- this
-
forAddress
Use the given address to create the connection (e.g. used for remote TCP connected DBus daemons).- Parameters:
_address- address to use- Returns:
- this
-
forAddress
Use the given address to create the connection (e.g. used for remote TCP connected DBus daemons).- Parameters:
_address- address to use- Returns:
- this
- Since:
- 4.2.0 - 2022-07-18
-
validateTransportAddress
Checks if the given address can be used with the available transports. Will fallback to TCP if no address given and TCP transport is available.- Parameters:
_address- address to check- Returns:
- address, maybe fallback address
-
withRegisterSelf
Register the new connection on DBus using 'hello' message. Default is true.- Parameters:
_register- boolean- Returns:
- this
-
build
Create the newDBusConnection.- Specified by:
buildin classBaseConnectionBuilder<DBusConnectionBuilder,DBusConnection> - Returns:
DBusConnection- Throws:
DBusException- when DBusConnection could not be opened
-
getSystemEndianness
Deprecated, for removal: This API element is subject to removal in a future version.if required, useBaseConnectionBuilder.getSystemEndianness()Get the default system endianness.- Returns:
- LITTLE or BIG
-
BaseConnectionBuilder.getSystemEndianness()