Top Methods
org.freedesktop.dbus.spi.message

public Interface ISocketProvider

Known Direct Implementers
org.freedesktop.dbus.spi.message.DefaultSocketProvider
Imports
org.freedesktop.dbus.connections.transports.AbstractTransport, java.io.FileDescriptor, .IOException, java.nio.channels.SocketChannel, java.util.Optional

Method Summary

Modifier and TypeMethod and Description
public default Optional<FileDescriptor>

Returns:

FileDescriptor, instantiated with provided value, packed to Optional if operation succeeded, or Optional#empty() otherwise
createFileDescriptor
(int
FileDescriptor to extract value from
_fd
)

Attempts to create native FileDescriptor from raw int value.

public IMessageReader

Returns:

MessageReader
createReader
(SocketChannel
socket to use for reading
_socket
)

Method to create a IMessageReader implementation.

public IMessageWriter

Returns:

MessageWriter
createWriter
(SocketChannel
socket to write to
_socket
)

Method to create a IMessageWriter implementation.

public default Optional<Integer>

Returns:

int representation, packed to Optional if operation succeeded, or Optional#empty() otherwise
getFileDescriptorValue
(FileDescriptor
FileDescriptor to extract value from
_fd
)

Attempts to extract raw FileDescriptor value from FileDescriptor instance.

public boolean

Returns:

true if file descriptors are supported by this provider, false otherwise
isFileDescriptorPassingSupported
()

Indicate if reader/writer supports file descriptor passing.

public void
setFileDescriptorSupport(boolean
true if file descriptor passing is supported, false otherwise
_support
)

Called to indicate if the current AbstractTransport implementation supports file descriptor passing.

Method Detail

createFileDescriptorback to summary
public default Optional<FileDescriptor> createFileDescriptor(int _fd)

Attempts to create native FileDescriptor from raw int value.

Parameters
_fd:int

FileDescriptor to extract value from

Returns:Optional<FileDescriptor>

FileDescriptor, instantiated with provided value, packed to Optional if operation succeeded, or Optional#empty() otherwise

Since
5.0.0 - 2023-10-07
See Also
getFileDescriptorValue(FileDescriptor)
createReaderback to summary
public IMessageReader createReader(SocketChannel _socket) throws IOException

Method to create a IMessageReader implementation.

Parameters
_socket:SocketChannel

socket to use for reading

Returns:IMessageReader

MessageReader

Exceptions
IOException:
if reader could not be created
createWriterback to summary
public IMessageWriter createWriter(SocketChannel _socket) throws IOException

Method to create a IMessageWriter implementation.

Parameters
_socket:SocketChannel

socket to write to

Returns:IMessageWriter

MessageWriter

Exceptions
IOException:
if write could not be created
getFileDescriptorValueback to summary
public default Optional<Integer> getFileDescriptorValue(FileDescriptor _fd)

Attempts to extract raw FileDescriptor value from FileDescriptor instance. Note that not any FileDescriptor can be represented as int, for example Windows uses HANDLE as descriptor, which excess range of int values, thus cannot be safely cast to int.

Parameters
_fd:FileDescriptor

FileDescriptor to extract value from

Returns:Optional<Integer>

int representation, packed to Optional if operation succeeded, or Optional#empty() otherwise

Since
5.0.0 - 2023-10-07
See Also
createFileDescriptor(int)
isFileDescriptorPassingSupportedback to summary
public boolean isFileDescriptorPassingSupported()

Indicate if reader/writer supports file descriptor passing. This is to show if the provider is able to handle file descriptors.

Returns:boolean

true if file descriptors are supported by this provider, false otherwise

setFileDescriptorSupportback to summary
public void setFileDescriptorSupport(boolean _support)

Called to indicate if the current AbstractTransport implementation supports file descriptor passing.

Parameters
_support:boolean

true if file descriptor passing is supported, false otherwise