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 * Represents a value filtering rule for a particular attribute. 21 */ 22 public class AttributeRule { 23 24 /** Unique ID of the attribute this rule applies to. */ 25 private String attributeId; 26 27 /** Filter that permits the release of attribute values. */ 28 private MatchFunctor permitValueRule; 29 30 /** Filter that denies the release of attribute values. */ 31 private MatchFunctor denyValueRule; 32 33 /** 34 * Constructor. 35 * 36 * @param id unique ID of this rule 37 */ 38 public AttributeRule(String id){ 39 attributeId = id; 40 } 41 42 /** 43 * Gets the ID of the attribute to which this rule applies. 44 * 45 * @return ID of the attribute to which this rule applies 46 */ 47 public String getAttributeId(){ 48 return attributeId; 49 } 50 51 /** 52 * Gets the filter that permits the release of attribute values. 53 * 54 * @return filter that permits the release of attribute values 55 */ 56 public MatchFunctor getPermitValueRule(){ 57 return permitValueRule; 58 } 59 60 /** 61 * Sets the filter that permits the release of attribute values. 62 * 63 * @param filter filter that permits the release of attribute values 64 */ 65 public void setPermitValueRule(MatchFunctor filter){ 66 permitValueRule = filter; 67 } 68 69 /** 70 * Gets the filter that denies the release of attribute values. 71 * 72 * @return filter that denies the release of attribute values 73 */ 74 public MatchFunctor getDenyValueRule() { 75 return denyValueRule; 76 } 77 78 /** 79 * Sets the filter that denies the release of attribute values. 80 * 81 * @param filter filter that denies the release of attribute values 82 */ 83 public void setDenyValueRule(MatchFunctor filter) { 84 denyValueRule = filter; 85 } 86 }