Replace Map<String, HashSet<Score>> with ScoreManager and ScoreHolder classes to...
authorpvtroshin <pvtroshin@e3abac25-378b-4346-85de-24260fe3988d>
Wed, 9 Feb 2011 17:17:43 +0000 (17:17 +0000)
committerpvtroshin <pvtroshin@e3abac25-378b-4346-85de-24260fe3988d>
Wed, 9 Feb 2011 17:17:43 +0000 (17:17 +0000)
git-svn-id: link to svn.lifesci.dundee.ac.uk/svn/barton/ptroshin/JABA2@3731 e3abac25-378b-4346-85de-24260fe3988d

12 files changed:
datamodel/compbio/data/sequence/ScoreManager.java [new file with mode: 0644]
how_to_add_new_webservice.txt
testsrc/compbio/ws/client/AAConWSClientExample.java
testsrc/compbio/ws/client/TestAAConWS.java
webservices/compbio/data/msa/SequenceAnnotation.java
webservices/compbio/ws/client/AAConClient.java
webservices/compbio/ws/client/IOHelper.java
webservices/compbio/ws/client/Jws2Client.java
webservices/compbio/ws/server/AAConWS.java
webservices/compbio/ws/server/DisemblWS.java
webservices/compbio/ws/server/GlobPlotWS.java
webservices/compbio/ws/server/JronnWS.java

diff --git a/datamodel/compbio/data/sequence/ScoreManager.java b/datamodel/compbio/data/sequence/ScoreManager.java
new file mode 100644 (file)
index 0000000..b0f87a6
--- /dev/null
@@ -0,0 +1,77 @@
+package compbio.data.sequence;\r
+\r
+import java.io.BufferedWriter;\r
+import java.io.IOException;\r
+import java.io.OutputStream;\r
+import java.io.OutputStreamWriter;\r
+import java.util.HashSet;\r
+import java.util.List;\r
+\r
+public class ScoreManager {\r
+\r
+       private List<ScoreHolder> seqScores;\r
+\r
+       private ScoreManager() {\r
+               // Default JAXB constructor\r
+       }\r
+\r
+       public int getNumberOfSeq() {\r
+               return seqScores.size();\r
+       }\r
+\r
+       public ScoreHolder getFirstSequenceScores() {\r
+               if (seqScores.isEmpty())\r
+                       return null;\r
+               return seqScores.get(0);\r
+       }\r
+\r
+       public ScoreHolder getAnnotationForSequence(String seqId) {\r
+               for (ScoreHolder sch : seqScores) {\r
+                       if (sch.id.equals(seqId)) {\r
+                               return sch;\r
+                       }\r
+               }\r
+               return null;\r
+       }\r
+\r
+       public void writeOut(OutputStream outStream) throws IOException {\r
+               BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(\r
+                               outStream));\r
+               for (ScoreHolder oneSeqScores : seqScores) {\r
+                       oneSeqScores.writeOut(outStream);\r
+               }\r
+               writer.flush();\r
+       }\r
+\r
+       public static class ScoreHolder {\r
+\r
+               public String id;\r
+               public HashSet<Score> scores;\r
+\r
+               public void writeOut(OutputStream outStream) throws IOException {\r
+                       BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(\r
+                                       outStream));\r
+                       writer.write(">" + id + "\n");\r
+                       Score.write(scores, outStream);\r
+               }\r
+\r
+               public Score getFirstScore() {\r
+                       if (scores.isEmpty())\r
+                               return null;\r
+                       return scores.iterator().next();\r
+               }\r
+\r
+               public Score getScoreByMethod(Enum<?> method) {\r
+                       for (Score sc : scores) {\r
+                               if (method == sc.getMethod()) {\r
+                                       return sc;\r
+                               }\r
+                       }\r
+                       return null;\r
+               }\r
+\r
+               public int getNumberOfScores() {\r
+                       return scores.size();\r
+               }\r
+       }\r
+}\r
index 7df641e..cb11ba4 100644 (file)
@@ -35,8 +35,12 @@ Edit binaries/src setexecutableflag.sh and compilebin.sh scripts accordingly.
 14) Run build-server task in wsbuild file. Watch for errors. If cannot compile that means \r
 that JAXB cannot serialize some of the data structures. Add appropriate annotations to your data types.\r
 Check that \r
