Move ChangeMessageStore binding to Module for 3.5
Change-Id: I34b1f934eebdac97275c8739b41bb8c055ed535e
diff --git a/BUILD b/BUILD
index f82e6a8..f02cbee 100644
--- a/BUILD
+++ b/BUILD
@@ -55,8 +55,6 @@
"Implementation-Title: Depends-on Plugin",
"Implementation-URL: https://gerrit-review.googlesource.com/#/admin/projects/plugins/" + plugin_name,
"Gerrit-Module: com.googlesource.gerrit.plugins.depends.on.Module",
- "Gerrit-SshModule: com.googlesource.gerrit.plugins.depends.on.SshModule",
- "Gerrit-HttpModule: com.googlesource.gerrit.plugins.depends.on.HttpModule",
],
resources = glob(["src/main/resources/**/*"]),
deps = [
diff --git a/src/main/java/com/googlesource/gerrit/plugins/depends/on/HttpModule.java b/src/main/java/com/googlesource/gerrit/plugins/depends/on/HttpModule.java
deleted file mode 100644
index 999dcc6..0000000
--- a/src/main/java/com/googlesource/gerrit/plugins/depends/on/HttpModule.java
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (C) 2021 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.googlesource.gerrit.plugins.depends.on;
-
-import com.google.gerrit.extensions.annotations.Exports;
-import com.google.gerrit.httpd.plugins.HttpPluginModule;
-import com.google.gerrit.server.DynamicOptions.DynamicBean;
-import com.google.gerrit.server.restapi.change.QueryChanges;
-
-public class HttpModule extends HttpPluginModule {
- @Override
- protected void configureServlets() {
- bind(DynamicBean.class)
- .annotatedWith(Exports.named(QueryChanges.class))
- .to(ChangeMessageStore.class);
- }
-}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/depends/on/Module.java b/src/main/java/com/googlesource/gerrit/plugins/depends/on/Module.java
index 102eb9c..10f0e1e 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/depends/on/Module.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/depends/on/Module.java
@@ -14,13 +14,25 @@
package com.googlesource.gerrit.plugins.depends.on;
+import com.google.gerrit.extensions.annotations.Exports;
import com.google.gerrit.extensions.registration.DynamicSet;
+import com.google.gerrit.server.DynamicOptions.DynamicBean;
import com.google.gerrit.server.events.EventListener;
+import com.google.gerrit.server.restapi.change.GetChange;
+import com.google.gerrit.server.restapi.change.QueryChanges;
+import com.google.gerrit.sshd.commands.Query;
import com.google.inject.AbstractModule;
public class Module extends AbstractModule {
@Override
protected void configure() {
DynamicSet.bind(binder(), EventListener.class).to(CoreListener.class);
+ bind(DynamicBean.class)
+ .annotatedWith(Exports.named(GetChange.class))
+ .to(ChangeMessageStore.class);
+ bind(DynamicBean.class).annotatedWith(Exports.named(Query.class)).to(ChangeMessageStore.class);
+ bind(DynamicBean.class)
+ .annotatedWith(Exports.named(QueryChanges.class))
+ .to(ChangeMessageStore.class);
}
}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/depends/on/SshModule.java b/src/main/java/com/googlesource/gerrit/plugins/depends/on/SshModule.java
deleted file mode 100644
index 1631433..0000000
--- a/src/main/java/com/googlesource/gerrit/plugins/depends/on/SshModule.java
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (C) 2021 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.googlesource.gerrit.plugins.depends.on;
-
-import com.google.gerrit.extensions.annotations.Exports;
-import com.google.gerrit.server.DynamicOptions.DynamicBean;
-import com.google.gerrit.sshd.PluginCommandModule;
-import com.google.gerrit.sshd.commands.Query;
-
-public class SshModule extends PluginCommandModule {
- @Override
- public void configureCommands() {
- bind(DynamicBean.class).annotatedWith(Exports.named(Query.class)).to(ChangeMessageStore.class);
- }
-}