From: Sasha Sherstnev Date: Sat, 12 Oct 2013 15:12:41 +0000 (+0100) Subject: remove project files and keep sources only X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8b45c19de3f4e652033186bf6b9dc9b3e9205a64;p=jabaws.git remove project files and keep sources only --- diff --git a/webservices/compbio/nosql/.classpath b/webservices/compbio/nosql/.classpath deleted file mode 100644 index 12511cb..0000000 --- a/webservices/compbio/nosql/.classpath +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/webservices/compbio/nosql/.gitignore b/webservices/compbio/nosql/.gitignore deleted file mode 100644 index 796b96d..0000000 --- a/webservices/compbio/nosql/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/webservices/compbio/nosql/.project b/webservices/compbio/nosql/.project deleted file mode 100644 index f2e4f29..0000000 --- a/webservices/compbio/nosql/.project +++ /dev/null @@ -1,36 +0,0 @@ - - - nosql - - - - - - org.eclipse.wst.jsdt.core.javascriptValidator - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.wst.validation.validationbuilder - - - - - - org.eclipse.jem.workbench.JavaEMFNature - org.eclipse.wst.common.modulecore.ModuleCoreNature - org.eclipse.wst.common.project.facet.core.nature - org.eclipse.jdt.core.javanature - org.eclipse.wst.jsdt.core.jsNature - - diff --git a/webservices/compbio/nosql/.settings/.jsdtscope b/webservices/compbio/nosql/.settings/.jsdtscope deleted file mode 100644 index 3a28de0..0000000 --- a/webservices/compbio/nosql/.settings/.jsdtscope +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/webservices/compbio/nosql/.settings/org.eclipse.jdt.core.prefs b/webservices/compbio/nosql/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f42de36..0000000 --- a/webservices/compbio/nosql/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/webservices/compbio/nosql/.settings/org.eclipse.wst.common.component b/webservices/compbio/nosql/.settings/org.eclipse.wst.common.component deleted file mode 100644 index e76377e..0000000 --- a/webservices/compbio/nosql/.settings/org.eclipse.wst.common.component +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/webservices/compbio/nosql/.settings/org.eclipse.wst.common.project.facet.core.xml b/webservices/compbio/nosql/.settings/org.eclipse.wst.common.project.facet.core.xml deleted file mode 100644 index b3f07fe..0000000 --- a/webservices/compbio/nosql/.settings/org.eclipse.wst.common.project.facet.core.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/webservices/compbio/nosql/.settings/org.eclipse.wst.jsdt.ui.superType.container b/webservices/compbio/nosql/.settings/org.eclipse.wst.jsdt.ui.superType.container deleted file mode 100644 index 3bd5d0a..0000000 --- a/webservices/compbio/nosql/.settings/org.eclipse.wst.jsdt.ui.superType.container +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/webservices/compbio/nosql/.settings/org.eclipse.wst.jsdt.ui.superType.name b/webservices/compbio/nosql/.settings/org.eclipse.wst.jsdt.ui.superType.name deleted file mode 100644 index 05bd71b..0000000 --- a/webservices/compbio/nosql/.settings/org.eclipse.wst.jsdt.ui.superType.name +++ /dev/null @@ -1 +0,0 @@ -Window \ No newline at end of file diff --git a/webservices/compbio/nosql/.settings/org.jboss.ide.eclipse.as.core.prefs b/webservices/compbio/nosql/.settings/org.jboss.ide.eclipse.as.core.prefs deleted file mode 100644 index cf3aa3a..0000000 --- a/webservices/compbio/nosql/.settings/org.jboss.ide.eclipse.as.core.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -org.jboss.ide.eclipse.as.core.singledeployable.deployableList= diff --git a/webservices/compbio/nosql/WebContent/AllReports.jsp b/webservices/compbio/nosql/WebContent/AllReports.jsp deleted file mode 100644 index 110bc3e..0000000 --- a/webservices/compbio/nosql/WebContent/AllReports.jsp +++ /dev/null @@ -1,9 +0,0 @@ -<% - String query = request.getParameter("query"); - if (query.equals("date")) - response.sendRedirect("Sample.jsp"); - else if (query.equals("length")) - response.sendRedirect("JobLength.jsp"); - else if (query.equals("protein")) - response.sendRedirect("Sequence.jsp"); -%> \ No newline at end of file diff --git a/webservices/compbio/nosql/WebContent/Index.jsp b/webservices/compbio/nosql/WebContent/Index.jsp deleted file mode 100644 index 475b4a7..0000000 --- a/webservices/compbio/nosql/WebContent/Index.jsp +++ /dev/null @@ -1,18 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - -Cassandra report - - -
-

Choose query type

- Search by date
- Search by time interval
- Search by protein sequence
- -
- - \ No newline at end of file diff --git a/webservices/compbio/nosql/WebContent/JobLength.jsp b/webservices/compbio/nosql/WebContent/JobLength.jsp deleted file mode 100644 index 65c7004..0000000 --- a/webservices/compbio/nosql/WebContent/JobLength.jsp +++ /dev/null @@ -1,23 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - <%@page import="java.util.Calendar"%> - - - - - -Date interval - - -
-

Enter time period

- <% Calendar cal = Calendar.getInstance(); - String datecalBegin = cal.get(Calendar.YEAR) + "/" + cal.get(Calendar.MONTH) + "/1"; - String datecalEnd = cal.get(Calendar.YEAR) + "/" + cal.get(Calendar.MONTH) + "/" + cal.get(Calendar.DAY_OF_MONTH); - %> -

from style=" width : 145px;"/> - to style=" width : 145px;"/>

- -
- - \ No newline at end of file diff --git a/webservices/compbio/nosql/WebContent/META-INF/MANIFEST.MF b/webservices/compbio/nosql/WebContent/META-INF/MANIFEST.MF deleted file mode 100644 index 5e94951..0000000 --- a/webservices/compbio/nosql/WebContent/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Class-Path: - diff --git a/webservices/compbio/nosql/WebContent/PrintResult.jsp b/webservices/compbio/nosql/WebContent/PrintResult.jsp deleted file mode 100644 index c2f2e81..0000000 --- a/webservices/compbio/nosql/WebContent/PrintResult.jsp +++ /dev/null @@ -1,21 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - -Report - - -

Report Results

