Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2014-06-11 22:11:13 -0400
committerRoberto E. Escobar2014-08-28 19:58:39 -0400
commitd4a7765ec05b4f124de987004505b5510b50d36a (patch)
treec9f7e8dca41e9021a4fe9bdcb9659564550493a9 /plugins/org.eclipse.osee.ote.master.rest.client
parent87185d728b0628e8562b5046ec092eb44ff5ba8c (diff)
downloadorg.eclipse.osee-d4a7765ec05b4f124de987004505b5510b50d36a.tar.gz
org.eclipse.osee-d4a7765ec05b4f124de987004505b5510b50d36a.tar.xz
org.eclipse.osee-d4a7765ec05b4f124de987004505b5510b50d36a.zip
feature[ats_ATS55930]: Upgrade JAX-RS to 2.0 API using Apache CXF
Change JAX-RS endpoints to comply with 2.0 API Change JAX-RS clients to use JAX-RS 2.0 Client API instead of using Jersey's client implementation. Remove all Jersey dependencies. Integrate Apache CXF with OSEE JAX-RS Change-Id: I866dff8516b91dbcde07b07819cf0bbc89b5d293
Diffstat (limited to 'plugins/org.eclipse.osee.ote.master.rest.client')
-rw-r--r--plugins/org.eclipse.osee.ote.master.rest.client/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/AddServer.java10
-rw-r--r--plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/GetAvailableServers.java8
-rw-r--r--plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/OTEMasterServerImpl.java3
-rw-r--r--plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/RemoveServer.java10
5 files changed, 18 insertions, 19 deletions
diff --git a/plugins/org.eclipse.osee.ote.master.rest.client/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ote.master.rest.client/META-INF/MANIFEST.MF
index eb830fe1d7..348c902aac 100644
--- a/plugins/org.eclipse.osee.ote.master.rest.client/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ote.master.rest.client/META-INF/MANIFEST.MF
@@ -6,10 +6,8 @@ Bundle-Version: 0.18.0.qualifier
Require-Bundle: org.eclipse.core.runtime
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Import-Package: com.sun.jersey.api.client,
- com.sun.jersey.api.client.config,
- com.sun.jersey.client.apache,
- com.sun.jersey.client.apache.config,
+Import-Package: javax.ws.rs;version="2.0.0",
+ javax.ws.rs.client;version="2.0.0",
javax.ws.rs.core,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.jaxrs.client,
diff --git a/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/AddServer.java b/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/AddServer.java
index d05e927ffd..bd41d4dd54 100644
--- a/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/AddServer.java
+++ b/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/AddServer.java
@@ -2,11 +2,12 @@ package org.eclipse.osee.ote.master.rest.client.internal;
import java.net.URI;
import java.util.concurrent.Callable;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import org.eclipse.osee.jaxrs.client.JaxRsClient;
import org.eclipse.osee.ote.master.rest.client.OTEMasterServerResult;
import org.eclipse.osee.ote.master.rest.model.OTEServer;
-import com.sun.jersey.api.client.WebResource;
public class AddServer implements Callable<OTEMasterServerResult> {
@@ -24,10 +25,9 @@ public class AddServer implements Callable<OTEMasterServerResult> {
public OTEMasterServerResult call() throws Exception {
OTEMasterServerResult result = new OTEMasterServerResult();
try {
- WebResource resource = webClientProvider.createResource(uri);
- resource.path(OTEMasterServerImpl.CONTEXT_NAME).path(OTEMasterServerImpl.CONTEXT_SERVERS).accept(
- MediaType.APPLICATION_XML).post(server);
-
+ WebTarget resource = webClientProvider.target(uri);
+ resource.path(OTEMasterServerImpl.CONTEXT_NAME).path(OTEMasterServerImpl.CONTEXT_SERVERS).request(
+ MediaType.APPLICATION_JSON).post(Entity.json(server));
} catch (Throwable th) {
result.setSuccess(false);
result.setThrowable(th);
diff --git a/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/GetAvailableServers.java b/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/GetAvailableServers.java
index d1fbe75b59..6a5065de95 100644
--- a/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/GetAvailableServers.java
+++ b/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/GetAvailableServers.java
@@ -2,11 +2,11 @@ package org.eclipse.osee.ote.master.rest.client.internal;
import java.net.URI;
import java.util.concurrent.Callable;
+import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import org.eclipse.osee.jaxrs.client.JaxRsClient;
import org.eclipse.osee.ote.master.rest.client.OTEMasterServerAvailableNodes;
import org.eclipse.osee.ote.master.rest.model.OTEServer;
-import com.sun.jersey.api.client.WebResource;
public class GetAvailableServers implements Callable<OTEMasterServerAvailableNodes> {
@@ -22,10 +22,10 @@ public class GetAvailableServers implements Callable<OTEMasterServerAvailableNod
public OTEMasterServerAvailableNodes call() throws Exception {
OTEMasterServerAvailableNodes result = new OTEMasterServerAvailableNodes();
try {
- WebResource resource = webClientProvider.createResource(uri);
+ WebTarget resource = webClientProvider.target(uri);
OTEServer[] servers =
- resource.path(OTEMasterServerImpl.CONTEXT_NAME).path(OTEMasterServerImpl.CONTEXT_SERVERS).accept(
- MediaType.APPLICATION_XML).get(OTEServer[].class);
+ resource.path(OTEMasterServerImpl.CONTEXT_NAME).path(OTEMasterServerImpl.CONTEXT_SERVERS).request(
+ MediaType.APPLICATION_JSON).get(OTEServer[].class);
result.setServers(servers);
result.setSuccess(true);
} catch (Throwable th) {
diff --git a/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/OTEMasterServerImpl.java b/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/OTEMasterServerImpl.java
index 3456be01f3..685fb888a0 100644
--- a/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/OTEMasterServerImpl.java
+++ b/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/OTEMasterServerImpl.java
@@ -7,7 +7,6 @@ import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadFactory;
import org.eclipse.osee.jaxrs.client.JaxRsClient;
-import org.eclipse.osee.jaxrs.client.JaxRsClientFactory;
import org.eclipse.osee.ote.master.rest.client.OTEMasterServer;
import org.eclipse.osee.ote.master.rest.client.OTEMasterServerAvailableNodes;
import org.eclipse.osee.ote.master.rest.client.OTEMasterServerResult;
@@ -42,7 +41,7 @@ public class OTEMasterServerImpl implements OTEMasterServer {
}
public void update(Map<String, Object> props) {
- client = JaxRsClientFactory.createClient(props);
+ client = JaxRsClient.newBuilder().properties(props).build();
}
@Override
diff --git a/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/RemoveServer.java b/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/RemoveServer.java
index e29a6b00ee..ebf257a8fc 100644
--- a/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/RemoveServer.java
+++ b/plugins/org.eclipse.osee.ote.master.rest.client/src/org/eclipse/osee/ote/master/rest/client/internal/RemoveServer.java
@@ -2,11 +2,13 @@ package org.eclipse.osee.ote.master.rest.client.internal;
import java.net.URI;
import java.util.concurrent.Callable;
+import javax.ws.rs.HttpMethod;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import org.eclipse.osee.jaxrs.client.JaxRsClient;
import org.eclipse.osee.ote.master.rest.client.OTEMasterServerResult;
import org.eclipse.osee.ote.master.rest.model.OTEServer;
-import com.sun.jersey.api.client.WebResource;
public class RemoveServer implements Callable<OTEMasterServerResult> {
@@ -24,9 +26,9 @@ public class RemoveServer implements Callable<OTEMasterServerResult> {
public OTEMasterServerResult call() throws Exception {
OTEMasterServerResult result = new OTEMasterServerResult();
try {
- WebResource resource = webClientProvider.createResource(uri);
- resource.path(OTEMasterServerImpl.CONTEXT_NAME).path(OTEMasterServerImpl.CONTEXT_SERVERS).accept(
- MediaType.APPLICATION_XML).delete(server);
+ WebTarget resource = webClientProvider.target(uri);
+ resource.path(OTEMasterServerImpl.CONTEXT_NAME).path(OTEMasterServerImpl.CONTEXT_SERVERS).request(
+ MediaType.APPLICATION_JSON).method(HttpMethod.DELETE, Entity.json(server));
} catch (Throwable th) {
result.setSuccess(false);
result.setThrowable(th);

Back to the top