Class VertxA2AHttpClientProvider
- All Implemented Interfaces:
A2AHttpClientProvider
VertxA2AHttpClient.
This provider has priority 100, placing it above the JDK implementation (0) but below the Android (110) and CDI (200) providers. It is preferred over JDK when the Vert.x dependencies are available on the classpath.
If Vert.x classes are not available at runtime, this provider will check for their
presence and throw an IllegalStateException when attempting to create a client.
The ServiceLoader mechanism will skip this provider and fall back to the JDK implementation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate()Creates a new instance of an A2AHttpClient.create(A2AHttpClientConfiguration configuration) Creates a client using the supplied factory configuration.name()Returns the name of this provider for logging and debugging purposes.intpriority()Returns the priority of this provider.booleanReturns whether this provider honours a configuredRedirectHeaderPolicy.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.a2aproject.sdk.client.http.A2AHttpClientProvider
createWithSseConfig, supportsSseConfig
-
Constructor Details
-
VertxA2AHttpClientProvider
public VertxA2AHttpClientProvider()
-
-
Method Details
-
create
Description copied from interface:A2AHttpClientProviderCreates a new instance of an A2AHttpClient.- Specified by:
createin interfaceA2AHttpClientProvider- Returns:
- a new A2AHttpClient instance
-
create
Description copied from interface:A2AHttpClientProviderCreates a client using the supplied factory configuration.The default implementation supports SSE parser configuration when this provider advertises
A2AHttpClientProvider.supportsSseConfig(); providers that support redirect-header policies should override this method to apply them.- Specified by:
createin interfaceA2AHttpClientProvider- Parameters:
configuration- the factory configuration- Returns:
- a new A2AHttpClient instance
-
supportsRedirectHeaderPolicy
public boolean supportsRedirectHeaderPolicy()Description copied from interface:A2AHttpClientProviderReturns whether this provider honours a configuredRedirectHeaderPolicy.- Specified by:
supportsRedirectHeaderPolicyin interfaceA2AHttpClientProvider- Returns:
trueif this provider applies redirect-header policies
-
priority
public int priority()Description copied from interface:A2AHttpClientProviderReturns the priority of this provider. Higher priority providers are tried first; the first one whoseA2AHttpClientProvider.create()succeeds is used.Built-in priorities (for reference when choosing a custom value):
- CdiA2AHttpClient: 200 (CDI-provided bean, when a container and bean are active)
- AndroidA2AHttpClient: 110 (Android runtime only)
- VertxA2AHttpClient: 100 (when
vertx-web-clientis on the classpath) - JdkA2AHttpClient: 0 (always available, last resort)
- Specified by:
priorityin interfaceA2AHttpClientProvider- Returns:
- the priority value (higher is better)
-
name
Description copied from interface:A2AHttpClientProviderReturns the name of this provider for logging and debugging purposes.- Specified by:
namein interfaceA2AHttpClientProvider- Returns:
- the provider name
-