Class ClientCallInterceptor

java.lang.Object
org.a2aproject.sdk.client.transport.spi.interceptors.ClientCallInterceptor
Direct Known Subclasses:
AuthInterceptor

public abstract class ClientCallInterceptor extends Object
An abstract base class for client-side call interceptors. Interceptors can inspect and modify requests before they are sent, which is ideal for concerns like authentication, logging, or tracing.
  • Constructor Details

    • ClientCallInterceptor

      public ClientCallInterceptor()
  • Method Details

    • intercept

      public abstract PayloadAndHeaders intercept(String methodName, @Nullable Object payload, Map<String,String> headers, @Nullable org.a2aproject.sdk.spec.AgentCard agentCard, @Nullable ClientCallContext clientCallContext)
      Intercept a client call before the request is sent.
      Parameters:
      methodName - the name of the protocol method (e.g., 'message/send')
      payload - the request payload
      headers - the headers to use
      agentCard - the agent card (may be null)
      clientCallContext - the ClientCallContext for this call (may be null)
      Returns:
      the potentially modified payload and headers