- java.lang.Object
-
- java.lang.Enum<FlowControl>
-
- swim.io.FlowControl
-
- All Implemented Interfaces:
Serializable
,Comparable<FlowControl>
,Debug
public enum FlowControl extends Enum<FlowControl> implements Debug
Network channel flow state, controlling accept, connect, read, and write operations.- See Also:
FlowModifier
,FlowContext
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACCEPT
accept enabled; connect, read, and write disabled.ACCEPT_CONNECT
accept and connect enabled; read and write disabled.ACCEPT_CONNECT_READ
accept, connect, and read enabled; write disabled.ACCEPT_CONNECT_READ_WRITE
accept, connect, read, and write enabled.ACCEPT_CONNECT_WRITE
accept, connect, and write enabled; read disabled.ACCEPT_READ
accept and read enabled; connect and write disabled.ACCEPT_READ_WRITE
accept, read, and write enabled; connect disabled.ACCEPT_WRITE
accept and write enabled; connect and read disabled.CONNECT
connect enabled; accept, read, and write disabled.CONNECT_READ
connect and read enabled; accept and write disabled.CONNECT_READ_WRITE
connect, read, and write enabled; accept disabled.CONNECT_WRITE
connect and write enabled; accept and read disabled.READ
read enabled; accept, connect, and write disabled.READ_WRITE
read and write enabled; accept and connect disabled.WAIT
accept, connect, read, and write disabled.WRITE
write enabled; accept, connect, and read disabled.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FlowControl
acceptDisabled()
Returns an updatedFlowControl
with its accept operation disabled.FlowControl
acceptEnabled()
Returns an updatedFlowControl
with its accept operation enabled.FlowControl
and(FlowControl that)
Returns theFlowControl
with all operations enabled inthis
andthat
enabled.FlowControl
connectDisabled()
Returns an updatedFlowControl
with its connect operation disabled.FlowControl
connectEnabled()
Returns an updatedFlowControl
with its connect operation enabled.<T> Output<T>
debug(Output<T> output)
Writes a developer readable, debug-formatted string representation of this object tooutput
.static FlowControl
fromSelectorOps(int selectorOps)
Returns theFlowControl
corresponding to the givenSelectionKey
interest set.boolean
isAcceptEnabled()
Returnstrue
if the accept operation is enabled.boolean
isConnectEnabled()
Returnstrue
if the connect operation is enabled.boolean
isReadEnabled()
Returnstrue
if the read operation is enabled.boolean
isWriteEnabled()
Returnstrue
if the write operation is enabled.FlowControl
modify(FlowModifier flowModifier)
Returns an updatedFlowControl
with its read and write operations patched by aflowModifier
delta.FlowControl
not()
Returns theFlowControl
with all operations enabled inthis
disabled, and all operations disabled inthis
enabled.FlowControl
or(FlowControl that)
Returns theFlowControl
with all operations enabled inthis
orthat
enabled.FlowControl
readDisabled()
Returns an updatedFlowControl
with its read operation disabled.FlowControl
readEnabled()
Returns an updatedFlowControl
with its read operation enabled.int
toSelectorOps()
Returns theSelectionKey
interest set corresponding to thisFlowControl
.static FlowControl
valueOf(String name)
Returns the enum constant of this type with the specified name.static FlowControl[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.FlowControl
writeDisabled()
Returns an updatedFlowControl
with its write operation disabled.FlowControl
writeEnabled()
Returns an updatedFlowControl
with its write operation enabled.FlowControl
xor(FlowControl that)
Returns theFlowControl
with all operations enabled inthis
orthat
—but not both—enabled.
-
-
-
Enum Constant Detail
-
WAIT
public static final FlowControl WAIT
accept, connect, read, and write disabled.
-
ACCEPT
public static final FlowControl ACCEPT
accept enabled; connect, read, and write disabled.
-
CONNECT
public static final FlowControl CONNECT
connect enabled; accept, read, and write disabled.
-
ACCEPT_CONNECT
public static final FlowControl ACCEPT_CONNECT
accept and connect enabled; read and write disabled.
-
READ
public static final FlowControl READ
read enabled; accept, connect, and write disabled.
-
ACCEPT_READ
public static final FlowControl ACCEPT_READ
accept and read enabled; connect and write disabled.
-
CONNECT_READ
public static final FlowControl CONNECT_READ
connect and read enabled; accept and write disabled.
-
ACCEPT_CONNECT_READ
public static final FlowControl ACCEPT_CONNECT_READ
accept, connect, and read enabled; write disabled.
-
WRITE
public static final FlowControl WRITE
write enabled; accept, connect, and read disabled.
-
ACCEPT_WRITE
public static final FlowControl ACCEPT_WRITE
accept and write enabled; connect and read disabled.
-
CONNECT_WRITE
public static final FlowControl CONNECT_WRITE
connect and write enabled; accept and read disabled.
-
ACCEPT_CONNECT_WRITE
public static final FlowControl ACCEPT_CONNECT_WRITE
accept, connect, and write enabled; read disabled.
-
READ_WRITE
public static final FlowControl READ_WRITE
read and write enabled; accept and connect disabled.
-
ACCEPT_READ_WRITE
public static final FlowControl ACCEPT_READ_WRITE
accept, read, and write enabled; connect disabled.
-
CONNECT_READ_WRITE
public static final FlowControl CONNECT_READ_WRITE
connect, read, and write enabled; accept disabled.
-
ACCEPT_CONNECT_READ_WRITE
public static final FlowControl ACCEPT_CONNECT_READ_WRITE
accept, connect, read, and write enabled.
-
-
Method Detail
-
values
public static FlowControl[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FlowControl c : FlowControl.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FlowControl valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isAcceptEnabled
public boolean isAcceptEnabled()
Returnstrue
if the accept operation is enabled.
-
isConnectEnabled
public boolean isConnectEnabled()
Returnstrue
if the connect operation is enabled.
-
isReadEnabled
public boolean isReadEnabled()
Returnstrue
if the read operation is enabled.
-
isWriteEnabled
public boolean isWriteEnabled()
Returnstrue
if the write operation is enabled.
-
acceptDisabled
public FlowControl acceptDisabled()
Returns an updatedFlowControl
with its accept operation disabled.
-
acceptEnabled
public FlowControl acceptEnabled()
Returns an updatedFlowControl
with its accept operation enabled.
-
connectDisabled
public FlowControl connectDisabled()
Returns an updatedFlowControl
with its connect operation disabled.
-
connectEnabled
public FlowControl connectEnabled()
Returns an updatedFlowControl
with its connect operation enabled.
-
readDisabled
public FlowControl readDisabled()
Returns an updatedFlowControl
with its read operation disabled.
-
readEnabled
public FlowControl readEnabled()
Returns an updatedFlowControl
with its read operation enabled.
-
writeDisabled
public FlowControl writeDisabled()
Returns an updatedFlowControl
with its write operation disabled.
-
writeEnabled
public FlowControl writeEnabled()
Returns an updatedFlowControl
with its write operation enabled.
-
modify
public FlowControl modify(FlowModifier flowModifier)
Returns an updatedFlowControl
with its read and write operations patched by aflowModifier
delta.
-
or
public FlowControl or(FlowControl that)
Returns theFlowControl
with all operations enabled inthis
orthat
enabled.
-
xor
public FlowControl xor(FlowControl that)
Returns theFlowControl
with all operations enabled inthis
orthat
—but not both—enabled.
-
and
public FlowControl and(FlowControl that)
Returns theFlowControl
with all operations enabled inthis
andthat
enabled.
-
not
public FlowControl not()
Returns theFlowControl
with all operations enabled inthis
disabled, and all operations disabled inthis
enabled.
-
toSelectorOps
public int toSelectorOps()
Returns theSelectionKey
interest set corresponding to thisFlowControl
.
-
debug
public <T> Output<T> debug(Output<T> output)
Description copied from interface:Debug
Writes a developer readable, debug-formatted string representation of this object tooutput
.
-
fromSelectorOps
public static FlowControl fromSelectorOps(int selectorOps)
Returns theFlowControl
corresponding to the givenSelectionKey
interest set.
-
-