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
ConstructorsConstructorDescriptionErrorMapLoadingHandler(EndpointContext endpointContext) Creates a newErrorMapLoadingHandler. -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelActive(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx) voidchannelRead(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object msg) voidconnect(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, writeMethods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
connectin interfacecom.couchbase.client.core.deps.io.netty.channel.ChannelOutboundHandler- Overrides:
connectin classcom.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler- Parameters:
ctx- theChannelHandlerContextfor which the connect operation is made.remoteAddress- theSocketAddressto which it should connect.localAddress- theSocketAddresswhich is used as source on connect.promise- theChannelPromiseto notify once the operation completes.
-
channelActive
public void channelActive(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx) - Specified by:
channelActivein interfacecom.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler- Overrides:
channelActivein 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:
channelReadin interfacecom.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classcom.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
-