/**
  * @see
  *     de.piratenpartei.berlin.ldadmin.app.service.impl.PasswordTokenManager#invalidateRecoveryToken(User,
  *     String)
  */
 @Override
 public void invalidateRecoveryToken(User user, String token) {
   jdbcTemplate.update(deleteTokenSql, user.getUsername());
 }
 protected void persistToken(User user, String token) {
   jdbcTemplate.update(deleteTokenSql, user.getUsername());
   jdbcTemplate.update(insertTokenSql, user.getUsername(), token, getExpirationTime());
 }
 protected boolean isRecoveryTokenPersisted(final User user, final String token) {
   Number count =
       jdbcTemplate.queryForObject(
           selectTokenSql, new Object[] {user.getUsername(), token}, Integer.class);
   return count != null && count.intValue() == 1;
 }