Class ErrorMapLoadingHandler
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.ErrorMapLoadingHandler
- 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
@Internal
public class ErrorMapLoadingHandler
extends com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
This handler tries to load the KV Error Map in a best effort manner.
We are trying to grab a KV error map from kv_engine, but if the server does not respond with a successful message and the configuration we keep moving on without it. The client has reasonable defaults in place and can operate without it. Note that there will still be a warning event generated if this is the case, since it is definitely not expected.
- Since:
- 2.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.couchbase.client.core.deps.io.netty.channel.ChannelHandler
com.couchbase.client.core.deps.io.netty.channel.ChannelHandler.Sharable
-
Constructor Summary
ConstructorDescriptionErrorMapLoadingHandler
(EndpointContext endpointContext) Creates a newErrorMapLoadingHandler
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
channelActive
(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx) void
channelRead
(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object msg) void
connect
(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, com.couchbase.client.core.deps.io.netty.channel.ChannelPromise promise) Intercepts the connect process inside the pipeline to only propagate either success or failure if the error map loading process is completed either way.Methods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
bind, close, deregister, disconnect, flush, read, write
Methods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
Methods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.couchbase.client.core.deps.io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
ErrorMapLoadingHandler
Creates a newErrorMapLoadingHandler
.- Parameters:
endpointContext
- the core context used to refer to values like the core id.
-
-
Method Details
-
connect
public void connect(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, com.couchbase.client.core.deps.io.netty.channel.ChannelPromise promise) Intercepts the connect process inside the pipeline to only propagate either success or failure if the error map loading process is completed either way.- Specified by:
connect
in interfacecom.couchbase.client.core.deps.io.netty.channel.ChannelOutboundHandler
- Overrides:
connect
in classcom.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
- Parameters:
ctx
- theChannelHandlerContext
for which the connect operation is made.remoteAddress
- theSocketAddress
to which it should connect.localAddress
- theSocketAddress
which is used as source on connect.promise
- theChannelPromise
to notify once the operation completes.
-
channelActive
public void channelActive(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx) - Specified by:
channelActive
in interfacecom.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
- Overrides:
channelActive
in classcom.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
-
channelRead
public void channelRead(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object msg) - 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
-