|
BEA Systems, Inc. | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--weblogic.security.SubjectUtils
This class contains utilities for managing Subjects.
| Constructor Summary | |
SubjectUtils()
|
|
| Method Summary | |
static void |
checkSubjectNonNull(java.lang.Object subject)
Throws an IllegalArgumentException if the Subject is null. |
static java.lang.String |
displaySubject(javax.security.auth.Subject subject)
Gives a detailed display of a Subject. |
static javax.security.auth.Subject |
getAnonymousUser()
Returns an unmodifiable Subject that corresponds to an anonymous user. |
static java.security.Principal |
getOnePrincipal(javax.security.auth.Subject subject,
java.lang.Class type)
Quickly return a single Principal of the specified type or return null. |
static java.lang.String |
getUsername(javax.security.auth.Subject s)
Returns a username for the specified Subject. |
static java.security.Principal |
getUserPrincipal(javax.security.auth.Subject s)
Returns a principal for the specified Subject that represents the current user. |
static boolean |
isUserAnAdministrator(javax.security.auth.Subject subject)
Returns true if the Subject has Administrator privileges. |
static boolean |
isUserAnonymous(javax.security.auth.Subject subject)
Returns true if and only if the user is the anonymous user. |
static boolean |
isUserInGroup(javax.security.auth.Subject s,
java.lang.String group)
Returns true if the Subject is in the specified group. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public SubjectUtils()
| Method Detail |
public static java.security.Principal getUserPrincipal(javax.security.auth.Subject s)
Note: No check is done to see if there are multiple WLSUser Principals in the Subject. The first is simply returned.
s - the Subject to extract the user fromWLSUser,
WLSGrouppublic static java.lang.String getUsername(javax.security.auth.Subject s)
s - the Subject to extract the user name from.public static java.lang.String displaySubject(javax.security.auth.Subject subject)
subject - Subject to display.
public static java.security.Principal getOnePrincipal(javax.security.auth.Subject subject,
java.lang.Class type)
subject - Subject to searchtype - Principal type to search for
public static boolean isUserInGroup(javax.security.auth.Subject s,
java.lang.String group)
s - Subject to determine if the user is in the group.group - name of group to compare.WLSGrouppublic static javax.security.auth.Subject getAnonymousUser()
public static boolean isUserAnonymous(javax.security.auth.Subject subject)
subject - the subject.public static boolean isUserAnAdministrator(javax.security.auth.Subject subject)
subject - subject to test for Administrator privileges.public static void checkSubjectNonNull(java.lang.Object subject)
subject - the subject to check.
|
Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/docs70 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||