Top Description Inners Fields Constructors Methods
reactor.netty5.channel

public Class ChannelOperations<INBOUND extends reactor.netty5.NettyInbound, OUTBOUND extends reactor.netty5.NettyOutbound>

extends Object
implements NettyInbound, NettyOutbound, Connection, CoreSubscriber<Void>, ChannelOperationsId
Class Inheritance
All Implemented Interfaces
reactor.netty5.ChannelOperationsId, reactor.core.CoreSubscriber, org.reactivestreams.Subscriber, reactor.netty5.Connection, reactor.netty5.DisposableChannel, reactor.core.Disposable, reactor.netty5.NettyOutbound, org.reactivestreams.Publisher, reactor.netty5.NettyInbound
Known Direct Subclasses
reactor.netty5.udp.UdpOperations
Imports
java.net.SocketAddress, java.nio.channels.ClosedChannelException, java.util.concurrent.Callable, java.util.concurrent.atomic.AtomicReferenceFieldUpdater, java.util.function.BiFunction, .Consumer, .Predicate, io.netty5.buffer.Buffer, .BufferAllocator, io.netty5.util.Resource, io.netty5.channel.Channel, .ChannelHandler, .ChannelHandlerContext, org.reactivestreams.Publisher, .Subscription, reactor.core.CoreSubscriber, .Disposable, reactor.core.publisher.Flux, .Mono, .Operators, .Sinks, reactor.netty5.BufferFlux, .ChannelOperationsId, .Connection, .ConnectionObserver, .FutureMono, .NettyInbound, .NettyOutbound, .NettyPipeline, .ReactorNetty, reactor.util.Logger, .Loggers, reactor.util.annotation.Nullable, reactor.util.context.Context

NettyInbound and NettyOutbound that apply to a Connection
Author
Stephane Maldini
Since
0.6

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Field Summary

Modifier and TypeField and Description
pack-priv final Connection
pack-priv static final ChannelOperations.OnSetup
pack-priv final FluxReceive
pack-priv final ConnectionObserver
pack-priv boolean
pack-priv static final Logger
pack-priv String
pack-priv final Sinks.Empty<Void>
pack-priv static final AtomicReferenceFieldUpdater<ChannelOperations<INBOUND extends NettyInbound, OUTBOUND extends NettyOutbound>, Subscription>
pack-priv volatile Subscription
pack-priv final String

Constructor Summary

AccessConstructor and Description
protected
ChannelOperations(ChannelOperations<INBOUND, OUTBOUND> replaced)

public
ChannelOperations(Connection
the new Connection connection
connection
,
ConnectionObserver
the events callback
listener
)

Create a new ChannelOperations attached to the Channel.

Method Summary

Modifier and TypeMethod and Description
public static void
addMetricsHandler(Channel
the channel
ch
,
ChannelMetricsRecorder
the configured metrics recorder
recorder
,
SocketAddress
the remote address
remoteAddress
,
boolean
true if ChannelMetricsRecorder is for the server, false if it is for the client
onServer
)

Add NettyPipeline#ChannelMetricsHandler to the channel pipeline.

public static void
addReactiveBridge(Channel
the channel to bridge
ch
,
ChannelOperations.OnSetup
the operations factory to invoke on channel active
opsFactory
,
ConnectionObserver
the listener to forward connection events to
listener
)

Add NettyPipeline#ReactiveBridge handler at the end of Channel pipeline.

protected void
afterInboundComplete()

React after inbound completion (last packet)

public BufferAllocator
alloc()

Implements reactor.netty5.NettyOutbound.alloc.

Returns the assigned BufferAllocator.
public <T extends Connection> T
as(Class<T>
connection type to match to
clazz
)

Overrides default reactor.netty5.Connection.as.

Return an existing Connection that must match the given type wrapper or null.
protected String

Returns:

the string to be logged
asDebugLogMessage
(Object
the object to be transformed
o
)

Transforms the object to a string for debug logs.

public String
asLongText()

Implements reactor.netty5.ChannelOperationsId.asLongText.

The long string is a combination of the id of the underlying connection, local and remote addresses, and in case of HTTP, the serial number of the request received on that connection.
public String
asShortText()

Implements reactor.netty5.ChannelOperationsId.asShortText.

The short string is a combination of the id of the underlying connection and in case of HTTP, the serial number of the request received on that connection.
public final Channel
channel()

Implements reactor.netty5.DisposableChannel.channel.

Returns the underlying Channel.
protected final Connection

Returns:

the delegate IO Connection for low-level IO access
connection
()

Return the delegate IO Connection for low-level IO access

public Context
currentContext()

Overrides default reactor.core.CoreSubscriber.currentContext.

Request a Context from dependent components which can include downstream operators during subscribing or a terminal org.reactivestreams.Subscriber.
public final void
discard()

Drop pending content and complete inbound.

protected final void
discardWhenNoReceiver()

Drop pending content and complete inbound.

public void
dispose()

Overrides default reactor.netty5.DisposableChannel.dispose.

Releases or closes the underlying Channel
public CoreSubscriber<Void>
disposeSubscriber()

Overrides default reactor.netty5.DisposableChannel.disposeSubscriber.

Returns a CoreSubscriber that will dispose on complete or error
protected final String

Returns:

