* @return a number of jobs executed for the protein
*/
@WebMethod
- public String findSequence(@WebParam(name = "sequence") String sequence, @WebParam(name = "program") String program,
+ public int findSequence(@WebParam(name = "sequence") String sequence, @WebParam(name = "program") String program,
@WebParam(name = "version") String version);
/**
*/
@WebMethod
public String getArchive(@WebParam(name = "job") String jobid);
+
+ /**
+ * Checks whether a job with a given Job ID is kept in ProteoCache
+ *
+ * @param jobid
+ * the job ID
+ * @return 1 if the job exists, 0 - otherwise
+ */
+ @WebMethod
+ public int jobExists(@WebParam(name = "job") String jobid);
}
import compbio.beans.ProteinBean;
import compbio.cassandra.CassandraNativeConnector;
+import compbio.cassandra.readers.JobReader;
import compbio.cassandra.readers.SequenceReader;
import compbio.engine.archive.ArchivedJob;
}
@Override
- public String findSequence(String sequence, String program, String version) {
+ public int findSequence(String sequence, String program, String version) {
List<String> jobs = findJobs(sequence, program, version);
if (null != jobs) {
- return jobs.size() + " jobs found";
+ return jobs.size();
}
- return "no jobs found";
+ return 0;
}
@Override
return link;
}
+ @Override
+ public int jobExists(String jobid) {
+ CassandraNativeConnector dbconnector = new CassandraNativeConnector();
+ JobReader reader = new JobReader();
+ reader.setSession(dbconnector.getSession());
+ if (null != reader.readJobLog(jobid)) {
+ return 1;
+ }
+ return 0;
+ }
+
}
public class FindSequenceResponse {
@XmlElement(name = "return", namespace = "")
- private String _return;
+ private int _return;
/**
*
* @return
- * returns String
+ * returns int
*/
- public String getReturn() {
+ public int getReturn() {
return this._return;
}
* @param _return
* the value for the _return property
*/
- public void setReturn(String _return) {
+ public void setReturn(int _return) {
this._return = _return;
}
--- /dev/null
+
+package compbio.ws.jpred.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "jobExists", namespace = "http://server.proteocache.ws")
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "jobExists", namespace = "http://server.proteocache.ws")
+public class JobExists {
+
+ @XmlElement(name = "job", namespace = "")
+ private String job;
+
+ /**
+ *
+ * @return
+ * returns String
+ */
+ public String getJob() {
+ return this.job;
+ }
+
+ /**
+ *
+ * @param job
+ * the value for the job property
+ */
+ public void setJob(String job) {
+ this.job = job;
+ }
+
+}
--- /dev/null
+
+package compbio.ws.jpred.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "jobExistsResponse", namespace = "http://server.proteocache.ws")
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "jobExistsResponse", namespace = "http://server.proteocache.ws")
+public class JobExistsResponse {
+
+ @XmlElement(name = "return", namespace = "")
+ private int _return;
+
+ /**
+ *
+ * @return
+ * returns int
+ */
+ public int getReturn() {
+ return this._return;
+ }
+
+ /**
+ *
+ * @param _return
+ * the value for the _return property
+ */
+ public void setReturn(int _return) {
+ this._return = _return;
+ }
+
+}
<message name="getArchiveResponse">
<part name="parameters" element="tns:getArchiveResponse"/>
</message>
+ <message name="jobExists">
+ <part name="parameters" element="tns:jobExists"/>
+ </message>
+ <message name="jobExistsResponse">
+ <part name="parameters" element="tns:jobExistsResponse"/>
+ </message>
<portType name="Jpred">
<operation name="findSequence">
<input wsam:Action="http://server.proteocache.ws/Jpred/findSequenceRequest" message="tns:findSequence"/>
<input wsam:Action="http://server.proteocache.ws/Jpred/getArchiveRequest" message="tns:getArchive"/>
<output wsam:Action="http://server.proteocache.ws/Jpred/getArchiveResponse" message="tns:getArchiveResponse"/>
</operation>
+ <operation name="jobExists">
+ <input wsam:Action="http://server.proteocache.ws/Jpred/jobExistsRequest" message="tns:jobExists"/>
+ <output wsam:Action="http://server.proteocache.ws/Jpred/jobExistsResponse" message="tns:jobExistsResponse"/>
+ </operation>
</portType>
<binding name="ProteoCacheWSPortBinding" type="tns:Jpred">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<soap:body use="literal"/>
</output>
</operation>
+ <operation name="jobExists">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
</binding>
<service name="ProteoCacheWS">
<port name="ProteoCacheWSPort" binding="tns:ProteoCacheWSPortBinding">
<xs:element name="getArchiveResponse" type="tns:getArchiveResponse"/>
+ <xs:element name="jobExists" type="tns:jobExists"/>
+
+ <xs:element name="jobExistsResponse" type="tns:jobExistsResponse"/>
+
<xs:complexType name="findJobForSequence">
<xs:sequence>
<xs:element name="sequence" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
+ <xs:complexType name="jobExists">
+ <xs:sequence>
+ <xs:element name="job" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="jobExistsResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+
<xs:complexType name="findSequence">
<xs:sequence>
<xs:element name="sequence" type="xs:string" minOccurs="0"/>
<xs:complexType name="findSequenceResponse">
<xs:sequence>
- <xs:element name="return" type="xs:string" minOccurs="0"/>
+ <xs:element name="return" type="xs:int"/>
</xs:sequence>
</xs:complexType>