Class CrawlStatusMessage
- java.lang.Object
-
- dk.netarkivet.common.distribute.NetarkivetMessage
-
- dk.netarkivet.harvester.distribute.HarvesterMessage
-
- dk.netarkivet.harvester.harvesting.distribute.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
-
-
Field Summary
-
Fields inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
replyOfId
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.String
getHarvestErrorDetails()
Get-method for private field harvestErrorDetails.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.String
getUploadErrorDetails()
Get-method for private field uploadErrorDetails.String
getUploadErrors()
Get-method for private field uploadErrors.void
setHarvestErrorDetails(String harvestErrorDetails)
Set-method for private field harvestErrorDetails.void
setHarvestErrors(String harvestErrors)
Set-method for private field harvestErrors.void
setUploadErrorDetails(String uploadErrorDetails)
Set-method for private field uploadErrorDetails.void
setUploadErrors(String uploadErrors)
Set-method for private field uploadErrors.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
-
-
-
-
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 refersstatusCode
- All values are accepted, except nullharvestReport
- 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 classHarvesterMessage
- Parameters:
v
- A message visitor
-
toString
public String toString()
Human readable version of object.- Overrides:
toString
in classNetarkivetMessage
- 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
-
-