formatted name of this operation
formatName
()

Return formatted name of this operation

public static ChannelOperations<?, ?>

Returns:

the current Channel bound ChannelOperations or null if none
get
(Channel
the current Channel
ch
)

Return the current Channel bound ChannelOperations or null if none

public NettyInbound
inbound()

Overrides default reactor.netty5.Connection.inbound.

Return the NettyInbound read API from this connection.
protected String
public final boolean
isDisposed()

Overrides default reactor.netty5.DisposableChannel.isDisposed.

Optionally return true when the resource or task is disposed.
public final boolean

Returns:

true if inbound traffic is not expected anymore
isInboundCancelled
()

Return true if inbound traffic is not expected anymore

public final boolean

Returns:

true if inbound traffic is not incoming or expected anymore
isInboundDisposed
()

Return true if inbound traffic is not incoming or expected anymore

public boolean
isPersistent()

Overrides default reactor.netty5.Connection.isPersistent.

Return false if it will force a close on terminal protocol events thus defeating any pooling strategy Return true (default) if it will release on terminal protocol events thus keeping alive the channel if possible.
public final boolean

Returns:

true if dispose subscription has been terminated
isSubscriptionDisposed
()

Return true if dispose subscription has been terminated

public final ConnectionObserver

Returns:

the available parent ConnectionObserverfor user-facing lifecycle handling
listener
()

Return the available parent ConnectionObserver for user-facing lifecycle handling

public final void
onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Successful terminal state.
public final Mono<Void>
onDispose()

Overrides default reactor.netty5.DisposableChannel.onDispose.

Returns an observing Mono terminating with success when shutdown successfully or error.
public Connection
onDispose(final Disposable
the close event handler
onDispose
)

Overrides default reactor.netty5.Connection.onDispose.

Assigns a Disposable to be invoked when the channel is closed.
public final void
onError(Throwable
the throwable signaled
t
)

Implements org.reactivestreams.Subscriber.onError.

Failed terminal state.
protected void
onInboundCancel()

React on inbound cancel (receive() subscriber cancelled)

protected void
onInboundClose()

React on inbound close (channel closed prematurely)

protected void
onInboundComplete()

React on inbound completion (last packet)

protected final void
onInboundError(Throwable
the Throwable cause
err
)

React on inbound error

protected void
onInboundNext(ChannelHandlerContext
the context
ctx
,
Object
the read payload
msg
)

React on inbound Channel#read

public final void
onNext(Void
the element signaled
aVoid
)

Implements org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).
protected void
onOutboundComplete()

React on inbound/outbound completion (last packet)

protected void
onOutboundError(Throwable
the Throwable cause
err
)

React on inbound/outbound error

public final void
onSubscribe(Subscription
the Subscription that allows requesting data via Subscription#request(long)
s
)

Implements reactor.core.CoreSubscriber.onSubscribe.

Implementors should initialize any state used by onNext(Object) before calling Subscription#request(long).
public final Mono<Void>

Returns:

a Mono succeeding when a ChannelOperations has been terminated
onTerminate
()

Overrides default reactor.netty5.Connection.onTerminate.

Return a Mono succeeding when a ChannelOperations has been terminated
public NettyOutbound
outbound()

Overrides default reactor.netty5.Connection.outbound.

Return the NettyOutbound write API from this connection.
public BufferFlux
receive()

Implements reactor.netty5.NettyInbound.receive.

A Flux extension that allows for extra decoding operators
public Flux<?>
public NettyOutbound
send(Publisher<? extends Buffer>
the dataStream publishing OUT items to write on this channel
dataStream
,
Predicate<Buffer>
that returns true if explicit flush operation is needed after that buffer
predicate
)

Implements reactor.netty5.NettyOutbound.send.

Sends data to the peer, listens for any error on write and closes on terminal signal (complete|error).
public NettyOutbound
sendObject(Publisher<?>
the dataStream publishing items to write on this channel or a simple pojo supported by configured Netty handlers
dataStream
,
Predicate<Object>
that returns true if explicit flush operation is needed after that object
predicate
)

Implements reactor.netty5.NettyOutbound.sendObject.

Sends an object through Netty pipeline.
public NettyOutbound
sendObject(Object
the object to publish
message
)

Implements reactor.netty5.NettyOutbound.sendObject.

Sends data to the peer, listens for any error on write and closes on terminal signal (complete|error).
public <S> NettyOutbound
sendUsing(Callable<? extends S>
state generator
sourceInput
,
BiFunction<? super Connection, ? super S, ?>
input to send
mappedInput
,
Consumer<? super S>
state cleaner
sourceCleanup
)

Implements reactor.netty5.NettyOutbound.sendUsing.

Binds a send to a starting/cleanup lifecycle

Note

Nesting any send* method is not supported.

protected final void
terminate()

Final release/close (last packet)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public ChannelOperations<INBOUND, OUTBOUND>
withConnection(Consumer<? super Connection>
connection callback
withConnection
)

Implements reactor.netty5.NettyInbound.withConnection, reactor.netty5.NettyOutbound.withConnection.

Calls the passed callback with a Connection to operate on the underlying Channel state.
protected Throwable
wrapInboundError(Throwable
the Throwable cause
err
)

Wrap an inbound error

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait