Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
TypeReference.of(RedisKeyCommands.class), TypeReference.of(RedisStringCommands.class),
TypeReference.of(RedisListCommands.class), TypeReference.of(RedisSetCommands.class),
TypeReference.of(RedisZSetCommands.class), TypeReference.of(RedisHashCommands.class),
TypeReference.of(RedisJsonCommands.class),
TypeReference.of(RedisTxCommands.class), TypeReference.of(RedisPubSubCommands.class),
TypeReference.of(RedisConnectionCommands.class), TypeReference.of(RedisServerCommands.class),
TypeReference.of(RedisStreamCommands.class), TypeReference.of(RedisScriptingCommands.class),
Expand Down Expand Up @@ -172,6 +173,7 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
registerRedisConnectionProxy(TypeReference.of(RedisStreamCommands.class), hints);
registerRedisConnectionProxy(TypeReference.of(RedisStringCommands.class), hints);
registerRedisConnectionProxy(TypeReference.of(RedisZSetCommands.class), hints);
registerRedisConnectionProxy(TypeReference.of(RedisJsonCommands.class), hints);
}

static void boundOperationsProxy(Class<?> type, @Nullable ClassLoader classLoader, RuntimeHints hints) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ public RedisZSetCommands zSetCommands() {
return this;
}

@Override
public RedisJsonCommands jsonCommands() {
return delegate.jsonCommands();
}

@Override
public Long append(byte[] key, byte[] value) {
return convertAndReturn(delegate.append(key, value), Converters.identityConverter());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2071,4 +2071,117 @@ default Long zRangeStoreRevByScore(byte[] dstKey, byte[] srcKey,
return zSetCommands().zRangeStoreRevByScore(dstKey, srcKey, range, limit);
}

// JSON COMMANDS

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default List<@Nullable Long> jsonArrAppend(byte[] key, String path, String... values) {
return jsonCommands().jsonArrAppend(key, path, values);
}

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default List<@Nullable Long> jsonArrIndex(byte[] key, String path, String value) {
return jsonCommands().jsonArrIndex(key, path, value);
}

@Override
@Deprecated
default List<@Nullable Long> jsonArrInsert(byte[] key, String path, int index, String... values) {
return jsonCommands().jsonArrInsert(key, path, index, values);
}

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default List<@Nullable Long> jsonArrLen(byte[] key, String path) {
return jsonCommands().jsonArrLen(key, path);
}

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default List<@Nullable Long> jsonArrTrim(byte[] key, String path, int start, int stop) {
return jsonCommands().jsonArrTrim(key, path, start, stop);
}

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default Long jsonClear(byte[] key, String path) {
return jsonCommands().jsonClear(key, path);
}

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default Long jsonDel(byte[] key, String path) {
return jsonCommands().jsonDel(key, path);
}

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default @Nullable String jsonGet(byte[] key, String... paths) {
return jsonCommands().jsonGet(key, paths);
}

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default Boolean jsonMerge(byte[] key, String path, String value) {
return jsonCommands().jsonMerge(key, path, value);
}

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default List<@Nullable String> jsonMGet(String path, byte[]... keys) {
return jsonCommands().jsonMGet(path, keys);
}

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default List<@Nullable Number> jsonNumIncrBy(byte[] key, String path, Number number) {
return jsonCommands().jsonNumIncrBy(key, path, number);
}

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default Boolean jsonSet(byte[] key, String path, String value, JsonSetOption option) {
return jsonCommands().jsonSet(key, path, value, option);
}

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default List<@Nullable Long> jsonStrAppend(byte[] key, String path, String value) {
return jsonCommands().jsonStrAppend(key, path, value);
}

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default List<@Nullable Long> jsonStrLen(byte[] key, String path) {
return jsonCommands().jsonStrLen(key, path);
}

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default List<@Nullable Boolean> jsonToggle(byte[] key, String path) {
return jsonCommands().jsonToggle(key, path);
}

/** @deprecated in favor of {@link RedisConnection#jsonCommands()}. */
@Override
@Deprecated
default List<@Nullable JsonType> jsonType(byte[] key, String path) {
return jsonCommands().jsonType(key, path);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
@NullUnmarked
public interface RedisCommands extends RedisKeyCommands, RedisStringCommands, RedisListCommands, RedisSetCommands,
RedisZSetCommands, RedisHashCommands, RedisTxCommands, RedisPubSubCommands, RedisConnectionCommands,
RedisServerCommands, RedisStreamCommands, RedisScriptingCommands, RedisGeoCommands, RedisHyperLogLogCommands {
RedisServerCommands, RedisStreamCommands, RedisScriptingCommands, RedisGeoCommands, RedisHyperLogLogCommands,
RedisJsonCommands {

/**
* {@literal Native} or {@literal raw} execution of the given Redis command along with the given arguments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,13 @@ public interface RedisCommandsProvider {
* @since 2.0
*/
RedisZSetCommands zSetCommands();

/**
* Get {@link RedisJsonCommands}.
*
* @return never {@literal null}.
* @since 4.1
*/
RedisJsonCommands jsonCommands();

}
Loading
Loading