Class TransportBuilder
java.lang.Object
org.freedesktop.dbus.connections.transports.TransportBuilder
Builder to create transports of different types.
- Since:
- v4.0.0 - 2021-09-17
- Author:
- hypfvieh
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents supported SASL authentication modes. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Create the transport with the previously provided configuration.Returns the configuration builder to configure the transport.static TransportBuildercreate()Creates a newTransportBuilderinstance using a empty transport configuration.static TransportBuilderCreates a newTransportBuilderinstance with the given address.static TransportBuildercreate(BusAddress _address) Creates a newTransportBuilderinstance with the given address.static TransportBuildercreate(TransportConfig _config) Creates a newTransportBuilderinstance using the given configuration.static StringcreateDynamicSession(String _busType, boolean _listeningAddress) Creates a new dynamic bus address for the given bus type.static TransportBuildercreateWithDynamicSession(String _transportType) Creates a newTransportBuilderwith a dynamically created address.The currently configured BusAddress.Returns aListof all bustypes supported in the current runtime.
-
Method Details
-
create
Creates a newTransportBuilderinstance with the given address.- Parameters:
_address- address, never null- Returns:
- new
TransportBuilder - Throws:
InvalidBusAddressException- if invalid address provided
-
create
Creates a newTransportBuilderinstance using the given configuration.- Parameters:
_config- config, never null- Returns:
- new
TransportBuilder - Throws:
InvalidBusAddressException- if invalid address provided
-
create
Creates a newTransportBuilderinstance using a empty transport configuration.- Returns:
- new
TransportBuilder
-
create
Creates a newTransportBuilderinstance with the given address.- Parameters:
_address- address, never null- Returns:
- new
TransportBuilder - Throws:
DBusException- if invalid address provided
-
createWithDynamicSession
Creates a newTransportBuilderwith a dynamically created address.- Parameters:
_transportType- type of session (e.g. UNIX or TCP)- Returns:
TransportBuilder- Throws:
DBusException- when invalid/unknown/unsupported transport type given
-
configure
public TransportConfigBuilder<TransportConfigBuilder<?, TransportBuilder>, TransportBuilder> configure()Returns the configuration builder to configure the transport.- Returns:
- TransportConfigBuilder
-
build
Create the transport with the previously provided configuration.If autoconnect is enabled and this is a client connection, the connection will be established automatically. Establishing the connection will be retried several times to allow connection in concurrent setups. The max retry attempts are calculated by using the configured connection timeout (default: 10000 millis) divided by 500. The minimum of retries is 1.
Without autoconnect, the connection will not be started and has to be started by calling
connect()on the connection instance. In that case there are no automatic reconnection attempts.- Returns:
AbstractTransportinstance- Throws:
DBusException- when creating transport failsIOException- when autoconnect is true, connection is not a listening connection and connection to DBus failed
-
getAddress
-
getRegisteredBusTypes
-
createDynamicSession
Creates a new dynamic bus address for the given bus type.- Parameters:
_busType- bus type (e.g. UNIX or TCP), never null_listeningAddress- true if a listening (server) address should be created, false otherwise- Returns:
- String containing BusAddress or null
-