Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 51 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@
</developers>
<properties>
<slf4j.version>2.1.0-alpha1</slf4j.version>
<log4j.version>2.25.4</log4j.version>
<log4j.version>2.26.0</log4j.version>

<jetty.version>12.1.8</jetty.version>
<jetty.version>12.1.10</jetty.version>
<!-- <jakarta.servlet-api.version>6.0.0</jakarta.servlet-api.version> -->
<jersey.version>3.1.11</jersey.version>
<jersey.version>3.1.12</jersey.version>

<spring-boot.version>2.3.3.RELEASE</spring-boot.version>

<jena.version>6.1.0-SNAPSHOT</jena.version>
<jena.version>6.1.0</jena.version>
<jenax.version>6.1.0-1-SNAPSHOT</jenax.version>
<rmltk.version>6.1.0-1-SNAPSHOT</rmltk.version>
<conjure.version>5.6.0-1-SNAPSHOT</conjure.version>
Expand All @@ -67,7 +67,7 @@
<!-- <jenax.version>3.14.0-2-SNAPSHOT</jenax.version> -->
<!-- <slf4j.version>1.8.0-beta4</slf4j.version> -->
<picocli.version>4.7.7</picocli.version>
<jackson.version>2.21</jackson.version>
<jackson.version>2.22</jackson.version>
<commons-vfs2.version>2.10.0</commons-vfs2.version>
<hadoop.version>3.5.0</hadoop.version>
<!-- <jetty.version>9.4.40.v20210413</jetty.version> -->
Expand All @@ -84,6 +84,30 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<gpg.keyname>AKSW</gpg.keyname>
<nexus-staging-maven-plugin.version>1.7.0</nexus-staging-maven-plugin.version>

<ws.rs-api.version>2.1.1</ws.rs-api.version>
<jts-io-common.version>1.20.0</jts-io-common.version>
<jgit.version>5.13.5.202508271544-r</jgit.version>
<jsch.agentproxy.jsch.version>0.0.9</jsch.agentproxy.jsch.version>
<jsch.agentproxy.usocket-jna.version>0.0.9</jsch.agentproxy.usocket-jna.version>
<jsch.agentproxy.sshagent.version>0.0.9</jsch.agentproxy.sshagent.version>
<vfs2nio.version>0.0.1-3</vfs2nio.version>
<classgraph.version>4.8.184</classgraph.version>
<junit.version>4.13.2</junit.version>

