Package org.apache.hadoop.hbase.security
Class NettyHBaseSaslRpcClientHandler
java.lang.Object
org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerAdapter
org.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandlerAdapter
org.apache.hbase.thirdparty.io.netty.channel.SimpleChannelInboundHandler<org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf>
org.apache.hadoop.hbase.security.NettyHBaseSaslRpcClientHandler
- All Implemented Interfaces:
org.apache.hbase.thirdparty.io.netty.channel.ChannelHandler,org.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandler
@Private
public class NettyHBaseSaslRpcClientHandler
extends org.apache.hbase.thirdparty.io.netty.channel.SimpleChannelInboundHandler<org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf>
Implement SASL logic for netty rpc client.
- Since:
- 2.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hbase.thirdparty.io.netty.channel.ChannelHandler
org.apache.hbase.thirdparty.io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hadoop.conf.Configurationstatic final Stringprivate static final org.slf4j.Loggerprivate booleanprivate final SaslClientAuthenticationProviderprivate final org.apache.hbase.thirdparty.io.netty.util.concurrent.Promise<Boolean>private final NettyHBaseSaslRpcClientprivate final org.apache.hadoop.security.UserGroupInformation -
Constructor Summary
ConstructorsConstructorDescriptionNettyHBaseSaslRpcClientHandler(org.apache.hbase.thirdparty.io.netty.util.concurrent.Promise<Boolean> saslPromise, org.apache.hadoop.security.UserGroupInformation ugi, SaslClientAuthenticationProvider provider, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token, InetAddress serverAddr, String serverPrincipal, boolean fallbackAllowed, org.apache.hadoop.conf.Configuration conf) -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelInactive(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx) protected voidchannelRead0(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf msg) voidexceptionCaught(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, Throwable cause) voidhandlerAdded(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx) booleanprivate voidremoveHandlers(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx) private voidprivate voidtryComplete(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx) private voidwriteResponse(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, byte[] response) Methods inherited from class org.apache.hbase.thirdparty.io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class org.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hbase.thirdparty.io.netty.channel.ChannelHandler
handlerRemoved
-
Field Details
-
LOG
-
HANDLER_NAME
- See Also:
-
saslPromise
-
ugi
-
saslRpcClient
-
conf
-
provider
-
needProcessConnectionHeader
-
-
Constructor Details
-
NettyHBaseSaslRpcClientHandler
public NettyHBaseSaslRpcClientHandler(org.apache.hbase.thirdparty.io.netty.util.concurrent.Promise<Boolean> saslPromise, org.apache.hadoop.security.UserGroupInformation ugi, SaslClientAuthenticationProvider provider, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token, InetAddress serverAddr, String serverPrincipal, boolean fallbackAllowed, org.apache.hadoop.conf.Configuration conf) throws IOException - Parameters:
saslPromise-trueif success,falseif server tells us to fallback to simple.- Throws:
IOException
-
-
Method Details
-
writeResponse
private void writeResponse(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, byte[] response) -
tryComplete
-
removeHandlers
-
setCryptoAESOption
-
isNeedProcessConnectionHeader
-
handlerAdded
- Specified by:
handlerAddedin interfaceorg.apache.hbase.thirdparty.io.netty.channel.ChannelHandler- Overrides:
handlerAddedin classorg.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerAdapter
-
channelRead0
protected void channelRead0(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf msg) throws Exception - Specified by:
channelRead0in classorg.apache.hbase.thirdparty.io.netty.channel.SimpleChannelInboundHandler<org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf>- Throws:
Exception
-
channelInactive
public void channelInactive(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx) throws Exception - Specified by:
channelInactivein interfaceorg.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classorg.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
exceptionCaught
public void exceptionCaught(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, Throwable cause) - Specified by:
exceptionCaughtin interfaceorg.apache.hbase.thirdparty.io.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceorg.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classorg.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandlerAdapter
-