Class HarvestStatus


  • public class HarvestStatus
    extends Object
    This page provides support for the HarvestStatus pages of the web interface.
    • Field Detail

      • log

        protected static final org.slf4j.Logger log
        The logger to use.
    • Constructor Detail

      • HarvestStatus

        public HarvestStatus​(long fullResultsCount,
                             List<JobStatusInfo> jobs)
        Constructor for the HarvestStatus class.
        Parameters:
        fullResultsCount - The total number of entries in the full resultset
        jobs - The list of jobs
    • Method Detail

      • getFullResultsCount

        public long getFullResultsCount()
        Returns:
        The total number in the full resultset
      • getJobStatusInfo

        public List<JobStatusInfo> getJobStatusInfo()
        Returns:
        The list of jobs in this HarvestStatus object.
      • processRequest

        public static void processRequest​(javax.servlet.jsp.PageContext context,
                                          I18n i18n)
                                   throws ForwardedToErrorPage
        Process a request from Harveststatus-alljobs.

        Will resubmit a job if requested, otherwise do nothing.

        Parameters:
        context - The web context used for processing
        i18n - The resource i18n context.
        Throws:
        ForwardedToErrorPage - If an error occurs that stops processing and forwards the user to an error page.
      • rejectFailedJob

        public static void rejectFailedJob​(javax.servlet.jsp.PageContext context,
                                           I18n i18n,
                                           Long jobID)
        Marks a failed job as rejected for resubmission. Throws a ForwardedToErrorPage if jobID is null or if it refers to a job that is not in the state FAILED to start with.
        Parameters:
        context - the context for forwarding errors
        i18n - the internationalisation to use
        jobID - the job to reject
      • unrejectRejectedJob

        public static void unrejectRejectedJob​(javax.servlet.jsp.PageContext context,
                                               I18n i18n,
                                               Long jobID)
        Marks as failed. Throws a ForwardedToErrorPage if the job is not in the state FAILED_REJECTED to start with.
        Parameters:
        context - the context for forwarding errors
        i18n - the internationalisation to use
        jobID - the job to unreject
      • makeHarvestRunLink

        public static String makeHarvestRunLink​(long harvestID,
                                                int harvestRun)
        Create a link to the harvest-run page for a given run.
        Parameters:
        harvestID - The ID of the harvest
        harvestRun - The run # of the harvest (always 0 for snapshots)
        Returns:
        A properly encoded HTML string with a link and the harvest run as the text. Select all jobs to be shown.
      • getjobStatusList

        public static HarvestStatus getjobStatusList​(HarvestStatusQuery query)
        Calculate list of job information to be shown.
        Parameters:
        query - the query with its filters.
        Returns:
        a list of job status info objects
      • isNextLinkActive

        public static boolean isNextLinkActive​(long pageSize,
                                               long totalResultsCount,
                                               long endIndex)
        Check if next link is active.
        Parameters:
        pageSize - the size of the page
        totalResultsCount - the number of results.
        endIndex - the index of the last result shown on this page
        Returns:
        true, if link to next page is active
      • isPreviousLinkActive

        public static boolean isPreviousLinkActive​(long pageSize,
                                                   long totalResultsCount,
                                                   long startIndex)
        Check if previous link is active.
        Parameters:
        pageSize - the size of the page
        totalResultsCount - the number of results.
        startIndex - the index of the first result shown on this page
        Returns:
        true, if link to previous page is active