dk.netarkivet.harvester.webinterface
Class HarvestStatus

java.lang.Object
  extended by dk.netarkivet.harvester.webinterface.HarvestStatus

public class HarvestStatus
extends java.lang.Object

This page provides support for the HarvestStatus pages of the web interface.


Field Summary
protected static org.apache.commons.logging.Log log
          The logger to use.
 
Constructor Summary
HarvestStatus(long fullResultsCount, java.util.List<JobStatusInfo> jobs)
          Constructor for the HarvestStatus class.
 
Method Summary
 long getFullResultsCount()
           
 java.util.List<JobStatusInfo> getJobStatusInfo()
           
static HarvestStatus getjobStatusList(HarvestStatusQuery query)
          Calculate list of job information to be shown.
static java.lang.String makeHarvestRunLink(long harvestID, int harvestRun)
          Create a link to the harvest-run page for a given run.
static void processRequest(javax.servlet.jsp.PageContext context, I18n i18n)
          Process a request from Harveststatus-alljobs.
static void rejectFailedJob(javax.servlet.jsp.PageContext context, I18n i18n, java.lang.Long jobID)
          Marks a failed job as rejected for resubmission.
static void unrejectRejectedJob(javax.servlet.jsp.PageContext context, I18n i18n, java.lang.Long jobID)
          Marks as failed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
The logger to use.

Constructor Detail

HarvestStatus

public HarvestStatus(long fullResultsCount,
                     java.util.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 java.util.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,
                                   java.lang.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,
                                       java.lang.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 java.lang.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