Enum ApiRateLimitChecker
- java.lang.Object
-
- java.lang.Enum<ApiRateLimitChecker>
-
- org.jenkinsci.plugins.github_branch_source.ApiRateLimitChecker
-
- All Implemented Interfaces:
Serializable
,Comparable<ApiRateLimitChecker>
public enum ApiRateLimitChecker extends Enum<ApiRateLimitChecker>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description NoThrottle
Ignore GitHub API Rate limit.ThrottleForNormalize
Attempt to evenly distribute GitHub API requests.ThrottleOnOver
Restrict GitHub API requests only when near or above rate limit.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
checkApiRateLimit(TaskListener listener, org.kohsuke.github.GitHub gitHub)
Deprecated.rate limit checking is done automatically.static void
configureThreadLocalChecker(TaskListener listener, org.kohsuke.github.GitHub gitHub)
abstract org.jenkinsci.plugins.github_branch_source.ApiRateLimitChecker.LocalChecker
getChecker(TaskListener listener, String apiUrl)
String
getDisplayName()
static ApiRateLimitChecker
valueOf(String name)
Returns the enum constant of this type with the specified name.static ApiRateLimitChecker[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ThrottleForNormalize
public static final ApiRateLimitChecker ThrottleForNormalize
Attempt to evenly distribute GitHub API requests.
-
ThrottleOnOver
public static final ApiRateLimitChecker ThrottleOnOver
Restrict GitHub API requests only when near or above rate limit.
-
NoThrottle
public static final ApiRateLimitChecker NoThrottle
Ignore GitHub API Rate limit. Useful for GitHub Enterprise instances that might not have a limit set up.
-
-
Method Detail
-
values
public static ApiRateLimitChecker[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ApiRateLimitChecker c : ApiRateLimitChecker.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ApiRateLimitChecker valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getDisplayName
public String getDisplayName()
-
configureThreadLocalChecker
public static void configureThreadLocalChecker(@NonNull TaskListener listener, @NonNull org.kohsuke.github.GitHub gitHub)
-
checkApiRateLimit
@Deprecated public void checkApiRateLimit(TaskListener listener, org.kohsuke.github.GitHub gitHub) throws IOException, InterruptedException
Deprecated.rate limit checking is done automatically. UseconfigureThreadLocalChecker(TaskListener, GitHub)
instead.This method is the old code path for rate limit checksIt has been slowly refactored until it almost matches the behavior of the GitHubRateLimitChecker.
- Throws:
IOException
InterruptedException
-
getChecker
public abstract org.jenkinsci.plugins.github_branch_source.ApiRateLimitChecker.LocalChecker getChecker(@NonNull TaskListener listener, String apiUrl)
-
-