java.lang.Object
org.hsqldb.auth.HsqldbSlaveAuthBean
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]
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.
-
Constructor Details
-
HsqldbSlaveAuthBean
public HsqldbSlaveAuthBean()
-
-
Method Details
-
setValidationUser
Use this method and setValidationPassword if you want access to the master database to be verified upon instance initialization.- Parameters:
validationUser
- String
-
setValidationPassword
Use this method and setValidationUser if you want access to the master database to be verified upon instance initialization.- Parameters:
validationPassword
- String
-
setMasterJdbcUrl
-
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
- 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
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 interfaceAuthFunctionBean
- Parameters:
userName
- Stringpassword
- 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
-