Class InvCatalogRef

  • Direct Known Subclasses:
    InvDatasetScan

    public class InvCatalogRef
    extends InvDatasetImpl
    A reference to a InvCatalog. The referenced catalog is not read until getDatasets() is called. A client will see the referenced catalog as a nested dataset.

    The client can also do asynchronous reading, if the InvCatalogFactory supports it, and if readAsynch() is used.

     Parent relationship:
       ds -> catRef -- catalog
                          ^ top  -> ds ...
     

    ParentView relationship: ds -> catRef -> top -> ds ... (or) -> ds if UseProxy

    See Also:
    for API, thredds.catalog.ui.CatalogTreeView as example to read asynchronously
    • Constructor Detail

      • InvCatalogRef

        public InvCatalogRef​(InvDatasetImpl parent,
                             String name,
                             String href)
        Constructor.
        Parameters:
        parent - : parent dataset
        name - : display name of collection
        href - : URL to another catalog
      • InvCatalogRef

        public InvCatalogRef​(InvDatasetImpl parent,
                             String name,
                             String href,
                             Boolean useRemoteCatalogService)
        Constructor.
        Parameters:
        parent - : parent dataset
        name - : display name of collection
        href - : URL to another catalog
        useRemoteCatalogService - : force catalogRef to go through the remoteCatalogService
    • Method Detail

      • useRemoteCatalogService

        public Boolean useRemoteCatalogService()
      • getXlinkHref

        public String getXlinkHref()
        Returns:
        Xlink Href, as a String, unresolved
      • setXlinkHref

        public void setXlinkHref​(String href)
      • getURI

        public URI getURI()
        Returns:
        Xlink reference as a URI, resolved
      • getDatasets

        public List<InvDataset> getDatasets()
        Get a list of all the nested datasets.
        Overrides:
        getDatasets in class InvDataset
        Returns:
        Datasets. This triggers a read of the referenced catalog the first time its called.
      • isRead

        public boolean isRead()
        Returns:
        true the referenced catalog has been read
      • getProxyDataset

        public InvDatasetImpl getProxyDataset()
        This triggers a read of the referenced catalog the first time its called.
        Returns:
        top dataset of referenced catalog.
      • release

        public void release()
        Release resources - undo the read of the catalog. This is needed when crawling large catalogs. For modest catalogs that you will repeatedly examine, do not use this method.
      • finish

        public boolean finish()
        Description copied from class: InvDatasetImpl
        Finish constructing after all elements have been added. This does the inheritence thing This can be called again if new elements are added.
        Overrides:
        finish in class InvDatasetImpl
        Returns:
        true if successful.
      • readAsynch

        public void readAsynch​(InvCatalogFactory factory,
                               CatalogSetCallback caller)
        Read the referenced catalog asynchronously, if the catalog factory supports it. If it doesnt, this method will work equivilently to read(), which is called the first time getDatasets() is called. If the catalog is already read in, the callback will be called immediately, before this method exits.
        Parameters:
        factory - : use this catalog factory
        caller - when catalog is read
        See Also:
        CatalogSetCallback
      • findDatasetByName

        public InvDatasetImpl findDatasetByName​(String p0)
        Description copied from class: InvDataset
        Find an immediate child dataset by its name.
        Overrides:
        findDatasetByName in class InvDataset
        Parameters:
        p0 - match on this name
        Returns:
        dataset if found or null if not exist.
      • findProperty

        public String findProperty​(String p0)
        Description copied from class: InvDataset
        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 InvDataset.getProperties().

        The property may have been specified in the dataset or in an enclosing parent element.

        Overrides:
        findProperty in class InvDataset
        Parameters:
        p0 - the name of the property.
        Returns:
        the string value of the first property with the given name or null if no such property exists.
      • findService

        public InvService findService​(String p0)
        Description copied from class: InvDataset
        Find the named service declared in this dataset or one of its parents.
        Overrides:
        findService in class InvDataset
        Parameters:
        p0 - match this name
        Returns:
        first service that matches the given name, or null if none found.
      • getAccess

        public InvAccess getAccess​(ServiceType p0)
        Description copied from class: InvDataset
        Get access element of the specified service type for this dataset. If more than one, get the first one.
        Overrides:
        getAccess in class InvDataset
        Parameters:
        p0 - find this ServiceType
        Returns:
        InvAccess or null if there is not one.
      • getAccess

        public List<InvAccess> getAccess()
        Description copied from class: InvDataset
        Get all access elements for this dataset. This list will expand any compound services.
        Overrides:
        getAccess in class InvDataset
        Returns:
        List of InvAccess objects. List may not be null, may be empty.
      • getAuthority

        public String getAuthority()
        Description copied from class: InvDataset
        Get authority for this Dataset, may be null.
        Overrides:
        getAuthority in class InvDataset
        Returns:
        authority for this Dataset, or null.
      • getDataFormatType

        public DataFormatType getDataFormatType()
        Description copied from class: InvDataset
        Get the DataFormatType (which may be inherited from parent), or null .
        Overrides:
        getDataFormatType in class InvDataset
        Returns:
        the DataFormatType or null .
      • getDataType

        public FeatureType getDataType()
        Description copied from class: InvDataset
        Get the DataType (which may be inherited from parent), or null .
        Overrides:
        getDataType in class InvDataset
        Returns:
        the DataType or null
      • getDates

        public List<DateType> getDates()
        Description copied from class: InvDataset
        get any DateType metadata
        Overrides:
        getDates in class InvDataset
        Returns:
        List of type DateType, may be empty
      • getDocumentation

        public List<InvDocumentation> getDocumentation()
        Description copied from class: InvDataset
        Get list of documentation elements for this dataset.
        Overrides:
        getDocumentation in class InvDataset
        Returns:
        list of InvDocumentation objects. May be empty, not null.
      • getDocumentation

        public String getDocumentation​(String p0)
        Description copied from class: InvDataset
        get specific type of documentation
        Overrides:
        getDocumentation in class InvDataset
        Parameters:
        p0 - find this type of documentation
        Returns:
        contents of documentation of specified type
      • getFullName

        public String getFullName()
        Description copied from class: InvDataset
        Get the full, heirarchical name of the dataset, which has all parent collection names.
        Overrides:
        getFullName in class InvDataset
        Returns:
        full, heirarchical name of the dataset, which has all parent collection names.
      • getID

        public String getID()
        Description copied from class: InvDataset
        Get the id of the dataset, or null.
        Overrides:
        getID in class InvDataset
        Returns:
        the id of the dataset, or null if none.
      • getMark

        protected boolean getMark()
        Description copied from class: InvDatasetImpl
        Filtering
        Overrides:
        getMark in class InvDatasetImpl
        Returns:
        true if this is "marked"
      • getMetadata

        public List<InvMetadata> getMetadata​(MetadataType p0)
        Description copied from class: InvDataset
        Get the metadata elements of the specified type.
        Overrides:
        getMetadata in class InvDataset
        Parameters:
        p0 - find this metadata type
        Returns:
        List of InvMetadata objects. List may be empty but not null.
      • getMetadata

        public List<InvMetadata> getMetadata()
        Description copied from class: InvDataset
        Get the metadata elements for this InvDataset.
        Overrides:
        getMetadata in class InvDataset
        Returns:
        List of InvMetadata objects. List may be empty but not null.
      • getName

        public String getName()
        Description copied from class: InvDataset
        Get the "human readable" name of the dataset.
        Overrides:
        getName in class InvDataset
        Returns:
        "human readable" name of the dataset.
      • getParent

        public InvDataset getParent()
        Description copied from class: InvDataset
        Get parent dataset.
        Overrides:
        getParent in class InvDataset
        Returns:
        parent dataset. If top dataset, return null.
      • getProperties

        public List<InvProperty> getProperties()
        Description copied from class: InvDataset
        Get all properties for this dataset. These may have been specified in the dataset or an enclosing parent element.
        Overrides:
        getProperties in class InvDataset
        Returns:
        List of type InvProperty. May be empty, not null.
      • getServiceDefault

        public InvService getServiceDefault()
        Description copied from class: InvDataset
        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.
        Overrides:
        getServiceDefault in class InvDataset
        Returns:
        default service, or null
      • getUniqueID

        public String getUniqueID()
        Description copied from class: InvDataset
        If this dataset has an authority and an ID, then the concatenation of them is the globally unique ID.
        Overrides:
        getUniqueID in class InvDataset
        Returns:
        globally unique ID, or null if missing authority or ID.
      • getUserProperty

        public Object getUserProperty​(Object p0)
        Description copied from class: InvDatasetImpl
        Look up the User property having the given key
        Overrides:
        getUserProperty in class InvDatasetImpl
        Parameters:
        p0 - property key
        Returns:
        User property having the given key, or null
      • hasAccess

        public boolean hasAccess()
        Description copied from class: InvDataset
        If this dataset has access elements.
        Overrides:
        hasAccess in class InvDataset
        Returns:
        true if has access elements.
      • hasNestedDatasets

        public boolean hasNestedDatasets()
        Description copied from class: InvDataset
        If this dataset has nested datasets.
        Overrides:
        hasNestedDatasets in class InvDataset
        Returns:
        true if has nested datasets.
      • isHarvest

        public boolean isHarvest()
        Overrides:
        isHarvest in class InvDataset
        Returns:
        if harvest is true