
public final class Role extends Object implements Principal, Serializable
Authorizer, such as a web
container.| Modifier and Type | Field and Description |
|---|---|
static Role |
ALL
All users, regardless of authentication status
|
static Role |
ANONYMOUS
If the user hasn't supplied a name
|
static Role |
ASSERTED
If the user has supplied a cookie with a username
|
static Role |
AUTHENTICATED
If the user has authenticated with the Container or UserDatabase
|
| Modifier | Constructor and Description |
|---|---|
protected |
Role()
Create an empty Role.
|
|
Role(String name)
Constructs a new Role with a given name.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Two Role objects are considered equal if their names are identical.
|
String |
getName()
Returns the name of the Principal.
|
int |
hashCode()
Returns a unique hashcode for the Role.
|
static boolean |
isBuiltInRole(Role role)
|
static boolean |
isReservedName(String name)
Returns
true if the supplied name is identical to the name
of a built-in Role; that is, the value returned by getName()
for built-in Roles ALL, ANONYMOUS,
ASSERTED, or AUTHENTICATED. |
String |
toString()
Returns a String representation of the role
|
public static final Role AUTHENTICATED
protected Role()
public static boolean isBuiltInRole(Role role)
role - the role to checkpublic static boolean isReservedName(String name)
true if the supplied name is identical to the name
of a built-in Role; that is, the value returned by getName()
for built-in Roles ALL, ANONYMOUS,
ASSERTED, or AUTHENTICATED.name - the name to be testedtrue if the name is reserved; false
if notpublic int hashCode()
public boolean equals(Object obj)
equals in interface Principalequals in class Objectobj - the object to testtrue if both objects are of type Role and have identical namesObject.equals(java.lang.Object)Copyright © 2001-2018 The Apache Software Foundation. All rights reserved.