Package thredds.catalog
Class ThreddsMetadata
- java.lang.Object
-
- thredds.catalog.ThreddsMetadata
-
public class ThreddsMetadata extends Object
Metadata for "enhanced catalogs", type THREDDS.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classThreddsMetadata.ContributorImplements Contributor type.static classThreddsMetadata.GeospatialCoverageImplements GeospatialCoverage type.static classThreddsMetadata.RangeImplements spatialRange type.static classThreddsMetadata.SourceImplements Source type, used by publisher and creator elements.static classThreddsMetadata.VariableImplements Variable type.static classThreddsMetadata.VariablesImplements Variables type.static classThreddsMetadata.VocabImplements Vocab type, just text with an optional "vocabulary" attribute.
-
Field Summary
Fields Modifier and Type Field Description protected StringauthorityNameprotected List<ThreddsMetadata.Contributor>contributorsprotected List<ThreddsMetadata.Source>creatorsprotected DataFormatTypedataFormatprotected doubledataSizeprotected ucar.nc2.constants.FeatureTypedataTypeprotected List<ucar.nc2.units.DateType>datesprotected List<InvDocumentation>docsprotected ThreddsMetadata.GeospatialCoveragegcprotected booleaninheritedprotected List<ThreddsMetadata.Vocab>keywordsprotected List<InvMetadata>metadataprotected List<ThreddsMetadata.Vocab>projectsprotected List<InvProperty>propertiesprotected List<ThreddsMetadata.Source>publishersprotected StringserviceNameprotected ucar.nc2.units.DateRangetimeCoverageprotected StringvariableMapLinkprotected List<ThreddsMetadata.Variables>variables
-
Constructor Summary
Constructors Constructor Description ThreddsMetadata(boolean inherited)ThreddsMetadata(ThreddsMetadata from)Copy Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(ThreddsMetadata tmd, boolean includeInherited)Add all the content from another ThreddsMetadatavoidaddContributor(ThreddsMetadata.Contributor c)Add a contributorvoidaddCreator(ThreddsMetadata.Source c)Add a creatorvoidaddDate(ucar.nc2.units.DateType d)Add a datevoidaddDocumentation(String type, String content)set specified type of documentationvoidaddDocumentation(InvDocumentation d)Add a documentationvoidaddKeyword(ThreddsMetadata.Vocab keyword)Add a keywordvoidaddMetadata(InvMetadata m)Add InvMetadatavoidaddProject(ThreddsMetadata.Vocab project)Add a projectvoidaddProperties(List<ucar.nc2.Attribute> atts)voidaddProperty(InvProperty p)Add a propertyvoidaddPublisher(ThreddsMetadata.Source p)Add a publishervoidaddVariableMapLink(String xlinkHref)Add a variable Map linkvoidaddVariables(ThreddsMetadata.Variables vs)Add variablesbooleanequals(Object o)StringgetAuthority()ucar.nc2.time.CalendarDateRangegetCalendarDateCoverage()List<ThreddsMetadata.Contributor>getContributors()List<ThreddsMetadata.Source>getCreators()DataFormatTypegetDataFormatType()doublegetDataSize()ucar.nc2.constants.FeatureTypegetDataType()List<ucar.nc2.units.DateType>getDates()List<InvDocumentation>getDocumentation()StringgetDocumentation(String type)ThreddsMetadata.GeospatialCoveragegetGeospatialCoverage()StringgetHistory()List<ThreddsMetadata.Vocab>getKeywords()List<InvMetadata>getMetadata()StringgetProcessing()List<ThreddsMetadata.Vocab>getProjects()List<InvProperty>getProperties()List<ThreddsMetadata.Source>getPublishers()StringgetRights()StringgetServiceName()StringgetSummary()ucar.nc2.units.DateRangegetTimeCoverage()StringgetVariableMap()List<ThreddsMetadata.Variables>getVariables()booleanhasDataSize()inthashCode()booleanisInherited()static voidmain(String[] args)********************************************************************voidremoveDocumentation(String type)remove all instances of specified type of documentationvoidremoveMetadata(InvMetadata m)remove an InvMetadata element from list, using equals() to locate it.voidsetAuthority(String authorityName)Set authorityvoidsetContributors(List<ThreddsMetadata.Contributor> contributors)Set list of contributors (type Contributor); may be empty, not null.voidsetCreators(List<ThreddsMetadata.Source> creators)Set list of creators (type Source); may be empty, not null.voidsetDataFormatType(DataFormatType dataFormat)Set dataTypeFormatvoidsetDataSize(double size)Set size (bytes)voidsetDataType(ucar.nc2.constants.FeatureType dataType)Set dataTypevoidsetGeospatialCoverage(ThreddsMetadata.GeospatialCoverage gc)set GeospatialCoverage elementvoidsetHistory(String history)set specific type of documentation = historyvoidsetInherited(boolean inherited)Set inheritedvoidsetKeywords(List<ThreddsMetadata.Vocab> keywords)Set list of keywords; may be empty, not null.voidsetProcessing(String processing)set specific type of documentation = processing_levelvoidsetProjects(List<ThreddsMetadata.Vocab> projects)Set list of projects (type Vocab); may be empty, not null.voidsetPublishers(List<ThreddsMetadata.Source> publishers)Set list of publishers (type Source); may be empty, not null.voidsetRights(String rights)set specific type of documentation = rightsvoidsetServiceName(String serviceName)Set serviceNamevoidsetSummary(String summary)set specific type of documentation = summaryvoidsetTimeCoverage(ucar.nc2.time.CalendarDateRange cdc)set TimeCoverage from a CalendarDateRangevoidsetTimeCoverage(ucar.nc2.units.DateRange tc)set TimeCoverage element
-
-
-
Field Detail
-
inherited
protected boolean inherited
-
creators
protected List<ThreddsMetadata.Source> creators
-
contributors
protected List<ThreddsMetadata.Contributor> contributors
-
dates
protected List<ucar.nc2.units.DateType> dates
-
docs
protected List<InvDocumentation> docs
-
keywords
protected List<ThreddsMetadata.Vocab> keywords
-
metadata
protected List<InvMetadata> metadata
-
projects
protected List<ThreddsMetadata.Vocab> projects
-
properties
protected List<InvProperty> properties
-
publishers
protected List<ThreddsMetadata.Source> publishers
-
variables
protected List<ThreddsMetadata.Variables> variables
-
variableMapLink
protected String variableMapLink
-
gc
protected ThreddsMetadata.GeospatialCoverage gc
-
timeCoverage
protected ucar.nc2.units.DateRange timeCoverage
-
authorityName
protected String authorityName
-
serviceName
protected String serviceName
-
dataType
protected ucar.nc2.constants.FeatureType dataType
-
dataFormat
protected DataFormatType dataFormat
-
dataSize
protected double dataSize
-
-
Constructor Detail
-
ThreddsMetadata
public ThreddsMetadata(boolean inherited)
-
ThreddsMetadata
public ThreddsMetadata(ThreddsMetadata from)
Copy Constructor.- Parameters:
from- copy from here
-
-
Method Detail
-
add
public void add(ThreddsMetadata tmd, boolean includeInherited)
Add all the content from another ThreddsMetadata- Parameters:
tmd- get content from hereincludeInherited- if false, dont add inherited InvMetadata
-
addCreator
public void addCreator(ThreddsMetadata.Source c)
Add a creator- Parameters:
c- add this
-
getCreators
public List<ThreddsMetadata.Source> getCreators()
- Returns:
- list of creators (type Source); may be empty, not null.
-
setCreators
public void setCreators(List<ThreddsMetadata.Source> creators)
Set list of creators (type Source); may be empty, not null.- Parameters:
creators- set creators to this list
-
addContributor
public void addContributor(ThreddsMetadata.Contributor c)
Add a contributor- Parameters:
c- add this
-
getContributors
public List<ThreddsMetadata.Contributor> getContributors()
- Returns:
- list of contributors (type Contributor); may be empty, not null.
-
setContributors
public void setContributors(List<ThreddsMetadata.Contributor> contributors)
Set list of contributors (type Contributor); may be empty, not null.- Parameters:
contributors- set contributers to this
-
addDate
public void addDate(ucar.nc2.units.DateType d)
Add a date- Parameters:
d- add this dateType
-
getDates
public List<ucar.nc2.units.DateType> getDates()
- Returns:
- list of DateType; may be empty, not null.
-
addDocumentation
public void addDocumentation(InvDocumentation d)
Add a documentation- Parameters:
d- add this
-
getDocumentation
public List<InvDocumentation> getDocumentation()
- Returns:
- list of InvDocumentation; may be empty, not null.
-
addKeyword
public void addKeyword(ThreddsMetadata.Vocab keyword)
Add a keyword- Parameters:
keyword- add this
-
getKeywords
public List<ThreddsMetadata.Vocab> getKeywords()
- Returns:
- list of keywords; may be empty, not null.
-
setKeywords
public void setKeywords(List<ThreddsMetadata.Vocab> keywords)
Set list of keywords; may be empty, not null.- Parameters:
keywords- set list of keywords to this
-
addMetadata
public void addMetadata(InvMetadata m)
Add InvMetadata- Parameters:
m- add this
-
removeMetadata
public void removeMetadata(InvMetadata m)
remove an InvMetadata element from list, using equals() to locate it.- Parameters:
m- remove this
-
getMetadata
public List<InvMetadata> getMetadata()
- Returns:
- list of InvMetadata; may be empty, not null.
-
addProject
public void addProject(ThreddsMetadata.Vocab project)
Add a project- Parameters:
project- add this
-
getProjects
public List<ThreddsMetadata.Vocab> getProjects()
- Returns:
- list of projects (type Vocab); may be empty, not null.
-
setProjects
public void setProjects(List<ThreddsMetadata.Vocab> projects)
Set list of projects (type Vocab); may be empty, not null.- Parameters:
projects- set list of projects to this
-
addProperty
public void addProperty(InvProperty p)
Add a property- Parameters:
p- add this
-
addProperties
public void addProperties(List<ucar.nc2.Attribute> atts)
-
getProperties
public List<InvProperty> getProperties()
- Returns:
- list of properties; may be empty, not null.
-
addPublisher
public void addPublisher(ThreddsMetadata.Source p)
Add a publisher- Parameters:
p- add this
-
getPublishers
public List<ThreddsMetadata.Source> getPublishers()
- Returns:
- list of publishers (type Source); may be empty, not null.
-
setPublishers
public void setPublishers(List<ThreddsMetadata.Source> publishers)
Set list of publishers (type Source); may be empty, not null.- Parameters:
publishers- set list of publishers to this
-
addVariables
public void addVariables(ThreddsMetadata.Variables vs)
Add variables- Parameters:
vs- add this
-
getVariables
public List<ThreddsMetadata.Variables> getVariables()
- Returns:
- list of Variables; may be empty, not null.
-
addVariableMapLink
public void addVariableMapLink(String xlinkHref)
Add a variable Map link- Parameters:
xlinkHref- : URI of xlink
-
getVariableMap
public String getVariableMap()
-
setGeospatialCoverage
public void setGeospatialCoverage(ThreddsMetadata.GeospatialCoverage gc)
set GeospatialCoverage element- Parameters:
gc- set GeospatialCoverage to this
-
getGeospatialCoverage
public ThreddsMetadata.GeospatialCoverage getGeospatialCoverage()
- Returns:
- GeospatialCoverage element
-
setTimeCoverage
public void setTimeCoverage(ucar.nc2.units.DateRange tc)
set TimeCoverage element- Parameters:
tc- set TimeCoverage to this
-
setTimeCoverage
public void setTimeCoverage(ucar.nc2.time.CalendarDateRange cdc)
set TimeCoverage from a CalendarDateRange- Parameters:
cdc- set CalendarDateRange to this
-
getTimeCoverage
public ucar.nc2.units.DateRange getTimeCoverage()
- Returns:
- TimeCoverage element as DateRange
-
getCalendarDateCoverage
public ucar.nc2.time.CalendarDateRange getCalendarDateCoverage()
- Returns:
- TimeCoverage element as CalendarDateRange
-
isInherited
public boolean isInherited()
- Returns:
- true if this is inherited
-
setInherited
public void setInherited(boolean inherited)
Set inherited- Parameters:
inherited- set true if inherited
-
getServiceName
public String getServiceName()
- Returns:
- serviceName
-
setServiceName
public void setServiceName(String serviceName)
Set serviceName- Parameters:
serviceName- set service name to this, must be valid service
-
getDataType
public ucar.nc2.constants.FeatureType getDataType()
- Returns:
- dataType
-
setDataType
public void setDataType(ucar.nc2.constants.FeatureType dataType)
Set dataType- Parameters:
dataType- set to this dataType
-
getDataFormatType
public DataFormatType getDataFormatType()
- Returns:
- dataType
-
setDataFormatType
public void setDataFormatType(DataFormatType dataFormat)
Set dataTypeFormat- Parameters:
dataFormat- set to this dataTypeFormat
-
getAuthority
public String getAuthority()
- Returns:
- authority
-
setAuthority
public void setAuthority(String authorityName)
Set authority- Parameters:
authorityName- set to this
-
getDocumentation
public String getDocumentation(String type)
- Parameters:
type- match on doc.getType()- Returns:
- specific type of documentation
-
getHistory
public String getHistory()
- Returns:
- specific type of documentation = history
-
setHistory
public void setHistory(String history)
set specific type of documentation = history- Parameters:
history- add (or replace) the history documentation element to this content
-
getProcessing
public String getProcessing()
- Returns:
- specific type of documentation = processing_level
-
setProcessing
public void setProcessing(String processing)
set specific type of documentation = processing_level- Parameters:
processing- add (or replace) the history documentation element to this content
-
getRights
public String getRights()
- Returns:
- specific type of documentation = rights
-
setRights
public void setRights(String rights)
set specific type of documentation = rights- Parameters:
rights- add (or replace) the history documentation element to this content
-
getSummary
public String getSummary()
- Returns:
- specific type of documentation = summary
-
setSummary
public void setSummary(String summary)
set specific type of documentation = summary- Parameters:
summary- add (or replace) the history documentation element to this content
-
getDataSize
public double getDataSize()
- Returns:
- the data size in bytes. A value of 0.0 or NaN means not set.
-
setDataSize
public void setDataSize(double size)
Set size (bytes)- Parameters:
size- the data size in bytes. A value of 0.0 or NaN means not set.
-
hasDataSize
public boolean hasDataSize()
-
addDocumentation
public void addDocumentation(String type, String content)
set specified type of documentation- Parameters:
type- type of documentationcontent- documentation contenet
-
removeDocumentation
public void removeDocumentation(String type)
remove all instances of specified type of documentation- Parameters:
type- type of documentation
-
main
public static void main(String[] args) throws IOException
********************************************************************- Throws:
IOException
-
-