Package net.shibboleth.idp.authn.principal

# Class PrincipalEvalPredicateFactoryRegistry

java.lang.Object
net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactoryRegistry

public final class PrincipalEvalPredicateFactoryRegistry extends Object
A registry of mappings between a custom `Principal` subtype with a matching operator and a corresponding `PrincipalEvalPredicateFactory` that returns predicates enforcing a particular set of matching rules for that operator and subtype.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Class logger.
`private Map<Pair<Class<? extends Principal>,String>,PrincipalEvalPredicateFactory>`
`registry`
Storage for the registry mappings.

## Constructor Summary

Constructors
Constructor
Description
`PrincipalEvalPredicateFactoryRegistry()`
Constructor.
`PrincipalEvalPredicateFactoryRegistry(Collection<PrincipalEvalPredicateFactoryRegistration> registrations)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`deregister(Class<? extends Principal> principalType, String operator)`
Deregister a predicate factory for a given operator string.
`PrincipalEvalPredicateFactory`
`lookup(Class<? extends Principal> principalType, String operator)`
Get a registered predicate factory for a given principal type and operator string, if any.
`void`
`register(Class<? extends Principal> principalType, String operator, PrincipalEvalPredicateFactory factory)`
Register a predicate factory for a given operator string.
`void`
`setRegistrations(Map<Pair<Class<? extends Principal>,String>,PrincipalEvalPredicateFactory> fromMap)`
Add registrations from a map, overwriting any previously matching entries.

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

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

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### registry

@Nonnull private Map<Pair<Class<? extends Principal>,String>,PrincipalEvalPredicateFactory> registry
Storage for the registry mappings.

## Constructor Details

### PrincipalEvalPredicateFactoryRegistry

public PrincipalEvalPredicateFactoryRegistry()
Constructor.

### PrincipalEvalPredicateFactoryRegistry

@Autowired public PrincipalEvalPredicateFactoryRegistry(@Nullable @ParameterName(name="registrations") Collection<PrincipalEvalPredicateFactoryRegistration> registrations)
Constructor.

Used to auto-wire `PrincipalEvalPredicateFactoryRegistration` wrappers.

Parameters:
  `registrations` - wrapped registration information
Since:
  4.1.0

## Method Details

### setRegistrations

public void setRegistrations(@Nullable Map<Pair<Class<? extends Principal>,String>,PrincipalEvalPredicateFactory> fromMap)
Add registrations from a map, overwriting any previously matching entries.

Parameters:
  `fromMap` - map entries to add
Since:
  4.1.0

### lookup

@Nullable public PrincipalEvalPredicateFactory lookup(@Nonnull Class<? extends Principal> principalType, @Nonnull @NotEmpty String operator)
Get a registered predicate factory for a given principal type and operator string, if any.

Parameters:
  `principalType` - a principal subtype
  `operator` - an operator string
Returns:
  a corresponding predicate factory, or null

### register

public void register(@Nonnull Class<? extends Principal> principalType, @Nonnull @NotEmpty String operator, @Nonnull PrincipalEvalPredicateFactory factory)
Register a predicate factory for a given operator string.

Parameters:
  `principalType` - a principal subtype
  `operator` - an operator string
  `factory` - the predicate factory to register

### deregister

public void deregister(@Nonnull Class<? extends Principal> principalType, @Nonnull @NotEmpty String operator)
Deregister a predicate factory for a given operator string.

Parameters:
  `principalType` - a principal subtype
  `operator` - an operator string