|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.ext.jaas.JaasUtils
public final class JaasUtils
Utility class to facilitate integration between the Restlet and JAAS APIs.
Constructor Summary | |
---|---|
JaasUtils()
|
Method Summary | ||
---|---|---|
static Subject |
createSubject(ClientInfo clientInfo)
Creates a JAAS subject based on a given ClientInfo . |
|
static
|
doAsPriviledged(ClientInfo clientInfo,
PrivilegedAction<T> action)
Creates a JAAS subject on the ClientInfo and uses it to run the
action, using
Subject.doAsPrivileged(Subject, PrivilegedAction, AccessControlContext)
. |
|
static
|
doAsPriviledged(ClientInfo clientInfo,
PrivilegedAction<T> action,
AccessControlContext acc)
Creates a JAAS subject on the ClientInfo and uses it to run the
action, using
Subject.doAsPrivileged(Subject, PrivilegedAction, AccessControlContext)
. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JaasUtils()
Method Detail |
---|
public static Subject createSubject(ClientInfo clientInfo)
ClientInfo
. It adds a
ClientInfo.getUser()
, all the entries in
ClientInfo.getRoles()
and all other principals in
ClientInfo.getPrincipals()
.
clientInfo
- The client info to expose as a subject.
public static <T> T doAsPriviledged(ClientInfo clientInfo, PrivilegedAction<T> action, AccessControlContext acc)
ClientInfo
and uses it to run the
action, using
Subject.doAsPrivileged(Subject, PrivilegedAction, AccessControlContext)
.
T
- the return type of the action.clientInfo
- the client info from which to build a subject.action
- the code to be run as the specified Subject.acc
- the AccessControlContext to be tied to the specified subject
and action.
public static <T> T doAsPriviledged(ClientInfo clientInfo, PrivilegedAction<T> action)
ClientInfo
and uses it to run the
action, using
Subject.doAsPrivileged(Subject, PrivilegedAction, AccessControlContext)
. This uses a null AccessControlContext
.
T
- the return type of the action.clientInfo
- the client info from which to build as a subject.action
- the code to be run as the specified Subject.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |