org.hsqldb.auth

## Class HsqldbSlaveAuthBean

- java.lang.Object
- - org.hsqldb.auth.HsqldbSlaveAuthBean

- All Implemented Interfaces:
    AuthFunctionBean

      public class HsqldbSlaveAuthBean
      extends java.lang.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:
    `AuthFunctionBean`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HsqldbSlaveAuthBean()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String[]` | `authenticate(java.lang.String userName, java.lang.String password)` 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.
    `void` | `init()`
    `void` | `setDelegateRolesSchema(boolean doDelegateRolesSchema)` Defaults to true.
    `void` | `setMasterJdbcUrl(java.lang.String masterJdbcUrl)`
    `void` | `setValidationPassword(java.lang.String validationPassword)` Use this method and setValidationUser if you want access to the master database to be verified upon instance initialization.
    `void` | `setValidationUser(java.lang.String validationUser)` Use this method and setValidationPassword if you want access to the master database to be verified upon instance initialization.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HsqldbSlaveAuthBean

          public HsqldbSlaveAuthBean()

  - ### Method Detail

    - #### setValidationUser

          public void setValidationUser(java.lang.String validationUser)

      Use this method and setValidationPassword if you want access to the master database to be verified upon instance initialization.

    - #### setValidationPassword

          public void setValidationPassword(java.lang.String validationPassword)

      Use this method and setValidationUser if you want access to the master database to be verified upon instance initialization.

    - #### setMasterJdbcUrl

          public void setMasterJdbcUrl(java.lang.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.

    - #### init

          public void init()
                    throws java.sql.SQLException

      Throws:
        `java.lang.IllegalStateException` - if any required setting has not been set.
        `java.sql.SQLException` - if properties 'validationUser' and 'validationPassword' have been set, but we fail to connect to the master database.

    - #### authenticate

          public java.lang.String[] authenticate(java.lang.String userName,
                                                 java.lang.String password)
                                          throws org.hsqldb.auth.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:
        `org.hsqldb.auth.DenyException`
      See Also:
        `AuthFunctionBean.authenticate(String, String)`

Copyright © 2001 - 2018 HSQL Development Group.