1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package edu.internet2.middleware.shibboleth.common.attribute.filtering.provider.match.basic;
19
20 import java.util.List;
21
22 import edu.internet2.middleware.shibboleth.common.attribute.filtering.provider.FilterProcessingException;
23 import edu.internet2.middleware.shibboleth.common.attribute.filtering.provider.MatchFunctor;
24 import edu.internet2.middleware.shibboleth.common.attribute.filtering.provider.ShibbolethFilteringContext;
25
26
27
28
29 public class OrMatchFunctor extends AbstractMatchFunctor {
30
31
32 private List<MatchFunctor> targetRules;
33
34
35
36
37
38
39 public OrMatchFunctor(List<MatchFunctor> rules){
40 targetRules = rules;
41 }
42
43
44
45
46
47
48 public List<MatchFunctor> getTargetRules() {
49 return targetRules;
50 }
51
52
53 protected boolean doEvaluatePolicyRequirement(ShibbolethFilteringContext filterContext)
54 throws FilterProcessingException {
55
56 if (targetRules == null) {
57
58
59
60 return false;
61 }
62
63 for (MatchFunctor child : targetRules) {
64 if (child.evaluatePolicyRequirement(filterContext)) {
65 return true;
66 }
67 }
68
69 return false;
70 }
71
72
73 protected boolean doEvaluateValue(ShibbolethFilteringContext filterContext, String attributeId,
74 Object attributeValue) throws FilterProcessingException {
75 if (targetRules == null) {
76 return false;
77 }
78
79 for (MatchFunctor child : targetRules) {
80 if (child.evaluatePermitValue(filterContext, attributeId, attributeValue)) {
81 return true;
82 }
83 }
84
85 return false;
86 }
87 }