gov.usda.gdpc
Interface DBGateway

All Known Implementing Classes:
AbstractDBGateway

public interface DBGateway

The single point of access to retrieve data from the database(s).

Author:
terryc

Method Summary
 boolean addDBConnection(DBConnection connection)
          Adds a database connection to this gateway.
 DBConnection[] getDBConnections()
          Returns the list of database connections that this gateway is managing.
 DistinctPropertyValues getDistinctProperties(Property[] properties)
          Returns list(s) of distinct property values for the given properties.
 EnvironmentExperimentGroup getEnvironmentExperimentGroup(EnvironmentExperimentFilter filter)
          Gets an environment experiment group based on the given environment experiment filter.
 GenotypeExperimentGroup getGenotypeExperimentGroup(GenotypeExperimentFilter filter)
          Gets a genotype experiment group based on the given genotype experiment filter.
 GenotypeGroup getGenotypeGroup(GenotypeExperimentGroup experimentGroup, TaxonGroup taxonGroup)
          Gets the genotypes for all combinations of genotype experiments and taxa defined by the respective groups.
 LocalityGroup getLocalityGroup(LocalityFilter filter)
          Gets a locality group based on the given locality filter.
 LocusGroup getLocusGroup(LocusFilter filter)
          Gets a locus group based on the given locus filter.
 int getNumConnections()
          Returns the number of connections managed by this gateway.
 PhenotypeGroup getPhenotypeGroup(EnvironmentExperimentGroup experimentGroup, TaxonGroup taxonGroup, PhenotypeOntologyGroup ontologyGroup)
          Gets the phenotypes for all combinations of environment experiments, taxa, and phenotype ontologys defined by the respective groups.
 PhenotypeOntologyGroup getPhenotypeOntologyGroup(PhenotypeOntologyFilter filter)
          Get a phenotype ontology group based on the given pheotype ontology filter.
 TaxonGroup getTaxonGroup(TaxonFilter filter)
          Gets a taxon group based on the given taxon filter.
 boolean removeDBConnection(DBConnection connection)
          Removes the specified database connection from this gateway.
 

Method Detail

addDBConnection

public boolean addDBConnection(DBConnection connection)
Adds a database connection to this gateway. Any connection added via this method will be queried by the gateway when users request data.

Parameters:
connection - connection to add
Returns:
true if added successfully

removeDBConnection

public boolean removeDBConnection(DBConnection connection)
Removes the specified database connection from this gateway.

Parameters:
connection - connection to remove
Returns:
true if removed successfully.

getDBConnections

public DBConnection[] getDBConnections()
Returns the list of database connections that this gateway is managing.

Returns:
list of database connections

getNumConnections

public int getNumConnections()
Returns the number of connections managed by this gateway.

Returns:
number of connections

getLocusGroup

public LocusGroup getLocusGroup(LocusFilter filter)
Gets a locus group based on the given locus filter.

Parameters:
filter - filter containing criteria to build locus group.
Returns:
the locus group

getGenotypeExperimentGroup

public GenotypeExperimentGroup getGenotypeExperimentGroup(GenotypeExperimentFilter filter)
Gets a genotype experiment group based on the given genotype experiment filter.

Parameters:
filter - filter containing criteria.
Returns:
the genotype experiment group

getTaxonGroup

public TaxonGroup getTaxonGroup(TaxonFilter filter)
Gets a taxon group based on the given taxon filter.

Parameters:
filter - filter containing criteria.
Returns:
the taxon group

getPhenotypeOntologyGroup

public PhenotypeOntologyGroup getPhenotypeOntologyGroup(PhenotypeOntologyFilter filter)
Get a phenotype ontology group based on the given pheotype ontology filter.

Parameters:
filter - phenotype ontology filter
Returns:
phenotype ontology group

getPhenotypeGroup

public PhenotypeGroup getPhenotypeGroup(EnvironmentExperimentGroup experimentGroup,
                                        TaxonGroup taxonGroup,
                                        PhenotypeOntologyGroup ontologyGroup)
Gets the phenotypes for all combinations of environment experiments, taxa, and phenotype ontologys defined by the respective groups.

Parameters:
experimentGroup - environment experiment group
taxonGroup - taxon group
ontologyGroup - phenotype ontology group
Returns:
phenotype group

getEnvironmentExperimentGroup

public EnvironmentExperimentGroup getEnvironmentExperimentGroup(EnvironmentExperimentFilter filter)
Gets an environment experiment group based on the given environment experiment filter.

Parameters:
filter - filter containing criteria.
Returns:
the environment experiment group

getLocalityGroup

public LocalityGroup getLocalityGroup(LocalityFilter filter)
Gets a locality group based on the given locality filter.

Parameters:
filter - filter containing criteria.
Returns:
the locality group

getGenotypeGroup

public GenotypeGroup getGenotypeGroup(GenotypeExperimentGroup experimentGroup,
                                      TaxonGroup taxonGroup)
Gets the genotypes for all combinations of genotype experiments and taxa defined by the respective groups.

Parameters:
experimentGroup - genotype experiment group
taxonGroup - taxon group
Returns:
genotype group

getDistinctProperties

public DistinctPropertyValues getDistinctProperties(Property[] properties)
Returns list(s) of distinct property values for the given properties. The list(s) are values retrieved from all the database connections managed by this gateway. If null returned, none of the managed connections supported the properties or the values could not be retrieved.

Parameters:
properties - list of properties
Returns:
list(s) of distinct property values