RemoteSandboxSnapshot
@JsonIgnoreProperties(ignoreUnknown = true) public class RemoteSandboxSnapshot implements SandboxSnapshot
io/agentscope/harness/agent/sandbox/snapshot/RemoteSandboxSnapshot.java:35–116远程沙箱快照,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.agent.sandbox.snapshot 包,实现 SandboxSnapshot。核心成员包括 persist、restore、isRestorable、getId、getType、RemoteSandboxSnapshot。
Snapshot backed by a RemoteSnapshotClient (e.g. S3, OSS, GCS).
This class delegates all operations to the provided client. The client is responsible for authentication, retry logic, and network error handling.
Note: RemoteSandboxSnapshot is not directly serializable to JSON because
RemoteSnapshotClient cannot be serialized. When persisting session state,
only the id is needed — the client is re-injected from the builder at resume time.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public RemoteSandboxSnapshot(String id) | 初始化 `RemoteSandboxSnapshot` 实例。 Creates a new instance. |
public RemoteSandboxSnapshot(RemoteSnapshotClient client, String id) | 创建远程快照。 Creates a remote snapshot. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void persist(InputStream workspaceArchive) throws Exception | 设置该参数。 {@inheritDoc} |
public InputStream restore() throws Exception | 返回 `restore` 结果。 {@inheritDoc} |
public boolean isRestorable() throws Exception | 判断是否 `isRestorable`。 {@inheritDoc} |
public String getId() | 获取标识。 Returns the id. |
public String getType() | 获取类型。 Returns the type. |
构造器详情Constructor Detail
RemoteSandboxSnapshot
public RemoteSandboxSnapshot(String id)
初始化 RemoteSandboxSnapshot 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
io/agentscope/harness/agent/sandbox/snapshot/RemoteSandboxSnapshot.java:41–44RemoteSandboxSnapshot
public RemoteSandboxSnapshot(RemoteSnapshotClient client, String id)
创建远程快照。
Creates a remote snapshot.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
client | RemoteSnapshotClient | 客户端(类型 `RemoteSnapshotClient`)。the remote storage client to delegate operations to |
id | String | 标识(类型 `String`)。unique identifier for this snapshot |
io/agentscope/harness/agent/sandbox/snapshot/RemoteSandboxSnapshot.java:52–55方法详情Method Detail
persist
public void persist(InputStream workspaceArchive) throws Exception
设置该参数。
{@inheritDoc} Uploads the archive via RemoteSnapshotClient#upload.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspaceArchive | InputStream | 工作区归档(类型 `InputStream`)。The workspace archive. |
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
io/agentscope/harness/agent/sandbox/snapshot/RemoteSandboxSnapshot.java:62–69restore
public InputStream restore() throws Exception
返回 restore 结果。
{@inheritDoc} Downloads the archive via RemoteSnapshotClient#download.
InputStreamException可能抛出 `Exception`。Thrown when the operation cannot be completed.
io/agentscope/harness/agent/sandbox/snapshot/RemoteSandboxSnapshot.java:76–83isRestorable
public boolean isRestorable() throws Exception
判断是否 isRestorable。
{@inheritDoc} Checks existence via RemoteSnapshotClient#exists.
booleanException可能抛出 `Exception`。Thrown when the operation cannot be completed.
io/agentscope/harness/agent/sandbox/snapshot/RemoteSandboxSnapshot.java:90–97getId
public String getId()
获取标识。
Returns the id.
Stringio/agentscope/harness/agent/sandbox/snapshot/RemoteSandboxSnapshot.java:99–102getType
public String getType()
获取类型。
Returns the type.
Stringio/agentscope/harness/agent/sandbox/snapshot/RemoteSandboxSnapshot.java:104–107