Package com.google.cloud.grpc
Class GcpMultiEndpointOptions.Builder
java.lang.Object
com.google.cloud.grpc.GcpMultiEndpointOptions.Builder
- Enclosing class:
- GcpMultiEndpointOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()withChannelConfigurator(com.google.api.core.ApiFunction<io.grpc.ManagedChannelBuilder<?>, io.grpc.ManagedChannelBuilder<?>> channelConfigurator) Sets the channel configurator for the MultiEndpoint channel pool.withChannelCredentials(io.grpc.ChannelCredentials channelCredentials) Sets the channel credentials to use in the MultiEndpoint channel pool.withEndpoints(List<String> endpoints) Sets the endpoints of the MultiEndpoint.Sets the name of the MultiEndpoint.withRecoveryTimeout(Duration recoveryTimeout) Sets the recovery timeout for the MultiEndpoint.withSwitchingDelay(Duration switchingDelay) Sets the switching delay for the MultiEndpoint.
-
Constructor Details
-
Builder
-
Builder
-
-
Method Details
-
build
-
withName
Sets the name of the MultiEndpoint.- Parameters:
name- MultiEndpoint name.
-
withEndpoints
Sets the endpoints of the MultiEndpoint.- Parameters:
endpoints- List of endpoints in the form of host:port in descending priority order.
-
withChannelConfigurator
@CanIgnoreReturnValue public GcpMultiEndpointOptions.Builder withChannelConfigurator(com.google.api.core.ApiFunction<io.grpc.ManagedChannelBuilder<?>, io.grpc.ManagedChannelBuilder<?>> channelConfigurator) Sets the channel configurator for the MultiEndpoint channel pool.- Parameters:
channelConfigurator- function to perform on the ManagedChannelBuilder in the channel pool.
-
withChannelCredentials
@CanIgnoreReturnValue public GcpMultiEndpointOptions.Builder withChannelCredentials(io.grpc.ChannelCredentials channelCredentials) Sets the channel credentials to use in the MultiEndpoint channel pool.- Parameters:
channelCredentials- channel credentials.
-
withRecoveryTimeout
@CanIgnoreReturnValue public GcpMultiEndpointOptions.Builder withRecoveryTimeout(Duration recoveryTimeout) Sets the recovery timeout for the MultiEndpoint. See more info in theMultiEndpoint.- Parameters:
recoveryTimeout- recovery timeout.
-
withSwitchingDelay
@CanIgnoreReturnValue public GcpMultiEndpointOptions.Builder withSwitchingDelay(Duration switchingDelay) Sets the switching delay for the MultiEndpoint.When switching between endpoints the MultiEndpoint will stick to previous endpoint for the switching delay.
- Parameters:
switchingDelay- switching delay.
-