JdbcRemoteSnapshotClient
public class JdbcRemoteSnapshotClient implements RemoteSnapshotClient
源码Source
io/agentscope/extensions/jdbc/snapshot/JdbcRemoteSnapshotClient.java:40–133JDBC 远程快照客户端,封装与远端服务的连接和调用。位于 io.agentscope.extensions.jdbc.snapshot 包,实现 RemoteSnapshotClient。核心成员包括 upload、download、exists、JdbcRemoteSnapshotClient。
RemoteSnapshotClient backed by a JDBC BLOB column, with zero inline SQL.
All SQL is sourced from SnapshotDialect, supporting MySQL, PostgreSQL, H2,
and SQLite.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public JdbcRemoteSnapshotClient(DataSource dataSource, SnapshotDialect dialect) | 初始化 `JdbcRemoteSnapshotClient` 实例。 Creates a client with auto table creation. |
public JdbcRemoteSnapshotClient(DataSource dataSource, SnapshotDialect dialect, boolean initializeSchema) | 初始化 `JdbcRemoteSnapshotClient` 实例。 Creates a client with optional auto table creation. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void upload(String snapshotId, InputStream data) throws Exception | 执行上传相关操作。 Performs the upload operation. |
public InputStream download(String snapshotId) throws Exception | 设置下载。 Performs the download operation. |
public boolean exists(String snapshotId) throws Exception | 判断数据是否存在。 Performs the exists operation. |
构造器详情Constructor Detail
JdbcRemoteSnapshotClient
public JdbcRemoteSnapshotClient(DataSource dataSource, SnapshotDialect dialect)
初始化 JdbcRemoteSnapshotClient 实例。
Creates a client with auto table creation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
dataSource | DataSource | JDBC 数据来源。the JDBC data source |
dialect | SnapshotDialect | dialect(类型 `SnapshotDialect`)。the snapshot dialect |
源码Source
io/agentscope/extensions/jdbc/snapshot/JdbcRemoteSnapshotClient.java:51–53JdbcRemoteSnapshotClient
public JdbcRemoteSnapshotClient(DataSource dataSource, SnapshotDialect dialect, boolean initializeSchema)
初始化 JdbcRemoteSnapshotClient 实例。
Creates a client with optional auto table creation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
dataSource | DataSource | JDBC 数据来源。the JDBC data source |
dialect | SnapshotDialect | dialect(类型 `SnapshotDialect`)。the snapshot dialect |
initializeSchema | boolean | 初始化模式(类型 `boolean`)。when true, auto-creates the table |
源码Source
io/agentscope/extensions/jdbc/snapshot/JdbcRemoteSnapshotClient.java:62–69方法详情Method Detail
upload
public void upload(String snapshotId, InputStream data) throws Exception
执行上传相关操作。
Performs the upload operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
snapshotId | String | 快照标识(类型 `String`)。The snapshot id. |
data | InputStream | 数据(类型 `InputStream`)。The data. |
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/extensions/jdbc/snapshot/JdbcRemoteSnapshotClient.java:82–91download
public InputStream download(String snapshotId) throws Exception
设置下载。
Performs the download operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
snapshotId | String | 快照标识(类型 `String`)。The snapshot id. |
InputStream返回InputStream。Returns input stream.
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/extensions/jdbc/snapshot/JdbcRemoteSnapshotClient.java:93–107exists
public boolean exists(String snapshotId) throws Exception
判断数据是否存在。
Performs the exists operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
snapshotId | String | 快照标识(类型 `String`)。The snapshot id. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/extensions/jdbc/snapshot/JdbcRemoteSnapshotClient.java:109–119