org.jclouds.http.functions
Class HeaderToRetryAfterException

java.lang.Object
  extended by org.jclouds.http.functions.HeaderToRetryAfterException
All Implemented Interfaces:
com.google.common.base.Function<Throwable,Void>, 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.

Author:
Adrian Cole
See Also:
Retry-After format

Method Summary
 Void apply(Throwable in)
           
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.common.base.Function
equals
 

Method Detail

create

public static HeaderToRetryAfterException create(com.google.common.base.Ticker ticker,
                                                 DateCodec dateCodec)
Parameters:
ticker - how to read current time
dateParser - how to parse the HttpHeaders.RETRY_AFTER header, if it is a Date.
Returns:

apply

public Void apply(Throwable in)
Specified by:
apply in interface com.google.common.base.Function<Throwable,Void>

tryCreateRetryAfterException

public com.google.common.base.Optional<RetryAfterException> tryCreateRetryAfterException(Throwable in,
                                                                                         String retryAfter)
returns a RetryAfterException if parameter retryAfter corresponds to known formats.

See Also:
Retry-After format


Copyright © 2009-2013 jclouds. All Rights Reserved.