- String datalink = dirprefix + "/" + id + "/" + id + ".concise.fasta";
- URL urltable = new URL(datalink);
- HttpURLConnection httpConnection = (HttpURLConnection) urltable.openConnection();
- int responsecode = httpConnection.getResponseCode();
- if (199 < responsecode && responsecode < 300) {
- try {
- final FastaReader fr = new FastaReader(urltable.openStream());
- final List<FastaSequence> seqs = new ArrayList<FastaSequence>();
- String newprotein = "";
- while (fr.hasNext()) {
- final FastaSequence fs = fr.next();
- if (fs.getId().equals("QUERY") || fs.getId().equals(id))
- newprotein = fs.getSequence().replaceAll("\n", "");
- else if (fs.getId().equals("jnetpred") || fs.getId().equals("JNETPRED")) {
- seqs.add(fs);
- }
- }
- if (newprotein.equals("")) {
- countUnclearFASTAid++;
- } else {
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");
- String dateInString1 = table[0].substring(0, table[0].indexOf(":"));
- long dateWork1 = 0;
- try {
- Date dat1 = formatter.parse(dateInString1);
- dateWork1 = dat1.getTime();
- } catch (ParseException e) {
- e.printStackTrace();
+ if (cc.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");
+ HttpURLConnection httpConnection1 = (HttpURLConnection) dataurl.openConnection();
+ HttpURLConnection httpConnection2 = (HttpURLConnection) logurl.openConnection();
+ HttpURLConnection httpConnection3 = (HttpURLConnection) archiveurl.openConnection();
+ int response1 = httpConnection1.getResponseCode();
+ int response2 = httpConnection2.getResponseCode();
+ if (199 < response1 && response1 < 300) {
+ try {
+ String protein = parsePredictions(dataurl.openStream(), id);
+ if (protein.equals("")) {
+ countUnclearFASTAid++;
+ } else {
+ SimpleDateFormat dateformatter = new SimpleDateFormat("yyyy/MM/dd");
+ SimpleDateFormat timeformatter = new SimpleDateFormat("yyyy/MM/dd:H:m:s");
+ String startdatestring = table[0].substring(0, table[0].indexOf(":"));
+ try {
+ Date startdate = dateformatter.parse(startdatestring);
+ Date starttime = timeformatter.parse(table[0]);
+ Date endtime = timeformatter.parse(table[1]);
+ String ip = table[2];
+ String execstatus = "OK";
+ String finalstatus = "OK";
+ countinsertions += cc.FormQueryTables(startdate.getTime(), table[0], table[1], ip, id, execstatus,
+ finalstatus, protein, predictions);
+
+ long exectime = (endtime.getTime() - starttime.getTime()) / 1000;
+ String log = "";
+ if (199 < response2 && response2 < 300) {
+ log = parseLogFile(logurl.openStream());
+ }
+ cc.ArchiveData(startdate.getTime(), exectime, ip, id, execstatus, finalstatus, protein,
+ predictions, alignment, log, archiveurl.toString());
+ } catch (ParseException e) {
+ e.printStackTrace();
+ }