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 Modifier and Type Class Description static classInstantiatingGrpcChannelProvider.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanacceptsPoolSize()Deprecated.Please modify pool settings viatoBuilder()StringgetEndpoint()The endpoint to be used for the channel.org.threeten.bp.DurationgetKeepAliveTime()The time without read activity before sending a keepalive ping.org.threeten.bp.DurationgetKeepAliveTimeout()The time without read activity after sending a keepalive ping.BooleangetKeepAliveWithoutCalls()Whether keepalive will be performed when there are no outstanding RPCs.IntegergetMaxInboundMetadataSize()The maximum metadata size allowed to be received on the channel.TransportChannelgetTransportChannel()StringgetTransportName()booleanneedsCredentials()booleanneedsEndpoint()booleanneedsExecutor()Deprecated.If executor is not set, this channel provider will create channels with default grpc executor.booleanneedsHeaders()static InstantiatingGrpcChannelProvider.BuildernewBuilder()booleanshouldAutoClose()InstantiatingGrpcChannelProvider.BuildertoBuilder()TransportChannelProviderwithCredentials(com.google.auth.Credentials credentials)TransportChannelProviderwithEndpoint(String endpoint)Specify the endpoint the channel should connect to.TransportChannelProviderwithExecutor(Executor executor)TransportChannelProviderwithExecutor(ScheduledExecutorService executor)Deprecated.TransportChannelProviderwithHeaders(Map<String,String> headers)TransportChannelProviderwithPoolSize(int size)Deprecated.Please modify pool settings viatoBuilder()
-
-
-
Method Detail
-
needsExecutor
@Deprecated public boolean needsExecutor()
Deprecated.If executor is not set, this channel provider will create channels with default grpc executor.- Specified by:
needsExecutorin interfaceTransportChannelProvider
-
withExecutor
@Deprecated public TransportChannelProvider withExecutor(ScheduledExecutorService executor)
Deprecated.- Specified by:
withExecutorin interfaceTransportChannelProvider
-
withExecutor
public TransportChannelProvider withExecutor(Executor executor)
- Specified by:
withExecutorin interfaceTransportChannelProvider
-
needsHeaders
public boolean needsHeaders()
- Specified by:
needsHeadersin interfaceTransportChannelProvider
-
withHeaders
public TransportChannelProvider withHeaders(Map<String,String> headers)
- Specified by:
withHeadersin interfaceTransportChannelProvider
-
getTransportName
public String getTransportName()
- Specified by:
getTransportNamein interfaceTransportChannelProvider
-
needsEndpoint
public boolean needsEndpoint()
- Specified by:
needsEndpointin interfaceTransportChannelProvider
-
withEndpoint
public TransportChannelProvider withEndpoint(String endpoint)
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 public boolean acceptsPoolSize()
Deprecated.Please modify pool settings viatoBuilder()- Specified by:
acceptsPoolSizein interfaceTransportChannelProvider
-
withPoolSize
@Deprecated public TransportChannelProvider withPoolSize(int size)
Deprecated.Please modify pool settings viatoBuilder()- Specified by:
withPoolSizein interfaceTransportChannelProvider
-
needsCredentials
public boolean needsCredentials()
- Specified by:
needsCredentialsin interfaceTransportChannelProvider
-
withCredentials
public TransportChannelProvider withCredentials(com.google.auth.Credentials credentials)
- Specified by:
withCredentialsin interfaceTransportChannelProvider
-
getTransportChannel
public TransportChannel getTransportChannel() throws IOException
- Specified by:
getTransportChannelin interfaceTransportChannelProvider- Throws:
IOException
-
getEndpoint
public String getEndpoint()
The endpoint to be used for the channel.
-
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
public Boolean 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
public InstantiatingGrpcChannelProvider.Builder toBuilder()
-
newBuilder
public static InstantiatingGrpcChannelProvider.Builder newBuilder()
-
-