Module org.freedesktop.dbus
Class AbstractTransport
java.lang.Object
org.freedesktop.dbus.connections.transports.AbstractTransport
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
AbstractUnixTransport
Base class for all transport types.
- Since:
- v3.2.0 - 2019-02-08
- Author:
- hypfvieh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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 BusAddressprotected org.slf4j.Loggerprotected intprotected SASL.SaslModeprotected abstract booleanMethod to indicate if passing of file descriptors is allowed.protected abstract booleanReturn true if the transport supports 'abstract' sockets.Read a message from the underlying socket.protected voidsetSaslAuthMode(int _saslAuthMode) protected voidsetSaslMode(SASL.SaslMode _saslMode) voidwriteMessage(Message _msg) Write a message to the underlying socket.
-
Constructor Details
-
AbstractTransport
-
-
Method Details
-
writeMessage
Write a message to the underlying socket.- Parameters:
_msg- message to write- Throws:
IOException- on write error or if output was already closed or null
-
readMessage
Read a message from the underlying socket.- Returns:
- read message, maybe null
- Throws:
IOException- when input already close or nullDBusException- when message could not be converted to a DBus message
-
hasFileDescriptorSupport
protected abstract boolean hasFileDescriptorSupport()Method to indicate if passing of file descriptors is allowed.- Returns:
- true to allow FD passing, false otherwise
-
isAbstractAllowed
protected abstract boolean isAbstractAllowed()Return true if the transport supports 'abstract' sockets.- Returns:
- 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).- Throws:
IOException- when connection fails
-
connect
Establish connection on created transport.- Returns:
SocketChannel- Throws:
IOException- if connection fails
-
getSaslAuthMode
protected int getSaslAuthMode() -
setSaslAuthMode
protected void setSaslAuthMode(int _saslAuthMode) -
getSaslMode
-
setSaslMode
-
getAddress
-
getLogger
protected org.slf4j.Logger getLogger() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-