Class HarvestMonitor

    • Field Detail

      • HARVEST_MONITOR_CHANNEL_ID

        public static final ChannelID HARVEST_MONITOR_CHANNEL_ID
        The JMS channel on which to listen for CrawlProgressMessages.
    • Method Detail

      • cleanup

        public void cleanup()
        Close down the HarvestMonitor singleton. This removes the HarvestMonitor as listener to the JMS scheduler and frontier channels, closes the persistence container, and resets the singleton.
        Specified by:
        cleanup in interface CleanupIF
        See Also:
        CleanupIF.cleanup()
      • getInstance

        public static HarvestMonitor getInstance()
        Returns:
        the singleton instance for this class.
      • getAutoRefreshDelay

        public static final int getAutoRefreshDelay()
        Returns the delay in seconds after which a harvest monitor webpage should refresh itself. This delay is set by overriding the value of the HarvesterSettings.HARVEST_MONITOR_REFRESH_INTERVAL property.
        Returns:
        the delay in seconds after which a harvest monitor webpage should refresh itself
      • getMostRecentRunningJobInfos

        public static StartedJobInfo[] getMostRecentRunningJobInfos​(long jobId)
        Returns a configurable number of the most recent running job info records available for the given job ID.
        Parameters:
        jobId -
        Returns:
        the most recent running job info records available for the given job ID.
        See Also:
        HarvesterSettings.HARVEST_MONITOR_DISPLAYED_HISTORY_SIZE
      • getMostRecentRunningJobInfo

        public static StartedJobInfo getMostRecentRunningJobInfo​(long jobId)
        Returns the most recent running job info record available for the given job ID.
        Parameters:
        jobId -
        Returns:
        the most recent running job info records available for the given job ID.
      • getFrontierReport

        public static InMemoryFrontierReport getFrontierReport​(long jobId)
        Retrieves the latest frontier report stored for the given job ID.
        Parameters:
        jobId - the job id
        Returns:
        a frontier report
      • getFrontierReport

        public static InMemoryFrontierReport getFrontierReport​(long jobId,
                                                               boolean sort)
        Retrieve a frontier report from a job id, with limited results and possibility to sort by totalenqueues DESC
        Parameters:
        jobId - the job id
        limit - the limit of result to query
        sort - if true, sort the results by totalenqueues DESC
        Returns:
        a frontier report
      • getFrontierActiveAndInactiveQueuesReport

        public static InMemoryFrontierReport getFrontierActiveAndInactiveQueuesReport​(long jobId,
                                                                                      boolean sort)
        Retrieve a frontier report from a job id, with limited results and possibility to sort by totalenqueues DESC
        Parameters:
        jobId - the job id
        limit - the limit of result to query
        sort - if true, sort the results by totalenqueues DESC
        Returns:
        a frontier report
      • getFrontierRetiredQueues

        public static InMemoryFrontierReport getFrontierRetiredQueues​(long jobId)
        Retrieves the latest frontier extract report stored for the given job ID, that contains only retired queues.
        Parameters:
        jobId - the job id
        Returns:
        a frontier report that contains only retired queues.
      • getFrontierExhaustedQueues

        public static InMemoryFrontierReport getFrontierExhaustedQueues​(long jobId)
        Retrieves the latest frontier extract report stored for the given job ID, that contains only exhausted queues.
        Parameters:
        jobId - the job id
        Returns:
        a frontier report that contains only exhausted queues.
      • getChartFilePath

        public static String getChartFilePath​(long jobId)
        Returns the path of the chart image file, relative to the webapp directory. If no chart is available, returns a default empty image.
        Parameters:
        jobId - the job id
        Returns:
        the path of the chart image file, relative to the webapp directory.
      • getRunningJobs

        public Set<Long> getRunningJobs()