public abstract class DatasetSource extends Object
Currently an abstract class, three abstract methods must be implemented to make a concrete subclass. These methods are getTopLevelDataset():InvDataset, isCollection():boolean, and expandThisLevel(InvDataset):List. (In previous versions, expandThisType():void was the only abstract method.)
Modifier and Type | Field and Description |
---|---|
protected InvDataset |
accessPointDataset
Top-level dataset of the catalog generated by this DatasetSource.
|
protected boolean |
addDatasetSize |
protected List |
catalogRefInfoList
Information on the catalogRefs in the resulting catalog.
|
protected boolean |
createCatalogRefs |
protected List |
datasetEnhancerList |
protected List |
datasetFilterList |
protected List |
datasetNamerList |
protected DatasetSorter |
datasetSorter |
protected boolean |
isValid |
protected StringBuffer |
msgLog |
protected InvCatalog |
resultingCatalog
The catalog that results from expanding this DatasetSource.
|
protected DatasetSourceType |
type |
Modifier | Constructor and Description |
---|---|
protected |
DatasetSource()
Default Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addDatasetEnhancer(DatasetEnhancer1 dsEnhancer) |
void |
addDatasetFilter(DatasetFilter datasetFilter) |
void |
addDatasetNamer(DatasetNamer datasetNamer) |
protected abstract InvDataset |
createDataset(String datasetLocation,
String prefixUrlPath)
Creates an InvDataset to represent the dataset at the given location
on this DatasetSource.
|
protected abstract InvCatalog |
createSkeletonCatalog(String prefixUrlPath)
Return a skeleton InvCatalog for this DatasetSource.
|
boolean |
equals(Object o) |
InvDataset |
expand()
Crawl this DatasetSource and generate a new InvCatalog, return the
top-level InvDataset.
|
InvDataset |
expand(List accessPoints) |
protected abstract List |
expandThisLevel(InvDataset collectionDataset,
String prefixUrlPath)
Return a list of the InvDatasets contained in the given collection dataset
on this DatasetSource.
|
InvCatalog |
fullExpand()
Crawl this DatasetSource and generate a new InvCatalog with all datasets
named, sorted, and organized as defined by this DatasetSource, return the
newly generated InvCatalog.
|
String |
getAccessPoint() |
List |
getCatalogRefInfoList() |
List |
getDatasetEnhancerList() |
List |
getDatasetFilterList() |
List |
getDatasetNamerList() |
DatasetSorter |
getDatasetSorter() |
String |
getName() |
String |
getPrefixUrlPath() |
InvCatalog |
getResultingCatalog() |
ResultService |
getResultService() |
DatasetSourceStructure |
getStructure() |
DatasetSourceType |
getType() |
int |
hashCode() |
boolean |
isAddDatasetSize() |
protected abstract boolean |
isCollection(InvDataset dataset)
Return true if the given dataset is a collection dataset, false otherwise.
|
boolean |
isCreateCatalogRefs() |
boolean |
isFlatten() |
static DatasetSource |
newDatasetSource(String name,
DatasetSourceType type,
DatasetSourceStructure structure,
String accessPoint,
ResultService resultService)
Factory method for this abstract class.
|
void |
setAccessPoint(String accessPoint) |
void |
setAddDatasetSize(boolean addDatasetSize) |
void |
setCreateCatalogRefs(boolean createCatalogRefs) |
void |
setDatasetSorter(DatasetSorter datasetSorter) |
void |
setName(String name) |
void |
setPrefixUrlPath(String prefixUrlPath) |
void |
setResultService(ResultService resultService) |
void |
setStructure(DatasetSourceStructure structure) |
String |
toString()
string representation
|
boolean |
validate(StringBuilder out) |
protected InvCatalog resultingCatalog
protected InvDataset accessPointDataset
protected List catalogRefInfoList
protected DatasetSourceType type
protected boolean createCatalogRefs
protected List datasetNamerList
protected List datasetFilterList
protected DatasetSorter datasetSorter
protected List datasetEnhancerList
protected boolean addDatasetSize
protected boolean isValid
protected StringBuffer msgLog
public static final DatasetSource newDatasetSource(String name, DatasetSourceType type, DatasetSourceStructure structure, String accessPoint, ResultService resultService)
name
- type
- structure
- accessPoint
- IllegalArgumentException
- if DatasetSource type is null or unsupported.public InvCatalog getResultingCatalog()
public List getCatalogRefInfoList()
public String getName()
public void setName(String name)
public DatasetSourceType getType()
public DatasetSourceStructure getStructure()
public void setStructure(DatasetSourceStructure structure)
public boolean isFlatten()
public String getAccessPoint()
public void setAccessPoint(String accessPoint)
public String getPrefixUrlPath()
public void setPrefixUrlPath(String prefixUrlPath)
public ResultService getResultService()
public void setResultService(ResultService resultService)
public boolean isCreateCatalogRefs()
public void setCreateCatalogRefs(boolean createCatalogRefs)
public List getDatasetNamerList()
public void addDatasetNamer(DatasetNamer datasetNamer)
public List getDatasetFilterList()
public void addDatasetFilter(DatasetFilter datasetFilter)
public DatasetSorter getDatasetSorter()
public void setDatasetSorter(DatasetSorter datasetSorter)
public List getDatasetEnhancerList()
public void addDatasetEnhancer(DatasetEnhancer1 dsEnhancer)
public boolean isAddDatasetSize()
public void setAddDatasetSize(boolean addDatasetSize)
public boolean validate(StringBuilder out)
public InvDataset expand() throws IOException
IOException
- if the accessPoint for this DatasetSource is not a container dataset.public InvDataset expand(List accessPoints) throws IOException
accessPoints
- IOException
- if the main access point for this DatasetSource is not a container dataset or any of the given access points do not exist or are not under the main access point.public InvCatalog fullExpand() throws IOException
IOException
- if DatasetSource does not reference a container dataset.protected abstract InvDataset createDataset(String datasetLocation, String prefixUrlPath) throws IOException
datasetLocation
- a String indicating the location of a dataset.prefixUrlPath
- a path name to be prefixed on the urlPathIOException
- if the dataset location does not correspond to an actual dataset or is not below the accessPointHeader directory.NullPointerException
- if the given dataset location is null.protected abstract boolean isCollection(InvDataset dataset)
dataset
- - the InvDataset to test for being a collection dataset.NullPointerException
- if the given InvDataset is null.ClassCastException
- if the given InvDataset is not a LocalInvDataset.protected abstract InvCatalog createSkeletonCatalog(String prefixUrlPath) throws IOException
prefixUrlPath
- IOException
- if top-level dataset does not exist or is not a collection dataset.protected abstract List expandThisLevel(InvDataset collectionDataset, String prefixUrlPath)
collectionDataset
- - the collection dataset to be expanded.prefixUrlPath
- IllegalArgumentException
- when given dataset is not a collection dataset.NullPointerException
- if given dataset is null.ClassCastException
- if the given InvDataset is not a LocalInvDataset.Copyright © 1999–2018 UCAR/Unidata. All rights reserved.