Package org.wildfly.security.http.util
Class FilterServerMechanismFactory
java.lang.Object
org.wildfly.security.http.util.FilterServerMechanismFactory
- All Implemented Interfaces:
HttpServerAuthenticationMechanismFactory
public final class FilterServerMechanismFactory
extends Object
implements HttpServerAuthenticationMechanismFactory
An implementation of
HttpServerAuthenticationMechanismFactory that wraps an existing factory and provides mechanism
filtering by name.- Author:
- Darran Lofthouse
-
Constructor Summary
ConstructorsConstructorDescriptionFilterServerMechanismFactory(HttpServerAuthenticationMechanismFactory delegate, boolean include, String... mechanismNames) Construct a new instance that filters from a provided set of mechanism names.FilterServerMechanismFactory(HttpServerAuthenticationMechanismFactory delegate, boolean include, Collection<String> mechanismNames) Construct a new instance that filters from a provided set of mechanism names.FilterServerMechanismFactory(HttpServerAuthenticationMechanismFactory delegate, Predicate<String> predicate) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptioncreateAuthenticationMechanism(String mechanismName, Map<String, ?> properties, CallbackHandler callbackHandler) Create the requestedHttpServerAuthenticationMechanismprovided it is available and allowed by the current filter.String[]getMechanismNames(Map<String, ?> properties) Get the available mechanism names after filtering has been performed by the previously providedPredicateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wildfly.security.http.HttpServerAuthenticationMechanismFactory
shutdown
-
Constructor Details
-
FilterServerMechanismFactory
public FilterServerMechanismFactory(HttpServerAuthenticationMechanismFactory delegate, Predicate<String> predicate) Constructs a new instance.- Parameters:
delegate- theHttpServerAuthenticationMechanismFactoryto delegate to.predicate- mechanism name based predicate to filter available mechanisms.
-
FilterServerMechanismFactory
public FilterServerMechanismFactory(HttpServerAuthenticationMechanismFactory delegate, boolean include, String... mechanismNames) Construct a new instance that filters from a provided set of mechanism names.- Parameters:
delegate- theHttpServerAuthenticationMechanismFactoryto delegate to.include- whentruemechanisms will be advertised as available if included in the provided mechanismNames.mechanismNames- the mechanism names to use as a filter.
-
FilterServerMechanismFactory
public FilterServerMechanismFactory(HttpServerAuthenticationMechanismFactory delegate, boolean include, Collection<String> mechanismNames) Construct a new instance that filters from a provided set of mechanism names.- Parameters:
delegate- theHttpServerAuthenticationMechanismFactoryto delegate to.include- whentruemechanisms will be advertised as available if included in the provided mechanismNames.mechanismNames- the mechanism names to use as a filter.
-
-
Method Details
-
getMechanismNames
Get the available mechanism names after filtering has been performed by the previously providedPredicate- Specified by:
getMechanismNamesin interfaceHttpServerAuthenticationMechanismFactory- Parameters:
properties- theMapof properties to pass into theHttpServerAuthenticationMechanismFactory.getMechanismNames(Map)call on the delegate.- Returns:
- The array of filtered mechanism names.
- See Also:
-
createAuthenticationMechanism
public HttpServerAuthenticationMechanism createAuthenticationMechanism(String mechanismName, Map<String, ?> properties, CallbackHandler callbackHandler) throws HttpAuthenticationExceptionCreate the requestedHttpServerAuthenticationMechanismprovided it is available and allowed by the current filter.- Specified by:
createAuthenticationMechanismin interfaceHttpServerAuthenticationMechanismFactory- Parameters:
mechanismName- the name of the required mechanism.properties- the configuration properties to pass in for mechanism creation.callbackHandler- theCallbackHandlerthe mechanism should use for verification.- Returns:
- The
HttpServerAuthenticationMechanismornullif not available. - Throws:
HttpAuthenticationException- See Also:
-