[java-opensaml COMMIT] in /trunk: opensaml-saml-api/src/main/java/org/opensaml/saml/criterion/ArtifactSourceIDCriteri...

noreply at shibboleth.net noreply at shibboleth.net
Mon Nov 2 19:55:17 EST 2015


Author: putmanb
Date: Mon Nov  2 19:55:17 2015
New Revision: 4372

URL: http://svn.shibboleth.net/view/java-opensaml?rev=4372&view=rev
Log:
Pull metadata indexing work from the trunk for now.

Don't want to commit to this API yet for the 3.2.0 release.

Modified:
    trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/criterion/ArtifactSourceIDCriterion.java
    trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/metadata/resolver/index/
    trunk/opensaml-saml-api/src/test/java/org/opensaml/saml/metadata/resolver/
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractBatchMetadataResolver.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/index/
    trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/metadata/resolver/index/

Modified: trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractBatchMetadataResolver.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractBatchMetadataResolver.java?rev=4372&r1=4371&r2=4372&view=diff
==============================================================================
--- trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractBatchMetadataResolver.java	(original)
+++ trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractBatchMetadataResolver.java	Mon Nov  2 19:55:17 2015
@@ -18,16 +18,11 @@
 package org.opensaml.saml.metadata.resolver.impl;
 
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.Iterator;
-import java.util.Set;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
-import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
-import net.shibboleth.utilities.java.support.annotation.constraint.NotLive;
-import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
 import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
@@ -38,16 +33,12 @@
 import org.opensaml.saml.metadata.IterableMetadataSource;
 import org.opensaml.saml.metadata.resolver.BatchMetadataResolver;
 import org.opensaml.saml.metadata.resolver.filter.FilterException;
-import org.opensaml.saml.metadata.resolver.index.MetadataIndex;
-import org.opensaml.saml.metadata.resolver.index.impl.MetadataIndexManager;
 import org.opensaml.saml.saml2.metadata.EntitiesDescriptor;
 import org.opensaml.saml.saml2.metadata.EntityDescriptor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Predicates;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.ImmutableSet;
+import com.google.common.base.Strings;
 
 /**
  * Abstract subclass for metadata resolvers that process and resolve metadata at a given point 
@@ -62,14 +53,9 @@
     /** Flag indicating whether to cache the original source metadata document. */
     private boolean cacheSourceMetadata;
     
-    /** The set of indexes configured. */
-    private Set<MetadataIndex> indexes;
-    
     /** Constructor. */
     public AbstractBatchMetadataResolver() {
         super();
-        
-        indexes = Collections.emptySet();
         
         setCacheSourceMetadata(true);
     }
@@ -101,29 +87,6 @@
         cacheSourceMetadata = flag; 
     }
     
-    /**
-     * Get the configured indexes.
-     * 
-     * @return the set of configured indexes
-     */
-    @Nonnull @NonnullElements @Unmodifiable @NotLive public Set<MetadataIndex> getIndexes() {
-        return ImmutableSet.copyOf(indexes);
-    }
-
-    /**
-     * Set the configured indexes.
-     * 
-     * @param newIndexes the new indexes to set
-     */
-    public void setIndexes(@Nullable final Set<MetadataIndex> newIndexes) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        if (newIndexes == null) {
-            indexes = Collections.emptySet();
-        } else {
-            indexes = new HashSet<>(Collections2.filter(newIndexes, Predicates.notNull()));
-        }
-    }
-
     /** {@inheritDoc} */
     @Override
     @Nonnull public Iterable<EntityDescriptor> resolve(CriteriaSet criteria) throws ResolverException {
@@ -131,41 +94,21 @@
         
         //TODO add filtering for entity role, protocol? maybe
         //TODO add filtering for binding? probably not, belongs better in RoleDescriptorResolver
+        //TODO this needs to change substantially if we support queries *without* an EntityIdCriterion
         
         EntityIdCriterion entityIdCriterion = criteria.get(EntityIdCriterion.class);
-        if (entityIdCriterion != null) {
-            return lookupEntityID(entityIdCriterion.getEntityId());
-        } else {
-            return lookupByIndexes(criteria);
-        }
-        
-    }
-    
-    /**

[... 100 lines stripped ...]


More information about the commits mailing list