-  - you do not have interfaces as fields\r
-  - you have a default no args constructor (can be private if you do not need it)    \r
+  - you do not have interfaces to serialize. JAXB cannot serialize them.\r
+  - you have a default no args constructor (can be private if you do not need it)\r
+  - JAXB cannot serialize a Map, use custom data structure instead!\r
+If you have the data on the server side, but nothing is coming through to the client, \r
+this is a JAXB serialization problem. They tend to be very silent and thus hard to debug. Check your \r
+data structure can be serialized! \r
 \r
 13) Modify the client to work with your web service. \r
 \r
@@ -46,7 +50,6 @@ Check that
 \r
 \r
 \r
-\r
 If executable does not support parameters do not add a reference to the XXXParameter.xml \r
 file into the Executable.properties file. Do the same for Presets\r
 \r
index 4178ada..307d144 100644 (file)
@@ -3,13 +3,11 @@ package compbio.ws.client;
 import java.io.ByteArrayInputStream;\r
 import java.io.FileNotFoundException;\r
 import java.io.IOException;\r
-import java.util.HashSet;\r
 import java.util.List;\r
-import java.util.Map;\r
 \r
 import compbio.data.msa.SequenceAnnotation;\r
 import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.Score;\r
+import compbio.data.sequence.ScoreManager;\r
 import compbio.data.sequence.SequenceUtil;\r
 import compbio.metadata.JobSubmissionException;\r
 import compbio.metadata.Preset;\r
