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 int
AUTH_411_OVERHEAD
protected java.lang.String
seed
-
Constructor Summary
Constructors Constructor Description NativeAuthenticationProvider()
-
Method Summary
Modifier and Type Method Description void
changeUser(ServerSession serverSession, java.lang.String userName, java.lang.String password, java.lang.String database)
Re-authenticates as the given user and passwordvoid
connect(ServerSession sessState, java.lang.String user, java.lang.String password, java.lang.String database)
Initialize communications with the MySQL server.java.lang.String
getEncodingForHandshake()
Get the Java encoding to be used for the handshake response.ExceptionInterceptor
getExceptionInterceptor()
void
init(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:
init
in 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:
connect
in 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:
getEncodingForHandshake
in 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:
changeUser
in interfaceAuthenticationProvider<NativePacketPayload>
- Parameters:
serverSession
- currentServerSession
userName
- user namepassword
- passworddatabase
- database name
-