Top Description Fields Constructors Methods
javax.ws.rs

public Class ServiceUnavailableException

extends ServerErrorException
Class Inheritance
Imports
java.util.Date, javax.ws.rs.core.HttpHeaders, .Response, javax.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(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(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(String
the detail message (which is saved for later retrieval by the getMessage() method).
message
,
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(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(String
the detail message (which is saved for later retrieval by the getMessage() method).
message
,
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(Response
error response.
response
)

Construct a new "service unavailable" exception.

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

Construct a new "service unavailable" exception.

public
ServiceUnavailableException(Date
a date/time after which the failed request may be retried.
retryAfter
,
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(String
the detail message (which is saved for later retrieval by the getMessage() method).
message
,
Date
a date/time after which the failed request may be retried.
retryAfter
,
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(Long
decimal interval in seconds after which the failed request may be retried.
retryAfter
,
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(String
the detail message (which is saved for later retrieval by the getMessage() method).
message
,
Long
decimal interval in seconds after which the failed request may be retried.
retryAfter
,
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(Response
error response.
response
,
Throwable
the underlying cause of the exception.
cause
)

Construct a new "service unavailable" exception.

public
ServiceUnavailableException(String
the detail message (which is saved for later retrieval by the getMessage() method).
message
,
Response
error response.
response
,
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 retry the request.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.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(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(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(String message, 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(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(String message, 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(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(String message, 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(Date retryAfter, 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(String message, Date retryAfter, 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(Long retryAfter, 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(String message, Long retryAfter, 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(Response response, 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(String message, Response response, 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 retry the request.

Returns:boolean

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