public class InvCatalogImpl extends InvCatalog
InvCatalog
baseURI, datasets, dsHash, expires, name, properties, serviceHash, services, topDataset, version
Constructor and Description |
---|
InvCatalogImpl(String name,
String version,
DateType expires,
URI baseURI)
Construct an InvCatalog.
|
InvCatalogImpl(String name,
String version,
URI baseURI)
Construct an InvCatalog.
|
Modifier and Type | Method and Description |
---|---|
void |
addDataset(InvDatasetImpl ds)
Add Dataset (1.0)
|
void |
addDatasetByID(InvDatasetImpl ds)
Add Dataset to internal hash.
|
void |
addDatasetRoot(DataRootConfig root)
Add Dataset Root, key = path, value = location.
|
void |
addProperty(InvProperty p)
Add Property (1.0)
|
void |
addService(InvService s)
Add Service (1.0)
|
void |
appendErrorMessage(String message,
boolean isInvalid)
Append an error message to the message log.
|
boolean |
check(StringBuilder out,
boolean show)
Check internal data structures.
|
String |
dump()
Debugging: dump entire data structure.
|
boolean |
equals(Object o)
InvCatalogImpl elements with same values are equal.
|
void |
filter(DatasetFilter filter)
Munge this catalog to remove any dataset that doesnt pass through the filter.
|
boolean |
finish()
Finish constructing after all elements have been added or modified.
|
URI |
getBaseURI() |
String |
getCreateFrom()
String describing how the catalog was created, for debugging.
|
protected DatasetFilter |
getDatasetFilter() |
List<DataRootConfig> |
getDatasetRoots()
Get dataset roots.
|
String |
getLog() |
boolean |
hasFatalError()
Check if there is a fatal error and catalog should not be used.
|
int |
hashCode()
Override Object.hashCode() to implement equals.
|
boolean |
isStatic() |
boolean |
removeDataset(InvDatasetImpl ds)
Remove the given dataset from this catalog if it is a direct child of this catalog.
|
void |
removeDatasetByID(InvDatasetImpl ds)
Find the dataset in this catalog by its ID.
|
boolean |
replaceDataset(InvDatasetImpl remove,
InvDatasetImpl add)
Replace the given dataset if it is a nested dataset.
|
void |
setBaseURI(URI baseURI)
Set the catalog base URI.
|
void |
setCreateFrom(String createFrom)
Set how the catalog was created, for debugging.
|
void |
setDataset(InvDatasetImpl ds)
Deprecated.
Use addDataset() instead; datamodel now allows multiple top level datasets.
|
void |
setExpires(DateType expiresDate)
Set the expires date after which the catalog is no longer valid.
|
void |
setStatic(boolean aStatic) |
void |
subset(InvDataset ds)
Deprecated.
in favor of thredds.catalog.util.DeepCopyUtils.subsetCatalogOnDataset
|
void |
writeXML(OutputStream os)
Write the catalog as an XML document to the specified stream.
|
void |
writeXML(OutputStream os,
boolean raw)
Write the catalog as an XML document to the specified stream.
|
check, findDatasetByID, findProperty, findService, getDataset, getDatasets, getExpires, getName, getProperties, getServices, getUriString, getVersion, resolveUri
public InvCatalogImpl(String name, String version, URI baseURI)
name
- : catalog name.version
- : catalog version.baseURI
- : catalog base URI (external).public InvCatalogImpl(String name, String version, DateType expires, URI baseURI)
name
- : catalog name.version
- : catalog version.expires
- : date/time catalog expires.baseURI
- : catalog base URI (external).public void subset(InvDataset ds)
subset
in class InvCatalog
ds
- make this top; must be existing dataset in this catalog.public void filter(DatasetFilter filter)
filter
in class InvCatalog
filter
- remove datasets that dont pass this filter.protected DatasetFilter getDatasetFilter()
public boolean finish()
public void addDatasetByID(InvDatasetImpl ds)
ds
- : add this dataset if ds.getID() != nullInvCatalog.findDatasetByID(java.lang.String)
public void removeDatasetByID(InvDatasetImpl ds)
ds
- Remove this dataset from the hashpublic void addDataset(InvDatasetImpl ds)
ds
- add this datasetpublic boolean removeDataset(InvDatasetImpl ds)
ds
- remove this datasetpublic boolean replaceDataset(InvDatasetImpl remove, InvDatasetImpl add)
remove
- - the dataset element to be removedadd
- - the dataset element to be addedpublic void addProperty(InvProperty p)
p
- add this propertypublic void addService(InvService s)
s
- add this servicepublic void setDataset(InvDatasetImpl ds)
public String getCreateFrom()
public void setCreateFrom(String createFrom)
createFrom
- how the catalog was created, for debuggingpublic void setBaseURI(URI baseURI)
baseURI
- set to thispublic URI getBaseURI()
public void setExpires(DateType expiresDate)
expiresDate
- a DateType
representing the date after which the catlog is no longer valid.public boolean hasFatalError()
public void appendErrorMessage(String message, boolean isInvalid)
message
- append this message to logisInvalid
- true if this is a fatal error.public boolean check(StringBuilder out, boolean show)
check
in class InvCatalog
out
- : print errors hereshow
- : print messages for each object (debug)public String getLog()
public String dump()
public void writeXML(OutputStream os) throws IOException
os
- write to this OutputStreamIOException
- on an error.public void writeXML(OutputStream os, boolean raw) throws IOException
os
- write to this OutputStreamraw
- if true, write original (server) version, else write client versionIOException
- on an error.public List<DataRootConfig> getDatasetRoots()
public void addDatasetRoot(DataRootConfig root)
root
- add a dataset rootpublic boolean equals(Object o)
public int hashCode()
public boolean isStatic()
public void setStatic(boolean aStatic)
Copyright © 1999–2013 UCAR/Unidata. All rights reserved.