Class HttpJsonCallContext

  • All Implemented Interfaces:
    com.google.api.gax.retrying.RetryingContext, com.google.api.gax.rpc.ApiCallContext

    @BetaApi("Reference ApiCallContext instead - this class is likely to experience breaking changes")
    public final class HttpJsonCallContext
    extends Object
    implements com.google.api.gax.rpc.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.

    • Method Detail

      • nullToSelf

        public HttpJsonCallContext nullToSelf​(com.google.api.gax.rpc.ApiCallContext inputContext)
        Returns inputContext cast to HttpJsonCallContext, or an empty HttpJsonCallContext if inputContext is null.
        Specified by:
        nullToSelf in interface com.google.api.gax.rpc.ApiCallContext
        Parameters:
        inputContext - the ApiCallContext to cast if it is not null
      • merge

        public HttpJsonCallContext merge​(com.google.api.gax.rpc.ApiCallContext inputCallContext)
        Specified by:
        merge in interface com.google.api.gax.rpc.ApiCallContext
      • withCredentials

        public HttpJsonCallContext withCredentials​(com.google.auth.Credentials newCredentials)
        Specified by:
        withCredentials in interface com.google.api.gax.rpc.ApiCallContext
      • withTransportChannel

        public HttpJsonCallContext withTransportChannel​(com.google.api.gax.rpc.TransportChannel inputChannel)
        Specified by:
        withTransportChannel in interface com.google.api.gax.rpc.ApiCallContext
      • withTimeout

        public HttpJsonCallContext withTimeout​(org.threeten.bp.Duration timeout)
        Specified by:
        withTimeout in interface com.google.api.gax.rpc.ApiCallContext
      • getTimeout

        @Nullable
        public org.threeten.bp.Duration getTimeout()
        Specified by:
        getTimeout in interface com.google.api.gax.rpc.ApiCallContext
      • withStreamWaitTimeout

        public HttpJsonCallContext withStreamWaitTimeout​(@Nullable
                                                         org.threeten.bp.Duration streamWaitTimeout)
        Specified by:
        withStreamWaitTimeout in interface com.google.api.gax.rpc.ApiCallContext
      • getStreamWaitTimeout

        @Nullable
        public org.threeten.bp.Duration getStreamWaitTimeout()
        The stream wait timeout set for this context.
        Specified by:
        getStreamWaitTimeout in interface com.google.api.gax.rpc.ApiCallContext
        See Also:
        ApiCallContext.withStreamWaitTimeout(Duration)
      • withStreamIdleTimeout

        public HttpJsonCallContext withStreamIdleTimeout​(@Nullable
                                                         org.threeten.bp.Duration streamIdleTimeout)
        Specified by:
        withStreamIdleTimeout in interface com.google.api.gax.rpc.ApiCallContext
      • getStreamIdleTimeout

        @Nullable
        public org.threeten.bp.Duration getStreamIdleTimeout()
        The stream idle timeout set for this context.
        Specified by:
        getStreamIdleTimeout in interface com.google.api.gax.rpc.ApiCallContext
        See Also:
        ApiCallContext.withStreamIdleTimeout(Duration)
      • withExtraHeaders

        @BetaApi("The surface for extra headers is not stable yet and may change in the future.")
        public com.google.api.gax.rpc.ApiCallContext withExtraHeaders​(Map<String,​List<String>> extraHeaders)
        Specified by:
        withExtraHeaders in interface com.google.api.gax.rpc.ApiCallContext
      • 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:
        getExtraHeaders in interface com.google.api.gax.rpc.ApiCallContext
      • withOption

        public <T> com.google.api.gax.rpc.ApiCallContext withOption​(com.google.api.gax.rpc.ApiCallContext.Key<T> key,
                                                                    T value)
        Specified by:
        withOption in interface com.google.api.gax.rpc.ApiCallContext
      • getOption

        public <T> T getOption​(com.google.api.gax.rpc.ApiCallContext.Key<T> key)
        Specified by:
        getOption in interface com.google.api.gax.rpc.ApiCallContext
      • getCredentials

        @Deprecated
        @Nullable
        public com.google.auth.Credentials getCredentials()
        Deprecated.
      • getRetrySettings

        public com.google.api.gax.retrying.RetrySettings getRetrySettings()
        Specified by:
        getRetrySettings in interface com.google.api.gax.retrying.RetryingContext
      • withRetrySettings

        public HttpJsonCallContext withRetrySettings​(com.google.api.gax.retrying.RetrySettings retrySettings)
        Specified by:
        withRetrySettings in interface com.google.api.gax.rpc.ApiCallContext
      • getRetryableCodes

        public Set<com.google.api.gax.rpc.StatusCode.Code> getRetryableCodes()
        Specified by:
        getRetryableCodes in interface com.google.api.gax.retrying.RetryingContext
      • withRetryableCodes

        public HttpJsonCallContext withRetryableCodes​(Set<com.google.api.gax.rpc.StatusCode.Code> retryableCodes)
        Specified by:
        withRetryableCodes in interface com.google.api.gax.rpc.ApiCallContext
      • getTracer

        @Nonnull
        public com.google.api.gax.tracing.ApiTracer getTracer()
        Specified by:
        getTracer in interface com.google.api.gax.rpc.ApiCallContext
        Specified by:
        getTracer in interface com.google.api.gax.retrying.RetryingContext
      • withTracer

        public HttpJsonCallContext withTracer​(@Nonnull
                                              com.google.api.gax.tracing.ApiTracer newTracer)
        Specified by:
        withTracer in interface com.google.api.gax.rpc.ApiCallContext
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object