@Response(code=428, description="Precondition Required") public class PreconditionRequired extends HttpException
The origin server requires the request to be conditional.
Intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.
Modifier and Type | Field and Description |
---|---|
static int |
CODE
HTTP status code
|
static String |
MESSAGE
Default message
|
Constructor and Description |
---|
PreconditionRequired()
Constructor.
|
PreconditionRequired(String msg)
Constructor.
|
PreconditionRequired(String msg,
Object... args)
Constructor.
|
PreconditionRequired(Throwable cause)
Constructor.
|
PreconditionRequired(Throwable cause,
String msg,
Object... args)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
PreconditionRequired |
header(String name,
Object val)
Add an HTTP header to this exception.
|
getFullStackMessage, getHeaders, getRootCause, getStatus, hashCode, setStatus, toString
getCause, getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public static final int CODE
public static final String MESSAGE
public PreconditionRequired(Throwable cause, String msg, Object... args)
cause
- The cause. Can be msg
- The message. Can be args
- Optional MessageFormat
-style arguments in the message.public PreconditionRequired(String msg)
msg
- The message. Can be public PreconditionRequired()
public PreconditionRequired(String msg, Object... args)
msg
- The message. Can be args
- Optional MessageFormat
-style arguments in the message.public PreconditionRequired(Throwable cause)
cause
- The cause. Can be public PreconditionRequired header(String name, Object val)
HttpException
header
in class HttpException
name
- The header name.val
- The header value.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.