From f0d8db5ce62954f499c54279476a36a2d4d6b38b Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Sat, 20 Oct 2007 23:12:41 +0000 Subject: [PATCH] Store the default order values of security filters. --- .../security/ui/FilterChainOrderUtils.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 core/src/main/java/org/springframework/security/ui/FilterChainOrderUtils.java diff --git a/core/src/main/java/org/springframework/security/ui/FilterChainOrderUtils.java b/core/src/main/java/org/springframework/security/ui/FilterChainOrderUtils.java new file mode 100644 index 0000000000..14ffbf8e3d --- /dev/null +++ b/core/src/main/java/org/springframework/security/ui/FilterChainOrderUtils.java @@ -0,0 +1,34 @@ +package org.springframework.security.ui; + +import org.springframework.core.Ordered; + +/** + * Stores the default order numbers of all Spring Security filters for use in configuration. + * + * @author luke + * @version $Id$ + */ +public class FilterChainOrderUtils { + /** + * The first position at which a Spring Security filter will be found. Any filter with an order less than this will + * be guaranteed to be placed before the Spring Security filters in the stack. + */ + public static final int FILTER_CHAIN_FIRST = Ordered.HIGHEST_PRECEDENCE + 1000; + private static final int INTERVAL = 100; + + public static final int CHANNEL_PROCESSING_FILTER_ORDER = FILTER_CHAIN_FIRST + INTERVAL; + public static final int CONCURRENT_SESSION_FILTER_ORDER = FILTER_CHAIN_FIRST + INTERVAL * 2; + public static final int HTTP_SESSION_CONTEXT_FILTER_ORDER = FILTER_CHAIN_FIRST + INTERVAL * 3; + public static final int LOGOUT_FILTER_ORDER = FILTER_CHAIN_FIRST + INTERVAL * 4; + public static final int AUTH_PROCESSING_FILTER_ORDER = FILTER_CHAIN_FIRST + INTERVAL * 5; + public static final int CAS_PROCESSING_FILTER_ORDER = FILTER_CHAIN_FIRST + INTERVAL * 5; + public static final int LOGIN_PAGE_FILTER_ORDER = FILTER_CHAIN_FIRST + INTERVAL * 6; + public static final int BASIC_PROCESSING_FILTER_ORDER = FILTER_CHAIN_FIRST + INTERVAL * 7; + public static final int SECURITY_CONTEXT_HOLDER_AWARE_FILTER_ORDER = FILTER_CHAIN_FIRST + INTERVAL * 8; + public static final int REMEMBER_ME_FILTER_ORDER = FILTER_CHAIN_FIRST + INTERVAL * 9; + public static final int ANON_PROCESSING_FILTER_ORDER = FILTER_CHAIN_FIRST + INTERVAL * 10; + public static final int SWITCH_USER_FILTER_ORDER = FILTER_CHAIN_FIRST + INTERVAL * 11; + public static final int EXCEPTION_TRANSLATION_FILTER_ORDER = FILTER_CHAIN_FIRST + INTERVAL * 12; + public static final int FILTER_SECURITY_INTERCEPTOR_ORDER = FILTER_CHAIN_FIRST + INTERVAL * 13; + +}