Class WebEndpointResponse<T>
java.lang.Object
org.springframework.boot.actuate.endpoint.web.WebEndpointResponse<T>
- Type Parameters:
T
- the type of the response body
A
WebEndpointResponse
can be returned by an operation on a
@EndpointWebExtension
to provide additional, web-specific
information such as the HTTP status code.- Since:
- 2.0.0
- Author:
- Stephane Nicoll, Andy Wilkinson, Vedran Pavic
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
400 Bad Request
.static final int
500 Internal Server Error
.static final int
204 No Content
.static final int
404 Not Found
.static final int
200 OK
.static final int
503 Service Unavailable
.static final int
429 Too Many Requests
. -
Constructor Summary
ConstructorDescriptionCreates a newWebEndpointResponse
with no body and a 200 (OK) status.WebEndpointResponse
(int status) Creates a newWebEndpointResponse
with no body and the givenstatus
.WebEndpointResponse
(T body) Creates a newWebEndpointResponse
with the given body and a 200 (OK) status.WebEndpointResponse
(T body, int status) Creates a newWebEndpointResponse
with the given body and status.WebEndpointResponse
(T body, int status, MimeType contentType) Creates a newWebEndpointResponse
with the given body and status.WebEndpointResponse
(T body, Producible<?> producible) Creates a newWebEndpointResponse
with the given body and content type and a 200 (OK) status.WebEndpointResponse
(T body, MimeType contentType) Creates a newWebEndpointResponse
with the given body and content type and a 200 (OK) status. -
Method Summary
Modifier and TypeMethodDescriptiongetBody()
Returns the body for the response.Returns the content type of the response.int
Returns the status for the response.
-
Field Details
-
STATUS_OK
public static final int STATUS_OK200 OK
.- See Also:
-
STATUS_NO_CONTENT
public static final int STATUS_NO_CONTENT204 No Content
.- See Also:
-
STATUS_BAD_REQUEST
public static final int STATUS_BAD_REQUEST400 Bad Request
.- See Also:
-
STATUS_NOT_FOUND
public static final int STATUS_NOT_FOUND404 Not Found
.- See Also:
-
STATUS_TOO_MANY_REQUESTS
public static final int STATUS_TOO_MANY_REQUESTS429 Too Many Requests
.- See Also:
-
STATUS_INTERNAL_SERVER_ERROR
public static final int STATUS_INTERNAL_SERVER_ERROR500 Internal Server Error
.- See Also:
-
STATUS_SERVICE_UNAVAILABLE
public static final int STATUS_SERVICE_UNAVAILABLE503 Service Unavailable
.- See Also:
-
-
Constructor Details
-
WebEndpointResponse
public WebEndpointResponse()Creates a newWebEndpointResponse
with no body and a 200 (OK) status. -
WebEndpointResponse
public WebEndpointResponse(int status) Creates a newWebEndpointResponse
with no body and the givenstatus
.- Parameters:
status
- the HTTP status
-
WebEndpointResponse
Creates a newWebEndpointResponse
with the given body and a 200 (OK) status.- Parameters:
body
- the body
-
WebEndpointResponse
Creates a newWebEndpointResponse
with the given body and content type and a 200 (OK) status.- Parameters:
body
- the bodyproducible
- the producible providing the content type- Since:
- 2.5.0
-
WebEndpointResponse
Creates a newWebEndpointResponse
with the given body and content type and a 200 (OK) status.- Parameters:
body
- the bodycontentType
- the content type of the response- Since:
- 2.5.0
-
WebEndpointResponse
Creates a newWebEndpointResponse
with the given body and status.- Parameters:
body
- the bodystatus
- the HTTP status
-
WebEndpointResponse
Creates a newWebEndpointResponse
with the given body and status.- Parameters:
body
- the bodystatus
- the HTTP statuscontentType
- the content type of the response- Since:
- 2.5.0
-
-
Method Details
-
getContentType
Returns the content type of the response.- Returns:
- the content type;
-
getBody
Returns the body for the response.- Returns:
- the body
-
getStatus
public int getStatus()Returns the status for the response.- Returns:
- the status
-