Framework Serveur J2EE ACube V3.1.0
CLASSE PRECEDANTE CLASSE SUIVANTE
SOMMAIRE: ATTR CONSTR METH DETAIL: ATTR CONSTR METH

acube.framework.clavierVirtuel.realm
Classe ElectisRealm
java.lang.Object
  org.apache.catalina.realm.RealmBase
      acube.framework.clavierVirtuel.realm.RealmBaseAcube
          acube.framework.clavierVirtuel.realm.ElectisRealm
Interfaces à implémenter:
org.apache.catalina.Lifecycle, MBeanRegistration, org.apache.catalina.Realm

public class ElectisRealm
hérite de RealmBaseAcube
Classe d'authentification J2EE Realm.

Permet d'authentifier un utilisateur pour l'application Electis avec politique de blocage.
La politique de blocage consiste à refuser l'accès à tout utilisateur dont le compte est bloqué. Un compte est bloqué si un ou plusieurs utilisateurs dépasse un nombre limite de tentatives de connexion à ce compte. Le compte reste bloqué pour un certain temps durant lequel aucun test d'authentification n'est réalisé.
Le déblocage s'effectue si le temps d'attente est dépassé et qu'un utilisateur est authentifié. Son compteur de tentatives de connexions est alors remis à zéro.

Prérequis : Utilise une datasource définie en tant que resource serveur et accessible avec un nom JNDI. Projet ELECTIS.
Author:
eds4

Sommaire des Attributs
private String
dataSourceName
Le nom JNDI de la datasource utilisée.
protected static final String
INFO
Descriptive information about this Realm implementation.
private boolean
localDataSource
Context local datasource.
private static final String
NAME
Descriptive information about this Realm implementation.
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
Principal
authenticate(String username, String credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise return null.
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.
private void
close(Connection dbConnection)
Close the specified database connection.
String
String
getInfo()
{@inheritDoc}
protected String
getName()
{@inheritDoc}
protected String
getPassword(String username)
{@inheritDoc}
protected Principal
getPrincipal(String username)
{@inheritDoc}
boolean
private Connection
open()
Open the specified database connection.
void
setDataSourceName(String argDataSourceName)
void
setLocalDataSource(boolean argLocalDataSource)
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 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
INFO
protected static final String INFO
Descriptive information about this Realm implementation.

NAME
private static final String NAME
Descriptive information about this Realm implementation.

dataSourceName
private String dataSourceName
Le nom JNDI de la datasource utilisée.

localDataSource
private boolean localDataSource
Context local datasource.
Détail des Constructeurs
ElectisRealm
public ElectisRealm()
Détail des méthodes
getDataSourceName
public String getDataSourceName()
Retours:
Returns the dataSourceName.

setDataSourceName
public void setDataSourceName(String argDataSourceName)
Paramètres:
argDataSourceName - The dataSourceName to set.

isLocalDataSource
public boolean isLocalDataSource()
Retours:
Returns the localDataSource.

setLocalDataSource
public void setLocalDataSource(boolean argLocalDataSource)
Paramètres:
argLocalDataSource - The localDataSource to set.

authenticate
public Principal authenticate(String username,
                              String credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise return null. If there are any errors with the JDBC connection, executing the query or anything we return null (don't authenticate). This event is also logged, and the connection will be closed so that a subsequent request will automatically re-open it.
Spécifié par:
authenticate in interface org.apache.catalina.Realm
Dépacées:
Paramètres:
username - Username of the Principal to look up
credentials - Password or other credentials to use in authenticating this username
Retours:
Principal

authenticate
protected Principal authenticate(Connection dbConnection,
                                 String username,
                                 String credentials)
                          throws Exception
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:
Principal
Exceptions:
Exception - if a database error occurs

close
private void close(Connection dbConnection)
Close the specified database connection.
Paramètres:
dbConnection - The connection to be closed

open
private 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

getInfo
public String getInfo()
{@inheritDoc}
Spécifié par:
getInfo in interface org.apache.catalina.Realm
Dépacées:
getInfo 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

getPrincipal
protected Principal getPrincipal(String username)
{@inheritDoc}
Dépacées:
getPrincipal in class org.apache.catalina.realm.RealmBase

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
CLASSE PRECEDANTE CLASSE SUIVANTE
SOMMAIRE: ATTR CONSTR METH DETAIL: ATTR CONSTR METH

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.
Documentation generated by DocFlex