Package org.jboss.security.plugins
Class JBossSecurityContext
- java.lang.Object
-
- org.jboss.security.plugins.JBossSecurityContext
-
- All Implemented Interfaces:
Serializable,Cloneable,SecurityContext,SecurityManagerLocator
public class JBossSecurityContext extends Object implements SecurityContext, SecurityManagerLocator
Implementation of the Security Context for the JBoss AS- Since:
- Aug 30, 2006
- Version:
- $Revision$
- Author:
- Anil Saldhana
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected CallbackHandlercallbackHandlerprotected Map<String,Object>contextDataprotected RunAsincomingRunAsprotected ISecurityManagementiSecurityManagementprotected static org.jboss.logging.Loggerlogprotected RunAsoutgoingRunAsprotected StringsecurityDomainprotected SubjectInfosubjectInfoprotected booleantraceprotected SecurityContextUtilutil
-
Constructor Summary
Constructors Constructor Description JBossSecurityContext(String securityDomain)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()AuditManagergetAuditManager()AuthenticationManagergetAuthenticationManager()AuthorizationManagergetAuthorizationManager()Map<String,Object>getData()Context MapIdentityTrustManagergetIdentityTrustManager()RunAsgetIncomingRunAs()RunAs that is being propagated into this context by an external contextSecurityContext.setIncomingRunAs(RunAs)MappingManagergetMappingManager()RunAsgetOutgoingRunAs()RunAs RepresentationSecurityContext.setOutgoingRunAs(RunAs)StringgetSecurityDomain()Get the security domain nameISecurityManagementgetSecurityManagement()Get the SecurityManagement object to get hold of the various managersSubjectInfogetSubjectInfo()Subject InfoSecurityContextUtilgetUtil()Return a utility that is a facade to the internal storage mechanism of the Security Context This utility can be used to store information like roles etc in an implementation specific wayvoidsetCallbackHandler(CallbackHandler callbackHandler)Set the CallbackHandler for the Managers in the SecurityContextvoidsetIncomingRunAs(RunAs runAs)Set the RunAs that is propagating into this context.voidsetOutgoingRunAs(RunAs runAs)Set the current RunAs for the security context that will be propagated out to other security context.voidsetRoles(Group roles, boolean replace)voidsetSecurityDomain(String securityDomain)Sets the security domain.voidsetSecurityManagement(ISecurityManagement securityManagement)Set the SecurityManagement holdervoidsetSubjectInfo(SubjectInfo si)Subject InfoStringtoString()
-
-
-
Field Detail
-
log
protected static final org.jboss.logging.Logger log
-
trace
protected boolean trace
-
securityDomain
protected String securityDomain
-
subjectInfo
protected SubjectInfo subjectInfo
-
incomingRunAs
protected RunAs incomingRunAs
-
outgoingRunAs
protected RunAs outgoingRunAs
-
iSecurityManagement
protected ISecurityManagement iSecurityManagement
-
callbackHandler
protected transient CallbackHandler callbackHandler
-
util
protected transient SecurityContextUtil util
-
-
Constructor Detail
-
JBossSecurityContext
public JBossSecurityContext(String securityDomain)
-
-
Method Detail
-
getSecurityManagement
public ISecurityManagement getSecurityManagement()
Description copied from interface:SecurityContextGet the SecurityManagement object to get hold of the various managers- Specified by:
getSecurityManagementin interfaceSecurityContext- Returns:
- Throws:
SecurityException- Under a security manager, caller does not have RuntimePermission("org.jboss.security.plugins.JBossSecurityContext.getSecurityManagement")- See Also:
SecurityContext.getSecurityManagement()
-
setSecurityManagement
public void setSecurityManagement(ISecurityManagement securityManagement)
Description copied from interface:SecurityContextSet the SecurityManagement holder- Specified by:
setSecurityManagementin interfaceSecurityContext- Throws:
SecurityException- Under a security manager, caller does not have RuntimePermission("org.jboss.security.plugins.JBossSecurityContext.setSecurityManagement")- See Also:
SecurityContext.setSecurityManagement(ISecurityManagement)
-
getData
public Map<String,Object> getData()
Description copied from interface:SecurityContextContext Map- Specified by:
getDatain interfaceSecurityContext- Throws:
SecurityException- Under a security manager, caller does not have RuntimePermission("org.jboss.security.plugins.JBossSecurityContext.getData")- See Also:
SecurityContext.getData()
-
getSecurityDomain
public String getSecurityDomain()
Get the security domain name- Specified by:
getSecurityDomainin interfaceSecurityContext
-
setSecurityDomain
public void setSecurityDomain(String securityDomain)
Description copied from interface:SecurityContextSets the security domain.
- Specified by:
setSecurityDomainin interfaceSecurityContext- Parameters:
securityDomain- aStringrepresenting the security domain.
-
getSubjectInfo
public SubjectInfo getSubjectInfo()
Description copied from interface:SecurityContextSubject Info- Specified by:
getSubjectInfoin interfaceSecurityContext- Throws:
SecurityException- Under a security manager, caller does not have RuntimePermission("org.jboss.security.plugins.JBossSecurityContext.getSubjectInfo")- See Also:
SecurityContext.getSubjectInfo()
-
getIncomingRunAs
public RunAs getIncomingRunAs()
Description copied from interface:SecurityContextRunAs that is being propagated into this context by an external contextSecurityContext.setIncomingRunAs(RunAs)- Specified by:
getIncomingRunAsin interfaceSecurityContext- See Also:
SecurityContext.getOutgoingRunAs()
-
setIncomingRunAs
public void setIncomingRunAs(RunAs runAs)
Description copied from interface:SecurityContextSet the RunAs that is propagating into this context.- Specified by:
setIncomingRunAsin interfaceSecurityContext- Parameters:
runAs- The RunAs- Throws:
SecurityException- Under a security manager, caller does not have RuntimePermission("org.jboss.security.plugins.JBossSecurityContext.setRunAsPermission")- See Also:
SecurityContext.setOutgoingRunAs(RunAs)
-
getOutgoingRunAs
public RunAs getOutgoingRunAs()
Description copied from interface:SecurityContextRunAs RepresentationSecurityContext.setOutgoingRunAs(RunAs)- Specified by:
getOutgoingRunAsin interfaceSecurityContext- See Also:
SecurityContext.getOutgoingRunAs()
-
setOutgoingRunAs
public void setOutgoingRunAs(RunAs runAs)
Description copied from interface:SecurityContextSet the current RunAs for the security context that will be propagated out to other security context. RunAs coming into this security context needs to be done from SecurityContextUtil.getCallerRunAs/setCallerRunAs- Specified by:
setOutgoingRunAsin interfaceSecurityContext- Throws:
SecurityException- Under a security manager, caller does not have RuntimePermission("org.jboss.security.plugins.JBossSecurityContext.setRunAsPermission")- See Also:
SecurityContext.setOutgoingRunAs(RunAs)
-
getUtil
public SecurityContextUtil getUtil()
Description copied from interface:SecurityContextReturn a utility that is a facade to the internal storage mechanism of the Security Context This utility can be used to store information like roles etc in an implementation specific way- Specified by:
getUtilin interfaceSecurityContext- Returns:
- See Also:
SecurityContext.getUtil()
-
getAuditManager
public AuditManager getAuditManager()
- Specified by:
getAuditManagerin interfaceSecurityManagerLocator
-
getAuthenticationManager
public AuthenticationManager getAuthenticationManager()
- Specified by:
getAuthenticationManagerin interfaceSecurityManagerLocator
-
getAuthorizationManager
public AuthorizationManager getAuthorizationManager()
- Specified by:
getAuthorizationManagerin interfaceSecurityManagerLocator
-
getIdentityTrustManager
public IdentityTrustManager getIdentityTrustManager()
- Specified by:
getIdentityTrustManagerin interfaceSecurityManagerLocator
-
getMappingManager
public MappingManager getMappingManager()
- Specified by:
getMappingManagerin interfaceSecurityManagerLocator
-
setSubjectInfo
public void setSubjectInfo(SubjectInfo si)
Description copied from interface:SecurityContextSubject Info- Specified by:
setSubjectInfoin interfaceSecurityContext- Throws:
SecurityException- Under a security manager, caller does not have RuntimePermission("org.jboss.security.plugins.JBossSecurityContext.setSubjectInfo")- See Also:
SecurityContextUtil.getSubject(),SecurityContextUtil.createSubjectInfo(java.security.Principal, Object, javax.security.auth.Subject)
-
setRoles
public void setRoles(Group roles, boolean replace)
- Parameters:
roles-replace-- Throws:
SecurityException- Under a security manager, caller does not have RuntimePermission("org.jboss.security.plugins.JBossSecurityContext.setRolesPermission")
-
setCallbackHandler
public void setCallbackHandler(CallbackHandler callbackHandler)
Set the CallbackHandler for the Managers in the SecurityContext- Parameters:
callbackHandler-
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
-