EndpointType
- type of endpointpublic abstract class AbstractEndpointResolver<EndpointType extends Endpoint> extends net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent implements EndpointResolver<EndpointType>
SAML metadata rules are followed for deriving candidate endpoints to evaluate. The base class implements only a subset of required functionality, then extracts a set of candidates from metadata if present, and delegates to a subclass to actually evaluate each one for acceptability.
The supported Criterion
types and their use follows:
EndpointCriterion
(required)
Endpoint
(s) to resolve that identifies at minimum the
type of endpoint object (via schema type or element name) to resolve. It MAY contain other attributes that
will be used in matching candidate endpoints for suitability, such as index, binding, location, etc. If so
marked, it may also be resolved as a trusted endpoint without additional verification required.
RoleDescriptorCriterion
EndpointCriterion
) is returned as the sole result,
whatever its completeness/usability, allowing for subclass validation.
Subclasses should override the {doCheckEndpoint(CriteriaSet, Endpoint)
method to implement
further criteria.
Modifier and Type | Field and Description |
---|---|
private org.slf4j.Logger |
log
Class logger.
|
Constructor and Description |
---|
AbstractEndpointResolver()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
canUseRequestedEndpoint(net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria)
Optimize the case of resolving a single endpoint if a populated endpoint is supplied via
criteria, and validation is unnecessary due to a signed request.
|
protected boolean |
doCheckEndpoint(net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria,
EndpointType endpoint)
Apply the supplied criteria to a candidate endpoint to determine its suitability.
|
private List<EndpointType> |
getCandidatesFromMetadata(net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria)
Get a mutable list of endpoints of a given type found in the metadata role contained in a
RoleDescriptorCriterion (or an empty list if no metadata exists). |
protected String |
getLogPrefix()
Return a prefix for logging messages for this component.
|
Iterable<EndpointType> |
resolve(net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria) |
EndpointType |
resolveSingle(net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria) |
private List<EndpointType> |
sortCandidates(List<Endpoint> candidates)
Copy and sort the endpoints such that the default endpoint by SAML rules comes first.
|
private void |
validateCriteria(net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria)
Verify that the required
EndpointCriterion is present. |
doInitialize, getId, setId
@Nonnull private org.slf4j.Logger log
@Nonnull @NonnullElements public Iterable<EndpointType> resolve(@Nullable net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria) throws net.shibboleth.utilities.java.support.resolver.ResolverException
resolve
in interface net.shibboleth.utilities.java.support.resolver.Resolver<EndpointType extends Endpoint,net.shibboleth.utilities.java.support.resolver.CriteriaSet>
net.shibboleth.utilities.java.support.resolver.ResolverException
@Nullable public EndpointType resolveSingle(@Nullable net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria) throws net.shibboleth.utilities.java.support.resolver.ResolverException
resolveSingle
in interface net.shibboleth.utilities.java.support.resolver.Resolver<EndpointType extends Endpoint,net.shibboleth.utilities.java.support.resolver.CriteriaSet>
net.shibboleth.utilities.java.support.resolver.ResolverException
protected boolean doCheckEndpoint(@Nonnull net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria, @Nonnull EndpointType endpoint)
criteria
- input criteria setendpoint
- candidate endpointprivate void validateCriteria(@Nullable net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria) throws net.shibboleth.utilities.java.support.resolver.ResolverException
EndpointCriterion
is present.criteria
- input criteria setnet.shibboleth.utilities.java.support.resolver.ResolverException
- if the input set is null or no EndpointCriterion
is presentprivate boolean canUseRequestedEndpoint(@Nonnull net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria)
criteria
- input criteria setEndpointCriterion
should be returned@Nonnull @NonnullElements private List<EndpointType> getCandidatesFromMetadata(@Nonnull net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria)
RoleDescriptorCriterion
(or an empty list if no metadata exists).
The endpoint type to extract is based on the candidate endpoint in an
EndpointCriterion
. If the endpoints are indexed, the first list entry will
contain the default endpoint to use in the absence of other limiting criteria.
criteria
- input criteria set@Nonnull @NonnullElements private List<EndpointType> sortCandidates(@Nonnull @NonnullElements List<Endpoint> candidates)
candidates
- input list of endpointsCopyright © 1999–2020 Shibboleth Consortium. All rights reserved.