@InterfaceAudience.Private public class SaslClientHandler extends io.netty.channel.ChannelDuplexHandler
Modifier and Type | Class and Description |
---|---|
static interface |
SaslClientHandler.SaslExceptionHandler
Handler for exceptions during Sasl connection
|
static interface |
SaslClientHandler.SaslSuccessfulConnectHandler
Handler for successful connects
|
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
LOG |
Constructor and Description |
---|
SaslClientHandler(org.apache.hadoop.security.UserGroupInformation ticket,
AuthMethod method,
org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token,
String serverPrincipal,
boolean fallbackAllowed,
String rpcProtection,
SaslClientHandler.SaslExceptionHandler exceptionHandler,
SaslClientHandler.SaslSuccessfulConnectHandler successfulConnectHandler)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
void |
channelUnregistered(io.netty.channel.ChannelHandlerContext ctx) |
protected SaslClient |
createDigestSaslClient(String[] mechanismNames,
String saslDefaultRealm,
CallbackHandler saslClientCallbackHandler)
Create a Digest Sasl client
|
protected SaslClient |
createKerberosSaslClient(String[] mechanismNames,
String userFirstPart,
String userSecondPart)
Create Kerberos client
|
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx) |
void |
write(io.netty.channel.ChannelHandlerContext ctx,
Object msg,
io.netty.channel.ChannelPromise promise) |
bind, close, connect, deregister, disconnect, flush, read
channelActive, channelInactive, channelReadComplete, channelRegistered, channelWritabilityChanged, userEventTriggered
public SaslClientHandler(org.apache.hadoop.security.UserGroupInformation ticket, AuthMethod method, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token, String serverPrincipal, boolean fallbackAllowed, String rpcProtection, SaslClientHandler.SaslExceptionHandler exceptionHandler, SaslClientHandler.SaslSuccessfulConnectHandler successfulConnectHandler) throws IOException
ticket
- the ugimethod
- auth methodtoken
- for SaslserverPrincipal
- Server's Kerberos principal namefallbackAllowed
- True if server may also fall back to less secure connectionrpcProtection
- Quality of protection. Can be 'authentication', 'integrity' or
'privacy'.exceptionHandler
- handler for exceptionssuccessfulConnectHandler
- handler for succesful connectsIOException
- if handler could not be createdprotected SaslClient createDigestSaslClient(String[] mechanismNames, String saslDefaultRealm, CallbackHandler saslClientCallbackHandler) throws IOException
mechanismNames
- names of mechanismssaslDefaultRealm
- default realm for saslsaslClientCallbackHandler
- handler for the clientIOException
- if creation went wrongprotected SaslClient createKerberosSaslClient(String[] mechanismNames, String userFirstPart, String userSecondPart) throws IOException
mechanismNames
- names of mechanismsuserFirstPart
- first part of usernameuserSecondPart
- second part of usernameIOException
- if failspublic void channelUnregistered(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelUnregistered
in interface io.netty.channel.ChannelInboundHandler
channelUnregistered
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) throws Exception
handlerAdded
in interface io.netty.channel.ChannelHandler
handlerAdded
in class io.netty.channel.ChannelHandlerAdapter
Exception
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) throws Exception
channelRead
in interface io.netty.channel.ChannelInboundHandler
channelRead
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.