gov.usda.gdpc
Class AbstractDBGateway

java.lang.Object
  extended bygov.usda.gdpc.AbstractDBGateway
All Implemented Interfaces:
DBGateway
Direct Known Subclasses:
DefaultDBGateway

public abstract class AbstractDBGateway
extends java.lang.Object
implements DBGateway

This class provides a skeletal implementation of the DBGateway interface to minimize the effort required to implement this interface.

Author:
terryc

Constructor Summary
AbstractDBGateway()
          AbstractDBGateway constructor.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDBGateway

public AbstractDBGateway()
AbstractDBGateway constructor.

Method Detail

getEnvironmentExperimentGroup

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

Specified by:
getEnvironmentExperimentGroup in interface DBGateway
Parameters:
filter - filter containing criteria.
Returns:
the environment experiment group

getGenotypeExperimentGroup

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

Specified by:
getGenotypeExperimentGroup in interface DBGateway
Parameters:
filter - filter containing criteria.
Returns:
the genotype experiment 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.

Specified by:
getGenotypeGroup in interface DBGateway
Parameters:
experimentGroup - genotype experiment group
taxonGroup - taxon group
Returns:
genotype group

getLocusGroup

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

Specified by:
getLocusGroup in interface DBGateway
Parameters:
filter - filter containing criteria to build locus group.
Returns:
the locus group

getLocalityGroup

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

Specified by:
getLocalityGroup in interface DBGateway
Parameters:
filter - filter containing criteria.
Returns:
the locality group

getPhenotypeOntologyGroup

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

Specified by:
getPhenotypeOntologyGroup in interface DBGateway
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.

Specified by:
getPhenotypeGroup in interface DBGateway
Parameters:
experimentGroup - environment experiment group
taxonGroup - taxon group
ontologyGroup - phenotype ontology group
Returns:
phenotype group

getTaxonGroup

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

Specified by:
getTaxonGroup in interface DBGateway
Parameters:
filter - filter containing criteria.
Returns:
the taxon 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.

Specified by:
getDistinctProperties in interface DBGateway
Parameters:
properties - list of properties
Returns:
list(s) of distinct property values

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.

Specified by:
addDBConnection in interface DBGateway
Parameters:
connection - connection to add
Returns:
true if added successfully

removeDBConnection

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

Specified by:
removeDBConnection in interface DBGateway
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.

Specified by:
getDBConnections in interface DBGateway
Returns:
list of database connections

getNumConnections

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

Specified by:
getNumConnections in interface DBGateway
Returns:
number of connections