diff --git a/sdk-platform-java/api-common-java/src/main/java/com/google/api/core/ApiService.java b/sdk-platform-java/api-common-java/src/main/java/com/google/api/core/ApiService.java index cd3545d8b952..c90254d175ed 100644 --- a/sdk-platform-java/api-common-java/src/main/java/com/google/api/core/ApiService.java +++ b/sdk-platform-java/api-common-java/src/main/java/com/google/api/core/ApiService.java @@ -51,10 +51,10 @@ *

There are deviations from this if there are failures or if {@link ApiService#stopAsync} is * called before the {@link ApiService} reaches the {@linkplain State#RUNNING RUNNING} state. The * set of legal transitions form a DAG, therefore every method of the - * listener will be called at most once. N.B. The {@link State#FAILED} and {@link State#TERMINATED} - * states are terminal states, once a service enters either of these states it cannot ever leave - * them. + * href="https://en.wikipedia.org/wiki/Directed_acyclic_graph">DAG, therefore every method of + * the listener will be called at most once. N.B. The {@link State#FAILED} and {@link + * State#TERMINATED} states are terminal states, once a service enters either of these states it + * cannot ever leave them. * *

Implementors of this interface are strongly encouraged to extend {@link AbstractApiService} * which implement this interface and make the threading and state management easier. diff --git a/sdk-platform-java/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java b/sdk-platform-java/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java index 8d4080247ec4..3e8ea8d7f94e 100644 --- a/sdk-platform-java/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java +++ b/sdk-platform-java/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java @@ -643,10 +643,10 @@ public Map> getExtraHeaders() { } /** - * This method is obsolete. Use {@link #withTransportChannel()} instead. Returns a new instance - * with the channel set to the given channel. + * This method is obsolete. Use {@link #withTransportChannel(TransportChannel)} instead. Returns a + * new instance with the channel set to the given channel. */ - @ObsoleteApi("Use withTransportChannel() instead") + @ObsoleteApi("Use withTransportChannel(TransportChannel) instead") public GrpcCallContext withChannel(@Nullable Channel newChannel) { return new GrpcCallContext( newChannel, diff --git a/sdk-platform-java/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java b/sdk-platform-java/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java index a74deca6350e..6642a14eea01 100644 --- a/sdk-platform-java/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java +++ b/sdk-platform-java/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java @@ -118,15 +118,13 @@ public final class InstantiatingGrpcChannelProvider implements TransportChannelP // The public portion of the mTLS MDS root certificate is stored for performing // cert verification when establishing an mTLS connection with the MDS. See - // {@link this - // for more information.} + // https://docs.cloud.google.com/compute/docs/metadata/overview#https-mds-root-certs + // for more information. private static final String MTLS_MDS_ROOT_PATH = "/run/google-mds-mtls/root.crt"; // The mTLS MDS credentials are formatted as the concatenation of a PEM-encoded certificate chain // followed by a PEM-encoded private key. See - // {@link this - // for more information.} + // https://docs.cloud.google.com/compute/docs/metadata/overview#https-mds-client-certs + // for more information. private static final String MTLS_MDS_CERT_CHAIN_AND_KEY_PATH = "/run/google-mds-mtls/client.key"; static final long DIRECT_PATH_KEEP_ALIVE_TIME_SECONDS = 3600; @@ -344,7 +342,7 @@ public TransportChannelProvider withEndpoint(String endpoint) { * *

The value of {@code mtlsEndpoint} must be of the form {@code host:port}. * - * @param mtlsEndpoint The mtTLS endpoint to connect to + * @param mtlsEndpoint The mTLS endpoint to connect to * @return A new {@link InstantiatingGrpcChannelProvider} with the specified mTLS endpoint * configured */ @@ -358,7 +356,7 @@ public TransportChannelProvider withMtlsEndpoint(String mtlsEndpoint) { /** * Specify whether or not to use S2A. * - * @param useS2A + * @param useS2A whether to use S2A for establishing mTLS connections * @return A new {@link InstantiatingGrpcChannelProvider} with useS2A set. */ @Override @@ -648,15 +646,15 @@ boolean canUseDirectPathWithUniverseDomain() { /** * This method creates {@link TlsChannelCredentials} to be used by the client to establish an mTLS - * connection to S2A. Returns null if any of {@param trustBundle}, {@param privateKey} or {@param + * connection to S2A. Returns null if any of {@code trustBundle}, {@code privateKey} or {@code * certChain} are missing. * - * @param trustBundle the trust bundle to be used to establish the client -> S2A mTLS connection - * @param privateKey the client's private key to be used to establish the client -> S2A mtls + * @param trustBundle the trust bundle to be used to establish the client-to-S2A mTLS connection + * @param privateKey the client's private key to be used to establish the client-to-S2A mTLS * connection - * @param certChain the client's cert chain to be used to establish the client -> S2A mtls + * @param certChain the client's cert chain to be used to establish the client-to-S2A mTLS * connection - * @return {@link ChannelCredentials} to use to create an mtls connection between client and S2A + * @return {@link ChannelCredentials} to use to create an mTLS connection between client and S2A * @throws IOException on error */ @VisibleForTesting @@ -673,7 +671,7 @@ boolean canUseDirectPathWithUniverseDomain() { /** * This method creates {@link ChannelCredentials} to be used by client to establish a plaintext - * connection to S2A. if {@param plaintextAddress} is not present, returns null. + * connection to S2A. If {@code plaintextAddress} is not present, returns null. * * @param plaintextAddress the address to reach S2A which accepts plaintext connections * @return {@link ChannelCredentials} to use to create a plaintext connection between client and @@ -687,15 +685,15 @@ boolean canUseDirectPathWithUniverseDomain() { } /** - * This method creates gRPC {@link ChannelCredentials} configured to use S2A to estbalish a mTLS - * connection. First, the address of S2A is discovered by using the {@link S2A} utility to learn - * the {@code mtlsAddress} to reach S2A and the {@code plaintextAddress} to reach S2A. Prefer to - * use the {@code mtlsAddress} address to reach S2A if it is non-empty and the MTLS-MDS - * credentials can successfully be discovered and used to create {@link TlsChannelCredentials}. If - * there is any failure using mTLS-to-S2A, fallback to using a plaintext connection to S2A using - * the {@code plaintextAddress}. If {@code plaintextAddress} is not available, this function - * returns null; in this case S2A will not be used, and a TLS connection to the service will be - * established. + * This method creates gRPC {@link ChannelCredentials} configured to use S2A to establish an mTLS + * connection. First, the address of S2A is discovered by using the {@link SecureSessionAgent} + * utility to learn the {@code mtlsAddress} to reach S2A and the {@code plaintextAddress} to reach + * S2A. Prefer to use the {@code mtlsAddress} address to reach S2A if it is non-empty and the + * MTLS-MDS credentials can successfully be discovered and used to create {@link + * TlsChannelCredentials}. If there is any failure using mTLS-to-S2A, fallback to using a + * plaintext connection to S2A using the {@code plaintextAddress}. If {@code plaintextAddress} is + * not available, this function returns null; in this case S2A will not be used, and a TLS + * connection to the service will be established. * * @return {@link ChannelCredentials} configured to use S2A to create mTLS connection. */ diff --git a/sdk-platform-java/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallableFactoryTest.java b/sdk-platform-java/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallableFactoryTest.java index 18fdf220defd..8590e9ff53e2 100644 --- a/sdk-platform-java/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallableFactoryTest.java +++ b/sdk-platform-java/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallableFactoryTest.java @@ -196,7 +196,8 @@ void testGetSpanNameInvalid() { try { SpanName spanName = SpanName.of(GrpcCallableFactory.getApiTracerContext(descriptor)); Truth.assertWithMessage( - "Invalid method descriptor should not have a valid span name: %s should not generate the spanName: %s", + "Invalid method descriptor should not have a valid span name: %s should not" + + " generate the spanName: %s", invalidName, spanName) .fail(); } catch (IllegalArgumentException e) { diff --git a/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/core/GoogleCredentialsProvider.java b/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/core/GoogleCredentialsProvider.java index c471b74e0d3f..7315c56f1c04 100644 --- a/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/core/GoogleCredentialsProvider.java +++ b/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/core/GoogleCredentialsProvider.java @@ -46,8 +46,8 @@ * GoogleCredentialsProvider acquires credentials using Application Default Credentials. * *

For more information on Application Default Credentials, see - * https://developers.google.com/identity/protocols/application-default-credentials. + * href="https://docs.cloud.google.com/docs/authentication/application-default-credentials"> + * Application Default Credentials. */ @NullMarked @AutoValue diff --git a/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiStreamObserver.java b/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiStreamObserver.java index 776be7412634..d5c72bc4a385 100644 --- a/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiStreamObserver.java +++ b/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiStreamObserver.java @@ -42,12 +42,11 @@ * implements the {@code ApiStreamObserver} and passes it to GAX, which then calls the observer with * the messages for the application to receive them. * - *

Implementations are expected to be thread-compatible. Separate - * {@code ApiStreamObserver}s do not need to be synchronized together; incoming and outgoing - * directions are independent. Since individual {@code ApiStreamObserver}s are not thread-safe, if - * multiple threads will be writing to a {@code ApiStreamObserver} concurrently, the application - * must synchronize calls. + *

Implementations are expected to be thread-compatible (safe to use across threads only with + * external synchronization). Separate {@code ApiStreamObserver}s do not need to be synchronized + * together; incoming and outgoing directions are independent. Since individual {@code + * ApiStreamObserver}s are not thread-safe, if multiple threads will be writing to a {@code + * ApiStreamObserver} concurrently, the application must synchronize calls. * *

This interface is a fork of io.grpc.stub.StreamObserver to enable shadowing of Guava, and also * to allow for a transport-agnostic interface that doesn't depend on gRPC. diff --git a/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java b/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java index 053f8141e328..62582edbb496 100644 --- a/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java +++ b/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java @@ -91,17 +91,17 @@ public static EndpointContext getDefaultInstance() { } /** - * ServiceName is host URI for Google Cloud Services. It follows the format of - * `{ServiceName}.googleapis.com`. For example, speech.googleapis.com would have a ServiceName of + * ServiceName is host URI for Google Cloud Services. It follows the format of {@code + * {ServiceName}.googleapis.com}. For example, speech.googleapis.com would have a ServiceName of * speech and cloudasset.googleapis.com would have a ServiceName of cloudasset. */ public abstract @Nullable String serviceName(); /** - * Universe Domain is the domain for Google Cloud Services. It follows the format of - * `{ServiceName}.{UniverseDomain}`. For example, speech.googleapis.com would have a Universe - * Domain value of `googleapis.com` and cloudasset.test.com would have a Universe Domain of - * `test.com`. If this value is not set, this will default to `googleapis.com`. + * Universe Domain is the domain for Google Cloud Services. It follows the format of {@code + * {ServiceName}.{UniverseDomain}}. For example, speech.googleapis.com would have a Universe + * Domain value of {@code googleapis.com} and cloudasset.test.com would have a Universe Domain of + * {@code test.com}. If this value is not set, this will default to {@code googleapis.com}. */ public abstract @Nullable String universeDomain(); @@ -213,17 +213,17 @@ public void validateUniverseDomain( @AutoValue.Builder public abstract static class Builder { /** - * ServiceName is host URI for Google Cloud Services. It follows the format of - * `{ServiceName}.googleapis.com`. For example, speech.googleapis.com would have a ServiceName - * of speech and cloudasset.googleapis.com would have a ServiceName of cloudasset. + * ServiceName is host URI for Google Cloud Services. It follows the format of {@code + * {ServiceName}.googleapis.com}. For example, speech.googleapis.com would have a ServiceName of + * speech and cloudasset.googleapis.com would have a ServiceName of cloudasset. */ public abstract Builder setServiceName(String serviceName); /** - * Universe Domain is the domain for Google Cloud Services. It follows the format of - * `{ServiceName}.{UniverseDomain}`. For example, speech.googleapis.com would have a Universe - * Domain value of `googleapis.com` and cloudasset.test.com would have a Universe Domain of - * `test.com`. If this value is not set, this will default to `googleapis.com`. + * Universe Domain is the domain for Google Cloud Services. It follows the format of {@code + * {ServiceName}.{UniverseDomain}}. For example, speech.googleapis.com would have a Universe + * Domain value of {@code googleapis.com} and cloudasset.test.com would have a Universe Domain + * of {@code test.com}. If this value is not set, this will default to {@code googleapis.com}. */ public abstract Builder setUniverseDomain(String universeDomain); diff --git a/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/StatusCode.java b/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/StatusCode.java index 7e946f6a08bb..83483237fc7a 100644 --- a/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/StatusCode.java +++ b/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/StatusCode.java @@ -35,9 +35,8 @@ /** * Transport-specific status code. * - *

The status codes are modeled after the status codes in grpc. For more information about grpc - * status codes, see - * https://github.com/grpc/grpc-java/blob/master/core/src/main/java/io/grpc/Status.java + *

The status codes are modeled after the status codes in gRPC. For more information about gRPC + * status codes, see gRPC status codes. */ @NullMarked @InternalExtensionOnly diff --git a/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/StubSettings.java b/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/StubSettings.java index dd9a5c301f3d..5d177ebead5c 100644 --- a/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/StubSettings.java +++ b/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/StubSettings.java @@ -671,11 +671,11 @@ public final String getApiKey() { } /** - * @return the resolved endpoint when the Builder was created. If invoked after - * `StubSettings.newBuilder()` is called, it will return the clientSettingsEndpoint value. - * If other parameters are then set in the builder, the resolved endpoint is not - * automatically updated. The resolved endpoint will only be recomputed when the - * StubSettings is built again. + * @return the resolved endpoint when the Builder was created. If invoked after {@code + * StubSettings.newBuilder()} is called, it will return the clientSettingsEndpoint value. If + * other parameters are then set in the builder, the resolved endpoint is not automatically + * updated. The resolved endpoint will only be recomputed when the StubSettings is built + * again. */ public String getEndpoint() { // For the `StubSettings.newBuilder()` case diff --git a/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/MtlsProvider.java b/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/MtlsProvider.java index 26afbc83ab80..d82d3037ad7c 100644 --- a/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/MtlsProvider.java +++ b/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/MtlsProvider.java @@ -182,7 +182,7 @@ static int runCertificateProviderCommand(Process commandProcess, long timeoutMil // exitValue throws IllegalThreadStateException if process has not yet terminated. // Once the process is terminated, exitValue no longer throws exception. Therefore // in the while loop, we use exitValue to check if process is terminated. See - // https://docs.oracle.com/javase/7/docs/api/java/lang/Process.html#exitValue() + // https://docs.oracle.com/javase/8/docs/api/java/lang/Process.html#exitValue-- // for more details. } } diff --git a/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpenTelemetryMetricsRecorder.java b/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpenTelemetryMetricsRecorder.java index 60739464be2f..ee412982794e 100644 --- a/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpenTelemetryMetricsRecorder.java +++ b/sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpenTelemetryMetricsRecorder.java @@ -44,13 +44,13 @@ import org.jspecify.annotations.NullMarked; /** - * OpenTelemetry implementation of recording metrics. This implementation collections the - * measurements related to the lifecyle of an RPC. + * OpenTelemetry implementation of recording metrics. This implementation collects the measurements + * related to the lifecycle of an RPC. * - *

For the Otel implementation, an attempt is a single RPC invocation and an operation is the + *

For the OTel implementation, an attempt is a single RPC invocation and an operation is the * collection of all the attempts made before a response is returned (either as a success or an - * error). A single call (i.e. `EchoClient.echo()`) should have an operation_count of 1 and may have - * an attempt_count of 1+ (depending on the retry configurations). + * error). A single call (e.g., {@code EchoClient.echo()}) should have an operation_count of 1 and + * may have an attempt_count of 1+ (depending on the retry configurations). */ @NullMarked @BetaApi