@@ -36,26 +36,26 @@ public class ComposeHttpStatusCodeChecker implements HttpStatusCodeChecker {
36
36
public ComposeHttpStatusCodeChecker (ComposeHttpStatusCodeCheckerConfig config ) {
37
37
// Handle deprecated configuration for backward compatibility.
38
38
if (areDeprecatedPropertiesUsed (config )) {
39
- notRetryableErrorStatusCodes = buildPredicate (config , config .getDeprecatedCodePrefix (),
40
- config .getDeprecatedErrorWhiteListPrefix (), DEFAULT_DEPRECATED_ERROR_CODES );
39
+ notRetryableErrorStatusCodes = buildPredicate (config , config .getErrorCodePrefix (),
40
+ config .getErrorWhiteListPrefix (), DEFAULT_DEPRECATED_ERROR_CODES );
41
41
retryableErrorStatusCodes = integer -> false ;
42
42
} else {
43
- retryableErrorStatusCodes = buildPredicate (config , config .getRetryableCodePrefix (),
44
- config .getRetryableWhiteListPrefix (), DEFAULT_RETRYABLE_ERROR_CODES );
45
- notRetryableErrorStatusCodes = buildPredicate (config , config .getErrorCodePrefix (),
46
- config .getErrorWhiteListPrefix (), DEFAULT_ERROR_CODES );
43
+ retryableErrorStatusCodes = buildPredicate (config , config .getRetryableErrorCodePrefix (),
44
+ config .getRetryableErrorWhiteListPrefix (), DEFAULT_RETRYABLE_ERROR_CODES );
45
+ notRetryableErrorStatusCodes =
46
+ buildPredicate (config , config .getNonRetryableErrorCodePrefix (),
47
+ config .getNonRetryableErrorWhiteListPrefix (), DEFAULT_ERROR_CODES );
47
48
}
48
49
}
49
50
50
51
private boolean areDeprecatedPropertiesUsed (ComposeHttpStatusCodeCheckerConfig config ) {
51
- boolean whiteListDefined =
52
- !isNullOrWhitespaceOnly (config .getDeprecatedErrorWhiteListPrefix ());
53
- boolean codeListDefined = !isNullOrWhitespaceOnly (config .getDeprecatedCodePrefix ());
52
+ boolean whiteListDefined = !isNullOrWhitespaceOnly (config .getErrorWhiteListPrefix ());
53
+ boolean codeListDefined = !isNullOrWhitespaceOnly (config .getErrorCodePrefix ());
54
54
55
55
return (whiteListDefined && !isNullOrWhitespaceOnly (
56
- config .getProperties ().getProperty (config .getDeprecatedErrorWhiteListPrefix ())))
57
- || (codeListDefined && !isNullOrWhitespaceOnly (
58
- config .getProperties ().getProperty (config .getDeprecatedCodePrefix ())));
56
+ config .getProperties ().getProperty (config .getErrorWhiteListPrefix ()))) ||
57
+ (codeListDefined && !isNullOrWhitespaceOnly (
58
+ config .getProperties ().getProperty (config .getErrorCodePrefix ())));
59
59
}
60
60
61
61
private Predicate <Integer > buildPredicate (
@@ -157,17 +157,17 @@ public HttpResponseStatus checkStatus(int statusCode) {
157
157
@ RequiredArgsConstructor (access = AccessLevel .PRIVATE )
158
158
public static class ComposeHttpStatusCodeCheckerConfig {
159
159
160
- private final String deprecatedErrorWhiteListPrefix ;
161
-
162
- private final String deprecatedCodePrefix ;
163
-
164
160
private final String errorWhiteListPrefix ;
165
161
166
162
private final String errorCodePrefix ;
167
163
168
- private final String retryableWhiteListPrefix ;
164
+ private final String nonRetryableErrorWhiteListPrefix ;
165
+
166
+ private final String nonRetryableErrorCodePrefix ;
167
+
168
+ private final String retryableErrorWhiteListPrefix ;
169
169
170
- private final String retryableCodePrefix ;
170
+ private final String retryableErrorCodePrefix ;
171
171
172
172
private final Properties properties ;
173
173
}
0 commit comments