From 6b60160dda1911b804b50e8995fcd36844c946e3 Mon Sep 17 00:00:00 2001 From: Simon Lei Date: Tue, 9 Sep 2014 14:09:22 -0400 Subject: [PATCH] Rename GerritUiOptions to GerritOptions This will allow this class to be used for more than just UI. Change-Id: Ic8db0d8a93a0e84b9834aba3cd61584836e896c0 --- .../httpd/{GerritUiOptions.java => GerritOptions.java} | 4 ++-- .../src/main/java/com/google/gerrit/httpd/UrlModule.java | 8 ++++---- .../src/main/java/com/google/gerrit/httpd/WebModule.java | 8 ++++---- .../src/main/java/com/google/gerrit/pgm/Daemon.java | 4 ++-- .../java/com/google/gerrit/httpd/WebAppInitializer.java | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) rename gerrit-httpd/src/main/java/com/google/gerrit/httpd/{GerritUiOptions.java => GerritOptions.java} (91%) diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GerritUiOptions.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GerritOptions.java similarity index 91% rename from gerrit-httpd/src/main/java/com/google/gerrit/httpd/GerritUiOptions.java rename to gerrit-httpd/src/main/java/com/google/gerrit/httpd/GerritOptions.java index cd07320a7a..4c93d26e5a 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GerritUiOptions.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GerritOptions.java @@ -14,10 +14,10 @@ package com.google.gerrit.httpd; -public class GerritUiOptions { +public class GerritOptions { private final boolean headless; - public GerritUiOptions(boolean headless) { + public GerritOptions(boolean headless) { this.headless = headless; } diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java index 3c4dfc5d35..46519590d5 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java @@ -63,11 +63,11 @@ class UrlModule extends ServletModule { } private final UrlConfig cfg; - private GerritUiOptions uiOptions; + private GerritOptions options; - UrlModule(UrlConfig cfg, GerritUiOptions uiOptions) { + UrlModule(UrlConfig cfg, GerritOptions options) { this.cfg = cfg; - this.uiOptions = uiOptions; + this.options = options; } @Override @@ -75,7 +75,7 @@ class UrlModule extends ServletModule { filter("/*").through(Key.get(CacheControlFilter.class)); bind(Key.get(CacheControlFilter.class)).in(SINGLETON); - if (uiOptions.enableDefaultUi()) { + if (options.enableDefaultUi()) { serve("/").with(HostPageServlet.class); serve("/Gerrit").with(LegacyGerritServlet.class); serve("/Gerrit/*").with(legacyGerritScreen()); diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/WebModule.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/WebModule.java index e2adcd5366..d14fa9ad43 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/WebModule.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/WebModule.java @@ -50,18 +50,18 @@ public class WebModule extends LifecycleModule { private final UrlModule.UrlConfig urlConfig; private final boolean wantSSL; private final GitWebConfig gitWebConfig; - private final GerritUiOptions uiOptions; + private final GerritOptions options; @Inject WebModule(final AuthConfig authConfig, final UrlModule.UrlConfig urlConfig, @CanonicalWebUrl @Nullable final String canonicalUrl, - GerritUiOptions uiOptions, + GerritOptions options, final Injector creatingInjector) { this.authConfig = authConfig; this.urlConfig = urlConfig; this.wantSSL = canonicalUrl != null && canonicalUrl.startsWith("https:"); - this.uiOptions = uiOptions; + this.options = options; this.gitWebConfig = creatingInjector.createChildInjector(new AbstractModule() { @@ -110,7 +110,7 @@ public class WebModule extends LifecycleModule { throw new ProvisionException("Unsupported loginType: " + authConfig.getAuthType()); } - install(new UrlModule(urlConfig, uiOptions)); + install(new UrlModule(urlConfig, options)); install(new UiRpcModule()); install(new GerritRequestModule()); install(new GitOverHttpServlet.Module()); diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Daemon.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Daemon.java index 3b0750bebd..8eeb6db171 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Daemon.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Daemon.java @@ -20,7 +20,7 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.MoreObjects; import com.google.gerrit.common.ChangeHookRunner; import com.google.gerrit.httpd.AllRequestFilter; -import com.google.gerrit.httpd.GerritUiOptions; +import com.google.gerrit.httpd.GerritOptions; import com.google.gerrit.httpd.GitOverHttpModule; import com.google.gerrit.httpd.H2CacheBasedWebSession; import com.google.gerrit.httpd.HttpCanonicalWebUrlProvider; @@ -356,7 +356,7 @@ public class Daemon extends SiteProgram { modules.add(new AbstractModule() { @Override protected void configure() { - bind(GerritUiOptions.class).toInstance(new GerritUiOptions(headless)); + bind(GerritOptions.class).toInstance(new GerritOptions(headless)); if (test) { bind(SecureStore.class).toProvider(SecureStoreProvider.class); } diff --git a/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java b/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java index 56b092e971..99db2db57a 100644 --- a/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java +++ b/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java @@ -310,7 +310,7 @@ public class WebAppInitializer extends GuiceServletContextListener modules.add(new AbstractModule() { @Override protected void configure() { - bind(GerritUiOptions.class).toInstance(new GerritUiOptions(false)); + bind(GerritOptions.class).toInstance(new GerritOptions(false)); } }); modules.add(GarbageCollectionRunner.module());