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>
diff --git a/gerrit-common/src/main/java/com/google/gerrit/common/data/GroupAdminService.java b/gerrit-common/src/main/java/com/google/gerrit/common/data/GroupAdminService.java
deleted file mode 100644
index 32b85d4..0000000
--- a/gerrit-common/src/main/java/com/google/gerrit/common/data/GroupAdminService.java
+++ /dev/null
@@ -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);
-}
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/Util.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/Util.java
index 4f8dd99..1696c43 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/Util.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/Util.java
@@ -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 @@
 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");
 
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/account/AccountModule.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/account/AccountModule.java
index 31e0874..bef6316 100644
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/account/AccountModule.java
+++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/account/AccountModule.java
@@ -32,12 +32,10 @@
         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);
   }
 }
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/account/GroupAdminServiceImpl.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/account/GroupAdminServiceImpl.java
deleted file mode 100644
index 0f2978a..0000000
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/account/GroupAdminServiceImpl.java
+++ /dev/null
@@ -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);
-  }
-}
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/account/GroupDetailHandler.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/account/GroupDetailHandler.java
deleted file mode 100644
index ce74218..0000000
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/account/GroupDetailHandler.java
+++ /dev/null
@@ -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();
-  }
-}