Package org.kohsuke.github
Class RateLimitHandler
- java.lang.Object
-
- org.kohsuke.github.GitHubRateLimitHandler
-
- org.kohsuke.github.RateLimitHandler
-
@Deprecated public abstract class RateLimitHandler extends GitHubRateLimitHandler
Deprecated.Switch toGitHubRateLimitHandler
or even better provideRateLimitChecker
s.Pluggable strategy to determine what to do when the API rate limit is reached.- Author:
- Kohsuke Kawaguchi
- See Also:
GitHubBuilder#withRateLimitHandler(GitHubRateLimitHandler)
,AbuseLimitHandler
-
-
Field Summary
Fields Modifier and Type Field Description static RateLimitHandler
FAIL
Deprecated.static RateLimitHandler
WAIT
Deprecated.
-
Constructor Summary
Constructors Constructor Description RateLimitHandler()
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract void
onError(IOException e, HttpURLConnection uc)
Deprecated.void
onError(GitHubConnectorResponse connectorResponse)
Deprecated.Called when the library encounters HTTP error indicating that the API rate limit has been exceeded.
-
-
-
Field Detail
-
WAIT
@Deprecated public static final RateLimitHandler WAIT
Deprecated.Block until the API rate limit is reset. Useful for long-running batch processing.
-
FAIL
@Deprecated public static final RateLimitHandler FAIL
Deprecated.Fail immediately.
-
-
Method Detail
-
onError
public void onError(@Nonnull GitHubConnectorResponse connectorResponse) throws IOException
Deprecated.Called when the library encounters HTTP error indicating that the API rate limit has been exceeded.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:
onError
in classGitHubRateLimitHandler
- Parameters:
connectorResponse
- Response information for this request.- Throws:
IOException
- the io exception- See Also:
- API documentation from GitHub
-
onError
@Deprecated public abstract void onError(IOException e, HttpURLConnection uc) throws IOException
Deprecated.Called when the library encounters HTTP error indicating that the API rate 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
- the io exception- See Also:
- API documentation from GitHub
-
-