@Beta public final class HeaderToRetryAfterException extends Object implements PropagateIfRetryAfter
RetryAfterException
if a Throwable is an
HttpResponseException
with a set
and a valid
HttpHeaders.RETRY_AFTER
header set.Modifier and Type | Method and Description |
---|---|
com.google.common.util.concurrent.ListenableFuture<Object> |
create(Throwable t)
if input is not of type
HttpResponseException , this method propagates. |
static HeaderToRetryAfterException |
create(com.google.common.base.Ticker ticker,
DateCodec dateCodec) |
com.google.common.base.Optional<RetryAfterException> |
tryCreateRetryAfterException(Throwable in,
String retryAfter)
returns a
RetryAfterException if parameter retryAfter
corresponds to known formats. |
public static HeaderToRetryAfterException create(com.google.common.base.Ticker ticker, DateCodec dateCodec)
ticker
- how to read current timedateParser
- how to parse the HttpHeaders.RETRY_AFTER
header, if it
is a Date.public com.google.common.util.concurrent.ListenableFuture<Object> create(Throwable t)
PropagateIfRetryAfter
HttpResponseException
, this method propagates. Otherwise, immediate future of
null
, if didn't coerce to RetryAfterException
create
in interface com.google.common.util.concurrent.FutureFallback<Object>
create
in interface PropagateIfRetryAfter
public com.google.common.base.Optional<RetryAfterException> tryCreateRetryAfterException(Throwable in, String retryAfter)
RetryAfterException
if parameter retryAfter
corresponds to known formats.Copyright © 2009-2013 jclouds. All Rights Reserved.