Module org.hsqldb

Class HsqldbSlaveAuthBean

java.lang.Object
org.hsqldb.auth.HsqldbSlaveAuthBean
All Implemented Interfaces:
AuthFunctionBean

public class HsqldbSlaveAuthBean extends Object implements AuthFunctionBean
Delegates authentication decisions, and optionally determination of user roles and schema, to a different HyperSQL catalog, which may be in the same JVM or remote. For now, at least, this class uses DriverManager to make the ephemeral database connections.
Since:
2.0.1
Author:
Blaine Simpson (blaine dot simpson at admc dot com)
See Also:
  • Constructor Details

    • HsqldbSlaveAuthBean

      public HsqldbSlaveAuthBean()
  • Method Details

    • setValidationUser

      public void setValidationUser(String validationUser)
      Use this method and setValidationPassword if you want access to the master database to be verified upon instance initialization.
      Parameters:
      validationUser - String
    • setValidationPassword

      public void setValidationPassword(String validationPassword)
      Use this method and setValidationUser if you want access to the master database to be verified upon instance initialization.
      Parameters:
      validationPassword - String
    • setMasterJdbcUrl

      public void setMasterJdbcUrl(String masterJdbcUrl)
    • setDelegateRolesSchema

      public void setDelegateRolesSchema(boolean doDelegateRolesSchema)
      Defaults to true. Whether roles and initial schema for the new session will be determined by what they are for this user in the master database.
      Parameters:
      doDelegateRolesSchema - boolean
    • init

      public void init() throws SQLException
      Throws:
      IllegalStateException - if any required setting has not been set.
      SQLException - if properties 'validationUser' and 'validationPassword' have been set, but we fail to connect to the master database.
    • authenticate

      public String[] authenticate(String userName, String password) throws DenyException
      Description copied from interface: AuthFunctionBean
      Return a list of authorized roles or null to indicate that the implementation does not intend to produce a specific role list but only to indicate whether to allow access or not. A return value of String[0] is different from returning null, and means that the user should not be granted any roles.
      Specified by:
      authenticate in interface AuthFunctionBean
      Parameters:
      userName - String
      password - String
      Returns:
      null or String[] according to the contract of HyperSQL authentication function contract, except that the role/schema list is returned as a String[] instead of a java.sql.Array.
      Throws:
      DenyException