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 import java.util.ArrayList; 21 import java.util.List; 22 23 /** 24 * A policy describing if a set of attribute value filters is applicable. 25 */ 26 public class AttributeFilterPolicy { 27 28 /** Unique identifier for this policy. */ 29 private String policyId; 30 31 /** Requirement that must be met for this policy to apply. */ 32 private MatchFunctor policyRequirementRule; 33 34 /** Filters to be used on attribute values. */ 35 private List<AttributeRule> attributeRules; 36 37 /** 38 * Constructor. 39 * 40 * @param id unique ID for the policy 41 */ 42 public AttributeFilterPolicy(String id) { 43 policyId = id; 44 attributeRules = new ArrayList<AttributeRule>(); 45 } 46 47 /** 48 * Gets the unique ID for this policy. 49 * 50 * @return unique ID for this policy 51 */ 52 public String getPolicyId(){ 53 return policyId; 54 } 55 56 /** 57 * Gets the requirement for this policy. 58 * 59 * @return requirement for this policy 60 */ 61 public MatchFunctor getPolicyRequirementRule() { 62 return policyRequirementRule; 63 } 64 65 /** 66 * Sets the requirement for this policy. 67 * 68 * @param requirement requirement for this policy 69 */ 70 public void setPolicyRequirementRule(MatchFunctor requirement) { 71 policyRequirementRule = requirement; 72 } 73 74 /** 75 * Gets the attribute rules that are in effect if this policy is in effect. 76 * 77 * @return attribute rules that are in effect if this policy is in effect, never null 78 */ 79 public List<AttributeRule> getAttributeRules(){ 80 return attributeRules; 81 } 82 }