public class AccessAuditContext extends Object
Modifier and Type | Method and Description |
---|---|
static AccessAuditContext |
currentAccessAuditContext()
Deprecated.
Internal use, will be changed without warning at any time.
|
static <T> T |
doAs(Subject subject,
PrivilegedAction<T> action)
Perform work with a new
AccessAuditContext as a particular Subject |
static <T> T |
doAs(Subject subject,
PrivilegedExceptionAction<T> action)
Perform work with a new
AccessAuditContext as a particular Subject |
AccessMechanism |
getAccessMechanism()
Gets the mechanism via which the user initiated the access.
|
String |
getDomainUuid()
Gets the unique identifier for a multi-domain-process operation.
|
boolean |
isDomainRollout()
Gets whether this context relates to a secondary request initiated by a remote Host Controller
process as part of its rollout of an operation initiated on that process.
|
void |
setAccessMechanism(AccessMechanism accessMechanism) |
void |
setDomainRollout(boolean domainRollout) |
void |
setDomainUuid(String domainUuid) |
public String getDomainUuid()
null
if this context does not relate to a multi-domain-process operationpublic void setDomainUuid(String domainUuid)
public AccessMechanism getAccessMechanism()
null
if the access was initiated internallypublic void setAccessMechanism(AccessMechanism accessMechanism)
public boolean isDomainRollout()
true
if this context relates to a remotely coordinated multi-process domain operationpublic void setDomainRollout(boolean domainRollout)
@Deprecated public static AccessAuditContext currentAccessAuditContext()
AccessAuditContext
or null
if none currently set.AccessAuditContext
public static <T> T doAs(Subject subject, PrivilegedAction<T> action)
AccessAuditContext
as a particular Subject
T
- the type of teh return valuesubject
- the Subject
that the specified action
will run as. May be null
action
- the work to perform. Cannot be null
run
methodNullPointerException
- if the specified
PrivilegedExceptionAction
is
null
.SecurityException
- if the caller does not have permission
to invoke this method.public static <T> T doAs(Subject subject, PrivilegedExceptionAction<T> action) throws PrivilegedActionException
AccessAuditContext
as a particular Subject
T
- the type of teh return valuesubject
- the Subject
that the specified action
will run as. May be null
action
- the work to perform. Cannot be null
run
methodPrivilegedActionException
- if the
PrivilegedExceptionAction.run
method throws a checked exception.NullPointerException
- if the specified
PrivilegedExceptionAction
is
null
.SecurityException
- if the caller does not have permission
to invoke this method.Copyright © 2023 JBoss by Red Hat. All rights reserved.