@Component @DependsOn(value="CdmInit") public final class DataRootHandler extends Object implements org.springframework.beans.factory.InitializingBean
The "data roots" are read in from one or more trees of config catalogs and are defined by the datasetScan and datasetRoot elements in the config catalogs.
Uses the singleton design pattern.
| Modifier and Type | Class and Description |
|---|---|
static interface |
DataRootHandler.ConfigListener
To receive notice of TDS configuration events, implement this interface
and use the DataRootHandler.registerConfigListener() method to register
an instance with a DataRootHandler instance.
|
class |
DataRootHandler.DataRoot |
class |
DataRootHandler.DataRootMatch |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
DataRootHandler.DataRootMatch |
findDataRootMatch(javax.servlet.http.HttpServletRequest req)
Extract the DataRoot from the request.
|
DataRootHandler.DataRootMatch |
findDataRootMatch(String spath) |
InvCatalog |
getCatalog(String path,
URI baseURI)
If a catalog exists and is allowed (not filtered out) for the given path, return
the catalog as an InvCatalog.
|
CrawlableDataset |
getCrawlableDataset(String path)
Return the CrawlableDataset to which the given path maps, null if the
dataset does not exist or the matching InvDatasetScan filters out the
requested CrawlableDataset.
|
File |
getCrawlableDatasetAsFile(String path)
Return the java.io.File represented by the CrawlableDataset to which the
given path maps.
|
URI |
getCrawlableDatasetAsOpendapUri(String path)
Return the OPeNDAP URI represented by the CrawlableDataset to which the
given path maps.
|
InvDatasetFeatureCollection |
getFeatureCollection(String want) |
List<InvDatasetFeatureCollection> |
getFeatureCollections() |
static DataRootHandler |
getInstance()
Get the singleton.
|
org.jdom2.Element |
getNcML(String path)
Try to match the given path with all available data roots.
|
PathMatcher |
getPathMatcher() |
InvCatalog |
getProxyDatasetResolverCatalog(String path,
URI baseURI) |
void |
handleRequestForDataset(String path,
DataServiceProvider dsp,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Deprecated.
DO NOT USE
|
void |
handleRequestForProxyDatasetResolverCatalog(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Deprecated.
|
boolean |
hasDataRootMatch(String path)
Return true if the given path matches a dataRoot, otherwise return false.
|
void |
initCatalogs(List<String> configCatalogRoots) |
boolean |
isProxyDataset(String path) |
boolean |
isProxyDatasetResolver(String path) |
void |
makeDebugActions() |
boolean |
processReqForCatalog(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Deprecated.
Instead forward() request to
|
boolean |
processReqForLatestDataset(javax.servlet.http.HttpServlet servlet,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Deprecated.
Instead use
processReqForCatalog() which provides more general proxy dataset handling. |
boolean |
registerConfigListener(DataRootHandler.ConfigListener cl) |
void |
reinit()
Reinitialize lists of static catalogs, data roots, dataset Ids.
|
void |
setDataRootLocationAliasExpanders(Map<String,String> aliases) |
static void |
setInstance(DataRootHandler drh)
Initialize the DataRootHandler singleton instance.
|
boolean |
unregisterConfigListener(DataRootHandler.ConfigListener cl) |
public static void setInstance(DataRootHandler drh)
drh - the singleton instance of DataRootHandler being usedpublic static DataRootHandler getInstance()
IllegalStateException - if setInstance() has not been called.public void setDataRootLocationAliasExpanders(Map<String,String> aliases)
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic boolean registerConfigListener(DataRootHandler.ConfigListener cl)
public boolean unregisterConfigListener(DataRootHandler.ConfigListener cl)
public void reinit()
public List<InvDatasetFeatureCollection> getFeatureCollections()
public InvDatasetFeatureCollection getFeatureCollection(String want)
public DataRootHandler.DataRootMatch findDataRootMatch(javax.servlet.http.HttpServletRequest req)
req - the requestpublic DataRootHandler.DataRootMatch findDataRootMatch(String spath)
public boolean hasDataRootMatch(String path)
path - the request path, ie req.getServletPath() + req.getPathInfo()public CrawlableDataset getCrawlableDataset(String path) throws IOException
path - the request path.IOException - if an I/O error occurs while locating the requested dataset.public File getCrawlableDatasetAsFile(String path)
path - the request path.IllegalStateException - if the request is not for a descendant of (or the same as) the matching DatasetRoot collection location.public URI getCrawlableDatasetAsOpendapUri(String path)
path - the request path.IllegalStateException - if the request is not for a descendant of (or the same as) the matching DatasetRoot collection location.public boolean isProxyDataset(String path)
public boolean isProxyDatasetResolver(String path)
public InvCatalog getProxyDatasetResolverCatalog(String path, URI baseURI)
public void handleRequestForProxyDatasetResolverCatalog(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws IOException
IOExceptionpublic void handleRequestForDataset(String path, DataServiceProvider dsp, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws IOException
path - dsp - req - res - IOExceptionpublic boolean processReqForCatalog(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws IOException,
javax.servlet.ServletException
req - the requestres - the responseIOException - on I/O errorjavax.servlet.ServletException - on other errorspublic InvCatalog getCatalog(String path, URI baseURI)
path - the path for the requested catalog.baseURI - the base URI for the catalog, used to resolve relative URLs.public boolean processReqForLatestDataset(javax.servlet.http.HttpServlet servlet,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws IOException
processReqForCatalog() which provides more general proxy dataset handling.servlet - requesting servletreq - requestres - responseIOException - if have I/O trouble writing response.public org.jdom2.Element getNcML(String path)
path - the reletive path, ie req.getServletPath() + req.getPathInfo()public PathMatcher getPathMatcher()
public void makeDebugActions()
Copyright © 1999-2013 UCAR/Unidata. All Rights Reserved.