porting to jakarta

This commit is contained in:
lucio 2024-03-08 12:00:45 +01:00
parent 2bef840123
commit b2a113536f
6 changed files with 47 additions and 14 deletions

View File

@ -23,5 +23,18 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

30
pom.xml
View File

@ -14,8 +14,10 @@
</parent> </parent>
<scm> <scm>
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/common-jaxrs-client.git</connection> <connection>
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/common-jaxrs-client.git</developerConnection> scm:git:https://code-repo.d4science.org/gCubeSystem/common-jaxrs-client.git</connection>
<developerConnection>
scm:git:https://code-repo.d4science.org/gCubeSystem/common-jaxrs-client.git</developerConnection>
<url>https://code-repo.d4science.org/gCubeSystem/common-jaxrs-client</url> <url>https://code-repo.d4science.org/gCubeSystem/common-jaxrs-client</url>
</scm> </scm>
@ -24,7 +26,7 @@
<dependency> <dependency>
<groupId>org.gcube.distribution</groupId> <groupId>org.gcube.distribution</groupId>
<artifactId>gcube-bom</artifactId> <artifactId>gcube-bom</artifactId>
<version>3.0.0-SNAPSHOT</version> <version>3.0.1-SNAPSHOT</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
@ -50,8 +52,26 @@
<artifactId>jersey-client</artifactId> <artifactId>jersey-client</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.ws.rs</groupId> <groupId>jakarta.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId> <artifactId>jakarta.ws.rs-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</dependency>
<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -4,7 +4,7 @@ import java.io.StringReader;
import java.io.StringWriter; import java.io.StringWriter;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamResult;
import javax.xml.ws.EndpointReference; import jakarta.xml.ws.EndpointReference;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;

View File

@ -4,8 +4,8 @@ import java.io.IOException;
import java.util.Collections; import java.util.Collections;
import java.util.Map.Entry; import java.util.Map.Entry;
import javax.ws.rs.client.ClientRequestContext; import jakarta.ws.rs.client.ClientRequestContext;
import javax.ws.rs.client.ClientRequestFilter; import jakarta.ws.rs.client.ClientRequestFilter;
import org.gcube.common.calls.Interceptors; import org.gcube.common.calls.Interceptors;
import org.gcube.common.calls.Request; import org.gcube.common.calls.Request;
@ -22,7 +22,7 @@ public class JaxRSRequestFilter implements ClientRequestFilter {
@Override @Override
public void filter(final ClientRequestContext rc) throws IOException { public void filter(final ClientRequestContext rc) throws IOException {
if (SecretManagerProvider.instance.get()!=null){ if (SecretManagerProvider.get()!=null){
Request requestContext = Interceptors.executeRequestChain(service.call()); Request requestContext = Interceptors.executeRequestChain(service.call());
for (Entry<String, String> entry: requestContext.getHeaders()){ for (Entry<String, String> entry: requestContext.getHeaders()){
rc.getHeaders().put(entry.getKey(), Collections.singletonList((Object)entry.getValue())); rc.getHeaders().put(entry.getKey(), Collections.singletonList((Object)entry.getValue()));

View File

@ -1,9 +1,9 @@
package org.gcube.common.calls.jaxrs; package org.gcube.common.calls.jaxrs;
import javax.ws.rs.client.Client; import jakarta.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder; import jakarta.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget; import jakarta.ws.rs.client.WebTarget;
import javax.xml.ws.EndpointReference; import jakarta.xml.ws.EndpointReference;
import org.gcube.common.gxrest.request.GXWebTargetAdapterRequest; import org.gcube.common.gxrest.request.GXWebTargetAdapterRequest;
import org.glassfish.jersey.client.ClientProperties; import org.glassfish.jersey.client.ClientProperties;

View File

@ -1,6 +1,6 @@
package org.gcube.common.calls.jaxrs; package org.gcube.common.calls.jaxrs;
import javax.ws.rs.client.WebTarget; import jakarta.ws.rs.client.WebTarget;
import org.gcube.common.gxrest.request.GXWebTargetAdapterRequest; import org.gcube.common.gxrest.request.GXWebTargetAdapterRequest;