Package com.lucimber.dbus.netty
Class NettyConnectionHandle
java.lang.Object
com.lucimber.dbus.netty.NettyConnectionHandle
- All Implemented Interfaces:
ConnectionHandle
Netty-based implementation of ConnectionHandle.
This class wraps a Netty Channel and provides the transport-agnostic ConnectionHandle interface for the D-Bus connection layer.
-
Constructor Summary
ConstructorsConstructorDescriptionNettyConnectionHandle
(io.netty.channel.Channel channel, io.netty.channel.EventLoopGroup eventLoopGroup, ConnectionConfig config, RealityCheckpoint realityCheckpoint) -
Method Summary
Modifier and TypeMethodDescriptionclose()
Closes this connection handle and releases associated resources.Gets the assigned D-Bus name for this connection, if available.Gets the next available serial number for message sequencing.boolean
isActive()
Checks if the connection is currently active and ready for communication.send
(OutboundMessage message) Sends a message over this connection.sendRequest
(OutboundMessage message) Sends a request message and waits for a response.
-
Constructor Details
-
NettyConnectionHandle
public NettyConnectionHandle(io.netty.channel.Channel channel, io.netty.channel.EventLoopGroup eventLoopGroup, ConnectionConfig config, RealityCheckpoint realityCheckpoint)
-
-
Method Details
-
isActive
public boolean isActive()Description copied from interface:ConnectionHandle
Checks if the connection is currently active and ready for communication.- Specified by:
isActive
in interfaceConnectionHandle
- Returns:
- true if the connection is active
-
send
Description copied from interface:ConnectionHandle
Sends a message over this connection.- Specified by:
send
in interfaceConnectionHandle
- Parameters:
message
- the outbound message to send- Returns:
- CompletionStage that completes when the message is sent
-
sendRequest
Description copied from interface:ConnectionHandle
Sends a request message and waits for a response.- Specified by:
sendRequest
in interfaceConnectionHandle
- Parameters:
message
- the outbound request message- Returns:
- CompletionStage that completes with the response message
-
getNextSerial
Description copied from interface:ConnectionHandle
Gets the next available serial number for message sequencing.- Specified by:
getNextSerial
in interfaceConnectionHandle
- Returns:
- the next serial number
-
close
Description copied from interface:ConnectionHandle
Closes this connection handle and releases associated resources.- Specified by:
close
in interfaceConnectionHandle
- Returns:
- CompletionStage that completes when the connection is closed
-
getAssignedBusName
Description copied from interface:ConnectionHandle
Gets the assigned D-Bus name for this connection, if available.- Specified by:
getAssignedBusName
in interfaceConnectionHandle
- Returns:
- the assigned bus name, or null if not yet assigned
-