Remove RPC's for listing all groups and my groups
These RPC's are not needed anymore since there is now a REST API to retrieve the groups. Change-Id: I92603f4fdc74da1bd7bcf3e55917bb38264f060a Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:

committed by
Gerrit Code Review

parent
d57c3fd834
commit
2d7561ddab
@@ -18,7 +18,6 @@ import com.google.gerrit.common.audit.Audit;
|
||||
import com.google.gerrit.common.auth.SignInRequired;
|
||||
import com.google.gerrit.reviewdb.client.Account;
|
||||
import com.google.gerrit.reviewdb.client.AccountExternalId;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
import com.google.gerrit.reviewdb.client.AccountSshKey;
|
||||
import com.google.gerrit.reviewdb.client.ContactInformation;
|
||||
import com.google.gwtjsonrpc.common.AsyncCallback;
|
||||
@@ -61,9 +60,6 @@ public interface AccountSecurity extends RemoteJsonService {
|
||||
@SignInRequired
|
||||
void myExternalIds(AsyncCallback<List<AccountExternalId>> callback);
|
||||
|
||||
@SignInRequired
|
||||
void myGroups(AsyncCallback<List<AccountGroup>> callback);
|
||||
|
||||
@Audit
|
||||
@SignInRequired
|
||||
void deleteExternalIds(Set<AccountExternalId.Key> keys,
|
||||
|
@@ -29,10 +29,6 @@ import java.util.Set;
|
||||
|
||||
@RpcImpl(version = Version.V2_0)
|
||||
public interface GroupAdminService extends RemoteJsonService {
|
||||
@Audit
|
||||
@SignInRequired
|
||||
void visibleGroups(AsyncCallback<GroupList> callback);
|
||||
|
||||
@Audit
|
||||
@SignInRequired
|
||||
void createGroup(String newName, AsyncCallback<AccountGroup.Id> callback);
|
||||
|
@@ -34,10 +34,8 @@ public class AccountModule extends RpcServletModule {
|
||||
factory(DeleteExternalIds.Factory.class);
|
||||
factory(ExternalIdDetailFactory.Factory.class);
|
||||
factory(GroupDetailHandler.Factory.class);
|
||||
factory(MyGroupsFactory.Factory.class);
|
||||
factory(RegisterNewEmailSender.Factory.class);
|
||||
factory(RenameGroup.Factory.class);
|
||||
factory(VisibleGroupsHandler.Factory.class);
|
||||
}
|
||||
});
|
||||
rpc(AccountSecurityImpl.class);
|
||||
|
@@ -22,7 +22,6 @@ import com.google.gerrit.common.errors.EmailException;
|
||||
import com.google.gerrit.common.errors.InvalidSshKeyException;
|
||||
import com.google.gerrit.common.errors.NameAlreadyUsedException;
|
||||
import com.google.gerrit.common.errors.NoSuchEntityException;
|
||||
import com.google.gerrit.common.errors.NoSuchGroupException;
|
||||
import com.google.gerrit.httpd.rpc.BaseServiceImplementation;
|
||||
import com.google.gerrit.httpd.rpc.Handler;
|
||||
import com.google.gerrit.reviewdb.client.Account;
|
||||
@@ -86,7 +85,6 @@ class AccountSecurityImpl extends BaseServiceImplementation implements
|
||||
private final ChangeUserName.CurrentUser changeUserNameFactory;
|
||||
private final DeleteExternalIds.Factory deleteExternalIdsFactory;
|
||||
private final ExternalIdDetailFactory.Factory externalIdDetailFactory;
|
||||
private final MyGroupsFactory.Factory myGroupsFactory;
|
||||
|
||||
private final ChangeHooks hooks;
|
||||
private final GroupCache groupCache;
|
||||
@@ -104,7 +102,6 @@ class AccountSecurityImpl extends BaseServiceImplementation implements
|
||||
final ChangeUserName.CurrentUser changeUserNameFactory,
|
||||
final DeleteExternalIds.Factory deleteExternalIdsFactory,
|
||||
final ExternalIdDetailFactory.Factory externalIdDetailFactory,
|
||||
final MyGroupsFactory.Factory myGroupsFactory,
|
||||
final ChangeHooks hooks, final GroupCache groupCache) {
|
||||
super(schema, currentUser);
|
||||
contactStore = cs;
|
||||
@@ -126,7 +123,6 @@ class AccountSecurityImpl extends BaseServiceImplementation implements
|
||||
this.changeUserNameFactory = changeUserNameFactory;
|
||||
this.deleteExternalIdsFactory = deleteExternalIdsFactory;
|
||||
this.externalIdDetailFactory = externalIdDetailFactory;
|
||||
this.myGroupsFactory = myGroupsFactory;
|
||||
this.hooks = hooks;
|
||||
this.groupCache = groupCache;
|
||||
}
|
||||
@@ -211,16 +207,6 @@ class AccountSecurityImpl extends BaseServiceImplementation implements
|
||||
externalIdDetailFactory.create().to(callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void myGroups(final AsyncCallback<List<AccountGroup>> callback) {
|
||||
run(callback, new Action<List<AccountGroup>>() {
|
||||
public List<AccountGroup> run(final ReviewDb db) throws OrmException,
|
||||
NoSuchGroupException, Failure {
|
||||
return myGroupsFactory.create().call();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void deleteExternalIds(final Set<AccountExternalId.Key> keys,
|
||||
final AsyncCallback<Set<AccountExternalId.Key>> callback) {
|
||||
deleteExternalIdsFactory.create(keys).to(callback);
|
||||
|
@@ -16,7 +16,6 @@ package com.google.gerrit.httpd.rpc.account;
|
||||
|
||||
import com.google.gerrit.common.data.GroupAdminService;
|
||||
import com.google.gerrit.common.data.GroupDetail;
|
||||
import com.google.gerrit.common.data.GroupList;
|
||||
import com.google.gerrit.common.data.GroupOptions;
|
||||
import com.google.gerrit.common.data.GroupReference;
|
||||
import com.google.gerrit.common.errors.InactiveAccountException;
|
||||
@@ -69,7 +68,6 @@ class GroupAdminServiceImpl extends BaseServiceImplementation implements
|
||||
private final CreateGroup.Factory createGroupFactory;
|
||||
private final RenameGroup.Factory renameGroupFactory;
|
||||
private final GroupDetailHandler.Factory groupDetailFactory;
|
||||
private final VisibleGroupsHandler.Factory visibleGroupsFactory;
|
||||
|
||||
@Inject
|
||||
GroupAdminServiceImpl(final Provider<ReviewDb> schema,
|
||||
@@ -84,8 +82,7 @@ class GroupAdminServiceImpl extends BaseServiceImplementation implements
|
||||
final GroupControl.Factory groupControlFactory,
|
||||
final CreateGroup.Factory createGroupFactory,
|
||||
final RenameGroup.Factory renameGroupFactory,
|
||||
final GroupDetailHandler.Factory groupDetailFactory,
|
||||
final VisibleGroupsHandler.Factory visibleGroupsFactory) {
|
||||
final GroupDetailHandler.Factory groupDetailFactory) {
|
||||
super(schema, currentUser);
|
||||
this.accountCache = accountCache;
|
||||
this.groupIncludeCache = groupIncludeCache;
|
||||
@@ -98,11 +95,6 @@ class GroupAdminServiceImpl extends BaseServiceImplementation implements
|
||||
this.createGroupFactory = createGroupFactory;
|
||||
this.renameGroupFactory = renameGroupFactory;
|
||||
this.groupDetailFactory = groupDetailFactory;
|
||||
this.visibleGroupsFactory = visibleGroupsFactory;
|
||||
}
|
||||
|
||||
public void visibleGroups(final AsyncCallback<GroupList> callback) {
|
||||
visibleGroupsFactory.create().to(callback);
|
||||
}
|
||||
|
||||
public void createGroup(final String newName,
|
||||
|
@@ -1,46 +0,0 @@
|
||||
// Copyright (C) 2009 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.gerrit.httpd.rpc.account;
|
||||
|
||||
import com.google.gerrit.common.errors.NoSuchGroupException;
|
||||
import com.google.gerrit.httpd.rpc.Handler;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
import com.google.gerrit.server.IdentifiedUser;
|
||||
import com.google.gerrit.server.account.VisibleGroups;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
class MyGroupsFactory extends Handler<List<AccountGroup>> {
|
||||
interface Factory {
|
||||
MyGroupsFactory create();
|
||||
}
|
||||
|
||||
private final VisibleGroups.Factory visibleGroupsFactory;
|
||||
private final IdentifiedUser user;
|
||||
|
||||
@Inject
|
||||
MyGroupsFactory(final VisibleGroups.Factory visibleGroupsFactory, final IdentifiedUser user) {
|
||||
this.visibleGroupsFactory = visibleGroupsFactory;
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccountGroup> call() throws OrmException, NoSuchGroupException {
|
||||
final VisibleGroups visibleGroups = visibleGroupsFactory.create();
|
||||
return visibleGroups.get(user).getGroups();
|
||||
}
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
// Copyright (C) 2011 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.gerrit.httpd.rpc.account;
|
||||
|
||||
import com.google.gerrit.common.data.GroupList;
|
||||
import com.google.gerrit.httpd.rpc.Handler;
|
||||
import com.google.gerrit.server.account.VisibleGroups;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
public class VisibleGroupsHandler extends Handler<GroupList> {
|
||||
|
||||
interface Factory {
|
||||
VisibleGroupsHandler create();
|
||||
}
|
||||
|
||||
private final VisibleGroups.Factory visibleGroupsFactory;
|
||||
|
||||
@Inject
|
||||
VisibleGroupsHandler(final VisibleGroups.Factory visibleGroupsFactory) {
|
||||
this.visibleGroupsFactory = visibleGroupsFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GroupList call() throws Exception {
|
||||
return visibleGroupsFactory.create().get();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user