Class JedisAgentStateStore
java.lang.Object
io.agentscope.extensions.redis.state.jedis.JedisAgentStateStore
- All Implemented Interfaces:
io.agentscope.core.state.AgentStateStore
@Deprecated
public class JedisAgentStateStore
extends Object
implements io.agentscope.core.state.AgentStateStore
Deprecated.
Redis-based session implementation using Jedis.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface io.agentscope.core.state.AgentStateStore
UNVERSIONED -
Method Summary
Modifier and TypeMethodDescriptionstatic JedisAgentStateStore.Builderbuilder()Deprecated.Creates a new builder forJedisAgentStateStore.reactor.core.publisher.Mono<Integer>Deprecated.Clear all sessions stored in Redis (for testing or cleanup).voidclose()Deprecated.voidDeprecated.booleanDeprecated.<T extends io.agentscope.core.state.State>
Optional<T>Deprecated.<T extends io.agentscope.core.state.State>
List<T>Deprecated.<T extends io.agentscope.core.state.State>
io.agentscope.core.state.VersionedState<T>getVersioned(String userId, String sessionId, String key, Class<T> type) Deprecated.listSessionIds(String userId) Deprecated.voidDeprecated.voidsave(String userId, String sessionId, String key, List<? extends io.agentscope.core.state.State> values) Deprecated.Save a list of state values with hash-based change detection.longsaveIfVersion(String userId, String sessionId, String key, io.agentscope.core.state.State value, long expectedVersion) Deprecated.booleanDeprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.agentscope.core.state.AgentStateStore
delete
-
Method Details
-
builder
Deprecated.Creates a new builder forJedisAgentStateStore.- Returns:
- a new Builder instance
-
supportsVersioning
public boolean supportsVersioning()Deprecated.- Specified by:
supportsVersioningin interfaceio.agentscope.core.state.AgentStateStore
-
save
Deprecated.- Specified by:
savein interfaceio.agentscope.core.state.AgentStateStore
-
getVersioned
public <T extends io.agentscope.core.state.State> io.agentscope.core.state.VersionedState<T> getVersioned(String userId, String sessionId, String key, Class<T> type) Deprecated.- Specified by:
getVersionedin interfaceio.agentscope.core.state.AgentStateStore
-
saveIfVersion
public long saveIfVersion(String userId, String sessionId, String key, io.agentscope.core.state.State value, long expectedVersion) Deprecated.- Specified by:
saveIfVersionin interfaceio.agentscope.core.state.AgentStateStore
-
save
public void save(String userId, String sessionId, String key, List<? extends io.agentscope.core.state.State> values) Deprecated.Save a list of state values with hash-based change detection.This method uses hash-based change detection to handle both append-only and mutable lists:
- If the hash changes (list was modified), the Redis list is deleted and recreated
- If the list shrinks, the Redis list is deleted and recreated
- If the list only grows (append-only), only new items are appended
- If nothing changes, the operation is skipped
- Specified by:
savein interfaceio.agentscope.core.state.AgentStateStore- Parameters:
userId- the user identifiersessionId- the session identifierkey- the state key (e.g., "memory_messages")values- the list of state values to save
-
get
public <T extends io.agentscope.core.state.State> Optional<T> get(String userId, String sessionId, String key, Class<T> type) Deprecated.- Specified by:
getin interfaceio.agentscope.core.state.AgentStateStore
-
getList
public <T extends io.agentscope.core.state.State> List<T> getList(String userId, String sessionId, String key, Class<T> itemType) Deprecated.- Specified by:
getListin interfaceio.agentscope.core.state.AgentStateStore
-
exists
Deprecated.- Specified by:
existsin interfaceio.agentscope.core.state.AgentStateStore
-
delete
Deprecated.- Specified by:
deletein interfaceio.agentscope.core.state.AgentStateStore
-
listSessionIds
Deprecated.- Specified by:
listSessionIdsin interfaceio.agentscope.core.state.AgentStateStore
-
close
public void close()Deprecated.- Specified by:
closein interfaceio.agentscope.core.state.AgentStateStore
-
clearAllSessions
Deprecated.Clear all sessions stored in Redis (for testing or cleanup).- Returns:
- Mono that completes with the number of deleted session keys
-
RedisAgentStateStorewith jedisClient instead. RedisAgentStateStore provides a unified session implementation that works with multiple Redis clients. For basic usage, simple constructors are available. For advanced configuration, useRedisAgentStateStore.builder().This implementation stores session state in Redis with the following key structure:
{prefix}{sessionId}:{stateKey}- Redis String containing JSON{prefix}{sessionId}:{stateKey}:list- Redis List containing JSON items{prefix}{sessionId}:_keys- Redis Set tracking all state keys