类 MysqlNativePasswordPlugin
- java.lang.Object
-
- com.mysql.cj.protocol.a.authentication.MysqlNativePasswordPlugin
-
- 所有已实现的接口:
AuthenticationPlugin<NativePacketPayload>
public class MysqlNativePasswordPlugin extends Object implements AuthenticationPlugin<NativePacketPayload>
MySQL Native Password Authentication Plugin
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringPLUGIN_NAME
-
构造器概要
构造器 构造器 说明 MysqlNativePasswordPlugin()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voiddestroy()Called by the driver when this extension should release any resources it is holding and cleanup internally before the connection is closed.StringgetProtocolPluginName()Returns the client-side name that the MySQL server uses on the wire for this plugin.voidinit(Protocol<NativePacketPayload> prot, MysqlCallbackHandler cbh)Initializes this plugin with a direct Protocol reference and a genericMysqlCallbackHandlerthat can be used to pass over information back to the authentication provider.booleanisReusable()booleannextAuthenticationStep(NativePacketPayload fromServer, List<NativePacketPayload> toServer)Process authentication handshake data from server and optionally produce data to be sent back to the server.booleanrequiresConfidentiality()Does this plugin require the connection itself to be confidential (i.e. tls/ssl)...Highly recommended to return "true" for plugins that return the credentials in the clear.voidsetAuthenticationParameters(String user, String password)This method called from Connector/J before first nextAuthenticationStep call.-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 com.mysql.cj.protocol.AuthenticationPlugin
init, reset, setSourceOfAuthData
-
-
-
-
字段详细资料
-
PLUGIN_NAME
public static String PLUGIN_NAME
-
-
方法详细资料
-
init
public void init(Protocol<NativePacketPayload> prot, MysqlCallbackHandler cbh)
从接口复制的说明:AuthenticationPluginInitializes this plugin with a direct Protocol reference and a genericMysqlCallbackHandlerthat can be used to pass over information back to the authentication provider. For example an authentication plugin may acceptnullusernames and use that information to obtain them from some external source, such as the system login.- 指定者:
init在接口中AuthenticationPlugin<NativePacketPayload>- 参数:
prot- the protocol instancecbh- a callback handler to provide additional information to the authentication provider
-
destroy
public void destroy()
从接口复制的说明:AuthenticationPluginCalled by the driver when this extension should release any resources it is holding and cleanup internally before the connection is closed.- 指定者:
destroy在接口中AuthenticationPlugin<NativePacketPayload>
-
getProtocolPluginName
public String getProtocolPluginName()
从接口复制的说明:AuthenticationPluginReturns the client-side name that the MySQL server uses on the wire for this plugin.- 指定者:
getProtocolPluginName在接口中AuthenticationPlugin<NativePacketPayload>- 返回:
- plugin name
-
requiresConfidentiality
public boolean requiresConfidentiality()
从接口复制的说明:AuthenticationPluginDoes this plugin require the connection itself to be confidential (i.e. tls/ssl)...Highly recommended to return "true" for plugins that return the credentials in the clear.- 指定者:
requiresConfidentiality在接口中AuthenticationPlugin<NativePacketPayload>- 返回:
- true if secure connection is required
-
isReusable
public boolean isReusable()
- 指定者:
isReusable在接口中AuthenticationPlugin<NativePacketPayload>- 返回:
- true if plugin instance may be reused, false otherwise
-
setAuthenticationParameters
public void setAuthenticationParameters(String user, String password)
从接口复制的说明:AuthenticationPluginThis method called from Connector/J before first nextAuthenticationStep call. Values of user and password parameters are passed from those in NativeAuthenticationProvider#changeUser() or NativeAuthenticationProvider#connect(). Plugin should use these values instead of values from connection properties because parent method may be a changeUser call which saves user and password into connection only after successful handshake.- 指定者:
setAuthenticationParameters在接口中AuthenticationPlugin<NativePacketPayload>- 参数:
user- user namepassword- user password
-
nextAuthenticationStep
public boolean nextAuthenticationStep(NativePacketPayload fromServer, List<NativePacketPayload> toServer)
从接口复制的说明:AuthenticationPluginProcess authentication handshake data from server and optionally produce data to be sent back to the server. The driver will keep calling this method on each new server packet arrival until either an Exception is thrown (authentication failure, please use appropriate SQLStates) or the number of exchange iterations exceeded max limit or an OK packet is sent by server indicating that the connection has been approved. If, on return from this method, toServer is a non-empty list of buffers, then these buffers will be sent to the server in the same order and without any reads in between them. If toServer is an empty list, no data will be sent to server, driver immediately reads the next packet from server. In case of errors the method should throw Exception.- 指定者:
nextAuthenticationStep在接口中AuthenticationPlugin<NativePacketPayload>- 参数:
fromServer- a buffer containing handshake data payload from server (can be empty).toServer- list of buffers with data to be sent to the server (the list can be empty, but buffers in the list should contain data).- 返回:
- return value is ignored.
-
-