Package org.kohsuke.github
Class AbuseLimitHandler
java.lang.Object
org.kohsuke.github.GitHubAbuseLimitHandler
org.kohsuke.github.AbuseLimitHandler
Deprecated.
Pluggable strategy to determine what to do when the API abuse limit is hit.
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AbuseLimitHandlerDeprecated.static final intThe HTTP 429 Too Many Requests response status code indicates the user has sent too many requests in a given amount of time ("rate limiting").static final AbuseLimitHandlerDeprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidonError(IOException e, HttpURLConnection uc) Deprecated.voidonError(GitHubConnectorResponse connectorResponse) Deprecated.Called when the library encounters HTTP error indicating that the API abuse limit is reached.
-
Field Details
-
WAIT
Deprecated.Wait until the API abuse "wait time" is passed. -
FAIL
Deprecated.Fail immediately. -
TOO_MANY_REQUESTS
public static final int TOO_MANY_REQUESTSThe HTTP 429 Too Many Requests response status code indicates the user has sent too many requests in a given amount of time ("rate limiting"). A Retry-After header might be included to this response indicating how long to wait before making a new request. Why is this hardcoded here? The HttpURLConnection class is missing the status codes above 415, so the constant needs to be sourced from elsewhere.- See Also:
-
-
Constructor Details
-
AbuseLimitHandler
public AbuseLimitHandler()Deprecated.
-
-
Method Details
-
onError
Deprecated.Called when the library encounters HTTP error indicating that the API abuse limit is reached.Any exception thrown from this method will cause the request to fail, and the caller of github-api will receive an exception. If this method returns normally, another request will be attempted. For that to make sense, the implementation needs to wait for some time.
- Specified by:
onErrorin classGitHubAbuseLimitHandler- Parameters:
connectorResponse- Response information for this request.- Throws:
IOException- on failure- See Also:
-
onError
Deprecated.Called when the library encounters HTTP error indicating that the API abuse limit is reached.Any exception thrown from this method will cause the request to fail, and the caller of github-api will receive an exception. If this method returns normally, another request will be attempted. For that to make sense, the implementation needs to wait for some time.
- Parameters:
e- Exception from Java I/O layer. If you decide to fail the processing, you can throw this exception (or wrap this exception into another exception and throw it).uc- Connection that resulted in an error. Useful for accessing other response headers.- Throws:
IOException- on failure- See Also:
-
GitHubAbuseLimitHandler.