Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
* <p>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 <a
* href="http://en.wikipedia.org/wiki/Directed_acyclic_graph">DAG</a>, 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</a>, 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.
*
* <p>Implementors of this interface are strongly encouraged to extend {@link AbstractApiService}
* which implement this interface and make the threading and state management easier.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,10 @@ public Map<String, List<String>> 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.
Comment thread
lqiu96 marked this conversation as resolved.
Resolved
*/
@ObsoleteApi("Use withTransportChannel() instead")
@ObsoleteApi("Use withTransportChannel(TransportChannel) instead")
public GrpcCallContext withChannel(@Nullable Channel newChannel) {
return new GrpcCallContext(
newChannel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a
// href="https://cloud.google.com/compute/docs/metadata/overview#https-mds-root-certs">this</a>
// 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 <a
// href="https://cloud.google.com/compute/docs/metadata/overview#https-mds-client-certs">this</a>
// 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;
Expand Down Expand Up @@ -344,7 +342,7 @@ public TransportChannelProvider withEndpoint(String endpoint) {
*
* <p>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
*/
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
* GoogleCredentialsProvider acquires credentials using Application Default Credentials.
*
* <p>For more information on Application Default Credentials, see <a
* href="https://developers.google.com/identity/protocols/application-default-credentials">
* https://developers.google.com/identity/protocols/application-default-credentials</a>.
* href="https://docs.cloud.google.com/docs/authentication/application-default-credentials">
* Application Default Credentials</a>.
*/
@NullMarked
@AutoValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>Implementations are expected to be <a
* href="http://www.ibm.com/developerworks/library/j-jtp09263/">thread-compatible</a>. 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.
* <p>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.
*
* <p>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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@
/**
* Transport-specific status code.
*
* <p>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
* <p>The status codes are modeled after the status codes in gRPC. For more information about gRPC
* status codes, see <a href="https://grpc.io/docs/guides/status-codes/">gRPC status codes</a>.
*/
@NullMarked
@InternalExtensionOnly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>For the Otel implementation, an attempt is a single RPC invocation and an operation is the
* <p>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
Expand Down
Loading