From e24eb699241141cc6b202d29b040cb2b4f55a112 Mon Sep 17 00:00:00 2001 From: Alan Chiu Date: Tue, 4 May 2021 14:52:24 -0700 Subject: [PATCH] fix Signed-off-by: Alan Chiu --- .../envoyproxy/envoymobile/engine/AndroidEngineImpl.java | 6 +++--- .../io/envoyproxy/envoymobile/engine/EnvoyEngine.java | 8 +++----- .../io/envoyproxy/envoymobile/engine/EnvoyEngineImpl.java | 6 +++--- library/kotlin/io/envoyproxy/envoymobile/EngineImpl.kt | 2 +- .../io/envoyproxy/envoymobile/mocks/MockEnvoyEngine.kt | 6 +++++- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/library/java/io/envoyproxy/envoymobile/engine/AndroidEngineImpl.java b/library/java/io/envoyproxy/envoymobile/engine/AndroidEngineImpl.java index 5388b82bed..15e0c857d2 100644 --- a/library/java/io/envoyproxy/envoymobile/engine/AndroidEngineImpl.java +++ b/library/java/io/envoyproxy/envoymobile/engine/AndroidEngineImpl.java @@ -27,12 +27,12 @@ public EnvoyHTTPStream startStream(EnvoyHTTPCallbacks callbacks) { return envoyEngine.startStream(callbacks); } - public int runWithConfig(EnvoyConfiguration envoyConfiguration, String configurationYAML, - String logLevel) { + public int runWithTemplate(String configurationYAML, EnvoyConfiguration envoyConfiguration, + String logLevel) { // re-enable lifecycle-based stat flushing when https://github.com/lyft/envoy-mobile/issues/748 // gets fixed. AndroidAppLifecycleMonitor monitor = new AndroidAppLifecycleMonitor(); // application.registerActivityLifecycleCallbacks(monitor); - return envoyEngine.runWithConfig(envoyConfiguration, configurationYAML, logLevel); + return envoyEngine.runWithTemplate(configurationYAML, envoyConfiguration, logLevel); } @Override diff --git a/library/java/io/envoyproxy/envoymobile/engine/EnvoyEngine.java b/library/java/io/envoyproxy/envoymobile/engine/EnvoyEngine.java index ebc8ad7a08..bfcc0dcdda 100644 --- a/library/java/io/envoyproxy/envoymobile/engine/EnvoyEngine.java +++ b/library/java/io/envoyproxy/envoymobile/engine/EnvoyEngine.java @@ -1,8 +1,6 @@ package io.envoyproxy.envoymobile.engine; import io.envoyproxy.envoymobile.engine.types.EnvoyHTTPCallbacks; -import io.envoyproxy.envoymobile.engine.types.EnvoyLogger; -import io.envoyproxy.envoymobile.engine.types.EnvoyOnEngineRunning; import io.envoyproxy.envoymobile.engine.types.EnvoyStringAccessor; import java.util.Map; @@ -27,13 +25,13 @@ public interface EnvoyEngine { * * The envoyConfiguration is used to resolve the configurationYAML. * - * @param envoyConfiguration The EnvoyConfiguration used to start Envoy. * @param configurationYAML The configuration yaml with which to start Envoy. + * @param envoyConfiguration The EnvoyConfiguration used to start Envoy. * @param logLevel The log level to use when starting Envoy. * @return A status indicating if the action was successful. */ - int runWithConfig(EnvoyConfiguration envoyConfiguration, String configurationYAML, - String logLevel); + int runWithTemplate(String configurationYAML, EnvoyConfiguration envoyConfiguration, + String logLevel); /** * Run the Envoy engine with the provided EnvoyConfiguration and log level. diff --git a/library/java/io/envoyproxy/envoymobile/engine/EnvoyEngineImpl.java b/library/java/io/envoyproxy/envoymobile/engine/EnvoyEngineImpl.java index 14f9c49be0..4721ccd48a 100644 --- a/library/java/io/envoyproxy/envoymobile/engine/EnvoyEngineImpl.java +++ b/library/java/io/envoyproxy/envoymobile/engine/EnvoyEngineImpl.java @@ -52,14 +52,14 @@ public void terminate() { * * The envoyConfiguration is used to resolve the configurationYAML. * - * @param envoyConfiguration The EnvoyConfiguration used to start Envoy. * @param configurationYAML The configuration yaml with which to start Envoy. + * @param envoyConfiguration The EnvoyConfiguration used to start Envoy. * @param logLevel The log level to use when starting Envoy. * @return A status indicating if the action was successful. */ @Override - public int runWithConfig(EnvoyConfiguration envoyConfiguration, String configurationYAML, - String logLevel) { + public int runWithTemplate(String configurationYAML, EnvoyConfiguration envoyConfiguration, + String logLevel) { for (EnvoyHTTPFilterFactory filterFactory : envoyConfiguration.httpPlatformFilterFactories) { JniLibrary.registerFilterFactory(filterFactory.getFilterName(), new JvmFilterFactoryContext(filterFactory)); diff --git a/library/kotlin/io/envoyproxy/envoymobile/EngineImpl.kt b/library/kotlin/io/envoyproxy/envoymobile/EngineImpl.kt index e0984ad9b6..402976c43e 100644 --- a/library/kotlin/io/envoyproxy/envoymobile/EngineImpl.kt +++ b/library/kotlin/io/envoyproxy/envoymobile/EngineImpl.kt @@ -26,7 +26,7 @@ class EngineImpl constructor( streamClient = StreamClientImpl(envoyEngine) pulseClient = PulseClientImpl(envoyEngine) if (configurationYAML != null) { - envoyEngine.runWithConfig(envoyConfiguration, configurationYAML, logLevel.level) + envoyEngine.runWithTemplate(configurationYAML, envoyConfiguration, logLevel.level) } else { envoyEngine.runWithConfig(envoyConfiguration, logLevel.level) } diff --git a/library/kotlin/io/envoyproxy/envoymobile/mocks/MockEnvoyEngine.kt b/library/kotlin/io/envoyproxy/envoymobile/mocks/MockEnvoyEngine.kt index cb5f3e11f6..16ffeaf73f 100644 --- a/library/kotlin/io/envoyproxy/envoymobile/mocks/MockEnvoyEngine.kt +++ b/library/kotlin/io/envoyproxy/envoymobile/mocks/MockEnvoyEngine.kt @@ -12,7 +12,11 @@ import io.envoyproxy.envoymobile.engine.types.EnvoyStringAccessor internal class MockEnvoyEngine : EnvoyEngine { override fun runWithConfig(envoyConfiguration: EnvoyConfiguration?, logLevel: String?): Int = 0 - override fun runWithConfig(envoyConfiguration: EnvoyConfiguration, configurationYAML: String?, logLevel: String?): Int = 0 + override fun runWithTemplate( + configurationYAML: String, + envoyConfiguration: EnvoyConfiguration, + logLevel: String + ): Int = 0 override fun startStream(callbacks: EnvoyHTTPCallbacks?): EnvoyHTTPStream = MockEnvoyHTTPStream(callbacks!!)