public class InvCatalogImpl extends InvCatalog
InvCatalogbaseURI, datasets, dsHash, expires, name, properties, serviceHash, services, topDataset, version| Constructor and Description |
|---|
InvCatalogImpl(java.lang.String name,
java.lang.String version,
DateType expires,
java.net.URI baseURI)
Construct an InvCatalog.
|
InvCatalogImpl(java.lang.String name,
java.lang.String version,
java.net.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(java.lang.String message,
boolean isInvalid)
Append an error message to the message log.
|
boolean |
check(java.lang.StringBuilder out,
boolean show)
Check internal data structures.
|
java.lang.String |
dump()
Debugging: dump entire data structure.
|
boolean |
equals(java.lang.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.
|
java.net.URI |
getBaseURI() |
java.lang.String |
getCreateFrom()
String describing how the catalog was created, for debugging.
|
protected DatasetFilter |
getDatasetFilter() |
java.util.List<DataRootConfig> |
getDatasetRoots()
Get dataset roots.
|
java.lang.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(java.net.URI baseURI)
Set the catalog base URI.
|
void |
setCreateFrom(java.lang.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(java.io.OutputStream os)
Write the catalog as an XML document to the specified stream.
|
void |
writeXML(java.io.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, resolveUripublic InvCatalogImpl(java.lang.String name,
java.lang.String version,
java.net.URI baseURI)
name - : catalog name.version - : catalog version.baseURI - : catalog base URI (external).public InvCatalogImpl(java.lang.String name,
java.lang.String version,
DateType expires,
java.net.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 InvCatalogds - make this top; must be existing dataset in this catalog.public void filter(DatasetFilter filter)
filter in class InvCatalogfilter - 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 java.lang.String getCreateFrom()
public void setCreateFrom(java.lang.String createFrom)
createFrom - how the catalog was created, for debuggingpublic void setBaseURI(java.net.URI baseURI)
baseURI - set to thispublic java.net.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(java.lang.String message,
boolean isInvalid)
message - append this message to logisInvalid - true if this is a fatal error.public boolean check(java.lang.StringBuilder out,
boolean show)
check in class InvCatalogout - : print errors hereshow - : print messages for each object (debug)public java.lang.String getLog()
public java.lang.String dump()
public void writeXML(java.io.OutputStream os)
throws java.io.IOException
os - write to this OutputStreamjava.io.IOException - on an error.public void writeXML(java.io.OutputStream os,
boolean raw)
throws java.io.IOException
os - write to this OutputStreamraw - if true, write original (server) version, else write client versionjava.io.IOException - on an error.public java.util.List<DataRootConfig> getDatasetRoots()
public void addDatasetRoot(DataRootConfig root)
root - add a dataset rootpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean isStatic()
public void setStatic(boolean aStatic)