Package thredds.cataloggen
Class SimpleCatalogBuilder
- java.lang.Object
-
- thredds.cataloggen.SimpleCatalogBuilder
-
- All Implemented Interfaces:
CatalogBuilder
public class SimpleCatalogBuilder extends Object implements CatalogBuilder
Provide a simple interface for building single-level catalogs at any level of the specified collection.- Since:
- Nov 30, 2005 3:17:23 PM
-
-
Constructor Summary
Constructors Constructor Description SimpleCatalogBuilder(String collectionPath, CrawlableDataset collectionCrDs, String serviceName, String serviceTypeName, String serviceURL)
Construct a SimpleCatalogBuilder for a given collection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InvCatalogImpl
generateCatalog(CrawlableDataset catalogCrDs)
Return an InvCatalog for the level in the collection hierarchy specified by catalogPath.org.jdom2.Document
generateCatalogAsDocument(CrawlableDataset catalogCrDs)
Return a JDOM Document representation of the catalog for the level in the collection hierarchy specified by catalogPath.String
generateCatalogAsString(CrawlableDataset catalogCrDs)
Return a String containing the XML representation of the catalog for the level in the collection hierarchy specified by catalogPath.InvCatalogImpl
generateProxyDsResolverCatalog(CrawlableDataset catalogCrDs, ProxyDatasetHandler pdh)
Not supported by SimpleCatalogBuilder.CrawlableDataset
requestCrawlableDataset(String path)
Return the CrawlableDataset for the given path, null if this CatalogBuilder does not allow the requested CrawlableDataset.
-
-
-
Constructor Detail
-
SimpleCatalogBuilder
public SimpleCatalogBuilder(String collectionPath, CrawlableDataset collectionCrDs, String serviceName, String serviceTypeName, String serviceURL)
Construct a SimpleCatalogBuilder for a given collection.- Parameters:
collectionPath
- an path for the collection to be cataloged (used as the base of the generated URL, can be an empty string or null). If null, the collectionLevel final path segment is used.collectionCrDs
- the root level of the collection to be cataloged.serviceName
- specifies the name of the service to be used in the resulting catalogs.serviceTypeName
- specifies the THREDDS service type, e.g., "OPENDAP"serviceURL
- the base URL to the service
-
-
Method Detail
-
requestCrawlableDataset
public CrawlableDataset requestCrawlableDataset(String path)
Description copied from interface:CatalogBuilder
Return the CrawlableDataset for the given path, null if this CatalogBuilder does not allow the requested CrawlableDataset.This method can handle requests for regular datasets and proxy datasets.
- Specified by:
requestCrawlableDataset
in interfaceCatalogBuilder
- Parameters:
path
- the path of the requested CrawlableDataset- Returns:
- the CrawlableDataset for the given path or null if the path is not allowed by this CatalogBuilder either due to filtering or due to the path not being a descendant (or self) of the collection level path.
-
generateCatalog
public InvCatalogImpl generateCatalog(CrawlableDataset catalogCrDs) throws IOException
Description copied from interface:CatalogBuilder
Return an InvCatalog for the level in the collection hierarchy specified by catalogPath.- Specified by:
generateCatalog
in interfaceCatalogBuilder
- Parameters:
catalogCrDs
- the location in the collection at which to generate a catalog- Returns:
- an InvCatalog for the specified location
- Throws:
IOException
- if problems accessing the dataset collection.
-
generateProxyDsResolverCatalog
public InvCatalogImpl generateProxyDsResolverCatalog(CrawlableDataset catalogCrDs, ProxyDatasetHandler pdh) throws IOException
Not supported by SimpleCatalogBuilder.- Specified by:
generateProxyDsResolverCatalog
in interfaceCatalogBuilder
- Parameters:
catalogCrDs
- the location in the collection at which to generate a catalogpdh
- the ProxyDatasetHandler corresponding to the resolver request.- Returns:
- the catalog for a resolver request of the given proxy dataset.
- Throws:
IOException
-
generateCatalogAsDocument
public org.jdom2.Document generateCatalogAsDocument(CrawlableDataset catalogCrDs) throws IOException
Description copied from interface:CatalogBuilder
Return a JDOM Document representation of the catalog for the level in the collection hierarchy specified by catalogPath.- Specified by:
generateCatalogAsDocument
in interfaceCatalogBuilder
- Parameters:
catalogCrDs
- the location in the collection at which to generate a catalog- Returns:
- an org.jdom.Document representing the catalog for the specified location
- Throws:
IOException
- if problems accessing the dataset collection.
-
generateCatalogAsString
public String generateCatalogAsString(CrawlableDataset catalogCrDs) throws IOException
Description copied from interface:CatalogBuilder
Return a String containing the XML representation of the catalog for the level in the collection hierarchy specified by catalogPath.- Specified by:
generateCatalogAsString
in interfaceCatalogBuilder
- Parameters:
catalogCrDs
- the location in the collection at which to generate a catalog- Returns:
- a String containing the XML representation of the catalog for the specified location
- Throws:
IOException
- if problems accessing the dataset collection.
-
-