Framework Serveur J2EE ACube V2.7.4
CLASSE PRECEDANTE CLASSE SUIVANTE
SOMMAIRE: ATTR CONSTR METH DETAIL: ATTR CONSTR METH

acube.framework.clavierVirtuel.realm
Classe DataSourceRealm
java.lang.Object
  org.apache.catalina.realm.RealmBase
      acube.framework.clavierVirtuel.realm.RealmBaseAcube
          acube.framework.clavierVirtuel.realm.DataSourceRealm

public class DataSourceRealm
hérite de RealmBaseAcube
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 String
dataSourceName
The NAME of the JNDI JDBC DataSource
private boolean
localDataSource
Context local datasource.
private static final String
NAME
Descriptive information about this Realm implementation.
private String
preparedCredentials
The generated string for the credentials PreparedStatement
private String
preparedRoles
The generated string for the roles PreparedStatement
private String
roleNameCol
The column in the user role table that names a role
private static final StringManager
SM
The string manager for this package.
private String
userCredCol
The column in the user table that holds the user's credintials
private String
userNameCol
The column in the user table that holds the user's NAME
private String
userRoleTable
The table that holds the relation between user's and roles
private String
userTable
The table that holds user data.
Sommaire des Constructeurs
Sommaire des Méthodes
Principal
authenticate(String username, String credentials)
{@inheritDoc}
protected Principal
authenticate(Connection dbConnection, String username, String credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise return null.
protected void
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.
String
getDataSourceName()
Return the NAME of the JNDI JDBC DataSource.
boolean
getLocalDataSource()
Return if the datasource will be looked up in the webapp JNDI Context.
protected String
getName()
{@inheritDoc}
protected String
getPassword(String username)
{@inheritDoc}
protected String
getPassword(Connection dbConnection, String username)
Return the password associated with the given principal's user NAME.
protected Principal
getPrincipal(String username)
{@inheritDoc}
String
getRoleNameCol()
Return the column in the user role table that names a role.
protected ArrayList
getRoles(String username)
Return the roles associated with the given user NAME.
protected ArrayList
getRoles(Connection dbConnection, String username)
Return the roles associated with the given user NAME
String
getUserCredCol()
Return the column in the user table that holds the user's credentials.
String
getUserNameCol()
Return the column in the user table that holds the user's NAME.
String
getUserRoleTable()
Return the table that holds the relation between user's and roles.
String
getUserTable()
Return the table that holds user data..
protected Connection
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.
void
setDataSourceName(String dataSourceName)
Set the NAME of the JNDI JDBC DataSource.
void
setLocalDataSource(boolean localDataSource)
Set to true to cause the datasource to be looked up in the webapp JNDI Context.
void
setRoleNameCol(String roleNameCol)
Set the column in the user role table that names a role.
void
setUserCredCol(String userCredCol)
Set the column in the user table that holds the user's credentials.
void
setUserNameCol(String userNameCol)
Set the column in the user table that holds the user's NAME.
void
setUserRoleTable(String userRoleTable)
Set the table that holds the relation between user's and roles.
void
setUserTable(String userTable)
Set the table that holds user data.
void
start()
Prepare for active use of the public methods of this Component.
void
stop()
Gracefully shut down active use of the public methods of this Component.
Méthodes héritées de la classe acube.framework.clavierVirtuel.realm.RealmBaseAcube
authenticate
Méthodes héritées de la classe java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Détail des Attributs
NAME
private static final String NAME
Descriptive information about this Realm implementation.

SM
private static final 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}
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}

getPassword
protected String getPassword(String username)
{@inheritDoc}

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}

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 LifecycleException
Prepare for active use of the public methods of this Component.
Exceptions:
LifecycleException - if this component detects a fatal error that prevents it from being started

stop
public void stop()
          throws LifecycleException
Gracefully shut down active use of the public methods of this Component.
Exceptions:
LifecycleException - if this component detects a fatal error that needs to be reported

Framework Serveur J2EE ACube V2.7.4
CLASSE PRECEDANTE CLASSE SUIVANTE
SOMMAIRE: ATTR CONSTR METH DETAIL: ATTR CONSTR METH

Version 2.7.4 du 10/07/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.
Documentation generated by DocFlex