Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2013-08-26 20:34:34 +0000
committerRoberto E. Escobar2013-09-06 23:34:17 +0000
commit7bb9a26096b6c7ccab52b2e923ae270283f2a3d2 (patch)
tree92054314ad9256c23e7ea27628150523e47b2514 /plugins/org.eclipse.osee.orcs.rest
parent0c4767ab9244dc576618791d3f852506932e3d10 (diff)
downloadorg.eclipse.osee-7bb9a26096b6c7ccab52b2e923ae270283f2a3d2.tar.gz
org.eclipse.osee-7bb9a26096b6c7ccab52b2e923ae270283f2a3d2.tar.xz
org.eclipse.osee-7bb9a26096b6c7ccab52b2e923ae270283f2a3d2.zip
refinement: Improve result set API
Remove getList method. Remove getIterable method. Since resultSet is already an Iterable object, these methods are not needed. Add size and isEmpty methods for convenience. Change-Id: I34160b3acaad391949ff9da0e81afa95f4532677
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.rest')
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ArtifactResource.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ArtifactsResource.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java2
3 files changed, 4 insertions, 5 deletions
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ArtifactResource.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ArtifactResource.java
index a5c2d3abc0..834dd7aab8 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ArtifactResource.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ArtifactResource.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.orcs.rest.internal;
-import java.util.List;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
@@ -19,6 +18,7 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.UriInfo;
import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.data.ResultSet;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -59,7 +59,7 @@ public class ArtifactResource {
public String getAsHtml() throws OseeCoreException {
IOseeBranch branch = TokenFactory.createBranch(branchUuid, "");
QueryFactory factory = OrcsApplication.getOrcsApi().getQueryFactory(null);
- List<ArtifactReadable> arts = factory.fromBranch(branch).andGuidsOrHrids(artifactUuid).getResults().getList();
+ ResultSet<ArtifactReadable> arts = factory.fromBranch(branch).andGuidsOrHrids(artifactUuid).getResults();
HtmlWriter writer = new HtmlWriter(uriInfo);
return writer.toHtml(arts);
}
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ArtifactsResource.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ArtifactsResource.java
index a9935b084d..f4fb5fc7a0 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ArtifactsResource.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/ArtifactsResource.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.orcs.rest.internal;
-import java.util.List;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@@ -67,7 +66,7 @@ public class ArtifactsResource {
ArtifactReadable rootArtifact = results.getExactlyOne();
GraphReadable graph = OrcsApplication.getOrcsApi().getGraph(null);
- List<ArtifactReadable> arts = graph.getChildren(rootArtifact).getList();
+ ResultSet<ArtifactReadable> arts = graph.getChildren(rootArtifact);
HtmlWriter writer = new HtmlWriter(uriInfo);
return writer.toHtml(arts);
}
diff --git a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java
index 4cb5419b60..f8dd3771bf 100644
--- a/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java
+++ b/plugins/org.eclipse.osee.orcs.rest/src/org/eclipse/osee/orcs/rest/internal/HtmlWriter.java
@@ -36,7 +36,7 @@ public class HtmlWriter {
this.uriInfo = uriInfo;
}
- public String toHtml(Collection<? extends Object> objects) throws OseeCoreException {
+ public String toHtml(Iterable<? extends Object> objects) throws OseeCoreException {
StringBuilder builder = new StringBuilder();
builder.append("<html><body>");
for (Object object : objects) {

Back to the top