Top Description Fields Constructors Methods
jakarta.ws.rs

public Class ServiceUnavailableException

extends ServerErrorException
Class Inheritance
Imports
java.util.Date, jakarta.ws.rs.core.Response, jakarta.ws.rs.ext.RuntimeDelegate

A runtime exception indicating that the requested resource cannot be served.
Author
Marek Potociar
Since
2.0

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
ServiceUnavailableException()

Construct a new "service unavailable" exception without any "Retry-After" information specified for the failed request.

public
ServiceUnavailableException(final String
the detail message (which is saved for later retrieval by the getMessage() method).
message
)

Construct a new "service unavailable" exception without any "Retry-After" information specified for the failed request.

public
ServiceUnavailableException(final Long
decimal interval in seconds after which the failed request may be retried.
retryAfter
)

Construct a new "service unavailable" exception with an interval specifying the "Retry-After" information for the failed request.

public
ServiceUnavailableException(final String
the detail message (which is saved for later retrieval by the getMessage() method).
message
,
final Long
decimal interval in seconds after which the failed request may be retried.
retryAfter
)

Construct a new "service unavailable" exception with an interval specifying the "Retry-After" information for the failed request.

public
ServiceUnavailableException(final Date
a date/time after which the failed request may be retried.
retryAfter
)

Construct a new "service unavailable" exception with an interval specifying the "Retry-After" information for the failed request.

public
ServiceUnavailableException(final String
the detail message (which is saved for later retrieval by the getMessage() method).
message
,
final Date
a date/time after which the failed request may be retried.
retryAfter
)

Construct a new "service unavailable" exception with an interval specifying the "Retry-After" information for the failed request.

public
ServiceUnavailableException(final Response
error response.
response
)

Construct a new "service unavailable" exception.

public
ServiceUnavailableException(final String
the detail message (which is saved for later retrieval by the getMessage() method).
message
,
final Response
error response.
response
)

Construct a new "service unavailable" exception.

public
ServiceUnavailableException(final Date
a date/time after which the failed request may be retried.
retryAfter
,
final Throwable
the underlying cause of the exception.
cause
)

Construct a new "service unavailable" exception with a date specifying the "Retry-After" information for the failed request and an underlying request failure cause.

public
ServiceUnavailableException(final String
the detail message (which is saved for later retrieval by the getMessage() method).
message
,
final Date
a date/time after which the failed request may be retried.
retryAfter
,
final Throwable
the underlying cause of the exception.
cause
)

Construct a new "service unavailable" exception with a date specifying the "Retry-After" information for the failed request and an underlying request failure cause.

public
ServiceUnavailableException(final Long
decimal interval in seconds after which the failed request may be retried.
retryAfter
,
final Throwable
the underlying cause of the exception.
cause
)

Construct a new "service unavailable" exception with an interval specifying the "Retry-After" information for the failed request and an underlying request failure cause.

public
ServiceUnavailableException(final String
the detail message (which is saved for later retrieval by the getMessage() method).
message
,
final Long
decimal interval in seconds after which the failed request may be retried.
retryAfter
,
final Throwable
the underlying cause of the exception.
cause
)

Construct a new "service unavailable" exception with an interval specifying the "Retry-After" information for the failed request and an underlying request failure cause.

public
ServiceUnavailableException(final Response
error response.
response
,
final Throwable
the underlying cause of the exception.
cause
)

Construct a new "service unavailable" exception.

public
ServiceUnavailableException(final String
the detail message (which is saved for later retrieval by the getMessage() method).
message
,
final Response
error response.
response
,
final Throwable
the underlying cause of the exception.
cause
)

Construct a new "service unavailable" exception.

Method Summary

Modifier and TypeMethod and Description
public Date

Returns:

time when the request may be retried or null if there is no retry information available.
getRetryTime
(final Date
time of sending the original request that may be used to compute the retry time (in case the retry time information specified as a decimal interval in seconds).
requestTime
)

Get the retry time for the failed request.

public boolean

Returns:

true in case the retry time is specified in the underlying response, false otherwise.
hasRetryAfter
()

Check if the underlying response contains the information on when is it possible to jakarta.ws.rs.core.HttpHeaders#RETRY_AFTER retry the request.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides jakarta.ws.rs.ServerErrorException.serialVersionUID.

Constructor Detail

ServiceUnavailableExceptionback to summary
public ServiceUnavailableException()

Construct a new "service unavailable" exception without any "Retry-After" information specified for the failed request.

ServiceUnavailableExceptionback to summary
public ServiceUnavailableException(final String message)

Construct a new "service unavailable" exception without any "Retry-After" information specified for the failed request.

