Add documentation to the classes
authorSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Fri, 31 Jan 2014 16:51:47 +0000 (16:51 +0000)
committerSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Fri, 31 Jan 2014 16:51:47 +0000 (16:51 +0000)
server/compbio/ws/jpred/Jpred.java
server/compbio/ws/jpred/JpredWS.java

index 4b4a965..72b1a9e 100644 (file)
@@ -4,17 +4,58 @@ import javax.jws.WebMethod;
 import javax.jws.WebParam;
 import javax.jws.WebService;
 
+/**
+ * Jpred interface of the corresponding web serice in ProteoCache
+ * 
+ * @author Alexander Sherstnev
+ * @author Natasha Sherstneva
+ * 
+ * @version 1.0
+ * @since Jan 2014
+ */
 @WebService(targetNamespace = "http://server.proteocache.ws")
 public interface Jpred {
 
+       /**
+        * Returns a number of jobs xecuted for a protein with a program of a
+        * version
+        * 
+        * @param sequence
+        *            the protein sequence
+        * @param program
+        *            the program title
+        * @param version
+        *            the program version
+        * @return a number of jobs executed for the protein
+        */
        @WebMethod
        public String findSequence(@WebParam(name = "sequence") String sequence, @WebParam(name = "program") String program,
                        @WebParam(name = "version") String version);
 
+       /**
+        * Returns a job ID executed for a protein with a program of a version if
+        * the job archive file is available, otherwise returns empty string
+        * 
+        * @param sequence
+        *            the protein sequence
+        * @param program
+        *            the program title
+        * @param version
+        *            the program version
+        * @return job ID
+        */
        @WebMethod
        public String findJobForSequence(@WebParam(name = "sequence") String sequence, @WebParam(name = "program") String program,
                        @WebParam(name = "version") String version);
 
+       /**
+        * Returns a relative web link to the job archive file for a ProteoCache
+        * job, if the file is not available null is returned
+        * 
+        * @param jobid
+        *            the job ID
+        * @return the job archive file web link or null
+        */
        @WebMethod
        public String getArchive(@WebParam(name = "job") String jobid);
 }
index 9978cc4..5249280 100644 (file)
@@ -13,6 +13,15 @@ import compbio.cassandra.CassandraNativeConnector;
 import compbio.cassandra.readers.SequenceReader;
 import compbio.engine.archive.ArchivedJob;
 
+/**
+ * Implementation of the Jpred web service in ProteoCache
+ * 
+ * @author Alexander Sherstnev
+ * @author Natasha Sherstneva
+ * 
+ * @version 1.0
+ * @since Jan 2014
+ */
 @WebService(endpointInterface = "compbio.ws.jpred.Jpred", targetNamespace = "http://server.proteocache.ws", serviceName = "ProteoCacheWS", portName = "ProteoCacheWSPort")
 public class JpredWS implements Jpred {
        private static Logger log = Logger.getLogger(CassandraNativeConnector.class);
@@ -71,7 +80,7 @@ public class JpredWS implements Jpred {
 
        @Override
        public String getArchive(String jobid) {
-               String link = "undefined";
+               String link = null;
                ArchivedJob aj = new ArchivedJob(jobid);
                try {
                        link = aj.prepareJobArchiveToWeb();
@@ -79,6 +88,7 @@ public class JpredWS implements Jpred {
                        log.error("JpredWS.findSequence: IO exception with job archive file");
                        log.error(e.getLocalizedMessage(), e.getCause());
                }
+               // if the archive file is not available null is returned
                return link;
        }