Package org.glassfish.tyrus.client
Class RetryAfterException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.glassfish.tyrus.core.HandshakeException
org.glassfish.tyrus.client.RetryAfterException
- All Implemented Interfaces:
Serializable
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetDelay()
Get a delay specified in "Retry-After" response header in seconds.Methods inherited from class org.glassfish.tyrus.core.HandshakeException
getHttpStatusCode
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
RetryAfterException
Constructor.- Parameters:
message
- the detail message. The detail message is saved for later retrieval by theThrowable.getMessage()
method.delay
- a delay to the time received handshake response in header.
-
-
Method Details
-
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 othttp-date
.
-