public class RetryPolicyFactory
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static RetryPolicy |
getBasicPolicy(int retries,
java.lang.Runnable runnableOnFail)
Policy that retries if there was an error on the request by status code.
|
static RetryPolicy |
getBasicPolicy(int retries,
java.lang.String scriptOnFail)
Policy that retries if there was an error on the request by status code.
|
static RetryPolicy |
getEmptyPolicy()
Policy that returns no error.
|
static RetryPolicy |
getMatchingRegexPolicy(int retries,
java.lang.String regex)
Policy that requires a Regular Expression to match the page content (including headers) in order to be considered valid.
|
static RetryPolicy |
getMatchingRegexPolicy(int retries,
java.lang.String regex,
java.lang.Runnable runnableOnFail)
Policy that requires a Regular Expression to match the page content (including headers) in order to be considered valid.
|
static RetryPolicy |
getMatchingRegexPolicy(int retries,
java.lang.String regex,
java.lang.String scriptOnFail)
Policy that requires a Regular Expression to match the page content (including headers) in order to be considered valid.
|
static RetryPolicy |
getMissingRegexPolicy(int retries,
java.lang.String regex)
Policy that requires a Regular Expression NOT to match the page content (including headers) in order to be considered valid.
|
static RetryPolicy |
getMissingRegexPolicy(int retries,
java.lang.String regex,
java.lang.Runnable runnableOnFail)
Policy that requires a Regular Expression NOT to match the page content (including headers) in order to be considered valid.
|
static RetryPolicy |
getMissingRegexPolicy(int retries,
java.lang.String regex,
java.lang.String scriptOnFail)
Policy that requires a Regular Expression NOT to match the page content (including headers) in order to be considered valid.
|
static RetryPolicy |
getMultiRegexPolicy(int retries,
java.util.Collection<java.lang.String> matchingRegex,
java.util.Collection<java.lang.String> missingRegex)
Policy that allows for multiple regex, with each being set to required or not.
|
static RetryPolicy |
getMultiRegexPolicy(int retries,
java.util.Collection<java.lang.String> matchingRegex,
java.util.Collection<java.lang.String> missingRegex,
java.lang.Runnable runnableOnFail)
Policy that allows for multiple regex, with each being set to required or not.
|
static RetryPolicy |
getMultiRegexPolicy(int retries,
java.util.Collection<java.lang.String> matchingRegex,
java.util.Collection<java.lang.String> missingRegex,
java.lang.String scriptOnFail)
Policy that allows for multiple regex, with each being set to required or not.
|
static RetryPolicy |
getRegexPolicy(int retries,
java.lang.String matchingRegex,
java.lang.String missingRegex)
Policy that allows for both a required regex and a regex that should not match.
|
static RetryPolicy |
getRegexPolicy(int retries,
java.lang.String matchingRegex,
java.lang.String missingRegex,
java.lang.Runnable runnableOnFail)
Policy that allows for both a required regex and a regex that should not match.
|
static RetryPolicy |
getRegexPolicy(int retries,
java.lang.String matchingRegex,
java.lang.String missingRegex,
java.lang.String scriptOnFail)
Policy that allows for both a required regex and a regex that should not match.
|
@NotNull public static RetryPolicy getEmptyPolicy()
@NotNull public static RetryPolicy getBasicPolicy(int retries, java.lang.String scriptOnFail)
retries
- How many times max to retry before failingscriptOnFail
- The name of the script to run@NotNull public static RetryPolicy getBasicPolicy(int retries, java.lang.Runnable runnableOnFail)
retries
- How many times max to retry before failingrunnableOnFail
- A Runnable to run before retrying@NotNull public static RetryPolicy getMatchingRegexPolicy(int retries, @NotNull java.lang.String regex)
retries
- How many times max to retry before failingregex
- A Regular expression that must match for the page to be considered valid@NotNull public static RetryPolicy getMatchingRegexPolicy(int retries, @NotNull java.lang.String regex, java.lang.String scriptOnFail)
retries
- How many times max to retry before failingregex
- A Regular expression that must match for the page to be considered validscriptOnFail
- The script to run before retrying@NotNull public static RetryPolicy getMatchingRegexPolicy(int retries, @NotNull java.lang.String regex, java.lang.Runnable runnableOnFail)
retries
- How many times max to retry before failingregex
- A Regular expression that must match for the page to be considered validrunnableOnFail
- The runnable to run before retrying@NotNull public static RetryPolicy getMissingRegexPolicy(int retries, @NotNull java.lang.String regex)
retries
- How many times max to retry before failingregex
- A Regular expression that must not match for the page to be considered valid@NotNull public static RetryPolicy getMissingRegexPolicy(int retries, @NotNull java.lang.String regex, java.lang.String scriptOnFail)
retries
- How many times max to retry before failingregex
- A Regular expression that must not match for the page to be considered validscriptOnFail
- The runnable to run before retrying@NotNull public static RetryPolicy getMissingRegexPolicy(int retries, @NotNull java.lang.String regex, java.lang.Runnable runnableOnFail)
retries
- How many times max to retry before failingregex
- A Regular expression that must not match for the page to be considered validrunnableOnFail
- The runnable to run before retrying@NotNull public static RetryPolicy getRegexPolicy(int retries, @NotNull java.lang.String matchingRegex, @NotNull java.lang.String missingRegex)
retries
- How many times max to retry before failingmatchingRegex
- A Regular expression that must match for the page to be considered validmissingRegex
- A Regular expression that must not match for the page to be considered valid@NotNull public static RetryPolicy getRegexPolicy(int retries, @NotNull java.lang.String matchingRegex, @NotNull java.lang.String missingRegex, java.lang.String scriptOnFail)
retries
- How many times max to retry before failingmatchingRegex
- A Regular expression that must match for the page to be considered validmissingRegex
- A Regular expression that must not match for the page to be considered validscriptOnFail
- The runnable to run before retrying@NotNull public static RetryPolicy getRegexPolicy(int retries, @NotNull java.lang.String matchingRegex, @NotNull java.lang.String missingRegex, java.lang.Runnable runnableOnFail)
retries
- How many times max to retry before failingmatchingRegex
- A Regular expression that must match for the page to be considered validmissingRegex
- A Regular expression that must not match for the page to be considered validrunnableOnFail
- The runnable to run before retrying@NotNull public static RetryPolicy getMultiRegexPolicy(int retries, @Nullable java.util.Collection<java.lang.String> matchingRegex, @Nullable java.util.Collection<java.lang.String> missingRegex)
retries
- How many times max to retry before failingmatchingRegex
- Regular Expressions that must match for the page to be valid. If this is null, no matchingRegex will be addedmissingRegex
- Regular Expressions that must not match for the page to be valid. If this is null, no missingRegex will be added@NotNull public static RetryPolicy getMultiRegexPolicy(int retries, @Nullable java.util.Collection<java.lang.String> matchingRegex, @Nullable java.util.Collection<java.lang.String> missingRegex, java.lang.String scriptOnFail)
retries
- How many times max to retry before failingmatchingRegex
- Regular Expressions that must match for the page to be valid. If this is null, no matchingRegex will be addedmissingRegex
- Regular Expressions that must not match for the page to be valid. If this is null, no missingRegex will be addedscriptOnFail
- The script to run before retrying@NotNull public static RetryPolicy getMultiRegexPolicy(int retries, @Nullable java.util.Collection<java.lang.String> matchingRegex, @Nullable java.util.Collection<java.lang.String> missingRegex, java.lang.Runnable runnableOnFail)
retries
- How many times max to retry before failingmatchingRegex
- Regular Expressions that must match for the page to be valid. If this is null, no matchingRegex will be addedmissingRegex
- Regular Expressions that must not match for the page to be valid. If this is null, no missingRegex will be addedrunnableOnFail
- The runnable to run before retrying