public class JDBCLoginService extends MappedLoginService
MappedLoginService.Anonymous, MappedLoginService.KnownUser, MappedLoginService.RolePrincipal, MappedLoginService.UserPrincipalAbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.Listener| Modifier and Type | Field and Description |
|---|---|
protected int |
_cacheTime |
protected Connection |
_con |
protected String |
_config |
protected String |
_jdbcDriver |
protected long |
_lastHashPurge |
protected String |
_password |
protected String |
_roleSql |
protected String |
_roleTableRoleField |
protected String |
_url |
protected String |
_userName |
protected String |
_userSql |
protected String |
_userTableKey |
protected String |
_userTablePasswordField |
_identityService, _name, _users| Constructor and Description |
|---|
JDBCLoginService() |
JDBCLoginService(String name) |
JDBCLoginService(String name,
IdentityService identityService,
String config) |
JDBCLoginService(String name,
String config) |
| Modifier and Type | Method and Description |
|---|---|
void |
connectDatabase()
(re)Connect to database with parameters setup by loadConfig()
|
protected void |
doStart() |
String |
getConfig() |
protected UserIdentity |
loadUser(String username) |
protected void |
loadUsers() |
UserIdentity |
login(String username,
Object credentials)
Login a user.
|
protected UserIdentity |
putUser(String username,
String credentials,
String[] roles) |
void |
setConfig(String config)
Load JDBC connection configuration from properties file.
|
doStop, getIdentityService, getName, getUsers, logout, putUser, putUser, removeUser, setIdentityService, setName, setUsers, toString, validateaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stopprotected String _config
protected String _jdbcDriver
protected String _url
protected String _userName
protected String _password
protected String _userTableKey
protected String _userTablePasswordField
protected String _roleTableRoleField
protected int _cacheTime
protected long _lastHashPurge
protected Connection _con
protected String _userSql
protected String _roleSql
public JDBCLoginService()
throws IOException
IOExceptionpublic JDBCLoginService(String name) throws IOException
IOExceptionpublic JDBCLoginService(String name, String config) throws IOException
IOExceptionpublic JDBCLoginService(String name, IdentityService identityService, String config) throws IOException
IOExceptionprotected void doStart()
throws Exception
doStart in class MappedLoginServiceExceptionMappedLoginService.doStart()public String getConfig()
public void setConfig(String config)
config - Filename or url of user properties file.public void connectDatabase()
public UserIdentity login(String username, Object credentials)
LoginServicelogin in interface LoginServicelogin in class MappedLoginServiceusername - The user namecredentials - The users credentialsLoginService.login(java.lang.String, java.lang.Object)protected void loadUsers()
loadUsers in class MappedLoginServiceprotected UserIdentity loadUser(String username)
loadUser in class MappedLoginServiceprotected UserIdentity putUser(String username, String credentials, String[] roles)
Copyright © 1995-2015 Webtide. All Rights Reserved.