- 2.70.3 (latest)
- 2.70.2
- 2.69.0
- 2.68.2
- 2.67.0
- 2.66.0
- 2.65.0
- 2.63.1
- 2.62.0
- 2.61.0
- 2.60.0
- 2.59.1
- 2.58.0
- 2.57.0
- 2.55.0
- 2.54.1
- 2.53.0
- 2.52.0
- 2.51.0
- 2.50.0
- 2.49.0
- 2.48.1
- 2.47.0
- 2.46.1
- 2.45.0
- 2.43.0
- 2.42.0
- 2.41.0
- 2.39.0
- 2.38.0
- 2.37.0
- 2.36.0
- 2.35.0
- 2.34.1
- 2.33.0
- 2.32.1
- 2.31.1
- 2.30.1
- 2.24.0
- 2.23.3
- 2.22.0
- 2.21.0
- 2.20.1
- 2.19.6
- 2.18.7
- 2.17.0
- 2.16.0
- 2.15.0
- 2.14.0
- 2.13.0
- 2.12.2
- 2.11.0
- 2.10.0
- 2.9.0
- 2.8.1
- 2.7.1
public class FixedTransportChannelProvider implements TransportChannelProviderAn instance of TransportChannelProvider that always provides the same TransportChannel.
Implements
TransportChannelProviderStatic Methods
create(TransportChannel transportChannel)
public static FixedTransportChannelProvider create(TransportChannel transportChannel)Creates a FixedTransportChannelProvider.
| Parameter | |
|---|---|
| Name | Description |
transportChannel |
TransportChannel |
| Returns | |
|---|---|
| Type | Description |
FixedTransportChannelProvider |
|
Methods
acceptsPoolSize() (deprecated)
public boolean acceptsPoolSize()Deprecated. FixedTransportChannelProvider doesn't support ChannelPool configuration
Reports whether this provider allows pool size customization.
| Returns | |
|---|---|
| Type | Description |
boolean |
|
getTransportChannel()
public TransportChannel getTransportChannel()Provides a Transport, which could either be a new instance for every call, or the same instance, depending on the implementation.
If #needsExecutor() is true, then #withExecutor(Executor) needs to be called first to provide an executor.
If #needsHeaders() is true, then #withHeaders(Map) needs to be called first to provide headers.
if #needsEndpoint() is true, then #withEndpoint(String) needs to be called first to provide an endpoint.
| Returns | |
|---|---|
| Type | Description |
TransportChannel |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
getTransportName()
public String getTransportName()The name of the transport.
This string can be used for identifying transports for switching logic.
| Returns | |
|---|---|
| Type | Description |
String |
|
needsCredentials()
public boolean needsCredentials()True if credentials are needed before channel creation.
| Returns | |
|---|---|
| Type | Description |
boolean |
|
needsEndpoint()
public boolean needsEndpoint()True if the TransportProvider has no endpoint set.
| Returns | |
|---|---|
| Type | Description |
boolean |
|
needsExecutor()
public boolean needsExecutor()True if the TransportProvider needs an executor.
| Returns | |
|---|---|
| Type | Description |
boolean |
|
needsHeaders()
public boolean needsHeaders()True if the TransportProvider has no headers provided.
| Returns | |
|---|---|
| Type | Description |
boolean |
|
shouldAutoClose()
public boolean shouldAutoClose()Indicates whether the TransportChannel should be closed by the containing client class.
| Returns | |
|---|---|
| Type | Description |
boolean |
|
withCredentials(Credentials credentials)
public TransportChannelProvider withCredentials(Credentials credentials)Sets the credentials that will be applied before channel creation.
| Parameter | |
|---|---|
| Name | Description |
credentials |
com.google.auth.Credentials |
| Returns | |
|---|---|
| Type | Description |
TransportChannelProvider |
|
withEndpoint(String endpoint)
public TransportChannelProvider withEndpoint(String endpoint)Sets the endpoint to use when constructing a new TransportChannel.
This method should only be called if #needsEndpoint() returns true.
| Parameter | |
|---|---|
| Name | Description |
endpoint |
String |
| Returns | |
|---|---|
| Type | Description |
TransportChannelProvider |
|
withExecutor(Executor executor)
public FixedTransportChannelProvider withExecutor(Executor executor)Sets the executor to use when constructing a new TransportChannel.
| Parameter | |
|---|---|
| Name | Description |
executor |
Executor |
| Returns | |
|---|---|
| Type | Description |
FixedTransportChannelProvider |
|
withExecutor(ScheduledExecutorService executor)
public FixedTransportChannelProvider withExecutor(ScheduledExecutorService executor)| Parameter | |
|---|---|
| Name | Description |
executor |
ScheduledExecutorService |
| Returns | |
|---|---|
| Type | Description |
FixedTransportChannelProvider |
|
withHeaders(Map<String,String> headers)
public FixedTransportChannelProvider withHeaders(Map<String,String> headers)Sets the headers to use when constructing a new TransportChannel.
This method should only be called if #needsHeaders() returns true.
| Parameter | |
|---|---|
| Name | Description |
headers |
Map<String,String> |
| Returns | |
|---|---|
| Type | Description |
FixedTransportChannelProvider |
|
withPoolSize(int size) (deprecated)
public TransportChannelProvider withPoolSize(int size)Deprecated. FixedTransportChannelProvider doesn't support ChannelPool configuration
Number of underlying transport channels to open. Calls will be load balanced across them.
| Parameter | |
|---|---|
| Name | Description |
size |
int |
| Returns | |
|---|---|
| Type | Description |
TransportChannelProvider |
|