org.gcube.data.spd.obisplugin
Class ObisClient

java.lang.Object
  extended by org.gcube.data.spd.obisplugin.ObisClient

public class ObisClient
extends Object

Author:
"Federico De Faveri defaveri@isti.cnr.it"

Field Summary
protected static SimpleDateFormat DATE_FORMAT
           
static String KEY_SEPARATOR
           
protected static org.gcube.common.core.utils.logging.GCUBELog logger
           
protected static String SCHEMA
           
 
Constructor Summary
ObisClient()
           
 
Method Summary
protected static void fillCommonNames(SearchSession session, int taxonNameId, org.gcube.data.spd.stubs.model.ResultItem item)
           
protected static int fillDatasetInformation(ResultSet rs, org.gcube.data.spd.stubs.model.ResultItem item)
           
protected static void fillProducts(Connection connection, int speciesId, int datasetId, SearchFilters filters, org.gcube.data.spd.stubs.model.ResultItem item)
           
protected static void fillTaxon(SearchSession session, int id, org.gcube.data.spd.stubs.model.Taxon taxon)
          Fills the node with the taxon information.
protected static void generateRecords(SearchSession session, ResultSet rs, SearchFilters filters, Writer<org.gcube.data.spd.stubs.model.ResultItem> writer)
           
static org.gcube.data.spd.stubs.model.BasisOfRecord getBasisOfRecord(String basis)
           
static Set<String> getEnglishCommonNames(Connection connection, String scientificName)
           
static org.gcube.data.trees.data.Tree getOccurencesAsTree(Connection connection, int taxonId)
           
static List<Occurrence> getOccurrences(Connection connection, int taxonId)
           
static void getOccurrences(Connection connection, String key, Writer<org.gcube.data.spd.stubs.model.Occurrence> writer)
           
static int getOccurrencesCount(Connection connection, int taxonId, int datasetId, Coordinate upperBound, Coordinate lowerBound, Calendar fromDate, Calendar toDate)
           
static Set<String> getScientificNames(Connection connection, String commonName)
           
static void main(String[] args)
           
protected static void print(Connection connection, int id)
           
static void searchByCommonName(SearchSession session, String searchTerm, SearchFilters filters, Writer<org.gcube.data.spd.stubs.model.ResultItem> writer)
           
static void searchByScientificName(SearchSession session, String searchTerm, SearchFilters filters, Writer<org.gcube.data.spd.stubs.model.ResultItem> writer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_SEPARATOR

public static final String KEY_SEPARATOR
See Also:
Constant Field Values

logger

protected static org.gcube.common.core.utils.logging.GCUBELog logger

SCHEMA

protected static final String SCHEMA
See Also:
Constant Field Values

DATE_FORMAT

protected static final SimpleDateFormat DATE_FORMAT
Constructor Detail

ObisClient

public ObisClient()
Method Detail

getOccurrences

public static List<Occurrence> getOccurrences(Connection connection,
                                              int taxonId)
                                       throws SQLException
Throws:
SQLException

getOccurrencesCount

public static int getOccurrencesCount(Connection connection,
                                      int taxonId,
                                      int datasetId,
                                      Coordinate upperBound,
                                      Coordinate lowerBound,
                                      Calendar fromDate,
                                      Calendar toDate)
                               throws SQLException
Throws:
SQLException

getOccurrences

public static void getOccurrences(Connection connection,
                                  String key,
                                  Writer<org.gcube.data.spd.stubs.model.Occurrence> writer)
                           throws Exception
Throws:
Exception

getBasisOfRecord

public static org.gcube.data.spd.stubs.model.BasisOfRecord getBasisOfRecord(String basis)

getOccurencesAsTree

public static org.gcube.data.trees.data.Tree getOccurencesAsTree(Connection connection,
                                                                 int taxonId)
                                                          throws SQLException
Throws:
SQLException

searchByCommonName

public static void searchByCommonName(SearchSession session,
                                      String searchTerm,
                                      SearchFilters filters,
                                      Writer<org.gcube.data.spd.stubs.model.ResultItem> writer)
                               throws Exception
Throws:
Exception

fillProducts

protected static void fillProducts(Connection connection,
                                   int speciesId,
                                   int datasetId,
                                   SearchFilters filters,
                                   org.gcube.data.spd.stubs.model.ResultItem item)
                            throws SQLException
Throws:
SQLException

searchByScientificName

public static void searchByScientificName(SearchSession session,
                                          String searchTerm,
                                          SearchFilters filters,
                                          Writer<org.gcube.data.spd.stubs.model.ResultItem> writer)
                                   throws Exception
Throws:
Exception

generateRecords

protected static void generateRecords(SearchSession session,
                                      ResultSet rs,
                                      SearchFilters filters,
                                      Writer<org.gcube.data.spd.stubs.model.ResultItem> writer)
                               throws Exception
Throws:
Exception

fillTaxon

protected static void fillTaxon(SearchSession session,
                                int id,
                                org.gcube.data.spd.stubs.model.Taxon taxon)
                         throws SQLException
Fills the node with the taxon information. Also information about parent are retrieved.

Parameters:
connection - the db connection.
id - the taxon id.
taxonNode - the node to fill.
Throws:
SQLException

fillCommonNames

protected static void fillCommonNames(SearchSession session,
                                      int taxonNameId,
                                      org.gcube.data.spd.stubs.model.ResultItem item)
                               throws SQLException
Throws:
SQLException

fillDatasetInformation

protected static int fillDatasetInformation(ResultSet rs,
                                            org.gcube.data.spd.stubs.model.ResultItem item)
                                     throws SQLException
Throws:
SQLException

getEnglishCommonNames

public static Set<String> getEnglishCommonNames(Connection connection,
                                                String scientificName)
                                         throws SQLException
Throws:
SQLException

getScientificNames

public static Set<String> getScientificNames(Connection connection,
                                             String commonName)
                                      throws SQLException
Throws:
SQLException

print

protected static void print(Connection connection,
                            int id)
                     throws SQLException
Throws:
SQLException

main

public static void main(String[] args)
                 throws Exception
Parameters:
args -
Throws:
Exception


Copyright © 2012. All Rights Reserved.