Package com.norconex.crawler.core.ledger
Class ProcessingOutcome
java.lang.Object
com.norconex.crawler.core.ledger.ProcessingOutcome
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
WebProcessingOutcome
Reference processing status.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ProcessingOutcomestatic final ProcessingOutcomestatic final ProcessingOutcomestatic final ProcessingOutcomestatic final ProcessingOutcomestatic final ProcessingOutcomestatic final ProcessingOutcomeFor collectors that support it, this state indicates a previously crawled document is not yet ready to be re-crawled.static final ProcessingOutcomestatic final ProcessingOutcomestatic final ProcessingOutcomestatic final ProcessingOutcomeTypically when a reference cannot be processed since it is not supported by the collector or one of its configured component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleaninthashCode()booleanReturns whether a reference should be considered "good" (the corresponding document is not in a "bad" state, such as being rejected or produced an error.static booleanisGoodState(ProcessingOutcome state) Null-safe version ofisGoodState().booleanReturns whether a state indicates new or modified.booleanisOneOf(ProcessingOutcome... states) booleanReturns whether a state indicate the document is to be skipped (UNMODIFIEDorPREMATURE).toString()static ProcessingOutcome
-
Field Details
-
NEW
-
MODIFIED
-
UNMODIFIED
-
ERROR
-
REJECTED
-
BAD_STATUS
-
DELETED
-
NOT_FOUND
-
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
Typically when a reference cannot be processed since it is not supported by the collector or one of its configured component. -
TOO_DEEP
-
-
Constructor Details
-
ProcessingOutcome
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, andPREMATURE. This method can be overridden to provide different logic for a valid reference.- Returns:
trueif status is valid.
-
isGoodState
- Parameters:
state- the state to test- Returns:
trueif status is valid.
-
isNewOrModified
public boolean isNewOrModified()Returns whether a state indicates new or modified.- Returns:
trueif new or modified
-
isSkipped
public boolean isSkipped()Returns whether a state indicate the document is to be skipped (UNMODIFIEDorPREMATURE).- Returns:
trueif skipped
-
isOneOf
-
valueOf
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-