@InterfaceAudience.Private public class SaslClientHandler extends 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 Log |
LOG |
| Constructor and Description |
|---|
SaslClientHandler(UserGroupInformation ticket,
AuthMethod method,
<any> token,
String serverPrincipal,
boolean fallbackAllowed,
String rpcProtection,
SaslClientHandler.SaslExceptionHandler exceptionHandler,
SaslClientHandler.SaslSuccessfulConnectHandler successfulConnectHandler)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
channelRead(ChannelHandlerContext ctx,
Object msg) |
void |
channelUnregistered(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(ChannelHandlerContext ctx,
Throwable cause) |
void |
handlerAdded(ChannelHandlerContext ctx) |
void |
write(ChannelHandlerContext ctx,
Object msg,
ChannelPromise promise) |
public SaslClientHandler(UserGroupInformation ticket,
AuthMethod method,
<any> 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. Integrity or privacyexceptionHandler - 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(ChannelHandlerContext ctx)
throws Exception
Exceptionpublic void channelRead(ChannelHandlerContext ctx,
Object msg)
throws Exception
Exceptionpublic void exceptionCaught(ChannelHandlerContext ctx,
Throwable cause)
throws Exception
Exception