public final class Role extends java.lang.Object implements java.security.Principal, java.io.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
|
| Constructor and Description |
|---|
Role(java.lang.String name)
Constructs a new Role with a given name.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Two Role objects are considered equal if their names are identical.
|
java.lang.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(java.lang.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. |
java.lang.String |
toString()
Returns a String representation of the role
|
public static final Role AUTHENTICATED
public Role(java.lang.String name)
name - the name of the Rolepublic static boolean isBuiltInRole(Role role)
role - the role to checkpublic static boolean isReservedName(java.lang.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()
hashCode in interface java.security.PrincipalhashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in interface java.security.Principalequals in class java.lang.Objectobj - the object to testtrue if both objects are of type Role and have identical namesObject.equals(java.lang.Object)public java.lang.String getName()
getName in interface java.security.Principalpublic java.lang.String toString()
toString in interface java.security.PrincipaltoString in class java.lang.ObjectObject.toString()Copyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.