HttpSelfRegistration
public final class HttpSelfRegistration implements AutoCloseable
io/agentscope/extensions/controlplane/transport/HttpSelfRegistration.java:40–284HTTP 自身注册,承载智能体的部署、调度与服务化运行。位于 io.agentscope.extensions.controlplane.transport 包,实现 AutoCloseable。核心成员包括 start、identity、setIdentityListener、close、HttpSelfRegistration。
v5 external-application registration against service-controlplane:
POST /api/v1/agent-registrations + periodic instance heartbeats.
The control plane then polls this instance's /agentscope/* contract at baseUrl. Failures are swallowed and retried — registration must never disturb the agent.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
RegisteredIdentity | 记录record | 承载已注册身份数据的记录类型。 Stable identity returned by the Catalog registration transaction. |
构造器摘要Constructor Summary
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void start() | 执行启动相关操作。 Returns the start. |
public RegisteredIdentity identity() | 返回身份。 Returns the last successfully registered stable identity, or `null`. |
public void setIdentityListener(Consumer<RegisteredIdentity> listener) | 设置身份监听器。 Receives every successfully refreshed identity, including generation changes. |
public void close() | 关闭连接并释放相关资源。 Releases resources and connections. |
构造器详情Constructor Detail
HttpSelfRegistration
public HttpSelfRegistration(String controlPlaneHttp, String internalToken, String registrationCredential, String agentKey, String tenant, String namespace, String instanceKey, String baseUrl, String runtime, String framework, int contractLevel, List<String> capabilities, long heartbeatIntervalMs)
初始化 HttpSelfRegistration 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
controlPlaneHttp | String | 控制面 HTTP(类型 `String`)。The control plane http. |
internalToken | String | 内部令牌(类型 `String`)。The internal token. |
registrationCredential | String | 注册凭证(类型 `String`)。The registration credential. |
agentKey | String | 智能体键(类型 `String`)。The agent key. |
tenant | String | 租户(类型 `String`)。The tenant. |
namespace | String | 命名空间(类型 `String`)。The namespace. |
instanceKey | String | 实例键(类型 `String`)。The instance key. |
baseUrl | String | 基类 URL(类型 `String`)。The base url. |
runtime | String | 运行时(类型 `String`)。The runtime. |
framework | String | framework(类型 `String`)。The framework. |
contractLevel | int | 契约级别(类型 `int`)。The contract level. |
capabilities | List<String> | 能力(类型 `List`)。The capabilities. |
heartbeatIntervalMs | long | 心跳间隔 Ms(类型 `long`)。The heartbeat interval ms. |
io/agentscope/extensions/controlplane/transport/HttpSelfRegistration.java:75–106方法详情Method Detail
start
public void start()
执行启动相关操作。
Returns the start.
io/agentscope/extensions/controlplane/transport/HttpSelfRegistration.java:108–125identity
public RegisteredIdentity identity()
返回身份。
Returns the last successfully registered stable identity, or null.
RegisteredIdentityio/agentscope/extensions/controlplane/transport/HttpSelfRegistration.java:128–130setIdentityListener
public void setIdentityListener(Consumer<RegisteredIdentity> listener)
设置身份监听器。
Receives every successfully refreshed identity, including generation changes.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
listener | Consumer<RegisteredIdentity> | 监听器(类型 `Consumer`)。The listener. |
io/agentscope/extensions/controlplane/transport/HttpSelfRegistration.java:133–135close
public void close()
关闭连接并释放相关资源。
Releases resources and connections.
io/agentscope/extensions/controlplane/transport/HttpSelfRegistration.java:137–161嵌套类详情Nested Class Detail
RegisteredIdentity
public record RegisteredIdentity( String agentId, String agentKey, String bindingId, String instanceId, String instanceKey, long generation, String registrationCredential)承载已注册身份数据的记录类型。位于 io.agentscope.extensions.controlplane.transport 包。核心成员包括 agentId、agentKey、bindingId、instanceId、instanceKey、generation。
Stable identity returned by the Catalog registration transaction.