public abstract class CatalogQueryAgent
extends java.lang.Object
CatalogQueryAgent
is an abstract class for
performing queries of earth data catalogs. The catalog may be
queried using temporal and spatial criteria.Modifier and Type | Class and Description |
---|---|
static class |
CatalogQueryAgent.Entry
The
Entry class holds information about one
catalog entry. |
Modifier and Type | Field and Description |
---|---|
protected int |
coverage
The coverage as a percentage.
|
protected java.util.Date |
endDate
The ending date.
|
protected static long |
MSEC_PER_DAY
The number of milliseconds per day.
|
protected java.lang.String |
region
The coverage region.
|
protected boolean |
searchByCoverage
The search by coverage flag.
|
protected boolean |
searchByTime
The search by time flag.
|
protected java.util.Date |
startDate
The starting date.
|
protected java.net.URL |
url
The catalog query URL.
|
Modifier | Constructor and Description |
---|---|
protected |
CatalogQueryAgent(java.net.URL url)
Creates a new catalog agent that uses the specified URL for
performing queries.
|
Modifier and Type | Method and Description |
---|---|
java.util.List |
getAllEntries()
Gets all entries in the catalog by turning off time and
coverage searching, and then calling
getEntries() . |
abstract java.util.List |
getEntries()
Gets the catalog data entries whose temporal and spatial
properties match those currently set in the query agent.
|
void |
setCoverageByRegion(java.lang.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(java.util.Date startDate,
java.util.Date endDate)
Sets the query time constraints by start and end date.
|
protected static final long MSEC_PER_DAY
protected java.net.URL url
protected boolean searchByTime
protected java.util.Date startDate
protected java.util.Date endDate
protected boolean searchByCoverage
protected java.lang.String region
protected int coverage
protected CatalogQueryAgent(java.net.URL url)
setSearchByTime(boolean)
or setSearchByCoverage(boolean)
.url
- the query url.public void setSearchByTime(boolean searchByTime)
searchByTime
- the time flag, true to search by time, or
false otherwise.setTimeByDate(java.util.Date, java.util.Date)
,
setTimeByAge(double)
public void setSearchByCoverage(boolean searchByCoverage)
searchByCoverage
- the coverage flag, true to search by
coverage, or false otherwise.setCoverageByRegion(java.lang.String, int)
public void setTimeByDate(java.util.Date startDate, java.util.Date endDate)
startDate
- the starting data date.endDate
- the ending data date.public void setTimeByAge(double days)
days
- the data age in days.public void setCoverageByRegion(java.lang.String region, int coverage)
region
- the coverage region code.coverage
- the coverage as a percent.public java.util.List getAllEntries() throws java.io.IOException
getEntries()
.
This is simply a convenience method for getting a complete
catalog dump.java.io.IOException
- if an error occurred performing the
query.public abstract java.util.List getEntries() throws java.io.IOException
Entry
objects.java.io.IOException
- if an error occurred performing the
query.