18
18
19
19
import static com .google .common .base .Preconditions .checkNotNull ;
20
20
21
- import com .google .errorprone .annotations .InlineMe ;
22
21
import io .grpc .CallOptions ;
23
22
import io .grpc .Channel ;
24
23
import io .grpc .ClientCall ;
25
24
import io .grpc .ClientInterceptor ;
26
- import io .grpc .ExperimentalApi ;
27
25
import io .grpc .ForwardingClientCall .SimpleForwardingClientCall ;
28
26
import io .grpc .ForwardingClientCallListener .SimpleForwardingClientCallListener ;
29
27
import io .grpc .Metadata ;
@@ -38,24 +36,6 @@ public final class MetadataUtils {
38
36
// Prevent instantiation
39
37
private MetadataUtils () {}
40
38
41
- /**
42
- * Attaches a set of request headers to a stub.
43
- *
44
- * @param stub to bind the headers to.
45
- * @param extraHeaders the headers to be passed by each call on the returned stub.
46
- * @return an implementation of the stub with {@code extraHeaders} bound to each call.
47
- * @deprecated Use {@code stub.withInterceptors(newAttachHeadersInterceptor(...))} instead.
48
- */
49
- @ ExperimentalApi ("https://github.com/grpc/grpc-java/issues/1789" )
50
- @ Deprecated
51
- @ InlineMe (
52
- replacement =
53
- "stub.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(extraHeaders))" ,
54
- imports = "io.grpc.stub.MetadataUtils" )
55
- public static <T extends AbstractStub <T >> T attachHeaders (T stub , Metadata extraHeaders ) {
56
- return stub .withInterceptors (newAttachHeadersInterceptor (extraHeaders ));
57
- }
58
-
59
39
/**
60
40
* Returns a client interceptor that attaches a set of headers to requests.
61
41
*
@@ -97,31 +77,6 @@ public void start(Listener<RespT> responseListener, Metadata headers) {
97
77
}
98
78
}
99
79
100
- /**
101
- * Captures the last received metadata for a stub. Useful for testing
102
- *
103
- * @param stub to capture for
104
- * @param headersCapture to record the last received headers
105
- * @param trailersCapture to record the last received trailers
106
- * @return an implementation of the stub that allows to access the last received call's
107
- * headers and trailers via {@code headersCapture} and {@code trailersCapture}.
108
- * @deprecated Use {@code stub.withInterceptors(newCaptureMetadataInterceptor())} instead.
109
- */
110
- @ ExperimentalApi ("https://github.com/grpc/grpc-java/issues/1789" )
111
- @ Deprecated
112
- @ InlineMe (
113
- replacement =
114
- "stub.withInterceptors(MetadataUtils.newCaptureMetadataInterceptor(headersCapture,"
115
- + " trailersCapture))" ,
116
- imports = "io.grpc.stub.MetadataUtils" )
117
- public static <T extends AbstractStub <T >> T captureMetadata (
118
- T stub ,
119
- AtomicReference <Metadata > headersCapture ,
120
- AtomicReference <Metadata > trailersCapture ) {
121
- return stub .withInterceptors (
122
- newCaptureMetadataInterceptor (headersCapture , trailersCapture ));
123
- }
124
-
125
80
/**
126
81
* Captures the last received metadata on a channel. Useful for testing.
127
82
*
0 commit comments