Package thredds.cataloggen.inserter
Class LatestCompleteProxyDsHandler
- java.lang.Object
-
- thredds.cataloggen.inserter.LatestCompleteProxyDsHandler
-
- All Implemented Interfaces:
ProxyDatasetHandler
public class LatestCompleteProxyDsHandler extends Object implements ProxyDatasetHandler
Adds a latest complete dataset to a collection where the latest is determined by the creation date stamp and the last modified date. The dataset name is assumed to provide a creation date stamp that sorted lexigraphically gives the most recent dataset at the end of the list. Any datasets whose last modified date (CrawlableDataset.lastModified()) is more recent than the present time minus the given lastModifiedLimit.- Since:
- Nov 29, 2005 12:12:53 PM
-
-
Constructor Summary
Constructors Constructor Description LatestCompleteProxyDsHandler(String latestName, boolean locateAtTopOrBottom, InvService service, boolean isResolver, long lastModifiedLimit)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CrawlableDatasetcreateProxyDataset(CrawlableDataset parent)Create a new dataset to add to the parent collection dataset.InvCrawlablePairgetActualDataset(List atomicDsInfo)Determine the InvCrawlablePair from the given dataset collection (java.util.List) being proxied by this ProxyDatasetHandler.StringgetActualDatasetName(InvCrawlablePair actualDataset, String baseName)ObjectgetConfigObject()Return the configuration object.longgetLastModifiedLimit()StringgetName()intgetProxyDatasetLocation(CrawlableDataset parent, int collectionDatasetSize)Return an integer which indicates the location/index at which the new dataset should be added to the parent collection dataset.StringgetProxyDatasetName()Return the name of the proxy dataset.InvServicegetProxyDatasetService(CrawlableDataset parent)Return the InvService to be used by the InvDataset that corresponds to the created dataset.StringgetServiceName()booleanisLocateAtTopOrBottom()booleanisProxyDatasetResolver()
-
-
-
Constructor Detail
-
LatestCompleteProxyDsHandler
public LatestCompleteProxyDsHandler(String latestName, boolean locateAtTopOrBottom, InvService service, boolean isResolver, long lastModifiedLimit)
Constructor. The latestName is used as the name of latest dataset created. The location for the placement of the latest dataset is given by locateAtTopOrBottom (true - locate on top; false - locate on bottom).- Parameters:
latestName- the name to be used for all latest dataset, if null, the default is "latest.xml".locateAtTopOrBottom- indicates where to locate the latest dataset (true - locate on top; false - locate on bottom).service- the InvService used by the created dataset.lastModifiedLimit- only use datasets whose lastModified() time is at least this many minutes in the past
-
-
Method Detail
-
getName
public String getName()
-
isLocateAtTopOrBottom
public boolean isLocateAtTopOrBottom()
-
getServiceName
public String getServiceName()
-
getLastModifiedLimit
public long getLastModifiedLimit()
-
getProxyDatasetName
public String getProxyDatasetName()
Description copied from interface:ProxyDatasetHandlerReturn the name of the proxy dataset.- Specified by:
getProxyDatasetNamein interfaceProxyDatasetHandler- Returns:
- the name of the proxy dataset.
-
getConfigObject
public Object getConfigObject()
Description copied from interface:ProxyDatasetHandlerReturn the configuration object.- Specified by:
getConfigObjectin interfaceProxyDatasetHandler- Returns:
- the configuration Object (may be null).
-
createProxyDataset
public CrawlableDataset createProxyDataset(CrawlableDataset parent)
Description copied from interface:ProxyDatasetHandlerCreate a new dataset to add to the parent collection dataset.- Specified by:
createProxyDatasetin interfaceProxyDatasetHandler- Parameters:
parent- the collection dataset in which to add the dataset being created.- Returns:
- A new CrawlableDataset to be added to the parent dataset (in the InvDataset arena).
-
getProxyDatasetService
public InvService getProxyDatasetService(CrawlableDataset parent)
Description copied from interface:ProxyDatasetHandlerReturn the InvService to be used by the InvDataset that corresponds to the created dataset.- Specified by:
getProxyDatasetServicein interfaceProxyDatasetHandler- Parameters:
parent- the collection dataset in which to add the dataset being created.- Returns:
- the InvService used by the InvDataset that corresponds to the created dataset.
-
getProxyDatasetLocation
public int getProxyDatasetLocation(CrawlableDataset parent, int collectionDatasetSize)
Description copied from interface:ProxyDatasetHandlerReturn an integer which indicates the location/index at which the new dataset should be added to the parent collection dataset.- Specified by:
getProxyDatasetLocationin interfaceProxyDatasetHandler- Parameters:
parent- the collection dataset in which to add the dataset being created.collectionDatasetSize- the number of datasets currentlyin the parent collection dataset.- Returns:
- The location at which the new dataset is to be added to the parent collection dataset.
-
isProxyDatasetResolver
public boolean isProxyDatasetResolver()
- Specified by:
isProxyDatasetResolverin interfaceProxyDatasetHandler
-
getActualDataset
public InvCrawlablePair getActualDataset(List atomicDsInfo)
Description copied from interface:ProxyDatasetHandlerDetermine the InvCrawlablePair from the given dataset collection (java.util.List) being proxied by this ProxyDatasetHandler.- Specified by:
getActualDatasetin interfaceProxyDatasetHandler- Parameters:
atomicDsInfo- a list of InvCrawlablePair objects representing a dataset collection.- Returns:
- the InvCrawlablePair being proxied by this proxy dataset
-
getActualDatasetName
public String getActualDatasetName(InvCrawlablePair actualDataset, String baseName)
- Specified by:
getActualDatasetNamein interfaceProxyDatasetHandler
-
-