Browse Source

Polish SecurityContextChangedEvent

- Changed methods to getOldContext and getNewContext

Closes gh-10249
pull/9483/head
Josh Cummings 5 years ago
parent
commit
5da55448f9
  1. 22
      core/src/main/java/org/springframework/security/core/context/SecurityContextChangedEvent.java

22
core/src/main/java/org/springframework/security/core/context/SecurityContextChangedEvent.java

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

Loading…
Cancel
Save