1 /* 2 * Copyright 2007 University Corporation for Advanced Internet Development, Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package edu.internet2.middleware.shibboleth.common.attribute.filtering.provider; 18 19 /** 20 * A function that evaluates whether an expressed criteria is met by the current filter context. 21 */ 22 public interface MatchFunctor { 23 24 /** 25 * Evaluates this matching criteria. This evaluation is used while the filtering engine determines policy 26 * applicability. 27 * 28 * @param filterContext current filtering context 29 * 30 * @return true if the criteria for this matching function are meant 31 * 32 * @throws FilterProcessingException thrown if the function can not be evaluated 33 */ 34 public boolean evaluatePolicyRequirement(ShibbolethFilteringContext filterContext) throws FilterProcessingException; 35 36 /** 37 * Evaluates this matching criteria. This evaluation is used while the filtering engine evaluating permit value 38 * rules. 39 * 40 * @param filterContext the current filtering context 41 * @param attributeId ID of the attribute being evaluated 42 * @param attributeValue value of the attribute being evaluated 43 * 44 * @return true if the criteria for this matching function are meant 45 * 46 * @throws FilterProcessingException thrown if the function can not be evaluated 47 */ 48 public boolean evaluatePermitValue(ShibbolethFilteringContext filterContext, String attributeId, 49 Object attributeValue) throws FilterProcessingException; 50 51 /** 52 * Evaluates this matching criteria. This evaluation is used while the filtering engine is evaluating deny value 53 * rules. 54 * 55 * @param filterContext the current filtering context 56 * @param attributeId ID of the attribute being evaluated 57 * @param attributeValue value of the attribute being evaluated 58 * 59 * @return true if the criteria for this matching function are meant 60 * 61 * @throws FilterProcessingException thrown if the function can not be evaluated 62 */ 63 public boolean evaluateDenyRule(ShibbolethFilteringContext filterContext, String attributeId, Object attributeValue) 64 throws FilterProcessingException; 65 }