Class PassiveClusterStateWriteGuardFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
com.loomcache.springboot.security.PassiveClusterStateWriteGuardFilter
- All Implemented Interfaces:
jakarta.servlet.Filter, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.EnvironmentAware, org.springframework.core.env.EnvironmentCapable, org.springframework.web.context.ServletContextAware
public final class PassiveClusterStateWriteGuardFilter
extends org.springframework.web.filter.OncePerRequestFilter
Rejects mutating REST data operations while the cluster is in PASSIVE read-only mode.
-
Field Summary
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIXFields inherited from class org.springframework.web.filter.GenericFilterBean
logger -
Constructor Summary
ConstructorsConstructorDescriptionPassiveClusterStateWriteGuardFilter(@NonNull Supplier<ClusterState.OperationalState> operationalStateSupplier) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoFilterInternal(@NonNull jakarta.servlet.http.HttpServletRequest request, @NonNull jakarta.servlet.http.HttpServletResponse response, @NonNull jakarta.servlet.FilterChain filterChain) protected booleanshouldNotFilter(@NonNull jakarta.servlet.http.HttpServletRequest request) Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatchMethods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Constructor Details
-
PassiveClusterStateWriteGuardFilter
public PassiveClusterStateWriteGuardFilter(@NonNull Supplier<ClusterState.OperationalState> operationalStateSupplier)
-
-
Method Details
-
shouldNotFilter
protected boolean shouldNotFilter(@NonNull jakarta.servlet.http.HttpServletRequest request) - Overrides:
shouldNotFilterin classorg.springframework.web.filter.OncePerRequestFilter
-
doFilterInternal
protected void doFilterInternal(@NonNull jakarta.servlet.http.HttpServletRequest request, @NonNull jakarta.servlet.http.HttpServletResponse response, @NonNull jakarta.servlet.FilterChain filterChain) throws jakarta.servlet.ServletException, IOException - Specified by:
doFilterInternalin classorg.springframework.web.filter.OncePerRequestFilter- Throws:
jakarta.servlet.ServletExceptionIOException
-