@Service(value="blStaleStateProtectionService") public class StaleStateProtectionServiceImpl extends Object implements StaleStateProtectionService
StaleStateProtectionService| Modifier and Type | Field and Description | 
|---|---|
| protected boolean | staleStateProtectionEnabled | 
| static String | STATECHANGENOTIFICATIONTOKEN | 
| static String | STATEVERSIONTOKEN | 
| static String | STATEVERSIONTOKENPARAMETER | 
| Constructor and Description | 
|---|
| StaleStateProtectionServiceImpl() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | compareToken(String passedToken)Compare the state version token provided by the request to what is resident in the user session. | 
| String | getStateVersionToken()Retrieve the state version token resident in the user's session, or create one if it doesn't exist. | 
| String | getStateVersionTokenParameter()Retrieve the parameter key used to harvest the state version token value from the request | 
| void | invalidateState()Remove the current state version token in the user's session, if exists. | 
| void | invalidateState(boolean notify)Remove the current state version token in the user's session, if exists. | 
| boolean | isEnabled()Whether or not the protection provided by this service is active. | 
| boolean | sendRedirectOnStateChange(javax.servlet.http.HttpServletResponse response,
                         String... stateChangeParams)Utility method to send a redirect for the current url with state change params cleared. | 
public static final String STATEVERSIONTOKEN
public static final String STATECHANGENOTIFICATIONTOKEN
public static final String STATEVERSIONTOKENPARAMETER
@Value(value="${stale.state.protection.enabled:false}")
protected boolean staleStateProtectionEnabled
public void compareToken(String passedToken)
StaleStateProtectionServiceStaleStateServiceException
 is emitted.compareToken in interface StaleStateProtectionServicepassedToken - the state version token from the requestpublic String getStateVersionToken()
StaleStateProtectionServicegetStateVersionToken in interface StaleStateProtectionServicepublic void invalidateState()
StaleStateProtectionServiceinvalidateState in interface StaleStateProtectionServicepublic void invalidateState(boolean notify)
StaleStateProtectionServiceinvalidateState in interface StaleStateProtectionServicenotify - Whether or not the request should be notified that state was invalidated. See StaleStateProtectionService.sendRedirectOnStateChange(HttpServletResponse, String...).public boolean sendRedirectOnStateChange(javax.servlet.http.HttpServletResponse response,
                                         String... stateChangeParams)
                                  throws IOException
StaleStateProtectionServicesendRedirectOnStateChange in interface StaleStateProtectionServiceresponse - the current http responsestateChangeParams - any request parameter names being used by the system to drive state changeStaleStateProtectionService.invalidateState()IOExceptionpublic boolean isEnabled()
StaleStateProtectionServiceisEnabled in interface StaleStateProtectionServicepublic String getStateVersionTokenParameter()
StaleStateProtectionServicegetStateVersionTokenParameter in interface StaleStateProtectionServiceCopyright © 2020. All rights reserved.