Package thredds.catalog
Class InvCatalogRef
- java.lang.Object
-
- thredds.catalog.InvDataset
-
- thredds.catalog.InvDatasetImpl
-
- thredds.catalog.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
-
-
Field Summary
-
Fields inherited from class thredds.catalog.InvDatasetImpl
log, mark, ncmlElement, tm, tmi
-
Fields inherited from class thredds.catalog.InvDataset
access, authorityName, catalog, collectionType, contributors, creators, dataFormatType, datasets, dataType, dates, defaultService, docs, gc, harvest, id, keywords, metadata, name, parent, projects, properties, publishers, restrictAccess, services, tc, variableMapLink, variables
-
-
Constructor Summary
Constructors Constructor Description InvCatalogRef(InvDatasetImpl parent, String name, String href)
Constructor.InvCatalogRef(InvDatasetImpl parent, String name, String href, Boolean useRemoteCatalogService)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
InvDatasetImpl elements with same values are equal.InvDatasetImpl
findDatasetByName(String p0)
Find an immediate child dataset by its name.String
findProperty(String p0)
Finds the first property declared in the dataset with the given name.InvService
findService(String p0)
Find the named service declared in this dataset or one of its parents.boolean
finish()
Finish constructing after all elements have been added.List<InvAccess>
getAccess()
Get all access elements for this dataset.InvAccess
getAccess(ServiceType p0)
Get access element of the specified service type for this dataset.String
getAlias()
String
getAuthority()
Get authority for this Dataset, may be null.CalendarDateRange
getCalendarDateCoverage()
get time coverage as CalendarDateRangeCollectionType
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 p0)
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
getID()
Get the id of the dataset, or null.List<ThreddsMetadata.Vocab>
getKeywords()
get any Keyword metadataprotected boolean
getMark()
FilteringList<InvMetadata>
getMetadata()
Get the metadata elements for this InvDataset.List<InvMetadata>
getMetadata(MetadataType p0)
Get the metadata elements of the specified type.String
getName()
Get the "human readable" name of the dataset.InvDataset
getParent()
Get parent dataset.List<ThreddsMetadata.Vocab>
getProjects()
get Projects metadataList<InvProperty>
getProperties()
Get all properties for this dataset.InvDatasetImpl
getProxyDataset()
This triggers a read of the referenced catalog the first time its called.List<ThreddsMetadata.Source>
getPublishers()
get Publisher metadataInvService
getServiceDefault()
Find the default service for this dataset and its children.String
getUniqueID()
If this dataset has an authority and an ID, then the concatenation of them is the globally unique ID.URI
getURI()
String
getUrlPath()
Get urlPath for this DatasetObject
getUserProperty(Object p0)
Look up the User property having the given keyString
getVariableMapLink()
List<ThreddsMetadata.Variables>
getVariables()
get Variable metadataString
getXlinkHref()
boolean
hasAccess()
If this dataset has access elements.int
hashCode()
Override Object.hashCode() to implement equals.boolean
hasNestedDatasets()
If this dataset has nested datasets.boolean
isHarvest()
boolean
isRead()
void
readAsynch(InvCatalogFactory factory, CatalogSetCallback caller)
Read the referenced catalog asynchronously, if the catalog factory supports it.void
release()
Release resources - undo the read of the catalog.void
setXlinkHref(String href)
Boolean
useRemoteCatalogService()
-
Methods inherited from class thredds.catalog.InvDatasetImpl
addAccess, addAccess, addDataset, addDataset, addDocumentation, addProperty, addService, canonicalize, dump, getAccessLocal, getDataSize, getLastModifiedDate, getLocalMetadata, getLocalMetadataInheritable, getNcmlElement, getParentReal, getServiceName, getServicesLocal, removeDataset, removeLocalMetadata, removeService, replaceDataset, resolve, setAlias, setAuthority, setCatalog, setCollectionType, setContributors, setDataFormatType, setDataSize, setDataType, setGeospatialCoverage, setHarvest, setID, setKeywords, setLastModifiedDate, setLastModifiedDate, setLocalMetadata, setMark, setName, setNcmlElement, setParent, setProjects, setPublishers, setResourceControl, setServiceName, setServicesLocal, setTimeCoverage, setTimeCoverage, setUrlPath, setUserProperty, toString, transferMetadata, writeHtmlDescription, writeHtmlDescription
-
Methods inherited from class thredds.catalog.InvDataset
findAccess, getCatalogUrl, getHistory, getParentCatalog, getProcessing, getRestrictAccess, getRights, getSubsetUrl, getSummary, getTimeCoverage, getVariables
-
-
-
-
Constructor Detail
-
InvCatalogRef
public InvCatalogRef(InvDatasetImpl parent, String name, String href)
Constructor.- Parameters:
parent
- : parent datasetname
- : display name of collectionhref
- : URL to another catalog
-
InvCatalogRef
public InvCatalogRef(InvDatasetImpl parent, String name, String href, Boolean useRemoteCatalogService)
Constructor.- Parameters:
parent
- : parent datasetname
- : display name of collectionhref
- : URL to another cataloguseRemoteCatalogService
- : 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 classInvDataset
- 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 classInvDatasetImpl
- 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 factorycaller
- when catalog is read- See Also:
CatalogSetCallback
-
equals
public boolean equals(Object o)
Description copied from class:InvDatasetImpl
InvDatasetImpl elements with same values are equal.- Overrides:
equals
in classInvDatasetImpl
-
hashCode
public int hashCode()
Description copied from class:InvDatasetImpl
Override Object.hashCode() to implement equals.- Overrides:
hashCode
in classInvDatasetImpl
-
findDatasetByName
public InvDatasetImpl findDatasetByName(String p0)
Description copied from class:InvDataset
Find an immediate child dataset by its name.- Overrides:
findDatasetByName
in classInvDataset
- 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 viaInvDataset.getProperties()
.The property may have been specified in the dataset or in an enclosing parent element.
- Overrides:
findProperty
in classInvDataset
- 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 classInvDataset
- 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 classInvDataset
- 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 classInvDataset
- Returns:
- List of InvAccess objects. List may not be null, may be empty.
-
getAlias
public String getAlias()
- Overrides:
getAlias
in classInvDatasetImpl
- Returns:
- alias for this Dataset, if there is one
-
getAuthority
public String getAuthority()
Description copied from class:InvDataset
Get authority for this Dataset, may be null.- Overrides:
getAuthority
in classInvDataset
- Returns:
- authority for this Dataset, or null.
-
getCollectionType
public CollectionType getCollectionType()
Description copied from class:InvDataset
Get collectionType- Overrides:
getCollectionType
in classInvDataset
- Returns:
- collectionType, or null
-
getContributors
public List<ThreddsMetadata.Contributor> getContributors()
Description copied from class:InvDataset
get Contributor metadata- Overrides:
getContributors
in classInvDataset
- Returns:
- List of type ThreddsMetadata.Contributor, may be empty
-
getCreators
public List<ThreddsMetadata.Source> getCreators()
Description copied from class:InvDataset
get any Creator metadata- Overrides:
getCreators
in classInvDataset
- Returns:
- List of type ThreddsMetadata.Source, may be empty
-
getDataFormatType
public DataFormatType getDataFormatType()
Description copied from class:InvDataset
Get the DataFormatType (which may be inherited from parent), or null .- Overrides:
getDataFormatType
in classInvDataset
- 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 classInvDataset
- Returns:
- the DataType or null
-
getDates
public List<DateType> getDates()
Description copied from class:InvDataset
get any DateType metadata- Overrides:
getDates
in classInvDataset
- 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 classInvDataset
- 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 classInvDataset
- 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 classInvDataset
- Returns:
- full, heirarchical name of the dataset, which has all parent collection names.
-
getGeospatialCoverage
public ThreddsMetadata.GeospatialCoverage getGeospatialCoverage()
Description copied from class:InvDataset
get geospatial coverage- Overrides:
getGeospatialCoverage
in classInvDataset
- Returns:
- geospatial coverage, or null if none
-
getID
public String getID()
Description copied from class:InvDataset
Get the id of the dataset, or null.- Overrides:
getID
in classInvDataset
- Returns:
- the id of the dataset, or null if none.
-
getKeywords
public List<ThreddsMetadata.Vocab> getKeywords()
Description copied from class:InvDataset
get any Keyword metadata- Overrides:
getKeywords
in classInvDataset
- Returns:
- List of type ThreddsMetadata.Vocab, may be empty
-
getMark
protected boolean getMark()
Description copied from class:InvDatasetImpl
Filtering- Overrides:
getMark
in classInvDatasetImpl
- 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 classInvDataset
- 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 classInvDataset
- 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 classInvDataset
- Returns:
- "human readable" name of the dataset.
-
getParent
public InvDataset getParent()
Description copied from class:InvDataset
Get parent dataset.- Overrides:
getParent
in classInvDataset
- Returns:
- parent dataset. If top dataset, return null.
-
getProjects
public List<ThreddsMetadata.Vocab> getProjects()
Description copied from class:InvDataset
get Projects metadata- Overrides:
getProjects
in classInvDataset
- Returns:
- List of type ThreddsMetadata.Vocab, may be empty
-
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 classInvDataset
- Returns:
- List of type InvProperty. May be empty, not null.
-
getPublishers
public List<ThreddsMetadata.Source> getPublishers()
Description copied from class:InvDataset
get Publisher metadata- Overrides:
getPublishers
in classInvDataset
- Returns:
- List of type ThreddsMetadata.Source, may be empty
-
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 classInvDataset
- Returns:
- default service, or null
-
getCalendarDateCoverage
public CalendarDateRange getCalendarDateCoverage()
Description copied from class:InvDataset
get time coverage as CalendarDateRange- Overrides:
getCalendarDateCoverage
in classInvDataset
- Returns:
- time coverage, or null if none
-
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 classInvDataset
- Returns:
- globally unique ID, or null if missing authority or ID.
-
getUrlPath
public String getUrlPath()
Description copied from class:InvDatasetImpl
Get urlPath for this Dataset- Overrides:
getUrlPath
in classInvDatasetImpl
- Returns:
- urlPath for this Dataset
-
getUserProperty
public Object getUserProperty(Object p0)
Description copied from class:InvDatasetImpl
Look up the User property having the given key- Overrides:
getUserProperty
in classInvDatasetImpl
- Parameters:
p0
- property key- Returns:
- User property having the given key, or null
-
getVariables
public List<ThreddsMetadata.Variables> getVariables()
Description copied from class:InvDataset
get Variable metadata- Overrides:
getVariables
in classInvDataset
- Returns:
- List of type ThreddsMetadata.Variables, may be empty
-
getVariableMapLink
public String getVariableMapLink()
- Overrides:
getVariableMapLink
in classInvDataset
-
hasAccess
public boolean hasAccess()
Description copied from class:InvDataset
If this dataset has access elements.- Overrides:
hasAccess
in classInvDataset
- Returns:
- true if has access elements.
-
hasNestedDatasets
public boolean hasNestedDatasets()
Description copied from class:InvDataset
If this dataset has nested datasets.- Overrides:
hasNestedDatasets
in classInvDataset
- Returns:
- true if has nested datasets.
-
isHarvest
public boolean isHarvest()
- Overrides:
isHarvest
in classInvDataset
- Returns:
- if harvest is true
-
-