Top Description Fields Constructors Methods
org.glassfish.tyrus.client

public Class RetryAfterException

extends HandshakeException
Class Inheritance
Imports
jakarta.websocket.DeploymentException, .WebSocketContainer, org.glassfish.tyrus.core.HandshakeException, org.glassfish.tyrus.spi.UpgradeResponse

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
ClientManager.ReconnectHandler, ClientProperties#RETRY_AFTER_SERVICE_UNAVAILABLE

Field Summary

Modifier and TypeField and Description
private final Long

Constructor Summary

AccessConstructor and Description
public
RetryAfterException(String
the detail message. The detail message is saved for later retrieval by the getMessage() method.
message
,
Long
a delay to the time received handshake response in header.
delay
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public Long

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.
getDelay
()

Get a delay specified in Retry-After response header in seconds.

Inherited from org.glassfish.tyrus.core.HandshakeException:
getHttpStatusCode

Field Detail

delayback to summary
private final Long delay

Constructor Detail

RetryAfterExceptionback to summary
public RetryAfterException(String message, Long delay)

Constructor.

Parameters
message:String

the detail message. The detail message is saved for later retrieval by the getMessage() method.

delay:Long

a delay to the time received handshake response in header.

Method Detail

getDelayback to summary
public Long getDelay()

Get a delay specified in Retry-After response header in seconds.

Returns:Long

a delay in seconds or null when response does not contain Retry-After or the value cannot be parsed as long ot http-date.