| java.lang.Object org.mortbay.jetty.security.HashUserRealm org.mortbay.jetty.security.JDBCUserRealm
JDBCUserRealm | public class JDBCUserRealm extends HashUserRealm implements UserRealm(Code) | | HashMapped User Realm with JDBC as data source.
JDBCUserRealm extends HashUserRealm and adds a method to fetch user
information from database.
The authenticate() method checks the inherited HashMap for the user.
If the user is not found, it will fetch details from the database
and populate the inherited HashMap. It then calls the HashUserRealm
authenticate() 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
version: $Id: JDBCUserRealm.java 1180 2006-11-08 19:47:06Z janb $ author: Arkadi Shishlov (arkadi) author: Fredrik Borgh author: Greg Wilkins (gregw) author: Ben Alex |
JDBCUserRealm | public JDBCUserRealm()(Code) | | Constructor.
|
JDBCUserRealm | public JDBCUserRealm(String name)(Code) | | Constructor.
Parameters: name - |
connectDatabase | public void connectDatabase()(Code) | | (re)Connect to database with parameters setup by loadConfig()
|
setConfig | public void setConfig(String config) throws IOException(Code) | | Load JDBC connection configuration from properties file.
Parameters: config - Filename or url of user properties file. exception: IOException - |
Methods inherited from org.mortbay.jetty.security.HashUserRealm | public synchronized void addUserToRole(String userName, String roleName)(Code)(Java Doc) public Principal authenticate(String username, Object credentials, Request request)(Code)(Java Doc) public void clearSingleSignOn(String username)(Code)(Java Doc) public void disassociate(Principal user)(Code)(Java Doc) public void dump(PrintStream out)(Code)(Java Doc) public String getConfig()(Code)(Java Doc) public String getName()(Code)(Java Doc) public Principal getPrincipal(String username)(Code)(Java Doc) public SSORealm getSSORealm()(Code)(Java Doc) public Credential getSingleSignOn(Request request, Response response)(Code)(Java Doc) public synchronized boolean isUserInRole(Principal user, String roleName)(Code)(Java Doc) public void logout(Principal user)(Code)(Java Doc) public Principal popRole(Principal user)(Code)(Java Doc) public Principal pushRole(Principal user, String role)(Code)(Java Doc) public synchronized Object put(Object name, Object credentials)(Code)(Java Doc) public boolean reauthenticate(Principal user)(Code)(Java Doc) public void setConfig(String config) throws IOException(Code)(Java Doc) public void setName(String name)(Code)(Java Doc) public void setSSORealm(SSORealm ssoRealm)(Code)(Java Doc) public void setSingleSignOn(Request request, Response response, Principal principal, Credential credential)(Code)(Java Doc) public String toString()(Code)(Java Doc)
|
|
|