edu.nrao.sss.model.source
Interface SourceProvider

All Known Implementing Classes:
SourceCatalog, SourceGroup

public interface SourceProvider

A provider of astronomical sources.

CVS Info:

$Revision: 2313 $
$Date: 2009-05-20 15:00:52 -0600 (Wed, 20 May 2009) $
$Author: btruitt $

Since:
2006-08-03
Author:
David M. Harland

Method Summary
 Source findSourceById(long id)
          Returns the Source with the given id, if any.
 List<Source> findSourceByName(String name)
          Returns the Source(s) with the given name, if any.
 SourceLookupTable findSourceTableById(long id)
          Returns the SourceLookupTable with the given id, if any.
 List<SourceLookupTable> findSourceTableByName(String name)
          Returns the SourceLookupTable(s) with the given name, if any.
 List<Source> getSources()
          Returns a list of all sources held by this provider.
 List<Source> getSources(Filter<Source> filter)
          Returns a list of sources held this provider that can pass through filter.
 List<SourceLookupTable> getSourceTables()
          Returns a list of all source lookup tables held by this provider.
 

Method Detail

findSourceById

Source findSourceById(long id)
                      throws RepositoryException
Returns the Source with the given id, if any.

If this provider holds no Source with an ID of id, null is returned.

Parameters:
id - the identifier (primary key) for a Source in this repository.
Returns:
The Source with the given id, or null, if this provider holds no such Source.
Throws:
RepositoryException - if anything goes wrong while trying to fetch sources from this provider.

findSourceByName

List<Source> findSourceByName(String name)
                              throws RepositoryException
Returns the Source(s) with the given name, if any.

Ideally, the returned list will contain only one source. However, since the name is not usually used as a primary key to a source, it is possible that the returned list may contain more than one source. If this provider holds no Source with a name of name, the returned list will be empty.

Parameters:
name - the name of a Source requested from this provider.
Returns:
The Sources with the given name, or null, if this provider holds no such Source.
Throws:
RepositoryException - if anything goes wrong while trying to fetch sources from this provider.

getSources

List<Source> getSources(Filter<Source> filter)
                        throws RepositoryException
Returns a list of sources held this provider that can pass through filter. If filter is null, it will be treated as a wide-open filter, allowing all sources to pass.

Parameters:
filter - the filter through which a source must pass in order to be included in the returned set.
Returns:
a list of sources that can pass through filter.
Throws:
RepositoryException - if anything goes wrong while trying to fetch sources from this provider.

getSources

List<Source> getSources()
                        throws RepositoryException
Returns a list of all sources held by this provider.

Returns:
a list of all sources held by this provider. If the provider has no sources the returned list will be empty.
Throws:
RepositoryException - if anything goes wrong while trying to fetch sources from this provider.

findSourceTableById

SourceLookupTable findSourceTableById(long id)
                                      throws RepositoryException
Returns the SourceLookupTable with the given id, if any.

If this provider holds no SourceLookupTable with an ID of id, null is returned.

Parameters:
id - the identifier (primary key) for a SourceLookupTable in this repository.
Returns:
The SourceLookupTable with the given id, or null, if this provider holds no such SourceLookupTable.
Throws:
RepositoryException - if anything goes wrong while trying to fetch source tables from this provider.

findSourceTableByName

List<SourceLookupTable> findSourceTableByName(String name)
                                              throws RepositoryException
Returns the SourceLookupTable(s) with the given name, if any.

Ideally, the returned list will contain only one table. However, since the name is not usually used as a primary key to a table, it is possible that the returned list may contain more than one table. If this provider holds no SourceLookupTable with a name of name, the returned list will be empty.

Parameters:
name - the name of a SourceLookupTable requested from this provider.
Returns:
The SourceLookupTables with the given name, or null, if this provider holds no such table.
Throws:
RepositoryException - if anything goes wrong while trying to fetch tables from this provider.

getSourceTables

List<SourceLookupTable> getSourceTables()
                                        throws RepositoryException
Returns a list of all source lookup tables held by this provider.

Returns:
a list of all tables held by this provider. If the provider has no tables the returned list will be empty.
Throws:
RepositoryException - if anything goes wrong while trying to fetch tables from this provider.


Copyright © 2009. All Rights Reserved.