@InternalExtensionOnly
public interface ApiCallContext
Implementations need to be immutable because default instances are stored in callable objects.
This is transport specific and each transport has an implementation with its own options.
| Modifier and Type | Method and Description |
|---|---|
org.threeten.bp.Duration |
getStreamIdleTimeout()
The stream idle timeout set for this context.
|
org.threeten.bp.Duration |
getStreamWaitTimeout()
Return the stream wait timeout set for this context.
|
ApiCallContext |
merge(ApiCallContext inputCallContext)
For any values in
inputCallContext that are not null, override the corresponding values
in the present instance. |
ApiCallContext |
nullToSelf(ApiCallContext inputContext)
If inputContext is not null, returns it; if it is null, returns the present instance.
|
ApiCallContext |
withCredentials(com.google.auth.Credentials credentials)
Returns a new ApiCallContext with the given credentials set.
|
ApiCallContext |
withStreamIdleTimeout(org.threeten.bp.Duration streamIdleTimeout)
Returns a new ApiCallContext with the given stream idle timeout set.
|
ApiCallContext |
withStreamWaitTimeout(org.threeten.bp.Duration streamWaitTimeout)
Returns a new ApiCallContext with the given stream timeout set.
|
ApiCallContext |
withTimeout(org.threeten.bp.Duration rpcTimeout)
Returns a new ApiCallContext with the given timeout set.
|
ApiCallContext |
withTransportChannel(TransportChannel channel)
Returns a new ApiCallContext with the given channel set.
|
ApiCallContext withCredentials(com.google.auth.Credentials credentials)
ApiCallContext withTransportChannel(TransportChannel channel)
ApiCallContext withTimeout(org.threeten.bp.Duration rpcTimeout)
This timeout only applies to a single RPC call; if timeouts are configured, the overall time taken will be much higher.
@BetaApi(value="The surface for streaming is not stable yet and may change in the future.") ApiCallContext withStreamWaitTimeout(@Nullable org.threeten.bp.Duration streamWaitTimeout)
This timeout only applies to a ServerStreamingCallables. It limits the maximum
amount of timeout that can pass between demand being signaled via StreamController.request(int) and actual message delivery to ResponseObserver.onResponse(Object). Or, in the case of automatic flow control, since the last
message was delivered to ResponseObserver.onResponse(Object). This is useful to detect
server or connection stalls. When the timeout has been reached, the stream will be closed with
a retryable WatchdogTimeoutException and a status of StatusCode.Code.ABORTED.
A value of Duration.ZERO, disables the streaming wait timeout and a null value will
use the default in the callable.
Please note that this timeout is best effort and the maximum resolution is configured in
StubSettings.getStreamWatchdogCheckInterval().
@BetaApi(value="The surface for streaming is not stable yet and may change in the future.") @Nullable org.threeten.bp.Duration getStreamWaitTimeout()
withStreamWaitTimeout(Duration)@BetaApi(value="The surface for streaming is not stable yet and may change in the future.") ApiCallContext withStreamIdleTimeout(@Nullable org.threeten.bp.Duration streamIdleTimeout)
This timeout only applies to a ServerStreamingCallables. It limits the maximum
amount of timeout that can pass between a message being received by ResponseObserver.onResponse(Object) and demand being signaled via StreamController.request(int). Please note that this timeout is best effort and the maximum
resolution configured in StubSettings.getStreamWatchdogCheckInterval(). This is useful
to clean up streams that were partially read but never closed. When the timeout has been
reached, the stream will be closed with a nonretryable WatchdogTimeoutException and a
status of StatusCode.Code.ABORTED.
A value of Duration.ZERO, disables the streaming idle timeout and a null value will
use the default in the callable.
Please note that this timeout is best effort and the maximum resolution is configured in
StubSettings.getStreamWatchdogCheckInterval().
@BetaApi(value="The surface for streaming is not stable yet and may change in the future.") @Nullable org.threeten.bp.Duration getStreamIdleTimeout()
withStreamIdleTimeout(Duration)ApiCallContext nullToSelf(ApiCallContext inputContext)
ApiCallContext merge(ApiCallContext inputCallContext)
inputCallContext that are not null, override the corresponding values
in the present instance.