Package noaa.coastwatch.net
Class CatalogQueryAgent
java.lang.Object
noaa.coastwatch.net.CatalogQueryAgent
- Direct Known Subclasses:
OpendapQueryAgent
A
CatalogQueryAgent
is an abstract class for
performing queries of earth data catalogs. The catalog may be
queried using temporal and spatial criteria.- Since:
- 3.2.1
- Author:
- Peter Hollemans
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
TheEntry
class holds information about one catalog entry. -
Field Summary
Modifier and TypeFieldDescriptionprotected int
The coverage as a percentage.protected Date
The ending date.protected static final long
The number of milliseconds per day.protected String
The coverage region.protected boolean
The search by coverage flag.protected boolean
The search by time flag.protected Date
The starting date.protected URL
The catalog query URL. -
Constructor Summary
ModifierConstructorDescriptionprotected
CatalogQueryAgent
(URL url) Creates a new catalog agent that uses the specified URL for performing queries. -
Method Summary
Modifier and TypeMethodDescriptionGets all entries in the catalog by turning off time and coverage searching, and then callinggetEntries()
.abstract List
Gets the catalog data entries whose temporal and spatial properties match those currently set in the query agent.void
setCoverageByRegion
(String region, int coverage) Sets the spatial coverage constraints using a predefined region code.void
setSearchByCoverage
(boolean searchByCoverage) Sets the coverage search flag.void
setSearchByTime
(boolean searchByTime) Sets the time search flag.void
setTimeByAge
(double days) Sets the query time constraints by data age.void
setTimeByDate
(Date startDate, Date endDate) Sets the query time constraints by start and end date.
-
Field Details
-
MSEC_PER_DAY
protected static final long MSEC_PER_DAYThe number of milliseconds per day.- See Also:
-
url
The catalog query URL. -
searchByTime
protected boolean searchByTimeThe search by time flag. -
startDate
The starting date. -
endDate
The ending date. -
searchByCoverage
protected boolean searchByCoverageThe search by coverage flag. -
region
The coverage region. -
coverage
protected int coverageThe coverage as a percentage.
-
-
Constructor Details
-
CatalogQueryAgent
Creates a new catalog agent that uses the specified URL for performing queries. By default, time and coverage searching are enabled unless disabled usingsetSearchByTime(boolean)
orsetSearchByCoverage(boolean)
.- Parameters:
url
- the query url.
-
-
Method Details
-
setSearchByTime
public void setSearchByTime(boolean searchByTime) Sets the time search flag.- Parameters:
searchByTime
- the time flag, true to search by time, or false otherwise.- See Also:
-
setSearchByCoverage
public void setSearchByCoverage(boolean searchByCoverage) Sets the coverage search flag.- Parameters:
searchByCoverage
- the coverage flag, true to search by coverage, or false otherwise.- See Also:
-
setTimeByDate
Sets the query time constraints by start and end date. The query will return data whose starting date falls in the specified range.- Parameters:
startDate
- the starting data date.endDate
- the ending data date.
-
setTimeByAge
public void setTimeByAge(double days) Sets the query time constraints by data age. The query will return data whose starting date falls during the past specified number of days.- Parameters:
days
- the data age in days.
-
setCoverageByRegion
Sets the spatial coverage constraints using a predefined region code. The query will return data with at least the specified coverage in the region.- Parameters:
region
- the coverage region code.coverage
- the coverage as a percent.
-
getAllEntries
Gets all entries in the catalog by turning off time and coverage searching, and then callinggetEntries()
. This is simply a convenience method for getting a complete catalog dump.- Returns:
- all the entries in the catalog as a list.
- Throws:
IOException
- if an error occurred performing the query.
-
getEntries
Gets the catalog data entries whose temporal and spatial properties match those currently set in the query agent.- Returns:
- the list of catalog
Entry
objects. - Throws:
IOException
- if an error occurred performing the query.
-