Package com.google.api.gax.grpc
Class InstantiatingGrpcChannelProvider
java.lang.Object
com.google.api.gax.grpc.InstantiatingGrpcChannelProvider
- All Implemented Interfaces:
TransportChannelProvider
@InternalExtensionOnly
public final class InstantiatingGrpcChannelProvider
extends Object
implements TransportChannelProvider
InstantiatingGrpcChannelProvider is a TransportChannelProvider which constructs a gRPC
ManagedChannel with a number of configured inputs every time getChannel(...) is called. These
inputs include a port, a service address, and credentials.
The credentials can either be supplied directly (by providing a FixedCredentialsProvider to Builder.setCredentialsProvider()) or acquired implicitly from Application Default Credentials (by providing a GoogleCredentialsProvider to Builder.setCredentialsProvider()).
The client lib header and generator header values are used to form a value that goes into the http header of requests to the service.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.The endpoint to be used for the channel.org.threeten.bp.DurationThe time without read activity before sending a keepalive ping.org.threeten.bp.DurationThe time without read activity after sending a keepalive ping.Whether keepalive will be performed when there are no outstanding RPCs.The maximum metadata size allowed to be received on the channel.booleanbooleanbooleanDeprecated.If executor is not set, this channel provider will create channels with default grpc executor.booleanbooleanwithCredentials(com.google.auth.Credentials credentials) withEndpoint(String endpoint) Specify the endpoint the channel should connect to.withExecutor(Executor executor) withExecutor(ScheduledExecutorService executor) Deprecated.withHeaders(Map<String, String> headers) withPoolSize(int size) Deprecated.Please modify pool settings viatoBuilder()
-
Method Details
-
needsExecutor
Deprecated.If executor is not set, this channel provider will create channels with default grpc executor.- Specified by:
needsExecutorin interfaceTransportChannelProvider
-
withExecutor
Deprecated.- Specified by:
withExecutorin interfaceTransportChannelProvider
-
withExecutor
- Specified by:
withExecutorin interfaceTransportChannelProvider
-
needsHeaders
public boolean needsHeaders()- Specified by:
needsHeadersin interfaceTransportChannelProvider
-
withHeaders
- Specified by:
withHeadersin interfaceTransportChannelProvider
-
getTransportName
- Specified by:
getTransportNamein interfaceTransportChannelProvider
-
needsEndpoint
public boolean needsEndpoint()- Specified by:
needsEndpointin interfaceTransportChannelProvider
-
withEndpoint
Specify the endpoint the channel should connect to.The value of
endpointmust be of the formhost:port.- Specified by:
withEndpointin interfaceTransportChannelProvider- Parameters:
endpoint- The endpoint to connect to- Returns:
- A new
InstantiatingGrpcChannelProviderwith the specified endpoint configured
-
acceptsPoolSize
Deprecated.Please modify pool settings viatoBuilder()- Specified by:
acceptsPoolSizein interfaceTransportChannelProvider
-
withPoolSize
Deprecated.Please modify pool settings viatoBuilder()- Specified by:
withPoolSizein interfaceTransportChannelProvider
-
needsCredentials
public boolean needsCredentials()- Specified by:
needsCredentialsin interfaceTransportChannelProvider
-
withCredentials
- Specified by:
withCredentialsin interfaceTransportChannelProvider
-
getTransportChannel
- Specified by:
getTransportChannelin interfaceTransportChannelProvider- Throws:
IOException
-
getEndpoint
The endpoint to be used for the channel.- Specified by:
getEndpointin interfaceTransportChannelProvider
-
getKeepAliveTime
public org.threeten.bp.Duration getKeepAliveTime()The time without read activity before sending a keepalive ping. -
getKeepAliveTimeout
public org.threeten.bp.Duration getKeepAliveTimeout()The time without read activity after sending a keepalive ping. -
getKeepAliveWithoutCalls
Whether keepalive will be performed when there are no outstanding RPCs. -
getMaxInboundMetadataSize
@BetaApi("The surface for maximum metadata size is not stable yet and may change in the future.") public Integer getMaxInboundMetadataSize()The maximum metadata size allowed to be received on the channel. -
shouldAutoClose
public boolean shouldAutoClose()- Specified by:
shouldAutoClosein interfaceTransportChannelProvider
-
toBuilder
-
newBuilder
-
toBuilder()