@Override
    public void handleEvent(Object event) throws GuacamoleException {

        // Notify auth tracker of each request received BEFORE the request is
        // processed ...
        if (event instanceof AuthenticationRequestReceivedEvent) {
            AuthenticationRequestReceivedEvent request = (AuthenticationRequestReceivedEvent) event;
            tracker.notifyAuthenticationRequestReceived(request.getCredentials());
        }

        // ... as well as every explicit failure ...
        else if (event instanceof AuthenticationFailureEvent) {

            AuthenticationFailureEvent failure = (AuthenticationFailureEvent) event;

            // Requests for additional credentials are not failures per se,
            // but continuations of a multi-request authentication attempt that
            // has not yet succeeded OR failed
            if (failure.getFailure() instanceof GuacamoleInsufficientCredentialsException) {
                tracker.notifyAuthenticationRequestReceived(failure.getCredentials());
                return;
            }

            // Consider all other errors to be failed auth attempts
            tracker.notifyAuthenticationFailed(failure.getCredentials());

        }

        // ... and explicit success.
        else if (event instanceof AuthenticationSuccessEvent) {
            AuthenticationSuccessEvent success = (AuthenticationSuccessEvent) event;
            tracker.notifyAuthenticationSuccess(success.getCredentials());
        }

    }
Creates a new BanningAuthenticationListener which automatically bans
further authentication attempts from addresses that have repeatedly
failed to authenticate. The ban duration and maximum number of failed
attempts allowed before banning are configured within
guacamole.properties.

@throws GuacamoleException
    If an error occurs parsing the configuration properties used by this
    extension.
extensions/guacamole-auth-ban/src/main/java/org/apache/guacamole/auth/ban/BanningAuthenticationListener.java