Klasse TransportConfigBuilder<X extends TransportConfigBuilder<?,R>,R>
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungback()Return to the previous builder.build()Returns the transport config.Switch to theSaslConfigBuilderto configure the SASL authentication mechanism.
UseSaslConfigBuilder.back()to return to this builder when finished.Returns the currently configured BusAddress.withAdditionalConfig(String _key, Object _value) Adds an additional config key to the transport config.
Will overwrite value if key exists.withAutoConnect(boolean _connect) Instantly connect to DBus whenbuild()is called.withBusAddress(BusAddress _address) Set theBusAddresswhich should be used for the connection.withConfig(TransportConfig _config) Use the predefined TransportConfig.withListening(boolean _listen) Use true to use the transport as listener (server).withPreConnectCallback(Consumer<AbstractTransport> _callback) Set a callback which will be called right before the connection to the transport is established.Removes an additional config key to of transport config.
Will do nothing if key does not exist.withSaslAuthMode(TransportBuilder.SaslAuthMode _authMode) Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.withSaslUid(long _saslUid) Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.useconfigureSasl()insteadwithTimeout(int _timeout) Setup a timeout for the transport.withUnixSocketFileGroup(String _group) The group of the socket file if a unix socket is used and this is a server transport.withUnixSocketFileOwner(String _user) The owner of the socket file if a unix socket is used and this is a server transport.withUnixSocketFilePermissions(PosixFilePermission... _permissions) The permissions which will be set on socket file if a unix socket is used and this is a server transport.
-
Konstruktordetails
-
TransportConfigBuilder
-
-
Methodendetails
-
withConfig
Use the predefined TransportConfig.Using this will override any previous configuration and replaces the internal configuration object with the given instance.
- Parameter:
_config- configuration, never null- Gibt zurück:
- this
-
withBusAddress
Set theBusAddresswhich should be used for the connection.- Parameter:
_address- address to use- Gibt zurück:
- this
-
getBusAddress
Returns the currently configured BusAddress.- Gibt zurück:
- BusAddress, maybe null
-
withPreConnectCallback
Set a callback which will be called right before the connection to the transport is established.The given consumer will receive the created
AbstractTransportobject which is not yet connected. A callback should NEVER connect the transport, but is allowed to do further configuration if needed.- Parameter:
_callback- consumer to call, null to remove any callback- Gibt zurück:
- this
-
withAutoConnect
Instantly connect to DBus whenbuild()is called.default: true
- Parameter:
_connect- boolean- Gibt zurück:
- this
-
withSaslAuthMode
@Deprecated(forRemoval=true, since="4.2.2 - 2023-02-03") public X withSaslAuthMode(TransportBuilder.SaslAuthMode _authMode) Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.useconfigureSasl()insteadSet a different SASL authentication mode.Usually when a unixsocket based transport is used,
TransportBuilder.SaslAuthMode.AUTH_EXTERNALwill be used. For TCP based transportTransportBuilder.SaslAuthMode.AUTH_COOKIEwill be used.- Parameter:
_authMode- authmode to use, if null is given, default mode will be used- Gibt zurück:
- this
-
configureSasl
Switch to theSaslConfigBuilderto configure the SASL authentication mechanism.
UseSaslConfigBuilder.back()to return to this builder when finished.- Gibt zurück:
- SaslConfigBuilder
-
withListening
Use true to use the transport as listener (server).- Parameter:
_listen- true to be a listening connection- Gibt zurück:
- this
-
withTimeout
Setup a timeout for the transport.This option might not be used by every transport (e.g. unix sockets do not support a timeout). Timeout cannot be less than zero.
- Parameter:
_timeout- true to be a listening connection- Gibt zurück:
- this
-
withSaslUid
Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.useconfigureSasl()insteadSet to UID to present during SASL authentication.Default is the user of the running JVM process on Unix-like operating systems. On Windows, the default is zero.
- Parameter:
_saslUid- UID to set, if a negative long is given the default is used- Gibt zurück:
- this
-
withUnixSocketFileOwner
The owner of the socket file if a unix socket is used and this is a server transport.Default is the user of the running JVM process.
Please note:
The running process user has to have suitable permissions to change the owner of the file. Otherwise the file owner will not be changed!- Parameter:
_user- user to set, if null is given JVM process user is used- Gibt zurück:
- this
-
withUnixSocketFileGroup
The group of the socket file if a unix socket is used and this is a server transport.Default is the group of the running JVM process.
Please note:
The running process user has to have suitable permissions to change the group of the file. Otherwise the file group will not be changed!- Parameter:
_group- group to set, if null is given JVM process group is used- Gibt zurück:
- this
-
withUnixSocketFilePermissions
The permissions which will be set on socket file if a unix socket is used and this is a server transport.This method does nothing when used on windows systems. Please note:
The running process user has to have suitable permissions to change the permissions of the file. Otherwise the file permissions will not be changed!- Parameter:
_permissions- permissions to set, if null is given default permissions will be used- Gibt zurück:
- this
-
withAdditionalConfig
Adds an additional config key to the transport config.
Will overwrite value if key exists.- Parameter:
_key- key to use_value- value to use- Gibt zurück:
- this
-
withRemoveAdditionalConfig
Removes an additional config key to of transport config.
Will do nothing if key does not exist.- Parameter:
_key- key to remove- Gibt zurück:
- this
-
back
Return to the previous builder.This allows you to return from the this builder to the builder which started this builder so you can continue using the previous builder.
- Gibt zurück:
- previous builder, maybe null
-
build
Returns the transport config.- Gibt zurück:
- config
-
configureSasl()instead