<github-release-plugin.version>1.6.0</github-release-plugin.version>
<maven-compiler-plugin.version>3.15.0</maven-compiler-plugin.version>
<maven-source-plugin.version>3.4.0</maven-source-plugin.version>
<maven-javadoc-plugin.version>2.10.4</maven-javadoc-plugin.version>
<maven-surefire-plugin.version>3.6.0-M1</maven-surefire-plugin.version>
<jib-maven-plugin.version>3.5.1</jib-maven-plugin.version>
<jdeb.version>1.14</jdeb.version>
<rpm.version>1.13.0</rpm.version>
<maven-shade-plugin.version>2.4.3</maven-shade-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
<maven-dependency-plugin.version>3.11.0</maven-dependency-plugin.version>
<gitflow-maven-plugin.version>1.21.0</gitflow-maven-plugin.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down Expand Up @@ -124,7 +148,7 @@
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.1.1</version>
<version>${ws.rs-api.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -317,40 +341,40 @@
<dependency>
<groupId>org.locationtech.jts.io</groupId>
<artifactId>jts-io-common</artifactId>
<version>1.18.1</version>
<version>${jts-io-common.version}</version>
</dependency>

<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>5.6.0.201912101111-r</version>
<version>${jgit.version}</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch.agentproxy.jsch</artifactId>
<version>0.0.9</version>
<version>${jsch.agentproxy.jsch.version}</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch.agentproxy.usocket-jna</artifactId>
<version>0.0.9</version>
<version>${jsch.agentproxy.usocket-jna.version}</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch.agentproxy.sshagent</artifactId>
<version>0.0.9</version>
<version>${jsch.agentproxy.sshagent.version}</version>
</dependency>

<dependency>
<groupId>org.aksw.thirdparty.com.sshtools</groupId>
<artifactId>vfs2nio</artifactId>
<version>0.0.1-3-SNAPSHOT</version>
<version>${vfs2nio.version}</version>
</dependency>

<dependency>
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
<version>4.8.129</version>
<version>${classgraph.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -379,7 +403,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<version>${junit.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -420,12 +444,12 @@
<plugin>
<groupId>de.jutzig</groupId>
<artifactId>github-release-plugin</artifactId>
<version>1.4.0</version>
<version>${github-release-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.amashchenko.maven.plugin</groupId>
<artifactId>gitflow-maven-plugin</artifactId>
<version>1.8.0</version>
<version>${gitflow-maven-plugin.version}</version>
<configuration>
<gitFlowConfig>
<versionTagPrefix>v</versionTagPrefix>
Expand All @@ -435,7 +459,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<!-- <source>${maven.compiler.source}</source> -->
<!-- <target>${maven.compiler.target}</target> -->
Expand All @@ -447,7 +471,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -461,7 +485,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -480,7 +504,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.2</version>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<!-- <forkCount>1C</forkCount> -->
<!-- <reuseForks>true</reuseForks> -->
Expand All @@ -495,22 +519,22 @@
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>3.4.4</version>
<version>${jib-maven-plugin.version}</version>
</plugin>
<plugin>
<artifactId>jdeb</artifactId>
<groupId>org.vafer</groupId>
<version>1.10</version>
<version>${jdeb.version}</version>
</plugin>
<plugin>
<groupId>de.dentrassi.maven</groupId>
<artifactId>rpm</artifactId>
<version>1.8.0</version>
<version>${rpm.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<version>${maven-shade-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -542,7 +566,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down Expand Up @@ -571,12 +595,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<version>${maven-deploy-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.2</version>
<version>${maven-dependency-plugin.version}</version>
<executions>
<execution>
<phase>prepare-package</phase>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package org.aksw.sparql_integrate.cli.main;

import jakarta.servlet.ServletRegistration;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.ws.rs.core.MediaType;
import org.aksw.jenax.web.server.boot.ServletBuilder;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.support.GenericWebApplicationContext;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;

public class ServletRptServerStatus extends HttpServlet implements ServletBuilder {

private AtomicBoolean serverReady = null;

public static ServletRptServerStatus newBuilder() {
return new ServletRptServerStatus();
}

@Override
public WebApplicationInitializer build(GenericWebApplicationContext rootContext) {
Objects.requireNonNull(serverReady, "Ready signal was not configured");
return servletContext -> {
ServletRegistration.Dynamic servlet = servletContext.addServlet("rptServerStatus", this);
servlet.addMapping("/health");
servlet.addMapping("/health/");
servlet.setLoadOnStartup(1);
};
}

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
String accept = req.getHeader("Accept");
boolean isSse = accept != null && accept.contains("text/event-stream");

if (false && isSse) {
resp.setContentType("text/event-stream;charset=utf-8");
resp.setHeader("Cache-Control", "no-cache");
resp.setHeader("Connection", "keep-alive");

PrintWriter writer = resp.getWriter();
writer.print("data: " + (serverReady.get() ? "ready" : "starting") + "\n\n");
writer.flush();
// XXX Would need to keep the connection open for SSE
} else {
resp.setContentType(MediaType.TEXT_PLAIN);
PrintWriter writer = resp.getWriter();
writer.println(serverReady.get() ? "ready" : "starting");
writer.close();
}
}

public ServletRptServerStatus setServerReady(AtomicBoolean serverReady) {
this.serverReady = serverReady;
return this;
}

public boolean isServerReady() {
return serverReady.get();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.Optional;
import java.util.Set;
import java.util.function.Consumer;
Expand Down Expand Up @@ -218,6 +219,8 @@ public static int sparqlIntegrate(CmdSparqlIntegrateMain cmd) throws Exception {
CmdMixinArq.configureGlobal(cmd.arqConfig);
CmdMixinArq.configureCxt(ARQ.getContext(), cmd.arqConfig);

AtomicBoolean serverReady = new AtomicBoolean();

// JenaRuntime.isRDF11 = !cmd.useRdf10;
//
// CliUtils.configureGlobalSettings();
Expand Down Expand Up @@ -971,7 +974,9 @@ public void afterExec() {
// .addServletBuilder(ServletBuilderGraphQlV2.newBuilder().setGraphQlExecFactory(graphQlExecFactory))
.addServletBuilder(
ServletBuilderGraphQlV2.newBuilder().setGraphQlExecFactory(graphQlExecFactoryV2))
.addServletBuilder(ServletLdvConfigJs.newBuilder().setDbEngine(cmd.engine)).setPort(port);
.addServletBuilder(ServletLdvConfigJs.newBuilder().setDbEngine(cmd.engine))
.addServletBuilder(ServletRptServerStatus.newBuilder().setServerReady(serverReady))
.setPort(port);

if (graphqlSchemaNavigator != null) {
serverBuilder = serverBuilder.addServletBuilder(ServletGraphQlSchema.newBuilder()
Expand Down Expand Up @@ -1040,6 +1045,8 @@ public void afterExec() {
logger.info("SPARQL overall execution finished after " + sw.stop());

if (server != null) {
serverReady.set(true);
// ServletRptServerStatus.setServerReady();
logger.info("Server still running on port " + cmd.serverPort + ". Terminate with CTRL+C");
server.join();
}
Expand Down
Loading
Loading