Re-engineering of database I/O
[proteocache.git] / datadb / compbio / cassandra / JpredParserHTTP.java
index 27f66cc..5687a83 100644 (file)
@@ -21,17 +21,17 @@ import java.util.List;
 import compbio.cassandra.JpredParser;
 
 public class JpredParserHTTP implements JpredParser {
-       private CassandraNativeConnector cc = new CassandraNativeConnector();
+       private CassandraWriter cw = new CassandraWriter();
        private String dirprefix;
        private List<FastaSequence> alignment;
        private List<FastaSequence> predictions;
        private String jnetpred;
 
-       JpredParserHTTP() {
+       public JpredParserHTTP() {
                dirprefix = "http://www.compbio.dundee.ac.uk/www-jpred/results";
        }
 
-       JpredParserHTTP(String sourceurl) {
+       public JpredParserHTTP(String sourceurl) {
                dirprefix = sourceurl;
        }
 
@@ -125,7 +125,7 @@ public class JpredParserHTTP implements JpredParser {
                                        // unknown_email jp_J9HBCBT
                                        String id = table[table.length - 1];
                                        totalcount++;
-                                       if (cc.JobisNotInsterted(id)) {
+                                       if (cw.JobisNotInsterted(id)) {
                                                URL dataurl = new URL(dirprefix + "/" + id + "/" + id + ".concise.fasta");
                                                URL archiveurl = new URL(dirprefix + "/" + id + "/" + id + ".tar.gz");
                                                URL logurl = new URL(dirprefix + "/" + id + "/LOG");
@@ -150,7 +150,7 @@ public class JpredParserHTTP implements JpredParser {
                                                                                String ip = table[2];
                                                                                String execstatus = "OK";
                                                                                String finalstatus = "OK";
-                                                                               countinsertions += cc.FormQueryTables(startdate.getTime(), table[0], table[1], ip, id, execstatus,
+                                                                               countinsertions += cw.FormQueryTables(startdate.getTime(), table[0], table[1], ip, id, execstatus,
                                                                                                finalstatus, protein, predictions);
 
                                                                                long exectime = (endtime.getTime() - starttime.getTime()) / 1000;
@@ -158,7 +158,7 @@ public class JpredParserHTTP implements JpredParser {
                                                                                if (199 < response2 && response2 < 300) {
                                                                                        log = parseLogFile(logurl.openStream());
                                                                                }
-                                                                               cc.ArchiveData(startdate.getTime(), exectime, ip, id, execstatus, finalstatus, protein,
+                                                                               cw.ArchiveData(startdate.getTime(), exectime, ip, id, execstatus, finalstatus, protein,
                                                                                                predictions, alignment, log, archiveurl.toString());
                                                                        } catch (ParseException e) {
                                                                                e.printStackTrace();