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 anAggregateDnResolver
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 Classes Modifier and Type Class Description static class
AggregateAuthenticationResponseHandler.Builder
-
Field Summary
Fields Modifier and Type Field Description private Logger
logger
Logger for this class.private Map<String,AuthenticationResponseHandler[]>
responseHandlers
Labeled 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 void
addAuthenticationResponseHandlers(String label, AuthenticationResponseHandler... handlers)
Adds an authentication response handler with the supplied label.static AggregateAuthenticationResponseHandler.Builder
builder()
Creates a builder for this class.void
freeze()
Freezes this object, making it immutable.Map<String,AuthenticationResponseHandler[]>
getAuthenticationResponseHandlers()
Returns the response handlers to aggregate over.void
handle(AuthenticationResponse response)
Handle the response from an ldap authentication.void
setAuthenticationResponseHandlers(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:Freezable
Freezes this object, making it immutable.- Specified by:
freeze
in interfaceFreezable
- Overrides:
freeze
in 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:AuthenticationResponseHandler
Handle the response from an ldap authentication.- Specified by:
handle
in 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
-
-