Module bus.http

Class RealInterceptorChain

java.lang.Object
org.miaixz.bus.http.metric.http.RealInterceptorChain
All Implemented Interfaces:
NewChain

public class RealInterceptorChain extends Object implements NewChain
A concrete interceptor chain that carries the entire interceptor chain: all application interceptors, the Http core, all network interceptors, and finally the network caller.
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

  • Method Details

    • connection

      public Connection connection()
      Description copied from interface: NewChain
      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.
      Specified by:
      connection in interface NewChain
      Returns:
      The connection information.
    • connectTimeoutMillis

      public int connectTimeoutMillis()
      Description copied from interface: NewChain
      Returns the connect timeout in milliseconds.
      Specified by:
      connectTimeoutMillis in interface NewChain
      Returns:
      The connect timeout in milliseconds.
    • withConnectTimeout

      public NewChain withConnectTimeout(int timeout, TimeUnit unit)
      Description copied from interface: NewChain
      Sets the connect timeout for this chain.
      Specified by:
      withConnectTimeout in interface NewChain
      Parameters:
      timeout - The timeout value.
      unit - The time unit.
      Returns:
      This NewChain instance.
    • readTimeoutMillis

      public int readTimeoutMillis()
      Description copied from interface: NewChain
      Returns the read timeout in milliseconds.
      Specified by:
      readTimeoutMillis in interface NewChain
      Returns:
      The read timeout in milliseconds.
    • withReadTimeout

      public NewChain withReadTimeout(int timeout, TimeUnit unit)
      Description copied from interface: NewChain
      Configures the read timeout for this chain.
      Specified by:
      withReadTimeout in interface NewChain
      Parameters:
      timeout - The timeout value.
      unit - The time unit.
      Returns:
      This NewChain instance.
    • writeTimeoutMillis

      public int writeTimeoutMillis()
      Description copied from interface: NewChain
      Returns the write timeout in milliseconds.
      Specified by:
      writeTimeoutMillis in interface NewChain
      Returns:
      The write timeout in milliseconds.
    • withWriteTimeout

      public NewChain withWriteTimeout(int timeout, TimeUnit unit)
      Description copied from interface: NewChain
      Configures the write timeout for this chain.
      Specified by:
      withWriteTimeout in interface NewChain
      Parameters:
      timeout - The timeout value.
      unit - The time unit.
      Returns:
      This NewChain instance.
    • transmitter

      public Transmitter transmitter()
    • exchange

      public Exchange exchange()
    • call

      public NewCall call()
      Description copied from interface: NewChain
      Returns the actual call that is ready to execute the request.
      Specified by:
      call in interface NewChain
      Returns:
      The NewCall instance.
    • request

      public Request request()
      Description copied from interface: NewChain
      Returns the request currently being processed.
      Specified by:
      request in interface NewChain
      Returns:
      The network request.
    • proceed

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

      public Response proceed(Request request, Transmitter transmitter, Exchange exchange) throws IOException
      Throws:
      IOException