Package org.jclouds.fallbacks
Class HeaderToRetryAfterException
java.lang.Object
org.jclouds.fallbacks.HeaderToRetryAfterException
- All Implemented Interfaces:
Fallback<Object>
,PropagateIfRetryAfter
@Beta
public final class HeaderToRetryAfterException
extends Object
implements PropagateIfRetryAfter
propagates as
RetryAfterException
if a Throwable is an
HttpResponseException
with a set
and a valid
HttpHeaders.RETRY_AFTER
header set.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic HeaderToRetryAfterException
if input is not of typeHttpResponseException
, this method propagates.com.google.common.base.Optional
<RetryAfterException> tryCreateRetryAfterException
(Throwable in, String retryAfter) returns aRetryAfterException
if parameterretryAfter
corresponds to known formats.
-
Method Details
-
create
public static HeaderToRetryAfterException create(com.google.common.base.Ticker ticker, DateCodec dateCodec) - Parameters:
ticker
- how to read current timedateCodec
- how to parse theHttpHeaders.RETRY_AFTER
header, if it is a Date.- Returns:
-
createOrPropagate
Description copied from interface:PropagateIfRetryAfter
if input is not of typeHttpResponseException
, this method propagates. Otherwise,null
, if didn't coerce toRetryAfterException
- Specified by:
createOrPropagate
in interfaceFallback<Object>
- Specified by:
createOrPropagate
in interfacePropagateIfRetryAfter
- Parameters:
t
- the exception that made the call fail.- Throws:
Exception
-
tryCreateRetryAfterException
public com.google.common.base.Optional<RetryAfterException> tryCreateRetryAfterException(Throwable in, String retryAfter) returns aRetryAfterException
if parameterretryAfter
corresponds to known formats.- See Also:
-