Class SecurityContextChangedEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.springframework.context.ApplicationEvent
-
- org.springframework.security.core.context.SecurityContextChangedEvent
-
- All Implemented Interfaces:
java.io.Serializable
public class SecurityContextChangedEvent extends org.springframework.context.ApplicationEvent
An event that represents a change inSecurityContext
- Since:
- 5.6
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SecurityContextChangedEvent(SecurityContext previous, SecurityContext current)
Construct an event
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SecurityContext
getCurrentContext()
Get theSecurityContext
set on theSecurityContextHolder
as of this eventSecurityContext
getPreviousContext()
Get theSecurityContext
set on theSecurityContextHolder
immediately previous to this event
-
-
-
Constructor Detail
-
SecurityContextChangedEvent
public SecurityContextChangedEvent(SecurityContext previous, SecurityContext current)
Construct an event- Parameters:
previous
- the old security contextcurrent
- the new security context
-
-
Method Detail
-
getPreviousContext
public SecurityContext getPreviousContext()
Get theSecurityContext
set on theSecurityContextHolder
immediately previous to this event- Returns:
- the previous
SecurityContext
-
getCurrentContext
public SecurityContext getCurrentContext()
Get theSecurityContext
set on theSecurityContextHolder
as of this event- Returns:
- the current
SecurityContext
-
-