File tree Expand file tree Collapse file tree 4 files changed +19
-14
lines changed
spring-boot-actuator/src/main/java/org/springframework/boot/actuate Expand file tree Collapse file tree 4 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public AuditEventsWebEndpointExtension(AuditEventsEndpoint delegate) {
42
42
public WebEndpointResponse <AuditEventsDescriptor > eventsWithPrincipalDateAfterAndType (
43
43
String principal , Date after , String type ) {
44
44
if (after == null ) {
45
- return new WebEndpointResponse <>(WebEndpointResponse .BAD_REQUEST_STATUS );
45
+ return new WebEndpointResponse <>(WebEndpointResponse .STATUS_BAD_REQUEST );
46
46
}
47
47
AuditEventsDescriptor auditEvents = this .delegate
48
48
.eventsWithPrincipalDateAfterAndType (principal , after , type );
Original file line number Diff line number Diff line change @@ -34,27 +34,32 @@ public final class WebEndpointResponse<T> {
34
34
/**
35
35
* {@code 200 OK}.
36
36
*/
37
- public static final int OK_STATUS = 200 ;
37
+ public static final int STATUS_OK = 200 ;
38
38
39
39
/**
40
40
* {@code 400 Bad Request}.
41
41
*/
42
- public static final int BAD_REQUEST_STATUS = 400 ;
42
+ public static final int STATUS_BAD_REQUEST = 400 ;
43
+
44
+ /**
45
+ * {@code 404 Not Found}.
46
+ */
47
+ public static final int STATUS_NOT_FOUND = 404 ;
43
48
44
49
/**
45
50
* {@code 429 Too Many Requests}.
46
51
*/
47
- public static final int TOO_MANY_REQUESTS_STATUS = 429 ;
52
+ public static final int STATUS_TOO_MANY_REQUESTS = 429 ;
48
53
49
54
/**
50
55
* {@code 500 Internal Server Error}.
51
56
*/
52
- public static final int INTERNAL_SERVER_ERROR_STATUS = 500 ;
57
+ public static final int STATUS_INTERNAL_SERVER_ERROR = 500 ;
53
58
54
59
/**
55
60
* {@code 503 Service Unavailable}.
56
61
*/
57
- public static final int SERVICE_UNAVAILABLE_STATUS = 503 ;
62
+ public static final int STATUS_SERVICE_UNAVAILABLE = 503 ;
58
63
59
64
private final T body ;
60
65
@@ -82,7 +87,7 @@ public WebEndpointResponse(int status) {
82
87
* @param body the body
83
88
*/
84
89
public WebEndpointResponse (T body ) {
85
- this (body , OK_STATUS );
90
+ this (body , STATUS_OK );
86
91
}
87
92
88
93
/**
Original file line number Diff line number Diff line change @@ -41,9 +41,9 @@ public HealthStatusHttpMapper() {
41
41
}
42
42
43
43
private void setupDefaultStatusMapping () {
44
- addStatusMapping (Status .DOWN , WebEndpointResponse .SERVICE_UNAVAILABLE_STATUS );
44
+ addStatusMapping (Status .DOWN , WebEndpointResponse .STATUS_SERVICE_UNAVAILABLE );
45
45
addStatusMapping (Status .OUT_OF_SERVICE ,
46
- WebEndpointResponse .SERVICE_UNAVAILABLE_STATUS );
46
+ WebEndpointResponse .STATUS_SERVICE_UNAVAILABLE );
47
47
}
48
48
49
49
/**
@@ -105,9 +105,9 @@ public int mapStatus(Status status) {
105
105
return this .statusMapping .keySet ().stream ()
106
106
.filter ((key ) -> code .equals (getUniformValue (key )))
107
107
.map (this .statusMapping ::get ).findFirst ()
108
- .orElse (WebEndpointResponse .OK_STATUS );
108
+ .orElse (WebEndpointResponse .STATUS_OK );
109
109
}
110
- return WebEndpointResponse .OK_STATUS ;
110
+ return WebEndpointResponse .STATUS_OK ;
111
111
}
112
112
113
113
private String getUniformValue (String code ) {
Original file line number Diff line number Diff line change @@ -89,13 +89,13 @@ public WebEndpointResponse<Resource> heapDump(Boolean live) {
89
89
}
90
90
catch (IOException ex ) {
91
91
return new WebEndpointResponse <>(
92
- WebEndpointResponse .INTERNAL_SERVER_ERROR_STATUS );
92
+ WebEndpointResponse .STATUS_INTERNAL_SERVER_ERROR );
93
93
}
94
94
catch (HeapDumperUnavailableException ex ) {
95
95
return new WebEndpointResponse <>(
96
- WebEndpointResponse .SERVICE_UNAVAILABLE_STATUS );
96
+ WebEndpointResponse .STATUS_SERVICE_UNAVAILABLE );
97
97
}
98
- return new WebEndpointResponse <>(WebEndpointResponse .TOO_MANY_REQUESTS_STATUS );
98
+ return new WebEndpointResponse <>(WebEndpointResponse .STATUS_TOO_MANY_REQUESTS );
99
99
}
100
100
101
101
private Resource dumpHeap (boolean live ) throws IOException , InterruptedException {
You can’t perform that action at this time.
0 commit comments