Module bus.http

Interface NewChain

All Known Implementing Classes:
RealInterceptorChain

public interface NewChain
A chain of interceptors that can process an HTTP request and response.
Since:
Java 17+
Author:
Kimi Liu
  • Method Details

    • request

      Request request()
      Returns the request currently being processed.
      Returns:
      The network request.
    • proceed

      Response proceed(Request request) throws IOException
      Proceeds with the request to the next interceptor in the chain.
      Parameters:
      request - The network request.
      Returns:
      The response from the next interceptor.
      Throws:
      IOException - if an I/O error occurs.
    • connection

      Connection connection()
      Returns the connection that will be used to execute the request. This is only available in the network interceptor chain; for application interceptors, this will always be null.
      Returns:
      The connection information.
    • call

      NewCall call()
      Returns the actual call that is ready to execute the request.
      Returns:
      The NewCall instance.
    • connectTimeoutMillis

      int connectTimeoutMillis()
      Returns the connect timeout in milliseconds.
      Returns:
      The connect timeout in milliseconds.
    • withConnectTimeout

      NewChain withConnectTimeout(int timeout, TimeUnit unit)
      Sets the connect timeout for this chain.
      Parameters:
      timeout - The timeout value.
      unit - The time unit.
      Returns:
      This NewChain instance.
    • readTimeoutMillis

      int readTimeoutMillis()
      Returns the read timeout in milliseconds.
      Returns:
      The read timeout in milliseconds.
    • withReadTimeout

      NewChain withReadTimeout(int timeout, TimeUnit unit)
      Configures the read timeout for this chain.
      Parameters:
      timeout - The timeout value.
      unit - The time unit.
      Returns:
      This NewChain instance.
    • writeTimeoutMillis

      int writeTimeoutMillis()
      Returns the write timeout in milliseconds.
      Returns:
      The write timeout in milliseconds.
    • withWriteTimeout

      NewChain withWriteTimeout(int timeout, TimeUnit unit)
      Configures the write timeout for this chain.
      Parameters:
      timeout - The timeout value.
      unit - The time unit.
      Returns:
      This NewChain instance.