Package net.shibboleth.idp.authn.principal.impl

# Class InexactPrincipalEvalPredicateFactory

java.lang.Object
net.shibboleth.idp.authn.principal.impl.InexactPrincipalEvalPredicateFactory

All Implemented Interfaces:
  `PrincipalEvalPredicateFactory`

public class InexactPrincipalEvalPredicateFactory extends Object implements PrincipalEvalPredicateFactory
`PrincipalEvalPredicateFactory` that implements inexact matching of principals, based on an arbitrary set of "matches" configured at runtime.

Matching is based on string equality between two principals via the `Principal.getName()` method.

This component implements essentially arbitrary comparison rules by being unaware of the actual semantics implied by a match. For example, a given instance of the component could be configured with rules for matching principals that are "at least as good as" or "better than" a candidate value, but the component doesn't know or care about that meaning.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`private class`
`InexactPrincipalEvalPredicateFactory.InexactMatchPredicate`
Implementation of an inexact-matching predicate.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final HashMultimap<String,String>`
`matchingRules`
Rules for matching.

## Constructor Summary

Constructors
Constructor
Description
`InexactPrincipalEvalPredicateFactory()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`(package private) Multimap<String,String>`
`getMatchingRules()`
Get the matching rules to apply.
`PrincipalEvalPredicate`
`getPredicate(Principal candidate)`
Get a predicate to compare a candidate `Principal` object against a `PrincipalSupportingComponent` for a "match", where the definition of a match is implementation-specific.
`void`
`setMatchingRules(Map<String,Collection<String>> rules)`
Set the matching rules to apply.

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

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

## Field Details

### matchingRules

@Nonnull private final HashMultimap<String,String> matchingRules
Rules for matching.

## Constructor Details

### InexactPrincipalEvalPredicateFactory

InexactPrincipalEvalPredicateFactory()
Constructor.

## Method Details

### getMatchingRules

@Nonnull @Live Multimap<String,String> getMatchingRules()
Get the matching rules to apply.

Returns:
  a mutable multimap of the matching rules to apply

### setMatchingRules

public void setMatchingRules(@Nonnull Map<String,Collection<String>> rules)
Set the matching rules to apply.

The input is a map of sets for bean compatibility.

Parameters:
  `rules` - matching rules

### getPredicate

@Nonnull public PrincipalEvalPredicate getPredicate(@Nonnull Principal candidate)
Get a predicate to compare a candidate `Principal` object against a `PrincipalSupportingComponent` for a "match", where the definition of a match is implementation-specific.

Specified by:
  `getPredicate` in interface `PrincipalEvalPredicateFactory`
Parameters:
  `candidate` - a `Principal` object to evaluate
Returns:
  a `PrincipalEvalPredicate` implementing custom matching rules