public class SubjectHelper extends Object
Subject helper.
| Constructor and Description |
|---|
SubjectHelper() |
| Modifier and Type | Method and Description |
|---|---|
static Principal |
getBestPrincipal(Principal[] principals,
Class<? extends Principal> classe)
Returns the first matching principal of a given type.
|
static Principal |
getBestPrincipal(Subject subject,
Class<? extends Principal> classe)
Given a subject, finds the first principal of the given classe for that subject.
|
static Principal |
getPrincipal(Subject subject,
Class<? extends Principal> classe)
Given a subject, finds the first principal of the given classe for that subject.
|
static Principal |
getPrincipal(Subject subject,
Class<? extends Principal> classe,
String name)
Given a subject, finds a specific principal by name of the given classe for that subject.
|
static List<Principal> |
getPrincipals(Subject subject,
Class<? extends Principal> classe)
Given a subject, finds all principals of the given classe for that subject.
|
static List<JetspeedPrincipal> |
getPrincipals(Subject subject,
String jptName)
Given a subject, finds all principals of the given JetspeedPrincipalType(JPT) for that subject.
|
static UserCredential |
getUserCredential(Subject subject)
Given a subject, find the (first) UserCredential from the private credentials
|
public static Principal getPrincipal(Subject subject, Class<? extends Principal> classe)
Given a subject, finds the first principal of the given classe for that subject. If a principal of the given classe is not found, null is returned.
subject - The subject supplying the principals.classe - A class or interface derived from java.security.InternalPrincipal.public static Principal getBestPrincipal(Subject subject, Class<? extends Principal> classe)
Given a subject, finds the first principal of the given classe for that subject. If a principal of the given classe is not found, then the first other principal is returned. If the list is empty, null is returned.
subject - The subject supplying the principals.classe - A class or interface derived from java.security.InternalPrincipal.public static Principal getBestPrincipal(Principal[] principals, Class<? extends Principal> classe)
Returns the first matching principal of a given type.
principals - The array of pricinpalsclasse - The class of Principalpublic static List<Principal> getPrincipals(Subject subject, Class<? extends Principal> classe)
Given a subject, finds all principals of the given classe for that subject. If no principals of the given class is not found, null is returned.
subject - The subject supplying the principals.classe - A class or interface derived from java.security.InternalPrincipal.public static List<JetspeedPrincipal> getPrincipals(Subject subject, String jptName)
Given a subject, finds all principals of the given JetspeedPrincipalType(JPT) for that subject. If no principals of the given class is not found, null is returned.
subject - The subject supplying the principals.jptName - the name of the Jetspeed Principal Typepublic static Principal getPrincipal(Subject subject, Class<? extends Principal> classe, String name)
Given a subject, finds a specific principal by name of the given classe for that subject.
subject - The subject supplying the principals.classe - A class or interface derived from java.security.InternalPrincipal.name - the name of the principal to look forpublic static UserCredential getUserCredential(Subject subject)
Given a subject, find the (first) UserCredential from the private credentials
subject - The subjectCopyright © 1999–2015 The Apache Software Foundation. All rights reserved.