Package org.ldaptive.auth
Class AggregateAuthenticationHandler
- java.lang.Object
-
- org.ldaptive.AbstractFreezable
-
- org.ldaptive.auth.AggregateAuthenticationHandler
-
- All Implemented Interfaces:
AuthenticationHandler,Freezable
public final class AggregateAuthenticationHandler extends AbstractFreezable implements AuthenticationHandler
Used in conjunction with anAggregateDnResolverto authenticate the resolved DN. In particular, the resolved DN is expected to be of the form: label:DN where the label indicates the authentication handler to use. This class only invokes one authentication handler that matches the label found on the DN.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAggregateAuthenticationHandler.Builder
-
Field Summary
Fields Modifier and Type Field Description private Map<String,AuthenticationHandler>authenticationHandlersLabeled authentication handlers.private LoggerloggerLogger for this class.
-
Constructor Summary
Constructors Constructor Description AggregateAuthenticationHandler()Default constructor.AggregateAuthenticationHandler(Map<String,AuthenticationHandler> handlers)Creates a new aggregate authentication handler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAuthenticationHandler(String label, AuthenticationHandler handler)Adds an authentication handler with the supplied label.AuthenticationHandlerResponseauthenticate(AuthenticationCriteria criteria)Perform an ldap authentication.static AggregateAuthenticationHandler.Builderbuilder()Creates a builder for this class.voidfreeze()Freezes this object, making it immutable.Map<String,AuthenticationHandler>getAuthenticationHandlers()Returns the authentication handlers to aggregate over.voidsetAuthenticationHandlers(Map<String,AuthenticationHandler> handlers)Sets the authentication handlers to aggregate over.-
Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, isFrozen
-
-
-
-
Field Detail
-
logger
private final Logger logger
Logger for this class.
-
authenticationHandlers
private final Map<String,AuthenticationHandler> authenticationHandlers
Labeled authentication handlers.
-
-
Constructor Detail
-
AggregateAuthenticationHandler
public AggregateAuthenticationHandler()
Default constructor.
-
AggregateAuthenticationHandler
public AggregateAuthenticationHandler(Map<String,AuthenticationHandler> handlers)
Creates a new aggregate authentication handler.- Parameters:
handlers- authentication handlers
-
-
Method Detail
-
freeze
public void freeze()
Description copied from interface:FreezableFreezes this object, making it immutable.- Specified by:
freezein interfaceFreezable- Overrides:
freezein classAbstractFreezable
-
getAuthenticationHandlers
public Map<String,AuthenticationHandler> getAuthenticationHandlers()
Returns the authentication handlers to aggregate over.- Returns:
- map of label to authentication handler
-
setAuthenticationHandlers
public void setAuthenticationHandlers(Map<String,AuthenticationHandler> handlers)
Sets the authentication handlers to aggregate over.- Parameters:
handlers- to set
-
addAuthenticationHandler
public void addAuthenticationHandler(String label, AuthenticationHandler handler)
Adds an authentication handler with the supplied label.- Parameters:
label- of the resolverhandler- authentication handler
-
authenticate
public AuthenticationHandlerResponse authenticate(AuthenticationCriteria criteria) throws LdapException
Description copied from interface:AuthenticationHandlerPerform an ldap authentication.- Specified by:
authenticatein interfaceAuthenticationHandler- Parameters:
criteria- to perform the authentication with- Returns:
- authentication handler response
- Throws:
LdapException- if ldap operation fails
-
builder
public static AggregateAuthenticationHandler.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-