AS AgentScopeAPI 手册 / API Reference

CoordLeaseEntityRepository

public interface CoordLeaseEntityRepository extends JpaRepository<CoordLeaseEntity, Long>
源码Source io/agentscope/builder/web/persistence/jpa/CoordLeaseEntityRepository.java:27–59

定义 Coord Lease Entity 仓库契约的接口。位于 io.agentscope.builder.web.persistence.jpa 包,实现 JpaRepository<CoordLeaseEntity, Long>。核心成员包括 findByLeaseKindAndLeaseKey、findByKindAndKeyForUpdate、heartbeatIfOwned、findByLeaseKindAndExpiresAtLessThan、findByLeaseKindAndLeaseKeyStartingWithOrderByAcquiredAtAsc、deleteByKindKeyAndInstance。

An interface in io.agentscope.builder.web.persistence.jpa that defines the contract for components that persists and restores session and memory data across calls. Declared in io.agentscope.builder.web.persistence.jpa. Implements JpaRepository.

方法摘要Method Summary

方法Method说明Description
public Optional<CoordLeaseEntity> findByLeaseKindAndLeaseKey(String leaseKind, String leaseKey)
查找 `findByLeaseKindAndLeaseKey`。
Finds the by lease kind and lease key.
public Optional<CoordLeaseEntity> findByKindAndKeyForUpdate(String kind, String key)
查找通过种类和键用于更新。
Finds the by kind and key for update.
public int heartbeatIfOwned(String kind, String key, String instanceId, long expiresAt)
执行 `heartbeatIfOwned` 方法。
Performs the heartbeat if owned operation.
public List<CoordLeaseEntity> findByLeaseKindAndExpiresAtLessThan(String leaseKind, long expiresAt)
查找 `findByLeaseKindAndExpiresAtLessThan`。
Finds the by lease kind and expires at less than.
public List<CoordLeaseEntity> findByLeaseKindAndLeaseKeyStartingWithOrderByAcquiredAtAsc(String leaseKind, String leaseKeyPrefix)
查找 `findByLeaseKindAndLeaseKeyStartingWithOrderByAcquiredAtAsc`。
Finds the by lease kind and lease key starting with order by acquired at asc.
public int deleteByKindKeyAndInstance(String kind, String key, String instanceId)
删除通过种类键和实例。
Deletes the by kind key and instance.

方法详情Method Detail

findByLeaseKindAndLeaseKey

public Optional<CoordLeaseEntity> findByLeaseKindAndLeaseKey(String leaseKind, String leaseKey)

查找 findByLeaseKindAndLeaseKey。

Finds the by lease kind and lease key.

参数Parameters
名称Name类型Type说明Description
leaseKindStringlease 种类(类型 `String`)。The lease kind.
leaseKeyStringlease 键(类型 `String`)。The lease key.
返回Returns Optional<CoordLeaseEntity>
返回可选。Returns optional.
源码Source io/agentscope/builder/web/persistence/jpa/CoordLeaseEntityRepository.java:29

findByKindAndKeyForUpdate

public Optional<CoordLeaseEntity> findByKindAndKeyForUpdate(String kind, String key)

查找通过种类和键用于更新。

Finds the by kind and key for update.

参数Parameters
名称Name类型Type说明Description
kindString种类(类型 `String`)。The kind.
keyString键(类型 `String`)。The key.
返回Returns Optional<CoordLeaseEntity>
返回可选。Returns optional.
源码Source io/agentscope/builder/web/persistence/jpa/CoordLeaseEntityRepository.java:31–34

heartbeatIfOwned

public int heartbeatIfOwned(String kind, String key, String instanceId, long expiresAt)

执行 heartbeatIfOwned 方法。

Performs the heartbeat if owned operation.

参数Parameters
名称Name类型Type说明Description
kindString种类(类型 `String`)。The kind.
keyString键(类型 `String`)。The key.
instanceIdString实例标识(类型 `String`)。The instance id.
expiresAtlong过期 At(类型 `long`)。The expires at.
返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/builder/web/persistence/jpa/CoordLeaseEntityRepository.java:36–44

findByLeaseKindAndExpiresAtLessThan

public List<CoordLeaseEntity> findByLeaseKindAndExpiresAtLessThan(String leaseKind, long expiresAt)

查找 findByLeaseKindAndExpiresAtLessThan。

Finds the by lease kind and expires at less than.

参数Parameters
名称Name类型Type说明Description
leaseKindStringlease 种类(类型 `String`)。The lease kind.
expiresAtlong过期 At(类型 `long`)。The expires at.
返回Returns List<CoordLeaseEntity>
返回列出。Returns list.
源码Source io/agentscope/builder/web/persistence/jpa/CoordLeaseEntityRepository.java:46

findByLeaseKindAndLeaseKeyStartingWithOrderByAcquiredAtAsc

public List<CoordLeaseEntity> findByLeaseKindAndLeaseKeyStartingWithOrderByAcquiredAtAsc(String leaseKind, String leaseKeyPrefix)

查找 findByLeaseKindAndLeaseKeyStartingWithOrderByAcquiredAtAsc。

Finds the by lease kind and lease key starting with order by acquired at asc.

参数Parameters
名称Name类型Type说明Description
leaseKindStringlease 种类(类型 `String`)。The lease kind.
leaseKeyPrefixStringlease 键 Prefix(类型 `String`)。The lease key prefix.
返回Returns List<CoordLeaseEntity>
返回列出。Returns list.
源码Source io/agentscope/builder/web/persistence/jpa/CoordLeaseEntityRepository.java:48–49

deleteByKindKeyAndInstance

public int deleteByKindKeyAndInstance(String kind, String key, String instanceId)

删除通过种类键和实例。

Deletes the by kind key and instance.

参数Parameters
名称Name类型Type说明Description
kindString种类(类型 `String`)。The kind.
keyString键(类型 `String`)。The key.
instanceIdString实例标识(类型 `String`)。The instance id.
返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/builder/web/persistence/jpa/CoordLeaseEntityRepository.java:51–58
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.