Polish SecurityContextChangedEvent

- Changed methods to getOldContext and getNewContext

Closes gh-10249
This commit is contained in:
Josh Cummings 2021-09-13 16:04:36 -06:00
parent 3e87ef84ae
commit 5da55448f9

View File

@ -26,19 +26,19 @@ import org.springframework.context.ApplicationEvent;
*/ */
public class SecurityContextChangedEvent extends ApplicationEvent { public class SecurityContextChangedEvent extends ApplicationEvent {
private final SecurityContext previous; private final SecurityContext oldContext;
private final SecurityContext current; private final SecurityContext newContext;
/** /**
* Construct an event * Construct an event
* @param previous the old security context * @param oldContext the old security context
* @param current the new security context * @param newContext the new security context
*/ */
public SecurityContextChangedEvent(SecurityContext previous, SecurityContext current) { public SecurityContextChangedEvent(SecurityContext oldContext, SecurityContext newContext) {
super(SecurityContextHolder.class); super(SecurityContextHolder.class);
this.previous = previous; this.oldContext = oldContext;
this.current = current; this.newContext = newContext;
} }
/** /**
@ -46,8 +46,8 @@ public class SecurityContextChangedEvent extends ApplicationEvent {
* immediately previous to this event * immediately previous to this event
* @return the previous {@link SecurityContext} * @return the previous {@link SecurityContext}
*/ */
public SecurityContext getPreviousContext() { public SecurityContext getOldContext() {
return this.previous; return this.oldContext;
} }
/** /**
@ -55,8 +55,8 @@ public class SecurityContextChangedEvent extends ApplicationEvent {
* event * event
* @return the current {@link SecurityContext} * @return the current {@link SecurityContext}
*/ */
public SecurityContext getCurrentContext() { public SecurityContext getNewContext() {
return this.current; return this.newContext;
} }
} }