Class SecurityContextImpl
- java.lang.Object
-
- org.springframework.security.core.context.SecurityContextImpl
-
- All Implemented Interfaces:
java.io.Serializable,SecurityContext
- Direct Known Subclasses:
TransientSecurityContext
public class SecurityContextImpl extends java.lang.Object implements SecurityContext
Base implementation ofSecurityContext.Used by default by
SecurityContextHolderstrategies.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SecurityContextImpl()SecurityContextImpl(Authentication authentication)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)AuthenticationgetAuthentication()Obtains the currently authenticated principal, or an authentication request token.inthashCode()voidsetAuthentication(Authentication authentication)Changes the currently authenticated principal, or removes the authentication information.java.lang.StringtoString()
-
-
-
Constructor Detail
-
SecurityContextImpl
public SecurityContextImpl()
-
SecurityContextImpl
public SecurityContextImpl(Authentication authentication)
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getAuthentication
public Authentication getAuthentication()
Description copied from interface:SecurityContextObtains the currently authenticated principal, or an authentication request token.- Specified by:
getAuthenticationin interfaceSecurityContext- Returns:
- the
Authenticationornullif no authentication information is available
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
setAuthentication
public void setAuthentication(Authentication authentication)
Description copied from interface:SecurityContextChanges the currently authenticated principal, or removes the authentication information.- Specified by:
setAuthenticationin interfaceSecurityContext- Parameters:
authentication- the newAuthenticationtoken, ornullif no further authentication information should be stored
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-