moved to jakarta
This commit is contained in:
parent
e36605ec12
commit
3aeca7c089
32
pom.xml
32
pom.xml
|
@ -24,17 +24,27 @@
|
|||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<properties>
|
||||
<tomcat.version>9.0.85</tomcat.version>
|
||||
<tomcat.version>10.1.19</tomcat.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
</properties>
|
||||
<scm>
|
||||
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/common-smartgears.git</connection>
|
||||
<developerConnection>scm:git:httpstps://code-repo.d4science.org/gCubeSystem/common-smartgears.git</developerConnection>
|
||||
<connection>
|
||||
scm:git:https://code-repo.d4science.org/gCubeSystem/common-smartgears.git</connection>
|
||||
<developerConnection>
|
||||
scm:git:httpstps://code-repo.d4science.org/gCubeSystem/common-smartgears.git</developerConnection>
|
||||
<url>https://code-repo.d4science.org/gCubeSystem/common-smartgears</url>
|
||||
</scm>
|
||||
<dependencies>
|
||||
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
|
||||
<!--
|
||||
https://mvnrepository.com/artifact/jakarta.servlet/jakarta.servlet-api -->
|
||||
<dependency>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<version>6.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
|
@ -102,12 +112,6 @@
|
|||
<groupId>org.gcube.common.security</groupId>
|
||||
<artifactId>gcube-secrets</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>4.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-core -->
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
|
@ -119,7 +123,8 @@
|
|||
<artifactId>micrometer-registry-prometheus</artifactId>
|
||||
<version>1.9.0</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.tomcat/tomcat-catalina -->
|
||||
<!--
|
||||
https://mvnrepository.com/artifact/org.apache.tomcat/tomcat-catalina -->
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat</groupId>
|
||||
<artifactId>tomcat-catalina</artifactId>
|
||||
|
@ -143,6 +148,10 @@
|
|||
<version>1.9.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.resources</groupId>
|
||||
<artifactId>common-gcore-resources</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
@ -185,7 +194,8 @@
|
|||
<configuration>
|
||||
<primaryArtifact>false</primaryArtifact>
|
||||
<classifier>probe</classifier>
|
||||
<packagingIncludes>WEB-INF/classes/org/gcube/smartgears/probe/**/*</packagingIncludes>
|
||||
<packagingIncludes>
|
||||
WEB-INF/classes/org/gcube/smartgears/probe/**/*</packagingIncludes>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
|
|
@ -4,9 +4,9 @@ import static java.util.Collections.emptyList;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.ServletContainerInitializer;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import jakarta.servlet.ServletContainerInitializer;
|
||||
import jakarta.servlet.ServletContext;
|
||||
import jakarta.servlet.ServletException;
|
||||
|
||||
import org.gcube.smartgears.context.application.ApplicationContext;
|
||||
import org.gcube.smartgears.context.container.ContainerContext;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.gcube.smartgears.context.application;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import jakarta.servlet.ServletContext;
|
||||
|
||||
import org.gcube.common.events.Hub;
|
||||
import org.gcube.smartgears.configuration.application.ApplicationConfiguration;
|
||||
|
|
|
@ -7,7 +7,7 @@ import java.io.FileInputStream;
|
|||
import java.io.ObjectInputStream;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import jakarta.servlet.ServletContext;
|
||||
|
||||
import org.gcube.common.events.Hub;
|
||||
import org.gcube.smartgears.configuration.PersistenceConfiguration;
|
||||
|
|
|
@ -4,9 +4,9 @@ import java.io.IOException;
|
|||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.smartgears.Constants;
|
||||
import org.gcube.smartgears.configuration.application.GCubeExclude;
|
||||
|
|
|
@ -2,7 +2,7 @@ package org.gcube.smartgears.extensions;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.Servlet;
|
||||
import jakarta.servlet.Servlet;
|
||||
|
||||
import org.gcube.smartgears.configuration.application.GCubeExclude;
|
||||
import org.gcube.smartgears.context.application.ApplicationContext;
|
||||
|
|
|
@ -16,11 +16,11 @@ import java.util.LinkedHashSet;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.ServletResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.smartgears.configuration.application.GCubeExclude;
|
||||
import org.gcube.smartgears.context.application.ApplicationContext;
|
||||
|
|
|
@ -5,7 +5,7 @@ import static org.gcube.common.events.impl.Utils.valid;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import jakarta.servlet.http.HttpServlet;
|
||||
|
||||
import org.gcube.common.validator.annotations.NotEmpty;
|
||||
import org.gcube.smartgears.configuration.application.GCubeExclude;
|
||||
|
@ -66,7 +66,7 @@ public abstract class HttpExtension extends HttpServlet implements ApplicationEx
|
|||
}
|
||||
|
||||
//extensions use init(context) instead
|
||||
public final void init() throws javax.servlet.ServletException {
|
||||
public final void init() throws jakarta.servlet.ServletException {
|
||||
};
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,14 +2,14 @@ package org.gcube.smartgears.extensions;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.Filter;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.FilterConfig;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.ServletResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.smartgears.handlers.application.request.RequestException;
|
||||
import org.gcube.smartgears.utils.Utils;
|
||||
|
|
|
@ -5,9 +5,9 @@ import static org.gcube.smartgears.extensions.HttpExtension.Method.GET;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.gcube.smartgears.configuration.application.ApplicationConfiguration;
|
||||
|
|
|
@ -15,9 +15,9 @@ import java.util.Map;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.smartgears.extensions.ApiResource;
|
||||
import org.gcube.smartgears.extensions.ApiSignature;
|
||||
|
|
|
@ -9,9 +9,9 @@ import java.util.Set;
|
|||
import java.util.Timer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.gcube.common.health.api.HealthCheck;
|
||||
|
|
|
@ -8,9 +8,9 @@ import static org.gcube.smartgears.handlers.application.request.RequestError.inv
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.common.resources.gcore.Resources;
|
||||
import org.gcube.smartgears.extensions.ApiResource;
|
||||
|
|
|
@ -5,9 +5,9 @@ import static org.gcube.smartgears.extensions.HttpExtension.Method.GET;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.smartgears.extensions.ApiResource;
|
||||
import org.gcube.smartgears.extensions.ApiSignature;
|
||||
|
|
|
@ -5,9 +5,9 @@ import static org.gcube.smartgears.extensions.HttpExtension.Method.GET;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.smartgears.extensions.ApiResource;
|
||||
import org.gcube.smartgears.extensions.ApiSignature;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.gcube.smartgears.handlers.application;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.smartgears.context.application.ApplicationContext;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.gcube.smartgears.handlers.application;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.smartgears.context.application.ApplicationContext;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.gcube.smartgears.handlers.application.request;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,9 +4,7 @@ import static java.util.concurrent.TimeUnit.SECONDS;
|
|||
import static org.gcube.common.events.Observes.Kind.critical;
|
||||
import static org.gcube.common.events.Observes.Kind.resilient;
|
||||
import static org.gcube.smartgears.Constants.profile_management;
|
||||
import static org.gcube.smartgears.handlers.ProfileEvents.addToContext;
|
||||
import static org.gcube.smartgears.handlers.ProfileEvents.changed;
|
||||
import static org.gcube.smartgears.handlers.ProfileEvents.removeFromContext;
|
||||
import static org.gcube.smartgears.lifecycle.container.ContainerLifecycle.activation;
|
||||
import static org.gcube.smartgears.lifecycle.container.ContainerLifecycle.failure;
|
||||
import static org.gcube.smartgears.lifecycle.container.ContainerLifecycle.part_activation;
|
||||
|
@ -26,6 +24,7 @@ import org.gcube.smartgears.handlers.container.ContainerHandler;
|
|||
import org.gcube.smartgears.handlers.container.ContainerLifecycleEvent;
|
||||
import org.gcube.smartgears.lifecycle.container.ContainerLifecycle;
|
||||
import org.gcube.smartgears.lifecycle.container.ContainerState;
|
||||
import org.gcube.smartgears.managers.ContextEvents;
|
||||
import org.gcube.smartgears.provider.ProviderFactory;
|
||||
import org.gcube.smartgears.publishing.Publisher;
|
||||
import org.gcube.smartgears.utils.Utils;
|
||||
|
@ -129,7 +128,7 @@ public class ContainerProfileManager extends ContainerHandler {
|
|||
|
||||
}
|
||||
|
||||
@Observes(value = addToContext)
|
||||
@Observes(value = ContextEvents.ADD_CONTEXT_TO_CONTAINER)
|
||||
void addTo(String scope) {
|
||||
log.info("add_to_context event arrived in container");
|
||||
for (Publisher publisher : publishers)
|
||||
|
@ -151,7 +150,7 @@ public class ContainerProfileManager extends ContainerHandler {
|
|||
|
||||
}
|
||||
|
||||
@Observes(value = removeFromContext)
|
||||
@Observes(value = ContextEvents.REMOVE_CONTEXT_FROM_CONTAINER)
|
||||
void removeFrom(String scope) {
|
||||
log.info("remove_from_context event arrived in container");
|
||||
for (Publisher publisher : publishers)
|
||||
|
|
|
@ -31,7 +31,7 @@ public class HealthTask extends TimerTask{
|
|||
Status totalStatus = responses.stream().anyMatch(r -> r.getStatus().equals(Status.DOWN)) ? Status.DOWN : Status.UP;
|
||||
|
||||
this.response = new HealthResponse(totalStatus, responses);
|
||||
log.debug("health task executed with total status {}",totalStatus);
|
||||
log.trace("health task executed with total status {}",totalStatus);
|
||||
}
|
||||
|
||||
public HealthResponse getResponse() {
|
||||
|
|
|
@ -15,11 +15,11 @@ import java.io.ObjectOutputStream;
|
|||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.servlet.FilterRegistration;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
import javax.servlet.ServletRegistration;
|
||||
import jakarta.servlet.FilterRegistration;
|
||||
import jakarta.servlet.ServletContext;
|
||||
import jakarta.servlet.ServletContextEvent;
|
||||
import jakarta.servlet.ServletContextListener;
|
||||
import jakarta.servlet.ServletRegistration;
|
||||
|
||||
import org.gcube.common.events.Observes;
|
||||
import org.gcube.smartgears.configuration.application.ApplicationHandlers;
|
||||
|
|
|
@ -122,18 +122,6 @@ public class ContainerManager {
|
|||
context.lifecycle().tryMoveTo(ContainerState.partActive);
|
||||
}
|
||||
|
||||
@Observes(value = ContextEvents.ADD_CONTEXT_TO_CONTAINER, kind = Kind.critical)
|
||||
void addContext(String scope) {
|
||||
log.info("adding context {} event send", context);
|
||||
context.events().fire(scope, ProfileEvents.addToContext);
|
||||
}
|
||||
|
||||
@Observes(value = ContextEvents.REMOVE_CONTEXT_FROM_CONTAINER, kind = Kind.critical)
|
||||
void removeContext(String scope) {
|
||||
log.info("removing context {} event send", context);
|
||||
context.events().fire(scope, ProfileEvents.removeFromContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops container management on remote request.
|
||||
*
|
||||
|
|
|
@ -10,14 +10,14 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.Filter;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.FilterConfig;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.ServletResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.common.authorization.library.exception.AuthorizationException;
|
||||
import org.gcube.smartgears.Constants;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.gcube.smartgears.probe;
|
||||
|
||||
import javax.servlet.ServletContextListener;
|
||||
import javax.servlet.annotation.WebListener;
|
||||
import jakarta.servlet.ServletContextListener;
|
||||
import jakarta.servlet.annotation.WebListener;
|
||||
|
||||
import org.gcube.smartgears.managers.ContainerManager;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -12,12 +12,12 @@ public class ContainerListener implements ServletContextListener {
|
|||
|
||||
public static Logger log = LoggerFactory.getLogger(ContainerListener.class);
|
||||
|
||||
public void contextDestroyed(javax.servlet.ServletContextEvent sce) {
|
||||
public void contextDestroyed(jakarta.servlet.ServletContextEvent sce) {
|
||||
log.trace("shutting down container from probe");
|
||||
ContainerManager.instance.stop(true);
|
||||
};
|
||||
|
||||
public void contextInitialized(javax.servlet.ServletContextEvent sce) {
|
||||
public void contextInitialized(jakarta.servlet.ServletContextEvent sce) {
|
||||
log.trace("starting up probe...");
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import jakarta.servlet.ServletContext;
|
||||
|
||||
import org.gcube.common.events.Hub;
|
||||
import org.gcube.common.events.impl.DefaultHub;
|
||||
|
|
|
@ -2,7 +2,7 @@ package org.gcube.smartgears.provider;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import jakarta.servlet.ServletContext;
|
||||
|
||||
import org.gcube.smartgears.configuration.SmartgearsConfiguration;
|
||||
import org.gcube.smartgears.configuration.application.ApplicationHandlers;
|
||||
|
|
|
@ -16,8 +16,8 @@ import java.util.Collection;
|
|||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.common.authorization.library.provider.ServiceIdentifier;
|
||||
import org.gcube.common.authorization.library.provider.ServiceInfo;
|
||||
|
|
|
@ -3,7 +3,7 @@ package utils;
|
|||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import jakarta.servlet.ServletContext;
|
||||
|
||||
import org.gcube.smartgears.configuration.application.ApplicationConfiguration;
|
||||
import org.gcube.smartgears.configuration.application.ApplicationHandlers;
|
||||
|
|
Loading…
Reference in New Issue