public class JDBCUserRealm extends HashUserRealm implements UserRealm
__SSO, _roles, _users| Constructor and Description |
|---|
JDBCUserRealm()
Constructor.
|
JDBCUserRealm(String name)
Constructor.
|
JDBCUserRealm(String name,
String config)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Principal |
authenticate(String username,
Object credentials,
Request request)
Authenticate a users credentials.
|
void |
connectDatabase()
(re)Connect to database with parameters setup by loadConfig()
|
boolean |
isUserInRole(Principal user,
String roleName)
Check if a user is in a role.
|
protected void |
loadConfig()
Load JDBC connection configuration from properties file.
|
void |
logout(Principal user)
logout a user Principal.
|
addUserToRole, clearSingleSignOn, disassociate, doStart, doStop, dump, getConfig, getConfigResource, getName, getPrincipal, getRefreshInterval, getSingleSignOn, getSSORealm, popRole, pushRole, put, reauthenticate, setConfig, setName, setRefreshInterval, setSingleSignOn, setSSORealm, toStringaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdisassociate, getName, getPrincipal, popRole, pushRole, reauthenticatepublic JDBCUserRealm()
public JDBCUserRealm(String name)
name - public JDBCUserRealm(String name, String config) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException
name - Realm nameconfig - Filename or url of JDBC connection properties file.IOExceptionClassNotFoundExceptionInstantiationExceptionIllegalAccessExceptionprotected void loadConfig()
throws IOException
loadConfig in class HashUserRealmIOExceptionpublic void logout(Principal user)
UserRealmlogout in interface UserRealmlogout in class HashUserRealmuser - A Principal previously returned from this realmpublic void connectDatabase()
public Principal authenticate(String username, Object credentials, Request request)
UserRealmauthenticate in interface UserRealmauthenticate in class HashUserRealmusername - The username.credentials - The user credentials, normally a String password.request - The request to be authenticated. Additional
parameters may be extracted or set on this request as needed
for the authentication mechanism (none required for BASIC and
FORM authentication).public boolean isUserInRole(Principal user, String roleName)
isUserInRole in interface UserRealmisUserInRole in class HashUserRealmuser - The user, which must be from this realmroleName - Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.