From 3f25306ea609baaaf5b83aab104cf741ee43258d Mon Sep 17 00:00:00 2001 From: Damian Serwin Date: Tue, 5 Dec 2023 20:24:30 +0100 Subject: [PATCH] Upgrades to java 17 --- .github/workflows/maven.yml | 27 +++ cyclone-daemon/docker/Dockerfile | 2 +- cyclone-daemon/pom.xml | 31 ++- .../cyclone/auth/AuthFilterFactory.java | 4 +- .../cyclone/auth/HeaderAuthFilter.java | 14 +- .../cempaka/cyclone/auth/NoopAuthFilter.java | 7 +- .../configurations/ChannelConfiguration.java | 2 +- .../configurations/ClusterConfiguration.java | 6 +- .../configurations/DaemonConfiguration.java | 8 +- .../StalledTestCleanerConfiguration.java | 4 +- .../configurations/StorageConfiguration.java | 2 +- .../TestRunnerConfiguration.java | 4 +- .../configurations/TypedConfiguration.java | 2 +- .../configurations/WorkersConfiguration.java | 7 +- .../cyclone/core/log/BaseLogDataSink.java | 2 +- .../core/log/RepositoryLogDataSink.java | 4 +- .../cempaka/cyclone/daemon/CycloneDaemon.java | 13 +- .../cempaka/cyclone/daemon/DaemonModule.java | 7 +- .../listeners/EndedPayloadListener.java | 4 +- .../cyclone/listeners/LogPayloadListener.java | 4 +- .../cyclone/listeners/PayloadListener.java | 4 +- .../listeners/RunningPayloadListener.java | 4 +- .../listeners/StartedPayloadListener.java | 4 +- .../managed/DaemonTestRunnerManaged.java | 4 +- .../cyclone/managed/HeartbeatManaged.java | 4 +- .../managed/StalledTestCleanerManaged.java | 4 +- .../cyclone/resources/ClusterResource.java | 23 ++- .../resources/LogMessagesResource.java | 20 +- .../cyclone/resources/MetadataResource.java | 20 +- .../cyclone/resources/MetricsResource.java | 21 +- .../cyclone/resources/ParcelResource.java | 18 +- .../resources/TestExecutionResource.java | 24 +-- .../cyclone/resources/TestResource.java | 22 +-- .../DistributedTestRunnerService.java | 4 +- .../LocalHostNodeIdentifierProvider.java | 4 +- .../cyclone/services/MetadataService.java | 4 +- .../cyclone/services/NodeStatusService.java | 6 +- .../cyclone/services/ParcelUploadService.java | 4 +- .../StaticNodeIdentifierProvider.java | 6 +- .../cyclone/storage/ParcelIndexer.java | 6 +- .../cyclone/storage/StorageModule.java | 2 +- .../repositories/FileParcelRepository.java | 6 +- .../JdbiLogMessageRepository.java | 4 +- .../repositories/JdbiNodeStateRepository.java | 4 +- .../repositories/JdbiParcelRepository.java | 4 +- .../JdbiTestExecutionRepository.java | 4 +- .../JdbiTestMetricRepository.java | 4 +- .../repositories/JdbiTestRepository.java | 5 +- .../repositories/JooqMetadataRepository.java | 4 +- .../org/cempaka/cyclone/webjars/Asset.java | 22 +++ .../org/cempaka/cyclone/webjars/AssetId.java | 45 +++++ .../cempaka/cyclone/webjars/AssetLoader.java | 112 +++++++++++ .../cempaka/cyclone/webjars/AssetWeigher.java | 16 ++ .../cyclone/webjars/VersionLoader.java | 70 +++++++ .../cempaka/cyclone/webjars/WebJarBundle.java | 66 +++++++ .../cyclone/webjars/WebJarServlet.java | 187 ++++++++++++++++++ .../cyclone/workers/WorkerManager.java | 6 +- .../auth/HeaderAuthFilterSmallTest.java | 10 +- .../cyclone/auth/NoopAuthFilterSmallTest.java | 4 +- .../auth/PrincipalSecurityContextMatcher.java | 2 +- cyclone-examples/pom.xml | 18 +- cyclone-plugins/cyclone-slf4j/pom.xml | 2 + docker/docker-compose.yml | 2 +- pom.xml | 95 +++------ tools/docker-compose.yml | 2 +- 65 files changed, 799 insertions(+), 257 deletions(-) create mode 100644 .github/workflows/maven.yml create mode 100644 cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/Asset.java create mode 100644 cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/AssetId.java create mode 100644 cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/AssetLoader.java create mode 100644 cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/AssetWeigher.java create mode 100644 cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/VersionLoader.java create mode 100644 cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/WebJarBundle.java create mode 100644 cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/WebJarServlet.java diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..0c725a0 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,27 @@ +name: maven build + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B clean verify -P docker + + # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive + - name: Update dependency graph + uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 diff --git a/cyclone-daemon/docker/Dockerfile b/cyclone-daemon/docker/Dockerfile index 407d994..0159fbe 100644 --- a/cyclone-daemon/docker/Dockerfile +++ b/cyclone-daemon/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM openjdk:11-jre-slim +FROM amazoncorretto:17.0.9-alpine3.18 RUN mkdir /opt/cyclone /opt/cyclone/parcels /etc/cyclone /var/log/cyclone diff --git a/cyclone-daemon/pom.xml b/cyclone-daemon/pom.xml index a19cea2..f87dbbb 100644 --- a/cyclone-daemon/pom.xml +++ b/cyclone-daemon/pom.xml @@ -25,6 +25,12 @@ io.dropwizard dropwizard-core + + + jakarta.activation + jakarta.activation-api + + io.dropwizard @@ -42,13 +48,15 @@ io.dropwizard dropwizard-auth - - io.dropwizard-bundles - dropwizard-webjars-bundle - com.google.inject guice + + + aopalliance + aopalliance + + org.postgresql @@ -163,8 +171,8 @@ generate-test-resources - - + + @@ -214,7 +222,7 @@ true target/cyclone-daemon.jar - + org.cempaka.cyclone.daemon.CycloneDaemon @@ -226,7 +234,16 @@ META-INF/*.SF META-INF/*.DSA META-INF/*.RSA + META-INF/*.md + META-INF/*.txt + *.module-info + META-INF/NOTICE + META-INF/DEPENDENCIES + META-INF/LICENSE + META-INF/*.MF + META-INF/*.markdown module-info.* + about.html diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/auth/AuthFilterFactory.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/auth/AuthFilterFactory.java index 8784672..c2097a5 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/auth/AuthFilterFactory.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/auth/AuthFilterFactory.java @@ -5,8 +5,8 @@ import io.dropwizard.auth.AuthFilter; import io.dropwizard.auth.basic.BasicCredentialAuthFilter; import java.util.Map; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.configurations.AuthenticationConfiguration; @Singleton diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/auth/HeaderAuthFilter.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/auth/HeaderAuthFilter.java index f29a28a..f37c145 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/auth/HeaderAuthFilter.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/auth/HeaderAuthFilter.java @@ -3,13 +3,13 @@ import static com.google.common.base.Preconditions.checkNotNull; import io.dropwizard.auth.AuthFilter; +import jakarta.annotation.Priority; +import jakarta.ws.rs.Priorities; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Response; + import java.util.Optional; -import javax.annotation.Priority; -import javax.ws.rs.Priorities; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; @Priority(Priorities.AUTHENTICATION) class HeaderAuthFilter extends AuthFilter @@ -28,7 +28,7 @@ class HeaderAuthFilter extends AuthFilter public void filter(final ContainerRequestContext requestContext) { if (!authenticate(requestContext, requestContext.getHeaderString(headerName), SCHEME)) { - throw new WebApplicationException(Response.status(Status.UNAUTHORIZED).build()); + throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build()); } } } diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/auth/NoopAuthFilter.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/auth/NoopAuthFilter.java index a7c018c..f386369 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/auth/NoopAuthFilter.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/auth/NoopAuthFilter.java @@ -1,10 +1,11 @@ package org.cempaka.cyclone.auth; import io.dropwizard.auth.AuthFilter; +import jakarta.annotation.Priority; +import jakarta.ws.rs.Priorities; +import jakarta.ws.rs.container.ContainerRequestContext; + import java.util.Optional; -import javax.annotation.Priority; -import javax.ws.rs.Priorities; -import javax.ws.rs.container.ContainerRequestContext; @Priority(Priorities.AUTHENTICATION) class NoopAuthFilter extends AuthFilter diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/ChannelConfiguration.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/ChannelConfiguration.java index 270bba3..d282b4c 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/ChannelConfiguration.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/ChannelConfiguration.java @@ -1,6 +1,6 @@ package org.cempaka.cyclone.configurations; -import javax.validation.constraints.Min; +import jakarta.validation.constraints.Min; public class ChannelConfiguration { diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/ClusterConfiguration.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/ClusterConfiguration.java index 975d962..e85de8d 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/ClusterConfiguration.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/ClusterConfiguration.java @@ -3,9 +3,9 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; import org.cempaka.cyclone.services.NodeIdentifierProvider; import org.cempaka.cyclone.services.StaticNodeIdentifierProvider; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/DaemonConfiguration.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/DaemonConfiguration.java index 7564409..6cc6b86 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/DaemonConfiguration.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/DaemonConfiguration.java @@ -1,10 +1,12 @@ package org.cempaka.cyclone.configurations; import com.fasterxml.jackson.annotation.JsonProperty; -import io.dropwizard.Configuration; +import io.dropwizard.core.Configuration; import io.dropwizard.db.DataSourceFactory; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import io.dropwizard.logging.common.ExternalLoggingFactory; +import io.dropwizard.logging.common.LoggingFactory; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; public class DaemonConfiguration extends Configuration { diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/StalledTestCleanerConfiguration.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/StalledTestCleanerConfiguration.java index f3ae143..540f379 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/StalledTestCleanerConfiguration.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/StalledTestCleanerConfiguration.java @@ -1,7 +1,7 @@ package org.cempaka.cyclone.configurations; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; public class StalledTestCleanerConfiguration { diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/StorageConfiguration.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/StorageConfiguration.java index caeaac1..4f1fb5d 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/StorageConfiguration.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/StorageConfiguration.java @@ -1,7 +1,7 @@ package org.cempaka.cyclone.configurations; import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.cempaka.cyclone.storage.repositories.JdbiLogMessageRepository; import org.cempaka.cyclone.storage.repositories.JdbiNodeStateRepository; import org.cempaka.cyclone.storage.repositories.JdbiParcelRepository; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/TestRunnerConfiguration.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/TestRunnerConfiguration.java index 2373d30..2ac9af5 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/TestRunnerConfiguration.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/TestRunnerConfiguration.java @@ -1,7 +1,7 @@ package org.cempaka.cyclone.configurations; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; public class TestRunnerConfiguration { diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/TypedConfiguration.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/TypedConfiguration.java index 0af50b3..03a4040 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/TypedConfiguration.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/TypedConfiguration.java @@ -2,7 +2,7 @@ import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class TypedConfiguration { diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/WorkersConfiguration.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/WorkersConfiguration.java index 6540356..fdd9a2b 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/WorkersConfiguration.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/configurations/WorkersConfiguration.java @@ -1,11 +1,10 @@ package org.cempaka.cyclone.configurations; -import javax.annotation.Nullable; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import org.cempaka.cyclone.workers.WorkerConfiguration; +import jakarta.validation.constraints.Min; import org.hibernate.validator.constraints.NotEmpty; +import javax.annotation.Nullable; + public class WorkersConfiguration { @Min(1) diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/core/log/BaseLogDataSink.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/core/log/BaseLogDataSink.java index fa88810..07ffee6 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/core/log/BaseLogDataSink.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/core/log/BaseLogDataSink.java @@ -1,6 +1,6 @@ package org.cempaka.cyclone.core.log; -import javax.inject.Singleton; +import com.google.inject.Singleton; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/core/log/RepositoryLogDataSink.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/core/log/RepositoryLogDataSink.java index b689a27..ed96641 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/core/log/RepositoryLogDataSink.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/core/log/RepositoryLogDataSink.java @@ -2,8 +2,8 @@ import static org.cempaka.cyclone.core.utils.Preconditions.checkNotNull; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.storage.repositories.LogMessageRepository; @Singleton diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/daemon/CycloneDaemon.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/daemon/CycloneDaemon.java index 66c8d69..86d8d7b 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/daemon/CycloneDaemon.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/daemon/CycloneDaemon.java @@ -2,16 +2,13 @@ import com.google.inject.Guice; import com.google.inject.Injector; -import io.dropwizard.Application; import io.dropwizard.assets.AssetsBundle; -import io.dropwizard.bundles.webjars.WebJarBundle; +import io.dropwizard.core.Application; +import io.dropwizard.core.setup.Bootstrap; +import io.dropwizard.core.setup.Environment; import io.dropwizard.forms.MultiPartBundle; import io.dropwizard.jersey.setup.JerseyEnvironment; import io.dropwizard.lifecycle.setup.LifecycleEnvironment; -import io.dropwizard.setup.Bootstrap; -import io.dropwizard.setup.Environment; -import java.net.SocketException; -import java.net.UnknownHostException; import org.cempaka.cyclone.auth.AuthFilterFactory; import org.cempaka.cyclone.configurations.DaemonConfiguration; import org.cempaka.cyclone.core.channel.DaemonChannel; @@ -26,9 +23,13 @@ import org.cempaka.cyclone.resources.TestExecutionResource; import org.cempaka.cyclone.resources.TestResource; import org.cempaka.cyclone.storage.MigrationRunner; +import org.cempaka.cyclone.webjars.WebJarBundle; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.net.SocketException; +import java.net.UnknownHostException; + public class CycloneDaemon extends Application { private static final Logger LOG = LoggerFactory.getLogger(CycloneDaemon.class); diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/daemon/DaemonModule.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/daemon/DaemonModule.java index 04b0f6f..4f2f516 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/daemon/DaemonModule.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/daemon/DaemonModule.java @@ -9,14 +9,14 @@ import com.google.inject.Provides; import com.google.inject.TypeLiteral; import com.google.inject.name.Names; +import io.dropwizard.core.setup.Environment; import io.dropwizard.db.DataSourceFactory; import io.dropwizard.jdbi3.JdbiFactory; -import io.dropwizard.setup.Environment; import java.time.Clock; import java.util.Map; import java.util.function.BiConsumer; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.cempaka.cyclone.configurations.AuthenticationConfiguration; @@ -42,7 +42,6 @@ import org.cempaka.cyclone.services.NodeIdentifierProvider; import org.cempaka.cyclone.services.TestRunnerService; import org.cempaka.cyclone.storage.StorageModule; -import org.cempaka.cyclone.workers.WorkerConfiguration; import org.jdbi.v3.core.Jdbi; import org.jdbi.v3.jackson2.Jackson2Config; import org.jdbi.v3.jackson2.Jackson2Plugin; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/EndedPayloadListener.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/EndedPayloadListener.java index 0e3f73c..6f14bbb 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/EndedPayloadListener.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/EndedPayloadListener.java @@ -4,8 +4,8 @@ import java.util.UUID; import java.util.function.BiConsumer; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.beans.TestState; import org.cempaka.cyclone.core.channel.Payload; import org.cempaka.cyclone.core.channel.PayloadType; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/LogPayloadListener.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/LogPayloadListener.java index a3c366b..b28c43b 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/LogPayloadListener.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/LogPayloadListener.java @@ -4,8 +4,8 @@ import java.util.UUID; import java.util.function.BiConsumer; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.core.channel.LogPayload; import org.cempaka.cyclone.core.channel.Payload; import org.cempaka.cyclone.core.channel.PayloadType; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/PayloadListener.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/PayloadListener.java index 453d7e5..8d63332 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/PayloadListener.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/PayloadListener.java @@ -3,8 +3,8 @@ import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Multimap; import java.util.function.BiConsumer; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.core.channel.Payload; import org.cempaka.cyclone.core.channel.PayloadType; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/RunningPayloadListener.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/RunningPayloadListener.java index 72c993d..64f9bc5 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/RunningPayloadListener.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/RunningPayloadListener.java @@ -6,8 +6,8 @@ import java.time.Instant; import java.util.UUID; import java.util.function.BiConsumer; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.beans.MetricDataPoint; import org.cempaka.cyclone.core.channel.Payload; import org.cempaka.cyclone.core.channel.PayloadType; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/StartedPayloadListener.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/StartedPayloadListener.java index 75df225..023c066 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/StartedPayloadListener.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/listeners/StartedPayloadListener.java @@ -4,8 +4,8 @@ import java.util.UUID; import java.util.function.BiConsumer; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.beans.TestState; import org.cempaka.cyclone.core.channel.Payload; import org.cempaka.cyclone.core.channel.PayloadType; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/managed/DaemonTestRunnerManaged.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/managed/DaemonTestRunnerManaged.java index e8027c5..e6b3255 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/managed/DaemonTestRunnerManaged.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/managed/DaemonTestRunnerManaged.java @@ -8,8 +8,8 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.beans.TestState; import org.cempaka.cyclone.beans.exceptions.ParcelNotFoundException; import org.cempaka.cyclone.beans.exceptions.WorkerNotAvailableException; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/managed/HeartbeatManaged.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/managed/HeartbeatManaged.java index e579620..5548e34 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/managed/HeartbeatManaged.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/managed/HeartbeatManaged.java @@ -7,8 +7,8 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.beans.NodeStatus; import org.cempaka.cyclone.configurations.ClusterConfiguration; import org.cempaka.cyclone.services.NodeStatusService; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/managed/StalledTestCleanerManaged.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/managed/StalledTestCleanerManaged.java index b3a74b6..9043d16 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/managed/StalledTestCleanerManaged.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/managed/StalledTestCleanerManaged.java @@ -9,8 +9,8 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.configurations.ClusterConfiguration; import org.cempaka.cyclone.configurations.StalledTestCleanerConfiguration; import org.cempaka.cyclone.services.NodeStatusService; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/ClusterResource.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/ClusterResource.java index 3b4f76d..689e480 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/ClusterResource.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/ClusterResource.java @@ -2,17 +2,16 @@ import static com.google.common.base.Preconditions.checkNotNull; -import javax.inject.Inject; -import javax.inject.Singleton; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.cempaka.cyclone.beans.ImmutableNodeCapacity; import org.cempaka.cyclone.services.NodeStatusService; import org.cempaka.cyclone.workers.WorkerManager; @@ -52,7 +51,7 @@ public Response getNodeCapacity(@NotNull @PathParam("node") final String node) .build()) .build(); } else { - return Response.status(Status.NOT_FOUND).build(); + return Response.status(Response.Status.NOT_FOUND).build(); } } } diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/LogMessagesResource.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/LogMessagesResource.java index c613f40..8e60686 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/LogMessagesResource.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/LogMessagesResource.java @@ -6,16 +6,16 @@ import java.util.List; import java.util.UUID; import java.util.stream.Collectors; -import javax.inject.Inject; -import javax.inject.Singleton; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import jakarta.ws.rs.DefaultValue; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.cempaka.cyclone.core.log.LogMessage; import org.cempaka.cyclone.storage.repositories.LogMessageRepository; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/MetadataResource.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/MetadataResource.java index 068b5e5..7d260be 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/MetadataResource.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/MetadataResource.java @@ -8,16 +8,16 @@ import java.io.UncheckedIOException; import java.util.List; import java.util.Optional; -import javax.inject.Inject; -import javax.inject.Singleton; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import org.cempaka.cyclone.beans.ImmutableMetadata; import org.cempaka.cyclone.beans.Metadata; import org.cempaka.cyclone.services.MetadataService; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/MetricsResource.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/MetricsResource.java index 38579e8..682f63d 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/MetricsResource.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/MetricsResource.java @@ -5,16 +5,17 @@ import com.google.common.collect.Range; import java.util.List; import java.util.UUID; -import javax.inject.Inject; -import javax.inject.Singleton; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; + +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.beans.MetricDataPoint; import org.cempaka.cyclone.storage.repositories.TestMetricRepository; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/ParcelResource.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/ParcelResource.java index 8e0f324..3326986 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/ParcelResource.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/ParcelResource.java @@ -4,15 +4,15 @@ import java.io.InputStream; import java.util.UUID; -import javax.inject.Inject; -import javax.inject.Singleton; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import org.cempaka.cyclone.beans.ParcelUpload; import org.cempaka.cyclone.services.ParcelUploadService; import org.cempaka.cyclone.storage.repositories.ParcelRepository; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/TestExecutionResource.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/TestExecutionResource.java index 06c1a33..695c711 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/TestExecutionResource.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/TestExecutionResource.java @@ -4,18 +4,18 @@ import java.util.Set; import java.util.UUID; -import javax.inject.Inject; -import javax.inject.Singleton; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.DefaultValue; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.cempaka.cyclone.beans.TestState; import org.cempaka.cyclone.storage.repositories.TestExecutionRepository; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/TestResource.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/TestResource.java index 00dadbe..f9ac8a1 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/TestResource.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/resources/TestResource.java @@ -3,17 +3,17 @@ import static com.google.common.base.Preconditions.checkNotNull; import java.util.UUID; -import javax.inject.Inject; -import javax.inject.Singleton; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; import org.cempaka.cyclone.beans.exceptions.ParcelNotFoundException; import org.cempaka.cyclone.beans.exceptions.TestNotFoundException; import org.cempaka.cyclone.services.NodeNotAliveException; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/DistributedTestRunnerService.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/DistributedTestRunnerService.java index f6e12d9..93ab443 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/DistributedTestRunnerService.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/DistributedTestRunnerService.java @@ -8,8 +8,8 @@ import java.util.Optional; import java.util.Set; import java.util.UUID; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.beans.TestState; import org.cempaka.cyclone.beans.exceptions.ParcelNotFoundException; import org.cempaka.cyclone.beans.exceptions.TestNotFoundException; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/LocalHostNodeIdentifierProvider.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/LocalHostNodeIdentifierProvider.java index f72185a..0643dd3 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/LocalHostNodeIdentifierProvider.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/LocalHostNodeIdentifierProvider.java @@ -3,8 +3,8 @@ import java.io.UncheckedIOException; import java.net.InetAddress; import java.net.UnknownHostException; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; @Singleton public class LocalHostNodeIdentifierProvider implements NodeIdentifierProvider diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/MetadataService.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/MetadataService.java index c29629e..33daca6 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/MetadataService.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/MetadataService.java @@ -7,8 +7,8 @@ import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.beans.ImmutableMetadata; import org.cempaka.cyclone.beans.Metadata; import org.cempaka.cyclone.jooq.tables.records.MetadataRecord; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/NodeStatusService.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/NodeStatusService.java index cd08a05..41941f8 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/NodeStatusService.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/NodeStatusService.java @@ -7,9 +7,9 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import com.google.inject.name.Named; import org.cempaka.cyclone.beans.NodeState; import org.cempaka.cyclone.beans.NodeStatus; import org.cempaka.cyclone.storage.repositories.NodeStateDataRepository; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/ParcelUploadService.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/ParcelUploadService.java index df81c66..bb1b6b0 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/ParcelUploadService.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/ParcelUploadService.java @@ -8,8 +8,8 @@ import java.io.UncheckedIOException; import java.util.Set; import java.util.UUID; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.apache.http.HttpStatus; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/StaticNodeIdentifierProvider.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/StaticNodeIdentifierProvider.java index f438a88..4b8eff8 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/StaticNodeIdentifierProvider.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/services/StaticNodeIdentifierProvider.java @@ -3,9 +3,9 @@ import static org.cempaka.cyclone.core.utils.Preconditions.checkNotNull; import java.util.Map; -import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.name.Named; +import com.google.inject.Singleton; @Singleton public class StaticNodeIdentifierProvider implements NodeIdentifierProvider diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/ParcelIndexer.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/ParcelIndexer.java index 26de1e9..e3bc8fd 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/ParcelIndexer.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/ParcelIndexer.java @@ -13,9 +13,9 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import com.google.inject.name.Named; import org.cempaka.cyclone.beans.Parcel; import org.cempaka.cyclone.beans.exceptions.IndexingParcelException; import org.cempaka.cyclone.core.utils.Metadata; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/StorageModule.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/StorageModule.java index 1d3d7eb..d427f10 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/StorageModule.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/StorageModule.java @@ -7,7 +7,7 @@ import com.google.inject.TypeLiteral; import com.google.inject.name.Names; import java.util.Map; -import javax.inject.Singleton; +import com.google.inject.Singleton; import org.cempaka.cyclone.configurations.StorageConfiguration; import org.cempaka.cyclone.configurations.TypedConfiguration; import org.cempaka.cyclone.storage.jdbi.LogMessageDataAccess; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/FileParcelRepository.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/FileParcelRepository.java index 4f847d4..715f575 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/FileParcelRepository.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/FileParcelRepository.java @@ -12,9 +12,9 @@ import java.util.Set; import java.util.UUID; import javax.annotation.Nullable; -import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import com.google.inject.name.Named; import org.cempaka.cyclone.beans.Parcel; @Singleton diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiLogMessageRepository.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiLogMessageRepository.java index 2fee1c3..b270ada 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiLogMessageRepository.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiLogMessageRepository.java @@ -6,8 +6,8 @@ import java.time.Instant; import java.util.List; import java.util.UUID; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.core.log.LogMessage; import org.cempaka.cyclone.storage.jdbi.LogMessageDataAccess; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiNodeStateRepository.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiNodeStateRepository.java index 8132ce9..a5ab64a 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiNodeStateRepository.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiNodeStateRepository.java @@ -5,8 +5,8 @@ import java.sql.Timestamp; import java.time.Instant; import java.util.Set; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.beans.NodeState; import org.cempaka.cyclone.storage.jdbi.NodeStateDataAccess; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiParcelRepository.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiParcelRepository.java index dd62158..7541b33 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiParcelRepository.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiParcelRepository.java @@ -6,8 +6,8 @@ import java.util.Set; import java.util.UUID; import javax.annotation.Nullable; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.beans.Parcel; import org.cempaka.cyclone.storage.jdbi.ParcelDataAccess; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiTestExecutionRepository.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiTestExecutionRepository.java index 687e208..4515f6d 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiTestExecutionRepository.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiTestExecutionRepository.java @@ -10,8 +10,8 @@ import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.resources.ImmutableTestExecutionsPage; import org.cempaka.cyclone.resources.TestExecutionsPage; import org.cempaka.cyclone.storage.jdbi.TestExecutionDataAccess; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiTestMetricRepository.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiTestMetricRepository.java index 5b13a2d..ff4b528 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiTestMetricRepository.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiTestMetricRepository.java @@ -7,8 +7,8 @@ import java.time.Instant; import java.util.List; import java.util.UUID; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.beans.MetricDataPoint; import org.cempaka.cyclone.storage.jdbi.TestMetricDataAccess; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiTestRepository.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiTestRepository.java index a7d4996..eb3a598 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiTestRepository.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JdbiTestRepository.java @@ -6,8 +6,9 @@ import java.util.Optional; import java.util.Set; import java.util.UUID; -import javax.inject.Inject; -import javax.inject.Singleton; + +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.storage.jdbi.TestDataAccess; import org.cempaka.cyclone.tests.Test; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JooqMetadataRepository.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JooqMetadataRepository.java index a4acaca..310c439 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JooqMetadataRepository.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/storage/repositories/JooqMetadataRepository.java @@ -4,8 +4,8 @@ import java.util.List; import java.util.Optional; -import javax.inject.Inject; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; import org.cempaka.cyclone.jooq.Tables; import org.cempaka.cyclone.jooq.tables.records.MetadataRecord; import org.jooq.DSLContext; diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/Asset.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/Asset.java new file mode 100644 index 0000000..eeafbef --- /dev/null +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/Asset.java @@ -0,0 +1,22 @@ +package org.cempaka.cyclone.webjars; + +import com.google.common.hash.Hashing; +import com.google.common.net.MediaType; + +import java.util.Date; + +class Asset +{ + public final byte[] bytes; + public final MediaType mediaType; + public final String hash; + public final long lastModifiedTime; + + public Asset(byte[] bytes, MediaType mediaType) + { + this.bytes = bytes; + this.mediaType = mediaType; + this.hash = (bytes != null) ? Hashing.murmur3_128().hashBytes(bytes).toString() : null; + this.lastModifiedTime = (new Date().getTime() / 1000) * 1000; // Ignore milliseconds + } +} \ No newline at end of file diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/AssetId.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/AssetId.java new file mode 100644 index 0000000..0fbd3e6 --- /dev/null +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/AssetId.java @@ -0,0 +1,45 @@ +package org.cempaka.cyclone.webjars; + +import com.google.common.base.MoreObjects; +import com.google.common.base.Objects; + +class AssetId +{ + public final String library; + public final String resource; + + public AssetId(String library, String resource) + { + this.library = library; + this.resource = resource; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) { + return true; + } + if (obj == null || !(obj instanceof AssetId)) { + return false; + } + + AssetId id = (AssetId) obj; + return Objects.equal(library, id.library) && Objects.equal(resource, id.resource); + } + + @Override + public int hashCode() + { + return Objects.hashCode(library, resource); + } + + @Override + public String toString() + { + return MoreObjects.toStringHelper(this) + .add("library", library) + .add("resource", resource) + .toString(); + } +} \ No newline at end of file diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/AssetLoader.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/AssetLoader.java new file mode 100644 index 0000000..c5a5a8a --- /dev/null +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/AssetLoader.java @@ -0,0 +1,112 @@ +package org.cempaka.cyclone.webjars; + +import com.google.common.base.Charsets; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.io.ByteStreams; +import com.google.common.io.Resources; +import com.google.common.net.MediaType; +import org.eclipse.jetty.http.MimeTypes; + +import java.net.URL; +import java.nio.charset.Charset; + +/** + * Locates an loads a particular WebJar asset from the classpath. + */ +class AssetLoader extends CacheLoader +{ + public static final Asset NOT_FOUND = new Asset(null, null); + + // For determining content type and content encoding + private static final MimeTypes MIME_TYPES = new MimeTypes(); + private static final MediaType DEFAULT_MEDIA_TYPE = MediaType.HTML_UTF_8; + private static final Charset DEFAULT_CHARSET = Charsets.UTF_8; + + private final LoadingCache versionCache; + + AssetLoader(CacheLoader versionLoader) + { + versionCache = CacheBuilder.newBuilder() + .maximumSize(10) + .build(versionLoader); + } + + @Override + public Asset load(AssetId id) throws Exception + { + String version = versionCache.getUnchecked(id.library); + if (VersionLoader.NOT_FOUND.equals(version)) { + return NOT_FOUND; + } + + // Sometimes the WebJar has multiple releases which gets represented by a -# suffix to the + // version number inside of pom.properties. When this happens, the files inside of the jar + // don't include the WebJar release number as part of the file path. For example, the angularjs + // 1.1.1 WebJar has a version inside of pom.properties of 1.1.1-1. But the path to angular.js + // inside of the jar is META-INF/resources/webjars/angularjs/1.1.1/angular.js. + // + // Alternatively sometimes the developer of the library includes a -suffix in the true library + // version. In these cases the WebJar pom.properties will include that suffix in the version + // number, and the file paths inside of the jar will also include the suffix. For example, the + // backbone-marionette 1.0.0-beta6 WebJar has a version inside of pom.properties of 1.0.0-beta6. + // The path to backbone.marionette.js is also + // META-INF/resources/webjars/backbone-marionette/1.0.0-beta6/backbone.marionette.js. + // + // So based on the data inside of pom.properties it's going to be impossible to determine + // whether a -suffix should be stripped off or not. A reasonable heuristic however is going to + // be to just keep trying over and over starting with the most specific version number, then + // stripping a suffix off at a time until there are no more suffixes and the right version + // number is determined. + do { + final String pathPattern = "META-INF/resources/webjars/%s/%s/%s"; + final String path = String.format(pathPattern, id.library, version, id.resource); + + try { + URL resource = Resources.getResource(path); + + // Determine the media type of this resource + MediaType mediaType = getMediaType(path); + + // We know that this version was valid. Update the version cache to make sure that we + // remember it for next time around. + versionCache.put(id.library, version); + + return new Asset(ByteStreams.toByteArray(resource.openStream()), mediaType); + } catch (IllegalArgumentException e) { + // ignored + } + + // Trim a suffix off of the version number + int hyphen = version.lastIndexOf('-'); + if (hyphen == -1) { + return NOT_FOUND; + } + + version = version.substring(0, hyphen); + } + while (true); + } + + private MediaType getMediaType(String path) + { + String mimeType = MIME_TYPES.getMimeByExtension(path); + if (mimeType == null) { + return DEFAULT_MEDIA_TYPE; + } + + MediaType mediaType; + try { + mediaType = MediaType.parse(mimeType); + + if (mediaType.is(MediaType.ANY_TEXT_TYPE)) { + mediaType = mediaType.withCharset(DEFAULT_CHARSET); + } + } catch (IllegalArgumentException e) { + return DEFAULT_MEDIA_TYPE; + } + + return mediaType; + } +} \ No newline at end of file diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/AssetWeigher.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/AssetWeigher.java new file mode 100644 index 0000000..f28f9d7 --- /dev/null +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/AssetWeigher.java @@ -0,0 +1,16 @@ +package org.cempaka.cyclone.webjars; + +import com.google.common.cache.Weigher; + +/** + * Weigh an asset according to the number of bytes it contains. + */ +class AssetWeigher implements Weigher +{ + @Override + public int weigh(AssetId key, Asset asset) + { + // return file size in bytes + return (asset.bytes != null) ? asset.bytes.length : 0; + } +} \ No newline at end of file diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/VersionLoader.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/VersionLoader.java new file mode 100644 index 0000000..a111158 --- /dev/null +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/VersionLoader.java @@ -0,0 +1,70 @@ +package org.cempaka.cyclone.webjars; + +import com.google.common.cache.CacheLoader; +import com.google.common.io.Closer; +import com.google.common.io.Resources; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.Properties; + +/** + * Determines the version of the webjar that's in the classpath for a particular library. + *

