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 CrawlableDataset
createProxyDataset(CrawlableDataset parent)
Create a new dataset to add to the parent collection dataset.InvCrawlablePair
getActualDataset(List atomicDsInfo)
Determine the InvCrawlablePair from the given dataset collection (java.util.List) being proxied by this ProxyDatasetHandler.String
getActualDatasetName(InvCrawlablePair actualDataset, String baseName)
Object
getConfigObject()
Return the configuration object.long
getLastModifiedLimit()
String
getName()
int
getProxyDatasetLocation(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.String
getProxyDatasetName()
Return the name of the proxy dataset.InvService
getProxyDatasetService(CrawlableDataset parent)
Return the InvService to be used by the InvDataset that corresponds to the created dataset.String
getServiceName()
boolean
isLocateAtTopOrBottom()
boolean
isProxyDatasetResolver()
-
-
-
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:ProxyDatasetHandler
Return the name of the proxy dataset.- Specified by:
getProxyDatasetName
in interfaceProxyDatasetHandler
- Returns:
- the name of the proxy dataset.
-
getConfigObject
public Object getConfigObject()
Description copied from interface:ProxyDatasetHandler
Return the configuration object.- Specified by:
getConfigObject
in interfaceProxyDatasetHandler
- Returns:
- the configuration Object (may be null).
-
createProxyDataset
public CrawlableDataset createProxyDataset(CrawlableDataset parent)
Description copied from interface:ProxyDatasetHandler
Create a new dataset to add to the parent collection dataset.- Specified by:
createProxyDataset
in 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:ProxyDatasetHandler
Return the InvService to be used by the InvDataset that corresponds to the created dataset.- Specified by:
getProxyDatasetService
in 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:ProxyDatasetHandler
Return an integer which indicates the location/index at which the new dataset should be added to the parent collection dataset.- Specified by:
getProxyDatasetLocation
in 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:
isProxyDatasetResolver
in interfaceProxyDatasetHandler
-
getActualDataset
public InvCrawlablePair getActualDataset(List atomicDsInfo)
Description copied from interface:ProxyDatasetHandler
Determine the InvCrawlablePair from the given dataset collection (java.util.List) being proxied by this ProxyDatasetHandler.- Specified by:
getActualDataset
in 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:
getActualDatasetName
in interfaceProxyDatasetHandler
-
-