Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to Jetty 12 #1667

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up JDK 11
- name: Set up JDK 17
jvermillard marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
cache: maven

Expand Down
2 changes: 1 addition & 1 deletion .jenkins/ci.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pipeline {
agent any
tools {
maven 'apache-maven-latest'
jdk 'temurin-jdk11-latest'
jdk 'temurin-jdk17-latest'
}
options {
timeout (time: 30, unit: 'MINUTES')
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/nightly.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pipeline {
agent any
tools {
maven 'apache-maven-latest'
jdk 'temurin-jdk11-latest'
jdk 'temurin-jdk17-latest'
}
options {
timeout (time: 60, unit: 'MINUTES')
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/release.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pipeline {
}
tools {
maven 'apache-maven-latest'
jdk 'temurin-jdk11-latest'
jdk 'temurin-jdk17-latest'
}
options {
timeout (time: 30, unit: 'MINUTES')
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/test.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pipeline {
}
tools {
maven 'apache-maven-latest'
jdk 'temurin-jdk11-latest'
jdk 'temurin-jdk17-latest'
}
options {
timeout (time: 30, unit: 'MINUTES')
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/weekly.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pipeline {
agent any
tools {
maven 'apache-maven-latest'
jdk 'temurin-jdk11-latest'
jdk 'temurin-jdk17-latest'
}
options {
timeout (time: 30, unit: 'MINUTES')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
import org.eclipse.californium.core.config.CoapConfig;
import org.eclipse.californium.elements.config.Configuration;
import org.eclipse.californium.scandium.config.DtlsConfig;
import org.eclipse.jetty.ee10.servlet.DefaultServlet;
import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
import org.eclipse.jetty.ee10.servlet.ServletHolder;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.leshan.bsserver.EditableBootstrapConfigStore;
import org.eclipse.leshan.bsserver.LeshanBootstrapServer;
import org.eclipse.leshan.bsserver.LeshanBootstrapServerBuilder;
Expand Down Expand Up @@ -217,7 +217,7 @@ private static Server createJettyServer(LeshanBsServerDemoCLI cli, LeshanBootstr
jettyAddr = new InetSocketAddress(cli.main.webhost, cli.main.webPort);
}
Server server = new Server(jettyAddr);
ServletContextHandler root = new ServletContextHandler(null, "/", true, false);
ServletContextHandler root = new ServletContextHandler("/", true, false);
server.setHandler(root);

// Create static Servlet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
import java.nio.charset.StandardCharsets;
import java.util.EnumSet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.eclipse.leshan.bsserver.BootstrapConfig;
import org.eclipse.leshan.bsserver.EditableBootstrapConfigStore;
Expand All @@ -42,6 +37,11 @@
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.type.CollectionType;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
* Servlet for REST API in charge of adding bootstrap information to the bootstrap server.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

import javax.servlet.http.HttpServletRequest;

import org.eclipse.jetty.servlets.EventSource;
import org.eclipse.jetty.servlets.EventSourceServlet;
import org.eclipse.jetty.ee10.servlets.EventSource;
import org.eclipse.jetty.ee10.servlets.EventSourceServlet;
import org.eclipse.leshan.bsserver.BootstrapFailureCause;
import org.eclipse.leshan.bsserver.BootstrapSession;
import org.eclipse.leshan.bsserver.BootstrapSessionListener;
Expand All @@ -44,6 +42,8 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import jakarta.servlet.http.HttpServletRequest;

public class EventServlet extends EventSourceServlet {
private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
import java.security.PublicKey;
import java.security.cert.X509Certificate;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.eclipse.leshan.bsserver.LeshanBootstrapServer;
import org.eclipse.leshan.bsserver.endpoint.LwM2mBootstrapServerEndpoint;
Expand All @@ -36,6 +31,11 @@
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public class ServerServlet extends HttpServlet {

private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
import org.eclipse.californium.elements.util.CertPathUtil;
import org.eclipse.californium.scandium.config.DtlsConfig;
import org.eclipse.californium.scandium.config.DtlsConfig.DtlsRole;
import org.eclipse.jetty.ee10.servlet.DefaultServlet;
import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
import org.eclipse.jetty.ee10.servlet.ServletHolder;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.leshan.core.endpoint.DefaultEndPointUriHandler;
import org.eclipse.leshan.core.endpoint.EndPointUriHandler;
import org.eclipse.leshan.core.endpoint.Protocol;
Expand Down Expand Up @@ -290,7 +290,7 @@ private static Server createJettyServer(LeshanServerDemoCLI cli, LeshanServer lw
jettyAddr = new InetSocketAddress(cli.main.webhost, cli.main.webPort);
}
Server server = new Server(jettyAddr);
ServletContextHandler root = new ServletContextHandler(null, "/", true, false);
ServletContextHandler root = new ServletContextHandler("/", true, false);
server.setHandler(root);

// Create static Servlet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.eclipse.leshan.core.link.Link;
Expand Down Expand Up @@ -92,6 +87,11 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
* Service HTTP REST API calls.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

import javax.servlet.http.HttpServletRequest;

import org.eclipse.jetty.servlets.EventSource;
import org.eclipse.jetty.servlets.EventSourceServlet;
import org.eclipse.jetty.ee10.servlets.EventSource;
import org.eclipse.jetty.ee10.servlets.EventSourceServlet;
import org.eclipse.leshan.core.LwM2m.Version;
import org.eclipse.leshan.core.link.Link;
import org.eclipse.leshan.core.node.LwM2mNode;
Expand Down Expand Up @@ -66,6 +64,7 @@
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.node.ObjectNode;

import jakarta.servlet.http.HttpServletRequest;
import jline.internal.Log;

public class EventServlet extends EventSourceServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
import java.util.Comparator;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.eclipse.leshan.core.model.LwM2mModel;
import org.eclipse.leshan.core.model.ObjectModel;
Expand All @@ -35,6 +30,11 @@
import org.eclipse.leshan.server.registration.Registration;
import org.eclipse.leshan.server.registration.RegistrationService;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public class ObjectSpecServlet extends HttpServlet {

private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
import java.security.PublicKey;
import java.security.cert.X509Certificate;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.eclipse.leshan.demo.servers.json.PublicKeySerDes;
import org.eclipse.leshan.demo.servers.json.X509CertificateSerDes;
Expand All @@ -36,6 +31,11 @@
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public class ServerServlet extends HttpServlet {

private static final long serialVersionUID = 1L;
Expand Down
8 changes: 4 additions & 4 deletions leshan-demo-servers-shared/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ Contributors:
<artifactId>leshan-demo-shared</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-webapp</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-servlets</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
import java.security.cert.X509Certificate;
import java.util.Collection;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.eclipse.leshan.demo.servers.json.JacksonSecurityDeserializer;
import org.eclipse.leshan.demo.servers.json.JacksonSecuritySerializer;
Expand All @@ -46,6 +41,11 @@
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
* Service HTTP REST API calls for security information.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
/**
* Since LWM2M v1.1, endpoint name is optional in REGISTER and BOOTSTRAP request. An {@link ClientEndpointNameProvider}
* is determine the endpoint name value which should be used in Register/BootstrapRequest.
* <p>
*
* @see <a href="https://github.com/eclipse-leshan/leshan/issues/1457"></a>
* @see DefaultClientEndpointNameProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ public static List<ObjectModel> loadDdfResources(String path, String[] filenames
* Load object definition from DDF resources following rules of {@link Class#getResourceAsStream(String)}.
* <p>
* It should be used to load DDF embedded with your application bundle (e.g. jar, war, ...)
* <p>
*
* @param path directory path to the DDF files
* @param filenames names of all the DDF files
Expand Down Expand Up @@ -247,7 +246,6 @@ public static List<ObjectModel> loadDdfResources(String[] paths)
* Load object definition from DDF resources following rules of {@link Class#getResourceAsStream(String)}.
* <p>
* It should be used to load DDF embedded with your application bundle (e.g. jar, war, ...)
* <p>
*
* @param paths An array of paths to DDF files.
* @param validate true if you want model validation. Validation is not free and it could make sense to not validate
Expand All @@ -265,7 +263,6 @@ public static List<ObjectModel> loadDdfResources(String[] paths, boolean validat
* Load object definition from DDF resources following rules of {@link Class#getResourceAsStream(String)}.
* <p>
* It should be used to load DDF embedded with your application bundle (e.g. jar, war, ...)
* <p>
*
* @param paths An array of paths to DDF files.
* @param ddfFileParser a ddfFileParser which could do validation optionally.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ List<TimestampedLwM2mNode> decodeTimestampedData(byte[] content, ContentFormat f

/**
* Deserializes a binary content into a {@link TimestampedLwM2mNodes}.
* <p>
*
* @param content the content
* @param format the content format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
public interface TimestampedMultiNodeDecoder {
/**
* Deserializes a binary content into a {@link TimestampedLwM2mNodes}.
* <p>
*
* @param content the content
* @param rootPath the expected rootPath also known as alternatePath of LWM2M client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
public interface TimestampedMultiNodeEncoder {
/**
* Serializes a {@link TimestampedLwM2mNodes} object into a byte array.
* <p>
*
* @param rootPath to use by LWM2M client (also known as alternate path)
* @param timestampedNodes timestamped nodes to be serialized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public class WriteCompositeRequest extends AbstractLwM2mRequest<WriteCompositeRe

/**
* Create WriteComposite Request.
* <p>
*
* @param values The values to write as a the Map of string path to value. Value can not be <code>null</code>. And
* must be {@link Boolean} or {@link String} or a byte array or {@link Date} or {@link Long} or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
/**
* Since LWM2M v1.1, endpoint name is optional in REGISTER and BOOTSTRAP request. An {@link ServerEndpointNameProvider}
* is responsible to find the right Endpoint Name from the client identity.
* <p>
*
* @see <a href="https://github.com/eclipse-leshan/leshan/issues/1457"></a>
* @see DefaultServerEndpointNameProvider
Expand Down
Loading