Move RenameGroupOp to group.db package and make package-private

Configure the binding through a new public module, GroupDbModule.

Change-Id: I5e2bb9b05360e12cb2a8abfda937bf5b9b19ea6a
This commit is contained in:
Dave Borowitz
2018-04-02 13:51:57 -04:00
parent ef0c89924d
commit e1de0aff63
5 changed files with 31 additions and 5 deletions

View File

@@ -134,6 +134,7 @@ import com.google.gerrit.server.git.validators.RefOperationValidationListener;
import com.google.gerrit.server.git.validators.RefOperationValidators;
import com.google.gerrit.server.git.validators.UploadValidationListener;
import com.google.gerrit.server.git.validators.UploadValidators;
import com.google.gerrit.server.group.db.GroupDbModule;
import com.google.gerrit.server.index.change.ReindexAfterRefUpdate;
import com.google.gerrit.server.mail.AutoReplyMailFilter;
import com.google.gerrit.server.mail.EmailModule;
@@ -239,6 +240,7 @@ public class GerritGlobalModule extends FactoryModule {
install(new EmailModule());
install(new ExternalIdModule());
install(new GitModule());
install(new GroupDbModule());
install(new GroupModule());
install(new NoteDbModule(cfg));
install(new PrologModule());

View File

@@ -24,7 +24,6 @@ import org.eclipse.jgit.transport.PostUploadHook;
public class GitModule extends FactoryModule {
@Override
protected void configure() {
factory(RenameGroupOp.Factory.class);
factory(MetaDataUpdate.InternalFactory.class);
bind(MetaDataUpdate.Server.class);
DynamicSet.bind(binder(), PostUploadHook.class).to(UploadPackMetricsHook.class);

View File

@@ -0,0 +1,24 @@
// Copyright (C) 2018 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.server.group.db;
import com.google.gerrit.extensions.config.FactoryModule;
public class GroupDbModule extends FactoryModule {
@Override
protected void configure() {
factory(RenameGroupOp.Factory.class);
}
}

View File

@@ -38,7 +38,6 @@ import com.google.gerrit.server.config.GerritServerId;
import com.google.gerrit.server.extensions.events.GitReferenceUpdated;
import com.google.gerrit.server.git.GitRepositoryManager;
import com.google.gerrit.server.git.LockFailureException;
import com.google.gerrit.server.git.RenameGroupOp;
import com.google.gerrit.server.git.meta.MetaDataUpdate;
import com.google.gerrit.server.group.InternalGroup;
import com.google.gerrit.server.index.group.GroupIndexer;

View File

@@ -12,11 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.git;
package com.google.gerrit.server.group.db;
import com.google.gerrit.common.data.GroupReference;
import com.google.gerrit.reviewdb.client.AccountGroup;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.server.git.DefaultQueueOp;
import com.google.gerrit.server.git.WorkQueue;
import com.google.gerrit.server.git.meta.MetaDataUpdate;
import com.google.gerrit.server.project.ProjectCache;
import com.google.gerrit.server.project.ProjectConfig;
@@ -33,8 +35,8 @@ import org.eclipse.jgit.lib.PersonIdent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class RenameGroupOp extends DefaultQueueOp {
public interface Factory {
class RenameGroupOp extends DefaultQueueOp {
interface Factory {
RenameGroupOp create(
@Assisted("author") PersonIdent author,
@Assisted AccountGroup.UUID uuid,