@Override public HttpJsonCallContext withCredentials(Credentials newCredentials) { return new HttpJsonCallContext( this.channel, this.timeout, this.deadline, newCredentials, this.extraHeaders, this.tracer); }
public HttpJsonCallContext withDeadline(Instant newDeadline) { return new HttpJsonCallContext( channel, timeout, newDeadline, credentials, extraHeaders, this.tracer); }
@Override public HttpJsonCallContext withCredentials(Credentials newCredentials) { return new HttpJsonCallContext( this.channel, this.timeout, this.deadline, newCredentials, this.extraHeaders, this.tracer); }
public HttpJsonCallContext withChannel(HttpJsonChannel newChannel) { return new HttpJsonCallContext( newChannel, timeout, deadline, credentials, extraHeaders, this.tracer); }
public HttpJsonCallContext withDeadline(Instant newDeadline) { return new HttpJsonCallContext( channel, timeout, newDeadline, credentials, extraHeaders, this.tracer); }
public HttpJsonCallContext withChannel(HttpJsonChannel newChannel) { return new HttpJsonCallContext( newChannel, timeout, deadline, credentials, extraHeaders, this.tracer); }
/** Returns an empty instance. */ public static HttpJsonCallContext createDefault() { return new HttpJsonCallContext( null, null, null, null, ImmutableMap.<String, List<String>>of(), null); }
/** Returns an empty instance. */ public static HttpJsonCallContext createDefault() { return new HttpJsonCallContext( null, null, null, null, ImmutableMap.<String, List<String>>of(), null); }
/** {@inheritDoc} */ @Override public HttpJsonCallContext withTracer(@Nonnull ApiTracer newTracer) { Preconditions.checkNotNull(newTracer); return new HttpJsonCallContext( channel, timeout, deadline, credentials, extraHeaders, newTracer); }
/** {@inheritDoc} */ @Override public HttpJsonCallContext withTracer(@Nonnull ApiTracer newTracer) { Preconditions.checkNotNull(newTracer); return new HttpJsonCallContext( channel, timeout, deadline, credentials, extraHeaders, newTracer); }
@BetaApi("The surface for extra headers is not stable yet and may change in the future.") @Override public ApiCallContext withExtraHeaders(Map<String, List<String>> extraHeaders) { Preconditions.checkNotNull(extraHeaders); ImmutableMap<String, List<String>> newExtraHeaders = Headers.mergeHeaders(this.extraHeaders, extraHeaders); return new HttpJsonCallContext( channel, timeout, deadline, credentials, newExtraHeaders, this.tracer); }
@BetaApi("The surface for extra headers is not stable yet and may change in the future.") @Override public ApiCallContext withExtraHeaders(Map<String, List<String>> extraHeaders) { Preconditions.checkNotNull(extraHeaders); ImmutableMap<String, List<String>> newExtraHeaders = Headers.mergeHeaders(this.extraHeaders, extraHeaders); return new HttpJsonCallContext( channel, timeout, deadline, credentials, newExtraHeaders, this.tracer); }
return new HttpJsonCallContext( newChannel, newTimeout, newDeadline, newCredentials, newExtraHeaders, newTracer);
return new HttpJsonCallContext( newChannel, newTimeout, newDeadline, newCredentials, newExtraHeaders, newTracer);
@Override public HttpJsonCallContext withTimeout(Duration timeout) { // Default RetrySettings use 0 for RPC timeout. Treat that as disabled timeouts. if (timeout != null && (timeout.isZero() || timeout.isNegative())) { timeout = null; } // Prevent expanding deadlines if (timeout != null && this.timeout != null && this.timeout.compareTo(timeout) <= 0) { return this; } return new HttpJsonCallContext( this.channel, timeout, this.deadline, this.credentials, this.extraHeaders, this.tracer); }
@Override public HttpJsonCallContext withTimeout(Duration timeout) { // Default RetrySettings use 0 for RPC timeout. Treat that as disabled timeouts. if (timeout != null && (timeout.isZero() || timeout.isNegative())) { timeout = null; } // Prevent expanding deadlines if (timeout != null && this.timeout != null && this.timeout.compareTo(timeout) <= 0) { return this; } return new HttpJsonCallContext( this.channel, timeout, this.deadline, this.credentials, this.extraHeaders, this.tracer); }