Package org.jboss.security.plugins
Class JBossSecurityContextUtil
- java.lang.Object
-
- org.jboss.security.SecurityContextUtil
-
- org.jboss.security.plugins.JBossSecurityContextUtil
-
public class JBossSecurityContextUtil extends SecurityContextUtil
Utility class for JBossSecurityContext implementation- Since:
- Jan 5, 2007
- Version:
- $Revision$
- Author:
- Anil Saldhana
-
-
Field Summary
-
Fields inherited from class org.jboss.security.SecurityContextUtil
securityContext
-
-
Constructor Summary
Constructors Constructor Description JBossSecurityContextUtil(SecurityContext sc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tget(String key)Return an object from the Security ContextObjectgetCredential()Get the credentialRoleGroupgetRoles()Get the Roles associated with the user for the current security contextSecurityIdentitygetSecurityIdentity()Get a holder of subject, runAs and caller RunAsSubjectgetSubject()Get the subject the security contextStringgetUserName()Get the username from the security contextPrincipalgetUserPrincipal()Get the user principal the security context<T> Tremove(String key)Remove an object represented by the key from the security context<T> voidset(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)voidsetRoles(RoleGroup roles)Set the roles for the user for the current security contextvoidsetSecurityIdentity(SecurityIdentity sidentity)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-
Methods inherited from class org.jboss.security.SecurityContextUtil
addIdentity, clearIdentities, createSubjectInfo, createSubjectInfo, getIdentities, setIdentities, setSecurityContext
-
-
-
-
Constructor Detail
-
JBossSecurityContextUtil
public JBossSecurityContextUtil(SecurityContext sc)
-
-
Method Detail
-
get
public <T> T get(String key)
Description copied from class:SecurityContextUtilReturn an object from the Security Context- Specified by:
getin classSecurityContextUtil- Parameters:
key- key identifies the type of object we are requesting- Returns:
-
getUserName
public String getUserName()
Description copied from class:SecurityContextUtilGet the username from the security context- Specified by:
getUserNamein classSecurityContextUtil- Returns:
- username
-
getUserPrincipal
public Principal getUserPrincipal()
Description copied from class:SecurityContextUtilGet the user principal the security context- Specified by:
getUserPrincipalin classSecurityContextUtil- Returns:
- user principal
-
getCredential
public Object getCredential()
Description copied from class:SecurityContextUtilGet the credential- Specified by:
getCredentialin classSecurityContextUtil- Returns:
-
getSubject
public Subject getSubject()
Description copied from class:SecurityContextUtilGet the subject the security context- Specified by:
getSubjectin classSecurityContextUtil- Returns:
-
set
public <T> void set(String key, T obj)
Description copied from class:SecurityContextUtilSet an object on the Security Context The context implementation may place the object in its internal data structures (like the Data Map)- Specified by:
setin classSecurityContextUtil- Type Parameters:
T- Generic Type- Parameters:
key- Key representing the object being set
-
remove
public <T> T remove(String key)
Description copied from class:SecurityContextUtilRemove an object represented by the key from the security context- Specified by:
removein classSecurityContextUtil- Parameters:
key- key identifies the type of object we are requesting- Returns:
- the removed object
-
setRoles
public void setRoles(RoleGroup roles)
Description copied from class:SecurityContextUtilSet the roles for the user for the current security context- Specified by:
setRolesin classSecurityContextUtil
-
setSecurityIdentity
public void setSecurityIdentity(SecurityIdentity sidentity)
Description copied from class:SecurityContextUtilInject 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- Specified by:
setSecurityIdentityin classSecurityContextUtil- Parameters:
sidentity- The SecurityIdentity Object
-
getSecurityIdentity
public SecurityIdentity getSecurityIdentity()
Description copied from class:SecurityContextUtilGet a holder of subject, runAs and caller RunAs- Specified by:
getSecurityIdentityin classSecurityContextUtil- Returns:
-
getRoles
public RoleGroup getRoles()
Description copied from class:SecurityContextUtilGet the Roles associated with the user for the current security context- Specified by:
getRolesin classSecurityContextUtil- Returns:
-
-