Class InstantiatingGrpcChannelProvider.Builder

    • Method Detail

      • setExecutor

        public InstantiatingGrpcChannelProvider.Builder setExecutor​(Executor executor)
        Sets the Executor for this TransportChannelProvider.

        This is optional; if it is not provided, needsExecutor() will return true, meaning that an Executor must be provided when getChannel is called on the constructed TransportChannelProvider instance. Note: GrpcTransportProvider will automatically provide its own Executor in this circumstance when it calls getChannel.

      • setHeaderProvider

        public InstantiatingGrpcChannelProvider.Builder setHeaderProvider​(com.google.api.gax.rpc.HeaderProvider headerProvider)
        Sets the HeaderProvider for this TransportChannelProvider.

        This is optional; if it is not provided, needsHeaders() will return true, meaning that headers must be provided when getChannel is called on the constructed TransportChannelProvider instance.

      • setInterceptorProvider

        public InstantiatingGrpcChannelProvider.Builder setInterceptorProvider​(GrpcInterceptorProvider interceptorProvider)
        Sets the GrpcInterceptorProvider for this TransportChannelProvider.

        The provider will be called once for each underlying gRPC ManagedChannel that is created. It is recommended to return a new list of new interceptors on each call so that interceptors are not shared among channels, but this is not required.

      • getEndpoint

        public String getEndpoint()
      • getMaxInboundMessageSize

        public Integer getMaxInboundMessageSize()
        The maximum message size allowed to be received on the channel.
      • setMaxInboundMetadataSize

        @BetaApi("The surface for maximum metadata size is not stable yet and may change in the future.")
        public InstantiatingGrpcChannelProvider.Builder setMaxInboundMetadataSize​(Integer max)
        The maximum metadata size allowed to be received on the channel.
      • getMaxInboundMetadataSize

        @BetaApi("The surface for maximum metadata size is not stable yet and may change in the future.")
        public Integer getMaxInboundMetadataSize()
        The maximum metadata size allowed to be received on the channel.
      • getKeepAliveTime

        public org.threeten.bp.Duration getKeepAliveTime()
        The time without read activity before sending a keepalive ping.
      • getKeepAliveTimeout

        public org.threeten.bp.Duration getKeepAliveTimeout()
        The time without read activity after sending a keepalive ping.
      • getKeepAliveWithoutCalls

        public Boolean getKeepAliveWithoutCalls()
        Whether keepalive will be performed when there are no outstanding RPCs.
      • setChannelPrimer

        @InternalApi("For internal use by google-cloud-java clients only")
        public InstantiatingGrpcChannelProvider.Builder setChannelPrimer​(ChannelPrimer channelPrimer)
        By setting a channelPrimer, the ChannelPool created by the provider will be refreshing ChannelPool. channelPrimer will be invoked periodically when the channels are refreshed

        This is public only for technical reasons, for advanced usage.

        Parameters:
        channelPrimer - invoked when the channels are refreshed
        Returns:
        builder for the provider
      • setAttemptDirectPath

        @InternalApi("For internal use by google-cloud-java clients only")
        public InstantiatingGrpcChannelProvider.Builder setAttemptDirectPath​(boolean attemptDirectPath)
        Whether attempt DirectPath.
      • setAllowNonDefaultServiceAccount

        @InternalApi("For internal use by google-cloud-java clients only")
        public InstantiatingGrpcChannelProvider.Builder setAllowNonDefaultServiceAccount​(boolean allowNonDefaultServiceAccount)
        Whether allow non-default service account for DirectPath.
      • setChannelConfigurator

        @BetaApi("Surface for advanced channel configuration is not yet stable")
        public InstantiatingGrpcChannelProvider.Builder setChannelConfigurator​(@Nullable
                                                                               com.google.api.core.ApiFunction<io.grpc.ManagedChannelBuilder,​io.grpc.ManagedChannelBuilder> channelConfigurator)
        Add a callback that can intercept channel creation.

        This can be used for advanced configuration like setting the netty event loop. The callback will be invoked with a fully configured channel builder, which the callback can augment or replace.

      • getChannelConfigurator

        @Nullable
        public com.google.api.core.ApiFunction<io.grpc.ManagedChannelBuilder,​io.grpc.ManagedChannelBuilder> getChannelConfigurator()