Class PrincipalEvalPredicateFactoryRegistry
java.lang.Object
net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactoryRegistry
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 -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.PrincipalEvalPredicateFactoryRegistry(Collection<PrincipalEvalPredicateFactoryRegistration> registrations) Constructor.PrincipalEvalPredicateFactoryRegistry(Map<Pair<Class<? extends Principal>, String>, PrincipalEvalPredicateFactory> fromMap) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidderegister(Class<? extends Principal> principalType, String operator) Deregister a predicate factory for a given operator string.Get a registered predicate factory for a given principal type and operator string, if any.voidregister(Class<? extends Principal> principalType, String operator, PrincipalEvalPredicateFactory factory) Register a predicate factory for a given operator string.voidsetRegistrations(Map<Pair<Class<? extends Principal>, String>, PrincipalEvalPredicateFactory> fromMap) Add registrations from a map, overwriting any previously matching entries.
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
registry
@Nonnull @NonnullElements private Map<Pair<Class<? extends Principal>,String>, registryPrincipalEvalPredicateFactory> Storage for the registry mappings.
-
-
Constructor Details
-
PrincipalEvalPredicateFactoryRegistry
public PrincipalEvalPredicateFactoryRegistry()Constructor. -
PrincipalEvalPredicateFactoryRegistry
@Autowired public PrincipalEvalPredicateFactoryRegistry(@Nullable @NonnullElements @ParameterName(name="registrations") Collection<PrincipalEvalPredicateFactoryRegistration> registrations) Constructor.Used to auto-wire
PrincipalEvalPredicateFactoryRegistrationwrappers.- Parameters:
registrations- wrapped registration information- Since:
- 4.1.0
-
PrincipalEvalPredicateFactoryRegistry
@Deprecated(since="4.1.0", forRemoval=true) public PrincipalEvalPredicateFactoryRegistry(@Nonnull @NonnullElements @ParameterName(name="fromMap") Map<Pair<Class<? extends Principal>, String>, PrincipalEvalPredicateFactory> fromMap) Deprecated, for removal: This API element is subject to removal in a future version.Constructor.- Parameters:
fromMap- map to populate registry with
-
-
Method Details
-
setRegistrations
public void setRegistrations(@Nullable @NonnullElements 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 subtypeoperator- 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 subtypeoperator- an operator stringfactory- 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 subtypeoperator- an operator string
-