Package thredds.catalog
Class InvDataset
- java.lang.Object
-
- thredds.catalog.InvDataset
-
- Direct Known Subclasses:
InvDatasetImpl
public abstract class InvDataset extends Object
Public interface to a thredds dataset, basic abstraction for data.
-
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
InvDataset(InvDataset parent, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InvAccess
findAccess(String accessURL)
Get access element that matches the given access standard URL.InvDatasetImpl
findDatasetByName(String name)
Find an immediate child dataset by its name.String
findProperty(String name)
Finds the first property declared in the dataset with the given name.InvService
findService(String name)
Find the named service declared in this dataset or one of its parents.List<InvAccess>
getAccess()
Get all access elements for this dataset.InvAccess
getAccess(ServiceType type)
Get access element of the specified service type for this dataset.String
getAuthority()
Get authority for this Dataset, may be null.CalendarDateRange
getCalendarDateCoverage()
get time coverage as CalendarDateRangeString
getCatalogUrl()
Get URL to this dataset.CollectionType
getCollectionType()
Get collectionTypeList<ThreddsMetadata.Contributor>
getContributors()
get Contributor metadataList<ThreddsMetadata.Source>
getCreators()
get any Creator metadataDataFormatType
getDataFormatType()
Get the DataFormatType (which may be inherited from parent), or null .List<InvDataset>
getDatasets()
Get a list of all the nested datasets.FeatureType
getDataType()
Get the DataType (which may be inherited from parent), or null .List<DateType>
getDates()
get any DateType metadataList<InvDocumentation>
getDocumentation()
Get list of documentation elements for this dataset.String
getDocumentation(String type)
get specific type of documentationString
getFullName()
Get the full, heirarchical name of the dataset, which has all parent collection names.ThreddsMetadata.GeospatialCoverage
getGeospatialCoverage()
get geospatial coverageString
getHistory()
get specific type of documentation = historyString
getID()
Get the id of the dataset, or null.List<ThreddsMetadata.Vocab>
getKeywords()
get any Keyword metadataList<InvMetadata>
getMetadata()
Get the metadata elements for this InvDataset.List<InvMetadata>
getMetadata(MetadataType want)
Get the metadata elements of the specified type.String
getName()
Get the "human readable" name of the dataset.InvDataset
getParent()
Get parent dataset.InvCatalog
getParentCatalog()
Get containing catalog.String
getProcessing()
get specific type of documentation = processing_levelList<ThreddsMetadata.Vocab>
getProjects()
get Projects metadataList<InvProperty>
getProperties()
Get all properties for this dataset.List<ThreddsMetadata.Source>
getPublishers()
get Publisher metadataString
getRestrictAccess()
Return the resource control value which indicates that only users with proper permission can access this resource.String
getRights()
get specific type of documentation = rightsInvService
getServiceDefault()
Find the default service for this dataset and its children.String
getSubsetUrl()
Return the query fragment referencing this dataset, ie "catalog=catalog.xml&dataset=datasetID"String
getSummary()
get specific type of documentation = summaryDateRange
getTimeCoverage()
get time coverageString
getUniqueID()
If this dataset has an authority and an ID, then the concatenation of them is the globally unique ID.String
getVariableMapLink()
List<ThreddsMetadata.Variables>
getVariables()
get Variable metadataThreddsMetadata.Variables
getVariables(String vocab)
get Variables from the specified vocabularyboolean
hasAccess()
If this dataset has access elements.boolean
hasNestedDatasets()
If this dataset has nested datasets.boolean
isHarvest()
-
-
-
Field Detail
-
catalog
protected InvCatalog catalog
-
parent
protected InvDataset parent
-
name
protected String name
-
id
protected String id
-
datasets
protected List<InvDataset> datasets
-
harvest
protected boolean harvest
-
collectionType
protected CollectionType collectionType
-
services
protected List<InvService> services
-
authorityName
protected String authorityName
-
dataType
protected FeatureType dataType
-
defaultService
protected InvService defaultService
-
dataFormatType
protected DataFormatType dataFormatType
-
restrictAccess
protected String restrictAccess
-
docs
protected List<InvDocumentation> docs
-
metadata
protected List<InvMetadata> metadata
-
properties
protected List<InvProperty> properties
-
creators
protected List<ThreddsMetadata.Source> creators
-
contributors
protected List<ThreddsMetadata.Contributor> contributors
-
keywords
protected List<ThreddsMetadata.Vocab> keywords
-
projects
protected List<ThreddsMetadata.Vocab> projects
-
publishers
protected List<ThreddsMetadata.Source> publishers
-
variables
protected List<ThreddsMetadata.Variables> variables
-
gc
public ThreddsMetadata.GeospatialCoverage gc
-
tc
public DateRange tc
-
variableMapLink
protected String variableMapLink
-
-
Constructor Detail
-
InvDataset
protected InvDataset(InvDataset parent, String name)
-
-
Method Detail
-
getName
public String getName()
Get the "human readable" name of the dataset.- Returns:
- "human readable" name of the dataset.
-
getFullName
public String getFullName()
Get the full, heirarchical name of the dataset, which has all parent collection names.- Returns:
- full, heirarchical name of the dataset, which has all parent collection names.
-
getCollectionType
public CollectionType getCollectionType()
Get collectionType- Returns:
- collectionType, or null
-
isHarvest
public boolean isHarvest()
- Returns:
- if harvest is true
-
getID
public String getID()
Get the id of the dataset, or null.- Returns:
- the id of the dataset, or null if none.
-
getUniqueID
public String getUniqueID()
If this dataset has an authority and an ID, then the concatenation of them is the globally unique ID.- Returns:
- globally unique ID, or null if missing authority or ID.
-
getAuthority
public String getAuthority()
Get authority for this Dataset, may be null.- Returns:
- authority for this Dataset, or null.
-
getDataType
public FeatureType getDataType()
Get the DataType (which may be inherited from parent), or null .- Returns:
- the DataType or null
-
getDataFormatType
public DataFormatType getDataFormatType()
Get the DataFormatType (which may be inherited from parent), or null .- Returns:
- the DataFormatType or null .
-
hasAccess
public boolean hasAccess()
If this dataset has access elements.- Returns:
- true if has access elements.
-
getAccess
public List<InvAccess> getAccess()
Get all access elements for this dataset. This list will expand any compound services.- Returns:
- List of InvAccess objects. List may not be null, may be empty.
-
getAccess
public InvAccess getAccess(ServiceType type)
Get access element of the specified service type for this dataset. If more than one, get the first one.- Parameters:
type
- find this ServiceType- Returns:
- InvAccess or null if there is not one.
-
findAccess
public InvAccess findAccess(String accessURL)
Get access element that matches the given access standard URL. Match on a.getStandardUrlName().- Parameters:
accessURL
- find theis access URL string- Returns:
- InvAccess or null if no match.
-
getSubsetUrl
public String getSubsetUrl()
Return the query fragment referencing this dataset, ie "catalog=catalog.xml&dataset=datasetID"- Returns:
- the query fragment for this dataset
-
hasNestedDatasets
public boolean hasNestedDatasets()
If this dataset has nested datasets.- Returns:
- true if has nested datasets.
-
getDatasets
public List<InvDataset> getDatasets()
Get a list of all the nested datasets.- Returns:
- list of objects of type InvDataset. May be empty, not null.
-
findDatasetByName
public InvDatasetImpl findDatasetByName(String name)
Find an immediate child dataset by its name.- Parameters:
name
- match on this name- Returns:
- dataset if found or null if not exist.
-
getParent
public InvDataset getParent()
Get parent dataset.- Returns:
- parent dataset. If top dataset, return null.
-
getParentCatalog
public InvCatalog getParentCatalog()
Get containing catalog.- Returns:
- containing catalog.
-
getCatalogUrl
public String getCatalogUrl()
Get URL to this dataset. Dataset must have an ID. Form is catalogURL#DatasetID- Returns:
- URL to this dataset.
-
getDocumentation
public List<InvDocumentation> getDocumentation()
Get list of documentation elements for this dataset.- Returns:
- list of InvDocumentation objects. May be empty, not null.
-
getProperties
public List<InvProperty> getProperties()
Get all properties for this dataset. These may have been specified in the dataset or an enclosing parent element.- Returns:
- List of type InvProperty. May be empty, not null.
-
findProperty
public String findProperty(String name)
Finds the first property declared in the dataset with the given name. If a property other than the first is desired, it can be obtained viagetProperties()
.The property may have been specified in the dataset or in an enclosing parent element.
- Parameters:
name
- the name of the property.- Returns:
- the string value of the first property with the given name or
null
if no such property exists.
-
getMetadata
public List<InvMetadata> getMetadata()
Get the metadata elements for this InvDataset.- Returns:
- List of InvMetadata objects. List may be empty but not null.
-
getMetadata
public List<InvMetadata> getMetadata(MetadataType want)
Get the metadata elements of the specified type.- Parameters:
want
- find this metadata type- Returns:
- List of InvMetadata objects. List may be empty but not null.
-
findService
public InvService findService(String name)
Find the named service declared in this dataset or one of its parents.- Parameters:
name
- match this name- Returns:
- first service that matches the given name, or null if none found.
-
getServiceDefault
public InvService getServiceDefault()
Find the default service for this dataset and its children. If not declared in this dataset, search in parents. This is the default for any nested datasets or access elements.- Returns:
- default service, or null
-
getRestrictAccess
public String getRestrictAccess()
Return the resource control value which indicates that only users with proper permission can access this resource. ??? Not sure if the value indicates anything or just set or not set.- Returns:
- the resource control value for this dataset (inherited from ancestor datasets).
-
getCreators
public List<ThreddsMetadata.Source> getCreators()
get any Creator metadata- Returns:
- List of type ThreddsMetadata.Source, may be empty
-
getContributors
public List<ThreddsMetadata.Contributor> getContributors()
get Contributor metadata- Returns:
- List of type ThreddsMetadata.Contributor, may be empty
-
getDates
public List<DateType> getDates()
get any DateType metadata- Returns:
- List of type DateType, may be empty
-
getKeywords
public List<ThreddsMetadata.Vocab> getKeywords()
get any Keyword metadata- Returns:
- List of type ThreddsMetadata.Vocab, may be empty
-
getProjects
public List<ThreddsMetadata.Vocab> getProjects()
get Projects metadata- Returns:
- List of type ThreddsMetadata.Vocab, may be empty
-
getPublishers
public List<ThreddsMetadata.Source> getPublishers()
get Publisher metadata- Returns:
- List of type ThreddsMetadata.Source, may be empty
-
getHistory
public String getHistory()
get specific type of documentation = history- Returns:
- contents of the "history" documentation, or null
-
getProcessing
public String getProcessing()
get specific type of documentation = processing_level- Returns:
- contents of the "processing_level" documentation, or null
-
getRights
public String getRights()
get specific type of documentation = rights- Returns:
- contents of the "rights" documentation, or null
-
getSummary
public String getSummary()
get specific type of documentation = summary- Returns:
- contents of the "summary" documentation, or null
-
getVariables
public List<ThreddsMetadata.Variables> getVariables()
get Variable metadata- Returns:
- List of type ThreddsMetadata.Variables, may be empty
-
getVariableMapLink
public String getVariableMapLink()
-
getVariables
public ThreddsMetadata.Variables getVariables(String vocab)
get Variables from the specified vocabulary- Parameters:
vocab
- look for this vocabulary- Returns:
- Variables from the specified vocabulary, may be null
-
getGeospatialCoverage
public ThreddsMetadata.GeospatialCoverage getGeospatialCoverage()
get geospatial coverage- Returns:
- geospatial coverage, or null if none
-
getCalendarDateCoverage
public CalendarDateRange getCalendarDateCoverage()
get time coverage as CalendarDateRange- Returns:
- time coverage, or null if none
-
getTimeCoverage
public DateRange getTimeCoverage()
get time coverage- Returns:
- time coverage, or null if none
-
-