Package com.lucimber.dbus.connection
Interface ConnectionStrategy
- All Known Implementing Classes:
NettyTcpStrategy
,NettyUnixSocketStrategy
public interface ConnectionStrategy
Strategy interface for different D-Bus connection transport types.
This interface defines the strategy pattern for handling different transport mechanisms (Unix domain sockets, TCP, etc.) in an implementation-agnostic way. The strategy encapsulates transport-specific connection logic while remaining independent of any particular networking framework.
-
Method Summary
Modifier and TypeMethodDescriptionconnect
(SocketAddress address, ConnectionConfig config, ConnectionContext context) Establishes a connection using this transport strategy.Gets a human-readable name for this transport strategy.boolean
Checks if the required transport capabilities are available on this platform.boolean
supports
(SocketAddress address) Checks if this strategy can handle the given socket address.
-
Method Details
-
supports
Checks if this strategy can handle the given socket address.- Parameters:
address
- the socket address to check- Returns:
- true if this strategy supports the address type
-
connect
CompletionStage<ConnectionHandle> connect(SocketAddress address, ConnectionConfig config, ConnectionContext context) Establishes a connection using this transport strategy.- Parameters:
address
- the socket address to connect toconfig
- connection configurationcontext
- connection context providing callbacks and handlers- Returns:
- CompletionStage that completes when connection is established
-
getTransportName
String getTransportName()Gets a human-readable name for this transport strategy.- Returns:
- transport name for logging
-
isAvailable
boolean isAvailable()Checks if the required transport capabilities are available on this platform.- Returns:
- true if this transport can be used on the current platform
-