Package io.grpc.alts
Class AltsChannelBuilder
- java.lang.Object
-
- io.grpc.ManagedChannelBuilder<T>
-
- io.grpc.ForwardingChannelBuilder2<AltsChannelBuilder>
-
- io.grpc.alts.AltsChannelBuilder
-
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/4151") public final class AltsChannelBuilder extends io.grpc.ForwardingChannelBuilder2<AltsChannelBuilder>ALTS version ofManagedChannelBuilder. This class sets up a secure and authenticated communication between two cloud VMs using ALTS.
-
-
Field Summary
Fields Modifier and Type Field Description private AltsChannelCredentials.BuildercredentialsBuilderprivate io.grpc.netty.NettyChannelBuilderdelegate
-
Constructor Summary
Constructors Modifier Constructor Description privateAltsChannelBuilder(java.lang.String target)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AltsChannelBuilderaddTargetServiceAccount(java.lang.String targetServiceAccount)Adds an expected target service accounts.io.grpc.ManagedChannelbuild()protected io.grpc.netty.NettyChannelBuilderdelegate()AltsChannelBuilderenableUntrustedAltsForTesting()Enables untrusted ALTS for testing.static AltsChannelBuilderforAddress(java.lang.String name, int port)"Overrides" the static method inManagedChannelBuilder.static AltsChannelBuilderforTarget(java.lang.String target)"Overrides" the static method inManagedChannelBuilder.(package private) io.grpc.netty.InternalProtocolNegotiator.ProtocolNegotiatorgetProtocolNegotiatorForTest()AltsChannelBuildersetHandshakerAddressForTesting(java.lang.String handshakerAddress)Sets a new handshaker service address for testing.-
Methods inherited from class io.grpc.ForwardingChannelBuilder2
addMetricSink, addTransportFilter, compressorRegistry, decompressorRegistry, defaultLoadBalancingPolicy, defaultServiceConfig, directExecutor, disableRetry, disableServiceConfigLookUp, enableRetry, executor, idleTimeout, intercept, intercept, interceptWithTarget, keepAliveTime, keepAliveTimeout, keepAliveWithoutCalls, maxHedgedAttempts, maxInboundMessageSize, maxInboundMetadataSize, maxRetryAttempts, maxTraceEvents, nameResolverFactory, offloadExecutor, overrideAuthority, perRpcBufferLimit, proxyDetector, retryBufferSize, setBinaryLog, toString, usePlaintext, userAgent, useTransportSecurity
-
-
-
-
Field Detail
-
delegate
private final io.grpc.netty.NettyChannelBuilder delegate
-
credentialsBuilder
private final AltsChannelCredentials.Builder credentialsBuilder
-
-
Method Detail
-
forTarget
public static AltsChannelBuilder forTarget(java.lang.String target)
"Overrides" the static method inManagedChannelBuilder.
-
forAddress
public static AltsChannelBuilder forAddress(java.lang.String name, int port)
"Overrides" the static method inManagedChannelBuilder.
-
addTargetServiceAccount
public AltsChannelBuilder addTargetServiceAccount(java.lang.String targetServiceAccount)
Adds an expected target service accounts. One of the added service accounts should match peer service account in the handshaker result. Otherwise, the handshake fails.
-
enableUntrustedAltsForTesting
public AltsChannelBuilder enableUntrustedAltsForTesting()
Enables untrusted ALTS for testing. If this function is called, we will not check whether ALTS is running on Google Cloud Platform.
-
setHandshakerAddressForTesting
public AltsChannelBuilder setHandshakerAddressForTesting(java.lang.String handshakerAddress)
Sets a new handshaker service address for testing.
-
delegate
protected io.grpc.netty.NettyChannelBuilder delegate()
- Specified by:
delegatein classio.grpc.ForwardingChannelBuilder2<AltsChannelBuilder>
-
build
public io.grpc.ManagedChannel build()
- Overrides:
buildin classio.grpc.ForwardingChannelBuilder2<AltsChannelBuilder>
-
getProtocolNegotiatorForTest
@Nullable io.grpc.netty.InternalProtocolNegotiator.ProtocolNegotiator getProtocolNegotiatorForTest()
-
-