Package com.google.api.gax.httpjson
Class HttpJsonCallContext
- java.lang.Object
-
- com.google.api.gax.httpjson.HttpJsonCallContext
-
- All Implemented Interfaces:
RetryingContext,ApiCallContext
@BetaApi("Reference ApiCallContext instead - this class is likely to experience breaking changes") public final class HttpJsonCallContext extends Object implements ApiCallContext
HttpJsonCallContext encapsulates context data used to make an http-json call.HttpJsonCallContext is immutable in the sense that none of its methods modifies the HttpJsonCallContext itself or the underlying data. Methods of the form
withXreturn copies of the object, but with one field changed. The immutability and thread safety of the arguments solely depends on the arguments themselves.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.api.gax.rpc.ApiCallContext
ApiCallContext.Key<T extends Object>
-
-
Method Summary
-
-
-
Method Detail
-
createDefault
public static HttpJsonCallContext createDefault()
Returns an empty instance.
-
of
public static HttpJsonCallContext of(HttpJsonChannel channel, HttpJsonCallOptions options)
-
nullToSelf
public HttpJsonCallContext nullToSelf(ApiCallContext inputContext)
Returns inputContext cast toHttpJsonCallContext, or an emptyHttpJsonCallContextif inputContext is null.- Specified by:
nullToSelfin interfaceApiCallContext- Parameters:
inputContext- theApiCallContextto cast if it is not null
-
merge
public HttpJsonCallContext merge(ApiCallContext inputCallContext)
- Specified by:
mergein interfaceApiCallContext
-
withCredentials
public HttpJsonCallContext withCredentials(com.google.auth.Credentials newCredentials)
- Specified by:
withCredentialsin interfaceApiCallContext
-
withTransportChannel
public HttpJsonCallContext withTransportChannel(TransportChannel inputChannel)
- Specified by:
withTransportChannelin interfaceApiCallContext
-
withTimeout
public HttpJsonCallContext withTimeout(org.threeten.bp.Duration timeout)
- Specified by:
withTimeoutin interfaceApiCallContext
-
getTimeout
@Nullable public org.threeten.bp.Duration getTimeout()
- Specified by:
getTimeoutin interfaceApiCallContext
-
withStreamWaitTimeout
public HttpJsonCallContext withStreamWaitTimeout(@Nullable org.threeten.bp.Duration streamWaitTimeout)
- Specified by:
withStreamWaitTimeoutin interfaceApiCallContext
-
getStreamWaitTimeout
@Nullable public org.threeten.bp.Duration getStreamWaitTimeout()
The stream wait timeout set for this context.- Specified by:
getStreamWaitTimeoutin interfaceApiCallContext- See Also:
ApiCallContext.withStreamWaitTimeout(Duration)
-
withStreamIdleTimeout
public HttpJsonCallContext withStreamIdleTimeout(@Nullable org.threeten.bp.Duration streamIdleTimeout)
- Specified by:
withStreamIdleTimeoutin interfaceApiCallContext
-
getStreamIdleTimeout
@Nullable public org.threeten.bp.Duration getStreamIdleTimeout()
The stream idle timeout set for this context.- Specified by:
getStreamIdleTimeoutin interfaceApiCallContext- See Also:
ApiCallContext.withStreamIdleTimeout(Duration)
-
withExtraHeaders
@BetaApi("The surface for extra headers is not stable yet and may change in the future.") public ApiCallContext withExtraHeaders(Map<String,List<String>> extraHeaders)
- Specified by:
withExtraHeadersin interfaceApiCallContext
-
getExtraHeaders
@BetaApi("The surface for extra headers is not stable yet and may change in the future.") public Map<String,List<String>> getExtraHeaders()
- Specified by:
getExtraHeadersin interfaceApiCallContext
-
withOption
public <T> ApiCallContext withOption(ApiCallContext.Key<T> key, T value)
- Specified by:
withOptionin interfaceApiCallContext
-
getOption
public <T> T getOption(ApiCallContext.Key<T> key)
- Specified by:
getOptionin interfaceApiCallContext
-
getChannel
public HttpJsonChannel getChannel()
-
getCallOptions
public HttpJsonCallOptions getCallOptions()
-
getDeadline
@Deprecated @Nullable public org.threeten.bp.Instant getDeadline()
Deprecated.
-
getCredentials
@Deprecated @Nullable public com.google.auth.Credentials getCredentials()
Deprecated.
-
getRetrySettings
public RetrySettings getRetrySettings()
- Specified by:
getRetrySettingsin interfaceRetryingContext
-
withRetrySettings
public HttpJsonCallContext withRetrySettings(RetrySettings retrySettings)
- Specified by:
withRetrySettingsin interfaceApiCallContext
-
getRetryableCodes
public Set<StatusCode.Code> getRetryableCodes()
- Specified by:
getRetryableCodesin interfaceRetryingContext
-
withRetryableCodes
public HttpJsonCallContext withRetryableCodes(Set<StatusCode.Code> retryableCodes)
- Specified by:
withRetryableCodesin interfaceApiCallContext
-
withChannel
public HttpJsonCallContext withChannel(HttpJsonChannel newChannel)
-
withCallOptions
public HttpJsonCallContext withCallOptions(HttpJsonCallOptions newCallOptions)
-
withDeadline
@Deprecated public HttpJsonCallContext withDeadline(org.threeten.bp.Instant newDeadline)
Deprecated.
-
getTracer
@Nonnull public ApiTracer getTracer()
- Specified by:
getTracerin interfaceApiCallContext- Specified by:
getTracerin interfaceRetryingContext
-
withTracer
public HttpJsonCallContext withTracer(@Nonnull ApiTracer newTracer)
- Specified by:
withTracerin interfaceApiCallContext
-
-