diff --git a/build.gradle b/build.gradle index e14f3f5d9..5a756e662 100644 --- a/build.gradle +++ b/build.gradle @@ -236,9 +236,7 @@ subprojects { } } - if (project.name == 'util') return - if (project.name == 'proxy') return - if (project.name == 'core') return + if (['util', 'proxy', 'core', 'prober'].contains(project.name)) return test { testLogging.showStandardStreams = Boolean.parseBoolean(showAllOutput) diff --git a/prober/build.gradle b/prober/build.gradle index e287bfd1b..8551d11f7 100644 --- a/prober/build.gradle +++ b/prober/build.gradle @@ -4,7 +4,7 @@ // 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 +// 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, @@ -12,38 +12,36 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'java' - createUberJar('deployJar', 'prober', 'google.registry.monitoring.blackbox.Prober') dependencies { - def deps = rootProject.dependencyMap + def deps = rootProject.dependencyMap - compile deps['com.google.auto.value:auto-value-annotations'] - compile deps['com.google.dagger:dagger'] - compile deps['com.google.flogger:flogger'] - compile deps['com.google.guava:guava'] - compile deps['io.netty:netty-buffer'] - compile deps['io.netty:netty-codec-http'] - compile deps['io.netty:netty-codec'] - compile deps['io.netty:netty-common'] - compile deps['io.netty:netty-handler'] - compile deps['io.netty:netty-transport'] - compile deps['javax.inject:javax.inject'] + compile deps['com.google.auto.value:auto-value-annotations'] + compile deps['com.google.dagger:dagger'] + compile deps['com.google.flogger:flogger'] + compile deps['com.google.guava:guava'] + compile deps['io.netty:netty-buffer'] + compile deps['io.netty:netty-codec-http'] + compile deps['io.netty:netty-codec'] + compile deps['io.netty:netty-common'] + compile deps['io.netty:netty-handler'] + compile deps['io.netty:netty-transport'] + compile deps['javax.inject:javax.inject'] - runtime deps['com.google.flogger:flogger-system-backend'] - runtime deps['com.google.auto.value:auto-value'] - runtime deps['io.netty:netty-tcnative-boringssl-static'] + runtime deps['com.google.flogger:flogger-system-backend'] + runtime deps['com.google.auto.value:auto-value'] + runtime deps['io.netty:netty-tcnative-boringssl-static'] - testCompile deps['com.google.truth:truth'] - testCompile deps['junit:junit'] - testCompile deps['org.mockito:mockito-core'] - testCompile project(':third_party') + testCompile deps['com.google.truth:truth'] + testCompile deps['junit:junit'] + testCompile deps['org.mockito:mockito-core'] + testCompile project(':third_party') - // Include auto-value in compile until nebula-lint understands - // annotationProcessor - annotationProcessor deps['com.google.auto.value:auto-value'] - testAnnotationProcessor deps['com.google.auto.value:auto-value'] - annotationProcessor deps['com.google.dagger:dagger-compiler'] - testAnnotationProcessor deps['com.google.dagger:dagger-compiler'] + // Include auto-value in compile until nebula-lint understands + // annotationProcessor + annotationProcessor deps['com.google.auto.value:auto-value'] + testAnnotationProcessor deps['com.google.auto.value:auto-value'] + annotationProcessor deps['com.google.dagger:dagger-compiler'] + testAnnotationProcessor deps['com.google.dagger:dagger-compiler'] } diff --git a/prober/src/main/java/google/registry/monitoring/blackbox/Protocol.java b/prober/src/main/java/google/registry/monitoring/blackbox/Protocol.java index b0071ea44..271af3c67 100644 --- a/prober/src/main/java/google/registry/monitoring/blackbox/Protocol.java +++ b/prober/src/main/java/google/registry/monitoring/blackbox/Protocol.java @@ -41,14 +41,16 @@ public abstract class Protocol { return new AutoValue_Protocol.Builder(); } + /** Builder for {@link Protocol}. */ @AutoValue.Builder - public static abstract class Builder { + public abstract static class Builder { public abstract Builder name(String value); public abstract Builder port(int num); - public abstract Builder handlerProviders(ImmutableList> providers); + public abstract Builder handlerProviders( + ImmutableList> providers); public abstract Builder persistentConnection(boolean value); diff --git a/prober/src/main/java/google/registry/monitoring/blackbox/handlers/ActionHandler.java b/prober/src/main/java/google/registry/monitoring/blackbox/handlers/ActionHandler.java index dfd88cba1..f0d9ac023 100644 --- a/prober/src/main/java/google/registry/monitoring/blackbox/handlers/ActionHandler.java +++ b/prober/src/main/java/google/registry/monitoring/blackbox/handlers/ActionHandler.java @@ -17,22 +17,23 @@ package google.registry.monitoring.blackbox.handlers; import com.google.common.flogger.FluentLogger; import google.registry.monitoring.blackbox.messages.InboundMessageType; import google.registry.monitoring.blackbox.messages.OutboundMessageType; -import io.netty.channel.SimpleChannelInboundHandler; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelPromise; +import io.netty.channel.SimpleChannelInboundHandler; /** - *Superclass of all {@link ChannelHandler}s placed at end of channel pipeline + * Superclass of all {@link ChannelHandler}s placed at end of channel pipeline * - *

{@code ActionHandler} inherits from {@link SimpleChannelInboundHandler< InboundMessageType >}, as it should only be passed in - * messages that implement the {@link InboundMessageType} interface.

+ *

{@code ActionHandler} inherits from {@link SimpleChannelInboundHandler< InboundMessageType >}, + * as it should only be passed in messages that implement the {@link InboundMessageType} interface. * - *

The {@code ActionHandler} skeleton exists for a few main purposes. First, it returns a {@link ChannelPromise}, - * which informs the {@link ProbingAction} in charge that a response has been read. Second, it stores the {@link OutboundMessageType} - * passed down the pipeline, so that subclasses can use that information for their own processes. Lastly, with any exception - * thrown, the connection is closed, and the ProbingAction governing this channel is informed of the error. Subclasses - * specify further work to be done for specific kinds of channel pipelines.

+ *

The {@code ActionHandler} skeleton exists for a few main purposes. First, it returns a {@link + * ChannelPromise}, which informs the {@link ProbingAction} in charge that a response has been read. + * Second, it stores the {@link OutboundMessageType} passed down the pipeline, so that subclasses + * can use that information for their own processes. Lastly, with any exception thrown, the + * connection is closed, and the ProbingAction governing this channel is informed of the error. + * Subclasses specify further work to be done for specific kinds of channel pipelines. */ public abstract class ActionHandler extends SimpleChannelInboundHandler { @@ -40,7 +41,10 @@ public abstract class ActionHandler extends SimpleChannelInboundHandler logger.atInfo().log("Unsuccessful channel connection closed")); } } - diff --git a/prober/src/main/java/google/registry/monitoring/blackbox/messages/InboundMessageType.java b/prober/src/main/java/google/registry/monitoring/blackbox/messages/InboundMessageType.java index 0c1260bec..84b77f89d 100644 --- a/prober/src/main/java/google/registry/monitoring/blackbox/messages/InboundMessageType.java +++ b/prober/src/main/java/google/registry/monitoring/blackbox/messages/InboundMessageType.java @@ -15,7 +15,7 @@ package google.registry.monitoring.blackbox.messages; /** - * Marker Interface that is implemented by all classes that serve as {@code inboundMessages} in channel pipeline + * Marker Interface that is implemented by all classes that serve as {@code inboundMessages} in + * channel pipeline */ public interface InboundMessageType {} - diff --git a/prober/src/main/java/google/registry/monitoring/blackbox/messages/OutboundMessageType.java b/prober/src/main/java/google/registry/monitoring/blackbox/messages/OutboundMessageType.java index 0dd17e9d4..e393e47ff 100644 --- a/prober/src/main/java/google/registry/monitoring/blackbox/messages/OutboundMessageType.java +++ b/prober/src/main/java/google/registry/monitoring/blackbox/messages/OutboundMessageType.java @@ -15,7 +15,7 @@ package google.registry.monitoring.blackbox.messages; /** - * Marker Interface that is implemented by all classes that serve as {@code outboundMessages} in channel pipeline + * Marker Interface that is implemented by all classes that serve as {@code outboundMessages} in + * channel pipeline */ public interface OutboundMessageType {} - diff --git a/proxy/build.gradle b/proxy/build.gradle index 952bf2da7..d36a400cc 100644 --- a/proxy/build.gradle +++ b/proxy/build.gradle @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'java' - createUberJar('deployJar', 'proxy_server', 'google.registry.proxy.ProxyServer') task buildProxyImage(dependsOn: deployJar, type: Exec) { diff --git a/util/build.gradle b/util/build.gradle index b83e82fb9..5e77780a0 100644 --- a/util/build.gradle +++ b/util/build.gradle @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'java' - dependencies { def deps = rootProject.dependencyMap compile deps['com.google.api-client:google-api-client']