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 TypeMethodDescriptionboolean
Deprecated.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.boolean
True if credentials are needed before channel creation.boolean
True if the TransportProvider has no endpoint set.boolean
True if the TransportProvider needs an executor.boolean
True if the TransportProvider has no headers provided.boolean
Indicates 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 configurationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.api.gax.rpc.TransportChannelProvider
getEndpoint, withUseS2A
-
Method Details
-
shouldAutoClose
public boolean shouldAutoClose()Description copied from interface:TransportChannelProvider
Indicates whether the TransportChannel should be closed by the containing client class.- Specified by:
shouldAutoClose
in interfaceTransportChannelProvider
-
needsExecutor
public boolean needsExecutor()Description copied from interface:TransportChannelProvider
True if the TransportProvider needs an executor.- Specified by:
needsExecutor
in interfaceTransportChannelProvider
-
withExecutor
- Specified by:
withExecutor
in interfaceTransportChannelProvider
-
withExecutor
Description copied from interface:TransportChannelProvider
Sets the executor to use when constructing a newTransportChannel
.- Specified by:
withExecutor
in interfaceTransportChannelProvider
-
needsHeaders
public boolean needsHeaders()Description copied from interface:TransportChannelProvider
True if the TransportProvider has no headers provided.- Specified by:
needsHeaders
in interfaceTransportChannelProvider
-
withHeaders
Description copied from interface:TransportChannelProvider
Sets the headers to use when constructing a newTransportChannel
.This method should only be called if
TransportChannelProvider.needsHeaders()
returns true.- Specified by:
withHeaders
in interfaceTransportChannelProvider
-
needsEndpoint
public boolean needsEndpoint()Description copied from interface:TransportChannelProvider
True if the TransportProvider has no endpoint set.- Specified by:
needsEndpoint
in interfaceTransportChannelProvider
-
withEndpoint
Description copied from interface:TransportChannelProvider
Sets the endpoint to use when constructing a newTransportChannel
.This method should only be called if
TransportChannelProvider.needsEndpoint()
returns true.- Specified by:
withEndpoint
in interfaceTransportChannelProvider
-
acceptsPoolSize
Deprecated.FixedTransportChannelProvider doesn't support ChannelPool configurationDescription copied from interface:TransportChannelProvider
Reports whether this provider allows pool size customization.- Specified by:
acceptsPoolSize
in interfaceTransportChannelProvider
-
withPoolSize
Deprecated.FixedTransportChannelProvider doesn't support ChannelPool configurationDescription copied from interface:TransportChannelProvider
Number of underlying transport channels to open. Calls will be load balanced across them.- Specified by:
withPoolSize
in interfaceTransportChannelProvider
-
getTransportChannel
Description copied from interface:TransportChannelProvider
Provides 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:
getTransportChannel
in interfaceTransportChannelProvider
- Throws:
IOException
-
getTransportName
Description copied from interface:TransportChannelProvider
The name of the transport.This string can be used for identifying transports for switching logic.
- Specified by:
getTransportName
in interfaceTransportChannelProvider
-
needsCredentials
public boolean needsCredentials()Description copied from interface:TransportChannelProvider
True if credentials are needed before channel creation.- Specified by:
needsCredentials
in interfaceTransportChannelProvider
-
withCredentials
Description copied from interface:TransportChannelProvider
Sets the credentials that will be applied before channel creation.- Specified by:
withCredentials
in interfaceTransportChannelProvider
-
create
Creates a FixedTransportChannelProvider.
-