Class ProcessingOutcome

java.lang.Object
com.norconex.crawler.core.ledger.ProcessingOutcome
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
WebProcessingOutcome

public class ProcessingOutcome extends Object implements Serializable
Reference processing status.
See Also:
  • Field Details

    • NEW

      public static final ProcessingOutcome NEW
    • MODIFIED

      public static final ProcessingOutcome MODIFIED
    • UNMODIFIED

      public static final ProcessingOutcome UNMODIFIED
    • ERROR

      public static final ProcessingOutcome ERROR
    • REJECTED

      public static final ProcessingOutcome REJECTED
    • BAD_STATUS

      public static final ProcessingOutcome BAD_STATUS
    • DELETED

      public static final ProcessingOutcome DELETED
    • NOT_FOUND

      public static final ProcessingOutcome NOT_FOUND
    • PREMATURE

      public static final ProcessingOutcome PREMATURE
      For collectors that support it, this state indicates a previously crawled document is not yet ready to be re-crawled. It may or may not be re-crawled in the next crawl session (if ready).
    • NON_DOCUMENT

      public static final ProcessingOutcome NON_DOCUMENT
      The reference is a legitimate, successfully processed crawl entry that does not represent a document of its own. A file system folder is the archetype: it is queued, traversed, depth-tracked and yields its children, but there is nothing to send to a committer for the folder itself.

      This is deliberately distinct from REJECTED, which says two things at once: do not commit this and remove it from the target if it is there. The second half is right for a reference that could have been a document and no longer qualifies — a non-canonical URL, a page a rule now excludes — and wrong for one that was never eligible. A folder marked rejected was deleted from the target on every recrawl, for something that had never been sent there.

      Note this describes a ledger entry, not a fetch. It must not be used as a fetch response outcome: fetchers signal success with a good state, and MultiFetcher would otherwise keep trying further fetchers for a folder that was fetched perfectly well.

    • UNSUPPORTED

      public static final ProcessingOutcome UNSUPPORTED
      Typically when a reference cannot be processed since it is not supported by the collector or one of its configured component.
    • TOO_DEEP

      public static final ProcessingOutcome TOO_DEEP
  • Constructor Details

    • ProcessingOutcome

      protected ProcessingOutcome(String outcome)
      Constructor.
      Parameters:
      outcome - processing outcome
  • Method Details

    • isGoodState

      public boolean isGoodState()
      Returns whether a reference should be considered "good" (the corresponding document is not in a "bad" state, such as being rejected or produced an error. This implementation will consider as good these reference statuses: NEW, MODIFIED, UNMODIFIED, and PREMATURE. This method can be overridden to provide different logic for a valid reference.
      Returns:
      true if status is valid.
    • isGoodState

      public static boolean isGoodState(ProcessingOutcome state)
      Null-safe version of isGoodState(). A null state returns false.
      Parameters:
      state - the state to test
      Returns:
      true if status is valid.
    • isNewOrModified

      public boolean isNewOrModified()
      Returns whether a state indicates new or modified.
      Returns:
      true if new or modified
    • isSkipped

      public boolean isSkipped()
      Returns whether a state indicate the document is to be skipped (UNMODIFIED or PREMATURE).
      Returns:
      true if skipped
    • isOneOf

      public boolean isOneOf(ProcessingOutcome... states)
    • valueOf

      public static ProcessingOutcome valueOf(String state)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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