Package thredds.catalog
Class InvCatalog
- java.lang.Object
-
- thredds.catalog.InvCatalog
-
- Direct Known Subclasses:
InvCatalogImpl
public abstract class InvCatalog extends Object
Public interface to a thredds catalog, a virtual directory of datasets. A catalog consists of nested collections of InvDatasets.
-
-
Field Summary
Fields Modifier and Type Field Description protected URIbaseURIprotected List<InvDataset>datasetsprotected Map<String,InvDataset>dsHashprotected ucar.nc2.units.DateTypeexpiresprotected Stringnameprotected List<InvProperty>propertiesprotected Map<String,InvService>serviceHashprotected List<InvService>servicesprotected InvDatasetImpltopDatasetprotected Stringversion
-
Constructor Summary
Constructors Modifier Constructor Description protectedInvCatalog()Protected constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancheck(StringBuilder out)Check internal data structures.abstract booleancheck(StringBuilder out, boolean show)Check internal data structures.abstract voidfilter(DatasetFilter filter)Munge this catalog to remove any dataset that doesnt pass through the filter.InvDatasetfindDatasetByID(String id)Find a contained dataset by its ID.StringfindProperty(String name)Find named property.InvServicefindService(String name)Find the named service declared in the top level of this catalog.InvDatasetImplgetDataset()Deprecated.use getDatasets()List<InvDataset>getDatasets()Get top-level datasets.ucar.nc2.units.DateTypegetExpires()Get date catalog expires, or null if none given.StringgetName()Get the name of the catalogList<InvProperty>getProperties()Get catalog properties.List<InvService>getServices()Get top-level services.StringgetUriString()Get the base URI as a StringStringgetVersion()Get the version of the catalogURIresolveUri(String uriString)Resolve reletive URIs, using the catalog's base URI.abstract voidsubset(InvDataset dataset)Munge this catalog so the given dataset is the top catalog.
-
-
-
Field Detail
-
name
protected String name
-
version
protected String version
-
baseURI
protected URI baseURI
-
topDataset
protected InvDatasetImpl topDataset
-
dsHash
protected Map<String,InvDataset> dsHash
-
serviceHash
protected Map<String,InvService> serviceHash
-
services
protected List<InvService> services
-
properties
protected List<InvProperty> properties
-
datasets
protected List<InvDataset> datasets
-
expires
protected ucar.nc2.units.DateType expires
-
-
Method Detail
-
getName
public String getName()
Get the name of the catalog- Returns:
- name of catalog
-
getVersion
public String getVersion()
Get the version of the catalog- Returns:
- catalog version
-
getDataset
public InvDatasetImpl getDataset()
Deprecated.use getDatasets()Get top-level dataset.- Returns:
- top-level InvDataset. May not be null.
-
findDatasetByID
public InvDataset findDatasetByID(String id)
Find a contained dataset by its ID.- Parameters:
id- : dataset ID, case sensitive- Returns:
- InvDataset or null if not found.
-
getDatasets
public List<InvDataset> getDatasets()
Get top-level datasets.- Returns:
- List of InvDataset. May be empty, may not be null.
-
getServices
public List<InvService> getServices()
Get top-level services.- Returns:
- List of InvService. May be empty, may not be null.
-
getProperties
public List<InvProperty> getProperties()
Get catalog properties.- Returns:
- List of InvProperty. May be empty, may not be null.
-
findProperty
public String findProperty(String name)
Find named property.- Parameters:
name- match this name- Returns:
- string value of property or null if not exist.
-
getExpires
public ucar.nc2.units.DateType getExpires()
Get date catalog expires, or null if none given.- Returns:
- expiration date, or null
-
findService
public InvService findService(String name)
Find the named service declared in the top level of this catalog.- Parameters:
name- match this name- Returns:
- service that matches the given name, or null if none found.
-
resolveUri
public URI resolveUri(String uriString) throws URISyntaxException
Resolve reletive URIs, using the catalog's base URI. If the uriString is not reletive, then no resolution is done. This also allows baseURI to be a file: scheme.- Parameters:
uriString- any url, reletive or absolute- Returns:
- resolved url string, or null on error
- Throws:
URISyntaxException- if uriString violates RFC 2396- See Also:
URI.resolve(java.net.URI)
-
getUriString
public String getUriString()
Get the base URI as a String- Returns:
- baseURI as a String
-
check
public abstract boolean check(StringBuilder out, boolean show)
Check internal data structures.- Parameters:
out- : print errors hereshow- : print messages for each object (debug)- Returns:
- true if no fatal consistency errors.
-
check
public boolean check(StringBuilder out)
Check internal data structures.- Parameters:
out- : print errors here- Returns:
- true if no fatal consistency errors.
-
subset
public abstract void subset(InvDataset dataset)
Munge this catalog so the given dataset is the top catalog.- Parameters:
dataset- make this top; must be existing dataset in this catalog.
-
filter
public abstract void filter(DatasetFilter filter)
Munge this catalog to remove any dataset that doesnt pass through the filter.- Parameters:
filter- remove datasets that dont pass this filter.
-
-