public class SaslClientHandler
extends io.netty.channel.ChannelDuplexHandler
| Modifier and Type | Class and Description |
|---|---|
static interface |
SaslClientHandler.SaslExceptionHandler
Handler for exceptions during Sasl connection
|
| Modifier and Type | Field and Description |
|---|---|
static org.apache.commons.logging.Log |
LOG |
| Constructor and Description |
|---|
SaslClientHandler(org.apache.hadoop.hbase.security.AuthMethod method,
org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token,
java.lang.String serverPrincipal,
boolean fallbackAllowed,
java.lang.String rpcProtection,
SaslClientHandler.SaslExceptionHandler exceptionHandler)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg) |
void |
channelUnregistered(io.netty.channel.ChannelHandlerContext ctx) |
protected javax.security.sasl.SaslClient |
createDigestSaslClient(java.lang.String[] mechanismNames,
java.lang.String saslDefaultRealm,
javax.security.auth.callback.CallbackHandler saslClientCallbackHandler)
Create a Digest Sasl client
|
protected javax.security.sasl.SaslClient |
createKerberosSaslClient(java.lang.String[] mechanismNames,
java.lang.String userFirstPart,
java.lang.String userSecondPart)
Create Kerberos client
|
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable cause) |
void |
write(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg,
io.netty.channel.ChannelPromise promise) |
bind, close, connect, deregister, disconnect, flush, readchannelInactive, channelReadComplete, channelRegistered, channelWritabilityChanged, userEventTriggeredhandlerAdded, handlerRemoved, isSharablepublic SaslClientHandler(org.apache.hadoop.hbase.security.AuthMethod method,
org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token,
java.lang.String serverPrincipal,
boolean fallbackAllowed,
java.lang.String rpcProtection,
SaslClientHandler.SaslExceptionHandler exceptionHandler)
throws java.io.IOException
method - auth methodtoken - for SaslserverPrincipal - Server's Kerberos principal namefallbackAllowed - True if server may also fall back to less secure connectionrpcProtection - Quality of protection. Integrity or privacyexceptionHandler - handler for exceptionsjava.io.IOException - if handler could not be createdprotected javax.security.sasl.SaslClient createDigestSaslClient(java.lang.String[] mechanismNames,
java.lang.String saslDefaultRealm,
javax.security.auth.callback.CallbackHandler saslClientCallbackHandler)
throws java.io.IOException
mechanismNames - names of mechanismssaslDefaultRealm - default realm for saslsaslClientCallbackHandler - handler for the clientjava.io.IOException - if creation went wrongprotected javax.security.sasl.SaslClient createKerberosSaslClient(java.lang.String[] mechanismNames,
java.lang.String userFirstPart,
java.lang.String userSecondPart)
throws java.io.IOException
mechanismNames - names of mechanismsuserFirstPart - first part of usernameuserSecondPart - second part of usernamejava.io.IOException - if failspublic void channelUnregistered(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
channelUnregistered in interface io.netty.channel.ChannelInboundHandlerchannelUnregistered in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void channelActive(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
channelActive in interface io.netty.channel.ChannelInboundHandlerchannelActive in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void channelRead(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg)
throws java.lang.Exception
channelRead in interface io.netty.channel.ChannelInboundHandlerchannelRead in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable cause)
throws java.lang.Exception
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void write(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg,
io.netty.channel.ChannelPromise promise)
throws java.lang.Exception
write in interface io.netty.channel.ChannelOutboundHandlerwrite in class io.netty.channel.ChannelDuplexHandlerjava.lang.Exception