Class RetryAfterException

All Implemented Interfaces:
Serializable

public class RetryAfterException extends HandshakeException
This exception is set as a cause of DeploymentException thrown from WebSocketContainer.connectToServer(...) when HTTP response status code 503 - Service Unavailable is received.
Author:
Ondrej Kosatka
See Also:
  • Constructor Details

    • RetryAfterException

      public RetryAfterException(String message, Long delay)
      Constructor.
      Parameters:
      message - the detail message. The detail message is saved for later retrieval by the Throwable.getMessage() method.
      delay - a delay to the time received handshake response in header.
  • Method Details

    • getDelay

      public Long getDelay()
      Get a delay specified in "Retry-After" response header in seconds.
      Returns:
      a delay in seconds or null when response does not contain "Retry-After" or the value cannot be parsed as long ot http-date.