Declare current observation context as available since 6.0.15

See gh-31609
See gh-31646
This commit is contained in:
Juergen Hoeller
2024-01-24 12:35:30 +01:00
parent 2f921dd13d
commit 199a675692
2 changed files with 41 additions and 32 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,10 +23,12 @@ import org.springframework.http.client.ClientHttpResponse;
import org.springframework.lang.Nullable;
/**
* Context that holds information for metadata collection
* during the {@link ClientHttpObservationDocumentation#HTTP_CLIENT_EXCHANGES client HTTP exchanges} observations.
* Context that holds information for metadata collection during the
* {@link ClientHttpObservationDocumentation#HTTP_CLIENT_EXCHANGES client HTTP exchanges} observations.
*
* <p>This context also extends {@link RequestReplySenderContext} for propagating tracing
* information with the HTTP client exchange.
*
* @author Brian Clozel
* @since 6.0
*/
@@ -35,6 +37,7 @@ public class ClientRequestObservationContext extends RequestReplySenderContext<C
@Nullable
private String uriTemplate;
/**
* Create an observation context for {@link ClientHttpRequest} observations.
* @param request the HTTP client request
@@ -50,13 +53,6 @@ public class ClientRequestObservationContext extends RequestReplySenderContext<C
}
}
/**
* Return the URI template used for the current client exchange, {@code null} if none was used.
*/
@Nullable
public String getUriTemplate() {
return this.uriTemplate;
}
/**
* Set the URI template used for the current client exchange.
@@ -65,4 +61,12 @@ public class ClientRequestObservationContext extends RequestReplySenderContext<C
this.uriTemplate = uriTemplate;
}
/**
* Return the URI template used for the current client exchange, {@code null} if none was used.
*/
@Nullable
public String getUriTemplate() {
return this.uriTemplate;
}
}