|
Framework Serveur J2EE ACube V3.1.0 |
|
acube.framework.clavierVirtuel.realm
Classe MemoryRealm
java.lang.Object
org.apache.catalina.realm.RealmBase
acube.framework.clavierVirtuel.realm.MemoryRealm Interfaces à implémenter:
-
org.apache.catalina.Lifecycle, MBeanRegistration, org.apache.catalina.Realm
public class MemoryRealm
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 org.apache.tomcat.util.digester.Digester |
digesterThe Digester we will use to process in-memory database files. |
|
infoDescriptive information about this Realm implementation. |
private static org.apache.commons.logging.Log |
loglog the log for this realm
|
protected static final String |
NAMEDescriptive information about this Realm implementation. |
|
pathnameThe pathname (absolute or relative to Catalina's current
working directory) of the XML file containing our database
information. |
|
principalsThe set of valid Principals for this Realm, keyed by user NAME. |
private static org.apache.catalina.util.StringManager |
smThe string manager for this package. |
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 |
|
addUser(String username, String password, String roles)Add a new user to the in-memory database. |
|
authenticate(String username, String credentials)Return the Principal associated with the specified username and
credentials, if there is one; otherwise return
null . |
protected synchronized org.apache.tomcat.util.digester.Digester |
getDigester()Return a configured Digester to use for
processing the XML input file, creating a new one if necessary. |
|
getInfo()Return descriptive information about this Realm implementation
and the corresponding version number, in the format
<description>/<version> . |
|
getName()Return a short Name for this Realm implementation. |
|
getPassword(String username)Return the password associated with the given principal's user
NAME. |
|
getPathname()Return the pathname of our XML file containing user
definitions. |
|
getPrincipal(String username)Return the Principal associated with the given user NAME. |
|
|
|
setPathname(String pathname)Set the pathname of our XML file containing user definitions. |
|
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
protected static final String NAME
-
Descriptive information about this Realm implementation.
log
private static org.apache.commons.logging.Log log
-
log
the log for this realm
digester
private static org.apache.tomcat.util.digester.Digester digester
-
The Digester we will use to process in-memory database files.
sm
private static org.apache.catalina.util.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>
.
Spécifié par:
-
getInfo in interface org.apache.catalina.Realm
Dépacées:
-
getInfo in class org.apache.catalina.realm.RealmBase
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
.
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:
-
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 org.apache.tomcat.util.digester.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.
Dépacées:
-
getName in class org.apache.catalina.realm.RealmBase
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.
Dépacées:
-
getPassword in class org.apache.catalina.realm.RealmBase
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.
Dépacées:
-
getPrincipal in class org.apache.catalina.realm.RealmBase
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 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 synchronized 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.
|
|