From c9f4dee461b9c0d5f0e9d79443bab74770b74cb5 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:54:22 +0600 Subject: [PATCH] Deprecate RedisJSON v1 support (#3503) * Deprecate RedisJSON v1 support * in CommandObjects --- .../redis/clients/jedis/CommandObjects.java | 37 ++++++++++++++++ .../redis/clients/jedis/UnifiedJedis.java | 37 ++++++++++++++++ .../java/redis/clients/jedis/json/Path.java | 4 +- .../java/redis/clients/jedis/json/Path2.java | 2 +- .../json/commands/RedisJsonV1Commands.java | 44 +++++++++++++++++++ .../commands/RedisJsonV1PipelineCommands.java | 39 +++++++++++++++- 6 files changed, 160 insertions(+), 3 deletions(-) diff --git a/src/main/java/redis/clients/jedis/CommandObjects.java b/src/main/java/redis/clients/jedis/CommandObjects.java index 79ec632882..94fed19d57 100644 --- a/src/main/java/redis/clients/jedis/CommandObjects.java +++ b/src/main/java/redis/clients/jedis/CommandObjects.java @@ -3427,11 +3427,13 @@ public final CommandObject jsonSetWithEscape(String key, Path2 path, Obj getJsonObjectMapper().toJson(object)), BuilderFactory.STRING); } + @Deprecated public final CommandObject jsonSet(String key, Path path, Object pojo) { return new CommandObject<>(commandArguments(JsonCommand.SET).key(key).add(path).add( getJsonObjectMapper().toJson(pojo)), BuilderFactory.STRING); } + @Deprecated public final CommandObject jsonSetWithPlainString(String key, Path path, String string) { return new CommandObject<>(commandArguments(JsonCommand.SET).key(key).add(path).add(string), BuilderFactory.STRING); } @@ -3445,6 +3447,7 @@ public final CommandObject jsonSetWithEscape(String key, Path2 path, Obj getJsonObjectMapper().toJson(object)).addParams(params), BuilderFactory.STRING); } + @Deprecated public final CommandObject jsonSet(String key, Path path, Object pojo, JsonSetParams params) { return new CommandObject<>(commandArguments(JsonCommand.SET).key(key).add(path).add( getJsonObjectMapper().toJson(pojo)).addParams(params), BuilderFactory.STRING); @@ -3454,6 +3457,7 @@ public final CommandObject jsonMerge(String key, Path2 path, Object obje return new CommandObject<>(commandArguments(JsonCommand.MERGE).key(key).add(path).add(object), BuilderFactory.STRING); } + @Deprecated public final CommandObject jsonMerge(String key, Path path, Object pojo) { return new CommandObject<>(commandArguments(JsonCommand.MERGE).key(key).add(path).add( getJsonObjectMapper().toJson(pojo)), BuilderFactory.STRING); @@ -3464,6 +3468,7 @@ public final CommandObject jsonGet(String key) { protocol != RedisProtocol.RESP3 ? JSON_GENERIC_OBJECT : JsonBuilderFactory.JSON_OBJECT); } + @Deprecated public final CommandObject jsonGet(String key, Class clazz) { return new CommandObject<>(commandArguments(JsonCommand.GET).key(key), new JsonObjectBuilder<>(clazz)); } @@ -3472,14 +3477,17 @@ public final CommandObject jsonGet(String key, Path2... paths) { return new CommandObject<>(commandArguments(JsonCommand.GET).key(key).addObjects((Object[]) paths), JsonBuilderFactory.JSON_OBJECT); } + @Deprecated public final CommandObject jsonGet(String key, Path... paths) { return new CommandObject<>(commandArguments(JsonCommand.GET).key(key).addObjects((Object[]) paths), JSON_GENERIC_OBJECT); } + @Deprecated public final CommandObject jsonGetAsPlainString(String key, Path path) { return new CommandObject<>(commandArguments(JsonCommand.GET).key(key).add(path), BuilderFactory.STRING); } + @Deprecated public final CommandObject jsonGet(String key, Class clazz, Path... paths) { return new CommandObject<>(commandArguments(JsonCommand.GET).key(key).addObjects((Object[]) paths), new JsonObjectBuilder<>(clazz)); } @@ -3488,6 +3496,7 @@ public final CommandObject> jsonMGet(Path2 path, String... keys) return new CommandObject<>(commandArguments(JsonCommand.MGET).keys((Object[]) keys).add(path), JsonBuilderFactory.JSON_ARRAY_LIST); } + @Deprecated public final CommandObject> jsonMGet(Path path, Class clazz, String... keys) { return new CommandObject<>(commandArguments(JsonCommand.MGET).keys((Object[]) keys).add(path), new JsonObjectListBuilder<>(clazz)); } @@ -3500,6 +3509,7 @@ public final CommandObject jsonDel(String key, Path2 path) { return new CommandObject<>(commandArguments(JsonCommand.DEL).key(key).add(path), BuilderFactory.LONG); } + @Deprecated public final CommandObject jsonDel(String key, Path path) { return new CommandObject<>(commandArguments(JsonCommand.DEL).key(key).add(path), BuilderFactory.LONG); } @@ -3512,6 +3522,7 @@ public final CommandObject jsonClear(String key, Path2 path) { return new CommandObject<>(commandArguments(JsonCommand.CLEAR).key(key).add(path), BuilderFactory.LONG); } + @Deprecated public final CommandObject jsonClear(String key, Path path) { return new CommandObject<>(commandArguments(JsonCommand.CLEAR).key(key).add(path), BuilderFactory.LONG); } @@ -3520,10 +3531,12 @@ public final CommandObject> jsonToggle(String key, Path2 path) { return new CommandObject<>(commandArguments(JsonCommand.TOGGLE).key(key).add(path), BuilderFactory.BOOLEAN_LIST); } + @Deprecated public final CommandObject jsonToggle(String key, Path path) { return new CommandObject<>(commandArguments(JsonCommand.TOGGLE).key(key).add(path), BuilderFactory.STRING); } + @Deprecated public final CommandObject> jsonType(String key) { return new CommandObject<>(commandArguments(JsonCommand.TYPE).key(key), JsonBuilderFactory.JSON_TYPE); } @@ -3533,10 +3546,12 @@ public final CommandObject>> jsonType(String key, Path2 path) { protocol != RedisProtocol.RESP3 ? JsonBuilderFactory.JSON_TYPE_LIST : JsonBuilderFactory.JSON_TYPE_RESPONSE_RESP3_COMPATIBLE); } + @Deprecated public final CommandObject> jsonType(String key, Path path) { return new CommandObject<>(commandArguments(JsonCommand.TYPE).key(key).add(path), JsonBuilderFactory.JSON_TYPE); } + @Deprecated public final CommandObject jsonStrAppend(String key, Object string) { return new CommandObject<>(commandArguments(JsonCommand.STRAPPEND).key(key).add( getJsonObjectMapper().toJson(string)), BuilderFactory.LONG); @@ -3547,11 +3562,13 @@ public final CommandObject> jsonStrAppend(String key, Path2 path, Obj getJsonObjectMapper().toJson(string)), BuilderFactory.LONG_LIST); } + @Deprecated public final CommandObject jsonStrAppend(String key, Path path, Object string) { return new CommandObject<>(commandArguments(JsonCommand.STRAPPEND).key(key).add(path).add( getJsonObjectMapper().toJson(string)), BuilderFactory.LONG); } + @Deprecated public final CommandObject jsonStrLen(String key) { return new CommandObject<>(commandArguments(JsonCommand.STRLEN).key(key), BuilderFactory.LONG); } @@ -3560,6 +3577,7 @@ public final CommandObject> jsonStrLen(String key, Path2 path) { return new CommandObject<>(commandArguments(JsonCommand.STRLEN).key(key).add(path), BuilderFactory.LONG_LIST); } + @Deprecated public final CommandObject jsonStrLen(String key, Path path) { return new CommandObject<>(commandArguments(JsonCommand.STRLEN).key(key).add(path), BuilderFactory.LONG); } @@ -3569,6 +3587,7 @@ public final CommandObject jsonNumIncrBy(String key, Path2 path, double JsonBuilderFactory.JSON_ARRAY_OR_DOUBLE_LIST); } + @Deprecated public final CommandObject jsonNumIncrBy(String key, Path path, double value) { return new CommandObject<>(commandArguments(JsonCommand.NUMINCRBY).key(key).add(path).add(value), BuilderFactory.DOUBLE); } @@ -3594,6 +3613,7 @@ public final CommandObject> jsonArrAppendWithEscape(String key, Path2 return new CommandObject<>(args, BuilderFactory.LONG_LIST); } + @Deprecated public final CommandObject jsonArrAppend(String key, Path path, Object... pojos) { CommandArguments args = commandArguments(JsonCommand.ARRAPPEND).key(key).add(path); for (Object pojo : pojos) { @@ -3611,6 +3631,7 @@ public final CommandObject> jsonArrIndexWithEscape(String key, Path2 getJsonObjectMapper().toJson(scalar)), BuilderFactory.LONG_LIST); } + @Deprecated public final CommandObject jsonArrIndex(String key, Path path, Object scalar) { return new CommandObject<>(commandArguments(JsonCommand.ARRINDEX).key(key).add(path).add( getJsonObjectMapper().toJson(scalar)), BuilderFactory.LONG); @@ -3629,6 +3650,7 @@ public final CommandObject> jsonArrInsertWithEscape(String key, Path2 return new CommandObject<>(args, BuilderFactory.LONG_LIST); } + @Deprecated public final CommandObject jsonArrInsert(String key, Path path, int index, Object... pojos) { CommandArguments args = commandArguments(JsonCommand.ARRINSERT).key(key).add(path).add(index); for (Object pojo : pojos) { @@ -3637,10 +3659,12 @@ public final CommandObject jsonArrInsert(String key, Path path, int index, return new CommandObject<>(args, BuilderFactory.LONG); } + @Deprecated public final CommandObject jsonArrPop(String key) { return new CommandObject<>(commandArguments(JsonCommand.ARRPOP).key(key), new JsonObjectBuilder<>(Object.class)); } + @Deprecated public final CommandObject jsonArrPop(String key, Class clazz) { return new CommandObject<>(commandArguments(JsonCommand.ARRPOP).key(key), new JsonObjectBuilder<>(clazz)); } @@ -3649,10 +3673,12 @@ public final CommandObject> jsonArrPop(String key, Path2 path) { return new CommandObject<>(commandArguments(JsonCommand.ARRPOP).key(key).add(path), new JsonObjectListBuilder<>(Object.class)); } + @Deprecated public final CommandObject jsonArrPop(String key, Path path) { return new CommandObject<>(commandArguments(JsonCommand.ARRPOP).key(key).add(path), new JsonObjectBuilder<>(Object.class)); } + @Deprecated public final CommandObject jsonArrPop(String key, Class clazz, Path path) { return new CommandObject<>(commandArguments(JsonCommand.ARRPOP).key(key).add(path), new JsonObjectBuilder<>(clazz)); } @@ -3661,14 +3687,17 @@ public final CommandObject> jsonArrPop(String key, Path2 path, int return new CommandObject<>(commandArguments(JsonCommand.ARRPOP).key(key).add(path).add(index), new JsonObjectListBuilder<>(Object.class)); } + @Deprecated public final CommandObject jsonArrPop(String key, Path path, int index) { return new CommandObject<>(commandArguments(JsonCommand.ARRPOP).key(key).add(path).add(index), new JsonObjectBuilder<>(Object.class)); } + @Deprecated public final CommandObject jsonArrPop(String key, Class clazz, Path path, int index) { return new CommandObject<>(commandArguments(JsonCommand.ARRPOP).key(key).add(path).add(index), new JsonObjectBuilder<>(clazz)); } + @Deprecated public final CommandObject jsonArrLen(String key) { return new CommandObject<>(commandArguments(JsonCommand.ARRLEN).key(key), BuilderFactory.LONG); } @@ -3677,6 +3706,7 @@ public final CommandObject> jsonArrLen(String key, Path2 path) { return new CommandObject<>(commandArguments(JsonCommand.ARRLEN).key(key).add(path), BuilderFactory.LONG_LIST); } + @Deprecated public final CommandObject jsonArrLen(String key, Path path) { return new CommandObject<>(commandArguments(JsonCommand.ARRLEN).key(key).add(path), BuilderFactory.LONG); } @@ -3685,14 +3715,17 @@ public final CommandObject> jsonArrTrim(String key, Path2 path, int s return new CommandObject<>(commandArguments(JsonCommand.ARRTRIM).key(key).add(path).add(start).add(stop), BuilderFactory.LONG_LIST); } + @Deprecated public final CommandObject jsonArrTrim(String key, Path path, int start, int stop) { return new CommandObject<>(commandArguments(JsonCommand.ARRTRIM).key(key).add(path).add(start).add(stop), BuilderFactory.LONG); } + @Deprecated public final CommandObject jsonObjLen(String key) { return new CommandObject<>(commandArguments(JsonCommand.OBJLEN).key(key), BuilderFactory.LONG); } + @Deprecated public final CommandObject jsonObjLen(String key, Path path) { return new CommandObject<>(commandArguments(JsonCommand.OBJLEN).key(key).add(path), BuilderFactory.LONG); } @@ -3701,10 +3734,12 @@ public final CommandObject> jsonObjLen(String key, Path2 path) { return new CommandObject<>(commandArguments(JsonCommand.OBJLEN).key(key).add(path), BuilderFactory.LONG_LIST); } + @Deprecated public final CommandObject> jsonObjKeys(String key) { return new CommandObject<>(commandArguments(JsonCommand.OBJKEYS).key(key), BuilderFactory.STRING_LIST); } + @Deprecated public final CommandObject> jsonObjKeys(String key, Path path) { return new CommandObject<>(commandArguments(JsonCommand.OBJKEYS).key(key).add(path), BuilderFactory.STRING_LIST); } @@ -3713,10 +3748,12 @@ public final CommandObject>> jsonObjKeys(String key, Path2 pat return new CommandObject<>(commandArguments(JsonCommand.OBJKEYS).key(key).add(path), BuilderFactory.STRING_LIST_LIST); } + @Deprecated public final CommandObject jsonDebugMemory(String key) { return new CommandObject<>(commandArguments(JsonCommand.DEBUG).add("MEMORY").key(key), BuilderFactory.LONG); } + @Deprecated public final CommandObject jsonDebugMemory(String key, Path path) { return new CommandObject<>(commandArguments(JsonCommand.DEBUG).add("MEMORY").key(key).add(path), BuilderFactory.LONG); } diff --git a/src/main/java/redis/clients/jedis/UnifiedJedis.java b/src/main/java/redis/clients/jedis/UnifiedJedis.java index ccfb99461f..b62156cd98 100644 --- a/src/main/java/redis/clients/jedis/UnifiedJedis.java +++ b/src/main/java/redis/clients/jedis/UnifiedJedis.java @@ -3896,11 +3896,13 @@ public String jsonSetWithEscape(String key, Path2 path, Object object) { } @Override + @Deprecated public String jsonSet(String key, Path path, Object pojo) { return executeCommand(commandObjects.jsonSet(key, path, pojo)); } @Override + @Deprecated public String jsonSetWithPlainString(String key, Path path, String string) { return executeCommand(commandObjects.jsonSetWithPlainString(key, path, string)); } @@ -3916,6 +3918,7 @@ public String jsonSetWithEscape(String key, Path2 path, Object pojo, JsonSetPara } @Override + @Deprecated public String jsonSet(String key, Path path, Object pojo, JsonSetParams params) { return executeCommand(commandObjects.jsonSet(key, path, pojo, params)); } @@ -3926,6 +3929,7 @@ public String jsonMerge(String key, Path2 path, Object object) { } @Override + @Deprecated public String jsonMerge(String key, Path path, Object pojo) { return executeCommand(commandObjects.jsonMerge(key, path, pojo)); } @@ -3936,6 +3940,7 @@ public Object jsonGet(String key) { } @Override + @Deprecated public T jsonGet(String key, Class clazz) { return executeCommand(commandObjects.jsonGet(key, clazz)); } @@ -3946,16 +3951,19 @@ public Object jsonGet(String key, Path2... paths) { } @Override + @Deprecated public Object jsonGet(String key, Path... paths) { return executeCommand(commandObjects.jsonGet(key, paths)); } @Override + @Deprecated public String jsonGetAsPlainString(String key, Path path) { return executeCommand(commandObjects.jsonGetAsPlainString(key, path)); } @Override + @Deprecated public T jsonGet(String key, Class clazz, Path... paths) { return executeCommand(commandObjects.jsonGet(key, clazz, paths)); } @@ -3966,6 +3974,7 @@ public List jsonMGet(Path2 path, String... keys) { } @Override + @Deprecated public List jsonMGet(Path path, Class clazz, String... keys) { return executeCommand(commandObjects.jsonMGet(path, clazz, keys)); } @@ -3981,6 +3990,7 @@ public long jsonDel(String key, Path2 path) { } @Override + @Deprecated public long jsonDel(String key, Path path) { return executeCommand(commandObjects.jsonDel(key, path)); } @@ -3996,6 +4006,7 @@ public long jsonClear(String key, Path2 path) { } @Override + @Deprecated public long jsonClear(String key, Path path) { return executeCommand(commandObjects.jsonClear(key, path)); } @@ -4006,11 +4017,13 @@ public List jsonToggle(String key, Path2 path) { } @Override + @Deprecated public String jsonToggle(String key, Path path) { return executeCommand(commandObjects.jsonToggle(key, path)); } @Override + @Deprecated public Class jsonType(String key) { return executeCommand(commandObjects.jsonType(key)); } @@ -4021,11 +4034,13 @@ public List> jsonType(String key, Path2 path) { } @Override + @Deprecated public Class jsonType(String key, Path path) { return executeCommand(commandObjects.jsonType(key, path)); } @Override + @Deprecated public long jsonStrAppend(String key, Object string) { return executeCommand(commandObjects.jsonStrAppend(key, string)); } @@ -4036,11 +4051,13 @@ public List jsonStrAppend(String key, Path2 path, Object string) { } @Override + @Deprecated public long jsonStrAppend(String key, Path path, Object string) { return executeCommand(commandObjects.jsonStrAppend(key, path, string)); } @Override + @Deprecated public Long jsonStrLen(String key) { return executeCommand(commandObjects.jsonStrLen(key)); } @@ -4051,6 +4068,7 @@ public List jsonStrLen(String key, Path2 path) { } @Override + @Deprecated public Long jsonStrLen(String key, Path path) { return executeCommand(commandObjects.jsonStrLen(key, path)); } @@ -4061,6 +4079,7 @@ public Object jsonNumIncrBy(String key, Path2 path, double value) { } @Override + @Deprecated public double jsonNumIncrBy(String key, Path path, double value) { return executeCommand(commandObjects.jsonNumIncrBy(key, path, value)); } @@ -4076,6 +4095,7 @@ public List jsonArrAppendWithEscape(String key, Path2 path, Object... obje } @Override + @Deprecated public Long jsonArrAppend(String key, Path path, Object... pojos) { return executeCommand(commandObjects.jsonArrAppend(key, path, pojos)); } @@ -4091,6 +4111,7 @@ public List jsonArrIndexWithEscape(String key, Path2 path, Object scalar) } @Override + @Deprecated public long jsonArrIndex(String key, Path path, Object scalar) { return executeCommand(commandObjects.jsonArrIndex(key, path, scalar)); } @@ -4106,16 +4127,19 @@ public List jsonArrInsertWithEscape(String key, Path2 path, int index, Obj } @Override + @Deprecated public long jsonArrInsert(String key, Path path, int index, Object... pojos) { return executeCommand(commandObjects.jsonArrInsert(key, path, index, pojos)); } @Override + @Deprecated public Object jsonArrPop(String key) { return executeCommand(commandObjects.jsonArrPop(key)); } @Override + @Deprecated public T jsonArrPop(String key, Class clazz) { return executeCommand(commandObjects.jsonArrPop(key, clazz)); } @@ -4126,11 +4150,13 @@ public List jsonArrPop(String key, Path2 path) { } @Override + @Deprecated public Object jsonArrPop(String key, Path path) { return executeCommand(commandObjects.jsonArrPop(key, path)); } @Override + @Deprecated public T jsonArrPop(String key, Class clazz, Path path) { return executeCommand(commandObjects.jsonArrPop(key, clazz, path)); } @@ -4141,16 +4167,19 @@ public List jsonArrPop(String key, Path2 path, int index) { } @Override + @Deprecated public Object jsonArrPop(String key, Path path, int index) { return executeCommand(commandObjects.jsonArrPop(key, path, index)); } @Override + @Deprecated public T jsonArrPop(String key, Class clazz, Path path, int index) { return executeCommand(commandObjects.jsonArrPop(key, clazz, path, index)); } @Override + @Deprecated public Long jsonArrLen(String key) { return executeCommand(commandObjects.jsonArrLen(key)); } @@ -4161,6 +4190,7 @@ public List jsonArrLen(String key, Path2 path) { } @Override + @Deprecated public Long jsonArrLen(String key, Path path) { return executeCommand(commandObjects.jsonArrLen(key, path)); } @@ -4171,16 +4201,19 @@ public List jsonArrTrim(String key, Path2 path, int start, int stop) { } @Override + @Deprecated public Long jsonArrTrim(String key, Path path, int start, int stop) { return executeCommand(commandObjects.jsonArrTrim(key, path, start, stop)); } @Override + @Deprecated public Long jsonObjLen(String key) { return executeCommand(commandObjects.jsonObjLen(key)); } @Override + @Deprecated public Long jsonObjLen(String key, Path path) { return executeCommand(commandObjects.jsonObjLen(key, path)); } @@ -4191,11 +4224,13 @@ public List jsonObjLen(String key, Path2 path) { } @Override + @Deprecated public List jsonObjKeys(String key) { return executeCommand(commandObjects.jsonObjKeys(key)); } @Override + @Deprecated public List jsonObjKeys(String key, Path path) { return executeCommand(commandObjects.jsonObjKeys(key, path)); } @@ -4206,11 +4241,13 @@ public List> jsonObjKeys(String key, Path2 path) { } @Override + @Deprecated public long jsonDebugMemory(String key) { return executeCommand(commandObjects.jsonDebugMemory(key)); } @Override + @Deprecated public long jsonDebugMemory(String key, Path path) { return executeCommand(commandObjects.jsonDebugMemory(key, path)); } diff --git a/src/main/java/redis/clients/jedis/json/Path.java b/src/main/java/redis/clients/jedis/json/Path.java index e361cab2ea..d225626e89 100644 --- a/src/main/java/redis/clients/jedis/json/Path.java +++ b/src/main/java/redis/clients/jedis/json/Path.java @@ -1,8 +1,10 @@ package redis.clients.jedis.json; /** - * Path is a ReJSON path, representing a valid path into an object + * Path is a RedisJSON (v1) path, representing a valid path into an object. + * @deprecated RedisJSON (v1) support is deprecated. */ +@Deprecated public class Path { public static final Path ROOT_PATH = new Path("."); diff --git a/src/main/java/redis/clients/jedis/json/Path2.java b/src/main/java/redis/clients/jedis/json/Path2.java index 28211bb470..27c2698689 100644 --- a/src/main/java/redis/clients/jedis/json/Path2.java +++ b/src/main/java/redis/clients/jedis/json/Path2.java @@ -1,7 +1,7 @@ package redis.clients.jedis.json; /** - * Path is a ReJSON path, representing a valid path into an object + * Path is a RedisJSON v2 path, representing a valid path or a multi-path into an object. */ public class Path2 { diff --git a/src/main/java/redis/clients/jedis/json/commands/RedisJsonV1Commands.java b/src/main/java/redis/clients/jedis/json/commands/RedisJsonV1Commands.java index 60d3318640..5d7fe0d8e7 100644 --- a/src/main/java/redis/clients/jedis/json/commands/RedisJsonV1Commands.java +++ b/src/main/java/redis/clients/jedis/json/commands/RedisJsonV1Commands.java @@ -4,97 +4,141 @@ import redis.clients.jedis.json.JsonSetParams; import redis.clients.jedis.json.Path; +/** + * @deprecated RedisJSON (v1) support is deprecated. + */ +@Deprecated public interface RedisJsonV1Commands { + @Deprecated default String jsonSetLegacy(String key, Object pojo) { return jsonSet(key, Path.ROOT_PATH, pojo); } + @Deprecated default String jsonSetLegacy(String key, Object pojo, JsonSetParams params) { return jsonSet(key, Path.ROOT_PATH, pojo, params); } + @Deprecated String jsonSet(String key, Path path, Object pojo); + @Deprecated String jsonSetWithPlainString(String key, Path path, String string); + @Deprecated String jsonSet(String key, Path path, Object pojo, JsonSetParams params); + @Deprecated String jsonMerge(String key, Path path, Object pojo); Object jsonGet(String key); // both ver + @Deprecated T jsonGet(String key, Class clazz); + @Deprecated Object jsonGet(String key, Path... paths); + @Deprecated String jsonGetAsPlainString(String key, Path path); + @Deprecated T jsonGet(String key, Class clazz, Path... paths); + @Deprecated default List jsonMGet(Class clazz, String... keys) { return jsonMGet(Path.ROOT_PATH, clazz, keys); } + @Deprecated List jsonMGet(Path path, Class clazz, String... keys); long jsonDel(String key); // both ver + @Deprecated long jsonDel(String key, Path path); long jsonClear(String key); // no test + @Deprecated long jsonClear(String key, Path path); + @Deprecated String jsonToggle(String key, Path path); + @Deprecated Class jsonType(String key); + @Deprecated Class jsonType(String key, Path path); + @Deprecated long jsonStrAppend(String key, Object string); + @Deprecated long jsonStrAppend(String key, Path path, Object string); + @Deprecated Long jsonStrLen(String key); + @Deprecated Long jsonStrLen(String key, Path path); + @Deprecated double jsonNumIncrBy(String key, Path path, double value); + @Deprecated Long jsonArrAppend(String key, Path path, Object... pojos); + @Deprecated long jsonArrIndex(String key, Path path, Object scalar); + @Deprecated long jsonArrInsert(String key, Path path, int index, Object... pojos); + @Deprecated Object jsonArrPop(String key); + @Deprecated T jsonArrPop(String key, Class clazz); + @Deprecated Object jsonArrPop(String key, Path path); + @Deprecated T jsonArrPop(String key, Class clazz, Path path); + @Deprecated Object jsonArrPop(String key, Path path, int index); + @Deprecated T jsonArrPop(String key, Class clazz, Path path, int index); + @Deprecated Long jsonArrLen(String key); + @Deprecated Long jsonArrLen(String key, Path path); + @Deprecated Long jsonArrTrim(String key, Path path, int start, int stop); + @Deprecated Long jsonObjLen(String key); + @Deprecated Long jsonObjLen(String key, Path path); + @Deprecated List jsonObjKeys(String key); + @Deprecated List jsonObjKeys(String key, Path path); + @Deprecated long jsonDebugMemory(String key); + @Deprecated long jsonDebugMemory(String key, Path path); } diff --git a/src/main/java/redis/clients/jedis/json/commands/RedisJsonV1PipelineCommands.java b/src/main/java/redis/clients/jedis/json/commands/RedisJsonV1PipelineCommands.java index 5d0be5bce7..b447a1e508 100644 --- a/src/main/java/redis/clients/jedis/json/commands/RedisJsonV1PipelineCommands.java +++ b/src/main/java/redis/clients/jedis/json/commands/RedisJsonV1PipelineCommands.java @@ -5,81 +5,118 @@ import redis.clients.jedis.json.JsonSetParams; import redis.clients.jedis.json.Path; -public interface RedisJsonV1PipelineCommands extends RedisJsonV2PipelineCommands { +/** + * @deprecated RedisJSON (v1) support is deprecated. + */ +@Deprecated +public interface RedisJsonV1PipelineCommands { + @Deprecated default Response jsonSetLegacy(String key, Object pojo) { return jsonSet(key, Path.ROOT_PATH, pojo); } + @Deprecated default Response jsonSetLegacy(String key, Object pojo, JsonSetParams params) { return jsonSet(key, Path.ROOT_PATH, pojo, params); } + @Deprecated Response jsonSet(String key, Path path, Object pojo); + @Deprecated Response jsonSet(String key, Path path, Object pojo, JsonSetParams params); + @Deprecated Response jsonMerge(String key, Path path, Object pojo); Response jsonGet(String key); // both ver + @Deprecated Response jsonGet(String key, Class clazz); + @Deprecated Response jsonGet(String key, Path... paths); + @Deprecated Response jsonGet(String key, Class clazz, Path... paths); + @Deprecated default Response> jsonMGet(Class clazz, String... keys) { return jsonMGet(Path.ROOT_PATH, clazz, keys); } + @Deprecated Response> jsonMGet(Path path, Class clazz, String... keys); Response jsonDel(String key); // both ver + @Deprecated Response jsonDel(String key, Path path); + @Deprecated Response jsonClear(String key); // no test + @Deprecated Response jsonClear(String key, Path path); + @Deprecated Response jsonToggle(String key, Path path); + @Deprecated Response> jsonType(String key); + @Deprecated Response> jsonType(String key, Path path); + @Deprecated Response jsonStrAppend(String key, Object string); + @Deprecated Response jsonStrAppend(String key, Path path, Object string); + @Deprecated Response jsonStrLen(String key); + @Deprecated Response jsonStrLen(String key, Path path); + @Deprecated Response jsonNumIncrBy(String key, Path path, double value); + @Deprecated Response jsonArrAppend(String key, Path path, Object... pojos); + @Deprecated Response jsonArrIndex(String key, Path path, Object scalar); + @Deprecated Response jsonArrInsert(String key, Path path, int index, Object... pojos); + @Deprecated Response jsonArrPop(String key); + @Deprecated Response jsonArrPop(String key, Class clazz); + @Deprecated Response jsonArrPop(String key, Path path); + @Deprecated Response jsonArrPop(String key, Class clazz, Path path); + @Deprecated Response jsonArrPop(String key, Path path, int index); + @Deprecated Response jsonArrPop(String key, Class clazz, Path path, int index); + @Deprecated Response jsonArrLen(String key); + @Deprecated Response jsonArrLen(String key, Path path); + @Deprecated Response jsonArrTrim(String key, Path path, int start, int stop); }