org.hsqldb.auth
Class HsqldbSlaveAuthBean

java.lang.Object
  extended by 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:
AuthFunctionBean

Constructor Summary
HsqldbSlaveAuthBean()
           
 
Method Summary
 String[] authenticate(String userName, 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(String masterJdbcUrl)
           
 void setValidationPassword(String validationPassword)
          Use this method and setValidationUser if you want access to the master database to be verified upon instance initialization.
 void setValidationUser(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(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(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(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 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 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
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 - 2010 HSQL Development Group.