Skip to content

Commit

Permalink
#414: update libraries and rebase from master
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Ohr committed Feb 19, 2024
1 parent 8b88563 commit 9cc1004
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 115 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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"),
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
org.openehealth.ipf.commons.audit.protocol.providers.RecordingAuditMessageTransmissionProvider
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
5 changes: 0 additions & 5 deletions commons/ihe/ws/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@
<artifactId>tomcat-jasper</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.security.auth.message</groupId>
<artifactId>jakarta.security.auth.message-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand All @@ -30,6 +31,7 @@
*/
public class JettyServer extends ServletServer {
private Server server;
private ServletContext servletContext;

@Override
public void start() {
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -98,6 +99,8 @@ public String getContextPath() {
return contextPath;
}

public abstract ServletContext getServletContext();

/**
* @param port
* the port that the server is started on.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

/**
Expand All @@ -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() {
Expand All @@ -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("");

Expand Down Expand Up @@ -100,6 +103,11 @@ public void start() {
}
}

@Override
public ServletContext getServletContext() {
return servletContext;
}

@Override
public void stop() {
if (embedded != null) {
Expand Down
3 changes: 1 addition & 2 deletions dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- resolve dependency convergence between guava and hapi caffeine -->
<checker-qual-version>3.19.0</checker-qual-version>
<cxf-version>4.0.3</cxf-version>
<commons-io-version>2.15.0</commons-io-version>
<commons-io-version>2.15.1</commons-io-version>
<equinox-app.version>1.3.200-v20130910-1609</equinox-app.version>
<equinox-common.version>3.6.200-v20130402-1505</equinox-common.version>
<groovy-version>4.0.18</groovy-version>
Expand All @@ -40,7 +40,6 @@
<simple-syslog-version>0.0.16</simple-syslog-version>
<spring-boot-version>3.2.2</spring-boot-version>
<velocity-version>2.3</velocity-version>
<vertx-version>4.5.1</vertx-version>
<vibur-version>25.0</vibur-version>
<woodstox-version>6.5.1</woodstox-version>
<xmlsec-version>4.0.1</xmlsec-version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
}
Expand Down
10 changes: 2 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@
<activemq-version>6.0.1</activemq-version>
<easymock-version>5.2.0</easymock-version>
<guava-version>33.0.0-jre</guava-version>
<jaspic-api-version>1.1.3</jaspic-api-version>
<lombok-version>1.18.30</lombok-version>
<mockserver-version>5.15.0</mockserver-version>
<pooled-jms-version>3.1.5</pooled-jms-version>
<quickcheck-version>0.6</quickcheck-version>
<tomcat-version>10.1.18</tomcat-version>
<xbean-spring-version>4.23</xbean-spring-version>
<undertow-version>2.3.11.Final</undertow-version>
<xbean-spring-version>4.24</xbean-spring-version>
</properties>

<scm>
Expand Down Expand Up @@ -207,12 +207,6 @@
</exclusions>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.security.auth.message</groupId>
<artifactId>jakarta.security.auth.message-api</artifactId>
<version>${jaspic-api-version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>net.java.quickcheck</groupId>
Expand Down
6 changes: 6 additions & 0 deletions tutorials/iheclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<exclusions>
<exclusion>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Expand Down
5 changes: 0 additions & 5 deletions tutorials/xds/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@
<artifactId>tomcat-jasper</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jakarta.security.auth.message</groupId>
<artifactId>jakarta.security.auth.message-api</artifactId>
<scope>compile</scope>
</dependency>

<!-- Dependencies for test -->
<dependency>
Expand Down

0 comments on commit 9cc1004

Please sign in to comment.