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.booleanisActive()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:ConnectionHandleChecks if the connection is currently active and ready for communication.- Specified by:
isActivein interfaceConnectionHandle- Returns:
- true if the connection is active
-
send
Description copied from interface:ConnectionHandleSends a message over this connection.- Specified by:
sendin interfaceConnectionHandle- Parameters:
message- the outbound message to send- Returns:
- CompletionStage that completes when the message is sent
-
sendRequest
Description copied from interface:ConnectionHandleSends a request message and waits for a response.- Specified by:
sendRequestin interfaceConnectionHandle- Parameters:
message- the outbound request message- Returns:
- CompletionStage that completes with the response message
-
getNextSerial
Description copied from interface:ConnectionHandleGets the next available serial number for message sequencing.- Specified by:
getNextSerialin interfaceConnectionHandle- Returns:
- the next serial number
-
close
Description copied from interface:ConnectionHandleCloses this connection handle and releases associated resources.- Specified by:
closein interfaceConnectionHandle- Returns:
- CompletionStage that completes when the connection is closed
-
getAssignedBusName
Description copied from interface:ConnectionHandleGets the assigned D-Bus name for this connection, if available.- Specified by:
getAssignedBusNamein interfaceConnectionHandle- Returns:
- the assigned bus name, or null if not yet assigned
-