Package org.wildfly.security.sasl.util
Class AuthenticationTimeoutSaslServerFactory
- java.lang.Object
-
- org.wildfly.security.sasl.util.AbstractDelegatingSaslServerFactory
-
- org.wildfly.security.sasl.util.AuthenticationTimeoutSaslServerFactory
-
- All Implemented Interfaces:
SaslServerFactory
public final class AuthenticationTimeoutSaslServerFactory extends AbstractDelegatingSaslServerFactory
ASaslServerFactory
which adds authentication timeout functionality to a delegateSaslServerFactory
.This
SaslServerFactory
must be outside of theAuthenticationCompleteCallbackSaslServerFactory
in the chain of SASL server factories.- Author:
- Farah Juma
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
AuthenticationTimeoutSaslServerFactory.DelegatingTimeoutSaslServer
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_TIMEOUT
The default amount of time, in seconds, after which an authentication attempt should time out.private ScheduledExecutorService
scheduledExecutorService
-
Fields inherited from class org.wildfly.security.sasl.util.AbstractDelegatingSaslServerFactory
delegate
-
-
Constructor Summary
Constructors Constructor Description AuthenticationTimeoutSaslServerFactory(SaslServerFactory delegate, ScheduledExecutorService scheduledExecutorService)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SaslServer
createSaslServer(String mechanism, String protocol, String serverName, Map<String,?> props, CallbackHandler cbh)
private long
getTimeout(Map<String,?> props)
-
Methods inherited from class org.wildfly.security.sasl.util.AbstractDelegatingSaslServerFactory
delegatesThrough, delegatesThroughNN, getMechanismNames, toString
-
-
-
-
Field Detail
-
DEFAULT_TIMEOUT
public static final long DEFAULT_TIMEOUT
The default amount of time, in seconds, after which an authentication attempt should time out.- See Also:
- Constant Field Values
-
scheduledExecutorService
private final ScheduledExecutorService scheduledExecutorService
-
-
Constructor Detail
-
AuthenticationTimeoutSaslServerFactory
public AuthenticationTimeoutSaslServerFactory(SaslServerFactory delegate, ScheduledExecutorService scheduledExecutorService)
Construct a new instance.- Parameters:
delegate
- the delegateSaslServerFactory
scheduledExecutorService
- the scheduled executor to use to handle authentication timeout tasks
-
-
Method Detail
-
createSaslServer
public SaslServer createSaslServer(String mechanism, String protocol, String serverName, Map<String,?> props, CallbackHandler cbh) throws SaslException
- Specified by:
createSaslServer
in interfaceSaslServerFactory
- Overrides:
createSaslServer
in classAbstractDelegatingSaslServerFactory
- Throws:
SaslException
-
-