dk.netarkivet.harvester.harvesting.distribute
Class CrawlStatusMessage

java.lang.Object
  extended by dk.netarkivet.common.distribute.NetarkivetMessage
      extended by dk.netarkivet.harvester.distribute.HarvesterMessage
          extended by dk.netarkivet.harvester.harvesting.distribute.CrawlStatusMessage
All Implemented Interfaces:
java.io.Serializable

public class CrawlStatusMessage
extends HarvesterMessage
implements java.io.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

Field Summary
 
Fields inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
replyOfId
 
Constructor Summary
CrawlStatusMessage(long jobID, JobStatus statusCode)
          Alternate constructor, which does not have the DomainHarvestreport as argument.
CrawlStatusMessage(long jobID, JobStatus statusCode, HarvestReport harvestReport)
          Creates an instance of this class corresponding to a job.
 
Method Summary
 void accept(HarvesterMessageVisitor v)
          Should be implemented as a part of the visitor pattern.
 HarvestReport getDomainHarvestReport()
          Returns the generated domain harvest report object by this crawl job.
 java.lang.String getHarvestErrorDetails()
          Get-method for private field harvestErrorDetails.
 java.lang.String getHarvestErrors()
          Get-method for private field harvestErrors.
 long getJobID()
          Returns the jobID of this crawl job.
 JobStatus getStatusCode()
          Returns the status code of this crawl job.
 java.lang.String getUploadErrorDetails()
          Get-method for private field uploadErrorDetails.
 java.lang.String getUploadErrors()
          Get-method for private field uploadErrors.
 void setHarvestErrorDetails(java.lang.String harvestErrorDetails)
          Set-method for private field harvestErrorDetails.
 void setHarvestErrors(java.lang.String harvestErrors)
          Set-method for private field harvestErrors.
 void setUploadErrorDetails(java.lang.String uploadErrorDetails)
          Set-method for private field uploadErrorDetails.
 void setUploadErrors(java.lang.String uploadErrors)
          Set-method for private field uploadErrors.
 java.lang.String toString()
          Human readable version of object.
 
Methods inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
getErrMsg, getID, getReplyOfId, getReplyTo, getTo, hasBeenSent, isOk, setNotOk, setNotOk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 java.lang.String toString()
Human readable version of object.

Overrides:
toString in class NetarkivetMessage
Returns:
Human readable version of object.

getHarvestErrors

public java.lang.String getHarvestErrors()
Get-method for private field harvestErrors.

Returns:
harvestErrors

setHarvestErrors

public void setHarvestErrors(java.lang.String harvestErrors)
Set-method for private field harvestErrors.

Parameters:
harvestErrors - The value for harvest errors.
Throws:
ArgumentNotValid - if null argument

getHarvestErrorDetails

public java.lang.String getHarvestErrorDetails()
Get-method for private field harvestErrorDetails.

Returns:
harvestErrorDetails

setHarvestErrorDetails

public void setHarvestErrorDetails(java.lang.String harvestErrorDetails)
Set-method for private field harvestErrorDetails.

Parameters:
harvestErrorDetails - The value for harvest error details.
Throws:
ArgumentNotValid - if null argument

getUploadErrors

public java.lang.String getUploadErrors()
Get-method for private field uploadErrors.

Returns:
uploadErrors

setUploadErrors

public void setUploadErrors(java.lang.String uploadErrors)
Set-method for private field uploadErrors.

Parameters:
uploadErrors - The value for upload errors.
Throws:
ArgumentNotValid - if null argument

getUploadErrorDetails

public java.lang.String getUploadErrorDetails()
Get-method for private field uploadErrorDetails.

Returns:
uploadErrorDetails

setUploadErrorDetails

public void setUploadErrorDetails(java.lang.String uploadErrorDetails)
Set-method for private field uploadErrorDetails.

Parameters:
uploadErrorDetails - The value for upload error details.
Throws:
ArgumentNotValid - if null argument