Package com.jcabi.github.wire
Class RetryCarefulWire
- java.lang.Object
-
- com.jcabi.github.wire.RetryCarefulWire
-
- All Implemented Interfaces:
com.jcabi.http.Wire
@Immutable public final class RetryCarefulWire extends Object implements com.jcabi.http.Wire
Wire that waits if the number of remaining requests per hour is less than a given threshold, and in the event ofIOException
retries a few times before giving up and rethrowing the exception.Just a wrapper for a
RetryWire
that wraps aCarefulWire
that wraps the underlying wire.You can use
RetryCarefulWire
with aGithub
object:Github github = new RtGithub( new RtGithub().entry().through(RetryCarefulWire.class, 50) );
- Since:
- 0.23
- Version:
- $Id: fd84d3dbf49f15221bf430a8703a19286db64256 $
- Author:
- Chris Rebert (github@chrisrebert.com)
-
-
Constructor Summary
Constructors Constructor Description RetryCarefulWire(com.jcabi.http.Wire wire, int threshold)
Public ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.jcabi.http.Response
send(com.jcabi.http.Request req, String home, String method, Collection<Map.Entry<String,String>> headers, InputStream content, int connect, int read)
-
-
-
Method Detail
-
send
public com.jcabi.http.Response send(com.jcabi.http.Request req, String home, String method, Collection<Map.Entry<String,String>> headers, InputStream content, int connect, int read) throws IOException
- Specified by:
send
in interfacecom.jcabi.http.Wire
- Throws:
IOException
-
-