public class ChannelFsm
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletableFuture<io.netty.channel.Channel> |
connect()
Fire a
Event.Connect event and return a CompletableFuture that completes successfully with the
Channel if a successful connection is made, or already exists, and completes exceptionally otherwise. |
java.util.concurrent.CompletableFuture<java.lang.Void> |
disconnect()
Fire a
Event.Disconnect event and return a CompletableFuture that completes successfully when the
Channel has been closed. |
java.util.concurrent.CompletableFuture<io.netty.channel.Channel> |
getChannel()
Fire a
Event.GetChannel event and return a CompletableFuture that completes successfully when the
Channel is available and completes exceptionally if the FSM is not currently connected or the connection
attempt failed. |
State |
getState()
Get the current
State of the ChannelFsm. |
public java.util.concurrent.CompletableFuture<io.netty.channel.Channel> connect()
Event.Connect event and return a CompletableFuture that completes successfully with the
Channel if a successful connection is made, or already exists, and completes exceptionally otherwise.CompletableFuture that completes successfully with the Channel if a successful
connection was made, or already exists, and completes exceptionally otherwise.public java.util.concurrent.CompletableFuture<java.lang.Void> disconnect()
Event.Disconnect event and return a CompletableFuture that completes successfully when the
Channel has been closed.CompletableFuture that completes successfully when the Channel has been closed.public java.util.concurrent.CompletableFuture<io.netty.channel.Channel> getChannel()
Event.GetChannel event and return a CompletableFuture that completes successfully when the
Channel is available and completes exceptionally if the FSM is not currently connected or the connection
attempt failed.
connect() must have been called at least once before attempting to get a Channel. Whether further calls
are necessary depends on whether the FSM is configured to be persistent in its connection attempts or not.
The returned CompletableFuture always fails exceptionally if the FSM is not connected.
CompletableFuture that completes successfully when the Channel is available and
completes exceptionally if the FSM is not currently connected or the connection attempt failed.public State getState()
State of the ChannelFsm.State of the ChannelFsm.