Klasse TransportBuilder

java.lang.Object
org.freedesktop.dbus.connections.transports.TransportBuilder

public final class TransportBuilder extends Object
Builder to create transports of different types.
Seit:
v4.0.0 - 2021-09-17
Autor:
hypfvieh
  • Methodendetails

    • create

      public static TransportBuilder create(String _address) throws InvalidBusAddressException
      Creates a new TransportBuilder instance with the given address.
      Parameter:
      _address - address, never null
      Gibt zurück:
      new TransportBuilder
      Löst aus:
      InvalidBusAddressException - if invalid address provided
    • create

      public static TransportBuilder create(TransportConfig _config) throws InvalidBusAddressException
      Creates a new TransportBuilder instance using the given configuration.
      Parameter:
      _config - config, never null
      Gibt zurück:
      new TransportBuilder
      Löst aus:
      InvalidBusAddressException - if invalid address provided
    • create

      public static TransportBuilder create()
      Creates a new TransportBuilder instance using a empty transport configuration.
      Gibt zurück:
      new TransportBuilder
    • create

      public static TransportBuilder create(BusAddress _address)
      Creates a new TransportBuilder instance with the given address.
      Parameter:
      _address - address, never null
      Gibt zurück:
      new TransportBuilder
      Löst aus:
      DBusException - if invalid address provided
    • createWithDynamicSession

      public static TransportBuilder createWithDynamicSession(String _transportType) throws DBusException
      Creates a new TransportBuilder with a dynamically created address.
      Parameter:
      _transportType - type of session (e.g. UNIX or TCP)
      Gibt zurück:
      TransportBuilder
      Löst aus:
      DBusException - when invalid/unknown/unsupported transport type given
    • configure

      Returns the configuration builder to configure the transport.
      Gibt zurück:
      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.

      Gibt zurück:
      AbstractTransport instance
      Löst aus:
      DBusException - when creating transport fails
      IOException - when autoconnect is true, connection is not a listening connection and connection to DBus failed
    • getAddress

      public BusAddress getAddress()
      The currently configured BusAddress.
      Gibt zurück:
      BusAddress
    • getRegisteredBusTypes

      public static List<String> getRegisteredBusTypes()
      Returns a List of all bustypes supported in the current runtime.
      Gibt zurück:
      List, maybe empty
    • createDynamicSession

      public static String createDynamicSession(String _busType, boolean _listeningAddress)
      Creates a new dynamic bus address for the given bus type.
      Parameter:
      _busType - bus type (e.g. UNIX or TCP), never null
      _listeningAddress - true if a listening (server) address should be created, false otherwise
      Gibt zurück:
      String containing BusAddress or null