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