RedissonAgentStateStore
@Deprecated public class RedissonAgentStateStore implements AgentStateStore
io/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:61–407Redisson 智能体状态存储,负责持久化与读取数据。位于 io.agentscope.extensions.redis.state.redisson 包,实现 AgentStateStore。核心成员包括 builder、supportsVersioning、save、getVersioned、saveIfVersion、get。
Redis-based session implementation using Redisson.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
Builder | 类class | `RedissonAgentStateStore`的构建器。 Builder for `RedissonAgentStateStore`. |
方法摘要Method Summary
方法详情Method Detail
builder
public static Builder builder()
创建新的构建器用于RedissonAgentStateStore。
Creates a new builder for RedissonAgentStateStore.
Builderio/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:87–89supportsVersioning
public boolean supportsVersioning()
返回 supportsVersioning 结果。
Returns the supports versioning.
booleanio/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:91–94save
public void save(String userId, String sessionId, String key, State value)
保存数据到持久化存储。
Performs the save operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
key | String | 键(类型 `String`)。The key. |
value | State | 值(类型 `State`)。The value. |
io/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:96–99getVersioned
public T extends State VersionedState<T> getVersioned(String userId, String sessionId, String key, Class<T> type)
获取 getVersioned。
Returns the versioned.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
key | String | 键(类型 `String`)。The key. |
type | Class<T> | 类型(类型 `Class`)。The type. |
VersionedState<T>io/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:101–121saveIfVersion
public long saveIfVersion(String userId, String sessionId, String key, State value, long expectedVersion)
保存If 版本。
Saves the if version.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
key | String | 键(类型 `String`)。The key. |
value | State | 值(类型 `State`)。The value. |
expectedVersion | long | expected 版本(类型 `long`)。The expected version. |
longio/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:123–133save
public void save(String userId, String sessionId, String key, List<? extends State> values)
保存数据到持久化存储。
Performs the save operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
key | String | 键(类型 `String`)。The key. |
values | List<? extends State> | 值(类型 `List`)。The values. |
io/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:163–191get
public T extends State Optional<T> get(String userId, String sessionId, String key, Class<T> type)
按条件读取数据。
Performs the get operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
key | String | 键(类型 `String`)。The key. |
type | Class<T> | 类型(类型 `Class`)。The type. |
Optional<T>io/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:193–210getList
public T extends State List<T> getList(String userId, String sessionId, String key, Class<T> itemType)
获取列表。
Returns the list.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
key | String | 键(类型 `String`)。The key. |
itemType | Class<T> | 条目类型(类型 `Class`)。The item type. |
List<T>io/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:212–234exists
public boolean exists(String userId, String sessionId)
判断数据是否存在。
Performs the exists operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
booleanio/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:236–247delete
public void delete(String userId, String sessionId)
删除数据。
Performs the delete operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
io/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:249–281listSessionIds
public Set<String> listSessionIds(String userId)
列出 listSessionIds。
Lists the session ids.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
Set<String>io/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:283–303close
public void close()
关闭连接并释放相关资源。
Releases resources and connections.
io/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:305–308clearAllSessions
public Mono<Integer> clearAllSessions()
清空所有会话。
Clear all sessions stored in Redis (for testing or cleanup).
Mono<Integer>io/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:328–351嵌套类详情Nested Class Detail
Builder
public static class BuilderRedissonAgentStateStore的构建器。位于 io.agentscope.extensions.redis.state.redisson 包。核心成员包括 keyPrefix、redissonClient、build。
Builder for RedissonAgentStateStore.