Class 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void 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 interface com.couchbase.client.core.deps.io.netty.channel.ChannelHandler

        handlerAdded, handlerRemoved
    • Constructor Detail

      • ErrorMapLoadingHandler

        public ErrorMapLoadingHandler​(EndpointContext endpointContext)
        Creates a new ErrorMapLoadingHandler.
        Parameters:
        endpointContext - the core context used to refer to values like the core id.
    • Method Detail

      • 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 interface com.couchbase.client.core.deps.io.netty.channel.ChannelOutboundHandler
        Overrides:
        connect in class com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
        Parameters:
        ctx - the ChannelHandlerContext for which the connect operation is made.
        remoteAddress - the SocketAddress to which it should connect.
        localAddress - the SocketAddress which is used as source on connect.
        promise - the ChannelPromise to notify once the operation completes.
      • channelActive

        public void channelActive​(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx)
        Specified by:
        channelActive in interface com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
        Overrides:
        channelActive in class com.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 interface com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
        Overrides:
        channelRead in class com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter