Merge branch 'DAO' of https://source.jalview.org/git/proteocache into DAO
[proteocache.git] / datadb / compbio / cassandra / readers / CassandraReader.java
index 01dc122..f970659 100644 (file)
@@ -6,6 +6,7 @@ import com.datastax.driver.core.ResultSet;
 import com.datastax.driver.core.Session;
 import com.datastax.driver.core.exceptions.QueryExecutionException;
 import com.datastax.driver.core.exceptions.QueryValidationException;
+
 import compbio.cassandra.CassandraNativeConnector;
 
 public class CassandraReader {
@@ -50,5 +51,23 @@ public class CassandraReader {
                earlestDate = CassandraNativeConnector.getEarliestDateInDB();
                return earlestDate;
        }
+       
+       /**
+        * prepares an example of either job id or IP for the DB
+        * 
+        * @param exampletype
+        *            defines which example you need (an existing job from the DB -
+        *            jobid, an IP - "ip")
+        * @return a string representation of the requested example, if the example
+        *         type is not known empty string is returned
+        */
+       public String getExample(String exampletype) {
+               if (exampletype.equals("jobid")) {
+                       return "jp_NzBOJKo";
+               } else if (exampletype.equals("ip")) {
+                       return "127.0.0.1";
+               }
+               return "";
+       }
 
 }