org.eclipse.jetty.security
类 JDBCLoginService
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.security.MappedLoginService
org.eclipse.jetty.security.JDBCLoginService
- 所有已实现的接口:
- LoginService, LifeCycle
public class JDBCLoginService
- extends MappedLoginService
HashMapped User Realm with JDBC as data source. JDBCLoginService extends
HashULoginService and adds a method to fetch user information from database.
The login() 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 login() 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. authenticate() is 'synchronized'.
An example properties file for configuration is in
$JETTY_HOME/etc/jdbcRealm.properties
- 版本:
- $Id: JDBCLoginService.java 4792 2009-03-18 21:55:52Z gregw $
| 从类 org.eclipse.jetty.security.MappedLoginService 继承的方法 |
doStop, getIdentityService, getName, getUsers, logout, putUser, putUser, removeUser, setIdentityService, setName, setUsers, toString, validate |
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法 |
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
JDBCLoginService
public JDBCLoginService()
throws IOException
- 抛出:
IOException
JDBCLoginService
public JDBCLoginService(String name)
throws IOException
- 抛出:
IOException
JDBCLoginService
public JDBCLoginService(String name,
String config)
throws IOException
- 抛出:
IOException
JDBCLoginService
public JDBCLoginService(String name,
IdentityService identityService,
String config)
throws IOException
- 抛出:
IOException
doStart
protected void doStart()
throws Exception
- 覆盖:
- 类
MappedLoginService 中的 doStart
- 抛出:
Exception- 另请参见:
MappedLoginService.doStart()
getConfig
public String getConfig()
setConfig
public void setConfig(String config)
- Load JDBC connection configuration from properties file.
- 参数:
config - Filename or url of user properties file.
connectDatabase
public void connectDatabase()
- (re)Connect to database with parameters setup by loadConfig()
login
public UserIdentity login(String username,
Object credentials)
- 从接口
LoginService 复制的描述
- Login a user.
- 指定者:
- 接口
LoginService 中的 login - 覆盖:
- 类
MappedLoginService 中的 login
- 参数:
username - The user namecredentials - The users credentials
- 返回:
- A UserIdentity if the credentials matched, otherwise null
- 另请参见:
LoginService.login(java.lang.String, java.lang.Object)
loadUsers
protected void loadUsers()
- 指定者:
- 类
MappedLoginService 中的 loadUsers
loadUser
protected UserIdentity loadUser(String username)
- 指定者:
- 类
MappedLoginService 中的 loadUser
Copyright © 2013. All Rights Reserved.