From 9cc100414b92339238be9fc646ec3cc0734579cf Mon Sep 17 00:00:00 2001 From: Christian Ohr Date: Mon, 19 Feb 2024 14:00:05 +0100 Subject: [PATCH] #414: update libraries and rebase from master --- .../protocol/AuditTransmissionChannel.java | 2 -- .../VertxTLSSyslogSenderProvider.java | 30 ------------------- .../VertxUDPSyslogSenderProvider.java | 30 ------------------- ...protocol.AuditTransmissionProtocolProvider | 4 +-- .../fhir/audit/server/FhirAuditServer.java | 16 ++-------- .../fhir/audit/server/TLSBalpRepository.java | 7 ++--- ...i105DocumentReferenceResourceProvider.java | 5 ++-- .../fhir/iti66/Iti66ListResourceProvider.java | 4 +-- commons/ihe/ws/pom.xml | 5 ---- .../commons/ihe/ws/server/JettyServer.java | 9 ++++++ .../commons/ihe/ws/server/ServletServer.java | 3 ++ .../commons/ihe/ws/server/TomcatServer.java | 10 ++++++- dependencies/pom.xml | 3 +- .../ihe/fhir/test/FhirTestContainer.java | 2 +- .../camel/ihe/ws/StandardTestContainer.groovy | 7 ++--- pom.xml | 10 ++----- tutorials/iheclient/pom.xml | 6 ++++ tutorials/xds/pom.xml | 5 ---- 18 files changed, 43 insertions(+), 115 deletions(-) delete mode 100644 commons/audit/src/main/java/org/openehealth/ipf/commons/audit/protocol/providers/VertxTLSSyslogSenderProvider.java delete mode 100644 commons/audit/src/main/java/org/openehealth/ipf/commons/audit/protocol/providers/VertxUDPSyslogSenderProvider.java diff --git a/commons/audit/src/main/java/org/openehealth/ipf/commons/audit/protocol/AuditTransmissionChannel.java b/commons/audit/src/main/java/org/openehealth/ipf/commons/audit/protocol/AuditTransmissionChannel.java index 50c84b929e..2048d67ccb 100644 --- a/commons/audit/src/main/java/org/openehealth/ipf/commons/audit/protocol/AuditTransmissionChannel.java +++ b/commons/audit/src/main/java/org/openehealth/ipf/commons/audit/protocol/AuditTransmissionChannel.java @@ -23,7 +23,6 @@ import org.openehealth.ipf.commons.audit.protocol.providers.RecordingAuditMessageTransmissionProvider; import org.openehealth.ipf.commons.audit.protocol.providers.TLSSyslogSenderProvider; import org.openehealth.ipf.commons.audit.protocol.providers.UDPSyslogSenderProvider; -import org.openehealth.ipf.commons.audit.protocol.providers.VertxTLSSyslogSenderProvider; import java.util.Arrays; import java.util.ServiceLoader; @@ -42,7 +41,6 @@ public enum AuditTransmissionChannel { VERTX_UDP("VERTX-UDP", UDPSyslogSenderProvider.class.getName()), TLS("TLS", TLSSyslogSenderProvider.class.getName()), NIO_TLS("NIO-TLS", NettyTLSSyslogSenderProvider.class.getName()), - VERTX_TLS("VERTX-TLS", VertxTLSSyslogSenderProvider.class.getName()), NETTY_TLS("NETTY-TLS", NettyTLSSyslogSenderProvider.class.getName()), REACTOR_NETTY_TLS("REACTOR-NETTY-TLS", ReactorNettyTLSSyslogSenderProvider.class.getName()), FHIR_REST_TLS("FHIR-REST-TLS", "org.openehealth.ipf.commons.ihe.fhir.audit.protocol.FhirRestTLSAuditRecordApacheSenderProvider"), diff --git a/commons/audit/src/main/java/org/openehealth/ipf/commons/audit/protocol/providers/VertxTLSSyslogSenderProvider.java b/commons/audit/src/main/java/org/openehealth/ipf/commons/audit/protocol/providers/VertxTLSSyslogSenderProvider.java deleted file mode 100644 index 7fc0f74424..0000000000 --- a/commons/audit/src/main/java/org/openehealth/ipf/commons/audit/protocol/providers/VertxTLSSyslogSenderProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2024 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openehealth.ipf.commons.audit.protocol.providers; - -import org.openehealth.ipf.commons.audit.TlsParameters; -import org.openehealth.ipf.commons.audit.protocol.AuditTransmissionProtocol; -import org.openehealth.ipf.commons.audit.protocol.AuditTransmissionProtocolProvider; -import org.openehealth.ipf.commons.audit.protocol.VertxTLSSyslogSenderImpl; - -@Deprecated -public class VertxTLSSyslogSenderProvider implements AuditTransmissionProtocolProvider { - - @Override - public AuditTransmissionProtocol createAuditTransmissionProtocol(TlsParameters tlsParameters) { - return new VertxTLSSyslogSenderImpl(tlsParameters); - } -} diff --git a/commons/audit/src/main/java/org/openehealth/ipf/commons/audit/protocol/providers/VertxUDPSyslogSenderProvider.java b/commons/audit/src/main/java/org/openehealth/ipf/commons/audit/protocol/providers/VertxUDPSyslogSenderProvider.java deleted file mode 100644 index 3aa76668c7..0000000000 --- a/commons/audit/src/main/java/org/openehealth/ipf/commons/audit/protocol/providers/VertxUDPSyslogSenderProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2024 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openehealth.ipf.commons.audit.protocol.providers; - -import org.openehealth.ipf.commons.audit.TlsParameters; -import org.openehealth.ipf.commons.audit.protocol.AuditTransmissionProtocol; -import org.openehealth.ipf.commons.audit.protocol.AuditTransmissionProtocolProvider; -import org.openehealth.ipf.commons.audit.protocol.VertxUDPSyslogSenderImpl; - -@Deprecated -public class VertxUDPSyslogSenderProvider implements AuditTransmissionProtocolProvider { - - @Override - public AuditTransmissionProtocol createAuditTransmissionProtocol(TlsParameters tlsParameters) { - return new VertxUDPSyslogSenderImpl(tlsParameters); - } -} diff --git a/commons/audit/src/main/resources/META-INF/services/org.openehealth.ipf.commons.audit.protocol.AuditTransmissionProtocolProvider b/commons/audit/src/main/resources/META-INF/services/org.openehealth.ipf.commons.audit.protocol.AuditTransmissionProtocolProvider index 256537f434..73ab162357 100644 --- a/commons/audit/src/main/resources/META-INF/services/org.openehealth.ipf.commons.audit.protocol.AuditTransmissionProtocolProvider +++ b/commons/audit/src/main/resources/META-INF/services/org.openehealth.ipf.commons.audit.protocol.AuditTransmissionProtocolProvider @@ -2,6 +2,4 @@ org.openehealth.ipf.commons.audit.protocol.providers.TLSSyslogSenderProvider org.openehealth.ipf.commons.audit.protocol.providers.UDPSyslogSenderProvider org.openehealth.ipf.commons.audit.protocol.providers.NettyTLSSyslogSenderProvider org.openehealth.ipf.commons.audit.protocol.providers.ReactorNettyTLSSyslogSenderProvider -org.openehealth.ipf.commons.audit.protocol.providers.RecordingAuditMessageTransmissionProvider -org.openehealth.ipf.commons.audit.protocol.providers.VertxTLSSyslogSenderProvider -org.openehealth.ipf.commons.audit.protocol.providers.VertxUDPSyslogSenderProvider \ No newline at end of file +org.openehealth.ipf.commons.audit.protocol.providers.RecordingAuditMessageTransmissionProvider \ No newline at end of file diff --git a/commons/ihe/fhir/core/src/test/java/org/openehealth/ipf/commons/ihe/fhir/audit/server/FhirAuditServer.java b/commons/ihe/fhir/core/src/test/java/org/openehealth/ipf/commons/ihe/fhir/audit/server/FhirAuditServer.java index 7f7e5e0c3f..c4391e0e80 100644 --- a/commons/ihe/fhir/core/src/test/java/org/openehealth/ipf/commons/ihe/fhir/audit/server/FhirAuditServer.java +++ b/commons/ihe/fhir/core/src/test/java/org/openehealth/ipf/commons/ihe/fhir/audit/server/FhirAuditServer.java @@ -16,30 +16,18 @@ package org.openehealth.ipf.commons.ihe.fhir.audit.server; import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.rest.annotation.Create; -import ca.uhn.fhir.rest.annotation.Delete; -import ca.uhn.fhir.rest.annotation.IdParam; -import ca.uhn.fhir.rest.annotation.OptionalParam; -import ca.uhn.fhir.rest.annotation.Read; -import ca.uhn.fhir.rest.annotation.ResourceParam; -import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.annotation.*; import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.param.TokenParam; import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.RestfulServer; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; -import org.hl7.fhir.dstu3.model.Organization; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.AuditEvent; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.ResourceType; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; diff --git a/commons/ihe/fhir/core/src/test/java/org/openehealth/ipf/commons/ihe/fhir/audit/server/TLSBalpRepository.java b/commons/ihe/fhir/core/src/test/java/org/openehealth/ipf/commons/ihe/fhir/audit/server/TLSBalpRepository.java index a9acf2ecf7..a2f5720d9c 100644 --- a/commons/ihe/fhir/core/src/test/java/org/openehealth/ipf/commons/ihe/fhir/audit/server/TLSBalpRepository.java +++ b/commons/ihe/fhir/core/src/test/java/org/openehealth/ipf/commons/ihe/fhir/audit/server/TLSBalpRepository.java @@ -24,19 +24,16 @@ import io.undertow.servlet.api.DeploymentManager; import io.undertow.servlet.api.InstanceFactory; import io.undertow.servlet.api.InstanceHandle; +import jakarta.servlet.ServletException; import org.openehealth.ipf.commons.audit.TlsParameters; import org.openehealth.ipf.commons.ihe.fhir.extension.FhirAuditRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.servlet.ServletException; - import java.io.Closeable; import java.io.IOException; -import static io.undertow.servlet.Servlets.defaultContainer; -import static io.undertow.servlet.Servlets.deployment; -import static io.undertow.servlet.Servlets.servlet; +import static io.undertow.servlet.Servlets.*; public class TLSBalpRepository implements Closeable { diff --git a/commons/ihe/fhir/r4/mhd/src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti105/Iti105DocumentReferenceResourceProvider.java b/commons/ihe/fhir/r4/mhd/src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti105/Iti105DocumentReferenceResourceProvider.java index 5b5e354ead..c52aad3cf7 100644 --- a/commons/ihe/fhir/r4/mhd/src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti105/Iti105DocumentReferenceResourceProvider.java +++ b/commons/ihe/fhir/r4/mhd/src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti105/Iti105DocumentReferenceResourceProvider.java @@ -20,13 +20,12 @@ import ca.uhn.fhir.rest.annotation.ResourceParam; import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.api.server.RequestDetails; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.DocumentReference; import org.openehealth.ipf.commons.ihe.fhir.AbstractResourceProvider; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - /** * Resource Provider for MHD (ITI-105) based on creating a DocumentReference resource * diff --git a/commons/ihe/fhir/r4/mhd/src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti66/Iti66ListResourceProvider.java b/commons/ihe/fhir/r4/mhd/src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti66/Iti66ListResourceProvider.java index a3e4252973..67a7c75376 100644 --- a/commons/ihe/fhir/r4/mhd/src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti66/Iti66ListResourceProvider.java +++ b/commons/ihe/fhir/r4/mhd/src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti66/Iti66ListResourceProvider.java @@ -23,12 +23,12 @@ import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.param.*; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.r4.model.*; import org.openehealth.ipf.commons.ihe.fhir.AbstractPlainProvider; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import java.util.Set; /** diff --git a/commons/ihe/ws/pom.xml b/commons/ihe/ws/pom.xml index fd006b8c18..98caf0a33f 100644 --- a/commons/ihe/ws/pom.xml +++ b/commons/ihe/ws/pom.xml @@ -84,11 +84,6 @@ tomcat-jasper test - - jakarta.security.auth.message - jakarta.security.auth.message-api - test - org.springframework spring-web diff --git a/commons/ihe/ws/src/test/java/org/openehealth/ipf/commons/ihe/ws/server/JettyServer.java b/commons/ihe/ws/src/test/java/org/openehealth/ipf/commons/ihe/ws/server/JettyServer.java index 67d7b99c4d..b869b870e0 100644 --- a/commons/ihe/ws/src/test/java/org/openehealth/ipf/commons/ihe/ws/server/JettyServer.java +++ b/commons/ihe/ws/src/test/java/org/openehealth/ipf/commons/ihe/ws/server/JettyServer.java @@ -15,6 +15,7 @@ */ package org.openehealth.ipf.commons.ihe.ws.server; +import jakarta.servlet.ServletContext; import org.eclipse.jetty.ee10.servlet.ServletContextHandler; import org.eclipse.jetty.ee10.servlet.ServletHolder; import org.eclipse.jetty.server.*; @@ -30,6 +31,7 @@ */ public class JettyServer extends ServletServer { private Server server; + private ServletContext servletContext; @Override public void start() { @@ -63,6 +65,13 @@ public void start() { } catch (Exception e) { throw new AssertionError(e); } + + this.servletContext = context.getServletContext(); + } + + @Override + public ServletContext getServletContext() { + return servletContext; } private ServerConnector secureServerConnector(int port) { diff --git a/commons/ihe/ws/src/test/java/org/openehealth/ipf/commons/ihe/ws/server/ServletServer.java b/commons/ihe/ws/src/test/java/org/openehealth/ipf/commons/ihe/ws/server/ServletServer.java index 67c26c1696..d45c887919 100644 --- a/commons/ihe/ws/src/test/java/org/openehealth/ipf/commons/ihe/ws/server/ServletServer.java +++ b/commons/ihe/ws/src/test/java/org/openehealth/ipf/commons/ihe/ws/server/ServletServer.java @@ -15,6 +15,7 @@ */ package org.openehealth.ipf.commons.ihe.ws.server; +import jakarta.servlet.ServletContext; import org.openehealth.ipf.commons.ihe.core.ClientAuthType; import jakarta.servlet.Servlet; @@ -98,6 +99,8 @@ public String getContextPath() { return contextPath; } + public abstract ServletContext getServletContext(); + /** * @param port * the port that the server is started on. diff --git a/commons/ihe/ws/src/test/java/org/openehealth/ipf/commons/ihe/ws/server/TomcatServer.java b/commons/ihe/ws/src/test/java/org/openehealth/ipf/commons/ihe/ws/server/TomcatServer.java index ed6830e589..b2fe74390d 100644 --- a/commons/ihe/ws/src/test/java/org/openehealth/ipf/commons/ihe/ws/server/TomcatServer.java +++ b/commons/ihe/ws/src/test/java/org/openehealth/ipf/commons/ihe/ws/server/TomcatServer.java @@ -15,6 +15,8 @@ */ package org.openehealth.ipf.commons.ihe.ws.server; +import jakarta.security.auth.message.config.AuthConfigFactory; +import jakarta.servlet.ServletContext; import org.apache.catalina.Wrapper; import org.apache.catalina.authenticator.jaspic.AuthConfigFactoryImpl; import org.apache.catalina.startup.Tomcat; @@ -23,7 +25,6 @@ import org.slf4j.LoggerFactory; import org.springframework.web.context.ContextLoaderListener; -import jakarta.security.auth.message.config.AuthConfigFactory; import java.util.concurrent.atomic.AtomicInteger; /** @@ -38,6 +39,7 @@ public class TomcatServer extends ServletServer { private static final AtomicInteger SERVLET_COUNTER = new AtomicInteger(0); private Tomcat embedded; private Wrapper wrapper; + private ServletContext servletContext; @Override public void start() { @@ -47,6 +49,7 @@ public void start() { var context = embedded.addContext(getContextPath(), "/"); context.addParameter("contextConfigLocation", getContextResource()); context.addApplicationListener(ContextLoaderListener.class.getName()); + context.addServletContainerInitializer((c, ctx) -> servletContext = ctx, null); embedded.getHost().setAppBase(""); @@ -100,6 +103,11 @@ public void start() { } } + @Override + public ServletContext getServletContext() { + return servletContext; + } + @Override public void stop() { if (embedded != null) { diff --git a/dependencies/pom.xml b/dependencies/pom.xml index 96296679d6..fbb8eab660 100644 --- a/dependencies/pom.xml +++ b/dependencies/pom.xml @@ -15,7 +15,7 @@ 3.19.0 4.0.3 - 2.15.0 + 2.15.1 1.3.200-v20130910-1609 3.6.200-v20130402-1505 4.0.18 @@ -40,7 +40,6 @@ 0.0.16 3.2.2 2.3 - 4.5.1 25.0 6.5.1 4.0.1 diff --git a/platform-camel/ihe/fhir/r4/test/src/main/java/org/openehealth/ipf/platform/camel/ihe/fhir/test/FhirTestContainer.java b/platform-camel/ihe/fhir/r4/test/src/main/java/org/openehealth/ipf/platform/camel/ihe/fhir/test/FhirTestContainer.java index f5cc217af6..c4374091ff 100644 --- a/platform-camel/ihe/fhir/r4/test/src/main/java/org/openehealth/ipf/platform/camel/ihe/fhir/test/FhirTestContainer.java +++ b/platform-camel/ihe/fhir/r4/test/src/main/java/org/openehealth/ipf/platform/camel/ihe/fhir/test/FhirTestContainer.java @@ -20,13 +20,13 @@ import ca.uhn.fhir.rest.api.EncodingEnum; import ca.uhn.fhir.rest.client.api.IGenericClient; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; +import jakarta.servlet.Servlet; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.CapabilityStatement; import org.hl7.fhir.r4.model.OperationOutcome; import org.openehealth.ipf.commons.audit.codes.EventOutcomeIndicator; import org.openehealth.ipf.platform.camel.ihe.ws.StandardTestContainer; -import javax.servlet.Servlet; import java.util.function.Consumer; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/platform-camel/ihe/ws/src/test/groovy/org/openehealth/ipf/platform/camel/ihe/ws/StandardTestContainer.groovy b/platform-camel/ihe/ws/src/test/groovy/org/openehealth/ipf/platform/camel/ihe/ws/StandardTestContainer.groovy index b5837dac3c..3b385def10 100644 --- a/platform-camel/ihe/ws/src/test/groovy/org/openehealth/ipf/platform/camel/ihe/ws/StandardTestContainer.groovy +++ b/platform-camel/ihe/ws/src/test/groovy/org/openehealth/ipf/platform/camel/ihe/ws/StandardTestContainer.groovy @@ -15,6 +15,7 @@ */ package org.openehealth.ipf.platform.camel.ihe.ws +import jakarta.servlet.Servlet import org.apache.camel.CamelContext import org.apache.camel.Exchange import org.apache.camel.ProducerTemplate @@ -31,8 +32,6 @@ import org.slf4j.LoggerFactory import org.springframework.context.ApplicationContext import org.springframework.web.context.support.WebApplicationContextUtils -import javax.servlet.Servlet - /** * Base class for tests that are run within an embedded web container. * This class requires that an application context named "context.xml" is @@ -77,7 +76,7 @@ class StandardTestContainer { servletServer.start() - def servletContext = servlet.servletConfig.servletContext + def servletContext = servletServer.servletContext appContext = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext) producerTemplate = appContext.getBean('template', ProducerTemplate.class) camelContext = appContext.getBean('camelContext', CamelContext.class) @@ -94,7 +93,7 @@ class StandardTestContainer { } static int startServer(servlet, String appContextName, boolean secure, String servletName = null) { - int port = JettyServer.freePort + int port = ServletServer.freePort startServer(servlet, appContextName, secure, port, servletName) port } diff --git a/pom.xml b/pom.xml index ce4fb58b77..b838fe76c7 100644 --- a/pom.xml +++ b/pom.xml @@ -57,13 +57,13 @@ 6.0.1 5.2.0 33.0.0-jre - 1.1.3 1.18.30 5.15.0 3.1.5 0.6 10.1.18 - 4.23 + 2.3.11.Final + 4.24 @@ -207,12 +207,6 @@ test - - jakarta.security.auth.message - jakarta.security.auth.message-api - ${jaspic-api-version} - test - net.java.quickcheck diff --git a/tutorials/iheclient/pom.xml b/tutorials/iheclient/pom.xml index 6810f4e215..4ca9504fd6 100644 --- a/tutorials/iheclient/pom.xml +++ b/tutorials/iheclient/pom.xml @@ -74,6 +74,12 @@ com.github.ben-manes.caffeine caffeine + + + com.google.errorprone + error_prone_annotations + + diff --git a/tutorials/xds/pom.xml b/tutorials/xds/pom.xml index dfe90c5427..d832d61e62 100644 --- a/tutorials/xds/pom.xml +++ b/tutorials/xds/pom.xml @@ -86,11 +86,6 @@ tomcat-jasper compile - - jakarta.security.auth.message - jakarta.security.auth.message-api - compile -