Package thredds.server.catalog
Class DataRootPathMatcher
- java.lang.Object
-
- thredds.server.catalog.DataRootPathMatcher
-
public class DataRootPathMatcher extends Object
Find the dataRoot path from the request, by getting the longest match. Use a TreeSet for minimum in-memory use. Keep the objects in a separate map that could be off-heap and persistent.- Since:
- 4/1/2015
-
-
Constructor Summary
Constructors Constructor Description DataRootPathMatcher(ConfigCatalogCache ccc, DataRootTracker tracker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddRoot(DatasetRootConfig config, String catalogRelPath, boolean checkDups)booleancontains(String path)See if this object already exists in the collectionDataRootconvert2DataRoot(DataRootExt dataRootExt)voidextractDataRoots(String catalogRelPath, List<thredds.client.catalog.Dataset> dsList, boolean checkDups, Map<String,String> idMap)Finds datasetScan, datasetFmrc Look for duplicate Ids (give message).DataRootfindDataRoot(String reqPath)Find the longest DataRoot match.StringfindLongestPathMatch(String reqPath)Find the longest path match.DataRootExtget(String path)Set<Map.Entry<String,DataRootExt>>getValues()Get an iterator over the dataRoot keys and values.
-
-
-
Constructor Detail
-
DataRootPathMatcher
public DataRootPathMatcher(ConfigCatalogCache ccc, DataRootTracker tracker)
-
-
Method Detail
-
contains
public boolean contains(String path)
See if this object already exists in the collection- Parameters:
path- find object that has this key- Returns:
- true if already contains the key
-
get
public DataRootExt get(String path)
-
getValues
public Set<Map.Entry<String,DataRootExt>> getValues()
Get an iterator over the dataRoot keys and values. debug- Returns:
- iterator
-
findLongestPathMatch
public String findLongestPathMatch(String reqPath)
Find the longest path match.- Parameters:
reqPath- find object with longest match where reqPath.startsWith( key)- Returns:
- the value whose key is the longest that matches path, or null if none
-
findDataRoot
public DataRoot findDataRoot(String reqPath)
Find the longest DataRoot match.- Parameters:
reqPath- find object with longest match where reqPath.startsWith( key)- Returns:
- the value whose key is the longest that matches path, or null if none
-
convert2DataRoot
@Nonnull public DataRoot convert2DataRoot(DataRootExt dataRootExt)
-
extractDataRoots
public void extractDataRoots(String catalogRelPath, List<thredds.client.catalog.Dataset> dsList, boolean checkDups, Map<String,String> idMap)
Finds datasetScan, datasetFmrc Look for duplicate Ids (give message). Dont follow catRefs.- Parameters:
dsList- the list of Dataset
-
addRoot
public boolean addRoot(DatasetRootConfig config, String catalogRelPath, boolean checkDups)
-
-