Class SecurityContextChangedEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.security.core.context.SecurityContextChangedEvent
- All Implemented Interfaces:
Serializable
public class SecurityContextChangedEvent
extends org.springframework.context.ApplicationEvent
An event that represents a change in
SecurityContext
- Since:
- 5.6
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionSecurityContextChangedEvent
(SecurityContext oldContext, SecurityContext newContext) Construct an event -
Method Summary
Modifier and TypeMethodDescriptionGet theSecurityContext
set on theSecurityContextHolder
as of this eventGet theSecurityContext
set on theSecurityContextHolder
immediately previous to this eventMethods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
SecurityContextChangedEvent
Construct an event- Parameters:
oldContext
- the old security contextnewContext
- the new security context
-
-
Method Details
-
getOldContext
Get theSecurityContext
set on theSecurityContextHolder
immediately previous to this event- Returns:
- the previous
SecurityContext
-
getNewContext
Get theSecurityContext
set on theSecurityContextHolder
as of this event- Returns:
- the current
SecurityContext
-