Reindex account whenever account is evicted from cache
Change-Id: I025cabc9be98628777066cda7aa97186f5a0da15 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -38,6 +38,7 @@ import com.google.inject.Inject;
|
||||
import org.kohsuke.args4j.Argument;
|
||||
import org.kohsuke.args4j.Option;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -88,7 +89,7 @@ final class CreateGroupCommand extends SshCommand {
|
||||
private AddIncludedGroups addIncludedGroups;
|
||||
|
||||
@Override
|
||||
protected void run() throws Failure, OrmException {
|
||||
protected void run() throws Failure, OrmException, IOException {
|
||||
try {
|
||||
GroupResource rsrc = createGroup();
|
||||
|
||||
@@ -104,7 +105,8 @@ final class CreateGroupCommand extends SshCommand {
|
||||
}
|
||||
}
|
||||
|
||||
private GroupResource createGroup() throws RestApiException, OrmException {
|
||||
private GroupResource createGroup()
|
||||
throws RestApiException, OrmException, IOException {
|
||||
GroupInput input = new GroupInput();
|
||||
input.description = groupDescription;
|
||||
input.visibleToAll = visibleToAll;
|
||||
@@ -120,7 +122,7 @@ final class CreateGroupCommand extends SshCommand {
|
||||
}
|
||||
|
||||
private void addMembers(GroupResource rsrc) throws RestApiException,
|
||||
OrmException {
|
||||
OrmException, IOException {
|
||||
AddMembers.Input input =
|
||||
AddMembers.Input.fromMembers(FluentIterable
|
||||
.from(initialMembers)
|
||||
|
||||
@@ -256,8 +256,8 @@ final class SetAccountCommand extends SshCommand {
|
||||
new AccountResource.SshKey(user, sshKey), null);
|
||||
}
|
||||
|
||||
private void addEmail(String email) throws UnloggedFailure, RestApiException,
|
||||
OrmException {
|
||||
private void addEmail(String email)
|
||||
throws UnloggedFailure, RestApiException, OrmException, IOException {
|
||||
EmailInput in = new EmailInput();
|
||||
in.email = email;
|
||||
in.noConfirmation = true;
|
||||
@@ -268,7 +268,8 @@ final class SetAccountCommand extends SshCommand {
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteEmail(String email) throws RestApiException, OrmException {
|
||||
private void deleteEmail(String email)
|
||||
throws RestApiException, OrmException, IOException {
|
||||
if (email.equals("ALL")) {
|
||||
List<EmailInfo> emails = getEmails.apply(rsrc);
|
||||
for (EmailInfo e : emails) {
|
||||
@@ -281,8 +282,8 @@ final class SetAccountCommand extends SshCommand {
|
||||
}
|
||||
}
|
||||
|
||||
private void putPreferred(String email) throws RestApiException,
|
||||
OrmException {
|
||||
private void putPreferred(String email)
|
||||
throws RestApiException, OrmException, IOException {
|
||||
for (EmailInfo e : getEmails.apply(rsrc)) {
|
||||
if (e.email.equals(email)) {
|
||||
putPreferred.apply(new AccountResource.Email(user, email), null);
|
||||
|
||||
Reference in New Issue
Block a user