Package com.google.api.gax.httpjson
Class HttpJsonCallContext
java.lang.Object
com.google.api.gax.httpjson.HttpJsonCallContext
- All Implemented Interfaces:
RetryingContext,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 withX return
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
Modifier and TypeMethodDescriptionstatic HttpJsonCallContextReturns an empty instance.booleancom.google.auth.CredentialsDeprecated.org.threeten.bp.InstantDeprecated.<T> TgetOption(ApiCallContext.Key<T> key) org.threeten.bp.DurationThis method is obsolete.The stream idle timeout set for this context.org.threeten.bp.DurationThis method is obsolete.The stream wait timeout set for this context.org.threeten.bp.DurationThis method is obsolete.inthashCode()merge(ApiCallContext inputCallContext) nullToSelf(ApiCallContext inputContext) Returns inputContext cast toHttpJsonCallContext, or an emptyHttpJsonCallContextif inputContext is null.static HttpJsonCallContextof(HttpJsonChannel channel, HttpJsonCallOptions options) voidValidate the Universe Domain to ensure that the user configured Universe Domain and the Credentials' Universe Domain match.withCallOptions(HttpJsonCallOptions newCallOptions) withChannel(HttpJsonChannel newChannel) withCredentials(com.google.auth.Credentials newCredentials) withDeadline(org.threeten.bp.Instant newDeadline) Deprecated.withEndpointContext(EndpointContext endpointContext) withExtraHeaders(Map<String, List<String>> extraHeaders) <T> ApiCallContextwithOption(ApiCallContext.Key<T> key, T value) withRetryableCodes(Set<StatusCode.Code> retryableCodes) withRetrySettings(RetrySettings retrySettings) withStreamIdleTimeout(org.threeten.bp.Duration streamIdleTimeout) This method is obsolete.withStreamIdleTimeoutDuration(Duration streamIdleTimeout) withStreamWaitTimeout(org.threeten.bp.Duration streamWaitTimeout) This method is obsolete.withStreamWaitTimeoutDuration(Duration streamWaitTimeout) withTimeout(org.threeten.bp.Duration timeout) This method is obsolete.withTimeoutDuration(Duration timeout) withTracer(ApiTracer newTracer) withTransportChannel(TransportChannel inputChannel)
-
Method Details
-
createDefault
Returns an empty instance. -
of
-
nullToSelf
Returns inputContext cast toHttpJsonCallContext, or an emptyHttpJsonCallContextif inputContext is null.- Specified by:
nullToSelfin interfaceApiCallContext- Parameters:
inputContext- theApiCallContextto cast if it is not null
-
merge
- Specified by:
mergein interfaceApiCallContext
-
withCredentials
- Specified by:
withCredentialsin interfaceApiCallContext
-
withTransportChannel
- Specified by:
withTransportChannelin interfaceApiCallContext
-
withTimeout
@ObsoleteApi("Use withTimeoutDuration(java.time.Duration) instead") public HttpJsonCallContext withTimeout(org.threeten.bp.Duration timeout) This method is obsolete. UsewithTimeoutDuration(java.time.Duration)instead.- Specified by:
withTimeoutin interfaceApiCallContext
-
withEndpointContext
- Specified by:
withEndpointContextin interfaceApiCallContext
-
withTimeoutDuration
- Specified by:
withTimeoutDurationin interfaceApiCallContext
-
getTimeout
@Nullable @ObsoleteApi("Use getTimeoutDuration instead") public org.threeten.bp.Duration getTimeout()This method is obsolete. UsegetTimeoutDuration()instead.- Specified by:
getTimeoutin interfaceApiCallContext
-
getTimeoutDuration
- Specified by:
getTimeoutDurationin interfaceApiCallContext
-
withStreamWaitTimeout
@ObsoleteApi("Use withStreamWaitTimeoutDuration(java.time.Duration) instead") public HttpJsonCallContext withStreamWaitTimeout(@Nullable org.threeten.bp.Duration streamWaitTimeout) This method is obsolete. UsewithStreamWaitTimeoutDuration(java.time.Duration)instead.- Specified by:
withStreamWaitTimeoutin interfaceApiCallContext
-
withStreamWaitTimeoutDuration
- Specified by:
withStreamWaitTimeoutDurationin interfaceApiCallContext
-
getStreamWaitTimeout
@Nullable @ObsoleteApi("Use getStreamWaitTimeoutDuration() instead") public org.threeten.bp.Duration getStreamWaitTimeout()This method is obsolete. UsegetStreamWaitTimeoutDuration()instead.- Specified by:
getStreamWaitTimeoutin interfaceApiCallContext
-
getStreamWaitTimeoutDuration
The stream wait timeout set for this context.- Specified by:
getStreamWaitTimeoutDurationin interfaceApiCallContext- See Also:
-
withStreamIdleTimeout
@ObsoleteApi("Use withStreamIdleTimeoutDuration(java.time.Duration) instead") public HttpJsonCallContext withStreamIdleTimeout(@Nullable org.threeten.bp.Duration streamIdleTimeout) This method is obsolete. UsewithStreamIdleTimeoutDuration(java.time.Duration)instead.- Specified by:
withStreamIdleTimeoutin interfaceApiCallContext
-
withStreamIdleTimeoutDuration
- Specified by:
withStreamIdleTimeoutDurationin interfaceApiCallContext
-
getStreamIdleTimeout
@Nullable @ObsoleteApi("Use getStreamIdleTimeoutDuration() instead") public org.threeten.bp.Duration getStreamIdleTimeout()This method is obsolete. UsegetStreamIdleTimeoutDuration()instead.- Specified by:
getStreamIdleTimeoutin interfaceApiCallContext
-
getStreamIdleTimeoutDuration
The stream idle timeout set for this context.- Specified by:
getStreamIdleTimeoutDurationin interfaceApiCallContext- See Also:
-
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
- Specified by:
withOptionin interfaceApiCallContext
-
getOption
- Specified by:
getOptionin interfaceApiCallContext
-
validateUniverseDomain
Validate the Universe Domain to ensure that the user configured Universe Domain and the Credentials' Universe Domain match. An exception will be raised if there are any issues when trying to validate (i.e. unable to access the universe domain).- Throws:
UnauthenticatedException- Thrown if the universe domain that the user configured does not match the Credential's universe domain or if the client library is unable to retrieve the Universe Domain from the Credentials.
-
getChannel
-
getCallOptions
-
getDeadline
Deprecated. -
getCredentials
Deprecated. -
getRetrySettings
- Specified by:
getRetrySettingsin interfaceRetryingContext
-
withRetrySettings
- Specified by:
withRetrySettingsin interfaceApiCallContext
-
getRetryableCodes
- Specified by:
getRetryableCodesin interfaceRetryingContext
-
withRetryableCodes
- Specified by:
withRetryableCodesin interfaceApiCallContext
-
withChannel
-
withCallOptions
-
withDeadline
Deprecated. -
getTracer
- Specified by:
getTracerin interfaceApiCallContext- Specified by:
getTracerin interfaceRetryingContext
-
withTracer
- Specified by:
withTracerin interfaceApiCallContext
-
equals
-
hashCode
public int hashCode()
-