34
34
import org .springframework .web .server .ServerWebExchange ;
35
35
36
36
/**
37
- * {@code ApiDeprecationHandler } based on
37
+ * {@code ApiVersionDeprecationHandler } based on
38
38
* <a href="https://datatracker.ietf.org/doc/html/rfc9745">RFC 9745</a> and
39
39
* <a href="https://datatracker.ietf.org/doc/html/rfc8594">RFC 8594</a> that
40
40
* provides the option to set the "Deprecation" and "Sunset" response headers,
46
46
* @author Rossen Stoyanchev
47
47
* @since 7.0
48
48
*/
49
- public class StandardApiDeprecationHandler implements ApiDeprecationHandler {
49
+ public class StandardApiVersionDeprecationHandler implements ApiVersionDeprecationHandler {
50
50
51
51
private final ApiVersionParser <?> versionParser ;
52
52
@@ -58,9 +58,9 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler {
58
58
* <p>By default, {@link SemanticApiVersionParser} is used to parse configured
59
59
* API versions, so those can be compared to request versions parsed at runtime.
60
60
* If you have a custom parser, then please use the
61
- * {@link #StandardApiDeprecationHandler (ApiVersionParser)} constructor.
61
+ * {@link #StandardApiVersionDeprecationHandler (ApiVersionParser)} constructor.
62
62
*/
63
- public StandardApiDeprecationHandler () {
63
+ public StandardApiVersionDeprecationHandler () {
64
64
this (new SemanticApiVersionParser ());
65
65
}
66
66
@@ -69,7 +69,7 @@ public StandardApiDeprecationHandler() {
69
69
* This needs to be the same as the parser type used at runtime to parse
70
70
* request versions.
71
71
*/
72
- public StandardApiDeprecationHandler (ApiVersionParser <?> parser ) {
72
+ public StandardApiVersionDeprecationHandler (ApiVersionParser <?> parser ) {
73
73
this .versionParser = parser ;
74
74
}
75
75
@@ -108,7 +108,7 @@ public void handleVersion(Comparable<?> requestVersion, ServerWebExchange exchan
108
108
109
109
@ Override
110
110
public String toString () {
111
- return "StandardApiDeprecationHandler " + this .infos .values ();
111
+ return "StandardApiVersionDeprecationHandler " + this .infos .values ();
112
112
}
113
113
114
114
@@ -121,7 +121,7 @@ public final class VersionSpec {
121
121
122
122
private VersionSpec (Comparable <?> version ) {
123
123
this .version = version ;
124
- StandardApiDeprecationHandler .this .infos .put (version , new VersionInfo (version ));
124
+ StandardApiVersionDeprecationHandler .this .infos .put (version , new VersionInfo (version ));
125
125
}
126
126
127
127
/**
@@ -197,7 +197,7 @@ public VersionSpec setSunsetLink(URI uri, MediaType mediaType) {
197
197
}
198
198
199
199
private VersionSpec map (Function <VersionInfo , VersionInfo > function ) {
200
- StandardApiDeprecationHandler .this .infos .compute (this .version , (version , versionInfo ) -> {
200
+ StandardApiVersionDeprecationHandler .this .infos .compute (this .version , (version , versionInfo ) -> {
201
201
Assert .state (versionInfo != null , "No VersionInfo" );
202
202
return function .apply (versionInfo );
203
203
});
0 commit comments