org.springframework.ldap.core

## Class CollectingAuthenticationErrorCallback

- java.lang.Object
- - org.springframework.ldap.core.CollectingAuthenticationErrorCallback

- All Implemented Interfaces:
    AuthenticationErrorCallback

      public final class CollectingAuthenticationErrorCallback
      extends Object
      implements AuthenticationErrorCallback

  Convenience implementation of AuthenticationErrorCallback that stores the given exception and provides a method for retrieving it. The caller of the authenticate method can provide an instance of this class as an error callback. If the authentication fails, the caller can ask the callback instance for the actual authentication exception.
  Since:
    1.3.1
  Author:
    Ulrik Sandberg

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CollectingAuthenticationErrorCallback()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `execute(Exception e)` This method will be called with the authentication exception in case there is a problem with the authentication.
    `Exception` | `getError()`
    `boolean` | `hasError()` Check whether this callback has collected an error.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CollectingAuthenticationErrorCallback

          public CollectingAuthenticationErrorCallback()

  - ### Method Detail

    - #### execute

          public void execute(Exception e)

      Description copied from interface: `AuthenticationErrorCallback`
      This method will be called with the authentication exception in case there is a problem with the authentication.
      Specified by:
        `execute` in interface `AuthenticationErrorCallback`
      Parameters:
        `e` - the exception that was caught in the authentication method

    - #### getError

          public Exception getError()

      Returns:
        the collected exception

    - #### hasError

          public boolean hasError()

      Check whether this callback has collected an error.
      Returns:
        `true` if an error has been collected, `false` otherwise.