Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2020-03-08 03:57:25 +0000
committerRyan D. Brooks2020-12-15 21:40:27 +0000
commitcf0d8bc8feff3e6321346274c266ed214431596d (patch)
tree34d5a019b040bde587fb0cd2eb33e87a33b93142
parent0f78077c7c514d3d855c93f45d50f7e75316292f (diff)
downloadorg.eclipse.osee-cf0d8bc8feff3e6321346274c266ed214431596d.tar.gz
org.eclipse.osee-cf0d8bc8feff3e6321346274c266ed214431596d.tar.xz
org.eclipse.osee-cf0d8bc8feff3e6321346274c266ed214431596d.zip
feature[TW16580]: Use JaxRsApi with Dispo
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/OSGI-INF/disposition.service.xml1
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java8
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java20
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java27
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoImporterFactory.java7
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/TmzImporter.java18
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationListMessageWriter.java11
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationMessageReader.java9
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationMessageWriter.java9
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemListMessageWriter.java9
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemMessageReader.java11
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemMessageWriter.java11
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetListMessageWriter.java11
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetMessageReader.java11
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetMessageWriter.java11
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoApplication.java24
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResource.java8
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java18
19 files changed, 143 insertions, 82 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF
index 9c224fc9b40..0218e1ba8dc 100644
--- a/plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.disposition.rest/META-INF/MANIFEST.MF
@@ -27,6 +27,7 @@ Import-Package:
org.eclipse.osee.framework.jdk.core.util.io.xml,
org.eclipse.osee.framework.resource.management,
org.eclipse.osee.framework.resource.management.util,
+ org.eclipse.osee.jaxrs,
org.eclipse.osee.logger,
org.eclipse.osee.orcs,
org.eclipse.osee.orcs.data,
diff --git a/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/disposition.service.xml b/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/disposition.service.xml
index 8d182c537dc..95c993d2781 100644
--- a/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/disposition.service.xml
+++ b/plugins/org.eclipse.osee.disposition.rest/OSGI-INF/disposition.service.xml
@@ -11,4 +11,5 @@
<reference bind="setExecutor" cardinality="1..1" interface="org.eclipse.osee.framework.core.executor.ExecutorAdmin" name="ExecutorAdmin" policy="static"/>
<reference bind="setDispoUpdateBroadcaster" cardinality="1..1" interface="org.eclipse.osee.disposition.rest.external.DispoUpdateBroadcaster" name="DispoUpdateBroadcaster" policy="static"/>
<reference bind="setOrcsApi" cardinality="1..1" interface="org.eclipse.osee.orcs.OrcsApi" name="OrcsApi" policy="static"/>
+ <reference bind="setJaxRsApi" cardinality="1..1" interface="org.eclipse.osee.jaxrs.JaxRsApi" name="jaxRsApi" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
index 4be803b9028..12b6c04095f 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
@@ -57,6 +57,7 @@ import org.eclipse.osee.framework.core.executor.ExecutorAdmin;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
+import org.eclipse.osee.jaxrs.JaxRsApi;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -77,6 +78,7 @@ public class DispoApiImpl implements DispoApi {
private DispoImporterFactory importerFactory;
private DispoUpdateBroadcaster updateBroadcaster;
private OrcsApi orcsApi;
+ private JaxRsApi jaxRsApi;
private volatile DispoApiConfiguration config;
@@ -128,10 +130,14 @@ public class DispoApiImpl implements DispoApi {
this.storage = storage;
}
+ public void setJaxRsApi(JaxRsApi jaxRsApi) {
+ this.jaxRsApi = jaxRsApi;
+ }
+
public void start(Map<String, Object> props) {
logger.trace("Starting DispoApiImpl...");
update(props);
- importerFactory = new DispoImporterFactory(dataFactory, executor, config, logger);
+ importerFactory = new DispoImporterFactory(dataFactory, executor, config, logger, jaxRsApi);
storage = new OrcsStorageImpl(orcsApi);
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
index 736de6a268d..3af7a9268c2 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
@@ -13,14 +13,19 @@
package org.eclipse.osee.disposition.rest.internal;
+import com.fasterxml.jackson.databind.JsonNode;
import java.util.Date;
+import java.util.LinkedList;
import java.util.List;
import org.eclipse.osee.disposition.model.DispoSet;
import org.eclipse.osee.disposition.model.Note;
import org.eclipse.osee.disposition.model.OperationReport;
+import org.eclipse.osee.disposition.model.OperationSummaryEntry;
import org.eclipse.osee.disposition.rest.util.DispoUtil;
import org.eclipse.osee.framework.core.enums.DispoOseeTypes;
+import org.eclipse.osee.framework.core.util.JsonUtil;
import org.eclipse.osee.framework.jdk.core.type.BaseIdentity;
+import org.eclipse.osee.jaxrs.JaxRsApi;
import org.eclipse.osee.orcs.data.ArtifactReadable;
/**
@@ -29,10 +34,12 @@ import org.eclipse.osee.orcs.data.ArtifactReadable;
public class DispoSetArtifact extends BaseIdentity<String> implements DispoSet {
private final ArtifactReadable artifact;
+ private final JaxRsApi jaxRsApi;
- public DispoSetArtifact(ArtifactReadable artifact) {
+ public DispoSetArtifact(ArtifactReadable artifact, JaxRsApi jaxRsApi) {
super(artifact.getIdString());
this.artifact = artifact;
+ this.jaxRsApi = jaxRsApi;
}
@Override
@@ -54,7 +61,16 @@ public class DispoSetArtifact extends BaseIdentity<String> implements DispoSet {
@Override
public OperationReport getOperationSummary() {
String operationSummaryJson = artifact.getSoleAttributeAsString(DispoOseeTypes.DispoOperationSummary, "{}");
- return DispoUtil.jsonObjToOperationSummary(operationSummaryJson);
+
+ OperationReport summary = new OperationReport();
+ List<OperationSummaryEntry> entries = new LinkedList<>();
+ if (!operationSummaryJson.contains("entries")) {
+ return summary;
+ }
+ JsonNode entriesNode = JsonUtil.readTree(operationSummaryJson).get("entries");
+ entries = jaxRsApi.readValue(entriesNode.toString(), List.class);
+ summary.setEntries(entries);
+ return summary;
}
@Override
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
index 575617ca2d8..ccf9b2d5688 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
@@ -49,10 +49,10 @@ import org.eclipse.osee.framework.core.enums.CoverageOseeTypes;
import org.eclipse.osee.framework.core.enums.DispoOseeTypes;
import org.eclipse.osee.framework.core.enums.QueryOption;
import org.eclipse.osee.framework.core.enums.SystemUser;
-import org.eclipse.osee.framework.core.util.JsonUtil;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jaxrs.JaxRsApi;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.OrcsBranch;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -65,11 +65,13 @@ import org.eclipse.osee.orcs.transaction.TransactionFactory;
* @author Angel Avila
*/
public class OrcsStorageImpl implements Storage {
- private final OrcsApi orcsApi;
public static final IOseeBranch dispoParent = IOseeBranch.create(5781701693103907161L, "Dispo Parent");
+ private final OrcsApi orcsApi;
+ private final JaxRsApi jaxRsApi;
public OrcsStorageImpl(OrcsApi orcsApi) {
this.orcsApi = orcsApi;
+ jaxRsApi = orcsApi.jaxRsApi();
}
private QueryFactory getQuery() {
@@ -165,7 +167,7 @@ public class OrcsStorageImpl implements Storage {
List<DispoSet> toReturn = new ArrayList<>();
for (ArtifactReadable art : results) {
- DispoSetArtifact dispoSetArt = new DispoSetArtifact(art);
+ DispoSetArtifact dispoSetArt = new DispoSetArtifact(art, jaxRsApi);
if (dispoSetArt.getDispoType().equals(type)) {
toReturn.add(dispoSetArt);
}
@@ -176,7 +178,7 @@ public class OrcsStorageImpl implements Storage {
@Override
public DispoSet findDispoSetsById(BranchId branch, String setId) {
ArtifactReadable result = findDispoArtifact(branch, setId);
- return new DispoSetArtifact(result);
+ return new DispoSetArtifact(result, jaxRsApi);
}
private ArtifactReadable findDispoArtifact(BranchId branch, String artId) {
@@ -215,7 +217,7 @@ public class OrcsStorageImpl implements Storage {
tx.setSoleAttributeValue(creatdArtId, DispoOseeTypes.DispoImportPath, descriptor.getImportPath());
tx.setSoleAttributeValue(creatdArtId, DispoOseeTypes.DispoImportState, descriptor.getImportState());
tx.setSoleAttributeValue(creatdArtId, DispoOseeTypes.DispoConfig, descriptor.getDispoType());
- tx.setSoleAttributeValue(creatdArtId, DispoOseeTypes.DispoNotesJson, JsonUtil.toJson(descriptor.getNotesList()));
+ tx.setSoleAttributeValue(creatdArtId, DispoOseeTypes.DispoNotesJson, jaxRsApi.toJson(descriptor.getNotesList()));
if (descriptor.getCiSet() == null) {
tx.setSoleAttributeValue(creatdArtId, DispoOseeTypes.DispoCiSet, "NOCI");
tx.setSoleAttributeValue(creatdArtId, DispoOseeTypes.DispoRerunList, "NOCI");
@@ -255,7 +257,7 @@ public class OrcsStorageImpl implements Storage {
@Override
public void updateDispoSet(UserId author, BranchId branch, String setId, DispoSet newData) {
ArtifactReadable dispoSet = findDispoArtifact(branch, setId);
- DispoSetArtifact origSetAs = new DispoSetArtifact(dispoSet);
+ DispoSetArtifact origSetAs = new DispoSetArtifact(dispoSet, jaxRsApi);
String name = newData.getName();
String importPath = newData.getImportPath();
@@ -277,7 +279,7 @@ public class OrcsStorageImpl implements Storage {
}
if (notesList != null && !notesList.equals(origSetAs.getNotesList())) {
tx.setSoleAttributeFromString(dispoSet, DispoOseeTypes.DispoNotesJson,
- JsonUtil.toJson(origSetAs.getNotesList()));
+ jaxRsApi.toJson(origSetAs.getNotesList()));
}
if (ciSet != null && !ciSet.equals(origSetAs.getCiSet())) {
tx.setSoleAttributeFromString(dispoSet, DispoOseeTypes.DispoCiSet, ciSet);
@@ -346,9 +348,9 @@ public class OrcsStorageImpl implements Storage {
tx.setSoleAttributeValue(createdItem, DispoOseeTypes.DispoItemNeedsRerun, item.getNeedsRerun());
tx.setSoleAttributeValue(createdItem, DispoOseeTypes.DispoItemAborted, item.getAborted());
tx.setSoleAttributeValue(createdItem, DispoOseeTypes.DispoDiscrepanciesJson,
- JsonUtil.toJson(item.getDiscrepanciesList()));
+ jaxRsApi.toJson(item.getDiscrepanciesList()));
tx.setSoleAttributeValue(createdItem, DispoOseeTypes.DispoAnnotationsJson,
- JsonUtil.toJson(item.getAnnotationsList()));
+ jaxRsApi.toJson(item.getAnnotationsList()));
tx.setSoleAttributeValue(createdItem, DispoOseeTypes.DispoItemVersion, item.getVersion());
tx.setSoleAttributeValue(createdItem, DispoOseeTypes.DispoItemAssignee, item.getAssignee());
tx.setSoleAttributeValue(createdItem, DispoOseeTypes.DispoItemMachine, item.getMachine());
@@ -397,11 +399,11 @@ public class OrcsStorageImpl implements Storage {
}
if (newDiscrepancies != null && !newDiscrepancies.equals(origItem.getDiscrepanciesList())) {
tx.setSoleAttributeFromString(currentItemArt, DispoOseeTypes.DispoDiscrepanciesJson,
- JsonUtil.toJson(newDiscrepancies));
+ jaxRsApi.toJson(newDiscrepancies));
}
if (newAnnotations != null && !newAnnotations.equals(origItem.getAnnotationsList())) {
tx.setSoleAttributeFromString(currentItemArt, DispoOseeTypes.DispoAnnotationsJson,
- JsonUtil.toJson(newAnnotations));
+ jaxRsApi.toJson(newAnnotations));
}
if (assignee != null && !assignee.equals(origItem.getAssignee())) {
tx.setSoleAttributeFromString(currentItemArt, DispoOseeTypes.DispoItemAssignee, assignee);
@@ -619,8 +621,7 @@ public class OrcsStorageImpl implements Storage {
TransactionBuilder tx = getTxFactory().createTransaction(branch, author, "Update Dispo Operation Report");
tx.setSoleAttributeFromString(dispoSet, DispoOseeTypes.DispoImportState, newReport.getStatus().getName());
- tx.setSoleAttributeFromString(dispoSet, DispoOseeTypes.DispoOperationSummary,
- DispoUtil.operationReportToString(newReport));
+ tx.setSoleAttributeFromString(dispoSet, DispoOseeTypes.DispoOperationSummary, jaxRsApi.toJson(newReport));
tx.commit();
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoImporterFactory.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoImporterFactory.java
index e643a2d6929..a5d434706da 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoImporterFactory.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoImporterFactory.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.disposition.rest.internal.DispoDataFactory;
import org.eclipse.osee.disposition.rest.internal.importer.coverage.LisFileParser;
import org.eclipse.osee.framework.core.executor.ExecutorAdmin;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
+import org.eclipse.osee.jaxrs.JaxRsApi;
import org.eclipse.osee.logger.Log;
/**
@@ -31,6 +32,7 @@ public class DispoImporterFactory {
private final ExecutorAdmin executor;
private final Log logger;
private final DispoApiConfiguration config;
+ private final JaxRsApi jaxRsApi;
public enum ImportFormat {
TMO,
@@ -38,11 +40,12 @@ public class DispoImporterFactory {
LIS
};
- public DispoImporterFactory(DispoDataFactory dataFactory, ExecutorAdmin executor, DispoApiConfiguration config, Log logger) {
+ public DispoImporterFactory(DispoDataFactory dataFactory, ExecutorAdmin executor, DispoApiConfiguration config, Log logger, JaxRsApi jaxRsApi) {
this.dataFactory = dataFactory;
this.executor = executor;
this.logger = logger;
this.config = config;
+ this.jaxRsApi = jaxRsApi;
}
public DispoImporterApi createImporter(ImportFormat format, DispoConnector connector) {
@@ -50,7 +53,7 @@ public class DispoImporterFactory {
case TMO:
return new TmoImporter(dataFactory, executor, logger);
case TMZ:
- return new TmzImporter(logger, dataFactory);
+ return new TmzImporter(logger, dataFactory, jaxRsApi);
case LIS:
return new LisFileParser(logger, dataFactory, config, connector);
default:
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/TmzImporter.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/TmzImporter.java
index 60d3f8e8abf..1f7cf2d384f 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/TmzImporter.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/TmzImporter.java
@@ -13,10 +13,8 @@
package org.eclipse.osee.disposition.rest.internal.importer;
-import com.fasterxml.jackson.core.type.TypeReference;
import java.io.File;
import java.io.FileFilter;
-import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -33,11 +31,11 @@ import org.eclipse.osee.disposition.model.DispoItemData;
import org.eclipse.osee.disposition.model.OperationReport;
import org.eclipse.osee.disposition.rest.DispoImporterApi;
import org.eclipse.osee.disposition.rest.internal.DispoDataFactory;
-import org.eclipse.osee.framework.core.util.JsonUtil;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.jaxrs.JaxRsApi;
import org.eclipse.osee.logger.Log;
/**
@@ -49,10 +47,12 @@ public class TmzImporter implements DispoImporterApi {
private final Log logger;
private final DispoDataFactory dataFactory;
+ private final JaxRsApi jaxRsApi;
- public TmzImporter(Log logger, DispoDataFactory dataFactory) {
+ public TmzImporter(Log logger, DispoDataFactory dataFactory, JaxRsApi jaxRsApi) {
this.logger = logger;
this.dataFactory = dataFactory;
+ this.jaxRsApi = jaxRsApi;
}
@Override
@@ -130,7 +130,7 @@ public class TmzImporter implements DispoImporterApi {
private void processOverview(String json, DispoItemData dispoItem) {
try {
- TmzProperties properties = JsonUtil.getMapper().readValue(json, TmzProperties.class);
+ TmzProperties properties = jaxRsApi.readValue(json, TmzProperties.class);
dispoItem.setVersion(properties.getVersion_revision());
Date date = DATE_FORMAT.parse(properties.getVersion_lastModificationDate());
dispoItem.setCreationDate(date);
@@ -140,11 +140,9 @@ public class TmzImporter implements DispoImporterApi {
}
}
- private void processTestPointSummary(String json, Map<String, Discrepancy> discrepancies) throws IOException {
- List<TmzChildRecord> childRecords = new LinkedList<>();
- String node = JsonUtil.getMapper().readTree(json).get("childRecords").toString();
- childRecords = JsonUtil.getMapper().readValue(node, new TypeReference<List<TmzChildRecord>>() { //
- });
+ private void processTestPointSummary(String json, Map<String, Discrepancy> discrepancies) {
+ String node = jaxRsApi.readTree(json).get("childRecords").toString();
+ List<TmzChildRecord> childRecords = jaxRsApi.readValue(node, List.class, TmzChildRecord.class);
for (TmzChildRecord record : childRecords) {
int number = record.getNumber();
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationListMessageWriter.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationListMessageWriter.java
index b7665cc1dba..ad2e214970d 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationListMessageWriter.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationListMessageWriter.java
@@ -24,13 +24,18 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
import org.eclipse.osee.disposition.model.DispoAnnotationData;
-import org.eclipse.osee.framework.core.util.JsonUtil;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jaxrs.JaxRsApi;
/**
* @author Angel Avila
*/
public class DispoAnnotationListMessageWriter implements MessageBodyWriter<List<DispoAnnotationData>> {
+ private final JaxRsApi jaxRsApi;
+
+ public DispoAnnotationListMessageWriter(JaxRsApi jaxRsApi) {
+ this.jaxRsApi = jaxRsApi;
+ }
@Override
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
@@ -48,7 +53,7 @@ public class DispoAnnotationListMessageWriter implements MessageBodyWriter<List<
@Override
public void writeTo(List<DispoAnnotationData> dispoAnnotations, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
- String jsonString = JsonUtil.toJson(dispoAnnotations);
+ String jsonString = jaxRsApi.toJson(dispoAnnotations);
entityStream.write(jsonString.getBytes(Strings.UTF_8));
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationMessageReader.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationMessageReader.java
index 82553b763ce..12b4cd5320a 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationMessageReader.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationMessageReader.java
@@ -22,13 +22,18 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyReader;
import org.eclipse.osee.disposition.model.DispoAnnotationData;
-import org.eclipse.osee.framework.core.util.JsonUtil;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.jaxrs.JaxRsApi;
/**
* @author Angel Avila
*/
public class DispoAnnotationMessageReader implements MessageBodyReader<DispoAnnotationData> {
+ private final JaxRsApi jaxRsApi;
+
+ public DispoAnnotationMessageReader(JaxRsApi jaxRsApi) {
+ this.jaxRsApi = jaxRsApi;
+ }
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
@@ -38,6 +43,6 @@ public class DispoAnnotationMessageReader implements MessageBodyReader<DispoAnno
@Override
public DispoAnnotationData readFrom(Class<DispoAnnotationData> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException {
String inputStreamToString = Lib.inputStreamToString(entityStream);
- return JsonUtil.readValue(inputStreamToString, DispoAnnotationData.class);
+ return jaxRsApi.readValue(inputStreamToString, DispoAnnotationData.class);
}
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationMessageWriter.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationMessageWriter.java
index ff6e898ef58..2324c52e928 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationMessageWriter.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationMessageWriter.java
@@ -22,13 +22,18 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
import org.eclipse.osee.disposition.model.DispoAnnotationData;
-import org.eclipse.osee.framework.core.util.JsonUtil;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jaxrs.JaxRsApi;
/**
* @author Angel Avila
*/
public class DispoAnnotationMessageWriter implements MessageBodyWriter<DispoAnnotationData> {
+ private final JaxRsApi jaxRsApi;
+
+ public DispoAnnotationMessageWriter(JaxRsApi jaxRsApi) {
+ this.jaxRsApi = jaxRsApi;
+ }
@Override
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
@@ -42,7 +47,7 @@ public class DispoAnnotationMessageWriter implements MessageBodyWriter<DispoAnno
@Override
public void writeTo(DispoAnnotationData dispoAnnotation, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
- String jsonString = JsonUtil.toJson(dispoAnnotation);
+ String jsonString = jaxRsApi.toJson(dispoAnnotation);
entityStream.write(jsonString.getBytes(Strings.UTF_8));
}
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemListMessageWriter.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemListMessageWriter.java
index 41a52c6c63d..1fecc4fb63f 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemListMessageWriter.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemListMessageWriter.java
@@ -26,13 +26,18 @@ import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
import org.eclipse.osee.disposition.model.DispoItem;
import org.eclipse.osee.disposition.rest.util.DispoUtil;
-import org.eclipse.osee.framework.core.util.JsonUtil;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jaxrs.JaxRsApi;
/**
* @author Angel Avila
*/
public class DispoItemListMessageWriter implements MessageBodyWriter<List<DispoItem>> {
+ private final JaxRsApi jaxRsApi;
+
+ public DispoItemListMessageWriter(JaxRsApi jaxRsApi) {
+ this.jaxRsApi = jaxRsApi;
+ }
@Override
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
@@ -55,7 +60,7 @@ public class DispoItemListMessageWriter implements MessageBodyWriter<List<DispoI
DispoItem dispoItemData = DispoUtil.reconstructDispoItem(item, item.getIsIncludeDetails());
reconstructedDispoItems.add(dispoItemData);
}
- String jsonString = JsonUtil.toJson(reconstructedDispoItems);
+ String jsonString = jaxRsApi.toJson(reconstructedDispoItems);
entityStream.write(jsonString.getBytes(Strings.UTF_8));
}
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemMessageReader.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemMessageReader.java
index 9158ad1d5c0..943cd9976ad 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemMessageReader.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemMessageReader.java
@@ -22,13 +22,18 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyReader;
import org.eclipse.osee.disposition.model.DispoItemData;
-import org.eclipse.osee.framework.core.util.JsonUtil;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.jaxrs.JaxRsApi;
/**
* @author Angel Avila
*/
public class DispoItemMessageReader implements MessageBodyReader<DispoItemData> {
+ private final JaxRsApi jaxRsApi;
+
+ public DispoItemMessageReader(JaxRsApi jaxRsApi) {
+ this.jaxRsApi = jaxRsApi;
+ }
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
@@ -38,6 +43,6 @@ public class DispoItemMessageReader implements MessageBodyReader<DispoItemData>
@Override
public DispoItemData readFrom(Class<DispoItemData> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException {
String inputStreamToString = Lib.inputStreamToString(entityStream);
- return JsonUtil.readValue(inputStreamToString, DispoItemData.class);
+ return jaxRsApi.readValue(inputStreamToString, DispoItemData.class);
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemMessageWriter.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemMessageWriter.java
index b9bc2da7176..92eb7cbdbbe 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemMessageWriter.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoItemMessageWriter.java
@@ -22,13 +22,18 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
import org.eclipse.osee.disposition.model.DispoItem;
-import org.eclipse.osee.framework.core.util.JsonUtil;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jaxrs.JaxRsApi;
/**
* @author Angel Avila
*/
public class DispoItemMessageWriter implements MessageBodyWriter<DispoItem> {
+ private final JaxRsApi jaxRsApi;
+
+ public DispoItemMessageWriter(JaxRsApi jaxRsApi) {
+ this.jaxRsApi = jaxRsApi;
+ }
@Override
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
@@ -42,7 +47,7 @@ public class DispoItemMessageWriter implements MessageBodyWriter<DispoItem> {
@Override
public void writeTo(DispoItem dispoItem, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
- String jsonString = JsonUtil.toJson(dispoItem);
+ String jsonString = jaxRsApi.toJson(dispoItem);
entityStream.write(jsonString.getBytes(Strings.UTF_8));
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetListMessageWriter.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetListMessageWriter.java
index 0a52e31a28d..faddaed947e 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetListMessageWriter.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetListMessageWriter.java
@@ -24,13 +24,18 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
import org.eclipse.osee.disposition.model.DispoSet;
-import org.eclipse.osee.framework.core.util.JsonUtil;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jaxrs.JaxRsApi;
/**
* @author Angel Avila
*/
public class DispoSetListMessageWriter implements MessageBodyWriter<List<DispoSet>> {
+ private final JaxRsApi jaxRsApi;
+
+ public DispoSetListMessageWriter(JaxRsApi jaxRsApi) {
+ this.jaxRsApi = jaxRsApi;
+ }
@Override
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
@@ -48,7 +53,7 @@ public class DispoSetListMessageWriter implements MessageBodyWriter<List<DispoSe
@Override
public void writeTo(List<DispoSet> dispoSets, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
- String jsonString = JsonUtil.toJson(dispoSets);
+ String jsonString = jaxRsApi.toJson(dispoSets);
entityStream.write(jsonString.getBytes(Strings.UTF_8));
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetMessageReader.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetMessageReader.java
index 095e8657f6e..f2308c3c49d 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetMessageReader.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetMessageReader.java
@@ -22,13 +22,18 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyReader;
import org.eclipse.osee.disposition.model.DispoSetData;
-import org.eclipse.osee.framework.core.util.JsonUtil;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.jaxrs.JaxRsApi;
/**
* @author Angel Avila
*/
public class DispoSetMessageReader implements MessageBodyReader<DispoSetData> {
+ private final JaxRsApi jaxRsApi;
+
+ public DispoSetMessageReader(JaxRsApi jaxRsApi) {
+ this.jaxRsApi = jaxRsApi;
+ }
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
@@ -38,6 +43,6 @@ public class DispoSetMessageReader implements MessageBodyReader<DispoSetData> {
@Override
public DispoSetData readFrom(Class<DispoSetData> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException {
String inputStreamToString = Lib.inputStreamToString(entityStream);
- return JsonUtil.readValue(inputStreamToString, DispoSetData.class);
+ return jaxRsApi.readValue(inputStreamToString, DispoSetData.class);
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetMessageWriter.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetMessageWriter.java
index ce9f4e76ad0..2de73d73d74 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetMessageWriter.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoSetMessageWriter.java
@@ -22,13 +22,18 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
import org.eclipse.osee.disposition.model.DispoSet;
-import org.eclipse.osee.framework.core.util.JsonUtil;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jaxrs.JaxRsApi;
/**
* @author Angel Avila
*/
public class DispoSetMessageWriter implements MessageBodyWriter<DispoSet> {
+ private final JaxRsApi jaxRsApi;
+
+ public DispoSetMessageWriter(JaxRsApi jaxRsApi) {
+ this.jaxRsApi = jaxRsApi;
+ }
@Override
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
@@ -42,7 +47,7 @@ public class DispoSetMessageWriter implements MessageBodyWriter<DispoSet> {
@Override
public void writeTo(DispoSet dispoSet, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
- String jsonString = JsonUtil.toJson(dispoSet);
+ String jsonString = jaxRsApi.toJson(dispoSet);
entityStream.write(jsonString.getBytes(Strings.UTF_8));
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoApplication.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoApplication.java
index 5d1f8025937..4577daadc00 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoApplication.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoApplication.java
@@ -26,6 +26,7 @@ import org.eclipse.osee.disposition.rest.messages.DispoItemMessageWriter;
import org.eclipse.osee.disposition.rest.messages.DispoSetListMessageWriter;
import org.eclipse.osee.disposition.rest.messages.DispoSetMessageReader;
import org.eclipse.osee.disposition.rest.messages.DispoSetMessageWriter;
+import org.eclipse.osee.jaxrs.JaxRsApi;
/**
* @author Angel Avila
@@ -34,6 +35,7 @@ import org.eclipse.osee.disposition.rest.messages.DispoSetMessageWriter;
public final class DispoApplication extends Application {
private DispoApi dispoApi;
+ private JaxRsApi jaxRsApi;
private final Set<Object> singletons = new HashSet<>();
@@ -41,22 +43,26 @@ public final class DispoApplication extends Application {
this.dispoApi = dispoApi;
}
+ public void setJaxRsApi(JaxRsApi jaxRsApi) {
+ this.jaxRsApi = jaxRsApi;
+ }
+
@Override
public Set<Object> getSingletons() {
return singletons;
}
public void start() {
- singletons.add(new DispoSetMessageReader());
- singletons.add(new DispoSetMessageWriter());
- singletons.add(new DispoSetListMessageWriter());
- singletons.add(new DispoItemMessageReader());
- singletons.add(new DispoItemMessageWriter());
- singletons.add(new DispoItemListMessageWriter());
- singletons.add(new DispoAnnotationMessageReader());
- singletons.add(new DispoAnnotationMessageWriter());
+ singletons.add(new DispoSetMessageReader(jaxRsApi));
+ singletons.add(new DispoSetMessageWriter(jaxRsApi));
+ singletons.add(new DispoSetListMessageWriter(jaxRsApi));
+ singletons.add(new DispoItemMessageReader(jaxRsApi));
+ singletons.add(new DispoItemMessageWriter(jaxRsApi));
+ singletons.add(new DispoItemListMessageWriter(jaxRsApi));
+ singletons.add(new DispoAnnotationMessageReader(jaxRsApi));
+ singletons.add(new DispoAnnotationMessageWriter(jaxRsApi));
- singletons.add(new DispoProgramResource(dispoApi));
+ singletons.add(new DispoProgramResource(dispoApi, jaxRsApi));
singletons.add(new ContinuousIntegrationResource(dispoApi));
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResource.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResource.java
index aca51107d1a..8f272ca447f 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResource.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoProgramResource.java
@@ -38,7 +38,7 @@ import org.eclipse.osee.disposition.rest.DispoApi;
import org.eclipse.osee.disposition.rest.DispoRoles;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.core.util.JsonUtil;
+import org.eclipse.osee.jaxrs.JaxRsApi;
/**
* @author Angel Avila
@@ -47,9 +47,11 @@ import org.eclipse.osee.framework.core.util.JsonUtil;
public class DispoProgramResource {
private final DispoApi dispoApi;
+ private final JaxRsApi jaxRsApi;
- public DispoProgramResource(DispoApi dispoApi) {
+ public DispoProgramResource(DispoApi dispoApi, JaxRsApi jaxRsApi) {
this.dispoApi = dispoApi;
+ this.jaxRsApi = jaxRsApi;
}
/**
@@ -139,7 +141,7 @@ public class DispoProgramResource {
status = Status.OK;
}
- String branchListJson = JsonUtil.toJson(branchList);
+ String branchListJson = jaxRsApi.toJson(branchList);
return Response.status(status).entity(branchListJson).build();
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java
index a1fe73b2b2b..d217d7f514d 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/util/DispoUtil.java
@@ -21,7 +21,6 @@ import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -69,10 +68,6 @@ public final class DispoUtil {
return matcher.matches();
}
- public static String operationReportToString(OperationReport report) {
- return JsonUtil.toJson(report);
- }
-
public static OperationReport cleanOperationReport(OperationReport origReport) {
OperationReport newRerport = new OperationReport();
if (origReport.getStatus().isFailed()) {
@@ -283,19 +278,6 @@ public final class DispoUtil {
return testScriptNameToPath;
}
- @SuppressWarnings("unchecked")
- public static OperationReport jsonObjToOperationSummary(String jObj) {
- OperationReport summary = new OperationReport();
- List<OperationSummaryEntry> entries = new LinkedList<>();
- if (!jObj.contains("entries")) {
- return summary;
- }
- JsonNode entriesNode = JsonUtil.readTree(jObj).get("entries");
- entries = JsonUtil.readValue(entriesNode.toString(), List.class);
- summary.setEntries(entries);
- return summary;
- }
-
public static <T> List<T> jsonStringToList(String jObj, Class<T> valueType) {
List<T> toReturn = new ArrayList<>();
JsonNode node = JsonUtil.readTree(jObj);

Back to the top