ControlPlaneHttpClient
public final class ControlPlaneHttpClient
io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:33–201控制面 HTTP 客户端,封装与远端服务的连接和调用。位于 io.agentscope.extensions.aistio.transport 包。核心成员包括 baseUrl、mapper、send、sendBytes、sendForBytes、ControlPlaneHttpClient。
Shared JDK HttpClient wrapper for aistio control-plane REST calls.
Sends X-Builder-Internal-Token on every request and enforces a 10s timeout.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
Response | 记录record | 承载响应数据的记录类型。 HTTP response with a decoded string body. |
BytesResponse | 记录record | 承载字节响应数据的记录类型。 HTTP response with a raw byte body (e.g. |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public ControlPlaneHttpClient(String baseUrl, String internalToken) | 初始化 `ControlPlaneHttpClient` 实例。 Creates a client against the given control-plane base URL. |
方法摘要Method Summary
构造器详情Constructor Detail
ControlPlaneHttpClient
public ControlPlaneHttpClient(String baseUrl, String internalToken)
初始化 ControlPlaneHttpClient 实例。
Creates a client against the given control-plane base URL.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
baseUrl | String | 基类 URL(类型 `String`)。control-plane HTTP base (trailing slash trimmed) |
internalToken | String | 用于`X-Builder-Internal-Token`的值。value for `X-Builder-Internal-Token` |
io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:55–59方法详情Method Detail
baseUrl
public String baseUrl()
返回基类 URL。
Returns the trimmed base URL.
Stringio/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:62–64mapper
public static ObjectMapper mapper()
返回 mapper 结果。
Returns the Jackson mapper shared by control-plane clients.
ObjectMapperio/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:67–69send
public Response send(String method, String path, Object jsonBody) throws IOException, InterruptedException
执行发送相关操作。
Sends a JSON request and returns the string body.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
method | String | 方法(类型 `String`)。HTTP method |
path | String | 路径(类型 `String`)。absolute path beginning with `/`, may include a query string |
jsonBody | Object | JSON 正文(类型 `Object`)。request body object (serialized with Jackson), or `null` for no body |
ResponseIOException可能抛出 `IOException`。Thrown when the operation cannot be completed.InterruptedException可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:78–81send
public Response send(String method, String path, Object jsonBody, Map<String, String> extraHeaders) throws IOException, InterruptedException
执行发送相关操作。
Sends a JSON request with extra headers.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
method | String | 方法(类型 `String`)。HTTP method |
path | String | 路径(类型 `String`)。absolute path beginning with `/` |
jsonBody | Object | JSON 正文(类型 `Object`)。request body object, or `null` |
extraHeaders | Map<String, String> | extra 请求头(类型 `Map`)。additional request headers |
ResponseIOException可能抛出 `IOException`。Thrown when the operation cannot be completed.InterruptedException可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:91–104sendBytes
public Response sendBytes(String method, String path, String contentType, byte[] body) throws IOException, InterruptedException
发送字节。
Sends a raw-bytes request (e.g.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
method | String | 方法(类型 `String`)。HTTP method |
path | String | 路径(类型 `String`)。absolute path beginning with `/` |
contentType | String | 内容类型(类型 `String`)。`Content-Type` header, or `null` to omit |
body | byte[] | 用于无正文的请求正文字节,或`null`/`empty`。request body bytes, or `null`/`empty` for no body |
ResponseIOException可能抛出 `IOException`。Thrown when the operation cannot be completed.InterruptedException可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:114–117sendBytes
public Response sendBytes(String method, String path, String contentType, byte[] body, Map<String, String> extraHeaders) throws IOException, InterruptedException
发送字节。
Sends raw bytes with additional request headers.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
method | String | 方法(类型 `String`)。The method. |
path | String | 路径(类型 `String`)。The path. |
contentType | String | 内容类型(类型 `String`)。The content type. |
body | byte[] | 正文(类型 `byte[]`)。The body. |
extraHeaders | Map<String, String> | extra 请求头(类型 `Map`)。The extra headers. |
ResponseIOException可能抛出 `IOException`。Thrown when the operation cannot be completed.InterruptedException可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:120–138sendForBytes
public BytesResponse sendForBytes(String method, String path, String contentType, byte[] body) throws IOException, InterruptedException
发送用于字节。
Sends a request and returns the raw response bytes (used for snapshot download).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
method | String | 方法(类型 `String`)。HTTP method |
path | String | 路径(类型 `String`)。absolute path beginning with `/` |
contentType | String | 用于请求正文的可选内容类型。optional content type for a request body |
body | byte[] | 正文(类型 `byte[]`)。optional request body |
BytesResponseIOException可能抛出 `IOException`。Thrown when the operation cannot be completed.InterruptedException可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:148–151sendForBytes
public BytesResponse sendForBytes(String method, String path, String contentType, byte[] body, Map<String, String> extraHeaders) throws IOException, InterruptedException
发送用于字节。
Receives raw bytes with additional request headers.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
method | String | 方法(类型 `String`)。The method. |
path | String | 路径(类型 `String`)。The path. |
contentType | String | 内容类型(类型 `String`)。The content type. |
body | byte[] | 正文(类型 `byte[]`)。The body. |
extraHeaders | Map<String, String> | extra 请求头(类型 `Map`)。The extra headers. |
BytesResponseIOException可能抛出 `IOException`。Thrown when the operation cannot be completed.InterruptedException可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:154–173嵌套类详情Nested Class Detail
Response
public record Response(int status, String body)承载响应数据的记录类型。位于 io.agentscope.extensions.aistio.transport 包。核心成员包括 status、body。
HTTP response with a decoded string body.
BytesResponse
public record BytesResponse(int status, byte[] body)承载字节响应数据的记录类型。位于 io.agentscope.extensions.aistio.transport 包。核心成员包括 status、body。
HTTP response with a raw byte body (e.g. snapshot octet-streams).