Class InvDataset

  • Direct Known Subclasses:
    InvDatasetImpl

    public abstract class InvDataset
    extends Object
    Public interface to a thredds dataset, basic abstraction for data.
    • Constructor Detail

    • 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 via getProperties().

        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
      • 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
      • getDocumentation

        public String getDocumentation​(String type)
        get specific type of documentation
        Parameters:
        type - find this type of documentation
        Returns:
        contents of documentation of specified type