Reindex account whenever account is evicted from cache

Change-Id: I025cabc9be98628777066cda7aa97186f5a0da15
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2016-06-20 16:06:54 +02:00
parent ebbf81470a
commit 94732bfa19
29 changed files with 115 additions and 55 deletions

View File

@@ -32,6 +32,8 @@ import org.kohsuke.args4j.spi.OptionHandler;
import org.kohsuke.args4j.spi.Parameters;
import org.kohsuke.args4j.spi.Setter;
import java.io.IOException;
public class AccountIdHandler extends OptionHandler<Account.Id> {
private final AccountResolver accountResolver;
private final AccountManager accountManager;
@@ -76,7 +78,7 @@ public class AccountIdHandler extends OptionHandler<Account.Id> {
throw new CmdLineException(owner, "user \"" + token + "\" not found");
}
}
} catch (OrmException e) {
} catch (OrmException | IOException e) {
throw new CmdLineException(owner, "database is down");
}
setter.addValue(accountId);
@@ -84,7 +86,7 @@ public class AccountIdHandler extends OptionHandler<Account.Id> {
}
private Account.Id createAccountByLdap(String user)
throws CmdLineException {
throws CmdLineException, IOException {
if (!user.matches(Account.USER_NAME_PATTERN)) {
throw new CmdLineException(owner, "user \"" + user + "\" not found");
}