diff --git a/java/google/registry/proxy/BUILD b/java/google/registry/proxy/BUILD index 79719ae3e..c6d3969d5 100644 --- a/java/google/registry/proxy/BUILD +++ b/java/google/registry/proxy/BUILD @@ -18,6 +18,7 @@ java_library( "config/*.yaml", ]), deps = [ + "//java/com/google/common/logging:formatting_logger", "//java/google/registry/config", "//java/google/registry/util", "@com_beust_jcommander", diff --git a/java/google/registry/proxy/CertificateModule.java b/java/google/registry/proxy/CertificateModule.java index a8ad05bac..b5b69a2ad 100644 --- a/java/google/registry/proxy/CertificateModule.java +++ b/java/google/registry/proxy/CertificateModule.java @@ -19,11 +19,11 @@ import static com.google.common.collect.ImmutableList.toImmutableList; import static java.nio.charset.StandardCharsets.UTF_8; import com.google.common.collect.ImmutableList; +import com.google.common.logging.FormattingLogger; import dagger.Lazy; import dagger.Module; import dagger.Provides; import google.registry.proxy.ProxyConfig.Environment; -import google.registry.util.FormattingLogger; import io.netty.handler.ssl.util.SelfSignedCertificate; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/java/google/registry/proxy/EppProtocolModule.java b/java/google/registry/proxy/EppProtocolModule.java index 35a173232..c454f0342 100644 --- a/java/google/registry/proxy/EppProtocolModule.java +++ b/java/google/registry/proxy/EppProtocolModule.java @@ -17,6 +17,7 @@ package google.registry.proxy; import static google.registry.util.ResourceUtils.readResourceBytes; import com.google.common.collect.ImmutableList; +import com.google.common.logging.FormattingLogger; import dagger.Module; import dagger.Provides; import dagger.multibindings.IntoSet; @@ -33,7 +34,6 @@ import google.registry.proxy.quota.QuotaConfig; import google.registry.proxy.quota.QuotaManager; import google.registry.proxy.quota.TokenStore; import google.registry.util.Clock; -import google.registry.util.FormattingLogger; import io.netty.channel.ChannelHandler; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.codec.LengthFieldBasedFrameDecoder; diff --git a/java/google/registry/proxy/MetricsModule.java b/java/google/registry/proxy/MetricsModule.java index 6086f6e4f..c128be1f7 100644 --- a/java/google/registry/proxy/MetricsModule.java +++ b/java/google/registry/proxy/MetricsModule.java @@ -19,6 +19,7 @@ import com.google.api.client.googleapis.util.Utils; import com.google.api.services.monitoring.v3.Monitoring; import com.google.api.services.monitoring.v3.model.MonitoredResource; import com.google.common.collect.ImmutableMap; +import com.google.common.logging.FormattingLogger; import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.google.monitoring.metrics.MetricReporter; import com.google.monitoring.metrics.MetricWriter; @@ -28,7 +29,6 @@ import dagger.Module; import dagger.Provides; import google.registry.proxy.ProxyConfig.Environment; import google.registry.proxy.metric.MetricParameters; -import google.registry.util.FormattingLogger; import javax.inject.Singleton; /** Module that provides necessary bindings to instantiate a {@link MetricReporter} */ diff --git a/java/google/registry/proxy/ProxyModule.java b/java/google/registry/proxy/ProxyModule.java index ab8c51120..fa5a7a07a 100644 --- a/java/google/registry/proxy/ProxyModule.java +++ b/java/google/registry/proxy/ProxyModule.java @@ -28,6 +28,7 @@ import com.google.api.services.cloudkms.v1.model.DecryptRequest; import com.google.api.services.storage.Storage; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; +import com.google.common.logging.FormattingLogger; import com.google.monitoring.metrics.MetricReporter; import dagger.Component; import dagger.Module; @@ -38,7 +39,6 @@ import google.registry.proxy.Protocol.FrontendProtocol; import google.registry.proxy.ProxyConfig.Environment; import google.registry.proxy.WhoisProtocolModule.WhoisProtocol; import google.registry.util.Clock; -import google.registry.util.FormattingLogger; import google.registry.util.SystemClock; import io.netty.handler.logging.LogLevel; import io.netty.handler.logging.LoggingHandler; diff --git a/java/google/registry/proxy/ProxyServer.java b/java/google/registry/proxy/ProxyServer.java index e896ceffe..a7f4dcf6b 100644 --- a/java/google/registry/proxy/ProxyServer.java +++ b/java/google/registry/proxy/ProxyServer.java @@ -20,11 +20,11 @@ import static google.registry.proxy.handler.RelayHandler.RELAY_CHANNEL_KEY; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.flogger.FluentLogger; +import com.google.common.logging.FormattingLogger; import com.google.monitoring.metrics.MetricReporter; import google.registry.proxy.Protocol.BackendProtocol; import google.registry.proxy.Protocol.FrontendProtocol; import google.registry.proxy.ProxyModule.ProxyComponent; -import google.registry.util.FormattingLogger; import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.Channel; diff --git a/java/google/registry/proxy/handler/EppServiceHandler.java b/java/google/registry/proxy/handler/EppServiceHandler.java index 36916d551..f64cd82a2 100644 --- a/java/google/registry/proxy/handler/EppServiceHandler.java +++ b/java/google/registry/proxy/handler/EppServiceHandler.java @@ -20,8 +20,8 @@ import static google.registry.proxy.handler.ProxyProtocolHandler.REMOTE_ADDRESS_ import static google.registry.proxy.handler.SslServerInitializer.CLIENT_CERTIFICATE_PROMISE_KEY; import static google.registry.util.X509Utils.getCertificateHash; +import com.google.common.logging.FormattingLogger; import google.registry.proxy.metric.FrontendMetrics; -import google.registry.util.FormattingLogger; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelFuture; diff --git a/java/google/registry/proxy/handler/HttpsRelayServiceHandler.java b/java/google/registry/proxy/handler/HttpsRelayServiceHandler.java index f9a3c630b..6104d5688 100644 --- a/java/google/registry/proxy/handler/HttpsRelayServiceHandler.java +++ b/java/google/registry/proxy/handler/HttpsRelayServiceHandler.java @@ -17,8 +17,8 @@ package google.registry.proxy.handler; import static com.google.common.base.Preconditions.checkArgument; import static java.nio.charset.StandardCharsets.UTF_8; +import com.google.common.logging.FormattingLogger; import google.registry.proxy.metric.FrontendMetrics; -import google.registry.util.FormattingLogger; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelHandlerContext; diff --git a/java/google/registry/proxy/handler/ProxyProtocolHandler.java b/java/google/registry/proxy/handler/ProxyProtocolHandler.java index 0856d1665..e0bfd609e 100644 --- a/java/google/registry/proxy/handler/ProxyProtocolHandler.java +++ b/java/google/registry/proxy/handler/ProxyProtocolHandler.java @@ -17,7 +17,7 @@ package google.registry.proxy.handler; import static com.google.common.base.Preconditions.checkState; import static java.nio.charset.StandardCharsets.US_ASCII; -import google.registry.util.FormattingLogger; +import com.google.common.logging.FormattingLogger; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.ByteToMessageDecoder; diff --git a/java/google/registry/proxy/handler/RelayHandler.java b/java/google/registry/proxy/handler/RelayHandler.java index 6df16e9ea..33557c4a1 100644 --- a/java/google/registry/proxy/handler/RelayHandler.java +++ b/java/google/registry/proxy/handler/RelayHandler.java @@ -16,7 +16,7 @@ package google.registry.proxy.handler; import static com.google.common.base.Preconditions.checkNotNull; -import google.registry.util.FormattingLogger; +import com.google.common.logging.FormattingLogger; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelHandlerContext; @@ -47,7 +47,7 @@ public class RelayHandler extends SimpleChannelInboundHandler { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { logger.severefmt(cause, "Inbound exception caught for channel %s", ctx.channel()); - ctx.close(); + ChannelFuture unusedFuture = ctx.close(); } /** Close relay channel if this channel is closed. */ @@ -55,7 +55,7 @@ public class RelayHandler extends SimpleChannelInboundHandler { public void channelInactive(ChannelHandlerContext ctx) throws Exception { Channel relayChannel = ctx.channel().attr(RELAY_CHANNEL_KEY).get(); if (relayChannel != null) { - relayChannel.close(); + ChannelFuture unusedFuture = relayChannel.close(); } ctx.fireChannelInactive(); } @@ -72,12 +72,12 @@ public class RelayHandler extends SimpleChannelInboundHandler { future -> { // Cannot write into relay channel, close this channel. if (!future.isSuccess()) { - ctx.close(); + ChannelFuture unusedFuture = ctx.close(); } }); } else { // close this channel if the relay channel is closed. - ctx.close(); + ChannelFuture unusedFuture = ctx.close(); } } diff --git a/java/google/registry/proxy/handler/SslClientInitializer.java b/java/google/registry/proxy/handler/SslClientInitializer.java index 792ae34f7..9b96d158d 100644 --- a/java/google/registry/proxy/handler/SslClientInitializer.java +++ b/java/google/registry/proxy/handler/SslClientInitializer.java @@ -17,9 +17,9 @@ package google.registry.proxy.handler; import static com.google.common.base.Preconditions.checkNotNull; import static google.registry.proxy.Protocol.PROTOCOL_KEY; +import com.google.common.logging.FormattingLogger; import google.registry.proxy.HttpsRelayProtocolModule.HttpsRelayProtocol; import google.registry.proxy.Protocol.BackendProtocol; -import google.registry.util.FormattingLogger; import io.netty.channel.Channel; import io.netty.channel.ChannelHandler.Sharable; import io.netty.channel.ChannelInitializer; diff --git a/java/google/registry/proxy/handler/SslServerInitializer.java b/java/google/registry/proxy/handler/SslServerInitializer.java index abb185326..b4e1aa178 100644 --- a/java/google/registry/proxy/handler/SslServerInitializer.java +++ b/java/google/registry/proxy/handler/SslServerInitializer.java @@ -14,8 +14,8 @@ package google.registry.proxy.handler; +import com.google.common.logging.FormattingLogger; import google.registry.proxy.CertificateModule.EppCertificates; -import google.registry.util.FormattingLogger; import io.netty.channel.Channel; import io.netty.channel.ChannelHandler.Sharable; import io.netty.channel.ChannelInitializer; diff --git a/java/google/registry/proxy/metric/MetricParameters.java b/java/google/registry/proxy/metric/MetricParameters.java index 316a9f4b8..64abb6f68 100644 --- a/java/google/registry/proxy/metric/MetricParameters.java +++ b/java/google/registry/proxy/metric/MetricParameters.java @@ -19,7 +19,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; import com.google.api.services.monitoring.v3.model.MonitoredResource; import com.google.common.collect.ImmutableMap; import com.google.common.io.CharStreams; -import google.registry.util.FormattingLogger; +import com.google.common.logging.FormattingLogger; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; diff --git a/java/google/registry/proxy/quota/TokenStore.java b/java/google/registry/proxy/quota/TokenStore.java index 017b7d1f7..5cf7433fe 100644 --- a/java/google/registry/proxy/quota/TokenStore.java +++ b/java/google/registry/proxy/quota/TokenStore.java @@ -20,8 +20,8 @@ import static java.lang.StrictMath.min; import com.google.auto.value.AutoValue; import com.google.common.annotations.VisibleForTesting; +import com.google.common.logging.FormattingLogger; import google.registry.util.Clock; -import google.registry.util.FormattingLogger; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledExecutorService;