Class CrawlStatusMessage

  • All Implemented Interfaces:
    Serializable

    public class CrawlStatusMessage
    extends HarvesterMessage
    implements Serializable
    Instances of this class are sent by a HarvestControllerServer to the THE_SCHED queue to indicate the progress of a heritrix crawl. They are collected and processed by the HarvestSchedulerMonitorServer.

    This class is immutable

    See Also:
    Serialized Form
    • Constructor Detail

      • CrawlStatusMessage

        public CrawlStatusMessage​(long jobID,
                                  JobStatus statusCode,
                                  HarvestReport harvestReport)
        Creates an instance of this class corresponding to a job.
        Parameters:
        jobID - the unique identifier for the crawl job to which this message refers
        statusCode - All values are accepted, except null
        harvestReport - A calculated domain harvest report produced by the crawl. May be null for no domain harvest report.
        Throws:
        ArgumentNotValid - If invalid arguments: jobID < 0L statusCode == null
      • CrawlStatusMessage

        public CrawlStatusMessage​(long jobID,
                                  JobStatus statusCode)
        Alternate constructor, which does not have the DomainHarvestreport as argument.
        Parameters:
        jobID - (see description for the other constructor)
        statusCode - (see description for the other constructor)
        See Also:
        CrawlStatusMessage(long, JobStatus, HarvestReport)
    • Method Detail

      • getJobID

        public long getJobID()
        Returns the jobID of this crawl job.
        Returns:
        the jobID
      • getStatusCode

        public JobStatus getStatusCode()
        Returns the status code of this crawl job.
        Returns:
        the status code
      • getDomainHarvestReport

        public HarvestReport getDomainHarvestReport()
        Returns the generated domain harvest report object by this crawl job. May be null on non-finished status, or job finished with no log file
        Returns:
        the hosts report.
      • accept

        public void accept​(HarvesterMessageVisitor v)
        Should be implemented as a part of the visitor pattern. fx.: public void accept(HarvesterMessageVisitor v) { v.visit(this); }
        Specified by:
        accept in class HarvesterMessage
        Parameters:
        v - A message visitor
      • toString

        public String toString()
        Human readable version of object.
        Overrides:
        toString in class NetarkivetMessage
        Returns:
        Human readable version of object.
      • getHarvestErrors

        public String getHarvestErrors()
        Get-method for private field harvestErrors.
        Returns:
        harvestErrors
      • setHarvestErrors

        public void setHarvestErrors​(String harvestErrors)
        Set-method for private field harvestErrors.
        Parameters:
        harvestErrors - The value for harvest errors.
        Throws:
        ArgumentNotValid - if null argument
      • getHarvestErrorDetails

        public String getHarvestErrorDetails()
        Get-method for private field harvestErrorDetails.
        Returns:
        harvestErrorDetails
      • setHarvestErrorDetails

        public void setHarvestErrorDetails​(String harvestErrorDetails)
        Set-method for private field harvestErrorDetails.
        Parameters:
        harvestErrorDetails - The value for harvest error details.
        Throws:
        ArgumentNotValid - if null argument
      • getUploadErrors

        public String getUploadErrors()
        Get-method for private field uploadErrors.
        Returns:
        uploadErrors
      • setUploadErrors

        public void setUploadErrors​(String uploadErrors)
        Set-method for private field uploadErrors.
        Parameters:
        uploadErrors - The value for upload errors.
        Throws:
        ArgumentNotValid - if null argument
      • getUploadErrorDetails

        public String getUploadErrorDetails()
        Get-method for private field uploadErrorDetails.
        Returns:
        uploadErrorDetails
      • setUploadErrorDetails

        public void setUploadErrorDetails​(String uploadErrorDetails)
        Set-method for private field uploadErrorDetails.
        Parameters:
        uploadErrorDetails - The value for upload error details.
        Throws:
        ArgumentNotValid - if null argument