Package com.google.api.gax.rpc
Class FixedTransportChannelProvider
java.lang.Object
com.google.api.gax.rpc.FixedTransportChannelProvider
- All Implemented Interfaces:
TransportChannelProvider
@InternalExtensionOnly
public class FixedTransportChannelProvider
extends Object
implements TransportChannelProvider
An instance of TransportChannelProvider that always provides the same TransportChannel.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.FixedTransportChannelProvider doesn't support ChannelPool configurationcreate(TransportChannel transportChannel) Creates a FixedTransportChannelProvider.Provides a Transport, which could either be a new instance for every call, or the same instance, depending on the implementation.The name of the transport.booleanTrue if credentials are needed before channel creation.booleanTrue if the TransportProvider has no endpoint set.booleanTrue if the TransportProvider needs an executor.booleanTrue if the TransportProvider has no headers provided.booleanIndicates whether the TransportChannel should be closed by the containing client class.withCredentials(com.google.auth.Credentials credentials) Sets the credentials that will be applied before channel creation.withEndpoint(String endpoint) Sets the endpoint to use when constructing a newTransportChannel.withExecutor(Executor executor) Sets the executor to use when constructing a newTransportChannel.withExecutor(ScheduledExecutorService executor) withHeaders(Map<String, String> headers) Sets the headers to use when constructing a newTransportChannel.withPoolSize(int size) Deprecated.FixedTransportChannelProvider doesn't support ChannelPool configuration
-
Method Details
-
shouldAutoClose
public boolean shouldAutoClose()Description copied from interface:TransportChannelProviderIndicates whether the TransportChannel should be closed by the containing client class.- Specified by:
shouldAutoClosein interfaceTransportChannelProvider
-
needsExecutor
public boolean needsExecutor()Description copied from interface:TransportChannelProviderTrue if the TransportProvider needs an executor.- Specified by:
needsExecutorin interfaceTransportChannelProvider
-
withExecutor
- Specified by:
withExecutorin interfaceTransportChannelProvider
-
withExecutor
Description copied from interface:TransportChannelProviderSets the executor to use when constructing a newTransportChannel.- Specified by:
withExecutorin interfaceTransportChannelProvider
-
needsHeaders
public boolean needsHeaders()Description copied from interface:TransportChannelProviderTrue if the TransportProvider has no headers provided.- Specified by:
needsHeadersin interfaceTransportChannelProvider
-
withHeaders
Description copied from interface:TransportChannelProviderSets the headers to use when constructing a newTransportChannel.This method should only be called if
TransportChannelProvider.needsHeaders()returns true.- Specified by:
withHeadersin interfaceTransportChannelProvider
-
needsEndpoint
public boolean needsEndpoint()Description copied from interface:TransportChannelProviderTrue if the TransportProvider has no endpoint set.- Specified by:
needsEndpointin interfaceTransportChannelProvider
-
withEndpoint
Description copied from interface:TransportChannelProviderSets the endpoint to use when constructing a newTransportChannel.This method should only be called if
TransportChannelProvider.needsEndpoint()returns true.- Specified by:
withEndpointin interfaceTransportChannelProvider
-
acceptsPoolSize
Deprecated.FixedTransportChannelProvider doesn't support ChannelPool configurationDescription copied from interface:TransportChannelProviderReports whether this provider allows pool size customization.- Specified by:
acceptsPoolSizein interfaceTransportChannelProvider
-
withPoolSize
Deprecated.FixedTransportChannelProvider doesn't support ChannelPool configurationDescription copied from interface:TransportChannelProviderNumber of underlying transport channels to open. Calls will be load balanced across them.- Specified by:
withPoolSizein interfaceTransportChannelProvider
-
getTransportChannel
Description copied from interface:TransportChannelProviderProvides a Transport, which could either be a new instance for every call, or the same instance, depending on the implementation.If
TransportChannelProvider.needsExecutor()is true, thenTransportChannelProvider.withExecutor(Executor)needs to be called first to provide an executor.If
TransportChannelProvider.needsHeaders()is true, thenTransportChannelProvider.withHeaders(Map)needs to be called first to provide headers.if
TransportChannelProvider.needsEndpoint()is true, thenTransportChannelProvider.withEndpoint(String)needs to be called first to provide an endpoint.- Specified by:
getTransportChannelin interfaceTransportChannelProvider- Throws:
IOException
-
getTransportName
Description copied from interface:TransportChannelProviderThe name of the transport.This string can be used for identifying transports for switching logic.
- Specified by:
getTransportNamein interfaceTransportChannelProvider
-
needsCredentials
public boolean needsCredentials()Description copied from interface:TransportChannelProviderTrue if credentials are needed before channel creation.- Specified by:
needsCredentialsin interfaceTransportChannelProvider
-
withCredentials
Description copied from interface:TransportChannelProviderSets the credentials that will be applied before channel creation.- Specified by:
withCredentialsin interfaceTransportChannelProvider
-
create
Creates a FixedTransportChannelProvider.
-