[java-opensaml] branch master updated: OSJ-318 - Deprecate terms from classes and configuration

Scott Cantor cantor.2 at osu.edu
Tue Jun 9 19:51:16 UTC 2020


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository java-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=f0bd5cfb033bc4d45cb13a28c358c3047703d07a

The following commit(s) were added to refs/heads/master by this push:
       new  f0bd5cfb0 OSJ-318 - Deprecate terms from classes and configuration
f0bd5cfb0 is described below

commit f0bd5cfb033bc4d45cb13a28c358c3047703d07a
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Jun 9 15:51:14 2020 -0400

    OSJ-318 - Deprecate terms from classes and configuration
    
    https://issues.shibboleth.net/jira/browse/OSJ-318
    
    Clean up EntityRoleFilter API.
---
 .../resolver/filter/impl/EntityRoleFilter.java     | 26 +++++++++++++++-------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/filter/impl/EntityRoleFilter.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/filter/impl/EntityRoleFilter.java
index 229375e4e..08c2b2adf 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/filter/impl/EntityRoleFilter.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/filter/impl/EntityRoleFilter.java
@@ -61,7 +61,7 @@ public class EntityRoleFilter implements MetadataFilter {
     @Nonnull private final Logger log = LoggerFactory.getLogger(EntityRoleFilter.class);
 
     /** List of roles that are NOT removed by this filter. */
-    @Nonnull @NonnullElements private List<QName> roleWhiteList;
+    @Nonnull @NonnullElements private List<QName> retainedRoles;
 
     /** Whether to keep entity descriptors that contain no roles; default value: true. */
     private boolean removeRolelessEntityDescriptors;
@@ -77,13 +77,12 @@ public class EntityRoleFilter implements MetadataFilter {
      * 
      * @param keptRoles list of roles NOT removed by this filter
      */
-    public EntityRoleFilter(@Nullable @ParameterName(name="keptRoles") final List<QName> keptRoles) {
-        roleWhiteList = new ArrayList<>();
-
+    public EntityRoleFilter(@Nullable @NonnullElements @ParameterName(name="keptRoles") final List<QName> keptRoles) {
         if (keptRoles != null) {
-            roleWhiteList.addAll(keptRoles);
+            retainedRoles = List.copyOf(keptRoles);
+        } else {
+            retainedRoles = Collections.emptyList();
         }
-        roleWhiteList = Collections.unmodifiableList(roleWhiteList);
 
         removeRolelessEntityDescriptors = true;
         removeEmptyEntitiesDescriptors = true;
@@ -95,9 +94,20 @@ public class EntityRoleFilter implements MetadataFilter {
      * Get the unmodifiable list of roles that are NOT removed by this filter.
      * 
      * @return unmodifiable list of roles that are NOT removed by this filter
+     * @deprecated
      */
+    @Deprecated(forRemoval=true, since="4.1.0")
     @Nonnull @NonnullElements @Unmodifiable @NotLive public List<QName> getRoleWhiteList() {
-        return roleWhiteList;
+        return getRetainedRoles();
+    }
+
+    /**
+     * Get the unmodifiable list of roles that are NOT removed by this filter.
+     * 
+     * @return unmodifiable list of roles that are NOT removed by this filter
+     */
+    @Nonnull @NonnullElements @Unmodifiable @NotLive public List<QName> getRetainedRoles() {
+        return retainedRoles;
     }
 
     /**
@@ -229,7 +239,7 @@ public class EntityRoleFilter implements MetadataFilter {
             QName roleName;
             while (rolesItr.hasNext()) {
                 roleName = getRoleName(rolesItr.next());
-                if (!roleWhiteList.contains(roleName)) {
+                if (!retainedRoles.contains(roleName)) {
                     log.trace("Filtering out role {} from entity {}", roleName, descriptor.getEntityID());
                     rolesItr.remove();
                 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list