@@ -96,7 +94,7 @@ public class AAConWSClientExample {
                String jobId = client.presetAnalize(fastalist, preset);\r
 \r
                /* This method will block for the duration of the calculation */\r
-               Map<String, HashSet<Score>> result = client.getAnnotation(jobId);\r
+               ScoreManager result = client.getAnnotation(jobId);\r
 \r
                /*\r
                 * This is a better way of obtaining results, it does not involve\r
index 4fa90ac..6476311 100644 (file)
@@ -8,10 +8,7 @@ import java.io.File;
 import java.io.FileInputStream;\r
 import java.io.FileNotFoundException;\r
 import java.io.IOException;\r
-import java.util.ArrayList;\r
-import java.util.HashSet;\r
 import java.util.List;\r
-import java.util.Map;\r
 \r
 import org.testng.annotations.BeforeTest;\r
 import org.testng.annotations.Test;\r
@@ -20,7 +17,7 @@ import compbio.data.msa.JABAService;
 import compbio.data.msa.SequenceAnnotation;\r
 import compbio.data.sequence.ConservationMethod;\r
 import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.Score;\r
+import compbio.data.sequence.ScoreManager;\r
 import compbio.data.sequence.SequenceUtil;\r
 import compbio.metadata.JobSubmissionException;\r
 import compbio.metadata.LimitExceededException;\r
@@ -78,13 +75,14 @@ public class TestAAConWS {
                        System.out.println("Pres: " + msaws.getPresets().getPresets());\r
                        String jobId = msaws.analize(fsl);\r
                        System.out.println("J: " + jobId);\r
-                       Map<String, HashSet<Score>> result = msaws.getAnnotation(jobId);\r
+                       ScoreManager result = msaws.getAnnotation(jobId);\r
                        assertNotNull(result);\r
-                       assertEquals(result.size(), 1);\r
-                       assertEquals(result.values().iterator().next().iterator().next()\r
+                       assertEquals(result.getFirstSequenceScores().getNumberOfScores(), 1);\r
+\r
+                       assertEquals(result.getFirstSequenceScores().getFirstScore()\r
                                        .getMethod(), ConservationMethod.SHENKIN);\r
-                       List<Float> scores = result.values().iterator().next().iterator()\r
-                                       .next().getScores();\r
+                       List<Float> scores = result.getFirstSequenceScores()\r
+                                       .getFirstScore().getScores();\r
                        assertNotNull(scores);\r
                        assertEquals(scores.size(), 568);\r
 \r
@@ -94,19 +92,21 @@ public class TestAAConWS {
                                        presets.getPresetByName("Quick conservation"));\r
                        result = msaws.getAnnotation(jobId);\r
                        assertNotNull(result);\r
-                       assertEquals(result.size(), 13);\r
+                       assertEquals(result.getFirstSequenceScores().getNumberOfScores(),\r
+                                       13);\r
 \r
                        jobId = msaws.presetAnalize(fsl,\r
                                        presets.getPresetByName("Slow conservation"));\r
                        result = msaws.getAnnotation(jobId);\r
                        assertNotNull(result);\r
-                       assertEquals(result.size(), 5);\r
+                       assertEquals(result.getFirstSequenceScores().getNumberOfScores(), 5);\r
 \r
                        jobId = msaws.presetAnalize(fsl,\r
                                        presets.getPresetByName("Complete conservation"));\r
                        result = msaws.getAnnotation(jobId);\r
                        assertNotNull(result);\r
-                       assertEquals(result.size(), 18);\r
+                       assertEquals(result.getFirstSequenceScores().getNumberOfScores(),\r
+                                       18);\r
 \r
                } catch (UnsupportedRuntimeException e) {\r
                        e.printStackTrace();\r
@@ -126,7 +126,6 @@ public class TestAAConWS {
                }\r
 \r
        }\r
-\r
        @Test\r
        public void testPresetAnalize() throws FileNotFoundException, IOException {\r
 \r
@@ -144,21 +143,23 @@ public class TestAAConWS {
                        PresetManager<AACon> presets = msaws.getPresets();\r
                        String jobId = msaws.presetAnalize(fsl,\r
                                        presets.getPresetByName("Quick conservation"));\r
-                       Map<String, HashSet<Score>> result = msaws.getAnnotation(jobId);\r
+                       ScoreManager result = msaws.getAnnotation(jobId);\r
                        assertNotNull(result);\r
-                       assertEquals(result.size(), 13);\r
+                       assertEquals(result.getFirstSequenceScores().getNumberOfScores(),\r
+                                       13);\r
 \r
                        jobId = msaws.presetAnalize(fsl,\r
                                        presets.getPresetByName("Slow conservation"));\r
                        result = msaws.getAnnotation(jobId);\r
                        assertNotNull(result);\r
-                       assertEquals(result.size(), 5);\r
+                       assertEquals(result.getFirstSequenceScores().getNumberOfScores(), 5);\r
 \r
                        jobId = msaws.presetAnalize(fsl,\r
                                        presets.getPresetByName("Complete conservation"));\r
                        result = msaws.getAnnotation(jobId);\r
                        assertNotNull(result);\r
-                       assertEquals(result.size(), 18);\r
+                       assertEquals(result.getFirstSequenceScores().getNumberOfScores(),\r
+                                       18);\r
 \r
                } catch (UnsupportedRuntimeException e) {\r
                        e.printStackTrace();\r
@@ -199,12 +200,11 @@ public class TestAAConWS {
                        // .setDefaultValue("MAX_SCORE");\r
                        // options.getArgument("SMERFS Gap Threshhold").setDefaultValue("1");\r
                        String jobId = msaws.customAnalize(fsl, options.getArguments());\r
-                       Map<String, HashSet<Score>> result = msaws.getAnnotation(jobId);\r
+                       ScoreManager result = msaws.getAnnotation(jobId);\r
                        assertNotNull(result);\r
-                       assertEquals(result.size(), 1);\r
-                       assertEquals(\r
-                                       new ArrayList<Score>(result.values().iterator().next())\r
-                                                       .get(0).getScores().get(0), 0.698f);\r
+                       assertEquals(result.getFirstSequenceScores().getNumberOfScores(), 1);\r
+                       assertEquals(result.getFirstSequenceScores().getFirstScore()\r
+                                       .getScores().get(0), 0.698f);\r
 \r
                        options.getArgument("Calculation method").setDefaultValue("SMERFS");\r
                        options.removeArgument("Normalize");\r
@@ -212,10 +212,9 @@ public class TestAAConWS {
                        jobId = msaws.customAnalize(fsl, options.getArguments());\r
                        result = msaws.getAnnotation(jobId);\r
                        assertNotNull(result);\r
-                       assertEquals(result.size(), 1);\r
-                       assertEquals(\r
-                                       new ArrayList<Score>(result.values().iterator().next())\r
-                                                       .get(0).getScores().get(0), 0.401f);\r
+                       assertEquals(result.getFirstSequenceScores().getNumberOfScores(), 1);\r
+                       assertEquals(result.getFirstSequenceScores().getFirstScore()\r
+                                       .getScores().get(0), 0.401f);\r
 \r
                } catch (WrongParameterException e) {\r
                        e.printStackTrace();\r
index d238d6b..c52c030 100644 (file)
@@ -1,8 +1,6 @@
 package compbio.data.msa;\r
 \r
 import java.security.InvalidParameterException;\r
-import java.util.HashMap;\r
-import java.util.HashSet;\r
 import java.util.List;\r
 \r
 import javax.jws.WebMethod;\r
@@ -10,7 +8,7 @@ import javax.jws.WebParam;
 import javax.jws.WebService;\r
 \r
 import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.Score;\r
+import compbio.data.sequence.ScoreManager;\r
 import compbio.metadata.JobSubmissionException;\r
 import compbio.metadata.LimitExceededException;\r
 import compbio.metadata.Option;\r
@@ -194,8 +192,7 @@ public interface SequenceAnnotation<T>
         * \r
         */\r
        @WebMethod\r
-       HashMap<String, HashSet<Score>> getAnnotation(\r
-                       @WebParam(name = "jobId") String jobId)\r
+       ScoreManager getAnnotation(@WebParam(name = "jobId") String jobId)\r
                        throws ResultNotAvailableException;\r
        /*\r
         * The method should really return Map and Set, but unfortunately JAXB\r
index 57cf59f..4619c60 100644 (file)
@@ -33,10 +33,7 @@ import java.io.IOException;
 import java.io.OutputStream;\r
 import java.net.MalformedURLException;\r
 import java.net.URL;\r
-import java.util.HashSet;\r
 import java.util.List;\r
-import java.util.Map;\r
-import java.util.Set;\r
 import java.util.logging.Level;\r
 import java.util.logging.Logger;\r
 \r
@@ -46,7 +43,7 @@ import javax.xml.ws.WebServiceException;
 \r
 import compbio.data.msa.SequenceAnnotation;\r
 import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.Score;\r
+import compbio.data.sequence.ScoreManager;\r
 import compbio.data.sequence.SequenceUtil;\r
 import compbio.data.sequence.UnknownFileFormatException;\r
 import compbio.metadata.JobSubmissionException;\r
@@ -115,7 +112,7 @@ public class AAConClient {
                        customOptions = MetadataHelper.processParameters(prms,\r
                                        msaws.getRunnerOptions());\r
                }\r
-               Map<String, HashSet<Score>> result = null;\r
+               ScoreManager result = null;\r
                if (inputFile != null) {\r
                        System.out.println("Calculating conservation...");\r
                        result = analize(inputFile, msaws, preset, customOptions);\r
@@ -155,14 +152,9 @@ public class AAConClient {
         * @param result\r
         *            the AACon scores to output\r
         */\r
-       static void writeOut(OutputStream outStream,\r
-                       Map<String, HashSet<Score>> result) {\r
+       static void writeOut(OutputStream outStream, ScoreManager result) {\r
                try {\r
-                       for (Map.Entry<String, ? extends Set<Score>> entry : result\r
-                                       .entrySet()) {\r
-                               System.out.println(">" + entry.getKey());\r
-                               Score.write(entry.getValue(), outStream);\r
-                       }\r
+                       result.writeOut(outStream);\r
                } catch (IOException e) {\r
                        System.err\r
                                        .println("Problems writing output file! Stack trace is below: ");\r
@@ -222,12 +214,11 @@ public class AAConClient {
         * @return Set<Score> the conservation scores\r
         * @throws UnknownFileFormatException\r
         */\r
-       static Map<String, HashSet<Score>> analize(File file,\r
-                       SequenceAnnotation<AAConWS> wsproxy, Preset<AAConWS> preset,\r
-                       List<Option<AAConWS>> customOptions) {\r
+       static ScoreManager analize(File file, SequenceAnnotation<AAConWS> wsproxy,\r
+                       Preset<AAConWS> preset, List<Option<AAConWS>> customOptions) {\r
 \r
                List<FastaSequence> fastalist = null;\r
-               Map<String, HashSet<Score>> scores = null;\r
+               ScoreManager scores = null;\r
                try {\r
                        fastalist = SequenceUtil.openInputStream(file.getAbsolutePath());\r
 \r
index 414af9c..8fbf763 100644 (file)
@@ -10,13 +10,11 @@ import java.io.FileReader;
 import java.io.IOException;\r
 import java.io.OutputStream;\r
 import java.util.ArrayList;\r
-import java.util.HashSet;\r
 import java.util.List;\r
-import java.util.Map;\r
 \r
 import compbio.data.sequence.Alignment;\r
 import compbio.data.sequence.ClustalAlignmentUtil;\r
-import compbio.data.sequence.Score;\r
+import compbio.data.sequence.ScoreManager;\r
 \r
 public class IOHelper {\r
 \r
@@ -119,13 +117,9 @@ public class IOHelper {
         * @param result\r
         *            the AACon scores to output\r
         */\r
-       static void writeOut(OutputStream outStream,\r
-                       Map<String, HashSet<Score>> result) {\r
+       static void writeOut(OutputStream outStream, ScoreManager results) {\r
                try {\r
-                       for (Map.Entry<String, HashSet<Score>> entry : result.entrySet()) {\r
-                               System.out.println(">" + entry.getKey());\r
-                               Score.write(entry.getValue(), outStream);\r
-                       }\r
+                       results.writeOut(outStream);\r
                } catch (IOException e) {\r
                        System.err\r
                                        .println("Problems writing output file! Stack trace is below: ");\r
index ec3cf65..eda6533 100644 (file)
@@ -37,10 +37,7 @@ import java.io.OutputStream;
 import java.net.MalformedURLException;\r
 import java.net.URL;\r
 import java.util.Arrays;\r
-import java.util.HashMap;\r
-import java.util.HashSet;\r
 import java.util.List;\r
-import java.util.Map;\r
 import java.util.logging.Level;\r
 import java.util.logging.Logger;\r
 \r
@@ -53,7 +50,7 @@ import compbio.data.msa.MsaWS;
 import compbio.data.msa.SequenceAnnotation;\r
 import compbio.data.sequence.Alignment;\r
 import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.Score;\r
+import compbio.data.sequence.ScoreManager;\r
 import compbio.data.sequence.SequenceUtil;\r
 import compbio.data.sequence.UnknownFileFormatException;\r
 import compbio.metadata.JobSubmissionException;\r
@@ -162,9 +159,9 @@ public class Jws2Client {
                                outStream = System.out;\r
                        }\r
                        if (service.getServiceType() == SequenceAnnotation.class) {\r
-                               Map<String, HashSet<Score>> result = analize(inputFile,\r
+                               ScoreManager result = analize(inputFile,\r
                                                ((SequenceAnnotation<T>) msaws), preset, customOptions);\r
-                               assert !result.values().isEmpty() : "No Result reported!";\r
+\r
                                IOHelper.writeOut(outStream, result);\r
                        } else {\r
                                alignment = align(inputFile, (MsaWS<T>) msaws, preset,\r
@@ -204,12 +201,11 @@ public class Jws2Client {
         * @return Set<Score> the conservation scores\r
         * @throws UnknownFileFormatException\r
         */\r
-       <T> HashMap<String, HashSet<Score>> analize(File file,\r
-                       SequenceAnnotation<T> wsproxy, Preset<T> preset,\r
-                       List<Option<T>> customOptions) {\r
+       <T> ScoreManager analize(File file, SequenceAnnotation<T> wsproxy,\r
+                       Preset<T> preset, List<Option<T>> customOptions) {\r
 \r
                List<FastaSequence> fastalist = null;\r
-               HashMap<String, HashSet<Score>> scores = null;\r
+               ScoreManager scores = null;\r
                try {\r
                        fastalist = SequenceUtil.openInputStream(file.getAbsolutePath());\r
                        assert !fastalist.isEmpty() : "Input is empty!";\r
@@ -230,8 +226,6 @@ public class Jws2Client {
                        Thread.sleep(2000);\r
 \r
                        scores = wsproxy.getAnnotation(jobId);\r
-                       assert scores != null && !scores.values().isEmpty() : "Scores are NULL for job: "\r
-                                       + jobId;\r
 \r
                } catch (IOException e) {\r
                        System.err\r
index 433728b..095bc4e 100644 (file)
@@ -2,7 +2,6 @@ package compbio.ws.server;
 \r
 import java.io.File;\r
 import java.util.Arrays;\r
-import java.util.HashMap;\r
 import java.util.HashSet;\r
 import java.util.List;\r
 \r
@@ -15,6 +14,7 @@ import org.apache.log4j.Logger;
 import compbio.data.msa.SequenceAnnotation;\r
 import compbio.data.sequence.FastaSequence;\r
 import compbio.data.sequence.Score;\r
+import compbio.data.sequence.ScoreManager;\r
 import compbio.engine.AsyncExecutor;\r
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
@@ -59,17 +59,18 @@ public class AAConWS implements SequenceAnnotation<AACon> {
        }\r
 \r
        @Override\r
-       public HashMap<String, HashSet<Score>> getAnnotation(String jobId)\r
+       public ScoreManager getAnnotation(String jobId)\r
                        throws ResultNotAvailableException {\r
                WSUtil.validateJobId(jobId);\r
                AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId);\r
                ConfiguredExecutable<AACon> aacon = (ConfiguredExecutable<AACon>) asyncEngine\r
                                .getResults(jobId);\r
                HashSet<Score> mas = aacon.getResults();\r
-               HashMap<String, HashSet<Score>> result = new HashMap<String, HashSet<Score>>();\r
-               result.put("Alignment", mas);\r
+               // ScoreManager result = new HashMap<String, HashSet<Score>>();\r
+               // result.put("Alignment", mas);\r
                log.trace(jobId + " getConservation : " + mas);\r
-               return result;\r
+               // FIXME\r
+               return null;\r
        }\r
        /*\r
         * @SuppressWarnings("unchecked") public JalviewAnnotation\r
index 061f9a6..2eac30d 100644 (file)
@@ -1,7 +1,5 @@
 package compbio.ws.server;\r
 \r
-import java.util.HashMap;\r
-import java.util.HashSet;\r
 import java.util.List;\r
 \r
 import javax.annotation.Resource;\r
@@ -12,7 +10,7 @@ import org.apache.log4j.Logger;
 \r
 import compbio.data.msa.SequenceAnnotation;\r
 import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.Score;\r
+import compbio.data.sequence.ScoreManager;\r
 import compbio.engine.AsyncExecutor;\r
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
@@ -57,13 +55,13 @@ public class DisemblWS implements SequenceAnnotation<Disembl> {
        }\r
 \r
        @Override\r
-       public HashMap<String, HashSet<Score>> getAnnotation(String jobId)\r
+       public ScoreManager getAnnotation(String jobId)\r
                        throws ResultNotAvailableException {\r
                WSUtil.validateJobId(jobId);\r
                AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId);\r
                ConfiguredExecutable<Disembl> disembl = (ConfiguredExecutable<Disembl>) asyncEngine\r
                                .getResults(jobId);\r
-               HashMap<String, HashSet<Score>> mas = disembl.getResults();\r
+               ScoreManager mas = disembl.getResults();\r
                log.trace(jobId + " getDisorder : " + mas);\r
                return mas;\r
        }\r
index df402fa..cf266b0 100644 (file)
@@ -1,7 +1,5 @@
 package compbio.ws.server;\r
 \r
-import java.util.HashMap;\r
-import java.util.HashSet;\r
 import java.util.List;\r
 \r
 import javax.annotation.Resource;\r
@@ -12,7 +10,7 @@ import org.apache.log4j.Logger;
 \r
 import compbio.data.msa.SequenceAnnotation;\r
 import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.Score;\r
+import compbio.data.sequence.ScoreManager;\r
 import compbio.engine.AsyncExecutor;\r
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
@@ -57,13 +55,13 @@ public class GlobPlotWS implements SequenceAnnotation<GlobPlot> {
        }\r
 \r
        @Override\r
-       public HashMap<String, HashSet<Score>> getAnnotation(String jobId)\r
+       public ScoreManager getAnnotation(String jobId)\r
                        throws ResultNotAvailableException {\r
                WSUtil.validateJobId(jobId);\r
                AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId);\r
                ConfiguredExecutable<GlobPlot> globPlot = (ConfiguredExecutable<GlobPlot>) asyncEngine\r
                                .getResults(jobId);\r
-               HashMap<String, HashSet<Score>> mas = globPlot.getResults();\r
+               ScoreManager mas = globPlot.getResults();\r
                log.trace(jobId + " getConservation : " + mas);\r
                return mas;\r
        }\r
index 13fe708..e9070d5 100644 (file)
@@ -1,8 +1,6 @@
 package compbio.ws.server;\r
 \r
 import java.io.File;\r
-import java.util.HashMap;\r
-import java.util.HashSet;\r
 import java.util.List;\r
 \r
 import javax.annotation.Resource;\r
@@ -13,7 +11,7 @@ import org.apache.log4j.Logger;
 \r
 import compbio.data.msa.SequenceAnnotation;\r
 import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.Score;\r
+import compbio.data.sequence.ScoreManager;\r
 import compbio.engine.AsyncExecutor;\r
 import compbio.engine.Configurator;\r
 import compbio.engine.client.ConfiguredExecutable;\r
@@ -59,13 +57,13 @@ public class JronnWS implements SequenceAnnotation<Jronn> {
        }\r
 \r
        @Override\r
-       public HashMap<String, HashSet<Score>> getAnnotation(String jobId)\r
+       public ScoreManager getAnnotation(String jobId)\r
                        throws ResultNotAvailableException {\r
                WSUtil.validateJobId(jobId);\r
                AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId);\r
                ConfiguredExecutable<Jronn> jronn = (ConfiguredExecutable<Jronn>) asyncEngine\r
                                .getResults(jobId);\r
-               HashMap<String, HashSet<Score>> mas = jronn.getResults();\r
+               ScoreManager mas = jronn.getResults();\r
                log.trace(jobId + " getConservation : " + mas);\r
                return mas;\r
        }\r