1 package com.atlassian.plugin.servlet.filter;
2
3 import javax.servlet.DispatcherType;
4
5
6
7
8
9
10
11
12 @Deprecated
13 public enum FilterDispatcherCondition {
14 REQUEST(DispatcherType.REQUEST),
15 INCLUDE(DispatcherType.INCLUDE),
16 FORWARD(DispatcherType.FORWARD),
17 ERROR(DispatcherType.ERROR),
18
19
20
21 ASYNC(DispatcherType.ASYNC);
22
23 private final DispatcherType dispatcherType;
24
25 FilterDispatcherCondition(DispatcherType dispatcherType) {
26 this.dispatcherType = dispatcherType;
27 }
28
29
30
31
32
33
34
35 public static boolean contains(String dispatcher) {
36 for (FilterDispatcherCondition cond : values()) {
37 if (cond.toString().equals(dispatcher)) {
38 return true;
39 }
40 }
41 return false;
42 }
43
44
45
46
47 public DispatcherType toDispatcherType() {
48 return dispatcherType;
49 }
50
51
52
53
54 public static FilterDispatcherCondition fromDispatcherType(DispatcherType dispatcherType) {
55 for (FilterDispatcherCondition cond : values()) {
56 if (cond.toDispatcherType().equals(dispatcherType)) {
57 return cond;
58 }
59 }
60 return null;
61 }
62 }