@Stability.Internal public class SaslListMechanismsHandler extends com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
SaslListMechanismsHandler
asks the server KV engine which SASL mechanism it supports.
Note that this handler only performs the listing and is separate from other SASL handlers in the pipeline which then actually decide what to do with the list. When negotiated, for pipelining reasons, the list of mechanisms is stored in the pipeline so that it can be consumed from other handlers.
Constructor and Description |
---|
SaslListMechanismsHandler(EndpointContext endpointContext)
Creates a new
SaslListMechanismsHandler . |
Modifier and Type | Method and Description |
---|---|
void |
channelActive(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx)
As soon as the channel is active start sending the request but also schedule
a timeout properly.
|
void |
channelRead(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx,
Object msg)
As soon as we get a response, turn it into a list of SASL mechanisms the server supports.
|
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 hello process is completed either way.
|
void |
exceptionCaught(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
If there is an exception raised while we are waiting for our connect phase to complete, the error
should be propagated as a cause up the pipeline.
|
bind, close, deregister, disconnect, flush, read, write
channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
public SaslListMechanismsHandler(EndpointContext endpointContext)
SaslListMechanismsHandler
.endpointContext
- the core context used to refer to values like the core id.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)
connect
in interface com.couchbase.client.core.deps.io.netty.channel.ChannelOutboundHandler
connect
in class com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
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.public void channelActive(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx)
channelActive
in interface com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
channelActive
in class com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
ctx
- the ChannelHandlerContext
for which the channel active operation is made.public void channelRead(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object msg)
If the server responds with an empty list this is an issue and as a result we need to fail the connection immediately.
channelRead
in interface com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
channelRead
in class com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
ctx
- the ChannelHandlerContext
for which the channel read operation is made.msg
- the incoming msg that needs to be parsed.public void exceptionCaught(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
One reason for example could be TLS problems that need to be surfaced up the stack properly.
exceptionCaught
in interface com.couchbase.client.core.deps.io.netty.channel.ChannelHandler
exceptionCaught
in interface com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
exceptionCaught
in class com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
ctx
- the channel handler context.cause
- the cause of the problem.Copyright © 2021 Couchbase, Inc.. All rights reserved.