diff --git a/core/src/main/java/io/grpc/ExperimentalApi.java b/core/src/main/java/io/grpc/ExperimentalApi.java index 22eef51fc7..3ad54b21b2 100644 --- a/core/src/main/java/io/grpc/ExperimentalApi.java +++ b/core/src/main/java/io/grpc/ExperimentalApi.java @@ -53,5 +53,5 @@ public @interface ExperimentalApi { /** * Context information such as links to discussion thread, tracking issue etc. */ - String value() default ""; + String value(); } diff --git a/core/src/main/java/io/grpc/Metadata.java b/core/src/main/java/io/grpc/Metadata.java index 7f4393fcb0..93f0347d3d 100644 --- a/core/src/main/java/io/grpc/Metadata.java +++ b/core/src/main/java/io/grpc/Metadata.java @@ -366,7 +366,7 @@ public final class Metadata { * Remove all values for the given key without returning them. This is a minor performance * optimization if you do not need the previous values. */ - @ExperimentalApi + @ExperimentalApi("https://github.com/grpc/grpc-java/issues/4691") public void discardAll(Key key) { if (isEmpty()) { return; diff --git a/core/src/main/java/io/grpc/SecurityLevel.java b/core/src/main/java/io/grpc/SecurityLevel.java index 9ce57ebbbf..7d834aadb6 100644 --- a/core/src/main/java/io/grpc/SecurityLevel.java +++ b/core/src/main/java/io/grpc/SecurityLevel.java @@ -19,7 +19,7 @@ package io.grpc; /** * The level of security guarantee in communications. */ -@ExperimentalApi +@ExperimentalApi("https://github.com/grpc/grpc-java/issues/4692") public enum SecurityLevel { /** * No security guarantee. diff --git a/core/src/main/java/io/grpc/Status.java b/core/src/main/java/io/grpc/Status.java index 9f5b351ef3..8554f17c4e 100644 --- a/core/src/main/java/io/grpc/Status.java +++ b/core/src/main/java/io/grpc/Status.java @@ -408,7 +408,7 @@ public final class Status { * * @return the trailers or {@code null} if not found. */ - @ExperimentalApi + @ExperimentalApi("https://github.com/grpc/grpc-java/issues/4683") public static Metadata trailersFromThrowable(Throwable t) { Throwable cause = checkNotNull(t, "t"); while (cause != null) { diff --git a/core/src/main/java/io/grpc/StatusException.java b/core/src/main/java/io/grpc/StatusException.java index 7c48d89612..f9416bf72e 100644 --- a/core/src/main/java/io/grpc/StatusException.java +++ b/core/src/main/java/io/grpc/StatusException.java @@ -28,6 +28,11 @@ public class StatusException extends Exception { private final Status status; private final Metadata trailers; + /** + * Constructs an exception with both a status. See also {@link Status#asException()}. + * + * @since 1.0.0 + */ public StatusException(Status status) { this(status, null); } @@ -35,6 +40,8 @@ public class StatusException extends Exception { /** * Constructs an exception with both a status and trailers. See also * {@link Status#asException(Metadata)}. + * + * @since 1.0.0 */ public StatusException(Status status, @Nullable Metadata trailers) { super(Status.formatThrowableMessage(status), status.getCause()); @@ -44,6 +51,8 @@ public class StatusException extends Exception { /** * Returns the status code as a {@link Status} object. + * + * @since 1.0.0 */ public final Status getStatus() { return status; @@ -51,8 +60,9 @@ public class StatusException extends Exception { /** * Returns the received trailers. + * + * @since 1.0.0 */ - @ExperimentalApi public final Metadata getTrailers() { return trailers; } diff --git a/core/src/main/java/io/grpc/StatusRuntimeException.java b/core/src/main/java/io/grpc/StatusRuntimeException.java index 3d032a7aa8..d685464d45 100644 --- a/core/src/main/java/io/grpc/StatusRuntimeException.java +++ b/core/src/main/java/io/grpc/StatusRuntimeException.java @@ -29,6 +29,11 @@ public class StatusRuntimeException extends RuntimeException { private final Status status; private final Metadata trailers; + /** + * Constructs the exception with both a status. See also {@link Status#asException()}. + * + * @since 1.0.0 + */ public StatusRuntimeException(Status status) { this(status, null); } @@ -36,6 +41,8 @@ public class StatusRuntimeException extends RuntimeException { /** * Constructs the exception with both a status and trailers. See also * {@link Status#asException(Metadata)}. + * + * @since 1.0.0 */ public StatusRuntimeException(Status status, @Nullable Metadata trailers) { super(Status.formatThrowableMessage(status), status.getCause()); @@ -45,6 +52,8 @@ public class StatusRuntimeException extends RuntimeException { /** * Returns the status code as a {@link Status} object. + * + * @since 1.0.0 */ public final Status getStatus() { return status; @@ -52,8 +61,9 @@ public class StatusRuntimeException extends RuntimeException { /** * Returns the received trailers. + * + * @since 1.0.0 */ - @ExperimentalApi public final Metadata getTrailers() { return trailers; } diff --git a/protobuf/src/main/java/io/grpc/protobuf/StatusProto.java b/protobuf/src/main/java/io/grpc/protobuf/StatusProto.java index fc08e955a5..2648138b93 100644 --- a/protobuf/src/main/java/io/grpc/protobuf/StatusProto.java +++ b/protobuf/src/main/java/io/grpc/protobuf/StatusProto.java @@ -28,7 +28,7 @@ import io.grpc.protobuf.lite.ProtoLiteUtils; import javax.annotation.Nullable; /** Utility methods for working with {@link com.google.rpc.Status}. */ -@ExperimentalApi +@ExperimentalApi("https://github.com/grpc/grpc-java/issues/4695") public final class StatusProto { private StatusProto() {} diff --git a/services/src/main/java/io/grpc/services/HealthStatusManager.java b/services/src/main/java/io/grpc/services/HealthStatusManager.java index a951910a70..090ac0c259 100644 --- a/services/src/main/java/io/grpc/services/HealthStatusManager.java +++ b/services/src/main/java/io/grpc/services/HealthStatusManager.java @@ -27,7 +27,7 @@ import io.grpc.health.v1.HealthCheckResponse.ServingStatus; * {@link #getHealthService()} method. * The health status manager can update the health statuses of the server. */ -@io.grpc.ExperimentalApi +@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/4696") public final class HealthStatusManager { private final HealthServiceImpl healthService; diff --git a/stub/src/main/java/io/grpc/stub/ClientResponseObserver.java b/stub/src/main/java/io/grpc/stub/ClientResponseObserver.java index c85ebf1782..2e7ea35ebb 100644 --- a/stub/src/main/java/io/grpc/stub/ClientResponseObserver.java +++ b/stub/src/main/java/io/grpc/stub/ClientResponseObserver.java @@ -22,7 +22,7 @@ import io.grpc.ExperimentalApi; * Specialization of {@link StreamObserver} implemented by clients in order to interact with the * advanced features of a call such as flow-control. */ -@ExperimentalApi +@ExperimentalApi("https://github.com/grpc/grpc-java/issues/4693") public interface ClientResponseObserver extends StreamObserver { /** * Called by the runtime priot to the start of a call to provide a reference to the diff --git a/stub/src/main/java/io/grpc/stub/StreamObservers.java b/stub/src/main/java/io/grpc/stub/StreamObservers.java index 5477b555b0..f7ccc9767d 100644 --- a/stub/src/main/java/io/grpc/stub/StreamObservers.java +++ b/stub/src/main/java/io/grpc/stub/StreamObservers.java @@ -24,7 +24,7 @@ import java.util.Iterator; * Utility functions for working with {@link StreamObserver} and it's common subclasses like * {@link CallStreamObserver}. */ -@ExperimentalApi +@ExperimentalApi("https://github.com/grpc/grpc-java/issues/4694") public final class StreamObservers { /** * Copy the values of an {@link Iterator} to the target {@link CallStreamObserver} while properly