org.apache.catalina.realm
Class GenericPrincipal
java.lang.Object
org.apache.catalina.realm.GenericPrincipal
- Principal
public class GenericPrincipal
extends java.lang.Object
implements Principal
Generic implementation of java.security.Principal that
is available for use by Realm
implementations.
Version:
- Craig R. McClanahan
protected String | name - The username of the user represented by this Principal.
|
protected String | password - The authentication credentials for the user represented by
this Principal.
|
protected Realm | realm - The Realm with which this Principal is associated.
|
protected String[] | roles - The set of roles associated with this user.
|
GenericPrincipal(String name, String password, List roles)
|
GenericPrincipal(Realm realm, String name, String password) - Construct a new Principal, associated with the specified Realm, for the
specified username and password.
|
GenericPrincipal(Realm realm, String name, String password, List roles) - Construct a new Principal, associated with the specified Realm, for the
specified username and password, with the specified role names
(as Strings).
|
String | getName()
|
String | getPassword()
|
Realm | getRealm()
|
String[] | getRoles()
|
boolean | hasRole(String role) - Does the user represented by this Principal possess the specified role?
|
String | toString() - Return a String representation of this object, which exposes only
information that should be public.
|
name
protected String name
The username of the user represented by this Principal.
password
protected String password
The authentication credentials for the user represented by
this Principal.
realm
protected Realm realm
The Realm with which this Principal is associated.
roles
protected String[] roles
The set of roles associated with this user.
GenericPrincipal
public GenericPrincipal(String name,
String password,
List roles)
GenericPrincipal
public GenericPrincipal(Realm realm,
String name,
String password)
Construct a new Principal, associated with the specified Realm, for the
specified username and password.
realm
- The Realm that owns this Principalname
- The username of the user represented by this Principalpassword
- Credentials used to authenticate this user
GenericPrincipal
public GenericPrincipal(Realm realm,
String name,
String password,
List roles)
Construct a new Principal, associated with the specified Realm, for the
specified username and password, with the specified role names
(as Strings).
realm
- The Realm that owns this principalname
- The username of the user represented by this Principalpassword
- Credentials used to authenticate this userroles
- List of roles (must be Strings) possessed by this user
getName
public String getName()
getPassword
public String getPassword()
getRealm
public Realm getRealm()
getRoles
public String[] getRoles()
hasRole
public boolean hasRole(String role)
Does the user represented by this Principal possess the specified role?
role
- Role to be tested
toString
public String toString()
Return a String representation of this object, which exposes only
information that should be public.
Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.