[java-opensaml COMMIT] in /trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl: AbstractB...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Sep 27 22:21:25 EDT 2013
Author: putmanb
Date: Fri Sep 27 22:21:25 2013
New Revision: 3457
URL: http://svn.shibboleth.net/view/java-opensaml?rev=3457&view=rev
Log:
Some work on abstract base class for dynamic metadata resolvers.
Added:
trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractDynamicMetadataResolver.java (with props)
Modified:
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/impl/AbstractMetadataResolver.java
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=3457&r1=3456&r2=3457&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 Fri Sep 27 22:21:25 2013
@@ -24,7 +24,10 @@
import javax.annotation.Nullable;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
-
+import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
+import net.shibboleth.utilities.java.support.resolver.ResolverException;
+
+import org.opensaml.core.criterion.EntityIdCriterion;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.saml.metadata.IterableMetadataSource;
import org.opensaml.saml.metadata.resolver.filter.FilterException;
@@ -33,6 +36,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.google.common.base.Strings;
+
/**
* Abstract subclass for metadata resolvers that process and resolve metadata at a given point
* in time from a single metadata source document.
@@ -75,6 +80,23 @@
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
cacheSourceMetadata = flag;
+ }
+
+ /** {@inheritDoc} */
+ @Nonnull public Iterable<EntityDescriptor> resolve(CriteriaSet criteria) throws ResolverException {
+ ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
+
+ //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 || Strings.isNullOrEmpty(entityIdCriterion.getEntityId())) {
+ //TODO throw or just log?
+ throw new ResolverException("Entity Id was not supplied in criteria set");
+ }
+
+ return lookupEntityID(entityIdCriterion.getEntityId());
}
/** {@inheritDoc} */
Modified: trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractMetadataResolver.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractMetadataResolver.java?rev=3457&r1=3456&r2=3457&view=diff
==============================================================================
--- trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractMetadataResolver.java (original)
+++ trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractMetadataResolver.java Fri Sep 27 22:21:25 2013
@@ -173,23 +173,6 @@
}
return null;
}
-
- /** {@inheritDoc} */
- @Nonnull public Iterable<EntityDescriptor> resolve(CriteriaSet criteria) throws ResolverException {
- ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
-
- //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 || Strings.isNullOrEmpty(entityIdCriterion.getEntityId())) {
- //TODO throw or just log?
- throw new ResolverException("Entity Id was not supplied in criteria set");
- }
-
- return lookupEntityID(entityIdCriterion.getEntityId());
- }
/**
* Get the XMLObject unmarshaller factory to use.
More information about the commits
mailing list