Class 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 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()
      • 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 interface ProxyDatasetHandler
        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 interface ProxyDatasetHandler
        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 interface ProxyDatasetHandler
        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.
      • 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 interface ProxyDatasetHandler
        Parameters:
        atomicDsInfo - a list of InvCrawlablePair objects representing a dataset collection.
        Returns:
        the InvCrawlablePair being proxied by this proxy dataset