+ * The version of a webjar can be determined by looking at the pom.properties file + * located at {@code META-INF/maven///pom.properties}. + *

+ * Where {@code } is the name of the maven group the webjar artifact is part of, and + * {@code } is the name of the library. + */ +class VersionLoader extends CacheLoader +{ + public static final String NOT_FOUND = "VERSION-NOT-FOUND"; + + private final Iterable groups; + + VersionLoader(Iterable groups) + { + this.groups = groups; + } + + @Override + public String load(String library) throws Exception + { + for (String group : groups) { + String found = tryToLoadFrom("META-INF/maven/%s/%s/pom.properties", group, library); + if (found != null) { + return found; + } + } + + return NOT_FOUND; + } + + private String tryToLoadFrom(String format, String group, String library) + { + String path = String.format(format, group, library); + URL url; + try { + url = Resources.getResource(path); + } catch (IllegalArgumentException e) { + return null; + } + + try { + Closer closer = Closer.create(); + InputStream in = closer.register(url.openStream()); + try { + Properties props = new Properties(); + props.load(in); + + return props.getProperty("version"); + } finally { + closer.close(); + } + } catch (IOException e) { + return null; + } + } +} \ No newline at end of file diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/WebJarBundle.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/WebJarBundle.java new file mode 100644 index 0000000..d49bc3f --- /dev/null +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/WebJarBundle.java @@ -0,0 +1,66 @@ +package org.cempaka.cyclone.webjars; + +import com.google.common.cache.CacheBuilder; +import com.google.common.collect.Lists; +import io.dropwizard.core.Configuration; +import io.dropwizard.core.ConfiguredBundle; +import io.dropwizard.core.setup.Environment; + +import java.util.Collections; +import java.util.List; + +public class WebJarBundle implements ConfiguredBundle +{ + private CacheBuilder cacheBuilder = null; + private List packages = Lists.newArrayList(WebJarServlet.DEFAULT_MAVEN_GROUPS); + private String urlPrefix = WebJarServlet.DEFAULT_URL_PREFIX; + + public WebJarBundle() + { + } + + public WebJarBundle(CacheBuilder builder) + { + cacheBuilder = builder; + } + + public WebJarBundle(String... additionalPackages) + { + Collections.addAll(packages, additionalPackages); + } + + public WebJarBundle(CacheBuilder builder, String... additionalPackages) + { + cacheBuilder = builder; + Collections.addAll(packages, additionalPackages); + } + + public WebJarBundle withUrlPrefix(String prefix) + { + urlPrefix = prefix; + return this; + } + + private String normalizedUrlPrefix() + { + final StringBuilder pathBuilder = new StringBuilder(); + if (!urlPrefix.startsWith("/")) { + pathBuilder.append('/'); + } + pathBuilder.append(urlPrefix); + if (!urlPrefix.endsWith("/")) { + pathBuilder.append('/'); + } + return pathBuilder.toString(); + } + + @Override + public void run(Configuration configuration, Environment environment) + { + String prefix = normalizedUrlPrefix(); + WebJarServlet servlet = new WebJarServlet(cacheBuilder, packages, prefix); + environment.servlets() + .addServlet("webjars", servlet) + .addMapping(prefix + "*"); + } +} diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/WebJarServlet.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/WebJarServlet.java new file mode 100644 index 0000000..f1cb791 --- /dev/null +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/webjars/WebJarServlet.java @@ -0,0 +1,187 @@ +package org.cempaka.cyclone.webjars; + +import com.google.common.base.Splitter; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.LoadingCache; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.google.common.net.HttpHeaders; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.ws.rs.core.EntityTag; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * A servlet that will load resources from WebJars found in the classpath. In order to make it more + * convenient to use a WebJar, this servlet will automatically determine the version of the WebJar + * present in the classpath and make it so that you don't need to explicitly specify a version + * number as part of the URL. This allows WebJars to be upgraded entirely via maven dependencies + * without having to update all of the references to the WebJar in your UI code. + */ +public class WebJarServlet extends HttpServlet +{ + private static final long serialVersionUID = 0L; + + /** + * The default URL prefix that webjars are served out of. + */ + public static final String DEFAULT_URL_PREFIX = "/webjars/"; + + /** + * The default maven group(s) that WebJars are searched for in. + */ + public static final String[] DEFAULT_MAVEN_GROUPS = {"org.webjars"}; + + /** + * An If-None-Match header parser, splits the header into the multiple ETags if present. + */ + private static final Splitter IF_NONE_MATCH_SPLITTER = + Splitter.on(',').omitEmptyStrings().trimResults(); + + private static final Logger LOG = LoggerFactory.getLogger(WebJarServlet.class); + + /** + * A path parser that can determine the library and library resource a particular path is for. + */ + private final Pattern pathParser; + + private final transient LoadingCache cache; + + /** + * Construct the actual servlet that this bundle will install. + * + * @param builder The cache definition for our webjar bundle. + * @param groups The allowed maven groups of webjars to look for and match against. + */ + public WebJarServlet(CacheBuilder builder, Iterable groups, + String urlPrefix) + { + if (groups == null || Iterables.isEmpty(groups)) { + groups = ImmutableList.copyOf(DEFAULT_MAVEN_GROUPS); + } + + AssetLoader loader = new AssetLoader(new VersionLoader(groups)); + + if (builder == null) { + cache = CacheBuilder.newBuilder() + .maximumWeight(5 * 1024 * 1024) + .expireAfterAccess(5, TimeUnit.MINUTES) + .weigher(new AssetWeigher()) + .build(loader); + } else { + cache = builder + .weigher(new AssetWeigher()) + .build(loader); + } + + pathParser = Pattern.compile(urlPrefix + "([^/]+)/(.+)"); + } + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException + { + try { + handle(req, resp); + } catch (Exception e) { + LOG.info("Error processing request: {}", req, e); + resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } + } + + private void handle(HttpServletRequest req, HttpServletResponse resp) throws IOException + { + String path = getFullPath(req); + + // Check to see if this is a valid path that we know how to deal with. + // If so parse out the library and resource. + Matcher match = pathParser.matcher(path); + if (!match.matches()) { + resp.sendError(HttpServletResponse.SC_NOT_FOUND); + return; + } + + // The path is valid, try to load the asset. + AssetId id = new AssetId(match.group(1), match.group(2)); + Asset asset = cache.getUnchecked(id); + if (asset == AssetLoader.NOT_FOUND) { + resp.sendError(HttpServletResponse.SC_NOT_FOUND); + return; + } + + // We know we've found the asset. No matter what happens, make sure we send back its last + // modification time as well as its ETag + resp.setDateHeader(HttpHeaders.LAST_MODIFIED, asset.lastModifiedTime); + resp.setHeader(HttpHeaders.ETAG, hash2etag(asset.hash)); + + // Check the If-None-Match header to see if any ETags match this resource + String ifNoneMatch = req.getHeader(HttpHeaders.IF_NONE_MATCH); + if (ifNoneMatch != null) { + for (String etag : IF_NONE_MATCH_SPLITTER.split(ifNoneMatch)) { + if ("*".equals(etag) || asset.hash.equals(etag2hash(etag))) { + resp.sendError(HttpServletResponse.SC_NOT_MODIFIED); + return; + } + } + } + + // Check the If-Modified-Since header to see if this resource is newer + if (asset.lastModifiedTime <= req.getDateHeader(HttpHeaders.IF_MODIFIED_SINCE)) { + resp.sendError(HttpServletResponse.SC_NOT_MODIFIED); + return; + } + + // Send back the correct content type and character encoding headers + resp.setContentType(asset.mediaType.toString()); + if (asset.mediaType.charset().isPresent()) { + resp.setCharacterEncoding(asset.mediaType.charset().get().toString()); + } + + // Finally write the bytes of the asset out + try (ServletOutputStream output = resp.getOutputStream()) { + output.write(asset.bytes); + } + } + + private static String getFullPath(HttpServletRequest request) + { + StringBuilder sb = new StringBuilder(request.getServletPath()); + if (request.getPathInfo() != null) { + sb.append(request.getPathInfo()); + } + + return sb.toString(); + } + + private static String hash2etag(String hash) + { + return new EntityTag(hash).toString(); + } + + private static String etag2hash(String etag) + { + String hash; + + try { + hash = EntityTag.valueOf(etag).getValue(); + } catch (Exception e) { + return null; + } + + // Jetty insists on adding a -gzip suffix to ETags sometimes. If it's there, then strip it off. + if (hash.endsWith("-gzip")) { + hash = hash.substring(0, hash.length() - 5); + } + + return hash; + } +} diff --git a/cyclone-daemon/src/main/java/org/cempaka/cyclone/workers/WorkerManager.java b/cyclone-daemon/src/main/java/org/cempaka/cyclone/workers/WorkerManager.java index 191f6ba..249b8f7 100644 --- a/cyclone-daemon/src/main/java/org/cempaka/cyclone/workers/WorkerManager.java +++ b/cyclone-daemon/src/main/java/org/cempaka/cyclone/workers/WorkerManager.java @@ -15,9 +15,9 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; import java.util.concurrent.Executors; -import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import com.google.inject.name.Named; import org.cempaka.cyclone.beans.Parcel; import org.cempaka.cyclone.beans.exceptions.ParcelNotFoundException; import org.cempaka.cyclone.beans.exceptions.WorkerNotAvailableException; diff --git a/cyclone-daemon/src/test/java/org/cempaka/cyclone/auth/HeaderAuthFilterSmallTest.java b/cyclone-daemon/src/test/java/org/cempaka/cyclone/auth/HeaderAuthFilterSmallTest.java index 8459a95..8760963 100644 --- a/cyclone-daemon/src/test/java/org/cempaka/cyclone/auth/HeaderAuthFilterSmallTest.java +++ b/cyclone-daemon/src/test/java/org/cempaka/cyclone/auth/HeaderAuthFilterSmallTest.java @@ -7,11 +7,11 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.core.SecurityContext; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; +import jakarta.ws.rs.core.SecurityContext; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/cyclone-daemon/src/test/java/org/cempaka/cyclone/auth/NoopAuthFilterSmallTest.java b/cyclone-daemon/src/test/java/org/cempaka/cyclone/auth/NoopAuthFilterSmallTest.java index 87a518b..0905d8c 100644 --- a/cyclone-daemon/src/test/java/org/cempaka/cyclone/auth/NoopAuthFilterSmallTest.java +++ b/cyclone-daemon/src/test/java/org/cempaka/cyclone/auth/NoopAuthFilterSmallTest.java @@ -5,8 +5,8 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.SecurityContext; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.SecurityContext; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; diff --git a/cyclone-daemon/src/test/java/org/cempaka/cyclone/auth/PrincipalSecurityContextMatcher.java b/cyclone-daemon/src/test/java/org/cempaka/cyclone/auth/PrincipalSecurityContextMatcher.java index 6ce0d2a..288c772 100644 --- a/cyclone-daemon/src/test/java/org/cempaka/cyclone/auth/PrincipalSecurityContextMatcher.java +++ b/cyclone-daemon/src/test/java/org/cempaka/cyclone/auth/PrincipalSecurityContextMatcher.java @@ -4,7 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.security.Principal; -import javax.ws.rs.core.SecurityContext; +import jakarta.ws.rs.core.SecurityContext; import org.assertj.core.matcher.AssertionMatcher; class PrincipalSecurityContextMatcher extends AssertionMatcher diff --git a/cyclone-examples/pom.xml b/cyclone-examples/pom.xml index fae7919..b920b98 100644 --- a/cyclone-examples/pom.xml +++ b/cyclone-examples/pom.xml @@ -50,11 +50,27 @@ false - + org.cempaka.cyclone.cli.CycloneCli + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + META-INF/*.txt + META-INF/MANIFEST.MF + META-INF/DEPENDENCIES + META-INF/LICENSE + META-INF/NOTICE + module-info.* + + + diff --git a/cyclone-plugins/cyclone-slf4j/pom.xml b/cyclone-plugins/cyclone-slf4j/pom.xml index 9a40884..65604d6 100644 --- a/cyclone-plugins/cyclone-slf4j/pom.xml +++ b/cyclone-plugins/cyclone-slf4j/pom.xml @@ -19,6 +19,8 @@ org.slf4j slf4j-api + + 1.7.36 diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 41de17d..4119bea 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.7' services: postgres: - image: postgres:9.5.16-alpine + image: postgres:15.5-alpine environment: POSTGRES_USER: cyclone POSTGRES_PASSWORD: cyclone diff --git a/pom.xml b/pom.xml index c415640..b8099bb 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,5 @@ - + 4.0.0 org.cempaka.cyclone @@ -58,31 +57,28 @@ - 1.8 + 17 UTF-8 32.1.3-jre 2.10.0 4.7.5 - 2.25.1 - 1.3.29 - 4.2.3 + 4.0.4 + 7.0.0 3.0.2 - 4.5.13 + 4.5.14 42.7.0 - 3.39.1 - 7.3.1 + 3.42.0 + 9.22.3 2.16.0 - 3.14.16 - 1.7.30 - 1.2 + 3.18.7 1.3.5 4.13.2 3.18.1 4.2.0 4.5.14 - 0.8.5 + 0.8.11 5.10.1 3.6.28 @@ -114,30 +110,10 @@ picocli ${picocli.version} - - org.glassfish.jersey.core - jersey-server - ${jersey.version} - - - org.glassfish.jersey.core - jersey-common - ${jersey.version} - io.dropwizard dropwizard-core ${dropwizard.version} - - - org.glassfish.hk2.external - javax.inject - - - org.glassfish.hk2.external - aopalliance-repackaged - - io.dropwizard @@ -148,12 +124,6 @@ io.dropwizard dropwizard-forms ${dropwizard.version} - - - org.glassfish.hk2.external - javax.inject - - io.dropwizard @@ -165,11 +135,6 @@ dropwizard-jdbi3 ${dropwizard.version} - - io.dropwizard-bundles - dropwizard-webjars-bundle - ${dropwizard-webjars-bundle.version} - com.google.inject guice @@ -260,11 +225,6 @@ jackson-datatype-jsr310 ${jackson.version} - - org.slf4j - slf4j-api - ${slf4j.version} - org.webjars @@ -391,7 +351,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.0 + 3.11.0 ${java.version} ${java.version} @@ -448,7 +408,7 @@ org.apache.maven.plugins maven-resources-plugin - 3.1.0 + 3.3.1 ${encoding} @@ -456,7 +416,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.1.1 + 3.3.0 true @@ -464,7 +424,7 @@ com.github.ekryd.sortpom sortpom-maven-plugin - 2.10.0 + 3.3.0 false false @@ -475,7 +435,7 @@ recommended_2008_06 none none - Stop + Sort @@ -490,7 +450,7 @@ org.apache.maven.plugins maven-source-plugin - 3.0.1 + 3.3.0 attach-sources @@ -504,7 +464,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.0 + 3.6.3 -Xdoclint:none @@ -521,7 +481,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M3 + 3.2.2 classes 8 @@ -545,14 +505,14 @@ io.fabric8 docker-maven-plugin - 0.31.0 + 0.43.4 true true postgres - postgres:9.5.16-alpine + postgres:15.5-alpine cyclone @@ -598,9 +558,7 @@ java - - -javaagent:/jacoco/dependency/jacoco-agent.jar=output=file,append=false,dumponexit=true,destfile=/jacoco/jacoco-it.exec - + -javaagent:/jacoco/dependency/jacoco-agent.jar=output=file,append=false,dumponexit=true,destfile=/jacoco/jacoco-it.exec -jar /opt/cyclone/cyclone-daemon.jar server @@ -615,7 +573,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.0.0-M3 + 3.2.2 big-tests @@ -668,12 +626,12 @@ org.apache.maven.plugins maven-antrun-plugin - 1.8 + 3.1.0 org.apache.maven.plugins maven-deploy-plugin - 3.0.0-M1 + 3.1.1 true @@ -681,7 +639,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.6 + 3.1.0 sign-artifacts @@ -704,12 +662,12 @@ org.apache.maven.plugins maven-dependency-plugin - 3.1.1 + 3.0.1 org.apache.maven.plugins maven-shade-plugin - 2.3 + 3.5.1 com.spotify @@ -719,6 +677,7 @@ docker/Dockerfile cempaka/cyclone ${project.version} + true diff --git a/tools/docker-compose.yml b/tools/docker-compose.yml index 3b95340..c16f8c9 100644 --- a/tools/docker-compose.yml +++ b/tools/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.1' services: postgres: - image: postgres:9.5.16-alpine + image: postgres:15.5-alpine restart: always ports: - 5432:5432