Package org.ldaptive.auth
Class AggregateAuthenticationResponseHandler
- java.lang.Object
-
- org.ldaptive.AbstractFreezable
-
- org.ldaptive.auth.AggregateAuthenticationResponseHandler
-
- All Implemented Interfaces:
AuthenticationResponseHandler,Freezable
public final class AggregateAuthenticationResponseHandler extends AbstractFreezable implements AuthenticationResponseHandler
Used in conjunction with anAggregateDnResolverto execute a list of response handlers. In particular, the resolved DN is expected to be of the form: label:DN where the label indicates the response handler to use. This class only invokes the response handlers that matches the label found on the DN.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAggregateAuthenticationResponseHandler.Builder
-
Field Summary
Fields Modifier and Type Field Description private LoggerloggerLogger for this class.private Map<String,AuthenticationResponseHandler[]>responseHandlersLabeled entry resolvers.
-
Constructor Summary
Constructors Constructor Description AggregateAuthenticationResponseHandler()Default constructor.AggregateAuthenticationResponseHandler(Map<String,AuthenticationResponseHandler[]> handlers)Creates a new aggregate authentication response handler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAuthenticationResponseHandlers(String label, AuthenticationResponseHandler... handlers)Adds an authentication response handler with the supplied label.static AggregateAuthenticationResponseHandler.Builderbuilder()Creates a builder for this class.voidfreeze()Freezes this object, making it immutable.Map<String,AuthenticationResponseHandler[]>getAuthenticationResponseHandlers()Returns the response handlers to aggregate over.voidhandle(AuthenticationResponse response)Handle the response from an ldap authentication.voidsetAuthenticationResponseHandlers(Map<String,AuthenticationResponseHandler[]> handlers)Sets the response 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.
-
responseHandlers
private final Map<String,AuthenticationResponseHandler[]> responseHandlers
Labeled entry resolvers.
-
-
Constructor Detail
-
AggregateAuthenticationResponseHandler
public AggregateAuthenticationResponseHandler()
Default constructor.
-
AggregateAuthenticationResponseHandler
public AggregateAuthenticationResponseHandler(Map<String,AuthenticationResponseHandler[]> handlers)
Creates a new aggregate authentication response handler.- Parameters:
handlers- authentication response handlers
-
-
Method Detail
-
freeze
public void freeze()
Description copied from interface:FreezableFreezes this object, making it immutable.- Specified by:
freezein interfaceFreezable- Overrides:
freezein classAbstractFreezable
-
getAuthenticationResponseHandlers
public Map<String,AuthenticationResponseHandler[]> getAuthenticationResponseHandlers()
Returns the response handlers to aggregate over.- Returns:
- map of label to response handlers
-
setAuthenticationResponseHandlers
public void setAuthenticationResponseHandlers(Map<String,AuthenticationResponseHandler[]> handlers)
Sets the response handlers to aggregate over.- Parameters:
handlers- to set
-
addAuthenticationResponseHandlers
public void addAuthenticationResponseHandlers(String label, AuthenticationResponseHandler... handlers)
Adds an authentication response handler with the supplied label.- Parameters:
label- of the resolverhandlers- authentication response handler
-
handle
public void handle(AuthenticationResponse response) throws LdapException
Description copied from interface:AuthenticationResponseHandlerHandle the response from an ldap authentication.- Specified by:
handlein interfaceAuthenticationResponseHandler- Parameters:
response- produced from an authentication- Throws:
LdapException- if an error occurs handling an authentication response
-
builder
public static AggregateAuthenticationResponseHandler.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-