Class A2AClient
java.lang.Object
com.mulesoft.connectors.a2a.internal.client.connection.A2AClient
-
Constructor Summary
ConstructorsConstructorDescriptionA2AClient(String baseUrl, int responseTimeout, org.mule.runtime.http.api.client.HttpClient httpClient, org.mule.extension.http.api.request.authentication.HttpRequestAuthentication authentication, org.mule.runtime.api.util.MultiMap<String, String> defaultHeaders, JsonRpcSerializer serializer, A2AProtocolSerializer a2aSerializer) -
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> cancelTask(InputStream taskId, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> deletePushNotificationConfig(InputStream taskQuery, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Delete push notification config from the agent via "tasks/pushNotificationConfig/delete" operation.CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getAgentCard(boolean useExtendedCard, boolean setBaseUrl, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches the agent card and returns it as an AgentCard object.CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getCard(boolean useExtendedCard, boolean setBaseUrl, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getCard(boolean useExtendedCard, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches the agent card from the agent via "agent/card" operation.CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getPushNotificationConfig(InputStream taskQuery, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches the specific push notification config from the agent via "tasks/pushNotificationConfig/get" operation.CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getTask(InputStream query, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches the task current state from the agent via "tasks/get" operation.CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> listPushNotificationConfigs(InputStream taskQuery, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches all push notification config from the agent via "tasks/pushNotificationConfig/list" operation.CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> sendMessage(InputStream message, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Redirects the request to the agent from the client for "message/send" operation.voidsetBaseUrl(String baseUrl) CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> setPushNotificationConfig(InputStream taskPushNotificationConfig, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Update push notification config for task via "tasks/pushNotificationConfig/set" operation.
-
Constructor Details
-
A2AClient
public A2AClient(String baseUrl, int responseTimeout, org.mule.runtime.http.api.client.HttpClient httpClient, org.mule.extension.http.api.request.authentication.HttpRequestAuthentication authentication, org.mule.runtime.api.util.MultiMap<String, String> defaultHeaders, JsonRpcSerializer serializer, A2AProtocolSerializer a2aSerializer)
-
-
Method Details
-
setBaseUrl
-
sendMessage
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> sendMessage(InputStream message, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Redirects the request to the agent from the client for "message/send" operation.- Parameters:
message- messageSendParams for rpc requestrequestParameters- request parameter group containing additional properties and other request settings- Returns:
- Response
-
getTask
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getTask(InputStream query, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches the task current state from the agent via "tasks/get" operation.- Parameters:
query- taskIdParams for rpc requestrequestParameters- request parameter group containing additional properties and other request settings- Returns:
- Response
-
getPushNotificationConfig
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getPushNotificationConfig(InputStream taskQuery, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches the specific push notification config from the agent via "tasks/pushNotificationConfig/get" operation.- Parameters:
taskQuery- taskQueryParams for rpc requestrequestParameters- request parameter group containing additional properties and other request settings- Returns:
- Response
-
listPushNotificationConfigs
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> listPushNotificationConfigs(InputStream taskQuery, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches all push notification config from the agent via "tasks/pushNotificationConfig/list" operation.- Parameters:
taskQuery- taskIdParams for rpc requestrequestParameters- request parameter group containing additional properties and other request settings- Returns:
- Response
-
deletePushNotificationConfig
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> deletePushNotificationConfig(InputStream taskQuery, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Delete push notification config from the agent via "tasks/pushNotificationConfig/delete" operation.- Parameters:
taskQuery- taskQueryParams for rpc requestrequestParameters- request parameter group containing additional properties and other request settings- Returns:
- Response
-
setPushNotificationConfig
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> setPushNotificationConfig(InputStream taskPushNotificationConfig, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Update push notification config for task via "tasks/pushNotificationConfig/set" operation.- Parameters:
taskPushNotificationConfig- config for rpc requestrequestParameters- request parameter group containing additional properties and other request settings- Returns:
- Response
-
getCard
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getCard(boolean useExtendedCard, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches the agent card from the agent via "agent/card" operation.- Parameters:
useExtendedCard- whether to use the extended card endpoint- Returns:
- Response
-
getCard
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getCard(boolean useExtendedCard, boolean setBaseUrl, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) -
cancelTask
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> cancelTask(InputStream taskId, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) -
getAgentCard
public CompletableFuture<org.mule.runtime.extension.api.runtime.operation.Result<String,ResponseAttributes>> getAgentCard(boolean useExtendedCard, boolean setBaseUrl, RequestParameterGroup requestParameters, org.mule.sdk.api.runtime.source.DistributedTraceContextManager traceContextManager) Fetches the agent card and returns it as an AgentCard object. This method encapsulates the conversion from raw response to AgentCard. It also validates the agent card and sets the service URL as the base URL.- Returns:
- CompletableFuture
-
getServiceUrl
-