Module org.hsqldb

Class 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.7.3
    Author:
    Blaine Simpson (blaine dot simpson at admc dot com)
    See Also:
    AuthFunctionBean
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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.
        Parameters:
        validationUser - String
      • 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.
        Parameters:
        validationPassword - String
      • 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.
        Parameters:
        doDelegateRolesSchema - boolean
      • 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 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