aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerry Wilson <tmwilson@google.com>2023-05-22 09:59:53 -0700
committerGitHub <noreply@github.com>2023-05-22 09:59:53 -0700
commitdd2dc21de21f13ae5542e2b0cfdb71764505bcc1 (patch)
treedf3633c7a6a4eb76c0a44e3bbbd41d9c717b5bd3
parent478f30e6458a72957106b44657608b9cd4ee6c1b (diff)
downloadgrpc-grpc-java-dd2dc21de21f13ae5542e2b0cfdb71764505bcc1.tar.gz
api: Stabilize io.grpc.CallCredentials (#10208)
-rw-r--r--api/src/main/java/io/grpc/CallCredentials.java12
-rw-r--r--api/src/main/java/io/grpc/CompositeCallCredentials.java3
-rw-r--r--api/src/test/java/io/grpc/CompositeCallCredentialsTest.java2
-rw-r--r--auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java3
-rw-r--r--core/src/test/java/io/grpc/internal/FakeCallCredentials.java2
5 files changed, 6 insertions, 16 deletions
diff --git a/api/src/main/java/io/grpc/CallCredentials.java b/api/src/main/java/io/grpc/CallCredentials.java
index 1d353fb9f..4ad1f52c1 100644
--- a/api/src/main/java/io/grpc/CallCredentials.java
+++ b/api/src/main/java/io/grpc/CallCredentials.java
@@ -56,18 +56,19 @@ public abstract class CallCredentials {
RequestInfo requestInfo, Executor appExecutor, CallCredentials.MetadataApplier applier);
/**
- * Should be a noop but never called; tries to make it clearer to implementors that they may break
- * in the future.
+ * With this class now being stable this method moves from an abstract one to a normal one with
+ * a no-op implementation. This method is marked deprecated to allow extenders time to remove the
+ * method before it is removed here.
*/
- @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1914")
- public abstract void thisUsesUnstableApi();
+ @Deprecated
+ public void thisUsesUnstableApi() {
+ }
/**
* The outlet of the produced headers. Not thread-safe.
*
* <p>Exactly one of its methods must be called to make the RPC proceed.
*/
- @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1914")
public abstract static class MetadataApplier {
/**
* Called when headers are successfully generated. They will be merged into the original
@@ -84,7 +85,6 @@ public abstract class CallCredentials {
/**
* The request-related information passed to {@code CallCredentials.applyRequestMetadata()}.
*/
- @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1914")
public abstract static class RequestInfo {
/**
* The method descriptor of this RPC.
diff --git a/api/src/main/java/io/grpc/CompositeCallCredentials.java b/api/src/main/java/io/grpc/CompositeCallCredentials.java
index 0bf59c21b..6a8ac3872 100644
--- a/api/src/main/java/io/grpc/CompositeCallCredentials.java
+++ b/api/src/main/java/io/grpc/CompositeCallCredentials.java
@@ -40,9 +40,6 @@ public final class CompositeCallCredentials extends CallCredentials {
new WrappingMetadataApplier(requestInfo, appExecutor, applier, Context.current()));
}
- @Override
- public void thisUsesUnstableApi() {}
-
private final class WrappingMetadataApplier extends MetadataApplier {
private final RequestInfo requestInfo;
private final Executor appExecutor;
diff --git a/api/src/test/java/io/grpc/CompositeCallCredentialsTest.java b/api/src/test/java/io/grpc/CompositeCallCredentialsTest.java
index 4e606c416..e4647a0b3 100644
--- a/api/src/test/java/io/grpc/CompositeCallCredentialsTest.java
+++ b/api/src/test/java/io/grpc/CompositeCallCredentialsTest.java
@@ -109,7 +109,5 @@ public final class CompositeCallCredentialsTest {
applier.fail(status);
}
}
-
- @Override public void thisUsesUnstableApi() {}
}
}
diff --git a/auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java b/auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java
index 26e7364ea..ad5f0175c 100644
--- a/auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java
+++ b/auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java
@@ -95,9 +95,6 @@ final class GoogleAuthLibraryCallCredentials extends io.grpc.CallCredentials
}
@Override
- public void thisUsesUnstableApi() {}
-
- @Override
public void applyRequestMetadata(
RequestInfo info, Executor appExecutor, final MetadataApplier applier) {
SecurityLevel security = info.getSecurityLevel();
diff --git a/core/src/test/java/io/grpc/internal/FakeCallCredentials.java b/core/src/test/java/io/grpc/internal/FakeCallCredentials.java
index e30749569..8161aaccc 100644
--- a/core/src/test/java/io/grpc/internal/FakeCallCredentials.java
+++ b/core/src/test/java/io/grpc/internal/FakeCallCredentials.java
@@ -38,6 +38,4 @@ final class FakeCallCredentials extends CallCredentials {
CallCredentials.MetadataApplier applier) {
applier.apply(headers);
}
-
- @Override public void thisUsesUnstableApi() {}
}