Class JdkA2AHttpClientProvider
- All Implemented Interfaces:
A2AHttpClientProvider
JdkA2AHttpClient.
This provider has the lowest priority (0) and serves as the fallback implementation when no other providers are available. The JDK HTTP client is always available as it uses only standard Java libraries.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate()Creates a new instance of an A2AHttpClient.createWithSseConfig(SSEParserConfig sseParserConfig) Creates a new instance of an A2AHttpClient with the givenSSEParserConfig.name()Returns the name of this provider for logging and debugging purposes.intpriority()Returns the priority of this provider.booleanReturnstrueif this provider honours theSSEParserConfigpassed toA2AHttpClientProvider.createWithSseConfig(SSEParserConfig).
-
Constructor Details
-
JdkA2AHttpClientProvider
public JdkA2AHttpClientProvider()
-
-
Method Details
-
create
Description copied from interface:A2AHttpClientProviderCreates a new instance of an A2AHttpClient.- Specified by:
createin interfaceA2AHttpClientProvider- Returns:
- a new A2AHttpClient instance
-
createWithSseConfig
Creates a new instance of an A2AHttpClient with the givenSSEParserConfig.Providers that support SSE parser configuration should override both this method and
A2AHttpClientProvider.supportsSseConfig()to returntrue. The default implementation ignoressseParserConfigand delegates toA2AHttpClientProvider.create().- Specified by:
createWithSseConfigin interfaceA2AHttpClientProvider- Parameters:
sseParserConfig- the SSE parser configuration to apply- Returns:
- a new A2AHttpClient instance
-
supportsSseConfig
public boolean supportsSseConfig()Description copied from interface:A2AHttpClientProviderReturnstrueif this provider honours theSSEParserConfigpassed toA2AHttpClientProvider.createWithSseConfig(SSEParserConfig).Providers that override
A2AHttpClientProvider.createWithSseConfig(SSEParserConfig)to actually apply the configuration must also override this method and returntrue; theA2AHttpClientFactory.createWithSseConfig(SSEParserConfig)method uses this flag to skip providers that would silently ignore the supplied configuration.The default is
false, matching the default no-op implementation ofA2AHttpClientProvider.createWithSseConfig(SSEParserConfig).- Specified by:
supportsSseConfigin interfaceA2AHttpClientProvider- Returns:
trueif this provider applies the givenSSEParserConfig
-
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
-