public abstract class SecurityContextUtil extends Object
Modifier and Type | Field and Description |
---|---|
protected SecurityContext |
securityContext |
Constructor and Description |
---|
SecurityContextUtil() |
Modifier and Type | Method and Description |
---|---|
void |
addIdentity(Identity id)
Add an Identity to the Security Context
|
void |
clearIdentities(Class<?> clazz)
Clear Identities of a particular type
|
void |
createSubjectInfo(Identity identity,
Subject theSubject)
Create a SubjectInfo
|
void |
createSubjectInfo(Principal principal,
Object credential,
Subject subject)
Create SubjectInfo and set it in the current security context
|
abstract <T> T |
get(String key)
Return an object from the Security Context
|
abstract Object |
getCredential()
Get the credential
|
Set<Identity> |
getIdentities(Class<?> clazz)
Get a set of identities of a particular type
|
abstract RoleGroup |
getRoles()
Get the Roles associated with the user for the
current security context
|
abstract SecurityIdentity |
getSecurityIdentity()
Get a holder of subject, runAs and caller RunAs
|
abstract Subject |
getSubject()
Get the subject the security context
|
abstract String |
getUserName()
Get the username from the security context
|
abstract Principal |
getUserPrincipal()
Get the user principal the security context
|
abstract <T> T |
remove(String key)
Remove an object represented by the key from the security context
|
abstract <T> void |
set(String key,
T obj)
Set an object on the Security Context
The context implementation may place the object in its internal
data structures (like the Data Map)
|
void |
setIdentities(Set<Identity> idSet)
Set the Identities into the Security Context
|
abstract void |
setRoles(RoleGroup roles)
Set the roles for the user for the current security context
|
void |
setSecurityContext(SecurityContext sc) |
abstract void |
setSecurityIdentity(SecurityIdentity si)
Inject subject, runAs and callerRunAs into the security context
Mainly used by integration code base to cache the security identity
and put back to the security context
|
protected SecurityContext securityContext
public void setSecurityContext(SecurityContext sc)
public abstract String getUserName()
public abstract Principal getUserPrincipal()
public abstract Object getCredential()
public abstract Subject getSubject()
public abstract SecurityIdentity getSecurityIdentity()
public abstract void setSecurityIdentity(SecurityIdentity si)
si
- The SecurityIdentity Objectpublic abstract RoleGroup getRoles()
public abstract void setRoles(RoleGroup roles)
roles
- public void createSubjectInfo(Principal principal, Object credential, Subject subject)
principal
- credential
- subject
- public void createSubjectInfo(Identity identity, Subject theSubject)
identity
- theSubject
- The AuthenticatedSubject(can be null)public void addIdentity(Identity id)
id
- public void clearIdentities(Class<?> clazz)
clazz
- public Set<Identity> getIdentities(Class<?> clazz)
clazz
- public void setIdentities(Set<Identity> idSet)
idSet
- public abstract <T> void set(String key, T obj)
T
- Generic Typekey
- Key representing the object being setobj
- public abstract <T> T get(String key)
T
- key
- key identifies the type of object we are requestingpublic abstract <T> T remove(String key)
T
- key
- key identifies the type of object we are requestingCopyright © 2019 JBoss by Red Hat. All rights reserved.