Remove GroupAdminService

The old RPC interface for group operations is no longer needed since
all the functionality is now available through the new REST API and the
WebUI has been adapted.

Change-Id: I4015cb617fbb01ceb479b9d107e463d722a56082
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2013-02-01 17:13:55 +01:00
committed by Gerrit Code Review
parent accd070eeb
commit 5575c3e975
5 changed files with 0 additions and 138 deletions

View File

@@ -1,31 +0,0 @@
// Copyright (C) 2008 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.common.data;
import com.google.gerrit.common.audit.Audit;
import com.google.gerrit.common.auth.SignInRequired;
import com.google.gerrit.reviewdb.client.AccountGroup;
import com.google.gwtjsonrpc.common.AsyncCallback;
import com.google.gwtjsonrpc.common.RemoteJsonService;
import com.google.gwtjsonrpc.common.RpcImpl;
import com.google.gwtjsonrpc.common.RpcImpl.Version;
@RpcImpl(version = Version.V2_0)
public interface GroupAdminService extends RemoteJsonService {
@Audit
@SignInRequired
void groupDetail(AccountGroup.Id groupId, AccountGroup.UUID uuid,
AsyncCallback<GroupDetail> callback);
}

View File

@@ -14,7 +14,6 @@
package com.google.gerrit.client.admin;
import com.google.gerrit.common.data.GroupAdminService;
import com.google.gerrit.common.data.ProjectAdminService;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gwt.core.client.GWT;
@@ -23,13 +22,9 @@ import com.google.gwtjsonrpc.client.JsonUtil;
public class Util {
public static final AdminConstants C = GWT.create(AdminConstants.class);
public static final AdminMessages M = GWT.create(AdminMessages.class);
public static final GroupAdminService GROUP_SVC;
public static final ProjectAdminService PROJECT_SVC;
static {
GROUP_SVC = GWT.create(GroupAdminService.class);
JsonUtil.bind(GROUP_SVC, "rpc/GroupAdminService");
PROJECT_SVC = GWT.create(ProjectAdminService.class);
JsonUtil.bind(PROJECT_SVC, "rpc/ProjectAdminService");

View File

@@ -32,12 +32,10 @@ public class AccountModule extends RpcServletModule {
factory(AgreementInfoFactory.Factory.class);
factory(DeleteExternalIds.Factory.class);
factory(ExternalIdDetailFactory.Factory.class);
factory(GroupDetailHandler.Factory.class);
factory(RegisterNewEmailSender.Factory.class);
}
});
rpc(AccountSecurityImpl.class);
rpc(AccountServiceImpl.class);
rpc(GroupAdminServiceImpl.class);
}
}

View File

@@ -1,54 +0,0 @@
// Copyright (C) 2008 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.GroupAdminService;
import com.google.gerrit.common.data.GroupDetail;
import com.google.gerrit.httpd.rpc.BaseServiceImplementation;
import com.google.gerrit.reviewdb.client.AccountGroup;
import com.google.gerrit.reviewdb.server.ReviewDb;
import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.account.GroupCache;
import com.google.gwtjsonrpc.common.AsyncCallback;
import com.google.inject.Inject;
import com.google.inject.Provider;
class GroupAdminServiceImpl extends BaseServiceImplementation implements
GroupAdminService {
private final GroupCache groupCache;
private final GroupDetailHandler.Factory groupDetailFactory;
@Inject
GroupAdminServiceImpl(final Provider<ReviewDb> schema,
final Provider<IdentifiedUser> currentUser,
final GroupCache groupCache,
final GroupDetailHandler.Factory groupDetailFactory) {
super(schema, currentUser);
this.groupCache = groupCache;
this.groupDetailFactory = groupDetailFactory;
}
public void groupDetail(AccountGroup.Id groupId, AccountGroup.UUID groupUUID,
AsyncCallback<GroupDetail> callback) {
if (groupId == null && groupUUID != null) {
AccountGroup g = groupCache.get(groupUUID);
if (g != null) {
groupId = g.getId();
}
}
groupDetailFactory.create(groupId).to(callback);
}
}

View File

@@ -1,46 +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.GroupDetail;
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.account.GroupDetailFactory;
import com.google.gwtorm.server.OrmException;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
public class GroupDetailHandler extends Handler<GroupDetail> {
public interface Factory {
GroupDetailHandler create(AccountGroup.Id groupId);
}
private final GroupDetailFactory.Factory groupDetailFactory;
private final AccountGroup.Id groupId;
@Inject
GroupDetailHandler(final GroupDetailFactory.Factory groupDetailFactory,
@Assisted final AccountGroup.Id groupId) {
this.groupDetailFactory = groupDetailFactory;
this.groupId = groupId;
}
@Override
public GroupDetail call() throws OrmException, NoSuchGroupException {
return groupDetailFactory.create(groupId).call();
}
}