public class JDBCLoginService extends AbstractLoginService
AbstractLoginService.login(String, Object, ServletRequest) method checks the inherited Map for the user. If the user is not
found, it will fetch details from the database and populate the inherited
Map. It then calls the superclass AbstractLoginService.login(String, Object, ServletRequest) method to perform the actual
authentication. Periodically (controlled by configuration parameter),
internal hashes are cleared. Caching can be disabled by setting cache refresh
interval to zero. Uses one database connection that is initialized at
startup. Reconnect on failures.
An example properties file for configuration is in
${jetty.home}/etc/jdbcRealm.properties
| Modifier and Type | Class and Description |
|---|---|
class |
JDBCLoginService.JDBCUserPrincipal
JDBCKnownUser
|
AbstractLoginService.RolePrincipal, AbstractLoginService.UserPrincipalAbstractLifeCycle.AbstractLifeCycleListenerContainer.InheritedListener, Container.ListenerLifeCycle.Listener| 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()
|
String |
getConfig() |
String[] |
loadRoleInfo(AbstractLoginService.UserPrincipal user) |
AbstractLoginService.UserPrincipal |
loadUserInfo(String username) |
void |
setConfig(String config)
Load JDBC connection configuration from properties file.
|
getIdentityService, getName, isFullValidate, login, logout, setFullValidate, setIdentityService, setName, toString, validateaddBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, unmanage, updateBean, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopequals, getClass, hashCode, notify, notifyAll, wait, wait, waitdumpContainer, dumpIterable, dumpMapEntries, dumpObjects, dumpSelf, namedpublic 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
IOExceptionpublic String getConfig()
public void setConfig(String config)
config - Filename or url of user properties file.public void connectDatabase()
public AbstractLoginService.UserPrincipal loadUserInfo(String username)
public String[] loadRoleInfo(AbstractLoginService.UserPrincipal user)
Copyright © 2010 - 2020 Adobe. All Rights Reserved