/** * Check for the presence of account state warnings. * * @return true if account state warnings exist */ public boolean hasAccountStateWarning() { final AccountState state = authenticationResponse.getAccountState(); return state != null ? state.getWarning() != null : false; }
@Override public List<MessageDescriptor> handle(final AuthenticationResponse response, final LdapPasswordPolicyConfiguration configuration) throws LoginException { final AccountState state = response.getAccountState(); if (state == null) { logger.debug("Account state not defined. Returning empty list of messages."); return Collections.emptyList(); } final List<MessageDescriptor> messages = new ArrayList<>(); handleError(state.getError(), response, configuration, messages); handleWarning(state.getWarning(), response, configuration, messages); return messages; }