Parameters
message:String

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

ServiceUnavailableExceptionback to summary
public ServiceUnavailableException(final Long retryAfter)

Construct a new "service unavailable" exception with an interval specifying the "Retry-After" information for the failed request.

Parameters
retryAfter:Long

decimal interval in seconds after which the failed request may be retried.

ServiceUnavailableExceptionback to summary
public ServiceUnavailableException(final String message, final Long retryAfter)

Construct a new "service unavailable" exception with an interval specifying the "Retry-After" information for the failed request.

Parameters
message:String

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

retryAfter:Long

decimal interval in seconds after which the failed request may be retried.

ServiceUnavailableExceptionback to summary
public ServiceUnavailableException(final Date retryAfter)

Construct a new "service unavailable" exception with an interval specifying the "Retry-After" information for the failed request.

Parameters
retryAfter:Date

a date/time after which the failed request may be retried.

ServiceUnavailableExceptionback to summary
public ServiceUnavailableException(final String message, final Date retryAfter)

Construct a new "service unavailable" exception with an interval specifying the "Retry-After" information for the failed request.

Parameters
message:String

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

retryAfter:Date

a date/time after which the failed request may be retried.

ServiceUnavailableExceptionback to summary
public ServiceUnavailableException(final Response response)

Construct a new "service unavailable" exception.

Parameters
response:Response

error response.

Exceptions
IllegalArgumentException:
in case the status code set in the response is not HTTP 503.
ServiceUnavailableExceptionback to summary
public ServiceUnavailableException(final String message, final Response response)

Construct a new "service unavailable" exception.

Parameters
message:String

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

response:Response

error response.

Exceptions
IllegalArgumentException:
in case the status code set in the response is not HTTP 503.
ServiceUnavailableExceptionback to summary
public ServiceUnavailableException(final Date retryAfter, final Throwable cause)

Construct a new "service unavailable" exception with a date specifying the "Retry-After" information for the failed request and an underlying request failure cause.

Parameters
retryAfter:Date

a date/time after which the failed request may be retried.

cause:Throwable

the underlying cause of the exception.

ServiceUnavailableExceptionback to summary
public ServiceUnavailableException(final String message, final Date retryAfter, final Throwable cause)

Construct a new "service unavailable" exception with a date specifying the "Retry-After" information for the failed request and an underlying request failure cause.

Parameters
message:String

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

retryAfter:Date

a date/time after which the failed request may be retried.

cause:Throwable

the underlying cause of the exception.

ServiceUnavailableExceptionback to summary
public ServiceUnavailableException(final Long retryAfter, final Throwable cause)

Construct a new "service unavailable" exception with an interval specifying the "Retry-After" information for the failed request and an underlying request failure cause.

Parameters
retryAfter:Long

decimal interval in seconds after which the failed request may be retried.

cause:Throwable

the underlying cause of the exception.

ServiceUnavailableExceptionback to summary
public ServiceUnavailableException(final String message, final Long retryAfter, final Throwable cause)

Construct a new "service unavailable" exception with an interval specifying the "Retry-After" information for the failed request and an underlying request failure cause.

Parameters
message:String

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

retryAfter:Long

decimal interval in seconds after which the failed request may be retried.

cause:Throwable

the underlying cause of the exception.

ServiceUnavailableExceptionback to summary
public ServiceUnavailableException(final Response response, final Throwable cause)

Construct a new "service unavailable" exception.

Parameters
response:Response

error response.

cause:Throwable

the underlying cause of the exception.

Exceptions
IllegalArgumentException:
in case the status code set in the response is not HTTP 503.
ServiceUnavailableExceptionback to summary
public ServiceUnavailableException(final String message, final Response response, final Throwable cause)

Construct a new "service unavailable" exception.

Parameters
message:String

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

response:Response

error response.

cause:Throwable

the underlying cause of the exception.

Exceptions
IllegalArgumentException:
in case the status code set in the response is not HTTP 503.

Method Detail

getRetryTimeback to summary
public Date getRetryTime(final Date requestTime)

Get the retry time for the failed request.

Parameters
requestTime:Date

time of sending the original request that may be used to compute the retry time (in case the retry time information specified as a decimal interval in seconds).

Returns:Date

time when the request may be retried or null if there is no retry information available.

Exceptions
NullPointerException:
in case the requestTime parameter is null.
hasRetryAfterback to summary
public boolean hasRetryAfter()

Check if the underlying response contains the information on when is it possible to jakarta.ws.rs.core.HttpHeaders#RETRY_AFTER retry the request.

Returns:boolean

true in case the retry time is specified in the underlying response, false otherwise.