Class MemcacheProtocolVerificationHandler
- java.lang.Object
-
- com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerAdapter
-
- com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
-
- com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
-
- com.couchbase.client.core.io.netty.kv.MemcacheProtocolVerificationHandler
-
- All Implemented Interfaces:
com.couchbase.client.core.deps.io.netty.channel.ChannelHandler
,com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
,com.couchbase.client.core.deps.io.netty.channel.ChannelOutboundHandler
public class MemcacheProtocolVerificationHandler extends com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
This handler makes sure that the KV protocol packets passed around are not malformed.This handler is purely here for defense in-depth against malformed packets. For performance reasons, it only checks the basic structure and length fields and cannot do any deep-packet inspection.
-
-
Constructor Summary
Constructors Constructor Description MemcacheProtocolVerificationHandler(EndpointContext endpointContext)
Creates a newMemcacheProtocolVerificationHandler
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
channelRead(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object response)
Makes sure that incoming responses are valid.void
write(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object request, com.couchbase.client.core.deps.io.netty.channel.ChannelPromise promise)
Makes sure that outgoing requests are valid.-
Methods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read
-
Methods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
-
Methods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Constructor Detail
-
MemcacheProtocolVerificationHandler
public MemcacheProtocolVerificationHandler(EndpointContext endpointContext)
Creates a newMemcacheProtocolVerificationHandler
.- Parameters:
endpointContext
- the core context used to refer to values like the core id.
-
-
Method Detail
-
write
public void write(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object request, com.couchbase.client.core.deps.io.netty.channel.ChannelPromise promise)
Makes sure that outgoing requests are valid.- Specified by:
write
in interfacecom.couchbase.client.core.deps.io.netty.channel.ChannelOutboundHandler
- Overrides:
write
in classcom.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
- Parameters:
ctx
- the context to use.request
- the request to check.promise
- the write promise.
-
channelRead
public void channelRead(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object response)
Makes sure that incoming responses are valid.- Specified by:
channelRead
in interfacecom.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
- Overrides:
channelRead
in classcom.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
- Parameters:
ctx
- the context to use.response
- the response to check.
-
-