[java-identity-provider COMMIT] in /trunk: idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter...

noreply at shibboleth.net noreply at shibboleth.net
Wed Jul 10 12:06:06 EDT 2013


Author: rdw
Date: Wed Jul 10 12:06:06 2013
New Revision: 4553

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4553&view=rev
Log:
IDP-287 Per review feedback, modify the AttributeRule to take a single matcher and a boolean to say if it is a deny or a permit rule.

Modified:
    trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/AttributeRule.java
    trunk/idp-attribute-filter-api/src/test/java/net/shibboleth/idp/attribute/filter/AttributeFilterPolicyTest.java
    trunk/idp-attribute-filter-api/src/test/java/net/shibboleth/idp/attribute/filter/AttributeFilteringEngineTest.java
    trunk/idp-attribute-filter-api/src/test/java/net/shibboleth/idp/attribute/filter/AttributeRuleTest.java
    trunk/idp-attribute-filter-api/src/test/java/net/shibboleth/idp/attribute/filter/AttributeValueFilterPolicyTest.java
    trunk/idp-attribute-filter-api/src/test/java/net/shibboleth/idp/attribute/filter/PolicyFromMatcherIdTest.java
    trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/impl/complex/TargettedAttributeValueFilterTest.java
    trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/impl/complex/UntargettedAttributeValueFilterTest.java
    trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/impl/policyrule/logic/NotPolicyRuleTest.java
    trunk/idp-attribute-filter-spring/src/main/java/net/shibboleth/idp/attribute/filter/spring/AttributeRuleParser.java

Modified: trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/AttributeRule.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/AttributeRule.java?rev=4553&r1=4552&r2=4553&view=diff
==============================================================================
--- trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/AttributeRule.java (original)
+++ trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/AttributeRule.java Wed Jul 10 12:06:06 2013
@@ -69,12 +69,12 @@
     /**
      * Filter that permits the release of attribute values.
      */
-    private Matcher permitValueRule;
+    private Matcher matcher;
 
     /**
      * Filter that denies the release of attribute values.
      */
-    private Matcher denyValueRule;
+    private boolean isDenyRule = true;
 
     /** {@inheritDoc} */
     public synchronized void setId(@Nonnull @NotEmpty final String componentId) {
@@ -106,55 +106,54 @@
     }
 
     /**
-     * Gets the matcher used to determine permitted attribute values filtered by this rule.
-     * 
-     * @return matcher used to determine permitted attribute values filtered by this rule
-     */
-    @Nullable public Matcher getPermitRule() {
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
-        return permitValueRule;
+     * Gets the matcher used to determine the attribute values filtered by this rule.
+     * 
+     * @return matcher used to determine the attribute values filtered by this rule
+     */
+    @Nullable public Matcher getMatcher() {
+        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        return matcher;
     }
 
     /**
      * Sets the rule used to determine permitted attribute values filtered by this rule.
      * 
-     * @param matcher matcher used to determine permitted attribute values filtered by this rule
-     */
-    public synchronized void setPermitRule(@Nonnull Matcher matcher) {
+     * @param theMatcher matcher used to determine permitted attribute values filtered by this rule
+     */
+    public synchronized void setMatcher(@Nonnull Matcher theMatcher) {
         ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
         ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
 
-        permitValueRule = Constraint.isNotNull(matcher, "Permit Rule can not be null");
-    }
-
-    /**
-     * Gets the matcher used to determine denied attribute values filtered by this rule.
-     * 
-     * @return matcher used to determine denied attribute values filtered by this rule
-     */
-    @Nullable public Matcher getDenyRule() {
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
-        return denyValueRule;
+        matcher = Constraint.isNotNull(theMatcher, "Rule can not be null");
+    }
+
+    /**
+     * Gets whether the rule is a deny rule or not.
+     * 
+     * @return whether the rule is a deny rule or not.
+     */
+    public boolean getIsDenyRule() {
+        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        return isDenyRule;
     }
 
     /**
      * Sets the rule used to determine denied attribute values filtered by this rule.
      * 
-     * @param matcher matcher used to determine denied attribute values filtered by this rule
-     */
-    public synchronized void setDenyRule(@Nonnull Matcher matcher) {
+     * @param isDeny - whether the rule is deny or not.
+     */

[... 519 lines stripped ...]


More information about the commits mailing list