| Modifier and Type | Field and Description |
|---|---|
protected String |
name
The username of the user represented by this Principal.
|
protected char[] |
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.
|
| Constructor and Description |
|---|
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).
|
GenericPrincipal(String name,
char[] password,
List<String> roles) |
| Modifier and Type | Method and Description |
|---|---|
String |
getName() |
char[] |
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.
|
protected String name
protected char[] password
protected Realm realm
protected String[] roles
public GenericPrincipal(Realm realm, String name, char[] password)
realm - The Realm that owns this Principalname - The username of the user represented by this Principalpassword - Credentials used to authenticate this userpublic GenericPrincipal(Realm realm, String name, char[] password, List<String> roles)
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 userCopyright © 2019. All rights reserved.