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

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

public class MemoryRealm
hérite de RealmBaseAcube
Simple implementation of Realm that reads an XML file to configure the valid users, passwords, and roles. The file format (and default file location) are identical to those currently supported by Tomcat 3.X.

IMPLEMENTATION NOTE: It is assumed that the in-memory collection representing our defined users (and their roles) is initialized at application startup and never modified again. Therefore, no thread synchronization is performed around accesses to the principals collection.

Author:
Craig R. McClanahan
Version:
$Revision: 373023 $ $Date: 2006-01-27 17:17:43 -0600 (Fri, 27 Jan 2006) $

Sommaire des Attributs
private static Digester
digester
The Digester we will use to process in-memory database files.
private final String
info
Descriptive information about this Realm implementation.
private static Log
log
log the log for this realm
protected static final String
NAME
Descriptive information about this Realm implementation.
private String
pathname
The pathname (absolute or relative to Catalina's current working directory) of the XML file containing our database information.
private Map
principals
The set of valid Principals for this Realm, keyed by user NAME.
private static StringManager
sm
The string manager for this package.
Sommaire des Constructeurs
Sommaire des Méthodes
void
addUser(String username, String password, String roles)
Add a new user to the in-memory database.
Principal
authenticate(String username, String credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise return null.
protected synchronized Digester
getDigester()
Return a configured Digester to use for processing the XML input file, creating a new one if necessary.
String
getInfo()
Return descriptive information about this Realm implementation and the corresponding version number, in the format <description>/<version>.
protected String
getName()
Return a short Name for this Realm implementation.
protected String
getPassword(String username)
Return the password associated with the given principal's user NAME.
String
getPathname()
Return the pathname of our XML file containing user definitions.
protected Principal
getPrincipal(String username)
Return the Principal associated with the given user NAME.
protected Map
getPrincipals()
Returns the principals for this realm.
void
setPathname(String pathname)
Set the pathname of our XML file containing user definitions.
synchronized void
start()
Prepare for active use of the public methods of this Component.
synchronized 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
protected static final String NAME
Descriptive information about this Realm implementation.

log
private static Log log
log the log for this realm

digester
private static Digester digester
The Digester we will use to process in-memory database files.

sm
private static StringManager sm
The string manager for this package.

info
private final String info
Descriptive information about this Realm implementation.

pathname
private String pathname
The pathname (absolute or relative to Catalina's current working directory) of the XML file containing our database information.

principals
private Map principals
The set of valid Principals for this Realm, keyed by user NAME.
Détail des Constructeurs
MemoryRealm
public MemoryRealm()
Détail des méthodes
getInfo
public String getInfo()
Return descriptive information about this Realm implementation and the corresponding version number, in the format <description>/<version>.
Retours:
descriptive information about this Realm

getPathname
public String getPathname()
Return the pathname of our XML file containing user definitions.
Retours:
the pathname of our XML file containing user definitions

setPathname
public void setPathname(String pathname)
Set the pathname of our XML file containing user definitions. If a relative pathname is specified, it is resolved against "catalina.base".
Paramètres:
pathname - The new pathname

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.
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:
the Principal associated with the specified username and credentials

addUser
void addUser(String username,
             String password,
             String roles)
Add a new user to the in-memory database.
Paramètres:
username - User's username
password - User's password (clear text)
roles - Comma-delimited set of roles associated with this user

getDigester
protected synchronized Digester getDigester()
Return a configured Digester to use for processing the XML input file, creating a new one if necessary.
Retours:
a configured Digester to use for processing the XML input file

getName
protected String getName()
Return a short Name for this Realm implementation.
Retours:
a short Name for this Realm implementation.

getPassword
protected String getPassword(String username)
Return the password associated with the given principal's user NAME.
Paramètres:
username - the user NAME.
Retours:
the password associated with the given principal's user NAME.

getPrincipal
protected Principal getPrincipal(String username)
Return the Principal associated with the given user NAME.
Paramètres:
username - the user NAME
Retours:
the Principal associated with the given user NAME.

getPrincipals
protected Map getPrincipals()
Returns the principals for this realm.
Retours:
The principals, keyed by user NAME (a String)

start
public synchronized 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 synchronized 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