-<% String rez = request.getAttribute("result").toString(); - String[] rezLines = rez.split(";"); - for (int i = 0; i < rezLines.length; i++) { -%> -<%= rezLines[i]+"
" %> -<% -} -%> -Click here to go Back - - \ No newline at end of file diff --git a/webservices/compbio/nosql/WebContent/ReportLength.jsp b/webservices/compbio/nosql/WebContent/ReportLength.jsp deleted file mode 100644 index 0f20353..0000000 --- a/webservices/compbio/nosql/WebContent/ReportLength.jsp +++ /dev/null @@ -1,28 +0,0 @@ -<%@page import="java.util.ArrayList"%> -<%@ page trimDirectiveWhitespaces="true" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="http://displaytag.sf.net" prefix="dt" %> - -

Time execution for the interval: ${data1} - ${data2}

- - - - - - - - - - - - - - - - - - - -
Dateless then 1sless then 10sless then 20smore then 20s
${res.date}${time}
diff --git a/webservices/compbio/nosql/WebContent/ReportNew.jsp b/webservices/compbio/nosql/WebContent/ReportNew.jsp deleted file mode 100644 index c0715bd..0000000 --- a/webservices/compbio/nosql/WebContent/ReportNew.jsp +++ /dev/null @@ -1,43 +0,0 @@ -<%@page import="java.util.ArrayList"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="http://displaytag.sf.net" prefix="dt" %> - -

Jobs statistics for the Period: - to

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DateNumber of Proteins
TotalFailedCancelledAbandoned
${res.date}000
Total:${sum}000
\ No newline at end of file diff --git a/webservices/compbio/nosql/WebContent/ReportProt.jsp b/webservices/compbio/nosql/WebContent/ReportProt.jsp deleted file mode 100644 index e5bc3fa..0000000 --- a/webservices/compbio/nosql/WebContent/ReportProt.jsp +++ /dev/null @@ -1,39 +0,0 @@ -<%@page import="java.util.ArrayList"%> -<%@ page trimDirectiveWhitespaces="true" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="http://displaytag.sf.net" prefix="dt" %> - -

Dundee ProteoCache query result

- - - - - - - - - - - - - - - - - - - - - - - -
IDPrediction
${res.id} - - -${seq} -${seq} - - -
diff --git a/webservices/compbio/nosql/WebContent/Sample.jsp b/webservices/compbio/nosql/WebContent/Sample.jsp deleted file mode 100644 index f080c3a..0000000 --- a/webservices/compbio/nosql/WebContent/Sample.jsp +++ /dev/null @@ -1,23 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - <%@page import="java.util.Calendar"%> - - - - - -Date period - - -
-

Enter time period

- <% Calendar cal = Calendar.getInstance(); - String datecalBegin = cal.get(Calendar.YEAR) + "/" + cal.get(Calendar.MONTH) + "/1"; - String datecalEnd = cal.get(Calendar.YEAR) + "/" + cal.get(Calendar.MONTH) + "/" + cal.get(Calendar.DAY_OF_MONTH); - %> -

from style=" width : 145px;"/> - to style=" width : 145px;"/>

- -
- - \ No newline at end of file diff --git a/webservices/compbio/nosql/WebContent/Sequence.jsp b/webservices/compbio/nosql/WebContent/Sequence.jsp deleted file mode 100644 index 29a033e..0000000 --- a/webservices/compbio/nosql/WebContent/Sequence.jsp +++ /dev/null @@ -1,20 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - - -Sequence of protein - - -
-
-

Enter protein sequence

-

- search by the whole sequence - search by a part of sequence
- -
- - \ No newline at end of file diff --git a/webservices/compbio/nosql/WebContent/StatisticsProtein.jsp b/webservices/compbio/nosql/WebContent/StatisticsProtein.jsp deleted file mode 100644 index 06c7d72..0000000 --- a/webservices/compbio/nosql/WebContent/StatisticsProtein.jsp +++ /dev/null @@ -1,41 +0,0 @@ -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="http://displaytag.sf.net" prefix="dt" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DateNumber of Proteins
TotalFailedCancelledAbandoned
${res.date}000
Total:${sum}000
diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/cassandra-all-1.2.4.jar b/webservices/compbio/nosql/WebContent/WEB-INF/lib/cassandra-all-1.2.4.jar deleted file mode 100644 index ab244c5..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/cassandra-all-1.2.4.jar and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/cassandra-clientutil-1.2.4.jar b/webservices/compbio/nosql/WebContent/WEB-INF/lib/cassandra-clientutil-1.2.4.jar deleted file mode 100644 index 1ac8df4..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/cassandra-clientutil-1.2.4.jar and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/cassandra-thrift-1.2.4.jar b/webservices/compbio/nosql/WebContent/WEB-INF/lib/cassandra-thrift-1.2.4.jar deleted file mode 100644 index ca72cf0..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/cassandra-thrift-1.2.4.jar and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/commons-lang-2.4.jar b/webservices/compbio/nosql/WebContent/WEB-INF/lib/commons-lang-2.4.jar deleted file mode 100644 index 532939e..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/commons-lang-2.4.jar and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/displaytag-1.2.jar b/webservices/compbio/nosql/WebContent/WEB-INF/lib/displaytag-1.2.jar deleted file mode 100644 index 4f379bd..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/displaytag-1.2.jar and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/google-collections-0.8.jar b/webservices/compbio/nosql/WebContent/WEB-INF/lib/google-collections-0.8.jar deleted file mode 100644 index 01a54ef..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/google-collections-0.8.jar and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/hector-0.7.0-20-sources.jar b/webservices/compbio/nosql/WebContent/WEB-INF/lib/hector-0.7.0-20-sources.jar deleted file mode 100644 index 9a2fe11..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/hector-0.7.0-20-sources.jar and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/hector-core-1.0-5.jar b/webservices/compbio/nosql/WebContent/WEB-INF/lib/hector-core-1.0-5.jar deleted file mode 100644 index a325f08..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/hector-core-1.0-5.jar and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/jamm-0.2.5.jar b/webservices/compbio/nosql/WebContent/WEB-INF/lib/jamm-0.2.5.jar deleted file mode 100644 index e9baf75..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/jamm-0.2.5.jar and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/jstl-1.2.jar b/webservices/compbio/nosql/WebContent/WEB-INF/lib/jstl-1.2.jar deleted file mode 100644 index 0fd275e..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/jstl-1.2.jar and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/libthrift-0.6.0.jar b/webservices/compbio/nosql/WebContent/WEB-INF/lib/libthrift-0.6.0.jar deleted file mode 100644 index 624e3ad..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/libthrift-0.6.0.jar and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/log4j-1.2.16.jar b/webservices/compbio/nosql/WebContent/WEB-INF/lib/log4j-1.2.16.jar deleted file mode 100644 index 5429a90..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/log4j-1.2.16.jar and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/slf4j-1.7.5.tar.gz b/webservices/compbio/nosql/WebContent/WEB-INF/lib/slf4j-1.7.5.tar.gz deleted file mode 100644 index 3f3d799..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/slf4j-1.7.5.tar.gz and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/slf4j-api-1.7.5.jar b/webservices/compbio/nosql/WebContent/WEB-INF/lib/slf4j-api-1.7.5.jar deleted file mode 100644 index 8766455..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/slf4j-api-1.7.5.jar and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/lib/slf4j-simple-1.7.5.jar b/webservices/compbio/nosql/WebContent/WEB-INF/lib/slf4j-simple-1.7.5.jar deleted file mode 100644 index 9dece31..0000000 Binary files a/webservices/compbio/nosql/WebContent/WEB-INF/lib/slf4j-simple-1.7.5.jar and /dev/null differ diff --git a/webservices/compbio/nosql/WebContent/WEB-INF/web.xml b/webservices/compbio/nosql/WebContent/WEB-INF/web.xml deleted file mode 100644 index 672606e..0000000 --- a/webservices/compbio/nosql/WebContent/WEB-INF/web.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - nosql - - combio.listeners.ContextListener - - \ No newline at end of file diff --git a/webservices/compbio/nosql/displaytag-1.2.jar b/webservices/compbio/nosql/displaytag-1.2.jar deleted file mode 100644 index 4f379bd..0000000 Binary files a/webservices/compbio/nosql/displaytag-1.2.jar and /dev/null differ diff --git a/webservices/compbio/nosql/jstl-1.2.jar b/webservices/compbio/nosql/jstl-1.2.jar deleted file mode 100644 index 0fd275e..0000000 Binary files a/webservices/compbio/nosql/jstl-1.2.jar and /dev/null differ diff --git a/webservices/compbio/nosql/src/combio/cassandra/CassandraCreate.java b/webservices/compbio/nosql/src/combio/cassandra/CassandraCreate.java deleted file mode 100644 index 376da4c..0000000 --- a/webservices/compbio/nosql/src/combio/cassandra/CassandraCreate.java +++ /dev/null @@ -1,103 +0,0 @@ -package combio.cassandra; - -import java.util.Arrays; - -import me.prettyprint.cassandra.serializers.LongSerializer; -import me.prettyprint.cassandra.serializers.StringSerializer; -import me.prettyprint.cassandra.service.ThriftKsDef; -import me.prettyprint.hector.api.Cluster; -import me.prettyprint.hector.api.Keyspace; -import me.prettyprint.hector.api.beans.ColumnSlice; -import me.prettyprint.hector.api.ddl.ColumnFamilyDefinition; -import me.prettyprint.hector.api.ddl.ComparatorType; -import me.prettyprint.hector.api.ddl.KeyspaceDefinition; -import me.prettyprint.hector.api.factory.HFactory; -import me.prettyprint.hector.api.mutation.Mutator; -import me.prettyprint.hector.api.query.QueryResult; -import me.prettyprint.hector.api.query.SliceQuery; - -public class CassandraCreate { - private static Keyspace ksp; - private static Cluster cluster; - private static Mutator mutatorLong; - private static Mutator mutatorString; - private static Mutator mutatorLog; - StringSerializer ss = StringSerializer.get(); - LongSerializer ls = LongSerializer.get(); - - - // connect to cluster - public void Connection() { - cluster = HFactory.getOrCreateCluster("Protein Cluster", "127.0.0.1:9160"); - KeyspaceDefinition keyspaceDef = cluster.describeKeyspace("ProteinKeyspace"); - // If keyspace does not exist, the CFs don't exist either. => create them. -/* if (keyspaceDef != null) { - cluster.dropColumnFamily("ProteinKeyspace", "ProteinRow", true); - cluster.dropColumnFamily("ProteinKeyspace", "ProteinData", true); - cluster.dropKeyspace("ProteinKeyspace", true); - System.out.println("ProteinKeyspace has been dropped"); - } else*/ if (keyspaceDef == null) { // create column family - System.out.println("ProteinKeyspace has been null"); - ColumnFamilyDefinition cfProtein = HFactory.createColumnFamilyDefinition("ProteinKeyspace", "ProteinRow", ComparatorType.ASCIITYPE); - ColumnFamilyDefinition cfLog = HFactory.createColumnFamilyDefinition("ProteinKeyspace", "ProteinLog", ComparatorType.ASCIITYPE); - ColumnFamilyDefinition cfData = HFactory.createColumnFamilyDefinition("ProteinKeyspace", "ProteinData", ComparatorType.ASCIITYPE); - - KeyspaceDefinition newKeyspace = HFactory.createKeyspaceDefinition("ProteinKeyspace", - ThriftKsDef.DEF_STRATEGY_CLASS, 1, Arrays.asList(cfProtein, cfLog, cfData)); - //Add the schema to the cluster. - //"true" as the second param means that Hector will block until all nodes see the change. - cluster.addKeyspace(newKeyspace, true); - cluster.addColumnFamily(cfProtein, true); - cluster.addColumnFamily(cfLog, true); - cluster.addColumnFamily(cfData, true); - } - ksp = HFactory.createKeyspace("ProteinKeyspace", cluster); - System.out.println("Cassantra has been connected"); - } - - // parsing data from http://www.compbio.dundee.ac.uk/www-jpred/results/usage-new/alljobs.dat - public void Parsing() { - mutatorString = HFactory.createMutator(ksp, ss); // CF ProteinRow store protein and prediction - mutatorLog = HFactory.createMutator(ksp, ss); // CF ProteinLog store log informations (ip, id, dates start and dates of end) - mutatorLong = HFactory.createMutator(ksp, ls); // CF ProteinData store id and protein per data - System.out.println("Parsing......"); - String in = "http://www.compbio.dundee.ac.uk/www-jpred/results/usage-new/alljobs.dat"; - DataParsing datParsing = new DataParsing(); - datParsing.ParsingTest(in); - mutatorString.execute(); - mutatorLong.execute(); - mutatorLog.execute(); - System.out.println("Data Inserted"); - } - - public void Closing() { - cluster.getConnectionManager().shutdown(); - System.out.println("Cassantra has been closed"); - } - - // check whether this id exists in the cassandra DB - public boolean CheckIP(String ip) { - SliceQuery sliceQuery = HFactory.createSliceQuery(ksp, ss, ss, ss); - sliceQuery.setColumnFamily("ProteinLog").setKey(ip).setRange("", "", false, 100); - QueryResult> result = sliceQuery.execute(); - if (result.get().getColumns().size() > 0) - return true; - else - return false; - } - - public void InsertData(long dataWork, String dataBegin, String dataEnd, String ip, String id, String statusEx, String statusFinal, String protein, String jnetpred) { - mutatorLog.addInsertion(id, "ProteinLog", HFactory.createColumn("ip", ip, ss, ss)) - .addInsertion(id, "ProteinLog", HFactory.createColumn("DataBegin", dataBegin, ss, ss)) - .addInsertion(id, "ProteinLog", HFactory.createColumn("DataEnd", dataEnd, ss, ss)) - .addInsertion(id, "ProteinLog", HFactory.createColumn("Status ex", statusEx, ss, ss)) - .addInsertion(id, "ProteinLog", HFactory.createColumn("Status final", statusFinal, ss, ss)) - .addInsertion(id, "ProteinLog", HFactory.createColumn("Protein", protein, ss, ss)); - mutatorString.addInsertion(protein, "ProteinRow", HFactory.createColumn(id, jnetpred, ss, ss)); - mutatorLong.addInsertion(dataWork, "ProteinData", HFactory.createColumn(id, protein, ss, ss)); - } - - public Keyspace GetKeyspace() { - return ksp; - } -} diff --git a/webservices/compbio/nosql/src/combio/cassandra/DataBase.java b/webservices/compbio/nosql/src/combio/cassandra/DataBase.java deleted file mode 100644 index 036a48d..0000000 --- a/webservices/compbio/nosql/src/combio/cassandra/DataBase.java +++ /dev/null @@ -1,76 +0,0 @@ -package combio.cassandra; - -import java.util.List; - -public class DataBase { - String date; - int total; - String id; - String prot; - String jpred; - List subProt; - List timeRez; - - - public DataBase() {} - - public DataBase(String dat, int total) { - this.date = dat; - this.total = total; - } - - public void setDate(String dat) { - this.date = dat; - } - - public String getDate() { - return date; - } - - public void setTotal(int tot) { - this.total = tot; - } - public int getTotal() { - return total; - } - - public void setProt(String prot) { - this.prot = prot; - } - - public String getProt() { - return prot; - } - - public void setJpred(String jpred) { - this.jpred = jpred; - } - - public String getJpred() { - return jpred; - } - - public void setId(String id) { - this.id = id; - } - - public String getId() { - return id; - } - - public void setSubProt(List subProt) { - this.subProt = subProt; - } - - public List getSubProt() { - return subProt; - } - - public void setTimeRez(List timeRez) { - this.timeRez = timeRez; - } - - public List getTimeRez() { - return timeRez; - } -} diff --git a/webservices/compbio/nosql/src/combio/cassandra/DataParsing.java b/webservices/compbio/nosql/src/combio/cassandra/DataParsing.java deleted file mode 100644 index 1a03ce4..0000000 --- a/webservices/compbio/nosql/src/combio/cassandra/DataParsing.java +++ /dev/null @@ -1,98 +0,0 @@ -package combio.cassandra; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; - -public class DataParsing { - private CassandraCreate cc = new CassandraCreate(); - - public void ParsingTest(String input) { - System.out.println("Inserting....."); - URL url, urltable; -// int count = 0; -// int countNotM = 0; -// int countEr = 0; -// int countEmp = 0; - Calendar cal = Calendar.getInstance(); - String date = cal.get(Calendar.YEAR) + "/" + cal.get(Calendar.MONTH) + "/" + cal.get(Calendar.DAY_OF_MONTH); - try { - url = new URL(input); - URLConnection conn = url.openConnection(); - BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream())); - String line; - - while ((line = br.readLine()) != null) { - if (line.matches(date + "(.*)jp_[^\\s]+")) { - String[] table; - table = line.split("\\s+"); - // count++; - if (!cc.CheckIP(table[table.length - 1])) { - // countNotM++; - urltable = new URL("http://www.compbio.dundee.ac.uk/www-jpred/results/" +table[table.length - 1]+"/"+table[table.length - 1]+".concise.fasta"); - HttpURLConnection httpConnection = (HttpURLConnection) urltable.openConnection(); - if (httpConnection.getResponseCode() > 200) { -// countEr++; - continue; - } - try { - BufferedReader br1 = new BufferedReader(new InputStreamReader(httpConnection.getInputStream())); - String lineNext; - String newProt = ""; - String jnetpred = ""; - while ((lineNext = br1.readLine()) != null) { - if (lineNext.equals(">QUERY")) { - while (!(lineNext = br1.readLine()).matches(">[^\\s]+")) - newProt += lineNext; - } else if (lineNext.equals(">jnetpred")) { - while (!(lineNext = br1.readLine()).matches(">[^\\s]+")) - jnetpred += lineNext; - } - } - br1.close(); - if (newProt.length() <= 1) { - // countEmp++; - continue; - } - - 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(); - } - cc.InsertData(dateWork1, table[0], table[1], table[2], table[table.length - 1], "OK", "OK", newProt, jnetpred); - } catch (IOException e) { - // e.printStackTrace(); - } - // } - } - } - } - br.close(); -// System.out.println("Match " + count); -// System.out.println("Not Match " + countNotM); -// System.out.println("Error " + countEr); -// System.out.println("No protein " + countEmp); - } catch (MalformedURLException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } -} diff --git a/webservices/compbio/nosql/src/combio/listeners/ContextListener.java b/webservices/compbio/nosql/src/combio/listeners/ContextListener.java deleted file mode 100644 index 1b57283..0000000 --- a/webservices/compbio/nosql/src/combio/listeners/ContextListener.java +++ /dev/null @@ -1,48 +0,0 @@ -package combio.listeners; - -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; - -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; -import javax.servlet.annotation.WebListener; - -import combio.cassandra.CassandraCreate; - -/** - * Application Lifecycle Listener implementation class ContextListener - * - */ -@WebListener -public class ContextListener implements ServletContextListener { - private ScheduledExecutorService scheduler; - CassandraCreate cc = new CassandraCreate(); - /** - * @see ServletContextListener#contextInitialized(ServletContextEvent) - */ - public void contextInitialized(ServletContextEvent arg0) { - System.out.println("Session start ..........................................."); - cc.Connection(); - - - scheduler = Executors.newSingleThreadScheduledExecutor(); - scheduler.scheduleAtFixedRate(new Runnable() { - @Override - public void run() { cc.Parsing();}} - , 0, 30, TimeUnit.SECONDS); - } - - /** - * @see ServletContextListener#contextDestroyed(ServletContextEvent) - */ - public void contextDestroyed(ServletContextEvent arg0) { - cc.Closing(); - System.out.println("Shut down"); - scheduler.shutdownNow(); - } - - - - -} diff --git a/webservices/compbio/nosql/src/combio/listeners/DetailList.java b/webservices/compbio/nosql/src/combio/listeners/DetailList.java deleted file mode 100644 index 7d679f1..0000000 --- a/webservices/compbio/nosql/src/combio/listeners/DetailList.java +++ /dev/null @@ -1,45 +0,0 @@ -package combio.listeners; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import combio.cassandra.*; -import combio.statistic.StatisticsProt; - -/** - * Servlet implementation class DetailList - */ -@WebServlet("/DetailList") -public class DetailList extends HttpServlet { - private static final long serialVersionUID = 1L; - - /** - * @see HttpServlet#HttpServlet() - */ - - /** - * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) - */ - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - List result; - String date1 = request.getParameter("data1"); - String date2 = request.getParameter("data2"); - StatisticsProt sp = new StatisticsProt(); -// result = sp.readDetail(date1, date2); - } - - /** - * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) - */ - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - // TODO Auto-generated method stub - } - -} diff --git a/webservices/compbio/nosql/src/combio/listeners/LengthServlet.java b/webservices/compbio/nosql/src/combio/listeners/LengthServlet.java deleted file mode 100644 index 6e4feee..0000000 --- a/webservices/compbio/nosql/src/combio/listeners/LengthServlet.java +++ /dev/null @@ -1,44 +0,0 @@ -package combio.listeners; - -import java.io.IOException; -import java.util.List; - -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import combio.cassandra.DataBase; -import combio.statistic.StatisticsProt; - -/** - * Servlet implementation class LengthServlet - */ -@WebServlet("/LengthServlet") -public class LengthServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - /** - * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) - */ - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - List result; - String date1 = request.getParameter("data1"); - String date2 = request.getParameter("data2"); - StatisticsProt sp = new StatisticsProt(); - result = sp.readLength(date1, date2); - request.setAttribute("data1", date1); - request.setAttribute("data2", date2); - request.setAttribute("result", result); - RequestDispatcher rd = request.getRequestDispatcher("/ReportLength.jsp"); - rd.forward(request, response); - } - - /** - * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) - */ - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - doGet(request, response); - } -} diff --git a/webservices/compbio/nosql/src/combio/listeners/ProtServlet.java b/webservices/compbio/nosql/src/combio/listeners/ProtServlet.java deleted file mode 100644 index 7bef70d..0000000 --- a/webservices/compbio/nosql/src/combio/listeners/ProtServlet.java +++ /dev/null @@ -1,49 +0,0 @@ -package combio.listeners; - -import java.io.IOException; -import java.util.List; - -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import combio.cassandra.DataBase; -import combio.statistic.StatisticsProt; - -/** - * Servlet implementation class ProtServlet - */ -@WebServlet("/ProtServlet") -public class ProtServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - /** - * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) - */ - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - List result; - String flag = request.getParameter("protein"); - String prot = request.getParameter("prot"); - StatisticsProt sp = new StatisticsProt(); - if (flag.equals("whole")) { - result = sp.readProt(prot); - } else { - result = sp.readPart(prot); - } - request.setAttribute("prot", prot); - request.setAttribute("flag", flag); - request.setAttribute("result", result); - RequestDispatcher rd = request.getRequestDispatcher("/ReportProt.jsp"); - rd.forward(request, response); - } - - /** - * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) - */ - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - doGet(request, response); - } - -} diff --git a/webservices/compbio/nosql/src/combio/listeners/QueryServlet.java b/webservices/compbio/nosql/src/combio/listeners/QueryServlet.java deleted file mode 100644 index e9ab299..0000000 --- a/webservices/compbio/nosql/src/combio/listeners/QueryServlet.java +++ /dev/null @@ -1,41 +0,0 @@ -package combio.listeners; - -import java.io.IOException; -import java.util.List; - -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import combio.cassandra.*; -import combio.statistic.StatisticsProt; - - -@WebServlet("/QueryServlet") -public class QueryServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - - /** - * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) - */ - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - List result; - String date1 = request.getParameter("data1"); - String date2 = request.getParameter("data2"); - StatisticsProt sp = new StatisticsProt(); - result = sp.readDetail(date1, date2); - request.setAttribute("data1", date1); - request.setAttribute("data2", date2); - request.setAttribute("result", result); - RequestDispatcher rd = request.getRequestDispatcher("/ReportNew.jsp"); - rd.forward(request, response); - } - - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - doGet(request, response); - } - -} diff --git a/webservices/compbio/nosql/src/combio/statistic/StatisticsProt.java b/webservices/compbio/nosql/src/combio/statistic/StatisticsProt.java deleted file mode 100644 index 72cad07..0000000 --- a/webservices/compbio/nosql/src/combio/statistic/StatisticsProt.java +++ /dev/null @@ -1,204 +0,0 @@ -package combio.statistic; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Date; -import java.util.Iterator; -import java.util.List; - -import me.prettyprint.cassandra.serializers.LongSerializer; -import me.prettyprint.cassandra.serializers.StringSerializer; -import me.prettyprint.hector.api.beans.ColumnSlice; -import me.prettyprint.hector.api.beans.HColumn; -import me.prettyprint.hector.api.beans.OrderedRows; -import me.prettyprint.hector.api.beans.Row; -import me.prettyprint.hector.api.factory.HFactory; -import me.prettyprint.hector.api.query.QueryResult; -import me.prettyprint.hector.api.query.RangeSlicesQuery; -import me.prettyprint.hector.api.query.SliceQuery; -import combio.cassandra.CassandraCreate; -import combio.cassandra.DataBase; - -public class StatisticsProt { - private final static long MILLISECONDS_PER_DAY = 1000L * 60 * 60 * 24; - private CassandraCreate cc = new CassandraCreate(); - private ArrayList query; - - // query for the period from date1 till date2 - public List readDetail(String dateInStringSt, String dateInStringEnd) { - long dateWorkSt = DateParsing(dateInStringSt); - long dateWorkEnd = DateParsing(dateInStringEnd); - query = new ArrayList(); - while (dateWorkSt <= dateWorkEnd) { - SliceQuery result = HFactory.createSliceQuery(cc.GetKeyspace(), LongSerializer.get(), StringSerializer.get(), StringSerializer.get()); - result.setColumnFamily("ProteinData"); - result.setKey(dateWorkSt); - result.setRange(null, null, false, Integer.MAX_VALUE); - QueryResult > columnSlice = result.execute(); - DataBase db = new DataBase(DateFormat(dateWorkSt), columnSlice.get().getColumns().size()); - query.add(db); - dateWorkSt += MILLISECONDS_PER_DAY ; - } - return query; - } - - // query jobs for the period from dateInStringSt till dateInStringEnd - public List readLength(String dateInStringSt, String dateInStringEnd) { - query = new ArrayList(); - long dateWorkSt = DateParsing(dateInStringSt); - long dateWorkEnd = DateParsing(dateInStringEnd); - while (dateWorkSt <= dateWorkEnd) { - List timeResult = new ArrayList(); - SliceQuery result = HFactory.createSliceQuery(cc.GetKeyspace(), LongSerializer.get(), StringSerializer.get(), StringSerializer.get()); - result.setColumnFamily("ProteinData"); - result.setKey(dateWorkSt); - result.setRange(null, null, false, Integer.MAX_VALUE); - QueryResult > columnSlice = result.execute(); - List> col = columnSlice.get().getColumns(); - Iterator> itCol = col.iterator(); - for (int i = 0; i < 4; i++) - timeResult.add(i, 0); - while (itCol.hasNext()) { - String id = itCol.next().getName(); - long lenResult = CountID(id); - if (lenResult <= 1) - timeResult.set(0, timeResult.get(0) + 1); - else if (lenResult > 1 && lenResult <= 10) - timeResult.set(1, timeResult.get(1) + 1); - else if (lenResult > 10 && lenResult <= 20) - timeResult.set(2, timeResult.get(2) + 1); - else - timeResult.set(3, timeResult.get(3) + 1); - } - DataBase db = new DataBase(); - db.setTimeRez(timeResult); - db.setDate(DateFormat(dateWorkSt)); - query.add(db); - List test = query.get(0).getTimeRez(); - dateWorkSt += MILLISECONDS_PER_DAY ; - } - return query; - } - - //query by a protein name - public List readProt(String protIn) { - query = new ArrayList(); - SliceQuery result = HFactory.createSliceQuery(cc.GetKeyspace(), StringSerializer.get(), StringSerializer.get(), StringSerializer.get()); - result.setColumnFamily("ProteinRow"); - result.setKey(protIn); - result.setRange(null, null, false, Integer.MAX_VALUE); - QueryResult > columnSlice = result.execute(); - Iterator > it = columnSlice.get().getColumns().iterator(); - while (it.hasNext()) { - HColumn col = it.next(); - DataBase db = new DataBase(); - db.setProt(protIn); - db.setId(col.getName()); - db.setJpred(col.getValue()); - query.add(db); - } - return query; - } - - - //query by a sequence (whether exists proteins contains this sequence in the name) - public List readPart(String protIn) { - int row_count = 10000; - query = new ArrayList(); - RangeSlicesQuery result = HFactory.createRangeSlicesQuery(cc.GetKeyspace(), StringSerializer.get(), StringSerializer.get(), StringSerializer.get()); - result.setColumnFamily("ProteinRow"); - result.setRange(null, null, false, Integer.MAX_VALUE); - result.setRowCount(row_count); - String last_key = null; - while (true) { - result.setKeys(last_key, null); - QueryResult > columnSlice = result.execute(); - OrderedRows rows = columnSlice.get(); - Iterator> rowsIterator = rows.iterator(); - while (rowsIterator.hasNext()) { - Row row = rowsIterator.next(); - last_key = row.getKey(); - if (last_key.matches("(.*)" + protIn + "(.*)")) { - Iterator > it = row.getColumnSlice().getColumns().iterator(); - while (it.hasNext()) { - HColumn col = it.next(); - List subProt = new ArrayList(); - String subStr = last_key; - while (subStr.length() > 0 && subStr.contains(protIn)) { - String first = subStr.substring(0, subStr.indexOf(protIn)); - if (first.length() > 0) - subProt.add(first); - subProt.add(protIn); - subStr = subStr.substring(subStr.indexOf(protIn) + protIn.length(), subStr.length()); - } - if (subStr.length() > 0) - subProt.add(subStr); - DataBase db = new DataBase(); - db.setProt(last_key); - db.setId(col.getName()); - db.setJpred(col.getValue()); - db.setSubProt(subProt); - query.add(db); - } - } - } - if (rows.getCount() < row_count) - break; - } - return query; - } - - // convert String to Date - private static long DateParsing(String datInput) { - long dateWorkSt = 0; - SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd"); - try { - dateWorkSt = formatter.parse(datInput).getTime(); - } catch (ParseException e) { - e.printStackTrace(); - } - return dateWorkSt; - } - - // convert String to Date - private static long TimeConvert(String datInput) { - long dateWorkSt = 0; - SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd:hh:mm:ss"); - try { - dateWorkSt = formatter.parse(datInput).getTime(); - } catch (ParseException e) { - e.printStackTrace(); - } - // System.out.println("start reverce" + DateFormat1(dateWorkSt)); - return dateWorkSt; - } - - // convert long to date in string format - private static String DateFormat(long inDate){ - SimpleDateFormat datformat = new SimpleDateFormat("dd/MM/yyyy"); - String dateString = datformat.format(new Date(inDate)); - return dateString; - } - - private static String DateFormat1(long inDate){ - SimpleDateFormat datformat = new SimpleDateFormat("dd/MM/yyyy:hh:mm:ss"); - String dateString = datformat.format(new Date(inDate)); - return dateString; - } - - public long CountID(String id) { - SliceQuery sliceQuery = HFactory.createSliceQuery(cc.GetKeyspace(), StringSerializer.get(), StringSerializer.get(), StringSerializer.get()); - sliceQuery.setColumnFamily("ProteinLog").setKey(id).setRange("", "", false, 100); - QueryResult> result = sliceQuery.execute(); - String datBegin = result.get().getColumnByName("DataBegin").getValue(); - String datEnd = result.get().getColumnByName("DataEnd").getValue(); - long datBeginLong = TimeConvert(datBegin); - long datEndLong = TimeConvert(datEnd); - return datEndLong-datBeginLong; - - } - -}