Class AgentCardHelper
java.lang.Object
com.mulesoft.connectors.a2a.internal.client.helper.AgentCardHelper
Helper class for agent card parsing and validation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AgentCardhandleAgentCardResponse(URI requestUri, org.mule.runtime.extension.api.runtime.operation.Result<String, ResponseAttributes> result, JsonRpcSerializer serializer) Parses and validates the agent card from JSON.static AgentCardparseAgentCard(URI requestUri, String json, JsonRpcSerializer serializer) Converts a JSON string to an AgentCard using the provided serializer.static URIvalidateServerUrl(String serverUrl) Validates the server URL and returns a URI object.
-
Constructor Details
-
AgentCardHelper
public AgentCardHelper()
-
-
Method Details
-
parseAgentCard
public static AgentCard parseAgentCard(URI requestUri, String json, JsonRpcSerializer serializer) throws AgentCardDiscoveryException Converts a JSON string to an AgentCard using the provided serializer.- Parameters:
requestUri-json-serializer-- Returns:
- Throws:
AgentCardDiscoveryException
-
handleAgentCardResponse
public static AgentCard handleAgentCardResponse(URI requestUri, org.mule.runtime.extension.api.runtime.operation.Result<String, ResponseAttributes> result, JsonRpcSerializer serializer) throws AgentCardDiscoveryExceptionParses and validates the agent card from JSON. Ensures the service URL is present and valid.- Parameters:
requestUri-json-serializer-- Returns:
- Throws:
AgentCardDiscoveryException
-
validateServerUrl
Validates the server URL and returns a URI object.- Parameters:
serverUrl-- Returns:
- Throws:
AgentCardDiscoveryException
-