Package org.apache.catalina.realm
Class GenericPrincipal
- java.lang.Object
-
- org.apache.catalina.realm.GenericPrincipal
-
-
Field Summary
Fields Modifier and Type Field Description protected StringnameThe username of the user represented by this Principal.protected char[]passwordThe authentication credentials for the user represented by this Principal.protected RealmrealmThe Realm with which this Principal is associated.protected String[]rolesThe set of roles associated with this user.
-
Constructor Summary
Constructors Constructor Description GenericPrincipal(String name, char[] password, List<String> roles)GenericPrincipal(Realm realm, String name, char[] password)Construct a new Principal, associated with the specified Realm, for the specified username and password.GenericPrincipal(Realm realm, String name, char[] password, List<String> roles)Construct a new Principal, associated with the specified Realm, for the specified username and password, with the specified role names (as Strings).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()char[]getPassword()RealmgetRealm()String[]getRoles()booleanhasRole(String role)Does the user represented by this Principal possess the specified role?StringtoString()Return a String representation of this object, which exposes only information that should be public.
-
-
-
Field Detail
-
name
protected String name
The username of the user represented by this Principal.
-
password
protected char[] 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.
-
-
Constructor Detail
-
GenericPrincipal
public GenericPrincipal(Realm realm, String name, char[] password)
Construct a new Principal, associated with the specified Realm, for the specified username and password.- Parameters:
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, char[] password, List<String> roles)
Construct a new Principal, associated with the specified Realm, for the specified username and password, with the specified role names (as Strings).- Parameters:
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
-
-