Class EndpointMetadataIndex
- All Implemented Interfaces:
MetadataIndex
public class EndpointMetadataIndex extends Object implements MetadataIndex
MetadataIndex
which indexes entities by their role endpoint locations.
The indexed endpoint location keys are scoped by the containing RoleDescriptor
type, Endpoint
type,
and whether or not the endpoint value was a standard location (Endpoint.getLocation()
)
or a response location (Endpoint.getResponseLocation()
).
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EndpointMetadataIndex.DefaultEndpointSelectionPredicate
protected static class
EndpointMetadataIndex.EndpointMetadataIndexKey
An implementation ofMetadataIndexKey
representing a single SAML metadata endpoint. -
Field Summary
Fields Modifier and Type Field Description private Predicate<Endpoint>
endpointSelectionPredicate
The predicate which selects which endpoints to index.private org.slf4j.Logger
log
Logger. -
Constructor Summary
Constructors Constructor Description EndpointMetadataIndex()
Constructor.EndpointMetadataIndex(Predicate<Endpoint> endpointPredicate)
Constructor. -
Method Summary
Modifier and Type Method Description Set<MetadataIndexKey>
generateKeys(CriteriaSet criteriaSet)
Generate a set of one or moreMetadataIndexKey
instances based on the inputCriteriaSet
.Set<MetadataIndexKey>
generateKeys(EntityDescriptor descriptor)
Generate a set of one or moreMetadataIndexKey
instances based on the inputEntityDescriptor
.private Set<MetadataIndexKey>
processCriteria(CriteriaSet criteriaSet, QName roleType, Endpoint endpoint)
Process the specified role and endpoint.private Set<String>
processLocation(CriteriaSet criteriaSet, String location)
Process the specified location.
-
Field Details
-
log
private org.slf4j.Logger logLogger. -
endpointSelectionPredicate
The predicate which selects which endpoints to index.
-
-
Constructor Details
-
EndpointMetadataIndex
public EndpointMetadataIndex()Constructor.All entity descriptor endpoints will be indexed.
-
EndpointMetadataIndex
public EndpointMetadataIndex(@Nonnull @ParameterName(name="endpointPredicate") Predicate<Endpoint> endpointPredicate)Constructor.- Parameters:
endpointPredicate
- the predicate which selects which endpoints to index
-
-
Method Details
-
generateKeys
@Nullable @NonnullElements @Unmodifiable @NotLive public Set<MetadataIndexKey> generateKeys(@Nonnull EntityDescriptor descriptor)Generate a set of one or moreMetadataIndexKey
instances based on the inputEntityDescriptor
.These index key instances reflect the type of indexing performed and "understood" by the implementation, and as such should complement the
MetadataIndexKey
types generated for descriptor lookup viaMetadataIndex.generateKeys(CriteriaSet)
.- Specified by:
generateKeys
in interfaceMetadataIndex
- Parameters:
descriptor
- the entity descriptor set to process- Returns:
- the set of index keys generated from the criteria. May be null or empty, but will not contain null elements.
-
generateKeys
@Nullable @NonnullElements @Unmodifiable @NotLive public Set<MetadataIndexKey> generateKeys(@Nonnull CriteriaSet criteriaSet)Generate a set of one or moreMetadataIndexKey
instances based on the inputCriteriaSet
.These index key instances reflect the type of indexing performed and "understood" by the implementation, and as such should complement the
MetadataIndexKey
types generated for descriptor indexing viaMetadataIndex.generateKeys(EntityDescriptor)
.- Specified by:
generateKeys
in interfaceMetadataIndex
- Parameters:
criteriaSet
- the criteria set to process- Returns:
- the set of index keys generated from the criteria. May be null or empty, but will not contain null elements.
-
processCriteria
@Nonnull private Set<MetadataIndexKey> processCriteria(@Nonnull CriteriaSet criteriaSet, @Nonnull QName roleType, @Nonnull Endpoint endpoint)Process the specified role and endpoint.- Parameters:
criteriaSet
- the criteria being processedroleType
- the type of role containing the endpointendpoint
- the endpoint to process- Returns:
- the set of metadata index keys for the endpoint
-
processLocation
@Nonnull private Set<String> processLocation(@Nonnull CriteriaSet criteriaSet, @Nonnull String location)Process the specified location.- Parameters:
criteriaSet
- the criteria being processedlocation
- the location to process- Returns:
- the variants of the location to be indexed
-