Class CrawlerEntry

java.lang.Object
com.norconex.crawler.core.ledger.CrawlerEntry
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FsCrawlerEntry, WebCrawlerEntry

public class CrawlerEntry extends Object implements Serializable
Holds minimal meta information and state necessary to the proper (re)processing of a document in the context of a crawl. Also persisted in the CrawlerEntryLedger.
See Also:
  • Constructor Details

    • CrawlerEntry

      public CrawlerEntry()
    • CrawlerEntry

      public CrawlerEntry(String reference)
  • Method Details

    • withReference

      public CrawlerEntry withReference(String reference)
    • getReferenceTrail

      public List<String> getReferenceTrail()
      Gets original references before normalization, redirect, etc.
      Returns:
      reference trail up to, but excluding, the current one.
    • setReferenceTrail

      public void setReferenceTrail(List<String> referenceTrail)
      Sets original references before normalization, redirect, etc.
      Parameters:
      referenceTrail - reference trail up to, but excluding, the current one.
    • addToReferenceTrail

      public void addToReferenceTrail(String reference)
      Adds original references before normalization, redirect, etc.
      Parameters:
      reference - reference to append to the trail
    • getMetaChecksum

      public String getMetaChecksum()
    • setMetaChecksum

      public void setMetaChecksum(String metaChecksum)
    • getContentChecksum

      public String getContentChecksum()
      Gets the content checksum.
      Returns:
      the content checksum
    • setContentChecksum

      public void setContentChecksum(String contentChecksum)
      Sets the content checksum.
      Parameters:
      contentChecksum - content checksum
    • getQueuedAt

      public ZonedDateTime getQueuedAt()
      Gets the queued date.
      Returns:
      the queued date
    • setQueuedAt

      public void setQueuedAt(ZonedDateTime queuedAt)
      Sets the queued date.
      Parameters:
      queuedAt - the queued date
    • getDepth

      public int getDepth()
      Typically, the number of "hops" or directories to get to a file.
    • getProcessingStatus

      @NonNull public @NonNull ProcessingStatus getProcessingStatus()
    • getProcessingOutcome

      public ProcessingOutcome getProcessingOutcome()
    • getProcessingAt

      public ZonedDateTime getProcessingAt()
    • getProcessingNode

      public String getProcessingNode()
      The name of the node that last took this entry for processing, set when the entry turned ProcessingStatus.PROCESSING. If that node leaves the crawl before finishing it, another node puts the entry back in the queue.
    • getProcessingClaim

      public String getProcessingClaim()
      Identifies the taking of this entry for processing by getProcessingNode(), new each time it is taken. Lets the node processing it tell whether it still holds it before sending it to committers or recording its outcome.
    • isSending

      public boolean isSending()
      Whether the node holding this entry for processing started sending it (or documents found in it) to committers. If that node stops working on the crawl after that, the entry is processed again and may reach committers twice.
    • getProcessedAt

      public ZonedDateTime getProcessedAt()
    • getLastModified

      public ZonedDateTime getLastModified()
    • getContentType

      public ContentType getContentType()
    • getCharset

      public Charset getCharset()
    • isOrphan

      public boolean isOrphan()
    • isDeleted

      public boolean isDeleted()
    • getReference

      public String getReference()
    • getParentReference

      public String getParentReference()
      The reference of the document this one was split off from or found embedded in (a chunk of a text, a zip entry, an attachment), or null for a document that stands on its own.
    • getChildCount

      public int getChildCount()
      How many documents were split off from or found embedded in this one the last time it was processed. Zero for most documents. Only a count, never the references: a parent can have hundreds of thousands of children, and an entry is read and written many times in a crawl. When it is above zero, the children are found through their getParentReference().
    • setDepth

      public void setDepth(int depth)
      Typically, the number of "hops" or directories to get to a file.
    • setProcessingStatus

      public void setProcessingStatus(@NonNull @NonNull ProcessingStatus processingStatus)
    • setProcessingOutcome

      public void setProcessingOutcome(ProcessingOutcome processingOutcome)
    • setProcessingAt

      public void setProcessingAt(ZonedDateTime processingAt)
    • setProcessingNode

      public void setProcessingNode(String processingNode)
      The name of the node that last took this entry for processing, set when the entry turned ProcessingStatus.PROCESSING. If that node leaves the crawl before finishing it, another node puts the entry back in the queue.
    • setProcessingClaim

      public void setProcessingClaim(String processingClaim)
      Identifies the taking of this entry for processing by getProcessingNode(), new each time it is taken. Lets the node processing it tell whether it still holds it before sending it to committers or recording its outcome.
    • setSending

      public void setSending(boolean sending)
      Whether the node holding this entry for processing started sending it (or documents found in it) to committers. If that node stops working on the crawl after that, the entry is processed again and may reach committers twice.
    • setProcessedAt

      public void setProcessedAt(ZonedDateTime processedAt)
    • setLastModified

      public void setLastModified(ZonedDateTime lastModified)
    • setContentType

      public void setContentType(ContentType contentType)
    • setCharset

      public void setCharset(Charset charset)
    • setOrphan

      public void setOrphan(boolean orphan)
    • setDeleted

      public void setDeleted(boolean deleted)
    • setReference

      public void setReference(String reference)
    • setParentReference

      public void setParentReference(String parentReference)
      The reference of the document this one was split off from or found embedded in (a chunk of a text, a zip entry, an attachment), or null for a document that stands on its own.
    • setChildCount

      public void setChildCount(int childCount)
      How many documents were split off from or found embedded in this one the last time it was processed. Zero for most documents. Only a count, never the references: a parent can have hundreds of thousands of children, and an entry is read and written many times in a crawl. When it is above zero, the children are found through their getParentReference().
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object