Class GcpMultiEndpointOptions.Builder (1.11.0)

public static class GcpMultiEndpointOptions.Builder

Inheritance

java.lang.Object > GcpMultiEndpointOptions.Builder

Constructors

Builder(GcpMultiEndpointOptions options)

public Builder(GcpMultiEndpointOptions options)
Parameter
Name Description
options GcpMultiEndpointOptions

Builder(List<String> endpoints)

public Builder(List<String> endpoints)
Parameter
Name Description
endpoints List<String>

Methods

build()

public GcpMultiEndpointOptions build()
Returns
Type Description
GcpMultiEndpointOptions

withChannelConfigurator(ApiFunction<ManagedChannelBuilder<?>,ManagedChannelBuilder<?>> channelConfigurator)

public GcpMultiEndpointOptions.Builder withChannelConfigurator(ApiFunction<ManagedChannelBuilder<?>,ManagedChannelBuilder<?>> channelConfigurator)

Sets the channel configurator for the MultiEndpoint channel pool.

Parameter
Name Description
channelConfigurator ApiFunction<io.grpc.ManagedChannelBuilder<?>,io.grpc.ManagedChannelBuilder<?>>

function to perform on the ManagedChannelBuilder in the channel pool.

Returns
Type Description
GcpMultiEndpointOptions.Builder

withChannelCredentials(ChannelCredentials channelCredentials)

public GcpMultiEndpointOptions.Builder withChannelCredentials(ChannelCredentials channelCredentials)

Sets the channel credentials to use in the MultiEndpoint channel pool.

Parameter
Name Description
channelCredentials io.grpc.ChannelCredentials

channel credentials.

Returns
Type Description
GcpMultiEndpointOptions.Builder

withEndpoints(List<String> endpoints)

public GcpMultiEndpointOptions.Builder withEndpoints(List<String> endpoints)

Sets the endpoints of the MultiEndpoint.

Parameter
Name Description
endpoints List<String>

List of endpoints in the form of host:port in descending priority order.

Returns
Type Description
GcpMultiEndpointOptions.Builder

withName(String name)

public GcpMultiEndpointOptions.Builder withName(String name)

Sets the name of the MultiEndpoint.

Parameter
Name Description
name String

MultiEndpoint name.

Returns
Type Description
GcpMultiEndpointOptions.Builder

withRecoveryTimeout(Duration recoveryTimeout)

public GcpMultiEndpointOptions.Builder withRecoveryTimeout(Duration recoveryTimeout)

Sets the recovery timeout for the MultiEndpoint. See more info in the MultiEndpoint.

Parameter
Name Description
recoveryTimeout Duration

recovery timeout.

Returns
Type Description
GcpMultiEndpointOptions.Builder

withSwitchingDelay(Duration switchingDelay)

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.

Parameter
Name Description
switchingDelay Duration

switching delay.

Returns
Type Description
GcpMultiEndpointOptions.Builder