Package com.mysql.cj.protocol.a
Class NativeAuthenticationProvider
java.lang.Object
com.mysql.cj.protocol.a.NativeAuthenticationProvider
- All Implemented Interfaces:
AuthenticationProvider<NativePacketPayload>
public class NativeAuthenticationProvider extends java.lang.Object implements AuthenticationProvider<NativePacketPayload>
-
Field Summary
Fields Modifier and Type Field Description protected static intAUTH_411_OVERHEADprotected java.lang.Stringseed -
Constructor Summary
Constructors Constructor Description NativeAuthenticationProvider() -
Method Summary
Modifier and Type Method Description voidchangeUser(ServerSession serverSession, java.lang.String userName, java.lang.String password, java.lang.String database)Re-authenticates as the given user and passwordvoidconnect(ServerSession sessState, java.lang.String user, java.lang.String password, java.lang.String database)Initialize communications with the MySQL server.java.lang.StringgetEncodingForHandshake()Get the Java encoding to be used for the handshake response.ExceptionInterceptorgetExceptionInterceptor()voidinit(Protocol<NativePacketPayload> prot, PropertySet propSet, ExceptionInterceptor excInterceptor)
-
Field Details
-
AUTH_411_OVERHEAD
protected static final int AUTH_411_OVERHEAD- See Also:
- Constant Field Values
-
seed
protected java.lang.String seed
-
-
Constructor Details
-
NativeAuthenticationProvider
public NativeAuthenticationProvider()
-
-
Method Details
-
init
public void init(Protocol<NativePacketPayload> prot, PropertySet propSet, ExceptionInterceptor excInterceptor)- Specified by:
initin interfaceAuthenticationProvider<NativePacketPayload>
-
connect
public void connect(ServerSession sessState, java.lang.String user, java.lang.String password, java.lang.String database)Initialize communications with the MySQL server. Handles logging on, and handling initial connection errors.- Specified by:
connectin interfaceAuthenticationProvider<NativePacketPayload>- Parameters:
sessState- The session state object. It's intended to be updated from the handshakeuser- user namepassword- passworddatabase- database name
-
getEncodingForHandshake
public java.lang.String getEncodingForHandshake()Get the Java encoding to be used for the handshake response. Defaults to UTF-8.- Specified by:
getEncodingForHandshakein interfaceAuthenticationProvider<NativePacketPayload>- Returns:
- encoding name
-
getExceptionInterceptor
-
changeUser
public void changeUser(ServerSession serverSession, java.lang.String userName, java.lang.String password, java.lang.String database)Re-authenticates as the given user and password- Specified by:
changeUserin interfaceAuthenticationProvider<NativePacketPayload>- Parameters:
serverSession- currentServerSessionuserName- user namepassword- passworddatabase- database name
-