Modul org.freedesktop.dbus
Klasse AbstractTransport
java.lang.Object
org.freedesktop.dbus.connections.transports.AbstractTransport
- Alle implementierten Schnittstellen:
Closeable,AutoCloseable
- Bekannte direkte Unterklassen:
AbstractUnixTransport
Base class for all transport types.
- Seit:
- v3.2.0 - 2019-02-08
- Autor:
- hypfvieh
-
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungprotectedAbstractTransport(BusAddress _address, TransportConfig _config) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidclose()final SocketChannelconnect()Establish connection on created transport.protected abstract SocketChannelAbstract method implemented by concrete sub classes to establish a connection using whatever transport type (e.g.protected BusAddressReturns theBusAddressused for this transport.protected org.slf4j.LoggerGet the logger in subclasses.protected intVeraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.protected SaslConfigReturns the current configuration used for SASL authentication.protected SASL.SaslModeVeraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.please usegetSaslConfig().getMode() insteadprotected abstract booleanMethod to indicate if passing of file descriptors is allowed.protected abstract booleanVeraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.Is no longer used and will be removedbooleanReturns true if inputReader and outputWriter are not yet closed.final booleanTrue if this transport connection is a listening (server) connection.final TransportConnectionlisten()Start listening on created transport.Read a message from the underlying socket.voidSet a callback which will be called right before the connection will be established to the transport.protected voidsetSaslAuthMode(int _mode) Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.please usegetSaslConfig().setSaslAuthMode(int) insteadprotected voidsetSaslMode(SASL.SaslMode _saslMode) Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.please usegetSaslConfig().setMode(int) insteadtoString()voidwriteMessage(Message _msg) Write a message to the underlying socket.
-
Konstruktordetails
-
AbstractTransport
-
-
Methodendetails
-
writeMessage
Write a message to the underlying socket.- Parameter:
_msg- message to write- Löst aus:
IOException- on write error or if output was already closed or null
-
readMessage
Read a message from the underlying socket.- Gibt zurück:
- read message, maybe null
- Löst aus:
IOException- when input already close or nullDBusException- when message could not be converted to a DBus message
-
isConnected
public boolean isConnected()Returns true if inputReader and outputWriter are not yet closed.- Gibt zurück:
- boolean
-
hasFileDescriptorSupport
protected abstract boolean hasFileDescriptorSupport()Method to indicate if passing of file descriptors is allowed.- Gibt zurück:
- true to allow FD passing, false otherwise
-
isAbstractAllowed
@Deprecated(forRemoval=true, since="4.2.0 - 2022-07-18") protected abstract boolean isAbstractAllowed()Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.Is no longer used and will be removedReturn true if the transport supports 'abstract' sockets.- Gibt zurück:
- true if abstract sockets supported, false otherwise
-
connectImpl
Abstract method implemented by concrete sub classes to establish a connection using whatever transport type (e.g. TCP/Unix socket).- Löst aus:
IOException- when connection fails
-
connect
Establish connection on created transport.
This method can only be used for non-listening connections.
Trying to use this with listening addresses will throw anInvalidBusAddressException.- Gibt zurück:
SocketChannelof the created connection- Löst aus:
IOException- if connection fails
-
isListening
public final boolean isListening()True if this transport connection is a listening (server) connection.- Gibt zurück:
- boolean
-
listen
Start listening on created transport.
This method can only be used for listening connections.
Trying to use this with non-listening addresses will throw anInvalidBusAddressException.Will return the
TransportConnectionas soon as a client connects.
Therefore this method should be called in a loop to accept multiple clients- Gibt zurück:
TransportConnectioncontaining createdSocketChannelandIMessageReader/IMessageWriter- Löst aus:
IOException- if connection fails
-
setPreConnectCallback
Set a callback which will be called right before the connection will be established to the transport.- Parameter:
_run- runnable to execute, null if no callback should be executed- Seit:
- 4.2.0 - 2022-07-20
-
getAddress
Returns theBusAddressused for this transport.- Gibt zurück:
- BusAddress, never null
-
getLogger
protected org.slf4j.Logger getLogger()Get the logger in subclasses.- Gibt zurück:
- Logger, never null
-
getSaslConfig
Returns the current configuration used for SASL authentication.- Gibt zurück:
- SaslConfig, never null
-
getSaslAuthMode
Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.please usegetSaslConfig().getAuthMode() insteadSet the SASL authentication mode. -
getSaslMode
Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.please usegetSaslConfig().getMode() insteadSet the SASL authentication mode. -
setSaslMode
@Deprecated(since="4.2.0 - 2022-07-22", forRemoval=true) protected void setSaslMode(SASL.SaslMode _saslMode) Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.please usegetSaslConfig().setMode(int) insteadSet the SASL mode (server or client).- Parameter:
_saslMode- mode to set
-
setSaslAuthMode
Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.please usegetSaslConfig().setSaslAuthMode(int) insteadSet the SASL authentication mode.- Parameter:
_mode- mode to set
-
getTransportConfig
-
toString
-
close
- Angegeben von:
closein SchnittstelleAutoCloseable- Angegeben von:
closein SchnittstelleCloseable- Löst aus:
IOException
-
getSaslConfig().getAuthMode() instead