Package com.mysql.cj.protocol
Interface AuthenticationProvider<M extends Message>
- All Known Implementing Classes:
NativeAuthenticationProvider,XAuthenticationProvider
public interface AuthenticationProvider<M extends Message>
-
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 serverSession, java.lang.String userName, java.lang.String password, java.lang.String database)static bytegetCharsetForHandshake(java.lang.String enc, ServerVersion sv)Get the MySQL collation index for the handshake packet.java.lang.StringgetEncodingForHandshake()voidinit(Protocol<M> prot, PropertySet propertySet, ExceptionInterceptor exceptionInterceptor)
-
Method Details
-
init
-
connect
void connect(ServerSession serverSession, java.lang.String userName, java.lang.String password, java.lang.String database) -
changeUser
void changeUser(ServerSession serverSession, java.lang.String userName, java.lang.String password, java.lang.String database)Re-authenticates as the given user and password- Parameters:
serverSession-ServerSessionobjectuserName- user namepassword- passworddatabase- db name
-
getEncodingForHandshake
java.lang.String getEncodingForHandshake() -
getCharsetForHandshake
Get the MySQL collation index for the handshake packet. A single byte will be added to the packet corresponding to the collation index found for the requested Java encoding name. If the index is > 255 which may be valid at some point in the future, an exception will be thrown. At the time of this implementation the index cannot be > 255 and only the COM_CHANGE_USER rpc, not the handshake response, can handle a value > 255.- Parameters:
enc- The Java encoding name used to lookup the collation indexsv- server version- Returns:
- collation index
-