Package org.wildfly.security.http.util
Class PropertiesServerMechanismFactory
- java.lang.Object
-
- org.wildfly.security.http.util.PropertiesServerMechanismFactory
-
- All Implemented Interfaces:
HttpServerAuthenticationMechanismFactory
public final class PropertiesServerMechanismFactory extends Object implements HttpServerAuthenticationMechanismFactory
AHttpServerAuthenticationMechanismFactory
that adds a predefined set of properties to all calls to the delegate.- Author:
- Darran Lofthouse
-
-
Field Summary
Fields Modifier and Type Field Description private HttpServerAuthenticationMechanismFactory
delegate
private Map<String,?>
properties
-
Constructor Summary
Constructors Constructor Description PropertiesServerMechanismFactory(HttpServerAuthenticationMechanismFactory delegate, Map<String,?> properties)
Construct a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static Map<String,?>
combine(Map<String,?> provided, Map<String,?> configured)
HttpServerAuthenticationMechanism
createAuthenticationMechanism(String mechanismName, Map<String,?> properties, CallbackHandler callbackHandler)
Create an instance of the requestedHttpServerAuthenticationMechanismFactory
.String[]
getMechanismNames(Map<String,?> properties)
Obtain the list of available mechanism names after merging the properties.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.security.http.HttpServerAuthenticationMechanismFactory
shutdown
-
-
-
-
Field Detail
-
delegate
private final HttpServerAuthenticationMechanismFactory delegate
-
-
Constructor Detail
-
PropertiesServerMechanismFactory
public PropertiesServerMechanismFactory(HttpServerAuthenticationMechanismFactory delegate, Map<String,?> properties)
Construct a new instance.- Parameters:
delegate
- theHttpServerAuthenticationMechanismFactory
calls are delegated to.properties
- the properties that should be added to any properties passed in overriding any duplicate keys.
-
-
Method Detail
-
getMechanismNames
public String[] getMechanismNames(Map<String,?> properties)
Obtain the list of available mechanism names after merging the properties.- Specified by:
getMechanismNames
in interfaceHttpServerAuthenticationMechanismFactory
- Parameters:
properties
- the initial set of properties to pass to the delegate to obtain the mechanism names.- Returns:
- the list of authentication mechanisms available form this factory.
- See Also:
HttpServerAuthenticationMechanismFactory.getMechanismNames(java.util.Map)
-
createAuthenticationMechanism
public HttpServerAuthenticationMechanism createAuthenticationMechanism(String mechanismName, Map<String,?> properties, CallbackHandler callbackHandler) throws HttpAuthenticationException
Create an instance of the requestedHttpServerAuthenticationMechanismFactory
.- Specified by:
createAuthenticationMechanism
in interfaceHttpServerAuthenticationMechanismFactory
- Parameters:
mechanismName
- the name of the mechanism being requested.properties
- initial properties to be passed into the delegate factory.callbackHandler
- theCallbackHandler
to use for verification.- Returns:
- The newly created
HttpServerAuthenticationMechanismFactory
, ornull
if not availbale. - Throws:
HttpAuthenticationException
- See Also:
HttpServerAuthenticationMechanismFactory.createAuthenticationMechanism(java.lang.String, java.util.Map, javax.security.auth.callback.CallbackHandler)
-
-