Interface AuthenticationProvider<M extends Message>

All Known Implementing Classes:
NativeAuthenticationProvider, XAuthenticationProvider

public interface AuthenticationProvider<M extends Message>
  • Method Details

    • init

      void init​(Protocol<M> prot, PropertySet propertySet, ExceptionInterceptor exceptionInterceptor)
    • 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 - ServerSession object
      userName - user name
      password - password
      database - db name
    • getEncodingForHandshake

      java.lang.String getEncodingForHandshake()
    • getCharsetForHandshake

      static byte getCharsetForHandshake​(java.lang.String enc, ServerVersion sv)
      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 index
      sv - server version
      Returns:
      collation index