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 an
AggregateDnResolver to 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 ClassesModifier and TypeClassDescriptionstatic final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LoggerLogger for this class.private final Map<String,AuthenticationResponseHandler[]> Labeled entry resolvers. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.Creates a new aggregate authentication response handler. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAuthenticationResponseHandlers(String label, AuthenticationResponseHandler... handlers) Adds an authentication response handler with the supplied label.builder()Creates a builder for this class.voidfreeze()Freezes this object, making it immutable.Returns the response handlers to aggregate over.voidhandle(AuthenticationResponse response) Handle the response from an ldap authentication.voidSets the response handlers to aggregate over.Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, isFrozen
-
Field Details
-
logger
Logger for this class. -
responseHandlers
Labeled entry resolvers.
-
-
Constructor Details
-
AggregateAuthenticationResponseHandler
public AggregateAuthenticationResponseHandler()Default constructor. -
AggregateAuthenticationResponseHandler
Creates a new aggregate authentication response handler.- Parameters:
handlers- authentication response handlers
-
-
Method Details
-
freeze
public void freeze()Description copied from interface:FreezableFreezes this object, making it immutable.- Specified by:
freezein interfaceFreezable- Overrides:
freezein classAbstractFreezable
-
getAuthenticationResponseHandlers
Returns the response handlers to aggregate over.- Returns:
- map of label to response handlers
-
setAuthenticationResponseHandlers
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
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
Creates a builder for this class.- Returns:
- new builder
-