public void clearConsecutiveAuthenticationFailures(UserEntity userEntity) {
    if (userEntity != null) {
      if (userEntity.getConsecutiveFailures() != 0) {
        Command command = new Command() {
          @Override
          public void perform(UserEntity userEntity) {
            userEntity.setConsecutiveFailures(0);
          }
        };

        safelyUpdateUserEntity(userEntity, command, MAX_RETRIES);
      }
    }
  }
Resets the named user's consecutive authentication failure count to <code>0</code>.
<p>
This operation is safe when concurrent authentication attempts by the same username are made
due to {@link UserEntity#version} and optimistic locking.

@param userEntity the user
ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java