public interface RetryPolicy
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,?> |
getErrorChecksMap()
Returns a map that can be used to output an error message to indicate what checks failed.
|
int |
getMaxRetryAttempts()
Return the maximum number of times this policy allows for a retry before terminating in an error
|
boolean |
isError()
Checks to see if the page loaded incorrectly
|
boolean |
resetReferrerBeforeRescrape()
Returns true if the referrer should be reset before attempting to rescrape the file, if there was an error.
|
boolean |
resetSessionVariablesBeforeRescrape()
Returns true if the session variables should be reset before attempting to rescrape the file, if there was an error.
|
void |
runOnAllAttemptsFailed()
This will be called if all the retry attempts for the scrapeable file failed.
|
void |
runOnError()
Runs this code when the page had an error.
|
boolean |
shouldLogErrors()
Returns true if errors should be logged to the log/web interface when they occur
|
boolean isError() throws java.lang.Exception
java.lang.Exception
- If something goes wrong while executing this methodvoid runOnError() throws java.lang.Exception
java.lang.Exception
- If something goes wrong while executing this method@Nullable java.util.Map<java.lang.String,?> getErrorChecksMap() throws java.lang.Exception
java.lang.Exception
- If something goes wrong while executing this methodboolean resetSessionVariablesBeforeRescrape()
runOnError()
boolean resetReferrerBeforeRescrape()
runOnError()
boolean shouldLogErrors()
int getMaxRetryAttempts()
void runOnAllAttemptsFailed() throws java.lang.Exception
runOnError()
will be called just before this, as it is called after each time the scrapeable file fails to load
correctly, including the last time it fails to load.
This should only contain code that handles the final error. Any proxy rotating, cookie clearing, etc... should generally be done in the runOnError()
method, especially since it will still be called after the final error.java.lang.Exception
- If the contents of this method throw an exception in the child class