org.jclouds.rest
Class RetryAfterException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.jclouds.rest.RetryAfterException
All Implemented Interfaces:
Serializable

public class RetryAfterException
extends RuntimeException

This exception is raised when an http endpoint returns with a response telling the caller to make the same request after a certain period of time. Typically, this is returned with a 503 status code, as specified in the HttpHeaders.RETRY_AFTER header.

See Also:
Serialized Form

Constructor Summary
RetryAfterException(String message, int seconds)
          Construct an exception instance to happen at a time in the future
RetryAfterException(String message, Throwable cause, int seconds)
          Construct an exception instance to happen at a time in the future
RetryAfterException(Throwable cause, int seconds)
          Construct an exception instance to happen at a time in the future
 
Method Summary
 int getSeconds()
          Get the value of the retry time
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RetryAfterException

public RetryAfterException(String message,
                           int seconds)
Construct an exception instance to happen at a time in the future

Parameters:
message - message
seconds - retry after delta. Negative values are converted to zero

RetryAfterException

public RetryAfterException(Throwable cause,
                           int seconds)
Construct an exception instance to happen at a time in the future

Parameters:
cause - cause
seconds - retry after delta. Negative values are converted to zero

RetryAfterException

public RetryAfterException(String message,
                           Throwable cause,
                           int seconds)
Construct an exception instance to happen at a time in the future

Parameters:
message - message
cause - cause
seconds - retry after delta. Negative values are converted to zero
Method Detail

getSeconds

public int getSeconds()
Get the value of the retry time

Returns:
the retry time, in seconds. This is always zero or positive.


Copyright © 2009-2013 jclouds. All Rights Reserved.