|
Framework Serveur J2EE ACube V3.1.0 |
|
acube.framework.clavierVirtuel.realm
Classe DataSourceRealm
java.lang.Object
org.apache.catalina.realm.RealmBase
acube.framework.clavierVirtuel.realm.DataSourceRealm Interfaces à implémenter:
-
org.apache.catalina.Lifecycle, MBeanRegistration, org.apache.catalina.Realm
public class DataSourceRealm
Implmentation of Realm that works with any JDBC JNDI
DataSource. See the JDBCRealm.howto for more details on how to set
up the database and for configuration options.
Author:
-
Glenn L. Nielsen
-
Craig R. McClanahan
-
Carson McDonald
-
Ignacio Ortega
Version:
-
$Revision: 1.1 $
Sommaire des Attributs |
|
|
|
|
private static final String |
NAMEDescriptive information about this Realm implementation. |
|
|
|
preparedRolesThe generated string for the roles PreparedStatement |
|
roleNameColThe column in the user role table that names a role |
private static final org.apache.catalina.util.StringManager |
SMThe string manager for this package. |
|
userCredColThe column in the user table that holds the user's credintials |
|
userNameColThe column in the user table that holds the user's NAME |
|
userRoleTableThe table that holds the relation between user's and roles |
|
|
Attributs hérités de l'interface org.apache.catalina.Lifecycle |
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT |
Sommaire des Constructeurs |
|
Sommaire des Méthodes |
|
authenticate(String username, String credentials){@inheritDoc} |
|
authenticate(Connection dbConnection, String username, String credentials)Return the Principal associated with the specified username and
credentials, if there is one; otherwise return
null . |
|
close(Connection dbConnection)Close the specified database connection. |
private PreparedStatement |
credentials(Connection dbConnection, String username)Return a PreparedStatement configured to perform the SELECT
required to retrieve user credentials for the specified
username. |
|
|
|
getLocalDataSource()Return if the datasource will be looked up in the webapp JNDI
Context. |
|
|
|
|
|
getPassword(Connection dbConnection, String username)Return the password associated with the given principal's user
NAME. |
|
|
|
getRoleNameCol()Return the column in the user role table that names a role. |
|
getRoles(String username)Return the roles associated with the given user NAME. |
|
getRoles(Connection dbConnection, String username)Return the roles associated with the given user NAME |
|
getUserCredCol()Return the column in the user table that holds the user's
credentials. |
|
getUserNameCol()Return the column in the user table that holds the user's NAME. |
|
getUserRoleTable()Return the table that holds the relation between user's and
roles. |
|
|
|
open()Open the specified database connection. |
private PreparedStatement |
roles(Connection dbConnection, String username)Return a PreparedStatement configured to perform the SELECT
required to retrieve user roles for the specified username. |
|
|
|
setLocalDataSource(boolean localDataSource)Set to true to cause the datasource to be looked up in the
webapp JNDI Context. |
|
setRoleNameCol(String roleNameCol)Set the column in the user role table that names a role. |
|
setUserCredCol(String userCredCol)Set the column in the user table that holds the user's
credentials. |
|
setUserNameCol(String userNameCol)Set the column in the user table that holds the user's NAME. |
|
setUserRoleTable(String userRoleTable)Set the table that holds the relation between user's and roles. |
|
setUserTable(String userTable)Set the table that holds user data. |
|
start()Prepare for active use of the public methods of this Component. |
|
stop()Gracefully shut down active use of the public methods of this
Component. |
Méthodes héritées de la classe org.apache.catalina.realm.RealmBase |
addLifecycleListener, addPropertyChangeListener, authenticate, authenticate, authenticate, authenticate, backgroundProcess, destroy, Digest, findLifecycleListeners, findSecurityConstraints, getAllRolesMode, getContainer, getController, getDigest, getDigestEncoding, getDomain, getInfo, getObjectName, getType, getValidate, hasResourcePermission, hasRole, hasUserDataPermission, init, main, postDeregister, postRegister, preDeregister, preRegister, removeLifecycleListener, removePropertyChangeListener, setAllRolesMode, setContainer, setController, setDigest, setDigestEncoding, setValidate, start, stop |
Méthodes héritées de la classe java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Méthodes héritées de l'interface org.apache.catalina.Lifecycle |
addLifecycleListener, findLifecycleListeners, removeLifecycleListener, start, stop |
Méthodes héritées de l'interface org.apache.catalina.Realm |
addPropertyChangeListener, authenticate, authenticate, authenticate, authenticate, backgroundProcess, findSecurityConstraints, getContainer, getInfo, hasResourcePermission, hasRole, hasUserDataPermission, removePropertyChangeListener, setContainer |
Méthodes héritées de l'interface javax.management.MBeanRegistration |
postDeregister, postRegister, preDeregister, preRegister |
Détail des Attributs
NAME
private static final String NAME
-
Descriptive information about this Realm implementation.
SM
private static final org.apache.catalina.util.StringManager SM
-
The string manager for this package.
dataSourceName
private String dataSourceName
-
The NAME of the JNDI JDBC DataSource
localDataSource
private boolean localDataSource
-
Context local datasource.
roleNameCol
private String roleNameCol
-
The column in the user role table that names a role
userCredCol
private String userCredCol
-
The column in the user table that holds the user's credintials
userNameCol
private String userNameCol
-
The column in the user table that holds the user's NAME
userRoleTable
private String userRoleTable
-
The table that holds the relation between user's and roles
userTable
private String userTable
-
The table that holds user data.
preparedRoles
private String preparedRoles
-
The generated string for the roles PreparedStatement
preparedCredentials
private String preparedCredentials
-
The generated string for the credentials PreparedStatement
Détail des Constructeurs
DataSourceRealm
public DataSourceRealm()
Détail des méthodes
getDataSourceName
public String getDataSourceName()
-
Return the NAME of the JNDI JDBC DataSource.
Retours:
-
the NAME of the JNDI JDBC DataSource.
setDataSourceName
public void setDataSourceName(String dataSourceName)
-
Set the NAME of the JNDI JDBC DataSource.
Paramètres:
-
dataSourceName - the NAME of the JNDI JDBC DataSource
getLocalDataSource
public boolean getLocalDataSource()
-
Return if the datasource will be looked up in the webapp JNDI
Context.
Retours:
-
if the datasource will be looked up in the webapp JNDI
Context.
setLocalDataSource
public void setLocalDataSource(boolean localDataSource)
-
Set to true to cause the datasource to be looked up in the
webapp JNDI Context.
Paramètres:
-
localDataSource - the new flag value
getRoleNameCol
public String getRoleNameCol()
-
Return the column in the user role table that names a role.
Retours:
-
the column in the user role table that names a role.
setRoleNameCol
public void setRoleNameCol(String roleNameCol)
-
Set the column in the user role table that names a role.
Paramètres:
-
roleNameCol - The column NAME
getUserCredCol
public String getUserCredCol()
-
Return the column in the user table that holds the user's
credentials.
Retours:
-
the column in the user table that holds the user's
setUserCredCol
public void setUserCredCol(String userCredCol)
-
Set the column in the user table that holds the user's
credentials.
Paramètres:
-
userCredCol - The column NAME
getUserNameCol
public String getUserNameCol()
-
Return the column in the user table that holds the user's NAME.
Retours:
-
the column in the user table that holds the user's
NAME.
setUserNameCol
public void setUserNameCol(String userNameCol)
-
Set the column in the user table that holds the user's NAME.
Paramètres:
-
userNameCol - The column NAME
getUserRoleTable
public String getUserRoleTable()
-
Return the table that holds the relation between user's and
roles.
Retours:
-
the table that holds the relation between user's and
roles.
setUserRoleTable
public void setUserRoleTable(String userRoleTable)
-
Set the table that holds the relation between user's and roles.
Paramètres:
-
userRoleTable - The table NAME
getUserTable
public String getUserTable()
-
Return the table that holds user data..
Retours:
-
the table that holds user data.
setUserTable
public void setUserTable(String userTable)
-
Set the table that holds user data.
Paramètres:
-
userTable - The table NAME
authenticate
public Principal authenticate(String username,
String credentials)
-
{@inheritDoc}
Spécifié par:
-
authenticate in interface org.apache.catalina.Realm
Dépacées:
-
authenticate
protected Principal authenticate(Connection dbConnection,
String username,
String credentials)
throws SQLException
-
Return the Principal associated with the specified username and
credentials, if there is one; otherwise return
null
.
Paramètres:
-
dbConnection - The database connection to be used
-
username - Username of the Principal to look up
-
credentials - Password or other credentials to use in
authenticating this username
Retours:
-
the Principal associated with the specified username
and credentials
Exceptions:
-
SQLException - if it had connection errors
close
protected void close(Connection dbConnection)
-
Close the specified database connection.
Paramètres:
-
dbConnection - The connection to be closed
open
protected Connection open()
-
Open the specified database connection.
Retours:
-
Connection to the database
getName
protected String getName()
-
{@inheritDoc}
Dépacées:
-
getName in class org.apache.catalina.realm.RealmBase
getPassword
protected String getPassword(String username)
-
{@inheritDoc}
Dépacées:
-
getPassword in class org.apache.catalina.realm.RealmBase
getPassword
protected String getPassword(Connection dbConnection,
String username)
-
Return the password associated with the given principal's user
NAME.
Paramètres:
-
dbConnection - The database connection to be used
-
username - Username for which password should be retrieved
Retours:
-
the password associated with the given principal's user
NAME.
getPrincipal
protected Principal getPrincipal(String username)
-
{@inheritDoc}
Dépacées:
-
getPrincipal in class org.apache.catalina.realm.RealmBase
getRoles
protected ArrayList getRoles(String username)
-
Return the roles associated with the given user NAME.
Paramètres:
-
username - Username for which roles should be retrieved
Retours:
-
the roles associated with the given user NAME.
getRoles
protected ArrayList getRoles(Connection dbConnection,
String username)
-
Return the roles associated with the given user NAME
Paramètres:
-
dbConnection - The database connection to be used
-
username - Username for which roles should be retrieved
Retours:
-
the roles associated with the given user NAME
credentials
private PreparedStatement credentials(Connection dbConnection,
String username)
throws SQLException
-
Return a PreparedStatement configured to perform the SELECT
required to retrieve user credentials for the specified
username.
Paramètres:
-
dbConnection - The database connection to be used
-
username - Username for which credentials should be retrieved
Retours:
-
a PreparedStatement configured to perform the SELECT
required to retrieve user credentials for the specified
username.
Exceptions:
-
SQLException - if a database error occurs
roles
private PreparedStatement roles(Connection dbConnection,
String username)
throws SQLException
-
Return a PreparedStatement configured to perform the SELECT
required to retrieve user roles for the specified username.
Paramètres:
-
dbConnection - The database connection to be used
-
username - Username for which roles should be retrieved
Retours:
-
a PreparedStatement configured to perform the SELECT
required to retrieve user roles for the specified
username.
Exceptions:
-
SQLException - if a database error occurs
start
public void start()
throws org.apache.catalina.LifecycleException
-
Prepare for active use of the public methods of this Component.
Spécifié par:
-
start in interface org.apache.catalina.Lifecycle
Dépacées:
-
start in class org.apache.catalina.realm.RealmBase
-
Exceptions:
-
org.apache.catalina.LifecycleException - if this component detects a fatal error that
prevents it from being started
stop
public void stop()
throws org.apache.catalina.LifecycleException
-
Gracefully shut down active use of the public methods of this
Component.
Spécifié par:
-
stop in interface org.apache.catalina.Lifecycle
Dépacées:
-
stop in class org.apache.catalina.realm.RealmBase
-
Exceptions:
-
org.apache.catalina.LifecycleException - if this component detects a fatal error that
needs to be reported
|
Framework Serveur J2EE ACube V3.1.0 |
|
Version 3.1.0 du 06/11/2009 / Etat : Validé |
Cette création est mise à disposition selon le Contrat Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique disponible en ligne http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ ou par courrier postal à Creative Commons, 559 Nathan Abbott Way, Stanford,California 94305, USA.
|
|