Package org.opensaml.saml.metadata.resolver.index.impl

# Class EndpointMetadataIndex

java.lang.Object
org.opensaml.saml.metadata.resolver.index.impl.EndpointMetadataIndex

All Implemented Interfaces:
  `MetadataIndex`

public class EndpointMetadataIndex extends Object implements MetadataIndex
An implementation of `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`
The default endpoint selection predicate, which evaluates an `Endpoint` using a map of `QName` endpoint types, indexed by role type.
`protected static class`
`EndpointMetadataIndex.EndpointMetadataIndexKey`
An implementation of `MetadataIndexKey` 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 more `MetadataIndexKey` instances based on the input `CriteriaSet`.
`Set<MetadataIndexKey>`
`generateKeys(EntityDescriptor descriptor)`
Generate a set of one or more `MetadataIndexKey` instances based on the input `EntityDescriptor`.
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### log

@Nonnull private org.slf4j.Logger log
Logger.

### endpointSelectionPredicate

@Nonnull private Predicate<Endpoint> 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 @Unmodifiable @NotLive public Set<MetadataIndexKey> generateKeys(@Nonnull EntityDescriptor descriptor)
Generate a set of one or more `MetadataIndexKey` instances based on the input `EntityDescriptor`.

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 via `MetadataIndex.generateKeys(CriteriaSet)`.

Specified by:
  `generateKeys` in interface `MetadataIndex`
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 @Unmodifiable @NotLive public Set<MetadataIndexKey> generateKeys(@Nullable CriteriaSet criteriaSet)
Generate a set of one or more `MetadataIndexKey` instances based on the input `CriteriaSet`.

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 via `MetadataIndex.generateKeys(EntityDescriptor)`.

Specified by:
  `generateKeys` in interface `MetadataIndex`
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(@Nullable CriteriaSet criteriaSet, @Nonnull QName roleType, @Nonnull Endpoint endpoint)
Process the specified role and endpoint.

Parameters:
  `criteriaSet` - the criteria being processed
  `roleType` - the type of role containing the endpoint
  `endpoint` - the endpoint to process
Returns:
  the set of metadata index keys for the endpoint

### processLocation

@Nonnull private Set<String> processLocation(@Nullable CriteriaSet criteriaSet, @Nonnull String location)
Process the specified location.

Parameters:
  `criteriaSet` - the criteria being processed
  `location` - the location to process
Returns:
  the variants of the location to be indexed