Package io.kroxylicious.proxy.internal
Class FilterHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
io.kroxylicious.proxy.internal.FilterHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
public class FilterHandler
extends io.netty.channel.ChannelDuplexHandler
A
ChannelInboundHandler (for handling requests from downstream)
that applies a single Filter.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
ConstructorsConstructorDescriptionFilterHandler(FilterAndInvoker filterAndInvoker, long timeoutMs, String sniHostname, io.netty.channel.Channel inboundChannel, ClientConnectionStateMachine clientConnectionStateMachine) -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) Handles inbound requests flowing toward the upstream broker.voidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx) toString()voidwrite(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) Handles outbound responses flowing toward the client.Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerRemoved
-
Constructor Details
-
FilterHandler
public FilterHandler(FilterAndInvoker filterAndInvoker, long timeoutMs, @Nullable String sniHostname, io.netty.channel.Channel inboundChannel, ClientConnectionStateMachine clientConnectionStateMachine)
-
-
Method Details
-
toString
-
handlerAdded
- Specified by:
handlerAddedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerAddedin classio.netty.channel.ChannelHandlerAdapter- Throws:
Exception
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) throws Exception Handles outbound responses flowing toward the client. outbound writes are requests that can succeed or fail. The promise allows the original writer to be notified when data reaches the socket (or if an error occurs).- Specified by:
writein interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
writein classio.netty.channel.ChannelDuplexHandler- Parameters:
ctx- channel handler context for each filter handlermsg- the message being writtenpromise- the channel promise- Throws:
Exception- if an error occurs
-
channelRead
Handles inbound requests flowing toward the upstream broker.- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter- Parameters:
ctx- channel handler context for each filter handlermsg- the message being read- Throws:
Exception- if an error occurs
-