Class JdbcRemoteSnapshotClient

java.lang.Object
io.agentscope.extensions.mysql.snapshot.JdbcRemoteSnapshotClient
All Implemented Interfaces:
io.agentscope.harness.agent.sandbox.snapshot.RemoteSnapshotClient

public class JdbcRemoteSnapshotClient extends Object implements io.agentscope.harness.agent.sandbox.snapshot.RemoteSnapshotClient
RemoteSnapshotClient backed by a JDBC BLOB column.

Stores sandbox workspace tar archives in a database table with columns (snapshot_id VARCHAR PK, data LONGBLOB, created_at TIMESTAMP).

The table is auto-created if it does not exist when initializeSchema is true.

  • Constructor Details

    • JdbcRemoteSnapshotClient

      public JdbcRemoteSnapshotClient(DataSource dataSource, boolean initializeSchema)
    • JdbcRemoteSnapshotClient

      public JdbcRemoteSnapshotClient(DataSource dataSource, String tableName, boolean initializeSchema)
  • Method Details

    • upload

      public void upload(String snapshotId, InputStream data) throws Exception
      Specified by:
      upload in interface io.agentscope.harness.agent.sandbox.snapshot.RemoteSnapshotClient
      Throws:
      Exception
    • download

      public InputStream download(String snapshotId) throws Exception
      Specified by:
      download in interface io.agentscope.harness.agent.sandbox.snapshot.RemoteSnapshotClient
      Throws:
      Exception
    • exists

      public boolean exists(String snapshotId) throws Exception
      Specified by:
      exists in interface io.agentscope.harness.agent.sandbox.snapshot.RemoteSnapshotClient
      Throws:
      Exception