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).
    • 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