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:
java.io.Serializable
public class RetryAfterException extends HandshakeException
This exception is set as a cause ofDeploymentException
thrown fromWebSocketContainer
.connectToServer(...) when HTTP response status code503 - Service Unavailable
is received.- Author:
- Ondrej Kosatka
- See Also:
ClientManager.ReconnectHandler
,ClientProperties.RETRY_AFTER_SERVICE_UNAVAILABLE
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RetryAfterException(java.lang.String message, java.lang.Long delay)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Long
getDelay()
Get a delay specified in "Retry-After" response header in seconds.-
Methods inherited from class org.glassfish.tyrus.core.HandshakeException
getHttpStatusCode
-
-
-
-
Constructor Detail
-
RetryAfterException
public RetryAfterException(java.lang.String message, java.lang.Long delay)
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 Detail
-
getDelay
public java.lang.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 othttp-date
.
-
-